Salome HOME
Implementation of the
[modules/visu.git] / src / CONVERTOR / VISU_MeshValue.cxx
index bf1038150859eacdaaa853e97018ac1f9c29650d..851aaa7fdb043dc8b2174d1c865f65610dc2553c 100644 (file)
@@ -1,29 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  VISU OBJECT : interactive object for VISU entities implementation
 //  File:
 //  Author:
 //  Module : VISU
-
+//
 #include "VISU_MeshValue.hxx"
 #include "VISU_ElnoMeshValue.hxx"
 #include "VISU_Structures_impl.hxx"
@@ -342,13 +343,13 @@ namespace VISU
             }
           }
 
-          TVTKBasicType aModule = (TVTKBasicType)sqrt(aModules[0]);
+          TVTKBasicType aModule = (TVTKBasicType)sqrt((double)aModules[0]);
           aDataValues[0] = aModule; // init Min
           aDataValues[1] = aModule; // init Max
           aDataValues[2] = aModule; // init Average
 
           for (vtkIdType ig = 0; ig < aNbGauss; ig++) {
-            aModule = (TVTKBasicType)sqrt(aModules[ig]);
+            aModule = (TVTKBasicType)sqrt((double)aModules[ig]);
 
             aDataValues[0] = std::min(TVTKBasicType(aModule), aDataValues[0]); // Min
             aDataValues[1] = std::max(TVTKBasicType(aModule), aDataValues[1]); // Max
@@ -740,7 +741,7 @@ 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)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
     case eSEG3:
       anArray[0] = 0;
       anArray[2] = 1;
@@ -748,7 +749,7 @@ namespace VISU
       break;
 #endif
 
-#if !(defined(VTK_QUADRATIC_TRIANGLE) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
     case eTRIA6:
       anArray[0] = 0;
       anArray[2] = 1;
@@ -760,7 +761,7 @@ namespace VISU
       break;
 #endif
 
-#if !(defined(VTK_QUADRATIC_QUAD) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
     case eQUAD8:
       anArray[0] = 0;
       anArray[2] = 1;
@@ -772,6 +773,20 @@ namespace VISU
       anArray[5] = 6;
       anArray[7] = 7;
       break;
+#endif
+#if !(defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+    case eQUAD9:
+      anArray[0] = 0;
+      anArray[2] = 1;
+      anArray[4] = 2;
+      anArray[6] = 3;
+
+      anArray[1] = 4;
+      anArray[3] = 5;
+      anArray[5] = 6;
+      anArray[7] = 7;
+         anArray[8] = 8;
+      break;
 #endif
     case eTETRA4:
       anArray[0] = 0;
@@ -786,7 +801,7 @@ namespace VISU
       anArray[3] = 1;
       anArray[4] = 4;
       break;
-#if (defined(VTK_QUADRATIC_TETRA) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
     case eTETRA10:
       anArray[0] = 0;
       anArray[1] = 2;
@@ -803,7 +818,7 @@ namespace VISU
       break;
 #endif
 
-#if (defined(VTK_QUADRATIC_PYRAMID) && defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
     case ePYRA13:
       anArray[0] = 0;
       anArray[1] = 3;
@@ -821,6 +836,43 @@ namespace VISU
       anArray[11] = 11;
       anArray[12] = 10;
       break;
+#endif
+#if (defined(VISU_USE_VTK_QUADRATIC)) && defined(VISU_ENABLE_QUADRATIC)
+       case eHEXA27:
+      anArray[0] = 0;
+      anArray[1] = 3;
+      anArray[2] = 2; 
+      anArray[3] = 1; 
+
+      anArray[4] = 4;
+      anArray[5] = 7;
+      anArray[6] = 6;
+      anArray[7] = 5;
+
+         anArray[8] = 11;
+         anArray[9] = 10;
+      anArray[10] = 9;
+         anArray[11] = 8;
+
+         anArray[12] = 15;
+         anArray[13] = 14;
+      anArray[14] = 13;
+         anArray[15] = 12;
+
+         anArray[16] = 16;
+         anArray[17] = 19;
+      anArray[18] = 18;
+         anArray[19] = 17;
+
+         anArray[20] = 21;
+         anArray[21] = 23;
+      anArray[22] = 24;
+         anArray[23] = 22;
+
+         anArray[24] = 20;
+         anArray[25] = 25;
+      anArray[26] = 26;
+      break;
 #endif
     default:
       for(int i=0;i<anArray.size();i++){