Salome HOME
Join BR-D5-38-2003
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index 2ddff5e5e73294919c7e68b30d37fd9b3d48a270..d06df22df5c231335d061bd5e434b0f02bbcd474 100644 (file)
@@ -116,7 +116,10 @@ SMESH_ActorDef::SMESH_ActorDef()
   myIsShrinkable = false;
   myIsShrunk = false;
 
-  myControlsPrecision = (long)SMESH::GetFloat( "SMESH:controls_precision", -1 );
+  myControlsPrecision = -1;
+  SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
+  if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
+    myControlsPrecision = (long)SMESH::GetFloat( "SMESH", "controls_precision", -1 );
 
   float aPointSize = SMESH::GetFloat("SMESH:node_size",3);
   float aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
@@ -259,7 +262,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   myHighlitableActor->PickableOff();
   myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
 
-  SetShrinkFactor( SMESH::GetFloat( "SMESH", "shrink_coeff", 0.75 ) );
+  SetShrinkFactor( SMESH::GetFloat( "SMESH:shrink_coeff", 0.75 ) );
 
   myName = "";
   myIO = NULL;
@@ -278,7 +281,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   myScalarBarActor->SetVisibility(false);
   myScalarBarActor->SetLookupTable(myLookupTable);
 
-  SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
+  mgr = SUIT_Session::session()->resourceMgr();
   if( !mgr )
     return;
 
@@ -585,6 +588,14 @@ SetControlMode(eControl theMode,
       myControlActor = my3DActor;
       break;
     }
+    case eVolume3D:
+    {
+      SMESH::Controls::Volume* aControl = new SMESH::Controls::Volume();
+      aControl->SetPrecision( myControlsPrecision );
+      aFunctor.reset( aControl );
+      myControlActor = my3DActor;
+      break;
+    }
     case eMinimumAngle:
     {
       SMESH::Controls::MinimumAngle* aControl = new SMESH::Controls::MinimumAngle();
@@ -743,18 +754,18 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
   if( !mgr )
     return false;
 
-  QString aMode = mgr->stringValue( "SMESH", "display_mode" );
+  int aMode = mgr->integerValue( "SMESH", "display_mode" );
   SetRepresentation(-1);
   
-  if(aMode.compare("Wireframe") == 0){
+  if(aMode == 0){
     SetRepresentation(eEdge);
-  }else if(aMode.compare("Shading") == 0){
+  }else if(aMode == 1){
     SetRepresentation(eSurface);
-  }else if(aMode.compare("Nodes") == 0){
+  }else if(aMode == 2){
     SetRepresentation(ePoint);
   }
   
-  if(aMode == "Shrink"){
+  if(aMode == 3){
     SetShrink();
   }
 
@@ -775,6 +786,8 @@ vtkDataSet* SMESH_ActorDef::GetInput(){
 
 
 void SMESH_ActorDef::SetTransform(VTKViewer_Transform* theTransform){
+  Superclass::SetTransform(theTransform);
+
   myNodeActor->SetTransform(theTransform);
   myBaseActor->SetTransform(theTransform);