FolderLayer.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/maptools/FolderLayer.h
22 
23  \brief A layer that can be used as a container for other kind of layers.
24 */
25 
26 #ifndef __TERRALIB_MAPTOOLS_INTERNAL_FOLDERLAYER_H
27 #define __TERRALIB_MAPTOOLS_INTERNAL_FOLDERLAYER_H
28 
29 // TerraLib
30 #include "AbstractLayer.h"
31 
32 namespace te
33 {
34  namespace map
35  {
36  /*!
37  \class FolderLayer
38 
39  \brief A layer that can be used as a container for other kind of layers.
40 
41  \ingroup map
42 
43  \sa AbstractLayer, QueryLayer, DataSetLayer, RasterLayer
44  */
46  {
47  public:
48 
49  /*!
50  \brief It initializes a new layer.
51 
52  \param parent The parent layer (NULL if it has no parent).
53  */
54  FolderLayer(AbstractLayer* parent = 0);
55 
56  /*!
57  \brief It initializes a new layer.
58 
59  \param id The layer id.
60  \param parent The parent layer (NULL if it has no parent).
61  */
62  FolderLayer(const std::string& id, AbstractLayer* parent = 0);
63 
64  /*!
65  \brief It initializes a new Layer.
66 
67  \param id The layer id.
68  \param title The title is a brief description about the layer.
69  \param parent The parent layer (NULL if it has no parent).
70  */
71  FolderLayer(const std::string& id, const std::string& title, AbstractLayer* parent = 0);
72 
73  /*! \brief Destructor. */
74  ~FolderLayer();
75 
76  void setVisibility(Visibility v);
77 
78  void updateVisibility();
79 
80  std::auto_ptr<LayerSchema> getSchema() const;
81 
82  std::auto_ptr<te::da::DataSet> getData(te::common::TraverseType travType = te::common::FORWARDONLY,
83  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
84 
85  std::auto_ptr<te::da::DataSet> getData(const std::string& propertyName,
86  const te::gm::Envelope* e,
89  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
90 
91  std::auto_ptr<te::da::DataSet> getData(const std::string& propertyName,
92  const te::gm::Geometry* g,
95  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
96 
97  std::auto_ptr<te::da::DataSet> getData(te::da::Expression* restriction,
99  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
100 
101  std::auto_ptr<te::da::DataSet> getData(const te::da::ObjectIdSet* oids,
103  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
104 
105  bool isValid() const;
106 
107  void draw(Canvas* canvas, const te::gm::Envelope& bbox, int srid, const double& scale);
108 
109  /*!
110  \brief It returns the layer type: FOLDERLAYER.
111 
112  \return The layer type: FOLDERLAYER.
113  */
114  const std::string& getType() const;
115 
116  private:
117 
118  static const std::string sm_type; //!< A static data member used in the implementation of getType method.
119  };
120 
121  typedef boost::intrusive_ptr<FolderLayer> FolderLayerPtr;
122 
123  } // end namespace map
124 } // end namespace te
125 
126 #endif // __TERRALIB_MAPTOOLS_INTERNAL_FOLDERLAYER_H
127 
This is the base class for layers.
Definition: AbstractLayer.h:76
This is the base class for Layers.
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:127
A layer that can be used as a container for other kind of layers.
Definition: FolderLayer.h:45
boost::intrusive_ptr< FolderLayer > FolderLayerPtr
Definition: FolderLayer.h:121
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
static const std::string sm_type
A static data member used in the implementation of getType method.
Definition: FolderLayer.h:118
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
URI C++ Library.
#define TEMAPEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
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:92
Visibility
Each layer can have three states of visibility.
Definition: Enums.h:138