RTK  1.4.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:
39  public ConvexShape
40 {
41 public:
47 
49  itkStaticConstMacro(Dimension, unsigned int, Superclass::Dimension);
51  typedef std::vector<ConvexShapePointer> ConvexShapeVector;
52  typedef Superclass::ScalarType ScalarType;
53  typedef Superclass::PointType PointType;
54  typedef Superclass::VectorType VectorType;
55  typedef Superclass::RotationMatrixType RotationMatrixType;
56 
58  itkNewMacro ( Self );
59 
62 
64  virtual bool IsInside(const PointType & point) const ITK_OVERRIDE;
65 
67  virtual bool IsIntersectedByRay(const PointType & rayOrigin,
68  const VectorType & rayDirection,
69  ScalarType & nearDist,
70  ScalarType & farDist) const ITK_OVERRIDE;
71 
73  void AddConvexShape(const ConvexShapePointer &co);
74  itkGetConstReferenceMacro(ConvexShapes, ConvexShapeVector);
75  virtual void SetConvexShapes(const ConvexShapeVector &_arg);
77 
79  virtual void Rescale(const VectorType &r) ITK_OVERRIDE;
80 
82  virtual void Translate(const VectorType &t) ITK_OVERRIDE;
83 
85  virtual void Rotate(const RotationMatrixType &r) ITK_OVERRIDE;
86 
87  virtual itk::LightObject::Pointer InternalClone() const ITK_OVERRIDE;
88 
89 private:
91 
92  ConvexShapeVector m_ConvexShapes;
93 };
94 
95 } // end namespace rtk
96 
97 #endif
Superclass::RotationMatrixType RotationMatrixType
itk::SmartPointer< const Self > ConstPointer
Defines a shape as the intersection of several ConvexShape.
std::vector< ConvexShapePointer > ConvexShapeVector
Base class for a 3D convex shape.