Salome HOME
0021338: EDF 1926 SMESH: New controls and filters
[modules/smesh.git] / src / OBJECT / SMESH_Actor.cxx
index 28cd31fc00e2f30fe85733dbccacce3a69241c3b..b0af3e9e33bf2847772442e45aec7a6970213a03 100644 (file)
@@ -172,6 +172,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_QUAD);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+  aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
 
   my2DExtProp = vtkProperty::New();
   my2DExtProp->DeepCopy(mySurfaceProp);
@@ -193,6 +194,7 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_QUAD);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+  aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
 
   my3DActor = SMESH_CellLabelActor::New();
   my3DActor->SetStoreGemetryMapping(true);
@@ -208,8 +210,10 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
   aFilter->RegisterCellsWithType(VTK_WEDGE);
   aFilter->RegisterCellsWithType(VTK_PYRAMID);
+  aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+  aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
   aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
@@ -231,8 +235,10 @@ SMESH_ActorDef::SMESH_ActorDef()
   aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
   aFilter->RegisterCellsWithType(VTK_WEDGE);
   aFilter->RegisterCellsWithType(VTK_PYRAMID);
+  aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+  aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
   aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
   aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
@@ -685,6 +691,27 @@ SetControlMode(eControl theMode,
       myFunctor.reset(new SMESH::Controls::FreeFaces());
       myControlActor = my2DActor;
       break;
+    case eCoincidentNodes:
+      {
+        SMESH::Controls::CoincidentNodes* cn = new SMESH::Controls::CoincidentNodes();
+        double tol = mgr->doubleValue( "SMESH", "equal_nodes_tolerance", 1e-7 );
+        cn->SetTolerance( tol );
+        myFunctor.reset(cn);
+        myControlActor = myNodeActor;
+        break;
+      }
+    case eCoincidentElems1D:
+      myFunctor.reset(new SMESH::Controls::CoincidentElements1D());
+      myControlActor = my1DActor;
+      break;
+    case eCoincidentElems2D:
+      myFunctor.reset(new SMESH::Controls::CoincidentElements2D());
+      myControlActor = my2DActor;
+      break;
+    case eCoincidentElems3D:
+      myFunctor.reset(new SMESH::Controls::CoincidentElements3D());
+      myControlActor = my3DActor;
+      break;
     case eBareBorderFace:
       myFunctor.reset(new SMESH::Controls::BareBorderFace());
       myControlActor = my2DActor;
@@ -803,19 +830,23 @@ SetControlMode(eControl theMode,
       myControlMode = theMode;
       switch(myControlMode){
       case eFreeNodes:
+      case eCoincidentNodes:
         myNodeExtActor->SetExtControlMode(myFunctor);
         break;
       case eFreeEdges:
       case eFreeBorders:
+      case eCoincidentElems1D:
         my1DExtActor->SetExtControlMode(myFunctor);
         break;
       case eFreeFaces:
       case eBareBorderFace:
       case eOverConstrainedFace:
+      case eCoincidentElems2D:
         my2DExtActor->SetExtControlMode(myFunctor);
         break;
       case eBareBorderVolume:
       case eOverConstrainedVolume:
+      case eCoincidentElems3D:
         my3DExtActor->SetExtControlMode(myFunctor);
         break;
       case eLength2D:
@@ -846,21 +877,21 @@ SetControlMode(eControl theMode,
           if (!myIsEntityModeCache){
             myEntityModeCache = GetEntityMode();
             myIsEntityModeCache=true;
-         } 
+          
           SetEntityMode(eFaces);
           break;
         default:
           if (!myIsEntityModeCache){
             myEntityModeCache = GetEntityMode();
             myIsEntityModeCache=true;
-         }
+          }
           SetEntityMode(eFaces);
         }
       }else if(myControlActor == my3DActor) {
         if (!myIsEntityModeCache){
             myEntityModeCache = GetEntityMode();
             myIsEntityModeCache=true;
-       } 
+        
         SetEntityMode(eVolumes);
     }
     }
@@ -1193,24 +1224,27 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
     if(myControlMode != eNone){
       switch(myControlMode){
       case eFreeNodes:
+      case eCoincidentNodes:
         myNodeExtActor->VisibilityOn();
         break;
       case eFreeEdges:
       case eFreeBorders:
+      case eCoincidentElems1D:
+      case eLength2D:
+      case eMultiConnection2D:
         my1DExtActor->VisibilityOn();
         break;
       case eFreeFaces:
       case eBareBorderFace:
       case eOverConstrainedFace:
+      case eCoincidentElems2D:
         my2DExtActor->VisibilityOn();
         break;
       case eBareBorderVolume:
       case eOverConstrainedVolume:
+      case eCoincidentElems3D:
         my3DExtActor->VisibilityOn();
         break;
-      case eLength2D:
-      case eMultiConnection2D:
-        my1DExtActor->VisibilityOn();
       default:
         if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
           myScalarBarActor->VisibilityOn();
@@ -1336,12 +1370,14 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
     aFilter->RegisterCellsWithType(VTK_QUAD);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+    aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
 
     aHightFilter->RegisterCellsWithType(VTK_TRIANGLE);
     aHightFilter->RegisterCellsWithType(VTK_POLYGON);
     aHightFilter->RegisterCellsWithType(VTK_QUAD);
     aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TRIANGLE);
     aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_QUAD);
+    aHightFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUAD);
   }
 
   if (myEntityMode & eVolumes) {
@@ -1351,8 +1387,10 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
     aFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
     aFilter->RegisterCellsWithType(VTK_WEDGE);
     aFilter->RegisterCellsWithType(VTK_PYRAMID);
+    aFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+    aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
     aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
     aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
 //#ifdef VTK_HAVE_POLYHEDRON
@@ -1364,8 +1402,10 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
     aHightFilter->RegisterCellsWithType(VTK_HEXAHEDRON);
     aHightFilter->RegisterCellsWithType(VTK_WEDGE);
     aHightFilter->RegisterCellsWithType(VTK_PYRAMID);
+    aHightFilter->RegisterCellsWithType(VTK_HEXAGONAL_PRISM);
     aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_TETRA);
     aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
+    aHightFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
     aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
     aHightFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
     aHightFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);