SFCGAL  1.3.0
Classes | Enumerations | Functions
Public C++ API

Classes

struct  SFCGAL::algorithm::NoValidityCheck
 Tag used for variants of algorithm that do not do validity check. More...
 
class  SFCGAL::Geometry
 OGC/SFA based Geometry abstract class. More...
 
class  SFCGAL::GeometryCollection
 A GeometryCollection in SFA. More...
 
class  SFCGAL::LineString::Point_2_const_iterator
 Const iterator to 2D points TODO: replace by boost::tranform_iterator ? More...
 
class  SFCGAL::LineString::Point_3_const_iterator
 Const iterator to 3D points TODO: replace by boost::tranform_iterator ? More...
 
class  SFCGAL::LineString
 A LineString in SFA. More...
 
class  SFCGAL::MultiLineString
 A MultiLineString in SFA. More...
 
class  SFCGAL::MultiPoint
 A MultiPoint in SFA. More...
 
class  SFCGAL::MultiPolygon
 A MultiPolygon in SFA. More...
 
class  SFCGAL::MultiSolid
 A MultiSolid. More...
 
class  SFCGAL::Point
 A point in SFA. More...
 
class  SFCGAL::Polygon
 A Polygon in SFA with holes. More...
 
class  SFCGAL::PolyhedralSurface
 A PolyhedralSurface in SFA modeled as a Polygon soup. More...
 
class  SFCGAL::Solid
 A Solid modeled with an exteriorShell and interiorShells materialized by PolyhedralSurface. More...
 
class  SFCGAL::Triangle
 [OGC/SFA]Triangle More...
 
class  SFCGAL::TriangulatedSurface
 A TriangulatedSurface in SFA modeled as a Triangle soup. More...
 

Enumerations

enum  SFCGAL::GeometryType {
  SFCGAL::TYPE_POINT = 1, SFCGAL::TYPE_LINESTRING = 2, SFCGAL::TYPE_POLYGON = 3, SFCGAL::TYPE_MULTIPOINT = 4,
  SFCGAL::TYPE_MULTILINESTRING = 5, SFCGAL::TYPE_MULTIPOLYGON = 6, SFCGAL::TYPE_GEOMETRYCOLLECTION = 7, SFCGAL::TYPE_POLYHEDRALSURFACE = 15,
  SFCGAL::TYPE_TRIANGULATEDSURFACE = 16, SFCGAL::TYPE_TRIANGLE = 100, SFCGAL::TYPE_SOLID = 101, SFCGAL::TYPE_MULTISOLID = 102
}
 [OGC/SFA]8.2.3 "A common list of codes for geometric types" More...
 
enum  SFCGAL::CoordinateType { SFCGAL::COORDINATE_XY = 0, SFCGAL::COORDINATE_XYZ = 1000, SFCGAL::COORDINATE_XYM = 2000, SFCGAL::COORDINATE_XYZM = 3000 }
 coordinate types (XY, XYZ, XYM, etc.) More...
 

Functions

double SFCGAL::algorithm::area (const Geometry &g)
 Compute the 2D area for a Geometry. More...
 
double SFCGAL::algorithm::area3D (const Geometry &g)
 Returns 3D area for a Geometry. More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::convexHull (const Geometry &g)
 Compute the 2D convex hull for a geometry. More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::convexHull3D (const Geometry &g)
 Compute the 3D convex hull for a geometry. More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::difference (const Geometry &ga, const Geometry &gb)
 Difference on 2D geometries. More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::difference3D (const Geometry &ga, const Geometry &gb)
 Difference on 3D geometries. More...
 
double SFCGAL::algorithm::distance (const Geometry &gA, const Geometry &gB)
 Compute the distance between two Geometries. More...
 
double SFCGAL::algorithm::distance3D (const Geometry &gA, const Geometry &gB)
 dispatch distance between two Geometries More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::extrude (const Geometry &g, Kernel::FT dx, Kernel::FT dy, Kernel::FT dz)
 extrude a Geometry with a direction More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::intersection (const Geometry &ga, const Geometry &gb)
 Intersection on 2D geometries. More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::intersection3D (const Geometry &ga, const Geometry &gb)
 Intersection on 3D geometries. More...
 
bool SFCGAL::algorithm::intersects (const Geometry &ga, const Geometry &gb)
 Robust intersection test on 2D geometries. More...
 
bool SFCGAL::algorithm::intersects3D (const Geometry &ga, const Geometry &gb)
 Robust intersection test on 3D geometries. More...
 
