Euclid

Euclid provides some standard definitions of points, lines and triangles based on Vectors. Points and Vectors are subclasses of StaticVectors, whereas Lines and Triangles are StaticSortedVectors containing Points. Exceptions are the IndexLine and the IndexTriangles.

Classes

The principal classes of Euclid are the template classes Point2D and Point3D.

template <typename T> struct Point2D;

Point2D a subclass of StaticVector<T, 2>, see also Vectors.

  Point2D()  
Default constructor.
  template <typename U>
  Point2D(const U &data)  
Initialize with a scalar or data from a container.
  Point2D(const U x, const U y)  
Initialize with the given coordinates.
  void set(const U x, const U y)  
Set to the given coordinates.
  Point2D jmp(const U dx, const U dy) const  
Return a Point with dx and dy relative to the coordinates of the point, i.e., dx and dy are offsets from the values returned by x() and y().
  T &x()  
The X coordinate; p.x() is an alias for p[X].
  T &y()  
The Y coordinate; p.y() is an alias for p[Y].
  T &height()  
The HEIGHT coordinate; p.height() is an alias for p[HEIGHT].
  T &width()  
The WIDTH coordinate; p.width() is an alias for p[WIDTH].

template <typename T> struct Point3D;

Point3D a subclass of StaticVector<T, 3>, see also Vectors.

  Point3D()  
Default constructor.
  template <typename U>
  Point3D(const U &data)  
Initialize with a scalar or data from a container.
  Point3D(const U x, const U y, const U z)  
Initialize with the given coordinates.
  void set(const U x, const U y, const U z)  
Set to the given coordinates.
  Point2D jmp(const U dx, const U dy, const U z) const  
Return a Point with dx, dy and dz relative to the coordinates of the point, i.e., dx, dy and dz are offsets from the values returned by x(), y() and z().
  T &x()  
The X coordinate; p.x() is an alias for p[X].
  T &y()  
The Y coordinate; p.y() is an alias for p[Y].
  T &z()  
The Z coordinate; p.z() is an alias for p[Z].

Predefined Typedefs

  iPoint2D  
Alias for Point2D< T>.
  iVector2D  
A vector in 2D space defined by two "int"s.
  iLine2D  
A line in 2D space between two "iPoint2D"s.
  iTriangle2D  
A triangle in 2D space that consists of three "iPoint2D"s.
  fPoint2D  
A point in 2D space defined by two "float"s.
  fVector2D  
A vector in 2D space defined by two "float"s.
  fLine2D  
A line in 2D space between two "fPoint2D"s.
  fTriangle2D  
A triangle in 2D space that consists of three "fPoint2D"s.
  dPoint2D  
A point in 2D space defined by two "double"s.
  dVector2D  
A vector in 2D space defined by two "double"s.
  dLine2D  
A line in 2D space between two "dPoint2D"s.
  dTriangle2D  
A triangle in 2D space that consists of three "dPoint2D"s.
  iPoint3D  
A point in 3D space defined by three "int"s.
  iVector3D  
A vector in 3D space defined by three "int"s.
  iLine3D  
A line in 3D space between three "iPoint3D"s.
  iTriangle3D  
A triangle in 3D space that consists of three "iPoint3D"s.
  fPoint3D  
A point in 3D space defined by three "float"s.
  fVector3D  
A vector in 3D space defined by three "float"s.
  fLine3D  
A line in 3D space between three "fPoint3D"s.
  fTriangle3D  
A triangle in 3D space that consists of three "fPoint3D"s.
  dPoint3D  
A point in 3D space defined by three "double"s.
  dVector3D  
A vector in 3D space defined by three "double"s.
  dLine3D  
A line in 3D space between three "dPoint3D"s.
  dTriangle3D  
A triangle in 3D space that consists of three "dPoint3D"s.
  IndexLine  
Essentially a set of two "unsigned int"s, assumed to identify points in an external data structure.
  IndexTriangle  
Essentially a set of three "unsigned int"s, assumed to identify points in an external data structure.