Fade2D Documentation pages v2.16.8
Delaunay Features
testDataGenerators.h
Go to the documentation of this file.
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 // unclear to you.
14 //
15 // Support: https://www.geom.at/contact/
16 // Project: https://www.geom.at/fade2d/html/
17 
19 #pragma once
20 #include "Point2.h"
21 #include "Segment2.h"
22 #include <vector>
23 
24 
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 
79 CLASS_DECLSPEC
80 void generateRandomNumbers( size_t num,
81  double min,
82  double max,
83  std::vector<double>& vRandomNumbersOut,
84  unsigned int seed=0
85  );
86 
108 CLASS_DECLSPEC
109 void generateRandomPoints( size_t numRandomPoints,
110  double min,
111  double max,
112  std::vector<Point2>& vRandomPointsOut,
113  unsigned int seed=0
114  );
115 
116 #if GEOM_PSEUDO3D==GEOM_TRUE
117 
130 CLASS_DECLSPEC
131 void generateRandomPoints3D(size_t numRandomPoints,
132  double min,
133  double max,
134  std::vector<Point2>& vRandomPointsOut,
135  unsigned int seed=0
136  );
137 
138 #endif
139 
140 
156 CLASS_DECLSPEC
157 void generateRandomPolygon( size_t numSegments,
158  double min,
159  double max,
160  std::vector<Segment2>& vPolygonOut,
161  unsigned int seed=0
162  );
163 
164 
179 CLASS_DECLSPEC
180 void generateRandomSegments(size_t numSegments,
181  double min,
182  double max,
183  double maxLen,
184  std::vector<Segment2>& vSegmentsOut,
185  unsigned int seed);
186 
203 CLASS_DECLSPEC
205  int numSegments,
206  int numPeriods,
207  double xOffset,
208  double yOffset,
209  double xFactor,
210  double yFactor, // 0 causes absolute values
211  bool bSwapXY,
212  std::vector<Segment2>& vSineSegmentsOut
213  );
214 
215 
234 #if GEOM_PSEUDO3D==GEOM_TRUE
235 CLASS_DECLSPEC
236 void generateCircle(
237  int numPoints,
238  double x,
239  double y,
240  double z,
241  double radiusX,
242  double radiusY,
243  std::vector<Point2>& vCirclePointsOut
244  );
245 #else
246 CLASS_DECLSPEC
248  int numPoints,
249  double x,
250  double y,
251  double radiusX,
252  double radiusY,
253  std::vector<Point2>& vCirclePointsOut
254  );
255 #endif
256 
257 
258 
259 #if GEOM_PSEUDO3D==GEOM_TRUE
260 
274 CLASS_DECLSPEC
275 void generateRandomSurfacePoints(
276  size_t numX,
277  size_t numY,
278  size_t numCenters,
279  double xmin,double ymin,double zmin,double xmax,double ymax,double zmax,
280  std::vector<Point2>& vSurfacePointsOut,
281  unsigned int seed,
282  bool bGrid=true
283  );
284 
285 #endif
286 
296 CLASS_DECLSPEC
297 void shear( std::vector<Point2>& vPointsInOut,double shearX,double shearY );
298 
299 
301 } // Namespace
CLASS_DECLSPEC void shear(std::vector< Point2 > &vPointsInOut, double shearX, double shearY)
Apply shear transformation to points.
CLASS_DECLSPEC void generateRandomPoints(size_t numRandomPoints, double min, double max, std::vector< Point2 > &vRandomPointsOut, unsigned int seed=0)
Generate (reproducible) random points.
CLASS_DECLSPEC void generateCircle(int numPoints, double x, double y, double radiusX, double radiusY, std::vector< Point2 > &vCirclePointsOut)
Generate points on a circle.
CLASS_DECLSPEC void generateRandomSegments(size_t numSegments, double min, double max, double maxLen, std::vector< Segment2 > &vSegmentsOut, unsigned int seed)
Generate (reproducible) random line segments.
CLASS_DECLSPEC void generateSineSegments(int numSegments, int numPeriods, double xOffset, double yOffset, double xFactor, double yFactor, bool bSwapXY, std::vector< Segment2 > &vSineSegmentsOut)
Generate segments from a sine function.
CLASS_DECLSPEC void generateRandomPolygon(size_t numSegments, double min, double max, std::vector< Segment2 > &vPolygonOut, unsigned int seed=0)
Generate a (reproducible) random polygon.
CLASS_DECLSPEC void generateRandomNumbers(size_t num, double min, double max, std::vector< double > &vRandomNumbersOut, unsigned int seed=0)
Generate (reproducible) random numbers.