Salome HOME
PR: SMDS refactoring in progress
[modules/smesh.git] / src / SMDS / SMDS_VtkCellIterator.cxx
index 497f649aa78de01fb3104ca0f217c8eb4fbb8155..8d6fe266ff64c242dea9026478bb483b465e7f34 100644 (file)
@@ -12,37 +12,60 @@ SMDS_VtkCellIterator::SMDS_VtkCellIterator(SMDS_Mesh* mesh, int vtkCellId, SMDSA
   {
     case SMDSEntity_Tetra:
     {
-      tempid = _vtkIdList->GetId(1);
-      _vtkIdList->SetId(1, _vtkIdList->GetId(2));
-      _vtkIdList->SetId(2, tempid);
+      this->exchange(1, 2);
       break;
     }
     case SMDSEntity_Pyramid:
     {
-      tempid = _vtkIdList->GetId(1);
-      _vtkIdList->SetId(1, _vtkIdList->GetId(3));
-      _vtkIdList->SetId(3, tempid);
+      this->exchange(1, 3);
       break;
     }
     case SMDSEntity_Penta:
     {
-      tempid = _vtkIdList->GetId(1);
-      _vtkIdList->SetId(1, _vtkIdList->GetId(2));
-      _vtkIdList->SetId(2, tempid);
-      tempid = _vtkIdList->GetId(4);
-      _vtkIdList->SetId(4, _vtkIdList->GetId(5));
-      _vtkIdList->SetId(5, tempid);
-     break;
+      this->exchange(1, 2);
+      this->exchange(4, 5);
+      break;
     }
     case SMDSEntity_Hexa:
     {
-      tempid = _vtkIdList->GetId(1);
-      _vtkIdList->SetId(1, _vtkIdList->GetId(3));
-      _vtkIdList->SetId(3, tempid);
-      tempid = _vtkIdList->GetId(5);
-      _vtkIdList->SetId(5, _vtkIdList->GetId(7));
-      _vtkIdList->SetId(7, tempid);
-     break;
+      this->exchange(1, 3);
+      this->exchange(5, 7);
+      break;
+    }
+    case SMDSEntity_Quad_Tetra:
+    {
+      this->exchange(1, 2);
+      this->exchange(4, 6);
+      this->exchange(8, 9);
+      break;
+    }
+    case SMDSEntity_Quad_Pyramid:
+    {
+      this->exchange(1, 3);
+      this->exchange(5, 8);
+      this->exchange(6, 7);
+      this->exchange(10, 12);
+      break;
+    }
+    case SMDSEntity_Quad_Penta:
+    {
+      this->exchange(1, 2);
+      this->exchange(4, 5);
+      this->exchange(6, 8);
+      this->exchange(9, 11);
+      this->exchange(13, 14);
+      break;
+    }
+    case SMDSEntity_Quad_Hexa:
+    {
+      this->exchange(1, 3);
+      this->exchange(5, 7);
+      this->exchange(8, 11);
+      this->exchange(9, 10);
+      this->exchange(12, 15);
+      this->exchange(13, 14);
+      this->exchange(17, 19);
+      break;
     }
     default:
       break;