All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
EditionLayer.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/edit/EditionLayer.h
22 
23  \brief This class represents a layer being created from user-edition.
24 */
25 
26 #ifndef __TERRALIB_EDIT_INTERNAL_EDITIONLAYER_H
27 #define __TERRALIB_EDIT_INTERNAL_EDITIONLAYER_H
28 
29 // TerraLib
30 #include "../maptools/AbstractLayer.h"
31 #include "Config.h"
32 
33 namespace te
34 {
35  namespace edit
36  {
37  /*!
38  \class EditionLayer
39 
40  \brief This class represents a layer being created from user-edition.
41  */
43  {
44  public:
45 
46  /*!
47  \brief It initializes a new layer.
48 
49  \param parent The parent layer (NULL if it has no parent).
50  */
52 
53  /*!
54  \brief It initializes a new layer.
55 
56  \param id The layer id.
57  \param parent The parent layer (NULL if it has no parent).
58  */
59  EditionLayer(const std::string& id, te::map::AbstractLayer* parent = 0);
60 
61  /*!
62  \brief It initializes a new Layer.
63 
64  \param id The layer id.
65  \param title The title is a brief description about the layer.
66  \param parent The parent layer (NULL if it has no parent).
67  */
68  EditionLayer(const std::string& id, const std::string& title, te::map::AbstractLayer* parent = 0);
69 
70  /*! \brief Destructor. */
71  ~EditionLayer();
72 
73  std::auto_ptr<te::map::LayerSchema> getSchema() const;
74 
75  void setSchema(te::map::LayerSchema* schema);
76 
77  std::auto_ptr<te::da::DataSet> getData(te::common::TraverseType travType = te::common::FORWARDONLY,
78  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
79 
80  std::auto_ptr<te::da::DataSet> getData(const std::string& propertyName,
81  const te::gm::Envelope* e,
84  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
85 
86  std::auto_ptr<te::da::DataSet> getData(const std::string& propertyName,
87  const te::gm::Geometry* g,
90  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
91 
92  std::auto_ptr<te::da::DataSet> getData(te::da::Expression* restriction,
94  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
95 
96  std::auto_ptr<te::da::DataSet> getData(const te::da::ObjectIdSet* oids,
98  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
99 
100  bool isValid() const;
101 
102  void draw(te::map::Canvas* canvas, const te::gm::Envelope& bbox, int srid);
103 
104  /*!
105  \brief It returns the layer type: EDITIONLAYER.
106 
107  \return The layer type: EDITIONLAYER.
108  */
109  const std::string& getType() const;
110 
111  const std::string& getRendererType() const;
112 
113  void setRendererType(const std::string& t);
114 
115  private:
116 
117  te::map::LayerSchema* m_schema; //!< The layer schema.
118  std::string m_rendererType; //!< A pointer to the internal renderer used to paint this layer.
119  static const std::string sm_type; //!< A static data member used in the implementation of getType method.
120  };
121 
122  typedef boost::intrusive_ptr<EditionLayer> EditionLayerPtr;
123 
124  } // end namespace edit
125 } // end namespace te
126 
127 #endif // __TERRALIB_EDIT_INTERNAL_EDITIONLAYER_H
This is the base class for layers.
Definition: AbstractLayer.h:76
A class that models the description of a dataset.
Definition: DataSetType.h:72
This class represents a layer being created from user-edition.
Definition: EditionLayer.h:42
std::string m_rendererType
A pointer to the internal renderer used to paint this layer.
Definition: EditionLayer.h:118
#define TEEDITEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:67
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:122
boost::intrusive_ptr< EditionLayer > EditionLayerPtr
Definition: EditionLayer.h:122
This is an abstract class that models a query expression.
Definition: Expression.h:47
AccessPolicy
Supported data access policies (can be used as bitfield).
Definition: Enums.h:40
TraverseType
A dataset can be traversed in two ways:
Definition: Enums.h:53
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
This class represents a set of unique ids created in the same context. i.e. from the same data set...
Definition: ObjectIdSet.h:55
static const std::string sm_type
A static data member used in the implementation of getType method.
Definition: EditionLayer.h:119
Configuration flags for the TerraLib Edit module.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:91
te::map::LayerSchema * m_schema
The layer schema.
Definition: EditionLayer.h:117