OSDN Git Service

fix build system ofmoflib1 and saisei1
[moflib/moflib.git] / moflib-1.0 / src / mof / stream / utilities.cpp
1 #include "mof/stream/utilities.hpp"
2 #include "mof/stream/Joint.hpp"
3 #include <boost/bind.hpp>
4
5 namespace
6 {
7     mof::Vector2D matrix2translation( const mof::Matrix2D& matrix )
8     {
9         return mof::Matrix2D::getTranslation( matrix );
10     }
11     
12     mof::Vector2D matrix2scaling( const mof::Matrix2D& matrix )
13     {
14         return matrix.getDiagonal( );
15     }
16
17     mof::Vector2D matrix2rotation( const mof::Matrix2D& matrix )
18     {
19         //TODO implementation
20         return matrix.getDiagonal( );
21     }
22
23 }
24
25
26 namespace mof
27 {
28
29     Manipulator< Vector2D >::Handler 
30     makeTranslation2DHandler( const Manipulator< Matrix2D >::Handler& handler )
31     {
32         return makeJointHandler( handler , &matrix2translation );
33         //return makeJointHandler( handler , boost::bind( &matrix2translation ) );
34     }
35
36     Manipulator< Vector2D >::Handler 
37     makeScaling2DHandler( const Manipulator< Matrix2D >::Handler& handler )
38     {
39         return makeJointHandler( handler , &matrix2scaling );
40         //return makeJointHandler( handler , boost::bind( &matrix2scaling ) );
41     }
42
43
44     Manipulator< Vector2D >::Handler 
45     makeRotation2DHandler( const Manipulator< Matrix2D >::Handler& handler )
46     {
47         return makeJointHandler( handler , &matrix2rotation  );
48         //return makeJointHandler( handler , boost::bind( &matrix2rotation )  );
49     }
50
51
52
53 } // namespace mof
54