SFCGAL  1.3.0
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
virtual ~Geometry ()
 
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::auto_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...
 
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...
 
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 Member Functions inherited from SFCGAL::Geometry
 Geometry ()
 
 Geometry (const Geometry &)
 
const Geometryoperator= (const Geometry &)
 
- 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

SFCGAL::Triangle::Triangle ( )

empty Triangle constructor

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

Constructor with a CGAL triangle.

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

Constructor with a CGAL triangle.

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

constructor with 3 points

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

copy constructor

SFCGAL::Triangle::~Triangle ( )

destructor

Member Function Documentation

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

[visitor]dispatch visitor

 

Implements SFCGAL::Geometry.

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

[visitor]dispatch visitor

 

Implements SFCGAL::Geometry.

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

Get a deep copy of the geometry.

Implements SFCGAL::Geometry.

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

[OGC/SFA]returns the dimension of the coordinates

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

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

[OGC/SFA]returns the geometry type

Warning
use CamelCase (LineString, not LINESTRING)

Implements SFCGAL::Geometry.

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

Returns a code corresponding to the type.

Warning
not standard

Implements SFCGAL::Geometry.

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

[OGC/SFA]test if geometry is 3d

Precondition
suppose no mix of 2D/3D coordinates

Implements SFCGAL::Geometry.

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

[OGC/SFA]test if geometry is empty

Implements SFCGAL::Geometry.

bool 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.

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

assign operator

void SFCGAL::Triangle::reverse ( )

reverse Triangle orientation

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

Serializer.

Polygon SFCGAL::Triangle::toPolygon ( ) const

convert a triangle to a polygon

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

Convert to CGAL::Triangle_2.

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

Convert to CGAL::Triangle_3.

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

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

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

returns the i-th vertex

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

returns the i-th vertex