]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for bug 9808: SIGFPE at Cut Lines edition
authorjfa <jfa@opencascade.com>
Fri, 14 Oct 2005 13:18:29 +0000 (13:18 +0000)
committerjfa <jfa@opencascade.com>
Fri, 14 Oct 2005 13:18:29 +0000 (13:18 +0000)
src/OBJECT/VISU_Actor.cxx
src/VISUGUI/VisuGUI_Tools.cxx
src/VISU_I/VISU_Prs3d_i.cc

index ac8298d3fc4822ccd69b9b6e03281121d150bb5c..e38b8cd3a139f4aec69ef7ec76bac64a61138d5a 100644 (file)
@@ -114,14 +114,17 @@ void VISU_Actor::SetPipeLine(VISU_PipeLine* thePipeLine) {
     this->Modified();
     vtkMapper *aMapper = myPipeLine->GetMapper();
     vtkDataSet *aDataSet = aMapper->GetInput();
-    if(!aDataSet)
-      throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no input data !!!");
-    aDataSet->Update();
-    static float eps = VTK_LARGE_FLOAT * 0.1 ;
-    if(aDataSet->GetLength() > eps)
-      throw std::runtime_error("VISU_Actor::SetPipeLine >> Diagonal of the actor is too large !!!");
-    if(!aDataSet->GetNumberOfCells())
-      throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no visible elements");
+
+    //This code has been moved into VISU::Prs3d_i::UpdateActor() for bug 9808
+    //if(!aDataSet)
+    //  throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no input data !!!");
+    //aDataSet->Update();
+    //static float eps = VTK_LARGE_FLOAT * 0.1 ;
+    //if(aDataSet->GetLength() > eps)
+    //  throw std::runtime_error("VISU_Actor::SetPipeLine >> Diagonal of the actor is too large !!!");
+    //if(!aDataSet->GetNumberOfCells())
+    //  throw std::runtime_error("VISU_Actor::SetPipeLine >> There is no visible elements");
+
     //Bug SAL4221:  Mesh with less than 10 cells : shrink mode disable
     //SetShrinkable(aDataSet->GetNumberOfCells() > 10);
     SetShrinkable(thePipeLine->IsShrinkable());
index ca94e272e5df3c3ab3f5547e9859d580190c7e0b..208b8a1a81bd440b3756c6528645ecd581d4b2b9 100644 (file)
@@ -652,7 +652,7 @@ namespace VISU
       }catch(std::exception& exc){
        SUIT_MessageBox::warn1(GetDesktop(theModule),
                               QObject::tr("WRN_VISU"),
-                              QObject::tr("ERR_CANT_CREATE_ACTOR"),
+                              QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
                               QObject::tr("BUT_OK"));
       }
       QApplication::restoreOverrideCursor();
@@ -758,6 +758,7 @@ namespace VISU
                  VISU::Prs3d_i* thePrs)
   {
     QApplication::setOverrideCursor(Qt::waitCursor);
+    bool isPublished = false;
 
     SALOMEDS::SObject_var aSObject = thePrs->GetSObject();
     CORBA::String_var anEntry = aSObject->GetID();
@@ -769,6 +770,7 @@ namespace VISU
       for (int i = 0, iEnd = aViewWindows.size(); i < iEnd; i++) {
         SVTK_ViewWindow* aView = aViewWindows[i];
         if (VISU_Actor* anActor = FindActor(aView, anEntry.in())) {
+          isPublished = true;
           thePrs->UpdateActor(anActor);
         }
       }
@@ -776,7 +778,7 @@ namespace VISU
       INFOS(ex.what());
       QApplication::restoreOverrideCursor();
       SUIT_MessageBox::warn1 (GetDesktop(theModule), QObject::tr("WRN_VISU"),
-                              QObject::tr("ERR_CANT_BUILD_PRESENTATION") + " " + QObject::tr(ex.what()),
+                              QObject::tr("ERR_CANT_BUILD_PRESENTATION") + ": " + QObject::tr(ex.what()),
                               QObject::tr("BUT_OK"));
 
       TViewWindows aViewWindows = GetViews(theModule);
@@ -790,6 +792,9 @@ namespace VISU
       return;
     }
     QApplication::restoreOverrideCursor();
+
+    if (!isPublished)
+      PublishInView(theModule, thePrs);
   }
 
   static bool ComputeVisiblePropBounds(SVTK_ViewWindow* theViewWindow,
@@ -1167,7 +1172,7 @@ namespace VISU
         INFOS(exc.what());
         SUIT_MessageBox::warn1 (GetDesktop(theModule),
                                 QObject::tr("WRN_VISU"),
-                                QObject::tr("ERR_CANT_CREATE_ACTOR") + " " + QObject::tr(exc.what()),
+                                QObject::tr("ERR_CANT_CREATE_ACTOR") + ": " + QObject::tr(exc.what()),
                                 QObject::tr("BUT_OK"));
       }
     }
index 5e39d80e3799988ba81fef1fdf9bbb2c69e7e4de..7838834f72dde338e7c79200c08526d3dd9ec5b7 100644 (file)
@@ -108,7 +108,22 @@ void VISU::Prs3d_i::CreateActor(VISU_Actor* theActor, const Handle(SALOME_Intera
 
 void VISU::Prs3d_i::UpdateActor(VISU_Actor* theActor) {
   if(MYDEBUG) MESSAGE("Prs3d_i::UpdateActor() - this = "<<this);
-  theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
+
+  // fix for bug 9808 BEGIN
+  vtkMapper *aMapper = myPipeLine->GetMapper();
+  vtkDataSet *aDataSet = aMapper->GetInput();
+  if (!aDataSet)
+    throw std::runtime_error("There is no input data !!!");
+  aDataSet->Update();
+  static float eps = VTK_LARGE_FLOAT * 0.1 ;
+  if (!aDataSet->GetNumberOfCells())
+    throw std::runtime_error("There is no visible elements");
+  if (aDataSet->GetLength() > eps)
+    throw std::runtime_error("Diagonal of the actor is too large !!!");
+  // fix for bug 9808 END
+
+  //theActor->GetMapper()->ShallowCopy(myPipeLine->GetMapper());
+  theActor->GetMapper()->ShallowCopy(aMapper);
   theActor->SetPosition(myOffset);
   theActor->Modified();
 }