RTK  2.0.1
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:
39  public ConvexShape
40 {
41 public:
47 
49  static constexpr unsigned int Dimension = Superclass::Dimension;
51  using ConvexShapeVector = std::vector<ConvexShapePointer>;
52  using ScalarType = Superclass::ScalarType;
53  using PointType = Superclass::PointType;
54  using VectorType = Superclass::VectorType;
55  using RotationMatrixType = Superclass::RotationMatrixType;
56 
58  itkNewMacro ( Self );
59 
62 
64  bool IsInside(const PointType & point) const override;
65 
67  bool IsIntersectedByRay(const PointType & rayOrigin,
68  const VectorType & rayDirection,
69  ScalarType & nearDist,
70  ScalarType & farDist) const override;
71 
73  void AddConvexShape(const ConvexShapePointer &co);
74  itkGetConstReferenceMacro(ConvexShapes, ConvexShapeVector);
75  virtual void SetConvexShapes(const ConvexShapeVector &_arg);
77 
79  void Rescale(const VectorType &r) override;
80 
82  void Translate(const VectorType &t) override;
83 
85  void Rotate(const RotationMatrixType &r) override;
86 
87  itk::LightObject::Pointer InternalClone() const override;
88 
89 private:
91 
93 };
94 
95 } // end namespace rtk
96 
97 #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.