]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug IPAL19512: Error message is shown after selection of Gauss point outside...
authormkr <mkr@opencascade.com>
Wed, 30 Apr 2008 07:02:29 +0000 (07:02 +0000)
committermkr <mkr@opencascade.com>
Wed, 30 Apr 2008 07:02:29 +0000 (07:02 +0000)
src/CONVERTOR/VISU_ConvertorUtils.cxx
src/OBJECT/VISU_GaussPtsAct.cxx
src/VISUGUI/VisuGUI_Selection.cxx

index 85f49eecc761a73cf75f0461d1c8644263ee23fd..a4cee79f990bb82bfbe4b74009b62b613584c184 100644 (file)
@@ -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;
   }
 
 
index 11f02cc015c160bc3bc8889c95e3f2aa217f92a3..c9514f44f68bbabf2156ffa6543b37c9fa653d10 100644 (file)
@@ -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
index bb92fe97ebe66ab7c9bb98aa73f8aaab237acded..4670d7cfc85a1d68536807b798a64d36a1d9a53b 100644 (file)
@@ -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:
           {