te::qt::widgets::ColorMapItem Class Reference

Represents a color map of rastersymbolizer of a layer in a LayerItemModel. More...

#include <ColorMapItem.h>

Inheritance diagram for te::qt::widgets::ColorMapItem:
te::qt::widgets::TreeItem

Public Member Functions

void addChild (TreeItem *item)
 Adds a child to the item. The child is added to the end of the list. More...
 
TreeItemgetChild (const size_t &pos) const throw (te::common::Exception)
 Returns the child located at pos. More...
 
void getChildren (std::vector< TreeItem *> &items, const std::string &type) const
 Returns all children of a certain type. More...
 
size_t getChildrenCount (const std::string &type) const
 Returns the number of children. More...
 
TreeItemgetParent () const
 Returns the item parent. More...
 
int getPosition ()
 Returns the position of item in its parent's list of children. More...
 
virtual std::string getToolTip () const
 Returns the item tooltip (for information purposes). More...
 
std::string getType () const
 Returns the type of the item. More...
 
bool hasChildren () const
 Tells us if the item has children or not. More...
 
virtual void insertChild (TreeItem *item, const size_t &pos) throw (te::common::Exception)
 Inserts a child item at the desired position. More...
 
virtual VISIBLE isVisible () const
 Returns the visibilty state of the item. More...
 
void removeAllChilds ()
 Removes all children. More...
 
TreeItemremoveChild (const size_t &pos) throw (te::common::Exception)
 Removes the child located at pos from the children list. More...
 
void setParent (TreeItem *item)
 Updates the item parent. More...
 
virtual void setVisible (const VISIBLE &visible, const bool &updateAncestors=false, const bool &updateDescendents=false)
 Updates the visibilty state of the item. More...
 
Instantiation Methods

Methods related to creation and destruction of the object.

 ColorMapItem (const te::se::ColorMap *map)
 Constructor. More...
 
 ~ColorMapItem ()
 Destructor. More...
 
Reimplementation of TreeItem

Methods reimplemented of the TreeItem class.

std::string getAsString () const
 Returns the label of the item to be presented in a Qt view. More...
 
Qt::ItemFlags flags ()
 Returns the flags to be used by the model. More...
 

Protected Attributes

std::unique_ptr< Queuem_children
 Queue of items (children). More...
 
const te::se::ColorMapm_colorMap
 ColorMap being used. More...
 
std::string m_label
 Label to be presented on the Qt view. More...
 
TreeItemm_parent
 Pointer to the parent. More...
 
std::string m_type
 Item type. More...
 

Detailed Description

Represents a color map of rastersymbolizer of a layer in a LayerItemModel.

Note
The type of the item is "COLORMAP".

Definition at line 51 of file ColorMapItem.h.

Constructor & Destructor Documentation

◆ ColorMapItem()

te::qt::widgets::ColorMapItem::ColorMapItem ( const te::se::ColorMap map)

Constructor.

Parameters
mapColor map.

◆ ~ColorMapItem()

te::qt::widgets::ColorMapItem::~ColorMapItem ( )

Destructor.

Member Function Documentation

◆ addChild()

void te::qt::widgets::TreeItem::addChild ( TreeItem item)
inherited

Adds a child to the item. The child is added to the end of the list.

Parameters
itemThe child to be inserted.

◆ flags()

Qt::ItemFlags te::qt::widgets::ColorMapItem::flags ( )
virtual

Returns the flags to be used by the model.

Returns
Qt flags. By default itens are enabled, editable and selectable. If you want to change the flags reimplement this method in a subclass.

Reimplemented from te::qt::widgets::TreeItem.

◆ getAsString()

std::string te::qt::widgets::ColorMapItem::getAsString ( ) const
virtual

Returns the label of the item to be presented in a Qt view.

Returns
The item label, to be presented in a Qt view.

Implements te::qt::widgets::TreeItem.

◆ getChild()

TreeItem* te::qt::widgets::TreeItem::getChild ( const size_t &  pos) const
throw (te::common::Exception
)
inherited

Returns the child located at pos.

Parameters
posThe position of the desired child at the children list.
Returns
The child item located at pos.
Exceptions
Ifpos is greater or equal than the children list size, a te::common::Exception will be raised.

◆ getChildren()

void te::qt::widgets::TreeItem::getChildren ( std::vector< TreeItem *> &  items,
const std::string &  type 
) const
inherited

Returns all children of a certain type.

