00001 00012 #include "XYZTransform.h" 00013 00014 #include "UnaryTransform.h" 00015 00016 using std::vector; 00017 00018 namespace hippodraw { 00019 00020 XYZTransform::XYZTransform ( UnaryTransform * x, 00021 UnaryTransform * y, 00022 UnaryTransform * z ) 00023 { 00024 m_name = "XYZTransform"; 00025 m_x = x; 00026 m_y = y; 00027 m_z = z; 00028 } 00029 00030 XYZTransform::~XYZTransform () 00031 { 00032 delete m_x; 00033 delete m_y; 00034 delete m_z; 00035 } 00036 00037 XYZTransform::XYZTransform ( const XYZTransform & t ) 00038 : XYZTransformBase ( t ) 00039 { 00040 #ifdef CLONE_DEFECT 00041 m_x = dynamic_cast < UnaryTransform * > ( t.m_x->clone () ); 00042 m_y = dynamic_cast < UnaryTransform * > ( t.m_y->clone () ); 00043 m_z = dynamic_cast < UnaryTransform * > ( t.m_z->clone () ); 00044 #else 00045 m_x = t.m_x->clone (); 00046 m_y = t.m_y->clone (); 00047 m_z = t.m_z->clone (); 00048 #endif 00049 } 00050 00051 #ifdef CLONE_DEFECT 00052 TransformBase * XYZTransform::clone () const 00053 #else 00054 XYZTransform * XYZTransform::clone () const 00055 #endif 00056 { 00057 return new XYZTransform ( *this ); 00058 } 00059 00060 /* virtual */ 00061 void XYZTransform::transform ( double & x, 00062 double & y, 00063 double & z ) const 00064 { 00065 m_x->transform ( x ); 00066 m_y->transform ( y ); 00067 m_z->transform ( z ); 00068 } 00069 00070 /* virtual */ 00071 void 00072 XYZTransform:: 00073 transform ( std::vector< double > & x, 00074 std::vector< double > & y, 00075 std::vector< double > & z ) const 00076 { 00077 m_x->transform ( x ); 00078 m_y->transform ( y ); 00079 m_z->transform ( z ); 00080 } 00081 00082 /* virtual */ 00083 void XYZTransform::validate ( Range & x, Range & y, Range & z ) const 00084 { 00085 m_x->validate ( x ); 00086 m_y->validate ( y ); 00087 m_z->validate ( z ); 00088 } 00089 00090 /* virtual */ 00091 const Range & XYZTransform::limitX () const 00092 { 00093 return m_x->limits (); 00094 } 00095 00096 /* virtual */ 00097 const Range & XYZTransform::limitY () const 00098 { 00099 return m_y->limits (); 00100 } 00101 00102 /* virtual */ 00103 const Range & XYZTransform::limitZ () const 00104 { 00105 return m_z->limits (); 00106 } 00107 00108 TransformBase * XYZTransform::xTransform () const 00109 { 00110 return m_x; 00111 } 00112 00113 TransformBase * XYZTransform::yTransform () const 00114 { 00115 return m_y; 00116 } 00117 00118 TransformBase * XYZTransform::zTransform () const 00119 { 00120 return m_z; 00121 } 00122 00123 bool XYZTransform::isLinearInZ () const 00124 { 00125 return m_z->isLinear(); 00126 } 00127 00128 00129 } // namespace hippodraw 00130