GDAL
Public Member Functions
OGRTriangle Class Reference

Triangle class. More...

#include <ogr_geometry.h>

Inheritance diagram for OGRTriangle:
OGRPolygon OGRCurvePolygon OGRSurface OGRGeometry

List of all members.

Public Member Functions

 OGRTriangle ()
 Constructor.
 OGRTriangle (const OGRPoint &p, const OGRPoint &q, const OGRPoint &r)
 Construct a triangle from points.
 OGRTriangle (const OGRTriangle &other)
 Copy constructor.
 OGRTriangle (const OGRPolygon &other, OGRErr &eErr)
 Constructs an OGRTriangle from a valid OGRPolygon.
OGRTriangleoperator= (const OGRTriangle &other)
 Assignment operator.
virtual ~OGRTriangle ()
 Destructor.
virtual const char * getGeometryName () const CPL_OVERRIDE
 Fetch WKT name for geometry type.
virtual OGRwkbGeometryType getGeometryType () const CPL_OVERRIDE
 Fetch geometry type.
virtual OGRErr importFromWkb (unsigned char *, int=-1, OGRwkbVariant=wkbVariantOldOgc) CPL_OVERRIDE
 Assign geometry from well known binary data.
virtual OGRErr addRingDirectly (OGRCurve *poNewRing) CPL_OVERRIDE
 Add a ring to a polygon.

Detailed Description

Triangle class.

Since:
GDAL 2.2

Constructor & Destructor Documentation

OGRTriangle::OGRTriangle ( const OGRPoint p,
const OGRPoint q,
const OGRPoint r 
)

Construct a triangle from points.

Parameters:
pPoint 1
qPoint 2
rPoint 3
OGRTriangle::OGRTriangle ( const OGRPolygon other,
OGRErr eErr 
)

Constructs an OGRTriangle from a valid OGRPolygon.

In case of error, NULL is returned.

Parameters:
otherthe Polygon we wish to construct a triangle from
eErrencapsulates an error code; contains OGRERR_NONE if the triangle is constructed successfully

Destructor.


Member Function Documentation

OGRErr OGRTriangle::addRingDirectly ( OGRCurve poNewRing) [virtual]

Add a ring to a polygon.

If the polygon has no external ring (it is empty) this will be used as the external ring, otherwise it is used as an internal ring. Ownership of the passed ring is assumed by the OGRCurvePolygon, but otherwise this method operates the same as OGRCurvePolygon::AddRing().

This method has no SFCOM analog.

Parameters:
poNewRingring to be added to the polygon.
Returns:
OGRERR_NONE in case of success

Reimplemented from OGRCurvePolygon.

const char * OGRTriangle::getGeometryName ( ) const [virtual]

Fetch WKT name for geometry type.

There is no SFCOM analog to this method.

This method is the same as the C function OGR_G_GetGeometryName().

Returns:
name used for this geometry type in well known text format. The returned pointer is to a static internal string and should not be modified or freed.

Reimplemented from OGRPolygon.

Fetch geometry type.

Note that the geometry type may include the 2.5D flag. To get a 2D flattened version of the geometry type apply the wkbFlatten() macro to the return result.

This method is the same as the C function OGR_G_GetGeometryType().

Returns:
the geometry type code.

Reimplemented from OGRPolygon.

OGRErr OGRTriangle::importFromWkb ( unsigned char *  pabyData,
int  nSize = -1,
OGRwkbVariant  eWkbVariant = wkbVariantOldOgc 
) [virtual]

Assign geometry from well known binary data.

The object must have already been instantiated as the correct derived type of geometry object to match the binaries type. This method is used by the OGRGeometryFactory class, but not normally called by application code.

This method relates to the SFCOM IWks::ImportFromWKB() method.

This method is the same as the C function OGR_G_ImportFromWkb().

Parameters:
pabyDatathe binary input data.
nSizethe size of pabyData in bytes, or zero if not known.
eWkbVariantif wkbVariantPostGIS1, special interpretation is done for curve geometries code
Returns:
OGRERR_NONE if all goes well, otherwise any of OGRERR_NOT_ENOUGH_DATA, OGRERR_UNSUPPORTED_GEOMETRY_TYPE, or OGRERR_CORRUPT_DATA may be returned.

Reimplemented from OGRPolygon.

OGRTriangle & OGRTriangle::operator= ( const OGRTriangle other)

Assignment operator.

Parameters:
otherA triangle passed as a parameter
Returns:
OGRTriangle A copy of other

The documentation for this class was generated from the following files:

Generated for GDAL by doxygen 1.7.6.1.