Geom Software - C++ Programming and Geometry Libraries
Fade2.5D Documentation pages v1.46
GEOM_FADE25D Namespace Reference

EfficientModel. More...

Classes

class  Bbox2
 Boundingbox. More...
 
class  Circle2
 Circle. More...
 
class  Color
 Color More...
 
class  ConstraintGraph2
 ConstraintGraph2 is a set of enforced edges. More...
 
class  ConstraintSegment2
 Constraint segment. More...
 
class  EfficientModel
 
class  Fade_2D
 Delaunay triangulation - the main class. More...
 
class  Label
 Text-Label. More...
 
class  MeshGenParams
 Parameters for the mesh generator. More...
 
class  Point2
 Point. More...
 
class  Segment2
 Segment. More...
 
class  SegmentChecker
 SegmentChecker identifies intersecting line segments. More...
 
class  Triangle2
 Triangle. More...
 
class  TriangleAroundVertexIterator
 Iterator for all triangles around a given vertex. More...
 
class  Vector2
 Vector. More...
 
class  Visualizer2
 Postscript writer. More...
 
class  Zone2
 Area in a triangulation. More...
 

Enumerations

enum  Colorname {
  CRED, CGREEN, CBLUE, CBLACK,
  CYELLOW, CPINK, CGRAY
}
 Colorname. More...
 
enum  ConstraintInsertionStrategy {
  CIS_CONFORMING_DELAUNAY =0, CIS_CONSTRAINED_DELAUNAY =1, CIS_CONFORMING_DELAUNAY_SEGMENT_LEVEL =2, CIS_KEEP_DELAUNAY =0,
  CIS_IGNORE_DELAUNAY =1
}
 Constraint Insertion Strategy determines how a constraint edge shall be inserted: More...
 

Functions

std::ostream & operator<< (std::ostream &stream, Bbox2 &pC)
 
template<typename T >
void unusedParameter (const T &)
 
std::ostream & operator<< (std::ostream &stream, const Color &c)
 
std::string getFade2DVersion ()
 Fade2D version string This method returns a version string.
 
int getMajorVersionNumber ()
 Get the major version number.
 
int getMinorVersionNumber ()
 Get the minor version number.
 
int getRevisionNumber ()
 Get the revision version number.
 
bool isRelease ()
 Check if a RELEASE or a DEBUG version is used.
 
void getBorders (const std::vector< Triangle2 * > &vT, std::vector< Segment2 > &vBorderSegments)
 Get the border edges of a set of triangles. More...
 
bool sortRing (std::vector< Segment2 > &vRing)
 Sort a vector of Segments. More...
 
void setLic (const std::string &l1, const std::string &l2, const std::string &dt, const std::string &s1, const std::string &s2_)
 
Lic * getLic ()
 
bool readXY (const char *filename, std::vector< Point2 > &vPointsOut)
 Read (x y) points. More...
 
bool readXYZ (const char *filename, std::vector< Point2 > &vPointsOut)
 Read (x y z) points. More...
 
double timer (const std::string &str)
 Timer. More...
 
bool benchCounter (const std::string &str)
 
std::ostream & operator<< (std::ostream &stream, const Point2 &pnt)
 
std::istream & operator>> (std::istream &stream, Point2 &pnt)
 
double sqDistance2D (const Point2 &p0, const Point2 &p1)
 Get the squared distance between two points in 2D. More...
 
double sqDistance2D (const double x0, const double y0, const Point2 &p1)
 Get the squared distance between two points in 2D. More...
 
double sqDistance25D (const Point2 &p0, const Point2 &p1)
 Get the squared distance between two points. More...
 
double sqDistance25D (const double x0, const double y0, const double z0, const Point2 &p1)
 Get the squared distance between two points in 2D. More...
 
Point2 center (const Point2 &p0, const Point2 &p1)
 Compute the midpoint of p0 and p1. More...
 
Point2 centerWithShift (const Point2 &p0, const Point2 &p1)
 Compute the midpoint of p0 and p1 and adapt it. More...
 
int inc1 (int num)
 
int inc2 (int num)
 
void generateRandomNumbers (size_t num, double min, double max, std::vector< double > &vRandomNumbersOut, unsigned int seed=0)
 Generate random numbers. More...
 
void generateRandomPoints (size_t numRandomPoints, double min, double max, std::vector< Point2 > &vRandomPointsOut, unsigned int seed=0)
 Generate random points. More...
 
void generateRandomPolygon (size_t numSegments, double min, double max, std::vector< Segment2 > &vPolygonOut, unsigned int seed=0)
 Generate a random simple polygon. More...
 
void generateRandomSegments (size_t numSegments, double min, double max, double maxLen, std::vector< Segment2 > &vSegmentsOut, unsigned int seed)
 Generate random line segments. More...
 
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. More...
 
std::ostream & operator<< (std::ostream &stream, const Vector2 &vec)
 
Vector2 crossProduct (const Vector2 &vec0, const Vector2 &vec1)
 Cross product.
 
Vector2 normalize (const Vector2 &other)
 Normalize the vector.
 
Vector2 operator- (const Vector2 &in)
 
Vector2 operator* (double d, const Vector2 &vec)
 
