XYZTransform.cxx
Go to the documentation of this file.
1 
12 #include "XYZTransform.h"
13 
14 #include "UnaryTransform.h"
15 
16 using std::vector;
17 
18 namespace hippodraw {
19 
21  UnaryTransform * y,
22  UnaryTransform * z )
23 {
24  m_name = "XYZTransform";
25  m_x = x;
26  m_y = y;
27  m_z = z;
28 }
29 
31 {
32  delete m_x;
33  delete m_y;
34  delete m_z;
35 }
36 
38  : XYZTransformBase ( t )
39 {
40 #ifdef CLONE_DEFECT
41  m_x = dynamic_cast < UnaryTransform * > ( t.m_x->clone () );
42  m_y = dynamic_cast < UnaryTransform * > ( t.m_y->clone () );
43  m_z = dynamic_cast < UnaryTransform * > ( t.m_z->clone () );
44 #else
45  m_x = t.m_x->clone ();
46  m_y = t.m_y->clone ();
47  m_z = t.m_z->clone ();
48 #endif
49 }
50 
51 #ifdef CLONE_DEFECT
53 #else
55 #endif
56 {
57  return new XYZTransform ( *this );
58 }
59 
60 /* virtual */
61 void XYZTransform::transform ( double & x,
62  double & y,
63  double & z ) const
64 {
65  m_x->transform ( x );
66  m_y->transform ( y );
67  m_z->transform ( z );
68 }
69 
70 /* virtual */
71 void
73 transform ( std::vector< double > & x,
74  std::vector< double > & y,
75  std::vector< double > & z ) const
76 {
77  m_x->transform ( x );
78  m_y->transform ( y );
79  m_z->transform ( z );
80 }
81 
82 /* virtual */
83 void XYZTransform::validate ( Range & x, Range & y, Range & z ) const
84 {
85  m_x->validate ( x );
86  m_y->validate ( y );
87  m_z->validate ( z );
88 }
89 
90 /* virtual */
91 const Range & XYZTransform::limitX () const
92 {
93  return m_x->limits ();
94 }
95 
96 /* virtual */
97 const Range & XYZTransform::limitY () const
98 {
99  return m_y->limits ();
100 }
101 
102 /* virtual */
103 const Range & XYZTransform::limitZ () const
104 {
105  return m_z->limits ();
106 }
107 
109 {
110  return m_x;
111 }
112 
114 {
115  return m_y;
116 }
117 
119 {
120  return m_z;
121 }
122 
124 {
125  return m_z->isLinear();
126 }
127 
128 
129 } // namespace hippodraw
130 
TransformBase * zTransform() const
Returns the transform function on the Z axis.
virtual const Range & limitZ() const
Returns a Range whose values are the limits on the Z coordinate.
virtual const Range & limitY() const
Returns a Range whose values are the limits on the Y coordinate.
virtual const Range & limitX() const
Returns a Range whose values are the limits on the X coordinate.
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
UnaryTransform class interface.
virtual UnaryTransform * clone() const =0
Function to make copy of object.
virtual bool isLinearInZ() const
Returns true if Z axis is linear.
virtual void validate(Range &x, Range &y, Range &z) const
TransformBase * yTransform() const
Returns the transform function on the Y axis.
virtual const Range & limits() const
Returns a Range whose values are the limits on the coordinate.
virtual XYZTransform * clone() const
Creates a new Transform object by copying an existing one.
virtual bool isLinear() const =0
virtual void transform(double &x) const =0
virtual void transform(double &x, double &y, double &z) const
A transform that transforms coordinates from one 3D coordinate system to another. ...
XYZTransform(UnaryTransform *x, UnaryTransform *y, UnaryTransform *z)
The following constructor takes three base constructors as arguments.
TransformBase * xTransform() const
Returns the transform function on the X axis.
UnaryTransform * m_y
The transform on the Y axis.
Definition: XYZTransform.h:34
A transform that transforms the X, Y and Z coordinates independently.
Definition: XYZTransform.h:27
virtual void validate(Range &) const =0
Validates the Range.
std::string m_name
Name of the Transform.
Definition: TransformBase.h:42
UnaryTransform * m_x
The transform on the X axis.
Definition: XYZTransform.h:31
UnaryTransform * m_z
The transform on the Z axis.
Definition: XYZTransform.h:37
A transform that transforms coordinates in one dimension from one coordinate system to another...
Expresses a range of values.
Definition: Range.h:33
virtual ~XYZTransform()
The virtual destructor.

Generated for HippoDraw Class Library by doxygen