All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MultiPolygon.h
Go to the documentation of this file.
1 /* Copyright (C) 2008-2013 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  /** @name Re-Implementation from AbstractData
97  * Methods re-Implementated from AbstractData.
98  */
99  //@{
100 
101  /*!
102  \brief It clones the multi polygon.
103 
104  \return A copy of the given multi polygon.
105 
106  \note The caller of this method will take the ownership of the returned multi polygon.
107 
108  \note The cloned multi polygon will not have the
109  MBR computed. This will save time when you
110  are just cloning a geometry and don't intend
111  to waste time computing the bounding box.
112  If you have another suggestion, please, let me know.
113  */
114  te::dt::AbstractData* clone() const;
115 
116  //@}
117 
118  /** @name Basic methods on geometric objects
119  * Basic methods on geometric objects.
120  */
121  //@{
122 
123  /*!
124  \brief The name of the Geometry subtype is: MultiPolygon.
125 
126  \return The name of the Geometry subtype is: MultiPolygon.
127  */
128  const std::string& getGeometryType() const throw();
129 
130  //@}
131 
132  private:
133 
134  static const std::string sm_typeName; //!< Geometry type name for MultiPolygon.
135  };
136 
137  } // end namespace gm
138 } // end namespace te
139 
140 #endif // __TERRALIB_GEOMETRY_INTERNAL_MULTIPOLYGON_H
141 
MultiSurface is a class that represents a 2-dimensional GeometryCollection whose elements are surface...
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:114
MultiSurface is a class that represents a 2-dimensional GeometryCollection whose elements are surface...
Definition: MultiSurface.h:54
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
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
A base class for values that can be retrieved from the data access module.
Definition: AbstractData.h:57
~MultiPolygon()
Destructor.
Definition: MultiPolygon.h:83
std::string asText() const
It returns an string with the Well-Known Text Representation for the geometry.
Definition: Geometry.cpp:111
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51