This class is a helper class used internally by CSOPointInPolygon.
More...
#include <CSOPointInPolygon.h>
This class is a helper class used internally by CSOPointInPolygon.
- Author
- Ingo Kloecker
This class represents the projection of a planar CSO to one of the 2D planes X-Y, X-Z, or Y-Z.
Definition at line 33 of file CSOPointInPolygon.h.
◆ ProjectedCSO()
ml::ProjectedCSO::ProjectedCSO |
( |
| ) |
|
Default constructor.
Creates an invalid projected CSO. Use fromCSO() for creating a projected CSO.
◆ contains()
bool ml::ProjectedCSO::contains |
( |
const Vector3 & |
p | ) |
const |
Checks whether the projected CSO contains the point p.
Uses the winding number for the definition of inclusion.
- Returns
- true if the point p is contained in the projected CSO; otherwise returns false.
◆ fromCSO()
Projects the given planar CSO cso to one of the 2D planes X-Y, X-Z, Y-Z.
This is done by ignoring one of the 3D coordinates and using the other two. To achieve optimal numerical robustness the normal vector of the CSO is calculated and the coordinate with the largest absolute value is chosen. Returns an invalid projected CSO if the given CSO is not planar.
See John M. Snyder, Alan H. Barr, "Ray Tracing Complex Models Containing Surface Tessellations", Computer Graphics 21(4), 119-126 (1987) [also in the Proceedings of SIGGRAPH 1987] for details.
- Note
- Unfortunately, cso cannot be passed as const because we need to call some methods (like CSO::isInPlane()) which are not const
- Parameters
-
cso | the CSO to be projected to 2D |
- Returns
- the projected CSO or an invalid projected CSO if the CSO cso is not planar
◆ fromPointListAndNormal()
The same as fromCSO() but with a vector of positions and a normal instead of a CSO.
The documentation for this class was generated from the following file: