📄 transf.h
字号:
#ifndef TRANSF_H#define TRANSF_Hclass quater;class transf{ private: matrix m; vector v; // multiplication friend transf& operator*=( transf &, transf const& ); friend transf operator*( transf const&, transf const& ); friend vector& operator*=( vector&, transf const& ); friend vector operator*( vector const&, transf const& ); friend position& operator*=( position&, transf const& ); friend position operator*( position const&, transf const& ); friend unit_vector& operator*=( unit_vector&, transf const& ); friend unit_vector operator*( unit_vector const&, transf const& ); // functions friend transf inverse( transf const& ); friend transf interpolate( m_real, transf const&, transf const& ); // stream friend ostream& operator<<( ostream&, transf const& ); friend istream& operator>>( istream&, transf& ); public: // constructors transf() {} transf( matrix const& a, vector const& b ) { m = a; v = b; }
transf( quater const& a, vector const& b ) { m = Quater2Matrix(a); v = b; }
transf( const transf& a);
transf& operator=(const transf&a); // inquiry functions const matrix& getAffine() const { return m; }; const vector& getTranslation() const { return v; };
const quater getRotation() const { return Matrix2Quater(m); }
const matrix& affine() const { return m; };
const vector& translation() const { return v; }
void setAffine( matrix const& a ) { m = a; } void setTranslation( vector const& a ) { v = a; }
void setRotation( quater const& q ) { m = Quater2Matrix(q); } transf inverse() const;};// identity transformextern transf identity_transf;// generatorextern transf scale_transf( m_real );extern transf scale_transf( m_real, m_real, m_real );extern transf rotate_transf( m_real, vector const& );extern transf reflect_transf( vector const& );extern transf translate_transf( vector const& );extern transf translate_transf( m_real, m_real, m_real );extern transf coordinate_transf( position const&, unit_vector const&, unit_vector const& );#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -