All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TrajectoryDataSetLayer.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/TrajectoryDataSetLayer.h
22 
23  \brief A layer with a reference to an TrajectoryDataSet.
24 */
25 
26 #ifndef __TERRALIB_ST_INTERNAL_TRAJECTORYDATASETLAYER_H
27 #define __TERRALIB_ST_INTERNAL_TRAJECTORYDATASETLAYER_H
28 
29 // ST
30 #include "../Config.h"
31 #include "AbstractSTDataSetLayer.h"
32 
33 // Boost
34 #include <boost/ptr_container/ptr_vector.hpp>
35 
36 namespace te
37 {
38  namespace st
39  {
40 
41  //Forward declarations
42  class TrajectoryDataSet;
43  class TrajectoryDataSetInfo;
44 
46 
47  /*!
48  \class TrajectoryDataSetLayer
49 
50  \brief A layer with reference to a dataset that contains trajectories.
51 
52  \sa AbstractLayer, AbstractSTDataSetLayer
53  */
55  {
56  public:
57 
58  /*!
59  \brief It initializes a new layer.
60 
61  \param parent The parent layer (NULL if it has no parent).
62  \param info Infos about the data source and its data set that contains observations.
63 
64  \note It will take the ownership of the given pointer info
65  */
66  TrajectoryDataSetLayer(AbstractLayer* parent, TrajectoryDataSetInfo* info);
67 
68  /*!
69  \brief It initializes a new layer.
70 
71  \param id The layer id.
72  \param parent The parent layer (NULL if it has no parent).
73  \param info Infos about the data source and its data set that contains observations.
74 
75  \note It will take the ownership of the given pointer info
76  */
77  TrajectoryDataSetLayer(const std::string& id, AbstractLayer* parent, TrajectoryDataSetInfo* info);
78 
79  /*!
80  \brief It initializes a new Layer.
81 
82  \param id The layer id.
83  \param title The title is a brief description about the layer.
84  \param parent The parent layer (NULL if it has no parent).
85  \param info Infos about the data source and its data set that contains observations.
86 
87  \note It will take the ownership of the given pointer info
88  */
89  TrajectoryDataSetLayer(const std::string& id, const std::string& title, AbstractLayer* parent, TrajectoryDataSetInfo* info);
90 
91  /*! \brief Destructor. */
93 
94  std::auto_ptr<LayerSchema> getSchema() const;
95 
96  /*!
97  \brief It returns the layer temporal extent.
98 
99  \return The layer temporal extent.
100  */
101  te::dt::DateTimePeriod* getTemporalExtent() const;
102 
103  std::auto_ptr<te::da::DataSet> getData(te::common::TraverseType travType = te::common::FORWARDONLY,
104  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
105 
106  std::auto_ptr<te::da::DataSet> getData(const std::string& propertyName,
107  const te::gm::Envelope* e,
110  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
111 
112  std::auto_ptr<te::da::DataSet> getData(const std::string& propertyName,
113  const te::gm::Geometry* g,
116  const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
117 
118  //std::auto_ptr<te::da::DataSet> getData(te::da::Expression* restriction,
119  // te::common::TraverseType travType = te::common::FORWARDONLY,
120  // const te::common::AccessPolicy accessPolicy = te::common::RAccess) const;
121 
122  std::auto_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset(te::common::TraverseType travType = te::common::FORWARDONLY) const;
123 
124  std::auto_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset(const te::gm::Envelope& e,
127 
128  std::auto_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset(const te::gm::Geometry& g,
131 
132  std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
135 
136  std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
140 
141  std::auto_ptr<te::da::DataSet> getData( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
145 
146  std::auto_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation r = te::dt::DURING,
148 
149  std::auto_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
152 
153  std::auto_ptr<te::st::TrajectoryDataSet> getTrajectoryDataset( const te::dt::DateTime& dt, te::dt::TemporalRelation tr,
156 
157  bool isValid() const;
158 
159  void draw(te::map::Canvas* canvas, const te::gm::Envelope& bbox, int srid);
160 
161  /*!
162  \brief It returns the layer type: DATASET_LAYER.
163 
164  \return The layer type: DATASET_LAYER.
165  */
166  const std::string& getType() const;
167 
168  /*!
169  \brief
170 
171  \return
172  */
173  const std::string& getRendererType() const;
174 
175  /*!
176  \brief
177 
178  \param t
179  */
180  void setRendererType(const std::string& t);
181 
182  /*!
183  \brief Checks if the layer has any childs
184 
185  \return true if the layer has any childs, otherwise returns false
186  */
187 
188  bool hasChilds();
189 
190  private:
191 
192  boost::ptr_vector<TrajectoryDataSetLayer> m_layers; //!, A container the holds any child layers.
193  std::auto_ptr<TrajectoryDataSetInfo> m_info; //!< Infos about the data source and its data set that contains observations.
194  std::string m_rendererType; //!< A pointer to the internal renderer used to paint this layer.
195  static const std::string sm_type; //!< A static data member used in the implementation of getType method.
196  };
197 
198  typedef boost::intrusive_ptr<TrajectoryDataSetLayer> TrajectoryDataSetLayerPtr;
199 
200  } // end namespace st
201 } // end namespace te
202 
203 #endif // __TERRALIB_ST_INTERNAL_TRAJECTORYDATASETLAYER_H
#define TESTEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:90
std::string m_rendererType
A pointer to the internal renderer used to paint this layer.
boost::intrusive_ptr< TrajectoryDataSetLayer > TrajectoryDataSetLayerPtr
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
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
static const std::string sm_type
A static data member used in the implementation of getType method.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
std::auto_ptr< TrajectoryDataSetInfo > m_info
, A container the holds any child layers.
A class that contains infos about a DataSet that contains observations of one or more trajectories...
A canvas is an abstraction of a drawing area.
Definition: Canvas.h:91
An abstract class to represent a period of date and time.
A layer with reference to a dataset that contains trajectories.
boost::ptr_vector< TrajectoryDataSetLayer > m_layers