RTK  1.4.0
Reconstruction Toolkit
rtkQuadricShape.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 rtkQuadricShape_h
20 #define rtkQuadricShape_h
21 
22 #include "RTKExport.h"
23 #include <itkPoint.h>
24 #include <rtkMacro.h>
25 
26 #include "rtkConvexShape.h"
27 
28 namespace rtk
29 {
30 
45 class RTK_EXPORT QuadricShape:
46  public ConvexShape
47 {
48 public:
50  typedef QuadricShape Self;
54 
57  typedef Superclass::PointType PointType;
58  typedef Superclass::VectorType VectorType;
59 
61  itkNewMacro ( Self );
62 
64  itkTypeMacro(QuadricShape, ConvexShape);
65 
67  virtual bool IsInside(const PointType & point) const ITK_OVERRIDE;
68 
72  virtual bool IsIntersectedByRay(const PointType & rayOrigin,
73  const VectorType & rayDirection,
74  double & nearDist,
75  double & farDist) const ITK_OVERRIDE;
76 
78  virtual void Rescale(const VectorType &r) ITK_OVERRIDE;
79 
81  virtual void Translate(const VectorType &t) ITK_OVERRIDE;
82 
84  virtual void Rotate(const RotationMatrixType &r) ITK_OVERRIDE;
85 
86  itkGetConstMacro(A, ScalarType);
87  itkSetMacro(A, ScalarType);
88  itkGetConstMacro(B, ScalarType);
89  itkSetMacro(B, ScalarType);
90  itkGetConstMacro(C, ScalarType);
91  itkSetMacro(C, ScalarType);
92  itkGetConstMacro(D, ScalarType);
93  itkSetMacro(D, ScalarType);
94  itkGetConstMacro(E, ScalarType);
95  itkSetMacro(E, ScalarType);
96  itkGetConstMacro(F, ScalarType);
97  itkSetMacro(F, ScalarType);
98  itkGetConstMacro(G, ScalarType);
99  itkSetMacro(G, ScalarType);
100  itkGetConstMacro(H, ScalarType);
101  itkSetMacro(H, ScalarType);
102  itkGetConstMacro(I, ScalarType);
103  itkSetMacro(I, ScalarType);
104  itkGetConstMacro(J, ScalarType);
105  itkSetMacro(J, ScalarType);
106 
107  void SetEllipsoid(const PointType &center, const VectorType &axis, const ScalarType &yangle=0);
108 
109  virtual itk::LightObject::Pointer InternalClone() const ITK_OVERRIDE;
110 
111 private:
112  QuadricShape();
113 
114  ScalarType m_A;
115  ScalarType m_B;
116  ScalarType m_C;
117  ScalarType m_D;
118  ScalarType m_E;
119  ScalarType m_F;
120  ScalarType m_G;
121  ScalarType m_H;
122  ScalarType m_I;
123  ScalarType m_J;
124 };
125 
126 } // end namespace rtk
127 
128 #endif
itk::SmartPointer< const Self > ConstPointer
ConvexShape Superclass
Superclass::VectorType VectorType
Superclass::PointType PointType
QuadricShape Self
Superclass::ScalarType ScalarType
Defines a 3D quadric shape.
itk::SmartPointer< Self > Pointer
Base class for a 3D convex shape.
#define itkSetMacro(name, type)