All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ObservationDataSetLayer.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2014 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/st/maptools/ObservationDataSetLayer.h
22 
23  \brief A layer with a reference to an ObservationDataSet.
24 */
25 
26 #ifndef __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETLAYER_H
27 #define __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETLAYER_H
28 
29 // ST
30 #include "../Config.h"
31 #include "AbstractSTDataSetLayer.h"
32 
33 namespace te
34 {
35  namespace st
36  {
37 
38  //Forward declarations
40 
42 
43  /*!
44  \class ObservationDataSetLayer
45 
46  \brief A layer with reference to a dataset that contains observations.
47 
48  \sa AbstractLayer, AbstractSTDataSetLayer
49  */
51  {
52  public:
53 
54  /*!
55  \brief It initializes a new layer.
56 
57  \param parent The parent layer (NULL if it has no parent).
58  \param info Infos about the data source and its data set that contains observations.
59 
60  \note It will take the ownership of the given pointer info
61  */
62  ObservationDataSetLayer(AbstractLayer* parent, ObservationDataSetInfo* info);
63 
64  /*!
65  \brief It initializes a new layer.
66 
67  \param id The layer id.
68  \param parent The parent layer (NULL if it has no parent).
69  \param info Infos about the data source and its data set that contains observations.
70 
71  \note It will take the ownership of the given pointer info
72  */
73  ObservationDataSetLayer(const std::string& id, AbstractLayer* parent, ObservationDataSetInfo* info);
74 
75  /*!
76  \brief It initializes a new Layer.
77 
78  \param id The layer id.
79  \param title The title is a brief description about the layer.
80  \param parent The parent layer (NULL if it has no parent).
81  \param info Infos about the data source and its data set that contains observations.
82 
83  \note It will take the ownership of the given pointer info
84  */
85  ObservationDataSetLayer(const std::string& id, const std::string& title, AbstractLayer* parent, ObservationDataSetInfo* info);
86 
87  /*! \brief Destructor. */
89 
90  std::auto_ptr<LayerSchema> getSchema() const;
91 
92  std::auto_ptr<te::da::DataSet> getData(te::common::TraverseType travType = te::common::FORWARDONLY,
93  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
94 
95  std::auto_ptr<te::da::DataSet> getData(const std::string& propertyName,
96  const te::gm::Envelope* e,
99  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
100 
101  std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
105 
106  std::auto_ptr<te::da::DataSet> getData(const std::string& propertyName,
107  const te::gm::Geometry* g,
110  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
111 
112  std::auto_ptr<te::st::ObservationDataSet> getObservationDataset(te::common::TraverseType travType = te::common::FORWARDONLY) const;
113 
114  std::auto_ptr<te::st::ObservationDataSet> getObservationDataset(const te::gm::Envelope& e,
117 
118  std::auto_ptr<te::st::ObservationDataSet> getObservationDataset(const te::gm::Geometry& g,
121 
122  std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
125 
126  std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
130 
131  std::auto_ptr<te::st::ObservationDataSet> getObservationDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
133 
134  std::auto_ptr<te::st::ObservationDataSet> getObservationDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
137 
138  std::auto_ptr<te::st::ObservationDataSet> getObservationDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
141 
142  bool isValid() const;
143 
144  void draw(te::map::Canvas* canvas, const te::gm::Envelope& bbox, int srid);
145 
146  /*!
147  \brief It returns the layer type: DATASET_LAYER.
148 
149  \return The layer type: DATASET_LAYER.
150  */
151  const std::string& getType() const;
152 
153  /*!
154  \brief
155 
156  \return
157  */
158  const std::string& getRendererType() const;
159 
160  /*!
161  \brief
162 
163  \param t
164  */
165  void setRendererType(const std::string& t);
166 
167  private:
168 
169  std::auto_ptr<ObservationDataSetInfo> m_info; //!< Infos about the data source and its data set that contains observations.
170  std::string m_rendererType; //!< A pointer to the internal renderer used to paint this layer.
171  static const std::string sm_type; //!< A static data member used in the implementation of getType method.
172  };
173 
174  typedef boost::intrusive_ptr<ObservationDataSetLayer> ObservationDataSetLayerPtr;
175 
176  } // end namespace st
177 } // end namespace te
178 
179 #endif // __TERRALIB_ST_INTERNAL_OBSERVATIONDATASETLAYER_H
180 
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:90
A layer with reference to a dataset that contains observations.
std::auto_ptr< ObservationDataSetInfo > m_info
Infos about the data source and its data set that contains observations.
A class that contains infos about a DataSet that contains observations.
boost::intrusive_ptr< ObservationDataSetLayer > ObservationDataSetLayerPtr
A class that models the description of a dataset.
Definition: DataSetType.h:72
This file has the AbstractSTDataSetLayer class that provides an abstract interface for layers that co...
TemporalRelation
Temporal relations between date and time (Source: Allen, 1991).
Definition: Enums.h:76
SpatialRelation
Spatial relations between geometric objects.
Definition: Enums.h:122
static const std::string sm_type
A static data member used in the implementation of getType method.
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
A layer with reference to a dataset that contains spatiotemporal data.
te::da::DataSetType LayerSchema
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
std::string m_rendererType
A pointer to the internal renderer used to paint this layer.
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