46 #if GEOM_PSEUDO3D==GEOM_TRUE
47 #include "IsoContours.h"
48 #include "EfficientModel.h"
49 #include "CutAndFill.h"
50 #include "Visualizer3.h"
51 #include "CloudPrepare.h"
56 #if GEOM_PSEUDO3D==GEOM_TRUE
57 namespace GEOM_FADE25D {
58 #elif GEOM_PSEUDO3D==GEOM_FALSE
59 namespace GEOM_FADE2D {
61 #error GEOM_PSEUDO3D is not defined
129 explicit Fade_2D(
unsigned numExpectedVertices=3);
140 Fade_2D(
Fade_2D& other,std::vector<Zone2*> vZoneIn=std::vector<Zone2*>(),std::vector<Zone2*> vZoneOut=std::vector<Zone2*>());
204 bool saveZones(
const char* filename,std::vector<Zone2*>& vSaveZones);
231 bool saveZones(std::ostream& stream,std::vector<Zone2*>& vSaveZones);
249 bool load(
const char* filename,std::vector<Zone2*>& vZones);
266 bool load(std::istream& stream,std::vector<Zone2*>& vZones);
374 void show(
const char* filename,
bool bWithConstraints=
true)
const;
429 #if GEOM_PSEUDO3D==GEOM_TRUE
440 void showGeomview(
const char* filename,
const char* color=
"1 1 1 0.5")
const;
452 void showGeomview(Visualizer3* pVis,
const char* color=
"1 1 1 0.5")
const;
471 void remove(std::vector<Point2*>& vPoints);
489 void getConvexHull(
bool bAllVertices,std::vector<Point2*>& vConvexHullPointsOut);
491 #if GEOM_PSEUDO3D==GEOM_TRUE
516 void insert(CloudPrepare* pCloudPrepare,
bool bClear=
true);
545 void insert(
const std::vector<Point2>& vInputPoints);
564 void insert(
const std::vector<Point2>& vInputPoints,std::vector<Point2*>& vHandles);
566 #if GEOM_PSEUDO3D==GEOM_TRUE
651 #if GEOM_PSEUDO3D==GEOM_TRUE
672 bool getHeight(
double x,
double y,
double& heightOut,
Triangle2* pApproxT=NULL,
double tolerance=0)
const;
692 double minAngleDegree,
693 double minEdgeLength,
694 double maxEdgeLength,
695 bool bAllowConstraintSplitting
850 #if GEOM_PSEUDO3D==GEOM_TRUE
857 double getMedianEdgeLength25D();
916 #if GEOM_PSEUDO3D==GEOM_TRUE
918 std::vector<Segment2>& vSegments,
920 bool bOrientedSegments=
false,
921 bool bUseHeightOfLatest=
false
925 std::vector<Segment2>& vSegments,
927 bool bOrientedSegments=
false
959 #if GEOM_PSEUDO3D==GEOM_TRUE
981 Zone2* getPeeledZone(
double angleThreshold,
bool bAvoidSplit);
1001 Zone2*
createZone(
const std::vector<ConstraintGraph2*>& vConstraintGraphs,ZoneLocation zoneLoc,
const Point2& startPoint,
bool bVerbose=
true);
1165 #if GEOM_PSEUDO3D==GEOM_TRUE
1178 bool writePly(
const char* filename,
bool bASCII=
false)
const;
1192 bool writePly(std::ostream& os,
bool bASCII=
false)
const;
1273 bool checkZoneQuality(
Zone2* pZone,
double minAngle,
const char* name,
const AcceptExperimentalFeature& accept);
1275 void setName(
const char* s);
1277 std::string getName()
const;
1304 bool bReorientIfNeeded,
1305 bool bCreateExtendedBoundingBox
1333 #if GEOM_PSEUDO3D==GEOM_TRUE
1346 Zone2* importTrianglesFromPly(
const char* filename);
1360 Zone2* importTrianglesFromPly(std::istream& is);
1407 bool bTurnEdgesIntoConstraints);
1422 bool bTurnEdgesIntoConstraints);
1433 void getZones(std::vector<Zone2*>& vZones)
const;
1500 bool bProtectEdges);
1544 #if GEOM_PSEUDO3D==GEOM_TRUE
1545 bool drape( std::vector<Segment2>& vSegmentsIn,
1546 std::vector<Segment2>& vSegmentsOut,
1548 double offTolerance=0.0,
1549 bool bKeepOffSegments=
false)
const;
1551 bool drape( std::vector<Segment2>& vSegmentsIn,
1552 std::vector<Segment2>& vSegmentsOut,
1553 double offTolerance=0.0,
1554 bool bKeepOffSegments=
false)
const;
1581 void enableMultithreading();
1584 void internal(
int au,
int fu,
const char* s=
"");
1588 void setDev(
const char* s,
int ival,
double dval);
1592 void initFade(
unsigned numExpectedVertices);
1609 std::stringstream ss;
1611 dt1.
load(ss,vZones1);
ConstraintInsertionStrategy
Enum defining the available strategies for inserting constraints.
Definition: ConstraintSegment2.h:44
void copyFade(Fade_2D &dt0, std::vector< Zone2 * > &vZones0, Fade_2D &dt1, std::vector< Zone2 * > &vZones1)
Copy a Fade_2D object and selected Zone2 objects.
Definition: Fade_2D.h:1607
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
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
Triangle2 * getAdjacentTriangle(Point2 *p0, Point2 *p1) const
Get the adjacent triangle of an oriented edge.
void insert(const std::vector< Point2 > &vInputPoints, std::vector< Point2 * > &vHandles)
Insert points from a std::vector<Point2> and store pointers in vHandles.
bool drape(std::vector< Segment2 > &vSegmentsIn, std::vector< Segment2 > &vSegmentsOut, double offTolerance=0.0, bool bKeepOffSegments=false) const
Drape segments onto a surface.
void unsubscribe(MsgType msgType, MsgBase *pMsg)
Unregisters a message receiver.
int setNumCPU(int numCPU)
Set the number of CPU cores for multithreading (deprecated)
void setFastMode(bool bFast)
Set fast mode.
void getIncidentVertices(Point2 *pVtx, std::vector< Point2 * > &vAdjVtx) const
Get adjacent vertices.
void show(const char *filename, bool bWithConstraints=true) const
Draws the triangulation as a PostScript or PDF file.
void getConvexHull(bool bAllVertices, std::vector< Point2 * > &vConvexHullPointsOut)
Compute the convex hull.
void subscribe(MsgType msgType, MsgBase *pMsg)
Registers a message receiver.
bool hasArea() const
Check if the triangulation contains any triangles.
Zone2 * importTriangles_robust(std::vector< Point2 > &vPoints)
Import Triangles - Robust (Error-tolerant version)
Orientation2 getOrientation(const Point2 &p0, const Point2 &p1, const Point2 &p2)
Compute the orientation of 3 points.
void show(Visualizer2 *pVis, bool bWithConstraints=true) const
Draws the triangulation as a PostScript or PDF file.
void getUndirectedEdges(std::vector< Edge2 > &vUndirectedEdgesOut) const
Get undirected edges.
ConstraintGraph2 * createConstraint(std::vector< Segment2 > &vSegments, ConstraintInsertionStrategy cis, bool bOrientedSegments=false)
Insert constraint edges (edges, polyline or polygon) .
void insert(const std::vector< Point2 > &vInputPoints)
Insert a vector of points.
double measureTriangulationTime(const std::vector< Point2 > &vPoints)
Measure the Delaunay triangulation time.
Zone2 * createZone(ConstraintGraph2 *pConstraintGraph, ZoneLocation zoneLoc, const Point2 &startPoint, bool bVerbose=true)
Create a Zone2 bounded by a ConstraintGraph2 object by growing from a seed point.
void writeWebScene(const char *path, Zone2 *pZone) const
Create a scene of a Zone2 that can be viewed in a web browser.
void writeObj(const char *filename, Zone2 *pZone) const
Write a Zone2 an .obj file.
bool load(std::istream &stream, std::vector< Zone2 * > &vZones)
Load a triangulation from a binary file.
void getVertexPointers(std::vector< Point2 * > &vAllPoints) const
Get pointers to all vertices.
void writeObj(const char *filename) const
Write the current triangulation to an .obj file.
Bbox2 computeBoundingBox() const
Computes the axis-aligned bounding box of the triangulation.
Zone2 * createZone(const std::vector< ConstraintGraph2 * > &vConstraintGraphs, ZoneLocation zoneLoc, const Point2 &startPoint, bool bVerbose=true)
Create a Zone2 bounded by multiple ConstraintGraph2 objects by growing from a seed point.
void getTrianglePointers(std::vector< Triangle2 * > &vAllTriangles) const
Get pointers to all triangles.
Fade_2D(Fade_2D &other, std::vector< Zone2 * > vZoneIn=std::vector< Zone2 * >(), std::vector< Zone2 * > vZoneOut=std::vector< Zone2 * >())
Copy constructor.
void showVtk(VtkWriter *pVtkWriter, VtkColor color, VtkColor constraintColor=VTK_TRANSPARENT) const
Draws the triangulation using the VTK file format.
Point2 * insert(const Point2 &p)
Insert a single point.
void printLicense() const
Prints license information.
Fade_2D(unsigned numExpectedVertices=3)
Constructor of the triangulation class.
ConstraintSegment2 * getConstraintSegment(Point2 *p0, Point2 *p1) const
Retrieve a ConstraintSegment2.
void remove(Point2 *pVertex)
Remove a single vertex.
void getIncidentTriangles(Point2 *pVtx, std::vector< Triangle2 * > &vIncidentT) const
Get incident triangles.
bool saveTriangulation(const char *filename, std::vector< Zone2 * > &vSaveZones)
Save a triangulation to a binary file.
Zone2 * createZone(ConstraintGraph2 *pConstraintGraph, ZoneLocation zoneLoc, bool bVerbose=true)
Create a Zone2 .
Voronoi2 * getVoronoiDiagram()
Get the Voronoi diagram of the triangulation.
Point2 * getNearestNeighbor(const Point2 &p)
Get nearest neighbor.
bool saveZones(std::ostream &stream, std::vector< Zone2 * > &vSaveZones)
Save zones to a binary file.
bool saveTriangulation(std::ostream &stream, std::vector< Zone2 * > &vSaveZones)
Save a triangulation to a binary file.
void applyConstraintsAndZones()
Apply conforming constraints and zones (deprecated!)
void reset()
Reset the triangulation.
size_t numberOfPoints() const
Number of points.
Zone2 * createZone_cookieCutter(std::vector< Segment2 > &vSegments, bool bProtectEdges, ConstraintGraph2 *&pProtectedEdgesCG, ConstraintGraph2 *&pBoundaryCG)
Cookie Cutter (deprecated)
void getAliveAndDeadConstraintSegments(std::vector< ConstraintSegment2 * > &vAllConstraintSegments) const
Get all (alive and dead) constraint segments.
void getDirectedEdges(std::vector< Edge2 > &vDirectedEdgesOut) const
Get directed edges Edges are counterclockwise oriented around their triangle. The present method retu...
double getMedianEdgeLength2D()
Get the median 2D edge length.
void refineAdvanced(MeshGenParams *pParameters)
Delaunay refinement and grid meshing.
bool isConstraint(Point2 *pVtx) const
Check if a vertex is a constraint vertex.
bool load(const char *filename, std::vector< Zone2 * > &vZones)
Load a triangulation from a binary file.
Zone2 * createZone_cookieCutter2(std::vector< Segment2 > &vSegments, bool bProtectEdges)
Cookie Cutter2.
void cutTriangles(const Point2 &knifeStart, const Point2 &knifeEnd, bool bTurnEdgesIntoConstraints)
Cut through a triangulation.
void exportTriangulation(FadeExport &fadeExport, bool bWithCustomIndices, bool bClear)
Export triangulation data.
void statistics(const char *s) const
Statistics.
Point2 * getVertexPointer(const Point2 &p)
Get vertex pointer.
void getAliveConstraintSegments(std::vector< ConstraintSegment2 * > &vAliveConstraintSegments) const
Get active (alive) constraint segments.
void refine(Zone2 *pZone, double minAngleDegree, double minEdgeLength, double maxEdgeLength, bool bAllowConstraintSplitting)
Delaunay refinement.
void cutTriangles(std::vector< Segment2 > &vSegments, bool bTurnEdgesIntoConstraints)
Cut through a triangulation.
bool checkValidity(bool bCheckEmptyCircleProperty, const char *msg) const
Checks the validity of the triangulation.
Zone2 * createZone_cookieCutter(std::vector< Segment2 > &vSegments, bool bProtectEdges)
Cookie Cutter (deprecated)
bool saveZones(const char *filename, std::vector< Zone2 * > &vSaveZones)
Save zones to a binary file.
bool isConstraint(Triangle2 *pT, int ith) const
Check if an edge is a constraint edge.
bool isConstraint(Point2 *p0, Point2 *p1) const
Check if an edge is a constraint edge.
void writeWebScene(const char *path) const
Create a scene of a triangulation that can be viewed in a web browser.
void remove(std::vector< Point2 * > &vPoints)
Remove vertices.
void insert(int numPoints, double *aCoordinates, Point2 **aHandles)
Insert points from an array.
void showVtk(const char *filename, VtkColor color, VtkColor constraintColor=VTK_TRANSPARENT) const
Draws the triangulation using the VTK file format.
Zone2 * importTriangles(std::vector< Point2 > &vPoints, bool bReorientIfNeeded, bool bCreateExtendedBoundingBox)
Import Triangles (deprecated in favor of the robust version)
Zone2 * createZone_cookieCutter2(std::vector< Segment2 > &vSegments, bool bProtectEdges, ConstraintGraph2 *&pProtectedEdgesCG, ConstraintGraph2 *&pBoundaryCG)
Cookie Cutter2.
size_t numberOfTriangles() const
Number of triangles.
void deleteZone(Zone2 *pZone)
Delete a Zone2 object.
Zone2 * createZone(std::vector< Triangle2 * > &vTriangles, bool bVerbose=true)
Create a Zone2 defined by a vector of triangles.
Triangle2 * locate(const Point2 &p)
Locate a triangle that contains p.
Parameters for the mesh generator.
Definition: MeshGenParams.h:59
MsgBase, a base class for message subscriber classes.
Definition: MsgBase.h:55
Represents a 2D point.
Definition: Point2.h:61
Represents a triangle in a triangulation.
Definition: Triangle2.h:59
A PDF and Postscript Writer for 2D Visualization.
Definition: Visualizer2.h:60
Voronoi diagram.
Definition: Voronoi2.h:63
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:82
FadeExport is a simple struct to export triangulation data.
Definition: FadeExport.h:49