Salome HOME
Porting SMESH module to Qt 4
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index cd2cec46e1cac83ac28a75af25876f831a1da6ff..cf7628f5756f957ca4d70a9742482182f80e5a27 100644 (file)
@@ -17,7 +17,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
 #include "SMESH_DeviceActor.h"
 #include "SMESH_ControlsDef.hxx"
 #include "VTKViewer_ExtractUnstructuredGrid.h"
+#include "SALOME_InteractiveObject.hxx"
 
 #include "SUIT_Session.h"
 #include "SUIT_ResourceMgr.h"
 
-#include <qstringlist.h>
-
 #include <vtkProperty.h>
 #include <vtkTimeStamp.h>
 #include <vtkObjectFactory.h>
@@ -286,6 +285,10 @@ SMESH_ActorDef::SMESH_ActorDef()
   myScalarBarActor->SetVisibility(false);
   myScalarBarActor->SetLookupTable(myLookupTable);
 
+  //Fix for Bug 13314:
+  //Incorrect "Min value" in Scalar Bar in Mesh:
+  myScalarBarActor->SetLabelFormat("%.4g");
+
   mgr = SUIT_Session::session()->resourceMgr();
   if( !mgr )
     return;
@@ -406,13 +409,16 @@ SMESH_ActorDef::~SMESH_ActorDef()
   //---------------------------------------
   myPointsNumDataSet->Delete();
 
-  myPtsLabeledDataMapper->RemoveAllInputs();
+  // commented: porting to vtk 5.0
+  //  myPtsLabeledDataMapper->RemoveAllInputs();
   myPtsLabeledDataMapper->Delete();
 
-  myPtsSelectVisiblePoints->UnRegisterAllOutputs();
+  // commented: porting to vtk 5.0
+  //  myPtsSelectVisiblePoints->UnRegisterAllOutputs();
   myPtsSelectVisiblePoints->Delete();
 
-  myPtsMaskPoints->UnRegisterAllOutputs();
+  // commented: porting to vtk 5.0
+  //  myPtsMaskPoints->UnRegisterAllOutputs();
   myPtsMaskPoints->Delete();
 
   myPointLabels->Delete();
@@ -425,13 +431,16 @@ SMESH_ActorDef::~SMESH_ActorDef()
   myClsLabeledDataMapper->RemoveAllInputs();
   myClsLabeledDataMapper->Delete();
 
-  myClsSelectVisiblePoints->UnRegisterAllOutputs();
+  // commented: porting to vtk 5.0
+  //  myClsSelectVisiblePoints->UnRegisterAllOutputs();
   myClsSelectVisiblePoints->Delete();
 
-  myClsMaskPoints->UnRegisterAllOutputs();
+  // commented: porting to vtk 5.0
+  //  myClsMaskPoints->UnRegisterAllOutputs();
   myClsMaskPoints->Delete();
 
-  myCellCenters->UnRegisterAllOutputs();
+  // commented: porting to vtk 5.0
+  //  myCellCenters->UnRegisterAllOutputs();
   myCellCenters->Delete();
 
   myCellsLabels->Delete();
@@ -978,7 +987,7 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
     if(myIsCellsLabeled) 
       myCellsLabels->VisibilityOn();
   }
-
+  UpdateHighlight();
   Modified();
 }
 
@@ -1180,9 +1189,9 @@ void SMESH_ActorDef::UpdateHighlight(){
       myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
     }else if(myRepresentation == ePoint || GetPointRepresentation()){
       myHighlitableActor->SetHighlited(anIsVisible);
-      myHighlitableActor->SetVisibility(anIsVisible);
       myHighlitableActor->GetExtractUnstructuredGrid()->
        SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+      myHighlitableActor->SetVisibility(anIsVisible);
       myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
     }
   }
@@ -1582,7 +1591,7 @@ void SMESH_ActorDef::UpdateScalarBar()
   aScalarBarLabelProp->SetFontFamilyToArial();
   if( mgr->hasValue( "SMESH", "scalar_bar_label_font" ) )
   {
-    QFont f = mgr->stringValue( "SMESH", "scalar_bar_label_font" );
+    QFont f = mgr->fontValue( "SMESH", "scalar_bar_label_font" );
     if( f.family() == "Arial" )
       aScalarBarLabelProp->SetFontFamilyToArial();
     else if( f.family() == "Courier" )