Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.63
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 
48 CLASS_DECLSPEC
49 bool isSimplePolygon(std::vector<Segment2>& vSegments);
50 
51 #if GEOM_PSEUDO3D==GEOM_TRUE
52 
63 CLASS_DECLSPEC
64 Vector2 getNormalVector( const Point2& p0,
65  const Point2& p1,
66  const Point2& p2,
67  bool& bOK);
68 #endif
69 
70 
71 
77 CLASS_DECLSPEC
78 void getDirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vDirectedEdgesOut);
79 
84 CLASS_DECLSPEC
85 void getUndirectedEdges(std::vector<Triangle2*>& vT,std::vector<Edge2>& vUndirectedEdgesOut);
86 
87 
88 
89 
90 
91 
121 CLASS_DECLSPEC
122 void edgesToPolygons(
123  std::vector<Edge2>& vEdgesIn,
124  std::vector<std::vector<Edge2> >& vvPolygonsOut,
125  std::vector<Edge2>& vRemainingOut
126  );
127 
136 CLASS_DECLSPEC
137 void getBorders(const std::vector<Triangle2*>& vT,std::vector<Segment2>& vBorderSegmentsOut);
143 CLASS_DECLSPEC
144 bool sortRing(std::vector<Segment2>& vRing);
145 
152 CLASS_DECLSPEC
153 bool sortRingCCW(std::vector<Segment2>& vRing);
154 
155 
167 CLASS_DECLSPEC
168 Orientation2 getOrientation2(const Point2* p0,const Point2* p1,const Point2* p2);
176 CLASS_DECLSPEC
177 Orientation2 getOrientation2_mt(const Point2* p0,const Point2* p1,const Point2* p2);
178 
180 CLASS_DECLSPEC
181 std::string getString(const Orientation2 ori);
182 
192 CLASS_DECLSPEC
193 std::string getFade2DVersion();
196 CLASS_DECLSPEC
200 CLASS_DECLSPEC
204 CLASS_DECLSPEC
205 int getRevisionNumber();
208 CLASS_DECLSPEC
209 bool isRelease();
210 
211 
213 CLASS_DECLSPEC
214 void setLic(
215  const std::string& l1,
216  const std::string& l2,
217  const std::string& dt,
218  const std::string& s1,
219  const std::string& s2_
220  );
222 class Lic;
224 Lic* getLic();
225 
240 // READ AND WRITE, ASCII
243 
261 CLASS_DECLSPEC
262 bool writePointsASCII(const char* filename,const std::vector<Point2*>& vPointsIn);
263 
270 CLASS_DECLSPEC
271 bool writePointsASCII(const char* filename,const std::vector<Point2>& vPointsIn);
272 
273 
274 
275 
276 
286 CLASS_DECLSPEC
287 bool readXY(const char* filename,std::vector<Point2>& vPointsOut);
288 
289 #if GEOM_PSEUDO3D==GEOM_TRUE
290 // ONLY 2.5D
296 CLASS_DECLSPEC
297 bool readXYZ(const char* filename,std::vector<Point2>& vPointsOut);
298 #endif
299 
300 
302 // READ AND WRITE, BINARY
304 
305 
306 
324 CLASS_DECLSPEC
325 bool writePointsBIN(const char* filename,std::vector<Point2>& vPointsIn);
326 
333 CLASS_DECLSPEC
334 bool writePointsBIN(const char* filename,std::vector<Point2*>& vPointsIn);
335 
342 CLASS_DECLSPEC
343 bool readPointsBIN(const char* filename, std::vector<Point2>& vPointsIn);
344 
378 CLASS_DECLSPEC
379 bool writeSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsIn);
380 
387 CLASS_DECLSPEC
388 bool readSegmentsBIN(const char* filename,std::vector<Segment2>& vSegmentsOut);
389 
390 
391 
392 
393 
394 
396 } // 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.
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.