All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
te::qt::af::Project Class Reference

This class models the concept of a project for the TerraLib Application Framework. More...

#include <Project.h>

Public Member Functions

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 specified, the layer is added as a top layer of the project. More...
 
void clear ()
 It clears the project, setting it as having no layers. More...
 
std::list
< te::map::AbstractLayerPtr
getAllLayers ()
 It gets all the layers (single and folder layers) of the project. More...
 
const std::string & getAuthor () const
 It gets the author of the project. More...
 
const std::string & getFileName () const
 It gets the filename where the project is saved. More...
 
const std::list
< te::map::AbstractLayerPtr
getSelectedLayers () const
 It gets all the layers that are selected. More...
 
std::list
< te::map::AbstractLayerPtr
getSingleLayers ()
 It gets all the single layers of the project. More...
 
const std::string & getTitle () const
 It gets the title of the project. More...
 
const std::list
< te::map::AbstractLayerPtr > & 
getTopLayers () const
 It gets all the top layers of the project (folder and single layers). More...
 
std::list
< te::map::AbstractLayerPtr > & 
getTopLayers ()
 It gets all the top layers of the project (folder and single layers). More...
 
std::list
< te::map::AbstractLayerPtr
getVisibleSingleLayers ()
 It gets all the single layers that are visible. More...
 
bool hasChanged ()
 It informs if the project has changed. More...
 
 Project ()
 Constructor. More...
 
void remove (const te::map::AbstractLayerPtr &layer)
 It removes the specified layer from the project. More...
 
void setAuthor (const std::string &author)
 It sets the author of the project. More...
 
void setFileName (const std::string &fName)
 It sets the filename where the project will be saved. More...
 
void setProjectAsChanged (const bool &changed)
 It sets the project status as changed or not. More...
 
void setSelectedLayers (const std::list< te::map::AbstractLayerPtr > &selectedLayers)
 It sets all the layers that are selected. More...
 
void setTitle (const std::string &title)
 It sets the title of the project. More...
 
void setTopLayers (const std::list< te::map::AbstractLayerPtr > &layers)
 It sets the top layers of the project. More...
 
 ~Project ()
 Destructor. More...
 

Private Attributes

std::string m_author
 The author of the project. More...
 
bool m_changed
 Flag indicating that the project needs to be saved. More...
 
std::string m_fileName
 The project file. More...
 
std::list
< te::map::AbstractLayerPtr
m_selectedLayers
 The list of selected layers of the project. More...
 
std::string m_title
 The title of the project. More...
 
std::list
< te::map::AbstractLayerPtr
m_topLayers
 The list of top layers of the project. More...
 

Detailed Description

This class models the concept of a project for the TerraLib Application Framework.

Definition at line 50 of file Project.h.

Constructor & Destructor Documentation

te::qt::af::Project::Project ( )

Constructor.

Definition at line 32 of file Project.cpp.

te::qt::af::Project::~Project ( )

Destructor.

Definition at line 40 of file Project.cpp.

Member Function Documentation

void te::qt::af::Project::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 specified, the layer is added as a top layer of the project.

Parameters
layerThe layer that will be added to the list of layers of the project.
parentLayerThe parent layer where the layer will be added.

Definition at line 156 of file Project.cpp.

Referenced by te::qt::af::LayerExplorer::onApplicationTriggered().

void te::qt::af::Project::clear ( )

It clears the project, setting it as having no layers.

Definition at line 198 of file Project.cpp.

std::list< te::map::AbstractLayerPtr > te::qt::af::Project::getAllLayers ( )

It gets all the layers (single and folder layers) of the project.

Returns
The list of all the layers (single and folder layers) of the project.

Definition at line 77 of file Project.cpp.

Referenced by te::qt::plugins::rp::AbstractAction::getLayers(), te::qt::af::BaseApplication::onAddQueryLayerTriggered(), te::qt::af::BaseApplication::onMapRemoveSelectionTriggered(), and te::qt::af::BaseApplication::onToolsDataExchangerDirectTriggered().

const std::string & te::qt::af::Project::getAuthor ( ) const

It gets the author of the project.

Returns
The author of the project.

Definition at line 62 of file Project.cpp.

Referenced by te::qt::af::Save(), and te::qt::af::ProjectInfoWidget::setProject().

const std::string & te::qt::af::Project::getFileName ( ) const

It gets the filename where the project is saved.

Returns
The file name where the project is saved.

Definition at line 188 of file Project.cpp.

Referenced by te::qt::af::ProjectInfoWidget::setProject().

