]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Do notm update outside / inside cursor settings when the segementation functionality...
authorapo <apo@opencascade.com>
Mon, 19 Dec 2005 11:33:12 +0000 (11:33 +0000)
committerapo <apo@opencascade.com>
Mon, 19 Dec 2005 11:33:12 +0000 (11:33 +0000)
src/OBJECT/VISU_GaussPtsAct.cxx
src/OBJECT/VISU_GaussPtsAct.h

index 42156e20d26a3675ee8097abf4338063d9c76635..b0716f9ee8c073a9f005a3f711d4b5ea1c1528e4 100644 (file)
@@ -459,6 +459,8 @@ VISU_GaussPtsAct
   return myGaussPtsActorFactory;
 }
 
+
+//----------------------------------------------------------------------------
 void
 VISU_GaussPtsAct
 ::SetVisibility(int theMode)
@@ -468,6 +470,14 @@ VISU_GaussPtsAct
   Highlight(isHighlighted());
 }
 
+int
+VISU_GaussPtsAct
+::IsSegmentationEnabled()
+{
+  return myWidgetCtrl  && myWidgetCtrl->GetEnabled();
+}
+
+
 //----------------------------------------------------------------------------
 void
 VISU_GaussPtsAct
@@ -1021,6 +1031,9 @@ VISU_GaussPtsAct
   if(!myInsideCursorSettings || myInsideCursorSettings->GetInitial())
     return;
 
+  if(!IsSegmentationEnabled())
+    return;
+
   VISU_GaussPointsPL* aPipeline = theActor->GetPipeLine();
 
   SALOME_ExtractGeometry* anExtractGeometry = aPipeline->GetExtractGeometryFilter();
@@ -1149,15 +1162,15 @@ VISU_GaussPtsAct1
     myOutsideDeviceActor->SetVisibility(false);
   }
 
+  Superclass::SetWidgetCtrl(theWidgetCtrl);
+
   if(theWidgetCtrl){
     myInsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidgetCtrl->ImplicitFunction());
-    myInsideDeviceActor->SetVisibility(GetVisibility() && theWidgetCtrl->GetEnabled());
+    myInsideDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled());
 
     myOutsideDeviceActor->GetPipeLine()->SetImplicitFunction(theWidgetCtrl->ImplicitFunction());  
-    myOutsideDeviceActor->SetVisibility(GetVisibility() && theWidgetCtrl->GetEnabled());
+    myOutsideDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled());
   }
-
-  Superclass::SetWidgetCtrl(theWidgetCtrl);
 }
 
 
