Salome HOME
0020501: EDF 1098 SMESH: Display only groups, edit a group: can't select face from...
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index 49d838bac3d47d7efb04ad0f9d7404b28692f3af..4709f9357bd26325684bdbd5b79d82a0fd8f2cd8 100644 (file)
 #include "SMESH_ActorDef.h"
 #include "SMESH_ActorUtils.h"
 #include "SMESH_DeviceActor.h"
+#include "SMESH_ObjectDef.h"
 #include "SMESH_ControlsDef.hxx"
 #include "VTKViewer_ExtractUnstructuredGrid.h"
+#include "VTKViewer_FramedTextActor.h"
 #include "SALOME_InteractiveObject.hxx"
 
 #include "SUIT_Session.h"
@@ -118,17 +120,18 @@ SMESH_ActorDef::SMESH_ActorDef()
 
   myControlsPrecision = -1;
   SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
-  
+
   if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) )
     myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1);
 
-  vtkFloatingPointType aPointSize = SMESH::GetFloat("SMESH:node_size",3);
-  vtkFloatingPointType aLineWidth = SMESH::GetFloat("SMESH:element_width",1);
+  vtkFloatingPointType aPointSize  = SMESH::GetFloat("SMESH:node_size",3);
+  vtkFloatingPointType aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5);
+  vtkFloatingPointType aLineWidth  = SMESH::GetFloat("SMESH:element_width",1);
 
   vtkMatrix4x4 *aMatrix = vtkMatrix4x4::New();
   VTKViewer_ExtractUnstructuredGrid* aFilter = NULL;
 
-  //Definition 2D and 3D divices of the actor
+  //Definition 2D and 3D devices of the actor
   //-----------------------------------------
   vtkFloatingPointType anRGB[3] = {1,1,1};
   mySurfaceProp = vtkProperty::New();
@@ -192,7 +195,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
   aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
 
-  //Definition 1D divice of the actor
+  //Definition 1D device of the actor
   //---------------------------------
   myEdgeProp = vtkProperty::New();
   myEdgeProp->SetAmbient(1.0);
