Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.60
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 
51 CLASS_DECLSPEC
52 Vector2 getNormalVector( const Point2& p0,
53  const Point2& p1,
54  const Point2& p2,
55  bool& bOK);
56 #endif
57 
58 
59 
65 CLASS_DECLSPEC
66 void getDirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vDirectedEdgesOut);
67 
72 CLASS_DECLSPEC
73 void getUndirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vUndirectedEdgesOut);
74 
75 
76 
77 
78 
79 
109 CLASS_DECLSPEC
110 void edgesToPolygons(
111  std::vector<Edge2>& vEdgesIn,
112  std::vector<std::vector<Edge2> >& vvPolygonsOut,
113  std::vector<Edge2>& vRemainingOut
114  );
115 
124 CLASS_DECLSPEC
125 void getBorders(const std::vector<Triangle2*>& vT,std::vector<Segment2>& vBorderSegmentsOut);
131 CLASS_DECLSPEC
132 bool sortRing(std::vector<Segment2>& vRing);
133 
145 CLASS_DECLSPEC
146 Orientation2 getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2);
154 CLASS_DECLSPEC
155 Orientation2 getOrientation2_mt(const Point2* p0,const Point2* p1,const Point2* p2);
156 
158 CLASS_DECLSPEC
159 std::string getString(const Orientation2 ori);
160 
170 CLASS_DECLSPEC
171 std::string getFade2DVersion();
174 CLASS_DECLSPEC
178 CLASS_DECLSPEC
182 CLASS_DECLSPEC
183 int getRevisionNumber();
186 CLASS_DECLSPEC
187 bool isRelease();
188 
189 
191 CLASS_DECLSPEC
192 void setLic(
193  const std::string& l1,
194  const std::string& l2,
195  const std::string& dt,
196  const std::string& s1,
197  const std::string& s2_
198  );
200 class Lic;
202 Lic* getLic();
203 
218 // READ AND WRITE, ASCII
221 
239 CLASS_DECLSPEC
240 bool writePointsASCII(const char* filename,const std::vector<Point2*>& vPointsIn);
241 
248 CLASS_DECLSPEC
249 bool writePointsASCII(const char* filename,const std::vector<Point2>& vPointsIn);
250 
251 
252 
253 
254 
264 CLASS_DECLSPEC
265 bool readXY(const char* filename,std::vector<Point2>& vPointsOut);
266 
267 #if GEOM_PSEUDO3D==GEOM_TRUE
268 // ONLY 2.5D
274 CLASS_DECLSPEC
275 bool readXYZ(const char* filename,std::vector<Point2>& vPointsOut);
276 #endif
277 
278 
280 // READ AND WRITE, BINARY
282 
283 
284 
302 CLASS_DECLSPEC
303 bool writePointsBIN(const char* filename,std::vector<Point2>& vPointsIn);
304 
311 CLASS_DECLSPEC
312 bool writePointsBIN(const char* filename,std::vector<Point2*>& vPointsIn);
313 
320 CLASS_DECLSPEC
321 bool readPointsBIN(const char* filename, std::vector<Point2>& vPointsIn);
322 
356 CLASS_DECLSPEC
357 bool writeSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsIn);
358 
365 CLASS_DECLSPEC
366 bool readSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsOut);
367 
368 
369 
370 
371 
372 
374 } // NAMESPACE
bool writePointsASCII(const char *filename, const std::vector< Point2 > &vPointsIn)
Write points to an ASCII file.
void getBorders(const std::vector< Triangle2 *> &vT, std::vector< Segment2 > &vBorderSegmentsOut)
Get Borders.
int getRevisionNumber()
Get the revision version number.
Orientation2 getOrientation2(const Point2 *p0, const Point2 *p1, const Point2 *p2)
Get the orientation of three points.
Vector2 getNormalVector(const Point2 &p0, const Point2 &p1, const Point2 &p2, bool &bOK)
Get normal vector.
bool sortRing(std::vector< Segment2 > &vRing)
Sort a vector of Segments.
bool isRelease()
Check if a RELEASE or a DEBUG version is used.
bool readPointsBIN(const char *filename, std::vector< Point2 > &vPointsIn)
Read points from a binary file.
int getMajorVersionNumber()
Get the major version number.
Orientation2 getOrientation2_mt(const Point2 *p0, const Point2 *p1, const Point2 *p2)
Get Orientation2 (MT)
bool writeSegmentsBIN(const char *filename, std::vector< Segment2 > &vSegmentsIn)
Write segments to a binary file.
void edgesToPolygons(std::vector< Edge2 > &vEdgesIn, std::vector< std::vector< Edge2 > > &vvPolygonsOut, std::vector< Edge2 > &vRemainingOut)
Create polygons from a set of edges.
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...
Definition: Bbox2.h:23
bool readXYZ(const char *filename, std::vector< Point2 > &vPointsOut)
Read (x y z) points.
bool readXY(const char *filename, std::vector< Point2 > &vPointsOut)
Read (x y) points.
int getMinorVersionNumber()
Get the minor version number.
std::string getFade2DVersion()
Get the Fade2D version string.
void getUndirectedEdges(std::vector< Triangle2 *> &vT, std::vector< Edge2 > &vUndirectedEdgesOut)
Get undirected edges.
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.