79 std::list<te::map::AbstractLayerPtr> layers;
81 std::list<te::map::AbstractLayerPtr>::const_iterator it;
83 for(it = m_topLayers.begin(); it != m_topLayers.end(); ++it)
86 layers.push_back(topLevelLayer);
88 if(topLevelLayer->getType() ==
"FOLDERLAYER")
90 std::vector<te::map::AbstractLayer*> children = topLevelLayer->getDescendants();
91 for(std::size_t i = 0; i < children.size(); ++i)
101 std::list<te::map::AbstractLayerPtr> singleLayers;
103 std::list<te::map::AbstractLayerPtr> allLayers = getAllLayers();
105 std::list<te::map::AbstractLayerPtr>::const_iterator it;
107 for(it = allLayers.begin(); it != allLayers.end(); ++it)
111 if(layer->getType() ==
"FOLDERLAYER")
122 std::list<te::map::AbstractLayerPtr> visibleSingleLayers;
124 std::list<te::map::AbstractLayerPtr> singleLayers = getSingleLayers();
126 std::list<te::map::AbstractLayerPtr>::const_iterator it;
127 for(it = singleLayers.begin(); it != singleLayers.end(); ++it)
132 visibleSingleLayers.push_back(singleLayer);
135 return visibleSingleLayers;
141 m_topLayers = layers;
146 return m_selectedLayers;
151 m_selectedLayers.clear();
153 m_selectedLayers = selectedLayers;
159 m_topLayers.push_back(layer);
161 parentLayer->add(layer);
171 m_topLayers.
remove(layer);
173 parentLayer->remove(layer->getIndex());
201 setProjectAsChanged(
true);
const std::string & getFileName() const
It gets the filename where the project is saved.
bool hasChanged()
It informs if the project has changed.
void setSelectedLayers(const std::list< te::map::AbstractLayerPtr > &selectedLayers)
It sets all the layers that are selected.
const std::string & getAuthor() const
It gets the author of the project.
This is the base class for layers.
std::list< te::map::AbstractLayerPtr > getAllLayers()
It gets all the layers (single and folder layers) of the project.
void setProjectAsChanged(const bool &changed)
It sets the project status as changed or not.
void clear()
It clears the project, setting it as having no layers.
std::list< te::map::AbstractLayerPtr > getVisibleSingleLayers()
It gets all the single layers that are visible.
void setTitle(const std::string &title)
It sets the title of the project.
void setFileName(const std::string &fName)
It sets the filename where the project will be saved.
const std::string & getTitle() const
It gets the title of the project.
TreeItemPtr remove(std::size_t i)
It removes the i-th child.
std::list< te::map::AbstractLayerPtr > getSingleLayers()
It gets all the single layers of the project.
void add(const te::map::AbstractLayerPtr &layer, const te::map::AbstractLayerPtr &parentLayer=te::map::AbstractLayerPtr())
It adds the specified layer to the list of layers of the parent layer. If the parent layer is not spe...
const std::list< te::map::AbstractLayerPtr > & getTopLayers() const
It gets all the top layers of the project (folder and single layers).
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
This class models the concept of a project for the TerraLib Application Framework.
void remove(const te::map::AbstractLayerPtr &layer)
It removes the specified layer from the project.
void setTopLayers(const std::list< te::map::AbstractLayerPtr > &layers)
It sets the top layers of the project.
void setAuthor(const std::string &author)
It sets the author of the project.
const std::list< te::map::AbstractLayerPtr > getSelectedLayers() const
It gets all the layers that are selected.