MeVisLabToolboxReference
ml::ProjectedCSO Class Reference

This class is a helper class used internally by CSOPointInPolygon. More...

#include <CSOPointInPolygon.h>

List of all members.

Public Member Functions

 ProjectedCSO ()
 Default constructor.
bool contains (const Vector3 &p) const
 Checks whether the projected CSO contains the point p.

Static Public Member Functions

static ProjectedCSO fromCSO (CSO *cso)
 Projects the given planar CSO cso to one of the 2D planes X-Y, X-Z, Y-Z.
static ProjectedCSO fromPointListAndNormal (const std::vector< Vector3 > &points, const Vector3 &normal)
 The same as fromCSO() but with a vector of positions and a normal instead of a CSO.

Detailed Description

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 28 of file CSOPointInPolygon.h.


Constructor & Destructor Documentation

ml::ProjectedCSO::ProjectedCSO ( )

Default constructor.

Creates an invalid projected CSO. Use fromCSO() for creating a projected CSO.


Member Function Documentation

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.
static ProjectedCSO ml::ProjectedCSO::fromCSO ( CSO cso) [static]

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:
csothe CSO to be projected to 2D
Returns:
the projected CSO or an invalid projected CSO if the CSO cso is not planar
static ProjectedCSO ml::ProjectedCSO::fromPointListAndNormal ( const std::vector< Vector3 > &  points,
const Vector3 normal 
) [static]

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: