20 #ifndef MIRTK_Polyhedron_H 21 #define MIRTK_Polyhedron_H 23 #include "mirtk/Object.h" 24 #include "mirtk/Point.h" 26 #include "vtkSmartPointer.h" 27 #include "vtkPolyData.h" 49 mirtkPublicAttributeMacro(vtkSmartPointer<vtkPolyData>, DataSet);
75 void GetPoint(
int,
double &,
double &,
double &)
const;
78 void GetPoint(
int,
double [3])
const;
90 static double Volume(vtkPolyData *);
102 static int WindingNumber(vtkPolyData *,
double,
double,
double);
114 bool IsInside(
double,
double,
double)
const;
123 static bool IsInside(vtkPolyData *,
double,
double,
double);
126 static bool IsInside(vtkPolyData *,
double [3]);
144 return static_cast<int>(_DataSet->GetNumberOfPoints());
150 _DataSet->GetPoint(i, p);
157 _DataSet->GetPoint(i, p);
158 x = p[0], y = p[1], z = p[2];
240 return IsInside(polydata, p[0], p[1], p[2]);
252 #endif // MIRTK_Polyhedron_H void GetPoint(int, double &, double &, double &) const
Get vertex position.
double Volume() const
Calculate volume enclosed by polyhedron.
double _x
x coordinate of Point
virtual ~Polyhedron()
Destructor.
int WindingNumber(double, double, double) const
Compute winding number of polyhedron around given point.
Polyhedron(vtkPolyData *=NULL)
Constructor.
bool IsInside(double, double, double) const
Test whether point is inside the polyhedron.
double _z
z coordinate of Point
int NumberOfPoints() const
Number of vertices.
double _y
y coordinate of Point
Polyhedron & operator=(const Polyhedron &)
Assignment operator.