From: vsr Date: Mon, 4 Apr 2016 09:50:13 +0000 (+0300) Subject: Merge remote branch 'origin/V7_dev' X-Git-Tag: V8_1_0a1~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8c63a38303474ce53194ae7b312ef70f3b3daa9f;hp=bdd7ee8934413e95d66df32b9fbaac742df4ed39;p=modules%2Fparavis.git Merge remote branch 'origin/V7_dev' --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e00ed8e..48719435 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,8 +33,8 @@ CMAKE_POLICY(SET CMP0003 NEW) # Project name, upper case STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC) -SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7) -SET(${PROJECT_NAME_UC}_MINOR_VERSION 7) +SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8) +SET(${PROJECT_NAME_UC}_MINOR_VERSION 0) SET(${PROJECT_NAME_UC}_PATCH_VERSION 0) SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) @@ -119,7 +119,11 @@ ENDIF() ## From GUI ## -FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtHelp) +IF (NOT SALOME_GUI_BUILD_WITH_QT5) + FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml QtHelp) +ELSE() + FIND_PACKAGE(SalomeQt5 REQUIRED) +ENDIF() ## ## Specific to ParaViS: diff --git a/src/PVGUI/CMakeLists.txt b/src/PVGUI/CMakeLists.txt index 3f5eef9a..7e74e068 100644 --- a/src/PVGUI/CMakeLists.txt +++ b/src/PVGUI/CMakeLists.txt @@ -17,7 +17,7 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -INCLUDE(UseQt4Ext) +INCLUDE(UseQtExt) # --- options --- @@ -57,7 +57,7 @@ SET(_ui_files resources/pqCustomSettingsWidget.ui ) -QT4_WRAP_UI(_ui_FORMS_HEADERS ${_ui_files}) +QT_WRAP_UIC(_ui_FORMS_HEADERS ${_ui_files}) # header files / to be processed by moc SET(_moc_HEADERS @@ -105,10 +105,10 @@ ENDIF() # --- sources --- # sources / rcc wrappings -QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES}) +QT_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES}) # sources / moc wrappings -QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS}) +QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS}) # sources / static SET(_other_SOURCES @@ -135,5 +135,5 @@ INSTALL(TARGETS PARAVIS EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_I # --- header and resources installation --- INSTALL(FILES ${PVGUI_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) -QT4_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}") +QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_PARAVIS_INSTALL_RES_DATA}") INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_PARAVIS_INSTALL_RES_DATA}) diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index 284d98a8..60a1635c 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -513,7 +513,7 @@ void PVGUI_Module::endWaitCursor() { QApplication::restoreOverrideCursor(); } - +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) /*! \brief Handler method for the output of messages. */ @@ -535,7 +535,29 @@ static void ParavisMessageOutput(QtMsgType type, const char *msg) break; } } - +#else +/*! + \brief Handler method for the output of messages. +*/ +static void ParavisMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) +{ + switch(type) + { + case QtDebugMsg: + vtkOutputWindow::GetInstance()->DisplayText(msg.toLatin1().constData()); + break; + case QtWarningMsg: + vtkOutputWindow::GetInstance()->DisplayErrorText(msg.toLatin1().constData()); + break; + case QtCriticalMsg: + vtkOutputWindow::GetInstance()->DisplayErrorText(msg.toLatin1().constData()); + break; + case QtFatalMsg: + vtkOutputWindow::GetInstance()->DisplayErrorText(msg.toLatin1().constData()); + break; + } +} +#endif /*! \brief Activate module. \param study current study @@ -544,8 +566,11 @@ static void ParavisMessageOutput(QtMsgType type, const char *msg) */ bool PVGUI_Module::activateModule( SUIT_Study* study ) { +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) myOldMsgHandler = qInstallMsgHandler(ParavisMessageOutput); - +#else + myOldMsgHandler = qInstallMessageHandler(ParavisMessageOutput); +#endif SUIT_ExceptionHandler::addCleanUpRoutine( paravisCleanUp ); storeCommonWindowsState(); @@ -643,8 +668,11 @@ bool PVGUI_Module::deactivateModule( SUIT_Study* study ) SUIT_ExceptionHandler::removeCleanUpRoutine( paravisCleanUp ); if (myOldMsgHandler) +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) qInstallMsgHandler(myOldMsgHandler); - +#else + qInstallMessageHandler(myOldMsgHandler); +#endif restoreCommonWindowsState(); return LightApp_Module::deactivateModule( study ); diff --git a/src/PVGUI/PVGUI_Module.h b/src/PVGUI/PVGUI_Module.h index 0ce311fd..bbeed82b 100644 --- a/src/PVGUI/PVGUI_Module.h +++ b/src/PVGUI/PVGUI_Module.h @@ -217,9 +217,11 @@ private: typedef QMap DockWindowMap; DockWindowMap myCommonMap; - +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) QtMsgHandler myOldMsgHandler; - +#else + QtMessageHandler myOldMsgHandler; +#endif vtkEventQtSlotConnect* VTKConnect; pqPythonScriptEditor* myTraceWindow; diff --git a/src/PV_SWIG/presentations.py b/src/PV_SWIG/presentations.py index 8680f5d1..b795657c 100644 --- a/src/PV_SWIG/presentations.py +++ b/src/PV_SWIG/presentations.py @@ -972,7 +972,6 @@ def get_group_mesh_name(full_group_name): group_name = full_group_name.split('/')[1] return group_name - def get_group_entity(full_group_name): """Return entity type of the group by its full name.""" aList = full_group_name.split('/') @@ -1123,7 +1122,7 @@ def ScalarMapOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - scalarmap.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(scalarmap, (EntityType.get_pvtype(entity), field_name)) scalarmap.LookupTable = lookup_table # Add scalar bar @@ -1214,7 +1213,7 @@ def CutPlanesOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_planes.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_planes, (EntityType.get_pvtype(entity), field_name)) cut_planes.LookupTable = lookup_table # Add scalar bar @@ -1361,7 +1360,7 @@ def CutLinesOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_lines.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_lines, (EntityType.get_pvtype(entity), field_name)) cut_lines.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1440,7 +1439,7 @@ def CutSegmentOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - cut_segment.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(cut_segment, (EntityType.get_pvtype(entity), field_name)) cut_segment.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1563,9 +1562,9 @@ def VectorsOnField(proxy, entity, field_name, timestamp_nb, # Set properties if (is_colored): - vectors.ColorArrayName = (EntityType.get_pvtype(entity), 'GlyphVector') + pvs.ColorBy(vectors, (EntityType.get_pvtype(entity), 'GlyphVector')) else: - vectors.ColorArrayName = (None, '') + pvs.ColorBy(vectors, (EntityType.get_pvtype(entity), None)) vectors.LookupTable = lookup_table vectors.LineWidth = 1.0 @@ -1667,9 +1666,9 @@ def DeformedShapeOnField(proxy, entity, field_name, # Set properties if is_colored: - defshape.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(defshape, (EntityType.get_pvtype(entity), field_name)) else: - defshape.ColorArrayName = (None, '') + pvs.ColorBy(defshape, (EntityType.get_pvtype(entity), None)) defshape.LookupTable = lookup_table # Set wireframe represenatation mode @@ -1790,7 +1789,7 @@ def DeformedShapeAndScalarMapOnField(proxy, entity, field_name, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - defshapemap.ColorArrayName = (EntityType.get_pvtype(scalar_field_entity), scalar_field) + pvs.ColorBy(defshapemap, (EntityType.get_pvtype(scalar_field_entity), scalar_field)) defshapemap.LookupTable = lookup_table # Add scalar bar @@ -1965,7 +1964,7 @@ def Plot3DOnField(proxy, entity, field_name, timestamp_nb, lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties - plot3d.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(plot3d, (EntityType.get_pvtype(entity), field_name)) plot3d.LookupTable = lookup_table # Add scalar bar @@ -2046,7 +2045,7 @@ def IsoSurfacesOnField(proxy, entity, field_name, timestamp_nb, if (scalar_range is None): scalar_range = get_data_range(proxy, entity, field_name, cut_off=True) - + # Get contour values for the range surfaces = get_contours(scalar_range, nb_surfaces) @@ -2073,9 +2072,9 @@ def IsoSurfacesOnField(proxy, entity, field_name, timestamp_nb, # Set display properties if (is_colored): - isosurfaces.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(isosurfaces, (EntityType.get_pvtype(entity), field_name)) else: - isosurfaces.ColorArrayName = (None, '') + pvs.ColorBy(isosurfaces, (EntityType.get_pvtype(entity), None)) if color: isosurfaces.DiffuseColor = color isosurfaces.LookupTable = lookup_table @@ -2202,9 +2201,9 @@ def GaussPointsOnField(proxy, entity, field_name, # Set display properties if is_colored: - gausspnt.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), field_name)) else: - gausspnt.ColorArrayName = (None, '') + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), None)) if color: gausspnt.DiffuseColor = color @@ -2340,9 +2339,9 @@ def GaussPointsOnField1(proxy, entity, field_name, # Set display properties if is_colored: - gausspnt.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), field_name)) else: - gausspnt.ColorArrayName = (None, '') + pvs.ColorBy(gausspnt, (EntityType.get_pvtype(entity), None)) if color: gausspnt.DiffuseColor = color @@ -2475,6 +2474,7 @@ def StreamLinesOnField(proxy, entity, field_name, timestamp_nb, stream.Vectors = ['POINTS', vector_array] stream.IntegrationDirection = direction stream.IntegratorType = 'Runge-Kutta 2' + stream.SeedType = 'High Resolution Line Source' stream.UpdatePipeline() # Get Stream Lines representation object @@ -2499,9 +2499,9 @@ def StreamLinesOnField(proxy, entity, field_name, timestamp_nb, # Set properties if is_colored: - streamlines.ColorArrayName = (EntityType.get_pvtype(entity), field_name) + pvs.ColorBy(streamlines, (EntityType.get_pvtype(entity), field_name)) else: - streamlines.ColorArrayName = (None, '') + pvs.ColorBy(streamlines, (EntityType.get_pvtype(entity), None)) if color: streamlines.DiffuseColor = color @@ -2583,7 +2583,7 @@ def MeshOnGroup(proxy, extrGroups, group_name): if nb_points or nb_cells: # prs = pvs.GetRepresentation(proxy) prs = pvs.Show() - prs.ColorArrayName = '' + prs.ColorArrayName = (None, '') display_only(prs) return prs diff --git a/src/Plugins/ArrayRenamer/CMakeLists.txt b/src/Plugins/ArrayRenamer/CMakeLists.txt index 6eb34f59..f5be88a8 100644 --- a/src/Plugins/ArrayRenamer/CMakeLists.txt +++ b/src/Plugins/ArrayRenamer/CMakeLists.txt @@ -22,13 +22,14 @@ PROJECT(ArrayRenamer) cmake_minimum_required(VERSION 2.8) +INCLUDE(UseQtExt) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) SET (outifaces) SET (outsrcs) -QT4_WRAP_CPP(moc_srcs pqArraysEditorPropertyWidget.h pqEditComponents.h) +QT_WRAP_MOC(moc_srcs pqArraysEditorPropertyWidget.h pqEditComponents.h) ADD_PARAVIEW_PROPERTY_GROUP_WIDGET(outifaces outsrcs TYPE "custom_arrays_editor" diff --git a/src/Plugins/ArrayRenamer/pqArraysEditorPropertyWidget.cxx b/src/Plugins/ArrayRenamer/pqArraysEditorPropertyWidget.cxx index 76854e2f..405edb98 100644 --- a/src/Plugins/ArrayRenamer/pqArraysEditorPropertyWidget.cxx +++ b/src/Plugins/ArrayRenamer/pqArraysEditorPropertyWidget.cxx @@ -437,9 +437,13 @@ pqEditComponents::pqEditComponents( pqComponentsModel* model, QWidget* parent ) QTableView* componentsTable = new QTableView( this ); componentsTable->setModel( model ); aCompsLayout->addWidget( componentsTable ); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) componentsTable->horizontalHeader()->setResizeMode( pqComponentsModel::COMPONENT_NAME, QHeaderView::Stretch ); componentsTable->horizontalHeader()->setResizeMode( pqComponentsModel::NEW_COMPONENT_NAME, QHeaderView::Stretch ); - +#else + componentsTable->horizontalHeader()->setSectionResizeMode( pqComponentsModel::COMPONENT_NAME, QHeaderView::Stretch ); + componentsTable->horizontalHeader()->setSectionResizeMode( pqComponentsModel::NEW_COMPONENT_NAME, QHeaderView::Stretch ); +#endif /// Parameters QVBoxLayout *aParamsLayout = new QVBoxLayout( aParams ); myRenameAllComps = new QCheckBox( "Rename all similar Components", aParams ); @@ -488,10 +492,17 @@ pqArraysEditorPropertyWidget::pqArraysEditorPropertyWidget( vtkSMProxy* smproxy, // Layout QVBoxLayout* lay = new QVBoxLayout(this); lay->addWidget(myArraysTable); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::PROCESSING, QHeaderView::ResizeToContents ); myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::NAME, QHeaderView::Stretch); myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::NEW_NAME, QHeaderView::Stretch ); myArraysTable->horizontalHeader()->setResizeMode( pqArraysModel::COMPONENTS, QHeaderView::ResizeToContents ); +#else + myArraysTable->horizontalHeader()->setSectionResizeMode( pqArraysModel::PROCESSING, QHeaderView::ResizeToContents ); + myArraysTable->horizontalHeader()->setSectionResizeMode( pqArraysModel::NAME, QHeaderView::Stretch); + myArraysTable->horizontalHeader()->setSectionResizeMode( pqArraysModel::NEW_NAME, QHeaderView::Stretch ); + myArraysTable->horizontalHeader()->setSectionResizeMode( pqArraysModel::COMPONENTS, QHeaderView::ResizeToContents ); +#endif myArraysTable->resizeColumnsToContents(); // Connections diff --git a/src/Plugins/JSONReader/ParaViewPlugin/CMakeLists.txt b/src/Plugins/JSONReader/ParaViewPlugin/CMakeLists.txt index f839ccea..e0ad2521 100644 --- a/src/Plugins/JSONReader/ParaViewPlugin/CMakeLists.txt +++ b/src/Plugins/JSONReader/ParaViewPlugin/CMakeLists.txt @@ -25,6 +25,12 @@ ADD_PARAVIEW_PLUGIN(JSONReader "1.0" SERVER_MANAGER_SOURCES vtkJSONReader.cxx REQUIRED_ON_SERVER) +TARGET_LINK_LIBRARIES(JSONReader vtkjsoncpp) + +IF(WIN32) + ADD_DEFINITIONS(-DJSON_DLL) +ENDIF() + INSTALL(TARGETS JSONReader DESTINATION lib/paraview ) diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx index dbae71be..f905bfda 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.cxx @@ -53,7 +53,7 @@ #include "vtkMutableDirectedGraph.h" -using namespace ParaMEDMEM; +using namespace MEDCoupling; const char MEDFileFieldRepresentationLeavesArrays::ZE_SEP[]="@@][@@"; @@ -69,13 +69,15 @@ const char MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_NODE_NAME[]="Family const char MEDFileFieldRepresentationLeavesArrays::NUM_ID_NODE_NAME[]="NumIdNode"; +const char MEDFileFieldRepresentationLeavesArrays::GLOBAL_NODE_ID_NAME[]="GlobalNodeIds";// WARNING DO NOT CHANGE IT BEFORE HAVING CHECKED IN PV SOURCES ! + const char MEDFileFieldRepresentationTree::ROOT_OF_GRPS_IN_TREE[]="zeGrps"; const char MEDFileFieldRepresentationTree::ROOT_OF_FAM_IDS_IN_TREE[]="zeFamIds"; const char MEDFileFieldRepresentationTree::COMPO_STR_TO_LOCATE_MESH_DA[]="-@?|*_"; -vtkIdTypeArray *ELGACmp::findOrCreate(const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds, bool& isNew) const +vtkIdTypeArray *ELGACmp::findOrCreate(const MEDCoupling::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds, bool& isNew) const { vtkIdTypeArray *try0(isExisting(locsReallyUsed,vtkd)); if(try0) @@ -106,7 +108,7 @@ vtkIdTypeArray *ELGACmp::isExisting(const std::vector& locsReallyUs return ret; } -vtkIdTypeArray *ELGACmp::createNew(const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds) const +vtkIdTypeArray *ELGACmp::createNew(const MEDCoupling::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds) const { const int VTK_DATA_ARRAY_DELETE=vtkDataArrayTemplate::VTK_DATA_ARRAY_DELETE; std::vector< std::vector > locNames(_loc_names); @@ -196,25 +198,68 @@ ELGACmp::~ELGACmp() //= +template +class MEDFileVTKTraits +{ +public: + typedef void VtkType; + typedef void MCType; +}; + +template<> +class MEDFileVTKTraits +{ +public: + typedef vtkIntArray VtkType; + typedef MEDCoupling::DataArrayInt MCType; +}; + +template<> +class MEDFileVTKTraits +{ +public: + typedef vtkDoubleArray VtkType; + typedef MEDCoupling::DataArrayDouble MCType; +}; + +template +void AssignDataPointerToVTK(typename MEDFileVTKTraits::VtkType *vtkTab, typename MEDFileVTKTraits::MCType *mcTab, bool noCpyNumNodes) +{ + if(noCpyNumNodes) + vtkTab->SetArray(mcTab->getPointer(),mcTab->getNbOfElems(),1,vtkDataArrayTemplate::VTK_DATA_ARRAY_FREE); + else + { vtkTab->SetArray(mcTab->getPointer(),mcTab->getNbOfElems(),0,vtkDataArrayTemplate::VTK_DATA_ARRAY_FREE); mcTab->accessToMemArray().setSpecificDeallocator(0); } +} + +// here copy is always assumed. +template +void AssignDataPointerOther(VTKT *vtkTab, MCT *mcTab, int nbElems) +{ + vtkTab->SetVoidArray(reinterpret_cast(mcTab->getPointer()),nbElems,0,VTKT::VTK_DATA_ARRAY_FREE); + mcTab->accessToMemArray().setSpecificDeallocator(0); +} + +//= + MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays():_id(-1) { } -MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays(const ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr& arr):ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr(arr),_activated(false),_id(-1) +MEDFileFieldRepresentationLeavesArrays::MEDFileFieldRepresentationLeavesArrays(const MEDCoupling::MCAuto& arr):MEDCoupling::MCAuto(arr),_activated(false),_id(-1) { - std::vector< std::vector > typs((operator->())->getTypesOfFieldAvailable()); + std::vector< std::vector > typs((operator->())->getTypesOfFieldAvailable()); if(typs.size()<1) throw INTERP_KERNEL::Exception("There is a big internal problem in MEDLoader ! The field time spitting has failed ! A CRASH will occur soon !"); if(typs[0].size()!=1) throw INTERP_KERNEL::Exception("There is a big internal problem in MEDLoader ! The field spitting by spatial discretization has failed ! A CRASH will occur soon !"); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr fd(MEDCouplingFieldDiscretization::New(typs[0][0])); + MEDCoupling::MCAuto fd(MEDCouplingFieldDiscretization::New(typs[0][0])); std::ostringstream oss2; oss2 << (operator->())->getName() << ZE_SEP << fd->getRepr(); _ze_name=oss2.str(); } MEDFileFieldRepresentationLeavesArrays& MEDFileFieldRepresentationLeavesArrays::operator=(const MEDFileFieldRepresentationLeavesArrays& other) { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr::operator=(other); + MEDCoupling::MCAuto::operator=(other); _id=-1; _activated=false; _ze_name=other._ze_name; @@ -272,15 +317,14 @@ bool MEDFileFieldRepresentationLeavesArrays::setStatus(bool status) const return ret; } -void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDMeshMultiLev *mml, const ParaMEDMEM::MEDFileMeshStruct *mst, vtkDataSet *ds) const +void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshStruct *mst, vtkDataSet *ds) const { - const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate::VTK_DATA_ARRAY_FREE; const int VTK_DATA_ARRAY_DELETE=vtkDataArrayTemplate::VTK_DATA_ARRAY_DELETE; tr->setNumberOfTS((operator->())->getNumberOfTS()); tr->initIterator(); for(int timeStepId=0;timeStepIdsize();timeStepId++,++(*tr)) { - MEDCouplingAutoRefCountObjectPtr f1ts((operator->())->getTimeStepAtPos(tr->getCurrent())); + MCAuto f1ts((operator->())->getTimeStepAtPos(tr->getCurrent())); MEDFileAnyTypeField1TS *f1tsPtr(f1ts); MEDFileField1TS *f1tsPtrDbl(dynamic_cast(f1tsPtr)); MEDFileIntField1TS *f1tsPtrInt(dynamic_cast(f1tsPtr)); @@ -293,7 +337,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, throw INTERP_KERNEL::Exception("MEDFileFieldRepresentationLeavesArrays::appendFields : only FLOAT64 and INT32 fields are dealt for the moment !"); MEDFileField1TSStructItem fsst(MEDFileField1TSStructItem::BuildItemFrom(f1ts,mst)); f1ts->loadArraysIfNecessary(); - MEDCouplingAutoRefCountObjectPtr v(mml->buildDataArray(fsst,globs,crudeArr)); + MCAuto v(mml->buildDataArray(fsst,globs,crudeArr)); postProcessedArr=v; // std::vector discs(f1ts->getTypesOfFieldAvailable()); @@ -332,14 +376,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, vtkd->SetNumberOfComponents(vd->getNumberOfComponents()); for(int i=0;igetNumberOfComponents();i++) vtkd->SetComponentName(i,vd->getInfoOnComponent(i).c_str()); - if(postProcessedArr!=crudeArr) - { - vtkd->SetArray(vd->getPointer(),vd->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); vd->accessToMemArray().setSpecificDeallocator(0); - } - else - { - vtkd->SetArray(vd->getPointer(),vd->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - } + AssignDataPointerToVTK(vtkd,vd,postProcessedArr==crudeArr); std::string name(tr->buildName(f1ts->getName())); vtkd->SetName(name.c_str()); att->AddArray(vtkd); @@ -412,14 +449,7 @@ void MEDFileFieldRepresentationLeavesArrays::appendFields(const MEDTimeReq *tr, vtkd->SetNumberOfComponents(vi->getNumberOfComponents()); for(int i=0;igetNumberOfComponents();i++) vtkd->SetComponentName(i,vi->getVarOnComponent(i).c_str()); - if(postProcessedArr!=crudeArr) - { - vtkd->SetArray(vi->getPointer(),vi->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); vi->accessToMemArray().setSpecificDeallocator(0); - } - else - { - vtkd->SetArray(vi->getPointer(),vi->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - } + AssignDataPointerToVTK(vtkd,vi,postProcessedArr==crudeArr); std::string name(tr->buildName(f1ts->getName())); vtkd->SetName(name.c_str()); att->AddArray(vtkd); @@ -441,8 +471,8 @@ MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves():_cached_ds( { } -MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves(const std::vector< ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr >& arr, - const ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr& fsp):_arrays(arr.size()),_fsp(fsp),_cached_ds(0) +MEDFileFieldRepresentationLeaves::MEDFileFieldRepresentationLeaves(const std::vector< MEDCoupling::MCAuto >& arr, + const MEDCoupling::MCAuto& fsp):_arrays(arr.size()),_fsp(fsp),_cached_ds(0) { for(std::size_t i=0;i& names) const +void MEDFileFieldRepresentationLeaves::feedSIL(const MEDCoupling::MEDFileMeshes *ms, const std::string& meshName, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const { vtkIdType root2(sil->AddChild(root,edge)); names.push_back(std::string("Arrs")); @@ -499,10 +529,10 @@ void MEDFileFieldRepresentationLeaves::feedSIL(const ParaMEDMEM::MEDFileMeshes * // vtkIdType root3(sil->AddChild(root,edge)); names.push_back(std::string("InfoOnGeoType")); - const ParaMEDMEM::MEDFileMesh *m(0); + const MEDCoupling::MEDFileMesh *m(0); if(ms) m=ms->getMeshWithName(meshName); - const ParaMEDMEM::MEDFileFastCellSupportComparator *fsp(_fsp); + const MEDCoupling::MEDFileFastCellSupportComparator *fsp(_fsp); if(!fsp || fsp->getNumberOfTS()==0) return ; std::vector< INTERP_KERNEL::NormalizedCellType > gts(fsp->getGeoTypesAt(0,m)); @@ -618,11 +648,11 @@ std::string MEDFileFieldRepresentationLeaves::getHumanReadableOverviewOfTS() con return oss.str(); } -void MEDFileFieldRepresentationLeaves::appendFields(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDMeshMultiLev *mml, const ParaMEDMEM::MEDFileMeshes *meshes, vtkDataSet *ds) const +void MEDFileFieldRepresentationLeaves::appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshes *meshes, vtkDataSet *ds) const { if(_arrays.size()<1) throw INTERP_KERNEL::Exception("MEDFileFieldRepresentationLeaves::appendFields : internal error !"); - MEDCouplingAutoRefCountObjectPtr mst(MEDFileMeshStruct::New(meshes->getMeshWithName(_arrays[0]->getMeshName().c_str()))); + MCAuto mst(MEDFileMeshStruct::New(meshes->getMeshWithName(_arrays[0]->getMeshName().c_str()))); for(std::vector::const_iterator it=_arrays.begin();it!=_arrays.end();it++) if((*it).getStatus()) { @@ -633,32 +663,31 @@ void MEDFileFieldRepresentationLeaves::appendFields(const MEDTimeReq *tr, const vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationUnstructured(MEDUMeshMultiLev *mm) const { - const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate::VTK_DATA_ARRAY_FREE; DataArrayDouble *coordsMC(0); DataArrayByte *typesMC(0); DataArrayInt *cellLocationsMC(0),*cellsMC(0),*faceLocationsMC(0),*facesMC(0); bool statusOfCoords(mm->buildVTUArrays(coordsMC,typesMC,cellLocationsMC,cellsMC,faceLocationsMC,facesMC)); - MEDCouplingAutoRefCountObjectPtr coordsSafe(coordsMC); - MEDCouplingAutoRefCountObjectPtr typesSafe(typesMC); - MEDCouplingAutoRefCountObjectPtr cellLocationsSafe(cellLocationsMC),cellsSafe(cellsMC),faceLocationsSafe(faceLocationsMC),facesSafe(facesMC); + MCAuto coordsSafe(coordsMC); + MCAuto typesSafe(typesMC); + MCAuto cellLocationsSafe(cellLocationsMC),cellsSafe(cellsMC),faceLocationsSafe(faceLocationsMC),facesSafe(facesMC); // int nbOfCells(typesSafe->getNbOfElems()); vtkUnstructuredGrid *ret(vtkUnstructuredGrid::New()); vtkUnsignedCharArray *cellTypes(vtkUnsignedCharArray::New()); - cellTypes->SetArray(reinterpret_cast(typesSafe->getPointer()),nbOfCells,0,VTK_DATA_ARRAY_FREE); typesSafe->accessToMemArray().setSpecificDeallocator(0); + AssignDataPointerOther(cellTypes,typesSafe,nbOfCells); vtkIdTypeArray *cellLocations(vtkIdTypeArray::New()); - cellLocations->SetVoidArray(cellLocationsSafe->getPointer(),nbOfCells,0,VTK_DATA_ARRAY_FREE); cellLocationsSafe->accessToMemArray().setSpecificDeallocator(0); + AssignDataPointerOther(cellLocations,cellLocationsSafe,nbOfCells); vtkCellArray *cells(vtkCellArray::New()); vtkIdTypeArray *cells2(vtkIdTypeArray::New()); - cells2->SetVoidArray(cellsSafe->getPointer(),cellsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); cellsSafe->accessToMemArray().setSpecificDeallocator(0); + AssignDataPointerOther(cells2,cellsSafe,cellsSafe->getNbOfElems()); cells->SetCells(nbOfCells,cells2); cells2->Delete(); if(faceLocationsMC!=0 && facesMC!=0) { vtkIdTypeArray *faces(vtkIdTypeArray::New()); - faces->SetVoidArray(facesSafe->getPointer(),facesSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); facesSafe->accessToMemArray().setSpecificDeallocator(0); + AssignDataPointerOther(faces,facesSafe,facesSafe->getNbOfElems()); vtkIdTypeArray *faceLocations(vtkIdTypeArray::New()); - faceLocations->SetVoidArray(faceLocationsSafe->getPointer(),faceLocationsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); faceLocationsSafe->accessToMemArray().setSpecificDeallocator(0); + AssignDataPointerOther(faceLocations,faceLocationsSafe,faceLocationsSafe->getNbOfElems()); ret->SetCells(cellTypes,cellLocations,cells,faceLocations,faces); faceLocations->Delete(); faces->Delete(); @@ -671,13 +700,7 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt vtkPoints *pts(vtkPoints::New()); vtkDoubleArray *pts2(vtkDoubleArray::New()); pts2->SetNumberOfComponents(3); - if(!statusOfCoords) - { - pts2->SetArray(coordsSafe->getPointer(),coordsSafe->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); - coordsSafe->accessToMemArray().setSpecificDeallocator(0); - } - else - pts2->SetArray(coordsSafe->getPointer(),coordsSafe->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); + AssignDataPointerToVTK(pts2,coordsSafe,statusOfCoords); pts->SetData(pts2); pts2->Delete(); ret->SetPoints(pts); @@ -686,9 +709,8 @@ vtkUnstructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInt return ret; } -vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCartesian(ParaMEDMEM::MEDCMeshMultiLev *mm) const +vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCartesian(MEDCoupling::MEDCMeshMultiLev *mm) const { - const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate::VTK_DATA_ARRAY_FREE; bool isInternal; std::vector< DataArrayDouble * > arrs(mm->buildVTUArrays(isInternal)); vtkDoubleArray *vtkTmp(0); @@ -705,10 +727,7 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte ret->SetDimensions(sizePerAxe[0],sizePerAxe[1],sizePerAxe[2]); vtkTmp=vtkDoubleArray::New(); vtkTmp->SetNumberOfComponents(1); - if(isInternal) - vtkTmp->SetArray(arrs[0]->getPointer(),arrs[0]->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - else - { vtkTmp->SetArray(arrs[0]->getPointer(),arrs[0]->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); arrs[0]->accessToMemArray().setSpecificDeallocator(0); } + AssignDataPointerToVTK(vtkTmp,arrs[0],isInternal); ret->SetXCoordinates(vtkTmp); vtkTmp->Delete(); arrs[0]->decrRef(); @@ -716,10 +735,7 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte { vtkTmp=vtkDoubleArray::New(); vtkTmp->SetNumberOfComponents(1); - if(isInternal) - vtkTmp->SetArray(arrs[1]->getPointer(),arrs[1]->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - else - { vtkTmp->SetArray(arrs[1]->getPointer(),arrs[1]->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); arrs[1]->accessToMemArray().setSpecificDeallocator(0); } + AssignDataPointerToVTK(vtkTmp,arrs[1],isInternal); ret->SetYCoordinates(vtkTmp); vtkTmp->Delete(); arrs[1]->decrRef(); @@ -728,10 +744,7 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte { vtkTmp=vtkDoubleArray::New(); vtkTmp->SetNumberOfComponents(1); - if(isInternal) - vtkTmp->SetArray(arrs[2]->getPointer(),arrs[2]->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - else - { vtkTmp->SetArray(arrs[2]->getPointer(),arrs[2]->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); arrs[2]->accessToMemArray().setSpecificDeallocator(0); } + AssignDataPointerToVTK(vtkTmp,arrs[2],isInternal); ret->SetZCoordinates(vtkTmp); vtkTmp->Delete(); arrs[2]->decrRef(); @@ -739,9 +752,8 @@ vtkRectilinearGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInte return ret; } -vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCurveLinear(ParaMEDMEM::MEDCurveLinearMeshMultiLev *mm) const +vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolationCurveLinear(MEDCoupling::MEDCurveLinearMeshMultiLev *mm) const { - const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate::VTK_DATA_ARRAY_FREE; int meshStr[3]={1,1,1}; DataArrayDouble *coords(0); std::vector nodeStrct; @@ -760,17 +772,11 @@ vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInter vtkDoubleArray *da(vtkDoubleArray::New()); da->SetNumberOfComponents(3); if(coords->getNumberOfComponents()==3) - { - if(isInternal) - da->SetArray(coords->getPointer(),coords->getNbOfElems(),1,VTK_DATA_ARRAY_FREE);//VTK has not the ownership of double * because MEDLoader main struct has it ! - else - { da->SetArray(coords->getPointer(),coords->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); coords->accessToMemArray().setSpecificDeallocator(0); } - } + AssignDataPointerToVTK(da,coords,isInternal);//if isIntenal==True VTK has not the ownership of double * because MEDLoader main struct has it ! else { - MEDCouplingAutoRefCountObjectPtr coords2(coords->changeNbOfComponents(3,0.)); - da->SetArray(coords2->getPointer(),coords2->getNbOfElems(),0,VTK_DATA_ARRAY_FREE);//let VTK deal with double * - coords2->accessToMemArray().setSpecificDeallocator(0); + MCAuto coords2(coords->changeNbOfComponents(3,0.)); + AssignDataPointerToVTK(da,coords2,false);//let VTK deal with double * } coords->decrRef(); vtkPoints *points=vtkPoints::New(); @@ -781,13 +787,12 @@ vtkStructuredGrid *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInter return ret; } -vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDFileMeshes *meshes) const +vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDFileMeshes *meshes) const { - const int VTK_DATA_ARRAY_FREE=vtkDataArrayTemplate::VTK_DATA_ARRAY_FREE; vtkDataSet *ret(0); //_fsp->isDataSetSupportEqualToThePreviousOne(i,globs); - MEDCouplingAutoRefCountObjectPtr mml(_fsp->buildFromScratchDataSetSupport(0,globs));//0=timestep Id. Make the hypothesis that support does not change - MEDCouplingAutoRefCountObjectPtr mml2(mml->prepare()); + MCAuto mml(_fsp->buildFromScratchDataSetSupport(0,globs));//0=timestep Id. Make the hypothesis that support does not change + MCAuto mml2(mml->prepare()); MEDMeshMultiLev *ptMML2(mml2); if(!_cached_ds) { @@ -828,10 +833,7 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio vtkIntArray *vtkTab(vtkIntArray::New()); vtkTab->SetNumberOfComponents(1); vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_CELL_NAME); - if(noCpyFamCells) - vtkTab->SetArray(famCells->getPointer(),famCells->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - else - { vtkTab->SetArray(famCells->getPointer(),famCells->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); famCells->accessToMemArray().setSpecificDeallocator(0); } + AssignDataPointerToVTK(vtkTab,famCells,noCpyFamCells); ret->GetCellData()->AddArray(vtkTab); vtkTab->Delete(); famCells->decrRef(); @@ -842,10 +844,7 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio vtkIntArray *vtkTab(vtkIntArray::New()); vtkTab->SetNumberOfComponents(1); vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::NUM_ID_CELL_NAME); - if(noCpyNumCells) - vtkTab->SetArray(numCells->getPointer(),numCells->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - else - { vtkTab->SetArray(numCells->getPointer(),numCells->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); numCells->accessToMemArray().setSpecificDeallocator(0); } + AssignDataPointerToVTK(vtkTab,numCells,noCpyNumCells); ret->GetCellData()->AddArray(vtkTab); vtkTab->Delete(); numCells->decrRef(); @@ -859,10 +858,7 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio vtkIntArray *vtkTab(vtkIntArray::New()); vtkTab->SetNumberOfComponents(1); vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::FAMILY_ID_NODE_NAME); - if(noCpyFamNodes) - vtkTab->SetArray(famNodes->getPointer(),famNodes->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - else - { vtkTab->SetArray(famNodes->getPointer(),famNodes->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); famNodes->accessToMemArray().setSpecificDeallocator(0); } + AssignDataPointerToVTK(vtkTab,famNodes,noCpyFamNodes); ret->GetPointData()->AddArray(vtkTab); vtkTab->Delete(); famNodes->decrRef(); @@ -873,14 +869,23 @@ vtkDataSet *MEDFileFieldRepresentationLeaves::buildVTKInstanceNoTimeInterpolatio vtkIntArray *vtkTab(vtkIntArray::New()); vtkTab->SetNumberOfComponents(1); vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::NUM_ID_NODE_NAME); - if(noCpyNumNodes) - vtkTab->SetArray(numNodes->getPointer(),numNodes->getNbOfElems(),1,VTK_DATA_ARRAY_FREE); - else - { vtkTab->SetArray(numNodes->getPointer(),numNodes->getNbOfElems(),0,VTK_DATA_ARRAY_FREE); numNodes->accessToMemArray().setSpecificDeallocator(0); } + AssignDataPointerToVTK(vtkTab,numNodes,noCpyNumNodes); ret->GetPointData()->AddArray(vtkTab); vtkTab->Delete(); numNodes->decrRef(); } + // Global Node Ids if any ! (In // mode) + DataArrayInt *gni(ptMML2->retrieveGlobalNodeIdsIfAny()); + if(gni) + { + vtkIntArray *vtkTab(vtkIntArray::New()); + vtkTab->SetNumberOfComponents(1); + vtkTab->SetName(MEDFileFieldRepresentationLeavesArrays::GLOBAL_NODE_ID_NAME); + AssignDataPointerToVTK(vtkTab,gni,false); + ret->GetPointData()->AddArray(vtkTab); + vtkTab->Delete(); + gni->decrRef(); + } return ret; } @@ -1112,10 +1117,10 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam int nbMeshes(_ms->getNumberOfMeshes()); for(int i=0;igetMeshAtPos(i)); - ParaMEDMEM::MEDFileUMesh *tmp2(dynamic_cast(tmp)); + MEDCoupling::MEDFileMesh *tmp(_ms->getMeshAtPos(i)); + MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast(tmp)); if(tmp2) - MEDCouplingAutoRefCountObjectPtr tmp3(tmp2->zipCoords()); + MCAuto tmp3(tmp2->zipCoords()); } _fields=MEDFileFields::LoadPartOf(fileName,false,_ms);//false is important to not read the values #else @@ -1126,22 +1131,22 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam } else { - MEDCouplingAutoRefCountObjectPtr sr(ParaMEDMEM::SauvReader::New(fileName)); - MEDCouplingAutoRefCountObjectPtr mfd(sr->loadInMEDFileDS()); + MCAuto sr(MEDCoupling::SauvReader::New(fileName)); + MCAuto mfd(sr->loadInMEDFileDS()); _ms=mfd->getMeshes(); _ms->incrRef(); int nbMeshes(_ms->getNumberOfMeshes()); for(int i=0;igetMeshAtPos(i)); - ParaMEDMEM::MEDFileUMesh *tmp2(dynamic_cast(tmp)); + MEDCoupling::MEDFileMesh *tmp(_ms->getMeshAtPos(i)); + MEDCoupling::MEDFileUMesh *tmp2(dynamic_cast(tmp)); if(tmp2) tmp2->forceComputationOfParts(); } _fields=mfd->getFields(); - if((ParaMEDMEM::MEDFileFields *)_fields) + if((MEDCoupling::MEDFileFields *)_fields) _fields->incrRef(); } - if(!((ParaMEDMEM::MEDFileFields *)_fields)) + if(!((MEDCoupling::MEDFileFields *)_fields)) { _fields=BuildFieldFromMeshes(_ms); } @@ -1152,29 +1157,29 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam _ms->cartesianizeMe(); _fields->removeFieldsWithoutAnyTimeStep(); std::vector meshNames(_ms->getMeshesNames()); - std::vector< MEDCouplingAutoRefCountObjectPtr > fields_per_mesh(meshNames.size()); + std::vector< MCAuto > fields_per_mesh(meshNames.size()); for(std::size_t i=0;ipartOfThisLyingOnSpecifiedMeshName(meshNames[i].c_str()); } - std::vector< MEDCouplingAutoRefCountObjectPtr > allFMTSLeavesToDisplaySafe; + std::vector< MCAuto > allFMTSLeavesToDisplaySafe; std::size_t k(0); - for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator fields=fields_per_mesh.begin();fields!=fields_per_mesh.end();fields++) + for(std::vector< MCAuto >::const_iterator fields=fields_per_mesh.begin();fields!=fields_per_mesh.end();fields++) { for(int j=0;j<(*fields)->getNumberOfFields();j++) { - MEDCouplingAutoRefCountObjectPtr fmts((*fields)->getFieldAtPos((int)j)); - std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > tmp(fmts->splitDiscretizations()); + MCAuto fmts((*fields)->getFieldAtPos((int)j)); + std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > tmp(fmts->splitDiscretizations()); // EDF 8655 - for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > >::const_iterator it=tmp.begin();it!=tmp.end();it++) + for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > >::const_iterator it=tmp.begin();it!=tmp.end();it++) { if(!(*it)->presenceOfMultiDiscPerGeoType()) allFMTSLeavesToDisplaySafe.push_back(*it); else {// The case of some parts of field have more than one discretization per geo type. - std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > subTmp((*it)->splitMultiDiscrPerGeoTypes()); + std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > > subTmp((*it)->splitMultiDiscrPerGeoTypes()); std::size_t it0Cnt(0); - for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > >::iterator it0=subTmp.begin();it0!=subTmp.end();it0++,it0Cnt++)//not const because setName + for(std::vector< MCAuto< MEDFileAnyTypeFieldMultiTS > >::iterator it0=subTmp.begin();it0!=subTmp.end();it0++,it0Cnt++)//not const because setName { std::ostringstream oss; oss << (*it0)->getName() << "_" << std::setfill('M') << std::setw(3) << it0Cnt; (*it0)->setName(oss.str()); @@ -1192,7 +1197,7 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam } std::vector< std::vector > allFMTSLeavesPerTimeSeries(MEDFileAnyTypeFieldMultiTS::SplitIntoCommonTimeSeries(allFMTSLeavesToDisplay)); // memory safety part - std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr > > allFMTSLeavesPerTimeSeriesSafe(allFMTSLeavesPerTimeSeries.size()); + std::vector< std::vector< MCAuto > > allFMTSLeavesPerTimeSeriesSafe(allFMTSLeavesPerTimeSeries.size()); for(std::size_t j=0;j meshNamesLoc; - std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr > > splitByMeshName; + std::vector< std::vector< MCAuto > > splitByMeshName; for(std::size_t j=0;jgetMeshName()); @@ -1225,13 +1230,13 @@ void MEDFileFieldRepresentationTree::loadMainStructureOfFile(const char *fileNam _data_structure[i].resize(meshNamesLoc.size()); for(std::size_t j=0;j > fsp; + std::vector< MCAuto > fsp; std::vector< MEDFileAnyTypeFieldMultiTS *> sbmn(splitByMeshName[j].size()); for(std::size_t k=0;k > commonSupSplit(MEDFileAnyTypeFieldMultiTS::SplitPerCommonSupport(sbmn,_ms->getMeshWithName(meshNamesLoc[j].c_str()),fsp)); - std::vector< std::vector< MEDCouplingAutoRefCountObjectPtr > > commonSupSplitSafe(commonSupSplit.size()); + std::vector< std::vector< MCAuto > > commonSupSplitSafe(commonSupSplit.size()); this->_data_structure[i][j].resize(commonSupSplit.size()); for(std::size_t k=0;k MEDFileFieldRepresentationTree::dumpState() const return ret; } -void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms, ParaMEDMEM::MEDFileFields *ret) +void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms, MEDCoupling::MEDFileFields *ret) { if(!ret) throw INTERP_KERNEL::Exception("MEDFileFieldRepresentationTree::AppendFieldFromMeshes : internal error ! NULL ret !"); @@ -1417,7 +1422,7 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MED { MEDFileMesh *mm(ms->getMeshAtPos(i)); std::vector levs(mm->getNonEmptyLevels()); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f1tsMultiLev(ParaMEDMEM::MEDFileField1TS::New()); + MEDCoupling::MCAuto f1tsMultiLev(MEDCoupling::MEDFileField1TS::New()); MEDFileUMesh *mmu(dynamic_cast(mm)); if(mmu) { @@ -1426,10 +1431,10 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MED std::vector gts(mmu->getGeoTypesAtLevel(*it)); for(std::vector::const_iterator gt=gts.begin();gt!=gts.end();gt++) { - ParaMEDMEM::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt)); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); + MEDCoupling::MEDCouplingMesh *m(mmu->getDirectUndergroundSingleGeoTypeMesh(*gt)); + MEDCoupling::MCAuto f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS)); f->setMesh(m); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); + MEDCoupling::MCAuto arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); arr->iota(); f->setArray(arr); @@ -1442,10 +1447,10 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MED std::vector levsExt(mm->getNonEmptyLevelsExt()); if(levsExt.size()==levs.size()+1) { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getMeshAtLevel(1)); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_NODES)); + MEDCoupling::MCAuto m(mm->getMeshAtLevel(1)); + MEDCoupling::MCAuto f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_NODES)); f->setMesh(m); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes()); + MEDCoupling::MCAuto arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(m->getNumberOfNodes()); arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); arr->iota(); f->setArray(arr); f->setName(BuildAUniqueArrayNameForMesh(mm->getName(),ret)); @@ -1457,10 +1462,10 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MED } else { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr m(mm->getMeshAtLevel(0)); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr f(ParaMEDMEM::MEDCouplingFieldDouble::New(ParaMEDMEM::ON_CELLS)); + MEDCoupling::MCAuto m(mm->getMeshAtLevel(0)); + MEDCoupling::MCAuto f(MEDCoupling::MEDCouplingFieldDouble::New(MEDCoupling::ON_CELLS)); f->setMesh(m); - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr arr(ParaMEDMEM::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); + MEDCoupling::MCAuto arr(MEDCoupling::DataArrayDouble::New()); arr->alloc(f->getNumberOfTuplesExpected()); arr->setInfoOnComponent(0,std::string(COMPO_STR_TO_LOCATE_MESH_DA)); arr->iota(); f->setArray(arr); @@ -1468,13 +1473,13 @@ void MEDFileFieldRepresentationTree::AppendFieldFromMeshes(const ParaMEDMEM::MED f1tsMultiLev->setFieldNoProfileSBT(f); } // - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr fmtsMultiLev(ParaMEDMEM::MEDFileFieldMultiTS::New()); + MEDCoupling::MCAuto fmtsMultiLev(MEDCoupling::MEDFileFieldMultiTS::New()); fmtsMultiLev->pushBackTimeStep(f1tsMultiLev); ret->pushField(fmtsMultiLev); } } -std::string MEDFileFieldRepresentationTree::BuildAUniqueArrayNameForMesh(const std::string& meshName, const ParaMEDMEM::MEDFileFields *ret) +std::string MEDFileFieldRepresentationTree::BuildAUniqueArrayNameForMesh(const std::string& meshName, const MEDCoupling::MEDFileFields *ret) { const char KEY_STR_TO_AVOID_COLLIDE[]="MESH@"; if(!ret) @@ -1488,9 +1493,9 @@ std::string MEDFileFieldRepresentationTree::BuildAUniqueArrayNameForMesh(const s return tmpName; } -ParaMEDMEM::MEDFileFields *MEDFileFieldRepresentationTree::BuildFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms) +MEDCoupling::MEDFileFields *MEDFileFieldRepresentationTree::BuildFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms) { - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr ret(ParaMEDMEM::MEDFileFields::New()); + MEDCoupling::MCAuto ret(MEDCoupling::MEDFileFields::New()); AppendFieldFromMeshes(ms,ret); return ret.retn(); } diff --git a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx index 6e9cfa9d..96f94534 100644 --- a/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx +++ b/src/Plugins/MEDReader/IO/MEDFileFieldRepresentationTree.hxx @@ -46,12 +46,12 @@ class MEDTimeReq; class ELGACmp { public: - vtkIdTypeArray *findOrCreate(const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds, bool& isNew) const; + vtkIdTypeArray *findOrCreate(const MEDCoupling::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds, bool& isNew) const; void appendELGAIfAny(vtkDataSet *ds) const; ~ELGACmp(); private: vtkIdTypeArray *isExisting(const std::vector& locsReallyUsed, vtkDoubleArray *vtkd) const; - vtkIdTypeArray *createNew(const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds) const; + vtkIdTypeArray *createNew(const MEDCoupling::MEDFileFieldGlobsReal *globs, const std::vector& locsReallyUsed, vtkDoubleArray *vtkd, vtkDataSet *ds) const; private: //! size of _loc_names is equal to _elgas. mutable std::vector< std::vector > _loc_names; @@ -61,11 +61,11 @@ private: mutable std::vector< std::vector< std::pair< vtkQuadratureSchemeDefinition *, unsigned char > > > _defs; }; -class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeavesArrays : public ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr +class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeavesArrays : public MEDCoupling::MCAuto { public: MEDFileFieldRepresentationLeavesArrays(); - MEDFileFieldRepresentationLeavesArrays(const ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr& arr); + MEDFileFieldRepresentationLeavesArrays(const MEDCoupling::MCAuto& arr); MEDFileFieldRepresentationLeavesArrays& operator=(const MEDFileFieldRepresentationLeavesArrays& other); int getId() const; void setId(int& id) const; @@ -75,7 +75,7 @@ public: bool setStatus(bool status) const; std::string getZeName() const; const char *getZeNameC() const; - void appendFields(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDMeshMultiLev *mml, const ParaMEDMEM::MEDFileMeshStruct *mst, vtkDataSet *ds) const; + void appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshStruct *mst, vtkDataSet *ds) const; void appendELGAIfAny(vtkDataSet *ds) const; public: static const char ZE_SEP[]; @@ -85,6 +85,7 @@ public: static const char NUM_ID_CELL_NAME[]; static const char FAMILY_ID_NODE_NAME[]; static const char NUM_ID_NODE_NAME[]; + static const char GLOBAL_NODE_ID_NAME[]; private: mutable bool _activated; mutable int _id; @@ -97,15 +98,15 @@ class MEDLOADERFORPV_EXPORT MEDFileFieldRepresentationLeaves { public: MEDFileFieldRepresentationLeaves(); - MEDFileFieldRepresentationLeaves(const std::vector< ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr >& arr, - const ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr& fsp); + MEDFileFieldRepresentationLeaves(const std::vector< MEDCoupling::MCAuto >& arr, + const MEDCoupling::MCAuto& fsp); ~MEDFileFieldRepresentationLeaves(); bool empty() const; void setId(int& id) const; std::string getMeshName() const; int getNumberOfArrays() const; int getNumberOfTS() const; - void feedSIL(const ParaMEDMEM::MEDFileMeshes *ms, const std::string& meshName, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const; + void feedSIL(const MEDCoupling::MEDFileMeshes *ms, const std::string& meshName, vtkMutableDirectedGraph* sil, vtkIdType root, vtkVariantArray *edge, std::vector& names) const; void computeFullNameInLeaves(const std::string& tsName, const std::string& meshName, const std::string& comSupStr) const; bool containId(int id) const; bool containZeName(const char *name, int& id) const; @@ -117,15 +118,15 @@ public: std::vector getTimeSteps(const TimeKeeper& tk) const; std::vector< std::pair > getTimeStepsInCoarseMEDFileFormat(std::vector& ts) const; std::string getHumanReadableOverviewOfTS() const; - vtkDataSet *buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDFileMeshes *meshes) const; + vtkDataSet *buildVTKInstanceNoTimeInterpolation(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDFileMeshes *meshes) const; private: - vtkUnstructuredGrid *buildVTKInstanceNoTimeInterpolationUnstructured(ParaMEDMEM::MEDUMeshMultiLev *mm) const; - vtkRectilinearGrid *buildVTKInstanceNoTimeInterpolationCartesian(ParaMEDMEM::MEDCMeshMultiLev *mm) const; - vtkStructuredGrid *buildVTKInstanceNoTimeInterpolationCurveLinear(ParaMEDMEM::MEDCurveLinearMeshMultiLev *mm) const; - void appendFields(const MEDTimeReq *tr, const ParaMEDMEM::MEDFileFieldGlobsReal *globs, const ParaMEDMEM::MEDMeshMultiLev *mml, const ParaMEDMEM::MEDFileMeshes *meshes, vtkDataSet *ds) const; + vtkUnstructuredGrid *buildVTKInstanceNoTimeInterpolationUnstructured(MEDCoupling::MEDUMeshMultiLev *mm) const; + vtkRectilinearGrid *buildVTKInstanceNoTimeInterpolationCartesian(MEDCoupling::MEDCMeshMultiLev *mm) const; + vtkStructuredGrid *buildVTKInstanceNoTimeInterpolationCurveLinear(MEDCoupling::MEDCurveLinearMeshMultiLev *mm) const; + void appendFields(const MEDTimeReq *tr, const MEDCoupling::MEDFileFieldGlobsReal *globs, const MEDCoupling::MEDMeshMultiLev *mml, const MEDCoupling::MEDFileMeshes *meshes, vtkDataSet *ds) const; private: std::vector _arrays; - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr _fsp; + MEDCoupling::MCAuto _fsp; mutable vtkDataSet *_cached_ds; }; @@ -164,15 +165,15 @@ public: private: const MEDFileFieldRepresentationLeavesArrays& getLeafArr(int id) const; const MEDFileFieldRepresentationLeaves& getTheSingleActivated(int& lev0, int& lev1, int& lev2) const; - static ParaMEDMEM::MEDFileFields *BuildFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms); - static void AppendFieldFromMeshes(const ParaMEDMEM::MEDFileMeshes *ms, ParaMEDMEM::MEDFileFields *ret); - static std::string BuildAUniqueArrayNameForMesh(const std::string& meshName, const ParaMEDMEM::MEDFileFields *ret); + static MEDCoupling::MEDFileFields *BuildFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms); + static void AppendFieldFromMeshes(const MEDCoupling::MEDFileMeshes *ms, MEDCoupling::MEDFileFields *ret); + static std::string BuildAUniqueArrayNameForMesh(const std::string& meshName, const MEDCoupling::MEDFileFields *ret); static std::vector SplitFieldNameIntoParts(const std::string& fullFieldName, char sep); private: // 1st : timesteps, 2nd : meshName, 3rd : common support std::vector< std::vector< std::vector< MEDFileFieldRepresentationLeaves > > > _data_structure; - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr _ms; - ParaMEDMEM::MEDCouplingAutoRefCountObjectPtr _fields; + MEDCoupling::MCAuto _ms; + MEDCoupling::MCAuto _fields; }; class MEDLOADERFORPV_EXPORT TimeKeeper diff --git a/src/Plugins/MEDReader/IO/vtkExtractCellType.cxx b/src/Plugins/MEDReader/IO/vtkExtractCellType.cxx index 5152a81c..d79200a2 100644 --- a/src/Plugins/MEDReader/IO/vtkExtractCellType.cxx +++ b/src/Plugins/MEDReader/IO/vtkExtractCellType.cxx @@ -341,13 +341,13 @@ int vtkExtractCellType::RequestInformation(vtkInformation *request, vtkInformati const std::map::const_iterator it(m.find(vtkCt)); if(it==m.end()) { - const unsigned char *pos(std::find(ParaMEDMEM::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE,ParaMEDMEM::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE+ParaMEDMEM::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE_LGTH,vtkCt)); - if(pos==ParaMEDMEM::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE+ParaMEDMEM::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE_LGTH) + const unsigned char *pos(std::find(MEDCoupling::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE,MEDCoupling::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE+MEDCoupling::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE_LGTH,vtkCt)); + if(pos==MEDCoupling::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE+MEDCoupling::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE_LGTH) { vtkDebugMacro("vtkExtractCellType::RequestInformation : cell #" << cellId << " has unrecognized type !"); return 0; } - m[vtkCt]=(INTERP_KERNEL::NormalizedCellType)std::distance(ParaMEDMEM::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE,pos); + m[vtkCt]=(INTERP_KERNEL::NormalizedCellType)std::distance(MEDCoupling::MEDMeshMultiLev::PARAMEDMEM_2_VTKTYPE,pos); } } this->Internal->loadFrom(m); diff --git a/src/Plugins/MEDReader/ParaViewPlugin/CMakeLists.txt b/src/Plugins/MEDReader/ParaViewPlugin/CMakeLists.txt index f92e1847..2f948dad 100644 --- a/src/Plugins/MEDReader/ParaViewPlugin/CMakeLists.txt +++ b/src/Plugins/MEDReader/ParaViewPlugin/CMakeLists.txt @@ -21,7 +21,7 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../IO ) IF(PARAVIEW_BUILD_QT_GUI) - QT4_WRAP_UI(CLIENT_UI_SRCS + QT_WRAP_UIC(CLIENT_UI_SRCS Resources/UI/MEDReaderVectorsWidget.ui Resources/UI/MEDReaderTimeModeWidget.ui) @@ -41,7 +41,7 @@ IF(PARAVIEW_BUILD_QT_GUI) pqMEDReaderTimesFlagsWidget.cxx pqMEDReaderFieldsWidget.cxx) - QT4_WRAP_CPP(MOC_SRCS + QT_WRAP_MOC(MOC_SRCS pqExtractGroupFieldsWidget.h pqAbstractFieldsWidget.h VectBoolSpreadSheet.h diff --git a/src/Plugins/MEDReader/ParaViewPlugin/VectBoolSpreadSheet.cxx b/src/Plugins/MEDReader/ParaViewPlugin/VectBoolSpreadSheet.cxx index 839136eb..8f560beb 100644 --- a/src/Plugins/MEDReader/ParaViewPlugin/VectBoolSpreadSheet.cxx +++ b/src/Plugins/MEDReader/ParaViewPlugin/VectBoolSpreadSheet.cxx @@ -217,8 +217,13 @@ void VectBoolSpreadSheet::init() this->verticalHeader()->setMinimumSectionSize(2); this->verticalHeader()->setDefaultSectionSize(2); this->setItemDelegate(_delegate); +#if QT_VERSION < QT_VERSION_CHECK(5, 0, 0) this->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents); this->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); +#else + this->verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); + this->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); +#endif this->resizeColumnsToContents(); this->resizeRowsToContents(); //this->verticalHeader()->hide(); diff --git a/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderFieldsWidget.cxx b/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderFieldsWidget.cxx index 4064c9c6..f06f0616 100644 --- a/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderFieldsWidget.cxx +++ b/src/Plugins/MEDReader/ParaViewPlugin/pqMEDReaderFieldsWidget.cxx @@ -92,107 +92,109 @@ void pqMEDReaderFieldsWidget::loadTreeWidgetItems() ts->setData(0, Qt::ToolTipRole, QString(names->GetValue(tsId))); // MAIL Node - vtkIdType mailId = tree->GetChild(tsxId, 0); - pqTreeWidgetItemObject *mail = new pqTreeWidgetItemObject(ts, QStringList()); - this->NItems++; - QString mailName = QString(names->GetValue(mailId)); - mail->setText(0, mailName); - mail->setData(0, Qt::ToolTipRole, QString(names->GetValue(mailId))); - - QString propertyBaseName = tsxName + "/" + mailName + "/"; - - // ComsupX node - for (int comsupi = 0; comsupi < tree->GetNumberOfChildren(mailId); comsupi++) + for (int maili = 0; maili < tree->GetNumberOfChildren(tsxId); maili++) { - vtkIdType comSupId = tree->GetChild(mailId, comsupi); - pqTreeWidgetItemObject *comsup = new pqTreeWidgetItemObject(mail, QStringList()); + vtkIdType mailId = tree->GetChild(tsxId, maili); + pqTreeWidgetItemObject *mail = new pqTreeWidgetItemObject(ts, QStringList()); this->NItems++; - QString comsupName = QString(names->GetValue(comSupId)); - comsup->setText(0, comsupName); - - // ComSup tooltip - vtkIdType geoTypeId = tree->GetChild(comSupId, 1); - QString comSupToolTipName(names->GetValue(comSupId)); - for (int geoi = 0; geoi < tree->GetNumberOfChildren(geoTypeId); geoi++) - { - comSupToolTipName += QString("\n- %1").arg( - QString(names->GetValue(tree->GetChild(geoTypeId, geoi)))); - } - comsup->setData(0, Qt::ToolTipRole, comSupToolTipName); + QString mailName = QString(names->GetValue(mailId)); + mail->setText(0, mailName); + mail->setData(0, Qt::ToolTipRole, QString(names->GetValue(mailId))); - comsup->setFlags(comsup->flags() | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable); - comsup->setChecked(true); - QObject::connect(comsup, SIGNAL(checkedStateChanged(bool)), this, SLOT(updateChecks())); - this->UniqueCheckedItems.push_back(comsup); + QString propertyBaseName = tsxName + "/" + mailName + "/"; - QString fullComsupName = propertyBaseName + comsupName + "/"; - // Arrs node - vtkIdType arrId = tree->GetChild(comSupId, 0); - for (int arri = 0; arri < tree->GetNumberOfChildren(arrId); arri++) + // ComsupX node + for (int comsupi = 0; comsupi < tree->GetNumberOfChildren(mailId); comsupi++) { - pqTreeWidgetItemObject *array = new pqTreeWidgetItemObject(comsup, QStringList()); + vtkIdType comSupId = tree->GetChild(mailId, comsupi); + pqTreeWidgetItemObject *comsup = new pqTreeWidgetItemObject(mail, QStringList()); this->NItems++; + QString comsupName = QString(names->GetValue(comSupId)); + comsup->setText(0, comsupName); - vtkIdType arrayId = tree->GetChild(arrId, arri); - std::string str = names->GetValue(arrayId); - this->ItemMap[fullComsupName + QString(str.c_str())] = array; - - const char* separator = vtkMEDReader::GetSeparator(); - size_t pos = str.find(separator); - std::string name = str.substr(0, pos); - - array->setText(0, QString(name.c_str())); - array->setFlags(array->flags() | Qt::ItemIsUserCheckable); - array->setChecked(true); - - // Special Field - if (tree->GetNumberOfChildren(arrayId) != 0) + // ComSup tooltip + vtkIdType geoTypeId = tree->GetChild(comSupId, 1); + QString comSupToolTipName(names->GetValue(comSupId)); + for (int geoi = 0; geoi < tree->GetNumberOfChildren(geoTypeId); geoi++) { - QFont font; - font.setItalic(true); - font.setUnderline(true); - array->setData(0, Qt::FontRole, QVariant(font)); - - array->setData(0, Qt::ToolTipRole, - QString("Whole \" %1\" mesh").arg(name.c_str())); - array->setData(0, Qt::DecorationRole, - QPixmap(":/ParaViewResources/Icons/pqCellDataForWholeMesh16.png")); + comSupToolTipName += QString("\n- %1").arg( + QString(names->GetValue(tree->GetChild(geoTypeId, geoi)))); } - // Standard Field - else + comsup->setData(0, Qt::ToolTipRole, comSupToolTipName); + + comsup->setFlags(comsup->flags() | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable); + comsup->setChecked(true); + QObject::connect(comsup, SIGNAL(checkedStateChanged(bool)), this, SLOT(updateChecks())); + this->UniqueCheckedItems.push_back(comsup); + + QString fullComsupName = propertyBaseName + comsupName + "/"; + // Arrs node + vtkIdType arrId = tree->GetChild(comSupId, 0); + for (int arri = 0; arri < tree->GetNumberOfChildren(arrId); arri++) { - std::string spatialDiscr = str.substr(pos + strlen(separator)); - QString tooltip = QString(name.c_str() + QString(" (") + - spatialDiscr.c_str() + QString(")")); - array->setData(0, Qt::ToolTipRole, tooltip); + pqTreeWidgetItemObject *array = new pqTreeWidgetItemObject(comsup, QStringList()); + this->NItems++; - QPixmap pix; - if (spatialDiscr == "P0") - { - pix.load(":/ParaViewResources/Icons/pqCellData16.png"); - } - else if (spatialDiscr == "P1") - { - pix.load(":/ParaViewResources/Icons/pqPointData16.png"); - } - else if (spatialDiscr == "GAUSS") + vtkIdType arrayId = tree->GetChild(arrId, arri); + std::string str = names->GetValue(arrayId); + this->ItemMap[fullComsupName + QString(str.c_str())] = array; + + const char* separator = vtkMEDReader::GetSeparator(); + size_t pos = str.find(separator); + std::string name = str.substr(0, pos); + + array->setText(0, QString(name.c_str())); + array->setFlags(array->flags() | Qt::ItemIsUserCheckable); + array->setChecked(true); + + // Special Field + if (tree->GetNumberOfChildren(arrayId) != 0) { - pix.load(":/ParaViewResources/Icons/pqQuadratureData16.png"); + QFont font; + font.setItalic(true); + font.setUnderline(true); + array->setData(0, Qt::FontRole, QVariant(font)); + + array->setData(0, Qt::ToolTipRole, + QString("Whole \" %1\" mesh").arg(name.c_str())); + array->setData(0, Qt::DecorationRole, + QPixmap(":/ParaViewResources/Icons/pqCellDataForWholeMesh16.png")); } - else if (spatialDiscr == "GSSNE") + // Standard Field + else { - pix.load(":/ParaViewResources/Icons/pqElnoData16.png"); + std::string spatialDiscr = str.substr(pos + strlen(separator)); + QString tooltip = QString(name.c_str() + QString(" (") + + spatialDiscr.c_str() + QString(")")); + array->setData(0, Qt::ToolTipRole, tooltip); + + QPixmap pix; + if (spatialDiscr == "P0") + { + pix.load(":/ParaViewResources/Icons/pqCellData16.png"); + } + else if (spatialDiscr == "P1") + { + pix.load(":/ParaViewResources/Icons/pqPointData16.png"); + } + else if (spatialDiscr == "GAUSS") + { + pix.load(":/ParaViewResources/Icons/pqQuadratureData16.png"); + } + else if (spatialDiscr == "GSSNE") + { + pix.load(":/ParaViewResources/Icons/pqElnoData16.png"); + } + array->setData(0, Qt::DecorationRole, pix); } - array->setData(0, Qt::DecorationRole, pix); - } - // Connection and updating checks for each item - QObject::connect(array, SIGNAL(checkedStateChanged(bool)), this, SLOT(updateChecks())); - nLeaves++; + // Connection and updating checks for each item + QObject::connect(array, SIGNAL(checkedStateChanged(bool)), this, SLOT(updateChecks())); + nLeaves++; + } } } } - // Expand tree this->TreeWidget->expandAll(); } diff --git a/src/Plugins/MEDReader/Test/Baselines/testMEDReader20.png b/src/Plugins/MEDReader/Test/Baselines/testMEDReader20.png new file mode 100644 index 00000000..c27a45f9 Binary files /dev/null and b/src/Plugins/MEDReader/Test/Baselines/testMEDReader20.png differ diff --git a/src/Plugins/MEDReader/Test/CMakeLists.txt b/src/Plugins/MEDReader/Test/CMakeLists.txt index d3ecf847..803fe6d0 100644 --- a/src/Plugins/MEDReader/Test/CMakeLists.txt +++ b/src/Plugins/MEDReader/Test/CMakeLists.txt @@ -17,21 +17,13 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(TEST_NUMBERS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19) +SET(TEST_NUMBERS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20) SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/MEDReader) +SET(BASELINES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Baselines") IF(KW_TESTING_PLATFORM) -FOREACH(tfile ${TEST_NUMBERS}) - INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/testMEDReader${tfile}.py - DESTINATION ${TEST_INSTALL_DIRECTORY}) -ENDFOREACH() - - INSTALL(FILES CTestTestfileInstall.cmake - DESTINATION ${TEST_INSTALL_DIRECTORY} - RENAME CTestTestfile.cmake) - cmake_minimum_required(VERSION 2.7) find_package(ParaView REQUIRED) @@ -54,13 +46,9 @@ set(PARAVIEW_CLIENT "${PARAVIEW_BIN_DIR}/paraview") set(PARAVIEW_SERVER "${PARAVIEW_BIN_DIR}/pvserver") set(PVPYTHON "${PARAVIEW_BIN_DIR}/pvpython") -set(BASELINES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/Baselines") set(PYTHON_SCRIPTS_DIR "${CMAKE_CURRENT_SOURCE_DIR}") set(TEMP_DIR "${CMAKE_CURRENT_BINARY_DIR}/Testing/Temporary") -# Application tests -SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/MEDReader) - if(NOT EXISTS ${TEMP_DIR}) file(MAKE_DIRECTORY ${TEMP_DIR}) endif() @@ -98,12 +86,24 @@ ELSE(KW_TESTING_PLATFORM) SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env) FOREACH(tfile ${TEST_NUMBERS}) - ADD_TEST(testMEDReader${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/testMEDReader${tfile}.py -B ${CMAKE_CURRENT_SOURCE_DIR}/Baselines ) + ADD_TEST(testMEDReader${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/testMEDReader${tfile}.py -B ${BASELINES_DIR} ) SET_TESTS_PROPERTIES(testMEDReader${tfile} PROPERTIES ENVIRONMENT "${tests_env}") ENDFOREACH() ENDIF(KW_TESTING_PLATFORM) + +# Application tests +FOREACH(tfile ${TEST_NUMBERS}) + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/testMEDReader${tfile}.py + DESTINATION ${TEST_INSTALL_DIRECTORY}) +ENDFOREACH() + +FILE(GLOB BASELINE_FILES "${BASELINES_DIR}/*") +FOREACH(baseline_file ${BASELINE_FILES}) + INSTALL(FILES ${baseline_file} DESTINATION ${TEST_INSTALL_DIRECTORY}/Baselines) +ENDFOREACH() + INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) diff --git a/src/Plugins/MEDReader/Test/CTestTestfileInstall.cmake b/src/Plugins/MEDReader/Test/CTestTestfileInstall.cmake index bc62bb7f..ea816efb 100644 --- a/src/Plugins/MEDReader/Test/CTestTestfileInstall.cmake +++ b/src/Plugins/MEDReader/Test/CTestTestfileInstall.cmake @@ -22,10 +22,11 @@ SET(COMPONENT_NAME MEDREADER) SET(TIMEOUT 30) SET(TEST_NUMBERS 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18) +set(BASELINES_DIR "Baselines") FOREACH(tfile ${TEST_NUMBERS}) SET(TEST_NAME MEDREADER_${tfile}) - ADD_TEST(${TEST_NAME} python testMEDReader${tfile}.py) - #ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} testMEDReader${tfile}.py) + ADD_TEST(${TEST_NAME} python testMEDReader${tfile}.py -B ${BASELINES_DIR}) + #ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} testMEDReader${tfile}.py -B ${BASELINES_DIR}) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/src/Plugins/MEDReader/Test/testMEDReader0.py b/src/Plugins/MEDReader/Test/testMEDReader0.py index bbb5938a..3f80e3a1 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader0.py +++ b/src/Plugins/MEDReader/Test/testMEDReader0.py @@ -39,7 +39,7 @@ f0z.setMesh(mz) f0z.setArray(arr0) f0z.setGaussLocalizationOnType(NORM_QUAD9,[-1,-1,1,-1,1,1,-1,1,0,-1,1,0,0,1,-1,0,0,0],[-0.774597,-0.774597,0.774597,-0.774597,0.774597,0.774597,-0.774597,0.774597,0,-0.774597,0.774597,0,0,0.774597,-0.774597,0,0,0,-0.774597,-0.774597,0.774597,-0.774597,0.774597,0.774597,-0.774597,0.774597,0,-0.774597,0.774597,0,0,0.774597,-0.774597,0,0,0,-0.774597,-0.774597,0.774597,-0.774597,0.774597,0.774597,-0.774597,0.774597,0,-0.774597,0.774597,0,0,0.774597,-0.774597,0,0,0],[0.308642,0.308642,0.308642,0.308642,0.493827,0.493827,0.493827,0.493827,0.790123,0.308642,0.308642,0.308642,0.308642,0.493827,0.493827,0.493827,0.493827,0.790123,0.308642,0.308642,0.308642,0.308642,0.493827,0.493827,0.493827,0.493827,0.790123]) f0z.setName("SolutionSIEF_ELGA") -f0z.checkCoherency() +f0z.checkConsistencyLight() ff0z=MEDFileField1TS() ff0z.setFieldNoProfileSBT(f0z) # @@ -48,7 +48,7 @@ arr1.setInfoOnComponents(['VMIS','TRESCA']) f1z=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f1z.setName("SolutionSIEQ_ELNO") f1z.setArray(arr1) f1z.setMesh(mz) -f1z.checkCoherency() +f1z.checkConsistencyLight() ff1z=MEDFileField1TS() ff1z.setFieldNoProfileSBT(f1z) # @@ -56,7 +56,7 @@ arr2=DataArrayDouble([4.938269266683534e-28,-6.232001151245993e-28,1.06022905661 arr2.setInfoOnComponents(['DRX','DRZ']) f2z=MEDCouplingFieldDouble(ON_NODES) ; f2z.setName("SolutionDEPL") ; f2z.setArray(arr2) f2z.setMesh(mz) -f2z.checkCoherency() +f2z.checkConsistencyLight() ff2z=MEDFileField1TS() ff2z.setFieldNoProfileSBT(f2z) # diff --git a/src/Plugins/MEDReader/Test/testMEDReader1.py b/src/Plugins/MEDReader/Test/testMEDReader1.py index 257cbab4..cbee37b9 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader1.py +++ b/src/Plugins/MEDReader/Test/testMEDReader1.py @@ -33,26 +33,26 @@ m.allocateCells() m.insertNextCell(NORM_QUAD4,[0,5,3,2]) m.insertNextCell(NORM_QUAD4,[4,2,3,1]) m.finishInsertingCells() -MEDLoader.WriteMesh(fname,m,True) +WriteMesh(fname,m,True) # f0=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f0.setMesh(m) ; f0.setTimeUnit("ms") f0.setTime(1.1,1,1) f0.setName("myELNOField") arr=DataArrayDouble([7,5,3,1,5,3,1,7]) ; arr.setInfoOnComponent(0,"Comp0") f0.setArray(arr) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f0) +WriteFieldUsingAlreadyWrittenMesh(fname,f0) # f0.setTime(2.2,2,1) arr=DataArrayDouble([1,7,5,3,7,5,3,1]) ; arr.setInfoOnComponent(0,"Comp0") f0.setArray(arr) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f0) +WriteFieldUsingAlreadyWrittenMesh(fname,f0) # f0.setTime(3.3,3,1) arr=DataArrayDouble([3,1,7,5,1,7,5,3]) ; arr.setInfoOnComponent(0,"Comp0") f0.setArray(arr) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f0) +WriteFieldUsingAlreadyWrittenMesh(fname,f0) # f0.setTime(4.4,4,1) arr=DataArrayDouble([5,3,1,7,3,1,7,5]) ; arr.setInfoOnComponent(0,"Comp0") f0.setArray(arr) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f0) +WriteFieldUsingAlreadyWrittenMesh(fname,f0) diff --git a/src/Plugins/MEDReader/Test/testMEDReader10.py b/src/Plugins/MEDReader/Test/testMEDReader10.py index 2e27d447..f71e1a4b 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader10.py +++ b/src/Plugins/MEDReader/Test/testMEDReader10.py @@ -47,11 +47,11 @@ arr=DataArrayDouble.Aggregate(arr,arr2) ; arr3=DataArrayDouble(16) ; arr3.iota() arr.setInfoOnComponents(["1st","2nd","3rd","4th"]) f3.setArray(arr) # -MEDLoader.WriteMesh(fname,m,True) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f0) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f1) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f2) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f3) +WriteMesh(fname,m,True) +WriteFieldUsingAlreadyWrittenMesh(fname,f0) +WriteFieldUsingAlreadyWrittenMesh(fname,f1) +WriteFieldUsingAlreadyWrittenMesh(fname,f2) +WriteFieldUsingAlreadyWrittenMesh(fname,f3) ################### MED write is done -> Go to MEDReader from paraview.simple import * diff --git a/src/Plugins/MEDReader/Test/testMEDReader11.py b/src/Plugins/MEDReader/Test/testMEDReader11.py index 6c8df9dd..b343f6d3 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader11.py +++ b/src/Plugins/MEDReader/Test/testMEDReader11.py @@ -85,7 +85,7 @@ for name,arrs in [("ENERGIE RECUE",(nrj_0_1,nrj_0_1)),("ENTHALPIE",(h_0,h_1)),(" f1ts0=MEDFileField1TS() f=MEDCouplingFieldDouble(ON_CELLS) ; f.setName(name) ; f.setTime(ft,dt,it) ; f.setMesh(sup) f.setArray(arrs[its]) - f.checkCoherency() + f.checkConsistencyLight() f1ts0.setFieldProfile(f,mm,0,pfl0) fmts0.pushBackTimeStep(f1ts0) pass diff --git a/src/Plugins/MEDReader/Test/testMEDReader13.py b/src/Plugins/MEDReader/Test/testMEDReader13.py index b7f93a28..5b6635fe 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader13.py +++ b/src/Plugins/MEDReader/Test/testMEDReader13.py @@ -34,8 +34,8 @@ m.insertNextCell(NORM_TRI3,[0,1,3]) ; m.insertNextCell(NORM_TRI3,[1,2,3]) f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setName("fieldELNO") ; f.setMesh(m) arr=DataArrayDouble([0.2,1.1,0.7,0.5,-0.3,0.4]) f.setArray(DataArrayDouble.Meld(4*[arr])) -f.checkCoherency() -MEDLoader.WriteField(fname,f,True) +f.checkConsistencyLight() +WriteField(fname,f,True) ################### MED write is done -> Go to MEDReader diff --git a/src/Plugins/MEDReader/Test/testMEDReader14.py b/src/Plugins/MEDReader/Test/testMEDReader14.py index ac0ea5c3..6412f059 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader14.py +++ b/src/Plugins/MEDReader/Test/testMEDReader14.py @@ -78,7 +78,7 @@ for i in xrange(5): fNode.setGaussLocalizationOnCells(DataArrayInt.Range(0,12,1),[0.,0.,1.,0.,0.,1.],[0.1,0.1,0.8,0.1,0.1,0.8],3*[0.16666666666666666]) fNode.setGaussLocalizationOnCells(DataArrayInt.Range(12,24,1),[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[-0.577350,-0.577350,0.577350,-0.577350,0.577350,0.577350,-0.577350,0.577350],4*[1.]) arr=DataArrayDouble(2*(12*3+12*4)) ; arr.iota(0+1000*i) ; arr.rearrange(2) - fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkCoherency() + fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkConsistencyLight() fNode.setName(fieldName0) f.setFieldProfile(fNode,mm,0,zePfl0) # @@ -91,7 +91,7 @@ for i in xrange(5): fNode.setGaussLocalizationOnCells(DataArrayInt.Range(4,10,1),[-1.,1.],[-0.5,0.,0.5],[1.,1.,1.]) fNode.setGaussLocalizationOnCells(DataArrayInt.Range(10,14,1),[-1.,1.],[-0.6,-0.2,0.2,0.6],[1.,1.,1.,1.]) arr=DataArrayDouble(2*(4*2+6*3+4*4)) ; arr.iota(100+1000*i) ; arr.rearrange(2) - fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkCoherency() + fNode.setArray(arr) ; arr.setInfoOnComponents(["Comp1_2 [m]","Com2_2 [s^2]"]) ; fNode.checkConsistencyLight() fNode.setName(fieldName0) f.setFieldProfile(fNode,mm,-1,zePfl1) fs0.pushBackTimeStep(f) @@ -104,7 +104,7 @@ for i in xrange(5): fNode.setGaussLocalizationOnCells(DataArrayInt.Range(0,4,1),[-1.,1.],[-0.6,-0.2,0.2,0.6],[1.,1.,1.,1.]) fNode.setGaussLocalizationOnCells(DataArrayInt.Range(4,10,1),[-1.,1.],[-0.6666666666666667,-0.33333333333333337,0.,0.33333333333333337,0.6666666666666667],[1.,1.,1.,1.,1.]) arr=DataArrayDouble(2*(4*4+6*5)) ; arr.iota(500+1000*i) ; arr.rearrange(2) - fNode.setArray(arr) ; arr.setInfoOnComponents(["C1 [m]","C2 [s^2]"]) ; fNode.checkCoherency() + fNode.setArray(arr) ; arr.setInfoOnComponents(["C1 [m]","C2 [s^2]"]) ; fNode.checkConsistencyLight() f.setFieldProfile(fNode,mm,-1,zePfl2) fs1.pushBackTimeStep(f) # diff --git a/src/Plugins/MEDReader/Test/testMEDReader15.py b/src/Plugins/MEDReader/Test/testMEDReader15.py index a26f7629..a68d7010 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader15.py +++ b/src/Plugins/MEDReader/Test/testMEDReader15.py @@ -38,7 +38,7 @@ f.setName(zeName) f.setArray(DataArrayDouble([(-1.,1.,0.),(0.,1.,0.),(1.,1.,0.)])) tmp=MEDCouplingUMesh.Build0DMeshFromCoords(m.getCoords()) ; tmp.setName(zeName) f.setMesh(tmp) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f) +WriteFieldUsingAlreadyWrittenMesh(fname,f) # from paraview.simple import * diff --git a/src/Plugins/MEDReader/Test/testMEDReader16.py b/src/Plugins/MEDReader/Test/testMEDReader16.py index 99b96edf..0252cb99 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader16.py +++ b/src/Plugins/MEDReader/Test/testMEDReader16.py @@ -35,9 +35,9 @@ grp3=DataArrayInt([0,1,2,3]) ; grp3.setName("grp3") mm.setGroupsAtLevel(0,[grp0,grp1,grp2,grp3]) f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setMesh(m) ; f.setName("MyField") ; f.setTime(0.,0,0) arr2=DataArrayDouble(4*4*2) ; arr2.iota() ; arr2.rearrange(2) ; arr2.setInfoOnComponents(["aa","bbb"]) -f.setArray(arr2) ; arr2+=0.1 ; f.checkCoherency() +f.setArray(arr2) ; arr2+=0.1 ; f.checkConsistencyLight() mm.write(fname,2) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f) +WriteFieldUsingAlreadyWrittenMesh(fname,f) # from paraview.simple import * from paraview import servermanager diff --git a/src/Plugins/MEDReader/Test/testMEDReader17.py b/src/Plugins/MEDReader/Test/testMEDReader17.py index c19fdefa..e1564ba5 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader17.py +++ b/src/Plugins/MEDReader/Test/testMEDReader17.py @@ -35,9 +35,9 @@ grp3=DataArrayInt([0,1,2,3]) ; grp3.setName("grp3") mm.setGroupsAtLevel(0,[grp0,grp1,grp2,grp3]) f=MEDCouplingFieldDouble(ON_GAUSS_NE) ; f.setMesh(m) ; f.setName("MyField") ; f.setTime(0.,0,0) arr2=DataArrayDouble(4*4*2) ; arr2.iota() ; arr2.rearrange(2) ; arr2.setInfoOnComponents(["aa","bbb"]) -f.setArray(arr2) ; arr2+=0.1 ; f.checkCoherency() +f.setArray(arr2) ; arr2+=0.1 ; f.checkConsistencyLight() mm.write(fname,2) -MEDLoader.WriteFieldUsingAlreadyWrittenMesh(fname,f) +WriteFieldUsingAlreadyWrittenMesh(fname,f) # from paraview.simple import * from paraview import servermanager diff --git a/src/Plugins/MEDReader/Test/testMEDReader2.py b/src/Plugins/MEDReader/Test/testMEDReader2.py index 02141208..09aa874a 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader2.py +++ b/src/Plugins/MEDReader/Test/testMEDReader2.py @@ -46,7 +46,7 @@ mm.write(fname,2) pfl=DataArrayInt([7,8,9,10,13,14,15,16,19,20,21,22,25,26,27,28]) ; pfl.setName("pfl") f=MEDCouplingFieldDouble(ON_CELLS) ; f.setName("ACellField") arr=DataArrayDouble(16) ; arr.iota() -arr2=arr.deepCpy() ; arr2.reverse() +arr2=arr.deepCopy() ; arr2.reverse() arr=DataArrayDouble.Meld(arr,arr2) ; arr.setInfoOnComponents(["aa","bbb"]) f.setArray(arr) f1ts=MEDFileField1TS() diff --git a/src/Plugins/MEDReader/Test/testMEDReader20.py b/src/Plugins/MEDReader/Test/testMEDReader20.py new file mode 100644 index 00000000..a63f90ff --- /dev/null +++ b/src/Plugins/MEDReader/Test/testMEDReader20.py @@ -0,0 +1,170 @@ +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2016 CEA/DEN, EDF R&D +# +# 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, or (at your option) any later version. +# +# 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 +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# Author : Anthony Geay (EDF R&D) + +# non regression test that emulates https://ageay@git.salome-platform.org/gitpub/samples/datafiles.git Med/ResOK_0000.med +# This test point error during commit efd9331a9455785d0f04b75 in PARAVIS + +from MEDLoader import * +fname="testMEDReader20.med" +png="testMEDReader20.png" +nb=10 +arrX=DataArrayDouble(nb+1) ; arrX.iota() +arrY=DataArrayDouble([0.,1.]) +m=MEDCouplingCMesh() ; m.setCoords(arrX,arrY) ; m=m.buildUnstructured(); m.setName("mesh") ; m.simplexize(0) +mm=MEDFileUMesh() ; mm[0]=m +m1=m.computeSkin() ; mm[-1]=m1 +# +f0=DataArrayInt(m1.getNumberOfCells()) ; f0.iota() ; mm.setFamilyFieldArr(-1,f0) +f1=DataArrayInt(m1.getNumberOfNodes()) ; f1.iota() ; mm.setFamilyFieldArr(1,f1) # <- very important the bug can be shown here +# +nbCells=m1.getNumberOfCells() ; nbNodes=m.getNumberOfNodes() +mm.write(fname,2) +for i in range(5): + f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(m) + f.setName("Field") + arr=DataArrayInt(2*nb) ; arr.iota(i) ; arr%=nb ; arr=arr.convertToDblArr() + f.setArray(arr) ; f.setTime(float(i),i,0) + WriteFieldUsingAlreadyWrittenMesh(fname,f) + # + f=MEDCouplingFieldDouble(ON_CELLS) ; f.setMesh(m1) + f.setName("Field") + arr=DataArrayInt(nbCells) ; arr.iota(i) ; arr%=nbCells ; arr=arr.convertToDblArr() + f.setArray(arr) ; f.setTime(float(i),i,0) + WriteFieldUsingAlreadyWrittenMesh(fname,f) + # + f=MEDCouplingFieldDouble(ON_NODES) ; f.setMesh(m) + f.setName("FieldNode") + arr=DataArrayDouble(nbNodes) ; arr[:]=float(i) + f.setArray(arr) ; f.setTime(float(i),i,0) + WriteFieldUsingAlreadyWrittenMesh(fname,f) + pass +##################### +from paraview.simple import * +#### disable automatic camera reset on 'Show' +paraview.simple._DisableFirstRenderCameraReset() + +# create a new 'MED Reader' +testMEDReader20med = MEDReader(FileName=fname) +testMEDReader20med.AllArrays = ['TS0/mesh/ComSup0/Field@@][@@P0'] +testMEDReader20med.AllTimeSteps = ['0000', '0001', '0002', '0003', '0004'] + +# get animation scene +animationScene1 = GetAnimationScene() + +# update animation scene based on data timesteps +animationScene1.UpdateAnimationUsingDataTimeSteps() + +# get active view +renderView1 = GetActiveViewOrCreate('RenderView') +# uncomment following to set a specific view size +# renderView1.ViewSize = [610, 477] + +# show data in view +testMEDReader20medDisplay = Show(testMEDReader20med, renderView1) +# trace defaults for the display properties. +testMEDReader20medDisplay.ColorArrayName = [None, ''] +testMEDReader20medDisplay.GlyphType = 'Arrow' +testMEDReader20medDisplay.ScalarOpacityUnitDistance = 4.664739046219201 +testMEDReader20medDisplay.SelectUncertaintyArray = [None, ''] +testMEDReader20medDisplay.UncertaintyTransferFunction = 'PiecewiseFunction' +testMEDReader20medDisplay.OpacityArray = [None, ''] +testMEDReader20medDisplay.RadiusArray = [None, ''] +testMEDReader20medDisplay.RadiusRange = [0.0, 10.0] +testMEDReader20medDisplay.ConstantRadius = 10.0 +testMEDReader20medDisplay.PointSpriteDefaultsInitialized = 1 +testMEDReader20medDisplay.SelectInputVectors = [None, ''] +testMEDReader20medDisplay.WriteLog = '' + +# reset view to fit data +renderView1.ResetCamera() + +#changing interaction mode based on data extents +renderView1.InteractionMode = '2D' +renderView1.CameraPosition = [5.0, 0.5, 10000.0] +renderView1.CameraFocalPoint = [5.0, 0.5, 0.0] + +# set scalar coloring +ColorBy(testMEDReader20medDisplay, ('FIELD', 'vtkBlockColors')) + +# show color bar/color legend +testMEDReader20medDisplay.SetScalarBarVisibility(renderView1, True) + +# get color transfer function/color map for 'vtkBlockColors' +vtkBlockColorsLUT = GetColorTransferFunction('vtkBlockColors') + +# get opacity transfer function/opacity map for 'vtkBlockColors' +vtkBlockColorsPWF = GetOpacityTransferFunction('vtkBlockColors') + +# set scalar coloring +ColorBy(testMEDReader20medDisplay, ('CELLS', 'Field')) + +# rescale color and/or opacity maps used to include current data range +testMEDReader20medDisplay.RescaleTransferFunctionToDataRange(True) + +# show color bar/color legend +testMEDReader20medDisplay.SetScalarBarVisibility(renderView1, True) + +# get color transfer function/color map for 'Field' +fieldLUT = GetColorTransferFunction('Field') + +# get opacity transfer function/opacity map for 'Field' +fieldPWF = GetOpacityTransferFunction('Field') + +animationScene1.GoToNext() # <- very important to see the bug play with time steps... +animationScene1.GoToNext() +animationScene1.GoToNext() +animationScene1.GoToNext() +animationScene1.GoToPrevious() +animationScene1.GoToPrevious() + +# current camera placement for renderView1 +renderView1.InteractionMode = '2D' +renderView1.CameraPosition = [5.0, 0.5, 10000.0] +renderView1.CameraFocalPoint = [5.0, 0.5, 0.0] +renderView1.CameraParallelScale = 5.024937810560445 + +# + +renderView1.ViewSize =[300,300] +Render() +#WriteImage(png) + +#### saving camera placements for all active views + +# current camera placement for renderView1 +renderView1.InteractionMode = '2D' +renderView1.CameraPosition = [5.0, 0.5, 10000.0] +renderView1.CameraFocalPoint = [5.0, 0.5, 0.0] +renderView1.CameraParallelScale = 5.024937810560445 +# compare with baseline image +import os +import sys +try: + baselineIndex = sys.argv.index('-B')+1 + baselinePath = sys.argv[baselineIndex] +except: + print "Could not get baseline directory. Test failed." + exit(1) +baseline_file = os.path.join(baselinePath,png) +import vtk.test.Testing +vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir() +vtk.test.Testing.compareImage(GetActiveView().GetRenderWindow(), baseline_file, threshold=25) +vtk.test.Testing.interact() diff --git a/src/Plugins/MEDReader/Test/testMEDReader4.py b/src/Plugins/MEDReader/Test/testMEDReader4.py index 495692d3..f02629cc 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader4.py +++ b/src/Plugins/MEDReader/Test/testMEDReader4.py @@ -42,7 +42,7 @@ f1ts1=MEDFileField1TS() f0=MEDCouplingFieldDouble(ON_NODES) ; f0.setMesh(m0) ; f0.setName("f0NoPfl") arr0=DataArrayDouble([0.,1.,2.,3.,1.,1.5,2.2,3.1,2.,2.2,3.,3.1,3.,3.1,3.5,4.]) f0.setArray(arr0) -f0.checkCoherency() +f0.checkConsistencyLight() f1ts0.setFieldNoProfileSBT(f0) # pfl1=DataArrayInt([0,1,2,3,4,5,6,8,9,12]) ; pfl1.setName("pfl1") diff --git a/src/Plugins/MEDReader/Test/testMEDReader5.py b/src/Plugins/MEDReader/Test/testMEDReader5.py index 1c07a227..87f3caf5 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader5.py +++ b/src/Plugins/MEDReader/Test/testMEDReader5.py @@ -32,7 +32,7 @@ arr=DataArrayDouble(5) ; arr.iota() c=MEDCouplingCMesh("mesh") c.setCoords(arr,arr,arr) m=c.buildUnstructured() -mbis=m.deepCpy() ; mbis.translate([5,0,0]) ; mbis.tetrahedrize(PLANAR_FACE_5) +mbis=m.deepCopy() ; mbis.translate([5,0,0]) ; mbis.tetrahedrize(PLANAR_FACE_5) m=MEDCouplingUMesh.MergeUMeshes([mbis,m]) ; m.setName(c.getName()) mm=MEDFileUMesh() mm.setMeshAtLevel(0,m) diff --git a/src/Plugins/MEDReader/Test/testMEDReader6.py b/src/Plugins/MEDReader/Test/testMEDReader6.py index f935c1d1..e9e7b266 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader6.py +++ b/src/Plugins/MEDReader/Test/testMEDReader6.py @@ -47,7 +47,7 @@ fGauss.setGaussLocalizationOnType(NORM_TRI3,[0.,0.,1.,0.,0.,1.],[0.1,0.1,0.05,0. fGauss.setGaussLocalizationOnType(NORM_QUAD4,[-1.,-1.,1.,-1.,1.,1.,-1.,1.],[-0.9,-0.9,0.,0.,0.9,0.9],[0.2,0.3,0.5]) fGauss.setArray(DataArrayDouble([0.9,1.3,0.22,1.3,1.62,2.21,1.62,2.72,2.95,2.54,2.25,2.16,1.58,1.05,3.13,2.91,2.82,1.41,1.58,1.95,3.59,3.53,3.59,2.82,2.91,3.13,2.25,2.54,2.95])) fGauss.getArray().setInfoOnComponent(0,"C0") -fGauss.checkCoherency() +fGauss.checkConsistencyLight() # f1ts=MEDFileField1TS() f1ts.setFieldNoProfileSBT(fGauss) diff --git a/src/Plugins/TableReader/ParaViewPlugin/CMakeLists.txt b/src/Plugins/TableReader/ParaViewPlugin/CMakeLists.txt index d8749177..492d3c0b 100644 --- a/src/Plugins/TableReader/ParaViewPlugin/CMakeLists.txt +++ b/src/Plugins/TableReader/ParaViewPlugin/CMakeLists.txt @@ -19,14 +19,15 @@ IF(PARAVIEW_BUILD_QT_GUI) + INCLUDE(UseQtExt) # Custom object panel for the reader and # custom display panel for line chart view - QT4_WRAP_UI(CLIENT_UI_SRCS + QT_WRAP_UIC(CLIENT_UI_SRCS Resources/UI/TableReaderPanel.ui Resources/UI/CustomXYChartDisplayPanel.ui ) - QT4_WRAP_CPP(MOC_SRCS + QT_WRAP_MOC(MOC_SRCS pqTableReaderPanel.h pqTableTo3DPanel.h pqCustomChartDisplayPanelImplementation.h diff --git a/src/Plugins/View/CMakeLists.txt b/src/Plugins/View/CMakeLists.txt index 69acb228..d67405bf 100755 --- a/src/Plugins/View/CMakeLists.txt +++ b/src/Plugins/View/CMakeLists.txt @@ -17,11 +17,13 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # +INCLUDE(UseQtExt) + # create a plugin with a custom view that shows up in ParaView's multi-view # manager. this plugin also contains a custom display panel # moc the Qt based .h files -QT4_WRAP_CPP(MOC_SRCS MyView.h MyDisplay.h MyViewActiveOptions.h MyViewOptions.h) +QT_WRAP_MOC(MOC_SRCS MyView.h MyDisplay.h MyViewActiveOptions.h MyViewOptions.h) # invoke macro to create sources for our custom view and display panel ADD_PARAVIEW_VIEW_MODULE( diff --git a/test/VisuPrs/2D_viewer/CTestTestfileInstall.cmake b/test/VisuPrs/2D_viewer/CTestTestfileInstall.cmake index fc8b22f1..f8f8f4d4 100644 --- a/test/VisuPrs/2D_viewer/CTestTestfileInstall.cmake +++ b/test/VisuPrs/2D_viewer/CTestTestfileInstall.cmake @@ -20,7 +20,7 @@ SET(TEST_NAMES A0 A1) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME 2DVIEWER_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_2DVIEWER_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/3D_viewer/CTestTestfileInstall.cmake b/test/VisuPrs/3D_viewer/CTestTestfileInstall.cmake index 5e8a5d02..a4da690c 100644 --- a/test/VisuPrs/3D_viewer/CTestTestfileInstall.cmake +++ b/test/VisuPrs/3D_viewer/CTestTestfileInstall.cmake @@ -20,7 +20,7 @@ SET(TEST_NAMES A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME 3DVIEWER_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_3DVIEWER_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/Animation/CTestTestfileInstall.cmake b/test/VisuPrs/Animation/CTestTestfileInstall.cmake index fc91ae93..ec2970ac 100644 --- a/test/VisuPrs/Animation/CTestTestfileInstall.cmake +++ b/test/VisuPrs/Animation/CTestTestfileInstall.cmake @@ -21,7 +21,7 @@ SET(TEST_NAMES A0 A1 A2 A4 A7 A8 B2 B5 B6 C0 C1 C3 C8 D1 D2 D6 D9 E0 E4 E7 E8 F2 F5 F6 G0 G3 G4 G8 H1 H2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME ANIMATION_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_ANIMATION_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/CMakeLists.txt b/test/VisuPrs/CMakeLists.txt index 2e2a8852..2924c599 100644 --- a/test/VisuPrs/CMakeLists.txt +++ b/test/VisuPrs/CMakeLists.txt @@ -51,12 +51,14 @@ SET(TEST_DIRECTORIES GaussPoints StreamLines SWIG_scripts - Tables +# Tables table reader is not used anymore and CSVReader +# doesn't suport txt and xls formats, so switch off Tables tests ImportMedField united bugs imps - dump_study +# dump_study Save trace functionality of ParaView is now working +# as expected: switch off dump_study tests until it will be corrected. ) FOREACH(test_dir ${TEST_DIRECTORIES}) diff --git a/test/VisuPrs/CutLines/CMakeLists.txt b/test/VisuPrs/CutLines/CMakeLists.txt index 4b2b7230..4c1af770 100644 --- a/test/VisuPrs/CutLines/CMakeLists.txt +++ b/test/VisuPrs/CutLines/CMakeLists.txt @@ -20,7 +20,7 @@ SET(BASE_TESTS A0 B0 E0 F1 G0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) @@ -37,6 +37,11 @@ FOREACH(tfile ${TEST_NAMES}) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES ENVIRONMENT "${tests_env}") ENDFOREACH() +IF(SALOME_PARAVIS_ALL_TEST) + # Increase timeout for specific tests + SET_TESTS_PROPERTIES(CUTLINES_F4 PROPERTIES TIMEOUT 5000) +ENDIF() + # Application tests SET(APPLICATION_TESTS ${ALL_TESTS}) SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test/VisuPrs/CutLines) diff --git a/test/VisuPrs/CutLines/CTestTestfileInstall.cmake b/test/VisuPrs/CutLines/CTestTestfileInstall.cmake index 30fd32aa..24a7bb1d 100644 --- a/test/VisuPrs/CutLines/CTestTestfileInstall.cmake +++ b/test/VisuPrs/CutLines/CTestTestfileInstall.cmake @@ -19,10 +19,10 @@ SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME CUTLINES_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_CUTLINES_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/CutLines/F7.py b/test/VisuPrs/CutLines/F7.py deleted file mode 100644 index 95bdfb5f..00000000 --- a/test/VisuPrs/CutLines/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/CutLines/F7 case -# Create Cut Lines for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("CutLines/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/CMakeLists.txt b/test/VisuPrs/CutPlanes/CMakeLists.txt index 5ef54666..3e7ab3d8 100644 --- a/test/VisuPrs/CutPlanes/CMakeLists.txt +++ b/test/VisuPrs/CutPlanes/CMakeLists.txt @@ -20,7 +20,7 @@ SET(BASE_TESTS A0 B0 E0 F1 G0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/CutPlanes/CTestTestfileInstall.cmake b/test/VisuPrs/CutPlanes/CTestTestfileInstall.cmake index 24e93064..34821935 100644 --- a/test/VisuPrs/CutPlanes/CTestTestfileInstall.cmake +++ b/test/VisuPrs/CutPlanes/CTestTestfileInstall.cmake @@ -19,10 +19,10 @@ SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME CUTPLANES_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_CUTPLANES_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/CutPlanes/F7.py b/test/VisuPrs/CutPlanes/F7.py deleted file mode 100755 index e51b293b..00000000 --- a/test/VisuPrs/CutPlanes/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/CutPlanes/F7 case -# Create Cut Planes for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("CutPlanes/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/CMakeLists.txt b/test/VisuPrs/DeformedShape/CMakeLists.txt index 415250fe..7058456e 100644 --- a/test/VisuPrs/DeformedShape/CMakeLists.txt +++ b/test/VisuPrs/DeformedShape/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B0 E0 F1) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9) + E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F8 F9) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/DeformedShape/CTestTestfileInstall.cmake b/test/VisuPrs/DeformedShape/CTestTestfileInstall.cmake index 52a4d368..52d0d956 100644 --- a/test/VisuPrs/DeformedShape/CTestTestfileInstall.cmake +++ b/test/VisuPrs/DeformedShape/CTestTestfileInstall.cmake @@ -18,10 +18,10 @@ # SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9) + E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F8 F9) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME DEFORMEDSHAPE_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_DEFORMEDSHAPE_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/DeformedShape/F7.py b/test/VisuPrs/DeformedShape/F7.py deleted file mode 100755 index f267319f..00000000 --- a/test/VisuPrs/DeformedShape/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/DeformedShape/F7 case -# Create Deformed Shape for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("DeformedShape/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/GaussPoints/C5.py b/test/VisuPrs/GaussPoints/C5.py deleted file mode 100644 index 98682623..00000000 --- a/test/VisuPrs/GaussPoints/C5.py +++ /dev/null @@ -1,59 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/GaussPoints/C5 case -# Create Gauss Points on the field of the MED file - -import os -import sys - -from paravistest import datadir, pictureext, get_picture_dir -from presentations import GaussPointsOnField, EntityType, get_time, process_prs_for_test -import pvsimple - -# Directory for saving snapshots -picturedir = get_picture_dir("GaussPoints/C5") -if not picturedir.endswith(os.sep): - picturedir += os.sep - -# MED file -file_name = datadir + "occ4050.med" -field_name = "champ_reel" -timestamp_nb = -1 # last timestamp - -pvsimple.OpenDataFile(file_name) -med_reader = pvsimple.GetActiveSource() -if med_reader is None: - raise RuntimeError("File wasn't imported!!!") - -# Create Gauss Points presentation -print "BREAKPOINT_1" - -prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) -if prs is None: - raise RuntimeError, "Created presentation is None!!!" - -print "BREAKPOINT_2" - -# Display presentation and get snapshot -view = pvsimple.GetRenderView() -time = get_time(med_reader, timestamp_nb) - -pic_name = picturedir + field_name + "_" + str(time) + "_GAUSSPOINTS." + pictureext -process_prs_for_test(prs, view, pic_name) diff --git a/test/VisuPrs/GaussPoints/CMakeLists.txt b/test/VisuPrs/GaussPoints/CMakeLists.txt index 74acce32..71f42a89 100644 --- a/test/VisuPrs/GaussPoints/CMakeLists.txt +++ b/test/VisuPrs/GaussPoints/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A2 B0 C0) SET(ALL_TESTS A0 A1 A3 A4 A5 A6 A7 A9 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 - C0 C1 C2 C3 C4 C5 C6 C7 C8 C9) + C0 C1 C2 C3 C4 C6 C7 C8 C9) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/GaussPoints/CTestTestfileInstall.cmake b/test/VisuPrs/GaussPoints/CTestTestfileInstall.cmake index 68ae1435..6fe8b70c 100644 --- a/test/VisuPrs/GaussPoints/CTestTestfileInstall.cmake +++ b/test/VisuPrs/GaussPoints/CTestTestfileInstall.cmake @@ -18,10 +18,10 @@ # SET(TEST_NAMES A0 A1 A3 A4 A5 A6 A7 A9 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 - C0 C1 C2 C3 C4 C5 C6 C7 C8 C9) + C0 C1 C2 C3 C4 C6 C7 C8 C9) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME GAUSSPOINTS_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_GAUSSPOINTS_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/ImportMedField/B3.py b/test/VisuPrs/ImportMedField/B3.py deleted file mode 100644 index 93a0b12b..00000000 --- a/test/VisuPrs/ImportMedField/B3.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/ImportMedField/B3 case -# Import MED file; create presentations for the given fields. - -from paravistest import datadir, Import_Med_Field - -med_file = datadir + "zzzz121b.med" -field_names = ["RESUZERODEPL____________________", "RESUZEROERRE_ELGA_NORE__________", "RESUZEROSIEF_ELGA_DEPL__________", "RESUZEROSIGM_ELNO_DEPL__________"] -prs_list = [ [0,1,5,6,7], [0,1,5,6,7], [0,1,5,6,7], [0,1,5,6,7,9] ] - -Import_Med_Field(med_file, field_names, 1, prs_list) diff --git a/test/VisuPrs/ImportMedField/CMakeLists.txt b/test/VisuPrs/ImportMedField/CMakeLists.txt index 22e679b9..fdf638b1 100644 --- a/test/VisuPrs/ImportMedField/CMakeLists.txt +++ b/test/VisuPrs/ImportMedField/CMakeLists.txt @@ -18,7 +18,7 @@ # SET(BASE_TESTS A0 B0 C0) -SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 C0 C1 C2) +SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B4 B5 B6 B7 B8 B9 C0 C1 C2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/ImportMedField/CTestTestfileInstall.cmake b/test/VisuPrs/ImportMedField/CTestTestfileInstall.cmake index 8e40a877..7364f7f7 100644 --- a/test/VisuPrs/ImportMedField/CTestTestfileInstall.cmake +++ b/test/VisuPrs/ImportMedField/CTestTestfileInstall.cmake @@ -17,10 +17,10 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 C0 C1 C2) +SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B4 B5 B6 B7 B8 B9 C0 C1 C2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME IMPORTMEDFIELD_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_IMPORTMEDFIELD_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/IsoSurfaces/CMakeLists.txt b/test/VisuPrs/IsoSurfaces/CMakeLists.txt index 5a8241ba..60f392e7 100755 --- a/test/VisuPrs/IsoSurfaces/CMakeLists.txt +++ b/test/VisuPrs/IsoSurfaces/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B0 E1 F1) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/IsoSurfaces/CTestTestfileInstall.cmake b/test/VisuPrs/IsoSurfaces/CTestTestfileInstall.cmake index 5027046b..68d2d970 100644 --- a/test/VisuPrs/IsoSurfaces/CTestTestfileInstall.cmake +++ b/test/VisuPrs/IsoSurfaces/CTestTestfileInstall.cmake @@ -21,7 +21,7 @@ SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME ISOSURFACES_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_ISOSURFACES_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/IsoSurfaces/F7.py b/test/VisuPrs/IsoSurfaces/F7.py deleted file mode 100644 index c691bbd3..00000000 --- a/test/VisuPrs/IsoSurfaces/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/IsoSurfaces/F7 case -# Create Iso Surface for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("IsoSurfaces/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/CMakeLists.txt b/test/VisuPrs/MeshPresentation/CMakeLists.txt index 39ea03f4..16ecedb7 100644 --- a/test/VisuPrs/MeshPresentation/CMakeLists.txt +++ b/test/VisuPrs/MeshPresentation/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B0 E2 F2 G3 H1 I0 J0 K1 L0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G3 G4 G5 G6 G7 G8 G9 + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G3 G4 G5 G6 G7 G8 G9 H0 H1 H2 H3 H4 H5 H6 H7 H8 H9 I0 I1 I2 I3 I4 I5 I6 I7 I8 I9 J0 J1 J2 J3 J4 J5 J6 J7 J8 J9 K0 K1 K2 K3 K4 K5 K6 K7 K8 K9 L0 L1) diff --git a/test/VisuPrs/MeshPresentation/CTestTestfileInstall.cmake b/test/VisuPrs/MeshPresentation/CTestTestfileInstall.cmake index cce48ed8..e0de497c 100644 --- a/test/VisuPrs/MeshPresentation/CTestTestfileInstall.cmake +++ b/test/VisuPrs/MeshPresentation/CTestTestfileInstall.cmake @@ -18,12 +18,12 @@ # SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G3 G4 G5 G6 G7 G8 G9 + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G3 G4 G5 G6 G7 G8 G9 H0 H1 H2 H3 H4 H5 H6 H7 H8 H9 I0 I1 I2 I3 I4 I5 I6 I7 I8 I9 J0 J1 J2 J3 J4 J5 J6 J7 J8 J9 K0 K1 K2 K3 K4 K5 K6 K7 K8 K9 L0 L1) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME MESH_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_MESH_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/MeshPresentation/F7.py b/test/VisuPrs/MeshPresentation/F7.py deleted file mode 100644 index 4ef2e441..00000000 --- a/test/VisuPrs/MeshPresentation/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/MeshPresentation/F7 case -# Create Mesh Presentation for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("MeshPresentation/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/CMakeLists.txt b/test/VisuPrs/Plot3D/CMakeLists.txt index 2bd6cdfc..bcb5c8f6 100755 --- a/test/VisuPrs/Plot3D/CMakeLists.txt +++ b/test/VisuPrs/Plot3D/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A1 B0 E0 F1 G0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/Plot3D/CTestTestfileInstall.cmake b/test/VisuPrs/Plot3D/CTestTestfileInstall.cmake index e3ba23b1..85446403 100644 --- a/test/VisuPrs/Plot3D/CTestTestfileInstall.cmake +++ b/test/VisuPrs/Plot3D/CTestTestfileInstall.cmake @@ -18,10 +18,10 @@ # SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME PLOT3D_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_PLOT3D_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/Plot3D/F7.py b/test/VisuPrs/Plot3D/F7.py deleted file mode 100644 index d48f7345..00000000 --- a/test/VisuPrs/Plot3D/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/Plot3D/F7 case -# Create Plot3D for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("Plot3D/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/SWIG_scripts/A5.py b/test/VisuPrs/SWIG_scripts/A5.py index 8fefc133..cb8edcc8 100644 --- a/test/VisuPrs/SWIG_scripts/A5.py +++ b/test/VisuPrs/SWIG_scripts/A5.py @@ -69,7 +69,8 @@ if cur_view: pvsimple.Delete(cur_view) xy_view = pvsimple.CreateXYPlotView() xy_view.ChartTitle = 'Very useful data' -xy_view.AxisTitle = ['[ Wt ]', 'Frequency [ Hz ]'] +xy_view.BottomAxisTitle = '[ Wt ]' +xy_view.LeftAxisTitle = 'Frequency [ Hz ]' xy_rep = pvsimple.Show(ps) xy_rep.AttributeType = 'Row Data' diff --git a/test/VisuPrs/SWIG_scripts/A9.py b/test/VisuPrs/SWIG_scripts/A9.py index 52dc5b0e..e597187c 100644 --- a/test/VisuPrs/SWIG_scripts/A9.py +++ b/test/VisuPrs/SWIG_scripts/A9.py @@ -58,7 +58,7 @@ pvs.Render() # Load MED reader plugin pv_root_dir = os.getenv("PARAVIS_ROOT_DIR") -pvs.LoadPlugin(pv_root_dir + "/lib/paraview/libMedReaderPlugin.so") +pvs.LoadPlugin(pv_root_dir + "/lib/paraview/libMEDReaderPlugin.so") # Import MED file med_file = datadir + "pointe.med" diff --git a/test/VisuPrs/SWIG_scripts/B6.py b/test/VisuPrs/SWIG_scripts/B6.py index c6f57735..20dcca05 100644 --- a/test/VisuPrs/SWIG_scripts/B6.py +++ b/test/VisuPrs/SWIG_scripts/B6.py @@ -98,7 +98,8 @@ if cur_view: xy_view1 = pvsimple.CreateXYPlotView() xy_view1.ChartTitle = 'TEST table of real' -xy_view1.AxisTitle = ['[ Wt ]', 'Row 0 [ Hz ]'] +xy_view1.BottomAxisTitle = '[ Wt ]' +xy_view1.LeftAxisTitle = 'Row 0 [ Hz ]' # Display curves for the table of real tr_rep = pvsimple.Show(ps_tr) @@ -124,7 +125,7 @@ tr_rep.SeriesColor = ['Row 10', '0.2', '0.2', '0.9'] # Create another chart line view xy_view2 = pvsimple.CreateXYPlotView() xy_view2.ChartTitle = 'TEST table of integer' -xy_view2.AxisTitle = ['', 'FR [ m/h ]'] +xy_view2.LeftAxisTitle = 'FR [ m/h ]' # Display curves for the table of integer ti_rep = pvsimple.Show(ps_ti, xy_view2) diff --git a/test/VisuPrs/SWIG_scripts/B7.py b/test/VisuPrs/SWIG_scripts/B7.py index 6dce141a..a425c443 100644 --- a/test/VisuPrs/SWIG_scripts/B7.py +++ b/test/VisuPrs/SWIG_scripts/B7.py @@ -48,9 +48,8 @@ title = xy_view.ChartTitle xy_view.ChartTitle = "Change the title from python" pvsimple.Render(xy_view) -axis_title = xy_view.AxisTitle -xy_view.AxisTitle[0] = "Y axis" -xy_view.AxisTitle[1] = "X axis" +xy_view.LeftAxisTitle = "Y axis" +xy_view.BottomAxisTitle = "X axis" pvsimple.Render(xy_view) xy_view.ShowLegend = 0 diff --git a/test/VisuPrs/SWIG_scripts/C6.py b/test/VisuPrs/SWIG_scripts/C6.py index 1e6d4d05..5dea829b 100644 --- a/test/VisuPrs/SWIG_scripts/C6.py +++ b/test/VisuPrs/SWIG_scripts/C6.py @@ -26,7 +26,7 @@ import pvsimple # 1. Import tables from file file_path = tablesdir + "tables_test.xls" -table_reader = pvsimple.TableReader(FileName=file_path) +table_reader = pvsimple.CSVReader(FileName=file_path) if table_reader is None: print "FAILED to import tables from tables_test.xls file." @@ -37,7 +37,6 @@ if cur_view: xy_view = pvsimple.CreateXYPlotView() # 3. Display curves in the viewer -table_reader.TableNumber = 1 xy_rep = pvsimple.Show(table_reader) xy_rep.AttributeType = 'Row Data' xy_rep.UseIndexForXAxis = 0 diff --git a/test/VisuPrs/SWIG_scripts/C7.py b/test/VisuPrs/SWIG_scripts/C7.py index c408b88b..d45f0ca4 100755 --- a/test/VisuPrs/SWIG_scripts/C7.py +++ b/test/VisuPrs/SWIG_scripts/C7.py @@ -92,7 +92,12 @@ entity = EntityType.NODE # Get lookup table lookup_table = get_lookup_table(table_name, nb_components, vector_mode) -lookup_table.LockScalarRange = 0 +if hasattr(lookup_table,"LockDataRange"): + lookup_table.LockDataRange = 0 +elif hasattr(lookup_table,"LockScalarRange"): + lookup_table.LockScalarRange = 0 +else: + raise RuntimeError("Object %s has no 'LockDataRange' or 'LockScalarRange' attribute!"%(lookup_table)) # Set properties pointmap3d.ColorArrayName = (EntityType.get_pvtype(entity), table_name) diff --git a/test/VisuPrs/SWIG_scripts/CTestTestfileInstall.cmake b/test/VisuPrs/SWIG_scripts/CTestTestfileInstall.cmake index 7e3abdb8..069b1002 100644 --- a/test/VisuPrs/SWIG_scripts/CTestTestfileInstall.cmake +++ b/test/VisuPrs/SWIG_scripts/CTestTestfileInstall.cmake @@ -20,7 +20,7 @@ SET(TEST_NAMES A1 A3 A4 A5 A6 A7 A8 A9 B0 B1 B4 B5 B6 B7 B8 B9 C3 C6 C7) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME SWIGSCRIPTS_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_SWIGSCRIPTS_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/ScalarMap/CMakeLists.txt b/test/VisuPrs/ScalarMap/CMakeLists.txt index 5f043a05..939702cc 100644 --- a/test/VisuPrs/ScalarMap/CMakeLists.txt +++ b/test/VisuPrs/ScalarMap/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A1 B0 E0 F3 G0) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/ScalarMap/CTestTestfileInstall.cmake b/test/VisuPrs/ScalarMap/CTestTestfileInstall.cmake index c7f1010c..d64dca58 100644 --- a/test/VisuPrs/ScalarMap/CTestTestfileInstall.cmake +++ b/test/VisuPrs/ScalarMap/CTestTestfileInstall.cmake @@ -18,10 +18,10 @@ # SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9 G0 G1 G2) + F1 F2 F3 F4 F5 F6 F8 F9 G0 G1 G2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME SCALARMAP_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_SCALARMAP_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/ScalarMap/F7.py b/test/VisuPrs/ScalarMap/F7.py deleted file mode 100644 index f70a9390..00000000 --- a/test/VisuPrs/ScalarMap/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/ScalarMap/F7 case -# Create Scalar Map for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("ScalarMap/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/G2.py b/test/VisuPrs/ScalarMap/G2.py index f70feb4c..d8eda874 100644 --- a/test/VisuPrs/ScalarMap/G2.py +++ b/test/VisuPrs/ScalarMap/G2.py @@ -22,7 +22,7 @@ import sys import os -from paravistest import datadir, pictureext, get_picture_dir +from paravistest import datadir, pictureext, get_picture_dir, get_png_picture_resolution from pvsimple import GetActiveSource, GetRenderView, Render, OpenDataFile from presentations import ScalarMapOnField, hide_all, EntityType, PrsTypeEnum,reset_view,process_prs_for_test @@ -44,10 +44,13 @@ else: print "OK" aView = GetRenderView() +import time + aFieldEntity = EntityType.NODE aFieldName = "MODES___DEPL____________________" #create list to store picture files sizes -sizes=[] +sizesw=[] +sizesh=[] #create Scalar Map presentations for 10 timestamps for i in range(1,11): hide_all(aView, True) @@ -72,12 +75,23 @@ for i in range(1,11): # Show and record the presentation process_prs_for_test(aPrs, aView, pic_name) - sizes.append(os.path.getsize(pic_name)) + (w,h) = get_png_picture_resolution(pic_name) + sizesw.append(w) + sizesh.append(h) + +# check sizes of pictures: width +if abs(max(sizesw)-min(sizesw)) > 0: + print "ERROR!!! Pictures have different width !!!"; + for i in range(1,11): + picture_name = "time_stamp_"+str(i)+"."+pictureext + print "Picture: "+picture_name+"; width : "+str(sizesw[i-1]) + raise RuntimeError -# check sizes of pictures -if abs(max(sizes)-min(sizes)) > 0.01*max(sizes): - print "WARNING!!! Pictures have different sizes!!!"; +# check sizes of pictures: height +if abs(max(sizesh)-min(sizesh)) > 0: + print "WARNING!!! Pictures have different height !!!"; for i in range(1,11): picture_name = "time_stamp_"+str(i)+"."+pictureext - print "Picture: "+picture_name+"; size: "+str(sizes[i-1]) + print "Picture: "+picture_name+"; height : "+str(sizesh[i-1]) raise RuntimeError + diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt b/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt index 8fa6aaeb..a76da696 100644 --- a/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B0 E0 F2) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8) + F1 F2 F3 F4 F5 F6 F8) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/CTestTestfileInstall.cmake b/test/VisuPrs/ScalarMap_On_DeformedShape/CTestTestfileInstall.cmake index 98167316..cf9c1351 100644 --- a/test/VisuPrs/ScalarMap_On_DeformedShape/CTestTestfileInstall.cmake +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/CTestTestfileInstall.cmake @@ -18,10 +18,10 @@ # SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8) + F1 F2 F3 F4 F5 F6 F8) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME DEFORMEDSHAPESCALARMAP_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_DEFORMEDSHAPESCALARMAP_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py deleted file mode 100755 index 52a22ff3..00000000 --- a/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/ScalarMap_On_DeformedShape/F7 case -# Create Scalar Map on Deformed Shape for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("ScalarMap_On_DeformedShape/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/B3.py b/test/VisuPrs/StreamLines/B3.py index dff72a03..a2338e3b 100644 --- a/test/VisuPrs/StreamLines/B3.py +++ b/test/VisuPrs/StreamLines/B3.py @@ -26,7 +26,7 @@ from paravistest import datadir, pictureext, get_picture_dir from presentations import CreatePrsForFile, PrsTypeEnum # Directory for saving snapshots -picturedir = get_picture_dir(sys.argv[1], "StreamLines/B3") +picturedir = get_picture_dir("StreamLines/B3") # Create presentations files = ["fra", "TimeStamps", "pointe", "Fields_group3D", "Hexa8", "Penta6", "Quad4", "Tetra4", "Tria3", "clo", "carre_en_quad4_seg2", "carre_en_quad4_seg2_fields", "cube_hexa8_quad4"] diff --git a/test/VisuPrs/StreamLines/B4.py b/test/VisuPrs/StreamLines/B4.py index af7cfc55..f41944ab 100644 --- a/test/VisuPrs/StreamLines/B4.py +++ b/test/VisuPrs/StreamLines/B4.py @@ -56,6 +56,8 @@ print "Maximum Step Length: ", stream_tracer.MaximumStepLength print "Maximum Steps: ", stream_tracer.MaximumSteps print "Maximum Streamline Length: ", stream_tracer.MaximumStreamlineLength print "Seed Type: ", type(stream_tracer.SeedType) -print "Center: ", stream_tracer.SeedType.Center -print "Number Of Points: ", stream_tracer.SeedType.NumberOfPoints -print "Radius: ", stream_tracer.SeedType.Radius +print "Point1: ", stream_tracer.SeedType.Point1 +print "Point2: ", stream_tracer.SeedType.Point2 +# print "Center: ", stream_tracer.SeedType.Center +# print "Number Of Points: ", stream_tracer.SeedType.NumberOfPoints +# print "Radius: ", stream_tracer.SeedType.Radius diff --git a/test/VisuPrs/StreamLines/CMakeLists.txt b/test/VisuPrs/StreamLines/CMakeLists.txt index cc81b7f1..e1ec48b4 100644 --- a/test/VisuPrs/StreamLines/CMakeLists.txt +++ b/test/VisuPrs/StreamLines/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A1 B2 E0 F2) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9 G0) + E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F8 F9 G0) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/StreamLines/CTestTestfileInstall.cmake b/test/VisuPrs/StreamLines/CTestTestfileInstall.cmake index 3403c9e5..8b4915da 100644 --- a/test/VisuPrs/StreamLines/CTestTestfileInstall.cmake +++ b/test/VisuPrs/StreamLines/CTestTestfileInstall.cmake @@ -18,10 +18,10 @@ # SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 B4 - E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F7 F8 F9 G0) + E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 F1 F2 F3 F4 F5 F6 F8 F9 G0) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME STREAMLINES_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_STREAMLINES_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/StreamLines/F7.py b/test/VisuPrs/StreamLines/F7.py deleted file mode 100644 index 084dc2e3..00000000 --- a/test/VisuPrs/StreamLines/F7.py +++ /dev/null @@ -1,36 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/StreamLines/F7 case -# Create Stream Lines for all fields of the the given MED file - -import sys - -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("StreamLines/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "\nCreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F9.py b/test/VisuPrs/StreamLines/F9.py index 9e24a93e..240b0336 100644 --- a/test/VisuPrs/StreamLines/F9.py +++ b/test/VisuPrs/StreamLines/F9.py @@ -45,7 +45,7 @@ view = pvsimple.GetRenderView() print "BREAKPOINT_1" for i in range(1, 11): - prs = StreamLinesOnField(med_reader, EntityType.NODE, "MODES_DEPL", i) + prs = StreamLinesOnField(med_reader, EntityType.NODE, "MODES___DEPL____________________", i) if prs is None: raise RuntimeError("Presentation on timestamp {0} is None!!!". format(i)) diff --git a/test/VisuPrs/StreamLines/G0.py b/test/VisuPrs/StreamLines/G0.py index 3f7f133c..587c2112 100644 --- a/test/VisuPrs/StreamLines/G0.py +++ b/test/VisuPrs/StreamLines/G0.py @@ -32,6 +32,6 @@ if med_reader is None: raise RuntimeError, "new_case.rmed was not imported!!!" # 2. Creation of a set of "StreamLines" presentations, based on time stamps of "RESU_DEPL" field -streamlines = StreamLinesOnField(med_reader, EntityType.NODE, 'RESU_DEPL', 1) +streamlines = StreamLinesOnField(med_reader, EntityType.NODE, 'RESU____DEPL____________________', 1) if streamlines is None: raise RuntimeError, "Presentation is None!!!" diff --git a/test/VisuPrs/Tables/CTestTestfileInstall.cmake b/test/VisuPrs/Tables/CTestTestfileInstall.cmake index b866aaf9..b7ee5790 100644 --- a/test/VisuPrs/Tables/CTestTestfileInstall.cmake +++ b/test/VisuPrs/Tables/CTestTestfileInstall.cmake @@ -20,7 +20,7 @@ SET(TEST_NAMES A0 A2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME TABLES_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_TABLES_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/Util/paravistest.py b/test/VisuPrs/Util/paravistest.py index 8121a2df..353cd049 100755 --- a/test/VisuPrs/Util/paravistest.py +++ b/test/VisuPrs/Util/paravistest.py @@ -28,6 +28,7 @@ import os import tempfile import getpass from datetime import date +import struct # Auxiliary variables @@ -349,3 +350,22 @@ def delete_with_inputs(obj): obj_to_delete = tmp_obj.Input pvsimple.Delete(tmp_obj) + +def get_png_picture_resolution(infile): + """Returns size (width, height) of the PNG image""" + f = open(infile, 'rb') + data = f.read(24) + f.close() + if not (data[:8] == '\211PNG\r\n\032\n'and (data[12:16] == 'IHDR')): + raise RuntimeError("File '%s' is not PNG image"%(infile)) + + w, h = struct.unpack('>LL', data[16:24]) + width = int(w) + height = int(h) + return (width,height) + +def save_trace(afile,atrace): + """Saves atrace in afile""" + f = open(afile, 'w') + f.write(atrace) + f.close() diff --git a/test/VisuPrs/Vectors/CMakeLists.txt b/test/VisuPrs/Vectors/CMakeLists.txt index ea052b18..71564a00 100644 --- a/test/VisuPrs/Vectors/CMakeLists.txt +++ b/test/VisuPrs/Vectors/CMakeLists.txt @@ -19,7 +19,7 @@ SET(BASE_TESTS A0 B1 E0 F1) SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9) + F1 F2 F3 F4 F5 F6 F8 F9) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/Vectors/CTestTestfileInstall.cmake b/test/VisuPrs/Vectors/CTestTestfileInstall.cmake index 0c0f275b..02c9113c 100644 --- a/test/VisuPrs/Vectors/CTestTestfileInstall.cmake +++ b/test/VisuPrs/Vectors/CTestTestfileInstall.cmake @@ -18,10 +18,10 @@ # SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B2 B3 E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 - F1 F2 F3 F4 F5 F6 F7 F8 F9) + F1 F2 F3 F4 F5 F6 F8 F9) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME VECTORS_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_VECTORS_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/Vectors/F7.py b/test/VisuPrs/Vectors/F7.py deleted file mode 100644 index 16b8e0a2..00000000 --- a/test/VisuPrs/Vectors/F7.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/Vectors/F7 case -# Create Vectors for all data of the given MED file - -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import CreatePrsForFile, PrsTypeEnum - -# Directory for saving snapshots -picturedir = get_picture_dir("Vectors/F7") - -file = datadir + "occ4050.med" -print " --------------------------------- " -print "file ", file -print " --------------------------------- " -print "CreatePrsForFile..." -CreatePrsForFile(file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/bugs/C4.py b/test/VisuPrs/bugs/C4.py deleted file mode 100644 index 3d8375d4..00000000 --- a/test/VisuPrs/bugs/C4.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/bugs2/C4 case - -import sys -import os -from paravistest import datadir, pictureext, get_picture_dir -from presentations import * -import pvsimple - -picturedir = get_picture_dir("bugs/C4") - -# 1. Import MED file -med_file_path = datadir + "forma01f.resu.med" - -print 'Importing "forma01f.resu.med"....', -pvsimple.OpenDataFile(med_file_path) -med_reader = pvsimple.GetActiveSource() - -if med_reader is None: - print "FAILED" -else: - print "OK" - -# 2. Creation of ScalarMap On DeformedShape presentation -scales=[None, 0, 1e-05] -fields=["RESU1_DEPL", "RESU1_SIGM_ELNO_DEPL"] -entities=[EntityType.NODE, EntityType.CELL] -entities_str=["NODE", "CELL"] - -view = pvsimple.GetRenderView() - -for scale in scales: - for i in range(len(fields)): - print "Field: ", fields[i], "; Scale: ", scale - presentation = None - try: - presentation = DeformedShapeAndScalarMapOnField(med_reader, entities[i], fields[i], 1) - except ValueError as e: - print "Error:", e - - if presentation is not None: - if scale is not None: - presentation.Input.ScaleFactor = scale - # save picture - pic_path = os.path.join(picturedir, "MAIL_" + entities_str[i] + "_" + fields[i] + "_" + str(scale) + "_." + pictureext) - process_prs_for_test(presentation, view, pic_path) - else: - print "FAILED! Created presentation is None!!!" - diff --git a/test/VisuPrs/bugs/C7.py b/test/VisuPrs/bugs/C7.py deleted file mode 100644 index 43e819ff..00000000 --- a/test/VisuPrs/bugs/C7.py +++ /dev/null @@ -1,64 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/bugs2/C7 case - -import os -import sys -from paravistest import datadir, pictureext, get_picture_dir -from presentations import * -import pvsimple - -picturedir = get_picture_dir("bugs/C7") - -# 1. Import MED file -med_file_path = datadir + "Bug583-Quadratique.resu.med" - -print 'Importing "Bug583-Quadratique.resu.med"....', -pvsimple.OpenDataFile(med_file_path) -med_reader = pvsimple.GetActiveSource() - -if med_reader is None: - raise RuntimeError, "File wasn't imported!!!" -else: - print "OK" - -# 2. Creation of GaussPoints presentations -mesh_name = "MAIL" -field_names = ["RESU_EQUI_ELNO_SIGM", "RESU_SIEF_ELGA_DEPL", "RESU_SIEF_ELNO_ELGA", "RESU_SIGM_ELNO_DEPL"] - -view = pvsimple.GetRenderView() - -print "BREAKPOINT_1" -error = 0 - -for field in field_names: - print "Creation of the GaussPoints presentation.. Field: ", field, "; Iteration: 1" - presentation = GaussPointsOnField1(med_reader, EntityType.CELL, field, 1) - if presentation is None: - print "ERROR!!! GaussPoints presentation wasn't created for the ", field, " field!!!" - error += 1 - else: - pic_path = os.path.join(picturedir, "GaussPoints_" + mesh_name + "_" + field + "." + pictureext) - process_prs_for_test(presentation, view, pic_path) - -if not error: - print "BREAKPOINT_2" -else: - raise RuntimeError, "There are some errors were occured... For more info see ERRORs above..." diff --git a/test/VisuPrs/bugs/CMakeLists.txt b/test/VisuPrs/bugs/CMakeLists.txt index 8f989714..44403460 100644 --- a/test/VisuPrs/bugs/CMakeLists.txt +++ b/test/VisuPrs/bugs/CMakeLists.txt @@ -17,9 +17,9 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(BASE_TESTS A0 B1 C3 D0 E0) -SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C4 C5 C6 C7 C8 C9 - D0 D1 D3 D5 D6 D7 E0) +SET(BASE_TESTS A0 B1 C3 E0) +SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C5 C6 C9 + D1 D3 D6 D7 E0) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/bugs/CTestTestfileInstall.cmake b/test/VisuPrs/bugs/CTestTestfileInstall.cmake index ccf08684..994b289f 100644 --- a/test/VisuPrs/bugs/CTestTestfileInstall.cmake +++ b/test/VisuPrs/bugs/CTestTestfileInstall.cmake @@ -17,11 +17,11 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C4 C5 C6 C7 C8 C9 - D0 D1 D3 D5 D6 D7 E0) +SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A9 B1 C3 C5 C6 C8 C9 + D1 D3 D5 D6 D7 E0) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME BUGS_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_BUGS_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/bugs/D0.py b/test/VisuPrs/bugs/D0.py deleted file mode 100644 index 71e13fd8..00000000 --- a/test/VisuPrs/bugs/D0.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright (C) 2010-2016 CEA/DEN, EDF R&D -# -# 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, or (at your option) any later version. -# -# 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 -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# - -# This case corresponds to: /visu/bugs3/D0 case - -import sys -import os -import time -from paravistest import datadir, pictureext, get_picture_dir -from presentations import * -import pvsimple - -picturedir = get_picture_dir("bugs/D0") - -# Aux method -def get_group_full_name(source, group_name): - result_name = group_name - - #full_names = source.Groups.Available - full_names = get_group_names(source) - for name in full_names: - if name.endswith(group_name): - result_name = name - break - - return result_name - -# -# NB! An 'Unknown exception' is raised, when a user try to open -# "Bug619-result_calcul_OCC.med" file in MED module via 'Add Data Source' functionality. -# Refer to LastTest.log file for more information. -# TODO: check MedReader pb. -# -# 1. Import of the "Bug619-result_calcul_OCC.med" file -med_file_path = datadir + "Bug619-result_calcul_OCC.med" - -pvsimple.OpenDataFile(med_file_path) -med_reader = pvsimple.GetActiveSource() - -if med_reader is None: - raise RuntimeError, "Bug619-result_calcul_OCC.med was not imported!!!" - -# 2. Creation of ScalarMap: -# iteration1: on the "TU_3D_G1" group -# iteration2: on the "TU_3D_D1" group -view = pvsimple.GetRenderView() -field_name = "MECASTATEQUI_ELNO_SIGM" - -groups = ['TU_3D_G1', 'TU_3D_D1'] - -for group_name in groups: - extract_group = pvsimple.ExtractGroup(med_reader) - #extract_group.Groups = [get_group_full_name(med_reader, group_name)] - extract_group.AllGroups = [get_group_full_name(extract_group, group_name)] - extract_group.UpdatePipeline() - - scalar_map = ScalarMapOnField(extract_group, EntityType.CELL, field_name, 1) - if scalar_map is None : - raise RuntimeError, "ScalarMap presentation on '" + group_name + "' group is None!!!" - - pic_path = os.path.join(picturedir, "npal18711_" + group_name + "." + pictureext) - process_prs_for_test(scalar_map, view, pic_path) diff --git a/test/VisuPrs/bugs/D1.py b/test/VisuPrs/bugs/D1.py index 27abc41e..554f9095 100644 --- a/test/VisuPrs/bugs/D1.py +++ b/test/VisuPrs/bugs/D1.py @@ -21,7 +21,7 @@ import sys import os -from paravistest import datadir, pictureext, get_picture_dir +from paravistest import datadir, pictureext, get_picture_dir, get_png_picture_resolution from presentations import * import pvsimple @@ -36,7 +36,8 @@ if med_reader1 is None: # 2. Creation of a set of "DeformedShape and ScalarMap" presentations, based on time stamps of "MODES_DEPL" field errors=0 -sizes=[] +sizew=[] +sizeh=[] for i in range(1,11): presentation = DeformedShapeAndScalarMapOnField(med_reader1, EntityType.NODE, "MODES___DEPL____________________", i) @@ -46,14 +47,24 @@ for i in range(1,11): pic_path = os.path.join(picturedir, "npal19999_1_time_stamp_" + str(i) + "." + pictureext) process_prs_for_test(presentation, pvsimple.GetRenderView(), pic_path) - sizes.append(os.path.getsize(pic_path)) + (h,w) = get_png_picture_resolution(pic_path) + sizew.append(w) + sizeh.append(h) -if abs(max(sizes)-min(sizes)) > 0.01*max(sizes): - print "WARNING!!! Pictures have different sizes!!!" +if abs(max(sizeh)-min(sizeh)) > 0.01*max(sizeh): + print "WARNING!!! Pictures have different height !!!" errors += 1 for i in range(1,11): - picture_name = "npal19999_1_time_stamp_" + str(i) + "." + pictureext - print "Picture: " + picture_name + "; size: " + str(sizes[i-1]) + picture_name = "npal19999_2_time_stamp_" + str(i) + "." + pictureext + print "Picture: " + picture_name + "; height : " + str(sizeh[i-1]) + raise RuntimeError + +if abs(max(sizew)-min(sizew)) > 0.01*max(sizew): + print "WARNING!!! Pictures have different width !!!" + errors += 1 + for i in range(1,11): + picture_name = "npal19999_2_time_stamp_" + str(i) + "." + pictureext + print "Picture: " + picture_name + "; width : " + str(sizew[i-1]) raise RuntimeError # 3. Import of the "Bug829_resu_mode.med" file at second time @@ -64,7 +75,8 @@ if med_reader2 is None: # 4. Creation of a set of "DeformedShape and ScalarMap" presentations, based on time stamps of "MODES_DEPL" field errors = 0 -sizes=[] +sizew=[] +sizeh=[] for i in range(1,11): presentation = DeformedShapeAndScalarMapOnField(med_reader2, EntityType.NODE, "MODES___DEPL____________________", 11-i) @@ -73,13 +85,23 @@ for i in range(1,11): pic_path = os.path.join(picturedir, "npal19999_2_time_stamp_" + str(i) + "." + pictureext) process_prs_for_test(presentation, pvsimple.GetRenderView(), pic_path) + (h,w) = get_png_picture_resolution(pic_path) + sizew.append(w) + sizeh.append(h) - sizes.append(os.path.getsize(pic_path)) +if abs(max(sizeh)-min(sizeh)) > 0.01*max(sizeh): + print "WARNING!!! Pictures have different height !!!" + errors += 1 + for i in range(1,11): + picture_name = "npal19999_2_time_stamp_" + str(i) + "." + pictureext + print "Picture: " + picture_name + "; height : " + str(sizeh[i-1]) + raise RuntimeError -if abs(max(sizes)-min(sizes)) > 0.01*max(sizes): - print "WARNING!!! Pictures have different sizes!!!" +if abs(max(sizew)-min(sizew)) > 0.01*max(sizew): + print "WARNING!!! Pictures have different width !!!" errors += 1 for i in range(1,11): picture_name = "npal19999_2_time_stamp_" + str(i) + "." + pictureext - print "Picture: " + picture_name + "; size: " + str(sizes[i-1]) + print "Picture: " + picture_name + "; width : " + str(sizew[i-1]) raise RuntimeError + diff --git a/test/VisuPrs/bugs/D5.py b/test/VisuPrs/bugs/D5.py index ae667ad5..0ab78541 100644 --- a/test/VisuPrs/bugs/D5.py +++ b/test/VisuPrs/bugs/D5.py @@ -48,7 +48,12 @@ for table_nb in range(0, tables_count): # Get lookup table lookup_table = get_lookup_table(field_name, nb_components, vector_mode) - lookup_table.LockScalarRange = 0 + if hasattr(lookup_table,"LockDataRange"): + lookup_table.LockDataRange = 0 + elif hasattr(lookup_table,"LockScalarRange"): + lookup_table.LockScalarRange = 0 + else: + raise RuntimeError("Object %s has no 'LockDataRange' or 'LockScalarRange' attribute!"%(lookup_table)) # Set properties prs.ColorArrayName = (EntityType.get_pvtype(EntityType.NODE), field_name) diff --git a/test/VisuPrs/dump_study/A0.py b/test/VisuPrs/dump_study/A0.py index dc4da469..6ca008c6 100644 --- a/test/VisuPrs/dump_study/A0.py +++ b/test/VisuPrs/dump_study/A0.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal'} @@ -36,6 +44,8 @@ if med_reader is None : med_field = "vitesse" scalarmap = ScalarMapOnField(med_reader, EntityType.NODE, med_field, 1) +scalarmap.Visibility = 1 +scalarmap.SetScalarBarVisibility(GetActiveView(),1) # apply settings scalarmap.Position = settings["Offset"] @@ -52,9 +62,11 @@ bar.NumberOfLabels = settings["NbLabels"] bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] + # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "ScalarMap.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(scalarmap) @@ -65,8 +77,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_scalarmap = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_scalarmap = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A1.py b/test/VisuPrs/dump_study/A1.py index 32d33460..80226504 100644 --- a/test/VisuPrs/dump_study/A1.py +++ b/test/VisuPrs/dump_study/A1.py @@ -23,6 +23,15 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + + settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "NbSurfaces": 444} # 1. TimeStamps.med import @@ -36,6 +45,8 @@ if med_reader is None : med_field = "vitesse" isosurfaces = IsoSurfacesOnField(med_reader, EntityType.NODE, med_field, 1) +isosurfaces.Visibility = 1 +isosurfaces.SetScalarBarVisibility(GetActiveView(),1) # apply settings isosurfaces.Position = settings["Offset"] @@ -59,8 +70,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "IsoSurfaces.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(isosurfaces) @@ -71,8 +83,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_isosurfaces = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_isosurfaces = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A2.py b/test/VisuPrs/dump_study/A2.py index e9c47ccf..b8fb5783 100644 --- a/test/VisuPrs/dump_study/A2.py +++ b/test/VisuPrs/dump_study/A2.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal'} @@ -36,6 +44,8 @@ if med_reader is None : med_field = "vitesse" cutplanes = CutPlanesOnField(med_reader, EntityType.NODE, med_field, 1) +cutplanes.Visibility = 1 +cutplanes.SetScalarBarVisibility(GetActiveView(),1) # apply settings cutplanes.Position = settings["Offset"] @@ -60,8 +70,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "CutPlanes.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(cutplanes) @@ -72,8 +83,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_cutplanes = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_cutplanes = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A3.py b/test/VisuPrs/dump_study/A3.py index d79482da..67cf245f 100644 --- a/test/VisuPrs/dump_study/A3.py +++ b/test/VisuPrs/dump_study/A3.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorArray": "", "ColorComponents": [0.111, 0.222, 0.333]} @@ -35,7 +43,9 @@ if med_reader is None : # 2. DeformedShape creation med_field = "vitesse" -deformedshape = DeformedShapeOnField(med_reader, EntityType.NODE, med_field, 1) +deformedshape = DeformedShapeOnField(med_reader, EntityType.NODE, med_field, 1, None, True) +deformedshape.Visibility = 1 +deformedshape.SetScalarBarVisibility(GetActiveView(),1) # apply settings deformedshape.Position = settings["Offset"] @@ -57,8 +67,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "DeformedShape.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(deformedshape) @@ -69,8 +80,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_deformedshape = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_deformedshape = view.Representations[0] errors = 0 tolerance = 1e-05 @@ -159,8 +170,8 @@ if abs(scale - settings["Scale"]) > tolerance: # Color array name array_name = recreated_deformedshape.ColorArrayName[1] -if array_name != settings["ColorArray"]: - print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", settings["arrayName"] +if array_name != med_field: + print "ERROR!!! Color array name of presentation is incorrect: ", array_name , " instead of ", med_field errors += 1 # Color diff --git a/test/VisuPrs/dump_study/A4.py b/test/VisuPrs/dump_study/A4.py index 33e47078..1076346b 100644 --- a/test/VisuPrs/dump_study/A4.py +++ b/test/VisuPrs/dump_study/A4.py @@ -22,6 +22,15 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 1), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation"} @@ -36,6 +45,8 @@ if med_reader is None : med_field = "pression" gausspoints = GaussPointsOnField(med_reader, EntityType.CELL, med_field, 1) +gausspoints.Visibility = 1 +gausspoints.SetScalarBarVisibility(GetActiveView(),1) # apply settings gausspoints.Position = settings["Offset"] @@ -51,8 +62,9 @@ bar.NumberOfLabels = settings["NbLabels"] bar.Title = settings["Title"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "GaussPoints.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(gausspoints) @@ -63,8 +75,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_gausspoints = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_gausspoints = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A5.py b/test/VisuPrs/dump_study/A5.py index 9b00410e..3c830d26 100644 --- a/test/VisuPrs/dump_study/A5.py +++ b/test/VisuPrs/dump_study/A5.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "ScaleFactor": 0.25, "NbContours": 4} @@ -36,6 +44,8 @@ if med_reader is None : med_field = "VITESSE" plot3d = Plot3DOnField(med_reader, EntityType.NODE, med_field, 1, is_contour=True) +plot3d.Visibility = 1 +plot3d.SetScalarBarVisibility(GetActiveView(),1) # apply settings plot3d.Position = settings["Offset"] @@ -68,8 +78,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "Plot3D.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(plot3d) @@ -80,8 +91,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_plot3d = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_plot3d = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A6.py b/test/VisuPrs/dump_study/A6.py index d91da4e8..e5613916 100644 --- a/test/VisuPrs/dump_study/A6.py +++ b/test/VisuPrs/dump_study/A6.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.12929} @@ -36,6 +44,8 @@ if med_reader is None: med_field = "vitesse" prs = DeformedShapeAndScalarMapOnField(med_reader, EntityType.NODE, med_field, 1) +prs.Visibility = 1 +prs.SetScalarBarVisibility(GetActiveView(),1) # apply settings prs.Position = settings["Offset"] @@ -57,8 +67,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "ScalarMapOnDeformedShape.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(prs) @@ -69,8 +80,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_prs = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_prs = view.Representations[0] errors = 0 tolerance = 1e-05 diff --git a/test/VisuPrs/dump_study/A7.py b/test/VisuPrs/dump_study/A7.py index 54a0cc8b..8acbffe6 100644 --- a/test/VisuPrs/dump_study/A7.py +++ b/test/VisuPrs/dump_study/A7.py @@ -22,6 +22,15 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + # StreamLines settings settings = {'name': 'myStreamLines', @@ -74,8 +83,9 @@ stream.SeedType.NumberOfPoints = settings['SeedType.NumberOfPoints'] stream.SeedType.Radius = settings['SeedType.Radius'] # 4. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "StreamLines.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects delete_with_inputs(stream) diff --git a/test/VisuPrs/dump_study/A8.py b/test/VisuPrs/dump_study/A8.py index d70048a2..ab9580a5 100644 --- a/test/VisuPrs/dump_study/A8.py +++ b/test/VisuPrs/dump_study/A8.py @@ -22,8 +22,17 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace -settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorArray": "", "ColorComponents": [0.111, 0.222, 0.333], "LineWidth": 2, "GlyphType": 'Cone', "GlyphPos": [-0.5, 0.0, 0.0]} +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + + +settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Scale": 0.333, "ColorComponents": [0.111, 0.222, 0.333], "LineWidth": 2, "GlyphType": 'Cone', "GlyphPos": [-0.5, 0.0, 0.0]} # 1. TimeStamps.med import file_path = datadir + "TimeStamps.med" @@ -35,7 +44,9 @@ if med_reader is None : # 2. Vectors creation med_field = "vitesse" -vectors = VectorsOnField(med_reader, EntityType.NODE, med_field, 1) +vectors = VectorsOnField(med_reader, EntityType.NODE, med_field, 1,is_colored=True) +vectors.Visibility = 1 +vectors.SetScalarBarVisibility(GetActiveView(),1) # apply settings vectors.Position = settings["Offset"] @@ -45,8 +56,7 @@ vectors.LookupTable.Discretize = settings["Discretize"] vectors.LookupTable.NumberOfTableValues = settings["NbColors"] vectors.LookupTable.UseLogScale = settings["UseLogScale"] -vectors.Input.SetScaleFactor = settings["Scale"] -vectors.ColorArrayName = (None, '') +vectors.Input.ScaleFactor = settings["Scale"] vectors.AmbientColor = settings["ColorComponents"] vectors.LineWidth = settings["LineWidth"] @@ -63,8 +73,9 @@ bar.Orientation = settings["Orientation"] cone_glyth_type = type(vectors.Input.GlyphType) # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "Vectors.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(vectors) @@ -75,8 +86,8 @@ view = CreateRenderView() execfile(path_to_save) # 6. Checking of the settings done before dump -recreated_bar = view.Representations[0] -recreated_vectors = view.Representations[1] +recreated_bar = view.Representations[1] +recreated_vectors = view.Representations[0] errors = 0 tolerance = 1e-05 @@ -158,15 +169,15 @@ if orientation != settings["Orientation"]: errors += 1 # Scale factor -scale = recreated_vectors.Input.SetScaleFactor +scale = recreated_vectors.Input.ScaleFactor if abs(scale - settings["Scale"]) > tolerance: print "ERROR!!! Scale of presentation is incorrect: ", scale, " instead of ", settings["Scale"] errors += 1 # Color array name array_name = recreated_vectors.ColorArrayName[1] -if array_name != settings["ColorArray"]: - print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", settings["arrayName"] +if array_name != med_field: + print "ERROR!!! Color array name of presentation is incorrect: ", array_name, " instead of ", med_field errors += 1 # Color diff --git a/test/VisuPrs/dump_study/A9.py b/test/VisuPrs/dump_study/A9.py index 51bbfff2..23dba938 100644 --- a/test/VisuPrs/dump_study/A9.py +++ b/test/VisuPrs/dump_study/A9.py @@ -22,6 +22,14 @@ from paravistest import datadir, delete_with_inputs from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) settings = {"Offset": [0.0001, 0.0002, 0], "ScalarMode": ("Component", 2), "Position": [0.1, 0.2], "Size": [0.15, 0.25], "Discretize": 1, "NbColors": 44, "NbLabels": 22, "Title": "My presentation", "UseLogScale": 1, "Orientation": 'Horizontal', "Orientation_BasePlane": [Orientation.ZX, 22, 33], "Orientation_CuttingPlanes": [Orientation.YZ, 44, 55], "Displacement": 0.1, "Displacement2": 0.2, "BasePlane_Position": 0.1, "NbLines": 3} @@ -46,6 +54,9 @@ d1 = settings["Displacement"] d2 = settings["Displacement2"] cutlines = CutLinesOnField(med_reader, EntityType.NODE, med_field, 1, nb_lines, orient1, base_ang1, base_ang2, orient2, cut_ang1, cut_ang2, d1, d2) +cutlines.Visibility = 1 +cutlines.SetScalarBarVisibility(GetActiveView(),1) + # apply settings cutlines.Position = settings["Offset"] @@ -70,8 +81,9 @@ bar.Title = settings["Title"] bar.Orientation = settings["Orientation"] # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "CutLines.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view delete_with_inputs(cutlines) diff --git a/test/VisuPrs/dump_study/B0.py b/test/VisuPrs/dump_study/B0.py index 1c6171f4..fcea366a 100644 --- a/test/VisuPrs/dump_study/B0.py +++ b/test/VisuPrs/dump_study/B0.py @@ -22,6 +22,14 @@ from paravistest import datadir from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +GetActiveViewOrCreate('RenderView') + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) # 1. TimeStamps.med import file_path = datadir + "TimeStamps.med" @@ -57,8 +65,9 @@ for name in prs_names: prs_list.append(prs) # 3. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "AllPresentations.py") -SaveTrace( path_to_save ) +save_trace( path_to_save, text ) # 4. Delete the created objects, recreate the view source_list = GetSources().values() diff --git a/test/VisuPrs/dump_study/B3.py b/test/VisuPrs/dump_study/B3.py index b9e9b77f..a497c918 100644 --- a/test/VisuPrs/dump_study/B3.py +++ b/test/VisuPrs/dump_study/B3.py @@ -22,6 +22,12 @@ import paravistest from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) # 1. Table creation title = "My Table" @@ -69,8 +75,9 @@ table.UpdatePipeline() orig_script = table.Script # 2. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "table.py") -SaveTrace(path_to_save) +save_trace( path_to_save, text ) # 3. Delete the table Delete(table) diff --git a/test/VisuPrs/dump_study/B4.py b/test/VisuPrs/dump_study/B4.py index 58cd338a..a0425170 100644 --- a/test/VisuPrs/dump_study/B4.py +++ b/test/VisuPrs/dump_study/B4.py @@ -22,6 +22,13 @@ import paravistest from presentations import * from pvsimple import * +from paravistest import save_trace +from paraview import smtrace + +config = smtrace.start_trace() +config.SetFullyTraceSupplementalProxies(True) +config.SetPropertiesToTraceOnCreate(config.RECORD_ALL_PROPERTIES) + # 1. Table creation title = "My Table" @@ -69,8 +76,9 @@ table.UpdatePipeline() orig_script = table.Script # 2. Dump Study +text = smtrace.stop_trace() path_to_save = os.path.join(os.getenv("HOME"), "table.py") -SaveTrace(path_to_save) +save_trace( path_to_save, text ) # 3. Delete the table Delete(table) diff --git a/test/VisuPrs/dump_study/CMakeLists.txt b/test/VisuPrs/dump_study/CMakeLists.txt index 96dda506..67115b6e 100644 --- a/test/VisuPrs/dump_study/CMakeLists.txt +++ b/test/VisuPrs/dump_study/CMakeLists.txt @@ -18,7 +18,7 @@ # SET(BASE_TESTS A0 B0) -SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B3 B4 B5) +SET(ALL_TESTS A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B3 B4 B5) # For make test IF(SALOME_PARAVIS_ALL_TEST) diff --git a/test/VisuPrs/dump_study/CTestTestfileInstall.cmake b/test/VisuPrs/dump_study/CTestTestfileInstall.cmake index 124f9eea..a244a334 100644 --- a/test/VisuPrs/dump_study/CTestTestfileInstall.cmake +++ b/test/VisuPrs/dump_study/CTestTestfileInstall.cmake @@ -20,7 +20,7 @@ SET(TEST_NAMES A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 B0 B1 B3 B4 B5) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME DUMPSTUDY_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_DUMPSTUDY_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/imps/A1.py b/test/VisuPrs/imps/A1.py index 8409a800..95695413 100644 --- a/test/VisuPrs/imps/A1.py +++ b/test/VisuPrs/imps/A1.py @@ -41,7 +41,12 @@ def set_prs_colored(prs, proxy, entity, field_name, vector_mode, timestamp_nb): # Set field range data_range = get_data_range(proxy, entity, field_name, vector_mode) - lookup_table.LockScalarRange = 1 + if hasattr(lookup_table,"LockDataRange"): + lookup_table.LockDataRange = 1 + elif hasattr(lookup_table,"LockScalarRange"): + lookup_table.LockScalarRange = 1 + else: + raise RuntimeError("Object %s has no 'LockDataRange' or 'LockScalarRange' attribute!"%(lookup_table)) lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] # Set properties diff --git a/test/VisuPrs/imps/CTestTestfileInstall.cmake b/test/VisuPrs/imps/CTestTestfileInstall.cmake index 43d17050..ce264536 100644 --- a/test/VisuPrs/imps/CTestTestfileInstall.cmake +++ b/test/VisuPrs/imps/CTestTestfileInstall.cmake @@ -20,7 +20,7 @@ SET(TEST_NAMES A1 A2 A3 A4 A6 A9 B1 B2) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME IMPS_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_IMPS_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/VisuPrs/united/CTestTestfileInstall.cmake b/test/VisuPrs/united/CTestTestfileInstall.cmake index 93876df5..1ebd7f83 100644 --- a/test/VisuPrs/united/CTestTestfileInstall.cmake +++ b/test/VisuPrs/united/CTestTestfileInstall.cmake @@ -20,7 +20,7 @@ SET(TEST_NAMES A1 A2 A4 A5 B0) FOREACH(tfile ${TEST_NAMES}) - SET(TEST_NAME UNITED_${tfile}) + SET(TEST_NAME ${COMPONENT_NAME}_UNITED_${tfile}) ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}") ENDFOREACH() diff --git a/test/standalone/CMakeLists.txt b/test/standalone/CMakeLists.txt index e6984c24..5c48d05b 100644 --- a/test/standalone/CMakeLists.txt +++ b/test/standalone/CMakeLists.txt @@ -25,7 +25,12 @@ SET(CMAKE_BUILD_TYPE "Debug") OPTION(LIGHTPARAVIS_WITH_GUI "Build GUI test app" ON) # Package detection -FIND_PACKAGE(Qt4 REQUIRED) +IF (NOT SALOME_GUI_BUILD_WITH_QT5) + FIND_PACKAGE(Qt4 REQUIRED) +ELSE() + FIND_PACKAGE(Qt5Core) + FIND_PACKAGE(Qt5Gui) +ENDIF() LIST(APPEND CMAKE_PREFIX_PATH "$ENV{PARAVIEW_ROOT_DIR}") FIND_PACKAGE(ParaView REQUIRED) diff --git a/test/standalone/gui/CMakeLists.txt b/test/standalone/gui/CMakeLists.txt index 8af5fee6..a4b18ca2 100644 --- a/test/standalone/gui/CMakeLists.txt +++ b/test/standalone/gui/CMakeLists.txt @@ -18,6 +18,8 @@ # # Author: Adrien Bruneton (CEA) +INCLUDE(UseQtExt) + SET(pl_HEADERS PLMainWindow.hxx PLViewTab.hxx @@ -47,7 +49,6 @@ SET(CMAKE_INCLUDE_CURRENT_DIR ON) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) INCLUDE_DIRECTORIES(${PARAVIEW_INCLUDE_DIRS}) -INCLUDE(${QT_USE_FILE}) ADD_DEFINITIONS(${QT_DEFINITIONS}) # Generate resources that will embedded @@ -59,11 +60,11 @@ GENERATE_QT_RESOURCE_FROM_FILES( "/LightPara/Configuration" "${PROJECT_SOURCE_DIR}/gui/xml/ParaViewReaders.xml") -QT4_ADD_RESOURCES(rcs_sources +QT_ADD_RESOURCES(rcs_sources ${ui_resources} ) -QT4_WRAP_UI(pl_FORMS_HEADERS ${pl_FORMS}) -QT4_WRAP_CPP(pl_HEADERS_MOC ${pl_HEADERS}) +QT_WRAP_UIC(pl_FORMS_HEADERS ${pl_FORMS}) +QT_WRAP_MOC(pl_HEADERS_MOC ${pl_HEADERS}) ADD_EXECUTABLE(paraLight ${pl_SOURCES}