MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
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
24
34{
35public:
40
58 static ProjectedCSO fromCSO(const CSO* cso);
59
63 static ProjectedCSO fromPointListAndNormal(const std::vector<Vector3>& points, const Vector3& normal);
64
71 bool contains(const Vector3& p) const;
72
73private:
75 std::vector<Vector2> _points;
76
78 int _xCoordinate;
79
81 int _yCoordinate;
82};
83
85
86namespace CSOPointInPolygon
87{
89 MLCSO_EXPORT bool isPointInPolygon(const std::vector<Vector3>& points, const Vector3& normal, const Vector3& point);
90} // namespace CSOPointInPolygon
91
93
#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.
Target mlrange_cast(Source arg)
Generic version of checked ML casts.
MLCSO_EXPORT bool isPointInCSO(CSO *cso, const Vector3 &point)
MLCSO_EXPORT bool isPointInPolygon(const std::vector< Vector3 > &points, const Vector3 &normal, const Vector3 &point)