@@ -1194,7 +1207,7 @@ VISU_GaussPtsAct1
            vtkDataArray *theScalarArray)
 {
   VISU_GaussPointsPL* aPipeLine = myDeviceActor->GetPipeLine();
-  if(myWidgetCtrl && myWidgetCtrl->GetEnabled()){
+  if(IsSegmentationEnabled()){
     if(myInsideDeviceActor->GetPipeLine()->GetNodeVTKID(theObjID) < 0)
       aPipeLine = myOutsideDeviceActor->GetPipeLine();
     else
@@ -1210,7 +1223,7 @@ VISU_GaussPtsAct1
 ::GetMagnification(vtkIdType theObjID)
 {
   VISU_GaussPointsPL* aPipeLine = myDeviceActor->GetPipeLine();
-  if(myWidgetCtrl && myWidgetCtrl->GetEnabled()){
+  if(IsSegmentationEnabled()){
     if(myInsideDeviceActor->GetPipeLine()->GetNodeVTKID(theObjID) < 0)
       aPipeLine = myOutsideDeviceActor->GetPipeLine();
     else
@@ -1225,7 +1238,7 @@ float
 VISU_GaussPtsAct1
 ::GetClamp(vtkIdType theObjID)
 {
-  if(myWidgetCtrl && myWidgetCtrl->GetEnabled()){
+  if(IsSegmentationEnabled()){
     if(myInsideDeviceActor->GetPipeLine()->GetNodeVTKID(theObjID) < 0)
       return ::GetClamp(myOutsideDeviceActor->GetPipeLine());
     else
@@ -1251,10 +1264,11 @@ VISU_GaussPtsAct1
 
   Superclass::SetVisibility(theMode);
 
-  bool anIsSegementation = !myWidgetCtrl || myWidgetCtrl->GetEnabled();
-  myDeviceActor->SetVisibility(GetVisibility() && !anIsSegementation);
-  myInsideDeviceActor->SetVisibility(GetVisibility() && anIsSegementation);
-  myOutsideDeviceActor->SetVisibility(GetVisibility() && anIsSegementation);
+  bool aVisisbility = GetVisibility();
+  bool anIsSegementation = IsSegmentationEnabled();
+  myDeviceActor->SetVisibility(aVisisbility && !anIsSegementation);
+  myInsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation);
+  myOutsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation);
 
   mySetVisibilitySignal(GetVisibility());
 }
@@ -1296,6 +1310,9 @@ VISU_GaussPtsAct1
   if(!myOutsideCursorSettings || myOutsideCursorSettings->GetInitial())
     return;
 
+  if(!IsSegmentationEnabled())
+    return;
+
   VISU_GaussPointsPL* aPipeline = myOutsideDeviceActor->GetPipeLine();
 
   SALOME_ExtractGeometry* anExtractGeometry = aPipeline->GetExtractGeometryFilter();
@@ -1374,10 +1391,11 @@ VISU_GaussPtsAct1
   case vtkCommand::EnableEvent: 
   case vtkCommand::DisableEvent:
   case vtkCommand::EndInteractionEvent: {
-    bool anIsSegementation = !myWidgetCtrl || myWidgetCtrl->GetEnabled();
-    myDeviceActor->SetVisibility(GetVisibility() && !anIsSegementation);
-    myInsideDeviceActor->SetVisibility(GetVisibility() && anIsSegementation);
-    myOutsideDeviceActor->SetVisibility(GetVisibility() && anIsSegementation);
+    bool aVisisbility = GetVisibility();
+    bool anIsSegementation = IsSegmentationEnabled();
+    myDeviceActor->SetVisibility(aVisisbility && !anIsSegementation);
+    myInsideDeviceActor->SetVisibility(aVisisbility && anIsSegementation);
+    myOutsideDeviceActor->SetVisibility(anIsSegementation);
     break;
   }
   default:
@@ -1451,12 +1469,12 @@ VISU_GaussPtsAct2
     myDeviceActor->SetVisibility(false);
   }
 
+  Superclass::SetWidgetCtrl(theWidgetCtrl);
+
   if(theWidgetCtrl){
     myDeviceActor->GetPipeLine()->SetImplicitFunction(theWidgetCtrl->ImplicitFunction());
-    myDeviceActor->SetVisibility(Superclass::GetVisibility());
+    myDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled());
   }
-
-  Superclass::SetWidgetCtrl(theWidgetCtrl);
 }
 
 
@@ -1469,14 +1487,7 @@ VISU_GaussPtsAct2
 
   Superclass::SetVisibility(theMode);
 
-  myDeviceActor->SetVisibility(GetVisibility());
-}
-
-int
-VISU_GaussPtsAct2
-::GetVisibility()
-{
-  return Superclass::GetVisibility();
+  myDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled());
 }
 
 void
@@ -1486,7 +1497,7 @@ VISU_GaussPtsAct2
   switch(theEvent){
   case vtkCommand::EnableEvent: 
   case vtkCommand::DisableEvent:
-    myDeviceActor->SetVisibility(GetVisibility());
+    myDeviceActor->SetVisibility(GetVisibility() && IsSegmentationEnabled());
     if(theEvent == vtkCommand::EnableEvent)
       Update();
     break;
index 3b8a81e614b061a5cfe8d9221490223bc0ce819c..822238f428e0eca46d01636fb06242157f9fbcba 100644 (file)
@@ -158,6 +158,11 @@ class VTKOCC_EXPORT VISU_GaussPtsAct : public VISU_Actor
   void
   SetVisibility(int theMode);
 
+  //! Get segmentation visibility.
+  virtual
+  int
+  IsSegmentationEnabled();
+
   //! Set Scalar Bar Control to the actor.
   VISU_ScalarBarCtrl* 
   GetScalarBarCtrl();
@@ -445,11 +450,6 @@ class VTKOCC_EXPORT VISU_GaussPtsAct2 : public VISU_GaussPtsAct
   void
   SetVisibility(int theMode);
 
-  //! Get actor visibility.
-  virtual
-  int
-  GetVisibility();
-
   virtual void SetWidgetCtrl(VISU_WidgetCtrl* theWidgetCtrl);
 
  protected: