Commit 64486fac authored by Alexander Wiebel's avatar Alexander Wiebel

[ADD] functionality ommiting computation when pickingposition does not change

parent 44d304b6
......@@ -64,7 +64,8 @@ W_LOADABLE_MODULE( WMPickingDVR )
WMPickingDVR::WMPickingDVR():
WModule(),
m_propCondition( new WCondition() ),
m_curve3D( 0 )
m_curve3D( 0 ),
m_oldRayStart( 0.0, 0.0, 0.0 )
{
m_intersected = false;
m_posStart = osg::Vec3f( 0.0, 0.0, 0.0 );
......@@ -288,10 +289,23 @@ void WMPickingDVR::moduleMain()
}
else if( selectionType == 2 )
{
std::vector< std::pair< double, WPosition > > candidates = computeVisiTraceCandidates();
if( candidates.size() )
if( m_oldRayStart != WPosition( m_posStart ) )
{
m_visiTrace.addCandidatesForRay( candidates );
m_oldRayStart = m_posStart;
std::vector< std::pair< double, WPosition > > candidates = computeVisiTraceCandidates();
std::cout << std::endl << "...##... ";
for( auto rayPos : candidates )
{
std::cout << rayPos.second << " == ";
}
std::cout << std::endl;
if( candidates.size() )
{
m_visiTrace.addCandidatesForRay( candidates );
}
}
if( m_continuousDrawing->get()
......@@ -600,6 +614,7 @@ std::vector< std::pair< double, WPosition > > WMPickingDVR::computeVisiTraceCand
{
std::vector< std::pair< double, WPosition > > samples( 0 );
samples = sampleIntensityAlongRay();
if( samples.size() == 0 )
{
return std::vector< std::pair< double, WPosition > >();
......
......@@ -245,6 +245,8 @@ private:
std::vector<WPosition> m_curve3D; //!< Positions representing the from VisiTrace selection mode.
WVisiTrace m_visiTrace; //!< Class providing VisiTrace optimization.
WPosition m_oldRayStart; //!< Used to check if position of picking has changed
};
#endif // WMPICKINGDVR_H
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