Geom Software - C++ Programming and Geometry Libraries
Fade2D Documentation pages v1.56
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 
122 CLASS_DECLSPEC
123 void generateRandomPolygon( size_t numSegments,
124  double min,
125  double max,
126  std::vector<Segment2>& vPolygonOut,
127  unsigned int seed=0
128  );
129 
145 CLASS_DECLSPEC
146 void generateRandomSegments(size_t numSegments,
147  double min,
148  double max,
149  double maxLen,
150  std::vector<Segment2>& vSegmentsOut,
151  unsigned int seed);
152 
167 CLASS_DECLSPEC
169  int numSegments,
170  int numPeriods,
171  double xOffset,
172  double yOffset,
173  double xFactor,
174  double yFactor, // 0 causes absolute values
175  bool bSwapXY,
176  std::vector<Segment2>& vSineSegmentsOut
177  );
178 
179 
184 #if GEOM_PSEUDO3D==GEOM_TRUE
185 CLASS_DECLSPEC
186 void generateCircle(
187  int numPoints,
188  double x,
189  double y,
190  double z,
191  double radiusX,
192  double radiusY,
193  std::vector<Point2>& vCirclePointsOut
194  );
195 #else
196 CLASS_DECLSPEC
197 void generateCircle(
198  int numPoints,
199  double x,
200  double y,
201  double radiusX,
202  double radiusY,
203  std::vector<Point2>& vCirclePointsOut
204  );
205 #endif
206 
207 
208 
209 #if GEOM_PSEUDO3D==GEOM_TRUE
210 
220 CLASS_DECLSPEC
221 void generateRandomSurfacePoints(
222  size_t numX,
223  size_t numY,
224  size_t numCenters,
225  double xmin,double ymin,double zmin,double xmax,double ymax,double zmax,
226  std::vector<Point2>& vSurfacePointsOut,
227  unsigned int seed
228  );
229 
230 #endif
231 
232 CLASS_DECLSPEC
233 void shear( std::vector<Point2>& vPointsInOut,double shearX,double shearY );
234 
235 
237 } // 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