Feature.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/Feature.h
22 
23  \brief This class represents a geographic feature.
24 */
25 
26 #ifndef __TERRALIB_EDIT_INTERNAL_FEATURE_H
27 #define __TERRALIB_EDIT_INTERNAL_FEATURE_H
28 
29 // TerraLib
30 #include "Config.h"
31 #include "Utils.h"
32 
33 // STL
34 #include <map>
35 
36 namespace te
37 {
38 // Forward declarations
39  namespace da
40  {
41  class ObjectId;
42  }
43 
44  namespace dt
45  {
46  class AbstractData;
47  }
48 
49  namespace gm
50  {
51  class Geometry;
52  }
53 
54  namespace edit
55  {
57  {
58  public:
59 
60  Feature();
61 
63 
65 
66  ~Feature();
67 
68  void set(te::da::ObjectId* id, te::gm::Geometry* geom, te::edit::FeatureType type);
69 
70  void setId(te::da::ObjectId* id);
71 
72  void setGeometry(te::gm::Geometry* geom);
73 
74  void setData(const std::map<std::size_t, te::dt::AbstractData*>& data);
75 
76  void setType(te::edit::FeatureType type);
77 
78  void setCoords(std::vector<te::gm::Coord2D> coords);
79 
80  void setFillColor(const te::color::RGBAColor& fillColor);
81 
82  void setContourColor(const te::color::RGBAColor& contourColor);
83 
84  te::da::ObjectId* getId() const;
85 
86  te::gm::Geometry* getGeometry() const;
87 
88  const std::map<std::size_t, te::dt::AbstractData*>& getData() const;
89 
90  FeatureType getType() const;
91 
92  std::vector<te::gm::Coord2D> getCoords() const;
93 
94  te::color::RGBAColor getFillColor() const;
95 
96  te::color::RGBAColor getContourColor() const;
97 
98  bool isColorChanged();
99 
100  bool isEquals(te::da::ObjectId* id);
101 
102  Feature* clone() const;
103 
104  private:
105 
108  std::map<std::size_t, te::dt::AbstractData*> m_data;
110  std::vector<te::gm::Coord2D> m_coords;
111 
115 
116  };
117 
118  } // end namespace edit
119 } // end namespace te
120 
121 #endif // __TERRALIB_EDIT_INTERNAL_FEATURE_H
FeatureType
Defines the feature type(Add, Update, Delete ...).
Definition: Utils.h:89
te::gm::Geometry * m_geom
Definition: Feature.h:107
#define TEEDITEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:68
te::edit::FeatureType m_type
Definition: Feature.h:109
std::map< std::size_t, te::dt::AbstractData * > m_data
Definition: Feature.h:108
te::color::RGBAColor m_fillColor
Definition: Feature.h:112
bool m_colorChanged
Definition: Feature.h:114
This class represents an unique id for a data set element.
Definition: ObjectId.h:47
URI C++ Library.
Configuration flags for the TerraLib Edit module.
Utility functions for TerraLib Edit module.
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:74
A helper class for 32-bit RGBA (Red-Green-Blue-Alpha channel) color.
Definition: RGBAColor.h:57
te::da::ObjectId * m_id
Definition: Feature.h:106
te::color::RGBAColor m_contourColor
Definition: Feature.h:113
std::vector< te::gm::Coord2D > m_coords
Definition: Feature.h:110