]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Elno visualization development.
authorrnv <rnv@opencascade.com>
Thu, 8 May 2008 06:17:05 +0000 (06:17 +0000)
committerrnv <rnv@opencascade.com>
Thu, 8 May 2008 06:17:05 +0000 (06:17 +0000)
src/CONVERTOR/VISU_MeshValue.cxx
src/CONVERTOR/VISU_MeshValue.hxx

index 0ed645651a08ab8327f562d2da9675eeb3cdb90d..51b4a72d78d4f6bc779ce577c1856006dac07d5e 100644 (file)
@@ -378,12 +378,13 @@ namespace VISU
                "; aNbElem = "<<aNbElem<<
                "; aNbGauss = "<<aNbGauss<<
                std::endl);
-
+        std::vector<int> med2visu(aNbGauss);
+        InitMed2VisuArray(med2visu,aEGeom);
        for ( vtkIdType iElem = 0; iElem < aNbElem; iElem++ ) {
           const typename TMeshValue::TValueSliceArr& aValueSliceArr = aMeshValue->GetGaussValueSliceArr( iElem );          
 
           for( vtkIdType iGauss = 0; iGauss < aNbGauss; iGauss++ ) {
-            const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[ iGauss ];
+            const typename TMeshValue::TCValueSlice& aValueSlice = aValueSliceArr[ med2visu[iGauss] ];
 
             for( vtkIdType iComp = 0; iComp < aNbComp; iComp++ ) {
               aDataValues[ iComp ] = aValueSlice[ iComp ];
@@ -596,4 +597,96 @@ namespace VISU
 
   
   //----------------------------------------------------------------------------
+
+  void InitMed2VisuArray(std::vector<int>& anArray, EGeometry aEGeom){
+    switch(aEGeom){
+#if !(defined(VTK_QUADRATIC_EDGE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eSEG3:
+      anArray[0] = 0;
+      anArray[2] = 1;  
+      anArray[1] = 2;
+      break;
+#endif
+
+#if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eTRIA6:
+      anArray[0] = 0;
+      anArray[2] = 1;  
+      anArray[4] = 2;  
+      
+      anArray[1] = 3;
+      anArray[3] = 4;  
+      anArray[5] = 5;
+      break;
+#endif
+
+#if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eQUAD8:
+      anArray[0] = 0;
+      anArray[2] = 1;  
+      anArray[4] = 2;  
+      anArray[6] = 3;  
+      
+      anArray[1] = 4;
+      anArray[3] = 5;  
+      anArray[5] = 6;  
+      anArray[7] = 7;
+      break;
+#endif
+    case eTETRA4:
+      anArray[0] = 0;
+      anArray[1] = 2;
+      anArray[2] = 1;  
+      anArray[3] = 3;
+      break;
+    case ePYRA5:
+      anArray[0] = 0;
+      anArray[1] = 3;  
+      anArray[2] = 2;
+      anArray[3] = 1;  
+      anArray[4] = 4;
+      break;
+#if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eTETRA10:
+      anArray[0] = 0;
+      anArray[1] = 2;
+      anArray[2] = 1;  
+      anArray[3] = 3;  
+      
+      anArray[4] = 6;
+      anArray[5] = 5;
+      anArray[6] = 4;  
+      
+      anArray[7] = 7;  
+      anArray[8] = 9;  
+      anArray[9] = 8;
+      break;
+#endif
+
+#if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case ePYRA13:
+      anArray[0] = 0;
+      anArray[1] = 3;
+      anArray[2] = 2;  
+      anArray[3] = 1;  
+      anArray[4] = 4;
+      
+      anArray[5] = 5;
+      anArray[6] = 8;  
+      anArray[7] = 7;  
+      anArray[8] = 6;  
+      
+      anArray[9] = 9;  
+      anArray[10] = 12;  
+      anArray[11] = 11;  
+      anArray[12] = 10;  
+      break;
+#endif
+    default:
+      for(int i=0;i<anArray.size();i++){
+        anArray[i] = i;
+      }
+      break;
+    }
+  }
 }
index f09fb783e36975d0effc28d7de7b717e4a0bd66a..220f53706667bb3b41bd1202b593a423d65d0be1 100644 (file)
@@ -212,6 +212,9 @@ namespace VISU
                          const PFieldImpl& theField, 
                          const PValForTimeImpl& theValForTime);
 
+  void 
+  InitMed2VisuArray(std::vector<int>& anArray, EGeometry aEGeom);
+
 
   //---------------------------------------------------------------
 }