Commit 9159b512 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[REMOVE] - removed deprecated getPickPixelPosition. It returned a std::pair as...

[REMOVE] - removed deprecated getPickPixelPosition. It returned a std::pair as point! If I see something like this again in your newly commited code, I will personally force you to program on windows with notepad as punishment.
parent d842f31e
...@@ -131,11 +131,6 @@ public: ...@@ -131,11 +131,6 @@ public:
*/ */
inline WVector3d_2 getPickNormal() const; inline WVector3d_2 getPickNormal() const;
/**
* Get pixel coordinates where object was hit.
*/
OW_API_DEPRECATED inline std::pair< float, float > getPickPixelPosition() const;
/** /**
* Returns the picked pixel coordinates in screen-space. * Returns the picked pixel coordinates in screen-space.
* *
...@@ -234,11 +229,6 @@ WVector3d_2 WPickInfo::getPickNormal() const ...@@ -234,11 +229,6 @@ WVector3d_2 WPickInfo::getPickNormal() const
return m_pickNormal; return m_pickNormal;
} }
std::pair< float, float > WPickInfo::getPickPixelPosition() const
{
return m_pixelCoords;
}
inline bool WPickInfo::operator==( WPickInfo rhs ) const inline bool WPickInfo::operator==( WPickInfo rhs ) const
{ {
return ( this->m_name == rhs.m_name return ( this->m_name == rhs.m_name
......
...@@ -114,7 +114,7 @@ WROIBox::WROIBox( WPosition_2 minPos, WPosition_2 maxPos ) : ...@@ -114,7 +114,7 @@ WROIBox::WROIBox( WPosition_2 minPos, WPosition_2 maxPos ) :
WROI(), WROI(),
boxId( maxBoxId++ ), boxId( maxBoxId++ ),
m_pickNormal( WVector3d_2() ), m_pickNormal( WVector3d_2() ),
m_oldPixelPosition( std::make_pair( 0, 0 ) ), m_oldPixelPosition( WVector2d_2::zero() ),
m_color( osg::Vec4( 0.f, 1.f, 1.f, 0.4f ) ), m_color( osg::Vec4( 0.f, 1.f, 1.f, 0.4f ) ),
m_notColor( osg::Vec4( 1.0f, 0.0f, 0.0f, 0.4f ) ) m_notColor( osg::Vec4( 1.0f, 0.0f, 0.0f, 0.4f ) )
{ {
...@@ -222,21 +222,21 @@ void WROIBox::updateGFX() ...@@ -222,21 +222,21 @@ void WROIBox::updateGFX()
ss << "ROIBox" << boxId << ""; ss << "ROIBox" << boxId << "";
if ( m_pickInfo.getName() == ss.str() ) if ( m_pickInfo.getName() == ss.str() )
{ {
std::pair< float, float > newPixelPos( m_pickInfo.getPickPixelPosition() ); WVector2d_2 newPixelPos( m_pickInfo.getPickPixel() );
if ( m_isPicked ) if ( m_isPicked )
{ {
osg::Vec3 in( newPixelPos.first, newPixelPos.second, 0.0 ); osg::Vec3 in( newPixelPos.x(), newPixelPos.y(), 0.0 );
osg::Vec3 world = wge::unprojectFromScreen( in, m_viewer->getCamera() ); osg::Vec3 world = wge::unprojectFromScreen( in, m_viewer->getCamera() );
WPosition_2 newPixelWorldPos( world[0], world[1], world[2] ); WPosition_2 newPixelWorldPos( world[0], world[1], world[2] );
WPosition_2 oldPixelWorldPos; WPosition_2 oldPixelWorldPos;
if( m_oldPixelPosition.first == 0 && m_oldPixelPosition.second == 0 ) if( m_oldPixelPosition.x() == 0 && m_oldPixelPosition.y() == 0 )
{ {
oldPixelWorldPos = newPixelWorldPos; oldPixelWorldPos = newPixelWorldPos;
} }
else else
{ {
osg::Vec3 in( m_oldPixelPosition.first, m_oldPixelPosition.second, 0.0 ); osg::Vec3 in( m_oldPixelPosition.x(), m_oldPixelPosition.y(), 0.0 );
osg::Vec3 world = wge::unprojectFromScreen( in, m_viewer->getCamera() ); osg::Vec3 world = wge::unprojectFromScreen( in, m_viewer->getCamera() );
oldPixelWorldPos = WPosition_2( world[0], world[1], world[2] ); oldPixelWorldPos = WPosition_2( world[0], world[1], world[2] );
} }
......
...@@ -84,7 +84,7 @@ private: ...@@ -84,7 +84,7 @@ private:
bool m_isPicked; //!< Indicates whether the box is currently picked or not. bool m_isPicked; //!< Indicates whether the box is currently picked or not.
WPosition_2 m_pickedPosition; //!< Caches the old picked position to a allow for cmoparison WPosition_2 m_pickedPosition; //!< Caches the old picked position to a allow for cmoparison
WVector3d_2 m_pickNormal; //!< Store the normal that occured when the pick action was started. WVector3d_2 m_pickNormal; //!< Store the normal that occured when the pick action was started.
std::pair< float, float > m_oldPixelPosition; //!< Caches the old picked position to a allow for cmoparison WVector2d_2 m_oldPixelPosition; //!< Caches the old picked position to a allow for cmoparison
boost::shared_mutex m_updateLock; //!< Lock to prevent concurrent threads trying to update the osg node boost::shared_mutex m_updateLock; //!< Lock to prevent concurrent threads trying to update the osg node
osg::ref_ptr< osg::Geometry > m_surfaceGeometry; //!< store this pointer for use in updates osg::ref_ptr< osg::Geometry > m_surfaceGeometry; //!< store this pointer for use in updates
......
...@@ -43,7 +43,7 @@ WROISphere::WROISphere( WPosition_2 position, float radius ) : ...@@ -43,7 +43,7 @@ WROISphere::WROISphere( WPosition_2 position, float radius ) :
m_originalPosition( position ), m_originalPosition( position ),
m_radius( radius ), m_radius( radius ),
m_pickNormal( WVector3d_2() ), m_pickNormal( WVector3d_2() ),
m_oldPixelPosition( std::make_pair( 0, 0 ) ), m_oldPixelPosition( WVector2d_2::zero() ),
m_color( osg::Vec4( 0.f, 1.f, 1.f, 0.4f ) ), m_color( osg::Vec4( 0.f, 1.f, 1.f, 0.4f ) ),
m_notColor( osg::Vec4( 1.0f, 0.0f, 0.0f, 0.4f ) ), m_notColor( osg::Vec4( 1.0f, 0.0f, 0.0f, 0.4f ) ),
m_lockPoint( WVector3d_2( 0.0, 0.0, 0.0 ) ), m_lockPoint( WVector3d_2( 0.0, 0.0, 0.0 ) ),
...@@ -151,21 +151,21 @@ void WROISphere::updateGFX() ...@@ -151,21 +151,21 @@ void WROISphere::updateGFX()
if ( m_pickInfo.getName() == ss.str() ) if ( m_pickInfo.getName() == ss.str() )
{ {
std::pair< float, float > newPixelPos( m_pickInfo.getPickPixelPosition() ); WVector2d_2 newPixelPos( m_pickInfo.getPickPixel() );
if ( m_isPicked ) if ( m_isPicked )
{ {
osg::Vec3 in( newPixelPos.first, newPixelPos.second, 0.0 ); osg::Vec3 in( newPixelPos.x(), newPixelPos.y(), 0.0 );
osg::Vec3 world = wge::unprojectFromScreen( in, m_viewer->getCamera() ); osg::Vec3 world = wge::unprojectFromScreen( in, m_viewer->getCamera() );
WPosition_2 newPixelWorldPos( world[0], world[1], world[2] ); WPosition_2 newPixelWorldPos( world[0], world[1], world[2] );
WPosition_2 oldPixelWorldPos; WPosition_2 oldPixelWorldPos;
if( m_oldPixelPosition.first == 0 && m_oldPixelPosition.second == 0 ) if( m_oldPixelPosition.x() == 0 && m_oldPixelPosition.y() == 0 )
{ {
oldPixelWorldPos = newPixelWorldPos; oldPixelWorldPos = newPixelWorldPos;
} }
else else
{ {
osg::Vec3 in( m_oldPixelPosition.first, m_oldPixelPosition.second, 0.0 ); osg::Vec3 in( m_oldPixelPosition.x(), m_oldPixelPosition.y(), 0.0 );
osg::Vec3 world = wge::unprojectFromScreen( in, m_viewer->getCamera() ); osg::Vec3 world = wge::unprojectFromScreen( in, m_viewer->getCamera() );
oldPixelWorldPos = WPosition_2( world[0], world[1], world[2] ); oldPixelWorldPos = WPosition_2( world[0], world[1], world[2] );
} }
......
...@@ -170,7 +170,7 @@ private: ...@@ -170,7 +170,7 @@ private:
WVector3d_2 m_pickNormal; //!< Store the normal that occured when the pick action was started. WVector3d_2 m_pickNormal; //!< Store the normal that occured when the pick action was started.
std::pair< float, float > m_oldPixelPosition; //!< Caches the old picked position to a allow for cmoparison WVector2d_2 m_oldPixelPosition; //!< Caches the old picked position to a allow for cmoparison
WPickInfo m_pickInfo; //!< Stores the pick information for potential redraw WPickInfo m_pickInfo; //!< Stores the pick information for potential redraw
......
...@@ -346,8 +346,8 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo ) ...@@ -346,8 +346,8 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo )
boost::unique_lock< boost::shared_mutex > lock; boost::unique_lock< boost::shared_mutex > lock;
lock = boost::unique_lock< boost::shared_mutex >( m_updateLock ); lock = boost::unique_lock< boost::shared_mutex >( m_updateLock );
double x = static_cast< double >( pickInfo.getPickPixelPosition().first ); double x = static_cast< double >( pickInfo.getPickPixel().x() );
double y = static_cast< double >( pickInfo.getPickPixelPosition().second ); double y = static_cast< double >( pickInfo.getPickPixel().y() );
double xPos = 0.0; double xPos = 0.0;
double yPos = 0.0; double yPos = 0.0;
double width; double width;
...@@ -494,11 +494,11 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo ) ...@@ -494,11 +494,11 @@ void WMNavSlices::setSlicePosFromPick( WPickInfo pickInfo )
WVector3d_2 normal = pickInfo.getPickNormal(); WVector3d_2 normal = pickInfo.getPickNormal();
std::pair< float, float > newPixelPos( pickInfo.getPickPixelPosition() ); WVector2d_2 newPixelPos( pickInfo.getPickPixel() );
if ( m_isPicked ) if ( m_isPicked )
{ {
osg::Vec3 startPosScreen( m_oldPixelPosition.first, m_oldPixelPosition.second, 0.0 ); osg::Vec3 startPosScreen( m_oldPixelPosition.x(), m_oldPixelPosition.y(), 0.0 );
osg::Vec3 endPosScreen( newPixelPos.first, newPixelPos.second, 0.0 ); osg::Vec3 endPosScreen( newPixelPos.x(), newPixelPos.y(), 0.0 );
osg::Vec3 startPosWorld = wge::unprojectFromScreen( startPosScreen, m_viewer->getCamera() ); osg::Vec3 startPosWorld = wge::unprojectFromScreen( startPosScreen, m_viewer->getCamera() );
osg::Vec3 endPosWorld = wge::unprojectFromScreen( endPosScreen, m_viewer->getCamera() ); osg::Vec3 endPosWorld = wge::unprojectFromScreen( endPosScreen, m_viewer->getCamera() );
......
...@@ -244,7 +244,7 @@ private: ...@@ -244,7 +244,7 @@ private:
*/ */
void initUniforms( osg::StateSet* rootState ); void initUniforms( osg::StateSet* rootState );
std::pair< float, float > m_oldPixelPosition; //!< Caches the old picked position to a allow for comparison WVector2d_2 m_oldPixelPosition; //!< Caches the old picked position to a allow for comparison
bool m_isPicked; //!< Indicates whether a slice is currently picked or not. bool m_isPicked; //!< Indicates whether a slice is currently picked or not.
bool m_isPickedSagittal; //!< Indicates whether a sagittal slice is currently picked or not. bool m_isPickedSagittal; //!< Indicates whether a sagittal slice is currently picked or not.
bool m_isPickedCoronal; //!< Indicates whether coronal slice is currently picked or not. bool m_isPickedCoronal; //!< Indicates whether coronal slice is currently picked or not.
......
...@@ -971,8 +971,8 @@ void WMClusterDisplay::dendrogramClick( WPickInfo pickInfo ) ...@@ -971,8 +971,8 @@ void WMClusterDisplay::dendrogramClick( WPickInfo pickInfo )
{ {
return; return;
} }
int x = pickInfo.getPickPixelPosition().first; int x = pickInfo.getPickPixel().x();
int y = pickInfo.getPickPixelPosition().second; int y = pickInfo.getPickPixel().y();
m_propSelectedCluster->set( m_dendrogramGeode->getClickedCluster( x, y ) ); m_propSelectedCluster->set( m_dendrogramGeode->getClickedCluster( x, y ) );
} }
......
...@@ -1066,8 +1066,8 @@ void WMClusterDisplayVoxels::dendrogramClick( WPickInfo pickInfo ) ...@@ -1066,8 +1066,8 @@ void WMClusterDisplayVoxels::dendrogramClick( WPickInfo pickInfo )
{ {
return; return;
} }
int x = pickInfo.getPickPixelPosition().first; int x = pickInfo.getPickPixel().x();
int y = pickInfo.getPickPixelPosition().second; int y = pickInfo.getPickPixel().y();
size_t cluster = m_dendrogramGeode->getClickedCluster( x, y ); size_t cluster = m_dendrogramGeode->getClickedCluster( x, y );
//std::cout << cluster << std::endl; //std::cout << cluster << std::endl;
......
...@@ -221,7 +221,7 @@ void WMHud::updatePickText( WPickInfo pickInfo ) ...@@ -221,7 +221,7 @@ void WMHud::updatePickText( WPickInfo pickInfo )
os << std::setprecision( 5 ) os << std::setprecision( 5 )
<< "Name: " << pickInfo.getName() << "\n" << "Name: " << pickInfo.getName() << "\n"
<< "Position: [" << pickInfo.getPickPosition()[0] << ", " << pickInfo.getPickPosition()[1] << ", " << pickInfo.getPickPosition()[2] << "]\n" << "Position: [" << pickInfo.getPickPosition()[0] << ", " << pickInfo.getPickPosition()[1] << ", " << pickInfo.getPickPosition()[2] << "]\n"
<< "Pixel coordinates: " << pickInfo.getPickPixelPosition().first << " " << pickInfo.getPickPixelPosition().second << "\n" << "Pixel coordinates: " << pickInfo.getPickPixel().x() << " " << pickInfo.getPickPixel().y() << "\n"
<< "Object Normal: [" << pickInfo.getPickNormal()[0] << ", " << pickInfo.getPickNormal()[1] << ", " << pickInfo.getPickNormal()[2] << "]\n"; << "Object Normal: [" << pickInfo.getPickNormal()[0] << ", " << pickInfo.getPickNormal()[1] << ", " << pickInfo.getPickNormal()[2] << "]\n";
m_pickText = os.str(); m_pickText = os.str();
......
...@@ -196,10 +196,10 @@ void WMLineGuidedSlice::setSlicePosFromPick( WPickInfo pickInfo ) ...@@ -196,10 +196,10 @@ void WMLineGuidedSlice::setSlicePosFromPick( WPickInfo pickInfo )
WVector3d_2 normal = pickInfo.getPickNormal(); WVector3d_2 normal = pickInfo.getPickNormal();
std::pair< float, float > newPixelPos( pickInfo.getPickPixelPosition() ); WVector2d_2 newPixelPos( pickInfo.getPickPixel() );
if( m_isPicked ) if( m_isPicked )
{ {
float diff = newPixelPos.first - m_oldPixelPosition.first; float diff = newPixelPos.x() - m_oldPixelPosition.x();
diff *= 0.01; diff *= 0.01;
......
...@@ -151,7 +151,7 @@ private: ...@@ -151,7 +151,7 @@ private:
WPropDouble m_pos; //!< Slice position along line. WPropDouble m_pos; //!< Slice position along line.
std::pair< float, float > m_oldPixelPosition; //!< Caches the old picked position to a allow for cmoparison WVector2d_2 m_oldPixelPosition; //!< Caches the old picked position to a allow for cmoparison
bool m_isPicked; //!< Indicates whether a slice is currently picked or not. bool m_isPicked; //!< Indicates whether a slice is currently picked or not.
boost::shared_ptr< WGEViewer > m_viewer; //!< Stores reference to the main viewer boost::shared_ptr< WGEViewer > m_viewer; //!< Stores reference to the main viewer
boost::shared_ptr< WModuleInputData< const WFiberCluster > > m_input; //!< Input connector for a fiber cluster boost::shared_ptr< WModuleInputData< const WFiberCluster > > m_input; //!< Input connector for a fiber cluster
......
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