const std::list< te::map::AbstractLayerPtr > te::qt::af::Project::getSelectedLayers ( ) const

It gets all the layers that are selected.

Returns
The list of all the layers that are selected.

Definition at line 144 of file Project.cpp.

Referenced by te::qt::plugins::gdal::Plugin::openFileDialog(), and te::qt::plugins::ogr::Plugin::showWindow().

const std::string & te::qt::af::Project::getTitle ( ) const

It gets the title of the project.

Returns
The title of the project.

Definition at line 51 of file Project.cpp.

Referenced by te::qt::af::Save(), and te::qt::af::ProjectInfoWidget::setProject().

const std::list< te::map::AbstractLayerPtr > & te::qt::af::Project::getTopLayers ( ) const

It gets all the top layers of the project (folder and single layers).

Returns
The list of all the top layers of the project (folder and single layers).

Definition at line 67 of file Project.cpp.

Referenced by te::qt::af::LayerExplorer::onApplicationTriggered(), and te::qt::af::Save().

std::list< te::map::AbstractLayerPtr > & te::qt::af::Project::getTopLayers ( )

It gets all the top layers of the project (folder and single layers).

Returns
The list of all the top layers of the project (folder and single layers).

Definition at line 72 of file Project.cpp.

std::list< te::map::AbstractLayerPtr > te::qt::af::Project::getVisibleSingleLayers ( )

It gets all the single layers that are visible.

Returns
The list of all the single layers that are visible.

Definition at line 120 of file Project.cpp.

References te::map::VISIBLE.

bool te::qt::af::Project::hasChanged ( )

It informs if the project has changed.

Returns
True, if the project has changed; otherwise, it returns false.

Definition at line 178 of file Project.cpp.

void te::qt::af::Project::remove ( const te::map::AbstractLayerPtr layer)

It removes the specified layer from the project.

Parameters
layerThe layer to be removed from the project.

Definition at line 166 of file Project.cpp.

References te::common::TreeItem::remove().

Referenced by te::qt::af::LayerExplorer::onApplicationTriggered().

void te::qt::af::Project::setAuthor ( const std::string &  author)

It sets the author of the project.

Parameters
titleThe author of the project to be set.

Definition at line 56 of file Project.cpp.

void te::qt::af::Project::setFileName ( const std::string &  fName)

It sets the filename where the project will be saved.

Parameters
fNameThe file name where the project will be saved.

Definition at line 183 of file Project.cpp.

Referenced by te::qt::af::ReadProject().

void te::qt::af::Project::setProjectAsChanged ( const bool &  changed)

It sets the project status as changed or not.

Parameters
changedThe flag that specifies if the project is to be set as changed or not.

Definition at line 193 of file Project.cpp.

void te::qt::af::Project::setSelectedLayers ( const std::list< te::map::AbstractLayerPtr > &  selectedLayers)

It sets all the layers that are selected.

Parameters
selectedLayersThe list of all the layers that are selected.

Definition at line 149 of file Project.cpp.

Referenced by te::qt::af::LayerExplorer::onSelectedLayersChanged().

void te::qt::af::Project::setTitle ( const std::string &  title)

It sets the title of the project.

Parameters
titleThe title of the project to be set.

Definition at line 45 of file Project.cpp.

void te::qt::af::Project::setTopLayers ( const std::list< te::map::AbstractLayerPtr > &  layers)

It sets the top layers of the project.

Parameters
layersThe layers that will be set as the top layers of the project.

Definition at line 138 of file Project.cpp.

Referenced by te::qt::af::LayerExplorer::onLayerOrderChanged().

Member Data Documentation

std::string te::qt::af::Project::m_author
private

The author of the project.

Definition at line 197 of file Project.h.

Referenced by te::qt::af::ProjectInfoWidget::setProject().

bool te::qt::af::Project::m_changed
private

Flag indicating that the project needs to be saved.

Definition at line 200 of file Project.h.

std::string te::qt::af::Project::m_fileName
private

The project file.

Definition at line 201 of file Project.h.

std::list<te::map::AbstractLayerPtr> te::qt::af::Project::m_selectedLayers
private

The list of selected layers of the project.

Definition at line 199 of file Project.h.

std::string te::qt::af::Project::m_title
private

The title of the project.

Definition at line 196 of file Project.h.

std::list<te::map::AbstractLayerPtr> te::qt::af::Project::m_topLayers
private

The list of top layers of the project.

Definition at line 198 of file Project.h.


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