|
| | PlaneGeometry () |
| |
| | PlaneGeometry (IBKMK::Polygon2D::type_t t, const IBKMK::Vector3D &a, const IBKMK::Vector3D &b, const IBKMK::Vector3D &c) |
| |
| | PlaneGeometry (const IBKMK::Polygon3D &poly3D) |
| |
| bool | isValid () const |
| |
| double | inclination (int digits=1) const |
| |
| double | orientation (int digits=1) const |
| |
| const VICUS::Polygon3D & | polygon3D () const |
| |
| const IBKMK::Vector3D & | offset () const |
| |
| const IBKMK::Vector3D & | normal () const |
| |
| const IBKMK::Vector3D & | localX () const |
| |
| const IBKMK::Vector3D & | localY () const |
| |
| double | area (int digits=1) const |
| |
| IBKMK::Vector3D | centerPoint () const |
| |
| const IBKMK::Polygon2D & | polygon2D () const |
| |
| const std::vector< Hole > & | holes () const |
| |
| void | setPolygon (const Polygon3D &polygon3D) |
| |
| void | setHoles (const std::vector< Hole > &holes) |
| |
| void | setGeometry (const Polygon3D &polygon3D, const std::vector< Hole > &holes) |
| |
| void | flip () |
| |
| void | changeOrigin (unsigned int idx) |
| |
| const PlaneTriangulationData & | triangulationData () const |
| |
| const PlaneTriangulationData & | triangulationDataWithoutHoles () const |
| |
| const std::vector< PlaneTriangulationData > & | holeTriangulationData () const |
| |
| bool | intersectsLine (const IBKMK::Vector3D &p1, const IBKMK::Vector3D &d, IBKMK::Vector3D &intersectionPoint, double &dist, int &holeIndex, bool hitBackfacingPlanes=false, bool endlessPlane=false) const |
| |
Class PlaneGeometry encapsulates the vertex data and plane type of a single plane in the geometrical model. Its main purpose is the triangulation of the outer polygon (optionally with holes) and the triangulation of the subsurfaces and to provide said data for visualization. Also, it implements intersection tests (for picking).
Since triangulation operations may be costly, the class implements lazy evaluation. Anything setting function that affects the computed triangulation just marks the PlaneGeometry as dirty. The triangulation is then computed on demand the triangulation data is accessed.
Note: PlaneGeometry is a runtime-only class and not used in the VICUS::Project data model. Instead, all data stored in PlaneGeometry is actually held in VICUS::Surface and its member variables.
| bool VICUS::PlaneGeometry::intersectsLine |
( |
const IBKMK::Vector3D & |
p1, |
|
|
const IBKMK::Vector3D & |
d, |
|
|
IBKMK::Vector3D & |
intersectionPoint, |
|
|
double & |
dist, |
|
|
int & |
holeIndex, |
|
|
bool |
hitBackfacingPlanes = false, |
|
|
bool |
endlessPlane = false |
|
) |
| const |
Tests if a line (with equation p = p1 + t * d) hits this plane. Returns true if intersection is found, and returns the normalized distance (t) between intersection point 'intersectionPoint' and point p1.
The optional argument hitBackfacingPlanes disables the front-facing check (if true). The optional argument endlessPlane disables the check if the intersection point lies within the plane (useful for getting intersections with, for example, the xy-plane).
If plane contains holes, 'holeIndex' contains the index of the respective hole. If the plane does not have any holes or the opaque surface was clicked, holeIndex will be -1.