Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.74
testDataGenerators.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 #pragma once
19 #include "Point2.h"
20 #include "Segment2.h"
21 #include <vector>
22 
23 
24 
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 
78 CLASS_DECLSPEC
79 void generateRandomNumbers( size_t num,
80  double min,
81  double max,
82  std::vector<double>& vRandomNumbersOut,
83  unsigned int seed=0
84  );
85 
101 CLASS_DECLSPEC
102 void generateRandomPoints( size_t numRandomPoints,
103  double min,
104  double max,
105  std::vector<Point2>& vRandomPointsOut,
106  unsigned int seed=0
107  );
108 
109 #if GEOM_PSEUDO3D==GEOM_TRUE
110 
125 CLASS_DECLSPEC
126 void generateRandomPoints3D(size_t numRandomPoints,
127  double min,
128  double max,
129  std::vector<Point2>& vRandomPointsOut,
130  unsigned int seed=0
131  );
132 
133 #endif
134 
148 CLASS_DECLSPEC
149 void generateRandomPolygon( size_t numSegments,
150  double min,
151  double max,
152  std::vector<Segment2>& vPolygonOut,
153  unsigned int seed=0
154  );
155 
171 CLASS_DECLSPEC
172 void generateRandomSegments(size_t numSegments,
173  double min,
174  double max,
175  double maxLen,
176  std::vector<Segment2>& vSegmentsOut,
177  unsigned int seed);
178 
193 CLASS_DECLSPEC
195  int numSegments,
196  int numPeriods,
197  double xOffset,
198  double yOffset,
199  double xFactor,
200  double yFactor, // 0 causes absolute values
201  bool bSwapXY,
202  std::vector<Segment2>& vSineSegmentsOut
203  );
204 
205 
210 #if GEOM_PSEUDO3D==GEOM_TRUE
211 CLASS_DECLSPEC
212 void generateCircle(
213  int numPoints,
214  double x,
215  double y,
216  double z,
217  double radiusX,
218  double radiusY,
219  std::vector<Point2>& vCirclePointsOut
220  );
221 #else
222 CLASS_DECLSPEC
223 void generateCircle(
224  int numPoints,
225  double x,
226  double y,
227  double radiusX,
228  double radiusY,
229  std::vector<Point2>& vCirclePointsOut
230  );
231 #endif
232 
233 
234 
235 #if GEOM_PSEUDO3D==GEOM_TRUE
236 
246 CLASS_DECLSPEC
247 void generateRandomSurfacePoints(
248  size_t numX,
249  size_t numY,
250  size_t numCenters,
251  double xmin,double ymin,double zmin,double xmax,double ymax,double zmax,
252  std::vector<Point2>& vSurfacePointsOut,
253  unsigned int seed
254  );
255 
256 #endif
257 
258 CLASS_DECLSPEC
259 void shear( std::vector<Point2>& vPointsInOut,double shearX,double shearY );
260 
261 
263 } // Namespace
void generateRandomPoints(size_t numRandomPoints, double min, double max, std::vector< Point2 > &vRandomPointsOut, unsigned int seed=0)
Generate random points.
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 generateRandomPolygon(size_t numSegments, double min, double max, std::vector< Segment2 > &vPolygonOut, unsigned int seed=0)
Generate a random simple polygon.
void generateRandomSegments(size_t numSegments, double min, double max, double maxLen, std::vector< Segment2 > &vSegmentsOut, unsigned int seed)
Generate random line segments.
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.
Definition: Bbox2.h:25