34 #if GEOM_PSEUDO3D==GEOM_TRUE
35 namespace GEOM_FADE25D {
36 #elif GEOM_PSEUDO3D==GEOM_FALSE
37 namespace GEOM_FADE2D {
39 #error GEOM_PSEUDO3D is not defined
43 class ConstraintSegment2;
61 class ConstraintGraph2;
102 Zone2(Dt2* pDt_,ZoneLocation zoneLoc_);
106 Zone2(Dt2* pDt_,ZoneLocation zoneLoc_,
const std::vector<ConstraintGraph2*>& vConstraintGraphs_);
108 Zone2(Dt2* pDt_,
const std::vector<ConstraintGraph2*>& vConstraintGraphs_,ZoneLocation zoneLoc_,std::vector<Point2>& vStartPoints);
201 bool save(
const char* filename);
221 bool save(std::ostream& stream);
245 void getOffsetBoundary(
double offset,std::vector<Segment2>& vOffsetBoundary,
double mergeAngleDeg=10.0,
double angleStepDeg=20.0);
292 void show(
const char* filename,
bool bShowFull,
bool bWithConstraints)
const;
328 #if GEOM_PSEUDO3D==GEOM_TRUE
335 void showGeomview(
const char* filename,
const char* color)
const;
342 void showGeomview(Visualizer3* pVis,
const char* color)
const;
345 void analyzeAngles(
const char* name=
"");
364 void smoothing(
int numIterations=2,
bool bWithXY=
true);
386 void smoothing2(
int numIterations,
bool bWithXY,
bool bWithConstraintZ);
458 void optimizeValleysAndRidges(
double tolerance2D,
double lowerThreshold25D);
486 bool assignDt2(Dt2* pDt_);
532 Dt2* getDelaunayTriangulation()
const;
552 void getBoundaryEdges(std::vector<Edge2>& vEdges)
const;
588 #if GEOM_PSEUDO3D==GEOM_TRUE
596 double getArea25D()
const;
613 #if GEOM_PSEUDO3D==GEOM_TRUE
621 bool writePly(
const char* filename,
bool bASCII=
false)
const;
629 bool writePly(std::ostream& os,
bool bASCII=
false)
const;
639 void optMode_standard_sub(std::vector<Triangle2*>& vT,std::vector<Triangle2*>& vChangedT);
641 void optMode_standard();
643 double optMode_prioq(
double noEdgeBelowDih,
bool bWithProgress);
645 void getEdgesForOptimization(
double noEdgeBelowDegree,std::vector<Edge2>& vEdges);
647 void optMode_simulatedAnnealing();
649 void optMode_simulatedAnnealing_sub(std::vector<Edge2>& vUniqueEdges,
double temperature);
651 void removeConstraintEdges(std::vector<Edge2>& vEdges)
const;
655 void getTriangles_RESULT(std::vector<Triangle2*>& vTriangles)
const;
657 void initWorkspace(
bool bInside,std::set<std::pair<Point2*,Point2*> >& sNoGrowEdges,std::vector<Triangle2*>& vWorkspace)
const;
659 void bfsFromWorkspace(std::vector<Triangle2*>& vWorkspace,std::set<std::pair<Point2*,Point2*> >& sNoGrowEdges,std::vector<Triangle2*>& vTriangles)
const;
661 Zone2* ctbz_treatCC(std::vector<Triangle2*>& vOneCC);
666 Progress* pZoneProgress;
668 ZoneShooter* pZoneShooter;
670 ZoneLocation zoneLoc;
713 #pragma warning(push)
714 #pragma warning(disable:4251)
717 std::vector<ConstraintGraph2*> vConstraintGraphs;
718 std::vector<Point2> vStartPoints;
719 std::vector<Zone2*> vInputZones;
VtkColor
Enumeration of colors used by the VTKWriter.
Definition: VtkWriter.h:39
Zone2 * zoneSymmetricDifference(Zone2 *pZone0, Zone2 *pZone1)
Computes the symmetric difference between two Zone2 objects.
Zone2 * zoneDifference(Zone2 *pZone0, Zone2 *pZone1)
Computes the difference between two Zone2 objects.
Zone2 * zoneUnion(Zone2 *pZone0, Zone2 *pZone1)
Computes the union of two Zone2 objects.
Zone2 * zoneIntersection(Zone2 *pZone0, Zone2 *pZone1)
Computes the intersection of two Zone2 objects.
OptimizationMode
Definition: Zone2.h:53
@ OPTMODE_STANDARD
Fastest optimization mode.
Definition: Zone2.h:54
@ OPTMODE_BEST
Best quality but quite time consuming.
Definition: Zone2.h:56
@ OPTMODE_BETTER
Considerably better quality and still fast.
Definition: Zone2.h:55
Bbox2 is an axis aligned 2D bounding box.
Definition: Bbox2.h:37
ConstraintGraph2 is a set of Constraint Edges (ConstraintSegment2)
Definition: ConstraintGraph2.h:52
A ConstraintSegment2 represents a Constraint Edge.
Definition: ConstraintSegment2.h:69
MsgBase, a base class for message subscriber classes.
Definition: MsgBase.h:47
User-defined peel predicate.
Definition: UserPredicates.h:60
Point.
Definition: Point2.h:53
Triangle.
Definition: Triangle2.h:60
User-defined predicate (deprecated)
Definition: UserPredicates.h:39
Visualizer2 is a PDF- and Postscript writer.
Definition: Visualizer2.h:55
A writer for the VTK file format.
Definition: VtkWriter.h:62
**
Definition: Zone2.h:99
bool hasOnBoundary(const Point2 &p)
Checks if the given point lies on the boundary of the zone.
friend Zone2 * peelOffIf(Zone2 *pZone, UserPredicateT *pPredicate, bool bVerbose)
Peel off border triangles (deprecated)
ConstraintGraph2 * getConstraintGraph() const
Get the associated constraint.
bool save(std::ostream &stream)
Save the zone.
Bbox2 getBoundingBox() const
Compute the bounding box.
void showVtk(const char *filename, VtkColor zoneColor, VtkColor nonZoneColor=VTK_TRANSPARENT, VtkColor constraintColor=VTK_TRANSPARENT) const
VTK visualization.
double getArea2D() const
Get 2D Area.
void writeObj(const char *outFilename) const
Write the zone to *.obj Writes the triangles of the present Zone2 to an *.obj file (The *....
size_t numberOfConstraintGraphs() const
Get a the number of ConstraintGraph2 objects.
bool shiftToZone(const Point2 &from, double tolerance, Point2 &result)
Finds a point close to the input point that lies inside the zone.
friend Zone2 * zoneIntersection(Zone2 *pZone0, Zone2 *pZone1)
Computes the intersection of two Zone2 objects.
void getOffsetBoundary(double offset, std::vector< Segment2 > &vOffsetBoundary, double mergeAngleDeg=10.0, double angleStepDeg=20.0)
Get the boundary of an offset shape.
void getTriangles(std::vector< Triangle2 * > &vTriangles_) const
Get the triangles of the zone.
Triangle2 * locate(const Point2 &p)
Locates the triangle containing the given point within the zone.
void getComponentPolygons(std::vector< CompPolygon > &vCompPolygons) const
Get connected components and their boundary polygons.
void show(Visualizer2 *pVisualizer, bool bShowFull, bool bWithConstraints) const
Postscript- and PDF-visualization.
bool hasOn(const Point2 &p)
Checks if the given point lies on the zone or its boundary.
void show(const char *filename, bool bShowFull, bool bWithConstraints) const
Postscript- and PDF-visualization.
void subscribe(MsgType msgType, MsgBase *pMsg)
Register a message receiver.
void getBoundarySegments(std::vector< Segment2 > &vSegments) const
Compute the boundary segments.
void getConstraintGraphs(std::vector< ConstraintGraph2 * > &vConstraintGraphs_) const
Get the associated constraint graphs.
friend Zone2 * zoneSymmetricDifference(Zone2 *pZone0, Zone2 *pZone1)
Computes the symmetric difference between two Zone2 objects.
ZoneLocation getZoneLocation() const
Get the zone location.
void getVertices(std::vector< Point2 * > &vVertices_) const
Get the vertices of the zone.
void exportZone(FadeExport &fadeExport, bool bWithCustomIndices) const
Export triangles from a zone.
friend Zone2 * zoneUnion(Zone2 *pZone0, Zone2 *pZone1)
Computes the union of two Zone2 objects.
void showVtk(VtkWriter *pVtk, VtkColor zoneColor, VtkColor nonZoneColor=VTK_TRANSPARENT, VtkColor constraintColor=VTK_TRANSPARENT) const
VTK visualization.
void unsubscribe(MsgType msgType, MsgBase *pMsg)
Unregister a message receiver.
void debug(const char *name="")
Development function.
size_t getNumberOfTriangles() const
Get the number of triangles.
friend Zone2 * peelOffIf(Zone2 *pZone, bool bAvoidSplit, PeelPredicateTS *pPredicate)
Peel off border triangles.
bool save(const char *filename)
Save the zone.
Zone2 * convertToBoundedZone()
Convert a zone to a bounded zone.
void unifyGrid(double tolerance)
void statistics(const char *s) const
void getBorderEdges(std::vector< Edge2 > &vBorderEdgesOut) const
Get border edges.
ConstraintSegment2 * getNearbyBoundaryConstraint(Point2 &p, double tolerance)
Locates the nearest boundary ConstraintSegment2 of the zone within a specified distance.
friend Zone2 * zoneDifference(Zone2 *pZone0, Zone2 *pZone1)
Computes the difference between two Zone2 objects.
FadeExport is a simple struct to export triangulation data.
Definition: FadeExport.h:48