Commit f9312b4d authored by schurade's avatar schurade
Browse files

[CHANGE] some additions to the selection manager make the position properties...

[CHANGE] some additions to the selection manager make the position properties of the nav slices available to everyone
parent 3aa922c4
......@@ -171,3 +171,45 @@ void WSelectionManager::setTextureOpacity( float value )
}
m_textureOpacity = value;
}
void WSelectionManager::setPropAxialPos( WPropInt prop )
{
m_axialPos = prop;
}
void WSelectionManager::setPropCoronalPos( WPropInt prop )
{
m_coronalPos = prop;
}
void WSelectionManager::setPropSagittalPos( WPropInt prop )
{
m_sagittalPos = prop;
}
WPropInt WSelectionManager::getPropAxialPos()
{
return m_axialPos;
}
WPropInt WSelectionManager::getPropCoronalPos()
{
return m_coronalPos;
}
WPropInt WSelectionManager::getPropSagittalPos()
{
return m_sagittalPos;
}
void WSelectionManager::setShader( int shader )
{
m_shader = shader;
}
int WSelectionManager::getShader()
{
return m_shader;
}
......@@ -124,10 +124,74 @@ public:
*/
void setTextureOpacity( float value );
/**
* setter
* \param prop
*/
void setPropAxialPos( WPropInt prop );
/**
* setter
* \param prop
*/
void setPropCoronalPos( WPropInt prop );
/**
* setter
* \param prop
*/
void setPropSagittalPos( WPropInt prop );
/**
* getter
* \return property
*/
WPropInt getPropAxialPos();
/**
* getter
* \return property
*/
WPropInt getPropCoronalPos();
/**
* getter
* \return property
*/
WPropInt getPropSagittalPos();
/**
* setter for the shader index to be used with the custom texture
* \param shader the index of the shader
*/
void setShader( int shader );
/**
* getter
* \return shader index
*/
int getShader();
protected:
private:
boost::shared_ptr< WCrosshair >m_crosshair; //!< stores pointer to crosshair
/**
* Axial slice position.
*/
WPropInt m_axialPos;
/**
* Coronal slice position.
*/
WPropInt m_coronalPos;
/**
* Sagittal slice position.
*/
WPropInt m_sagittalPos;
WPaintMode m_paintMode; //!< stores the currently selected paint mode
/**
......@@ -150,6 +214,11 @@ private:
* flag indicating if this additional texture should be used.
*/
bool m_useTexture;
/**
* index of the shader to use with the texture
*/
int m_shader;
};
#endif // WSELECTIONMANAGER_H
......@@ -137,6 +137,10 @@ void WMNavSlices::properties()
m_coronalPos->setHidden();
m_sagittalPos->setHidden();
WKernel::getRunningKernel()->getSelectionManager()->setPropAxialPos( m_axialPos );
WKernel::getRunningKernel()->getSelectionManager()->setPropCoronalPos( m_coronalPos );
WKernel::getRunningKernel()->getSelectionManager()->setPropSagittalPos( m_sagittalPos );
// Print some nice output: the current nav slice position
m_currentPosition = m_infoProperties->addProperty( "Position", "Current position of the navigation slices.",
wmath::WPosition( m_axialPos->get(), m_coronalPos->get(), m_sagittalPos->get() ) );
......@@ -966,7 +970,7 @@ void WMNavSlices::updateTextures()
m_typeUniforms[c]->set( W_DT_UNSIGNED_CHAR );
m_thresholdUniforms[c]->set( 0.0f );
m_alphaUniforms[c]->set( WKernel::getRunningKernel()->getSelectionManager()->getTextureOpacity() );
m_cmapUniforms[c]->set( 4 );
m_cmapUniforms[c]->set( WKernel::getRunningKernel()->getSelectionManager()->getShader() );
texture3D->setFilter( osg::Texture::MIN_FILTER, osg::Texture::NEAREST );
texture3D->setFilter( osg::Texture::MAG_FILTER, osg::Texture::NEAREST );
......
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