Zone2zoneUnion (Zone2 *pZone0, Zone2 *pZone1)
 Compute the union of two zones. More...
 
Zone2zoneIntersection (Zone2 *pZone0, Zone2 *pZone1)
 Compute the intersection of two zones. More...
 
Zone2zoneDifference (Zone2 *pZone0, Zone2 *pZone1)
 Compute the difference of two zones. More...
 
Zone2zoneSymmetricDifference (Zone2 *pZone0, Zone2 *pZone1)
 Compute the symmetric difference of two zones. More...
 

Detailed Description

2.5D point clouds from terrains and surfaces collected by scanners are often oversampled. The present class aims to reduce these point clouds in a controlled way such that a certain user specified quality is maintained.

Note
EfficientModel is pre-released in the present Fade version. But quite some further functionality like automatic line recognition and simplification as well as optimization of valleys and ridges exists already under the hood and is currently further developed. Thus, when you use this class please accept that its interface may change a bit when the next Fade version is released.

Enumeration Type Documentation

A few colors are predefined for convenience

  • CIS_CONSTRAINED_DELAUNAY inserts a segment without subdivision unless required (which is the case if existing vertices or constraint segments are crossed).
  • CIS_CONFORMING_DELAUNAY subdivides a segment if necessary to maintain the empty circle property of the surrounding triangles. In general this insertion strategy creates more but better shaped triangles than CIS_CONSTRAINED_DELAUNAY. The height (z-coordinate) of new split points is adapted to existing triangles.
  • CIS_CONFORMING_DELAUNAY_SEGMENT_LEVEL is the same as the strategy CIS_CONFORMING_DELAUNAY except that split points are not projected to an existing surface but their height is interpolated between the endpoints of the segment to be inserted.
Note
In former library versions the terms CIS_IGNORE_DELAUNAY and CIS_KEEP_DELAUNAY were used but these were misleading and are now deprecated. For backwards compatibility they are kept.

Function Documentation

Point2 GEOM_FADE25D::center ( const Point2 p0,
const Point2 p1 
)
inline
Note
: The true midpoint of p0 and p1 may not exist in floating point numbers. The returned point may not be collinear with p0 and p1.
Point2 GEOM_FADE25D::centerWithShift ( const Point2 p0,
const Point2 p1 
)

Experimental new function that may change in the future. Thought for specific applications.

This function works like center() but additionally it adapts the midpoint to the segment (p0,p1) such that it is 'as collinear as possible' with p0 and p1 in the x/y plane. Bounds for the shift are 0.01 and 1 % of the range in x- and y-direction.

void GEOM_FADE25D::getBorders ( const std::vector< Triangle2 * > &  vT,
std::vector< Segment2 > &  vBorderSegments 
)
Parameters
vTare the input triangles
vBorderSegmentsis used to return all segments of triangles in vT which have only one adjacent triangle
bool GEOM_FADE25D::readXY ( const char *  filename,
std::vector< Point2 > &  vPointsOut 
)

Reads points from an ASCII file. Expected file format: Two coordinates (x y) per line, whitespace separated.

The z coordinate is set to 0.

bool GEOM_FADE25D::readXYZ ( const char *  filename,
std::vector< Point2 > &  vPointsOut 
)

Reads points from an ASCII file. Expected file format: Three coordinates (x y z) per line, whitespace separated.

bool GEOM_FADE25D::sortRing ( std::vector< Segment2 > &  vRing)

The segments in vRing are re-aligned and sorted such that subsequent segments join at the endpoints.

double GEOM_FADE25D::sqDistance25D ( const Point2 p0,
const Point2 p1 
)
inline
Note
In contrast to sqDistance2D this method will use the z-coordinate of the points
double GEOM_FADE25D::sqDistance25D ( const double  x0,
const double  y0,
const double  z0,
const Point2 p1 
)
inline
Note
In contrast to sqDistance2D this method will use the z-coordinate of the points
double GEOM_FADE25D::sqDistance2D ( const Point2 p0,
const Point2 p1 
)
inline
Note
This method will not use the z-coordinate (if any)
double GEOM_FADE25D::sqDistance2D ( const double  x0,
const double  y0,
const Point2 p1 
)
inline
Note
This method will not use the z-coordinate (if any)
double GEOM_FADE25D::timer ( const std::string &  str)

Call the timer function with a certain string to start time measurement. Call it a second time with the same string to finish the time measurement.

Returns
-1 when the timer is started or the elapsed time in seconds when the timer is stopped.
Zone2* GEOM_FADE25D::zoneDifference ( Zone2 pZone0,
Zone2 pZone1 
)
Returns
a new zone containing the triangles of *pZone0 minus the ones of *pZone1
Zone2* GEOM_FADE25D::zoneIntersection ( Zone2 pZone0,
Zone2 pZone1 
)
Returns
a new zone containing the intersection of *pZone0 and *pZone1
Zone2* GEOM_FADE25D::zoneSymmetricDifference ( Zone2 pZone0,
Zone2 pZone1 
)
Returns
a new zone containing the triangles that are present in one of the zones but not in the other one.
Zone2* GEOM_FADE25D::zoneUnion ( Zone2 pZone0,
Zone2 pZone1 
)
Returns
a new zone containing the union of the triangles of *pZone0 and *pZone1