MeVisLab Toolbox Reference
CSOPointInPolygon.h
Go to the documentation of this file.
1 /*************************************************************************************
2 **
3 ** Copyright 2012, MeVis Medical Solutions AG
4 **
5 ** The user may use this file in accordance with the license agreement provided with
6 ** the Software or, alternatively, in accordance with the terms contained in a
7 ** written agreement between the user and MeVis Medical Solutions AG.
8 **
9 ** For further information use the contact form at https://www.mevislab.de/contact
10 **
11 **************************************************************************************/
12 
13 
16 
17 #pragma once
18 
19 
20 #include "MLCSOIncludes.h"
21 #include "CSOBase/CSO.h"
22 
23 ML_START_NAMESPACE
24 
34 {
35 public:
36 
41 
59  static ProjectedCSO fromCSO( const CSO* cso );
60 
64  static ProjectedCSO fromPointListAndNormal( const std::vector < Vector3 >& points, const Vector3& normal );
65 
72  bool contains( const Vector3& p ) const;
73 
74 private:
76  std::vector<Vector2> _points;
77 
79  int _xCoordinate;
80 
82  int _yCoordinate;
83 };
84 
86 
87 namespace CSOPointInPolygon
88 {
89  MLCSO_EXPORT bool isPointInCSO( CSO* cso, const Vector3& point );
90  MLCSO_EXPORT bool isPointInPolygon( const std::vector < Vector3 >& points, const Vector3& normal, const Vector3& point );
91 }
92 
94 
95 ML_END_NAMESPACE
#define MLCSO_EXPORT
Defines export symbols for classes, so they can be used in other DLLs.
Definition: MLCSOSystem.h:23
The CSO represents a contour segmentation object.
Definition: CSO.h:44
This class is a helper class used internally by CSOPointInPolygon.
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.
ProjectedCSO()
Default constructor.
bool contains(const Vector3 &p) const
Checks whether the projected CSO contains the point p.
static ProjectedCSO fromCSO(const CSO *cso)
Projects the given planar CSO cso to one of the 2D planes X-Y, X-Z, Y-Z.
MLCSO_EXPORT bool isPointInCSO(CSO *cso, const Vector3 &point)
MLCSO_EXPORT bool isPointInPolygon(const std::vector< Vector3 > &points, const Vector3 &normal, const Vector3 &point)