27 #include "terralib_config.h"
28 #include "../common/STLUtils.h"
29 #include "../common/Translator.h"
75 if(size < m_polygons.size())
77 std::size_t oldSize = m_polygons.size();
78 for(std::size_t i = size; i < oldSize; ++i)
82 m_polygons.resize(size);
87 assert(i < m_polygons.size());
93 assert((i < m_polygons.size()) && (m_polygons[i] == 0));
115 std::size_t n = m_polygons.size();
117 for(std::size_t i = 0; i < n; ++i)
118 m_polygons[i]->setSRID(srid);
125 #ifdef TERRALIB_MOD_SRS_ENABLED
129 std::size_t n = m_polygons.size();
131 for(std::size_t i = 0; i < n; ++i)
132 m_polygons[i]->transform(srid);
139 throw Exception(
TE_TR(
"transform method is not supported!"));
140 #endif // TERRALIB_MOD_SRS_ENABLED
150 std::size_t nPols = m_polygons.size();
156 m_polygons[0]->computeMBR(
true);
158 *m_mbr = *(m_polygons[0]->getMBR());
160 for(std::size_t i = 1; i < nPols; ++i)
163 m_polygons[i]->computeMBR(
true);
165 m_mbr->Union(*(m_polygons[i]->getMBR()));
171 std::size_t n = m_polygons.size();
175 for(std::size_t i = 0; i < n; ++i)
176 sum += m_polygons[i]->getNPoints();
PolyhedralSurface is a contiguous collection of polygons, which share common boundary segments...
MultiPolygon is a MultiSurface whose elements are Polygons.
void makeInvalid()
It will invalidated the envelope.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
static const std::string sm_typeName
Geometry type name for PolyhedralSurface.
double getPerimeter() const
It returns the length of the boundary for the surface.
void setSRID(int srid)
It sets the Spatial Reference System ID of the Geometry and all its parts if it is a GeometryCollecti...
Polygon * getPatchN(std::size_t i) const
It returns a polygon in this surface, the order is arbitrary.
PolyhedralSurface(std::size_t nPolygons, GeomType t, int srid=0, Envelope *mbr=0)
It initializes the Geometry with the specified spatial reference system id and envelope.
void transform(int srid)
It will transform the coordinates of the Geometry to the new one.
#define TE_TR(message)
It marks a string in order to get translated.
PolyhedralSurface is a contiguous collection of polygons, which share common boundary segments...
virtual ~PolyhedralSurface()
Virtual destructor.
An Envelope defines a 2D rectangular region.
An Envelope defines a 2D rectangular region.
std::size_t getNPoints() const
it returns the number of points (vertexes) in the geometry.
virtual const std::string & getGeometryType() const
The name of the geometry subtype for PolyhedralSurface is: PolyhedralSurface.
MultiPolygon is a MultiSurface whose elements are Polygons.
virtual Surface & operator=(const Surface &rhs)
Assignment operator.
A base class for values that can be retrieved from the data access module.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
An exception class for the Geometry module.
void setNumPatches(std::size_t size)
It sets the number of including polygons.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
std::vector< Polygon * > m_polygons
An array with the polygon list.
MultiPolygon * getBoundingPolygons(const Polygon *p) const
It returns the collection of polygons in this surface that bounds the given polygon "p" for any polyg...
virtual te::dt::AbstractData * clone() const
It clones the linestring.
void setPatchN(std::size_t i, Polygon *p)
It sets the informed position polygon to the new one.
void computeMBR(bool cascade) const
It computes the minimum bounding rectangle for the Geometry.
void Clone(const std::vector< T * > &src, std::vector< T * > &dst)
This function can be applied to a vector of pointers.
void FreeContents(boost::unordered_map< K, V * > &m)
This function can be applied to a map of pointers. It will delete each pointer in the map...
virtual PolyhedralSurface & operator=(const PolyhedralSurface &rhs)
Assignment operator.
Surface is an abstract class that represents a 2-dimensional geometric objects.