00001 // stuart meikle 00002 // 00003 00004 00005 #ifndef COORDINATE_XFORM_H 00006 #define COORDINATE_XFORM_H 00007 00008 #include <boost/numeric/ublas/vector.hpp> 00009 #include <boost/smart_ptr.hpp> 00010 #include "angle.h" 00011 00012 namespace mimas { 00013 /* A means to realte an obhject to another object's coordinate system. 00014 Sometimes arbitrary objects need to be rotated and orientated and have 00015 their default co-ordinate system changed. This is the class to do it with, 00016 but at the moment its very simple. I imagine in the future that a tensor 00017 matrix or co-variance mbatrix be used, and ideally the object to be 00018 operated on shouldn't be fixed. I use it now with the pgh models. 00019 @author Stuart Meikle (stu@stumeikle.org) 00020 @date Fri Jul 7 10:53:00 2000 */ 00021 class coordinate_xform 00022 { 00023 //WARNING! : this will become considerably more complex in the future!! 00024 //we should really use a covariance matrix here. stu. 00025 public: 00026 typedef boost::numeric::ublas::vector< double > Vector; 00027 private: 00028 Vector displacement; 00029 angle rotation; 00030 00031 public: 00032 void setDisplacement( const Vector &v ) 00033 { displacement = v; } 00034 const Vector &getDisplacement(void) const 00035 { return displacement; } 00036 void setRotation( angle a ) 00037 { rotation = a; } 00038 angle getRotation( void ) 00039 { return rotation; } 00040 00041 }; 00042 00043 typedef boost::shared_ptr< coordinate_xform > coordinate_xform_ptr; 00044 typedef std::list< coordinate_xform_ptr > coordinate_xform_ptr_list; 00045 00046 }; 00047 00048 #endif 00049