Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.56
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 
55 CLASS_DECLSPEC
56 void getDirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vDirectedEdgesOut);
57 
62 CLASS_DECLSPEC
63 void getUndirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vUndirectedEdgesOut);
64 
73 CLASS_DECLSPEC
74 void getBorders(const std::vector<Triangle2*>& vT,std::vector<Segment2>& vBorderSegmentsOut);
80 CLASS_DECLSPEC
81 bool sortRing(std::vector<Segment2>& vRing);
82 
94 CLASS_DECLSPEC
95 Orientation2 getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2);
103 CLASS_DECLSPEC
104 Orientation2 getOrientation2_mt(const Point2* p0,const Point2* p1,const Point2* p2);
105 
107 CLASS_DECLSPEC
108 std::string getString(const Orientation2 ori);
109 
119 CLASS_DECLSPEC
120 std::string getFade2DVersion();
123 CLASS_DECLSPEC
127 CLASS_DECLSPEC
131 CLASS_DECLSPEC
132 int getRevisionNumber();
135 CLASS_DECLSPEC
136 bool isRelease();
137 
138 
140 CLASS_DECLSPEC
141 void setLic(
142  const std::string& l1,
143  const std::string& l2,
144  const std::string& dt,
145  const std::string& s1,
146  const std::string& s2_
147  );
149 class Lic;
151 Lic* getLic();
152 
167 // READ AND WRITE, ASCII
170 
188 CLASS_DECLSPEC
189 bool writePointsASCII(const char* filename,const std::vector<Point2*>& vPointsIn);
190 
195 CLASS_DECLSPEC
196 bool writePointsASCII(const char* filename,const std::vector<Point2>& vPointsIn);
197 
198 
199 
200 
201 
211 CLASS_DECLSPEC
212 bool readXY(const char* filename,std::vector<Point2>& vPointsOut);
213 
214 #if GEOM_PSEUDO3D==GEOM_TRUE
215 // ONLY 2.5D
221 CLASS_DECLSPEC
222 bool readXYZ(const char* filename,std::vector<Point2>& vPointsOut);
223 #endif
224 
225 
227 // READ AND WRITE, BINARY
229 
230 
231 
249 CLASS_DECLSPEC
250 bool writePointsBIN(const char* filename,std::vector<Point2>& vPointsIn);
251 
255 CLASS_DECLSPEC
256 bool writePointsBIN(const char* filename,std::vector<Point2*>& vPointsIn);
257 
263 CLASS_DECLSPEC
264 bool readPointsBIN(const char* filename, std::vector<Point2>& vPointsIn);
265 
297 bool writeSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsIn);
298 
304 bool readSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsOut);
305 
306 
307 
308 
309 
310 
312 } // 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.
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.