27 #include "../common/Exception.h"
28 #include "../common/STLUtils.h"
73 if(size < m_polygons.size())
75 std::size_t oldSize = m_polygons.size();
76 for(std::size_t i = size; i < oldSize; ++i)
80 m_polygons.resize(size);
85 assert(i < m_polygons.size());
91 assert((i < m_polygons.size()) && (m_polygons[i] == 0));
113 std::size_t n = m_polygons.size();
115 for(std::size_t i = 0; i < n; ++i)
116 m_polygons[i]->setSRID(srid);
126 std::size_t n = m_polygons.size();
128 for(std::size_t i = 0; i < n; ++i)
129 m_polygons[i]->transform(srid);
144 std::size_t nPols = m_polygons.size();
150 m_polygons[0]->computeMBR(
true);
152 *m_mbr = *(m_polygons[0]->getMBR());
154 for(std::size_t i = 1; i < nPols; ++i)
157 m_polygons[i]->computeMBR(
true);
159 m_mbr->Union(*(m_polygons[i]->getMBR()));
165 std::size_t n = m_polygons.size();
169 for(std::size_t i = 0; i < n; ++i)
170 sum += m_polygons[i]->getNPoints();
PolyhedralSurface is a contiguous collection of polygons, which share common boundary segments...
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
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.
virtual ~PolyhedralSurface()
Virtual destructor.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
virtual const std::string & getGeometryType() const
The name of the geometry subtype for PolyhedralSurface is: PolyhedralSurface.
Polygon * getPatchN(std::size_t i) const
It returns a polygon in this surface, the order is arbitrary.
Polygon is a subclass of CurvePolygon whose rings are defined by linear rings.
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...
MultiPolygon * getBoundingPolygons(const Polygon *p) const
It returns the collection of polygons in this surface that bounds the given polygon "p" for any polyg...
std::size_t getNPoints() const
it returns the number of points (vertexes) in the geometry.
void Clone(const std::vector< T * > &src, std::vector< T * > &dst)
This function can be applied to a vector of pointers.
virtual Surface & operator=(const Surface &rhs)
Assignment operator.
virtual te::dt::AbstractData * clone() const
It clones the linestring.
MultiPolygon is a MultiSurface whose elements are Polygons.
static const std::string sm_typeName
Geometry type name for PolyhedralSurface.
void setPatchN(std::size_t i, Polygon *p)
It sets the informed position polygon to the new one.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
void transform(int srid)
It will transform the coordinates of the Geometry to the new one.
void setNumPatches(std::size_t size)
It sets the number of including polygons.
A base class for values that can be retrieved from the data access module.
PolyhedralSurface is a contiguous collection of polygons, which share common boundary segments...
virtual PolyhedralSurface & operator=(const PolyhedralSurface &rhs)
Assignment operator.
MultiPolygon is a MultiSurface whose elements are Polygons.
An Envelope defines a 2D rectangular region.
double getPerimeter() const
It returns the length of the boundary for the surface.
std::vector< Polygon * > m_polygons
An array with the polygon list.
An Envelope defines a 2D rectangular region.
Surface is an abstract class that represents a 2-dimensional geometric objects.
void makeInvalid()
It will invalidated the envelope.
void setSRID(int srid)
It sets the Spatial Reference System ID of the Geometry and all its parts if it is a GeometryCollecti...
void computeMBR(bool cascade) const
It computes the minimum bounding rectangle for the Geometry.