const Validity SFCGAL::algorithm::isValid (const Geometry &g, const double &toleranceAbs=1e-9)
 Check validity of a geometry. More...
 
void SFCGAL::algorithm::propagateValidityFlag (Geometry &g, bool valid)
 Sets the geometry flag on a geometry and propagate to every internal geometries. More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::minkowskiSum (const Geometry &gA, const Polygon &gB)
 2D minkowski sum (p+q) More...
 
std::auto_ptr< MultiPolygon > SFCGAL::algorithm::offset (const Geometry &g, const double &r)
 [experimental]compute polygon offset More...
 
template<typename Kernel >
bool SFCGAL::algorithm::hasPlane3D (const Polygon &polygon, CGAL::Point_3< Kernel > &a, CGAL::Point_3< Kernel > &b, CGAL::Point_3< Kernel > &c)
 Test if a 3D plane can be extracted from a Polygon. More...
 
std::auto_ptr< MultiLineString > SFCGAL::algorithm::approximateMedialAxis (const Geometry &g)
 build an approximate medial axis for a Polygon More...
 
std::auto_ptr< MultiLineString > SFCGAL::algorithm::straightSkeleton (const Geometry &g, bool autoOrientation=true, bool innerOnly=false, bool outputDistanceInM=false)
 build a 2D straight skeleton for a Polygon More...
 
