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 "rtkWin32Header.h"
23 
24 #include <itkPoint.h>
25 #include <rtkMacro.h>
26 
27 #include "rtkConvexShape.h"
28 
29 namespace rtk
30 {
31 
47  public ConvexShape
48 {
49 public:
51  typedef QuadricShape Self;
55 
58  typedef Superclass::PointType PointType;
59  typedef Superclass::VectorType VectorType;
60 
62  itkNewMacro ( Self );
63 
65  itkTypeMacro(QuadricShape, ConvexShape);
66 
68  virtual bool IsInside(const PointType & point) const ITK_OVERRIDE;
69 
73  virtual bool IsIntersectedByRay(const PointType & rayOrigin,
74  const VectorType & rayDirection,
75  double & nearDist,
76  double & farDist) const ITK_OVERRIDE;
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  itkGetConstMacro(A, ScalarType);
88  itkSetMacro(A, ScalarType);
89  itkGetConstMacro(B, ScalarType);
90  itkSetMacro(B, ScalarType);
91  itkGetConstMacro(C, ScalarType);
92  itkSetMacro(C, ScalarType);
93  itkGetConstMacro(D, ScalarType);
94  itkSetMacro(D, ScalarType);
95  itkGetConstMacro(E, ScalarType);
96  itkSetMacro(E, ScalarType);
97  itkGetConstMacro(F, ScalarType);
98  itkSetMacro(F, ScalarType);
99  itkGetConstMacro(G, ScalarType);
100  itkSetMacro(G, ScalarType);
101  itkGetConstMacro(H, ScalarType);
102  itkSetMacro(H, ScalarType);
103  itkGetConstMacro(I, ScalarType);
104  itkSetMacro(I, ScalarType);
105  itkGetConstMacro(J, ScalarType);
106  itkSetMacro(J, ScalarType);
107 
108  void SetEllipsoid(const PointType &center, const VectorType &axis, const ScalarType &yangle=0);
109 
110  virtual itk::LightObject::Pointer InternalClone() const ITK_OVERRIDE;
111 
112 private:
113  QuadricShape();
114 
115  ScalarType m_A;
116  ScalarType m_B;
117  ScalarType m_C;
118  ScalarType m_D;
119  ScalarType m_E;
120  ScalarType m_F;
121  ScalarType m_G;
122  ScalarType m_H;
123  ScalarType m_I;
124  ScalarType m_J;
125 };
126 
127 } // end namespace rtk
128 
129 #endif
itk::SmartPointer< const Self > ConstPointer
ConvexShape Superclass
Superclass::VectorType VectorType
Superclass::PointType PointType
QuadricShape Self
Superclass::ScalarType ScalarType
#define RTK_EXPORT
Defines a 3D quadric shape.
itk::SmartPointer< Self > Pointer
Base class for a 3D convex shape.
#define itkSetMacro(name, type)