00001 00002 // X3D_Transform.h // 00004 00005 #ifndef TRANSFORM_H 00006 #define TRANSFORM_H 00007 00008 #include "X3DTypes.h" 00009 #include "X3D_X3DGroupingNode.h" 00010 #include "X3D_X3DBoundedObject.h" 00011 00012 namespace X3DTK { 00013 namespace X3D { 00014 00019 00020 class Transform : public X3DGroupingNode, public X3DBoundedObject 00021 { 00022 public: 00024 Transform(); 00026 Transform(const SFVec3f ¢er, 00027 const SFRotation &rotation, 00028 const SFVec3f &scale, 00029 const SFRotation &scaleOrientation, 00030 const SFVec3f &translation, 00031 const SFVec3f &bboxCenter, 00032 const SFVec3f &bboxSize); 00034 virtual SFAbstractNode clone() const; 00036 virtual ~Transform(); 00037 00039 void setCenter(const SFVec3f ¢er); 00041 void setRotation(const SFRotation &rotation); 00043 void setScale(const SFVec3f &scale); 00045 void setScaleOrientation(const SFRotation &scaleOrientation); 00047 void setTranslation(const SFVec3f &translation); 00048 00050 inline const SFVec3f &getCenter() const {return _center;}; 00052 inline const SFRotation &getRotation() const {return _rotation;}; 00054 inline const SFVec3f &getScale() const {return _scale;}; 00056 inline const SFRotation &getScaleOrientation() const {return _scaleOrientation;}; 00058 inline const SFVec3f &getTranslation() const {return _translation;}; 00059 00061 void load(const X3DFileElement *element); 00063 virtual SFString &write(SFString &output) const; 00064 00065 protected: 00067 Transform(const Transform &T); 00068 00069 private: 00071 SFVec3f _center; 00073 SFRotation _rotation; 00075 SFVec3f _scale; 00077 SFRotation _scaleOrientation; 00079 SFVec3f _translation; 00080 }; 00081 00082 } 00083 } 00084 00085 #endif