RTK  2.1.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  * http://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 
61 
63  bool
64  IsInside(const PointType & point) const override;
65 
67  bool
68  IsIntersectedByRay(const PointType & rayOrigin,
69  const VectorType & rayDirection,
70  ScalarType & nearDist,
71  ScalarType & farDist) const override;
72 
74  void
75  AddConvexShape(const ConvexShape * co);
76  itkGetConstReferenceMacro(ConvexShapes, ConvexShapeVector);
77  virtual void
78  SetConvexShapes(const ConvexShapeVector & _arg);
80 
82  void
83  Rescale(const VectorType & r) override;
84 
86  void
87  Translate(const VectorType & t) override;
88 
90  void
91  Rotate(const RotationMatrixType & r) override;
92 
94  InternalClone() const override;
95 
96 private:
98 
100 };
101 
102 } // end namespace rtk
103 
104 #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.