From: mkr Date: Mon, 21 Apr 2008 12:41:32 +0000 (+0000) Subject: Fix for bug IPAL19512 : Qt4 porting: Error message is shown after selection of Gauss... X-Git-Tag: V5_0_0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=20e1abb35aea54a7ebfa63a1d4242fee748984c5;p=modules%2Fvisu.git Fix for bug IPAL19512 : Qt4 porting: Error message is shown after selection of Gauss point outside of segmentation cursor. --- 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 045da66f..8ca84bc9 100644 --- a/src/OBJECT/VISU_GaussPtsAct.cxx +++ b/src/OBJECT/VISU_GaussPtsAct.cxx @@ -967,7 +967,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 044de375..20462021 100644 --- a/src/VISUGUI/VisuGUI_Selection.cxx +++ b/src/VISUGUI/VisuGUI_Selection.cxx @@ -484,31 +484,33 @@ 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)); - //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing - const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper(); - VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(anID); - switch(aVec.size()){ - case 3: - myKValLbl->setText(QString::number(aVec[2])); - case 2: - myJValLbl->setText(QString::number(aVec[1])); - case 1: - myIValLbl->setText(QString::number(aVec[0])); - break; - default: - myIValLbl->setText("-"); - myJValLbl->setText("-"); - myKValLbl->setText("-"); + 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)); + //ENK: 23.11.2006 - PAL13176 - EDF228 VISU : Enhancement of structured datas processing + const VISU::PIDMapper& aMapper = aPrs3d->GetPipeLine()->GetIDMapper(); + VISU::TIdTypeVector aVec = aMapper->GetIndexesOfNode(anID); + switch(aVec.size()){ + case 3: + myKValLbl->setText(QString::number(aVec[2])); + case 2: + myJValLbl->setText(QString::number(aVec[1])); + case 1: + myIValLbl->setText(QString::number(aVec[0])); + break; + default: + myIValLbl->setText("-"); + myJValLbl->setText("-"); + myKValLbl->setText("-"); + } + //ENK: 23.11.2006 } - //ENK: 23.11.2006 } break; case 1: