Represents a lengend in the tree structure. More...
#include <RuleItem.h>
Public Member Functions | |
| void | addChild (TreeItem *item) |
| Adds a child to the item. The child is added to the end of the list. More... | |
| TreeItem * | getChild (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... | |
| QIcon | getIcon () const |
| Returns the image of the style as an icon. More... | |
| TreeItem * | getParent () const |
| Returns the item parent. More... | |
| int | getPosition () |
| Returns the position of item in its parent's list of children. 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... | |
| void | removeAllChilds () |
| Removes all children. More... | |
| TreeItem * | removeChild (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... | |
| void | updateSymbol (const te::se::Rule *rule) |
| updateSymbol More... | |
| void | updateSymbol (const std::vector< te::se::Symbolizer * > &symbolizers) |
Instantiation Methods | |
Methods related to creation and destruction of the object. | |
| RuleItem (te::se::Rule *rule) | |
| Constructor. More... | |
| ~RuleItem () | |
| 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... | |
| VISIBLE | isVisible () const |
| Returns the visibilty state of the item. More... | |
| void | setVisible (const VISIBLE &visible, const bool &updateAncestors=false, const bool &updateDescendents=false) |
| Updates the visibilty state of the item. More... | |
| std::string | getToolTip () const |
| Returns the item tooltip (for information purposes). More... | |
| te::se::Rule * | getRule () |
Protected Attributes | |
| std::unique_ptr< Queue > | m_children |
| Queue of items (children). More... | |
| QIcon | m_icon |
| Item icon. More... | |
| std::string | m_label |
| Label for presenting in the Qt view. More... | |
| TreeItem * | m_parent |
| Pointer to the parent. More... | |
| te::se::Rule * | m_rule |
| Rule being used. More... | |
| std::string | m_type |
| Item type. More... | |
Represents a lengend in the tree structure.
Definition at line 53 of file RuleItem.h.
| te::qt::widgets::RuleItem::RuleItem | ( | te::se::Rule * | rule | ) |
Constructor.
| rule | The Rule that defines the legend item. |
Definition at line 109 of file RuleItem.cpp.
References te::qt::widgets::TreeItem::addChild(), te::se::RasterSymbolizer::getColorMap(), te::se::Rule::getName(), GetRuleIcon(), te::se::Rule::getSymbolizers(), m_icon, m_label, m_rule, and ~RuleItem().
|
default |
Destructor.
Referenced by RuleItem().
|
inherited |
Adds a child to the item. The child is added to the end of the list.
| item | The child to be inserted. |
Definition at line 44 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_children, and te::qt::widgets::TreeItem::setParent().
Referenced by AddRuleItems(), AddSliceItems(), GetFolder(), GetRootFolder(), te::qt::widgets::LayerItem::LayerItem(), RuleItem(), and te::qt::widgets::LayerItem::updateLegend().
|
virtual |
Returns the flags to be used by the model.
Reimplemented from te::qt::widgets::TreeItem.
Definition at line 139 of file RuleItem.cpp.
|
virtual |
Returns the label of the item to be presented in a Qt view.
Implements te::qt::widgets::TreeItem.
Definition at line 134 of file RuleItem.cpp.
References m_label.
|
inherited | ||||||||||||||
Returns the child located at pos.
| pos | The position of the desired child at the children list. |
| If | pos is greater or equal than the children list size, a te::common::Exception will be raised. |
Definition at line 61 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_children.
Referenced by GetAllLayers(), GetVisibility(), GetVisibleLayers(), te::qt::widgets::LayerItemModel::index(), and te::qt::widgets::FolderItem::setVisible().
|
inherited |
Returns all children of a certain type.
| [out] | items | The set of items founded. |
| type | The type of items that we are searching for. |
Definition at line 94 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_children, te::common::NodeT< T >::m_next, and te::common::NodeT< T >::m_value.
Referenced by te::qt::widgets::TreeItem::getChildrenCount(), te::qt::widgets::LayerItem::updateChart(), te::qt::widgets::LayerItemView::updateChart(), te::qt::widgets::LayerItemView::updateLegend(), and te::qt::widgets::LayerItem::~LayerItem().
|
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.
| type | The type of children we want to calculate the number. |
Definition at line 82 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::getChildren(), and te::qt::widgets::TreeItem::m_children.
Referenced by te::qt::widgets::LayerItemModel::addItems(), GetAllLayers(), GetVisibility(), GetVisibleLayers(), te::qt::widgets::TreeItem::hasChildren(), te::qt::widgets::LayerItemModel::index(), te::qt::widgets::LayerItemModel::rowCount(), and te::qt::widgets::FolderItem::setVisible().
| QIcon te::qt::widgets::RuleItem::getIcon | ( | ) | const |
Returns the image of the style as an icon.
Definition at line 144 of file RuleItem.cpp.
References m_icon.
|
inherited |
Returns the item parent.
Definition at line 69 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_parent.
Referenced by te::qt::widgets::LayerItemModel::addItems(), GetAllLayers(), te::qt::widgets::LayerItemView::mouseDoubleClickEvent(), te::qt::af::BaseApplication::onLayerRemoveTriggered(), te::qt::widgets::LayerItemModel::parent(), and te::qt::widgets::LayerItemModel::setData().
|
inherited |
Returns the position of item in its parent's list of children.
Definition at line 115 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_children, and te::qt::widgets::TreeItem::m_parent.
Referenced by te::qt::widgets::LayerItemModel::addItems(), te::qt::widgets::LayerItemModel::parent(), te::qt::widgets::LayerItemView::updateChart(), te::qt::widgets::LayerItem::updateLegend(), and te::qt::widgets::LayerItemView::updateLegend().
| te::se::Rule * te::qt::widgets::RuleItem::getRule | ( | ) |
Definition at line 183 of file RuleItem.cpp.
References m_rule.
|
virtual |
Returns the item tooltip (for information purposes).
Reimplemented from te::qt::widgets::TreeItem.
Definition at line 173 of file RuleItem.cpp.
References te::se::Rule::getDescription(), te::se::Description::getTitle(), and m_rule.
|
inherited |
Returns the type of the item.
Definition at line 129 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_type.
Referenced by te::qt::widgets::LayerViewMenuManager::eventFilter(), Expand(), FindInsertInformation(), te::qt::widgets::LayerItemView::findLayerIndex(), GetAllLayers(), GetAllSTLayers(), GetAllWFSLayers(), GetAllWMSLayers(), GetAvailableLayers(), te::qt::widgets::GetChangedAndVisibleLayers(), te::qt::widgets::LayerViewDelegate::getIcon(), GetParent(), GetSelectedLayer(), GetSelectedLayers(), te::qt::widgets::GetValidLayers(), GetVisibleLayers(), te::qt::widgets::LayerItemView::mouseDoubleClickEvent(), te::qt::af::LayerExplorer::onApplicationTriggered(), TerraView::onLayerDuplicateLayerTriggered(), te::qt::af::BaseApplication::onLayerRenameTriggered(), te::qt::plugins::wfs::WFSItemDelegate::paint(), te::qt::plugins::wms::WMSItemDelegate::paint(), EditDelegate::paint(), te::qt::plugins::st::STItemDelegate::paint(), te::qt::widgets::ThemeViewDelegate::paint(), te::qt::widgets::RasterLayerDelegate::paint(), te::ws::ogc::wms::qt::WMSItemDelegate::paint(), te::qt::widgets::LayerViewDelegate::paint(), and te::qt::widgets::LayerItemModel::setData().
|
inherited |
Tells us if the item has children or not.
Definition at line 110 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::getChildrenCount().
Referenced by te::qt::widgets::LayerItemModel::addLayers().
|
virtualinherited | ||||||||||||||||||||
Inserts a child item at the desired position.
| item | The child to be inserted. |
| pos | The position of the child in the children list. |
| If | pos is greater than the children list size, a te::common::Exception will be raised. |
Reimplemented in te::qt::widgets::FolderItem.
Definition at line 51 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_children.
Referenced by te::qt::widgets::LayerItemModel::addFolder(), te::qt::widgets::LayerItemModel::addItems(), te::qt::widgets::LayerItemModel::addLayer(), te::qt::widgets::LayerItemModel::addLayers(), te::qt::widgets::FolderItem::insertChild(), and te::qt::widgets::LayerItem::updateChart().
|
virtual |
Returns the visibilty state of the item.
Reimplemented from te::qt::widgets::TreeItem.
Definition at line 149 of file RuleItem.cpp.
References te::se::Rule::getMaxScaleDenominator(), m_rule, te::qt::widgets::NONE, and te::qt::widgets::TOTALLY.
|
inherited |
Removes all children.
Definition at line 139 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_children.
Referenced by te::qt::widgets::StyleItem::updateStyle().
|
inherited | ||||||||||||||
Removes the child located at pos from the children list.
| pos | The position of the desired child at the children list. |
| If | pos is greater or equal than the children list size, a te::common::Exception will be raised. |
Definition at line 74 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_children.
Referenced by te::qt::widgets::LayerItemModel::addItems(), and te::qt::widgets::LayerItemModel::removeRows().
|
inherited |
Updates the item parent.
| item | The new parent. |
Definition at line 39 of file qt/widgets/layer/explorer/TreeItem.cpp.
References te::qt::widgets::TreeItem::m_parent.
Referenced by te::qt::widgets::TreeItem::addChild(), and te::qt::widgets::LayerItem::~LayerItem().
|
virtual |
Updates the visibilty state of the item.
| visible | The new visibility state. |
| updateAncestors | Updates also ancestors states. |
| updateDescendents | Updates also descendents states. |
Reimplemented from te::qt::widgets::TreeItem.
Definition at line 159 of file RuleItem.cpp.
References m_rule, te::se::Rule::setMaxScaleDenominator(), te::se::Rule::setMinScaleDenominator(), and te::qt::widgets::TOTALLY.
| void te::qt::widgets::RuleItem::updateSymbol | ( | const te::se::Rule * | rule | ) |
updateSymbol
| symbolizers |
Definition at line 188 of file RuleItem.cpp.
References GetRuleIcon(), and m_icon.
| void te::qt::widgets::RuleItem::updateSymbol | ( | const std::vector< te::se::Symbolizer * > & | symbolizers | ) |
Definition at line 193 of file RuleItem.cpp.
References GetRuleIcon(), and m_icon.
|
protectedinherited |
Queue of items (children).
Definition at line 237 of file qt/widgets/layer/explorer/TreeItem.h.
Referenced by te::qt::widgets::TreeItem::addChild(), te::qt::widgets::TreeItem::getChild(), te::qt::widgets::TreeItem::getChildren(), te::qt::widgets::TreeItem::getChildrenCount(), te::qt::widgets::TreeItem::getPosition(), te::qt::widgets::TreeItem::insertChild(), te::qt::widgets::TreeItem::removeAllChilds(), te::qt::widgets::TreeItem::removeChild(), te::qt::widgets::TreeItem::TreeItem(), and te::qt::widgets::TreeItem::~TreeItem().
|
protected |
Item icon.
Definition at line 113 of file RuleItem.h.
Referenced by getIcon(), RuleItem(), and updateSymbol().
|
protected |
Label for presenting in the Qt view.
Definition at line 112 of file RuleItem.h.
Referenced by getAsString(), and RuleItem().
|
protectedinherited |
Pointer to the parent.
Definition at line 238 of file qt/widgets/layer/explorer/TreeItem.h.
Referenced by te::qt::widgets::TreeItem::getParent(), te::qt::widgets::TreeItem::getPosition(), te::qt::widgets::TreeItem::setParent(), te::qt::widgets::FolderItem::setVisible(), te::qt::widgets::LayerItem::setVisible(), te::qt::widgets::TreeItem::TreeItem(), and te::qt::widgets::ChartItem::~ChartItem().
|
protected |
Rule being used.
Definition at line 114 of file RuleItem.h.
Referenced by getRule(), getToolTip(), isVisible(), RuleItem(), and setVisible().
|
protectedinherited |
Item type.
Definition at line 236 of file qt/widgets/layer/explorer/TreeItem.h.
Referenced by te::qt::widgets::TreeItem::getType().