Salome HOME
0020082: EDF 869 GEOM : Edges Orientation indicator/reverse
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index 9291df37ccd4e5d21f0cfd93bd3d72eaef36d7a5..36a44924d6c4b9c74803f3aae8a2099197da8db6 100644 (file)
@@ -1163,11 +1163,19 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
   aFilter = myBaseActor->GetExtractUnstructuredGrid();
   aFilter->ClearRegisteredCellsWithType();
   aFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+
+  VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
+  aHightFilter->ClearRegisteredCellsWithType();
+  aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+
   
   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){
@@ -1177,6 +1185,12 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode){
     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){
@@ -1190,6 +1204,16 @@ 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());
@@ -1458,7 +1482,10 @@ vtkFloatingPointType SMESH_ActorDef::GetOpacity(){
 
 void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b){
   mySurfaceProp->SetColor(r,g,b);
-  myNameActor->SetBackgroundColor(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();
 }
 
@@ -1480,6 +1507,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();
 }
 
@@ -1490,6 +1520,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();
 }