Commit 109537e3 by Sebastian Eichelbaum

[MERGE]

parents e5b8c231 5ee13378
......@@ -1194,10 +1194,6 @@ void WGridRegular3DTemplate< T >::initInformationProperties()
WPropDouble zOffset = m_infoProperties->addProperty( "Z offset: ",
"The distance between samples in z direction",
static_cast< double >( getOffsetZ() ) );
WPropMatrix4X4 transformation = m_infoProperties->addProperty( "Transformation",
"The transformation of this grid.",
static_cast< WMatrix4d >( getTransform() ) );
}
// +----------------------+
......
......@@ -288,7 +288,8 @@ void WMData::moduleMain()
// register the dataset properties
m_properties->addProperty( m_dataSet->getProperties() );
m_infoProperties->addProperty( m_dataSet->getInformationProperties() );
m_infoProperties->addProperty( getTransformationProperties() );
// I am interested in the active property ( manually subscribe signal )
m_active->getCondition()->subscribeSignal( boost::bind( &WMData::propertyChanged, this, m_active ) );
......@@ -450,3 +451,38 @@ std::string WMData::getDataTypeString( boost::shared_ptr< WDataSetSingle > dss )
return result;
}
namespace
{
// helper which gets a WMatrix< double > and returns a WMatrix4d
WMatrix4d WMatrixDoubleToWMatrix4d( const WMatrix< double >& matrix )
{
WAssert( matrix.getNbRows() == 4, "" );
WAssert( matrix.getNbCols() == 4, "" );
WMatrix4d result;
for( size_t i = 0; i < 4; ++i )
{
for( size_t j = 0; j < 4; ++j )
{
result( i, j ) = matrix( i, j );
}
}
return result;
}
}
boost::shared_ptr< WProperties > WMData::getTransformationProperties() const
{
boost::shared_ptr< WProperties > result( new WProperties( "Transformations", "Availabe transformation matrices for data-set " ) );
WPropGroup transformation = result->addPropertyGroup( "Transformation",
"The transformation of this grid." );
WPropMatrix4X4 noMatrixTransformation = result->addProperty( "No matrix transformation",
"The no matrix transformation for this data set.",
WMatrixDoubleToWMatrix4d( m_transformNoMatrix ) );
WPropMatrix4X4 sformMatrixTransformation = result->addProperty( "sform matrix transformation",
"The sform matrix transformation for this data set.",
WMatrixDoubleToWMatrix4d( m_transformSForm ) );
WPropMatrix4X4 qformMatrixTransformation = result->addProperty( "qform matrix transformation",
"The qform matrix transformation for this data set.",
WMatrixDoubleToWMatrix4d( m_transformQForm ) );
return result;
}
......@@ -177,6 +177,9 @@ protected:
WMatrix< double > m_transformQForm;
private:
//! returns info property group with the three availabe transformation matrixes
boost::shared_ptr< WProperties > getTransformationProperties() const;
//! a condition for the matrix selection
boost::shared_ptr< WCondition > m_propCondition;
......
......@@ -245,7 +245,7 @@ int WQtGLWidget::translateButton( QMouseEvent* event )
void WQtGLWidget::keyPressEvent( QKeyEvent* event )
{
// we ignore auto-repeated keys independant of the window manager settings
// we ignore auto-repeated keys independent of the window manager settings
if( event->isAutoRepeat() )
{
return;
......@@ -272,7 +272,7 @@ void WQtGLWidget::keyPressEvent( QKeyEvent* event )
void WQtGLWidget::keyReleaseEvent( QKeyEvent* event )
{
// we ignore auto-repeated keys independant of the window manager settings
// we ignore auto-repeated keys independent of the window manager settings
if( event->isAutoRepeat() )
{
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment