SFCGAL
Public Member Functions | List of all members
SFCGAL::Triangle Class Reference

[OGC/SFA]Triangle More...

#include <Triangle.h>

Inheritance diagram for SFCGAL::Triangle:
SFCGAL::Surface SFCGAL::Geometry

Public Member Functions

 Triangle ()
 empty Triangle constructor More...
 
 Triangle (const Kernel::Triangle_2 &triangle)
 Constructor with a CGAL triangle. More...
 
 Triangle (const Kernel::Triangle_3 &triangle)
 Constructor with a CGAL triangle. More...
 
 Triangle (const Point &p, const Point &q, const Point &r)
 constructor with 3 points More...
 
 Triangle (const Triangle &other)
 copy constructor More...
 
Triangleoperator= (const Triangle &other)
 assign operator More...
 
 ~Triangle ()
 destructor More...
 
virtual Triangleclone () const
 Get a deep copy of the geometry. More...
 
virtual std::string geometryType () const
 [OGC/SFA]returns the geometry type More...
 
virtual GeometryType geometryTypeId () const
 Returns a code corresponding to the type. More...
 
virtual int coordinateDimension () const
 [OGC/SFA]returns the dimension of the coordinates More...
 
virtual bool isEmpty () const
 [OGC/SFA]test if geometry is empty More...
 
virtual bool is3D () const
 [OGC/SFA]test if geometry is 3d More...
 
virtual bool isMeasured () const
 [OGC/SFA]test if geometry is measured (has an m) More...
 
void reverse ()
 reverse Triangle orientation More...
 
Polygon toPolygon () const
 convert a triangle to a polygon More...
 
const Pointvertex (const int &i) const
 returns the i-th vertex More...
 
Pointvertex (const int &i)
 returns the i-th vertex More...
 
Kernel::Triangle_2 toTriangle_2 () const
 Convert to CGAL::Triangle_2. More...
 
Kernel::Triangle_3 toTriangle_3 () const
 Convert to CGAL::Triangle_3. More...
 
template<int D>
detail::TypeForDimension< D >::Triangle toTriangle_d () const
 Convert to CGAL::Triangle_2 or CGAL::Triangle_2. More...
 
virtual void accept (GeometryVisitor &visitor)
 [visitor]dispatch visitor More...
 
virtual void accept (ConstGeometryVisitor &visitor) const
 [visitor]dispatch visitor More...
 
template<class Archive >
void serialize (Archive &ar, const unsigned int)
 Serializer. More...
 
- Public Member Functions inherited from SFCGAL::Surface
virtual ~Surface ()
 destructor More...
 
virtual int dimension () const
 [OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...) More...
 
- Public Member Functions inherited from SFCGAL::Geometry
 Geometry ()
 Default constructor. More...
 
 Geometry (const Geometry &)=default
 Copy constructor. More...
 
Geometryoperator= (const Geometry &other)=default
 Copy assignemnt operator. More...
 
virtual ~Geometry ()=default
 Destructor. More...
 
virtual Geometryclone () const =0
 Get a deep copy of the geometry. More...
 
virtual std::string geometryType () const =0
 [OGC/SFA]returns the geometry type More...
 
virtual GeometryType geometryTypeId () const =0
 Returns a code corresponding to the type. More...
 
virtual int dimension () const =0
 [OGC/SFA]Dimension of the Geometry ( 0 : punctual, 1 : curve, ...) More...
 
virtual int coordinateDimension () const =0
 [OGC/SFA]returns the dimension of the coordinates More...
 
virtual bool isEmpty () const =0
 [OGC/SFA]test if geometry is empty More...
 
virtual bool is3D () const =0
 [OGC/SFA]test if geometry is 3d More...
 
virtual bool isMeasured () const =0
 [OGC/SFA]test if geometry is measured (has an m) More...
 
void forceValidityFlag (bool validity)
 Force the state of the validity flag. More...
 
bool hasValidityFlag () const
 Returns the validity flag. More...
 
std::string asText (const int &numDecimals=-1) const
 [OGC/SFA]returns the WKT string More...
 
Envelope envelope () const
 [OGC/SFA]Returns a polygon representing the BBOX of the geometry More...
 
virtual std::unique_ptr< Geometryboundary () const
 [OGC/SFA]Returns the boundary of the geometry More...
 
double distance (const Geometry &other) const
 Computes the distance to an other geometry. More...
 
double distance3D (const Geometry &other) const
 Computes the 3D distance to an other geometry. More...
 
void round (const long &scale=1)
 round the geometry with a corresponding scale factor More...
 
auto almostEqual (const Geometry &, const double tolerance) const -> bool
 Equality operator. More...
 
virtual size_t numGeometries () const
 [OGC/SFA]Gets the number of geometries in a collection of geometries More...
 
virtual const GeometrygeometryN (size_t const &n) const
 [OGC/SFA]Returns the n-th geometry More...
 
virtual GeometrygeometryN (size_t const &n)
 [OGC/SFA]Returns the n-th geometry More...
 
template<typename Derived >
bool is () const
 Tests if geometry is of "Derived" type given as template parameter. More...
 
template<typename Derived >
const Derived & as () const
 Downcast to a "Derived" class. More...
 
template<typename Derived >
Derived & as ()
 Downcast to a "Derived" class. More...
 
virtual void accept (GeometryVisitor &visitor)=0
 [visitor]dispatch visitor More...
 
virtual void accept (ConstGeometryVisitor &visitor) const =0
 [visitor]dispatch visitor More...
 
template<class Archive >
void serialize (Archive &, const unsigned int)
 Serializer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from SFCGAL::Surface
 Surface ()
 [OGC/SFS]"The area of this Surface, as measured in the spatial reference system of this Surface" More...
 
 Surface (Surface const &other)
 no copy constructor More...
 
- Protected Attributes inherited from SFCGAL::Geometry
bool validityFlag_
 

Detailed Description

[OGC/SFA]Triangle

Warning
According to SFA, a Triangle should be inherited from a Polygon. That means that a triangle "is a" Polygon with hole. This inheritance is removed in order to keep CGAL modeling.
An empty triangle has empty points

Constructor & Destructor Documentation

◆ Triangle() [1/5]

SFCGAL::Triangle::Triangle ( )

empty Triangle constructor

◆ Triangle() [2/5]

SFCGAL::Triangle::Triangle ( const Kernel::Triangle_2 &  triangle)

Constructor with a CGAL triangle.

◆ Triangle() [3/5]

SFCGAL::Triangle::Triangle ( const Kernel::Triangle_3 &  triangle)

Constructor with a CGAL triangle.

◆ Triangle() [4/5]

SFCGAL::Triangle::Triangle ( const Point p,
const Point q,
const Point r 
)

constructor with 3 points

◆ Triangle() [5/5]

SFCGAL::Triangle::Triangle ( const Triangle other)

copy constructor

◆ ~Triangle()

SFCGAL::Triangle::~Triangle ( )
default

destructor

Member Function Documentation

◆ accept() [1/2]

void SFCGAL::Triangle::accept ( ConstGeometryVisitor visitor) const
virtual

[visitor]dispatch visitor

Implements SFCGAL::Geometry.

◆ accept() [2/2]

void SFCGAL::Triangle::accept ( GeometryVisitor visitor)
virtual

[visitor]dispatch visitor

Implements SFCGAL::Geometry.

◆ clone()

auto SFCGAL::Triangle::clone ( ) const
virtual

Get a deep copy of the geometry.

Implements SFCGAL::Geometry.

◆ coordinateDimension()

auto SFCGAL::Triangle::coordinateDimension ( ) const
virtual

[OGC/SFA]returns the dimension of the coordinates

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

◆ geometryType()

auto SFCGAL::Triangle::geometryType ( ) const
virtual

[OGC/SFA]returns the geometry type

Warning
use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry.

◆ geometryTypeId()

auto SFCGAL::Triangle::geometryTypeId ( ) const
virtual

Returns a code corresponding to the type.

Warning
not standard

Implements SFCGAL::Geometry.

◆ is3D()

auto SFCGAL::Triangle::is3D ( ) const
virtual

[OGC/SFA]test if geometry is 3d

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

◆ isEmpty()

auto SFCGAL::Triangle::isEmpty ( ) const
virtual

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry.

◆ isMeasured()

auto SFCGAL::Triangle::isMeasured ( ) const
virtual

[OGC/SFA]test if geometry is measured (has an m)

Precondition
suppose no mix of M/!M points

Implements SFCGAL::Geometry.

◆ operator=()

auto SFCGAL::Triangle::operator= ( const Triangle other)

assign operator

◆ reverse()

void SFCGAL::Triangle::reverse ( )

reverse Triangle orientation

◆ serialize()

template<class Archive >
void SFCGAL::Triangle::serialize ( Archive &  ar,
const unsigned int   
)
inline

Serializer.

◆ toPolygon()

auto SFCGAL::Triangle::toPolygon ( ) const

convert a triangle to a polygon

◆ toTriangle_2()

Kernel::Triangle_2 SFCGAL::Triangle::toTriangle_2 ( ) const
inline

Convert to CGAL::Triangle_2.

◆ toTriangle_3()

Kernel::Triangle_3 SFCGAL::Triangle::toTriangle_3 ( ) const
inline

Convert to CGAL::Triangle_3.

◆ toTriangle_d()

template<int D>
detail::TypeForDimension< D >::Triangle SFCGAL::Triangle::toTriangle_d ( ) const
inline

Convert to CGAL::Triangle_2 or CGAL::Triangle_2.

◆ vertex() [1/2]

Point & SFCGAL::Triangle::vertex ( const int &  i)
inline

returns the i-th vertex

◆ vertex() [2/2]

const Point & SFCGAL::Triangle::vertex ( const int &  i) const
inline

returns the i-th vertex