MeVisLab Toolbox Reference
ml::CSOPointInPolygonChecker Class Reference

Checks whether a point is inside a planar, closed polygon in an arbitrary plane. More...

#include <CSOPointInPolygonChecker.h>

Public Member Functions

 CSOPointInPolygonChecker (const CSO *cso)
 Sets the polygon based on a CSO. More...
 
 CSOPointInPolygonChecker (std::vector< Vector3 > &pathPoints, const Vector3 &normal, bool overwritePathPoints=false)
 Sets the polygon based on a list of points and a normal. More...
 
 ~CSOPointInPolygonChecker ()
 Destructor. More...
 
void set (const CSO *cso)
 Sets the polygon based on a CSO. More...
 
void set (std::vector< Vector3 > &pathPoints, const Vector3 &normal, bool overwritePathPoints=false)
 Sets the polygon based on a list of points and a normal. More...
 
bool isPointInsidePolygon (const Vector3 &pos) const
 Checks whether a given point is inside the polygon. More...
 

Detailed Description

Checks whether a point is inside a planar, closed polygon in an arbitrary plane.

The algorithm uses a bounding box test and a binning along the y-axis of the line segments. The CSOPointInPolygonChecker is optimized for testing a number of points against the same CSO. If only one point should be tested against a CSO, use the CSOPointInPolygon class.

Definition at line 32 of file CSOPointInPolygonChecker.h.

Constructor & Destructor Documentation

◆ CSOPointInPolygonChecker() [1/2]

ml::CSOPointInPolygonChecker::CSOPointInPolygonChecker ( const CSO cso)

Sets the polygon based on a CSO.

◆ CSOPointInPolygonChecker() [2/2]

ml::CSOPointInPolygonChecker::CSOPointInPolygonChecker ( std::vector< Vector3 > &  pathPoints,
const Vector3 normal,
bool  overwritePathPoints = false 
)

Sets the polygon based on a list of points and a normal.

If overwritePathPoints is true the given pathPoints vector will be overwritten by the projected polygon points!

◆ ~CSOPointInPolygonChecker()

ml::CSOPointInPolygonChecker::~CSOPointInPolygonChecker ( )
inline

Destructor.

Definition at line 47 of file CSOPointInPolygonChecker.h.

Member Function Documentation

◆ isPointInsidePolygon()

bool ml::CSOPointInPolygonChecker::isPointInsidePolygon ( const Vector3 pos) const

Checks whether a given point is inside the polygon.

◆ set() [1/2]

void ml::CSOPointInPolygonChecker::set ( const CSO cso)

Sets the polygon based on a CSO.

◆ set() [2/2]

void ml::CSOPointInPolygonChecker::set ( std::vector< Vector3 > &  pathPoints,
const Vector3 normal,
bool  overwritePathPoints = false 
)

Sets the polygon based on a list of points and a normal.

If overwritePathPoints is true the given pathPoints vector will be overwritten by the projected polygon points!


The documentation for this class was generated from the following file: