GDAL
|
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve. More...
#include <ogr_geometry.h>
Public Member Functions | |
virtual double | get_Length () const =0 |
Returns the length of the curve. | |
virtual void | StartPoint (OGRPoint *) const =0 |
Return the curve start point. | |
virtual void | EndPoint (OGRPoint *) const =0 |
Return the curve end point. | |
virtual int | get_IsClosed () const |
Return TRUE if curve is closed. | |
virtual void | Value (double, OGRPoint *) const =0 |
Fetch point at given distance along curve. | |
virtual OGRLineString * | CurveToLine (double dfMaxAngleStepSizeDegrees=0, const char *const *papszOptions=NULL) const =0 |
Return a linestring from a curve geometry. | |
virtual int | getDimension () const |
Get the dimension of this object. | |
virtual int | getNumPoints () const =0 |
Return the number of points of a curve geometry. | |
virtual OGRPointIterator * | getPointIterator () const =0 |
Returns a point iterator over the curve. | |
virtual OGRBoolean | IsConvex () const |
Returns if a (closed) curve forms a convex shape. | |
virtual double | get_Area () const =0 |
Get the area of the (closed) curve. | |
Static Public Member Functions | |
static OGRCompoundCurve * | CastToCompoundCurve (OGRCurve *puCurve) |
Cast to compound curve. | |
static OGRLineString * | CastToLineString (OGRCurve *poCurve) |
Cast to linestring. | |
static OGRLinearRing * | CastToLinearRing (OGRCurve *poCurve) |
Cast to linear ring. | |
Protected Member Functions | |
virtual OGRCurveCasterToLineString | GetCasterToLineString () const =0 |
virtual OGRCurveCasterToLinearRing | GetCasterToLinearRing () const =0 |
virtual int | ContainsPoint (const OGRPoint *p) const |
Returns if a point is contained in a (closed) curve. | |
virtual double | get_AreaOfCurveSegments () const =0 |
Get the area of the purely curve portions of a (closed) curve. | |
Friends | |
class | OGRCurvePolygon |
class | OGRCompoundCurve |
Abstract curve base class for OGRLineString, OGRCircularString and OGRCompoundCurve.
OGRCompoundCurve * OGRCurve::CastToCompoundCurve | ( | OGRCurve * | poCurve | ) | [static] |
Cast to compound curve.
The passed in geometry is consumed and a new one returned (or NULL in case of failure)
poCurve | the input geometry - ownership is passed to the method. |
OGRLinearRing * OGRCurve::CastToLinearRing | ( | OGRCurve * | poCurve | ) | [static] |
Cast to linear ring.
The passed in geometry is consumed and a new one returned (or NULL in case of failure)
poCurve | the input geometry - ownership is passed to the method. |
OGRLineString * OGRCurve::CastToLineString | ( | OGRCurve * | poCurve | ) | [static] |
Cast to linestring.
The passed in geometry is consumed and a new one returned (or NULL in case of failure)
poCurve | the input geometry - ownership is passed to the method. |
int OGRCurve::ContainsPoint | ( | const OGRPoint * | p | ) | const [protected, virtual] |
Returns if a point is contained in a (closed) curve.
Final users should use OGRGeometry::Contains() instead.
p | the point to test |
Reimplemented in OGRCircularString.
OGRLineString * OGRCurve::CurveToLine | ( | double | dfMaxAngleStepSizeDegrees = 0 , |
const char *const * | papszOptions = NULL |
||
) | const [pure virtual] |
Return a linestring from a curve geometry.
The returned geometry is a new instance whose ownership belongs to the caller.
If the dfMaxAngleStepSizeDegrees is zero, then a default value will be used. This is currently 4 degrees unless the user has overridden the value with the OGR_ARC_STEPSIZE configuration variable.
This method relates to the ISO SQL/MM Part 3 ICurve::CurveToLine() method.
This function is the same as C function OGR_G_CurveToLine().
dfMaxAngleStepSizeDegrees | the largest step in degrees along the arc, zero to use the default setting. |
papszOptions | options as a null-terminated list of strings or NULL. See OGRGeometryFactory::curveToLineString() for valid options. |
Implemented in OGRCompoundCurve, OGRCircularString, and OGRLineString.
void OGRCurve::EndPoint | ( | OGRPoint * | poPoint | ) | const [pure virtual] |
Return the curve end point.
This method relates to the SF COM ICurve::get_EndPoint() method.
poPoint | the point to be assigned the end location. |
Implemented in OGRCompoundCurve, and OGRSimpleCurve.
double OGRCurve::get_Area | ( | ) | const [pure virtual] |
Get the area of the (closed) curve.
This method is designed to be used by OGRCurvePolygon::get_Area().
Implemented in OGRCompoundCurve, OGRCircularString, and OGRLineString.
double OGRCurve::get_AreaOfCurveSegments | ( | ) | const [protected, pure virtual] |
Get the area of the purely curve portions of a (closed) curve.
This method is designed to be used on a closed convex curve.
Implemented in OGRCompoundCurve, OGRCircularString, and OGRLineString.
int OGRCurve::get_IsClosed | ( | ) | const [virtual] |
Return TRUE if curve is closed.
Tests if a curve is closed. A curve is closed if its start point is equal to its end point.
This method relates to the SFCOM ICurve::get_IsClosed() method.
double OGRCurve::get_Length | ( | ) | const [pure virtual] |
Returns the length of the curve.
This method relates to the SFCOM ICurve::get_Length() method.
Implemented in OGRCompoundCurve, OGRCircularString, and OGRSimpleCurve.
int OGRCurve::getDimension | ( | ) | const [virtual] |
Get the dimension of this object.
This method corresponds to the SFCOM IGeometry::GetDimension() method. It indicates the dimension of the object, but does not indicate the dimension of the underlying space (as indicated by OGRGeometry::getCoordinateDimension()).
This method is the same as the C function OGR_G_GetDimension().
Implements OGRGeometry.
int OGRCurve::getNumPoints | ( | ) | const [pure virtual] |
Return the number of points of a curve geometry.
This method, as a method of OGRCurve, does not relate to a standard. For circular strings or linestrings, it returns the number of points, conforming to SF COM NumPoints(). For compound curves, it returns the sum of the number of points of each of its components (non including intermediate starting/ending points of the different parts).
Implemented in OGRCompoundCurve, and OGRSimpleCurve.
OGRPointIterator * OGRCurve::getPointIterator | ( | ) | const [pure virtual] |
Returns a point iterator over the curve.
The curve must not be modified while an iterator exists on it.
The iterator must be destroyed with OGRPointIterator::destroy().
Implemented in OGRCompoundCurve, and OGRSimpleCurve.
OGRBoolean OGRCurve::IsConvex | ( | ) | const [virtual] |
Returns if a (closed) curve forms a convex shape.
void OGRCurve::StartPoint | ( | OGRPoint * | poPoint | ) | const [pure virtual] |
Return the curve start point.
This method relates to the SF COM ICurve::get_StartPoint() method.
poPoint | the point to be assigned the start location. |
Implemented in OGRCompoundCurve, and OGRSimpleCurve.
void OGRCurve::Value | ( | double | dfDistance, |
OGRPoint * | poPoint | ||
) | const [pure virtual] |
Fetch point at given distance along curve.
This method relates to the SF COM ICurve::get_Value() method.
This function is the same as the C function OGR_G_Value().
dfDistance | distance along the curve at which to sample position. This distance should be between zero and get_Length() for this curve. |
poPoint | the point to be assigned the curve position. |
Implemented in OGRCompoundCurve, OGRCircularString, and OGRSimpleCurve.