27 #include "terralib_config.h"
28 #include "../common/STLUtils.h"
29 #include "../common/Translator.h"
30 #include "../srs/Converter.h"
52 :
Curve(t, srid, mbr),
99 #ifdef TERRALIB_MOD_SRS_ENABLED
103 const std::size_t size = m_curves.size();
105 for(std::size_t i = 0; i < size; ++i)
106 m_curves[i]->transform(srid);
113 throw Exception(
TE_TR(
"transform method is not supported!"));
114 #endif // TERRALIB_MOD_SRS_ENABLED
124 const std::size_t nSegs = size();
131 for(std::size_t i = 0; i < nSegs; ++i)
132 m_curves[i]->computeMBR(
true);
135 const Envelope* e = m_curves[0]->getMBR();
137 double minx = e->
m_llx;
138 double miny = e->
m_lly;
139 double maxx = e->
m_urx;
140 double maxy = e->
m_ury;
142 for(std::size_t i = 1; i < nSegs; ++i)
144 e = m_curves[i]->getMBR();
148 if(maxx < e->m_urx) maxx = e->
m_urx;
149 if(maxy < e->m_ury) maxy = e->
m_ury;
206 m_curves.push_back(c);
void computeMBR(bool cascade) const
It computes the minimum bounding rectangle for the compound curve.
void makeInvalid()
It will invalidated the envelope.
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
CompoundCurve & operator=(const CompoundCurve &rhs)
Assignment operator.
Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of co...
bool isClosed() const
It returns true if the curve is closed (startPoint = endPoint).
CompoundCurve is a curve that may have circular and linear segments.
void makeEmpty()
It clears all the segments.
A point with x and y coordinate values.
void add(Curve *c)
It adds the curve to the compound.
double m_urx
Upper right corner x-coordinate.
virtual Curve & operator=(const Curve &rhs)
Assignment operator.
#define TE_TR(message)
It marks a string in order to get translated.
std::vector< Curve * > m_curves
The list of segments of the compund curve.
Point * getStartPoint() const
It returns the curve start point.
const std::string & getGeometryType() const
The name of instantiable subtype is: CompoundCurve.
double m_llx
Lower left corner x-coordinate.
An Envelope defines a 2D rectangular region.
Curve * getCurve(std::size_t i) const
It returns the i-th curve.
te::dt::AbstractData * clone() const
It clones the compound curve.
A point with x and y coordinate values.
An Envelope defines a 2D rectangular region.
CompoundCurve is a curve that may have circular and linear segments.
void transform(int srid)
It converts the coordinate values of the compound curve to the new spatial reference system...
CompoundCurve(GeomType t, int srid=0, Envelope *mbr=0)
It initializes the compound curve with the specified spatial reference system id and envelope...
A base class for values that can be retrieved from the data access module.
double getLength() const
The length of this Curve in its associated spatial reference.
Point * getEndPoint() const
It returns the curve end point.
This class is designed to declare objects to be thrown as exceptions by TerraLib. ...
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
double m_lly
Lower left corner y-coordinate.
An exception class for the Geometry module.
std::size_t getNPoints() const
It returns the number of points (vertexes) in the compound curve.
double m_ury
Upper right corner y-coordinate.
Geometry * locateBetween(const double &mStart, const double &mEnd) const
It returns a derived geometry collection value according to the range of coordinate values inclusivel...
A point with z-coordinate value.
A point with a z-coordinate value and an associated measurement.
void Clone(const std::vector< T * > &src, std::vector< T * > &dst)
This function can be applied to a vector of pointers.
void setSRID(int srid)
It sets the Spatial Reference System ID of the compound curve.
An utility struct for representing 2D coordinates.
A point with an associated measure.
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...
static const std::string sm_typeName
~CompoundCurve()
Virtual destructor.