MeVisLabToolboxReference
|
00001 // **InsertLicense** code 00002 //---------------------------------------------------------------------------------- 00005 00010 //---------------------------------------------------------------------------------- 00011 00012 #ifndef __CSOPointInPolygon_H 00013 #define __CSOPointInPolygon_H 00014 00015 #include "MLCSOIncludes.h" 00016 #include "CSOBase/CSO.h" 00017 00018 ML_START_NAMESPACE 00019 00028 class ProjectedCSO 00029 { 00030 public: 00031 00035 ProjectedCSO(); 00036 00054 static ProjectedCSO fromCSO( CSO* cso ); 00055 00059 static ProjectedCSO fromPointListAndNormal( const std::vector < Vector3 >& points, const Vector3& normal ); 00060 00067 bool contains( const Vector3& p ) const; 00068 00069 private: 00071 std::vector<Vector2> _points; 00072 00074 int _xCoordinate; 00075 00077 int _yCoordinate; 00078 }; 00079 00081 00082 namespace CSOPointInPolygon 00083 { 00084 MLCSO_EXPORT bool isPointInCSO( CSO* cso, const Vector3& point ); 00085 MLCSO_EXPORT bool isPointInPolygon( const std::vector < Vector3 >& points, const Vector3& normal, const Vector3& point ); 00086 } 00087 00089 00090 ML_END_NAMESPACE 00091 00092 #endif // __CSOPointInPolygon_H