SFCGAL  2.3.0
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
SFCGAL Namespace Reference

Default SFCGAL namespace. More...

Namespaces

 algorithm
 Compute the topological boundary of a Geometry.
 
 detail
 Visitor that extracts point coordinates from geometries to expand an Envelope.
 
 generator
 Generator namespace.
 
 graph
 graph namespace
 
 io
 Main Input/output namespace.
 
 tools
 
 transform
 transform namespace
 
 triangulate
 Triangulate dedicated namespace.
 

Classes

class  Box
 Represents a box in 3D space. More...
 
class  Cone
 Represents a cone in 3D space. More...
 
class  ConstGeometryVisitor
 Visitor interface for const Geometry types. More...
 
class  Coordinate
 Represents the Coordinate of a Point (wraps either an empty structure, or a Kernel::Point_2, or a Kernel::Point_3) More...
 
class  CoordinateDimensionVisitor
 Visitor to get coordinate dimension. More...
 
class  Cube
 Represents a cube in 3D space, which is a box where all 3 sides are of equal size. More...
 
class  Curve
 Abstract base class for parametric curves. More...
 
class  Cylinder
 Represents a cylinder in 3D space. More...
 
class  DereferenceIterator
 Iterator adapter that dereferences unique_ptr elements automatically. More...
 
class  Envelope
 Represents a bounding box. More...
 
class  Exception
 Base SFCGAL Exception. More...
 
class  GeometryCollection
 A GeometryCollection in SFA. More...
 
class  GeometryInvalidityException
 SFCGAL Exception thrown when invalid geometries are found before entering an algo. More...
 
class  GeometryVisitor
 Visitor interface for non-const Geometry types. More...
 
class  GetXVisitor
 Visitor to get X coordinate value. More...
 
class  GetYVisitor
 Visitor to get Y coordinate value. More...
 
class  GetZVisitor
 Visitor to get Z coordinate value. More...
 
class  InappropriateGeometryException
 SFCGAL Exception thrown when geometry is inappropriate for a function. More...
 
class  LineString
 A LineString in SFA. More...
 
class  Logger
 [Singleton]Logger class More...
 
class  MultiLineString
 A MultiLineString in SFA. More...
 
class  MultiPoint
 A MultiPoint in SFA. More...
 
class  MultiPolygon
 A MultiPolygon in SFA. More...
 
class  MultiSolid
 A MultiSolid. More...
 
class  NonFiniteValueException
 SFCGAL Exception thrown when non finite value is found. More...
 
class  NotImplementedException
 SFCGAL Exception thrown when a function is not implemented. More...
 
class  NURBSCurve
 Non-Uniform Rational B-Spline (NURBS) curve implementation. More...
 
class  Point
 A point in SFA. More...
 
class  Polygon
 A Polygon in SFA with holes. More...
 
class  PolyhedralSurface
 A PolyhedralSurface in SFA modeled as a Polygon soup. More...
 
class  PreparedGeometry
 A PreparedGeometry is a shell around a SFCGAL::Geometry. More...
 
class  Primitive
 Abstract base class for primitive object (Cube, Cylinder, Cone, etc.) More...
 
struct  PrimitiveParameterDesc
 
class  RoundVisitor
 Visitor to round coordinate values. More...
 
class  Segment
 Represents a line segment in space. More...
 
struct  Simplicity
 the class, convertible to bool, that stores the reason why a geom is not simple More...
 
class  Solid
 A Solid modeled with an exteriorShell and interiorShells materialized by PolyhedralSurface. More...
 
class  Sphere
 Represents a sphere in 3D space centered at the origin. More...
 
class  Surface
 Abstract Surface class. More...
 
struct  TestGeometry
 Test geometry structure for validation testing. More...
 
class  ToPoint2Visitor
 Visitor to convert coordinate to CGAL 2D point. More...
 
class  ToPoint3Visitor
 Visitor to convert coordinate to CGAL 3D point. More...
 
class  Torus
 Represents a torus in 3D space. More...
 
class  Transform
 Base interface for applying a coordinate transformation to geometry objects. More...
 
class  Triangle
 [OGC/SFA]Triangle More...
 
class  TriangulatedSurface
 A TriangulatedSurface in SFA modeled as a Triangle soup. More...
 
struct  Validity
 the class, convertible to bool, that stores the reason why a geom is invalid More...
 
class  WkbParseException
 SFCGAL Exception thrown when parsing WKB. More...
 
class  WktParseException
 SFCGAL Exception thrown when parsing WKT. More...
 

Typedefs

using Kernel = CGAL::Exact_predicates_exact_constructions_kernel
 default Kernel More...
 
using FT = NURBSCurve::FT
 Floating-point type alias for NURBS calculations. More...
 
using PrimitiveParameter = std::variant< Kernel::FT, unsigned int >
 Variant type representing the possible values of a primitive parameter. More...
 
using QT = CGAL::Gmpq
 Quotient type. More...
 
using Point_2 = CGAL::Point_2< SFCGAL::Kernel >
 
using Triangle_2 = CGAL::Triangle_2< SFCGAL::Kernel >
 
using Polygon_2 = CGAL::Polygon_2< SFCGAL::Kernel >
 
using Vector_2 = CGAL::Vector_2< SFCGAL::Kernel >
 
using Segment_2 = CGAL::Segment_2< Kernel >
 
using Polygon_with_holes_2 = CGAL::Polygon_with_holes_2< SFCGAL::Kernel >
 
using Polygon_set_2 = CGAL::Polygon_set_2< SFCGAL::Kernel >
 
using Point_3 = CGAL::Point_3< SFCGAL::Kernel >
 
using Triangle_3 = CGAL::Triangle_3< SFCGAL::Kernel >
 
using Plane_3 = CGAL::Plane_3< SFCGAL::Kernel >
 
using Segment_3 = CGAL::Segment_3< Kernel >
 
using Vector_3 = CGAL::Vector_3< SFCGAL::Kernel >
 
using Polyhedron_3 = CGAL::Polyhedron_3< Kernel >
 
using Surface_mesh_3 = CGAL::Surface_mesh< Point_3 >
 

Enumerations

enum  PrimitiveType : std::int8_t {
  PrimitiveType::TYPE_BOX = 0, PrimitiveType::TYPE_CONE, PrimitiveType::TYPE_CUBE, PrimitiveType::TYPE_CYLINDER,
  PrimitiveType::TYPE_SPHERE, PrimitiveType::TYPE_TORUS
}
 Enumeration of available primitive types. More...
 

Functions

void SFCGAL_API SFCGAL_ASSERT_GEOMETRY_SIMPLICITY (const Geometry &g)
 Assert that a geometry is simple. More...
 
void SFCGAL_API SFCGAL_ASSERT_GEOMETRY_VALIDITY_ON_PLANE (const Geometry &geometry)
 Assert geometry validity on a plane (not implemented) More...
 
void from_json (const nlohmann::json &jsonObject, PrimitiveParameterDesc &desc)
 
void to_json (nlohmann::json &jsonObject, const PrimitiveParameterDesc &desc)
 
template<typename Iterator >
auto dereference_iterator (Iterator iterator) -> DereferenceIterator< Iterator >
 Helper function to create a DereferenceIterator from a base iterator. More...
 
const std::vector< TestGeometry > createTestGeometries ()
 Creates a set of test geometries for validation purposes. More...
 
auto logger () -> Logger &
 get the logger More...
 
auto operator== (const Geometry &geomA, const Geometry &geomB) -> bool
 Function used to compare geometries FIXME Since we do not have (yet) a real "equals" operator, we only compare points coordinates. More...
 
auto operator<< (std::ostream &os, const Envelope &envelope) -> std::ostream &
 Ostream operator for Envelope. More...
 
auto operator<< (std::ostream &os, const Geometry &geometry) -> std::ostream &
 Ostream operator for Geometry. More...
 
auto almostEqual (const double first, const double second, const double epsilon) -> bool
 Check if two double values are almost equal within epsilon. More...
 
auto almostEqual (const Kernel::FT &first, const Kernel::FT &second, const Kernel::FT &epsilon) -> bool
 Check if two Kernel::FT values are almost equal within epsilon. More...
 
auto NaN () -> double
 shortcut to get NaN for double More...
 
auto round (const double &value) -> double
 round a double to the nearest integer More...
 
auto normalizeVector (const Kernel::Vector_3 &vector) -> Kernel::Vector_3
 Normalizes a vector. More...
 
static auto findKnotSpanImpl (const FT &parameter, unsigned int degree, const std::vector< FT > &knots, size_t numControlPoints) -> size_t
 
static auto findKnotSpan (const FT &parameter, unsigned int degree, const std::vector< FT > &knots) -> size_t
 
static auto computeBasisFunctions (size_t span, const FT &parameter, unsigned int degree, const std::vector< FT > &knots) -> std::vector< FT >
 Compute NURBS basis functions using Cox-de Boor recursion formula. More...
 
static auto computeBasisDerivatives (size_t span, const FT &parameter, unsigned int degree, const std::vector< FT > &knots, unsigned int maxDerivative) -> std::vector< std::vector< FT >>
 
auto operator== (const Primitive &prim1, const Primitive &prim2) -> bool
 Equality operator. More...
 
static auto validatePointDimensions (const Point &point1, const Point &point2, const char *point1Name, const char *point2Name) -> void
 

Variables

constexpr double EPSILON = 1e-8
 Default epsilon value for floating point comparisons. More...
 
const uint32_t wkbSRID = 0x20000000
 
const uint32_t wkbM = 0x40000000
 
const uint32_t wkbZ = 0x80000000
 

Detailed Description

Default SFCGAL namespace.

Typedef Documentation

using SFCGAL::FT = typedef NURBSCurve::FT

Floating-point type alias for NURBS calculations.

using SFCGAL::Kernel = typedef CGAL::Exact_predicates_exact_constructions_kernel

default Kernel

using SFCGAL::Plane_3 = typedef CGAL::Plane_3<SFCGAL::Kernel>
using SFCGAL::Point_2 = typedef CGAL::Point_2<SFCGAL::Kernel>
using SFCGAL::Point_3 = typedef CGAL::Point_3<SFCGAL::Kernel>
using SFCGAL::Polygon_2 = typedef CGAL::Polygon_2<SFCGAL::Kernel>
using SFCGAL::Polygon_set_2 = typedef CGAL::Polygon_set_2<SFCGAL::Kernel>
using SFCGAL::Polygon_with_holes_2 = typedef CGAL::Polygon_with_holes_2<SFCGAL::Kernel>
using SFCGAL::Polyhedron_3 = typedef CGAL::Polyhedron_3<Kernel>
using SFCGAL::PrimitiveParameter = typedef std::variant<Kernel::FT, unsigned int>

Variant type representing the possible values of a primitive parameter.

A primitive parameter can be one of the following types:

  • SFCGAL::Kernel::FT : a scalar floating-point value
  • unsigned int : an integer value
using SFCGAL::QT = typedef CGAL::Gmpq

Quotient type.

using SFCGAL::Segment_2 = typedef CGAL::Segment_2<Kernel>
using SFCGAL::Segment_3 = typedef CGAL::Segment_3<Kernel>
using SFCGAL::Surface_mesh_3 = typedef CGAL::Surface_mesh<Point_3>
using SFCGAL::Triangle_2 = typedef CGAL::Triangle_2<SFCGAL::Kernel>
using SFCGAL::Triangle_3 = typedef CGAL::Triangle_3<SFCGAL::Kernel>
using SFCGAL::Vector_2 = typedef CGAL::Vector_2<SFCGAL::Kernel>
using SFCGAL::Vector_3 = typedef CGAL::Vector_3<SFCGAL::Kernel>

Enumeration Type Documentation

enum SFCGAL::PrimitiveType : std::int8_t
strong

Enumeration of available primitive types.

Enumerator
TYPE_BOX 
TYPE_CONE 
TYPE_CUBE 
TYPE_CYLINDER 
TYPE_SPHERE 
TYPE_TORUS 

Function Documentation

auto SFCGAL::almostEqual ( const double  first,
const double  second,
const double  epsilon 
) -> bool
inline

Check if two double values are almost equal within epsilon.

Parameters
firstFirst value to compare
secondSecond value to compare
epsilonTolerance for comparison
Returns
true if values are almost equal, false otherwise
auto SFCGAL::almostEqual ( const Kernel::FT &  first,
const Kernel::FT &  second,
const Kernel::FT &  epsilon 
) -> bool
inline

Check if two Kernel::FT values are almost equal within epsilon.

Parameters
firstFirst value to compare
secondSecond value to compare
epsilonTolerance for comparison
Returns
true if values are almost equal, false otherwise
static auto SFCGAL::computeBasisDerivatives ( size_t  span,
const FT &  parameter,
unsigned int  degree,
const std::vector< FT > &  knots,
unsigned int  maxDerivative 
) -> std::vector<std::vector<FT>>
static
static auto SFCGAL::computeBasisFunctions ( size_t  span,
const FT &  parameter,
unsigned int  degree,
const std::vector< FT > &  knots 
) -> std::vector<FT>
static

Compute NURBS basis functions using Cox-de Boor recursion formula.

From Piegl & Tiller Algorithm A2.2: N_{i,0}(u) = 1 if u_i ≤ u < u_{i+1}, 0 otherwise N_{i,p}(u) = [(u-u_i)/(u_{i+p}-u_i)] * N_{i,p-1}(u)

  • [(u_{i+p+1}-u)/(u_{i+p+1}-u_{i+1})] * N_{i+1,p-1}(u)

Returns degree+1 non-zero basis function values at given parameter.

const std::vector<TestGeometry> SFCGAL::createTestGeometries ( )
inline

Creates a set of test geometries for validation purposes.

Include poly with touching holes that disconnect interior

Returns
std::vector<TestGeometry> A vector containing all the test geometries.
template<typename Iterator >
auto SFCGAL::dereference_iterator ( Iterator  iterator) -> DereferenceIterator<Iterator>

Helper function to create a DereferenceIterator from a base iterator.

Template Parameters
IteratorThe underlying iterator type.
Parameters
iteratorThe base iterator to wrap.
Returns
A DereferenceIterator instance wrapping t.
static auto SFCGAL::findKnotSpan ( const FT &  parameter,
unsigned int  degree,
const std::vector< FT > &  knots 
) -> size_t
static
static auto SFCGAL::findKnotSpanImpl ( const FT &  parameter,
unsigned int  degree,
const std::vector< FT > &  knots,
size_t  numControlPoints 
) -> size_t
static
void SFCGAL::from_json ( const nlohmann::json &  jsonObject,
PrimitiveParameterDesc &  desc 
)
SFCGAL_API auto SFCGAL::logger ( ) -> Logger &

get the logger

Returns
Reference to the global logger instance
auto SFCGAL::NaN ( ) -> double
inline

shortcut to get NaN for double

Returns
NaN (Not a Number) value for double
auto SFCGAL::normalizeVector ( const Kernel::Vector_3 &  vector) -> Kernel::Vector_3
inline

Normalizes a vector.

Parameters
vectorThe vector to normalize
Returns
The normalized vector
SFCGAL_API auto SFCGAL::operator<< ( std::ostream &  os,
const Envelope &  envelope 
) -> std::ostream &

Ostream operator for Envelope.

Parameters
osOutput stream
envelopeEnvelope to output
Returns
Reference to the output stream
SFCGAL_API auto SFCGAL::operator<< ( std::ostream &  os,
const Geometry &  geometry 
) -> std::ostream &

Ostream operator for Geometry.

Parameters
osOutput stream
geometryGeometry to output
Returns
Reference to the output stream
SFCGAL_API auto SFCGAL::operator== ( const Geometry &  geomA,
const Geometry &  geomB 
) -> bool

Function used to compare geometries FIXME Since we do not have (yet) a real "equals" operator, we only compare points coordinates.

Equality operator for geometries.

Compares two Geometry objects for equality.

Parameters
[in]geomAThe first Geometry object to compare.
[in]geomBThe second Geometry object to compare.
Returns
true according to algorithm::EqualityStrictness::pointNonOrdered()
Precondition
Both Geometry objects must be valid.
Todo:
Extend comparison to include more than just coordinate points if needed.
SFCGAL_API auto SFCGAL::operator== ( const Primitive &  prim1,
const Primitive &  prim2 
) -> bool

Equality operator.

Todo:
only compare coordinate points
Precondition
the two geometries must be valid
Parameters
prim1first primitive to compare
prim2second primitive to compare
Returns
true when the primitives are the same
auto SFCGAL::round ( const double &  value) -> double
inline

round a double to the nearest integer

Parameters
valueValue to round
Returns
Rounded value
void SFCGAL_API SFCGAL::SFCGAL_ASSERT_GEOMETRY_SIMPLICITY ( const Geometry &  g)

Assert that a geometry is simple.

Parameters
gThe geometry to check for simplicity
Returns
void (throws exception if geometry is not simple)
void SFCGAL_API SFCGAL::SFCGAL_ASSERT_GEOMETRY_VALIDITY_ON_PLANE ( const Geometry &  geometry)

Assert geometry validity on a plane (not implemented)

Parameters
geometryThe geometry to validate
Returns
void
void SFCGAL::to_json ( nlohmann::json &  jsonObject,
const PrimitiveParameterDesc &  desc 
)
static auto SFCGAL::validatePointDimensions ( const Point &  point1,
const Point &  point2,
const char *  point1Name,
const char *  point2Name 
) -> void
static

Variable Documentation

constexpr double SFCGAL::EPSILON = 1e-8

Default epsilon value for floating point comparisons.

const uint32_t SFCGAL::wkbM = 0x40000000
const uint32_t SFCGAL::wkbSRID = 0x20000000
const uint32_t SFCGAL::wkbZ = 0x80000000