ConstraintGraph2 is a set of Constraint Edges (ConstraintSegment2) More...
#include <ConstraintGraph2.h>
Public Member Functions | |
void | getChildConstraintSegments (std::vector< ConstraintSegment2 * > &vConstraintSegments_) const |
Get child ConstraintSegment2 objects. More... | |
void | getDirectChildren (ConstraintSegment2 *pParent, ConstraintSegment2 *&pChild0, ConstraintSegment2 *&pChild1) |
Get direct children. More... | |
Dt2 * | getDt2 () |
ConstraintInsertionStrategy | getInsertionStrategy () const |
Get the constraint insertion strategy. More... | |
void | getOriginalConstraintSegments (std::vector< ConstraintSegment2 * > &vConstraintSegments_) const |
Get the original ConstraintSegment2 objects. More... | |
void | getPolygonVertices (std::vector< Point2 * > &vVertices_) |
Get the vertices of the constraint segments. More... | |
bool | isConstraint (ConstraintSegment2 *pCSeg) const |
Check if a ConstraintSegment2 is a member. More... | |
bool | isConstraint (Point2 *p0, Point2 *p1) const |
Check if an edge is a constraint segment. More... | |
bool | isOriented () const |
Are the segments of the constraint graph oriented? More... | |
bool | isPolygon () const |
Does the constraint graph form a closed polygon? More... | |
bool | isReverse (ConstraintSegment2 *pCSeg) const |
bool | makeDelaunay (double minLength) |
void | show (const char *name) |
Visualization. | |
void | show (Visualizer2 *pVis, const Color &color) |
Visualization. | |
Protected Attributes | |
bool | bIsOriented |
bool | bIsPolygon |
ConstraintInsertionStrategy | cis |
std::map< ConstraintSegment2 *, bool, func_ltDerefPtr< ConstraintSegment2 * > > | mCSegReverse |
std::map< Point2 *, size_t > | mSplitPointNum |
Dt2 * | pDt2 |
GeomTest * | pGeomPredicates |
std::vector< ConstraintSegment2 * > | vCSegParents |
ConstraintGraph2 is a set of Constraint Edges (ConstraintSegment2)
void GEOM_FADE25D::ConstraintGraph2::getChildConstraintSegments | ( | std::vector< ConstraintSegment2 * > & | vConstraintSegments_ | ) | const |
Get child ConstraintSegment2 objects.
Returns the current constraint segments, i.e., the original ones or, if splitted, their child segments.
void GEOM_FADE25D::ConstraintGraph2::getDirectChildren | ( | ConstraintSegment2 * | pParent, |
ConstraintSegment2 *& | pChild0, | ||
ConstraintSegment2 *& | pChild1 | ||
) |
Get direct children.
[in] | pParent | is a ConstraintSegment that may have been splitted |
[out] | pChild0,pChild1 | are the direct child segments of pParent . They can be alive or dead (splitted). |
The children are returned in the correct order of the present ConstraintGraph2.
Dt2* GEOM_FADE25D::ConstraintGraph2::getDt2 | ( | ) |
ConstraintInsertionStrategy GEOM_FADE25D::ConstraintGraph2::getInsertionStrategy | ( | ) | const |
Get the constraint insertion strategy.
void GEOM_FADE25D::ConstraintGraph2::getOriginalConstraintSegments | ( | std::vector< ConstraintSegment2 * > & | vConstraintSegments_ | ) | const |
Get the original ConstraintSegment2 objects.
Get the original, ConstraintSegment2 objects. They are not subdivided but may be dead and have child segments (which may also be dead and have child segments...)
void GEOM_FADE25D::ConstraintGraph2::getPolygonVertices | ( | std::vector< Point2 * > & | vVertices_ | ) |
Get the vertices of the constraint segments.
Use this method to retrieve the vertices of the present ConstraintGraph2. If it forms ONE closed polygon, then the vertices are ordered and oriented in counterclockwise direction, e.g. (a,b,b,c,c,d,d,a). Otherwise they are returned in original order. Be aware that the order is only maintained if the ConstraintGraph2 has been created with Fade_2D::createConstraint(..,..,bOrientedSegments=true
).
bool GEOM_FADE25D::ConstraintGraph2::isConstraint | ( | ConstraintSegment2 * | pCSeg | ) | const |
Check if a ConstraintSegment2 is a member.
The present ConstraintGraph2 has been created using a set of edges and this method checks if the ConstraintSegment2 pCSeg
is one of them. Original edges that have been splitted are not alive anymore and are no members. But their child segments are members.
Check if an edge is a constraint segment.
Checks if the edge (p0,p1) is a constraint segment of the present ConstraintGraph2 object. The order of p0 and p1 does not matter.
bool GEOM_FADE25D::ConstraintGraph2::isOriented | ( | ) | const |
Are the segments of the constraint graph oriented?
bool GEOM_FADE25D::ConstraintGraph2::isPolygon | ( | ) | const |
Does the constraint graph form a closed polygon?
bool GEOM_FADE25D::ConstraintGraph2::isReverse | ( | ConstraintSegment2 * | pCSeg | ) | const |
Get the orientation of a ConstraintSegment2
A ConstraintSegment2 pCSeg
is unoriented because it may participate (with different orientations) in more than just one ConstraintGraph2 and thus the vertices returned by pCSeg->getSrc() and pCSeg->getTrg() do not carry any orientation information. However, the orientation of pCSeg
is stored in the ConstraintGraph2 objects where pCSeg
is a member and this method returns if the source and target vertex must be exchanged to match the present graph's direction.
bool GEOM_FADE25D::ConstraintGraph2::makeDelaunay | ( | double | minLength | ) |
Improve the triangle quality (make Delaunay)
Constraint segments can make a triangulation locally non-delaunay i.e., the empty-circumcircle property is not maintained for all triangles. makeDelaunay()
subdivides the constraint segments so that they appear naturally as part of the Delaunay triangulation. Use this function to create visually more appealing triangles with better aspect ratios.
[in] | minLength | specifies a lower bound. Constraint segments smaller than minLength are not subdivided. This parameter avoids excessive subdivision in narrow settings. |
minLength
has avoided further subdivision.