RTK  2.6.0
Reconstruction Toolkit
rtkIntersectionOfConvexShapes.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 rtkIntersectionOfConvexShapes_h
20 #define rtkIntersectionOfConvexShapes_h
21 
22 #include "RTKExport.h"
23 #include "rtkMacro.h"
24 #include "rtkConvexShape.h"
25 
26 namespace rtk
27 {
28 
38 class RTK_EXPORT IntersectionOfConvexShapes : public ConvexShape
39 {
40 public:
46 
48  static constexpr unsigned int Dimension = Superclass::Dimension;
50  using ConvexShapeVector = std::vector<ConvexShapePointer>;
51  using ScalarType = Superclass::ScalarType;
52  using PointType = Superclass::PointType;
53  using VectorType = Superclass::VectorType;
54  using RotationMatrixType = Superclass::RotationMatrixType;
55 
57  itkNewMacro(Self);
58 
60 #ifdef itkOverrideGetNameOfClassMacro
61  itkOverrideGetNameOfClassMacro(IntersectionOfConvexShapes);
62 #else
64 #endif
65 
66 
68  bool
69  IsInside(const PointType & point) const override;
70 
72  bool
73  IsIntersectedByRay(const PointType & rayOrigin,
74  const VectorType & rayDirection,
75  ScalarType & nearDist,
76  ScalarType & farDist) const override;
77 
79  void
80  AddConvexShape(const ConvexShape * co);
81  itkGetConstReferenceMacro(ConvexShapes, ConvexShapeVector);
82  virtual void
83  SetConvexShapes(const ConvexShapeVector & _arg);
85 
87  void
88  Rescale(const VectorType & r) override;
89 
91  void
92  Translate(const VectorType & t) override;
93 
95  void
96  Rotate(const RotationMatrixType & r) override;
97 
99  InternalClone() const override;
100 
101 private:
103 
105 };
106 
107 } // end namespace rtk
108 
109 #endif
std::vector< ConvexShapePointer > ConvexShapeVector
Defines a shape as the intersection of several ConvexShape.
itk::SmartPointer< Self > Pointer
constexpr unsigned int Dimension
Base class for a 3D convex shape.