Skip to content

Class SFCGAL::Triangle

ClassList > SFCGAL > Triangle

More...

  • #include <Triangle.h>

Inherits the following classes: SFCGAL::Surface

Public Functions

Type Name
Triangle ()
Triangle (const Kernel::Triangle_2 & triangle)
Triangle (const Kernel::Triangle_3 & triangle)
Triangle (const Point & p, const Point & q, const Point & r)
Triangle (const Triangle & other)
virtual void accept (GeometryVisitor & visitor)
[visitor]dispatch visitor
virtual void accept (ConstGeometryVisitor & visitor) const
[visitor]dispatch visitor
virtual Triangle * clone () const
Get a deep copy of the geometry.
virtual int coordinateDimension () const
virtual std::string geometryType () const
[OGC/SFA]returns the geometry type
virtual GeometryType geometryTypeId () const
Returns a code corresponding to the type.
virtual bool is3D () const
virtual bool isEmpty () const
virtual bool isMeasured () const
Triangle & operator= (const Triangle & other)
void reverse ()
void serialize (Archive & ar, const unsigned int)
Polygon toPolygon () const
Kernel::Triangle_2 toTriangle_2 () const
Kernel::Triangle_3 toTriangle_3 () const
detail::TypeForDimension< D >::Triangle toTriangle_d () const
const Point & vertex (const int & i) const
Point & vertex (const int & i)
~Triangle ()

Public Functions inherited from SFCGAL::Surface

See SFCGAL::Surface

Type Name
virtual int dimension () const
virtual ~Surface ()

Public Functions inherited from SFCGAL::Geometry

See SFCGAL::Geometry

Type Name
Geometry ()
Default constructor.
Geometry (const Geometry &) = default
Copy constructor.
virtual void accept (GeometryVisitor & visitor) = 0
[visitor]dispatch visitor
virtual void accept (ConstGeometryVisitor & visitor) const = 0
[visitor]dispatch visitor
auto almostEqual (const Geometry & other, const double tolerance) const
const Derived & as () const
Downcast to a "Derived" class.
Derived & as ()
Downcast to a "Derived" class.
std::string asText (const int & numDecimals=-1) const
std::string asWkb (boost::endian::order wkbOrder=boost::endian::order::native, bool asHex=false) const
virtual std::unique_ptr< Geometry > boundary () const
[OGC/SFA]Returns the boundary of the geometry
virtual Geometry * clone () const = 0
Get a deep copy of the geometry.
virtual int coordinateDimension () const = 0
virtual int dimension () const = 0
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.
Envelope envelope () const
void forceValidityFlag (bool validity)
virtual const Geometry & geometryN (size_t const & n) const
[OGC/SFA]Returns the n-th geometry
virtual Geometry & geometryN (size_t const & n)
[OGC/SFA]Returns the n-th geometry
virtual std::string geometryType () const = 0
[OGC/SFA]returns the geometry type
virtual GeometryType geometryTypeId () const = 0
Returns a code corresponding to the type.
bool hasValidityFlag () const
bool is () const
Tests if geometry is of "Derived" type given as template parameter.
virtual bool is3D () const = 0
virtual bool isEmpty () const = 0
virtual bool isMeasured () const = 0
virtual size_t numGeometries () const
[OGC/SFA]Gets the number of geometries in a collection of geometries
Geometry & operator= (const Geometry & other) = default
Copy assignemnt operator.
void round (const long & scale=1)
round the geometry with a corresponding scale factor
void serialize (Archive &, const unsigned int)
virtual ~Geometry () = default
Destructor.

Protected Attributes inherited from SFCGAL::Geometry

See SFCGAL::Geometry

Type Name
bool validityFlag_ = = false

Protected Functions inherited from SFCGAL::Surface

See SFCGAL::Surface

Type Name
Surface ()
Surface (Surface const & other)

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.

Warning:

An empty triangle has empty points

Public Functions Documentation

function Triangle [1/5]

SFCGAL::Triangle::Triangle () 

empty Triangle constructor


function Triangle [2/5]

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

Constructor with a CGAL triangle


function Triangle [3/5]

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

Constructor with a CGAL triangle


function Triangle [4/5]

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

constructor with 3 points


function Triangle [5/5]

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

copy constructor


function accept [1/2]

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

Implements SFCGAL::Geometry::accept


function accept [2/2]

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

Implements SFCGAL::Geometry::accept


function clone

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

Implements SFCGAL::Geometry::clone


function coordinateDimension

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

[OGC/SFA]returns the dimension of the coordinates

Precondition:

suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry::coordinateDimension


function geometryType

[OGC/SFA]returns the geometry type

virtual std::string SFCGAL::Triangle::geometryType () const

Warning:

use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry::geometryType


function geometryTypeId

Returns a code corresponding to the type.

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

Warning:

not standard

Implements SFCGAL::Geometry::geometryTypeId


function is3D

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

[OGC/SFA]test if geometry is 3d

Precondition:

suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry::is3D


function isEmpty

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

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry::isEmpty


function isMeasured

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

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

Precondition:

suppose no mix of M/!M points

Implements SFCGAL::Geometry::isMeasured


function operator=

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

assign operator


function reverse

void SFCGAL::Triangle::reverse () 

reverse Triangle orientation


function serialize

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

Serializer


function toPolygon

Polygon SFCGAL::Triangle::toPolygon () const

convert a triangle to a polygon


function toTriangle_2

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

Convert to CGAL::Triangle_2


function toTriangle_3

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

Convert to CGAL::Triangle_3


function toTriangle_d

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

Convert to CGAL::Triangle_2 or CGAL::Triangle_2


function vertex [1/2]

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

returns the i-th vertex


function vertex [2/2]

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

returns the i-th vertex


function ~Triangle

SFCGAL::Triangle::~Triangle () 

destructor



The documentation for this class was generated from the following file /builds/sfcgal/SFCGAL/src/Triangle.h