MultiPolygon.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/geometry/MultiPolygon.h
22 
23  \brief MultiPolygon is a MultiSurface whose elements are Polygons.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_MULTIPOLYGON_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_MULTIPOLYGON_H
28 
29 // TerraLib
30 #include "MultiSurface.h"
31 
32 namespace te
33 {
34  namespace gm
35  {
36  /*!
37  \class MultiPolygon
38 
39  \brief MultiPolygon is a MultiSurface whose elements are Polygons.
40 
41  \ingroup geometry
42 
43  \sa Geometry,
44  Point,
45  Curve, LineString, LinearRing,
46  Surface, Polygon, Triangle, PolyhedralSurface, TIN,
47  GeometryCollection, MultiCurve, MultiSurface,
48  MultiPoint, MultiLineString
49  */
51  {
52  public:
53 
55 
56  //using Geometry::asText;
57 
58  /** @name Initializer methods on geometric objects
59  * Methods for initializing a geometric object.
60  */
61  //@{
62 
63  /*!
64  \brief It initializes the Geometry with the specified spatial reference system id and envelope.
65 
66  \param nGeom The number of geometries in the collection.
67  \param t The internal type of the Geometry.
68  \param srid The Spatial Reference System ID associated to the Geometry.
69  \param mbr The minimum bounding rectangle of this geometry (i.e., its envelope). It may be a NULL value.
70 
71  \note The Geometry will take the ownership of the given mbr.
72  */
73  MultiPolygon(std::size_t nGeom, GeomType t, int srid = 0, Envelope* mbr = 0);
74 
75  /*!
76  \brief Copy constructor.
77 
78  \param rhs The other geometry.
79  */
80  MultiPolygon(const MultiPolygon& rhs);
81 
82  /*! \brief Destructor. */
84 
85  /*!
86  \brief Assignment operator.
87 
88  \param rhs The other geometry.
89 
90  \return A reference for this.
91  */
92  MultiPolygon& operator=(const MultiPolygon& rhs);
93 
94  //@}
95 
96 
97  /** @name Re-Implementation from MultiSurface.
98  * Methods re-Implementated from MultiSurface.
99  */
100  //@{
101 
102  Point* getCentroid() const;
103 
104  Coord2D* getCentroidCoord() const;
105 
106  //@}
107 
108  /** @name Re-Implementation from AbstractData
109  * Methods re-Implementated from AbstractData.
110  */
111  //@{
112 
113  /*!
114  \brief It clones the multi polygon.
115 
116  \return A copy of the given multi polygon.
117 
118  \note The caller of this method will take the ownership of the returned multi polygon.
119 
120  \note The cloned multi polygon will not have the
121  MBR computed. This will save time when you
122  are just cloning a geometry and don't intend
123  to waste time computing the bounding box.
124  If you have another suggestion, please, let me know.
125  */
126  te::dt::AbstractData* clone() const;
127 
128  //@}
129 
130  /** @name Basic methods on geometric objects
131  * Basic methods on geometric objects.
132  */
133  //@{
134 
135  /*!
136  \brief The name of the Geometry subtype is: MultiPolygon.
137 
138  \return The name of the Geometry subtype is: MultiPolygon.
139  */
140  const std::string& getGeometryType() const throw();
141 
142  //@}
143 
144  private:
145 
146  static const std::string sm_typeName; //!< Geometry type name for MultiPolygon.
147  };
148 
149  } // end namespace gm
150 } // end namespace te
151 
152 #endif // __TERRALIB_GEOMETRY_INTERNAL_MULTIPOLYGON_H
153 
MultiPolygon is a MultiSurface whose elements are Polygons.
Definition: MultiPolygon.h:50
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
An utility struct for representing 2D coordinates.
Definition: Coord2D.h:40
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:76
A point with x and y coordinate values.
Definition: Point.h:50
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51
URI C++ Library.
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
MultiSurface is a class that represents a 2-dimensional GeometryCollection whose elements are surface...
Definition: MultiSurface.h:54
~MultiPolygon()
Destructor.
Definition: MultiPolygon.h:83
MultiSurface is a class that represents a 2-dimensional GeometryCollection whose elements are surface...