26 #include <osg/MatrixTransform>
28 #include <osg/NodeVisitor>
30 #include "core/common/WPropertyTypes.h"
31 #include "core/common/WPropertyVariable.h"
32 #include "WPanTransformCallback.h"
37 WPropDouble timeRange,
40 : m_currentLabelsWidth( 0 ),
41 m_currentTimePos( 0.0 ),
42 m_currentTimeRange( 1.0 ),
43 m_currentGraphWidth( 1 ),
45 m_labelsWidth( labelsWidth ),
47 m_timeRange( timeRange ),
48 m_graphWidth( graphWidth ),
59 const double yPos =
m_yPos->get();
64 osg::MatrixTransform* transform =
static_cast< osg::MatrixTransform*
>( node );
67 transform->setMatrix( osg::Matrix::scale( graphWidth / timeRange, 1.0, 1.0 )
68 * osg::Matrix::translate( labelsWidth - timePos * graphWidth / timeRange, -yPos, 0.0 ) );