Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.74
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 
50 CLASS_DECLSPEC
51 bool isSimplePolygon(std::vector<Segment2>& vSegments);
52 
53 #if GEOM_PSEUDO3D==GEOM_TRUE
54 
65 CLASS_DECLSPEC
66 Vector2 getNormalVector( const Point2& p0,
67  const Point2& p1,
68  const Point2& p2,
69  bool& bOK);
70 #endif
71 
72 
73 
79 CLASS_DECLSPEC
80 void getDirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vDirectedEdgesOut);
81 
86 CLASS_DECLSPEC
87 void getUndirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vUndirectedEdgesOut);
88 
89 
110 CLASS_DECLSPEC
111 bool fillHole( std::vector<std::pair<Segment2,Vector2> > vPolygonSegments,
112  bool bWithRefine,
113  bool bVerbose,
114  std::vector<Point2>& vCornersOut
115  );
116 
117 
118 
119 
120 #if GEOM_PSEUDO3D==GEOM_TRUE
121 
136 CLASS_DECLSPEC
137 bool fillHole( std::vector<Point2>& vMeshCorners,
138  std::vector<Segment2>& vPolygonSegments,
139  bool bWithRefine,
140  bool bVerbose,
141  std::vector<Point2>& vCornersOut
142  );
143 
158 CLASS_DECLSPEC
159 bool fillHole( Mesh3* pMesh,
160  std::vector<Edge2>& vPolygonEdges,
161  bool bWithRefine,
162  bool bVerbose,
163  std::vector<Point2>& vCornersOut
164  );
165 #endif
166 
167 
197 CLASS_DECLSPEC
198 void edgesToPolygons(
199  std::vector<Edge2>& vEdgesIn,
200  std::vector<std::vector<Edge2> >& vvPolygonsOut,
201  std::vector<Edge2>& vRemainingOut
202  );
203 
212 CLASS_DECLSPEC
213 void getBorders(const std::vector<Triangle2*>& vT,std::vector<Segment2>& vBorderSegmentsOut);
219 CLASS_DECLSPEC
220 bool sortRing(std::vector<Segment2>& vRing);
221 
228 CLASS_DECLSPEC
229 bool sortRingCCW(std::vector<Segment2>& vRing);
230 
231 
243 CLASS_DECLSPEC
244 Orientation2 getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2);
252 CLASS_DECLSPEC
253 Orientation2 getOrientation2_mt(const Point2* p0,const Point2* p1,const Point2* p2);
254 
256 CLASS_DECLSPEC
257 std::string getString(const Orientation2 ori);
258 
268 CLASS_DECLSPEC
269 std::string getFade2DVersion();
272 CLASS_DECLSPEC
276 CLASS_DECLSPEC
280 CLASS_DECLSPEC
281 int getRevisionNumber();
284 CLASS_DECLSPEC
285 bool isRelease();
286 
287 
289 CLASS_DECLSPEC
290 void setLic(
291  const std::string& l1,
292  const std::string& l2,
293  const std::string& dt,
294  const std::string& s1,
295  const std::string& s2_
296  );
298 class Lic;
300 Lic* getLic();
301 
316 // READ AND WRITE, ASCII
319 
337 CLASS_DECLSPEC
338 bool writePointsASCII(const char* filename,const std::vector<Point2*>& vPointsIn);
339 
346 CLASS_DECLSPEC
347 bool writePointsASCII(const char* filename,const std::vector<Point2>& vPointsIn);
348 
349 
350 
351 
352 
362 CLASS_DECLSPEC
363 bool readXY(const char* filename,std::vector<Point2>& vPointsOut);
364 
365 #if GEOM_PSEUDO3D==GEOM_TRUE
366 // ONLY 2.5D
372 CLASS_DECLSPEC
373 bool readXYZ(const char* filename,std::vector<Point2>& vPointsOut);
374 #endif
375 
376 
378 // READ AND WRITE, BINARY
380 
381 
382 
404 CLASS_DECLSPEC
405 bool writePointsBIN(const char* filename,std::vector<Point2>& vPointsIn);
406 
413 CLASS_DECLSPEC
414 bool writePointsBIN(const char* filename,std::vector<Point2*>& vPointsIn);
415 
422 CLASS_DECLSPEC
423 bool readPointsBIN(const char* filename, std::vector<Point2>& vPointsIn);
424 
462 CLASS_DECLSPEC
463 bool writeSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsIn);
464 
471 CLASS_DECLSPEC
472 bool readSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsOut);
473 
474 
475 
476 
477 
478 
480 } // NAMESPACE
bool isSimplePolygon(std::vector< Segment2 > &vSegments)
isSimplePolygon
bool readXY(const char *filename, std::vector< Point2 > &vPointsOut)
Read (x y) points.
bool isRelease()
Check if a RELEASE or a DEBUG version is used.
int getMinorVersionNumber()
Get the minor version number.
bool readSegmentsBIN(const char *filename, std::vector< Segment2 > &vSegmentsOut)
Read segments from a binary file.
Orientation2 getOrientation2(const Point2 *p0, const Point2 *p1, const Point2 *p2)
Get the orientation of three points.
bool readPointsBIN(const char *filename, std::vector< Point2 > &vPointsIn)
Read points from a binary file.
std::string getFade2DVersion()
Get the Fade2D version string.
void getBorders(const std::vector< Triangle2 *> &vT, std::vector< Segment2 > &vBorderSegmentsOut)
Get Borders.
bool writePointsBIN(const char *filename, std::vector< Point2 *> &vPointsIn)
Write points to a binary file.
Orientation2 getOrientation2_mt(const Point2 *p0, const Point2 *p1, const Point2 *p2)
Get Orientation2 (MT)
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...
bool writeSegmentsBIN(const char *filename, std::vector< Segment2 > &vSegmentsIn)
Write segments to a binary file.
int getRevisionNumber()
Get the revision version number.
void getUndirectedEdges(std::vector< Triangle2 *> &vT, std::vector< Edge2 > &vUndirectedEdgesOut)
Get undirected edges.
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)
int getMajorVersionNumber()
Get the major version number.
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 sortRingCCW(std::vector< Segment2 > &vRing)
Sort a vector of Segments.
Definition: Bbox2.h:25
bool writePointsASCII(const char *filename, const std::vector< Point2 > &vPointsIn)
Write points to an ASCII file.