Fade2D Documentation pages v2.15
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 // not clear to you.
14 //
15 // Author: Bernhard Kornberger, bkorn (at) geom.at
16 // http://www.geom.at
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 
102 CLASS_DECLSPEC
103 void generateRandomPoints( size_t numRandomPoints,
104  double min,
105  double max,
106  std::vector<Point2>& vRandomPointsOut,
107  unsigned int seed=0
108  );
109 
110 #if GEOM_PSEUDO3D==GEOM_TRUE
126 CLASS_DECLSPEC
127 void generateRandomPoints3D(size_t numRandomPoints,
128  double min,
129  double max,
130  std::vector<Point2>& vRandomPointsOut,
131  unsigned int seed=0
132  );
133 
134 #endif
135 
149 CLASS_DECLSPEC
150 void generateRandomPolygon( size_t numSegments,
151  double min,
152  double max,
153  std::vector<Segment2>& vPolygonOut,
154  unsigned int seed=0
155  );
156 
172 CLASS_DECLSPEC
173 void generateRandomSegments(size_t numSegments,
174  double min,
175  double max,
176  double maxLen,
177  std::vector<Segment2>& vSegmentsOut,
178  unsigned int seed);
179 
194 CLASS_DECLSPEC
196  int numSegments,
197  int numPeriods,
198  double xOffset,
199  double yOffset,
200  double xFactor,
201  double yFactor, // 0 causes absolute values
202  bool bSwapXY,
203  std::vector<Segment2>& vSineSegmentsOut
204  );
205 
206 
211 #if GEOM_PSEUDO3D==GEOM_TRUE
212 CLASS_DECLSPEC
213 void generateCircle(
214  int numPoints,
215  double x,
216  double y,
217  double z,
218  double radiusX,
219  double radiusY,
220  std::vector<Point2>& vCirclePointsOut
221  );
222 #else
223 CLASS_DECLSPEC
225  int numPoints,
226  double x,
227  double y,
228  double radiusX,
229  double radiusY,
230  std::vector<Point2>& vCirclePointsOut
231  );
232 #endif
233 
234 
235 
236 #if GEOM_PSEUDO3D==GEOM_TRUE
248 CLASS_DECLSPEC
249 void generateRandomSurfacePoints(
250  size_t numX,
251  size_t numY,
252  size_t numCenters,
253  double xmin,double ymin,double zmin,double xmax,double ymax,double zmax,
254  std::vector<Point2>& vSurfacePointsOut,
255  unsigned int seed,
256  bool bGrid=true
257  );
258 
259 #endif
260 
261 CLASS_DECLSPEC
262 void shear( std::vector<Point2>& vPointsInOut,double shearX,double shearY );
263 
264 
266 } // Namespace
void generateRandomNumbers(size_t num, double min, double max, std::vector< double > &vRandomNumbersOut, unsigned int seed=0)
Generate random numbers.
void generateCircle(int numPoints, double x, double y, double radiusX, double radiusY, std::vector< Point2 > &vCirclePointsOut)
Generate a circle.
void generateRandomSegments(size_t numSegments, double min, double max, double maxLen, std::vector< Segment2 > &vSegmentsOut, unsigned int seed)
Generate random line segments.
void generateRandomPoints(size_t numRandomPoints, double min, double max, std::vector< Point2 > &vRandomPointsOut, unsigned int seed=0)
Generate random points.
void generateRandomPolygon(size_t numSegments, double min, double max, std::vector< Segment2 > &vPolygonOut, unsigned int seed=0)
Generate a random simple polygon.
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.