ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
rtkConvexShape.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright RTK Consortium
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18
19#ifndef rtkConvexShape_h
20#define rtkConvexShape_h
21
22#include <itkDataObject.h>
23#include <itkMatrix.h>
24#include <itkObjectFactory.h>
25#include <itkPoint.h>
26
27#include "RTKExport.h"
28#include "rtkMacro.h"
29
30namespace rtk
31{
46class RTK_EXPORT ConvexShape : public itk::DataObject
47{
48public:
49 ITK_DISALLOW_COPY_AND_MOVE(ConvexShape);
50
56
58 static constexpr unsigned int Dimension = 3;
59 using ScalarType = double;
63
65 itkNewMacro(Self);
66
68 itkOverrideGetNameOfClassMacro(ConvexShape);
69
71 virtual bool
72 IsInside(const PointType & point) const;
73
77 virtual bool
78 IsIntersectedByRay(const PointType & rayOrigin,
79 const VectorType & rayDirection,
80 ScalarType & infDist,
81 ScalarType & supDist) const;
82
84 virtual void
85 Rescale(const VectorType & r);
86
88 virtual void
90
92 virtual void
94
97 void
98 AddClipPlane(const VectorType & dir, const ScalarType & pos);
99 void
100 SetClipPlanes(const std::vector<VectorType> & dir, const std::vector<ScalarType> & pos);
101
104 itkGetConstMacro(Density, ScalarType);
105 itkGetMacro(Density, ScalarType);
106
108 itkGetConstReferenceMacro(PlaneDirections, std::vector<VectorType>);
109 itkGetConstReferenceMacro(PlanePositions, std::vector<ScalarType>);
110
111protected:
113 bool
114 ApplyClipPlanes(const PointType & rayOrigin,
115 const VectorType & rayDirection,
116 ScalarType & infDist,
117 ScalarType & supDist) const;
118 bool
119 ApplyClipPlanes(const PointType & point) const;
121 InternalClone() const override;
122
123private:
125 std::vector<VectorType> m_PlaneDirections;
126 std::vector<ScalarType> m_PlanePositions;
127};
128
129} // namespace rtk
130#endif
Base class for all data objects in ITK.
SmartPointer< Self > Pointer
A templated class holding a M x N size Matrix.
Definition itkMatrix.h:71
A templated class holding a geometric point in n-Dimensional space.
Definition itkPoint.h:54
Implements transparent reference counting.
A templated class holding a n-Dimensional vector.
Definition itkVector.h:63
bool ApplyClipPlanes(const PointType &point) const
bool ApplyClipPlanes(const PointType &rayOrigin, const VectorType &rayDirection, ScalarType &infDist, ScalarType &supDist) const
itk::SmartPointer< Self > Pointer
virtual void Translate(const VectorType &t)
std::vector< ScalarType > m_PlanePositions
virtual void Rotate(const RotationMatrixType &r)
virtual bool IsInside(const PointType &point) const
void SetClipPlanes(const std::vector< VectorType > &dir, const std::vector< ScalarType > &pos)
itk::Point< ScalarType, Dimension > PointType
virtual void Rescale(const VectorType &r)
virtual bool IsIntersectedByRay(const PointType &rayOrigin, const VectorType &rayDirection, ScalarType &infDist, ScalarType &supDist) const
itk::LightObject::Pointer InternalClone() const override
static constexpr unsigned int Dimension
std::vector< VectorType > m_PlaneDirections
itk::Vector< ScalarType, Dimension > VectorType
itk::SmartPointer< const Self > ConstPointer
void AddClipPlane(const VectorType &dir, const ScalarType &pos)
itk::DataObject Superclass
itk::Matrix< ScalarType, Dimension, Dimension > RotationMatrixType
#define itkSetMacro(name, type)