Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix picking points outside of volume #519

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions IbisLib/pointsobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,18 +393,6 @@ void PointsObject::UnselectAllPoints()
emit ObjectModified();
}

void PointsObject::ValidateSelectedPoint()
{
if( m_selectedPointIndex == InvalidPointIndex ) return;

vtkSmartPointer<PointRepresentation> pt = m_pointList.at( m_selectedPointIndex );
if( !pt->CheckVisibility() )
{
m_selectedPointIndex = InvalidPointIndex;
emit ObjectModified();
}
}

void PointsObject::MoveCursorToPoint( int index )
{
Q_ASSERT( index != InvalidPointIndex && index < m_pointCoordinates->GetNumberOfPoints() );
Expand Down
2 changes: 0 additions & 2 deletions IbisLib/pointsobject.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,6 @@ class PointsObject : public SceneObject
void SetPointCoordinates( int index, double coords[3] );
/** Set point timestamp - time when point was created. */
void SetPointTimeStamp( int index, const QString & stamp );
/** Check if the selected point is in the current planes. */
void ValidateSelectedPoint();

signals:
void PointAdded();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ void LandmarkRegistrationObject::CurrentObjectChanged()
if( GetManager()->GetCurrentObject() == SceneObject::SafeDownCast( this ) )
{
EnablePicking( true );
m_sourcePoints->ValidateSelectedPoint();
emit UpdateSettings();
}
else
Expand Down Expand Up @@ -297,7 +296,6 @@ void LandmarkRegistrationObject::Hide()
void LandmarkRegistrationObject::Show()
{
m_sourcePoints->SetHidden( false );
m_sourcePoints->ValidateSelectedPoint();
m_targetPoints->SetHidden( false );
m_sourcePoints->UpdatePointsVisibility();
m_targetPoints->UpdatePointsVisibility();
Expand All @@ -307,7 +305,6 @@ void LandmarkRegistrationObject::SetHiddenChildren( SceneObject * parent, bool h
{
// LandmarkRegistrationObject manages two PointsObjects, we just show/hide both.
m_sourcePoints->SetHidden( hide );
if( !hide ) m_sourcePoints->ValidateSelectedPoint();
m_targetPoints->SetHidden( hide );
m_sourcePoints->UpdatePointsVisibility();
m_targetPoints->UpdatePointsVisibility();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ void LandmarkRegistrationObjectSettingsWidget::on_capturePushButton_clicked()
{
Q_ASSERT( m_registrationObject );
int index = ui->pointsTreeView->currentIndex().row();
Q_ASSERT( index >= 0 && index < m_registrationObject->GetNumberOfPoints() );
if( ! (index >= 0 && index < m_registrationObject->GetNumberOfPoints()) ){
std::cerr << "No point selected, nothing was captured." << std::endl;
return;
}

Q_ASSERT( m_registrationObject->GetManager() );
PointerObject * pointer = m_registrationObject->GetManager()->GetNavigationPointerObject();
Expand Down
Loading