Salome HOME
Movement of examples to CVS EXAMPLES SAMPLES_SRC.
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index bdadcf0261d669de0a64417155f5b781e0774c3e..3c5e2e0d09a8baecf04fddf01c32d7ea856256d1 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);
@@ -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();
   }