1 /*=========================================================================
2 
3   Program:   Visualization Toolkit
4   Module:    vtkCylindricalTransform.h
5 
6   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7   All rights reserved.
8   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10      This software is distributed WITHOUT ANY WARRANTY; without even
11      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12      PURPOSE.  See the above copyright notice for more information.
13 
14 =========================================================================*/
15 /**
16  * @class   vtkCylindricalTransform
17  * @brief   cylindrical to rectangular coords and back
18  *
19  * vtkCylindricalTransform will convert (r,theta,z) coordinates to
20  * (x,y,z) coordinates and back again.  The angles are given in radians.
21  * By default, it converts cylindrical coordinates to rectangular, but
22  * GetInverse() returns a transform that will do the opposite.  The
23  * equation that is used is x = r*cos(theta), y = r*sin(theta), z = z.
24  * @warning
25  * This transform is not well behaved along the line x=y=0 (i.e. along
26  * the z-axis)
27  * @sa
28  * vtkSphericalTransform vtkGeneralTransform
29  */
30 
31 #ifndef vtkCylindricalTransform_h
32 #define vtkCylindricalTransform_h
33 
34 #include "vtkCommonTransformsModule.h" // For export macro
35 #include "vtkWarpTransform.h"
36 
37 class VTKCOMMONTRANSFORMS_EXPORT vtkCylindricalTransform : public vtkWarpTransform
38 {
39 public:
40   static vtkCylindricalTransform* New();
41   vtkTypeMacro(vtkCylindricalTransform, vtkWarpTransform);
42   void PrintSelf(ostream& os, vtkIndent indent) override;
43 
44   /**
45    * Make another transform of the same type.
46    */
47   vtkAbstractTransform* MakeTransform() override;
48 
49 protected:
50   vtkCylindricalTransform();
51   ~vtkCylindricalTransform() override;
52 
53   /**
54    * Copy this transform from another of the same type.
55    */
56   void InternalDeepCopy(vtkAbstractTransform* transform) override;
57 
58   ///@{
59   /**
60    * Internal functions for calculating the transformation.
61    */
62   void ForwardTransformPoint(const float in[3], float out[3]) override;
63   void ForwardTransformPoint(const double in[3], double out[3]) override;
64   ///@}
65 
66   void ForwardTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
67   void ForwardTransformDerivative(
68     const double in[3], double out[3], double derivative[3][3]) override;
69 
70   void InverseTransformPoint(const float in[3], float out[3]) override;
71   void InverseTransformPoint(const double in[3], double out[3]) override;
72 
73   void InverseTransformDerivative(const float in[3], float out[3], float derivative[3][3]) override;
74   void InverseTransformDerivative(
75     const double in[3], double out[3], double derivative[3][3]) override;
76 
77 private:
78   vtkCylindricalTransform(const vtkCylindricalTransform&) = delete;
79   void operator=(const vtkCylindricalTransform&) = delete;
80 };
81 
82 #endif
83