10 #ifndef __GU_PolyDelaunay_h__
11 #define __GU_PolyDelaunay_h__
21 #define DELAUNAY_TINY_AREA_TOLERANCE (std::numeric_limits<fpreal>::min())
83 { myRemoveDuplicatePoints =
value; }
88 { myKeepBoundingTriangle =
value; }
94 REMOVE_IF_OUT_BUT_NOT_IN
98 { myRemoveFromConvexHull =
value; }
102 void setRemoveOutside(
bool value,
103 bool skip_if_also_inside =
false);
109 { myCanSplitConstraints =
enabled; }
114 { myConstraintNewPointGroupName.harden(name); }
117 { myConstraintNewPointGroup = new_pt_grp; }
125 { myMaxNewPoints = maxNewPoints; }
130 { myRestorePositions =
val; }
134 void setMaxArea(
fpreal max_area);
146 void setMinAngle(
fpreal min_angle);
147 void setMinEdgeLength(
fpreal min_edge_length);
154 void copyTriangles(
bool updatePointNormals =
true,
158 {
return myWarningMessage.str().toStdString(); }
160 void getBoundingSquareCorners(
UT_Vector3 *corners);
161 bool setPositionAttribute(
const char *attrib);
163 void getProjectedConstrainedEdges(
171 {
return myDuplicateMap.size() != 0; }
174 void getDuplicatePointMapForInput(
179 {
return myHasConflictingConstraints; }
190 MultiQueue(
int num_queues = 1,
int rand_seed = -1,
int init_size = -1);
191 void append(
const T &
t,
int queue_idx = 0);
193 int entries() {
return myEntries; }
207 myHedge(e), mySrc(src), myDst(dst) {}
214 bool isPresent(PinnedEdge &se);
219 myFace(face), myP0(p0), myP1(p1), myP2(p2) {}
228 return myFace == other.myFace &&
229 ((myP0 == other.myP0 && myP1 == other.myP1 &&
230 myP2 == other.myP2) ||
231 (myP0 == other.myP1 && myP1 == other.myP2 &&
232 myP2 == other.myP0) ||
233 (myP0 == other.myP2 && myP1 == other.myP0 &&
234 myP2 == other.myP1));
239 bool isPresent(PinnedFace &sf);
241 typedef MultiQueue<PinnedEdge> EdgeQueue;
242 typedef MultiQueue<PinnedFace> FaceQueue;
249 Constraint(
const GA_Edge &e,
bool h) { edge = e; is_boundary =
h; }
265 int mySuccessors[NSUCCESSORS];
271 int newLocatorNode();
272 void freeLocatorNode(
int idx);
273 void attachLocatorNodeToFace(
int idx,
GA_Offset faceoff);
274 void detachLocatorNodeFromFace(
int idx);
275 void setLocatorNodeSuccessors(
int idx,
int s1,
int s2,
301 inline int getLocatorNodeIndex(
GA_Offset faceoff);
310 int locateInSuccessors(
int dnode_idx,
335 bool from_input_only =
false);
365 myFlippedEdges.entries(0);
368 void startRecording() { myRecording =
true; }
369 void stopRecording() { myRecording =
false; }
370 bool isRecording() {
return myRecording; }
372 GEO_HedgeArray myFlippedEdges;
380 bool maxNewPointsReached();
400 void retireLocatorDAG();
409 INSERTED_IN_FACE, INSERTED_ON_EDGE, DUPLICATE_POINT, OUTSIDE_POINT
416 InsertStatus insertPoint(
GA_Offset ptoff,
418 bool delaunize =
true,
423 void undoInsertPoint();
437 enum ConstraintStatus
447 void delaunayFixup(
GEO_Hedge efixup,
bool leftside);
451 void enforceInputConstraints();
454 void removeBoundingTriangle();
456 void removeOutside();
461 void propagateRemoved(
GA_Offset face,
bool is_seed =
false);
472 void testEdge(
GEO_Hedge edge,
bool on_left_only =
false);
477 bool on_left_only =
false);
483 bool delaunize =
true);
488 void splitEncroachedEdges(
bool check_for_bad_faces);
490 void testIncidentTriangles(
GA_Offset pt);
492 void markEnforced(
GEO_Hedge edge,
bool enforced =
true);
494 void markBoundary(
GEO_Hedge edge,
bool boundary =
true);
497 bool isBoundingTrianglePoint(
GA_Offset ptoff);
498 bool isBoundingTriangleHedge(
GEO_Hedge edge);
511 {
return myHi->srcPoint(e); }
514 {
return myHi->dstPoint(e); }
517 {
return myHi->preSrcPoint(e); }
520 {
return myHi->nextEquivalentHedge(e); }
523 {
return myHi->lnext(e); }
526 {
return myHi->onext(e); }
529 {
return myHi->lprev(e); }
532 {
return myHi->oprev(e); }
535 {
return myPos2.get(ptoff); }
538 {
return myHi->isValidHedge(e); }
541 {
return myHi->isPrimary(e); }
554 LocatorNodeArray myLocatorNodes;
556 int myLocatorRootIndex;
563 bool myHasClosedConstraints: 1;
564 bool myHasConflictingConstraints: 1;
565 bool myCanSplitConstraints: 1;
566 bool myRestorePositions: 1;
567 bool myDoRefinement: 1;
568 bool myRemoveDuplicatePoints: 1;
569 bool myKeepBoundingTriangle: 1;
570 bool myMapDuplicates: 1;
571 bool myWrangleAttributes: 1;
574 bool myRemoveFromConvexHull;
575 RemoveOutsidePolicy myRemoveOutsidePolicy;
579 fpreal myMinEdgeLengthSqr;
580 fpreal myMaxArea, myMaxAngleCosSqr;
590 bool myUsePos2Attrib;
594 ConstraintArray myInputConstraints;
595 OffsetMap myDuplicateMap;
610 EdgeQueue myEncroachedEdges;
611 FaceQueue myBadTriangles;
__hostdev__ bool isValid(GridType gridType, GridClass gridClass)
return true if the combination of GridType and GridClass is valid.
void setKeepBoundingTriangle(bool value)
GLsizei const GLchar *const * string
GLsizei const GLfloat * value
GLboolean GLboolean GLboolean GLboolean a
void setRestorePositions(bool val)
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define GEO_INVALID_HEDGE
An invalid hedge is sometimes returned if an operation is unsuccessful.
#define GA_INVALID_OFFSET
void setRemoveFromConvexHull(bool value)
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
GEO_Hedge encapsulates a half-edge (hedge) which is the restriction of.
void enableRefinement(bool enabled)
Allow refinement.
An bi-directional stream object that owns its own string buffer storage.
void setRemoveDuplicatePoints(bool value)
bool hasNonEmptyDuplicatePointMap() const
GLuint const GLchar * name
GLboolean GLboolean GLboolean b
void setMaxNewPoints(int maxNewPoints)
Cap the maximum allowed number of new ponts.
GLfloat GLfloat GLfloat GLfloat h
SYS_FORCE_INLINE REAL incircle(const REAL pa[2], const REAL pb[2], const REAL pc[2], const REAL pd[2])
void allowConstraintSplit(bool enabled)
void setConstraintSplitPointGroupName(const UT_String &name)
void setConstraintSplitPointGroup(GA_PointGroup *new_pt_grp)
SIM_API const UT_StringHolder distance
bool hasConflictingConstraints() const
Query whether the triangulation had conflicting constraints.
SYS_FORCE_INLINE REAL orient2d(const REAL pa[2], const REAL pb[2], const REAL pc[2])
const std::string getWarningMessage()