@@ -240,8 +243,49 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
 
 
-  //Definition 0D divice of the actor
-  //---------------------------------
+  //Definition 0D device of the actor (0d elements)
+  //-----------------------------------------------
+  my0DProp = vtkProperty::New();
+  SMESH::GetColor( "SMESH", "elem0d_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 0 ) );
+  my0DProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+  my0DProp->SetPointSize(aElem0DSize);
+
+  my0DActor = SMESH_DeviceActor::New();
+  my0DActor->SetUserMatrix(aMatrix);
+  my0DActor->SetStoreClippingMapping(true);
+  my0DActor->PickableOff();
+  my0DActor->SetVisibility(false);
+  my0DActor->SetProperty(my0DProp);
+  my0DActor->SetRepresentation(SMESH_DeviceActor::eSurface);
+  aFilter = my0DActor->GetExtractUnstructuredGrid();
+  //aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+  aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+  aFilter->RegisterCellsWithType(VTK_VERTEX);
+  
+  //my0DExtProp = vtkProperty::New();
+  //my0DExtProp->DeepCopy(my0DProp);
+  //anRGB[0] = 1 - anRGB[0];
+  //anRGB[1] = 1 - anRGB[1];
+  //anRGB[2] = 1 - anRGB[2];
+  //my0DExtProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
+  //my0DExtProp->SetPointSize(aElem0DSize);
+  //
+  //my0DExtActor = SMESH_DeviceActor::New();
+  //my0DExtActor->SetUserMatrix(aMatrix);
+  //my0DExtActor->SetStoreClippingMapping(true);
+  //my0DExtActor->PickableOff();
+  //my0DExtActor->SetHighlited(true);
+  //my0DExtActor->SetVisibility(false);
+  //my0DExtActor->SetProperty(my0DExtProp);
+  //my0DExtActor->SetRepresentation(SMESH_DeviceActor::eInsideframe);
+  //aFilter = my0DExtActor->GetExtractUnstructuredGrid();
+  ////aFilter->SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+  //aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+  //aFilter->RegisterCellsWithType(VTK_VERTEX);
+
+
+  //Definition 0D device of the actor (nodes)
+  //-----------------------------------------
   myNodeProp = vtkProperty::New();
   SMESH::GetColor( "SMESH", "node_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 0, 0 ) );
   myNodeProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
@@ -286,23 +330,25 @@ SMESH_ActorDef::SMESH_ActorDef()
   myBaseActor->GetProperty()->SetOpacity(0.0);
 
   myPickableActor = myBaseActor;
-  
+
   myHighlightProp = vtkProperty::New();
   myHighlightProp->SetAmbient(1.0);
   myHighlightProp->SetDiffuse(0.0);
   myHighlightProp->SetSpecular(0.0);
   SMESH::GetColor( "SMESH", "selection_object_color", anRGB[0], anRGB[1], anRGB[2], QColor( 255, 255, 255 ) );
   myHighlightProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-  myHighlightProp->SetPointSize(aPointSize);
+  //myHighlightProp->SetPointSize(aPointSize);
+  myHighlightProp->SetPointSize(std::max(aElem0DSize,aPointSize)); // ??
   myHighlightProp->SetRepresentation(1);
+
   myPreselectProp = vtkProperty::New();
   myPreselectProp->SetAmbient(1.0);
   myPreselectProp->SetDiffuse(0.0);
   myPreselectProp->SetSpecular(0.0);
   SMESH::GetColor( "SMESH", "highlight_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 255, 255 ) );
   myPreselectProp->SetColor(anRGB[0],anRGB[1],anRGB[2]);
-  myPreselectProp->SetPointSize(aPointSize);
+  //myPreselectProp->SetPointSize(aPointSize);
+  myPreselectProp->SetPointSize(std::max(aElem0DSize,aPointSize)); // ??
   myPreselectProp->SetRepresentation(1);
 
   myHighlitableActor = SMESH_DeviceActor::New();
@@ -310,6 +356,8 @@ SMESH_ActorDef::SMESH_ActorDef()
   myHighlitableActor->PickableOff();
   myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
 
+  aMatrix->Delete();
+
   myName = "";
   myIO = NULL;
 
@@ -415,6 +463,30 @@ SMESH_ActorDef::SMESH_ActorDef()
   // Clipping planes
   myImplicitBoolean = vtkImplicitBoolean::New();
   myImplicitBoolean->SetOperationTypeToIntersection();
+  
+
+
+  //Quadratic 2D elements representation
+  //-----------------------------------------------------------------------------
+  int aQuadratic2DMode = mgr->integerValue( "SMESH", "quadratic_mode", 0);
+  if(aQuadratic2DMode == 0){
+    myHighlitableActor->SetQuadraticArcMode(false);
+    my2DActor->SetQuadraticArcMode(false);
+    my1DActor->SetQuadraticArcMode(false);
+  }
+  else if(aQuadratic2DMode == 1){
+    myHighlitableActor->SetQuadraticArcMode(true);
+    my2DActor->SetQuadraticArcMode(true);
+    my1DActor->SetQuadraticArcMode(true);
+  }
+  
+  int aQuadraticAngle = mgr->integerValue( "SMESH", "max_angle", 2);
+  myHighlitableActor->SetQuadraticArcAngle(aQuadraticAngle);
+  my2DActor->SetQuadraticArcAngle(aQuadraticAngle);
+  
+  // Set color of the name actor
+  SMESH::GetColor( "SMESH", "fill_color", anRGB[0], anRGB[1], anRGB[2], QColor( 0, 170, 255 ) );
+  myNameActor->SetBackgroundColor(anRGB[0], anRGB[1], anRGB[2]);
 }
 
 
@@ -435,6 +507,12 @@ SMESH_ActorDef::~SMESH_ActorDef()
   myNodeProp->Delete();
   myNodeExtProp->Delete();
  
+  my0DProp->Delete();
+  my0DActor->Delete();
+
+  //my0DExtProp->Delete();
+  //my0DExtActor->Delete();
   my1DProp->Delete();
   my1DActor->Delete();
 
@@ -453,7 +531,7 @@ SMESH_ActorDef::~SMESH_ActorDef()
   
   myHighlitableActor->Delete();
 
-  //Deleting of pints numbering pipeline
+  //Deleting of points numbering pipeline
   //---------------------------------------
   myPointsNumDataSet->Delete();
 
@@ -500,8 +578,9 @@ SMESH_ActorDef::~SMESH_ActorDef()
 
 
 void SMESH_ActorDef::SetPointsLabeled( bool theIsPointsLabeled )
-{
+{    
   vtkUnstructuredGrid* aGrid = GetUnstructuredGrid();
+    
   myIsPointsLabeled = theIsPointsLabeled && aGrid->GetNumberOfPoints();
 
   if ( myIsPointsLabeled )
@@ -594,6 +673,7 @@ SetControlMode(eControl theMode,
   myControlMode = eNone;
   theCheckEntityMode &= mgr->booleanValue( "SMESH", "display_entity", false );
 
+  my0DActor->GetMapper()->SetScalarVisibility(false);
   my1DActor->GetMapper()->SetScalarVisibility(false);
   my2DActor->GetMapper()->SetScalarVisibility(false);
   my3DActor->GetMapper()->SetScalarVisibility(false);
@@ -779,6 +859,9 @@ void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer){
   theRenderer->AddActor(my1DActor);
   theRenderer->AddActor(my1DExtActor);
 
+  theRenderer->AddActor(my0DActor);
+  //theRenderer->AddActor(my0DExtActor);
+
   theRenderer->AddActor(myHighlitableActor);
   
   theRenderer->AddActor2D(myScalarBarActor);
@@ -800,6 +883,9 @@ void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
 
   theRenderer->RemoveActor(myHighlitableActor);
 
+  theRenderer->RemoveActor(my0DActor);
+  //theRenderer->RemoveActor(my0DExtActor);
+
   theRenderer->RemoveActor(my1DActor);
   theRenderer->RemoveActor(my1DExtActor);
 
@@ -832,6 +918,9 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
 
   myNodeExtActor->Init(myVisualObj,myImplicitBoolean);
   
+  my0DActor->Init(myVisualObj,myImplicitBoolean);
+  //my0DExtActor->Init(myVisualObj,myImplicitBoolean);
+  
   my1DActor->Init(myVisualObj,myImplicitBoolean);
   my1DExtActor->Init(myVisualObj,myImplicitBoolean);
   
@@ -839,6 +928,9 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
   my2DExtActor->Init(myVisualObj,myImplicitBoolean);
   my3DActor->Init(myVisualObj,myImplicitBoolean);
   
+  my0DActor->GetMapper()->SetLookupTable(myLookupTable);
+  //my0DExtActor->GetMapper()->SetLookupTable(myLookupTable);
+  
   my1DActor->GetMapper()->SetLookupTable(myLookupTable);
   my1DExtActor->GetMapper()->SetLookupTable(myLookupTable);
 
@@ -875,6 +967,9 @@ bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
     SetShrink();
   }
 
+  if( dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+    SetIsDisplayNameActor( true );
+
   myTimeStamp->Modified();
   Modified();
   return true;
@@ -901,6 +996,9 @@ void SMESH_ActorDef::SetTransform(VTKViewer_Transform* theTransform){
 
   myNodeExtActor->SetTransform(theTransform);
 
+  my0DActor->SetTransform(theTransform);
+  //my0DExtActor->SetTransform(theTransform);
+
   my1DActor->SetTransform(theTransform);
   my1DExtActor->SetTransform(theTransform);
 
@@ -1030,6 +1128,9 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
   
   myNodeExtActor->VisibilityOff();
 
+  my0DActor->VisibilityOff();
+  //my0DExtActor->VisibilityOff();
+
   my1DActor->VisibilityOff();
   my1DExtActor->VisibilityOff();
   
@@ -1072,6 +1173,10 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
       myNodeActor->VisibilityOn();
     }
 
+    if(myEntityMode & e0DElements){
+      my0DActor->VisibilityOn();
+    }
+
     if(myEntityMode & eEdges){
       my1DActor->VisibilityOn();
     }
@@ -1097,25 +1202,34 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
 }
 
 
-void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
+void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
+{
   myEntityState = eAllEntity;
 
-  if(!myVisualObj->GetNbEntities(SMDSAbs_Edge)){
+  if(!myVisualObj->GetNbEntities(SMDSAbs_0DElement)) {
+    myEntityState &= ~e0DElements;
+    theMode &= ~e0DElements;
+  }
+
+  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 (!theMode) {
+    if(myVisualObj->GetNbEntities(SMDSAbs_0DElement))
+      theMode |= e0DElements;
+
     if(myVisualObj->GetNbEntities(SMDSAbs_Edge))
       theMode |= eEdges;
 
@@ -1133,23 +1247,42 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
   aFilter = myBaseActor->GetExtractUnstructuredGrid();
   aFilter->ClearRegisteredCellsWithType();
   aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
-  
-  if(myEntityMode & eEdges){
+
+  VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
+  aHightFilter->ClearRegisteredCellsWithType();
+  aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+
+  if (myEntityMode & e0DElements) {
+    if (MYDEBUG) MESSAGE("0D ELEMENTS");
+    aFilter->RegisterCellsWithType(VTK_VERTEX);
+    aHightFilter->RegisterCellsWithType(VTK_VERTEX);
+  }
+
+  if (myEntityMode & eEdges) {
     if (MYDEBUG) MESSAGE("EDGES");
     aFilter->RegisterCellsWithType(VTK_LINE);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
+
+    aHightFilter->RegisterCellsWithType(VTK_LINE);
+    aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_EDGE);
   }
 
-  if(myEntityMode & eFaces){
+  if (myEntityMode & eFaces) {
     if (MYDEBUG) MESSAGE("FACES");
     aFilter->RegisterCellsWithType(VTK_TRIANGLE);
     aFilter->RegisterCellsWithType(VTK_POLYGON);
     aFilter->RegisterCellsWithType(VTK_QUAD);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+
+    aHightFilter->RegisterCellsWithType(VTK_TRIANGLE);
+    aHightFilter->RegisterCellsWithType(VTK_POLYGON);
+    aHightFilter->RegisterCellsWithType(VTK_QUAD);
+    aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
+    aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
   }
 
-  if(myEntityMode & eVolumes){
+  if (myEntityMode & eVolumes) {
     if (MYDEBUG) MESSAGE("VOLUMES");
     aFilter->RegisterCellsWithType(VTK_TETRA);
     aFilter->RegisterCellsWithType(VTK_VOXEL);
@@ -1160,43 +1293,55 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
     aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
+    
+    aHightFilter->RegisterCellsWithType(VTK_TETRA);
+    aHightFilter->RegisterCellsWithType(VTK_VOXEL);
+    aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
+    aHightFilter->RegisterCellsWithType(VTK_WEDGE);
+    aHightFilter->RegisterCellsWithType(VTK_PYRAMID);
+    aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
+    aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+    aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
+    aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
   }
   aFilter->Update();
   if (MYDEBUG) MESSAGE(aFilter->GetOutput()->GetNumberOfCells());
   SetVisibility(GetVisibility(),false);
 }
 
-void SMESH_ActorDef::SetRepresentation(int theMode){ 
+void SMESH_ActorDef::SetRepresentation (int theMode)
+{ 
   int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge);
   int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face);
   int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume);
-  if(theMode < 0){
+
+  if (theMode < 0) {
     myRepresentation = eSurface;
-    if(!aNbFaces && !aNbVolumes && aNbEdges){
+    if (!aNbFaces && !aNbVolumes && aNbEdges) {
       myRepresentation = eEdge;
-    }else if(!aNbFaces && !aNbVolumes && !aNbEdges){
+    } else if (!aNbFaces && !aNbVolumes && !aNbEdges) {
       myRepresentation = ePoint;
     }
-  }else{
-    switch(theMode){
+  } else {
+    switch (theMode) {
     case eEdge:
-      if(!aNbFaces && !aNbVolumes && !aNbEdges) return;
+      if (!aNbFaces && !aNbVolumes && !aNbEdges) return;
       break;
     case eSurface:
-      if(!aNbFaces && !aNbVolumes) return;
+      if (!aNbFaces && !aNbVolumes) return;
       break;
     }    
     myRepresentation = theMode;
   }
 
-  if(!GetUnstructuredGrid()->GetNumberOfCells())
+  if (!GetUnstructuredGrid()->GetNumberOfCells())
     myRepresentation = ePoint;
 
-  if(myIsShrunk){
-    if(myRepresentation == ePoint){
+  if (myIsShrunk) {
+    if (myRepresentation == ePoint) {
       UnShrink();
       myIsShrunk = true;
-    }else{
+    } else {
       SetShrink();
     }      
   }
@@ -1206,11 +1351,12 @@ void SMESH_ActorDef::SetRepresentation(int theMode){
   myNodeExtActor->SetVisibility(false);
   vtkProperty *aProp = NULL, *aBackProp = NULL;
   SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::EReperesent(-1);
-  switch(myRepresentation){
+  SMESH_Actor::EQuadratic2DRepresentation aQuadraticMode = GetQuadratic2DRepresentation();
+  switch (myRepresentation) {
   case ePoint:
     myPickableActor = myNodeActor;
     myNodeActor->SetVisibility(true);
-    
+    aQuadraticMode = SMESH_Actor::eLines;
     aProp = aBackProp = myNodeProp;
     aReperesent = SMESH_DeviceActor::ePoint;
     break;
@@ -1223,21 +1369,33 @@ void SMESH_ActorDef::SetRepresentation(int theMode){
     aBackProp = myBackSurfaceProp;
     aReperesent = SMESH_DeviceActor::eSurface;
     break;
-  }    
+  }
 
   my2DActor->SetProperty(aProp);
   my2DActor->SetBackfaceProperty(aBackProp);
   my2DActor->SetRepresentation(aReperesent);
 
+  if(aQuadraticMode == SMESH_Actor::eLines)
+    my2DActor->SetQuadraticArcMode(false);
+  else if(aQuadraticMode == SMESH_Actor::eArcs)
+    my2DActor->SetQuadraticArcMode(true);
+
   my2DExtActor->SetRepresentation(aReperesent);
   
   my3DActor->SetProperty(aProp);
   my3DActor->SetBackfaceProperty(aBackProp);
   my3DActor->SetRepresentation(aReperesent);
 
+  //my0DExtActor->SetVisibility(false);
   my1DExtActor->SetVisibility(false);
   my2DExtActor->SetVisibility(false);
 
+  // ???
+  //my0DActor->SetProperty(aProp);
+  //my0DActor->SetBackfaceProperty(aBackProp);
+  my0DActor->SetRepresentation(aReperesent);
+  //my0DExtActor->SetRepresentation(aReperesent);
+
   switch(myControlMode){
   case eLength:
   case eMultiConnection:
@@ -1247,12 +1405,17 @@ void SMESH_ActorDef::SetRepresentation(int theMode){
     break;
   }
   
+  if(aQuadraticMode == SMESH_Actor::eLines)
+    my1DActor->SetQuadraticArcMode(false);
+  else if(aQuadraticMode == SMESH_Actor::eArcs)
+    my1DActor->SetQuadraticArcMode(true);
+
   my1DActor->SetProperty(aProp);
   my1DActor->SetBackfaceProperty(aBackProp);
   my1DActor->SetRepresentation(aReperesent);
 
   my1DExtActor->SetRepresentation(aReperesent);
-  
+
   if(myIsPointsVisible)
     myPickableActor = myNodeActor;
   if(GetPointRepresentation())
@@ -1416,6 +1579,10 @@ vtkFloatingPointType SMESH_ActorDef::GetOpacity(){
 
 void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
   mySurfaceProp->SetColor(r,g,b);
+  if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+    if( aGroupObj->GetElementType() == SMDSAbs_Face ||
+       aGroupObj->GetElementType() == SMDSAbs_Volume )
+      myNameActor->SetBackgroundColor(r,g,b);
   Modified();
 }
 
@@ -1437,6 +1604,9 @@ void SMESH_ActorDef::SetEdgeColor(vtkFloatingPointType r,vtkFloatingPointType g,
   myEdgeProp->SetColor(r,g,b);
   my1DProp->SetColor(r,g,b);
   my1DExtProp->SetColor(1.0-r,1.0-g,1.0-b);
+  if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+    if( aGroupObj->GetElementType() == SMDSAbs_Edge )
+      myNameActor->SetBackgroundColor(r,g,b);
   Modified();
 }
 
@@ -1447,6 +1617,9 @@ void SMESH_ActorDef::GetEdgeColor(vtkFloatingPointType& r,vtkFloatingPointType&
 void SMESH_ActorDef::SetNodeColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){ 
   myNodeProp->SetColor(r,g,b);
   myNodeExtProp->SetColor(1.0-r,1.0-g,1.0-b);
+  if( SMESH_GroupObj* aGroupObj = dynamic_cast<SMESH_GroupObj*>( myVisualObj.get() ) )
+    if( aGroupObj->GetElementType() == SMDSAbs_Node )
+      myNameActor->SetBackgroundColor(r,g,b);
   Modified();
 }
 
@@ -1491,8 +1664,12 @@ void SMESH_ActorDef::SetLineWidth(vtkFloatingPointType theVal){
 void SMESH_ActorDef::SetNodeSize(vtkFloatingPointType theVal){
   myNodeProp->SetPointSize(theVal);
   myNodeExtProp->SetPointSize(theVal);
-  myHighlightProp->SetPointSize(theVal);
-  myPreselectProp->SetPointSize(theVal);
+
+  vtkFloatingPointType aPointSize = my0DProp->GetPointSize() > theVal ? my0DProp->GetPointSize() : theVal;
+  //myHighlightProp->SetPointSize(theVal);
+  myHighlightProp->SetPointSize(aPointSize); // ??
+  //myPreselectProp->SetPointSize(theVal);
+  myPreselectProp->SetPointSize(aPointSize); // ??
 
   my1DProp->SetPointSize(theVal + aPointSizeInc);
   my1DExtProp->SetPointSize(theVal + aPointSizeInc);
@@ -1517,27 +1694,28 @@ IsImplicitFunctionUsed() const
 }
 
 void
-SMESH_ActorDef::
-SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
+SMESH_ActorDef::SetImplicitFunctionUsed(bool theIsImplicitFunctionUsed)
 {
   myNodeActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
   myBaseActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
-  
+
   myHighlitableActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
 
   myNodeExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
-  
+
+  my0DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
+  //my0DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
+
   my1DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
   my1DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
-  
+
   my2DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
   my2DExtActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
   my3DActor->SetImplicitFunctionUsed(theIsImplicitFunctionUsed);
 }
 
 vtkIdType 
-SMESH_ActorDef::
-AddClippingPlane(vtkPlane* thePlane)
+SMESH_ActorDef::AddClippingPlane(vtkPlane* thePlane)
 {
   if(thePlane){
     myImplicitBoolean->GetFunction()->AddItem(thePlane);
@@ -1775,3 +1953,32 @@ void SMESH_ActorDef::UpdateScalarBar()
   myScalarBarActor->SetMaximumNumberOfColors( anIntVal == 0 ? 64 : anIntVal );
   
 }
+
+void SMESH_ActorDef::SetQuadratic2DRepresentation(EQuadratic2DRepresentation theMode)
+{
+  switch(theMode) {
+  case SMESH_Actor::eLines :
+    myHighlitableActor->SetQuadraticArcMode(false);
+    my2DActor->SetQuadraticArcMode(false);
+    my1DActor->SetQuadraticArcMode(false);
+    break;
+  case SMESH_Actor::eArcs :
+    myHighlitableActor->SetQuadraticArcMode(true);
+    if(GetRepresentation() != SMESH_Actor::ePoint) {
+      my2DActor->SetQuadraticArcMode(true);
+      my1DActor->SetQuadraticArcMode(true);
+    }
+    break;
+  default:
+    break;
+  }
+}
+
+
+SMESH_Actor::EQuadratic2DRepresentation SMESH_ActorDef::GetQuadratic2DRepresentation()
+{
+  if(myHighlitableActor->GetQuadraticArcMode())
+    return SMESH_Actor::eArcs;
+  else
+    return SMESH_Actor::eLines;
+}