Commit f9eb1377 authored by Hung Dang-Quoc's avatar Hung Dang-Quoc
Browse files

Merge branch 'top2021s5/#141_point_connector_selector_change' into 'sprint_6'

[MERGE #141] point connector selector change

See merge request top/21s/sivert-vis/sivert-vis-project!91
parents 8ecac3f2 eff3d270
...@@ -147,7 +147,7 @@ void WFiberHandler::addFiber( std::string name, bool silent, bool updateSelector ...@@ -147,7 +147,7 @@ void WFiberHandler::addFiber( std::string name, bool silent, bool updateSelector
if( updateSelector ) if( updateSelector )
{ {
selectorUpdate(); selectorUpdate( m_fibers->size() - 1 );
} }
if( !silent ) if( !silent )
...@@ -156,9 +156,9 @@ void WFiberHandler::addFiber( std::string name, bool silent, bool updateSelector ...@@ -156,9 +156,9 @@ void WFiberHandler::addFiber( std::string name, bool silent, bool updateSelector
} }
} }
void WFiberHandler::selectorUpdate() void WFiberHandler::selectorUpdate( size_t idx )
{ {
m_fiberSelection->set( m_possibleFiberSelections->getSelectorLast() ); m_fiberSelection->set( m_possibleFiberSelections->getSelector( idx ) );
} }
void WFiberHandler::addFiberAt( std::string name, size_t position, bool hidden, bool silent, PCFiber fiber ) void WFiberHandler::addFiberAt( std::string name, size_t position, bool hidden, bool silent, PCFiber fiber )
......
...@@ -144,8 +144,10 @@ public: ...@@ -144,8 +144,10 @@ public:
/** /**
* Updates the UI selector. * Updates the UI selector.
*
* \param idx index of the selected fiber.
*/ */
void selectorUpdate(); void selectorUpdate( size_t idx );
/** /**
* Clears the data in this handler. * Clears the data in this handler.
......
...@@ -201,7 +201,7 @@ void WMPointConnector::handleInput() ...@@ -201,7 +201,7 @@ void WMPointConnector::handleInput()
} }
m_fiberHandler->setFiberCount( fibers->size() ); m_fiberHandler->setFiberCount( fibers->size() );
m_fiberHandler->selectorUpdate(); m_fiberHandler->selectorUpdate( fibers->size() - 1 );
updatePoints(); updatePoints();
updateOutput(); updateOutput();
...@@ -272,7 +272,7 @@ void WMPointConnector::handleClick( osg::Vec3 cameraPosition, osg::Vec3 directio ...@@ -272,7 +272,7 @@ void WMPointConnector::handleClick( osg::Vec3 cameraPosition, osg::Vec3 directio
return; return;
} }
m_fiberHandler->selectFiber( fiberIdx ); m_fiberHandler->selectFiber( fiberIdx );
m_fiberHandler->selectorUpdate(); m_fiberHandler->selectorUpdate( fiberIdx );
} }
else else
{ {
......
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