Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.60


Vector2 GEOM_FADE25D::getNormalVector (const Point2 &p0, const Point2 &p1, const Point2 &p2, bool &bOK)
 Get normal vector. More...
void GEOM_FADE25D::getDirectedEdges (std::vector< Triangle2 *> &vT, std::vector< Edge2 > &vDirectedEdgesOut)
 Get directed edge The directed edges of vT are returned vDirectedEdgesOut. Directed means that each edge (a,b) with two adjacent triangles in vT is returned twice, as edge(a,b) and edge(b,a).
void GEOM_FADE25D::getUndirectedEdges (std::vector< Triangle2 *> &vT, std::vector< Edge2 > &vUndirectedEdgesOut)
 Get undirected edges. More...
void GEOM_FADE25D::edgesToPolygons (std::vector< Edge2 > &vEdgesIn, std::vector< std::vector< Edge2 > > &vvPolygonsOut, std::vector< Edge2 > &vRemainingOut)
 Create polygons from a set of edges. More...
void GEOM_FADE25D::getBorders (const std::vector< Triangle2 *> &vT, std::vector< Segment2 > &vBorderSegmentsOut)
 Get Borders. More...
bool GEOM_FADE25D::sortRing (std::vector< Segment2 > &vRing)
 Sort a vector of Segments. More...
Orientation2 GEOM_FADE25D::getOrientation2 (const Point2 *p0, const Point2 *p1, const Point2 *p2)
 Get the orientation of three points. More...
Orientation2 GEOM_FADE25D::getOrientation2_mt (const Point2 *p0, const Point2 *p1, const Point2 *p2)
 Get Orientation2 (MT) More...

Detailed Description

Function Documentation

◆ edgesToPolygons()

void GEOM_FADE25D::edgesToPolygons ( std::vector< Edge2 > &  vEdgesIn,
std::vector< std::vector< Edge2 > > &  vvPolygonsOut,
std::vector< Edge2 > &  vRemainingOut 

A number of methods in Fade returns an unorganized set of edges that delimit a certain area. But sometimes it is more beneficial to have these edges organized as a set of one or more polygons. This is the purpose of the present method.

[in]vEdgesInis a vector of oriented edges
[out]vvPolygonsOutcontains one vector<Edge2> for each polygon found in the input data.
[out]vRemainingOutis used to return the unused edges

The present function adds one vector<Edge2> to vvPolygonsOut for each polygon found in vEdgesIn. Each such polygon starts with the leftmost vertex (and when two or more vertices share the smallest x-coordiante then the one of them with the smallest y-coordinate is chosen). Edges that do not form a closed polygon are returned in vRemainingOut.

An Edge2 object represents an edge of a triangle. Triangle corners are always counterclockwise (CCW) oriented. Thus outer polygons are CCW-oriented while hole-polygons are CW-oriented, see the figure.
Polygons created by edgesToPolygons

◆ getBorders()

void GEOM_FADE25D::getBorders ( const std::vector< Triangle2 *> &  vT,
std::vector< Segment2 > &  vBorderSegmentsOut 

Computes the border of the triangles in vT. The border consists of all edges having only one adjacent triangle in vT.

[in]vTare the input triangles
[out]vBorderSegmentsOutis used to return all border segments

◆ getNormalVector()

Vector2 GEOM_FADE25D::getNormalVector ( const Point2 p0,
const Point2 p1,
const Point2 p2,
bool &  bOK 

Returns the normalized normal vector of the triangle defined by the three input points p0, p1, p2.

[in]p0,p1,p2When these points are counterclockwise (CCW) oriented then the resulting normal vector points towards the viewer.
[out]bOKreturns true for valid results. When the plane defined by p0, p1, p2 is degenerate, bOK returns false.

◆ getOrientation2()

Orientation2 GEOM_FADE25D::getOrientation2 ( const Point2 p0,
const Point2 p1,
const Point2 p2 

This function returns the exact orientation of the points p0, p1, p2 Possible values are
ORIENTATION2_COLLINEAR if p0, p1, p2 are located on a line,
ORIENTATION2_CCW if p0, p1, p2 are counterclockwise oriented
ORIENTATION2_CW if p0, p1, p2 are clockwise oriented
Not thread-safe but a bit faster than the thread-safe version

◆ getOrientation2_mt()

Orientation2 GEOM_FADE25D::getOrientation2_mt ( const Point2 p0,
const Point2 p1,
const Point2 p2 
See also
getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2)

This version is thread-safe.

◆ getUndirectedEdges()

void GEOM_FADE25D::getUndirectedEdges ( std::vector< Triangle2 *> &  vT,
std::vector< Edge2 > &  vUndirectedEdgesOut 

A unique set of edges of vT is returned.

◆ sortRing()

bool GEOM_FADE25D::sortRing ( std::vector< Segment2 > &  vRing)

The segments in vRing are reoriented and sorted such that subsequent segments join at the endpoints.