Fade2.5D Documentation pages v1.90
Delaunay Features
freeFunctions.h
Go to the documentation of this file.
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 
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 
48 CLASS_DECLSPEC
50  double offset,
51  std::vector<Point2>& vOrgPoints,
52  std::vector<Point2>& vOffsetPoints
53  );
54 
55 
56 // Expects _one_ edge-connected component. No problem if the component
57 // forms a ring around a void that touches only at one vertex. But keep
58 // in mind that two completely disjoint borders may exist. This is why
59 // we use sIgnorePairs.
79 CLASS_DECLSPEC
80 void getSortedBoundaryPolygons( std::vector<Triangle2*>& vConnectedComponent,
81  std::vector<Edge2>& vOutsidePolygon,
82  std::vector<std::vector<Edge2> >& vHolePolygons
83  );
84 
85 
103 CLASS_DECLSPEC
104 void pointsToPolyline(std::vector<Point2>& vInPoints,bool bClose,std::vector<Segment2>& vOutSegments);
105 
106 
107 
116 CLASS_DECLSPEC
117 bool isSimplePolygon(std::vector<Segment2>& vSegments);
118 
119 #if GEOM_PSEUDO3D==GEOM_TRUE
131 CLASS_DECLSPEC
133  const Point2& p1,
134  const Point2& p2,
135  bool& bOK);
136 #endif
137 
138 
139 
140 
141 #if GEOM_PSEUDO3D==GEOM_TRUE
151 CLASS_DECLSPEC
152 double getArea25D(Point2* p0,Point2* p1,Point2* p2);
153 #endif
154 
155 
169 CLASS_DECLSPEC
170 double getArea2D(Point2* p0,Point2* p1,Point2* p2);
171 
172 
178 CLASS_DECLSPEC
179 void getDirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vDirectedEdgesOut);
180 
185 CLASS_DECLSPEC
186 void getUndirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vUndirectedEdgesOut);
187 
188 
209 CLASS_DECLSPEC
210 bool fillHole( std::vector<std::pair<Segment2,Vector2> > vPolygonSegments,
211  bool bWithRefine,
212  bool bVerbose,
213  std::vector<Point2>& vCornersOut
214  );
215 
216 
217 
218 
219 #if GEOM_PSEUDO3D==GEOM_TRUE
235 CLASS_DECLSPEC
236 bool fillHole( std::vector<Point2>& vMeshCorners,
237  std::vector<Segment2>& vPolygonSegments,
238  bool bWithRefine,
239  bool bVerbose,
240  std::vector<Point2>& vCornersOut
241  );
242 
257 CLASS_DECLSPEC
258 bool fillHole( Mesh3* pMesh,
259  std::vector<Edge2>& vPolygonEdges,
260  bool bWithRefine,
261  bool bVerbose,
262  std::vector<Point2>& vCornersOut
263  );
264 #endif
265 
266 
296 CLASS_DECLSPEC
298  std::vector<Edge2>& vEdgesIn,
299  std::vector<std::vector<Edge2> >& vvPolygonsOut,
300  std::vector<Edge2>& vRemainingOut
301  );
302 
311 CLASS_DECLSPEC
312 void getBorders(const std::vector<Triangle2*>& vT,std::vector<Segment2>& vBorderSegmentsOut);
318 CLASS_DECLSPEC
319 bool sortRing(std::vector<Segment2>& vRing);
320 
327 CLASS_DECLSPEC
328 bool sortRingCCW(std::vector<Segment2>& vRing);
329 
330 
342 FUNC_DECLSPEC
343 Orientation2 getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2);
351 FUNC_DECLSPEC
352 Orientation2 getOrientation2_mt(const Point2* p0,const Point2* p1,const Point2* p2);
353 
355 CLASS_DECLSPEC
356 const char* getString(const Orientation2 ori);
357 
367 CLASS_DECLSPEC
368 const char* getFade2DVersion();
371 FUNC_DECLSPEC
375 FUNC_DECLSPEC
379 FUNC_DECLSPEC
383 FUNC_DECLSPEC
384 bool isRelease();
385 
387 FUNC_DECLSPEC
388 void setLic(
389  const char* l1,
390  const char* l2,
391  const char* dt,
392  const char* s1,
393  const char* s2_
394  );
396 class Lic;
398 Lic* getLic();
399 
415 // READ AND WRITE, ASCII
417 
435 FUNC_DECLSPEC
436 bool writePointsASCII(const char* filename,const std::vector<Point2*>& vPointsIn);
437 
444 CLASS_DECLSPEC
445 bool writePointsASCII(const char* filename,const std::vector<Point2>& vPointsIn);
446 
447 
448 
449 
450 
460 FUNC_DECLSPEC
461 bool readXY(const char* filename,std::vector<Point2>& vPointsOut);
462 
463 #if GEOM_PSEUDO3D==GEOM_TRUE
464 // ONLY 2.5D
470 FUNC_DECLSPEC
471 bool readXYZ(const char* filename,std::vector<Point2>& vPointsOut);
472 #endif
473 
474 
476 // READ AND WRITE, BINARY
478 
479 
480 
502 CLASS_DECLSPEC
503 bool writePointsBIN(const char* filename,std::vector<Point2>& vPointsIn);
504 
511 CLASS_DECLSPEC
512 bool writePointsBIN(const char* filename,std::vector<Point2*>& vPointsIn);
513 
520 CLASS_DECLSPEC
521 bool readPointsBIN(const char* filename, std::vector<Point2>& vPointsIn);
522 
560 CLASS_DECLSPEC
561 bool writeSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsIn);
562 
569 CLASS_DECLSPEC
570 bool readSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsOut);
571 
572 
573 
574 
575 
576 
578 } // NAMESPACE
Point.
Definition: Point2.h:43
Vector.
Definition: Vector2.h:38
void getSortedBoundaryPolygons(std::vector< Triangle2 * > &vConnectedComponent, std::vector< Edge2 > &vOutsidePolygon, std::vector< std::vector< Edge2 > > &vHolePolygons)
Get sorted boundary polygons.
void offsetPolygonPoints(double offset, std::vector< Point2 > &vOrgPoints, std::vector< Point2 > &vOffsetPoints)
Create an offet polygon.
FUNC_DECLSPEC int getMajorVersionNumber()
Get the major version number.
const char * getFade2DVersion()
Get the Fade2D version string.
FUNC_DECLSPEC int getRevisionNumber()
Get the revision version number.
FUNC_DECLSPEC int getMinorVersionNumber()
Get the minor version number.
FUNC_DECLSPEC bool isRelease()
Check if a RELEASE or a DEBUG version is used.
FUNC_DECLSPEC bool readXYZ(const char *filename, std::vector< Point2 > &vPointsOut)
Read (x y z) points.
bool readPointsBIN(const char *filename, std::vector< Point2 > &vPointsIn)
Read points from a binary file.
FUNC_DECLSPEC bool readXY(const char *filename, std::vector< Point2 > &vPointsOut)
Read (x y) points.
bool writePointsBIN(const char *filename, std::vector< Point2 * > &vPointsIn)
Write points to a binary file.
bool readSegmentsBIN(const char *filename, std::vector< Segment2 > &vSegmentsOut)
Read segments from a binary file.
bool writeSegmentsBIN(const char *filename, std::vector< Segment2 > &vSegmentsIn)
Write segments to a binary file.
bool writePointsASCII(const char *filename, const std::vector< Point2 > &vPointsIn)
Write points to an ASCII file.
bool isSimplePolygon(std::vector< Segment2 > &vSegments)
isSimplePolygon
void pointsToPolyline(std::vector< Point2 > &vInPoints, bool bClose, std::vector< Segment2 > &vOutSegments)
Points-to-Polyline.
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...
double getArea25D(Point2 *p0, Point2 *p1, Point2 *p2)
Get 2.5D area of a triangle.
FUNC_DECLSPEC Orientation2 getOrientation2(const Point2 *p0, const Point2 *p1, const Point2 *p2)
Get the orientation of three points.
double getArea2D(Point2 *p0, Point2 *p1, Point2 *p2)
Get 2D area of a triangle.
FUNC_DECLSPEC Orientation2 getOrientation2_mt(const Point2 *p0, const Point2 *p1, const Point2 *p2)
Get Orientation2 (MT)
void edgesToPolygons(std::vector< Edge2 > &vEdgesIn, std::vector< std::vector< Edge2 > > &vvPolygonsOut, std::vector< Edge2 > &vRemainingOut)
Create polygons from a set of edges.
bool sortRing(std::vector< Segment2 > &vRing)
Sort a vector of Segments.
bool fillHole(Mesh3 *pMesh, std::vector< Edge2 > &vPolygonEdges, bool bWithRefine, bool bVerbose, std::vector< Point2 > &vCornersOut)
Fill a hole in a 3D mesh with triangles (deprecated)
void getUndirectedEdges(std::vector< Triangle2 * > &vT, std::vector< Edge2 > &vUndirectedEdgesOut)
Get undirected edges.
Vector2 getNormalVector(const Point2 &p0, const Point2 &p1, const Point2 &p2, bool &bOK)
Get normal vector.
bool sortRingCCW(std::vector< Segment2 > &vRing)
Sort a vector of Segments.
void getBorders(const std::vector< Triangle2 * > &vT, std::vector< Segment2 > &vBorderSegmentsOut)
Get Borders.