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

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"
 
 Surface (Surface const &other)
 no copy constructor
 
- 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