std::auto_ptr< MultiLineString > SFCGAL::algorithm::straightSkeleton (const Geometry &g, bool autoOrientation, NoValidityCheck, bool innerOnly=false, bool outputDistanceInM=false)
 build a 2D straight skeleton for a Polygon More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::tesselate (const Geometry &)
 Tesselate a geometry: this will triangulate surfaces (including polyhedral and solid's surfaces) and keep untouched points, lines, etc. More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::union_ (const Geometry &ga, const Geometry &gb)
 Union on 2D geometries. More...
 
std::auto_ptr< Geometry > SFCGAL::algorithm::union3D (const Geometry &ga, const Geometry &gb)
 Union on 3D geometries. More...
 
const Kernel::FT SFCGAL::algorithm::volume (const Geometry &g)
 Computes the volume of a geometry. More...
 

Detailed Description

Enumeration Type Documentation

coordinate types (XY, XYZ, XYM, etc.)

See also
SFA 2.8.3 LineStringZ = 1003 ( coordinateType + geometryType)
Enumerator
COORDINATE_XY 
COORDINATE_XYZ 
COORDINATE_XYM 
COORDINATE_XYZM 

[OGC/SFA]8.2.3 "A common list of codes for geometric types"

Todo:
solid and triangles as non OGC/SFA geometric types?
Warning
codes for abstract classes and unimplemented classes are hidden
code values have are important for WKB
Enumerator
TYPE_POINT 
TYPE_LINESTRING 
TYPE_POLYGON 
TYPE_MULTIPOINT 
TYPE_MULTILINESTRING 
TYPE_MULTIPOLYGON 
TYPE_GEOMETRYCOLLECTION 
TYPE_POLYHEDRALSURFACE 
TYPE_TRIANGULATEDSURFACE 
TYPE_TRIANGLE 
TYPE_SOLID 
TYPE_MULTISOLID 

Function Documentation

SFCGAL_API std::auto_ptr< MultiLineString > SFCGAL::algorithm::approximateMedialAxis ( const Geometry g)

build an approximate medial axis for a Polygon

Parameters
ginput geometry
Precondition
g is a valid geometry
SFCGAL_API double SFCGAL::algorithm::area ( const Geometry g)

Compute the 2D area for a Geometry.

Warning
Z component is ignored, there is no 2D projection for 3D geometries
Precondition
g is a valid geometry
SFCGAL_API double SFCGAL::algorithm::area3D ( const Geometry g)

Returns 3D area for a Geometry.

Warning
Solid area is set to 0 (might be defined as the area of the surface)
Precondition
g is a valid geometry
SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::convexHull ( const Geometry g)

Compute the 2D convex hull for a geometry.

SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::convexHull3D ( const Geometry g)

Compute the 3D convex hull for a geometry.

Todo:
improve to handle collinear points and coplanar points
SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::difference ( const Geometry ga,
const Geometry gb 
)

Difference on 2D geometries.

Precondition
ga and gb are valid geometries
SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::difference3D ( const Geometry ga,
const Geometry gb 
)

Difference on 3D geometries.

Assume z = 0 if needed

Precondition
ga and gb are valid geometries
SFCGAL_API double SFCGAL::algorithm::distance ( const Geometry gA,
const Geometry gB 
)

Compute the distance between two Geometries.

Precondition
gA is a valid geometry
gB is a valid geometry
SFCGAL_API double SFCGAL::algorithm::distance3D ( const Geometry gA,
const Geometry gB 
)

dispatch distance between two Geometries

Todo:

complete with solid Compute distance between two 3D Geometries

Precondition
gA is a valid geometry
gB is a valid geometry
SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::extrude ( const Geometry g,
Kernel::FT  dx,
Kernel::FT  dy,
Kernel::FT  dz 
)

extrude a Geometry with a direction

Precondition
g is a valid geometry
template<typename Kernel >
bool SFCGAL::algorithm::hasPlane3D ( const Polygon polygon,
CGAL::Point_3< Kernel > &  a,
CGAL::Point_3< Kernel > &  b,
CGAL::Point_3< Kernel > &  c 
)

Test if a 3D plane can be extracted from a Polygon.

SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::intersection ( const Geometry ga,
const Geometry gb 
)

Intersection on 2D geometries.

Precondition
ga and gb are valid geometries
SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::intersection3D ( const Geometry ga,
const Geometry gb 
)

Intersection on 3D geometries.

Assume z = 0 if needed

Precondition
ga and gb are valid geometries
SFCGAL_API bool SFCGAL::algorithm::intersects ( const Geometry ga,
const Geometry gb 
)

Robust intersection test on 2D geometries.

Force projection to z=0 if needed

Precondition
ga and gb are valid geometries
SFCGAL_API bool SFCGAL::algorithm::intersects3D ( const Geometry ga,
const Geometry gb 
)

Robust intersection test on 3D geometries.

Assume z = 0 if needed

Precondition
ga and gb are valid geometries
SFCGAL_API const Validity SFCGAL::algorithm::isValid ( const Geometry g,
const double &  toleranceAbs 
)

Check validity of a geometry.

SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::minkowskiSum ( const Geometry gA,
const Polygon gB 
)

2D minkowski sum (p+q)

Warning
If gA is a polygon, its orientation is taken into account. A "reversed" polygon (with a clockwise-oriented exterior ring) will involve a minkowski difference rather than a sum.
Todo:
missing cases (union)
Precondition
gA and gB are valid geometries
SFCGAL_API std::auto_ptr< MultiPolygon > SFCGAL::algorithm::offset ( const Geometry g,
const double &  r 
)

[experimental]compute polygon offset

Warning
test in order to compare with minkowski sum
Precondition
g is a valid Geometry
SFCGAL_API void SFCGAL::algorithm::propagateValidityFlag ( Geometry g,
bool  valid 
)

Sets the geometry flag on a geometry and propagate to every internal geometries.

SFCGAL_API std::auto_ptr< MultiLineString > SFCGAL::algorithm::straightSkeleton ( const Geometry g,
bool  autoOrientation,
NoValidityCheck  ,
bool  innerOnly = false,
bool  outputDistanceInM = false 
)

build a 2D straight skeleton for a Polygon

Parameters
ginput geometry
autoOrientationcheck and fix polygon orientation
outputMwhether to output the distance to border as M
Precondition
g is a valid geometry
Warning
No actual validity check is done
SFCGAL_API std::auto_ptr< MultiLineString > SFCGAL::algorithm::straightSkeleton ( const Geometry g,
bool  autoOrientation = true,
bool  innerOnly = false,
bool  outputDistanceInM = false 
)

build a 2D straight skeleton for a Polygon

Todo:
add supports for TriangulatedSurface and PolyhedralSurface
Parameters
ginput geometry
autoOrientationcheck and fix polygon orientation
outputMwhether to output the distance to border as M
Precondition
g is a valid geometry
SFCGAL_API std::auto_ptr< SFCGAL::Geometry > SFCGAL::algorithm::tesselate ( const Geometry )

Tesselate a geometry: this will triangulate surfaces (including polyhedral and solid's surfaces) and keep untouched points, lines, etc.

Precondition
g is a valid geometry
SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::union3D ( const Geometry ga,
const Geometry gb 
)

Union on 3D geometries.

Assume z = 0 if needed

Precondition
ga and gb are valid geometries
SFCGAL_API std::auto_ptr< Geometry > SFCGAL::algorithm::union_ ( const Geometry ga,
const Geometry gb 
)

Union on 2D geometries.

Precondition
ga and gb are valid geometries
SFCGAL_API const Kernel::FT SFCGAL::algorithm::volume ( const Geometry g)

Computes the volume of a geometry.

Precondition
g is a valid Geometry