From: vsr Date: Thu, 13 Dec 2012 13:08:32 +0000 (+0000) Subject: Merge from V6_main 13/12/2012 X-Git-Tag: V7_1_0_pre X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FBR_KERNEL_REFACTORING;p=modules%2Fparavis.git Merge from V6_main 13/12/2012 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index b1810a05..61f77467 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/src/ENGINE/PARAVIS_Engine_i.cc b/src/ENGINE/PARAVIS_Engine_i.cc index 8bb302df..d41de106 100644 --- a/src/ENGINE/PARAVIS_Engine_i.cc +++ b/src/ENGINE/PARAVIS_Engine_i.cc @@ -294,4 +294,8 @@ namespace PARAVIS { SALOMEDS::Study_ptr PARAVIS_Gen_i::GetCurrentStudy(){ return myParaVisGen->GetCurrentStudy(); } + char* PARAVIS_Gen_i::getVersion() + { + return myParaVisGen->getVersion(); + } } diff --git a/src/ENGINE/PARAVIS_Engine_i.hh b/src/ENGINE/PARAVIS_Engine_i.hh index 6ea77ba3..2c86a524 100644 --- a/src/ENGINE/PARAVIS_Engine_i.hh +++ b/src/ENGINE/PARAVIS_Engine_i.hh @@ -116,6 +116,8 @@ namespace PARAVIS virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy); virtual SALOMEDS::Study_ptr GetCurrentStudy(); + + virtual char* getVersion(); }; }; #endif diff --git a/src/Macro/modes.py b/src/Macro/modes.py index db4b623b..30dc8dc7 100644 --- a/src/Macro/modes.py +++ b/src/Macro/modes.py @@ -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() diff --git a/src/PVGUI/PARAVIS_Gen_i.cc b/src/PVGUI/PARAVIS_Gen_i.cc index e31a4f52..c156d1f6 100644 --- a/src/PVGUI/PARAVIS_Gen_i.cc +++ b/src/PVGUI/PARAVIS_Gen_i.cc @@ -23,6 +23,7 @@ #include "PARAVIS_Gen_i.hh" +#include "PARAVIS_version.h" // IDL Headers #include @@ -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 + } } diff --git a/src/PVGUI/PARAVIS_Gen_i.hh b/src/PVGUI/PARAVIS_Gen_i.hh index 11b2fc99..8f30eeaa 100644 --- a/src/PVGUI/PARAVIS_Gen_i.hh +++ b/src/PVGUI/PARAVIS_Gen_i.hh @@ -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(); diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index f4d072bc..9c285391 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -52,6 +52,7 @@ #include #include #include +#include // SALOME Includes #include "SALOME_LifeCycleCORBA.hxx" @@ -101,6 +102,8 @@ #include #include #include +#include +#include #include #include #include @@ -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); diff --git a/src/Plugins/ElevationSurface/ElevationSurface.xml b/src/Plugins/ElevationSurface/ElevationSurface.xml index 2bfe615d..37ed8442 100644 --- a/src/Plugins/ElevationSurface/ElevationSurface.xml +++ b/src/Plugins/ElevationSurface/ElevationSurface.xml @@ -30,7 +30,7 @@ + value="vtkPolyData" /> @@ -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 surfaceFilter = vtkSmartPointer::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 newPts = vtkSmartPointer::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 newIds = vtkSmartPointer::New(); vtkSmartPointer polyhedronIds = vtkSmartPointer::New(); - vtkSmartPointer neighbors = vtkSmartPointer::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; ptidInsertNextPoint(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 cell = vtkSmartPointer::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; diff --git a/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h b/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h index 761b87f7..5ce7a2f7 100644 --- a/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h +++ b/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h @@ -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]; diff --git a/src/Plugins/MedReader/CMake/FindMED.cmake b/src/Plugins/MedReader/CMake/FindMED.cmake index 531520c8..ca02538a 100644 --- a/src/Plugins/MedReader/CMake/FindMED.cmake +++ b/src/Plugins/MedReader/CMake/FindMED.cmake @@ -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}) diff --git a/src/Plugins/MedReader/IO/vtkMedLocalization.cxx b/src/Plugins/MedReader/IO/vtkMedLocalization.cxx index 6fb2a95a..4ac6fd90 100644 --- a/src/Plugins/MedReader/IO/vtkMedLocalization.cxx +++ b/src/Plugins/MedReader/IO/vtkMedLocalization.cxx @@ -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)" }; diff --git a/src/Plugins/MedReader/IO/vtkMedReader.cxx b/src/Plugins/MedReader/IO/vtkMedReader.cxx index e2348f1a..ce59b8a2 100644 --- a/src/Plugins/MedReader/IO/vtkMedReader.cxx +++ b/src/Plugins/MedReader/IO/vtkMedReader.cxx @@ -81,6 +81,7 @@ #include #include #include + 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), diff --git a/src/Plugins/MedReader/IO/vtkMedUtilities.cxx b/src/Plugins/MedReader/IO/vtkMedUtilities.cxx index 9d9970ec..10a29238 100644 --- a/src/Plugins/MedReader/IO/vtkMedUtilities.cxx +++ b/src/Plugins/MedReader/IO/vtkMedUtilities.cxx @@ -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: diff --git a/wrapfiles.cmake b/wrapfiles.cmake index a5aabc1a..1906a08a 100644 --- a/wrapfiles.cmake +++ b/wrapfiles.cmake @@ -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} )