27 #include "../dataaccess/dataset/ObjectIdSet.h"
28 #include "../se/Style.h"
29 #include "../srs/Config.h"
35 : te::common::TreeItem(parent),
38 m_visibilityChanged(false),
47 : te::common::TreeItem(parent),
51 m_visibilityChanged(false),
60 const std::string& title,
62 : te::common::TreeItem(parent),
67 m_visibilityChanged(false),
105 std::vector<AbstractLayer*> layers;
106 std::vector<AbstractLayer*> childrenLayers;
108 std::size_t numChildren = getChildrenCount();
109 for(std::size_t i = 0; i < numChildren; ++i)
112 layers.push_back(childLayer);
117 for(std::size_t i = 0; i < childrenLayers.size(); ++i)
118 layers.push_back(childrenLayers[i]);
127 std::vector<AbstractLayer*> layers;
132 layers.push_back(parentLayer);
148 m_visibilityChanged =
false;
152 if(m_visibility != prevVisibility)
153 m_visibilityChanged =
true;
158 return m_visibilityChanged;
163 m_visibilityChanged = visChanged;
171 bool allVisible =
true;
172 bool allNotVisible =
true;
178 std::vector<AbstractLayer*> childrenVec(numChildren);
180 for(
int i = 0; i < numChildren; ++i)
187 allNotVisible =
false;
191 allNotVisible =
false;
199 else if(allNotVisible)
204 if(parentVisibility != prevParentVisibility)
245 if(m_selected->size() == 0)
254 m_selected->Union(oids);
272 if(m_selected->size() == 0)
275 m_selected->difference(oids);
297 m_grouping = grouping;
313 return m_geomPropertyName;
318 m_geomPropertyName = name;
virtual const std::string & getId() const
It returns the layer id.
const TreeItemPtr & getChild(std::size_t i) const
It returns the n-th child.
virtual ~AbstractLayer()
Virtual destructor.
std::size_t getChildrenCount() const
It returns the number of children of this node.
The Style defines the styling that is to be applied to a geographic dataset (vector geometries or cov...
This is the base class for layers.
virtual const te::gm::Envelope & getExtent() const
It returns the Layer extent (or minimum bounding box).
virtual const std::string & getTitle() const
It returns the layer title.
virtual void updateVisibility()
It updates the visibility of this layer.
bool hasChildren() const
It returns true if the item has descendants.
This is the base class for Layers.
bool hasVisibilityChanged()
It gets the flag that indicates if the layer visibility has changed.
virtual void setGrouping(te::map::Grouping *grouping)
It sets the Grouping associated to the Layer.
virtual Visibility getVisibility() const
It returns the layer visibility.
virtual void setTitle(const std::string &title)
It sets the layer title.
virtual te::map::Chart * getChart() const
It returns the Chart associated to the Layer.
virtual void setGeomPropertytName(const std::string &name)
This class contains the parameters needed for grouping the values of a Property.
virtual void setChart(te::map::Chart *chart)
It sets the Chart associated to the Layer.
This class represents the informations needed to build map charts.
An Envelope defines a 2D rectangular region.
#define TE_UNKNOWN_SRS
A numeric value to represent a unknown SRS identification in TerraLib.
This class represents a set of unique ids created in the same context. i.e. from the same data set...
std::vector< te::map::AbstractLayer * > getAncestors()
It returns a list with the ancestors of this layer.
virtual te::se::Style * getStyle() const
It returns the Style associated to the layer.
void updateVisibilityOfAncestors()
It updates the visibility of the ancestors of this layer, if any.
virtual void setVisibility(Visibility v)
It sets the layer visibility.
std::vector< te::map::AbstractLayer * > getDescendants()
It returns a list with the descendants of this layer.
virtual void clearSelected()
It clears the selected group of this Layer.
virtual void setExtent(const te::gm::Envelope &mbr)
It sets the Layer extent (or minimum bounding box).
This class represents the informations needed to build map charts.
virtual void select(te::da::ObjectIdSet *oids)
It adds the given oids to the selected group of this Layer.
virtual const te::da::ObjectIdSet * getSelected() const
It returns the selected group of this Layer.
virtual void setSRID(int srid)
It sets the Spatial Reference System ID associated to the Layer.
virtual te::map::Grouping * getGrouping() const
It returns the Grouping associated to the Layer.
TreeItem * getParent() const
It returns a pointer to the parent of this node.
virtual void setStyle(te::se::Style *style)
It sets the Style associated to the layer.
virtual const std::string & getGeomPropertyName() const
virtual int getSRID() const
It returns the Spatial Reference System ID associated to the Layer.
This class contains the parameters needed for grouping the values of a Property.
AbstractLayer(AbstractLayer *parent=0)
It initializes a new layer.
Visibility
Each layer can have three states of visibility.
Visibility m_visibility
It indicates the layer visibility.
virtual void setId(const std::string &id)
It sets the layer id.
void setVisibilityAsChanged(bool visChanged)
It sets that the status of the layer visibility is to be changed or not..
bool m_visibilityChanged
It indicates if the layer visibility has changed.
virtual void deselect(const te::da::ObjectIdSet *oids)
It removes the given oids from the selected group of this Layer.