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