00001 00002 // Transform.h // 00004 00005 #ifndef TRANSFORM_H 00006 #define TRANSFORM_H 00007 00008 #include "X3DTypes.h" 00009 #include "X3DGroupingNode.h" 00010 #include "X3DBoundedObject.h" 00011 00012 namespace X3DTK { 00013 00018 00019 class Transform : public X3DGroupingNode, public X3DBoundedObject 00020 { 00021 public: 00023 Transform(); 00025 Transform(const SFVec3f ¢er, 00026 const SFRotation &rotation, 00027 const SFVec3f &scale, 00028 const SFRotation &scaleOrientation, 00029 const SFVec3f &translation, 00030 const SFVec3f &bboxCenter, 00031 const SFVec3f &bboxSize); 00033 virtual SFNode clone() const; 00035 ~Transform(); 00036 00038 void setCenter(const SFVec3f ¢er); 00040 void setRotation(const SFRotation &rotation); 00042 void setScale(const SFVec3f &scale); 00044 void setScaleOrientation(const SFRotation &scaleOrientation); 00046 void setTranslation(const SFVec3f &translation); 00047 00049 inline SFVec3f getCenter() const {return center_;}; 00051 inline SFRotation getRotation() const {return rotation_;}; 00053 inline SFVec3f getScale() const {return scale_;}; 00055 inline SFRotation getScaleOrientation() const {return scaleOrientation_;}; 00057 inline SFVec3f getTranslation() const {return translation_;}; 00058 00060 void loadAttributes(const X3DFileElement *element); 00062 virtual SFString writeAttributes() const; 00063 00064 protected: 00066 Transform(const Transform &T); 00067 00068 private: 00069 SFVec3f center_; 00070 SFRotation rotation_; 00071 SFVec3f scale_; 00072 SFRotation scaleOrientation_; 00073 SFVec3f translation_; 00074 }; 00075 00076 } 00077 00078 #endif