All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Curve.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/Curve.h
22 
23  \brief Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of coordinates.
24 */
25 
26 #ifndef __TERRALIB_GEOMETRY_INTERNAL_CURVE_H
27 #define __TERRALIB_GEOMETRY_INTERNAL_CURVE_H
28 
29 // TerraLib
30 #include "Geometry.h"
31 
32 namespace te
33 {
34  namespace gm
35  {
36 // Forward declaration
37  class Point;
38 
39  /*!
40  \class Curve
41 
42  \brief Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of coordinates.
43 
44  The OGC SFS specification defines only one subclass of
45  Curve which uses linear interpolation between Points: LineString, Line, LinearRing.
46  The ISO SQL/MM additionaly specifies CircularString and CompoundCurve.
47 
48  \ingroup geometry
49 
50  \sa Geometry,
51  AbstractPoint, Point, PointM, PointZ, PointZM, PointKd,
52  LineString, LinearRing,
53  Surface, Polygon, Triangle, PolyhedralSurface, TIN,
54  GeometryCollection, MultiSurface, MultiCurve,
55  MultiPoint, MultiLineString, MultiPolygon
56  */
57  class TEGEOMEXPORT Curve : public Geometry
58  {
59  public:
60 
62 
63  /** @name Initializer methods on geometric objects
64  * Methods for initializing a geometric object.
65  */
66  //@{
67 
68  /*!
69  \brief It initializes the curve with the specified spatial reference system id and envelope.
70 
71  \param t The internal type of the curve.
72  \param srid The Spatial Reference System ID associated to the curve.
73  \param mbr The minimum bounding rectangle of this geometry (i.e., its envelope). May be a NULL value.
74 
75  \note The curve will take the ownership of the given mbr.
76  */
77  Curve(GeomType t, int srid = 0, Envelope* mbr = 0);
78 
79  /*!
80  \brief Copy constructor.
81 
82  \param rhs The other geometry.
83  */
84  Curve(const Curve& rhs);
85 
86  /*! \brief Virtual destructor. */
87  virtual ~Curve() { }
88 
89  /*!
90  \brief Assignment operator.
91 
92  \param rhs The other geometry.
93 
94  \return A reference for this.
95  */
96  virtual Curve& operator=(const Curve& rhs);
97 
98  //@}
99 
100  /** @name Curve Specific Methods
101  * Specific methods for a Curve.
102  */
103  //@{
104 
105  /*!
106  \brief The length of this curve in the unit associated to its spatial reference system.
107 
108  \return The length of this Curve in the unit associated to its spatial reference system.
109  */
110  virtual double getLength() const = 0;
111 
112  /*!
113  \brief It returns the curve start point.
114 
115  \return The curve start point.
116 
117  \note The caller of this method will take the ownership of the point geometry.
118  */
119  virtual Point* getStartPoint() const = 0;
120 
121  /*!
122  \brief It returns the curve end point.
123 
124  \return The curve end point.
125 
126  \note The caller of this method will take the ownership of the point geometry.
127  */
128  virtual Point* getEndPoint() const = 0;
129 
130  /*!
131  \brief It returns true if the curve is closed (startPoint = endPoint).
132 
133  \return True if the curve is closed (startPoint = endPoint).
134  */
135  virtual bool isClosed() const = 0;
136 
137  /*!
138  \brief It returns true if the curve is closed and simple.
139 
140  \return True if the curve is closed and simple.
141 
142  \warning If you just want to know if the first and last points are the same, call isClosed() it is computationally less intensive.
143  */
144  bool isRing() const;
145 
146  //@}
147 
148  /** @name Re-Implmentation of methods from Geometry class
149  * Re-Implmentation of basic methods from Geometry class.
150  */
151  //@{
152 
153  /*!
154  \brief Curves are 1-dimensional objects.
155 
156  \return 1-dimensional.
157  */
158  Dimensionality getDimension() const throw();
159 
160  //@}
161  };
162 
163  } // end namespace gm
164 } // end namespace te
165 
166 #endif // __TERRALIB_GEOMETRY_INTERNAL_CURVE_H
167 
#define TEGEOMEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:114
#define TE_DEFINE_VISITABLE
Definition: BaseVisitable.h:75
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Curve is an abstract class that represents 1-dimensional geometric objects stored as a sequence of co...
Definition: Curve.h:57
Dimensionality
From Wikipedia: &quot;in mathematics, the dimension of an object is an intrinsic property, independent of the space in which the object may happen to be embedded&quot;.
Definition: Enums.h:142
Geometry is the root class of the geometries hierarchy, it follows OGC and ISO standards.
Definition: Geometry.h:73
A point with x and y coordinate values.
Definition: Point.h:50
virtual ~Curve()
Virtual destructor.
Definition: Curve.h:87
GeomType
Each enumerated type is compatible with a Well-known Binary (WKB) type code.
Definition: Enums.h:41
An Envelope defines a 2D rectangular region.
Definition: Envelope.h:51