35 #if GEOM_PSEUDO3D==GEOM_TRUE
36 namespace GEOM_FADE25D {
37 #elif GEOM_PSEUDO3D==GEOM_FALSE
38 namespace GEOM_FADE2D {
40 #error GEOM_PSEUDO3D is not defined
44 class ConstraintSegment2;
69 enum SegmentSelectionType
80 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);
138 #if GEOM_PSEUDO3D==GEOM_TRUE
239 bool save(
const char* filename);
264 bool save(std::ostream& stream);
300 void getOffsetBoundary(
double offset,std::vector<Segment2>& vOffsetBoundary,
double mergeAngleDeg=10.0,
double angleStepDeg=20.0)
const;
443 void show(
const char* filename,
const Colorname& zoneFillColor=CTRANSPARENT,
const Colorname& zoneEdgeColor=CBLACK,
const Colorname& nonZoneFillColor=CTRANSPARENT,
const Colorname& nonZoneEdgeColor=CTRANSPARENT,
const Colorname& constraintEdgeColor=CTRANSPARENT)
const;
469 void show(
const char* filename,
bool bShowFull,
bool bWithConstraints)
const;
511 #if GEOM_PSEUDO3D==GEOM_TRUE
534 void analyzeAngles(
const char* name=
"");
573 void smoothing2(
int numIterations,
bool bWithXY,
bool bWithConstraintZ);
645 void optimizeValleysAndRidges(
double tolerance2D,
double lowerThreshold25D);
669 bool assignDt2(Dt2* pDt_);
717 Dt2* getDelaunayTriangulation()
const;
728 void debug(
const char* name=
"");
738 void getBoundaryEdges(std::vector<Edge2>& vEdges)
const;
783 #if GEOM_PSEUDO3D==GEOM_TRUE
816 #if GEOM_PSEUDO3D==GEOM_TRUE
829 bool writePly(
const char* filename,
bool bASCII=
false)
const;
842 bool writePly(std::ostream& os,
bool bASCII=
false)
const;
862 void getReplicationData( SegmentSelectionType segmentSelectionType,
863 std::vector<Point2>& vPoints,
864 std::vector<Segment2>& vInnerSegments,
865 std::vector<Segment2>& vBoundarySegments
873 void optMode_standard_sub(std::vector<Triangle2*>& vT,std::vector<Triangle2*>& vChangedT);
875 void optMode_standard();
877 double optMode_prioq(
double noEdgeBelowDih,
bool bWithProgress);
879 void getEdgesForOptimization(
double noEdgeBelowDegree,std::vector<Edge2>& vEdges);
881 void optMode_simulatedAnnealing();
883 void optMode_simulatedAnnealing_sub(std::vector<Edge2>& vUniqueEdges,
double temperature);
885 void removeConstraintEdges(std::vector<Edge2>& vEdges)
const;
889 void getTriangles_RESULT(std::vector<Triangle2*>& vTriangles)
const;
891 void initWorkspace(
bool bInside,std::set<std::pair<Point2*,Point2*> >& sNoGrowEdges,std::vector<Triangle2*>& vWorkspace)
const;
893 void bfsFromWorkspace(std::vector<Triangle2*>& vWorkspace,std::set<std::pair<Point2*,Point2*> >& sNoGrowEdges,std::vector<Triangle2*>& vTriangles)
const;
895 Zone2* ctbz_treatCC(std::vector<Triangle2*>& vOneCC);
900 Progress* pZoneProgress;
902 ZoneShooter* pZoneShooter;
904 ZoneLocation zoneLoc;
951 #pragma warning(push)
952 #pragma warning(disable:4251)
955 std::vector<ConstraintGraph2*> vConstraintGraphs;
956 std::vector<Point2> vStartPoints;
957 std::vector<Zone2*> vInputZones;
Colorname
Predefined colors for convenience.
Definition: Color.h:36
MsgType
Message types for the message system.
Definition: MsgBase.h:40
VtkColor
Enumeration of colors used by the VTKWriter class to represent various colors in the VTK file format.
Definition: VtkWriter.h:39
CLASS_DECLSPEC Zone2 * zoneSymmetricDifference(Zone2 *pZone0, Zone2 *pZone1)
Computes the symmetric difference between two Zone2 objects.
CLASS_DECLSPEC Zone2 * zoneIntersection(Zone2 *pZone0, Zone2 *pZone1)
Computes the intersection of two Zone2 objects.
OptimizationMode
Definition: Zone2.h:55
@ OPTMODE_BEST
Best quality but quite time consuming.
Definition: Zone2.h:58
@ OPTMODE_STANDARD
Fastest optimization mode.
Definition: Zone2.h:56
@ OPTMODE_BETTER
Considerably better quality and still fast.
Definition: Zone2.h:57
CLASS_DECLSPEC Zone2 * zoneUnion(Zone2 *pZone0, Zone2 *pZone1)
Computes the union of two Zone2 objects.
CLASS_DECLSPEC Zone2 * zoneDifference(Zone2 *pZone0, Zone2 *pZone1)
Computes the difference between two Zone2 objects.
A 2D axis-aligned bounding box.
Definition: Bbox2.h:39
A constraint graph is a collection of constraint edges (ConstraintSegment2).
Definition: ConstraintGraph2.h:56
A ConstraintSegment2 represents a constraint edge between two vertices of a Delaunay triangulation.
Definition: ConstraintSegment2.h:71
Fade_2D is a class that contains a Delaunay triangulation.
Definition: Fade_2D.h:122
MsgBase, a base class for message subscriber classes.
Definition: MsgBase.h:55
User-defined peel predicate.
Definition: UserPredicates.h:57
Represents a 2.5D point.
Definition: Point2.h:76
Represents a triangle in a triangulation.
Definition: Triangle2.h:59
User-defined predicate (deprecated)
Definition: UserPredicates.h:38
A PDF and Postscript Writer for 2D Visualization.
Definition: Visualizer2.h:60
Visualizer3 is a 3D scene writer for the Geomview viewer.
Definition: Visualizer3.h:45
A class for writing data to the VTK file format for visualization purposes.
Definition: VtkWriter.h:76
Represents a defined area within a triangulation.
Definition: Zone2.h:99
bool hasOn(const Point2 &p)
Checks if a point lies on the zone.
void subscribe(MsgType msgType, MsgBase *pMsg)
Registers a message receiver.
void unsubscribe(MsgType msgType, MsgBase *pMsg)
Unregisters a message receiver.
size_t getNumberOfTriangles() const
Get the number of triangles.
ConstraintGraph2 * getConstraintGraph() const
Get the associated constraint.
Bbox2 getBoundingBox() const
Compute the bounding box.
CLASS_DECLSPEC friend Zone2 * zoneSymmetricDifference(Zone2 *pZone0, Zone2 *pZone1)
Computes the symmetric difference between two Zone2 objects.
void show(Visualizer2 *pVisualizer, const Colorname &zoneFillColor=CTRANSPARENT, const Colorname &zoneEdgeColor=CBLACK, const Colorname &nonZoneFillColor=CTRANSPARENT, const Colorname &nonZoneEdgeColor=CTRANSPARENT, const Colorname &constraintEdgeColor=CTRANSPARENT) const
Postscript- and PDF visualization.
void getComponentPolygons(std::vector< CompPolygon > &vCompPolygons) const
Get connected components.
bool save(std::ostream &stream)
Save the zone.
CLASS_DECLSPEC friend Zone2 * zoneUnion(Zone2 *pZone0, Zone2 *pZone1)
Computes the union of two Zone2 objects.
ZoneLocation getZoneLocation() const
Get the zone location.
double getMedianEdgeLength25D()
Get the median 2.5D edge length.
void getOffsetBoundary(double offset, std::vector< Segment2 > &vOffsetBoundary, double mergeAngleDeg=10.0, double angleStepDeg=20.0) const
Get the offset boundary of a shape.
void unifyGrid(double tolerance)
Unify Grid.
void getTriangles(std::vector< Triangle2 * > &vTriangles) const
Get the triangles of the zone.
void getConstraintGraphs(std::vector< ConstraintGraph2 * > &vConstraintGraphs_) const
Get the associated constraint graphs.
void show(Visualizer2 *pVisualizer, bool bShowFull, bool bWithConstraints) const
Postscript- and PDF-visualization.
void exportZone(FadeExport &fadeExport, bool bWithCustomIndices) const
Export triangles from a zone.
void showGeomview(const char *filename, const char *color) const
Geomview visualization.
double getMedianEdgeLength2D()
Get the median 2D edge length.
double getArea2D() const
Get 2D Area.
Triangle2 * locate(const Point2 &p)
Locates the triangle containing the given point within the zone.
void getVertices(std::vector< Point2 * > &vVertices_) const
Get the vertices of the zone.
bool shiftToZone(const Point2 &q, double tolerance, Point2 &result)
Finds a point close to the query that lies inside the zone.
bool writePly(std::ostream &os, bool bASCII=false) const
Write the Zone2 to a *.ply file.
void smoothing2(int numIterations, bool bWithXY, bool bWithConstraintZ)
Smooths the vertices of the zone.
void showVtk(VtkWriter *pVtk, VtkColor zoneColor, VtkColor nonZoneColor=VTK_TRANSPARENT, VtkColor constraintColor=VTK_TRANSPARENT) const
VTK visualization.
Zone2 * morphClose(Fade_2D *pFade, double offset, double mergeAngleDeg=10.0, double angleStep=20.0) const
Morphological closing to bridge small gaps in the Zone2.
ConstraintSegment2 * getNearbyBoundaryConstraint(Point2 &p, double tolerance)
Locates the nearest boundary ConstraintSegment2 of the Zone2.
Zone2 * convertToBoundedZone()
Convert a zone to a bounded zone.
CLASS_DECLSPEC friend Zone2 * peelOffIf(Zone2 *pZone, bool bAvoidSplit, PeelPredicateTS *pPredicate)
Peel off undesired border triangles.
void showVtk(const char *filename, VtkColor zoneColor, VtkColor nonZoneColor=VTK_TRANSPARENT, VtkColor constraintColor=VTK_TRANSPARENT) const
VTK visualization.
double getArea25D() const
Get 2.5D Area.
Zone2 * createOffsetZone(Fade_2D *pFade, double offset, double mergeAngleDeg=10, double angleStep=20.0) const
Creates an offset zone.
void getBorderEdges(std::vector< Edge2 > &vBorderEdgesOut) const
Get border edges.
void showGeomview(Visualizer3 *pVis, const char *color) const
Geomview visualization.
CLASS_DECLSPEC friend Zone2 * zoneDifference(Zone2 *pZone0, Zone2 *pZone1)
Computes the difference between two Zone2 objects.
size_t numberOfConstraintGraphs() const
Get the number of ConstraintGraph2 objects.
void writeObj(const char *filename) const
Write the Zone2 to an .obj file.
Zone2 * morphOpen(Fade_2D *pFade, double offset, double mergeAngleDeg=10.0, double angleStep=20.0) const
Morphological opening to remove small details.
void show(const char *filename, bool bShowFull, bool bWithConstraints) const
Postscript- and PDF-visualization.
void statistics(const char *s) const
Prints statistics.
bool save(const char *filename)
Save the zone.
bool writePly(const char *filename, bool bASCII=false) const
Write the Zone2 to a *.ply file.
void getBoundarySegments(std::vector< Segment2 > &vSegments) const
Get the boundaries as segments.
bool hasOnBoundary(const Point2 &p)
Checks if a point lies on the boundary of the zone.
void smoothing(int numIterations=2, bool bWithXY=true)
Smoothing.
void show(const char *filename, const Colorname &zoneFillColor=CTRANSPARENT, const Colorname &zoneEdgeColor=CBLACK, const Colorname &nonZoneFillColor=CTRANSPARENT, const Colorname &nonZoneEdgeColor=CTRANSPARENT, const Colorname &constraintEdgeColor=CTRANSPARENT) const
Postscript- and PDF visualization.
void slopeValleyRidgeOptimization(OptimizationMode om=OPTMODE_BETTER)
Optimize Slopes, Valleys, and Ridges.
CLASS_DECLSPEC friend Zone2 * peelOffIf(Zone2 *pZone, UserPredicateT *pPredicate, bool bVerbose)
Peel off undesired border triangles (deprecated)
CLASS_DECLSPEC friend Zone2 * zoneIntersection(Zone2 *pZone0, Zone2 *pZone1)
Computes the intersection of two Zone2 objects.
FadeExport is a simple struct to export triangulation data.
Definition: FadeExport.h:49