Parameters
[out]itemsThe set of items founded.
typeThe type of items that we are searching for.

◆ getChildrenCount()

size_t te::qt::widgets::TreeItem::getChildrenCount ( const std::string &  type) const
inherited

Returns the number of children.

The type, defines the type of children we want to considere in the operation. If an empty string is given as argument, all kinds of children will be considered.

Parameters
typeThe type of children we want to calculate the number.
Returns
Number of children of type type.

◆ getParent()

TreeItem* te::qt::widgets::TreeItem::getParent ( ) const
inherited

Returns the item parent.

Returns
A pointer to the parent.

◆ getPosition()

int te::qt::widgets::TreeItem::getPosition ( )
inherited

Returns the position of item in its parent's list of children.

Returns
The position of item in its parent's list of children.

◆ getToolTip()

virtual std::string te::qt::widgets::TreeItem::getToolTip ( ) const
virtualinherited

Returns the item tooltip (for information purposes).

Returns
The item tooltip.

Reimplemented in te::qt::widgets::LayerItem, te::qt::widgets::RuleItem, and te::qt::widgets::StyleItem.

◆ getType()

std::string te::qt::widgets::TreeItem::getType ( ) const
inherited

Returns the type of the item.

Returns
Type of the item.

◆ hasChildren()

bool te::qt::widgets::TreeItem::hasChildren ( ) const
inherited

Tells us if the item has children or not.

Returns
True if children list is not empty and false otherwise.

◆ insertChild()

virtual void te::qt::widgets::TreeItem::insertChild ( TreeItem item,
const size_t &  pos 
)
throw (te::common::Exception
)
virtualinherited

Inserts a child item at the desired position.

Parameters
itemThe child to be inserted.
posThe position of the child in the children list.
Exceptions
Ifpos is greater than the children list size, a te::common::Exception will be raised.

Reimplemented in te::qt::widgets::FolderItem.

◆ isVisible()

virtual VISIBLE te::qt::widgets::TreeItem::isVisible ( ) const
virtualinherited

Returns the visibilty state of the item.

Returns
The state of visibilty of the item.

Reimplemented in te::qt::widgets::RuleItem, te::qt::widgets::LayerItem, te::qt::widgets::ChartItem, and te::qt::widgets::FolderItem.

◆ removeAllChilds()

void te::qt::widgets::TreeItem::removeAllChilds ( )
inherited

Removes all children.

◆ removeChild()

TreeItem* te::qt::widgets::TreeItem::removeChild ( const size_t &  pos)
throw (te::common::Exception
)
inherited

Removes the child located at pos from the children list.

Parameters
posThe position of the desired child at the children list.
Returns
The removed item.
Exceptions
Ifpos is greater or equal than the children list size, a te::common::Exception will be raised.

◆ setParent()

void te::qt::widgets::TreeItem::setParent ( TreeItem item)
inherited

Updates the item parent.

Parameters
itemThe new parent.

◆ setVisible()

virtual void te::qt::widgets::TreeItem::setVisible ( const VISIBLE visible,
const bool &  updateAncestors = false,
const bool &  updateDescendents = false 
)
virtualinherited

Updates the visibilty state of the item.

Parameters
visibleThe new visibility state.
updateAncestorsUpdates also ancestors states.
updateDescendentsUpdates also descendents states.

Reimplemented in te::qt::widgets::RuleItem, te::qt::widgets::LayerItem, te::qt::widgets::ChartItem, and te::qt::widgets::FolderItem.

Member Data Documentation

◆ m_children

std::unique_ptr<Queue> te::qt::widgets::TreeItem::m_children
protectedinherited

Queue of items (children).

Definition at line 237 of file TreeItem.h.

◆ m_colorMap

const te::se::ColorMap* te::qt::widgets::ColorMapItem::m_colorMap
protected

ColorMap being used.

Definition at line 88 of file ColorMapItem.h.

◆ m_label

std::string te::qt::widgets::ColorMapItem::m_label
protected

Label to be presented on the Qt view.

Definition at line 87 of file ColorMapItem.h.

◆ m_parent

TreeItem* te::qt::widgets::TreeItem::m_parent
protectedinherited

Pointer to the parent.

Definition at line 238 of file TreeItem.h.

◆ m_type

std::string te::qt::widgets::TreeItem::m_type
protectedinherited

Item type.

Definition at line 236 of file TreeItem.h.


The documentation for this class was generated from the following file: