]> SALOME platform Git repositories - modules/paravis.git/commitdiff
Salome HOME
Merge from V6_main 13/12/2012 BR_KERNEL_REFACTORING V7_1_0_pre
authorvsr <vsr@opencascade.com>
Thu, 13 Dec 2012 13:08:32 +0000 (13:08 +0000)
committervsr <vsr@opencascade.com>
Thu, 13 Dec 2012 13:08:32 +0000 (13:08 +0000)
15 files changed:
CMakeLists.txt
src/ENGINE/PARAVIS_Engine_i.cc
src/ENGINE/PARAVIS_Engine_i.hh
src/Macro/modes.py
src/PVGUI/PARAVIS_Gen_i.cc
src/PVGUI/PARAVIS_Gen_i.hh
src/PVGUI/PVGUI_Module.cxx
src/Plugins/ElevationSurface/ElevationSurface.xml
src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.cxx
src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h
src/Plugins/MedReader/CMake/FindMED.cmake
src/Plugins/MedReader/IO/vtkMedLocalization.cxx
src/Plugins/MedReader/IO/vtkMedReader.cxx
src/Plugins/MedReader/IO/vtkMedUtilities.cxx
wrapfiles.cmake

index b1810a05e79a42b0ca727380221aa2fac0bc1ff2..61f77467328e4390308a3cb4dc2241e6a24d2697 100644 (file)
@@ -75,7 +75,7 @@ ENDIF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake)
 SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR} CACHE PATH "MED_ROOT_DIR")
 INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake)
 
-EXECUTE_PROCESS(COMMAND pvpython ${CMAKE_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIRS})
+EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIRS})
 
 SET(SUBDIRS
   idl
index 8bb302df443f1a15420e53d4a9ee32e896f8df01..d41de106c8c150d0f0e5a44e84937ea115957acc 100644 (file)
@@ -294,4 +294,8 @@ namespace PARAVIS {
   SALOMEDS::Study_ptr PARAVIS_Gen_i::GetCurrentStudy(){
     return myParaVisGen->GetCurrentStudy();
   }
+  char* PARAVIS_Gen_i::getVersion()
+  {
+    return myParaVisGen->getVersion();
+  }
 }
index 6ea77ba3f251e7b31f9f1f8a3a970052204d9be7..2c86a5244e9f1ffd639280ae6bf536a0ff0cce53 100644 (file)
@@ -116,6 +116,8 @@ namespace PARAVIS
 
     virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy);
     virtual SALOMEDS::Study_ptr GetCurrentStudy();
+
+    virtual char* getVersion();
   };
 };
 #endif
index db4b623bb10c7fa67313c602bf51ef20d259783f..30dc8dc7675d04316709e6fb72fc9105254c4f44 100644 (file)
@@ -21,11 +21,16 @@ try: paraview.simple
 except: from paraview.simple import *
 paraview.simple._DisableFirstRenderCameraReset()
 
+import sys
+
 source = GetActiveSource()
 representation = GetDisplayProperties(source)
 representation.Visibility = 0
 
+oldmode = None
+
 if source.SMProxy.GetVTKClassName() == 'vtkMedReader' :
+  oldmode = source.AnimationMode
   source.AnimationMode = 'Modes'
 
 ExtractSurface1 = ExtractSurface()
@@ -52,6 +57,10 @@ for arrayid in range(0, pinfo.GetNumberOfArrays()) :
     WarpByVector1.Vectors = ['POINTS', rootname]
     break
 
+if vectorname == None :
+  source.AnimationMode = oldmode
+  sys.exit(0)
+
 ScaleVector1.ScaleFactor = 0
 ScaleVector1.UpdatePipeline()
 bounds = info.DataInformation.GetBounds()
index e31a4f5202d68b144cbcb22d4269c1ea29d15d28..c156d1f6e1175bac88edec9e683852516311aefa 100644 (file)
@@ -23,6 +23,7 @@
 
 
 #include "PARAVIS_Gen_i.hh"
+#include "PARAVIS_version.h"
 
 // IDL Headers
 #include <omnithread.h>
@@ -725,4 +726,13 @@ namespace PARAVIS
     return SALOMEDS::Study::_duplicate(myStudyDocument);
   }
 
+  // Version information
+  char* PARAVIS_Gen_i::getVersion()
+  {
+#if PARAVIS_DEVELOPMENT
+    return CORBA::string_dup( PARAVIS_VERSION_STR"dev" );
+#else
+    return CORBA::string_dup( PARAVIS_VERSION_STR );
+#endif
+  }
 }
index 11b2fc9914acd640955272c9f768fd6429280a74..8f30eeaaf14ad7b9b4b6c4bf3d1be914b122b547 100644 (file)
@@ -179,6 +179,9 @@ namespace PARAVIS
     virtual SALOMEDS::SObject_ptr PasteInto(const SALOMEDS::TMPFile& theStream,
                                             CORBA::Long theObjectID, SALOMEDS::SObject_ptr theObject);
 
+    //! inherited methods from Engines::EngineComponent. Returns module version.
+    virtual char* getVersion();
+
     //! Implementation of PARAVIS_Gen interface
     virtual PARAVIS::string_array* GetClassesList();
 
index f4d072bc8f568e145d4cf634fa1bb6d1f74b70e0..9c2853919157d86568350d105f189af1493db55a 100644 (file)
@@ -52,6 +52,7 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SUIT_OverrideCursor.h>
+#include <SUIT_ExceptionHandler.h>
 
 // SALOME Includes
 #include "SALOME_LifeCycleCORBA.hxx"
 #include <pqPipelineSource.h>
 #include <pqActiveObjects.h>
 #include <vtkProcessModule.h>
+#include <vtkSMSession.h>
+#include <vtkPVProgressHandler.h>
 #include <pqParaViewBehaviors.h>
 #include <pqHelpReaction.h>
 #include <vtkOutputWindow.h>
@@ -306,6 +309,18 @@ void vtkEDFHelperInit() {
     return aSComponent;
   }
 
+/*!
+  Clean up function; used to stop ParaView progress events when
+  exception is caught by global exception handler.
+*/
+void paravisCleanUp()
+{
+  if ( pqApplicationCore::instance() ) {
+    pqServer* s = pqApplicationCore::instance()->getActiveServer();
+    if ( s ) s->session()->GetProgressHandler()->CleanupPendingProgress();
+  }
+}
+
 /*!
   \brief Constructor. Sets the default name for the module.
 */
@@ -786,6 +801,8 @@ static void ParavisMessageOutput(QtMsgType type, const char *msg)
 bool PVGUI_Module::activateModule( SUIT_Study* study )
 {
   myOldMsgHandler = qInstallMsgHandler(ParavisMessageOutput);
+  
+  SUIT_ExceptionHandler::addCleanUpRoutine( paravisCleanUp );
 
   bool isDone = SalomeApp_Module::activateModule( study );
   if ( !isDone ) return false;
@@ -858,6 +875,8 @@ bool PVGUI_Module::deactivateModule( SUIT_Study* study )
 
   saveDockWidgetsState();
 
+  SUIT_ExceptionHandler::removeCleanUpRoutine( paravisCleanUp );
+
   if (myOldMsgHandler)
     qInstallMsgHandler(myOldMsgHandler);
 
index 2bfe615d28a5e090c1ab706fcf6ec5b65d157dab..37ed844247931f367c218a5d8eaa10af1e5920ca 100644 (file)
@@ -30,7 +30,7 @@
         <DataTypeDomain
           name="input_type">
           <DataType
-            value="vtkPointSet" />
+            value="vtkPolyData" />
         </DataTypeDomain>
         <InputArrayDomain
           name="input_array"
index 160b1909fe14327e0fa8ddca2cc11fe15d9810da..664bd75b721dc96cea6522daa891992e3569a36e 100644 (file)
@@ -34,7 +34,6 @@
 #include "vtkCellArray.h"
 #include "vtkPointData.h"
 #include "vtkCellData.h"
-//#include "vtkDataSetSurfaceFilter.h"
 
 #include <math.h>
 
@@ -95,7 +94,7 @@ int vtkElevationSurfaceFilter::FillOutputPortInformation(
 int vtkElevationSurfaceFilter::FillInputPortInformation(
   int vtkNotUsed(port), vtkInformation* info)
 {
-  info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet");
+  info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
   return 1;
 }
 
@@ -127,22 +126,15 @@ int vtkElevationSurfaceFilter::RequestInformation(vtkInformation *request,
 int vtkElevationSurfaceFilter::RequestData(vtkInformation *request,
     vtkInformationVector **input, vtkInformationVector *output)
 {
-       vtkPointSet *psIn = vtkPointSet::SafeDownCast(
+  vtkPolyData *pdIn = vtkPolyData::SafeDownCast(
       input[0]->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT()));
 
-  //vtkPolyData *psIn = vtkPolyData::SafeDownCast(
-  //    input[0]->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT()));
-
-  /*vtkSmartPointer<vtkDataSetSurfaceFilter> surfaceFilter = vtkSmartPointer<vtkDataSetSurfaceFilter>::New();
-  surfaceFilter->SetInput(psIn);
-  vtkPolyData* psIn = vtkPolyData::SafeDownCast(surfaceFilter->GetOutput());*/
-
   vtkUnstructuredGrid *usgOut = vtkUnstructuredGrid::SafeDownCast(
       output->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT()));
 
   vtkDataArray* array = this->GetInputArrayToProcess(0, input);
 
-  if(psIn == NULL || array == NULL || usgOut == NULL
+  if(pdIn == NULL || array == NULL || usgOut == NULL
      || array->GetNumberOfComponents() != 1)
     {
     vtkDebugMacro("vtkElevationSurfaceFilter no correctly configured");
@@ -152,7 +144,7 @@ int vtkElevationSurfaceFilter::RequestData(vtkInformation *request,
   double dir[3];
   if(this->AutoDetectDirection)
     {
-    this->ComputeDirection(psIn, dir);
+    this->ComputeDirection(pdIn, dir);
     }
   else
     {
@@ -179,23 +171,22 @@ int vtkElevationSurfaceFilter::RequestData(vtkInformation *request,
   dir[1] *= this->GetScaleFactor();
   dir[2] *= this->GetScaleFactor();
 
-  usgOut->Allocate(psIn->GetNumberOfCells());
+  usgOut->Allocate(pdIn->GetNumberOfCells());
 
   vtkSmartPointer<vtkPoints> newPts = vtkSmartPointer<vtkPoints>::New();
   usgOut->SetPoints(newPts);
 
-  usgOut->GetPointData()->CopyAllocate(psIn->GetPointData(),
-          2*psIn->GetNumberOfPoints());
-  usgOut->GetCellData()->CopyAllocate(psIn->GetCellData(),
-                 psIn->GetNumberOfCells());
+  usgOut->GetPointData()->CopyAllocate(pdIn->GetPointData(),
+                                       2*pdIn->GetNumberOfPoints());
+  usgOut->GetCellData()->CopyAllocate(pdIn->GetCellData(),
+                                       pdIn->GetNumberOfCells());
 
-  vtkIdType ncell = psIn->GetNumberOfCells();
+  vtkIdType ncell = pdIn->GetNumberOfCells();
   vtkSmartPointer<vtkIdList> newIds = vtkSmartPointer<vtkIdList>::New();
   vtkSmartPointer<vtkIdList> polyhedronIds = vtkSmartPointer<vtkIdList>::New();
-  vtkSmartPointer<vtkIdList> neighbors = vtkSmartPointer<vtkIdList>::New();
   for(vtkIdType cellId=0; cellId < ncell; cellId++)
     {
-    vtkCell* cell = psIn->GetCell(cellId);
+    vtkCell* cell = pdIn->GetCell(cellId);
     if(cell->GetCellDimension() != 2)
       continue;
 
@@ -225,7 +216,7 @@ int vtkElevationSurfaceFilter::RequestData(vtkInformation *request,
     double coords[VTK_CELL_SIZE*3];
     for(int ptid = 0; ptid < oldPtsNumber; ptid++)
       {
-       psIn->GetPoint(oldIds->GetId(ptid), coords + 3*ptid);
+      pdIn->GetPoint(oldIds->GetId(ptid), coords + 3*ptid);
       }
     for(int ptid = 0; ptid < oldPtsNumber; ptid++)
       {
@@ -233,50 +224,11 @@ int vtkElevationSurfaceFilter::RequestData(vtkInformation *request,
       coords[(ptid+oldPtsNumber)*3+1] = coords[ptid*3+1] + cellScalar*dir[1];
       coords[(ptid+oldPtsNumber)*3+2] = coords[ptid*3+2] + cellScalar*dir[2];
       }
-    double minScalar;
-    bool minInitialized = false;
-    for(int ptid = 0; ptid < oldPtsNumber; ptid++)
-      {
-      neighbors->Initialize();
-      psIn->GetPointCells(oldIds->GetId(ptid), neighbors);
-      for(int neiCellIt = 0; neiCellIt < neighbors->GetNumberOfIds(); neiCellIt++)
-        {
-        vtkIdType  neigCellId = neighbors->GetId(neiCellIt);
-        if(neigCellId == cellId)
-          continue;
-        double neighborScalar = array->GetTuple1(neigCellId);
-        if(neighborScalar != 0.0)
-                 {
-          if(!minInitialized)
-               minScalar = neighborScalar;
-          else
-                   minScalar = (neighborScalar < minScalar ? neighborScalar : minScalar);
-                 minInitialized = true;
-                 }
-        }
-      if(!minInitialized)
-       minScalar = 0.0;
-      }
-    for(int ptid = 0; ptid < oldPtsNumber; ptid++)
-      {
-         if(cellScalar != 0)
-           {
-        coords[(ptid)*3+0] = coords[ptid*3+0] + minScalar*dir[0];
-        coords[(ptid)*3+1] = coords[ptid*3+1] + minScalar*dir[1];
-        coords[(ptid)*3+2] = coords[ptid*3+2] + minScalar*dir[2];
-       }
-      else
-       {
-        coords[(ptid+oldPtsNumber)*3+0] = coords[ptid*3+0] + minScalar*dir[0];
-        coords[(ptid+oldPtsNumber)*3+1] = coords[ptid*3+1] + minScalar*dir[1];
-        coords[(ptid+oldPtsNumber)*3+2] = coords[ptid*3+2] + minScalar*dir[2];
-       }
-      }
     for(int ptid=0; ptid<newPtsNumber; ptid++)
       {
       vtkIdType newId = newPts->InsertNextPoint(coords + 3*ptid);
       newIds->SetId(ptid, newId);
-      usgOut->GetPointData()->CopyData(psIn->GetPointData(),
+      usgOut->GetPointData()->CopyData(pdIn->GetPointData(),
                                        oldIds->GetId(ptid % oldPtsNumber),
                                        newIds->GetId(ptid));
       }
@@ -315,29 +267,29 @@ int vtkElevationSurfaceFilter::RequestData(vtkInformation *request,
         }
       }
     newCellId = usgOut->InsertNextCell(newCellType, newIds);
-    usgOut->GetCellData()->CopyData(psIn->GetCellData(),
+    usgOut->GetCellData()->CopyData(pdIn->GetCellData(),
                                    cellId,
                                    newCellId);
     }
 
-  usgOut->GetFieldData()->ShallowCopy(psIn->GetFieldData());
+  usgOut->GetFieldData()->ShallowCopy(pdIn->GetFieldData());
 
   usgOut->Squeeze();
 
   return 1;
 }
 
-void  vtkElevationSurfaceFilter::ComputeDirection(vtkPointSet* psIn, double *outDir)
+void  vtkElevationSurfaceFilter::ComputeDirection(vtkPolyData* pdIn, double *outDir)
 {
   double tmp[2][3] = {{0, 0, 0}, {0, 0, 0}};
   outDir[0] = outDir[1] = outDir[2] = 0;
 
-  vtkPoints* pts = psIn->GetPoints();
+  vtkPoints* pts = pdIn->GetPoints();
   vtkSmartPointer<vtkGenericCell> cell = vtkSmartPointer<vtkGenericCell>::New();
 
-  for(vtkIdType cellId = 0; cellId < psIn->GetNumberOfCells(); cellId++)
+  for(vtkIdType cellId = 0; cellId < pdIn->GetNumberOfCells(); cellId++)
     {
-    psIn->GetCell(cellId, cell);
+    pdIn->GetCell(cellId, cell);
     if(cell->GetCellDimension() != 2)
       continue;
 
index 761b87f754610499fa6ea769cc7a34d224188014..5ce7a2f7ddfdbfac81a9849ef2977a9784a6e155 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "vtkAlgorithm.h"
 
-class vtkPointSet;
+class vtkPolyData;
 
 class VTK_EXPORT vtkElevationSurfaceFilter: public vtkAlgorithm
 {
@@ -79,7 +79,7 @@ protected:
                           vtkInformationVector**,
                           vtkInformationVector*);
 
-  virtual void  ComputeDirection(vtkPointSet*, double *outDir);
+  virtual void  ComputeDirection(vtkPolyData*, double *outDir);
 
   double ScaleFactor;
   double Direction[3];
index 531520c8b3bfb51da98179337ab94c51a74f9c19..ca02538a5eda1e4490061d8994842d88ed42044e 100644 (file)
@@ -57,8 +57,6 @@ FIND_LIBRARY(MED_LIBRARY med
   /usr/lib
 )
 
-get_filename_component(MED_LIBRARY_DIR ${MED_LIBRARY} PATH)
-
 FIND_LIBRARY(MEDC_LIBRARY medC
   HINTS
   ${MED_LIBRARY_DIR}
@@ -68,13 +66,16 @@ FIND_LIBRARY(MEDC_LIBRARY medC
   /usr/lib
 )
 
+get_filename_component(MED_LIBRARY_DIR ${MEDC_LIBRARY} PATH)
+
 IF(MED_INCLUDE_DIR)
-  IF(MED_LIBRARY)
-    IF(MEDC_LIBRARY)
-      SET(MED_LIBRARIES ${MED_LIBRARY} ${MEDC_LIBRARY} )
-      SET( MED_FOUND "YES" )
-    ENDIF(MEDC_LIBRARY)
-  ENDIF(MED_LIBRARY)
+  IF(MEDC_LIBRARY)
+    SET(MED_LIBRARIES ${MEDC_LIBRARY} )
+    IF(MED_LIBRARY)
+      SET(MED_LIBRARIES ${MED_LIBRARIES} ${MED_LIBRARY} )
+    ENDIF(MED_LIBRARY)
+    SET( MED_FOUND "YES" )
+  ENDIF(MEDC_LIBRARY)
 ENDIF(MED_INCLUDE_DIR)
 
 IF(${MED_FOUND})
index 6fb2a95a7556abfcb6c2db213f0de4518c406db2..4ac6fd90512d50f05337719ab312924fa9644306 100644 (file)
@@ -181,12 +181,13 @@ static const char* PENTA15_functions[PENTA15_nnode] =
  "2*y*z*(1-x)",
  "2*z*(1-y-z)*(1-x)",
  "2*y*(1-y-z)*(1-x)",
- "y*(1-x*x)",
- "z*(1-x*x)",
- "(1-y-z)*(1-x*x)",
  "2*y*z*(1+x)",
  "2*z*(1-y-z)*(1+x)",
- "2*y*(1-y-z)*(1+x)"};
+ "2*y*(1-y-z)*(1+x)",
+ "y*(1-x*x)",
+ "z*(1-x*x)",
+ "(1-y-z)*(1-x*x)"};
+
 
 // PENTA18
 const static int PENTA18_dim = 3;
@@ -195,24 +196,24 @@ const static int PENTA18_aster2med[PENTA18_nnode] =
 {0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 9, 10, 11, 15, 16, 17};
 static const char* PENTA18_varnames[PENTA18_dim] = {"x", "y", "z"};
 static const char* PENTA18_functions[PENTA18_nnode] =
-{"x*y*x−1*2*y−1/2",
- "x*z*x−1*2*z−1/2",
- "x*x−1*zy−1*2*z2*y−1/2",
- "x*y*x1*2*y−1/2",
- "x*z*x1*2*z−1/2",
- "x*x1*zy−1*2*z2*y−1/2",
- "2*x*y*z*x−1",
- "−2*x*z*x−1*zy−1",
- "−2*x*y*x−1*zy−1",
- "y*1−x*x*2*y−1",
- "z*1−x*x*2*z−1",
- "1−x*x*zy−1*2*z2*y−1",
- "2*x*y*z*x1",
- "−2*x*z*x1*zy−1",
- "−2*x*y*x1*zy−1",
- "4*y*z*1−x*x",
- "4*z*x−1*zy−1",
- "4*y*x−1*zy−1"};
+{"x*y*(x−1)*(2*y−1)/2",
+ "x*z*(x−1)*(2*z−1)/2",
+ "x*(x−1)*(zy−1)*(2*z2*y−1)/2",
+ "x*y*(x1)*(2*y−1)/2",
+ "x*z*(x1)*(2*z−1)/2",
+ "x*(x1)*(zy−1)*(2*z2*y−1)/2",
+ "2*x*y*z*(x−1)",
+ "−2*x*z*(x−1)*(zy−1)",
+ "−2*x*y*(x−1)*(zy−1)",
+ "2*x*y*z*(x1)",
+ "−2*x*z*(x1)*(zy−1)",
+ "−2*x*y*(x1)*(zy−1)",
+ "y*(1−x*x)*(2*y−1)",
+ "z*(1−x*x)*(2*z−1)",
+ "(1−x*x)*(zy−1)*(2*z2*y−1)",
+ "4*y*z*(1−x*x)",
+ "4*z*(x−1)*(zy−1)",
+ "4*y*(x−1)*(zy−1)"};
 
 // HEXA8
 const static int HEXA8_dim = 3;
@@ -250,22 +251,21 @@ static const char* HEXA20_functions[HEXA20_nnode] =
  "1/4*(1-y*y)*(1+x)*(1-z)",
  "1/4*(1-x*x)*(1+y)*(1-z)",
  "1/4*(1-y*y)*(1-x)*(1-z)",
- "1/4*(1-z*z)*(1-x)*(1-y)",
- "1/4*(1-z*z)*(1+x)*(1-y)",
- "1/4*(1-z*z)*(1+x)*(1+y)",
- "1/4*(1-z*z)*(1-x)*(1+y)",
  "1/4*(1-x*x)*(1-y)*(1+z)",
  "1/4*(1-y*y)*(1+x)*(1+z)",
  "1/4*(1-x*x)*(1+y)*(1+z)",
  "1/4*(1-y*y)*(1-x)*(1+z)",
+ "1/4*(1-z*z)*(1-x)*(1-y)",
+ "1/4*(1-z*z)*(1+x)*(1-y)",
+ "1/4*(1-z*z)*(1+x)*(1+y)",
+ "1/4*(1-z*z)*(1-x)*(1+y)"
   };
-
 // HEXA27
 const static int HEXA27_dim = 3;
 const static int HEXA27_nnode = 27;
 static const int HEXA27_aster2med[HEXA27_nnode] =
-{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 12, 13, 14, 15, 20, 21,
- 22, 23, 24, 25, 26};
+{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 12, 13, 14, 15, 24, 22,
+ 21, 23, 20, 25, 26};
 static const char* HEXA27_varnames[HEXA27_dim] = {"x", "y", "z"};
 static const char* HEXA27_functions[HEXA27_nnode] =
 {"1/8*x*(x-1)*y*(y-1)*z*(z-1)",
@@ -280,20 +280,20 @@ static const char* HEXA27_functions[HEXA27_nnode] =
  "1/4*x*(x+1)*(1-y*y)*z*(z-1)",
  "1/4*(1-x*x)*y*(y+1)*z*(z-1)",
  "1/4*x*(x-1)*(1-y*y)*z*(z-1)",
- "1/4*x*(x-1)*y*(y-1)*(1-z*z)",
- "1/4*x*(x+1)*y*(y-1)*(1-z*z)",
- "1/4*x*(x+1)*y*(y+1)*(1-z*z)",
- "1/4*x*(x-1)*y*(y+1)*(1-z*z)",
  "1/4*(1-x*x)*y*(y-1)*z*(z+1)",
  "1/4*x*(x+1)*(1-y*y)*z*(z+1)",
  "1/4*(1-x*x)*y*(y+1)*z*(z+1)",
  "1/4*x*(x-1)*(1-y*y)*z*(z+1)",
- "1/2*(1-x*x)*(1-y*y)*z*(z-1)",
- "1/2*(1-x*x)*y*(y-1)*(1-z*z)",
+ "1/4*x*(x-1)*y*(y-1)*(1-z*z)",
+ "1/4*x*(x+1)*y*(y-1)*(1-z*z)",
+ "1/4*x*(x+1)*y*(y+1)*(1-z*z)",
+ "1/4*x*(x-1)*y*(y+1)*(1-z*z)",
  "1/2*x*(x-1)*(1-y*y)*(1-z*z)",
+ "1/2*x*(x+1)*(1-y*y)*(1-z*z)",
  "1/2*(1-x*x)*y*(y-1)*(1-z*z)",
- "1/2*x*(x-1)*(1-y*y)*(1-z*z)",
+ "1/2*(1-x*x)*y*(y+1)*(1-z*z)",
  "1/2*(1-x*x)*(1-y*y)*z*(z-1)",
+ "1/2*(1-x*x)*(1-y*y)*z*(z+1)",
  "(1-x*x)*(1-y*y)*(1-z*z)"
   };
 
index e2348f1a1c9d8a93a7b987843ac208aee33fa1ec..ce59b8a2eb6b4f78e506772482cd7c7a61f13fb8 100644 (file)
@@ -81,6 +81,7 @@
 #include <list>
 #include <set>
 #include <algorithm>
+
 using namespace std;
 
 struct VTKField
@@ -1745,6 +1746,16 @@ void vtkMedReader::AddQuadratureSchemeDefinition(vtkInformation* info,
 
   vtkQuadratureSchemeDefinition* def=vtkQuadratureSchemeDefinition::New();
   int cellType=vtkMedUtilities::GetVTKCellType(loc->GetGeometryType());
+  // Control to avoid crahs when loading a file with structural elements.
+  // This should be removed in version 7.1.0 of SALOME.
+  // See mantis issue 21990
+  if(loc->GetGeometryType() >= MED_STRUCT_GEO_INTERNAL)    
+    {
+    vtkErrorMacro("You are loading a file containing structural elements BUT they are still not supported");
+    return;
+    }
+  if(loc->GetWeights()->GetVoidPointer(0) ==  NULL)
+    return;
   def->Initialize(cellType, vtkMedUtilities::GetNumberOfPoint(
       loc->GetGeometryType()), loc->GetNumberOfQuadraturePoint(),
       (double*)loc->GetShapeFunction()->GetVoidPointer(0),
index 9d9970ec5f4471ff9c5198756354aa07a9c7d544..10a29238bf0e78f60524f11024ea7321e84d50c4 100644 (file)
@@ -213,6 +213,8 @@ const char* vtkMedUtilities::GeometryName(med_geometry_type geometry)
       return "MED_POLYGON";
     case MED_POLYHEDRON:
       return "MED_POLYHEDRON";
+    case MED_STRUCT_GEO_INTERNAL:
+      return "MED_STRUCT_GEO_INTERNAL";
     case MED_NO_GEOTYPE:
       return "MED_NO_GEOTYPE";
     default:
index a5aabc1a9fa5bed411ebbb20d5273ae810a824d7..1906a08aa5d80830fd94f2f24530ba25a6c0a652 100644 (file)
@@ -19,6 +19,6 @@
 
 ADD_CUSTOM_COMMAND(
  OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wrapfiles.txt
- COMMAND pvpython ${CMAKE_SOURCE_DIR}/getwrapclasses.py
+ COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/getwrapclasses.py
  DEPENDS ${CMAKE_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_PYTHON_EXECUTABLE}
 )