From 3fc924999c0ab67d2569c34c3e29861634e36319 Mon Sep 17 00:00:00 2001 From: mkr Date: Wed, 30 Apr 2008 07:02:29 +0000 Subject: [PATCH] Fix for bug IPAL19512: Error message is shown after selection of Gauss point outside of segmentation cursor. --- src/CONVERTOR/VISU_ConvertorUtils.cxx | 3 ++- src/OBJECT/VISU_GaussPtsAct.cxx | 2 +- src/VISUGUI/VisuGUI_Selection.cxx | 30 ++++++++++++++------------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/CONVERTOR/VISU_ConvertorUtils.cxx b/src/CONVERTOR/VISU_ConvertorUtils.cxx index 85f49eec..a4cee79f 100644 --- a/src/CONVERTOR/VISU_ConvertorUtils.cxx +++ b/src/CONVERTOR/VISU_ConvertorUtils.cxx @@ -353,7 +353,8 @@ namespace VISU GetNodeCoord(vtkDataSet *theDataSet, vtkIdType theObjID) { vtkIdType aVTKID = GetNodeVTKID(theDataSet, theObjID); - return theDataSet->GetPoint(aVTKID); + if ( aVTKID >= 0 ) return theDataSet->GetPoint(aVTKID); + return 0; } diff --git a/src/OBJECT/VISU_GaussPtsAct.cxx b/src/OBJECT/VISU_GaussPtsAct.cxx index 11f02cc0..c9514f44 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -975,7 +975,7 @@ VISU_GaussPtsAct vtkFloatingPointType aFocalPnt[3]; aCamera->GetFocalPoint(aFocalPnt); - if ( CheckIsSameVector( aNodeCoord, aFocalPnt, 3 ) ) + if ( !aNodeCoord || CheckIsSameVector( aNodeCoord, aFocalPnt, 3 ) ) return; // FlyTo diff --git a/src/VISUGUI/VisuGUI_Selection.cxx b/src/VISUGUI/VisuGUI_Selection.cxx index bb92fe97..4670d7cf 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -444,21 +444,23 @@ void VisuGUI_SelectionDlg::onSelectionEvent() { switch (aType) { case 0: { - vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID); int aVTKID = anVISUActor->GetNodeVTKID(anID); - myXValLbl->setText( QString::number( aCoord[0] ) ); - myYValLbl->setText( QString::number( aCoord[1] ) ); - myZValLbl->setText( QString::number( aCoord[2] ) ); - myIDValLbl->setText( QString::number(anID) ); - myScalarValLbl->setText(getValue(aPntData, aVTKID)); - myVectorValLbl->setText(getVector(aPntData, aVTKID)); - - const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper(); - VISU::TStructuredId aStructuredId = aMapper->GetIndexesOfNode(anID); - myKValLbl->setText( GetNumber( aStructuredId, 2 ) ); - myJValLbl->setText( GetNumber( aStructuredId, 1 ) ); - myIValLbl->setText( GetNumber( aStructuredId, 0 ) ); - } + if(aVTKID >= 0){ + vtkFloatingPointType* aCoord = anVISUActor->GetNodeCoord(anID); + myXValLbl->setText( QString::number( aCoord[0] ) ); + myYValLbl->setText( QString::number( aCoord[1] ) ); + myZValLbl->setText( QString::number( aCoord[2] ) ); + myIDValLbl->setText( QString::number(anID) ); + myScalarValLbl->setText(getValue(aPntData, aVTKID)); + myVectorValLbl->setText(getVector(aPntData, aVTKID)); + + const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper(); + VISU::TStructuredId aStructuredId = aMapper->GetIndexesOfNode(anID); + myKValLbl->setText( GetNumber( aStructuredId, 2 ) ); + myJValLbl->setText( GetNumber( aStructuredId, 1 ) ); + myIValLbl->setText( GetNumber( aStructuredId, 0 ) ); + } + } break; case 1: { -- 2.39.2