Fade2D Documentation pages v1.86
Delaunay Features
freeFunctions.h
1 // Copyright (C) Geom Software e.U, Bernhard Kornberger, Graz/Austria
2 //
3 // This file is part of the Fade2D library. The student license is free
4 // of charge and covers personal non-commercial research. Licensees
5 // holding a commercial license may use this file in accordance with
6 // the Commercial License Agreement.
7 //
8 // This software is provided AS IS with NO WARRANTY OF ANY KIND,
9 // INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
10 // FOR A PARTICULAR PURPOSE.
11 //
12 // Please contact the author if any conditions of this licensing are
13 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
17 
18 
19 
20 #pragma once
21 #include "Point2.h"
22 #include "Segment2.h"
23 #include "Edge2.h"
24 #include <vector>
25 
26 
27 #if GEOM_PSEUDO3D==GEOM_TRUE
28  namespace GEOM_FADE25D {
29 #elif GEOM_PSEUDO3D==GEOM_FALSE
30  namespace GEOM_FADE2D {
31 #else
32  #error GEOM_PSEUDO3D is not defined
33 #endif
34 
35 class Mesh3;
36 
54 CLASS_DECLSPEC
55 void pointsToPolyline(std::vector<Point2>& vInPoints,bool bClose,std::vector<Segment2>& vOutSegments);
56 
57 
58 
67 CLASS_DECLSPEC
68 bool isSimplePolygon(std::vector<Segment2>& vSegments);
69 
70 #if GEOM_PSEUDO3D==GEOM_TRUE
71 
82 CLASS_DECLSPEC
83 Vector2 getNormalVector( const Point2& p0,
84  const Point2& p1,
85  const Point2& p2,
86  bool& bOK);
87 #endif
88 
89 
90 
91 
92 #if GEOM_PSEUDO3D==GEOM_TRUE
93 
102 CLASS_DECLSPEC
103 double getArea25D(Point2* p0,Point2* p1,Point2* p2);
104 
105 #else
106 
115 CLASS_DECLSPEC
116 double getArea2D(Point2* p0,Point2* p1,Point2* p2);
117 #endif
118 
124 CLASS_DECLSPEC
125 void getDirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vDirectedEdgesOut);
126 
131 CLASS_DECLSPEC
132 void getUndirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vUndirectedEdgesOut);
133 
134 
155 CLASS_DECLSPEC
156 bool fillHole( std::vector<std::pair<Segment2,Vector2> > vPolygonSegments,
157  bool bWithRefine,
158  bool bVerbose,
159  std::vector<Point2>& vCornersOut
160  );
161 
162 
163 
164 
165 #if GEOM_PSEUDO3D==GEOM_TRUE
166 
181 CLASS_DECLSPEC
182 bool fillHole( std::vector<Point2>& vMeshCorners,
183  std::vector<Segment2>& vPolygonSegments,
184  bool bWithRefine,
185  bool bVerbose,
186  std::vector<Point2>& vCornersOut
187  );
188 
203 CLASS_DECLSPEC
204 bool fillHole( Mesh3* pMesh,
205  std::vector<Edge2>& vPolygonEdges,
206  bool bWithRefine,
207  bool bVerbose,
208  std::vector<Point2>& vCornersOut
209  );
210 #endif
211 
212 
242 CLASS_DECLSPEC
243 void edgesToPolygons(
244  std::vector<Edge2>& vEdgesIn,
245  std::vector<std::vector<Edge2> >& vvPolygonsOut,
246  std::vector<Edge2>& vRemainingOut
247  );
248 
257 CLASS_DECLSPEC
258 void getBorders(const std::vector<Triangle2*>& vT,std::vector<Segment2>& vBorderSegmentsOut);
264 CLASS_DECLSPEC
265 bool sortRing(std::vector<Segment2>& vRing);
266 
273 CLASS_DECLSPEC
274 bool sortRingCCW(std::vector<Segment2>& vRing);
275 
276 
288 FUNC_DECLSPEC
289 Orientation2 getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2);
297 FUNC_DECLSPEC
298 Orientation2 getOrientation2_mt(const Point2* p0,const Point2* p1,const Point2* p2);
299 
301 CLASS_DECLSPEC
302 const char* getString(const Orientation2 ori);
303 
313 CLASS_DECLSPEC
314 const char* getFade2DVersion();
317 FUNC_DECLSPEC
321 FUNC_DECLSPEC
325 FUNC_DECLSPEC
326 int getRevisionNumber();
329 FUNC_DECLSPEC
330 bool isRelease();
331 
332 
334 FUNC_DECLSPEC
335 void setLic(
336  const char* l1,
337  const char* l2,
338  const char* dt,
339  const char* s1,
340  const char* s2_
341  );
343 class Lic;
345 Lic* getLic();
346 
361 // READ AND WRITE, ASCII
364 
382 FUNC_DECLSPEC
383 bool writePointsASCII(const char* filename,const std::vector<Point2*>& vPointsIn);
384 
391 CLASS_DECLSPEC
392 bool writePointsASCII(const char* filename,const std::vector<Point2>& vPointsIn);
393 
394 
395 
396 
397 
407 FUNC_DECLSPEC
408 bool readXY(const char* filename,std::vector<Point2>& vPointsOut);
409 
410 #if GEOM_PSEUDO3D==GEOM_TRUE
411 // ONLY 2.5D
417 FUNC_DECLSPEC
418 bool readXYZ(const char* filename,std::vector<Point2>& vPointsOut);
419 #endif
420 
421 
423 // READ AND WRITE, BINARY
425 
426 
427 
449 CLASS_DECLSPEC
450 bool writePointsBIN(const char* filename,std::vector<Point2>& vPointsIn);
451 
458 CLASS_DECLSPEC
459 bool writePointsBIN(const char* filename,std::vector<Point2*>& vPointsIn);
460 
467 CLASS_DECLSPEC
468 bool readPointsBIN(const char* filename, std::vector<Point2>& vPointsIn);
469 
507 CLASS_DECLSPEC
508 bool writeSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsIn);
509 
516 CLASS_DECLSPEC
517 bool readSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsOut);
518 
519 
520 
521 
522 
523 
525 } // NAMESPACE
GEOM_FADE2D::readXY
FUNC_DECLSPEC bool readXY(const char *filename, std::vector< Point2 > &vPointsOut)
Read (x y) points.
GEOM_FADE2D::readPointsBIN
bool readPointsBIN(const char *filename, std::vector< Point2 > &vPointsIn)
Read points from a binary file.
GEOM_FADE2D::getDirectedEdges
void getDirectedEdges(std::vector< Triangle2 * > &vT, std::vector< Edge2 > &vDirectedEdgesOut)
Get directed edge The directed edges of vT are returned vDirectedEdgesOut. Directed means that each e...
GEOM_FADE2D::writePointsBIN
bool writePointsBIN(const char *filename, std::vector< Point2 * > &vPointsIn)
Write points to a binary file.
GEOM_FADE2D::getFade2DVersion
const char * getFade2DVersion()
Get the Fade2D version string.
GEOM_FADE2D::readSegmentsBIN
bool readSegmentsBIN(const char *filename, std::vector< Segment2 > &vSegmentsOut)
Read segments from a binary file.
GEOM_FADE2D::getUndirectedEdges
void getUndirectedEdges(std::vector< Triangle2 * > &vT, std::vector< Edge2 > &vUndirectedEdgesOut)
Get undirected edges.
GEOM_FADE2D::isRelease
FUNC_DECLSPEC bool isRelease()
Check if a RELEASE or a DEBUG version is used.
GEOM_FADE2D::getOrientation2_mt
FUNC_DECLSPEC Orientation2 getOrientation2_mt(const Point2 *p0, const Point2 *p1, const Point2 *p2)
Get Orientation2 (MT)
GEOM_FADE2D::getBorders
void getBorders(const std::vector< Triangle2 * > &vT, std::vector< Segment2 > &vBorderSegmentsOut)
Get Borders.
GEOM_FADE2D::writePointsASCII
bool writePointsASCII(const char *filename, const std::vector< Point2 > &vPointsIn)
Write points to an ASCII file.
GEOM_FADE2D::getMinorVersionNumber
FUNC_DECLSPEC int getMinorVersionNumber()
Get the minor version number.
GEOM_FADE2D::getRevisionNumber
FUNC_DECLSPEC int getRevisionNumber()
Get the revision version number.
GEOM_FADE2D::getOrientation2
FUNC_DECLSPEC Orientation2 getOrientation2(const Point2 *p0, const Point2 *p1, const Point2 *p2)
Get the orientation of three points.
GEOM_FADE2D::getMajorVersionNumber
FUNC_DECLSPEC int getMajorVersionNumber()
Get the major version number.
GEOM_FADE2D::getArea2D
double getArea2D(Point2 *p0, Point2 *p1, Point2 *p2)
Get 2D area of a triangle.
GEOM_FADE2D::writeSegmentsBIN
bool writeSegmentsBIN(const char *filename, std::vector< Segment2 > &vSegmentsIn)
Write segments to a binary file.
GEOM_FADE2D::fillHole
bool fillHole(std::vector< std::pair< Segment2, Vector2 > > vPolygonSegments, bool bWithRefine, bool bVerbose, std::vector< Point2 > &vCornersOut)
Fill a hole in a 3D mesh with triangles (deprecated)
GEOM_FADE2D::pointsToPolyline
void pointsToPolyline(std::vector< Point2 > &vInPoints, bool bClose, std::vector< Segment2 > &vOutSegments)
Points-to-Polyline.
GEOM_FADE2D::sortRing
bool sortRing(std::vector< Segment2 > &vRing)
Sort a vector of Segments.
GEOM_FADE2D::edgesToPolygons
void edgesToPolygons(std::vector< Edge2 > &vEdgesIn, std::vector< std::vector< Edge2 > > &vvPolygonsOut, std::vector< Edge2 > &vRemainingOut)
Create polygons from a set of edges.
GEOM_FADE2D::isSimplePolygon
bool isSimplePolygon(std::vector< Segment2 > &vSegments)
isSimplePolygon
GEOM_FADE2D::sortRingCCW
bool sortRingCCW(std::vector< Segment2 > &vRing)
Sort a vector of Segments.