Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.58
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 #if GEOM_PSEUDO3D==GEOM_TRUE
27  namespace GEOM_FADE25D {
28 #elif GEOM_PSEUDO3D==GEOM_FALSE
29  namespace GEOM_FADE2D {
30 #else
31  #error GEOM_PSEUDO3D is not defined
32 #endif
33 
34 
39 #if GEOM_PSEUDO3D==GEOM_TRUE
40 
45 CLASS_DECLSPEC
46 Vector2 getNormalVector(const Point2& p0,const Point2& p1,const Point2& p2);
47 #endif
48 
49 
50 
56 CLASS_DECLSPEC
57 void getDirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vDirectedEdgesOut);
58 
63 CLASS_DECLSPEC
64 void getUndirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vUndirectedEdgesOut);
65 
66 
67 
68 
69 
70 
97 CLASS_DECLSPEC
98 void edgesToPolygons(
99  std::vector<Edge2>& vEdgesIn,
100  std::vector<std::vector<Edge2> >& vvPolygonsOut,
101  std::vector<Edge2>& vRemainingOut
102  );
103 
112 CLASS_DECLSPEC
113 void getBorders(const std::vector<Triangle2*>& vT,std::vector<Segment2>& vBorderSegmentsOut);
119 CLASS_DECLSPEC
120 bool sortRing(std::vector<Segment2>& vRing);
121 
133 CLASS_DECLSPEC
134 Orientation2 getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2);
142 CLASS_DECLSPEC
143 Orientation2 getOrientation2_mt(const Point2* p0,const Point2* p1,const Point2* p2);
144 
146 CLASS_DECLSPEC
147 std::string getString(const Orientation2 ori);
148 
158 CLASS_DECLSPEC
159 std::string getFade2DVersion();
162 CLASS_DECLSPEC
166 CLASS_DECLSPEC
170 CLASS_DECLSPEC
171 int getRevisionNumber();
174 CLASS_DECLSPEC
175 bool isRelease();
176 
177 
179 CLASS_DECLSPEC
180 void setLic(
181  const std::string& l1,
182  const std::string& l2,
183  const std::string& dt,
184  const std::string& s1,
185  const std::string& s2_
186  );
188 class Lic;
190 Lic* getLic();
191 
206 // READ AND WRITE, ASCII
209 
227 CLASS_DECLSPEC
228 bool writePointsASCII(const char* filename,const std::vector<Point2*>& vPointsIn);
229 
234 CLASS_DECLSPEC
235 bool writePointsASCII(const char* filename,const std::vector<Point2>& vPointsIn);
236 
237 
238 
239 
240 
250 CLASS_DECLSPEC
251 bool readXY(const char* filename,std::vector<Point2>& vPointsOut);
252 
253 #if GEOM_PSEUDO3D==GEOM_TRUE
254 // ONLY 2.5D
260 CLASS_DECLSPEC
261 bool readXYZ(const char* filename,std::vector<Point2>& vPointsOut);
262 #endif
263 
264 
266 // READ AND WRITE, BINARY
268 
269 
270 
288 CLASS_DECLSPEC
289 bool writePointsBIN(const char* filename,std::vector<Point2>& vPointsIn);
290 
294 CLASS_DECLSPEC
295 bool writePointsBIN(const char* filename,std::vector<Point2*>& vPointsIn);
296 
302 CLASS_DECLSPEC
303 bool readPointsBIN(const char* filename, std::vector<Point2>& vPointsIn);
304 
336 CLASS_DECLSPEC
337 bool writeSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsIn);
338 
344 CLASS_DECLSPEC
345 bool readSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsOut);
346 
347 
348 
349 
350 
351 
353 } // NAMESPACE
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.
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.
Definition: Bbox2.h:25
bool writePointsASCII(const char *filename, const std::vector< Point2 > &vPointsIn)
Write points to an ASCII file.