Salome HOME
activateModule/deactivateModule functions are made "bool".
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index f3794ec5e452b2a9a4d6209efc4c288feeede871..7bea5e30b0f153a15719ac0ba42dfc96f0a1977e 100644 (file)
 #include "SMESH_ActorUtils.h"
 #include "SMESH_DeviceActor.h"
 #include "SMESH_ControlsDef.hxx"
-#include "SALOME_ExtractUnstructuredGrid.h"
+#include <VTKViewer_ExtractUnstructuredGrid.h>
+
+#include "SUIT_Session.h"
+#include "SUIT_ResourceMgr.h"
 
-#include "QAD_Config.h"
 #include <qstringlist.h>
 
 #include <vtkTimeStamp.h>
@@ -73,7 +75,7 @@
 #include "utilities.h"
 
 #ifdef _DEBUG_
-static int MYDEBUG = 0;
+static int MYDEBUG = 1;
 #else
 static int MYDEBUG = 0;
 #endif
@@ -101,8 +103,9 @@ SMESH_Actor* SMESH_Actor::New(TVisualObjPtr theVisualObj,
 }
 
 
-SMESH_ActorDef::SMESH_ActorDef(){
-  if(MYDEBUG) MESSAGE("SMESH_ActorDef");
+SMESH_ActorDef::SMESH_ActorDef()
+{
+  if(MYDEBUG) MESSAGE("SMESH_ActorDef - "<<this);
 
   myTimeStamp = vtkTimeStamp::New();
 
@@ -117,7 +120,7 @@ SMESH_ActorDef::SMESH_ActorDef(){
   float aLineWidth = SMESH::GetFloat("SMESH:SettingsWidth",1);
 
   vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
-  SALOME_ExtractUnstructuredGrid* aFilter = NULL;
+  VTKViewer_ExtractUnstructuredGrid* aFilter = NULL;
 
   //Definition 2D and 3D divices of the actor
   //-----------------------------------------
@@ -136,32 +139,30 @@ SMESH_ActorDef::SMESH_ActorDef(){
 
   my2DActor = SMESH_DeviceActor::New();
   my2DActor->SetUserMatrix(aMatrix);
-  my2DActor->SetStoreMapping(true);
   my2DActor->PickableOff();
   my2DActor->SetProperty(mySurfaceProp);
   my2DActor->SetBackfaceProperty(myBackSurfaceProp);
   my2DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
   aFilter = my2DActor->GetExtractUnstructuredGrid();
-  aFilter->SetModeOfChanging(SALOME_ExtractUnstructuredGrid::eAdding);
+  aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
   aFilter->RegisterCellsWithType(VTK_TRIANGLE);
   aFilter->RegisterCellsWithType(VTK_POLYGON);
   aFilter->RegisterCellsWithType(VTK_QUAD);
 
   my3DActor = SMESH_DeviceActor::New();
   my3DActor->SetUserMatrix(aMatrix);
-  my3DActor->SetStoreMapping(true);
   my3DActor->PickableOff();
   my3DActor->SetProperty(mySurfaceProp);
   my3DActor->SetBackfaceProperty(myBackSurfaceProp);
   my3DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
   aFilter = my3DActor->GetExtractUnstructuredGrid();
-  aFilter->SetModeOfChanging(SALOME_ExtractUnstructuredGrid::eAdding);
+  aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
   aFilter->RegisterCellsWithType(VTK_TETRA);
   aFilter->RegisterCellsWithType(VTK_VOXEL);
   aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
   aFilter->RegisterCellsWithType(VTK_WEDGE);
   aFilter->RegisterCellsWithType(VTK_PYRAMID);
-
+  aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
 
   //Definition 1D divice of the actor
   //---------------------------------
@@ -177,13 +178,12 @@ SMESH_ActorDef::SMESH_ActorDef(){
 
   my1DActor = SMESH_DeviceActor::New();
   my1DActor->SetUserMatrix(aMatrix);
-  my1DActor->SetStoreMapping(true);
   my1DActor->PickableOff();
   my1DActor->SetHighlited(true);
   my1DActor->SetProperty(myEdgeProp);
   my1DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
   aFilter = my1DActor->GetExtractUnstructuredGrid();
-  aFilter->SetModeOfChanging(SALOME_ExtractUnstructuredGrid::eAdding);
+  aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
   aFilter->RegisterCellsWithType(VTK_LINE);
 
   my1DProp = vtkProperty::New();
@@ -202,14 +202,13 @@ SMESH_ActorDef::SMESH_ActorDef(){
 
   my1DExtActor = SMESH_DeviceActor::New();
   my1DExtActor->SetUserMatrix(aMatrix);
-  my1DExtActor->SetStoreMapping(true);
   my1DExtActor->PickableOff();
   my1DExtActor->SetHighlited(true);
   my1DExtActor->SetVisibility(false);
   my1DExtActor->SetProperty(my1DExtProp);
   my1DExtActor->SetRepresentation(SMESH_DeviceActor::eInsideframe);
   aFilter = my1DExtActor->GetExtractUnstructuredGrid();
-  aFilter->SetModeOfChanging(SALOME_ExtractUnstructuredGrid::eAdding);
+  aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
   aFilter->RegisterCellsWithType(VTK_LINE);
 
 
@@ -224,13 +223,13 @@ SMESH_ActorDef::SMESH_ActorDef(){
 
   myNodeActor = SMESH_DeviceActor::New();
   myNodeActor->SetUserMatrix(aMatrix);
-  myNodeActor->SetStoreMapping(true);
+  myNodeActor->SetStoreClippingMapping(true);
   myNodeActor->PickableOff();
   myNodeActor->SetVisibility(false);
   myNodeActor->SetProperty(myNodeProp);
   myNodeActor->SetRepresentation(SMESH_DeviceActor::ePoint);
   aFilter = myNodeActor->GetExtractUnstructuredGrid();
-  aFilter->SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::ePoints);
+  aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
 
 
   //Definition of Pickable and Highlitable engines
@@ -238,9 +237,8 @@ SMESH_ActorDef::SMESH_ActorDef(){
 
   myBaseActor = SMESH_DeviceActor::New();
   myBaseActor->SetUserMatrix(aMatrix);
-  myBaseActor->SetStoreMapping(true);
+  myBaseActor->SetStoreGemetryMapping(true);
   myBaseActor->GetProperty()->SetOpacity(0.0);
-  myBaseActor->myGeomFilter->SetInside(true);
 
   myPickableActor = myBaseActor;
   
@@ -268,19 +266,9 @@ SMESH_ActorDef::SMESH_ActorDef(){
 
   myHighlitableActor = SMESH_DeviceActor::New();
   myHighlitableActor->SetUserMatrix(aMatrix);
-  myHighlitableActor->SetStoreMapping(false);
   myHighlitableActor->PickableOff();
   myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
 
-  myNodeHighlitableActor = SMESH_DeviceActor::New();
-  myNodeHighlitableActor->SetUserMatrix(aMatrix);
-  myNodeHighlitableActor->SetStoreMapping(false);
-  myNodeHighlitableActor->PickableOff();
-  myNodeHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
-  aFilter = myNodeHighlitableActor->GetExtractUnstructuredGrid();
-  aFilter->SetModeOfExtraction(SALOME_ExtractUnstructuredGrid::ePoints);
-
-
   SetShrinkFactor(SMESH::GetFloat("SMESH:SettingsShrinkCoeff", 75)/100.);
 
   myName = "";
@@ -302,36 +290,36 @@ SMESH_ActorDef::SMESH_ActorDef(){
 
   vtkTextProperty* aScalarBarTitleProp = vtkTextProperty::New();
 
-  if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarTitleColor" ) ) {
-    QStringList aTColor = QStringList::split(  ":", QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleColor" ), false );
-    aScalarBarTitleProp->SetColor( ( aTColor.count() > 0 ? aTColor[0].toInt()/255. : 1.0 ),
-                                  ( aTColor.count() > 1 ? aTColor[1].toInt()/255. : 1.0 ), 
-                                  ( aTColor.count() > 2 ? aTColor[2].toInt()/255. : 1.0 ) );
-  }
-  else
-    aScalarBarTitleProp->SetColor( 1.0, 1.0, 1.0 );
+  SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
+  if( !mgr )
+    return;
+
+  QColor aTColor = mgr->colorValue( "ScalarBarTitleColor", "SMESH", QColor( 255, 255, 255 ) );
+  aScalarBarTitleProp->SetColor( aTColor.red()/255., aTColor.green()/255., aTColor.blue()/255. );
 
   aScalarBarTitleProp->SetFontFamilyToArial();
-  if( QAD_CONFIG->hasSetting( "SMESH:ScalarBarTitleFont" ) ){
-    if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleFont" ) == "Arial" )
+  
+  if( mgr->hasValue( "ScalarBarTitleFont", "SMESH" ) ){
+    QString str = mgr->stringValue( "ScalarBarTitleFont", "SMESH" );
+    if ( str == "Arial" )
       aScalarBarTitleProp->SetFontFamilyToArial();
-    else if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleFont" ) == "Courier" )
+    else if ( str == "Courier" )
       aScalarBarTitleProp->SetFontFamilyToCourier();
-    else if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleFont" ) == "Times" )
+    else if ( str == "Times" )
       aScalarBarTitleProp->SetFontFamilyToTimes();
   }
 
-  if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleBold" ) == "true" )
+  if ( mgr->stringValue( "ScalarBarTitleBold", "SMESH" ) == "true" )
     aScalarBarTitleProp->BoldOn();
   else
     aScalarBarTitleProp->BoldOff();
 
-  if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleItalic" ) == "true" )
+  if ( mgr->stringValue( "ScalarBarTitleItalic", "SMESH" ) == "true" )
     aScalarBarTitleProp->ItalicOn();
   else
     aScalarBarTitleProp->ItalicOff();
 
-  if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarTitleShadow" ) == "true" )
+  if ( mgr->stringValue( "ScalarBarTitleShadow", "SMESH" ) == "true" )
     aScalarBarTitleProp->ShadowOn();
   else
     aScalarBarTitleProp->ShadowOff();
@@ -341,36 +329,32 @@ SMESH_ActorDef::SMESH_ActorDef(){
 
   vtkTextProperty* aScalarBarLabelProp = vtkTextProperty::New();
 
-  if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarLabelColor" ) ) {
-    QStringList aTColor = QStringList::split(  ":", QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelColor" ), false );
-    aScalarBarLabelProp->SetColor( ( aTColor.count() > 0 ? aTColor[0].toInt()/255. : 1.0 ),
-                                  ( aTColor.count() > 1 ? aTColor[1].toInt()/255. : 1.0 ), 
-                                  ( aTColor.count() > 2 ? aTColor[2].toInt()/255. : 1.0 ) );
-  }
-  else
-    aScalarBarLabelProp->SetColor( 1.0, 1.0, 1.0 );
+  aTColor = mgr->colorValue( "ScalarBarLabelColor", "SMESH", QColor( 255, 255, 255 ) );
+  aScalarBarLabelProp->SetColor( aTColor.red()/255., aTColor.green()/255., aTColor.blue()/255. );
 
   aScalarBarLabelProp->SetFontFamilyToArial();
-  if( QAD_CONFIG->hasSetting( "SMESH:ScalarBarLabelFont" ) ){
-    if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelFont" ) == "Arial" )
+  if( mgr->hasValue( "ScalarBarLabelFont", "SMESH" ) )
+  {
+    QString str = mgr->stringValue( "ScalarBarLabelFont", "SMESH" );
+    if( str == "Arial" )
       aScalarBarLabelProp->SetFontFamilyToArial();
-    else if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelFont" ) == "Courier" )
+    else if( str == "Courier" )
       aScalarBarLabelProp->SetFontFamilyToCourier();
-    else if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelFont" ) == "Times" )
+    else if( str == "Times" )
       aScalarBarLabelProp->SetFontFamilyToTimes();
   }
 
-  if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelBold" ) == "true" )
+  if( mgr->stringValue( "ScalarBarLabelBold", "SMESH" ) == "true" )
     aScalarBarLabelProp->BoldOn();
   else
     aScalarBarLabelProp->BoldOff();
 
-  if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelItalic" ) == "true" )
+  if ( mgr->stringValue( "ScalarBarLabelItalic", "SMESH" ) == "true" )
     aScalarBarLabelProp->ItalicOn();
   else
     aScalarBarLabelProp->ItalicOff();
 
-  if ( QAD_CONFIG->getSetting( "SMESH:ScalarBarLabelShadow" ) == "true" )
+  if( mgr->stringValue( "ScalarBarLabelShadow", "SMESH" ) == "true" )
     aScalarBarLabelProp->ShadowOn();
   else
     aScalarBarLabelProp->ShadowOff();
@@ -378,38 +362,38 @@ SMESH_ActorDef::SMESH_ActorDef(){
   myScalarBarActor->SetLabelTextProperty( aScalarBarLabelProp );
   aScalarBarLabelProp->Delete();
 
-  if ( QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" )
+  if( mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" )
     myScalarBarActor->SetOrientationToHorizontal();
   else
     myScalarBarActor->SetOrientationToVertical();
 
-  float aXVal = QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" ? 0.20 : 0.01;
-  if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarXPosition" ) )
-    aXVal = QAD_CONFIG->getSetting( "SMESH:ScalarBarXPosition" ).toFloat();
-  float aYVal = QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" ? 0.01 : 0.1;
-  if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarYPosition" ) )
-    aYVal = QAD_CONFIG->getSetting( "SMESH:ScalarBarYPosition" ).toFloat();
+  float aXVal = mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" ? 0.20 : 0.01;
+  if( mgr->hasValue( "ScalarBarXPosition", "SMESH" ) )
+    aXVal = mgr->doubleValue( "ScalarBarXPosition", "SMESH", aXVal );
+  float aYVal = mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" ? 0.01 : 0.1;
+  if( mgr->hasValue( "ScalarBarYPosition", "SMESH" ) )
+    aYVal = mgr->doubleValue( "ScalarBarYPosition", "SMESH", aYVal );
   myScalarBarActor->SetPosition( aXVal, aYVal );
 
-  float aWVal = QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" ? 0.60 : 0.10;
-  if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarWidth" ) )
-    aWVal = QAD_CONFIG->getSetting( "SMESH:ScalarBarWidth" ).toFloat();
+  float aWVal = mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" ? 0.60 : 0.10;
+  if( mgr->hasValue( "ScalarBarWidth", "SMESH" ) )
+    aWVal = mgr->doubleValue( "ScalarBarWidth", "SMESH", aWVal );
   myScalarBarActor->SetWidth( aWVal );
 
-  float aHVal = QAD_CONFIG->getSetting("SMESH:ScalarBarOrientation") == "Horizontal" ? 0.12 : 0.80;
-  if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarHeight" ) )
-    aHVal = QAD_CONFIG->getSetting( "SMESH:ScalarBarHeight" ).toFloat();
+  float aHVal = mgr->stringValue( "ScalarBarOrientation", "SMESH" ) == "Horizontal" ? 0.12 : 0.80;
+  if( mgr->hasValue( "ScalarBarHeight", "SMESH" ) )
+    aHVal = mgr->doubleValue( "ScalarBarHeight", "SMESH", aHVal );
   myScalarBarActor->SetHeight( aHVal );
 
   int anIntVal = 5;
-  if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarNbOfLabels" ) )
-    anIntVal = QAD_CONFIG->getSetting("SMESH:ScalarBarNbOfLabels").toInt();
-  myScalarBarActor->SetNumberOfLabels(anIntVal == 0? 5: anIntVal);
+  if( mgr->hasValue( "ScalarBarNbOfLabels", "SMESH" ) )
+    anIntVal = mgr->integerValue( "ScalarBarNbOfLabels", "SMESH", anIntVal );
+  myScalarBarActor->SetNumberOfLabels( anIntVal == 0 ? 5: anIntVal );
 
   anIntVal = 64;
-  if ( QAD_CONFIG->hasSetting( "SMESH:ScalarBarNbOfColors" ) )
-    anIntVal = QAD_CONFIG->getSetting("SMESH:ScalarBarNbOfColors").toInt();
-  myScalarBarActor->SetMaximumNumberOfColors(anIntVal == 0? 64: anIntVal);
+  if( mgr->hasValue( "ScalarBarNbOfColors", "SMESH" ) )
+    anIntVal = mgr->integerValue( "ScalarBarNbOfColors", "SMESH", anIntVal );
+  myScalarBarActor->SetMaximumNumberOfColors( anIntVal == 0 ? 64 : anIntVal );
 
 
   //Definition of points numbering pipeline
@@ -419,7 +403,7 @@ SMESH_ActorDef::SMESH_ActorDef(){
   myPtsMaskPoints = vtkMaskPoints::New();
   myPtsMaskPoints->SetInput(myPointsNumDataSet);
   myPtsMaskPoints->SetOnRatio(1);
-    
+
   myPtsSelectVisiblePoints = vtkSelectVisiblePoints::New();
   myPtsSelectVisiblePoints->SetInput(myPtsMaskPoints->GetOutput());
   myPtsSelectVisiblePoints->SelectInvisibleOff();
@@ -494,8 +478,9 @@ SMESH_ActorDef::SMESH_ActorDef(){
 }
 
 
-SMESH_ActorDef::~SMESH_ActorDef(){
-  if(MYDEBUG) MESSAGE("~SMESH_ActorDef");
+SMESH_ActorDef::~SMESH_ActorDef()
+{
+  if(MYDEBUG) MESSAGE("~SMESH_ActorDef - "<<this);
 
   myScalarBarActor->Delete();
   myLookupTable->Delete();
@@ -522,8 +507,6 @@ SMESH_ActorDef::~SMESH_ActorDef(){
   myBaseActor->Delete();
 
   myHighlitableActor->Delete();
-  myNodeHighlitableActor->Delete();
-
 
   //Deleting of pints numbering pipeline
   //---------------------------------------
@@ -624,8 +607,25 @@ void SMESH_ActorDef::SetCellsLabeled(bool theIsCellsLabeled)
 }
 
 
-void SMESH_ActorDef::SetControlMode(eControl theMode){
+void 
+SMESH_ActorDef::
+SetControlMode(eControl theMode)
+{
+  SetControlMode(theMode,true);
+}
+
+
+void 
+SMESH_ActorDef::
+SetControlMode(eControl theMode,
+              bool theCheckEntityMode)
+{
+  SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();  
+  if( !mgr )
+    return;
+
   myControlMode = eNone;
+  theCheckEntityMode &= mgr->stringValue( "DispayEntity", "SMESH" ) == "true";
 
   my1DActor->GetMapper()->SetScalarVisibility(false);
   my2DActor->GetMapper()->SetScalarVisibility(false);
@@ -734,27 +734,36 @@ void SMESH_ActorDef::SetControlMode(eControl theMode){
       switch(myControlMode){
       case eFreeEdges:
       case eFreeBorders:
-       my1DExtActor->SetExtControlMode(aFunctor,myControlActor);
+       my1DExtActor->SetExtControlMode(aFunctor);
        break;
       case eLength2D:
       case eMultiConnection2D:
-       my1DExtActor->SetExtControlMode(aFunctor,myControlActor,myScalarBarActor,myLookupTable);
+       my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable);
        break;
       default:
        myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
       }
     }
 
-    if(QAD_CONFIG->getSetting("SMESH:DispayEntity") == "true"){
+    if(theCheckEntityMode){
       if(myControlActor == my1DActor)
-       myEntityMode = eEdges;
-      else if(myControlActor == my2DActor)
-       myEntityMode = eFaces;
-      else if(myControlActor == my3DActor)
-       myEntityMode = eVolumes;
+       SetEntityMode(eEdges);
+      else if(myControlActor == my2DActor){
+       switch(myControlMode){
+       case eLength2D:
+       case eFreeEdges:
+       case eMultiConnection2D:
+         //SetEntityMode(eEdges);
+         SetEntityMode(eFaces);
+         break;
+       default:
+         SetEntityMode(eFaces);
+       }
+      }else if(myControlActor == my3DActor)
+       SetEntityMode(eVolumes);
     }
 
-  }else if(QAD_CONFIG->getSetting("SMESH:DispayEntity") == "true"){
+  }else if(theCheckEntityMode){
     myEntityMode = eAllEntity;
   }
 
@@ -778,7 +787,6 @@ void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
   theRenderer->AddActor(my1DExtActor);
 
   theRenderer->AddActor(myHighlitableActor);
-  theRenderer->AddActor(myNodeHighlitableActor);
 
   theRenderer->AddActor2D(myScalarBarActor);
 
@@ -796,7 +804,6 @@ void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
   theRenderer->RemoveActor(myBaseActor);
 
   theRenderer->RemoveActor(myHighlitableActor);
-  theRenderer->RemoveActor(myNodeHighlitableActor);
 
   theRenderer->RemoveActor(my1DActor);
   theRenderer->RemoveActor(my1DExtActor);
@@ -826,7 +833,6 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
   myBaseActor->Init(myVisualObj,myImplicitBoolean);
   
   myHighlitableActor->Init(myVisualObj,myImplicitBoolean);
-  myNodeHighlitableActor->Init(myVisualObj,myImplicitBoolean);
   
   my1DActor->Init(myVisualObj,myImplicitBoolean);
   my1DExtActor->Init(myVisualObj,myImplicitBoolean);
@@ -846,9 +852,14 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
 
   //SetIsShrunkable(theGrid->GetNumberOfCells() > 10);
   SetIsShrunkable(true);
-  
-  QString aMode = QAD_CONFIG->getSetting("SMESH:DisplayMode");
+
+  SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
+  if( !mgr )
+    return false;
+
+  QString aMode = mgr->stringValue( "DisplayMode", "SMESH" );
   SetRepresentation(-1);
+  
   if(aMode.compare("Wireframe") == 0){
     SetRepresentation(eEdge);
   }else if(aMode.compare("Shading") == 0){
@@ -856,8 +867,8 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
   }else if(aMode.compare("Nodes") == 0){
     SetRepresentation(ePoint);
   }
-
-  aMode = QAD_CONFIG->getSetting("SMESH:Shrink");
+  
+  aMode = mgr->stringValue( "Shrink", "SMESH" );
   if(aMode == "yes"){
     SetShrink();
   }
@@ -878,12 +889,11 @@ vtkDataSet* SMESH_ActorDef::GetInput(){
 }
 
 
-void SMESH_ActorDef::SetTransform(SALOME_Transform* theTransform){
+void SMESH_ActorDef::SetTransform(VTKViewer_Transform* theTransform){
   myNodeActor->SetTransform(theTransform);
   myBaseActor->SetTransform(theTransform);
 
   myHighlitableActor->SetTransform(theTransform);
-  myNodeHighlitableActor->SetTransform(theTransform);
 
   my1DActor->SetTransform(theTransform);
   my1DExtActor->SetTransform(theTransform);
@@ -1067,14 +1077,22 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
 
 
 void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
-  if(!myVisualObj->GetNbEntities(SMDSAbs_Edge))
+  myEntityState = eAllEntity;
+
+  if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)){
+    myEntityState &= ~eEdges;
     theMode &= ~eEdges;
+  }
 
-  if(!myVisualObj->GetNbEntities(SMDSAbs_Face))
+  if(!myVisualObj->GetNbEntities(SMDSAbs_Face)){
+    myEntityState &= ~eFaces;
     theMode &= ~eFaces;
+  }
 
-  if(!myVisualObj->GetNbEntities(SMDSAbs_Volume))
+  if(!myVisualObj->GetNbEntities(SMDSAbs_Volume)){
+    myEntityState &= ~eVolumes;
     theMode &= ~eVolumes;
+  }
 
   if(!theMode){
     if(myVisualObj->GetNbEntities(SMDSAbs_Edge))
@@ -1087,11 +1105,13 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
       theMode |= eVolumes;
   }
 
+  myBaseActor->myGeomFilter->SetInside(myEntityMode != myEntityState);
+
   myEntityMode = theMode;
-  SALOME_ExtractUnstructuredGrid* aFilter = NULL;
+  VTKViewer_ExtractUnstructuredGrid* aFilter = NULL;
   aFilter = myBaseActor->GetExtractUnstructuredGrid();
   aFilter->ClearRegisteredCellsWithType();
-  aFilter->SetModeOfChanging(SALOME_ExtractUnstructuredGrid::eAdding);
+  aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
   
   if(myEntityMode & eEdges){
     if (MYDEBUG) MESSAGE("EDGES");
@@ -1229,27 +1249,27 @@ void SMESH_ActorDef::UpdateHighlight(){
   myHighlitableActor->SetVisibility(false);
   myHighlitableActor->SetHighlited(false);
 
-  myNodeHighlitableActor->SetVisibility(false);
-  myNodeHighlitableActor->SetHighlited(false);
-
   if(myIsHighlighted){
     myHighlitableActor->SetProperty(myHighlightProp);
   }else if(myIsPreselected){
     myHighlitableActor->SetProperty(myPreselectProp);
   }
 
-  bool isVisible = GetVisibility();
+  bool anIsVisible = GetVisibility();
 
   if(myIsHighlighted || myIsPreselected){
     if(GetUnstructuredGrid()->GetNumberOfCells()){
+      myHighlitableActor->SetHighlited(anIsVisible);
+      myHighlitableActor->SetVisibility(anIsVisible);
+      myHighlitableActor->GetExtractUnstructuredGrid()->
+       SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
       myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
-      myHighlitableActor->SetVisibility(isVisible);
-      myHighlitableActor->SetHighlited(isVisible);
-    }
-    if(myRepresentation == ePoint || GetPointRepresentation()){
-      myNodeHighlitableActor->SetProperty(myHighlitableActor->GetProperty());
-      myNodeHighlitableActor->SetVisibility(isVisible);
-      myNodeHighlitableActor->SetHighlited(isVisible);
+    }else if(myRepresentation == ePoint || GetPointRepresentation()){
+      myHighlitableActor->SetHighlited(anIsVisible);
+      myHighlitableActor->SetVisibility(anIsVisible);
+      myHighlitableActor->GetExtractUnstructuredGrid()->
+       SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+      myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
     }
   }
 }
@@ -1308,7 +1328,7 @@ void SMESH_ActorDef::Update(){
     unsigned long aTime = myTimeStamp->GetMTime();
     unsigned long anObjTime = myVisualObj->GetUnstructuredGrid()->GetMTime();
     if (anObjTime > aTime)
-      SetControlMode(GetControlMode());
+      SetControlMode(GetControlMode(),false);
   }
   if(myIsPointsLabeled){
     SetPointsLabeled(myIsPointsLabeled);
@@ -1461,7 +1481,6 @@ SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
   myBaseActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
   
   myHighlitableActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
-  myNodeHighlitableActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
   
   my1DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
   my1DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);