From 89c33033151baa33eeac8fb09d9c0488acb43c35 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 9 Aug 2012 11:16:07 +0000 Subject: [PATCH] Merge from V6_main_20120808 08Aug12 --- CMakeLists.txt | 323 +- INSTALL | 25 +- PARAVIS_version.h.in | 22 +- adm_local/CMakeLists.txt | 51 +- adm_local/cmake_files/CMakeLists.txt | 123 +- adm_local/cmake_files/FindPARAVIEW.cmake | 67 +- adm_local/unix/CMakeLists.txt | 44 - adm_local/unix/config_files/CMakeLists.txt | 113 - adm_local/unix/config_files/check_Med.m4 | 92 - adm_local/unix/config_files/check_Med2.m4 | 200 - adm_local/unix/config_files/check_ParaView.m4 | 175 - adm_local/unix/config_files/check_VISU.m4 | 73 - .../config_files/med_check_sizeof_medint.m4 | 38 - bin/CMakeLists.txt | 198 +- bin/VERSION.in | 4 +- bin/paravis_setenv.py | 35 + doc/CMakeLists.txt | 67 +- doc/UserDocumentation.html | 131 +- doc/salome/CMakeLists.txt | 69 +- doc/salome/gui/CMakeLists.txt | 88 +- doc/salome/gui/doxyfile.in | 20 + getwrapclasses.py | 43 +- idl/CMakeLists.txt | 765 +- idl/PARAVIS_Gen.idl | 43 +- idl/PARAVIS_Gen_Types.idl | 30 +- idl/create_header.py | 39 + idl/create_header.sh | 19 + idl/create_hints.py | 38 + idl/create_hints.sh | 19 + idl/vtkWrapIDL.c | 1256 +- idl/wrap.cmake | 45 +- resources/CMakeLists.txt | 233 +- resources/LightApp.xml | 13 - resources/PARAVISCatalog.xml.in | 5 +- resources/ParaViewFilters.xml | 39 +- resources/ParaViewReaders.xml | 23 +- resources/ParaViewWriters.xml | 3 +- resources/SalomeApp.xml | 21 - resources/SalomeApp.xml.in | 47 + src/CMakeLists.txt | 80 +- src/ENGINE/CMakeLists.txt | 415 +- src/ENGINE/PARAVIS_Engine_i.cc | 54 +- src/ENGINE/PARAVIS_Engine_i.hh | 34 +- src/Macro/CMakeLists.txt | 26 + src/Macro/modes.py | 93 + src/PVGUI/CMakeLists.txt | 872 +- src/PVGUI/PARAVIS_Gen_i.cc | 215 +- src/PVGUI/PARAVIS_Gen_i.hh | 49 +- src/PVGUI/PVGUI.qrc.in | 6 + src/PVGUI/PVGUI_Module.cxx | 885 +- src/PVGUI/PVGUI_Module.h | 143 +- src/PVGUI/PVGUI_Module_actions.cxx | 154 +- src/PVGUI/PVGUI_Module_impl.h | 61 - src/PVGUI/PVGUI_Module_widgets.cxx | 199 +- src/PVGUI/PVGUI_OutputWindowAdapter.cxx | 60 +- src/PVGUI/PVGUI_OutputWindowAdapter.h | 19 +- src/PVGUI/PVGUI_ParaViewSettingsPane.cxx | 647 + src/PVGUI/PVGUI_ParaViewSettingsPane.h | 123 + src/PVGUI/PVGUI_Tools.cxx | 47 +- src/PVGUI/PVGUI_Tools.h | 6 +- src/PVGUI/PVGUI_ViewManager.cxx | 24 +- src/PVGUI/PVGUI_ViewManager.h | 22 +- src/PVGUI/PVGUI_ViewModel.cxx | 19 +- src/PVGUI/PVGUI_ViewModel.h | 18 +- src/PVGUI/PVGUI_ViewWindow.cxx | 38 +- src/PVGUI/PVGUI_ViewWindow.h | 25 +- src/PVGUI/PV_Events.h | 64 +- src/PVGUI/PV_I.h | 31 +- src/PVGUI/PV_Tools.cxx | 30 +- src/PVGUI/PV_Tools.h | 34 +- src/PVGUI/create_class.py | 55 + src/PVGUI/create_class.sh | 18 + src/PVGUI/resources/PARAVIS_msg_en.ts | 118 +- src/PVGUI/resources/PARAVIS_msg_fr.ts | 1213 ++ src/PVGUI/ui_pqOptionsDialog.h | 145 + src/PVGUI/wrap.cmake | 49 +- src/PV_SWIG/CMakeLists.txt | 139 +- src/PV_SWIG/paravis.py | 31 +- src/PV_SWIG/paravisSM.py | 891 +- src/PV_SWIG/presentations.py | 2504 +++ src/PV_SWIG/pvsimple.py | 407 +- src/PV_SWIG/servermanager.diff | 167 +- src/PV_SWIG/simple.diff | 276 +- src/ParaView/lex.yy.c | 6335 +++++--- src/ParaView/vtkParse.h | 167 - src/ParaView/vtkParse.tab.c | 12773 ++++++++++++---- src/ParaView/vtkParseExtras.c | 1570 ++ src/ParaView/vtkParseExtras.h | 173 + src/ParaView/vtkParseHierarchy.c | 988 ++ src/ParaView/vtkParseHierarchy.h | 157 + src/ParaView/vtkParseInternal.h | 137 + src/ParaView/vtkParseMain.c | 309 + src/ParaView/vtkParsePreprocess.c | 2635 ++++ src/ParaView/vtkParsePreprocess.h | 225 + src/ParaView/vtkWrap.c | 973 ++ src/ParaView/vtkWrap.h | 242 + src/ParaView/vtkWrapHierarchy.c | 1015 ++ src/ParaView/vtkWrapText.c | 988 ++ src/ParaView/vtkWrapText.h | 61 + src/Plugins/CMakeLists.txt | 31 +- src/Plugins/ElevationSurface/CMakeLists.txt | 42 + .../ElevationSurface/ElevationSurface.xml | 93 + .../ElevationSurfaceClient.xml | 5 + .../vtkElevationSurfaceFilter.cxx | 363 + .../vtkElevationSurfaceFilter.h | 92 + src/Plugins/Filter/CMakeLists.txt | 18 + src/Plugins/Filter/vtkMySampleFilter.cxx | 19 + src/Plugins/Filter/vtkMySampleFilter.h | 19 + src/Plugins/IntegrationPoints/CMakeLists.txt | 45 + src/Plugins/IntegrationPoints/ELNOFilter.xml | 281 + .../IntegrationPoints/ELNOFilterClient.xml | 8 + .../IntegrationPoints/vtkELNOFilter.cxx | 128 + src/Plugins/IntegrationPoints/vtkELNOFilter.h | 54 + .../IntegrationPoints/vtkELNOMeshFilter.cxx | 203 + .../IntegrationPoints/vtkELNOMeshFilter.h | 43 + .../vtkELNOSurfaceFilter.cxx | 211 + .../IntegrationPoints/vtkELNOSurfaceFilter.h | 43 + .../MedReader/CMake/CTestCustom.ctest.in | 103 + src/Plugins/MedReader/CMake/FindMED.cmake | 96 + src/Plugins/MedReader/CMakeLists.txt | 83 + src/Plugins/MedReader/IO/CMakeLists.txt | 131 + .../MedReader/IO/Testing/CMakeLists.txt | 20 + .../MedReader/IO/Testing/Cxx/CMakeLists.txt | 77 + .../Cxx/TestMedDescendingPolyhedron.cxx | 189 + .../IO/Testing/Cxx/TestMedParallelRead.cxx | 110 + .../IO/Testing/Cxx/TestMedParallelWrite.cxx | 343 + .../IO/Testing/Cxx/TestMedPolyhedron.cxx | 165 + .../Cxx/TestMedReadDescendingPolyhedron.cxx | 234 + .../IO/Testing/Cxx/TestMedReadPolyhedron.cxx | 191 + .../IO/Testing/Cxx/TestMedReader.cxx | 80 + .../IO/Testing/Cxx/TestMedWriteOcta12.cxx | 149 + src/Plugins/MedReader/IO/config.h.cmake | 25 + src/Plugins/MedReader/IO/vtkExtractGroup.cxx | 425 + src/Plugins/MedReader/IO/vtkExtractGroup.h | 134 + .../MedReader/IO/vtkGenerateStructElement.cxx | 212 + .../MedReader/IO/vtkGenerateStructElement.h | 58 + src/Plugins/MedReader/IO/vtkMed.h | 45 + .../MedReader/IO/vtkMedCartesianGrid.cxx | 38 + .../MedReader/IO/vtkMedCartesianGrid.h | 42 + .../MedReader/IO/vtkMedConstantAttribute.cxx | 66 + .../MedReader/IO/vtkMedConstantAttribute.h | 109 + .../MedReader/IO/vtkMedCurvilinearGrid.cxx | 172 + .../MedReader/IO/vtkMedCurvilinearGrid.h | 80 + src/Plugins/MedReader/IO/vtkMedDriver.cxx | 466 + src/Plugins/MedReader/IO/vtkMedDriver.h | 232 + src/Plugins/MedReader/IO/vtkMedDriver30.cxx | 2371 +++ src/Plugins/MedReader/IO/vtkMedDriver30.h | 168 + .../MedReader/IO/vtkMedEntityArray.cxx | 531 + src/Plugins/MedReader/IO/vtkMedEntityArray.h | 200 + src/Plugins/MedReader/IO/vtkMedFactory.cxx | 45 + src/Plugins/MedReader/IO/vtkMedFactory.h | 44 + src/Plugins/MedReader/IO/vtkMedFamily.cxx | 63 + src/Plugins/MedReader/IO/vtkMedFamily.h | 83 + .../MedReader/IO/vtkMedFamilyOnEntity.cxx | 130 + .../MedReader/IO/vtkMedFamilyOnEntity.h | 100 + .../IO/vtkMedFamilyOnEntityOnProfile.cxx | 591 + .../IO/vtkMedFamilyOnEntityOnProfile.h | 146 + src/Plugins/MedReader/IO/vtkMedField.cxx | 326 + src/Plugins/MedReader/IO/vtkMedField.h | 176 + .../MedReader/IO/vtkMedFieldOnProfile.cxx | 88 + .../MedReader/IO/vtkMedFieldOnProfile.h | 126 + .../MedReader/IO/vtkMedFieldOverEntity.cxx | 56 + .../MedReader/IO/vtkMedFieldOverEntity.h | 81 + src/Plugins/MedReader/IO/vtkMedFieldStep.cxx | 77 + src/Plugins/MedReader/IO/vtkMedFieldStep.h | 115 + src/Plugins/MedReader/IO/vtkMedFile.cxx | 194 + src/Plugins/MedReader/IO/vtkMedFile.h | 141 + src/Plugins/MedReader/IO/vtkMedFilter.cxx | 63 + src/Plugins/MedReader/IO/vtkMedFilter.h | 49 + src/Plugins/MedReader/IO/vtkMedFraction.cxx | 211 + src/Plugins/MedReader/IO/vtkMedFraction.h | 94 + src/Plugins/MedReader/IO/vtkMedGrid.cxx | 98 + src/Plugins/MedReader/IO/vtkMedGrid.h | 166 + src/Plugins/MedReader/IO/vtkMedGroup.cxx | 43 + src/Plugins/MedReader/IO/vtkMedGroup.h | 57 + src/Plugins/MedReader/IO/vtkMedIntArray.cxx | 42 + src/Plugins/MedReader/IO/vtkMedIntArray.h | 68 + .../MedReader/IO/vtkMedIntArrayInternal.cxx | 53 + .../MedReader/IO/vtkMedIntArrayInternal.h | 145 + .../MedReader/IO/vtkMedInterpolation.cxx | 55 + .../MedReader/IO/vtkMedInterpolation.h | 92 + src/Plugins/MedReader/IO/vtkMedLink.cxx | 99 + src/Plugins/MedReader/IO/vtkMedLink.h | 87 + .../MedReader/IO/vtkMedLocalization.cxx | 701 + src/Plugins/MedReader/IO/vtkMedLocalization.h | 154 + src/Plugins/MedReader/IO/vtkMedMesh.cxx | 269 + src/Plugins/MedReader/IO/vtkMedMesh.h | 204 + src/Plugins/MedReader/IO/vtkMedPolarGrid.cxx | 38 + src/Plugins/MedReader/IO/vtkMedPolarGrid.h | 42 + src/Plugins/MedReader/IO/vtkMedProfile.cxx | 69 + src/Plugins/MedReader/IO/vtkMedProfile.h | 87 + src/Plugins/MedReader/IO/vtkMedReader.cxx | 3146 ++++ src/Plugins/MedReader/IO/vtkMedReader.h | 393 + .../MedReader/IO/vtkMedRegularGrid.cxx | 217 + src/Plugins/MedReader/IO/vtkMedRegularGrid.h | 84 + src/Plugins/MedReader/IO/vtkMedSelection.cxx | 118 + src/Plugins/MedReader/IO/vtkMedSelection.h | 62 + src/Plugins/MedReader/IO/vtkMedSetGet.h | 136 + .../MedReader/IO/vtkMedStructElement.cxx | 95 + .../MedReader/IO/vtkMedStructElement.h | 150 + .../MedReader/IO/vtkMedSupportMesh.cxx | 63 + src/Plugins/MedReader/IO/vtkMedSupportMesh.h | 101 + .../MedReader/IO/vtkMedUnstructuredGrid.cxx | 365 + .../MedReader/IO/vtkMedUnstructuredGrid.h | 82 + src/Plugins/MedReader/IO/vtkMedUtilities.cxx | 890 ++ src/Plugins/MedReader/IO/vtkMedUtilities.h | 468 + .../MedReader/IO/vtkMedVariableAttribute.cxx | 60 + .../MedReader/IO/vtkMedVariableAttribute.h | 83 + .../MedReader/ParaViewPlugin/CMakeLists.txt | 110 + .../Resources/Icons/pqCellData16.png | Bin 0 -> 899 bytes .../Resources/Icons/pqElnoData16.png | Bin 0 -> 926 bytes .../Resources/Icons/pqPointData16.png | Bin 0 -> 189 bytes .../Resources/Icons/pqQuadratureData16.png | Bin 0 -> 391 bytes .../Resources/MedReaderClient.xml | 7 + .../Resources/MedReaderServer.xml | 494 + .../Resources/UI/ExtractGroupPanel.ui | 141 + .../Resources/UI/MedReaderPanel.ui | 286 + .../ParaViewPlugin/Resources/pqMedReader.qrc | 9 + .../ParaViewPlugin/pqExtractGroupPanel.cxx | 170 + .../ParaViewPlugin/pqExtractGroupPanel.h | 59 + .../ParaViewPlugin/pqMedReaderPanel.cxx | 338 + .../ParaViewPlugin/pqMedReaderPanel.h | 74 + .../vtkSMMedGroupSelectionDomain.cxx | 78 + .../vtkSMMedGroupSelectionDomain.h | 49 + src/Plugins/NavigationMode/CMakeLists.txt | 58 + .../NavigationMode/pqSetModeStarter.cxx | 107 + src/Plugins/NavigationMode/pqSetModeStarter.h | 49 + src/Plugins/ParaMEDCorba/CMakeLists.txt | 92 + .../ParaMEDCorbaServerManager.xml | 67 + .../ParaMEDCorbaUserInterfaceSources.xml | 3 + .../ParaMEDCorba/ParaMEDMEM2VTK_defines.hxx | 33 + .../VTKMEDCouplingCMeshClient.cxx | 85 + .../VTKMEDCouplingCMeshClient.hxx | 32 + .../VTKMEDCouplingFieldClient.cxx | 212 + .../VTKMEDCouplingFieldClient.hxx | 40 + .../ParaMEDCorba/VTKMEDCouplingMeshClient.cxx | 80 + .../ParaMEDCorba/VTKMEDCouplingMeshClient.hxx | 34 + .../VTKMEDCouplingMultiFieldsClient.cxx | 337 + .../VTKMEDCouplingMultiFieldsClient.hxx | 88 + .../VTKMEDCouplingUMeshClient.cxx | 129 + .../VTKMEDCouplingUMeshClient.hxx | 32 + .../ParaMEDCorba/VTKParaMEDFieldClient.cxx | 56 + .../ParaMEDCorba/VTKParaMEDFieldClient.hxx | 36 + src/Plugins/ParaMEDCorba/testParaMEDCorba.cxx | 35 + .../ParaMEDCorba/vtkParaMEDCorbaSource.cxx | 273 + .../ParaMEDCorba/vtkParaMEDCorbaSource.h | 81 + src/Plugins/ScaleVector/CMakeLists.txt | 42 + src/Plugins/ScaleVector/ScaleVector.xml | 77 + src/Plugins/ScaleVector/ScaleVectorClient.xml | 3 + .../ScaleVector/vtkScaleVectorFilter.cxx | 170 + .../ScaleVector/vtkScaleVectorFilter.h | 54 + src/Plugins/TableReader/CMakeLists.txt | 47 + .../TableReader/ParaViewPlugin/CMakeLists.txt | 89 + .../ParaViewPlugin/Resources/TableReader.qrc | 5 + .../Resources/TableReaderClient.xml | 6 + .../Resources/TableReaderServer.xml | 80 + .../ParaViewPlugin/Resources/TableTo3D.qrc | 5 + .../Resources/TableTo3DClient.xml | 3 + .../Resources/TableTo3DServer.xml | 78 + .../UI/CustomLineChartDisplayPanel.ui | 335 + .../Resources/UI/CustomXYChartDisplayPanel.ui | 319 + .../Resources/UI/TableReaderPanel.ui | 103 + ...qCustomChartDisplayPanelImplementation.cxx | 79 + .../pqCustomChartDisplayPanelImplementation.h | 51 + .../pqCustomPlotSettingsModel.cxx | 218 + .../pqCustomPlotSettingsModel.h | 68 + .../pqCustomXYChartDisplayPanel.cxx | 511 + .../pqCustomXYChartDisplayPanel.h | 91 + .../ParaViewPlugin/pqTableReaderPanel.cxx | 112 + .../ParaViewPlugin/pqTableReaderPanel.h | 56 + .../ParaViewPlugin/pqTableTo3DPanel.cxx | 69 + .../ParaViewPlugin/pqTableTo3DPanel.h | 42 + src/Plugins/TableReader/Reader/CMakeLists.txt | 34 + .../TableReader/Reader/TableParser.cxx | 261 + src/Plugins/TableReader/Reader/TableParser.h | 53 + .../TableReader/Reader/vtkVisuTableReader.cxx | 204 + .../TableReader/Reader/vtkVisuTableReader.h | 103 + .../TableTo3DFilter/CMakeLists.txt | 33 + .../TableTo3DFilter/vtkTableTo3D.cxx | 214 + .../TableTo3DFilter/vtkTableTo3D.h | 81 + src/Plugins/ToolBar/CMakeLists.txt | 18 + src/Plugins/ToolBar/MyToolBarActions.cxx | 19 +- src/Plugins/ToolBar/MyToolBarActions.h | 18 + src/Plugins/View/CMakeLists.txt | 33 +- src/Plugins/View/MyDisplay.cxx | 18 + src/Plugins/View/MyDisplay.h | 18 + src/Plugins/View/MyView.cxx | 18 + src/Plugins/View/MyView.h | 18 + test/CMakeLists.txt | 21 + test/VisuPrs/2D_viewer/A0.py | 75 + test/VisuPrs/2D_viewer/A1.py | 55 + test/VisuPrs/2D_viewer/CMakeLists.txt | 27 + test/VisuPrs/3D_viewer/A1.py | 108 + test/VisuPrs/3D_viewer/A2.py | 106 + test/VisuPrs/3D_viewer/A3.py | 114 + test/VisuPrs/3D_viewer/A4.py | 105 + test/VisuPrs/3D_viewer/A5.py | 129 + test/VisuPrs/3D_viewer/A6.py | 130 + test/VisuPrs/3D_viewer/A7.py | 106 + test/VisuPrs/3D_viewer/A8.py | 110 + test/VisuPrs/3D_viewer/A9.py | 288 + test/VisuPrs/3D_viewer/B0.py | 133 + test/VisuPrs/3D_viewer/B2.py | 62 + test/VisuPrs/3D_viewer/CMakeLists.txt | 37 + test/VisuPrs/Animation/A0.py | 89 + test/VisuPrs/Animation/A2.py | 89 + test/VisuPrs/Animation/A4.py | 89 + test/VisuPrs/Animation/A7.py | 89 + test/VisuPrs/Animation/A8.py | 89 + test/VisuPrs/Animation/B2.py | 89 + test/VisuPrs/Animation/B5.py | 89 + test/VisuPrs/Animation/B6.py | 89 + test/VisuPrs/Animation/C0.py | 89 + test/VisuPrs/Animation/C1.py | 89 + test/VisuPrs/Animation/C3.py | 89 + test/VisuPrs/Animation/C8.py | 89 + test/VisuPrs/Animation/CMakeLists.txt | 55 + test/VisuPrs/Animation/D1.py | 90 + test/VisuPrs/Animation/D2.py | 89 + test/VisuPrs/Animation/D6.py | 89 + test/VisuPrs/Animation/D9.py | 89 + test/VisuPrs/Animation/E0.py | 89 + test/VisuPrs/Animation/E4.py | 89 + test/VisuPrs/Animation/E7.py | 85 + test/VisuPrs/Animation/E8.py | 89 + test/VisuPrs/Animation/F2.py | 89 + test/VisuPrs/Animation/F5.py | 89 + test/VisuPrs/Animation/F6.py | 89 + test/VisuPrs/Animation/G0.py | 89 + test/VisuPrs/Animation/G3.py | 90 + test/VisuPrs/Animation/G4.py | 90 + test/VisuPrs/Animation/G8.py | 89 + test/VisuPrs/Animation/H1.py | 89 + test/VisuPrs/Animation/H2.py | 89 + test/VisuPrs/CMakeLists.txt | 37 + test/VisuPrs/CutLines/A0.py | 39 + test/VisuPrs/CutLines/A1.py | 39 + test/VisuPrs/CutLines/A2.py | 39 + test/VisuPrs/CutLines/A3.py | 39 + test/VisuPrs/CutLines/A4.py | 39 + test/VisuPrs/CutLines/A5.py | 39 + test/VisuPrs/CutLines/A6.py | 39 + test/VisuPrs/CutLines/A7.py | 39 + test/VisuPrs/CutLines/A8.py | 39 + test/VisuPrs/CutLines/A9.py | 39 + test/VisuPrs/CutLines/B0.py | 39 + test/VisuPrs/CutLines/B1.py | 39 + test/VisuPrs/CutLines/B2.py | 39 + test/VisuPrs/CutLines/CMakeLists.txt | 63 + test/VisuPrs/CutLines/E0.py | 39 + test/VisuPrs/CutLines/E1.py | 39 + test/VisuPrs/CutLines/E2.py | 39 + test/VisuPrs/CutLines/E3.py | 39 + test/VisuPrs/CutLines/E4.py | 39 + test/VisuPrs/CutLines/E5.py | 39 + test/VisuPrs/CutLines/E6.py | 39 + test/VisuPrs/CutLines/E7.py | 39 + test/VisuPrs/CutLines/E8.py | 39 + test/VisuPrs/CutLines/E9.py | 39 + test/VisuPrs/CutLines/F0.py | 39 + test/VisuPrs/CutLines/F1.py | 39 + test/VisuPrs/CutLines/F2.py | 39 + test/VisuPrs/CutLines/F3.py | 39 + test/VisuPrs/CutLines/F4.py | 39 + test/VisuPrs/CutLines/F5.py | 39 + test/VisuPrs/CutLines/F6.py | 39 + test/VisuPrs/CutLines/F7.py | 39 + test/VisuPrs/CutLines/F8.py | 39 + test/VisuPrs/CutLines/F9.py | 39 + test/VisuPrs/CutLines/G0.py | 39 + test/VisuPrs/CutLines/G1.py | 39 + test/VisuPrs/CutLines/G2.py | 82 + test/VisuPrs/CutPlanes/A0.py | 39 + test/VisuPrs/CutPlanes/A1.py | 39 + test/VisuPrs/CutPlanes/A2.py | 39 + test/VisuPrs/CutPlanes/A3.py | 39 + test/VisuPrs/CutPlanes/A4.py | 39 + test/VisuPrs/CutPlanes/A5.py | 39 + test/VisuPrs/CutPlanes/A6.py | 39 + test/VisuPrs/CutPlanes/A7.py | 39 + test/VisuPrs/CutPlanes/A8.py | 39 + test/VisuPrs/CutPlanes/A9.py | 39 + test/VisuPrs/CutPlanes/B0.py | 39 + test/VisuPrs/CutPlanes/B1.py | 39 + test/VisuPrs/CutPlanes/B2.py | 39 + test/VisuPrs/CutPlanes/B3.py | 55 + test/VisuPrs/CutPlanes/CMakeLists.txt | 63 + test/VisuPrs/CutPlanes/E0.py | 39 + test/VisuPrs/CutPlanes/E1.py | 39 + test/VisuPrs/CutPlanes/E2.py | 39 + test/VisuPrs/CutPlanes/E3.py | 39 + test/VisuPrs/CutPlanes/E4.py | 39 + test/VisuPrs/CutPlanes/E5.py | 39 + test/VisuPrs/CutPlanes/E6.py | 39 + test/VisuPrs/CutPlanes/E7.py | 39 + test/VisuPrs/CutPlanes/E8.py | 39 + test/VisuPrs/CutPlanes/E9.py | 39 + test/VisuPrs/CutPlanes/F0.py | 39 + test/VisuPrs/CutPlanes/F1.py | 39 + test/VisuPrs/CutPlanes/F2.py | 39 + test/VisuPrs/CutPlanes/F3.py | 39 + test/VisuPrs/CutPlanes/F4.py | 39 + test/VisuPrs/CutPlanes/F5.py | 39 + test/VisuPrs/CutPlanes/F6.py | 39 + test/VisuPrs/CutPlanes/F7.py | 39 + test/VisuPrs/CutPlanes/F8.py | 39 + test/VisuPrs/CutPlanes/F9.py | 39 + test/VisuPrs/CutPlanes/G0.py | 39 + test/VisuPrs/CutPlanes/G1.py | 39 + test/VisuPrs/CutPlanes/G2.py | 82 + test/VisuPrs/DeformedShape/A0.py | 39 + test/VisuPrs/DeformedShape/A1.py | 39 + test/VisuPrs/DeformedShape/A2.py | 39 + test/VisuPrs/DeformedShape/A3.py | 39 + test/VisuPrs/DeformedShape/A4.py | 39 + test/VisuPrs/DeformedShape/A5.py | 39 + test/VisuPrs/DeformedShape/A6.py | 39 + test/VisuPrs/DeformedShape/A7.py | 39 + test/VisuPrs/DeformedShape/A8.py | 39 + test/VisuPrs/DeformedShape/A9.py | 39 + test/VisuPrs/DeformedShape/B0.py | 39 + test/VisuPrs/DeformedShape/B1.py | 39 + test/VisuPrs/DeformedShape/B2.py | 39 + test/VisuPrs/DeformedShape/B3.py | 111 + test/VisuPrs/DeformedShape/B4.py | 102 + test/VisuPrs/DeformedShape/CMakeLists.txt | 61 + test/VisuPrs/DeformedShape/E0.py | 39 + test/VisuPrs/DeformedShape/E1.py | 39 + test/VisuPrs/DeformedShape/E2.py | 39 + test/VisuPrs/DeformedShape/E3.py | 39 + test/VisuPrs/DeformedShape/E4.py | 39 + test/VisuPrs/DeformedShape/E5.py | 39 + test/VisuPrs/DeformedShape/E6.py | 39 + test/VisuPrs/DeformedShape/E7.py | 39 + test/VisuPrs/DeformedShape/E8.py | 39 + test/VisuPrs/DeformedShape/E9.py | 39 + test/VisuPrs/DeformedShape/F0.py | 39 + test/VisuPrs/DeformedShape/F1.py | 39 + test/VisuPrs/DeformedShape/F2.py | 39 + test/VisuPrs/DeformedShape/F3.py | 39 + test/VisuPrs/DeformedShape/F4.py | 39 + test/VisuPrs/DeformedShape/F5.py | 39 + test/VisuPrs/DeformedShape/F6.py | 39 + test/VisuPrs/DeformedShape/F7.py | 39 + test/VisuPrs/DeformedShape/F8.py | 39 + test/VisuPrs/DeformedShape/F9.py | 86 + test/VisuPrs/GaussPoints/A0.py | 59 + test/VisuPrs/GaussPoints/A1.py | 57 + test/VisuPrs/GaussPoints/A2.py | 59 + test/VisuPrs/GaussPoints/A3.py | 59 + test/VisuPrs/GaussPoints/A4.py | 59 + test/VisuPrs/GaussPoints/A5.py | 59 + test/VisuPrs/GaussPoints/A6.py | 59 + test/VisuPrs/GaussPoints/A7.py | 59 + test/VisuPrs/GaussPoints/A9.py | 59 + test/VisuPrs/GaussPoints/B0.py | 57 + test/VisuPrs/GaussPoints/B1.py | 57 + test/VisuPrs/GaussPoints/B2.py | 57 + test/VisuPrs/GaussPoints/B3.py | 57 + test/VisuPrs/GaussPoints/B4.py | 57 + test/VisuPrs/GaussPoints/B5.py | 57 + test/VisuPrs/GaussPoints/B6.py | 57 + test/VisuPrs/GaussPoints/B7.py | 57 + test/VisuPrs/GaussPoints/B8.py | 57 + test/VisuPrs/GaussPoints/B9.py | 57 + test/VisuPrs/GaussPoints/C0.py | 57 + test/VisuPrs/GaussPoints/C1.py | 57 + test/VisuPrs/GaussPoints/C2.py | 57 + test/VisuPrs/GaussPoints/C3.py | 57 + test/VisuPrs/GaussPoints/C4.py | 58 + test/VisuPrs/GaussPoints/C5.py | 61 + test/VisuPrs/GaussPoints/C6.py | 58 + test/VisuPrs/GaussPoints/C7.py | 58 + test/VisuPrs/GaussPoints/CMakeLists.txt | 53 + test/VisuPrs/IsoSurfaces/A0.py | 39 + test/VisuPrs/IsoSurfaces/A1.py | 39 + test/VisuPrs/IsoSurfaces/A2.py | 39 + test/VisuPrs/IsoSurfaces/A3.py | 39 + test/VisuPrs/IsoSurfaces/A4.py | 39 + test/VisuPrs/IsoSurfaces/A5.py | 39 + test/VisuPrs/IsoSurfaces/A6.py | 39 + test/VisuPrs/IsoSurfaces/A7.py | 39 + test/VisuPrs/IsoSurfaces/A8.py | 39 + test/VisuPrs/IsoSurfaces/A9.py | 39 + test/VisuPrs/IsoSurfaces/B0.py | 39 + test/VisuPrs/IsoSurfaces/B1.py | 39 + test/VisuPrs/IsoSurfaces/B2.py | 39 + test/VisuPrs/IsoSurfaces/CMakeLists.txt | 62 + test/VisuPrs/IsoSurfaces/E0.py | 39 + test/VisuPrs/IsoSurfaces/E1.py | 39 + test/VisuPrs/IsoSurfaces/E2.py | 39 + test/VisuPrs/IsoSurfaces/E3.py | 39 + test/VisuPrs/IsoSurfaces/E4.py | 39 + test/VisuPrs/IsoSurfaces/E5.py | 39 + test/VisuPrs/IsoSurfaces/E6.py | 39 + test/VisuPrs/IsoSurfaces/E7.py | 39 + test/VisuPrs/IsoSurfaces/E8.py | 39 + test/VisuPrs/IsoSurfaces/E9.py | 39 + test/VisuPrs/IsoSurfaces/F0.py | 39 + test/VisuPrs/IsoSurfaces/F1.py | 39 + test/VisuPrs/IsoSurfaces/F2.py | 39 + test/VisuPrs/IsoSurfaces/F3.py | 39 + test/VisuPrs/IsoSurfaces/F4.py | 39 + test/VisuPrs/IsoSurfaces/F5.py | 39 + test/VisuPrs/IsoSurfaces/F6.py | 39 + test/VisuPrs/IsoSurfaces/F7.py | 39 + test/VisuPrs/IsoSurfaces/F8.py | 39 + test/VisuPrs/IsoSurfaces/F9.py | 39 + test/VisuPrs/IsoSurfaces/G0.py | 39 + test/VisuPrs/IsoSurfaces/G1.py | 39 + test/VisuPrs/IsoSurfaces/G2.py | 82 + test/VisuPrs/MeshPresentation/A0.py | 39 + test/VisuPrs/MeshPresentation/A1.py | 39 + test/VisuPrs/MeshPresentation/A2.py | 39 + test/VisuPrs/MeshPresentation/A3.py | 39 + test/VisuPrs/MeshPresentation/A4.py | 39 + test/VisuPrs/MeshPresentation/A5.py | 39 + test/VisuPrs/MeshPresentation/A6.py | 39 + test/VisuPrs/MeshPresentation/A7.py | 39 + test/VisuPrs/MeshPresentation/A8.py | 39 + test/VisuPrs/MeshPresentation/A9.py | 39 + test/VisuPrs/MeshPresentation/B0.py | 39 + test/VisuPrs/MeshPresentation/B1.py | 39 + test/VisuPrs/MeshPresentation/B2.py | 39 + test/VisuPrs/MeshPresentation/CMakeLists.txt | 121 + test/VisuPrs/MeshPresentation/E0.py | 39 + test/VisuPrs/MeshPresentation/E1.py | 39 + test/VisuPrs/MeshPresentation/E2.py | 39 + test/VisuPrs/MeshPresentation/E3.py | 39 + test/VisuPrs/MeshPresentation/E4.py | 39 + test/VisuPrs/MeshPresentation/E5.py | 39 + test/VisuPrs/MeshPresentation/E6.py | 39 + test/VisuPrs/MeshPresentation/E7.py | 39 + test/VisuPrs/MeshPresentation/E8.py | 39 + test/VisuPrs/MeshPresentation/E9.py | 39 + test/VisuPrs/MeshPresentation/F0.py | 39 + test/VisuPrs/MeshPresentation/F1.py | 39 + test/VisuPrs/MeshPresentation/F2.py | 39 + test/VisuPrs/MeshPresentation/F3.py | 39 + test/VisuPrs/MeshPresentation/F4.py | 39 + test/VisuPrs/MeshPresentation/F5.py | 39 + test/VisuPrs/MeshPresentation/F6.py | 39 + test/VisuPrs/MeshPresentation/F7.py | 39 + test/VisuPrs/MeshPresentation/F8.py | 39 + test/VisuPrs/MeshPresentation/F9.py | 39 + test/VisuPrs/MeshPresentation/G0.py | 39 + test/VisuPrs/MeshPresentation/G1.py | 39 + test/VisuPrs/MeshPresentation/G3.py | 69 + test/VisuPrs/MeshPresentation/G4.py | 72 + test/VisuPrs/MeshPresentation/G5.py | 72 + test/VisuPrs/MeshPresentation/G6.py | 72 + test/VisuPrs/MeshPresentation/G7.py | 69 + test/VisuPrs/MeshPresentation/G8.py | 72 + test/VisuPrs/MeshPresentation/G9.py | 72 + test/VisuPrs/MeshPresentation/H0.py | 72 + test/VisuPrs/MeshPresentation/H1.py | 72 + test/VisuPrs/MeshPresentation/H2.py | 72 + test/VisuPrs/MeshPresentation/H3.py | 72 + test/VisuPrs/MeshPresentation/H4.py | 72 + test/VisuPrs/MeshPresentation/H5.py | 72 + test/VisuPrs/MeshPresentation/H6.py | 72 + test/VisuPrs/MeshPresentation/H7.py | 72 + test/VisuPrs/MeshPresentation/H8.py | 72 + test/VisuPrs/MeshPresentation/H9.py | 72 + test/VisuPrs/MeshPresentation/I0.py | 72 + test/VisuPrs/MeshPresentation/I1.py | 72 + test/VisuPrs/MeshPresentation/I2.py | 72 + test/VisuPrs/MeshPresentation/I3.py | 72 + test/VisuPrs/MeshPresentation/I4.py | 72 + test/VisuPrs/MeshPresentation/I5.py | 72 + test/VisuPrs/MeshPresentation/I6.py | 72 + test/VisuPrs/MeshPresentation/I7.py | 72 + test/VisuPrs/MeshPresentation/I8.py | 72 + test/VisuPrs/MeshPresentation/I9.py | 72 + test/VisuPrs/MeshPresentation/J0.py | 72 + test/VisuPrs/MeshPresentation/J1.py | 72 + test/VisuPrs/MeshPresentation/J2.py | 72 + test/VisuPrs/MeshPresentation/J3.py | 72 + test/VisuPrs/MeshPresentation/J4.py | 72 + test/VisuPrs/MeshPresentation/J5.py | 72 + test/VisuPrs/MeshPresentation/J6.py | 72 + test/VisuPrs/MeshPresentation/J7.py | 72 + test/VisuPrs/MeshPresentation/J8.py | 72 + test/VisuPrs/MeshPresentation/J9.py | 72 + test/VisuPrs/MeshPresentation/K0.py | 72 + test/VisuPrs/MeshPresentation/K1.py | 72 + test/VisuPrs/MeshPresentation/K2.py | 72 + test/VisuPrs/MeshPresentation/K3.py | 72 + test/VisuPrs/MeshPresentation/K4.py | 72 + test/VisuPrs/MeshPresentation/K5.py | 72 + test/VisuPrs/MeshPresentation/K6.py | 72 + test/VisuPrs/MeshPresentation/K7.py | 72 + test/VisuPrs/MeshPresentation/K8.py | 72 + test/VisuPrs/MeshPresentation/K9.py | 72 + test/VisuPrs/MeshPresentation/L0.py | 72 + test/VisuPrs/MeshPresentation/L1.py | 72 + test/VisuPrs/Plot3D/A0.py | 39 + test/VisuPrs/Plot3D/A1.py | 39 + test/VisuPrs/Plot3D/A2.py | 39 + test/VisuPrs/Plot3D/A3.py | 39 + test/VisuPrs/Plot3D/A4.py | 39 + test/VisuPrs/Plot3D/A5.py | 39 + test/VisuPrs/Plot3D/A6.py | 39 + test/VisuPrs/Plot3D/A7.py | 39 + test/VisuPrs/Plot3D/A8.py | 39 + test/VisuPrs/Plot3D/A9.py | 39 + test/VisuPrs/Plot3D/B0.py | 39 + test/VisuPrs/Plot3D/B1.py | 39 + test/VisuPrs/Plot3D/B2.py | 39 + test/VisuPrs/Plot3D/CMakeLists.txt | 62 + test/VisuPrs/Plot3D/E0.py | 39 + test/VisuPrs/Plot3D/E1.py | 39 + test/VisuPrs/Plot3D/E2.py | 39 + test/VisuPrs/Plot3D/E3.py | 39 + test/VisuPrs/Plot3D/E4.py | 39 + test/VisuPrs/Plot3D/E5.py | 39 + test/VisuPrs/Plot3D/E6.py | 39 + test/VisuPrs/Plot3D/E7.py | 39 + test/VisuPrs/Plot3D/E8.py | 39 + test/VisuPrs/Plot3D/E9.py | 39 + test/VisuPrs/Plot3D/F0.py | 39 + test/VisuPrs/Plot3D/F1.py | 39 + test/VisuPrs/Plot3D/F2.py | 39 + test/VisuPrs/Plot3D/F3.py | 39 + test/VisuPrs/Plot3D/F4.py | 39 + test/VisuPrs/Plot3D/F5.py | 39 + test/VisuPrs/Plot3D/F6.py | 39 + test/VisuPrs/Plot3D/F7.py | 39 + test/VisuPrs/Plot3D/F8.py | 39 + test/VisuPrs/Plot3D/F9.py | 39 + test/VisuPrs/Plot3D/G0.py | 39 + test/VisuPrs/Plot3D/G1.py | 39 + test/VisuPrs/Plot3D/G2.py | 81 + test/VisuPrs/SWIG_scripts/A1.py | 215 + test/VisuPrs/SWIG_scripts/A3.py | 70 + test/VisuPrs/SWIG_scripts/A4.py | 267 + test/VisuPrs/SWIG_scripts/A5.py | 82 + test/VisuPrs/SWIG_scripts/A6.py | 51 + test/VisuPrs/SWIG_scripts/A7.py | 172 + test/VisuPrs/SWIG_scripts/A8.py | 65 + test/VisuPrs/SWIG_scripts/A9.py | 280 + test/VisuPrs/SWIG_scripts/B0.py | 66 + test/VisuPrs/SWIG_scripts/B1.py | 299 + test/VisuPrs/SWIG_scripts/B5.py | 175 + test/VisuPrs/SWIG_scripts/B6.py | 151 + test/VisuPrs/SWIG_scripts/B7.py | 124 + test/VisuPrs/SWIG_scripts/B8.py | 23 + test/VisuPrs/SWIG_scripts/B9.py | 58 + test/VisuPrs/SWIG_scripts/C3.py | 100 + test/VisuPrs/SWIG_scripts/C7.py | 120 + test/VisuPrs/SWIG_scripts/CMakeLists.txt | 43 + test/VisuPrs/ScalarMap/A0.py | 39 + test/VisuPrs/ScalarMap/A1.py | 39 + test/VisuPrs/ScalarMap/A2.py | 39 + test/VisuPrs/ScalarMap/A3.py | 39 + test/VisuPrs/ScalarMap/A4.py | 39 + test/VisuPrs/ScalarMap/A5.py | 39 + test/VisuPrs/ScalarMap/A6.py | 39 + test/VisuPrs/ScalarMap/A7.py | 39 + test/VisuPrs/ScalarMap/A8.py | 39 + test/VisuPrs/ScalarMap/A9.py | 39 + test/VisuPrs/ScalarMap/B0.py | 39 + test/VisuPrs/ScalarMap/B1.py | 39 + test/VisuPrs/ScalarMap/B2.py | 39 + test/VisuPrs/ScalarMap/CMakeLists.txt | 62 + test/VisuPrs/ScalarMap/E0.py | 39 + test/VisuPrs/ScalarMap/E1.py | 39 + test/VisuPrs/ScalarMap/E2.py | 39 + test/VisuPrs/ScalarMap/E3.py | 39 + test/VisuPrs/ScalarMap/E4.py | 39 + test/VisuPrs/ScalarMap/E5.py | 39 + test/VisuPrs/ScalarMap/E6.py | 39 + test/VisuPrs/ScalarMap/E7.py | 39 + test/VisuPrs/ScalarMap/E8.py | 39 + test/VisuPrs/ScalarMap/E9.py | 39 + test/VisuPrs/ScalarMap/F0.py | 39 + test/VisuPrs/ScalarMap/F1.py | 39 + test/VisuPrs/ScalarMap/F2.py | 39 + test/VisuPrs/ScalarMap/F3.py | 39 + test/VisuPrs/ScalarMap/F4.py | 39 + test/VisuPrs/ScalarMap/F5.py | 39 + test/VisuPrs/ScalarMap/F6.py | 39 + test/VisuPrs/ScalarMap/F7.py | 39 + test/VisuPrs/ScalarMap/F8.py | 39 + test/VisuPrs/ScalarMap/F9.py | 39 + test/VisuPrs/ScalarMap/G0.py | 39 + test/VisuPrs/ScalarMap/G1.py | 39 + test/VisuPrs/ScalarMap/G2.py | 90 + test/VisuPrs/ScalarMap_On_DeformedShape/A0.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A1.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A2.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A3.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A4.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A5.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A6.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A7.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A8.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/A9.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/B0.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/B1.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/B2.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/B3.py | 241 + .../ScalarMap_On_DeformedShape/CMakeLists.txt | 59 + test/VisuPrs/ScalarMap_On_DeformedShape/E0.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E1.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E2.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E3.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E4.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E5.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E6.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E7.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E8.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/E9.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F0.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F1.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F2.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F3.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F4.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F5.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F6.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F7.py | 39 + test/VisuPrs/ScalarMap_On_DeformedShape/F8.py | 39 + test/VisuPrs/StreamLines/A0.py | 41 + test/VisuPrs/StreamLines/A1.py | 41 + test/VisuPrs/StreamLines/A2.py | 41 + test/VisuPrs/StreamLines/A3.py | 41 + test/VisuPrs/StreamLines/A4.py | 41 + test/VisuPrs/StreamLines/A5.py | 41 + test/VisuPrs/StreamLines/A6.py | 41 + test/VisuPrs/StreamLines/A7.py | 41 + test/VisuPrs/StreamLines/A8.py | 41 + test/VisuPrs/StreamLines/A9.py | 41 + test/VisuPrs/StreamLines/B0.py | 41 + test/VisuPrs/StreamLines/B1.py | 41 + test/VisuPrs/StreamLines/B2.py | 41 + test/VisuPrs/StreamLines/CMakeLists.txt | 59 + test/VisuPrs/StreamLines/E0.py | 41 + test/VisuPrs/StreamLines/E1.py | 41 + test/VisuPrs/StreamLines/E2.py | 41 + test/VisuPrs/StreamLines/E3.py | 41 + test/VisuPrs/StreamLines/E4.py | 41 + test/VisuPrs/StreamLines/E5.py | 41 + test/VisuPrs/StreamLines/E6.py | 41 + test/VisuPrs/StreamLines/E7.py | 41 + test/VisuPrs/StreamLines/E8.py | 41 + test/VisuPrs/StreamLines/E9.py | 41 + test/VisuPrs/StreamLines/F0.py | 41 + test/VisuPrs/StreamLines/F1.py | 41 + test/VisuPrs/StreamLines/F2.py | 41 + test/VisuPrs/StreamLines/F3.py | 41 + test/VisuPrs/StreamLines/F4.py | 41 + test/VisuPrs/StreamLines/F5.py | 41 + test/VisuPrs/StreamLines/F6.py | 41 + test/VisuPrs/StreamLines/F7.py | 41 + test/VisuPrs/StreamLines/F8.py | 41 + test/VisuPrs/StreamLines/F9.py | 60 + test/VisuPrs/Tables/A0.py | 78 + test/VisuPrs/Tables/A2.py | 77 + test/VisuPrs/Tables/CMakeLists.txt | 28 + test/VisuPrs/Util/CMakeLists.txt | 33 + test/VisuPrs/Util/paravistest.py | 204 + test/VisuPrs/Vectors/A0.py | 39 + test/VisuPrs/Vectors/A1.py | 39 + test/VisuPrs/Vectors/A2.py | 39 + test/VisuPrs/Vectors/A3.py | 39 + test/VisuPrs/Vectors/A4.py | 39 + test/VisuPrs/Vectors/A5.py | 39 + test/VisuPrs/Vectors/A6.py | 39 + test/VisuPrs/Vectors/A7.py | 39 + test/VisuPrs/Vectors/A8.py | 39 + test/VisuPrs/Vectors/A9.py | 39 + test/VisuPrs/Vectors/B0.py | 39 + test/VisuPrs/Vectors/B1.py | 39 + test/VisuPrs/Vectors/B2.py | 39 + test/VisuPrs/Vectors/B3.py | 128 + test/VisuPrs/Vectors/CMakeLists.txt | 60 + test/VisuPrs/Vectors/E0.py | 39 + test/VisuPrs/Vectors/E1.py | 39 + test/VisuPrs/Vectors/E2.py | 39 + test/VisuPrs/Vectors/E3.py | 39 + test/VisuPrs/Vectors/E4.py | 39 + test/VisuPrs/Vectors/E5.py | 39 + test/VisuPrs/Vectors/E6.py | 39 + test/VisuPrs/Vectors/E7.py | 39 + test/VisuPrs/Vectors/E8.py | 39 + test/VisuPrs/Vectors/E9.py | 39 + test/VisuPrs/Vectors/F0.py | 39 + test/VisuPrs/Vectors/F1.py | 39 + test/VisuPrs/Vectors/F2.py | 39 + test/VisuPrs/Vectors/F3.py | 39 + test/VisuPrs/Vectors/F4.py | 39 + test/VisuPrs/Vectors/F5.py | 39 + test/VisuPrs/Vectors/F6.py | 39 + test/VisuPrs/Vectors/F7.py | 39 + test/VisuPrs/Vectors/F8.py | 39 + test/VisuPrs/Vectors/F9.py | 85 + test/demo0.py | 49 +- test/demo1.py | 19 + test/demo10.py | 19 + test/demo11.py | 19 + test/demo12.py | 19 + test/demo2.py | 19 + test/demo3.py | 19 + test/demo4.py | 19 + test/demo5.py | 19 + test/demo6.py | 19 + test/demo7.py | 19 + test/demo8.py | 19 + test/demo9.py | 19 + test/demo_14_med.py | 19 + test/demo_15_med.py | 19 + wrapfiles.cmake | 21 +- 812 files changed, 89655 insertions(+), 10727 deletions(-) delete mode 100644 adm_local/unix/CMakeLists.txt delete mode 100644 adm_local/unix/config_files/CMakeLists.txt delete mode 100644 adm_local/unix/config_files/check_Med.m4 delete mode 100644 adm_local/unix/config_files/check_Med2.m4 delete mode 100644 adm_local/unix/config_files/check_ParaView.m4 delete mode 100755 adm_local/unix/config_files/check_VISU.m4 delete mode 100644 adm_local/unix/config_files/med_check_sizeof_medint.m4 create mode 100644 bin/paravis_setenv.py create mode 100755 idl/create_header.py create mode 100755 idl/create_hints.py delete mode 100644 resources/LightApp.xml delete mode 100644 resources/SalomeApp.xml create mode 100644 resources/SalomeApp.xml.in create mode 100644 src/Macro/CMakeLists.txt create mode 100644 src/Macro/modes.py create mode 100644 src/PVGUI/PVGUI.qrc.in delete mode 100644 src/PVGUI/PVGUI_Module_impl.h create mode 100644 src/PVGUI/PVGUI_ParaViewSettingsPane.cxx create mode 100644 src/PVGUI/PVGUI_ParaViewSettingsPane.h create mode 100755 src/PVGUI/create_class.py create mode 100644 src/PVGUI/resources/PARAVIS_msg_fr.ts create mode 100644 src/PVGUI/ui_pqOptionsDialog.h create mode 100644 src/PV_SWIG/presentations.py delete mode 100644 src/ParaView/vtkParse.h create mode 100644 src/ParaView/vtkParseExtras.c create mode 100644 src/ParaView/vtkParseExtras.h create mode 100644 src/ParaView/vtkParseHierarchy.c create mode 100644 src/ParaView/vtkParseHierarchy.h create mode 100644 src/ParaView/vtkParseInternal.h create mode 100644 src/ParaView/vtkParseMain.c create mode 100644 src/ParaView/vtkParsePreprocess.c create mode 100644 src/ParaView/vtkParsePreprocess.h create mode 100644 src/ParaView/vtkWrap.c create mode 100644 src/ParaView/vtkWrap.h create mode 100644 src/ParaView/vtkWrapHierarchy.c create mode 100644 src/ParaView/vtkWrapText.c create mode 100644 src/ParaView/vtkWrapText.h create mode 100644 src/Plugins/ElevationSurface/CMakeLists.txt create mode 100644 src/Plugins/ElevationSurface/ElevationSurface.xml create mode 100644 src/Plugins/ElevationSurface/ElevationSurfaceClient.xml create mode 100644 src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.cxx create mode 100644 src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h create mode 100644 src/Plugins/IntegrationPoints/CMakeLists.txt create mode 100644 src/Plugins/IntegrationPoints/ELNOFilter.xml create mode 100644 src/Plugins/IntegrationPoints/ELNOFilterClient.xml create mode 100644 src/Plugins/IntegrationPoints/vtkELNOFilter.cxx create mode 100644 src/Plugins/IntegrationPoints/vtkELNOFilter.h create mode 100644 src/Plugins/IntegrationPoints/vtkELNOMeshFilter.cxx create mode 100644 src/Plugins/IntegrationPoints/vtkELNOMeshFilter.h create mode 100644 src/Plugins/IntegrationPoints/vtkELNOSurfaceFilter.cxx create mode 100644 src/Plugins/IntegrationPoints/vtkELNOSurfaceFilter.h create mode 100644 src/Plugins/MedReader/CMake/CTestCustom.ctest.in create mode 100644 src/Plugins/MedReader/CMake/FindMED.cmake create mode 100644 src/Plugins/MedReader/CMakeLists.txt create mode 100644 src/Plugins/MedReader/IO/CMakeLists.txt create mode 100644 src/Plugins/MedReader/IO/Testing/CMakeLists.txt create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/CMakeLists.txt create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/TestMedDescendingPolyhedron.cxx create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/TestMedParallelRead.cxx create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/TestMedParallelWrite.cxx create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/TestMedPolyhedron.cxx create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/TestMedReadDescendingPolyhedron.cxx create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/TestMedReadPolyhedron.cxx create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/TestMedReader.cxx create mode 100644 src/Plugins/MedReader/IO/Testing/Cxx/TestMedWriteOcta12.cxx create mode 100644 src/Plugins/MedReader/IO/config.h.cmake create mode 100644 src/Plugins/MedReader/IO/vtkExtractGroup.cxx create mode 100644 src/Plugins/MedReader/IO/vtkExtractGroup.h create mode 100644 src/Plugins/MedReader/IO/vtkGenerateStructElement.cxx create mode 100644 src/Plugins/MedReader/IO/vtkGenerateStructElement.h create mode 100644 src/Plugins/MedReader/IO/vtkMed.h create mode 100644 src/Plugins/MedReader/IO/vtkMedCartesianGrid.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedCartesianGrid.h create mode 100644 src/Plugins/MedReader/IO/vtkMedConstantAttribute.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedConstantAttribute.h create mode 100644 src/Plugins/MedReader/IO/vtkMedCurvilinearGrid.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedCurvilinearGrid.h create mode 100644 src/Plugins/MedReader/IO/vtkMedDriver.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedDriver.h create mode 100644 src/Plugins/MedReader/IO/vtkMedDriver30.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedDriver30.h create mode 100644 src/Plugins/MedReader/IO/vtkMedEntityArray.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedEntityArray.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFactory.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFactory.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFamily.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFamily.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFamilyOnEntity.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFamilyOnEntity.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFamilyOnEntityOnProfile.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFamilyOnEntityOnProfile.h create mode 100644 src/Plugins/MedReader/IO/vtkMedField.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedField.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFieldOnProfile.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFieldOnProfile.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFieldOverEntity.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFieldOverEntity.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFieldStep.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFieldStep.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFile.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFile.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFilter.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFilter.h create mode 100644 src/Plugins/MedReader/IO/vtkMedFraction.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedFraction.h create mode 100644 src/Plugins/MedReader/IO/vtkMedGrid.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedGrid.h create mode 100644 src/Plugins/MedReader/IO/vtkMedGroup.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedGroup.h create mode 100644 src/Plugins/MedReader/IO/vtkMedIntArray.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedIntArray.h create mode 100644 src/Plugins/MedReader/IO/vtkMedIntArrayInternal.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedIntArrayInternal.h create mode 100644 src/Plugins/MedReader/IO/vtkMedInterpolation.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedInterpolation.h create mode 100644 src/Plugins/MedReader/IO/vtkMedLink.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedLink.h create mode 100644 src/Plugins/MedReader/IO/vtkMedLocalization.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedLocalization.h create mode 100644 src/Plugins/MedReader/IO/vtkMedMesh.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedMesh.h create mode 100644 src/Plugins/MedReader/IO/vtkMedPolarGrid.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedPolarGrid.h create mode 100644 src/Plugins/MedReader/IO/vtkMedProfile.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedProfile.h create mode 100644 src/Plugins/MedReader/IO/vtkMedReader.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedReader.h create mode 100644 src/Plugins/MedReader/IO/vtkMedRegularGrid.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedRegularGrid.h create mode 100644 src/Plugins/MedReader/IO/vtkMedSelection.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedSelection.h create mode 100644 src/Plugins/MedReader/IO/vtkMedSetGet.h create mode 100644 src/Plugins/MedReader/IO/vtkMedStructElement.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedStructElement.h create mode 100644 src/Plugins/MedReader/IO/vtkMedSupportMesh.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedSupportMesh.h create mode 100644 src/Plugins/MedReader/IO/vtkMedUnstructuredGrid.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedUnstructuredGrid.h create mode 100644 src/Plugins/MedReader/IO/vtkMedUtilities.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedUtilities.h create mode 100644 src/Plugins/MedReader/IO/vtkMedVariableAttribute.cxx create mode 100644 src/Plugins/MedReader/IO/vtkMedVariableAttribute.h create mode 100644 src/Plugins/MedReader/ParaViewPlugin/CMakeLists.txt create mode 100755 src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqCellData16.png create mode 100644 src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqElnoData16.png create mode 100755 src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqPointData16.png create mode 100755 src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqQuadratureData16.png create mode 100644 src/Plugins/MedReader/ParaViewPlugin/Resources/MedReaderClient.xml create mode 100644 src/Plugins/MedReader/ParaViewPlugin/Resources/MedReaderServer.xml create mode 100644 src/Plugins/MedReader/ParaViewPlugin/Resources/UI/ExtractGroupPanel.ui create mode 100644 src/Plugins/MedReader/ParaViewPlugin/Resources/UI/MedReaderPanel.ui create mode 100644 src/Plugins/MedReader/ParaViewPlugin/Resources/pqMedReader.qrc create mode 100644 src/Plugins/MedReader/ParaViewPlugin/pqExtractGroupPanel.cxx create mode 100644 src/Plugins/MedReader/ParaViewPlugin/pqExtractGroupPanel.h create mode 100644 src/Plugins/MedReader/ParaViewPlugin/pqMedReaderPanel.cxx create mode 100644 src/Plugins/MedReader/ParaViewPlugin/pqMedReaderPanel.h create mode 100644 src/Plugins/MedReader/ParaViewPlugin/vtkSMMedGroupSelectionDomain.cxx create mode 100644 src/Plugins/MedReader/ParaViewPlugin/vtkSMMedGroupSelectionDomain.h create mode 100644 src/Plugins/NavigationMode/CMakeLists.txt create mode 100644 src/Plugins/NavigationMode/pqSetModeStarter.cxx create mode 100644 src/Plugins/NavigationMode/pqSetModeStarter.h create mode 100644 src/Plugins/ParaMEDCorba/CMakeLists.txt create mode 100644 src/Plugins/ParaMEDCorba/ParaMEDCorbaServerManager.xml create mode 100644 src/Plugins/ParaMEDCorba/ParaMEDCorbaUserInterfaceSources.xml create mode 100755 src/Plugins/ParaMEDCorba/ParaMEDMEM2VTK_defines.hxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingCMeshClient.cxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingCMeshClient.hxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingFieldClient.cxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingFieldClient.hxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingMeshClient.cxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingMeshClient.hxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingMultiFieldsClient.cxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingMultiFieldsClient.hxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.cxx create mode 100644 src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.hxx create mode 100644 src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.cxx create mode 100644 src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.hxx create mode 100644 src/Plugins/ParaMEDCorba/testParaMEDCorba.cxx create mode 100644 src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.cxx create mode 100644 src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.h create mode 100644 src/Plugins/ScaleVector/CMakeLists.txt create mode 100644 src/Plugins/ScaleVector/ScaleVector.xml create mode 100644 src/Plugins/ScaleVector/ScaleVectorClient.xml create mode 100644 src/Plugins/ScaleVector/vtkScaleVectorFilter.cxx create mode 100644 src/Plugins/ScaleVector/vtkScaleVectorFilter.h create mode 100644 src/Plugins/TableReader/CMakeLists.txt create mode 100644 src/Plugins/TableReader/ParaViewPlugin/CMakeLists.txt create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/TableReader.qrc create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/TableReaderClient.xml create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/TableReaderServer.xml create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3D.qrc create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3DClient.xml create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3DServer.xml create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/UI/CustomLineChartDisplayPanel.ui create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/UI/CustomXYChartDisplayPanel.ui create mode 100644 src/Plugins/TableReader/ParaViewPlugin/Resources/UI/TableReaderPanel.ui create mode 100755 src/Plugins/TableReader/ParaViewPlugin/pqCustomChartDisplayPanelImplementation.cxx create mode 100755 src/Plugins/TableReader/ParaViewPlugin/pqCustomChartDisplayPanelImplementation.h create mode 100644 src/Plugins/TableReader/ParaViewPlugin/pqCustomPlotSettingsModel.cxx create mode 100644 src/Plugins/TableReader/ParaViewPlugin/pqCustomPlotSettingsModel.h create mode 100644 src/Plugins/TableReader/ParaViewPlugin/pqCustomXYChartDisplayPanel.cxx create mode 100644 src/Plugins/TableReader/ParaViewPlugin/pqCustomXYChartDisplayPanel.h create mode 100644 src/Plugins/TableReader/ParaViewPlugin/pqTableReaderPanel.cxx create mode 100644 src/Plugins/TableReader/ParaViewPlugin/pqTableReaderPanel.h create mode 100644 src/Plugins/TableReader/ParaViewPlugin/pqTableTo3DPanel.cxx create mode 100644 src/Plugins/TableReader/ParaViewPlugin/pqTableTo3DPanel.h create mode 100644 src/Plugins/TableReader/Reader/CMakeLists.txt create mode 100644 src/Plugins/TableReader/Reader/TableParser.cxx create mode 100644 src/Plugins/TableReader/Reader/TableParser.h create mode 100644 src/Plugins/TableReader/Reader/vtkVisuTableReader.cxx create mode 100644 src/Plugins/TableReader/Reader/vtkVisuTableReader.h create mode 100644 src/Plugins/TableReader/TableTo3DFilter/CMakeLists.txt create mode 100644 src/Plugins/TableReader/TableTo3DFilter/vtkTableTo3D.cxx create mode 100644 src/Plugins/TableReader/TableTo3DFilter/vtkTableTo3D.h create mode 100644 test/CMakeLists.txt create mode 100755 test/VisuPrs/2D_viewer/A0.py create mode 100755 test/VisuPrs/2D_viewer/A1.py create mode 100644 test/VisuPrs/2D_viewer/CMakeLists.txt create mode 100644 test/VisuPrs/3D_viewer/A1.py create mode 100644 test/VisuPrs/3D_viewer/A2.py create mode 100644 test/VisuPrs/3D_viewer/A3.py create mode 100644 test/VisuPrs/3D_viewer/A4.py create mode 100644 test/VisuPrs/3D_viewer/A5.py create mode 100644 test/VisuPrs/3D_viewer/A6.py create mode 100644 test/VisuPrs/3D_viewer/A7.py create mode 100644 test/VisuPrs/3D_viewer/A8.py create mode 100644 test/VisuPrs/3D_viewer/A9.py create mode 100644 test/VisuPrs/3D_viewer/B0.py create mode 100644 test/VisuPrs/3D_viewer/B2.py create mode 100755 test/VisuPrs/3D_viewer/CMakeLists.txt create mode 100755 test/VisuPrs/Animation/A0.py create mode 100755 test/VisuPrs/Animation/A2.py create mode 100644 test/VisuPrs/Animation/A4.py create mode 100644 test/VisuPrs/Animation/A7.py create mode 100644 test/VisuPrs/Animation/A8.py create mode 100644 test/VisuPrs/Animation/B2.py create mode 100644 test/VisuPrs/Animation/B5.py create mode 100644 test/VisuPrs/Animation/B6.py create mode 100644 test/VisuPrs/Animation/C0.py create mode 100644 test/VisuPrs/Animation/C1.py create mode 100644 test/VisuPrs/Animation/C3.py create mode 100644 test/VisuPrs/Animation/C8.py create mode 100755 test/VisuPrs/Animation/CMakeLists.txt create mode 100644 test/VisuPrs/Animation/D1.py create mode 100644 test/VisuPrs/Animation/D2.py create mode 100644 test/VisuPrs/Animation/D6.py create mode 100644 test/VisuPrs/Animation/D9.py create mode 100644 test/VisuPrs/Animation/E0.py create mode 100644 test/VisuPrs/Animation/E4.py create mode 100644 test/VisuPrs/Animation/E7.py create mode 100644 test/VisuPrs/Animation/E8.py create mode 100644 test/VisuPrs/Animation/F2.py create mode 100644 test/VisuPrs/Animation/F5.py create mode 100644 test/VisuPrs/Animation/F6.py create mode 100644 test/VisuPrs/Animation/G0.py create mode 100644 test/VisuPrs/Animation/G3.py create mode 100644 test/VisuPrs/Animation/G4.py create mode 100644 test/VisuPrs/Animation/G8.py create mode 100644 test/VisuPrs/Animation/H1.py create mode 100644 test/VisuPrs/Animation/H2.py create mode 100644 test/VisuPrs/CMakeLists.txt create mode 100644 test/VisuPrs/CutLines/A0.py create mode 100644 test/VisuPrs/CutLines/A1.py create mode 100755 test/VisuPrs/CutLines/A2.py create mode 100755 test/VisuPrs/CutLines/A3.py create mode 100644 test/VisuPrs/CutLines/A4.py create mode 100644 test/VisuPrs/CutLines/A5.py create mode 100644 test/VisuPrs/CutLines/A6.py create mode 100644 test/VisuPrs/CutLines/A7.py create mode 100644 test/VisuPrs/CutLines/A8.py create mode 100644 test/VisuPrs/CutLines/A9.py create mode 100644 test/VisuPrs/CutLines/B0.py create mode 100644 test/VisuPrs/CutLines/B1.py create mode 100644 test/VisuPrs/CutLines/B2.py create mode 100644 test/VisuPrs/CutLines/CMakeLists.txt create mode 100644 test/VisuPrs/CutLines/E0.py create mode 100644 test/VisuPrs/CutLines/E1.py create mode 100644 test/VisuPrs/CutLines/E2.py create mode 100644 test/VisuPrs/CutLines/E3.py create mode 100644 test/VisuPrs/CutLines/E4.py create mode 100644 test/VisuPrs/CutLines/E5.py create mode 100644 test/VisuPrs/CutLines/E6.py create mode 100644 test/VisuPrs/CutLines/E7.py create mode 100644 test/VisuPrs/CutLines/E8.py create mode 100644 test/VisuPrs/CutLines/E9.py create mode 100644 test/VisuPrs/CutLines/F0.py create mode 100644 test/VisuPrs/CutLines/F1.py create mode 100644 test/VisuPrs/CutLines/F2.py create mode 100644 test/VisuPrs/CutLines/F3.py create mode 100644 test/VisuPrs/CutLines/F4.py create mode 100644 test/VisuPrs/CutLines/F5.py create mode 100644 test/VisuPrs/CutLines/F6.py create mode 100644 test/VisuPrs/CutLines/F7.py create mode 100755 test/VisuPrs/CutLines/F8.py create mode 100644 test/VisuPrs/CutLines/F9.py create mode 100644 test/VisuPrs/CutLines/G0.py create mode 100644 test/VisuPrs/CutLines/G1.py create mode 100644 test/VisuPrs/CutLines/G2.py create mode 100644 test/VisuPrs/CutPlanes/A0.py create mode 100644 test/VisuPrs/CutPlanes/A1.py create mode 100755 test/VisuPrs/CutPlanes/A2.py create mode 100755 test/VisuPrs/CutPlanes/A3.py create mode 100644 test/VisuPrs/CutPlanes/A4.py create mode 100644 test/VisuPrs/CutPlanes/A5.py create mode 100644 test/VisuPrs/CutPlanes/A6.py create mode 100644 test/VisuPrs/CutPlanes/A7.py create mode 100644 test/VisuPrs/CutPlanes/A8.py create mode 100644 test/VisuPrs/CutPlanes/A9.py create mode 100644 test/VisuPrs/CutPlanes/B0.py create mode 100644 test/VisuPrs/CutPlanes/B1.py create mode 100644 test/VisuPrs/CutPlanes/B2.py create mode 100644 test/VisuPrs/CutPlanes/B3.py create mode 100644 test/VisuPrs/CutPlanes/CMakeLists.txt create mode 100644 test/VisuPrs/CutPlanes/E0.py create mode 100644 test/VisuPrs/CutPlanes/E1.py create mode 100644 test/VisuPrs/CutPlanes/E2.py create mode 100644 test/VisuPrs/CutPlanes/E3.py create mode 100644 test/VisuPrs/CutPlanes/E4.py create mode 100644 test/VisuPrs/CutPlanes/E5.py create mode 100644 test/VisuPrs/CutPlanes/E6.py create mode 100644 test/VisuPrs/CutPlanes/E7.py create mode 100644 test/VisuPrs/CutPlanes/E8.py create mode 100644 test/VisuPrs/CutPlanes/E9.py create mode 100644 test/VisuPrs/CutPlanes/F0.py create mode 100644 test/VisuPrs/CutPlanes/F1.py create mode 100644 test/VisuPrs/CutPlanes/F2.py create mode 100644 test/VisuPrs/CutPlanes/F3.py create mode 100644 test/VisuPrs/CutPlanes/F4.py create mode 100644 test/VisuPrs/CutPlanes/F5.py create mode 100644 test/VisuPrs/CutPlanes/F6.py create mode 100755 test/VisuPrs/CutPlanes/F7.py create mode 100644 test/VisuPrs/CutPlanes/F8.py create mode 100644 test/VisuPrs/CutPlanes/F9.py create mode 100644 test/VisuPrs/CutPlanes/G0.py create mode 100644 test/VisuPrs/CutPlanes/G1.py create mode 100644 test/VisuPrs/CutPlanes/G2.py create mode 100644 test/VisuPrs/DeformedShape/A0.py create mode 100644 test/VisuPrs/DeformedShape/A1.py create mode 100755 test/VisuPrs/DeformedShape/A2.py create mode 100755 test/VisuPrs/DeformedShape/A3.py create mode 100755 test/VisuPrs/DeformedShape/A4.py create mode 100644 test/VisuPrs/DeformedShape/A5.py create mode 100755 test/VisuPrs/DeformedShape/A6.py create mode 100644 test/VisuPrs/DeformedShape/A7.py create mode 100644 test/VisuPrs/DeformedShape/A8.py create mode 100644 test/VisuPrs/DeformedShape/A9.py create mode 100644 test/VisuPrs/DeformedShape/B0.py create mode 100644 test/VisuPrs/DeformedShape/B1.py create mode 100644 test/VisuPrs/DeformedShape/B2.py create mode 100755 test/VisuPrs/DeformedShape/B3.py create mode 100644 test/VisuPrs/DeformedShape/B4.py create mode 100644 test/VisuPrs/DeformedShape/CMakeLists.txt create mode 100644 test/VisuPrs/DeformedShape/E0.py create mode 100644 test/VisuPrs/DeformedShape/E1.py create mode 100644 test/VisuPrs/DeformedShape/E2.py create mode 100755 test/VisuPrs/DeformedShape/E3.py create mode 100644 test/VisuPrs/DeformedShape/E4.py create mode 100644 test/VisuPrs/DeformedShape/E5.py create mode 100644 test/VisuPrs/DeformedShape/E6.py create mode 100644 test/VisuPrs/DeformedShape/E7.py create mode 100644 test/VisuPrs/DeformedShape/E8.py create mode 100644 test/VisuPrs/DeformedShape/E9.py create mode 100755 test/VisuPrs/DeformedShape/F0.py create mode 100644 test/VisuPrs/DeformedShape/F1.py create mode 100644 test/VisuPrs/DeformedShape/F2.py create mode 100644 test/VisuPrs/DeformedShape/F3.py create mode 100644 test/VisuPrs/DeformedShape/F4.py create mode 100644 test/VisuPrs/DeformedShape/F5.py create mode 100644 test/VisuPrs/DeformedShape/F6.py create mode 100755 test/VisuPrs/DeformedShape/F7.py create mode 100644 test/VisuPrs/DeformedShape/F8.py create mode 100644 test/VisuPrs/DeformedShape/F9.py create mode 100644 test/VisuPrs/GaussPoints/A0.py create mode 100644 test/VisuPrs/GaussPoints/A1.py create mode 100644 test/VisuPrs/GaussPoints/A2.py create mode 100644 test/VisuPrs/GaussPoints/A3.py create mode 100644 test/VisuPrs/GaussPoints/A4.py create mode 100644 test/VisuPrs/GaussPoints/A5.py create mode 100644 test/VisuPrs/GaussPoints/A6.py create mode 100644 test/VisuPrs/GaussPoints/A7.py create mode 100644 test/VisuPrs/GaussPoints/A9.py create mode 100644 test/VisuPrs/GaussPoints/B0.py create mode 100644 test/VisuPrs/GaussPoints/B1.py create mode 100644 test/VisuPrs/GaussPoints/B2.py create mode 100644 test/VisuPrs/GaussPoints/B3.py create mode 100644 test/VisuPrs/GaussPoints/B4.py create mode 100644 test/VisuPrs/GaussPoints/B5.py create mode 100644 test/VisuPrs/GaussPoints/B6.py create mode 100644 test/VisuPrs/GaussPoints/B7.py create mode 100644 test/VisuPrs/GaussPoints/B8.py create mode 100644 test/VisuPrs/GaussPoints/B9.py create mode 100644 test/VisuPrs/GaussPoints/C0.py create mode 100644 test/VisuPrs/GaussPoints/C1.py create mode 100644 test/VisuPrs/GaussPoints/C2.py create mode 100644 test/VisuPrs/GaussPoints/C3.py create mode 100644 test/VisuPrs/GaussPoints/C4.py create mode 100644 test/VisuPrs/GaussPoints/C5.py create mode 100644 test/VisuPrs/GaussPoints/C6.py create mode 100644 test/VisuPrs/GaussPoints/C7.py create mode 100644 test/VisuPrs/GaussPoints/CMakeLists.txt create mode 100644 test/VisuPrs/IsoSurfaces/A0.py create mode 100755 test/VisuPrs/IsoSurfaces/A1.py create mode 100755 test/VisuPrs/IsoSurfaces/A2.py create mode 100755 test/VisuPrs/IsoSurfaces/A3.py create mode 100755 test/VisuPrs/IsoSurfaces/A4.py create mode 100755 test/VisuPrs/IsoSurfaces/A5.py create mode 100644 test/VisuPrs/IsoSurfaces/A6.py create mode 100755 test/VisuPrs/IsoSurfaces/A7.py create mode 100755 test/VisuPrs/IsoSurfaces/A8.py create mode 100755 test/VisuPrs/IsoSurfaces/A9.py create mode 100755 test/VisuPrs/IsoSurfaces/B0.py create mode 100644 test/VisuPrs/IsoSurfaces/B1.py create mode 100755 test/VisuPrs/IsoSurfaces/B2.py create mode 100755 test/VisuPrs/IsoSurfaces/CMakeLists.txt create mode 100755 test/VisuPrs/IsoSurfaces/E0.py create mode 100755 test/VisuPrs/IsoSurfaces/E1.py create mode 100755 test/VisuPrs/IsoSurfaces/E2.py create mode 100644 test/VisuPrs/IsoSurfaces/E3.py create mode 100755 test/VisuPrs/IsoSurfaces/E4.py create mode 100755 test/VisuPrs/IsoSurfaces/E5.py create mode 100755 test/VisuPrs/IsoSurfaces/E6.py create mode 100755 test/VisuPrs/IsoSurfaces/E7.py create mode 100755 test/VisuPrs/IsoSurfaces/E8.py create mode 100644 test/VisuPrs/IsoSurfaces/E9.py create mode 100644 test/VisuPrs/IsoSurfaces/F0.py create mode 100755 test/VisuPrs/IsoSurfaces/F1.py create mode 100755 test/VisuPrs/IsoSurfaces/F2.py create mode 100755 test/VisuPrs/IsoSurfaces/F3.py create mode 100755 test/VisuPrs/IsoSurfaces/F4.py create mode 100755 test/VisuPrs/IsoSurfaces/F5.py create mode 100755 test/VisuPrs/IsoSurfaces/F6.py create mode 100644 test/VisuPrs/IsoSurfaces/F7.py create mode 100755 test/VisuPrs/IsoSurfaces/F8.py create mode 100644 test/VisuPrs/IsoSurfaces/F9.py create mode 100644 test/VisuPrs/IsoSurfaces/G0.py create mode 100755 test/VisuPrs/IsoSurfaces/G1.py create mode 100644 test/VisuPrs/IsoSurfaces/G2.py create mode 100644 test/VisuPrs/MeshPresentation/A0.py create mode 100644 test/VisuPrs/MeshPresentation/A1.py create mode 100644 test/VisuPrs/MeshPresentation/A2.py create mode 100644 test/VisuPrs/MeshPresentation/A3.py create mode 100644 test/VisuPrs/MeshPresentation/A4.py create mode 100644 test/VisuPrs/MeshPresentation/A5.py create mode 100644 test/VisuPrs/MeshPresentation/A6.py create mode 100644 test/VisuPrs/MeshPresentation/A7.py create mode 100644 test/VisuPrs/MeshPresentation/A8.py create mode 100644 test/VisuPrs/MeshPresentation/A9.py create mode 100644 test/VisuPrs/MeshPresentation/B0.py create mode 100644 test/VisuPrs/MeshPresentation/B1.py create mode 100644 test/VisuPrs/MeshPresentation/B2.py create mode 100644 test/VisuPrs/MeshPresentation/CMakeLists.txt create mode 100644 test/VisuPrs/MeshPresentation/E0.py create mode 100644 test/VisuPrs/MeshPresentation/E1.py create mode 100644 test/VisuPrs/MeshPresentation/E2.py create mode 100644 test/VisuPrs/MeshPresentation/E3.py create mode 100644 test/VisuPrs/MeshPresentation/E4.py create mode 100644 test/VisuPrs/MeshPresentation/E5.py create mode 100644 test/VisuPrs/MeshPresentation/E6.py create mode 100644 test/VisuPrs/MeshPresentation/E7.py create mode 100644 test/VisuPrs/MeshPresentation/E8.py create mode 100644 test/VisuPrs/MeshPresentation/E9.py create mode 100644 test/VisuPrs/MeshPresentation/F0.py create mode 100644 test/VisuPrs/MeshPresentation/F1.py create mode 100644 test/VisuPrs/MeshPresentation/F2.py create mode 100644 test/VisuPrs/MeshPresentation/F3.py create mode 100644 test/VisuPrs/MeshPresentation/F4.py create mode 100644 test/VisuPrs/MeshPresentation/F5.py create mode 100644 test/VisuPrs/MeshPresentation/F6.py create mode 100644 test/VisuPrs/MeshPresentation/F7.py create mode 100644 test/VisuPrs/MeshPresentation/F8.py create mode 100644 test/VisuPrs/MeshPresentation/F9.py create mode 100644 test/VisuPrs/MeshPresentation/G0.py create mode 100644 test/VisuPrs/MeshPresentation/G1.py create mode 100644 test/VisuPrs/MeshPresentation/G3.py create mode 100644 test/VisuPrs/MeshPresentation/G4.py create mode 100644 test/VisuPrs/MeshPresentation/G5.py create mode 100644 test/VisuPrs/MeshPresentation/G6.py create mode 100644 test/VisuPrs/MeshPresentation/G7.py create mode 100644 test/VisuPrs/MeshPresentation/G8.py create mode 100644 test/VisuPrs/MeshPresentation/G9.py create mode 100644 test/VisuPrs/MeshPresentation/H0.py create mode 100644 test/VisuPrs/MeshPresentation/H1.py create mode 100644 test/VisuPrs/MeshPresentation/H2.py create mode 100644 test/VisuPrs/MeshPresentation/H3.py create mode 100644 test/VisuPrs/MeshPresentation/H4.py create mode 100644 test/VisuPrs/MeshPresentation/H5.py create mode 100644 test/VisuPrs/MeshPresentation/H6.py create mode 100644 test/VisuPrs/MeshPresentation/H7.py create mode 100644 test/VisuPrs/MeshPresentation/H8.py create mode 100644 test/VisuPrs/MeshPresentation/H9.py create mode 100644 test/VisuPrs/MeshPresentation/I0.py create mode 100644 test/VisuPrs/MeshPresentation/I1.py create mode 100644 test/VisuPrs/MeshPresentation/I2.py create mode 100644 test/VisuPrs/MeshPresentation/I3.py create mode 100644 test/VisuPrs/MeshPresentation/I4.py create mode 100644 test/VisuPrs/MeshPresentation/I5.py create mode 100644 test/VisuPrs/MeshPresentation/I6.py create mode 100644 test/VisuPrs/MeshPresentation/I7.py create mode 100644 test/VisuPrs/MeshPresentation/I8.py create mode 100644 test/VisuPrs/MeshPresentation/I9.py create mode 100644 test/VisuPrs/MeshPresentation/J0.py create mode 100644 test/VisuPrs/MeshPresentation/J1.py create mode 100644 test/VisuPrs/MeshPresentation/J2.py create mode 100644 test/VisuPrs/MeshPresentation/J3.py create mode 100644 test/VisuPrs/MeshPresentation/J4.py create mode 100644 test/VisuPrs/MeshPresentation/J5.py create mode 100644 test/VisuPrs/MeshPresentation/J6.py create mode 100644 test/VisuPrs/MeshPresentation/J7.py create mode 100644 test/VisuPrs/MeshPresentation/J8.py create mode 100644 test/VisuPrs/MeshPresentation/J9.py create mode 100644 test/VisuPrs/MeshPresentation/K0.py create mode 100644 test/VisuPrs/MeshPresentation/K1.py create mode 100644 test/VisuPrs/MeshPresentation/K2.py create mode 100644 test/VisuPrs/MeshPresentation/K3.py create mode 100644 test/VisuPrs/MeshPresentation/K4.py create mode 100644 test/VisuPrs/MeshPresentation/K5.py create mode 100644 test/VisuPrs/MeshPresentation/K6.py create mode 100644 test/VisuPrs/MeshPresentation/K7.py create mode 100644 test/VisuPrs/MeshPresentation/K8.py create mode 100644 test/VisuPrs/MeshPresentation/K9.py create mode 100644 test/VisuPrs/MeshPresentation/L0.py create mode 100644 test/VisuPrs/MeshPresentation/L1.py create mode 100644 test/VisuPrs/Plot3D/A0.py create mode 100755 test/VisuPrs/Plot3D/A1.py create mode 100755 test/VisuPrs/Plot3D/A2.py create mode 100755 test/VisuPrs/Plot3D/A3.py create mode 100755 test/VisuPrs/Plot3D/A4.py create mode 100755 test/VisuPrs/Plot3D/A5.py create mode 100644 test/VisuPrs/Plot3D/A6.py create mode 100755 test/VisuPrs/Plot3D/A7.py create mode 100755 test/VisuPrs/Plot3D/A8.py create mode 100755 test/VisuPrs/Plot3D/A9.py create mode 100755 test/VisuPrs/Plot3D/B0.py create mode 100755 test/VisuPrs/Plot3D/B1.py create mode 100755 test/VisuPrs/Plot3D/B2.py create mode 100755 test/VisuPrs/Plot3D/CMakeLists.txt create mode 100755 test/VisuPrs/Plot3D/E0.py create mode 100755 test/VisuPrs/Plot3D/E1.py create mode 100755 test/VisuPrs/Plot3D/E2.py create mode 100644 test/VisuPrs/Plot3D/E3.py create mode 100755 test/VisuPrs/Plot3D/E4.py create mode 100755 test/VisuPrs/Plot3D/E5.py create mode 100755 test/VisuPrs/Plot3D/E6.py create mode 100755 test/VisuPrs/Plot3D/E7.py create mode 100755 test/VisuPrs/Plot3D/E8.py create mode 100755 test/VisuPrs/Plot3D/E9.py create mode 100644 test/VisuPrs/Plot3D/F0.py create mode 100755 test/VisuPrs/Plot3D/F1.py create mode 100755 test/VisuPrs/Plot3D/F2.py create mode 100755 test/VisuPrs/Plot3D/F3.py create mode 100755 test/VisuPrs/Plot3D/F4.py create mode 100755 test/VisuPrs/Plot3D/F5.py create mode 100755 test/VisuPrs/Plot3D/F6.py create mode 100644 test/VisuPrs/Plot3D/F7.py create mode 100755 test/VisuPrs/Plot3D/F8.py create mode 100644 test/VisuPrs/Plot3D/F9.py create mode 100644 test/VisuPrs/Plot3D/G0.py create mode 100755 test/VisuPrs/Plot3D/G1.py create mode 100755 test/VisuPrs/Plot3D/G2.py create mode 100644 test/VisuPrs/SWIG_scripts/A1.py create mode 100644 test/VisuPrs/SWIG_scripts/A3.py create mode 100644 test/VisuPrs/SWIG_scripts/A4.py create mode 100644 test/VisuPrs/SWIG_scripts/A5.py create mode 100644 test/VisuPrs/SWIG_scripts/A6.py create mode 100644 test/VisuPrs/SWIG_scripts/A7.py create mode 100644 test/VisuPrs/SWIG_scripts/A8.py create mode 100644 test/VisuPrs/SWIG_scripts/A9.py create mode 100644 test/VisuPrs/SWIG_scripts/B0.py create mode 100644 test/VisuPrs/SWIG_scripts/B1.py create mode 100644 test/VisuPrs/SWIG_scripts/B5.py create mode 100644 test/VisuPrs/SWIG_scripts/B6.py create mode 100644 test/VisuPrs/SWIG_scripts/B7.py create mode 100644 test/VisuPrs/SWIG_scripts/B8.py create mode 100644 test/VisuPrs/SWIG_scripts/B9.py create mode 100644 test/VisuPrs/SWIG_scripts/C3.py create mode 100755 test/VisuPrs/SWIG_scripts/C7.py create mode 100644 test/VisuPrs/SWIG_scripts/CMakeLists.txt create mode 100755 test/VisuPrs/ScalarMap/A0.py create mode 100644 test/VisuPrs/ScalarMap/A1.py create mode 100755 test/VisuPrs/ScalarMap/A2.py create mode 100755 test/VisuPrs/ScalarMap/A3.py create mode 100755 test/VisuPrs/ScalarMap/A4.py create mode 100644 test/VisuPrs/ScalarMap/A5.py create mode 100755 test/VisuPrs/ScalarMap/A6.py create mode 100644 test/VisuPrs/ScalarMap/A7.py create mode 100644 test/VisuPrs/ScalarMap/A8.py create mode 100644 test/VisuPrs/ScalarMap/A9.py create mode 100644 test/VisuPrs/ScalarMap/B0.py create mode 100644 test/VisuPrs/ScalarMap/B1.py create mode 100644 test/VisuPrs/ScalarMap/B2.py create mode 100644 test/VisuPrs/ScalarMap/CMakeLists.txt create mode 100644 test/VisuPrs/ScalarMap/E0.py create mode 100644 test/VisuPrs/ScalarMap/E1.py create mode 100644 test/VisuPrs/ScalarMap/E2.py create mode 100755 test/VisuPrs/ScalarMap/E3.py create mode 100644 test/VisuPrs/ScalarMap/E4.py create mode 100644 test/VisuPrs/ScalarMap/E5.py create mode 100644 test/VisuPrs/ScalarMap/E6.py create mode 100644 test/VisuPrs/ScalarMap/E7.py create mode 100644 test/VisuPrs/ScalarMap/E8.py create mode 100644 test/VisuPrs/ScalarMap/E9.py create mode 100755 test/VisuPrs/ScalarMap/F0.py create mode 100644 test/VisuPrs/ScalarMap/F1.py create mode 100644 test/VisuPrs/ScalarMap/F2.py create mode 100644 test/VisuPrs/ScalarMap/F3.py create mode 100644 test/VisuPrs/ScalarMap/F4.py create mode 100644 test/VisuPrs/ScalarMap/F5.py create mode 100644 test/VisuPrs/ScalarMap/F6.py create mode 100644 test/VisuPrs/ScalarMap/F7.py create mode 100644 test/VisuPrs/ScalarMap/F8.py create mode 100644 test/VisuPrs/ScalarMap/F9.py create mode 100644 test/VisuPrs/ScalarMap/G0.py create mode 100644 test/VisuPrs/ScalarMap/G1.py create mode 100644 test/VisuPrs/ScalarMap/G2.py create mode 100644 test/VisuPrs/ScalarMap_On_DeformedShape/A0.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A1.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A2.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A3.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A4.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A5.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A6.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A7.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A8.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/A9.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/B0.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/B1.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/B2.py create mode 100644 test/VisuPrs/ScalarMap_On_DeformedShape/B3.py create mode 100644 test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E0.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E1.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E2.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E3.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E4.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E5.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E6.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E7.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E8.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/E9.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F0.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F1.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F2.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F3.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F4.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F5.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F6.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F7.py create mode 100755 test/VisuPrs/ScalarMap_On_DeformedShape/F8.py create mode 100644 test/VisuPrs/StreamLines/A0.py create mode 100644 test/VisuPrs/StreamLines/A1.py create mode 100644 test/VisuPrs/StreamLines/A2.py create mode 100644 test/VisuPrs/StreamLines/A3.py create mode 100644 test/VisuPrs/StreamLines/A4.py create mode 100644 test/VisuPrs/StreamLines/A5.py create mode 100644 test/VisuPrs/StreamLines/A6.py create mode 100644 test/VisuPrs/StreamLines/A7.py create mode 100644 test/VisuPrs/StreamLines/A8.py create mode 100644 test/VisuPrs/StreamLines/A9.py create mode 100644 test/VisuPrs/StreamLines/B0.py create mode 100644 test/VisuPrs/StreamLines/B1.py create mode 100644 test/VisuPrs/StreamLines/B2.py create mode 100644 test/VisuPrs/StreamLines/CMakeLists.txt create mode 100644 test/VisuPrs/StreamLines/E0.py create mode 100644 test/VisuPrs/StreamLines/E1.py create mode 100644 test/VisuPrs/StreamLines/E2.py create mode 100644 test/VisuPrs/StreamLines/E3.py create mode 100644 test/VisuPrs/StreamLines/E4.py create mode 100644 test/VisuPrs/StreamLines/E5.py create mode 100644 test/VisuPrs/StreamLines/E6.py create mode 100644 test/VisuPrs/StreamLines/E7.py create mode 100644 test/VisuPrs/StreamLines/E8.py create mode 100644 test/VisuPrs/StreamLines/E9.py create mode 100644 test/VisuPrs/StreamLines/F0.py create mode 100644 test/VisuPrs/StreamLines/F1.py create mode 100644 test/VisuPrs/StreamLines/F2.py create mode 100644 test/VisuPrs/StreamLines/F3.py create mode 100644 test/VisuPrs/StreamLines/F4.py create mode 100644 test/VisuPrs/StreamLines/F5.py create mode 100644 test/VisuPrs/StreamLines/F6.py create mode 100644 test/VisuPrs/StreamLines/F7.py create mode 100644 test/VisuPrs/StreamLines/F8.py create mode 100644 test/VisuPrs/StreamLines/F9.py create mode 100755 test/VisuPrs/Tables/A0.py create mode 100755 test/VisuPrs/Tables/A2.py create mode 100644 test/VisuPrs/Tables/CMakeLists.txt create mode 100644 test/VisuPrs/Util/CMakeLists.txt create mode 100755 test/VisuPrs/Util/paravistest.py create mode 100644 test/VisuPrs/Vectors/A0.py create mode 100755 test/VisuPrs/Vectors/A1.py create mode 100644 test/VisuPrs/Vectors/A2.py create mode 100755 test/VisuPrs/Vectors/A3.py create mode 100755 test/VisuPrs/Vectors/A4.py create mode 100755 test/VisuPrs/Vectors/A5.py create mode 100644 test/VisuPrs/Vectors/A6.py create mode 100755 test/VisuPrs/Vectors/A7.py create mode 100755 test/VisuPrs/Vectors/A8.py create mode 100755 test/VisuPrs/Vectors/A9.py create mode 100755 test/VisuPrs/Vectors/B0.py create mode 100755 test/VisuPrs/Vectors/B1.py create mode 100755 test/VisuPrs/Vectors/B2.py create mode 100644 test/VisuPrs/Vectors/B3.py create mode 100644 test/VisuPrs/Vectors/CMakeLists.txt create mode 100755 test/VisuPrs/Vectors/E0.py create mode 100755 test/VisuPrs/Vectors/E1.py create mode 100755 test/VisuPrs/Vectors/E2.py create mode 100644 test/VisuPrs/Vectors/E3.py create mode 100755 test/VisuPrs/Vectors/E4.py create mode 100755 test/VisuPrs/Vectors/E5.py create mode 100755 test/VisuPrs/Vectors/E6.py create mode 100755 test/VisuPrs/Vectors/E7.py create mode 100755 test/VisuPrs/Vectors/E8.py create mode 100755 test/VisuPrs/Vectors/E9.py create mode 100644 test/VisuPrs/Vectors/F0.py create mode 100755 test/VisuPrs/Vectors/F1.py create mode 100755 test/VisuPrs/Vectors/F2.py create mode 100755 test/VisuPrs/Vectors/F3.py create mode 100755 test/VisuPrs/Vectors/F4.py create mode 100755 test/VisuPrs/Vectors/F5.py create mode 100755 test/VisuPrs/Vectors/F6.py create mode 100644 test/VisuPrs/Vectors/F7.py create mode 100755 test/VisuPrs/Vectors/F8.py create mode 100644 test/VisuPrs/Vectors/F9.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bc2f363..e6cd3bc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,223 +1,126 @@ - - CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR) - IF(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) - ENDIF(COMMAND cmake_policy) - - - SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR}) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPYTHON.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindOMNIORB.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPTHREADS.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindHDF5.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindBOOST.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBXML2.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSWIG.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake) - INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake) - - - INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindPARAVIEW.cmake) - IF(EXISTS ${PARAVIEW_VTK_DIR}/VTKConfig.cmake) - SET(VTK_DIR ${PARAVIEW_VTK_DIR}) - ENDIF(EXISTS ${PARAVIEW_VTK_DIR}/VTKConfig.cmake) - SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR}) - INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindCAS.cmake) - INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindQT4.cmake) - INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindOPENGL.cmake) - INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindVTK.cmake) - INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindQWT.cmake) - INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindSIPPYQT.cmake) - INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindGUI.cmake) - - - SET(BUILD_PLUGINS 1) - SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR}) - SET(VISU_ROOT_DIR $ENV{VISU_ROOT_DIR}) - INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake) - IF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) - INCLUDE(${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) - SET(WITH_VISU 1) - ENDIF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) - EXECUTE_PROCESS(COMMAND pvpython ${CMAKE_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIRS}) - - - SET(DOXYGEN_IS_OK 0) - - - IF(WINDOWS) - SET(CPPUNIT_IS_OK 0) - ENDIF(WINDOWS) - - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# Copyright (C) 2010-2012 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. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# -* Makefile *- -# -# Author : -# Modified by : Alexander BORODIN (OCN) - autotools usage -# -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -SET(ACLOCAL_AMFLAGS - -I - adm_local/unix/config_files - -I - ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files - -I - ${GUI_ROOT_DIR}/adm_local/unix/config_files -) +PROJECT(PARAVIS) + +IF(WINDOWS) + STRING( REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags ${CMAKE_SHARED_LINKER_FLAGS_DEBUG} ) + SET( CMAKE_SHARED_LINKER_FLAGS_DEBUG "${replacementFlags}" ) +ENDIF(WINDOWS) + +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR) +IF(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +ENDIF(COMMAND cmake_policy) + +SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "KERNEL_ROOT_DIR") +SET(MODULE PARAVIS) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPLATFORM.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPYTHON.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindOMNIORB.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindPTHREADS.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindHDF5.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindBOOST.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindLIBXML2.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindSWIG.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindCPPUNIT.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindDOXYGEN.cmake) +INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/FindKERNEL.cmake) + +INCLUDE(${CMAKE_SOURCE_DIR}/adm_local/cmake_files/FindPARAVIEW.cmake) +IF(EXISTS ${PARAVIEW_VTK_DIR}/VTKConfig.cmake) + SET(VTK_DIR ${PARAVIEW_VTK_DIR}) +ENDIF(EXISTS ${PARAVIEW_VTK_DIR}/VTKConfig.cmake) + +SET(GUI_ROOT_DIR $ENV{GUI_ROOT_DIR} CACHE PATH "GUI_ROOT_DIR") +INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindCAS.cmake) +INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindQT4.cmake) +INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindOPENGL.cmake) +INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindVTK.cmake) +INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindQWT.cmake) +INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindSIPPYQT.cmake) +INCLUDE(${GUI_ROOT_DIR}/adm_local/cmake_files/FindGUI.cmake) + +SET(VERSION_MAJOR 6) +SET(VERSION_MINOR 5) +SET(VERSION_MAINTENANCE 0) +SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}") +SET(XVERSION 0x0${VERSION_MAJOR}0${VERSION_MINOR}0${VERSION_MAINTENANCE}) +SET(VERSION_DEV 1) + +SET(BUILD_PLUGINS 1) + +SET(VISU_ROOT_DIR $ENV{VISU_ROOT_DIR} CACHE PATH "VISU_ROOT_DIR") +IF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) + INCLUDE(${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) + SET(WITH_VISU 1) +ENDIF(EXISTS ${VISU_ROOT_DIR}/adm_local/cmake_files/FindVISU.cmake) + +SET(MED_ROOT_DIR $ENV{MED_ROOT_DIR} CACHE PATH "MED_ROOT_DIR") +INCLUDE(${MED_ROOT_DIR}/adm_local/cmake_files/FindMED.cmake) + +EXECUTE_PROCESS(COMMAND pvpython ${CMAKE_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_INCLUDE_DIRS}) SET(SUBDIRS - idl - adm_local - resources - src - doc - bin -) + idl + adm_local + resources + src + doc + bin + ) SET(DISTCLEANFILES - a.out - aclocal.m4 - configure - wrapfiles.txt -) - -SET(salomeinclude_DATA - PARAVIS_version.h -) - -SET(EXTRA_DIST - ${EXTRA_DIST} - build_configure - clean_configure -) - -# include $(top_srcdir)/wrapfiles.am + wrapfiles.txt + ) + INCLUDE(wrapfiles.cmake) -# dist-hook: -# rm -rf `find $(distdir) -name CVS` - -# dev_docs: -# (cd doc && $(MAKE) $(AM_MAKEFLAGS) dev_docs) - -# docs: dev_docs - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVIS_version.h.in) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/PARAVIS_version.h) - - - MESSAGE(STATUS "Creation of ${output}") - CONFIGURE_FILE(${input} ${output}) - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - -FOREACH(f ${salomeinclude_DATA}) - - SET(DEST include/salome) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - - ENDIF(ext STREQUAL .py) - -ENDFOREACH(f ${salomeinclude_DATA}) +SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVIS_version.h.in) +SET(output ${CMAKE_CURRENT_BINARY_DIR}/PARAVIS_version.h) + +MESSAGE(STATUS "Creation of ${output}") +CONFIGURE_FILE(${input} ${output}) + +ADD_DEFINITIONS(-DVTK_EXCLUDE_STRSTREAM_HEADERS) + +FOREACH(dir ${SUBDIRS}) + ADD_SUBDIRECTORY(${dir}) +ENDFOREACH(dir ${SUBDIRS}) + +# Reset CMAKE_CONFIGURATION_TYPES to the good value defined by CMAKE_BUILD_TYPE +IF(CMAKE_BUILD_TYPE) + IF(WINDOWS) + MARK_AS_ADVANCED(CLEAR CMAKE_CONFIGURATION_TYPES) + SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE} CACHE STRING "compilation types" FORCE) + ENDIF(WINDOWS) +ENDIF(CMAKE_BUILD_TYPE) + +INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/PARAVIS_version.h DESTINATION include/salome) + +# Configure Testing +SET(PARAVIS_TEST_OUTPUT_DIR /tmp/pic CACHE PATH "Directory for saving test pictures.") +OPTION(BUILD_TESTING "Build ParaVis Testing" ON) +IF(BUILD_TESTING) + SET(PARAVIS_TEST_DIR ${ParaVis_BINARY_DIR}/Test/Temporary) + MAKE_DIRECTORY(${PARAVIS_TEST_DIR}) + ENABLE_TESTING() + INCLUDE (CTest) + ADD_SUBDIRECTORY(test) +ENDIF(BUILD_TESTING) diff --git a/INSTALL b/INSTALL index ecaacbc7..4aff1376 100644 --- a/INSTALL +++ b/INSTALL @@ -1,44 +1,29 @@ Building and installing PARAVIS module =============================================== -PARAVIS is a light SALOME module that wraps ParaView GUI and makes it available in +PARAVIS is a SALOME module that wraps ParaView GUI and makes it available in SALOME GUI. Like any other SALOME module, PARAVIS requires PARAVIS_ROOT_DIR environment variable to be set to PARAVIS installation directory. Specific prerequisites: -- cmake 2.4.5 or higher should be installed, path to cmake executable +- cmake 2.6 or higher should be installed, path to cmake executable should be added to PATH environment variable. -- ParaView-3.4.0, both the build directory and the source files +- ParaView-3.7.0, should be installed -Environment variables needed for correct detection of ParaView location: -- PVSRCHOME - points at the root of ParaView source directory tree -- PVINSTALLHOME - points at the top of ParaView build tree (currently, due to some drawbacks in its buld procedure -ParaView should not be installed, its build directory is used instead). It also requires common SALOME environment including GUI_ROOT_DIR and other standard SALOME prerequisites. As soon as the environment is set, execute the following commands in a shell: -mkdir PARAVIS_BUILD -cd PARAVIS_BUILD -../PARAVIS_SRC/build_configure -../PARAVIS_SRC/configure --prefix=${PARAVIS_ROOT_DIR} +mkdir PARAVIS_BIN +ccmake ../PARAVIS_SRC make -make docs make install PARAVIS module can be launched using the following commands: -- Light SALOME configuration - -runLightSalome.sh --modules="PARAVIS" - -or - -- Full SALOME configuration - runSalome --modules="PARAVIS" diff --git a/PARAVIS_version.h.in b/PARAVIS_version.h.in index 79c8971b..785aca16 100644 --- a/PARAVIS_version.h.in +++ b/PARAVIS_version.h.in @@ -1,21 +1,20 @@ -// Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// +// Copyright (C) 2010-2012 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// 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 +// 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/ +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : PARAVIS_version.h // Author : Sergey ANIKIN @@ -30,5 +29,6 @@ #define PARAVIS_VERSION_STR "@VERSION@" #define PARAVIS_VERSION @XVERSION@ +#define PARAVIS_DEVELOPMENT @VERSION_DEV@ #endif // __PARAVIS_VERSION_H__ diff --git a/adm_local/CMakeLists.txt b/adm_local/CMakeLists.txt index 8c289eaa..8900ecb3 100644 --- a/adm_local/CMakeLists.txt +++ b/adm_local/CMakeLists.txt @@ -1,45 +1,20 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT +# Copyright (C) 2010-2012 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 +# License as published by the Free Software Foundation; either # version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# +# 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 +# +# 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 -# - -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -SET(SUBDIRS - unix - cmake_files -) - +# - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - +ADD_SUBDIRECTORY(cmake_files) diff --git a/adm_local/cmake_files/CMakeLists.txt b/adm_local/cmake_files/CMakeLists.txt index 60fb019e..56c56abe 100644 --- a/adm_local/cmake_files/CMakeLists.txt +++ b/adm_local/cmake_files/CMakeLists.txt @@ -1,115 +1,20 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2010-2012 CEA/DEN, EDF R&D # -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -SET(dist_admlocal_cmake_DATA - FindPARAVIEW.cmake -) - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - -FOREACH(f ${dist_admlocal_cmake_DATA}) - - SET(DEST adm_local/cmake_files) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - ENDIF(ext STREQUAL .py) - -ENDFOREACH(f ${dist_admlocal_cmake_DATA}) +INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/FindPARAVIEW.cmake DESTINATION adm_local/cmake_files) diff --git a/adm_local/cmake_files/FindPARAVIEW.cmake b/adm_local/cmake_files/FindPARAVIEW.cmake index 52f73d7f..d0dd6abd 100644 --- a/adm_local/cmake_files/FindPARAVIEW.cmake +++ b/adm_local/cmake_files/FindPARAVIEW.cmake @@ -1,31 +1,56 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2010-2012 CEA/DEN, EDF R&D # -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # FIND_PACKAGE(ParaView REQUIRED) -SET(PARAVIS_ROOT_DIR $ENV{PARAVIS_ROOT_DIR}) - SET(PARAVIEW_INCLUDES -I${PARAVIEW_INCLUDE_DIRS}) -SET(PARAVIEW_LIBS -L${PARAVIEW_LIBRARY_DIRS} -lvtkPVServerManager -lpqApplicationComponents) -FIND_LIBRARY(vtkPVServerManager vtkPVServerManager ${PARAVIEW_LIBRARY_DIRS}) -FIND_LIBRARY(pqApplicationComponents pqApplicationComponents ${PARAVIEW_LIBRARY_DIRS}) +FIND_LIBRARY(QtPython QtPython PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(QVTK QVTK PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(vtkClientServer vtkClientServer PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(vtkPVServerManager vtkPVServerManager PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(pqApplicationComponents pqApplicationComponents PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(pqComponents pqComponents PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(pqCore pqCore PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(pqWidgets pqWidgets PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(vtkPVClientServerCore vtkPVClientServerCore PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(vtkPVServerImplementation vtkPVServerImplementation PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(vtkPVCommon vtkPVCommon PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(vtkPVVTKExtensions vtkPVVTKExtensions PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(vtkViews vtkViews PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +FIND_LIBRARY(pqApplicationComponents pqApplicationComponents PATHS ${PARAVIEW_LIBRARY_DIRS} NO_DEFAULT_PATH) +SET(PARAVIEW_LIBS + ${QtPython} + ${QVTK} + ${vtkClientServer} + ${vtkGenericFiltering} + ${vtkInfovis} + ${vtkVolumeRendering} + ${vtkPVServerManager} + ${pqApplicationComponents} + ${pqComponents} + ${pqCore} + ${pqWidgets} + ${vtkPVClientServerCore} + ${vtkPVServerImplementation} + ${vtkPVVTKExtensions} + ${vtkPVCommon} + ${vtkViews} + ${pqApplicationComponents} + ) diff --git a/adm_local/unix/CMakeLists.txt b/adm_local/unix/CMakeLists.txt deleted file mode 100644 index 1694914d..00000000 --- a/adm_local/unix/CMakeLists.txt +++ /dev/null @@ -1,44 +0,0 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# 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 -# - -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -SET(SUBDIRS - config_files -) - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - diff --git a/adm_local/unix/config_files/CMakeLists.txt b/adm_local/unix/config_files/CMakeLists.txt deleted file mode 100644 index cca26ccd..00000000 --- a/adm_local/unix/config_files/CMakeLists.txt +++ /dev/null @@ -1,113 +0,0 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# 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 -# - -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -SET(dist_admlocalm4_DATA - check_ParaView.m4 -) - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - -FOREACH(f ${dist_admlocalm4_DATA}) - - SET(DEST adm_local/unix/config_files) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - - ENDIF(ext STREQUAL .py) - -ENDFOREACH(f ${dist_admlocalm4_DATA}) diff --git a/adm_local/unix/config_files/check_Med.m4 b/adm_local/unix/config_files/check_Med.m4 deleted file mode 100644 index 576db978..00000000 --- a/adm_local/unix/config_files/check_Med.m4 +++ /dev/null @@ -1,92 +0,0 @@ -dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -dnl -dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -dnl -# Check availability of Med binary distribution -# -# Author : Nicolas REJNERI (OPEN CASCADE, 2003) -# - -AC_DEFUN([CHECK_MED],[ -AC_REQUIRE([AC_LINKER_OPTIONS])dnl -AC_REQUIRE([CHECK_MED2]) - -AC_CHECKING(for Med) - -Med_ok=no - -MED_LDFLAGS="" -MED_CXXFLAGS="" - -AC_ARG_WITH(med, - [ --with-med=DIR root directory path of MED installation ], - MED_DIR="$withval",MED_DIR="") - -if test "x${MED_DIR}" == "x" ; then - AC_MSG_RESULT(for \${MED_ROOT_DIR}: ${MED_ROOT_DIR}) -# no --with-med-dir option used - if test "x${MED_ROOT_DIR}" != "x" ; then - - # MED_ROOT_DIR environment variable defined - MED_DIR=${MED_ROOT_DIR} - - fi - -fi - -MED_ENABLE_MULTIPR=no - -if test -f ${MED_DIR}/idl/salome/MED.idl ; then - AC_MSG_RESULT(Using Med module distribution in ${MED_DIR}) - Med_ok=yes - - if test "x$MED_ROOT_DIR" == "x" ; then - MED_ROOT_DIR=${MED_DIR} - fi - - AC_SUBST(MED_ROOT_DIR) - - MED_LDFLAGS=-L${MED_DIR}/lib${LIB_LOCATION_SUFFIX}/salome - MED_CXXFLAGS=-I${MED_DIR}/include/salome - - AC_SUBST(MED_LDFLAGS) - AC_SUBST(MED_CXXFLAGS) - - # MULTIPR - AC_CHECK_FILE(${MED_DIR}/include/salome/MULTIPR_Obj.hxx, - ENABLE_MULTIPR=yes, - ENABLE_MULTIPR=no) - AC_SUBST(ENABLE_MULTIPR) - MULTIPR_CPPFLAGS="" - MULTIPR_LIBS="" - if test "x${ENABLE_MULTIPR}" = "xyes" ; then - MULTIPR_CPPFLAGS="-DENABLE_MULTIPR" - MULTIPR_LIBS="-lMULTIPR_API" - fi - AC_SUBST(MULTIPR_CPPFLAGS) - AC_SUBST(MULTIPR_LIBS) -else - AC_MSG_WARN("Cannot find Med module sources") -fi - -AC_MSG_RESULT(for Med: $Med_ok) -AC_MSG_RESULT(for MULTIPR Med package: $ENABLE_MULTIPR) - -])dnl diff --git a/adm_local/unix/config_files/check_Med2.m4 b/adm_local/unix/config_files/check_Med2.m4 deleted file mode 100644 index c5cc625a..00000000 --- a/adm_local/unix/config_files/check_Med2.m4 +++ /dev/null @@ -1,200 +0,0 @@ -dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -dnl -dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -dnl -AC_DEFUN([CHECK_MED2],[ -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_CPP])dnl -AC_REQUIRE([CHECK_HDF5])dnl -AC_REQUIRE([MED_CHECK_SIZEOF_MEDINT]) - -AC_CHECKING(for MED2) - -AC_ARG_WITH(med2, - [ --with-med2=DIR root directory path to med2 installation ], - [MED2HOME="$withval" - AC_MSG_RESULT("select $withval as path to med2") - ]) - -AC_SUBST(MED2_INCLUDES) -AC_SUBST(MED2_LIBS) -AC_SUBST(MED2_MT_LIBS) -AC_SUBST(MED_CPPFLAGS) - -MED2_INCLUDES="" -MED2_LIBS="" -MED2_MT_LIBS="" -MED_CPPFLAGS="$DEFINED_F77INT64" - -med2_ok=no - -LOCAL_INCLUDES="$HDF5_INCLUDES" -LOCAL_LIBS="-lmed -lmedimportcxx $HDF5_LIBS" - -if test -z $MED2HOME -then - AC_MSG_WARN(undefined MED2HOME variable which specify med2 installation directory) - AC_PATH_PROG(MDUMP, mdump) - if test "xMDUMP" != "x" ; then - MED2HOME=$MDUMP - MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` - MED2HOME=`echo ${MED2HOME} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` - fi -fi -if test ! -z $MED2HOME -then - LOCAL_INCLUDES="$LOCAL_INCLUDES -I$MED2HOME/include" - if test "x$MED2HOME" = "x/usr" - then - LOCAL_LIBS="-lmed $LOCAL_LIBS" - else - LOCAL_LIBS="-L$MED2HOME/lib $LOCAL_LIBS" - fi -fi - -dnl check med2 header - -f77int="F77INT32" -case $host_os in - irix5.* | irix6.* | osf4.* | osf5.* | linux* ) - - linux64="true" -# porting on intel processor 64 bits - expr "$host_os" : 'linux' >/dev/null && ( test ! x"$host_cpu" = x"x86_64" && test ! x"$host_cpu" = x"ia64" ) && linux64="false" - if test ! x"$linux64" = "xfalse" ; then - echo "$as_me:$LINENO: checking for 64bits integers size in F77/F90" >&5 -echo $ECHO_N "checking for 64bits integers size in F77/F90... $ECHO_C" >&6 - # Check whether --enable-int64 or --disable-int64 was given. -if test "${enable_int64+set}" = set; then - enableval="$enable_int64" - -fi; - case "X-$enable_int64" in - X-no) - echo "$as_me:$LINENO: result: \"disabled\"" >&5 -echo "${ECHO_T}\"disabled\"" >&6 - SUFFIXES="_32" - ;; - *) - echo "$as_me:$LINENO: result: \"enabled\"" >&5 -echo "${ECHO_T}\"enabled\"" >&6 - SUFFIXES="" - f77int="F77INT64" - ;; - esac - fi - ;; - *) - ;; -esac - -case $host_os in - linux*) - test x"$linux64" = x"true" && \ - MACHINE="PCLINUX64${SUFFIXES}" || \ - MACHINE=PCLINUX - ;; - hpux*) - MACHINE=HP9000 - ;; - aix4.*) - MACHINE=RS6000 - host_os_novers=aix4.x - ;; - irix5.*) - MACHINE="IRIX64${SUFFIXES}" - host_os_novers=irix5.x - ;; - irix6.*) - MACHINE="IRIX64${SUFFIXES}" - host_os_novers=irix6.x - ;; - osf4.*) - MACHINE="OSF1${SUFFIXES}" - host_os_novers=osf4.x - ;; - osf5.*) - MACHINE="OSF1${SUFFIXES}" - host_os_novers=osf5.x - ;; - solaris2.*) - MACHINE=SUN4SOL2 - host_os_novers=solaris2.x - ;; - uxpv*) - MACHINE=VPP5000 - ;; - *) - MACHINE= - host_os_novers=$host_os - ;; -esac - -CPPFLAGS_old="$CPPFLAGS" -dnl we must test system : linux = -DPCLINUX -dnl we must test system : Alpha-OSF = -DOSF1 -case $host_os in - linux*) - CPPFLAGS="$CPPFLAGS -D$MACHINE $LOCAL_INCLUDES" -dnl CPPFLAGS="$CPPFLAGS -DPCLINUX $LOCAL_INCLUDES" - ;; - osf*) - CPPFLAGS="$CPPFLAGS -DOSF1 $LOCAL_INCLUDES" - ;; -esac -AC_CHECK_HEADER(med.h,med2_ok=yes ,med2_ok=no) -CPPFLAGS="$CPPFLAGS_old" - -if test "x$med2_ok" = "xyes" -then - -dnl check med2 library - - LIBS_old="$LIBS" - LIBS="$LIBS $LOCAL_LIBS" - AC_CHECK_LIB(med,MEDouvrir,med2_ok=yes,med2_ok=no) - - if test "x$med2_ok" = "xyes" - then - AC_CHECK_LIB(medimportcxx,HAVE_MEDimport,med2_ok=yes,med2_ok=no) - fi - LIBS="$LIBS_old" - -fi - -if test "x$med2_ok" = "xyes" -then -case $host_os in - linux*) - MED2_INCLUDES="-D$MACHINE $LOCAL_INCLUDES" -dnl MED2_INCLUDES="-DPCLINUX $LOCAL_INCLUDES" - ;; - osf*) - MED2_INCLUDES="-DOSF1 $LOCAL_INCLUDES" - ;; -esac - MED2_LIBS="$LOCAL_LIBS" - MED2_MT_LIBS="$LOCAL_LIBS" -fi - - -AC_MSG_RESULT(for med2: $med2_ok) - -])dnl diff --git a/adm_local/unix/config_files/check_ParaView.m4 b/adm_local/unix/config_files/check_ParaView.m4 deleted file mode 100644 index 51907bbe..00000000 --- a/adm_local/unix/config_files/check_ParaView.m4 +++ /dev/null @@ -1,175 +0,0 @@ -dnl Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org -dnl -dnl -dnl - -dnl -dnl OPTIONS_PARAVIEW -dnl ------------------------------------------------------------------------ -dnl Adds the --with-paraview=path -dnl -AC_DEFUN([OPTIONS_PARAVIEW], [ - AC_ARG_WITH([paraview], - [AC_HELP_STRING([--with-paraview], [The prefix where ParaView is located (default "" means taking from PVHOME environment variable)])], - [with_paraview=$withval], [with_paraview=""]) -]) - -dnl -dnl CHECK_PARAVIEW -dnl ------------------------------------------------------------------------ -dnl a simplified check that assumes VTK is a part of ParaView, separate location -dnl for VTK is not supported -dnl -AC_DEFUN([CHECK_PARAVIEW], [ -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_CXX])dnl -AC_REQUIRE([AC_PROG_CPP])dnl -AC_REQUIRE([AC_PROG_CXXCPP])dnl -AC_REQUIRE([AC_LINKER_OPTIONS])dnl - -AC_REQUIRE([OPTIONS_PARAVIEW])dnl - -AC_CHECKING(for ParaView) - -AC_LANG_SAVE -AC_LANG_CPLUSPLUS - -AC_SUBST(PARAVIEW_INCLUDES) -AC_SUBST(PARAVIEW_LIBS) -dnl AC_SUBST(VTKPY_MODULES) - -PARAVIEW_INCLUDES="" -PARAVIEW_LIBS="" -dnl VTKPY_MODULES="" - -paraview_ok=no - -if test "x$OpenGL_ok" != "xyes" ; then - AC_MSG_WARN(ParaView needs OpenGL correct configuration, check configure output) -fi - - -if test "x$qt_ok" != "xyes" ; then - AC_MSG_WARN(ParaView needs Qt correct configuration, check configure output) -fi - -if test "x$hdf5_ok" != "xyes" ; then - AC_MSG_WARN(ParaView needs correct HDF5 configuration, check configure output) -fi - -AC_PATH_X -if test "x$x_libraries" != "x" -then - LXLIB="-L$x_libraries" -else - LXLIB="" -fi - -if test "x$x_libraries" = "x/usr/lib" -then - LXLIB="" -fi - -if test "x$x_libraries" = "x/usr/lib${LIB_LOCATION_SUFFIX}" -then - LXLIB="" -fi - -LOCAL_INCLUDES="$OGL_INCLUDES" -LOCAL_LIBS="-lvtksys -lvtkzlib -lvtkpng -lvtkjpeg -lvtktiff -lvtkexpat -lvtksqlite -lvtkmetaio -lvtkverdict -lvtkNetCDF -lvtkDICOMParser -lvtkfreetype -lvtkftgl -lvtkexoIIc -lvtklibxml2 -lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets -lvtkClientServer -lvtkCommonCS -lvtkFilteringCS -lvtkIOCS -lvtkImagingCS -lvtkGraphicsCS -lvtkGenericFiltering -lvtkGenericFilteringCS -lvtkRenderingCS -lvtkHybridCS -lvtkParallelCS -lvtkPVCommandOptions -lKWCommon -lvtkInfovis -lvtkInfovisCS -lvtkPVServerCommon -lvtkPVServerCommonCS -lvtkCommonPythonD -lvtkFilteringPythonD -lvtkIOPythonD -lXdmf -lvtkXdmf -lvtkXdmfCS -lvtkWidgetsCS -lvtkVolumeRendering -lvtkVolumeRenderingCS -lvtkPVFilters -lvtkPVFiltersCS -lvtkViews -lvtkPVServerManagerPythonD -lvtkPVServerCommonPythonD -lvtkPVPythonInterpretor -lvtkPVServerManager -lQVTK -lpqWidgets -lQtTesting -lvtkQtChart -lpqCore -lQtPython -lpqApplicationComponents -lpqComponents -lvtkalglib $LXLIB -lX11 -lXt" - -dnl VTK install dir -if test -z $with_paraview ; then - with_paraview="" -fi -if test "x$with_paraview" = "xyes" ; then - dnl in case user wrote --with-paraview=yes - with_paraview="" -fi -if test "x$with_paraview" = "xno" ; then - dnl in case user wrote --with-paraview=no - with_paraview="" - AC_MSG_WARN(Value "no", specified for option --with-paraview, is not supported) -fi - -if test "x$with_paraview" != "x" ; then - PVHOME="$with_paraview" -fi - - if test -z $PVHOME ; then - AC_MSG_WARN(undefined PVHOME and PVSRCHOME variables which specify where ParaView is located) - fi - -LOCAL_INCLUDES="-I$PVHOME/include/paraview-$PVVERSION $LOCAL_INCLUDES" - -LOCAL_LIBS="-L$PVHOME/lib/paraview-$PVVERSION $LOCAL_LIBS" - -dnl vtk headers -CPPFLAGS_old="$CPPFLAGS" -CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES $QT_INCLUDES" - -AC_CHECK_HEADER(pqApplicationCore.h,paraview_ok="yes",paraview_ok="no") - -CPPFLAGS="$CPPFLAGS_old" - -if test "x$paraview_ok" = "xyes" -then - PARAVIEW_INCLUDES="$LOCAL_INCLUDES" - - dnl vtk libraries - - AC_MSG_CHECKING(linking ParaView component library) - - LIBS_old="$LIBS" - LIBS="$LIBS $QT_LIBS $LOCAL_LIBS" - CPPFLAGS_old="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $QT_INCLUDES $PARAVIEW_INCLUDES" - - dnl VTKPY_MODULES="$VTKHOME/python" - - AC_CACHE_VAL(salome_cv_lib_paraview,[ - AC_TRY_LINK([#include "pqApplicationCore.h" - ], - [pqApplicationCore::instance()], - [salome_cv_lib_paraview=yes], - [salome_cv_lib_paraview=no]) - ]) - paraview_ok="$salome_cv_lib_paraview" - LIBS="$LIBS_old" - CPPFLAGS="$CPPFLAGS_old" -fi - -if test "x$paraview_ok" = "xno" -then - AC_MSG_RESULT(no) - AC_MSG_WARN(unable to link with ParaView component library) -else - AC_MSG_RESULT(yes) - PARAVIEW_LIBS="$LOCAL_LIBS" -fi - -AC_MSG_RESULT(for ParaView: $paraview_ok) - -AC_LANG_RESTORE - -# Save cache -AC_CACHE_SAVE - -])dnl diff --git a/adm_local/unix/config_files/check_VISU.m4 b/adm_local/unix/config_files/check_VISU.m4 deleted file mode 100755 index 1fde1814..00000000 --- a/adm_local/unix/config_files/check_VISU.m4 +++ /dev/null @@ -1,73 +0,0 @@ -dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -dnl -dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -dnl -########################################################### -# File : check_Visu.m4 -# Author : Vadim SANDLER (OCN) -# Created : 13/07/05 -# Check availability of VISU binary distribution -########################################################### - -AC_DEFUN([CHECK_VISU],[ - -AC_CHECKING(for VISU) - -Visu_ok=no - -VISU_LDFLAGS="" -VISU_CXXFLAGS="" - - -AC_ARG_WITH(visu, - [ --with-visu=DIR root directory path of VISU module installation ], - VISU_DIR="$withval",VISU_DIR="") - -if test "x$VISU_DIR" == "x" ; then - # no --with-visu-dir option used - if test "x$VISU_ROOT_DIR" != "x" ; then - # VISU_ROOT_DIR environment variable defined - VISU_DIR=$VISU_ROOT_DIR - fi -fi - -if test -f ${VISU_DIR}/idl/salome/VISU_Gen.idl ; then - Visu_ok=yes - AC_MSG_RESULT(Using VISU module distribution in ${VISU_DIR}) - - if test "x$VISU_ROOT_DIR" == "x" ; then - VISU_ROOT_DIR=${VISU_DIR} - fi - AC_SUBST(VISU_ROOT_DIR) - - VISU_LDFLAGS=-L${VISU_DIR}/lib${LIB_LOCATION_SUFFIX}/salome - VISU_CXXFLAGS=-I${VISU_DIR}/include/salome - - AC_SUBST(VISU_LDFLAGS) - AC_SUBST(VISU_CXXFLAGS) - -else - AC_MSG_WARN("Cannot find VISU module sources") -fi - -AC_MSG_RESULT(for VISU: $Visu_ok) - -])dnl - diff --git a/adm_local/unix/config_files/med_check_sizeof_medint.m4 b/adm_local/unix/config_files/med_check_sizeof_medint.m4 deleted file mode 100644 index 97572a42..00000000 --- a/adm_local/unix/config_files/med_check_sizeof_medint.m4 +++ /dev/null @@ -1,38 +0,0 @@ -dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -dnl -dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -dnl -dnl This library is free software; you can redistribute it and/or -dnl modify it under the terms of the GNU Lesser General Public -dnl License as published by the Free Software Foundation; either -dnl version 2.1 of the License. -dnl -dnl This library is distributed in the hope that it will be useful, -dnl but WITHOUT ANY WARRANTY; without even the implied warranty of -dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -dnl Lesser General Public License for more details. -dnl -dnl You should have received a copy of the GNU Lesser General Public -dnl License along with this library; if not, write to the Free Software -dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -dnl -dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -dnl -AC_DEFUN([MED_CHECK_SIZEOF_MEDINT], [ - - ## Guess the fortran int size - AC_CHECK_SIZEOF_FORTRAN(integer) - if test "x$ac_cv_sizeof_fortran_integer" = "x8" ; then - AC_CHECK_SIZEOF(long) - test "x$ac_cv_sizeof_long" = "x8" || AC_MSG_ERROR([Size of C type long expected to be eight bytes]) - DEFINED_F77INT64="-DHAVE_F77INT64" - elif test "x$ac_cv_sizeof_fortran_integer" = "x4" ; then - AC_CHECK_SIZEOF(int) - test "x$ac_cv_sizeof_int" = "x4" || AC_MSG_ERROR([Size of C type int expected to be four bytes]) - DEFINED_F77INT64="" - else - AC_MSG_ERROR([Size of Fortran type integer is neither four nor eigth bytes]) - fi - AC_SUBST(DEFINED_F77INT64) -]) \ No newline at end of file diff --git a/bin/CMakeLists.txt b/bin/CMakeLists.txt index aebb6e4e..ab2ab6a3 100644 --- a/bin/CMakeLists.txt +++ b/bin/CMakeLists.txt @@ -1,192 +1,26 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT +# Copyright (C) 2010-2012 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 +# License as published by the Free Software Foundation; either # version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# +# 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 +# +# 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 -# -* Makefile *- # -# Author : -# Module : PARAVIS +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -# non-distributed files -SET(nodist_salomescript_DATA - VERSION -) - -# distributed files -SET(dist_salomescript_SCRIPTS -) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.in) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/VERSION) - - - MESSAGE(STATUS "Creation of ${output}") - CONFIGURE_FILE(${input} ${output}) - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - -FOREACH(f ${nodist_salomescript_DATA}) - - SET(DEST bin/salome) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - - ENDIF(ext STREQUAL .py) - -ENDFOREACH(f ${nodist_salomescript_DATA}) -FOREACH(f ${dist_salomescript_SCRIPTS}) - - SET(DEST bin/salome) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - +SET(input ${CMAKE_CURRENT_SOURCE_DIR}/VERSION.in) +SET(output ${CMAKE_CURRENT_BINARY_DIR}/VERSION) - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - +MESSAGE(STATUS "Creation of ${output}") +CONFIGURE_FILE(${input} ${output}) - ENDIF(ext STREQUAL .py) - -ENDFOREACH(f ${dist_salomescript_SCRIPTS}) +INSTALL(FILES paravis_setenv.py ${CMAKE_CURRENT_BINARY_DIR}/VERSION DESTINATION bin/salome) diff --git a/bin/VERSION.in b/bin/VERSION.in index 4e8104ee..b91222e2 100755 --- a/bin/VERSION.in +++ b/bin/VERSION.in @@ -1 +1,3 @@ -THIS IS PARAVIS MODULE : VERSION: @VERSION@ +[SALOME PARAVIS] : @VERSION@ +[DEVELOPMENT] : @VERSION_DEV@ +[DESCRIPTION] : SALOME ParaVis (Paraview-based post-processing) module diff --git a/bin/paravis_setenv.py b/bin/paravis_setenv.py new file mode 100644 index 00000000..117d0795 --- /dev/null +++ b/bin/paravis_setenv.py @@ -0,0 +1,35 @@ +#! /usr/bin/env python +# -*- coding: iso-8859-1 -*- +# Copyright (C) 2007-2012 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. +# +# 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 +# + +import os, re + +# ----------------------------------------------------------------------------- + +def set_env( args ): + """Initialize environment of PARAVIS module""" + # set PV_PLUGIN_PATH to PARAVIS plug-ins + paravis_plugin_dir = os.path.join( os.getenv( "PARAVIS_ROOT_DIR" ), "lib", "paraview" ) + plugin_path = re.split( ":|;", os.getenv( 'PV_PLUGIN_PATH', paravis_plugin_dir ) ) + if paravis_plugin_dir not in plugin_path: plugin_path[0:0] = [paravis_plugin_dir] + os.environ['PV_PLUGIN_PATH'] = ";".join(plugin_path) + pass + + diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index fb443b9c..0b2bac41 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -1,59 +1,20 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# PARAVIS : ParaView wrapper SALOME module -# -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# Copyright (C) 2010-2012 CEA/DEN, EDF R&D # -# 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 +# 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. # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# 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. # -# -* Makefile *- +# 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 # -# Author : Margarita KARPUNINA (OCN) -# Date : 05/12/2008 -# $Header$ +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(SUBDIRS - salome -) - -# dev_docs: -# (cd salome && $(MAKE) $(AM_MAKEFLAGS) dev_docs) - -# docs: dev_docs - - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - +ADD_SUBDIRECTORY(salome) diff --git a/doc/UserDocumentation.html b/doc/UserDocumentation.html index 18b08d89..2960bc89 100644 --- a/doc/UserDocumentation.html +++ b/doc/UserDocumentation.html @@ -1,30 +1,32 @@ - + - + - +

PARAVIS development

PARAVIS user documentation

-

1.Introduction

-

2.Building -environment

-

3.VTK -library

-

4.Building -of PARAVIS

-

5.Starting -SALOME with PARAVIS

-

6.Commands -accessible in Python console

-

7.Trace -management

-

8.PARAVIS -GUI specific

+

1.Introduction

+

2.Building +environment

+

3.VTK +library

+

4.Building +of PARAVIS

+

5.Starting +SALOME with PARAVIS

+

6.Commands +accessible in Python console

+

7.Trace +management

+

8.PARAVIS +GUI specific

+

9. +PARAVIEW options

Introduction

This document describes features of ParaView Python extractor using in PARAVIS module of SALOME platform. @@ -34,25 +36,8 @@ API extracted for using in SALOME Python console is similar to the server manager API of ParaView. But there are some features what is desirable to understand for effective using of extractor.

Building environment

-

In addition to -standard SALOME environment following environment variables has to be -defined for PARAVIS building and testing:

-
    -
  1. PVHOME – - points to installation directory of ParaView.

    -
  2. PVVERSION - – defines a number of installed ParaView version.

    -
  3. PATH="${PVHOME}/bin:${PATH}"

    -
  4. LD_LIBRARY_PATH=”${PVHOME}/bin:${PVHOME}/lib/paraview-${PVVERSION}:${LD_LIBRARY_PATH}"

    -
  5. PYTHONPATH="${PVHOME}/bin:${PVHOME}/lib/paraview-${PVVERSION}:${PYTHONPATH}"

    -
  6. TESTDIR – - points to a directory which contains test script files. Usually it - is PARAVIS_SRC/test.

    -
  7. PVDATA – - points to ParaViewData directory.

    -
-

Also it is -necessary to check that PARAVIS_SRC directory contains following +

It is +necessary to check that PARAVIS_SRC directory contains following files and they are up-to-date:

  1. src/Paraview/lex.yy.c

    @@ -69,42 +54,37 @@ same version supplied with ParaView for all components and modules of SALOME.

    For this -purposes a new option “--with-paraview” has been defined for -configure script. This option configures building procedure to use -VTK from ParaView. It means that GUI package and all modules has to -be configured with this option.

    +purposes a new option “--with-paraview” has been defined +for configure script. This option configures building procedure to +use VTK from ParaView. It means that GUI package and all modules has +to be configured with this option.

    Building of PARAVIS


    1. - Call build_configure - script in sources directory: + Call cmake in a build directory:

      - > - build configure

      -
    2. Launch configure script from a build directory. -

      -

      > ../PARAVIS_SRC/configure --prefix=$PARAVIS_ROOT_DIR

      + > + ccmake ../PARAVIS_SRC

    3. Call make command in build directory.

      > make

    4. - Call - make install command - in build directory. + Call + make install command in build directory.

      - > make - install

      + > make + install

    Starting SALOME with PARAVIS

    -

    > runSalome –modules="PARAVIS"

    +

    > runSalome –modules="PARAVIS"

    If it is necessary then other SALOME modules can be added to -“modules” list separated by comma.

    +“modules” list separated by comma.

    Commands accessible in Python console

    Loading ParaView Python API for PARAVIS can be done with help of @@ -120,8 +100,9 @@ which can start/stop trace in any moment, in PARAVIS trace is activating or deactivating for whole session.

    Trace functionality can be switched on/off in SALOME preferences dialog box in PARAVIS tab (main menu | Preferences...). It contains -check box “Deactivate Trace”. By default the trace is activated. -Change of check box state makes effect only for next session.

    +check box “Deactivate Trace”. By default the trace is +activated. Change of check box state makes effect only for next +session.

    User can get the trace with help of two commands (after pvsimple import):

      @@ -129,29 +110,29 @@ import):

      console window.

    1. SaveTrace(fileName) - saves the trace into a given disk file.

    -

    Also trace is using for “Dump Study” functionality. But if the -tracing is switched off then “Dump Study” doesn't saves PARAVIS -module state.

    +

    Also trace is using for “Dump Study” functionality. +But if the tracing is switched off then “Dump Study” +doesn't saves PARAVIS module state.

    SALOME study save

    On SALOME study saving PARAVIS module data is also saved in the study. This data is saved in form of ParaView state file. ParaView state file could have references on external files imported during PARAVIS working session. These referenced files can be saved with the -current study depending on preference “Paraview state saving type” -defined in PARAVIS preferences dialog box. This preference can have -three possible state:

    +current study depending on preference “Paraview state saving +type” defined in PARAVIS preferences dialog box. This +preference can have three possible state:

      -
    1. “Save referenced files only for built-in server”. In case - if this option is active then referenced files will be saved in - study together with ParaView state only if in PARAVIS was used +

    2. “Save referenced files only for built-in server”. + In case if this option is active then referenced files will be saved + in study together with ParaView state only if in PARAVIS was used built-in ParaView server. In case of remote ParaView server the state will be saved as it is without referenced files.

      -
    3. “Always save referenced files if they are accessible”. In - this case referenced files will be saved with ParaView state for any - type of ParaView server but only in case if they are accessible +

    4. “Always save referenced files if they are accessible”. + In this case referenced files will be saved with ParaView state for + any type of ParaView server but only in case if they are accessible across local file system.

      -
    5. “Never save referenced files”. In this case referenced - files will be never saved with ParaView state.

      +
    6. “Never save referenced files”. In this case + referenced files will be never saved with ParaView state.

    It is necessary to be aware that if referenced files are not saved in study then there is no guarantee that the saved study will be @@ -173,5 +154,13 @@ appeared after SALOME launch. Other desktops, even they opened with study containing PARAVIS data, can not load PARAVIS module.



    +

    PARAVIEW options

    +

    If it is necessary to define a spcific command line +parameters for ParaView application then it can be defined with help +of PARAVIS_OPTIONS environment variable. For example:

    +

    export PARAVIS_OPTIONS=--server=myServer

    +

    If it is necessary to define several command line +parameters then these parameters has to be separated by “:” +symbol.

    \ No newline at end of file diff --git a/doc/salome/CMakeLists.txt b/doc/salome/CMakeLists.txt index d361b5b7..bd7f083f 100644 --- a/doc/salome/CMakeLists.txt +++ b/doc/salome/CMakeLists.txt @@ -1,61 +1,20 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# PARAVIS : ParaView wrapper SALOME module -# -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# 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. +# Copyright (C) 2010-2012 CEA/DEN, EDF R&D # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is 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. # -# 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 +# 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. # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# 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 # -# -* Makefile *- +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# Author : Margarita KARPUNINA (OCN) -# Date : 05/12/2008 -# $Header$ -# - -SET(SUBDIRS - gui -) -SET(SUBDIRSGUI - gui -) - -# dev_docs: -# @@SETX@; for d in $(SUBDIRSGUI); do (cd $$d && $(MAKE) $@) || exit 1; done; - -# docs: dev_docs - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - +ADD_SUBDIRECTORY(gui) diff --git a/doc/salome/gui/CMakeLists.txt b/doc/salome/gui/CMakeLists.txt index 4926eb87..1ccf8056 100644 --- a/doc/salome/gui/CMakeLists.txt +++ b/doc/salome/gui/CMakeLists.txt @@ -1,79 +1,25 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# PARAVIS : ParaView wrapper SALOME module -# -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# Copyright (C) 2010-2012 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. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# -* Makefile *- -# -# Author : Margarita KARPUNINA (OCN) -# Date : 05/12/2008 -# $Header$ -# - -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -SET(EXTRA_DIST - ${EXTRA_DIST} - images - static -) - -# dev_docs: doxyfile -# echo "Running doxygen in directory: "`pwd`; $(DOXYGEN) $<; - -# clean-local: -# -rm -fr PARAVIS doxygen.bak - -# install-data-local: -# if test -d PARAVIS; then $(INSTALL) -d $(DESTDIR)$(docdir)/gui ; cp -rp PARAVIS $(DESTDIR)$(docdir)/gui ; fi; - -# uninstall-local: -# rm -rf $(DESTDIR)$(docdir)/gui/PARAVIS - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in) - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/doxyfile) - +SET(input ${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in) +SET(output ${CMAKE_CURRENT_BINARY_DIR}/doxyfile) - MESSAGE(STATUS "Creation of ${output}") - CONFIGURE_FILE(${input} ${output}) - +MESSAGE(STATUS "Creation of ${output}") +CONFIGURE_FILE(${input} ${output}) - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - diff --git a/doc/salome/gui/doxyfile.in b/doc/salome/gui/doxyfile.in index a60c13ef..eeda70aa 100755 --- a/doc/salome/gui/doxyfile.in +++ b/doc/salome/gui/doxyfile.in @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + # Doxyfile 1.4.6 #--------------------------------------------------------------------------- @@ -225,6 +244,7 @@ CALL_GRAPH = NO GRAPHICAL_HIERARCHY = YES DIRECTORY_GRAPH = YES DOT_IMAGE_FORMAT = jpg +DOT_FONTNAME = Arial DOT_PATH = DOTFILE_DIRS = MAX_DOT_GRAPH_WIDTH = 1024 diff --git a/getwrapclasses.py b/getwrapclasses.py index 41934659..883f1646 100644 --- a/getwrapclasses.py +++ b/getwrapclasses.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + import paraview, os, sys import string import re @@ -5,12 +24,10 @@ import re classeslistsm = [] classeslistvtk = [] -if os.name == "posix": - from libvtkPVServerCommonPython import * - from libvtkPVServerManagerPython import * -else: - from vtkPVServerCommonPython import * - from vtkPVServerManagerPython import * +from vtkPVClientServerCorePython import * +from vtkPVServerImplementationPython import * +from vtkPVServerManagerPython import * +from vtkPVCommonPython import * l1 = dir() for a in l1: @@ -24,12 +41,18 @@ for a in l2: if (a not in l1) and a.startswith("vtk"): classeslistvtk.append(a) -dic=dict(); +dic=dict() + +non_wrap_list = ["vtkVariant", "vtkTimeStamp"] + pv_classes_new=classeslistsm while len(pv_classes_new): pv_classes_cur=pv_classes_new pv_classes_new=[] for c in pv_classes_cur: + ## ignore non wrappable classes + if c in non_wrap_list: + continue filename=sys.argv[1]+"/"+c+".h" if os.path.isfile(filename): c_new=[] @@ -64,6 +87,9 @@ while len(pv_classes_new): if len(cm) == 0: continue for cn in cm: + ## do not extract Call Back classes + if cn.count('vtkClassMemberCallback'): + continue if cn not in dic.keys() and cn not in pv_classes_new: pv_classes_new.append(cn) if cn not in c_new: @@ -71,11 +97,14 @@ while len(pv_classes_new): f.close() dic[c]=[0, c_new] + pv_classes_sort=[] def collect_dic(cc): ret=[] for c in cc: + if c not in dic.keys(): + continue if len(dic[c][1]) and dic[c][0] == 0: ret+=collect_dic(dic[c][1]) if dic[c][0] == 0: diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index c0535dd4..1c116fae 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -1,665 +1,132 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# Copyright (C) 2010-2012 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. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# This Makefile is responsible of generating the client and server -# implementation of IDL interfaces for both C++ and python usage. -# The building process of the C++ files is in charge of each source -# package and then is not manage here. -# -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -#Executable -SET(bin_PROGRAMS - vtkWrapIDL -) -# vtkWrapIDL.h: -# @$(srcdir)/create_header.sh $(top_srcdir) +SET(VERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}) +SET(SOVERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}) -# $(srcdir)/vtkWrapIDL.c: vtkWrapIDL.h; +ADD_DEFINITIONS(-DHAVE_SALOME_CONFIG) +INCLUDE_DIRECTORIES(${KERNEL_ROOT_DIR}/include/salome ${CMAKE_BINARY_DIR}/idl) -SET(dist_vtkWrapIDL_SOURCES - ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParse.tab.c - ${CMAKE_CURRENT_SOURCE_DIR}/vtkWrapIDL.c -) +#INCLUDE(vtkWrapHierarchy.cmake) +#SET(VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy) -SET(vtkWrapIDL_CPPFLAGS - -I${CMAKE_SOURCE_DIR}/src/ParaView - -I${CMAKE_BINARY_DIR}/idl - ${PARAVIEW_INCLUDES} - ${VTK_INCLUDES} -) - -# hints: $(PVHOME)/lib/paraview-$(PVVERSION)/hints $(srcdir)/hints_paravis -# @$(srcdir)/create_hints.sh $(PVHOME)/lib/paraview-$(PVVERSION) - -# $(srcdir)/wrap.am: $(top_srcdir)/wrapfiles.txt -# @cd $(srcdir) && $(srcdir)/create_wrap.sh - -# include $(srcdir)/wrap.am INCLUDE(wrap.cmake) -SET(BASEIDL_FILES - PARAVIS_Gen_Types.idl - PARAVIS_Gen.idl -) -SET(BASEIDL_SK_FILES - PARAVIS_Gen_TypesSK.cc - PARAVIS_GenSK.cc -) - -SET(IDL_FILES - ${BASEIDL_FILES} - ${WRAP_IDL} -) - -# This variable defines the files to be installed -SET(dist_salomeidl_DATA - ${IDL_FILES} -) - -# PARAVIS idl common library -SET(lib_LTLIBRARIES - libSalomeIDLPARAVIS.la -) - -# Sources built from idl files -SET(nodist_libSalomeIDLPARAVIS_la_SOURCES - ${BASEIDL_SK_FILES} - ${WRAP_SK_FILES} -) -# header files must be exported: other modules have to use this library -SET(nodist_salomeinclude_HEADERS -# ${BASEIDL_FILES:%.idl=%.hh} -# ${WRAP_IDL:%.idl=%.hh} -) - -SET(libSalomeIDLPARAVIS_la_CPPFLAGS - -I${CMAKE_BINARY_DIR}/salome_adm/unix - -I${CMAKE_BINARY_DIR}/idl - ${CORBA_CXXFLAGS} - ${CORBA_INCLUDES} - ${KERNEL_CXXFLAGS} -) -SET(VERSION_INFO 0.0.0) -SET(SOVERSION_INFO 0) -SET(libSalomeIDLPARAVIS_la_LDFLAGS - -no-undefined -) -SET(libSalomeIDLPARAVIS_la_LIBADD - ${CORBA_LIBS} -) +SET(BASEIDL_FILES + PARAVIS_Gen_Types.idl + PARAVIS_Gen.idl + ) -# These variables defines the building process of CORBA files -SET(OMNIORB_IDL - ${OMNIORB_IDL} -) -SET(OMNIORB_IDLCXXFLAGS - ${OMNIORB_IDLCXXFLAGS} -) -SET(OMNIORB_IDLPYFLAGS - ${OMNIORB_IDLPYFLAGS} - -I${KERNEL_ROOT_DIR}/idl/salome -) -SET(IDLCXXFLAGS - -bcxx - ${IDLCXXFLAGS} - -I${CMAKE_CURRENT_SOURCE_DIR} - -I${KERNEL_ROOT_DIR}/idl/salome - -I${CMAKE_BINARY_DIR}/salome_adm/unix -) -SET(IDLPYFLAGS - -bpythonIDL - -nf - -p${CMAKE_CURRENT_SOURCE_DIR} - -I${CMAKE_CURRENT_SOURCE_DIR} - -I${KERNEL_ROOT_DIR}/idl/salome -) +SET(BASEIDL_SK_FILES + PARAVIS_Gen_TypesSK.cc + PARAVIS_GenSK.cc + ) # potential problem on parallel make on the following - multiple outputs SET(SUFFIXES - .idl - .hh - SK.cc -) -# .idlSK.cc: -# $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< -# .idl.hh: -# $(OMNIORB_IDL) $(IDLCXXFLAGS) $(OMNIORB_IDLCXXFLAGS) $< - -# install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%) $(WRAP_IDL) -# $(INSTALL) -d $(DESTDIR)$(salomepythondir) -# ls $^ | while read file; do $(OMNIORB_IDL) $(IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; done - -# uninstall-local removes too much, but it works in distcheck -# uninstall-local: -# rm -rf $(DESTDIR)$(salomepythondir)/* - -# mostlyclean-local: clean-idls - -# clean-idls: -# @find . \( -name "*.hh" -or -name "*.cc" -or -name ".depidl" -or -name "*.idl" \) -exec rm -f {} \; -# -rm -f hints vtkWrapIDL.h - -# we use cpp to generate dependencies between idl files. -# option x c tells the preprocessor to consider idl as a c file. -# if an idl is modified, all idl dependencies are rebuilt - -# .depidl: $(BASEIDL_FILES) -# @echo "" > $@ -# @for dep in $^ dummy; do if [ $$dep != "dummy" ]; then echo Building dependencies for $$dep; $(CPP) $(C_DEPEND_FLAG) $(C_WRAP_IDL_FLAG) -x c -I$(srcdir) -I$(KERNEL_ROOT_DIR)/idl/salome $$dep 2>/dev/null | sed 's/\.o/\SK.cc/' >>$@; fi; done ; - -# -include .depidl - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - - - FOREACH(amname ${lib_LTLIBRARIES}) - - - STRING(REPLACE .la _la amname ${amname}) - - - STRING(LENGTH ${amname} len) - MATH(EXPR newlen "${len}-3") - STRING(SUBSTRING ${amname} 0 ${newlen} name) - - - STRING(REGEX MATCH "^lib" BEGIN_WITH_lib ${name}) - IF(BEGIN_WITH_lib) - STRING(LENGTH ${name} len) - MATH(EXPR newlen "${len}-3") - STRING(SUBSTRING ${name} 3 ${newlen} name) - ENDIF(BEGIN_WITH_lib) - - - STRING(REGEX MATCH "IDL" ISIDL ${name}) - - - IF(ISIDL) - IF(WINDOWS) - SET(type STATIC) - ELSE(WINDOWS) - SET(type SHARED) - ENDIF(WINDOWS) - ELSE(ISIDL) - SET(type SHARED) - ENDIF(ISIDL) - - - SET(srcs) - FOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) - GET_FILENAME_COMPONENT(ext ${src} EXT) - IF(ext STREQUAL .f) - IF(src STREQUAL trte.f) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) - STRING(REPLACE ".f" ".c" src ${src}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) - SET(output ${src}) - ADD_CUSTOM_COMMAND( - OUTPUT ${output} - COMMAND f2c ${input} - MAIN_DEPENDENCY ${input} - ) - ELSE(src STREQUAL trte.f) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) - STRING(REPLACE ".f" ".o" src ${src}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) - SET(output ${src}) - IF(WINDOWS) - SET(F77 g77) - ELSE(WINDOWS) - SET(F77 gfortran) - ENDIF(WINDOWS) - ADD_CUSTOM_COMMAND( - OUTPUT ${output} - COMMAND ${F77} -c -o ${output} ${input} - MAIN_DEPENDENCY ${input} - ) - ENDIF(src STREQUAL trte.f) - ENDIF(ext STREQUAL .f) - SET(srcs ${srcs} ${src}) - ENDFOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) - - - SET(l ${nodist_${amname}_SOURCES} ${UIC_FILES}) - FOREACH(f ${l}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${f}) - SET(srcs ${srcs} ${src}) - ENDFOREACH(f ${l}) - - - SET(build_srcs) - SET(l ${nodist_${amname}_SOURCES} ${BUILT_SOURCES}) - FOREACH(f ${l}) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - ELSE(ext STREQUAL .py) - SET(build_srcs ${build_srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f}) - ENDIF(ext STREQUAL .py) - ENDFOREACH(f ${l}) - - - ADD_LIBRARY(${name} ${type} ${srcs}) - - - SET(var) - IF(WINDOWS) - SET(targets) - SET(targets ${targets} SalomeIDLKernel) - SET(targets ${targets} SalomeDS) - SET(targets ${targets} SALOMEDSTest) - SET(targets ${targets} SALOMEDS_Client_exe) - SET(targets ${targets} SalomeIDLGEOM) - SET(targets ${targets} GEOMEngine) - SET(targets ${targets} MEDEngine) - SET(targets ${targets} SMESHEngine) - SET(targets ${targets} SMESH) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(var ${var} -DNOGDI) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(var ${var} -I${dir}) - SET(var ${var} -DF2C_BUILD) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(var ${var} ${AM_CPPFLAGS}) - SET(var ${var} ${AM_CXXFLAGS}) - - - SET(var ${var} ${PLATFORM_CPPFLAGS}) - SET(var ${var} ${PTHREAD_CFLAGS}) - SET(var ${var} ${${amname}_CPPFLAGS}) - SET(var ${var} ${${amname}_CXXFLAGS}) - SET(var ${var} ${${amname}_CFLAGS}) - SET(vars) - IF(WINDOWS) - SET(vars ${vars} -include SALOMEconfig.h) - SET(vars ${vars} -ftemplate-depth-32) - SET(vars ${vars} -fPIC) - SET(vars ${vars} -g) - ENDIF(WINDOWS) - SET(flags) - FOREACH(f ${var}) - FOREACH(v ${vars}) - IF(f STREQUAL v) - SET(f) - ENDIF(f STREQUAL v) - ENDFOREACH(v ${vars}) - SET(flags "${flags} ${f}") - ENDFOREACH(f ${var}) - SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") - - - SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) - - - SET(libadd) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(libadd ${libadd} ${dir}/LIBF77.lib) - SET(libadd ${libadd} ${dir}/LIBI77.lib) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) - FOREACH(lib SALOMEBasics SalomeBatch) - IF(name STREQUAL lib) - SET(libs ${libs} ${PTHREAD_LIBS}) - ENDIF(name STREQUAL lib) - ENDFOREACH(lib SALOMEBasics SalomeBatch) - - - FOREACH(lib ${libs}) - GET_FILENAME_COMPONENT(ext ${lib} EXT) - IF(ext STREQUAL .la) - GET_FILENAME_COMPONENT(lib ${lib} NAME_WE) - STRING(REGEX REPLACE "^lib" "" lib ${lib}) - ENDIF(ext STREQUAL .la) - SET(vars) - SET(vars ${vars} -no-undefined) - SET(vars ${vars} -lvtkWidgets) - IF(WINDOWS) - SET(vars ${vars} -module) - SET(vars ${vars} -Wl,-E) - SET(vars ${vars} -Xlinker) - SET(vars ${vars} -export-dynamic) - SET(vars ${vars} -lm) - SET(vars ${vars} -lboost_thread) - SET(vars ${vars} -lboost_signals) - SET(vars ${vars} -pthread -lpthread -ldl) - ENDIF(WINDOWS) - FOREACH(v ${vars}) - IF(lib STREQUAL v) - SET(lib) - ENDIF(lib STREQUAL v) - ENDFOREACH(v ${vars}) - SET(libadd ${libadd} ${lib}) - ENDFOREACH(lib ${libs}) - TARGET_LINK_LIBRARIES(${name} ${libadd}) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - IF(CMAKE_BUILD_TYPE STREQUAL Debug) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(DEST lib/salome) - - - IF(BEGIN_WITH_lib) - INSTALL(TARGETS ${name} DESTINATION ${DEST}) - - - ELSE(BEGIN_WITH_lib) - - - IF(WINDOWS) - INSTALL(TARGETS ${name} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome/${name}.dll DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.pyd) - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome/${name}.dll DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}_d.pyd) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) - ELSE(WINDOWS) - GET_TARGET_PROPERTY(version ${name} VERSION) - GET_TARGET_PROPERTY(soversion ${name} SOVERSION) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so.${version}) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so.${soversion}) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so) - ENDIF(WINDOWS) - - - ENDIF(BEGIN_WITH_lib) - - - ENDFOREACH(amname ${lib_LTLIBRARIES}) - - - FOREACH(amname ${bin_PROGRAMS} ${check_PROGRAMS}) - - - SET(name "${amname}_exe") - SET(srcs ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) - SET(l ${nodist_${amname}_SOURCES}) - FOREACH(f ${l}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${f}) - SET(srcs ${srcs} ${src}) - ENDFOREACH(f ${l}) - LIST(LENGTH srcs nb) - IF(nb) - ADD_EXECUTABLE(${name} ${srcs}) - - - SET(var) - IF(WINDOWS) - SET(targets) - SET(targets ${targets} SalomeIDLKernel) - SET(targets ${targets} SalomeDS) - SET(targets ${targets} SALOMEDSTest) - SET(targets ${targets} SALOMEDS_Client_exe) - SET(targets ${targets} SalomeIDLGEOM) - SET(targets ${targets} GEOMEngine) - SET(targets ${targets} MEDEngine) - SET(targets ${targets} SMESHEngine) - SET(targets ${targets} SMESH) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(var ${var} -DNOGDI) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(var ${var} -I${dir}) - SET(var ${var} -DF2C_BUILD) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(var ${var} ${AM_CPPFLAGS}) - SET(var ${var} ${AM_CXXFLAGS}) - - - SET(var ${var} ${PLATFORM_CPPFLAGS}) - SET(var ${var} ${PTHREAD_CFLAGS}) - SET(var ${var} ${${amname}_CPPFLAGS}) - SET(var ${var} ${${amname}_CXXFLAGS}) - SET(var ${var} ${${amname}_CFLAGS}) - SET(vars) - IF(WINDOWS) - SET(vars ${vars} -include SALOMEconfig.h) - SET(vars ${vars} -ftemplate-depth-32) - SET(vars ${vars} -fPIC) - SET(vars ${vars} -g) - ENDIF(WINDOWS) - SET(flags) - FOREACH(f ${var}) - FOREACH(v ${vars}) - IF(f STREQUAL v) - SET(f) - ENDIF(f STREQUAL v) - ENDFOREACH(v ${vars}) - SET(flags "${flags} ${f}") - ENDFOREACH(f ${var}) - SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") - - - SET(libadd) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(libadd ${libadd} ${dir}/LIBF77.lib) - SET(libadd ${libadd} ${dir}/LIBI77.lib) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) - FOREACH(lib SALOMEBasics SalomeBatch) - IF(name STREQUAL lib) - SET(libs ${libs} ${PTHREAD_LIBS}) - ENDIF(name STREQUAL lib) - ENDFOREACH(lib SALOMEBasics SalomeBatch) - - - SET(libs ${libs} ${LDADD}) - - - FOREACH(lib ${libs}) - GET_FILENAME_COMPONENT(ext ${lib} EXT) - IF(ext STREQUAL .la) - GET_FILENAME_COMPONENT(lib ${lib} NAME_WE) - STRING(REGEX REPLACE "^lib" "" lib ${lib}) - ENDIF(ext STREQUAL .la) - SET(vars) - SET(vars ${vars} -no-undefined) - SET(vars ${vars} -lvtkWidgets) - IF(WINDOWS) - SET(vars ${vars} -module) - SET(vars ${vars} -Wl,-E) - SET(vars ${vars} -Xlinker) - SET(vars ${vars} -export-dynamic) - SET(vars ${vars} -lm) - SET(vars ${vars} -lboost_thread) - SET(vars ${vars} -lboost_signals) - SET(vars ${vars} -pthread -lpthread -ldl) - ENDIF(WINDOWS) - FOREACH(v ${vars}) - IF(lib STREQUAL v) - SET(lib) - ENDIF(lib STREQUAL v) - ENDFOREACH(v ${vars}) - SET(libadd ${libadd} ${lib}) - ENDFOREACH(lib ${libs}) - TARGET_LINK_LIBRARIES(${name} ${libadd}) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - IF(CMAKE_BUILD_TYPE STREQUAL Debug) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(DEST bin/salome) - - - IF(WINDOWS) - INSTALL(TARGETS ${name} DESTINATION ${DEST}) - INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${DEST}/${name}.exe DESTINATION ${DEST} RENAME ${amname}.exe) - INSTALL(CODE "FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${name}.exe)") - ELSE(WINDOWS) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name} DESTINATION ${DEST} PERMISSIONS ${PERMS} RENAME ${amname}) - ENDIF(WINDOWS) - - - ENDIF(nb) - - - ENDFOREACH(amname ${bin_PROGRAMS} ${check_PROGRAMS}) - - - FOREACH(input ${IDL_FILES}) - STRING(REGEX REPLACE ".idl" "" base ${input}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${base}SK.cc) - SET(outputs ${src}) - SET(dynsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}DynSK.cc) - SET(outputs ${outputs} ${dynsrc}) - SET(inc ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh) - SET(outputs ${outputs} ${inc}) - IF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${input}) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) - ELSE(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${input}) - SET(input ${CMAKE_CURRENT_BINARY_DIR}/${input}) - ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${input}) - SET(flags ${IDLCXXFLAGS} ${OMNIORB_IDLCXXFLAGS}) - STRING(REGEX MATCH "-bcxx" ISBCXX ${flags}) - IF(NOT ISBCXX) - SET(flags -bcxx ${flags}) - ENDIF(NOT ISBCXX) - ADD_CUSTOM_COMMAND( - OUTPUT ${outputs} - COMMAND ${OMNIORB_IDL} ${flags} ${input} - MAIN_DEPENDENCY ${input} - ) - install(FILES ${input} DESTINATION idl/salome) - SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh) - install(FILES ${IDL_HEADER} DESTINATION include/salome) - INSTALL(CODE "SET(IDL_FILE ${input})") - INSTALL(CODE "SET(DIR lib/python${PYTHON_VERSION}/site-packages/salome)") - INSTALL(CODE "SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})") - INSTALL(CODE "SET(OMNIORB_IDL_PYTHON ${OMNIORB_IDL_PYTHON})") - # -- - SET(flags) - FOREACH(f ${IDLPYFLAGS}) - SET(flags "${flags} ${f}") - ENDFOREACH(f ${IDLPYFLAGS}) - STRING(REGEX MATCH "-bpython" ISBPYTHON ${flags}) - IF(NOT ISBPYTHON) - SET(flags "-bpython ${flags}") - ENDIF(NOT ISBPYTHON) - SET(IDLPYFLAGS ${flags}) - STRING(REPLACE "\\" "/" IDLPYFLAGS ${IDLPYFLAGS}) - INSTALL(CODE "SET(IDLPYFLAGS ${IDLPYFLAGS})") - # -- - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_python_from_idl.cmake) - - - ENDFOREACH(input ${IDL_FILES}) - + .idl + .hh + SK.cc + ) + +SET(srcs) +FOREACH(f ${BASEIDL_SK_FILES} ${WRAP_SK_FILES}) + SET(srcs ${srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f}) +ENDFOREACH(f ${BASEIDL_SK_FILES} ${WRAP_SK_FILES}) + +IF(WINDOWS) +ADD_LIBRARY(SalomeIDLPARAVIS STATIC ${srcs}) +ELSE(WINDOWS) +ADD_LIBRARY(SalomeIDLPARAVIS SHARED ${srcs}) +ENDIF(WINDOWS) + +SET(flags) +FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${CORBA_INCLUDES} ${CORBA_CXXFLAGS} ${KERNEL_CXXFLAGS}) + SET(flags "${flags} ${f}") +ENDFOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${CORBA_INCLUDES} ${CORBA_CXXFLAGS} ${KERNEL_CXXFLAGS}) + +SET_TARGET_PROPERTIES(SalomeIDLPARAVIS PROPERTIES COMPILE_FLAGS "${flags}") +SET_TARGET_PROPERTIES(SalomeIDLPARAVIS PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) + +TARGET_LINK_LIBRARIES(SalomeIDLPARAVIS ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${CORBA_LIBS}) +INSTALL(TARGETS SalomeIDLPARAVIS DESTINATION lib/salome) + +ADD_EXECUTABLE(vtkWrapIDL + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParse.tab.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParsePreprocess.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseHierarchy.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseExtras.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseMain.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkWrap.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkWrapText.c + ${CMAKE_CURRENT_SOURCE_DIR}/vtkWrapIDL.c) + +ADD_DEPENDENCIES(vtkWrapIDL generate_txt) + +INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/ParaView) +SET(flags) +FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${PARAVIEW_INCLUDES} ${VTK_INCLUDES}) + SET(flags "${flags} ${f}") +ENDFOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${PARAVIEW_INCLUDES} ${VTK_INCLUDES}) + +SET_TARGET_PROPERTIES(vtkWrapIDL PROPERTIES COMPILE_FLAGS "${flags}") + +TARGET_LINK_LIBRARIES(vtkWrapIDL ${PLATFORM_LDFLAGS} ${PLATFORM_LIBADD}) +SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL) +IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) +ENDIF(WINDOWS) +INSTALL(FILES ${vtkWrapIDL_EXEFILE} DESTINATION bin/salome PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + +FOREACH(input ${BASEIDL_FILES} ${WRAP_IDL}) + STRING(REGEX REPLACE ".idl" "" base ${input}) + SET(src ${CMAKE_CURRENT_BINARY_DIR}/${base}SK.cc) + SET(outputs ${src}) + SET(dynsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}DynSK.cc) + SET(outputs ${outputs} ${dynsrc}) + SET(inc ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh) + SET(outputs ${outputs} ${inc}) + LIST(FIND BASEIDL_FILES ${input} BASE_INDEX) + IF(${BASE_INDEX} EQUAL -1) + SET(input ${CMAKE_CURRENT_BINARY_DIR}/${input}) + ELSE(${BASE_INDEX} EQUAL -1) + SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) + ENDIF(${BASE_INDEX} EQUAL -1) + ADD_CUSTOM_COMMAND( + OUTPUT ${outputs} + COMMAND ${OMNIORB_IDL} -bcxx ${IDLCXXFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR} -I${KERNEL_ROOT_DIR}/idl/salome ${OMNIORB_IDLCXXFLAGS} ${input} + MAIN_DEPENDENCY ${input} + ) + INSTALL(FILES ${input} DESTINATION idl/salome) + + SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh) + INSTALL(FILES ${IDL_HEADER} DESTINATION include/salome) + INSTALL(CODE "SET(IDL_FILE ${input})") + INSTALL(CODE "SET(DIR lib/python${PYTHON_VERSION}/site-packages/salome)") + INSTALL(CODE "SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})") + INSTALL(CODE "SET(OMNIORB_IDL_PYTHON ${OMNIORB_IDL_PYTHON})") + INSTALL(CODE "SET(IDLPYFLAGS -bpythonIDL -p${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR} -I${KERNEL_ROOT_DIR}/idl/salome)") + INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_python_from_idl.cmake) + +ENDFOREACH(input ${IDL_FILES}) diff --git a/idl/PARAVIS_Gen.idl b/idl/PARAVIS_Gen.idl index ed39460b..d9f8bbe9 100644 --- a/idl/PARAVIS_Gen.idl +++ b/idl/PARAVIS_Gen.idl @@ -1,27 +1,23 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : PARAVIS_Gen.idl // Author : Vitaly Smetannikov -// /*! \file PARAVIS_Gen.idl This file conatins a set of interfaces of the %PARAVIS module. * This module provides access to PARAVIEW functionality integrated to %SALOME application. @@ -58,7 +54,7 @@ module PARAVIS { * \brief The main interface class for PARAVIS server. * Instantiation of this class has to be done before access to any other PARAVIS interfaces */ - interface PARAVIS_Gen : Engines::Component, SALOMEDS::Driver + interface PARAVIS_Gen : Engines::EngineComponent, SALOMEDS::Driver { /*! * \brief Returns IOR of the current object. @@ -72,6 +68,8 @@ module PARAVIS { void ImportFile(in string theFileName); + void ExecuteScript(in string script); + /*! * Returns trace string if trace is activated for current session. * Otherwise it returns empty string. @@ -113,6 +111,15 @@ module PARAVIS { */ void ActivateModule(); + + /*! Sets a definite study to be current. + */ + void SetCurrentStudy(in SALOMEDS::Study theStudy); + + /*! Gets the current study. + */ + SALOMEDS::Study GetCurrentStudy(); + }; }; diff --git a/idl/PARAVIS_Gen_Types.idl b/idl/PARAVIS_Gen_Types.idl index 132fe4f8..4edacdef 100644 --- a/idl/PARAVIS_Gen_Types.idl +++ b/idl/PARAVIS_Gen_Types.idl @@ -1,23 +1,20 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : PARAVIS_Gen.idl // Author : Vladimir Turin @@ -42,6 +39,7 @@ module PARAVIS { typedef sequence long_array; typedef sequence float_array; typedef sequence double_array; + typedef sequence char_array; }; diff --git a/idl/create_header.py b/idl/create_header.py new file mode 100755 index 00000000..46573a1e --- /dev/null +++ b/idl/create_header.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +import sys +import os + +ffile = "vtkWrapIDL.h" +wfile = os.path.join(sys.argv[1], "wrapfiles.txt") + +ffile_stream = open(ffile, "w") +ffile_stream.write('const char* wrapped_classes[] = {') +ffile_stream.write('\n') +wfile_stream = open(wfile) +for line in wfile_stream: + ffile_stream.write('"'+line.split()[0]+'",') + ffile_stream.write('\n') + pass +wfile_stream.close() +ffile_stream.write('""') +ffile_stream.write('\n') +ffile_stream.write('};') +ffile_stream.write('\n') +ffile_stream.close() diff --git a/idl/create_header.sh b/idl/create_header.sh index 27e74c2d..954528a7 100755 --- a/idl/create_header.sh +++ b/idl/create_header.sh @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + #!/bin/bash file=vtkWrapIDL.h diff --git a/idl/create_hints.py b/idl/create_hints.py new file mode 100755 index 00000000..31addda5 --- /dev/null +++ b/idl/create_hints.py @@ -0,0 +1,38 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +import sys +import os + +CONF_DIR = os.path.dirname(sys.argv[0]) + +content = "" +for filename in [ + os.path.join(sys.argv[1], "hints"), + os.path.join(CONF_DIR, "hints_paravis"), + ]: + stream = open(filename) + content += stream.read() + stream.close() + pass + +filename = "hints" +stream = open(filename, "w") +stream.write(content) +stream.close() diff --git a/idl/create_hints.sh b/idl/create_hints.sh index c9e65b05..85a8c980 100755 --- a/idl/create_hints.sh +++ b/idl/create_hints.sh @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + #!/bin/bash CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` diff --git a/idl/vtkWrapIDL.c b/idl/vtkWrapIDL.c index 6e8aa070..11e33cd8 100644 --- a/idl/vtkWrapIDL.c +++ b/idl/vtkWrapIDL.c @@ -1,7 +1,6 @@ // PARAVIS : ParaView wrapper SALOME module // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2010-2012 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 @@ -27,7 +26,9 @@ #include #include #include "vtkParse.h" +#include "vtkParseType.h" #include "vtkWrapIDL.h" +#include "vtkWrap.h" char* Copyright[] = { "// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,", @@ -51,12 +52,13 @@ char* Copyright[] = { "" }; -#define bs 8192 +#define bs 12288 int numberOfWrappedFunctions = 0; FunctionInfo *wrappedFunctions[1000]; extern FunctionInfo *currentFunction; + static void add_to_sig(char *sig, const char *add, int *i) { strcpy(&sig[*i],add); @@ -71,7 +73,12 @@ void AddReturnArg(char *Result, int *CurrPos) { add_to_sig(Result,"virtual ",CurrPos); } -void AddNotReturnArg(int Type, char *Result, int *CurrPos) { +int IsIn(ValueInfo* Type) { + return 1; + //return ((Type % VTK_PARSE_BASE_TYPE)/0x100 < 1 || (Type % VTK_PARSE_BASE_TYPE)/0x100 > 7); +} + +void AddNotReturnArg(ValueInfo* Type, char *Result, int *CurrPos) { #if defined(IDL_I_HH) || defined(IDL_I_CC) ; #else @@ -82,12 +89,14 @@ void AddNotReturnArg(int Type, char *Result, int *CurrPos) { #endif } -int IsFunction(int Type) { - return (Type == 0x5000); +int IsFunction(ValueInfo* Type) { + //return (Type == VTK_PARSE_FUNCTION); + return vtkWrap_IsFunction(Type); } -int IsConst(int Type) { - return ((Type % 0x2000) >= 0x1000); +int IsConst(ValueInfo* Type) { + //return ((Type % 0x2000) >= 0x1000); + return vtkWrap_IsConst(Type); } void AddConst(char *Result, int *CurrPos) { @@ -98,20 +107,29 @@ void AddConst(char *Result, int *CurrPos) { #endif } -int IsPtr(int Type) { - return ((Type % 0x1000)/0x100 == 0x1); + +int IsClass(ValueInfo* theType) { + //return ((theType->Type % 0x10) == 0x9); + return vtkWrap_IsObject(theType) || vtkWrap_IsVTKObject(theType); } -int IsIn(int Type) { - return 1; - //return ((Type % 0x1000)/0x100 < 1 || (Type % 0x1000)/0x100 > 7); +int IsString(ValueInfo* Type) { + //return (IsChar(Type) && IsArray(Type)); + //return (IsChar(Type) && IsPtr(Type)); + return vtkWrap_IsCharPointer(Type) || vtkWrap_IsString(Type) || (strcmp(Type->Class, "vtkStdString") == 0); } -int IsUnknown(int Type) { - return ((Type % 0x1000)/0x100 == 0x8); +int IsPtr(ValueInfo* Type) { + //return ((Type % VTK_PARSE_BASE_TYPE)/0x100 == 0x1); + return vtkWrap_IsPointer(Type) && (!IsString(Type)) && (!IsClass(Type)); } -void AddAtomArg(int I, int Type, char *TypeIDL, char *TypeCorba, char *Result, int *CurrPos) { +int IsUnknown(ValueInfo* theType) { + //return ((Type % VTK_PARSE_BASE_TYPE)/0x100 == 0x8); + return (theType->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_UNKNOWN; +} + +void AddAtomArg(int I, ValueInfo* Type, char *TypeIDL, char *TypeCorba, char *Result, int *CurrPos) { #if defined(IDL_I_HH) || defined(IDL_I_CC) add_to_sig(Result,"CORBA::",CurrPos); add_to_sig(Result,TypeCorba,CurrPos); @@ -124,11 +142,12 @@ void AddAtomArg(int I, int Type, char *TypeIDL, char *TypeCorba, char *Result, i add_to_sig(Result," ",CurrPos); } -int IsArray(int Type) { - return ((Type % 0x1000)/0x100 == 0x3); +int IsArray(ValueInfo* Type) { + //return ((Type % VTK_PARSE_BASE_TYPE)/0x100 == 0x3); + return vtkWrap_IsArray(Type); } -void AddArrayArg(int I, int Type, char *TypeIDL, char *Result, int *CurrPos) { +void AddArrayArg(int I, ValueInfo* Type, char *TypeIDL, char *Result, int *CurrPos) { #if defined(IDL_I_HH) || defined(IDL_I_CC) if(!IsReturnArg(I) && !IsConst(Type)) add_to_sig(Result, "const ",CurrPos); @@ -146,24 +165,27 @@ void AddArrayArg(int I, int Type, char *TypeIDL, char *Result, int *CurrPos) { add_to_sig(Result, " ",CurrPos); } -int IsBoolean(int Type) { - return ((Type % 0x10) == 0xE); +int IsBoolean(ValueInfo* Type) { + //return ((Type % 0x10) == 0xE); + return vtkWrap_IsBool(Type); } -void AddBooleanAtomArg(int I, int Type, char *Result, int *CurrPos) { +void AddBooleanAtomArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddAtomArg(I,Type,"boolean","Boolean",Result,CurrPos); } -int IsChar(int Type) { - return ((Type % 0x10) == 0x3 || (Type % 0x10) == 0xD); +int IsChar(ValueInfo* theType) { + //return ((Type % 0x10) == 0x3 || (Type % 0x10) == 0xD); + int aBase = theType->Type & VTK_PARSE_BASE_TYPE; + return (aBase == VTK_PARSE_CHAR) || (aBase == VTK_PARSE_UNSIGNED_CHAR) || (aBase == VTK_PARSE_SIGNED_CHAR); } -void AddCharAtomArg(int I, int Type, char *Result, int *CurrPos) { - AddAtomArg(I,Type,"char","Char",Result,CurrPos); +int IsCharArray(ValueInfo* theType) { + return (IsChar(theType) && IsArray(theType)); } -int IsString(Type) { - return (IsChar(Type) && IsArray(Type)); +void AddCharAtomArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { + AddAtomArg(I,Type,"char","Char",Result,CurrPos); } void AddStringArg(int I, char *Result, int *CurrPos) { @@ -174,79 +196,86 @@ void AddStringArg(int I, char *Result, int *CurrPos) { #endif } -int IsFloat(int Type) { - return ((Type % 0x10) == 0x1); +int IsFloat(ValueInfo* theType) { + //return ((Type % 0x10) == 0x1); + return (theType->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_FLOAT; } -void AddFloatAtomArg(int I, int Type, char *Result, int *CurrPos) { +void AddFloatAtomArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddAtomArg(I,Type,"float","Float",Result,CurrPos); } -int IsFloatArray(int Type) { - return (IsFloat(Type) && IsArray(Type)); +int IsFloatArray(ValueInfo* theType) { + return (IsFloat(theType) && IsArray(theType)); } -void AddFloatArrayArg(int I, int Type, char *Result, int *CurrPos) { +void AddFloatArrayArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddArrayArg(I,Type,"float",Result,CurrPos); } -int IsDouble(int Type) { - return ((Type % 0x10) == 0x7); +int IsDouble(ValueInfo* theType) { + //return ((Type % 0x10) == 0x7); + return (theType->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_DOUBLE; } -void AddDoubleAtomArg(int I, int Type, char *Result, int *CurrPos) { +void AddDoubleAtomArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddAtomArg(I,Type,"double","Double",Result,CurrPos); } -int IsDoubleArray(int Type) { +int IsDoubleArray(ValueInfo* Type) { return (IsDouble(Type) && IsArray(Type)); } -void AddDoubleArrayArg(int I, int Type, char *Result, int *CurrPos) { +void AddDoubleArrayArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddArrayArg(I,Type,"double",Result,CurrPos); } -int IsvtkIdType(int Type) { - return((Type % 0x10) == 0xA); +int IsvtkIdType(ValueInfo* theType) { + //return((Type % 0x10) == 0xA); + return (theType->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_ID_TYPE; } -int IsShort(int Type) { - return ((Type % 0x10) == 0x4 || (Type % 0x10) == 0x5 || (Type % 0x10) == 0xA); +int IsShort(ValueInfo* theType) { + //return ((Type % 0x10) == 0x4 || (Type % 0x10) == 0x5 || (Type % 0x10) == 0xA); + int aVal = theType->Type & VTK_PARSE_BASE_TYPE; + return (aVal == VTK_PARSE_SHORT) || (aVal == VTK_PARSE_INT) || + (aVal == VTK_PARSE_ID_TYPE) || (aVal == VTK_PARSE_UNSIGNED_INT) || (aVal == VTK_PARSE_UNSIGNED_SHORT) || + (aVal == VTK_PARSE_SSIZE_T) || (aVal == VTK_PARSE_SIZE_T); } -void AddShortAtomArg(int I, int Type, char *Result, int *CurrPos) { +void AddShortAtomArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddAtomArg(I,Type,"short","Short",Result,CurrPos); } -int IsShortArray(int Type) { +int IsShortArray(ValueInfo* Type) { return (IsShort(Type) && IsArray(Type)); } -void AddShortArrayArg(int I, int Type, char *Result, int *CurrPos) { +void AddShortArrayArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddArrayArg(I,Type,"short",Result,CurrPos); } -int IsLong(int Type) { - return ((Type % 0x10) == 0x6 || (Type % 0x10) == 0xB || (Type % 0x10) == 0xC); +int IsLong(ValueInfo* theType) { + //return ((Type % 0x10) == 0x6 || (Type % 0x10) == 0xB || (Type % 0x10) == 0xC); + unsigned int aVal = theType->Type & VTK_PARSE_BASE_TYPE; + return (aVal == VTK_PARSE_LONG) || (aVal == VTK_PARSE_UNSIGNED_LONG) || + (aVal == VTK_PARSE___INT64) || (aVal == VTK_PARSE_UNSIGNED___INT64) || (aVal == VTK_PARSE_LONG_LONG) || + (aVal == VTK_PARSE_UNSIGNED_LONG_LONG); } -void AddLongAtomArg(int I, int Type, char *Result, int *CurrPos) { +void AddLongAtomArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddAtomArg(I,Type,"long","Long",Result,CurrPos); } -int IsLongArray(int Type) { +int IsLongArray(ValueInfo* Type) { return (IsLong(Type) && IsArray(Type)); } -void AddLongArrayArg(int I, int Type, char *Result, int *CurrPos) { +void AddLongArrayArg(int I, ValueInfo* Type, char *Result, int *CurrPos) { AddArrayArg(I,Type,"long",Result,CurrPos); } -int IsClass(int Type) { - return ((Type % 0x10) == 0x9); -} - -void AddClassArg(int I, int Type, char *Class, char *Result, int *CurrPos) { +void AddClassArg(int I, ValueInfo* Type, const char *Class, char *Result, int *CurrPos) { #if defined(IDL_I_HH) || defined(IDL_I_CC) add_to_sig(Result,"PARAVIS_Base",CurrPos); if(IsReturnArg(I) || IsConst(Type) || IsIn(Type)) { @@ -260,23 +289,46 @@ void AddClassArg(int I, int Type, char *Class, char *Result, int *CurrPos) { #endif } -int _IsVoid(int Type) { - return ((Type % 0x10) == 0x2); +int _IsVoid(ValueInfo* theType) { + //return ((Type % 0x10) == 0x2); + return (theType->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_VOID; } -int IsVoid(int Type) { +int IsVoid(ValueInfo* Type) { return (_IsVoid(Type) && (!IsPtr(Type))); } +int IsUnsigned(ValueInfo* theType) { + unsigned int aVal = theType->Type & VTK_PARSE_BASE_TYPE; + switch (aVal) { + case VTK_PARSE_UNSIGNED_CHAR: + case VTK_PARSE_UNSIGNED_INT: + case VTK_PARSE_UNSIGNED_SHORT: + case VTK_PARSE_UNSIGNED_LONG: + case VTK_PARSE_UNSIGNED_ID_TYPE: + case VTK_PARSE_UNSIGNED_LONG_LONG: + case VTK_PARSE_UNSIGNED___INT64: + case VTK_PARSE_UNSIGNED_CHAR_PTR: + case VTK_PARSE_UNSIGNED_INT_PTR: + case VTK_PARSE_UNSIGNED_SHORT_PTR: + case VTK_PARSE_UNSIGNED_LONG_PTR: + case VTK_PARSE_UNSIGNED_ID_TYPE_PTR: + case VTK_PARSE_UNSIGNED_LONG_LONG_PTR: + case VTK_PARSE_UNSIGNED___INT64_PTR: + return 1; + } + return 0; +} + void AddVoid(char *Result, int *CurrPos) { add_to_sig(Result,"void ",CurrPos); } -int IsVoidPtr(int Type) { +int IsVoidPtr(ValueInfo* Type) { return (_IsVoid(Type) && (IsPtr(Type) || IsArray(Type))); } -void AddVoidArg(int I, char *Result, int *CurrPos, int Type) { +void AddVoidArg(int I, char *Result, int *CurrPos, ValueInfo* Type) { #if defined(IDL_I_HH) || defined(IDL_I_CC) if(!IsReturnArg(I)) { if(!IsConst(Type)) @@ -290,7 +342,7 @@ void AddVoidArg(int I, char *Result, int *CurrPos, int Type) { #endif } -void AddTypeArray(int Type, char *Result, int *CurrPos) { +void AddTypeArray(ValueInfo* Type, char *Result, int *CurrPos) { if(IsShort(Type)) add_to_sig(Result,"short",CurrPos); if(IsLong(Type)) @@ -299,6 +351,8 @@ void AddTypeArray(int Type, char *Result, int *CurrPos) { add_to_sig(Result,"float",CurrPos); if(IsDouble(Type)) add_to_sig(Result,"double",CurrPos); + if(IsChar(Type)) + add_to_sig(Result,"char",CurrPos); add_to_sig(Result,"_array",CurrPos); } @@ -315,8 +369,11 @@ int numberOfReadFunctions = 0; static int class_has_new = 0; -void output_type(char* result, int *currPos, int i, int aType, char *Id) +void output_type(char* result, int *currPos, int i, ValueInfo* aType, const char *Id) { + if (vtkWrap_IsConst(aType)) + add_to_sig(result,"const ",currPos); + if(IsFloat(aType)) { if(IsArray(aType)) { add_to_sig(result,"float",currPos); @@ -335,10 +392,12 @@ void output_type(char* result, int *currPos, int i, int aType, char *Id) if(IsShort(aType)) { if(IsArray(aType)) { + if (IsUnsigned(aType)) + add_to_sig(result,"unsigned ",currPos); if(IsvtkIdType(aType)) { - add_to_sig(result,"vtkIdType",currPos); + add_to_sig(result,"vtkIdType",currPos); } else { - add_to_sig(result,"int",currPos); + add_to_sig(result,"int",currPos); } } else { add_to_sig(result,"CORBA::Short",currPos); @@ -347,6 +406,8 @@ void output_type(char* result, int *currPos, int i, int aType, char *Id) if(IsLong(aType)) { if(IsArray(aType)) { + if (IsUnsigned(aType)) + add_to_sig(result,"unsigned ",currPos); add_to_sig(result,"long",currPos); } else { add_to_sig(result,"CORBA::Long",currPos); @@ -356,13 +417,13 @@ void output_type(char* result, int *currPos, int i, int aType, char *Id) if(IsChar(aType)) { if(IsString(aType)) { if(IsReturnArg(i)) - add_to_sig(result,"const ",currPos); + add_to_sig(result,"const ",currPos); add_to_sig(result,"char",currPos); } else { add_to_sig(result,"CORBA::Char",currPos); } } - + if(IsBoolean(aType)) { add_to_sig(result,"CORBA::Boolean",currPos); } @@ -381,13 +442,13 @@ void output_type(char* result, int *currPos, int i, int aType, char *Id) } } -void output_typedef(char* result, int *currPos, int i, int aType, char *Id) +void output_typedef(char* result, int *currPos, int i, ValueInfo* aType, const char *Id) { add_to_sig(result," typedef ",currPos); output_type(result,currPos,i,aType,Id); } -void output_temp(char* result, int *currPos, int i, int aType, char *Id, int aCount) +void output_temp(char* result, int *currPos, int i, ValueInfo* aType, const char *Id, int aCount) { static char buf[bs]; @@ -456,7 +517,8 @@ void output_temp(char* result, int *currPos, int i, int aType, char *Id, int aCo } else { AddCharAtomArg(i,aType,result,currPos); } - } + } else if (IsString(aType)) //!!! VSV + AddStringArg(i,result,currPos); if(IsBoolean(aType)) { AddBooleanAtomArg(i,aType,result,currPos); @@ -480,10 +542,10 @@ void output_temp(char* result, int *currPos, int i, int aType, char *Id, int aCo } #if defined(IDL_I_HH) || defined(IDL_I_CC) if(IsString(aType) && !IsIn(aType) && !IsConst(aType) && !IsReturnArg(i)) { - add_to_sig(result,"*&",currPos); + add_to_sig(result,"*&",currPos); } else { if(IsString(aType) || (IsReturnArg(i) && IsVoidPtr(aType))) { - add_to_sig(result," *",currPos); + add_to_sig(result," *",currPos); } } #endif @@ -501,10 +563,9 @@ void read_class_functions(const char* name, const char* classname, FILE* fp) { int len=0; int curlen=0; - int i; - int j; + int i, j; int flen=0; - int num=0; + //int num=0; int ret_str=0; FILE *fin; char buf[bs]; @@ -518,6 +579,7 @@ void read_class_functions(const char* name, const char* classname, FILE* fp) static int clen=7; #endif + #if defined(IDL_I_HH) sprintf(buf,"PARAVIS_Gen_%s_i.hh",name); #elif defined(IDL_I_CC) @@ -532,10 +594,10 @@ void read_class_functions(const char* name, const char* classname, FILE* fp) while (fgets(sig,bs-1,fin) != 0) { #if defined(IDL_I_CC) if(strncmp("#include \"PARAVIS_Gen_vtk",sig,25)==0) { - fprintf(fp,sig); + fprintf(fp, "%s",sig); } if(strncmp("#include 1) { + if(fgets(buf,bs-1,fin)!=NULL && strlen(buf) > 1) { ret_str=0; #if defined(IDL_I_HH) strcpy(sig+len,buf); @@ -644,18 +705,23 @@ void read_class_functions(const char* name, const char* classname, FILE* fp) return; } -void get_signature(const char* num, FileInfo *data) +void get_signature(const char* num, ClassInfo *data) { static char result[bs]; int currPos = 0; int currPos_sig = 0; - int argtype; + //int argtype; int i, j; static char buf[bs]; static char buf1[bs]; int ret = 0; int found = 0; int currPos_num = 0; + ValueInfo* aRetVal = NULL; + ValueInfo* aArgVal = NULL; + char *cp; + + aRetVal = currentFunction->ReturnValue; add_to_sig(result,"\n",&currPos); if (currentFunction->Signature) { @@ -666,136 +732,153 @@ void get_signature(const char* num, FileInfo *data) add_to_sig(result,currentFunction->Signature,&currPos); add_to_sig(result,"\n",&currPos); } - - if(IsClass(currentFunction->ReturnType) && ret == 0) { + + if(IsClass(aRetVal) && ret == 0) { found = 0; for(i = 0; strcmp(wrapped_classes[i],"") != 0 && found == 0; i++) { - if(strcmp(wrapped_classes[i],currentFunction->ReturnClass) == 0) - found = 1; + if(strcmp(wrapped_classes[i],currentFunction->ReturnValue->Class) == 0) + found = 1; } if(!found) ret = 1; } - + for (j = 0; j < currentFunction->NumberOfArguments; j++) { - if(IsFunction(currentFunction->ArgTypes[j])) + aArgVal = currentFunction->Arguments[j]; + if(IsFunction(aArgVal)) ret == 1; - if(IsClass(currentFunction->ArgTypes[j]) && ret == 0) { + if(IsClass(aArgVal) && ret == 0) { found = 0; for(i = 0; strcmp(wrapped_classes[i],"") != 0 && found == 0; i++) { - if(strcmp(wrapped_classes[i],currentFunction->ArgClasses[j]) == 0) - found = 1; + if(strcmp(wrapped_classes[i],aArgVal->Class) == 0) + found = 1; } if(!found) - ret = 1; + ret = 1; } } - - if (IsArray(currentFunction->ReturnType) && !IsClass(currentFunction->ReturnType) && !IsString(currentFunction->ReturnType) && currentFunction->HintSize == 0) { + + if (IsArray(aRetVal) && !IsClass(aRetVal) && !IsString(aRetVal) && currentFunction->HintSize == 0) { ret = 1; } - + if(ret) { add_to_sig(result,"//\n",&currPos); - currentFunction->Signature = realloc(currentFunction->Signature, - (size_t)(currPos+1)); - strcpy(currentFunction->Signature,result); - + /*currentFunction->Signature = (const char*)realloc((void*)currentFunction->Signature, + (size_t)(currPos+1));*/ + //strcpy((char*)currentFunction->Signature,result); + cp = (char *)malloc(currPos+1); + strcpy(cp, result); + currentFunction->Signature = cp; return; } #if defined(IDL_I_CC) - add_to_sig(result,"struct CreateEventName(",&currPos); - add_to_sig(result,currentFunction->Name,&currPos); - if( strlen(num)!=0 ) { - add_to_sig(result,num,&currPos); - } - add_to_sig(result,")",&currPos); - add_to_sig(result,": public SALOME_Event\n",&currPos); - add_to_sig(result,"{\n",&currPos); - if(!IsVoid(currentFunction->ReturnType)) { - output_typedef(result,&currPos,MAX_ARGS,currentFunction->ReturnType, - currentFunction->ReturnClass); - add_to_sig(result," TResult;\n",&currPos); - add_to_sig(result," TResult myResult;\n",&currPos); - } - - output_typedef(result, &currPos, 0, 0x309, - data->ClassName); - add_to_sig(result," TObj;\n",&currPos); - add_to_sig(result," TObj myObj;\n",&currPos); - - for (i = 0; i < currentFunction->NumberOfArguments; i++) { - output_typedef(result, &currPos, i, currentFunction->ArgTypes[i], - currentFunction->ArgClasses[i]); - sprintf(buf," TParam%d;\n",i); - add_to_sig(result,buf,&currPos); - sprintf(buf," TParam%d myParam%d;\n",i,i); - add_to_sig(result,buf,&currPos); - } + add_to_sig(result,"struct CreateEventName(",&currPos); + add_to_sig(result,currentFunction->Name,&currPos); + if( strlen(num)!=0 ) { + add_to_sig(result,num,&currPos); + } + add_to_sig(result,")",&currPos); + add_to_sig(result,": public SALOME_Event\n",&currPos); + add_to_sig(result,"{\n",&currPos); + if(!IsVoid(aRetVal)) { + //output_typedef(result,&currPos,MAX_ARGS,aRetVal, currentFunction->ReturnValue->Class); + add_to_sig(result," typedef ",&currPos); + if (vtkWrap_IsConst(aRetVal)) + add_to_sig(result, " const ",&currPos); + if (vtkWrap_IsObject(aRetVal)) + add_to_sig(result, " ::",&currPos); + add_to_sig(result, aRetVal->Class,&currPos); + if (vtkWrap_IsPointer(aRetVal) || vtkWrap_IsArray(aRetVal)) + add_to_sig(result, "*",&currPos); + add_to_sig(result," TResult;\n",&currPos); + add_to_sig(result," TResult myResult;\n",&currPos); + } + + //output_typedef(result, &currPos, 0, 0x309, data->Name); //!!?? + add_to_sig(result," typedef ::",&currPos); + add_to_sig(result,data->Name,&currPos); + add_to_sig(result,"* TObj;\n",&currPos); + add_to_sig(result," TObj myObj;\n",&currPos); + + for (i = 0; i < currentFunction->NumberOfArguments; i++) { + aArgVal = currentFunction->Arguments[i]; + //output_typedef(result, &currPos, i, currentFunction->ArgTypes[i], + // currentFunction->ArgClasses[i]); + output_typedef(result, &currPos, i, aArgVal, currentFunction->ArgClasses[i]); + sprintf(buf," TParam%d;\n",i); + add_to_sig(result,buf,&currPos); + sprintf(buf," TParam%d myParam%d;\n",i,i); + add_to_sig(result,buf,&currPos); + } - add_to_sig(result,"\n",&currPos); - add_to_sig(result," CreateEventName(",&currPos); - add_to_sig(result,currentFunction->Name,&currPos); - if( strlen(num)!=0 ) { - add_to_sig(result,num,&currPos); - } - add_to_sig(result,")",&currPos); - add_to_sig(result,"(TObj theObj",&currPos); - for (i = 0; i < currentFunction->NumberOfArguments; i++) { - sprintf(buf,", TParam%d theParam%d",i,i); - add_to_sig(result,buf,&currPos); - } - add_to_sig(result,"):\n",&currPos); - add_to_sig(result," myObj(theObj)",&currPos); - for (i = 0; i < currentFunction->NumberOfArguments; i++) { - sprintf(buf,", myParam%d(theParam%d)",i,i); - add_to_sig(result,buf,&currPos); - } - add_to_sig(result,"\n",&currPos); - add_to_sig(result," { }\n",&currPos); - add_to_sig(result,"\n",&currPos); - add_to_sig(result," virtual void Execute()\n",&currPos); - add_to_sig(result," {\n",&currPos); - add_to_sig(result," ",&currPos); - if(!IsVoid(currentFunction->ReturnType)/* && !IsString(currentFunction->ReturnType)*/) { - add_to_sig(result,"myResult = ",&currPos); + add_to_sig(result,"\n",&currPos); + add_to_sig(result," CreateEventName(",&currPos); + add_to_sig(result,currentFunction->Name,&currPos); + if( strlen(num)!=0 ) { + add_to_sig(result,num,&currPos); + } + add_to_sig(result,")",&currPos); + add_to_sig(result,"(TObj theObj",&currPos); + for (i = 0; i < currentFunction->NumberOfArguments; i++) { + sprintf(buf,", TParam%d theParam%d",i,i); + add_to_sig(result,buf,&currPos); + } + add_to_sig(result,"):\n",&currPos); + add_to_sig(result," myObj(theObj)",&currPos); + for (i = 0; i < currentFunction->NumberOfArguments; i++) { + sprintf(buf,", myParam%d(theParam%d)",i,i); + add_to_sig(result,buf,&currPos); + } + add_to_sig(result,"\n",&currPos); + add_to_sig(result," { }\n",&currPos); + add_to_sig(result,"\n",&currPos); + add_to_sig(result," virtual void Execute()\n",&currPos); + add_to_sig(result," {\n",&currPos); + add_to_sig(result," ",&currPos); + if(!IsVoid(aRetVal)/* && !IsString(aRetVal)*/) { + add_to_sig(result,"myResult = ",&currPos); + } + //if(IsString(aRetVal)) { + //add_to_sig(result,"const char* ret = ",&currPos); + //} + add_to_sig(result,"myObj->",&currPos); + add_to_sig(result,currentFunction->Name,&currPos); + add_to_sig(result,"(",&currPos); + for (i = 0; i < currentFunction->NumberOfArguments; i++) { + aArgVal = currentFunction->Arguments[i]; + if(i!=0) + add_to_sig(result,", ",&currPos); + if(IsClass(aArgVal) && IsPtr(aArgVal)) { + add_to_sig(result,"*",&currPos); } - //if(IsString(currentFunction->ReturnType)) { - //add_to_sig(result,"const char* ret = ",&currPos); - //} - add_to_sig(result,"myObj->",&currPos); - add_to_sig(result,currentFunction->Name,&currPos); - add_to_sig(result,"(",&currPos); - for (i = 0; i < currentFunction->NumberOfArguments; i++) { - if(i!=0) - add_to_sig(result,", ",&currPos); - if(IsClass(currentFunction->ArgTypes[i]) && IsPtr(currentFunction->ArgTypes[i])) { - add_to_sig(result,"*",&currPos); - } + if (IsString(aArgVal) && IsConst(aArgVal)) + sprintf(buf,"checkNullStr(myParam%d)",i); + else sprintf(buf,"myParam%d",i); - add_to_sig(result,buf,&currPos); - } - add_to_sig(result,");\n",&currPos); - //if(IsString(currentFunction->ReturnType)) { - //add_to_sig(result," myResult = (ret==NULL)?NULL:CORBA::string_dup(\"\");\n",&currPos); - //} - add_to_sig(result," }\n",&currPos); - - add_to_sig(result,"};\n",&currPos); - add_to_sig(result,"//\n",&currPos); + add_to_sig(result,buf,&currPos); + } + add_to_sig(result,");\n",&currPos); + //if(IsString(aRetVal)) { + //add_to_sig(result," myResult = (ret==NULL)?NULL:CORBA::string_dup(\"\");\n",&currPos); + //} + add_to_sig(result," }\n",&currPos); + + add_to_sig(result,"};\n",&currPos); + add_to_sig(result,"//\n",&currPos); #endif currPos_sig=currPos; - + #if ! defined(IDL_I_CC) add_to_sig(result," ",&currPos); #endif - output_temp(result,&currPos,MAX_ARGS,currentFunction->ReturnType, - currentFunction->ReturnClass,0); + output_temp(result,&currPos,MAX_ARGS,aRetVal, + currentFunction->ReturnValue->Class,0); #if defined(IDL_I_CC) - add_to_sig(result,data->ClassName,&currPos); + add_to_sig(result,data->Name,&currPos); add_to_sig(result,"_i::",&currPos); #endif #if ! defined(IDL_I_HH) && ! defined(IDL_I_CC) @@ -813,12 +896,14 @@ void get_signature(const char* num, FileInfo *data) add_to_sig(result,"(",&currPos); for (i = 0; i < currentFunction->NumberOfArguments; i++) { + aArgVal = currentFunction->Arguments[i]; if( i != 0 ) { add_to_sig(result,", ",&currPos); } - output_temp(result, &currPos, i, currentFunction->ArgTypes[i], - currentFunction->ArgClasses[i], - currentFunction->ArgCounts[i]); + /* output_temp(result, &currPos, i, currentFunction->ArgTypes[i], + (char*)currentFunction->ArgClasses[i], + currentFunction->ArgCounts[i]);*/ + output_temp(result, &currPos, i, aArgVal, aArgVal->Class, currentFunction->NumberOfArguments); } add_to_sig(result,")",&currPos); @@ -826,59 +911,68 @@ void get_signature(const char* num, FileInfo *data) add_to_sig(result," {\n",&currPos); add_to_sig(result," try {\n",&currPos); for (i = 0; i < currentFunction->NumberOfArguments; i++) { - if(IsClass(currentFunction->ArgTypes[i])) { + aArgVal = currentFunction->Arguments[i]; + if(IsClass(aArgVal)) { sprintf(buf," PARAVIS_Base_i* i_temp%d = GET_SERVANT(temp%d);\n",i,i); add_to_sig(result,buf,&currPos); } - - if( - IsArray(currentFunction->ArgTypes[i]) - && !IsString(currentFunction->ArgTypes[i]) - && !IsClass(currentFunction->ArgTypes[i]) - && !IsVoid(currentFunction->ArgTypes[i]) - ) { + + if(IsArray(aArgVal) && !IsString(aArgVal) && !IsClass(aArgVal) && !IsVoid(aArgVal) ) { sprintf(buf," CORBA::ULong j_temp%d;\n",i); add_to_sig(result,buf,&currPos); sprintf(buf," CORBA::ULong l_temp%d = temp%d.length();\n",i,i); add_to_sig(result,buf,&currPos); add_to_sig(result," ",&currPos); - if(IsFloat(currentFunction->ArgTypes[i])) - add_to_sig(result,"float",&currPos); + if(IsFloat(aArgVal)) + add_to_sig(result,"float",&currPos); - if(IsDouble(currentFunction->ArgTypes[i])) - add_to_sig(result,"double",&currPos); + if(IsDouble(aArgVal)) + add_to_sig(result,"double",&currPos); - if(IsvtkIdType(currentFunction->ArgTypes[i])) { - add_to_sig(result,"vtkIdType",&currPos); + if(IsvtkIdType(aArgVal)) { + if (IsUnsigned(aArgVal)) + add_to_sig(result,"unsigned ",&currPos); + add_to_sig(result,"vtkIdType",&currPos); } else { - if(IsShort(currentFunction->ArgTypes[i])) { - add_to_sig(result,"int",&currPos); - } + if(IsShort(aArgVal)) { + if (IsUnsigned(aArgVal)) + add_to_sig(result,"unsigned ",&currPos); + add_to_sig(result,"int",&currPos); + } } - if(IsLong(currentFunction->ArgTypes[i])) - add_to_sig(result,"long",&currPos); - + if(IsLong(aArgVal)) { + if (IsUnsigned(aArgVal)) + add_to_sig(result,"unsigned ",&currPos); + add_to_sig(result,"long",&currPos); + } sprintf(buf,"* a_temp%d = new ",i); add_to_sig(result,buf,&currPos); - - if(IsFloat(currentFunction->ArgTypes[i])) - add_to_sig(result,"float",&currPos); - if(IsDouble(currentFunction->ArgTypes[i])) - add_to_sig(result,"double",&currPos); + if(IsFloat(aArgVal)) + add_to_sig(result,"float",&currPos); + + if(IsDouble(aArgVal)) + add_to_sig(result,"double",&currPos); - if(IsvtkIdType(currentFunction->ArgTypes[i])) { - add_to_sig(result,"vtkIdType",&currPos); + if(IsvtkIdType(aArgVal)) { + if (IsUnsigned(aArgVal)) + add_to_sig(result,"unsigned ",&currPos); + add_to_sig(result,"vtkIdType",&currPos); } else { - if(IsShort(currentFunction->ArgTypes[i])) { - add_to_sig(result,"int",&currPos); - } + if(IsShort(aArgVal)) { + if (IsUnsigned(aArgVal)) + add_to_sig(result,"unsigned ",&currPos); + add_to_sig(result,"int",&currPos); + } + } + + if(IsLong(aArgVal)) { + if (IsUnsigned(aArgVal)) + add_to_sig(result,"unsigned ",&currPos); + add_to_sig(result,"long",&currPos); } - - if(IsLong(currentFunction->ArgTypes[i])) - add_to_sig(result,"long",&currPos); sprintf(buf,"[l_temp%d];\n",i); add_to_sig(result,buf,&currPos); @@ -892,12 +986,12 @@ void get_signature(const char* num, FileInfo *data) add_to_sig(result," }\n",&currPos); } - if(IsString(currentFunction->ArgTypes[i])) { + if(IsString(aArgVal)) { sprintf(buf," char *c_temp%d = CORBA::string_dup(temp%d);\n",i,i); add_to_sig(result,buf,&currPos); } - if(IsVoid(currentFunction->ArgTypes[i])) { + if(IsVoid(aArgVal)) { sprintf(buf," long v_temp%d;\n",i); add_to_sig(result,buf,&currPos); @@ -907,40 +1001,40 @@ void get_signature(const char* num, FileInfo *data) } add_to_sig(result," ",&currPos); - if(IsArray(currentFunction->ReturnType) && !IsClass(currentFunction->ReturnType) && !IsString(currentFunction->ReturnType)) { + if(IsArray(aRetVal) && !IsClass(aRetVal) && !IsString(aRetVal)) { add_to_sig(result,"CORBA::ULong i_ret;\n",&currPos); add_to_sig(result," PARAVIS::",&currPos); - AddTypeArray(currentFunction->ReturnType,result,&currPos); + AddTypeArray(aRetVal,result,&currPos); add_to_sig(result,"_var s_ret = new ",&currPos); - AddTypeArray(currentFunction->ReturnType,result,&currPos); + AddTypeArray(aRetVal,result,&currPos); add_to_sig(result,"();\n",&currPos); sprintf(buf," s_ret->length(%d);\n",currentFunction->HintSize); add_to_sig(result,buf,&currPos); add_to_sig(result," ",&currPos); } - if(IsFloat(currentFunction->ReturnType)) { - if(IsArray(currentFunction->ReturnType)) { + if(IsFloat(aRetVal)) { + if(IsArray(aRetVal)) { add_to_sig(result,"float* a_ret = ",&currPos); } else { add_to_sig(result,"CORBA::Float ret = ",&currPos); } } - if(IsDouble(currentFunction->ReturnType)) { - if(IsArray(currentFunction->ReturnType)) { + if(IsDouble(aRetVal)) { + if(IsArray(aRetVal)) { add_to_sig(result,"double* a_ret = ",&currPos); } else { add_to_sig(result,"CORBA::Double ret = ",&currPos); } } - if(IsShort(currentFunction->ReturnType)) { - if(IsArray(currentFunction->ReturnType)) { - if(IsvtkIdType(currentFunction->ReturnType)) { - add_to_sig(result,"vtkIdType",&currPos); + if(IsShort(aRetVal)) { + if(IsArray(aRetVal)) { + if(IsvtkIdType(aRetVal)) { + add_to_sig(result,"vtkIdType",&currPos); } else { - add_to_sig(result,"int",&currPos); + add_to_sig(result,"int",&currPos); } add_to_sig(result,"* a_ret = ",&currPos); } else { @@ -948,39 +1042,39 @@ void get_signature(const char* num, FileInfo *data) } } - if(IsLong(currentFunction->ReturnType)) { - if(IsArray(currentFunction->ReturnType)) { + if(IsLong(aRetVal)) { + if(IsArray(aRetVal)) { add_to_sig(result,"long* a_ret = ",&currPos); } else { add_to_sig(result,"CORBA::Long ret = ",&currPos); } } - if(IsChar(currentFunction->ReturnType)) { - if(IsString(currentFunction->ReturnType)) { + //if(IsChar(aRetVal)) { + if(IsString(aRetVal)) { add_to_sig(result,"char * ret = CORBA::string_dup(\"\");\n",&currPos); add_to_sig(result," const char * cret = ",&currPos); - } else { + } else if (IsChar(aRetVal)) { //!!! vsv add_to_sig(result,"CORBA::Char ret = ",&currPos); } - } + //} - if(IsBoolean(currentFunction->ReturnType)) { + if(IsBoolean(aRetVal)) { add_to_sig(result,"CORBA::Boolean ret = ",&currPos); } - if(IsVoidPtr(currentFunction->ReturnType)) { + if(IsVoidPtr(aRetVal)) { add_to_sig(result,"void * v_ret = ",&currPos); } - if(IsClass(currentFunction->ReturnType)) { + if(IsClass(aRetVal)) { add_to_sig(result,"::",&currPos); - add_to_sig(result,currentFunction->ReturnClass,&currPos); + add_to_sig(result,currentFunction->ReturnValue->Class,&currPos); add_to_sig(result,"* a",&currPos); - add_to_sig(result,currentFunction->ReturnClass,&currPos); + add_to_sig(result,currentFunction->ReturnValue->Class,&currPos); add_to_sig(result," = ",&currPos); } - if(IsVoid(currentFunction->ReturnType)) { + if(IsVoid(aRetVal)) { add_to_sig(result,"if(getVTKObject() != NULL) ProcessVoidEvent",&currPos); } else { add_to_sig(result,"(getVTKObject() != NULL) ? ProcessEvent",&currPos); @@ -994,120 +1088,114 @@ void get_signature(const char* num, FileInfo *data) add_to_sig(result,")",&currPos); add_to_sig(result,"((::",&currPos); - add_to_sig(result,data->ClassName,&currPos); + add_to_sig(result,data->Name,&currPos); add_to_sig(result,"*)",&currPos); add_to_sig(result,"getVTKObject()\n",&currPos); for (i = 0; i < currentFunction->NumberOfArguments; i++) { + aArgVal = currentFunction->Arguments[i]; add_to_sig(result," , ",&currPos); //if(IsClass(currentFunction->ArgTypes[i]) && IsPtr(currentFunction->ArgTypes[i])) { //add_to_sig(result,"*(",&currPos); //} - if(IsClass(currentFunction->ArgTypes[i])) { - sprintf(buf,"(i_temp%d != NULL)?dynamic_cast< ::%s*>(i_temp%d->getVTKObject()):NULL",i,currentFunction->ArgClasses[i],i); + if(IsClass(aArgVal)) { + //sprintf(buf,"(i_temp%d != NULL)?dynamic_cast< ::%s*>(i_temp%d->getVTKObject()):NULL",i,currentFunction->ArgClasses[i],i); + sprintf(buf,"(i_temp%d != NULL)?dynamic_cast< ::%s*>(i_temp%d->getVTKObject()):NULL",i,aArgVal->Class,i); } else { - if( - IsArray(currentFunction->ArgTypes[i]) - && !IsString(currentFunction->ArgTypes[i]) - && !IsVoid(currentFunction->ArgTypes[i]) - ) { - sprintf(buf,"a_temp%d",i); + if(IsArray(aArgVal) && !IsString(aArgVal) && !IsVoid(aArgVal)) { + sprintf(buf,"a_temp%d",i); } else { - if(IsVoidPtr(currentFunction->ArgTypes[i])) { - sprintf(buf,"(void*)v_temp%d",i); - } else { - if(IsString(currentFunction->ArgTypes[i])) { - sprintf(buf,"c_temp%d",i); - } else { - sprintf(buf,"temp%d",i); - } - } + if(IsVoidPtr(aArgVal)) { + sprintf(buf,"(void*)v_temp%d",i); + } else { + if(IsString(aArgVal)) { + sprintf(buf,"c_temp%d",i); + } else { + sprintf(buf,"temp%d",i); + } + } } } - + add_to_sig(result,buf,&currPos); //if(IsClass(currentFunction->ArgTypes[i]) && IsPtr(currentFunction->ArgTypes[i])) { //add_to_sig(result,")",&currPos); //} add_to_sig(result,"\n",&currPos); } - + add_to_sig(result," )\n",&currPos); add_to_sig(result," )",&currPos); - if(!IsVoid(currentFunction->ReturnType)) { + if(!IsVoid(aRetVal)) { add_to_sig(result,":",&currPos); - if(IsClass(currentFunction->ReturnType) || IsString(currentFunction->ReturnType) || IsPtr(currentFunction->ReturnType) || IsArray(currentFunction->ReturnType)) + if(IsClass(aRetVal) || IsString(aRetVal) || IsPtr(aRetVal) || IsArray(aRetVal)) add_to_sig(result,"NULL",&currPos); else add_to_sig(result,"0",&currPos); } add_to_sig(result,";\n",&currPos); - if(IsString(currentFunction->ReturnType)) { + if(IsString(aRetVal)) { add_to_sig(result," if(cret!=NULL) ret=CORBA::string_dup(cret);\n",&currPos); } - if(IsClass(currentFunction->ReturnType)) { + if(IsClass(aRetVal)) { add_to_sig(result," if(a",&currPos); - add_to_sig(result,currentFunction->ReturnClass,&currPos); + add_to_sig(result,currentFunction->ReturnValue->Class,&currPos); add_to_sig(result," == NULL) {\n",&currPos); add_to_sig(result," return PARAVIS::",&currPos); - add_to_sig(result,currentFunction->ReturnClass,&currPos); + add_to_sig(result,currentFunction->ReturnValue->Class,&currPos); add_to_sig(result,"::_nil();\n",&currPos); add_to_sig(result," }\n",&currPos); add_to_sig(result," ",&currPos); add_to_sig(result,"PARAVIS_Base_i* aPtr = ::CreateInstance(a",&currPos); - add_to_sig(result,currentFunction->ReturnClass,&currPos); + add_to_sig(result,currentFunction->ReturnValue->Class,&currPos); add_to_sig(result,", a",&currPos); - add_to_sig(result,currentFunction->ReturnClass,&currPos); + add_to_sig(result,currentFunction->ReturnValue->Class,&currPos); add_to_sig(result,"->GetClassName());\n",&currPos); add_to_sig(result," aPtr->Init(a",&currPos); - add_to_sig(result,currentFunction->ReturnClass,&currPos); + add_to_sig(result,currentFunction->ReturnValue->Class,&currPos); add_to_sig(result,");\n",&currPos); } for (i = 0; i < currentFunction->NumberOfArguments; i++) { - if( - IsArray(currentFunction->ArgTypes[i]) - && !IsVoid(currentFunction->ArgTypes[i]) - && !IsString(currentFunction->ArgTypes[i]) - && !IsClass(currentFunction->ArgTypes[i]) - ) { - if (!IsIn(currentFunction->ArgTypes[i])) { - sprintf(buf," for(j_temp%d=0;j_temp%dArguments[i]; + if(IsArray(aArgVal) && !IsVoid(aArgVal) && !IsString(aArgVal) && !IsClass(aArgVal)) { + if (!IsIn(aArgVal)) { + sprintf(buf," for(j_temp%d=0;j_temp%dReturnType) && !IsVoidPtr(currentFunction->ReturnType)) { + if (IsVoid(aRetVal) && !IsVoidPtr(aRetVal)) { add_to_sig(result," return;\n",&currPos); } else { - if(IsClass(currentFunction->ReturnType)) { + if(IsClass(aRetVal)) { add_to_sig(result," return aPtr->_this();\n",&currPos); } else { - if(IsVoid(currentFunction->ReturnType)) { - add_to_sig(result," CORBA::Any* ret = new CORBA::Any;\n",&currPos); - add_to_sig(result," (*ret) <<= v_ret;\n",&currPos); - add_to_sig(result," return ret;\n",&currPos); + if(IsVoid(aRetVal)) { + add_to_sig(result," CORBA::Any* ret = new CORBA::Any;\n",&currPos); + add_to_sig(result," (*ret) <<= v_ret;\n",&currPos); + add_to_sig(result," return ret;\n",&currPos); } else { - if(IsArray(currentFunction->ReturnType) && !IsString(currentFunction->ReturnType)) { - sprintf(buf," for(i_ret=0; i_ret<%d; i_ret++) {\n",currentFunction->HintSize); - add_to_sig(result,buf,&currPos); - add_to_sig(result," s_ret[i_ret]=a_ret[i_ret];\n",&currPos); - add_to_sig(result," }\n",&currPos); - add_to_sig(result," return s_ret._retn();\n",&currPos); - } else { - add_to_sig(result," return ret;\n",&currPos); - } + if(IsArray(aRetVal) && !IsString(aRetVal)) { + sprintf(buf," for(i_ret=0; i_ret<%d; i_ret++) {\n",currentFunction->HintSize); + add_to_sig(result,buf,&currPos); + add_to_sig(result," s_ret[i_ret]=a_ret[i_ret];\n",&currPos); + add_to_sig(result," }\n",&currPos); + add_to_sig(result," return s_ret._retn();\n",&currPos); + } else { + add_to_sig(result," return ret;\n",&currPos); + } } } } @@ -1119,29 +1207,29 @@ void get_signature(const char* num, FileInfo *data) add_to_sig(result,currentFunction->Name,&currPos); add_to_sig(result," - Unknown exception was occured!!!\");\n",&currPos); - if (IsVoid(currentFunction->ReturnType)&& !IsVoidPtr(currentFunction->ReturnType)) { + if (IsVoid(aRetVal)&& !IsVoidPtr(aRetVal)) { add_to_sig(result," return;\n",&currPos); } else{ - if(IsString(currentFunction->ReturnType)) { + if(IsString(aRetVal)) { add_to_sig(result," return CORBA::string_dup(\"\");\n",&currPos); } else { - if(IsClass(currentFunction->ReturnType)) { - add_to_sig(result," return PARAVIS::",&currPos); - add_to_sig(result,currentFunction->ReturnClass,&currPos); - add_to_sig(result,"::_nil();\n",&currPos); + if(IsClass(aRetVal)) { + add_to_sig(result," return PARAVIS::",&currPos); + add_to_sig(result,currentFunction->ReturnValue->Class,&currPos); + add_to_sig(result,"::_nil();\n",&currPos); } else { - if(IsArray(currentFunction->ReturnType) && !IsVoid(currentFunction->ReturnType)) { - add_to_sig(result," PARAVIS::",&currPos); - AddTypeArray(currentFunction->ReturnType,result,&currPos); - add_to_sig(result,"_var s_ret = new ",&currPos); - AddTypeArray(currentFunction->ReturnType,result,&currPos); - add_to_sig(result,"();\n",&currPos); - sprintf(buf," s_ret->length(%d);\n",currentFunction->HintSize); - add_to_sig(result,buf,&currPos); - add_to_sig(result," return s_ret._retn();\n",&currPos); - } else { - add_to_sig(result," return 0;\n",&currPos); - } + if(IsArray(aRetVal) && !IsVoid(aRetVal)) { + add_to_sig(result," PARAVIS::",&currPos); + AddTypeArray(aRetVal,result,&currPos); + add_to_sig(result,"_var s_ret = new ",&currPos); + AddTypeArray(aRetVal,result,&currPos); + add_to_sig(result,"();\n",&currPos); + sprintf(buf," s_ret->length(%d);\n",currentFunction->HintSize); + add_to_sig(result,buf,&currPos); + add_to_sig(result," return s_ret._retn();\n",&currPos); + } else { + add_to_sig(result," return 0;\n",&currPos); + } } } } @@ -1155,9 +1243,12 @@ void get_signature(const char* num, FileInfo *data) if(ret) { result[currPos_sig]='\0'; - currentFunction->Signature = realloc(currentFunction->Signature, - (size_t)(currPos_sig+1)); - strcpy(currentFunction->Signature,result); + /*currentFunction->Signature = (const char*)realloc((void*)currentFunction->Signature, + (size_t)(currPos_sig+1));*/ + cp = (char *)malloc(currPos_sig+1); + strcpy(cp, result); + currentFunction->Signature = cp; + //strcpy((char*)currentFunction->Signature,result); return; } @@ -1175,34 +1266,39 @@ void get_signature(const char* num, FileInfo *data) buf[j]=0; buf1[j]=0; if(strcmp(buf,buf1) == 0) { - currentFunction->Signature[0]='\0'; - return; + ((char*)currentFunction->Signature)[0]='\0'; + return; } } } - - currentFunction->Signature = realloc(currentFunction->Signature, - (size_t)(currPos+1)); - strcpy(currentFunction->Signature,result); + /*currentFunction->Signature = (const char*)realloc((void*)currentFunction->Signature, + (size_t)(currPos+1));*/ + //strcpy((char*)currentFunction->Signature, result); + cp = (char *)malloc(currPos+1); + strcpy(cp, result); + currentFunction->Signature = cp; } -void outputFunction2(FILE *fp, FileInfo *data) +void outputFunction2(FILE *fp, ClassInfo *data) { - int i, j, k, is_static, is_vtkobject, fnum, occ, backnum, goto_used; - int all_legacy; + int i, j, k, is_vtkobject, fnum, backnum;//, is_static, occ, goto_used; + //int all_legacy; FunctionInfo *theFunc; FunctionInfo *backFunc; - char *theName; - int theType; - char *backName; + const char *theName; + unsigned int theType; + const char *backName; int backType; char static num[8]; //int isSMObject = 0; int found = 0; + ValueInfo* aArgVal = 0; + ValueInfo* aBackArgVal = 0; + #if defined(IDL_I_HH) fprintf(fp,"#include \"SALOMEconfig.h\"\n"); - fprintf(fp,"#include CORBA_SERVER_HEADER(PARAVIS_Gen_%s)\n",data->ClassName); + fprintf(fp,"#include CORBA_SERVER_HEADER(PARAVIS_Gen_%s)\n",data->Name); fprintf(fp,"\n"); fprintf(fp,"#include \"SALOME_GenericObj_i.hh\"\n"); fprintf(fp,"#include \"PARAVIS_Gen_i.hh\"\n"); @@ -1215,14 +1311,14 @@ void outputFunction2(FILE *fp, FileInfo *data) fprintf(fp,"#include \"PARAVIS_Gen_%s_i.hh\"\n",data->SuperClasses[i]); } - fprintf(fp,"\nclass %s;\n",data->ClassName); + fprintf(fp,"\nclass %s;\n",data->Name); fprintf(fp,"\nnamespace PARAVIS\n{\n\n"); #elif defined(IDL_I_CC) fprintf(fp,"#include \"SALOME_GenericObj_i.hh\"\n"); - fprintf(fp,"#include \"PARAVIS_Gen_%s_i.hh\"\n",data->ClassName); + fprintf(fp,"#include \"PARAVIS_Gen_%s_i.hh\"\n",data->Name); fprintf(fp,"#include \"PV_Tools.h\"\n"); fprintf(fp,"#include \"SALOME_Event.h\"\n"); - fprintf(fp,"#include <%s.h>\n",data->ClassName); + fprintf(fp,"#include <%s.h>\n",data->Name); #else fprintf(fp,"#include \"PARAVIS_Gen.idl\"\n"); fprintf(fp,"#include \"PARAVIS_Gen_Types.idl\"\n"); @@ -1235,160 +1331,182 @@ void outputFunction2(FILE *fp, FileInfo *data) fprintf(fp,"\nmodule PARAVIS\n{\n\n"); #endif - is_vtkobject = ((strcmp(data->ClassName,"vtkObjectBase") == 0) || + is_vtkobject = ((strcmp(data->Name,"vtkObjectBase") == 0) || (data->NumberOfSuperClasses != 0)); for(i = 0; i < data->NumberOfSuperClasses; i++) { - read_class_functions(data->SuperClasses[i],data->ClassName,fp); + read_class_functions(data->SuperClasses[i],data->Name,fp); } /* create a idl signature for each method */ for (fnum = 0; fnum < numberOfWrappedFunctions; fnum++) { - - theFunc = wrappedFunctions[fnum]; - currentFunction = theFunc; - - /* names of idl methods should be unique */ - num[0]='\0'; - j=-1; - for (i = 0; i < numberOfReadFunctions; i++) { - if(strcmp(currentFunction->Name,readFunctions[i].Name) == 0) - j++; - } - - for (i = 0; i < fnum; i++) - { - if( strcmp(currentFunction->Name,wrappedFunctions[i]->Name) == 0 ) - j++; - } - - if(j<0) { - for (i = fnum+1; i < numberOfWrappedFunctions; i++) { - if( strcmp(currentFunction->Name,wrappedFunctions[i]->Name) == 0 ) { - j=0; - break; - } + theFunc = wrappedFunctions[fnum]; + currentFunction = theFunc; + //printf("#### %i)Function %s\n", fnum, theFunc->Name); + + /* names of idl methods should be unique */ + num[0]='\0'; + j=-1; + for (i = 0; i < numberOfReadFunctions; i++) { + if(strcmp(currentFunction->Name,readFunctions[i].Name) == 0) + j++; } - } else { - j++; - } - - if(j>=0) - { - sprintf(num,"_%d",j); + for (i = 0; i < fnum; i++) + { + if( strcmp(currentFunction->Name,wrappedFunctions[i]->Name) == 0 ) + j++; + } + + if(j<0) { + for (i = fnum+1; i < numberOfWrappedFunctions; i++) { + if( strcmp(currentFunction->Name,wrappedFunctions[i]->Name) == 0 ) { + j=0; + break; + } + } + } else { + j++; } - - get_signature(num,data); + + if(j>=0) + { + sprintf(num,"_%d",j); + } + + get_signature(num,data); } - /* create external type declarations for all object return types */ for (fnum = 0; fnum < numberOfWrappedFunctions; fnum++) { - theFunc = wrappedFunctions[fnum]; - currentFunction = theFunc; - theName = NULL; - theType = 0; - - for (i = theFunc->NumberOfArguments; i >= 0; i--) - { - if (i==0)/* return type */ - { - theType = theFunc->ReturnType; - theName = theFunc->ReturnClass; - } - else /* arg type */ - { - theType = theFunc->ArgTypes[i-1]; - theName = theFunc->ArgClasses[i-1]; - } - /* check for object types */ - if ((theType % 0x1000 == 0x309)|| - (theType % 0x1000 == 0x109)) - { - /* check that we haven't done this type (no duplicate declarations) */ - for (backnum = fnum; backnum >= 0; backnum--) - { - backFunc = wrappedFunctions[backnum]; - backName = NULL; - backType = 0; - if (backnum == fnum) - k = i+1; - else - k = 0; - for (j = backFunc->NumberOfArguments; j >= k; j--) - { - if (j==0) /* return type */ - { - backType = backFunc->ReturnType; - backName = backFunc->ReturnClass; - } - else /* arg type */ - { - backType = backFunc->ArgTypes[j-1]; - backName = backFunc->ArgClasses[j-1]; - } - if (((backType % 0x1000 == 0x309)|| - (backType % 0x1000 == 0x109))) - { - if(strcmp(theName,backName) == 0) - { - break; - } - } - } - if (j >= k) - { - break; - } - } - if (backnum < 0 && strcmp(data->ClassName,theName) != 0) - { - found = 0; - for(j = 0; strcmp(wrapped_classes[j],"") != 0 && found == 0; j++) - { - if(strcmp(wrapped_classes[j],theName) == 0) - found = 1; - } - if(found) - { + theFunc = wrappedFunctions[fnum]; + currentFunction = theFunc; + theName = NULL; + theType = 0; + + for (i = theFunc->NumberOfArguments; i >= 0; i--) + { + if (i==0)/* return type */ + { + aArgVal = theFunc->ReturnValue; + //theType = theFunc->ReturnType; + //theName = (char*)theFunc->ReturnClass; + } + else /* arg type */ + { + aArgVal = theFunc->Arguments[i-1]; + //theType = theFunc->ArgTypes[i-1]; + //theName = (char*)theFunc->ArgClasses[i-1]; + } + theType = aArgVal->Type & VTK_PARSE_BASE_TYPE; + theName = aArgVal->Class; + /* check for object types */ + /*if ((theType & VTK_PARSE_BASE_TYPE == 0x309)|| + (theType & VTK_PARSE_BASE_TYPE == 0x109))*/ + if ((theType == VTK_PARSE_OBJECT) || (theType == VTK_PARSE_OBJECT_REF)) + { + /* check that we haven't done this type (no duplicate declarations) */ + for (backnum = fnum; backnum >= 0; backnum--) + { + backFunc = wrappedFunctions[backnum]; + backName = NULL; + backType = 0; + if (backnum == fnum) + k = i+1; + else + k = 0; + for (j = backFunc->NumberOfArguments; j >= k; j--) + { + if (j==0) /* return type */ + { + aBackArgVal = backFunc->ReturnValue; + //backType = backFunc->ReturnType; + //backName = (char*)backFunc->ReturnClass; + } + else /* arg type */ + { + aBackArgVal = backFunc->Arguments[j-1]; + //backType = backFunc->ArgTypes[j-1]; + //backName = (char*)backFunc->ArgClasses[j-1]; + } + backType = aBackArgVal->Type & VTK_PARSE_BASE_TYPE; + backName = aBackArgVal->Class; + /*if (((backType % VTK_PARSE_BASE_TYPE == 0x309)|| + (backType % VTK_PARSE_BASE_TYPE == 0x109)))*/ + if ((backType == VTK_PARSE_OBJECT) || (backType == VTK_PARSE_OBJECT_REF)) + { + if(strcmp(theName,backName) == 0) + { + break; + } + } + } + if (j >= k) + { + break; + } + } + if (backnum < 0 && strcmp(data->Name,theName) != 0) + { + found = 0; + for(j = 0; strcmp(wrapped_classes[j],"") != 0 && found == 0; j++) + { + if(strcmp(wrapped_classes[j],theName) == 0) + found = 1; + } + if(found) + { #if defined(IDL_I_HH) - fprintf(fp," class %s_i;\n",theName); + fprintf(fp," class %s_i;\n",theName); #elif defined(IDL_I_CC) - fprintf(fp,"#include \"PARAVIS_Gen_%s_i.hh\"\n",theName); - fprintf(fp,"#include <%s.h>\n",theName); + fprintf(fp,"#include \"PARAVIS_Gen_%s_i.hh\"\n",theName); + fprintf(fp,"#include <%s.h>\n",theName); #else - //fprintf(fp,"#include \"PARAVIS_Gen_%s.idl\"\n",theName); - fprintf(fp," interface %s;\n",theName); + //fprintf(fp,"#include \"PARAVIS_Gen_%s.idl\"\n",theName); + fprintf(fp," interface %s;\n",theName); #endif - } - } - } - } + } + } + } + } } - + //fprintf(fp,"\nmodule PARAVIS\n{\n"); #if defined(IDL_I_HH) - fprintf(fp,"\n class %s_i : public virtual POA_PARAVIS::%s, public virtual PARAVIS::PARAVIS_Base_i",data->ClassName,data->ClassName); + fprintf(fp,"\n class %s_i : public virtual POA_PARAVIS::%s, public virtual PARAVIS::PARAVIS_Base_i",data->Name,data->Name); //for(i = 0; i < data->NumberOfSuperClasses; i++) { // fprintf(fp,", public virtual %s_i",data->SuperClasses[i]); //} //fprintf(fp,", public virtual SALOME::GenericObj_i"); fprintf(fp," {"); fprintf(fp,"\n public:\n"); - fprintf(fp,"\n %s_i();\n",data->ClassName); + fprintf(fp,"\n %s_i();\n",data->Name); + if(strcmp(data->Name,"vtkSMSessionProxyManager") != 0) { + fprintf(fp,"\n ::vtkObjectBase* GetNew();\n"); + } + #elif defined(IDL_I_CC) fprintf(fp,"extern PARAVIS::PARAVIS_Base_i* CreateInstance(::vtkObjectBase* Inst, const QString&);\n"); fprintf(fp,"\nnamespace PARAVIS\n{\n"); - fprintf(fp,"typedef %s_i current_inderface;\n",data->ClassName); - fprintf(fp,"#define CreateEventName(Function) Event%s ##Function\n",data->ClassName); - fprintf(fp,"%s_i::%s_i() {\n",data->ClassName,data->ClassName); - fprintf(fp," Init(::%s::New());\n",data->ClassName); + fprintf(fp,"typedef %s_i current_interface;\n",data->Name); + fprintf(fp,"#define CreateEventName(Function) Event%s ##Function\n",data->Name); + fprintf(fp,"%s_i::%s_i() {\n",data->Name,data->Name); + //fprintf(fp," Init(::%s::New());\n",data->Name); fprintf(fp,"}\n"); fprintf(fp,"\n"); + + if(strcmp(data->Name,"vtkSMSessionProxyManager") != 0) { + fprintf(fp,"::vtkObjectBase* %s_i::GetNew() {\n", data->Name); + if(strcmp(data->Name,"vtkSMProxyManager") == 0) { + fprintf(fp," return ::%s::GetProxyManager();\n",data->Name); + } else { + fprintf(fp," return ::%s::New();\n",data->Name); + } + fprintf(fp,"}\n"); + } #else - fprintf(fp,"\n interface %s : PARAVIS_Base",data->ClassName); + fprintf(fp,"\n interface %s : PARAVIS_Base",data->Name); fprintf(fp,"\n {\n"); #endif @@ -1413,11 +1531,15 @@ void outputFunction2(FILE *fp, FileInfo *data) return; } -void outputFunction(FILE *fp, FileInfo *data) +void outputFunction(FILE *fp, ClassInfo *data) { int i; - int args_ok = 1; - + //int args_ok = 1; + ValueInfo* aRetVal = NULL;//currentFunction->ReturnValue; + ValueInfo* aArgVal = NULL; + unsigned int aType; + unsigned int argtype; + fp = fp; /* some functions will not get wrapped no matter what else, and some really common functions will appear only in vtkObjectPython */ @@ -1428,133 +1550,217 @@ void outputFunction(FILE *fp, FileInfo *data) { return; } - + //printf("#### Check %s\n", currentFunction->Name); + /* check to see if we can handle the args */ for (i = 0; i < currentFunction->NumberOfArguments; i++) { - if (currentFunction->ArgTypes[i] % 0x1000 == 9) args_ok = 0; - if ((currentFunction->ArgTypes[i] % 0x10) == 8) args_ok = 0; - if (((currentFunction->ArgTypes[i] % 0x1000)/0x100 != 0x3)&& - (currentFunction->ArgTypes[i] % 0x1000 != 0x109)&& - ((currentFunction->ArgTypes[i] % 0x1000)/0x100)) args_ok = 0; - if (currentFunction->ArgTypes[i] % 0x1000 == 0x313) args_ok = 0; - if (currentFunction->ArgTypes[i] % 0x1000 == 0x314) args_ok = 0; - if (currentFunction->ArgTypes[i] % 0x1000 == 0x31A) args_ok = 0; - if (currentFunction->ArgTypes[i] % 0x1000 == 0x31B) args_ok = 0; - if (currentFunction->ArgTypes[i] % 0x1000 == 0x31C) args_ok = 0; - if (currentFunction->ArgTypes[i] % 0x1000 == 0x315) args_ok = 0; - if (currentFunction->ArgTypes[i] % 0x1000 == 0x316) args_ok = 0; + aArgVal = currentFunction->Arguments[i]; + /*printf(" Argument: %s ", vtkWrap_GetTypeName(aArgVal)); + if (vtkWrap_IsArray(aArgVal)) { + printf("!!!! Argument %i is array\n", i); + return; + }*/ + if (vtkWrap_IsStream(aArgVal)) { + //printf("!!!! Argument %i is stream\n", i); + return; + } + if (IsPtr(aArgVal)) { + //printf("!!!! Argument %i is pointer value\n", i); + return; + } + if (IsUnknown(aArgVal)) { + //printf("!!!! Argument %i is unknown value\n", i); + return; + } + if (vtkWrap_IsVoidPointer(aArgVal)) { + //printf("!!!! Argument %i is void pointer\n", i); + return; + } + if (vtkWrap_IsVoidFunction(aArgVal)) { + //printf("!!!! Argument %i is void function\n", i); + return; + } + argtype = (aArgVal->Type & VTK_PARSE_INDIRECT); + if (argtype == VTK_PARSE_POINTER_POINTER){ + //printf("!!!! Argument %i is pointer to pointer\n", i); + return; + } + if (vtkWrap_IsNonConstRef(aArgVal)) { + //printf("!!!! Argument %i is non const ref\n", i); + return; + } + if (vtkWrap_IsSpecialObject(aArgVal)) { + //printf("!!!! Argument %i is special object\n", i); + return; + } + /*if (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE == 9) args_ok = 0; + if ((currentFunction->ArgTypes[i] % 0x10) == 8) args_ok = 0; + if (((currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE)/0x100 != 0x3)&& + (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE != 0x109)&& + ((currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE)/0x100)) args_ok = 0; + if (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE == 0x313) args_ok = 0; + if (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE == 0x314) args_ok = 0; + if (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE == 0x31A) args_ok = 0; + if (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE == 0x31B) args_ok = 0; + if (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE == 0x31C) args_ok = 0; + if (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE == 0x315) args_ok = 0; + if (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE == 0x316) args_ok = 0;*/ + } + aRetVal = currentFunction->ReturnValue; + if (aRetVal) { + //printf("#### Return type: %s\n", vtkWrap_GetTypeName(aRetVal)); + aType = aRetVal->Type & VTK_PARSE_BASE_TYPE; + if (IsPtr(aRetVal)) { + //printf("!!!! Return Value is pointer\n"); + return; + } + /* eliminate unsigned char * and unsigned short * */ + argtype = (aRetVal->Type & VTK_PARSE_UNQUALIFIED_TYPE); + if ((argtype == VTK_PARSE_UNSIGNED_CHAR_PTR) || (argtype == VTK_PARSE_UNSIGNED_SHORT)) { + //printf("!!!! Return Value is unsigned char or short\n"); + return; } - if ((currentFunction->ReturnType % 0x10) == 0x8) args_ok = 0; - if (currentFunction->ReturnType % 0x1000 == 0x9) args_ok = 0; - if (((currentFunction->ReturnType % 0x1000)/0x100 != 0x3)&& - (currentFunction->ReturnType % 0x1000 != 0x109)&& - ((currentFunction->ReturnType % 0x1000)/0x100)) args_ok = 0; - - - /* eliminate unsigned char * and unsigned short * */ - if (currentFunction->ReturnType % 0x1000 == 0x313) args_ok = 0; - if (currentFunction->ReturnType % 0x1000 == 0x314) args_ok = 0; - if (currentFunction->ReturnType % 0x1000 == 0x31A) args_ok = 0; - if (currentFunction->ReturnType % 0x1000 == 0x31B) args_ok = 0; - if (currentFunction->ReturnType % 0x1000 == 0x31C) args_ok = 0; - if (currentFunction->ReturnType % 0x1000 == 0x315) args_ok = 0; - if (currentFunction->ReturnType % 0x1000 == 0x316) args_ok = 0; + + if ((aType == VTK_PARSE_UNKNOWN)) { + //printf("!!!! Return Value is unknown\n"); + return; + } + argtype = (aRetVal->Type & VTK_PARSE_INDIRECT); + if (argtype == VTK_PARSE_POINTER_POINTER){ + //printf("!!!! Return value is pointer to pointer\n", i); + return; + } + if (vtkWrap_IsSpecialObject(aRetVal)) { + //printf("!!!! Return is special object\n", i); + return; + } + } + /*if ((aRetVal % 0x10) == 0x8) args_ok = 0; + if (aRetVal % VTK_PARSE_BASE_TYPE == 0x9) args_ok = 0; + if (((aRetVal % VTK_PARSE_BASE_TYPE)/0x100 != 0x3)&& + (aRetVal % VTK_PARSE_BASE_TYPE != 0x109)&& + ((aRetVal % VTK_PARSE_BASE_TYPE)/0x100)) args_ok = 0; + */ + + /*if (aRetVal % VTK_PARSE_BASE_TYPE == 0x313) args_ok = 0; + if (aRetVal % VTK_PARSE_BASE_TYPE == 0x314) args_ok = 0; + if (aRetVal % VTK_PARSE_BASE_TYPE == 0x31A) args_ok = 0; + if (aRetVal % VTK_PARSE_BASE_TYPE == 0x31B) args_ok = 0; + if (aRetVal % VTK_PARSE_BASE_TYPE == 0x31C) args_ok = 0; + if (aRetVal % VTK_PARSE_BASE_TYPE == 0x315) args_ok = 0; + if (aRetVal % VTK_PARSE_BASE_TYPE == 0x316) args_ok = 0; + if (currentFunction->NumberOfArguments && (currentFunction->ArgTypes[0] == 0x5000) - &&(currentFunction->NumberOfArguments != 0x1)) args_ok = 0; + &&(currentFunction->NumberOfArguments != 0x1)) args_ok = 0;*/ /* make sure we have all the info we need for array arguments in */ - for (i = 0; i < currentFunction->NumberOfArguments; i++) + /*for (i = 0; i < currentFunction->NumberOfArguments; i++) { - if (((currentFunction->ArgTypes[i] % 0x1000)/0x100 == 0x3)&& + if (((currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE)/0x100 == 0x3)&& (currentFunction->ArgCounts[i] <= 0)&& - (currentFunction->ArgTypes[i] % 0x1000 != 0x309)&& - (currentFunction->ArgTypes[i] % 0x1000 != 0x303)&& - (currentFunction->ArgTypes[i] % 0x1000 != 0x302)) args_ok = 0; - } + (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE != 0x309)&& + (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE != 0x303)&& + (currentFunction->ArgTypes[i] % VTK_PARSE_BASE_TYPE != 0x302)) args_ok = 0; + }*/ /* if we need a return type hint make sure we have one */ - switch (currentFunction->ReturnType % 0x1000) + //switch (aRetVal % VTK_PARSE_BASE_TYPE) + /*switch (aRetVal->Type % VTK_PARSE_BASE_TYPE) { case 0x301: case 0x307: case 0x30A: case 0x30B: case 0x30C: case 0x30D: case 0x30E: case 0x304: case 0x305: case 0x306: args_ok = currentFunction->HaveHint; break; - } + }*/ /* make sure it isn't a Delete or New function */ if (!strcmp("Delete",currentFunction->Name) || !strcmp("New",currentFunction->Name)) { - args_ok = 0; + return; } + + if (vtkWrap_IsDestructor(data, currentFunction) || vtkWrap_IsConstructor(data, currentFunction)) { + //printf("!!!! Return Value is constructor or destructor\n"); + return; + } /* check for New() function */ - if (!strcmp("New",currentFunction->Name) && - currentFunction->NumberOfArguments == 0) + if (!strcmp("New",currentFunction->Name) && currentFunction->NumberOfArguments == 0) { - class_has_new = 1; + class_has_new = 1; } - if (currentFunction->IsPublic && args_ok && - strcmp(data->ClassName,currentFunction->Name) && - strcmp(data->ClassName, currentFunction->Name + 1)) + if (currentFunction->IsPublic && //args_ok && + strcmp(data->Name,currentFunction->Name) && + strcmp(data->Name, currentFunction->Name + 1)) { - wrappedFunctions[numberOfWrappedFunctions] = currentFunction; - numberOfWrappedFunctions++; + //printf("#### %i Function %s\n", numberOfWrappedFunctions, currentFunction->Name); + wrappedFunctions[numberOfWrappedFunctions] = currentFunction; + numberOfWrappedFunctions++; } - + return; } /* print the parsed structures */ -void vtkParseOutput(FILE *fp, FileInfo *data) +void vtkParseOutput(FILE *fp, FileInfo *file_info) { int i; + ClassInfo *data; + + /* get the main class */ + data = file_info->MainClass; + + // Do not wrap this class + // if (strcmp(data->Name, "vtkVariant") == 0) + // return; #if defined(IDL_I_HH) - fprintf(fp, "// idl wrapper interface for %s object implementation\n//\n", data->ClassName); + fprintf(fp, "// idl wrapper interface for %s object implementation\n//\n", data->Name); #elif defined(IDL_I_CC) - fprintf(fp, "// idl wrapper implementation for %s object\n//\n", data->ClassName); + fprintf(fp, "// idl wrapper implementation for %s object\n//\n", data->Name); #else - fprintf(fp, "// idl wrapper for %s object\n//\n", data->ClassName); + fprintf(fp, "// idl wrapper for %s object\n//\n", data->Name); #endif for (i = 0;1;i++) { if(strlen(Copyright[i]) != 0) - { - fprintf(fp,"%s\n",Copyright[i]); - } + { + fprintf(fp,"%s\n",Copyright[i]); + } else - { - break; - } + { + break; + } } fprintf(fp,"\n"); #if defined(IDL_I_HH) - fprintf(fp,"#ifndef PARAVIS_Gen_%s_i_HeaderFile\n",data->ClassName); - fprintf(fp,"#define PARAVIS_Gen_%s_i_HeaderFile\n",data->ClassName); + fprintf(fp,"#ifndef PARAVIS_Gen_%s_i_HeaderFile\n",data->Name); + fprintf(fp,"#define PARAVIS_Gen_%s_i_HeaderFile\n",data->Name); fprintf(fp,"\n"); #elif defined(IDL_I_CC) #else - fprintf(fp,"#ifndef __PARAVIS_Gen_%s__\n",data->ClassName); - fprintf(fp,"#define __PARAVIS_Gen_%s__\n",data->ClassName); + fprintf(fp,"#ifndef __PARAVIS_Gen_%s__\n",data->Name); + fprintf(fp,"#define __PARAVIS_Gen_%s__\n",data->Name); fprintf(fp,"\n"); #endif /* insert function handling code here */ for (i = 0; i < data->NumberOfFunctions; i++) { - currentFunction = data->Functions + i; + currentFunction = data->Functions[i]; outputFunction(fp, data); } - - if (data->NumberOfSuperClasses || !data->IsAbstract) - { - outputFunction2(fp, data); - } + //printf("#### NbFunctions %i\n", numberOfWrappedFunctions); + //if (data->NumberOfSuperClasses || (!data->IsAbstract)) + //if (numberOfWrappedFunctions) + // { + outputFunction2(fp, data); + // } #if defined(IDL_I_HH) fprintf(fp,"\n#endif\n"); diff --git a/idl/wrap.cmake b/idl/wrap.cmake index b21aab7f..39b6b578 100755 --- a/idl/wrap.cmake +++ b/idl/wrap.cmake @@ -1,17 +1,31 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + ADD_CUSTOM_COMMAND( OUTPUT vtkWrapIDL.h - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/create_header.sh ${CMAKE_BINARY_DIR} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_header.py ${CMAKE_BINARY_DIR} DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt ) -ADD_CUSTOM_COMMAND( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/vtkWrapIDL.c - DEPENDS vtkWrapIDL.h -) - ADD_CUSTOM_COMMAND( OUTPUT hints - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/create_hints.sh ${PARAVIEW_LIBRARY_DIRS} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_hints.py ${PARAVIEW_LIBRARY_DIRS} DEPENDS ${PARAVIEW_LIBRARY_DIRS}/hints ${CMAKE_CURRENT_SOURCE_DIR}/hints_paravis ) @@ -20,7 +34,7 @@ SET(WRAP_SK_FILES) IF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) EXECUTE_PROCESS( - COMMAND cat ${CMAKE_BINARY_DIR}/wrapfiles.txt + COMMAND ${PYTHON_EXECUTABLE} -c "f = open('${CMAKE_BINARY_DIR}/wrapfiles.txt') ; print f.read(), ; f.close()" OUTPUT_VARIABLE WRAP_LIST_FULL ) @@ -45,13 +59,22 @@ IF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) SET(WRAP_IDL ${WRAP_IDL} PARAVIS_Gen_${VAL}.idl) SET(WRAP_SK_FILES ${WRAP_SK_FILES} PARAVIS_Gen_${VAL}SK.cc) + SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL) + IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) + ENDIF(WINDOWS) ADD_CUSTOM_COMMAND( OUTPUT PARAVIS_Gen_${VAL}.idl - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_exe ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h hints 0 PARAVIS_Gen_${VAL}.idl - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_exe ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h hints ${DEP} + COMMAND ${vtkWrapIDL_EXEFILE} ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h hints 0 PARAVIS_Gen_${VAL}.idl + DEPENDS vtkWrapIDL ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h hints ${DEP} ) ENDFOREACH(STR ${WRAP_LIST_REG}) ENDIF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) -ADD_CUSTOM_TARGET(generate_idl ALL DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt vtkWrapIDL.h ${CMAKE_CURRENT_SOURCE_DIR}/vtkWrapIDL.c hints ${WRAP_IDL}) +ADD_CUSTOM_TARGET(generate_txt DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt vtkWrapIDL.h hints) +ADD_CUSTOM_TARGET(generate_idl ALL DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt vtkWrapIDL.h hints ${WRAP_IDL}) diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index f25e07f4..6b2f87b8 100644 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -1,220 +1,47 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# Copyright (C) 2010-2012 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. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# -* Makefile *- -# -# Author : Patrick GOLDBRONN (CEA) -# Date : 28/06/2001 -# Modified by : Alexander BORODIN (OCN) - autotools usage - -# include $(top_srcdir)/adm_local/unix/make_common_starter.am SET(dist_salomeres_DATA - LightApp.xml - SalomeApp.xml - pqAppIcon22.png - pqAppIcon16.png - ParaViewFilters.xml - ParaViewReaders.xml - ParaViewSources.xml - ParaViewWriters.xml - SalomeApp.xml -) - -SET(nodist_salomeres_SCRIPTS - PARAVISCatalog.xml -) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVISCatalog.xml.in) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/PARAVISCatalog.xml) - - - MESSAGE(STATUS "Creation of ${output}") - CONFIGURE_FILE(${input} ${output}) - - - #SET(input ${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in) - - - #SET(output ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml) - - - #MESSAGE(STATUS "Creation of ${output}") - #CONFIGURE_FILE(${input} ${output}) - + pqAppIcon22.png + pqAppIcon16.png + ParaViewFilters.xml + ParaViewReaders.xml + ParaViewSources.xml + ParaViewWriters.xml + ) - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - -FOREACH(f ${nodist_salomeres_SCRIPTS}) +SET(input ${CMAKE_CURRENT_SOURCE_DIR}/PARAVISCatalog.xml.in) +SET(output ${CMAKE_CURRENT_BINARY_DIR}/PARAVISCatalog.xml) - SET(DEST share/salome/resources/paravis) - +MESSAGE(STATUS "Creation of ${output}") +CONFIGURE_FILE(${input} ${output}) - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - +INSTALL(FILES ${output} DESTINATION share/salome/resources/paravis) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - +SET(input ${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in) +SET(output ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml) - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - +MESSAGE(STATUS "Creation of ${output}") +CONFIGURE_FILE(${input} ${output}) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - +INSTALL(FILES ${output} DESTINATION share/salome/resources/paravis) - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - - ENDIF(ext STREQUAL .py) - -ENDFOREACH(f ${nodist_salomeres_SCRIPTS}) FOREACH(f ${dist_salomeres_DATA}) - - SET(DEST share/salome/resources/paravis) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - - ENDIF(ext STREQUAL .py) - + INSTALL(FILES ${f} DESTINATION share/salome/resources/paravis) ENDFOREACH(f ${dist_salomeres_DATA}) diff --git a/resources/LightApp.xml b/resources/LightApp.xml deleted file mode 100644 index 02f36852..00000000 --- a/resources/LightApp.xml +++ /dev/null @@ -1,13 +0,0 @@ - -
    - - - -
    -
    - - - - -
    -
    diff --git a/resources/PARAVISCatalog.xml.in b/resources/PARAVISCatalog.xml.in index bd35b2b6..253b903a 100644 --- a/resources/PARAVISCatalog.xml.in +++ b/resources/PARAVISCatalog.xml.in @@ -1,9 +1,6 @@ @@ -25,12 +25,15 @@ - + + + + @@ -40,10 +43,14 @@ + - - + + + + + @@ -56,4 +63,8 @@ + + + + diff --git a/resources/ParaViewWriters.xml b/resources/ParaViewWriters.xml index 7e02ed21..92e8dc4a 100755 --- a/resources/ParaViewWriters.xml +++ b/resources/ParaViewWriters.xml @@ -1,5 +1,6 @@ + @@ -18,7 +19,7 @@ - + diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml deleted file mode 100644 index cc032ab1..00000000 --- a/resources/SalomeApp.xml +++ /dev/null @@ -1,21 +0,0 @@ - -
    - - - - - - -
    -
    - - - - -
    -
    - - - -
    -
    diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in new file mode 100644 index 00000000..498ce10b --- /dev/null +++ b/resources/SalomeApp.xml.in @@ -0,0 +1,47 @@ + + + +
    + + + + + + + +
    +
    + + + + +
    +
    + + + +
    + +
    + +
    +
    diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f41d7c4b..188fc882 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,62 +1,36 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. -# -# This library is 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 +# Copyright (C) 2010-2012 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. # +# 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 # -# File : Makefile.in -# Author : (CEA) -# Modified by : Alexander BORODIN (OCN) - autotools usage -# include $(top_srcdir)/adm_local/unix/make_common_starter.am +SET(SUBDIRS + ENGINE + PVGUI + PV_SWIG + Macro + ) IF(BUILD_PLUGINS) SET(SUBDIRS - ENGINE - PVGUI - PV_SWIG - Plugins - ) -ELSE(BUILD_PLUGINS) - SET(SUBDIRS - ENGINE - PVGUI - PV_SWIG - ) + ${SUBDIRS} + Plugins + ) ENDIF(BUILD_PLUGINS) - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - +FOREACH(dir ${SUBDIRS}) + ADD_SUBDIRECTORY(${dir}) +ENDFOREACH(dir ${SUBDIRS}) diff --git a/src/ENGINE/CMakeLists.txt b/src/ENGINE/CMakeLists.txt index 07e1e5fd..918e68af 100644 --- a/src/ENGINE/CMakeLists.txt +++ b/src/ENGINE/CMakeLists.txt @@ -1,398 +1,39 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# Copyright (C) 2010-2012 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. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# File : Makefile.in -# Author : Vitaly Smetannikov -# Module : PARAVIS -# $Header: -# -# include $(top_srcdir)/adm_local/unix/make_common_starter.am - -SET(lib_LTLIBRARIES - libPARAVISEngine.la -) - -SET(salomeinclude_HEADERS - PARAVIS_Engine_i.hh -) - -SET(dist_libPARAVISEngine_la_SOURCES - PARAVIS_Engine_i.cc -) - -SET(libPARAVISEngine_la_CPPFLAGS - ${KERNEL_CXXFLAGS} - ${CORBA_CXXFLAGS} - ${CORBA_INCLUDES} - -I${CMAKE_BINARY_DIR}/salome_adm/unix - -I${CMAKE_BINARY_DIR}/idl -) - -SET(libPARAVISEngine_la_LDFLAGS - ${KERNEL_LDFLAGS} - ${SalomeIDLKernel} - ${SalomeNS} - ${SalomeContainer} - ${CORBA_LIBS} - ${CMAKE_BINARY_DIR}/idl/libSalomeIDLPARAVIS.la -) - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - - - FOREACH(amname ${lib_LTLIBRARIES}) - - - STRING(REPLACE .la _la amname ${amname}) - - - STRING(LENGTH ${amname} len) - MATH(EXPR newlen "${len}-3") - STRING(SUBSTRING ${amname} 0 ${newlen} name) - - - STRING(REGEX MATCH "^lib" BEGIN_WITH_lib ${name}) - IF(BEGIN_WITH_lib) - STRING(LENGTH ${name} len) - MATH(EXPR newlen "${len}-3") - STRING(SUBSTRING ${name} 3 ${newlen} name) - ENDIF(BEGIN_WITH_lib) - - - STRING(REGEX MATCH "IDL" ISIDL ${name}) - - - IF(ISIDL) - IF(WINDOWS) - SET(type STATIC) - ELSE(WINDOWS) - SET(type SHARED) - ENDIF(WINDOWS) - ELSE(ISIDL) - SET(type SHARED) - ENDIF(ISIDL) - - - SET(srcs) - FOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) - GET_FILENAME_COMPONENT(ext ${src} EXT) - IF(ext STREQUAL .f) - IF(src STREQUAL trte.f) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) - STRING(REPLACE ".f" ".c" src ${src}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) - SET(output ${src}) - ADD_CUSTOM_COMMAND( - OUTPUT ${output} - COMMAND f2c ${input} - MAIN_DEPENDENCY ${input} - ) - ELSE(src STREQUAL trte.f) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) - STRING(REPLACE ".f" ".o" src ${src}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) - SET(output ${src}) - IF(WINDOWS) - SET(F77 g77) - ELSE(WINDOWS) - SET(F77 gfortran) - ENDIF(WINDOWS) - ADD_CUSTOM_COMMAND( - OUTPUT ${output} - COMMAND ${F77} -c -o ${output} ${input} - MAIN_DEPENDENCY ${input} - ) - ENDIF(src STREQUAL trte.f) - ENDIF(ext STREQUAL .f) - SET(srcs ${srcs} ${src}) - ENDFOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) - - - SET(l ${nodist_${amname}_SOURCES} ${UIC_FILES}) - FOREACH(f ${l}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${f}) - SET(srcs ${srcs} ${src}) - ENDFOREACH(f ${l}) - - - SET(build_srcs) - SET(l ${nodist_${amname}_SOURCES} ${BUILT_SOURCES}) - FOREACH(f ${l}) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - ELSE(ext STREQUAL .py) - SET(build_srcs ${build_srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f}) - ENDIF(ext STREQUAL .py) - ENDFOREACH(f ${l}) - - - ADD_LIBRARY(${name} ${type} ${srcs}) - - - SET(var) - IF(WINDOWS) - SET(targets) - SET(targets ${targets} SalomeIDLKernel) - SET(targets ${targets} SalomeDS) - SET(targets ${targets} SALOMEDSTest) - SET(targets ${targets} SALOMEDS_Client_exe) - SET(targets ${targets} SalomeIDLGEOM) - SET(targets ${targets} GEOMEngine) - SET(targets ${targets} MEDEngine) - SET(targets ${targets} SMESHEngine) - SET(targets ${targets} SMESH) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(var ${var} -DNOGDI) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(var ${var} -I${dir}) - SET(var ${var} -DF2C_BUILD) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(var ${var} ${AM_CPPFLAGS}) - SET(var ${var} ${AM_CXXFLAGS}) - - - SET(var ${var} ${PLATFORM_CPPFLAGS}) - SET(var ${var} ${PTHREAD_CFLAGS}) - SET(var ${var} ${${amname}_CPPFLAGS}) - SET(var ${var} ${${amname}_CXXFLAGS}) - SET(var ${var} ${${amname}_CFLAGS}) - SET(vars) - IF(WINDOWS) - SET(vars ${vars} -include SALOMEconfig.h) - SET(vars ${vars} -ftemplate-depth-32) - SET(vars ${vars} -fPIC) - SET(vars ${vars} -g) - ENDIF(WINDOWS) - SET(flags) - FOREACH(f ${var}) - FOREACH(v ${vars}) - IF(f STREQUAL v) - SET(f) - ENDIF(f STREQUAL v) - ENDFOREACH(v ${vars}) - SET(flags "${flags} ${f}") - ENDFOREACH(f ${var}) - SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") - - - SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) - - - SET(libadd) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(libadd ${libadd} ${dir}/LIBF77.lib) - SET(libadd ${libadd} ${dir}/LIBI77.lib) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) - FOREACH(lib SALOMEBasics SalomeBatch) - IF(name STREQUAL lib) - SET(libs ${libs} ${PTHREAD_LIBS}) - ENDIF(name STREQUAL lib) - ENDFOREACH(lib SALOMEBasics SalomeBatch) - - - FOREACH(lib ${libs}) - GET_FILENAME_COMPONENT(ext ${lib} EXT) - IF(ext STREQUAL .la) - GET_FILENAME_COMPONENT(lib ${lib} NAME_WE) - STRING(REGEX REPLACE "^lib" "" lib ${lib}) - ENDIF(ext STREQUAL .la) - SET(vars) - SET(vars ${vars} -no-undefined) - SET(vars ${vars} -lvtkWidgets) - IF(WINDOWS) - SET(vars ${vars} -module) - SET(vars ${vars} -Wl,-E) - SET(vars ${vars} -Xlinker) - SET(vars ${vars} -export-dynamic) - SET(vars ${vars} -lm) - SET(vars ${vars} -lboost_thread) - SET(vars ${vars} -lboost_signals) - SET(vars ${vars} -pthread -lpthread -ldl) - ENDIF(WINDOWS) - FOREACH(v ${vars}) - IF(lib STREQUAL v) - SET(lib) - ENDIF(lib STREQUAL v) - ENDFOREACH(v ${vars}) - SET(libadd ${libadd} ${lib}) - ENDFOREACH(lib ${libs}) - TARGET_LINK_LIBRARIES(${name} ${libadd}) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - IF(CMAKE_BUILD_TYPE STREQUAL Debug) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(DEST lib/salome) - - - IF(BEGIN_WITH_lib) - INSTALL(TARGETS ${name} DESTINATION ${DEST}) - - - ELSE(BEGIN_WITH_lib) - - - IF(WINDOWS) - INSTALL(TARGETS ${name} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome/${name}.dll DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.pyd) - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome/${name}.dll DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}_d.pyd) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) - ELSE(WINDOWS) - GET_TARGET_PROPERTY(version ${name} VERSION) - GET_TARGET_PROPERTY(soversion ${name} SOVERSION) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so.${version}) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so.${soversion}) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so) - ENDIF(WINDOWS) - - - ENDIF(BEGIN_WITH_lib) - - - ENDFOREACH(amname ${lib_LTLIBRARIES}) - -FOREACH(f ${salomeinclude_HEADERS}) - - SET(DEST include/salome) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - +SET(VERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}) +SET(SOVERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - +ADD_DEFINITIONS(-DHAVE_SALOME_CONFIG) +INCLUDE_DIRECTORIES(${KERNEL_ROOT_DIR}/include/salome ${CMAKE_BINARY_DIR}/idl) - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - +ADD_LIBRARY(PARAVISEngine SHARED PARAVIS_Engine_i.cc) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - +SET(flags) +FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${KERNEL_CXXFLAGS} ${CORBA_CXXFLAGS} ${CORBA_INCLUDES}) + SET(flags "${flags} ${f}") +ENDFOREACH(f ${var}) - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - +SET_TARGET_PROPERTIES(PARAVISEngine PROPERTIES COMPILE_FLAGS "${flags}") +SET_TARGET_PROPERTIES(PARAVISEngine PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) - ENDIF(ext STREQUAL .py) - -ENDFOREACH(f ${salomeinclude_HEADERS}) +TARGET_LINK_LIBRARIES(PARAVISEngine ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${KERNEL_LDFLAGS} ${SalomeIDLKernel} ${SalomeNS} ${SalomeContainer} ${SALOMELocalTrace} ${CORBA_LIBS} SalomeIDLPARAVIS) +INSTALL(TARGETS PARAVISEngine DESTINATION lib/salome) + +INSTALL(FILES PARAVIS_Engine_i.hh DESTINATION include/salome) diff --git a/src/ENGINE/PARAVIS_Engine_i.cc b/src/ENGINE/PARAVIS_Engine_i.cc index 3b050c31..8bb302df 100644 --- a/src/ENGINE/PARAVIS_Engine_i.cc +++ b/src/ENGINE/PARAVIS_Engine_i.cc @@ -1,24 +1,22 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + #include "PARAVIS_Engine_i.hh" #include "utilities.h" @@ -85,9 +83,9 @@ namespace PARAVIS { _thisObj = this ; _id = _poa->activate_object(_thisObj); #ifndef WIN32 - Engines::Component_var aComponent = session->GetComponent("libPARAVIS.so"); + Engines::EngineComponent_var aComponent = session->GetComponent("libPARAVIS.so"); #else - Engines::Component_var aComponent = session->GetComponent("PARAVIS.dll"); + Engines::EngineComponent_var aComponent = session->GetComponent("PARAVIS.dll"); #endif if (CORBA::is_nil(aComponent)) { MESSAGE("Component PARAVIS is null"); @@ -172,6 +170,15 @@ namespace PARAVIS { myParaVisGen->ImportFile(theFileName); } + void PARAVIS_Gen_i::ExecuteScript(const char* script) + { + if (CORBA::is_nil(myParaVisGen)) { + MESSAGE("PARAVIS_Gen_i is null"); + return; + } + myParaVisGen->ExecuteScript(script); + } + //=========================================================================== char* PARAVIS_Gen_i::GetTrace() { @@ -276,4 +283,15 @@ namespace PARAVIS { { myParaVisGen->ActivateModule(); } + + //=========================================================================== + void PARAVIS_Gen_i::SetCurrentStudy(SALOMEDS::Study_ptr theStudy){ + myParaVisGen->SetCurrentStudy(theStudy); + } + + + //=========================================================================== + SALOMEDS::Study_ptr PARAVIS_Gen_i::GetCurrentStudy(){ + return myParaVisGen->GetCurrentStudy(); + } } diff --git a/src/ENGINE/PARAVIS_Engine_i.hh b/src/ENGINE/PARAVIS_Engine_i.hh index b0feb89a..6ea77ba3 100644 --- a/src/ENGINE/PARAVIS_Engine_i.hh +++ b/src/ENGINE/PARAVIS_Engine_i.hh @@ -1,23 +1,20 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #ifndef __PARAVIS_ENGINE_I_H__ #define __PARAVIS_ENGINE_I_H__ @@ -60,6 +57,8 @@ namespace PARAVIS virtual char* GetIOR(); virtual void ImportFile(const char* theFileName); + + virtual void ExecuteScript(const char* script); virtual char* GetTrace(); @@ -114,6 +113,9 @@ namespace PARAVIS virtual void ActivateModule(); + + virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy); + virtual SALOMEDS::Study_ptr GetCurrentStudy(); }; }; #endif diff --git a/src/Macro/CMakeLists.txt b/src/Macro/CMakeLists.txt new file mode 100644 index 00000000..c7471bb8 --- /dev/null +++ b/src/Macro/CMakeLists.txt @@ -0,0 +1,26 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +#FILE(GLOB copy_FILES "*py") +#INSTALL(FILES ${copy_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/salome/Macros) +INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/src/Macro + DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/salome + FILES_MATCHING PATTERN "*.py" + PATTERN "CVS" EXCLUDE + ) diff --git a/src/Macro/modes.py b/src/Macro/modes.py new file mode 100644 index 00000000..db4b623b --- /dev/null +++ b/src/Macro/modes.py @@ -0,0 +1,93 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +try: paraview.simple +except: from paraview.simple import * +paraview.simple._DisableFirstRenderCameraReset() + +source = GetActiveSource() +representation = GetDisplayProperties(source) +representation.Visibility = 0 + +if source.SMProxy.GetVTKClassName() == 'vtkMedReader' : + source.AnimationMode = 'Modes' + +ExtractSurface1 = ExtractSurface() +ScaleVector1 = ScaleVector() +WarpByVector1 = WarpByVector() + +# first, find the first point-centered vector array. +ExtractSurface1.UpdatePipeline() +info = ExtractSurface1.GetDataInformation() +pinfo = info.DataInformation.GetPointDataInformation() +arrayinfo = None +vectorname = None +rootname = None +for arrayid in range(0, pinfo.GetNumberOfArrays()) : + arrayinfo = pinfo.GetArrayInformation(arrayid) + if arrayinfo.GetNumberOfComponents() == 3 : + vectorname = arrayinfo.GetName() + rootpos = vectorname.rfind("[") + if rootpos == -1 : + rootname = vectorname + else : + rootname = vectorname[0:rootpos-1] + ScaleVector1.VectorField = ['POINTS', vectorname] + WarpByVector1.Vectors = ['POINTS', rootname] + break + +ScaleVector1.ScaleFactor = 0 +ScaleVector1.UpdatePipeline() +bounds = info.DataInformation.GetBounds() +side = [bounds[1] - bounds[0], bounds[3] - bounds[2], bounds[5] - bounds[4]] +length = side[0] +if side[1] > length : length = side[1] +if side[2] > length : length = side[2] + +scale = length / 20 +if vectorname != None : + arrayrange = arrayinfo.GetComponentRange(-1) + if arrayrange[1] > 0 : + scale = scale / arrayrange[1] + +WarpByVector1.ScaleFactor = scale + +AnimationScene1 = GetAnimationScene() + +TimeAnimationCue1 = GetTimeTrack() +TimeAnimationCue1.Enabled = 0 + +KeyFrameAnimationCue1 = GetAnimationTrack( ScaleVector1.GetProperty('ScaleFactor')) +KeyFrame0 = CompositeKeyFrame( KeyValues=[1.0], Interpolation='Sinusoid' ) +KeyFrame1 = CompositeKeyFrame( KeyTime=1.000000001, KeyValues=[1.0] ) + +KeyFrameAnimationCue1.KeyFrames = [ KeyFrame0, KeyFrame1 ] + +AnimationScene1.Cues.append(KeyFrameAnimationCue1) +AnimationScene1.Loop = 1 +AnimationScene1.PlayMode = 'Sequence' +AnimationScene1.NumberOfFrames = 21 + +WarpByVectorDataRepresentation = Show(WarpByVector1) +if rootname != None : + pvLookupTable = GetLookupTableForArray( rootname, 3, VectorMode='Magnitude' ) + WarpByVectorDataRepresentation.ColorArrayName = rootname + WarpByVectorDataRepresentation.LookupTable = pvLookupTable + +AnimationScene1.Play() diff --git a/src/PVGUI/CMakeLists.txt b/src/PVGUI/CMakeLists.txt index 67914b45..4f259991 100644 --- a/src/PVGUI/CMakeLists.txt +++ b/src/PVGUI/CMakeLists.txt @@ -1,723 +1,221 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# PARAVIS : ParaView wrapper SALOME module -# -# Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# Copyright (C) 2010-2012 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. +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# Author : Julia DOROVSKIKH -# Date : 01/06/2005 -# Modified by : Alexander BORODIN (OCN) - autotools usage -# include $(top_srcdir)/adm_local/unix/make_common_starter.am +SET(VERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE}) +SET(SOVERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}) + +ADD_DEFINITIONS(-DHAVE_SALOME_CONFIG) +INCLUDE_DIRECTORIES(${KERNEL_ROOT_DIR}/include/salome ${CMAKE_CURRENT_SOURCE_DIR}/../ParaView ${CMAKE_BINARY_DIR}/idl ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) IF(WITH_VISU) - SET(VISU_PARAVIS_LIBS - -lSalomeIDLVISU - ) - SET(VISU_PARAVIS_DEFINES - -DWITH_VISU - ) + SET(VISU_PARAVIS_LIBS + ${SalomeIDLVISU} + ) + + ADD_DEFINITIONS(-DWITH_VISU) ENDIF(WITH_VISU) #Executable SET(bin_PROGRAMS - vtkWrapIDL_HH - vtkWrapIDL_CC -) - -SET(dist_vtkWrapIDL_HH_SOURCES - ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParse.tab.c - ${CMAKE_SOURCE_DIR}/idl/vtkWrapIDL.c -) -SET(dist_vtkWrapIDL_CC_SOURCES - ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParse.tab.c - ${CMAKE_SOURCE_DIR}/idl/vtkWrapIDL.c -) + vtkWrapIDL_HH + vtkWrapIDL_CC + ) SET(vtkWrapIDL_HH_CPPFLAGS - -DIDL_I_HH - -I${CMAKE_CURRENT_SOURCE_DIR}/../ParaView - -I${CMAKE_BINARY_DIR}/idl - ${PARAVIEW_INCLUDES} - ${VTK_INCLUDES} -) + -DIDL_I_HH + ) SET(vtkWrapIDL_CC_CPPFLAGS - -DIDL_I_CC - -I${CMAKE_CURRENT_SOURCE_DIR}/../ParaView - -I${CMAKE_BINARY_DIR}/idl - ${PARAVIEW_INCLUDES} - ${VTK_INCLUDES} -) - -# $(srcdir)/wrap.am: $(top_srcdir)/wrapfiles.txt -# @cd $(srcdir) && $(srcdir)/create_wrap.sh + -DIDL_I_CC + ) -# include $(srcdir)/wrap.am INCLUDE(wrap.cmake) -# PARAVIS_CreateClass.cxx: $(top_srcdir)/wrapfiles.txt $(WRAP_IDL_I_HH) -# @$(srcdir)/create_class.sh $(top_srcdir) - -# Library target -SET(lib_LTLIBRARIES - libPARAVIS.la -) - # Library sources SET(dist_libPARAVIS_la_SOURCES - PVGUI_Module.h - PVGUI_Module_impl.h - PVGUI_Module.cxx - PVGUI_Module_actions.cxx - PVGUI_Module_widgets.cxx - PVGUI_ViewManager.h - PVGUI_ViewManager.cxx - PVGUI_ViewModel.h - PVGUI_ViewModel.cxx - PVGUI_ViewWindow.h - PVGUI_ViewWindow.cxx - PVGUI_OutputWindowAdapter.h - PVGUI_OutputWindowAdapter.cxx - PVGUI_Tools.h - PVGUI_Tools.cxx - PV_I.h - PARAVIS_Gen_i.hh - PV_Events.h - PV_Tools.h - PARAVIS_Gen_i.cc - PV_Tools.cxx - ${WRAP_IDL_I_HH} - ${WRAP_IDL_I_CC} - PARAVIS_CreateClass.cxx -) + PVGUI_Module.h + PVGUI_Module.cxx + PVGUI_Module_actions.cxx + PVGUI_Module_widgets.cxx + PVGUI_ViewManager.h + PVGUI_ViewManager.cxx + PVGUI_ViewModel.h + PVGUI_ViewModel.cxx + PVGUI_ViewWindow.h + PVGUI_ViewWindow.cxx + PVGUI_OutputWindowAdapter.h + PVGUI_OutputWindowAdapter.cxx + PVGUI_Tools.h + PVGUI_Tools.cxx + PVGUI_ParaViewSettingsPane.h + PVGUI_ParaViewSettingsPane.cxx + PV_I.h + PARAVIS_Gen_i.hh + PV_Events.h + PV_Tools.h + PARAVIS_Gen_i.cc + PV_Tools.cxx + ${WRAP_IDL_I_HH} + ${WRAP_IDL_I_CC} + PARAVIS_CreateClass.cxx + ) + +# Check ParaView documentation file existence +# if it exists add it to the resources (compile into binary form) +# otherwise print warning message +SET(PV_DOC_FILE ${ParaView_INSTALL_PREFIX}/share/doc/paraview-${PARAVIEW_VERSION_MAJOR}.${PARAVIEW_VERSION_MINOR}/paraview.qch) +IF (EXISTS ${PV_DOC_FILE}) + SET(RC_SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/PVGUI.qrc.in) + SET(RC_GENERATED ${CMAKE_CURRENT_BINARY_DIR}/PVGUI.qrc) + MESSAGE(STATUS "Creation of ${RC_GENERATED}") + CONFIGURE_FILE(${RC_SOURCE} ${RC_GENERATED}) + QT4_ADD_RESOURCES(RCS_SOURCES ${RC_GENERATED}) + SET(dist_libPARAVIS_la_SOURCES ${dist_libPARAVIS_la_SOURCES} ${RCS_SOURCES}) + ADD_DEFINITIONS(-DHAS_PV_DOC) +ELSE (EXISTS ${PV_DOC_FILE}) + MESSAGE(WARNING "Help file for ParaView has not been found! ParaView documentation will not be available.") +ENDIF (EXISTS ${PV_DOC_FILE}) # MOC pre-processing SET(MOC_FILES - PVGUI_Module_moc.cxx - PVGUI_ViewManager_moc.cxx - PVGUI_ViewModel_moc.cxx - PVGUI_ViewWindow_moc.cxx -) - -SET(nodist_libPARAVIS_la_SOURCES - ${MOC_FILES} -) + PVGUI_Module_moc.cxx + PVGUI_ViewManager_moc.cxx + PVGUI_ViewModel_moc.cxx + PVGUI_ViewWindow_moc.cxx + PVGUI_ParaViewSettingsPane_moc.cxx + ) # additionnal compilation flags # Note that ParaView uses HDF5 SET(libPARAVIS_la_CPPFLAGS - -ftemplate-depth-32 - ${HDF5_INCLUDES} - ${QT_INCLUDES} - ${QT_ASSISTANT_INCLUDES} - ${PARAVIEW_INCLUDES} - ${VTK_INCLUDES} - ${CAS_CPPFLAGS} - ${PYTHON_INCLUDES} - ${CAS_CPPFLAGS} - ${CAS_CXXFLAGS} - ${KERNEL_CXXFLAGS} - ${CORBA_CXXFLAGS} - ${CORBA_INCLUDES} - ${GUI_CXXFLAGS} - ${VISU_CXXFLAGS} - ${MED_CXXFLAGS} - -I${CMAKE_CURRENT_SOURCE_DIR} - -I${CMAKE_BINARY_DIR}/idl - -I${CMAKE_CURRENT_SOURCE_DIR}/../../idl - -I${CMAKE_BINARY_DIR}/salome_adm/unix - ${VISU_PARAVIS_DEFINES} -) - -# additionnal linkage flags -# Note that ParaView uses HDF5 -SET(libPARAVIS_la_LDFLAGS - ${PYTHON_LIBS} - ${QT_MT_LIBS} - ${HDF5_LIBS} - ${QT_ASSISTANT_LIBS} - ${PARAVIEW_LIBS} - ${CMAKE_BINARY_DIR}/idl/libSalomeIDLPARAVIS.la - ${KERNEL_LDFLAGS} - ${SalomeNS} - ${SalomeDSClient} - ${SalomeContainer} - ${SalomeLifeCycleCORBA} - ${GUI_LDFLAGS} - ${SalomeApp} - ${LightApp} - ${VISU_LDFLAGS} - ${VISU_PARAVIS_LIBS} -) - -SET(libPARAVIS_la_LIBADD - ${SalomeIDLKernel} - ${SalomeHDFPersist} - ${SalomeGenericObj} - ${SalomeContainer} - ${SalomeCommunication} - ${SalomeNS} - ${TOOLSDS} - ${OpUtil} - ${SalomeLifeCycleCORBA} - ${Event} - ${SalomeApp} - ${SalomeSession} - ${qtx} - ${LightApp} -) + -ftemplate-depth-32 + ${QT_INCLUDES} + ${QT_ASSISTANT_INCLUDES} + ${PYTHON_INCLUDES} + ${CAS_CPPFLAGS} + ${CAS_CXXFLAGS} + ${KERNEL_CXXFLAGS} + ${CORBA_CXXFLAGS} + ${CORBA_INCLUDES} + ${BOOST_CPPFLAGS} + ${GUI_CXXFLAGS} + ${MED_CXXFLAGS} + ${VISU_CXXFLAGS} + ${VISU_PARAVIS_DEFINES} + ) + +# remove deprecation warnings from Paraview +IF(WINDOWS) +ELSE(WINDOWS) + SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations") +ENDIF(WINDOWS) -# # resources files SET(nodist_salomeres_DATA - PARAVIS_images.qm - PARAVIS_msg_en.qm + PARAVIS_images.qm + PARAVIS_msg_en.qm + PARAVIS_msg_fr.qm + ) + +SET(srcs) +FOREACH(src ${dist_libPARAVIS_la_SOURCES}) + SET(srcs ${srcs} ${src}) +ENDFOREACH(src ${dist_libPARAVIS_la_SOURCES}) + +FOREACH(f ${MOC_FILES}) + SET(srcs ${srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f}) +ENDFOREACH(f ${MOC_FILES}) + +ADD_LIBRARY(PARAVIS SHARED ${srcs}) + +SET(flags) +FOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${libPARAVIS_la_CPPFLAGS}) + SET(flags "${flags} ${f}") +ENDFOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${libPARAVIS_la_CPPFLAGS}) + +SET_TARGET_PROPERTIES(PARAVIS PROPERTIES COMPILE_FLAGS "${flags}") +SET_TARGET_PROPERTIES(PARAVIS PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) + +TARGET_LINK_LIBRARIES(PARAVIS + ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} + ${CORBA_LIBS} + ${QT_LIBS} + ${CAS_KERNEL} + ${VTK_LIBS} + ${PYTHON_LIBS} + ${KERNEL_LDFLAGS} ${SalomeDS} ${SALOMELocalTrace} ${SalomeIDLKernel} ${SalomeNS} ${SalomeLifeCycleCORBA} ${SalomeContainer} ${TOOLSDS} + ${GUI_LDFLAGS} ${SalomeApp} ${LightApp} ${CAM} ${qtx} ${suit} ${Event} ${PyInterp} ${SalomeObject} + ${MED_LDFLAGS} ${SalomeIDLMED} + ${VISU_LDFLAGS} + ${VISU_PARAVIS_LIBS} + ${PARAVIEW_LIBS} + SalomeIDLPARAVIS ) - -# mostlyclean-local: clean-wrap - -# clean-wrap: -# -rm -f *.hh *.cc PARAVIS_CreateClass.cxx - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - - - FOREACH(amname ${lib_LTLIBRARIES}) - - - STRING(REPLACE .la _la amname ${amname}) - - - STRING(LENGTH ${amname} len) - MATH(EXPR newlen "${len}-3") - STRING(SUBSTRING ${amname} 0 ${newlen} name) - - - STRING(REGEX MATCH "^lib" BEGIN_WITH_lib ${name}) - IF(BEGIN_WITH_lib) - STRING(LENGTH ${name} len) - MATH(EXPR newlen "${len}-3") - STRING(SUBSTRING ${name} 3 ${newlen} name) - ENDIF(BEGIN_WITH_lib) - - - STRING(REGEX MATCH "IDL" ISIDL ${name}) - - - IF(ISIDL) - IF(WINDOWS) - SET(type STATIC) - ELSE(WINDOWS) - SET(type SHARED) - ENDIF(WINDOWS) - ELSE(ISIDL) - SET(type SHARED) - ENDIF(ISIDL) - - - SET(srcs) - FOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) - GET_FILENAME_COMPONENT(ext ${src} EXT) - IF(ext STREQUAL .f) - IF(src STREQUAL trte.f) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) - STRING(REPLACE ".f" ".c" src ${src}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) - SET(output ${src}) - ADD_CUSTOM_COMMAND( - OUTPUT ${output} - COMMAND f2c ${input} - MAIN_DEPENDENCY ${input} - ) - ELSE(src STREQUAL trte.f) - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${src}) - STRING(REPLACE ".f" ".o" src ${src}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${src}) - SET(output ${src}) - IF(WINDOWS) - SET(F77 g77) - ELSE(WINDOWS) - SET(F77 gfortran) - ENDIF(WINDOWS) - ADD_CUSTOM_COMMAND( - OUTPUT ${output} - COMMAND ${F77} -c -o ${output} ${input} - MAIN_DEPENDENCY ${input} - ) - ENDIF(src STREQUAL trte.f) - ENDIF(ext STREQUAL .f) - SET(srcs ${srcs} ${src}) - ENDFOREACH(src ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) - - - SET(l ${nodist_${amname}_SOURCES} ${UIC_FILES}) - FOREACH(f ${l}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${f}) - SET(srcs ${srcs} ${src}) - ENDFOREACH(f ${l}) - - - SET(build_srcs) - SET(l ${nodist_${amname}_SOURCES} ${BUILT_SOURCES}) - FOREACH(f ${l}) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - ELSE(ext STREQUAL .py) - SET(build_srcs ${build_srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f}) - ENDIF(ext STREQUAL .py) - ENDFOREACH(f ${l}) - - - ADD_LIBRARY(${name} ${type} ${srcs}) - - - SET(var) - IF(WINDOWS) - SET(targets) - SET(targets ${targets} SalomeIDLKernel) - SET(targets ${targets} SalomeDS) - SET(targets ${targets} SALOMEDSTest) - SET(targets ${targets} SALOMEDS_Client_exe) - SET(targets ${targets} SalomeIDLGEOM) - SET(targets ${targets} GEOMEngine) - SET(targets ${targets} MEDEngine) - SET(targets ${targets} SMESHEngine) - SET(targets ${targets} SMESH) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(var ${var} -DNOGDI) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(var ${var} -I${dir}) - SET(var ${var} -DF2C_BUILD) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(var ${var} ${AM_CPPFLAGS}) - SET(var ${var} ${AM_CXXFLAGS}) - - - SET(var ${var} ${PLATFORM_CPPFLAGS}) - SET(var ${var} ${PTHREAD_CFLAGS}) - SET(var ${var} ${${amname}_CPPFLAGS}) - SET(var ${var} ${${amname}_CXXFLAGS}) - SET(var ${var} ${${amname}_CFLAGS}) - SET(vars) - IF(WINDOWS) - SET(vars ${vars} -include SALOMEconfig.h) - SET(vars ${vars} -ftemplate-depth-32) - SET(vars ${vars} -fPIC) - SET(vars ${vars} -g) - ENDIF(WINDOWS) - SET(flags) - FOREACH(f ${var}) - FOREACH(v ${vars}) - IF(f STREQUAL v) - SET(f) - ENDIF(f STREQUAL v) - ENDFOREACH(v ${vars}) - SET(flags "${flags} ${f}") - ENDFOREACH(f ${var}) - SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") - - - SET_TARGET_PROPERTIES(${name} PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO}) - - - SET(libadd) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(libadd ${libadd} ${dir}/LIBF77.lib) - SET(libadd ${libadd} ${dir}/LIBI77.lib) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) - FOREACH(lib SALOMEBasics SalomeBatch) - IF(name STREQUAL lib) - SET(libs ${libs} ${PTHREAD_LIBS}) - ENDIF(name STREQUAL lib) - ENDFOREACH(lib SALOMEBasics SalomeBatch) - - - FOREACH(lib ${libs}) - GET_FILENAME_COMPONENT(ext ${lib} EXT) - IF(ext STREQUAL .la) - GET_FILENAME_COMPONENT(lib ${lib} NAME_WE) - STRING(REGEX REPLACE "^lib" "" lib ${lib}) - ENDIF(ext STREQUAL .la) - SET(vars) - SET(vars ${vars} -no-undefined) - SET(vars ${vars} -lvtkWidgets) - IF(WINDOWS) - SET(vars ${vars} -module) - SET(vars ${vars} -Wl,-E) - SET(vars ${vars} -Xlinker) - SET(vars ${vars} -export-dynamic) - SET(vars ${vars} -lm) - SET(vars ${vars} -lboost_thread) - SET(vars ${vars} -lboost_signals) - SET(vars ${vars} -pthread -lpthread -ldl) - ENDIF(WINDOWS) - FOREACH(v ${vars}) - IF(lib STREQUAL v) - SET(lib) - ENDIF(lib STREQUAL v) - ENDFOREACH(v ${vars}) - SET(libadd ${libadd} ${lib}) - ENDFOREACH(lib ${libs}) - TARGET_LINK_LIBRARIES(${name} ${libadd}) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - IF(CMAKE_BUILD_TYPE STREQUAL Debug) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(DEST lib/salome) - - - IF(BEGIN_WITH_lib) - INSTALL(TARGETS ${name} DESTINATION ${DEST}) - - - ELSE(BEGIN_WITH_lib) - - - IF(WINDOWS) - INSTALL(TARGETS ${name} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome) - IF(CMAKE_BUILD_TYPE STREQUAL Release) - INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome/${name}.dll DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.pyd) - ELSE(CMAKE_BUILD_TYPE STREQUAL Release) - INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION}/site-packages/salome/${name}.dll DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}_d.pyd) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Release) - ELSE(WINDOWS) - GET_TARGET_PROPERTY(version ${name} VERSION) - GET_TARGET_PROPERTY(soversion ${name} SOVERSION) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so.${version}) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so.${soversion}) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${name}.so.${version} DESTINATION lib/python${PYTHON_VERSION}/site-packages/salome RENAME ${name}.so) - ENDIF(WINDOWS) - - - ENDIF(BEGIN_WITH_lib) - - - ENDFOREACH(amname ${lib_LTLIBRARIES}) - - - FOREACH(amname ${bin_PROGRAMS} ${check_PROGRAMS}) - - - SET(name "${amname}_exe") - SET(srcs ${${amname}_SOURCES} ${dist_${amname}_SOURCES}) - SET(l ${nodist_${amname}_SOURCES}) - FOREACH(f ${l}) - SET(src ${CMAKE_CURRENT_BINARY_DIR}/${f}) - SET(srcs ${srcs} ${src}) - ENDFOREACH(f ${l}) - LIST(LENGTH srcs nb) - IF(nb) - ADD_EXECUTABLE(${name} ${srcs}) - - - SET(var) - IF(WINDOWS) - SET(targets) - SET(targets ${targets} SalomeIDLKernel) - SET(targets ${targets} SalomeDS) - SET(targets ${targets} SALOMEDSTest) - SET(targets ${targets} SALOMEDS_Client_exe) - SET(targets ${targets} SalomeIDLGEOM) - SET(targets ${targets} GEOMEngine) - SET(targets ${targets} MEDEngine) - SET(targets ${targets} SMESHEngine) - SET(targets ${targets} SMESH) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(var ${var} -DNOGDI) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(var ${var} -I${dir}) - SET(var ${var} -DF2C_BUILD) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(var ${var} ${AM_CPPFLAGS}) - SET(var ${var} ${AM_CXXFLAGS}) - - - SET(var ${var} ${PLATFORM_CPPFLAGS}) - SET(var ${var} ${PTHREAD_CFLAGS}) - SET(var ${var} ${${amname}_CPPFLAGS}) - SET(var ${var} ${${amname}_CXXFLAGS}) - SET(var ${var} ${${amname}_CFLAGS}) - SET(vars) - IF(WINDOWS) - SET(vars ${vars} -include SALOMEconfig.h) - SET(vars ${vars} -ftemplate-depth-32) - SET(vars ${vars} -fPIC) - SET(vars ${vars} -g) - ENDIF(WINDOWS) - SET(flags) - FOREACH(f ${var}) - FOREACH(v ${vars}) - IF(f STREQUAL v) - SET(f) - ENDIF(f STREQUAL v) - ENDFOREACH(v ${vars}) - SET(flags "${flags} ${f}") - ENDFOREACH(f ${var}) - SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") - - - SET(libadd) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - SET(dir $ENV{F2CHOME}) - STRING(REPLACE "\\\\" "/" dir ${dir}) - SET(libadd ${libadd} ${dir}/LIBF77.lib) - SET(libadd ${libadd} ${dir}/LIBI77.lib) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(libs ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${${amname}_LIBADD} ${${amname}_LDADD} ${${amname}_LDFLAGS}) - FOREACH(lib SALOMEBasics SalomeBatch) - IF(name STREQUAL lib) - SET(libs ${libs} ${PTHREAD_LIBS}) - ENDIF(name STREQUAL lib) - ENDFOREACH(lib SALOMEBasics SalomeBatch) - - - SET(libs ${libs} ${LDADD}) - - - FOREACH(lib ${libs}) - GET_FILENAME_COMPONENT(ext ${lib} EXT) - IF(ext STREQUAL .la) - GET_FILENAME_COMPONENT(lib ${lib} NAME_WE) - STRING(REGEX REPLACE "^lib" "" lib ${lib}) - ENDIF(ext STREQUAL .la) - SET(vars) - SET(vars ${vars} -no-undefined) - SET(vars ${vars} -lvtkWidgets) - IF(WINDOWS) - SET(vars ${vars} -module) - SET(vars ${vars} -Wl,-E) - SET(vars ${vars} -Xlinker) - SET(vars ${vars} -export-dynamic) - SET(vars ${vars} -lm) - SET(vars ${vars} -lboost_thread) - SET(vars ${vars} -lboost_signals) - SET(vars ${vars} -pthread -lpthread -ldl) - ENDIF(WINDOWS) - FOREACH(v ${vars}) - IF(lib STREQUAL v) - SET(lib) - ENDIF(lib STREQUAL v) - ENDFOREACH(v ${vars}) - SET(libadd ${libadd} ${lib}) - ENDFOREACH(lib ${libs}) - TARGET_LINK_LIBRARIES(${name} ${libadd}) - - - IF(WINDOWS) - SET(targets) - SET(targets ${targets} MEFISTO2D) - FOREACH(target ${targets}) - IF(name STREQUAL ${target}) - IF(CMAKE_BUILD_TYPE STREQUAL Debug) - SET_TARGET_PROPERTIES(${name} PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT") - ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug) - ENDIF(name STREQUAL ${target}) - ENDFOREACH(target ${targets}) - ENDIF(WINDOWS) - - - SET(DEST bin/salome) - - - IF(WINDOWS) - INSTALL(TARGETS ${name} DESTINATION ${DEST}) - INSTALL(FILES ${CMAKE_INSTALL_PREFIX}/${DEST}/${name}.exe DESTINATION ${DEST} RENAME ${amname}.exe) - INSTALL(CODE "FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${name}.exe)") - ELSE(WINDOWS) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${name} DESTINATION ${DEST} PERMISSIONS ${PERMS} RENAME ${amname}) - ENDIF(WINDOWS) - - - ENDIF(nb) - - - ENDFOREACH(amname ${bin_PROGRAMS} ${check_PROGRAMS}) - - - FOREACH(output ${MOC_FILES}) - - - STRING(REGEX REPLACE _moc.cxx .h input ${output}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output}) - ADD_CUSTOM_COMMAND( - OUTPUT ${output} - COMMAND ${QT_MOC_EXECUTABLE} ${MOC_FLAGS} ${input} -o ${output} - MAIN_DEPENDENCY ${input} - ) - ENDFOREACH(output ${MOC_FILES}) +INSTALL(TARGETS PARAVIS DESTINATION lib/salome) + +FOREACH(name ${bin_PROGRAMS}) + ADD_EXECUTABLE(${name} + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParse.tab.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParsePreprocess.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseHierarchy.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseMain.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseExtras.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkWrap.c + ${CMAKE_SOURCE_DIR}/src/ParaView/vtkWrapText.c + ${CMAKE_SOURCE_DIR}/idl/vtkWrapIDL.c) + ADD_DEPENDENCIES(${name} generate_txt) + + SET(flags) + FOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${${name}_CPPFLAGS}) + SET(flags "${flags} ${f}") + ENDFOREACH(f ${PARAVIEW_INCLUDES} ${VTK_INCLUDES} ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${${name}_CPPFLAGS}) + + SET_TARGET_PROPERTIES(${name} PROPERTIES COMPILE_FLAGS "${flags}") + TARGET_LINK_LIBRARIES(${name} ${PLATFORM_LIBADD}) + + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${name}) + IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${name}.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(${name}_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${name}.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) + ENDIF(WINDOWS) + INSTALL(FILES ${${name}_EXEFILE} DESTINATION bin/salome PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) +ENDFOREACH(name ${bin_PROGRAMS}) + +FOREACH(output ${MOC_FILES}) + STRING(REGEX REPLACE _moc.cxx .h input ${output}) + + SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input}) + SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output}) + ADD_CUSTOM_COMMAND( + OUTPUT ${output} + COMMAND ${QT_MOC_EXECUTABLE} ${MOC_FLAGS} ${input} -o ${output} + MAIN_DEPENDENCY ${input} + ) +ENDFOREACH(output ${MOC_FILES}) FOREACH(f ${nodist_salomeres_DATA}) - - SET(DEST share/salome/resources/paravis) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - - ENDIF(ext STREQUAL .py) - + STRING(REGEX REPLACE .qm .ts input ${f}) + SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) + SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) + EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) + INSTALL(FILES ${output} DESTINATION share/salome/resources/paravis) ENDFOREACH(f ${nodist_salomeres_DATA}) diff --git a/src/PVGUI/PARAVIS_Gen_i.cc b/src/PVGUI/PARAVIS_Gen_i.cc index 70ac58e1..e31a4f52 100644 --- a/src/PVGUI/PARAVIS_Gen_i.cc +++ b/src/PVGUI/PARAVIS_Gen_i.cc @@ -1,25 +1,21 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// PARAVIS OBJECT : interactive object for PARAVIS entities implementation // File : PARAVIS_Gen_i.cc // Author : Vitaly Smetannikov // Module : PARAVIS @@ -85,6 +81,30 @@ PARAVIS_I_EXPORT PARAVIS::PARAVIS_Gen_ptr GetImpl(CORBA::ORB_ptr theORB, namespace PARAVIS { + + const char* checkNullStr(const char* theStr) + { + if (strcmp(theStr, "NULL") == 0) + return NULL; + else + return theStr; + } + + std::string tabify( const std::string& source, bool isTabify ) + { + std::string result = source; + if ( isTabify && !result.empty() ) { + std::string caret = "\n"; + int idx = result.rfind( caret ); + while ( idx != std::string::npos ) { + result.replace( idx, caret.size(), "\n\t" ); + idx = result.rfind( caret, idx-1 ); + } + result.insert(0, "\t" ); + } + return result; + } + PARAVIS_Base_i::~PARAVIS_Base_i() { if(mySmartPointer != NULL) mySmartPointer->Delete(); } @@ -179,6 +199,12 @@ namespace PARAVIS ProcessVoidEvent(new TImportFile(mySalomeApp, theFileName)); } + void PARAVIS_Gen_i::ExecuteScript(const char* script) + { + if(MYDEBUG) MESSAGE("PARAVIS_Gen_i::ExecuteScript: " <GetStudy(); + SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(theComponent); + for (; anIter->More(); anIter->Next()) { + SALOMEDS::SObject_var aSObj = anIter->Value(); + SALOMEDS::GenericAttribute_var anAttr; + if (!aSObj->FindAttribute(anAttr, "AttributeLocalID")) { + continue; + } + SALOMEDS::AttributeLocalID_var anID = SALOMEDS::AttributeLocalID::_narrow(anAttr); + if (!anID->Value() == PVSTATEID) { + continue; + } + if (aSObj->FindAttribute(anAttr, "AttributeString")) { + SALOMEDS::AttributeString_var aStringAttr = SALOMEDS::AttributeString::_narrow(anAttr); + QString aStateFile(aStringAttr->Value()); + printf("getAllSavedStates, aStateFile = %s\n", aStateFile.toLatin1().constData()); + // Replace the old path with the new one + if (!theNewPath.isEmpty()) { + QFileInfo aFileInfo(aStateFile); + QString aPath = aFileInfo.path(); + aStateFile.replace(aPath, theNewPath); + aStringAttr->SetValue(aStateFile.toLatin1().constData()); + + printf("getAllSavedStates, aStateFile NEW = %s\n", aStateFile.toLatin1().constData()); + } + aStateFiles<resourceMgr(); int aSavingType = aResourceMgr->integerValue( "PARAVIS", "savestate_type", 0 ); @@ -334,8 +402,16 @@ namespace PARAVIS if (aIsBuiltIn) { - // Find referenced files and collect their paths nullyfying references + // Find referenced files and collect their paths nullyfying references: + + // for saved states + foreach (QString aState, aSavedStates) { + processAllFilesInState(aState.toLatin1().constData(), aFileNames, 0); + } + + // for main state processAllFilesInState(aFile.c_str(), aFileNames, 0); + SetRestoreParam(theComponent, true); } else { SetRestoreParam(theComponent, false); @@ -345,6 +421,13 @@ namespace PARAVIS case 1: //Save referenced files when they are accessible { // Find referenced files and collect their paths nullyfying references + + // for saved states + foreach (QString aState, aSavedStates) { + processAllFilesInState(aState.toLatin1().constData(), aFileNames, 0); + } + + // for main state processAllFilesInState(aFile.c_str(), aFileNames, 0); SetRestoreParam(theComponent, true); } @@ -353,7 +436,16 @@ namespace PARAVIS SetRestoreParam(theComponent, false); break; } + + // Add saved states + foreach (QString aSavedState, aSavedStates) { + aFileNames<length() - 1]); QStringList aEmptyList; processAllFilesInState(aFile.c_str(), aEmptyList, aTmpDir.c_str(), aRestore); ProcessVoidEvent(new TLoadStateFile(theApp, aFile.c_str())); + // Process saved states + QStringList aSavedStates = getAllSavedStates(theComponent, QString(aTmpDir.c_str())); + foreach(QString aState, aSavedStates) { + processAllFilesInState(aState.toLatin1().constData(), + aEmptyList, aTmpDir.c_str(), aRestore); + } + return true; } //---------------------------------------------------------------------------- - bool PARAVIS_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile& theStream, + bool PARAVIS_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent, const SALOMEDS::TMPFile& theStream, const char* theURL, bool isMultiFile) { return LoadState(mySalomeApp, theComponent, theStream, theURL, isMultiFile); @@ -496,7 +595,7 @@ namespace PARAVIS //---------------------------------------------------------------------------- PARAVIS::string_array* PARAVIS_Gen_i::GetClassesList() { - int k; + uint k; for (k = 0; strcmp(wrapped_classes[k], "") != 0; k++); PARAVIS::string_array_var aNames = new PARAVIS::string_array(); aNames->length(k); @@ -540,11 +639,16 @@ namespace PARAVIS //---------------------------------------------------------------------------- Engines::TMPFile* PARAVIS_Gen_i::DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean theIsPublished, + CORBA::Boolean theIsMultiFile, CORBA::Boolean& theIsValidScript) { theIsValidScript = true; - std::string aResult(ProcessEvent(new TGetTrace(mySalomeApp))); - aResult += "\ndef RebuildData(theStudy):\n pass\n"; + std::string aResult; + if ( theIsMultiFile ) + aResult += "\ndef RebuildData(theStudy):\n"; + aResult += tabify(ProcessEvent(new TGetTrace(mySalomeApp)), theIsMultiFile ); + if ( theIsMultiFile ) + aResult += "\n\tpass\n"; CORBA::ULong aSize = aResult.size() + 1; char* aBuffer = new char[aSize]; memset(aBuffer, 0, aSize); @@ -558,4 +662,67 @@ namespace PARAVIS { ProcessVoidEvent(new TActivateModule(mySalomeApp)); } + + //---------------------------------------------------------------------------- + struct TSetStudyEvent: public SALOME_Event { + std::string myStudyName; + typedef SalomeApp_Application* TResult; + TResult myResult; + + TSetStudyEvent(const std::string theStudyName):myStudyName(theStudyName), myResult(0) {} + virtual void Execute() + { + bool isActive = false; + SUIT_Session* aSession = SUIT_Session::session(); + QList anApplications = aSession->applications(); + QList::Iterator anIter = anApplications.begin(); + SUIT_Application* aFirstApp = *anIter; + while (anIter != anApplications.end()) { + SUIT_Application* anApp = *anIter; + if (SUIT_Study* aSStudy = anApp->activeStudy()) { + if (SalomeApp_Study* aStudy = dynamic_cast(aSStudy)) { + if (_PTR(Study) aCStudy = aStudy->studyDS()) { + if(MYDEBUG) MESSAGE("There is an application with active study : StudyId = " + << aCStudy->StudyId() << "; Name = '" << aCStudy->Name() << "'"); + if (myStudyName == aCStudy->Name()) { + isActive = true; + break; + } + } + } + } + anIter++; + } + SalomeApp_Application* anApp = dynamic_cast(aFirstApp); + if (!isActive) { + MESSAGE("!!! anApp->onLoadDoc(myStudyName) !!!"); + // Has to be loaded in an empty or in a new application + anApp->onLoadDoc(myStudyName.c_str()); + } + myResult = anApp; + } + }; + + void PARAVIS_Gen_i::SetCurrentStudy(SALOMEDS::Study_ptr theStudy) + { + if (!CORBA::is_nil(theStudy)) { + CORBA::String_var aName = theStudy->Name(); + std::string aStudyName (aName.in()); + + myStudyDocument = SALOMEDS::Study::_duplicate(theStudy); + SalomeApp_Application* anApp = ProcessEvent(new TSetStudyEvent(aStudyName)); + if (!mySalomeApp) + mySalomeApp = anApp; + } else { + INFOS("CORBA::is_nil(theStudy)"); + } + } + + + //---------------------------------------------------------------------------- + SALOMEDS::Study_ptr PARAVIS_Gen_i::GetCurrentStudy() + { + return SALOMEDS::Study::_duplicate(myStudyDocument); + } + } diff --git a/src/PVGUI/PARAVIS_Gen_i.hh b/src/PVGUI/PARAVIS_Gen_i.hh index 91b3746a..11b2fc99 100644 --- a/src/PVGUI/PARAVIS_Gen_i.hh +++ b/src/PVGUI/PARAVIS_Gen_i.hh @@ -1,23 +1,20 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : PARAVIS_Gen_i.hh // Author : Vitaly Smetannikov @@ -49,9 +46,13 @@ class SalomeApp_Application; class PVGUI_Module; class vtkObjectBase; +#define PVSTATEID 15555 + namespace PARAVIS { + const char* checkNullStr(const char* theStr); + /*! * Base implementation for all container objects for Paravis serevrmanager API classes */ @@ -67,8 +68,14 @@ namespace PARAVIS //! Initialises internal pointer on existing Paraview class instance virtual void Init(::vtkObjectBase* base); + virtual ::vtkObjectBase* GetNew() { return NULL; } + //! Returns pointer on internal Paraview class instance - virtual ::vtkObjectBase* getVTKObject() { return mySmartPointer.GetPointer(); } + virtual ::vtkObjectBase* getVTKObject() + { if (mySmartPointer == NULL) + mySmartPointer = GetNew(); + return mySmartPointer.GetPointer(); + } //! The same as previous in static context static ::vtkObjectBase* getVTKObject(PARAVIS_Base_ptr theBase); @@ -104,6 +111,9 @@ namespace PARAVIS //! Import file to PARAVIS module by its name. virtual void ImportFile(const char* theFileName); + + //! Execute a PARAVIS script on Session + virtual void ExecuteScript(const char* script); //! Returns Trace string. If Trace is not activated then empty string is returned virtual char* GetTrace(); @@ -114,6 +124,7 @@ namespace PARAVIS //! inherited methods from Engines::Component virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy, CORBA::Boolean theIsPublished, + CORBA::Boolean theIsMultiFile, CORBA::Boolean& theIsValidScript); //! inherited methods from SALOMEDS::Driver @@ -184,6 +195,10 @@ namespace PARAVIS //! Implementation of PARAVIS_Gen interface virtual void ActivateModule(); + virtual void SetCurrentStudy(SALOMEDS::Study_ptr theStudy); + + virtual SALOMEDS::Study_ptr GetCurrentStudy(); + //! Returns current ORB static CORBA::ORB_var GetORB() { return myOrb;} diff --git a/src/PVGUI/PVGUI.qrc.in b/src/PVGUI/PVGUI.qrc.in new file mode 100644 index 00000000..466b9797 --- /dev/null +++ b/src/PVGUI/PVGUI.qrc.in @@ -0,0 +1,6 @@ + + + ${PV_DOC_FILE} + + + diff --git a/src/PVGUI/PVGUI_Module.cxx b/src/PVGUI/PVGUI_Module.cxx index f0a6473a..b4f346df 100644 --- a/src/PVGUI/PVGUI_Module.cxx +++ b/src/PVGUI/PVGUI_Module.cxx @@ -1,7 +1,6 @@ // PARAVIS : ParaView wrapper SALOME module // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2010-2012 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 @@ -21,25 +20,33 @@ // // File : PVGUI_Module.cxx // Author : Julia DOROVSKIKH -// +#include // E.A. must be included before Python.h to fix compilation on windows +#ifdef HAVE_FINITE +#undef HAVE_FINITE // VSR: avoid compilation warning on Linux : "HAVE_FINITE" redefined +#endif #include // Python first #include "PVGUI_Module.h" #include "SALOMEconfig.h" +#ifdef WITH_VISU #include CORBA_CLIENT_HEADER(VISU_Gen) +#endif #include CORBA_SERVER_HEADER(SALOMEDS) #include "PARAVIS_Gen_i.hh" -#include "PVGUI_Module_impl.h" +#include "PV_Tools.h" + #include "PVGUI_ViewModel.h" #include "PVGUI_ViewManager.h" #include "PVGUI_ViewWindow.h" #include "PVGUI_Tools.h" -//#include "PVGUI_Trace.h" +#include "PVGUI_ParaViewSettingsPane.h" +#include "PVGUI_OutputWindowAdapter.h" +#include #include #include #include @@ -48,10 +55,11 @@ // SALOME Includes #include "SALOME_LifeCycleCORBA.hxx" -#include "SALOME_ListIteratorOfListIO.hxx" #include "SALOMEDS_SObject.hxx" -#include +#include "LightApp_SelectionMgr.h" +#include "LightApp_NameDlg.h" + #include #include #include @@ -69,6 +77,7 @@ #include #include #include +#include #include #include #include @@ -76,8 +85,11 @@ #include #include #include +#include +#include #include +#include #include #include #include @@ -85,21 +97,30 @@ #include #include #include -#include +#include #include -#include +//#include #include #include #include #include #include -#include +//#include +#include "pqInterfaceTracker.h" #include #include #include #include -#include "pqBrandPluginsLoader.h" +#include #include +#include +#include +#include +#include + +#include + +#include /* * Make sure all the kits register their classes with vtkInstantiator. @@ -129,22 +150,24 @@ #include #include #include +#include #include +#include #include #include #include #include -//#include #include #include #include #include +#include //---------------------------------------------------------------------------- -pqApplicationCore* PVGUI_Module::pqImplementation::Core = 0; -PVGUI_OutputWindowAdapter* PVGUI_Module::pqImplementation::OutputWindowAdapter = 0; -QPointer PVGUI_Module::pqImplementation::helpWindow = 0; +pqPVApplicationCore* PVGUI_Module::MyCoreApp = 0; +//PVGUI_OutputWindowAdapter* PVGUI_Module::pqImplementation::OutputWindowAdapter = 0; +//QPointer PVGUI_Module::pqImplementation::helpWindow = 0; PVGUI_Module* ParavisModule = 0; @@ -221,15 +244,32 @@ PVGUI_Module* ParavisModule = 0; PVGUI_Module::PVGUI_Module() : SalomeApp_Module( "PARAVIS" ), LightApp_Module( "PARAVIS" ), - Implementation( 0 ), + // Implementation( 0 ), mySelectionControlsTb( -1 ), mySourcesMenuId( -1 ), myFiltersMenuId( -1 ), myMacrosMenuId(-1), myToolbarsMenuId(-1), - myOldMsgHandler(0) + myRecentMenuId(-1), + myOldMsgHandler(0), + myTraceWindow(0), + myStateCounter(0) { +#ifdef HAS_PV_DOC + Q_INIT_RESOURCE( PVGUI ); +#endif ParavisModule = this; + + // Clear old macros + QString aDestPath = QString( "%1/.config/%2/Macros" ).arg( QDir::homePath() ).arg( QApplication::applicationName() ); + QStringList aFilter; + aFilter << "*.py"; + + QDir aDestDir(aDestPath); + QStringList aDestFiles = aDestDir.entryList(aFilter, QDir::Files); + foreach (QString aStr, aDestFiles) { + aDestDir.remove(aStr); + } } /*! @@ -249,6 +289,11 @@ void PVGUI_Module::initialize( CAM_Application* app ) { SalomeApp_Module::initialize( app ); + // Create ParaViS actions + createActions(); + // Create ParaViS menus + createMenus(); + // Uncomment to debug ParaView initialization // "aa" used instead of "i" as GDB doesn't like "i" variables :) /* @@ -262,11 +307,17 @@ void PVGUI_Module::initialize( CAM_Application* app ) pvInit(); // Create GUI elements (menus, toolbars, dock widgets) - if ( !Implementation ){ + //if ( !Implementation ){ SalomeApp_Application* anApp = getApp(); + SUIT_Desktop* aDesktop = anApp->desktop(); + + // connect(aDesktop, SIGNAL() + + // Remember current state of desktop toolbars + QList foreignToolbars = aDesktop->findChildren(); // Simulate ParaView client main window - Implementation = new pqImplementation( anApp->desktop() ); + //Implementation = new pqImplementation( aDesktop ); setupDockWidgets(); @@ -278,10 +329,12 @@ void PVGUI_Module::initialize( CAM_Application* app ) // Has to be replaced in order to exclude using of pqQtMessageHandlerBehaviour // Start pqParaViewBehaviors // Register ParaView interfaces. - pqPluginManager* pgm = pqApplicationCore::instance()->getPluginManager(); + //pqPluginManager* pgm = pqApplicationCore::instance()->getPluginManager(); + pqInterfaceTracker* pgm = pqApplicationCore::instance()->interfaceTracker(); // * adds support for standard paraview views. pgm->addInterface(new pqStandardViewModules(pgm)); + pgm->addInterface(new pqStandardSummaryPanelImplementation(pgm)); // Load plugins distributed with application. pqApplicationCore::instance()->loadDistributedPlugins(); @@ -291,6 +344,7 @@ void PVGUI_Module::initialize( CAM_Application* app ) new pqDataTimeStepBehavior(this); new pqViewFrameActionsBehavior(this); new pqSpreadSheetVisibilityBehavior(this); + new pqPipelineContextMenuBehavior(this); new pqDefaultViewBehavior(this); new pqAlwaysConnectedBehavior(this); new pqPVNewSourceBehavior(this); @@ -298,78 +352,138 @@ void PVGUI_Module::initialize( CAM_Application* app ) new pqUndoRedoBehavior(this); new pqCrashRecoveryBehavior(this); new pqAutoLoadPluginXMLBehavior(this); - new pqPluginDockWidgetsBehavior(getApp()->desktop()); - new pqPluginActionGroupBehavior(getApp()->desktop()); + new pqPluginDockWidgetsBehavior(aDesktop); + //new pqVerifyRequiredPluginBehavior(this); + new pqPluginActionGroupBehavior(aDesktop); + //new pqFixPathsInStateFilesBehavior(this); new pqCommandLineOptionsBehavior(this); - new pqPersistentMainWindowStateBehavior(getApp()->desktop()); + new pqPersistentMainWindowStateBehavior(aDesktop); + new pqObjectPickingBehavior(aDesktop); + new pqCollaborationBehavior(this); // Setup quick-launch shortcuts. - QShortcut *ctrlSpace = new QShortcut(Qt::CTRL + Qt::Key_Space, - getApp()->desktop()); + QShortcut *ctrlSpace = new QShortcut(Qt::CTRL + Qt::Key_Space, aDesktop); QObject::connect(ctrlSpace, SIGNAL(activated()), pqApplicationCore::instance(), SLOT(quickLaunch())); - QShortcut *altSpace = new QShortcut(Qt::ALT + Qt::Key_Space, - getApp()->desktop()); + QShortcut *altSpace = new QShortcut(Qt::ALT + Qt::Key_Space, aDesktop); QObject::connect(altSpace, SIGNAL(activated()), pqApplicationCore::instance(), SLOT(quickLaunch())); // End pqParaViewBehaviors - + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); QString aPath = resMgr->stringValue("resources", "PARAVIS", QString()); if (!aPath.isNull()) { - pqImplementation::Core->loadConfiguration(aPath + QDir::separator() + "ParaViewFilters.xml"); - pqImplementation::Core->loadConfiguration(aPath + QDir::separator() + "ParaViewReaders.xml"); - pqImplementation::Core->loadConfiguration(aPath + QDir::separator() + "ParaViewSources.xml"); - pqImplementation::Core->loadConfiguration(aPath + QDir::separator() + "ParaViewWriters.xml"); + MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewFilters.xml"); + MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewReaders.xml"); + MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewSources.xml"); + MyCoreApp->loadConfiguration(aPath + QDir::separator() + "ParaViewWriters.xml"); } - // Now that we're ready, initialize everything ... - - + // Force creation of engine PARAVIS::GetParavisGen(this); updateObjBrowser(); - } - // Initialize list of toolbars - QCoreApplication::processEvents(); - QList aBars = getParaViewToolbars(); - foreach (QToolBar* aBar, aBars) { - myToolbarState[aBar] = true; - } + // Find created toolbars + QCoreApplication::processEvents(); + + QList allToolbars = aDesktop->findChildren(); + foreach(QToolBar* aBar, allToolbars) { + if (!foreignToolbars.contains(aBar)) { + myToolbars[aBar] = true; + myToolbarBreaks[aBar] = false; + aBar->setVisible(false); + aBar->toggleViewAction()->setVisible(false); + } + } + //} + + updateMacros(); + + // we need to start trace after connection is done + connect(pqApplicationCore::instance()->getObjectBuilder(), SIGNAL(finishedAddingServer(pqServer*)), + this, SLOT(onFinishedAddingServer(pqServer*))); SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); bool isStop = aResourceMgr->booleanValue( "PARAVIS", "stop_trace", false ); + // start timer to activate trace in a proper moment if(!isStop) - QTimer::singleShot(50, this, SLOT(activateTrace())); + startTimer( 50 ); + + this->VTKConnect = vtkEventQtSlotConnect::New(); + vtkProcessModule* pm = vtkProcessModule::GetProcessModule(); + + this->VTKConnect->Connect(pm, vtkCommand::StartEvent, + this, SLOT(onStartProgress())); + this->VTKConnect->Connect(pm, vtkCommand::EndEvent, + this, SLOT(onEndProgress())); } +void PVGUI_Module::onStartProgress() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); +} + +void PVGUI_Module::onEndProgress() +{ + QApplication::restoreOverrideCursor(); +} -void PVGUI_Module::activateTrace() +void PVGUI_Module::onFinishedAddingServer(pqServer* /*server*/) { + SUIT_ResourceMgr* aResourceMgr = SUIT_Session::session()->resourceMgr(); + bool isStop = aResourceMgr->booleanValue( "PARAVIS", "stop_trace", false ); + if(!isStop) + startTimer( 50 ); +} + +/*! + \brief Launches a tracing of current server +*/ +void PVGUI_Module::timerEvent(QTimerEvent* te ) +{ +#ifndef WNT PyInterp_Dispatcher* aDispatcher = PyInterp_Dispatcher::Get(); - if (aDispatcher->IsBusy()) { - QTimer::singleShot(50, this, SLOT(activateTrace())); + if ( !aDispatcher->IsBusy() ) { + pqPythonManager* manager = qobject_cast + ( pqApplicationCore::instance()->manager( "PYTHON_MANAGER" ) ); + if ( manager ) { + pqPythonDialog* pyDiag = manager->pythonShellDialog(); + if ( pyDiag ) { + pqPythonShell* shell = pyDiag->shell(); + if ( shell ) { + QString script = "from paraview import smtrace\nsmtrace.start_trace()\n"; + shell->executeScript(script); + killTimer( te->timerId() ); + } + } + } + } +#endif +} + +void PVGUI_Module::updateMacros() +{ + pqPythonManager* aPythonManager = pqPVApplicationCore::instance()->pythonManager(); + if(!aPythonManager) { return; } + + QString aRootDir = getenv("PARAVIS_ROOT_DIR"); - pqPythonDialog* pyDiag = 0; - pqPythonManager* manager = qobject_cast( - pqApplicationCore::instance()->manager("PYTHON_MANAGER")); - if (manager) { - pyDiag = manager->pythonShellDialog(); - } - if (pyDiag) { - pyDiag->runString("try:\n" - " from paraview import smtrace\n" - " smtrace.start_trace()\n" - " print 'Trace started.'\n" - "except: raise RuntimeError('could not import paraview.smtrace')\n"); + QString aSourcePath = aRootDir + "/bin/salome/Macro"; + + QStringList aFilter; + aFilter << "*.py"; + + QDir aSourceDir(aSourcePath); + QStringList aSourceFiles = aSourceDir.entryList(aFilter, QDir::Files); + foreach (QString aStr, aSourceFiles) { + aPythonManager->addMacro(aSourcePath + "/" + aStr); } } - /*! \brief Get list of compliant dockable GUI elements \param m map to be filled in ("type":"default_position") @@ -388,22 +502,29 @@ void PVGUI_Module::windows( QMap& m ) const */ bool PVGUI_Module::pvInit() { - if ( !pqImplementation::Core ){ + // if ( !pqImplementation::Core ){ + if ( ! MyCoreApp) { // Obtain command-line arguments int argc = 0; + char** argv = 0; + QString aOptions = getenv("PARAVIS_OPTIONS"); + QStringList aOptList = aOptions.split(":", QString::SkipEmptyParts); + argv = new char*[aOptList.size() + 1]; QStringList args = QApplication::arguments(); - char** argv = new char*[args.size()]; - for ( QStringList::const_iterator it = args.begin(); argc < 1 && it != args.end(); it++, argc++ ) { - argv[argc] = strdup( (*it).toLatin1().constData() ); + argv[0] = (args.size() > 0)? strdup(args[0].toLatin1().constData()) : strdup("paravis"); + argc++; + + foreach (QString aStr, aOptList) { + argv[argc] = strdup( aStr.toLatin1().constData() ); + argc++; } - pqImplementation::Core = new pqPVApplicationCore (argc, argv); - if (pqImplementation::Core->getOptions()->GetHelpSelected() || - pqImplementation::Core->getOptions()->GetUnknownArgument() || - pqImplementation::Core->getOptions()->GetErrorMessage() || - pqImplementation::Core->getOptions()->GetTellVersion()) { + MyCoreApp = new pqPVApplicationCore (argc, argv); + if (MyCoreApp->getOptions()->GetHelpSelected() || + MyCoreApp->getOptions()->GetUnknownArgument() || + MyCoreApp->getOptions()->GetErrorMessage() || + MyCoreApp->getOptions()->GetTellVersion()) { return false; - } - // VSV: Code from Initializer - it seems that it does nothing + } // Not sure why this is needed. Andy added this ages ago with comment saying // needed for Mac apps. Need to check that it's indeed still required. @@ -427,17 +548,12 @@ bool PVGUI_Module::pvInit() // End of Initializer code - //qInstallMsgHandler(0); // switch off standard Paraview message handler - pqImplementation::OutputWindowAdapter = PVGUI_OutputWindowAdapter::New(); - vtkOutputWindow::SetInstance(pqImplementation::OutputWindowAdapter); - - //pqPluginManager* pgm = pqApplicationCore::instance()->getPluginManager(); - //pgm->loadExtensions(NULL); - - new pqViewManager(); // it registers as "MULTIVIEW_MANAGER on creation + vtkOutputWindow::SetInstance(PVGUI_OutputWindowAdapter::New()); + + new pqTabbedMultiViewWidget(); // it registers as "MULTIVIEW_WIDGET on creation - if (argc == 1) - free(argv[0]); // because in creation argc < 1 + for (int i = 0; i < argc; i++) + free(argv[i]); delete[] argv; } @@ -465,67 +581,17 @@ void PVGUI_Module::showView( bool toShow ) } pvWnd->setShown( toShow ); + if ( toShow ) pvWnd->setFocus(); } - -// void PVGUI_Module::connectToPlay() -// { -// connect( action(PlayId), SIGNAL( triggered() ), &Implementation->Core.VCRController(), SLOT( onPlay() ) ); -// } - - /*! \brief Slot to show help for proxy. */ -void PVGUI_Module::showHelpForProxy( const QString& proxy ) +void PVGUI_Module::showHelpForProxy( const QString& groupname, const QString& proxyname ) { - //pqHelpReaction::showHelp(QString("qthelp://paraview.org/paraview/%1.html").arg(proxy)); - showHelp(QString("qthelp://paraview.org/paraview/%1.html").arg(proxy)); + pqHelpReaction::showProxyHelp(groupname, proxyname); } -void PVGUI_Module::showParaViewHelp() -{ - showHelp(QString()); -} - -void PVGUI_Module::showHelp(const QString& url) -{ - if (pqImplementation::helpWindow) { - // raise assistant window; - pqImplementation::helpWindow->show(); - pqImplementation::helpWindow->raise(); - if (!url.isEmpty()) { - pqImplementation::helpWindow->showPage(url); - } - return; - } - - // * Discover help project files from the resources. - QString aPVHome(getenv("PVHOME")); - if (aPVHome.isNull()) { - qWarning("Wariable PVHOME is not defined"); - return; - } - QChar aSep = QDir::separator(); - QString aFile = aPVHome + aSep + "doc" + aSep + "paraview.qch"; - - if (!QFile::exists(aFile)) { - qWarning("Help file do not found"); - return; - } - - pqImplementation::helpWindow = new pqHelpWindow(QString("ParaView Online Help"), getApp()->desktop()); - QString namespace_name = pqImplementation::helpWindow->registerDocumentation(aFile); - - pqImplementation::helpWindow->showHomePage(namespace_name); - pqImplementation::helpWindow->show(); - pqImplementation::helpWindow->raise(); - if (!url.isEmpty()) { - pqImplementation::helpWindow->showPage(url); - } -} - - /*! \brief Slot to show the waiting state. @@ -556,9 +622,9 @@ void PVGUI_Module::endWaitCursor() /*! \brief Returns the ParaView multi-view manager. */ -pqViewManager* PVGUI_Module::getMultiViewManager() const +pqTabbedMultiViewWidget* PVGUI_Module::getMultiViewManager() const { - return qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_MANAGER")); + return qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET")); } @@ -604,16 +670,19 @@ bool PVGUI_Module::activateModule( SUIT_Study* study ) setMenuShown( true ); setToolShown( true ); - if (myToolbarState.size() > 0) { - SUIT_Desktop* desk = application()->desktop(); - QList aToolbars = myToolbarState.keys(); - foreach(QToolBar* aBar, aToolbars) { - aBar->setParent(desk); - aBar->setVisible(myToolbarState[aBar]); + restoreDockWidgetsState(); + + QMenu* aMenu = menuMgr()->findMenu( myRecentMenuId ); + if(aMenu) { + QList anActns = aMenu->actions(); + for (int i = 0; i < anActns.size(); ++i) { + QAction* a = anActns.at(i); + if(a) + a->setVisible(true); + } } - } - restoreDockWidgetsState(); + if ( myRecentMenuId != -1 ) menuMgr()->show(myRecentMenuId); return isDone; } @@ -627,12 +696,28 @@ bool PVGUI_Module::activateModule( SUIT_Study* study ) */ bool PVGUI_Module::deactivateModule( SUIT_Study* study ) { - if (pqImplementation::helpWindow) { - pqImplementation::helpWindow->hide(); + QMenu* aMenu = menuMgr()->findMenu( myRecentMenuId ); + if(aMenu) { + QList anActns = aMenu->actions(); + for (int i = 0; i < anActns.size(); ++i) { + QAction* a = anActns.at(i); + if(a) + a->setVisible(false); + } + } + + QList aStreamingViews = application()->desktop()->findChildren("pqStreamingControls"); + foreach(QDockWidget* aView, aStreamingViews) { + if (!myDockWidgets.contains(aView)) + myDockWidgets[aView] = aView->isVisible(); } - showView( false ); + /*if (pqImplementation::helpWindow) { + pqImplementation::helpWindow->hide(); + }*/ + showView( false ); // hide menus + menuMgr()->hide(myRecentMenuId); menuMgr()->hide(mySourcesMenuId); menuMgr()->hide(myFiltersMenuId); menuMgr()->hide(myMacrosMenuId); @@ -640,18 +725,12 @@ bool PVGUI_Module::deactivateModule( SUIT_Study* study ) setMenuShown( false ); setToolShown( false ); - saveDockWidgetsState(); - // hide toolbars - QList aToolbars = myToolbarState.keys(); - foreach(QToolBar* aBar, aToolbars) { - myToolbarState[aBar] = aBar->isVisible(); - aBar->hide(); - aBar->setParent(0); - } + saveDockWidgetsState(); if (myOldMsgHandler) qInstallMsgHandler(myOldMsgHandler); + return SalomeApp_Module::deactivateModule( study ); } @@ -670,23 +749,58 @@ void PVGUI_Module::onApplicationClosed( SUIT_Application* theApp ) int aAppsNb = SUIT_Session::session()->applications().size(); if (aAppsNb == 1) { deleteTemporaryFiles(); - //pvShutdown(); + MyCoreApp->deleteLater(); } CAM_Module::onApplicationClosed(theApp); } + +/*! + \brief Called when study is closed. + + Removes data model from the \a study. + + \param study study being closed +*/ +void PVGUI_Module::studyClosed(SUIT_Study* study) +{ + clearParaviewState(); + + SalomeApp_Module::studyClosed(study); +} + /*! - \brief Compares the contents of the window with the given reference image, - returns true if they "match" within some tolerance. + \brief Called when study is opened. */ -/*VSV it seems that this method is obsolete -bool PVGUI_Module::compareView( const QString& ReferenceImage, double Threshold, - std::ostream& Output, const QString& TempDirectory ) +void PVGUI_Module::onModelOpened() { - if ( Implementation ) - return Implementation->Core.compareView( ReferenceImage, Threshold, Output, TempDirectory ); - return false; + _PTR(Study) studyDS = PARAVIS::GetCStudy(this); + if(!studyDS) { + return; + } + + _PTR(SComponent) paravisComp = + studyDS->FindComponent(PARAVIS::GetParavisGen(this)->ComponentDataType()); + if(!paravisComp) { + return; + } + + _PTR(ChildIterator) anIter(studyDS->NewChildIterator(paravisComp)); + for (; anIter->More(); anIter->Next()) { + _PTR(SObject) aSObj = anIter->Value(); + _PTR(GenericAttribute) anAttr; + if (!aSObj->FindAttribute(anAttr, "AttributeLocalID")) { + continue; + } + _PTR(AttributeLocalID) anID(anAttr); + if (anID->Value() == PVSTATEID) { + myStateCounter++; + } + } } + +/*! + \brief Returns IOR of current engine */ QString PVGUI_Module::engineIOR() const { @@ -705,36 +819,60 @@ void PVGUI_Module::openFile(const char* theName) pqLoadDataReaction::loadData(aFiles); } +void PVGUI_Module::executeScript(const char *script) +{ +#ifndef WNT + pqPythonManager* manager = qobject_cast( + pqApplicationCore::instance()->manager("PYTHON_MANAGER")); + if (manager) { + pqPythonDialog* pyDiag = manager->pythonShellDialog(); + if (pyDiag) { + pyDiag->runString(script); + } + } +#endif +} + /*! \brief Returns trace string */ +static const QString MYReplaceStr("paraview.simple"); +static const QString MYReplaceImportStr("except: from pvsimple import *"); QString PVGUI_Module::getTraceString() { - pqPythonDialog* pyDiag = 0; + QString traceString; +#ifndef WNT pqPythonManager* manager = qobject_cast( pqApplicationCore::instance()->manager("PYTHON_MANAGER")); if (manager) { - pyDiag = manager->pythonShellDialog(); + pqPythonDialog* pyDiag = manager->pythonShellDialog(); + if (pyDiag) { + pyDiag->runString("from paraview import smtrace\n" + "__smtraceString = smtrace.get_trace_string()\n"); + pyDiag->shell()->makeCurrent(); + PyObject* main_module = PyImport_AddModule((char*)"__main__"); + PyObject* global_dict = PyModule_GetDict(main_module); + PyObject* string_object = PyDict_GetItemString(global_dict, "__smtraceString"); + char* string_ptr = string_object ? PyString_AsString(string_object) : 0; + if (string_ptr) { + traceString = string_ptr; + } + pyDiag->shell()->releaseControl(); + } } - - QString traceString; - if (pyDiag) { - pyDiag->runString("try:\n" - " from paraview import smtrace\n" - " __smtraceString = smtrace.get_trace_string()\n" - "except:\n" - " __smtraceString = str()\n" - " raise RuntimeError('could not import paraview.smtrace')\n"); - pyDiag->shell()->makeCurrent(); - PyObject* main_module = PyImport_AddModule((char*)"__main__"); - PyObject* global_dict = PyModule_GetDict(main_module); - PyObject* string_object = PyDict_GetItemString(global_dict, "__smtraceString"); - char* string_ptr = PyString_AsString(string_object); - if (string_ptr) { - traceString = string_ptr; + if ((!traceString.isNull()) && traceString.length() != 0) { + int aPos = traceString.indexOf(MYReplaceStr); + while (aPos != -1) { + traceString = traceString.replace(aPos, MYReplaceStr.length(), "pvsimple"); + aPos = traceString.indexOf(MYReplaceStr, aPos); } - pyDiag->shell()->releaseControl(); + int aImportPos = traceString.indexOf(MYReplaceImportStr); + if(aImportPos != -1) + { + traceString = traceString.replace(aImportPos, MYReplaceImportStr.length(), "except:\n import pvsimple\n from pvsimple import *"); + } } +#endif return traceString; } @@ -743,7 +881,6 @@ QString PVGUI_Module::getTraceString() */ void PVGUI_Module::saveTrace(const char* theName) { - //save_trace(theName); QFile file(theName); if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) { MESSAGE( "Could not open file:" << theName ); @@ -759,15 +896,28 @@ void PVGUI_Module::saveTrace(const char* theName) */ void PVGUI_Module::saveParaviewState(const char* theFileName) { - Implementation->Core->saveState(theFileName); + pqApplicationCore::instance()->saveState(theFileName); +} + +/*! + \brief Delete all objects for Paraview Pipeline Browser +*/ +void PVGUI_Module::clearParaviewState() +{ + QAction* deleteAllAction = action(DeleteAllId); + if (deleteAllAction) { + deleteAllAction->activate(QAction::Trigger); + } } /*! \brief Restores ParaView state from a disk file + + If toClear == true, the current ojects will be deleted */ void PVGUI_Module::loadParaviewState(const char* theFileName) { - Implementation->Core->loadState(theFileName, getActiveServer()); + pqApplicationCore::instance()->loadState(theFileName, getActiveServer()); } /*! @@ -802,16 +952,13 @@ void PVGUI_Module::onImportFromVisu(QString theEntry) SALOME_NamingService* aNamingService = SalomeApp_Application::namingService(); SALOME_LifeCycleCORBA aLCC(aNamingService); - Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU"); + Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","VISU"); VISU::VISU_Gen_var aVISU = VISU::VISU_Gen::_narrow(aComponent); if(CORBA::is_nil(aVISU)) return; _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder(); aStudyBuilder->LoadWith( aVisuComp, SalomeApp_Application::orb()->object_to_string(aVISU) ); - // set current study to VISU engine - //aVISU->SetCurrentStudy(aStudyVar); - // get VISU result object CORBA::Object_var aResultObject = aSObject->GetObject(); if (CORBA::is_nil(aResultObject)) return; @@ -850,7 +997,7 @@ void PVGUI_Module::deleteTemporaryFiles() */ pqServer* PVGUI_Module::getActiveServer() { - return Implementation->Core->getActiveServer(); + return pqApplicationCore::instance()->getActiveServer(); } @@ -859,10 +1006,16 @@ pqServer* PVGUI_Module::getActiveServer() */ void PVGUI_Module::createPreferences() { - int TraceTab = addPreference( tr( "TIT_TRACE" ) ); - addPreference( tr( "PREF_STOP_TRACE" ), TraceTab, LightApp_Preferences::Bool, "PARAVIS", "stop_trace"); + // Paraview settings tab + int aParaViewSettingsTab = addPreference( tr( "TIT_PVIEWSETTINGS" ) ); + int aPanel = addPreference(QString(), aParaViewSettingsTab, LightApp_Preferences::UserDefined, "PARAVIS", ""); + setPreferenceProperty(aPanel, "content", (qint64)(new PVGUI_ParaViewSettingsPane())); - int aSaveType = addPreference(tr( "PREF_SAVE_TYPE_LBL" ), TraceTab, + // Paravis settings tab + int aParaVisSettingsTab = addPreference( tr( "TIT_PVISSETTINGS" ) ); + addPreference( tr( "PREF_STOP_TRACE" ), aParaVisSettingsTab, LightApp_Preferences::Bool, "PARAVIS", "stop_trace"); + + int aSaveType = addPreference(tr( "PREF_SAVE_TYPE_LBL" ), aParaVisSettingsTab, LightApp_Preferences::Selector, "PARAVIS", "savestate_type"); QList aIndices; @@ -875,7 +1028,348 @@ void PVGUI_Module::createPreferences() setPreferenceProperty(aSaveType, "indexes", aIndices); } +/*! + \brief Creates ParaViS context menu popup +*/ +void PVGUI_Module::contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle) +{ + SalomeApp_Module::contextMenuPopup(theClient, theMenu, theTitle); + + // Check if we are in Object Browser + SUIT_DataBrowser* ob = getApp()->objectBrowser(); + bool isOBClient = (ob && theClient == ob->popupClientType()); + if (!isOBClient) { + return; + } + + // Get list of selected objects + LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr(); + SALOME_ListIO aListIO; + aSelectionMgr->selectedObjects(aListIO); + if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) { + QString entry = QString(aListIO.First()->getEntry()); + + // Get active study + SalomeApp_Study* activeStudy = + dynamic_cast(getApp()->activeStudy()); + if(!activeStudy) { + return; + } + // Get SALOMEDS client study + _PTR(Study) studyDS = activeStudy->studyDS(); + if(!studyDS) { + return; + } + + QString paravisDataType(PARAVIS::GetParavisGen(this)->ComponentDataType()); + if(activeStudy && activeStudy->isComponent(entry) && + activeStudy->componentDataType(entry) == paravisDataType) { + // ParaViS module object + theMenu->addSeparator(); + theMenu->addAction(action(SaveStatePopupId)); + } + else { + // Try to get state object + _PTR(SObject) stateSObj = + studyDS->FindObjectID(entry.toLatin1().constData()); + if (!stateSObj) { + return; + } + + // Check local id + _PTR(GenericAttribute) anAttr; + if (!stateSObj->FindAttribute(anAttr, "AttributeLocalID")) { + return; + } + + _PTR(AttributeLocalID) anID(anAttr); + + if (anID->Value() == PVSTATEID) { + // Paraview state object + theMenu->addSeparator(); + theMenu->addAction(action(AddStatePopupId)); + theMenu->addAction(action(CleanAndAddStatePopupId)); + theMenu->addSeparator(); + theMenu->addAction(action(ParaVisRenameId)); + theMenu->addAction(action(ParaVisDeleteId)); + } + } + } +} + +void PVGUI_Module::onShowTrace() +{ + if (!myTraceWindow) { + myTraceWindow = new pqPythonScriptEditor(getApp()->desktop()); + } + myTraceWindow->setText(getTraceString()); + myTraceWindow->show(); + myTraceWindow->raise(); + myTraceWindow->activateWindow(); +} + +/*! + \brief Show ParaView view. +*/ +void PVGUI_Module::onNewParaViewWindow() +{ + showView(true); +} + +/*! + \brief Save state under the module root object. +*/ +void PVGUI_Module::onSaveMultiState() +{ + // Create state study object + + // Get SALOMEDS client study + _PTR(Study) studyDS = PARAVIS::GetCStudy(this); + if(!studyDS) { + return; + } + + _PTR(SComponent) paravisComp = + studyDS->FindComponent(PARAVIS::GetParavisGen(this)->ComponentDataType()); + if(!paravisComp) { + return; + } + + // Unlock the study if it is locked + bool isLocked = studyDS->GetProperties()->IsLocked(); + if (isLocked) { + studyDS->GetProperties()->SetLocked(false); + } + + QString stateName = tr("SAVED_PARAVIEW_STATE_NAME") + + QString::number(myStateCounter + 1); + + _PTR(StudyBuilder) studyBuilder = studyDS->NewBuilder(); + _PTR(SObject) newSObj = studyBuilder->NewObject(paravisComp); + + // Set name + _PTR(GenericAttribute) anAttr; + anAttr = studyBuilder->FindOrCreateAttribute(newSObj, "AttributeName"); + _PTR(AttributeName) nameAttr(anAttr); + + nameAttr->SetValue(stateName.toLatin1().constData()); + + // Set local id + anAttr = studyBuilder->FindOrCreateAttribute(newSObj, "AttributeLocalID"); + _PTR(AttributeLocalID) localIdAttr(anAttr); + + localIdAttr->SetValue(PVSTATEID); + + // Set file name + QString stateEntry = QString::fromStdString(newSObj->GetID()); + + // File name for state saving + QString tmpDir = QString::fromStdString(SALOMEDS_Tool::GetTmpDir()); + QString fileName = QString("%1_paravisstate:%2").arg(tmpDir, + stateEntry); + + anAttr = studyBuilder->FindOrCreateAttribute(newSObj, "AttributeString"); + _PTR(AttributeString) stringAttr(anAttr); + + stringAttr->SetValue(fileName.toLatin1().constData()); + + // Lock the study back if necessary + if (isLocked) { + studyDS->GetProperties()->SetLocked(true); + } + + // Save state + saveParaviewState(fileName.toLatin1().constData()); + myTemporaryFiles.append(fileName); + + // Increment the counter + myStateCounter++; + + updateObjBrowser(); +} + +/*! + \brief Restore the selected state by merging with the current one. +*/ +void PVGUI_Module::onAddState() +{ + loadSelectedState(false); +} + +/*! + \brief Clean the current state and restore the selected one. +*/ +void PVGUI_Module::onCleanAddState() +{ + loadSelectedState(true); +} + +/*! + \brief Rename the selected object. +*/ +void PVGUI_Module::onRename() +{ + LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr(); + SALOME_ListIO aListIO; + aSelectionMgr->selectedObjects(aListIO); + + if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) { + std::string entry = aListIO.First()->getEntry(); + + // Get SALOMEDS client study + _PTR(Study) studyDS = PARAVIS::GetCStudy(this); + if(!studyDS) { + return; + } + + // Unlock the study if it is locked + bool isLocked = studyDS->GetProperties()->IsLocked(); + if (isLocked) { + studyDS->GetProperties()->SetLocked(false); + } + + // Rename the selected state object + _PTR(SObject) stateSObj = studyDS->FindObjectID(entry); + if (!stateSObj) { + return; + } + + _PTR(GenericAttribute) anAttr; + if (stateSObj->FindAttribute(anAttr, "AttributeName")) { + _PTR(AttributeName) nameAttr (anAttr); + QString newName = + LightApp_NameDlg::getName(getApp()->desktop(), nameAttr->Value().c_str()); + if (!newName.isEmpty()) { + nameAttr->SetValue(newName.toLatin1().constData()); + aListIO.First()->setName(newName.toLatin1().constData()); + } + } + + // Lock the study back if necessary + if (isLocked) { + studyDS->GetProperties()->SetLocked(true); + } + + // Update object browser + updateObjBrowser(); + + } +} + +/*! + \brief Delete the selected objects. +*/ +void PVGUI_Module::onDelete() +{ + LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr(); + SALOME_ListIO aListIO; + aSelectionMgr->selectedObjects(aListIO); + + if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) { + std::string entry = aListIO.First()->getEntry(); + + // Get SALOMEDS client study + _PTR(Study) studyDS = PARAVIS::GetCStudy(this); + if(!studyDS) { + return; + } + + // Unlock the study if it is locked + bool isLocked = studyDS->GetProperties()->IsLocked(); + if (isLocked) { + studyDS->GetProperties()->SetLocked(false); + } + + // Remove the selected state from the study + _PTR(StudyBuilder) studyBuilder = studyDS->NewBuilder(); + _PTR(SObject) stateSObj = studyDS->FindObjectID(entry); + studyBuilder->RemoveObject(stateSObj); + + // Lock the study back if necessary + if (isLocked) { + studyDS->GetProperties()->SetLocked(true); + } + + // Update object browser + updateObjBrowser(); + } +} + +/*! + \brief Discover help project files from the resources. + \return name of the help file. +*/ +QString PVGUI_Module::getHelpFileName() { + QString aPVHome(getenv("PVHOME")); + if (aPVHome.isNull()) { + qWarning("Wariable PVHOME is not defined"); + return QString(); + } + QChar aSep = QDir::separator(); + //PARAVIEW_VERSION from the vtkPVConfig.h file + QString aFileName = aPVHome + aSep + "share" + aSep + "doc" + aSep + "paraview-"+ PARAVIEW_VERSION + aSep + "paraview.qch"; + return aFileName; +} + + +/*! + \brief Load selected paraview state + + If toClear == true, the current state will be cleared +*/ +void PVGUI_Module::loadSelectedState(bool toClear) +{ + QString fileName; + + LightApp_SelectionMgr* aSelectionMgr = getApp()->selectionMgr(); + SALOME_ListIO aListIO; + aSelectionMgr->selectedObjects(aListIO); + + if (aListIO.Extent() == 1 && aListIO.First()->hasEntry()) { + std::string entry = aListIO.First()->getEntry(); + + // Get SALOMEDS client study + _PTR(Study) studyDS = PARAVIS::GetCStudy(this); + if(!studyDS) { + return; + } + + // Check local id + _PTR(SObject) stateSObj = studyDS->FindObjectID(entry); + _PTR(GenericAttribute) anAttr; + if (!stateSObj->FindAttribute(anAttr, "AttributeLocalID")) { + return; + } + _PTR(AttributeLocalID) anID(anAttr); + if (!anID->Value() == PVSTATEID) { + return; + } + + // Get state file name + if (stateSObj->FindAttribute(anAttr, "AttributeString")) { + _PTR(AttributeString) aStringAttr(anAttr); + QString stringValue(aStringAttr->Value().c_str()); + + if (QFile::exists(stringValue)) { + fileName = stringValue; + } + } + } + + if (!fileName.isEmpty()) { + if (toClear) { + clearParaviewState(); + } + + loadParaviewState(fileName.toLatin1().constData()); + } + else { + SUIT_MessageBox::critical(getApp()->desktop(), + tr("ERR_ERROR"), + tr("ERR_STATE_CANNOT_BE_RESTORED")); + } +} /*! \fn CAM_Module* createModule(); @@ -893,4 +1387,9 @@ extern "C" { PVGUI_EXPORT CAM_Module* createModule() { return new PVGUI_Module(); } + + PVGUI_EXPORT char* getModuleVersion() { + return (char*)PARAVIS_VERSION_STR; + } + } diff --git a/src/PVGUI/PVGUI_Module.h b/src/PVGUI/PVGUI_Module.h index dad5800a..4bbcd749 100644 --- a/src/PVGUI/PVGUI_Module.h +++ b/src/PVGUI/PVGUI_Module.h @@ -1,7 +1,6 @@ // PARAVIS : ParaView wrapper SALOME module // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2010-2012 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 @@ -30,6 +29,7 @@ #include #include +#include class QMenu; class QDockWidget; @@ -37,8 +37,12 @@ class QToolBar; class vtkPVMain; class pqOptions; class pqServer; -class pqViewManager; +class pqTabbedMultiViewWidget; class pqMainWindowCore; +class vtkEventQtSlotConnect; +class pqPythonScriptEditor; +class pqPVApplicationCore; + class PVGUI_Module : public SalomeApp_Module { @@ -68,53 +72,17 @@ class PVGUI_Module : public SalomeApp_Module CameraUndoId, CameraRedoId, + FindDataId, ChangeInputId, IgnoreTimeId, DeleteId, DeleteAllId, - //InteractId, - //SelectCellsOnId, - //SelectPointsOnId, - //SelectCellsThroughId, - //SelectPointsThroughId, - //SelectBlockId, - SettingsId, ViewSettingsId, // Menu "View" FullScreenId, -// ResetCameraId, -// PositiveXId, -// NegativeXId, -// PositiveYId, -// NegativeYId, -// PositiveZId, -// NegativeZId, -// -// ShowCenterId, -// ResetCenterId, -// PickCenterId, -// ShowColorLegendId, -// EditColorMapId, -// ResetRangeId, -// -// AnimationInspectorId, -// AnimationViewId, -// ComparativeViewInspectorId, -// SelectionInspectorId, -// LookmarkBrowserId, -// LookmarkInspectorId, -// ObjectInspectorId, -// PipelineBrowserId, -// StatisticsViewId, - - // Menu "Sources" - // TODO... - - // Menu "Filters" - // TODO... // Menu "Animation" FirstFrameId, @@ -136,14 +104,30 @@ class PVGUI_Module : public SalomeApp_Module RecordTestScreenshotId, PlayTestId, MaxWindowSizeId, + CustomWindowSizeId, TimerLogId, OutputWindowId, PythonShellId, + ShowTraceId, // Menu "Help" AboutParaViewId, ParaViewHelpId, - EnableTooltipsId + EnableTooltipsId, + + // Menu "Window" - "New Window" + ParaViewNewWindowId, + + // "Save state" ParaVis module root object popup + SaveStatePopupId, + + // "Add state" and "Reload state" popups + AddStatePopupId, + CleanAndAddStatePopupId, + + // "Rename" and "Delete" popups (Object Browser) + ParaVisRenameId, + ParaVisDeleteId }; public: @@ -153,19 +137,15 @@ public: virtual void initialize( CAM_Application* ); virtual void windows( QMap& ) const; - pqViewManager* getMultiViewManager() const; + pqTabbedMultiViewWidget* getMultiViewManager() const; virtual QString engineIOR() const; - /*! Compares the contents of the window with the given reference image, - * returns true if they "match" within some tolerance - */ - /*bool compareView( const QString& ReferenceImage, double Threshold, - std::ostream& Output, const QString& TempDirectory );*/ - void openFile(const char* theName); + void executeScript(const char *script); void saveParaviewState(const char* theFileName); void loadParaviewState(const char* theFileName); + void clearParaviewState(); QString getTraceString(); void saveTrace(const char* theName); @@ -174,6 +154,8 @@ public: virtual void createPreferences(); + virtual void contextMenuPopup(const QString& theClient, QMenu* theMenu, QString& theTitle); + public slots: void onImportFromVisu(QString theEntry); @@ -204,30 +186,65 @@ private: //! Returns QMenu object for a given menu id QMenu* getMenu( const int ); + + //! Discover help project files from the resources. + QString getHelpFileName(); void deleteTemporaryFiles(); - QList getParaViewToolbars(); + //QList getParaViewToolbars(); + + //! Create actions for ParaViS + void createActions(); + + //! Create menus for ParaViS + void createMenus(); + + //! Load selected state + void loadSelectedState(bool toClear); + + //! update macros state + void updateMacros(); private slots: - void showHelpForProxy( const QString& proxy ); + void showHelpForProxy( const QString&, const QString& ); void onPreAccept(); void onPostAccept(); void endWaitCursor(); - void activateTrace(); + // void buildToolbarsMenu(); - void buildToolbarsMenu(); + //void showParaViewHelp(); + //void showHelp(const QString& url); - void showParaViewHelp(); - void showHelp(const QString& url); + void onFinishedAddingServer(pqServer*); + + void onStartProgress(); + void onEndProgress(); + void onShowTrace(); + + void onNewParaViewWindow(); + + void onSaveMultiState(); + void onAddState(); + void onCleanAddState(); + + void onRename(); + void onDelete(); public slots: virtual bool activateModule( SUIT_Study* ); virtual bool deactivateModule( SUIT_Study* ); virtual void onApplicationClosed( SUIT_Application* ); + virtual void studyClosed( SUIT_Study* ); + +protected slots: + virtual void onModelOpened(); + +protected: + void timerEvent(QTimerEvent *event); private: class pqImplementation; @@ -238,14 +255,24 @@ private: int myFiltersMenuId; int myToolbarsMenuId; int myMacrosMenuId; - - QList myDockWidgets; + int myRecentMenuId; + + typedef QMap WgMap; + WgMap myDockWidgets; + WgMap myToolbars; + WgMap myToolbarBreaks; QStringList myTemporaryFiles; - QMap myToolbarState; - QtMsgHandler myOldMsgHandler; + + vtkEventQtSlotConnect *VTKConnect; + + pqPythonScriptEditor* myTraceWindow; + + int myStateCounter; + + static pqPVApplicationCore* MyCoreApp; }; #endif // PVGUI_Module_H diff --git a/src/PVGUI/PVGUI_Module_actions.cxx b/src/PVGUI/PVGUI_Module_actions.cxx index bb8913b8..b7614908 100644 --- a/src/PVGUI/PVGUI_Module_actions.cxx +++ b/src/PVGUI/PVGUI_Module_actions.cxx @@ -1,7 +1,6 @@ // PARAVIS : ParaView wrapper SALOME module // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2010-2012 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 @@ -23,7 +22,7 @@ // Author : Margarita KARPUNINA // -#include "PVGUI_Module_impl.h" +#include "PVGUI_Module.h" #include #include @@ -37,6 +36,7 @@ #include #include #include +#include #include #include @@ -78,6 +78,8 @@ #include #include #include +#include +#include #include "PVGUI_Tools.h" @@ -99,7 +101,7 @@ void PVGUI_Module::pvCreateActions() // Open File aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_OPEN_FILE"), false ); - anAction = new QAction(QIcon(aPixmap), tr("MEN_OPEN"), this); + anAction = new QAction(QIcon(aPixmap), tr("MEN_OPEN_FILE"), this); anAction->setToolTip(tr("TOP_OPEN_FILE")); anAction->setStatusTip(tr("STB_OPEN_FILE")); registerAction(OpenFileId, anAction); @@ -208,6 +210,13 @@ void PVGUI_Module::pvCreateActions() registerAction(CameraRedoId, anAction); new pqCameraUndoRedoReaction(anAction, false); + // Find Data + anAction = new QAction(tr("MEN_FIND_DATA"), this); + anAction->setToolTip(""); + anAction->setStatusTip(""); + registerAction(FindDataId, anAction); + new pqDataQueryReaction(anAction); + // Change Input anAction = new QAction(tr("MEN_CHANGE_INPUT"), this); anAction->setToolTip(tr("TOP_CHANGE_INPUT")); @@ -239,11 +248,11 @@ void PVGUI_Module::pvCreateActions() // Setting - anAction = new QAction(tr("MEN_SETTINGS"), this); + /*anAction = new QAction(tr("MEN_SETTINGS"), this); anAction->setToolTip(tr("TOP_SETTINGS")); anAction->setStatusTip(tr("STB_SETTINGS")); registerAction(SettingsId, anAction); - new pqApplicationSettingsReaction(anAction); + new pqApplicationSettingsReaction(anAction);*/ // View Settings anAction = new QAction(tr("MEN_VIEW_SETTINGS"), this); @@ -253,15 +262,19 @@ void PVGUI_Module::pvCreateActions() new pqViewSettingsReaction(anAction); // --- Menu "View" - pqViewManager* viewManager = qobject_cast( - pqApplicationCore::instance()->manager("MULTIVIEW_MANAGER")); - if (viewManager) { - anAction = new QAction("Full Screen", this); - anAction->setObjectName("actionFullScreen"); - anAction->setShortcut(QKeySequence("F11")); - connect(anAction, SIGNAL(triggered()), viewManager, SLOT(toggleFullScreen())); - registerAction(FullScreenId, anAction); - } + //pqViewManager* viewManager = qobject_cast( + // pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET")); + + //rnv: Commented to implement issue + //21318: EDF 1615 ALL: Display in full screen mode + //Switching to the "Full screen" mode added in the SALOME GUI module. + //if (viewManager) { + //anAction = new QAction("Full Screen", this); + //anAction->setObjectName("actionFullScreen"); + //anAction->setShortcut(QKeySequence("F11")); + //connect(anAction, SIGNAL(triggered()), viewManager, SLOT(toggleFullScreen())); + //registerAction(FullScreenId, anAction); + //} // --- Menu "Tools" // Create Custom Filter @@ -322,6 +335,15 @@ void PVGUI_Module::pvCreateActions() new pqTestingReaction(anAction << pqSetName("actionTesting_Window_Size"), pqTestingReaction::LOCK_VIEW_SIZE); + // Custom Window Size + anAction = new QAction(tr("MEN_CUSTOM_WINDOW_SIZE"), this); + anAction->setToolTip(tr("")); + anAction->setStatusTip(tr("")); + anAction->setCheckable(true); + registerAction(CustomWindowSizeId, anAction); + new pqTestingReaction(anAction << pqSetName("actionTesting_Window_Size_Custom"), + pqTestingReaction::LOCK_VIEW_SIZE_CUSTOM); + // Timer Log anAction = new QAction(tr("MEN_TIMER_LOG"), this); anAction->setToolTip(tr("TOP_TIMER_LOG")); @@ -344,6 +366,13 @@ void PVGUI_Module::pvCreateActions() registerAction(PythonShellId, anAction); new pqPythonShellReaction(anAction << pqSetName("actionToolsPythonShell")); + //Show Trace + anAction = new QAction(tr("MEN_SHOW_TRACE"), this); + anAction->setToolTip(tr("TOP_SHOW_TRACE")); + anAction->setStatusTip(tr("STB_SHOW_TRACE")); + connect(anAction, SIGNAL(triggered()), this, SLOT(onShowTrace())); + registerAction(ShowTraceId, anAction); + // --- Menu "Help" // About @@ -353,15 +382,15 @@ void PVGUI_Module::pvCreateActions() registerAction(AboutParaViewId, anAction); new pqAboutDialogReaction(anAction << pqSetName("actionAbout")); +#ifdef HAS_PV_DOC // Native ParaView user documentation aPixmap = resMgr->loadPixmap( "ParaView", tr("ICON_PARAVIEW_HELP"), false ); - anAction = new QAction(QIcon(aPixmap), tr("MEN_PARAVIEW_HELP"), this); + anAction = new QAction(tr("MEN_PARAVIEW_HELP"), this); anAction->setToolTip(tr("TOP_PARAVIEW_HELP")); anAction->setStatusTip(tr("STB_PARAVIEW_HELP")); - anAction->setShortcut(QKeySequence::HelpContents); - connect(anAction, SIGNAL(triggered()), this, SLOT(showParaViewHelp())); registerAction(ParaViewHelpId, anAction); - //new pqHelpReaction(anAction << pqSetName("actionHelp")); + new pqHelpReaction(anAction); +#endif } /*! @@ -382,12 +411,13 @@ void PVGUI_Module::pvCreateMenus() createMenu( OpenFileId, aPVMnu, 5 ); // Recent Files - int aMenuId = createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 ); - QMenu* aMenu = menuMgr()->findMenu( aMenuId ); - Implementation->RecentFilesMenu = new pqRecentFilesMenu( *aMenu, getApp()->desktop() ); + myRecentMenuId = createMenu( tr( "MEN_RECENT_FILES" ), aPVMnu, -1, 5 ); + QMenu* aMenu = menuMgr()->findMenu( myRecentMenuId ); + pqRecentFilesMenu* aRecentFilesMenu = new pqRecentFilesMenu( *aMenu, getApp()->desktop() ); QList anActns = aMenu->actions(); - for (int i = 0; i < anActns.size(); ++i) - createMenu( anActns.at(i), aMenuId ); + for (int i = 0; i < anActns.size(); ++i) { + createMenu( anActns.at(i), myRecentMenuId ); + } createMenu( separator(), aPVMnu, -1, 5 ); @@ -420,25 +450,27 @@ void PVGUI_Module::pvCreateMenus() createMenu( CameraRedoId, aPVMnu ); createMenu( separator(), aPVMnu ); + createMenu( FindDataId, aPVMnu ); createMenu( ChangeInputId, aPVMnu ); createMenu( IgnoreTimeId, aPVMnu ); createMenu( DeleteId, aPVMnu ); createMenu( DeleteAllId, aPVMnu ); createMenu( separator(), aPVMnu ); - createMenu( SettingsId, aPVMnu ); + //createMenu( SettingsId, aPVMnu ); createMenu( ViewSettingsId, aPVMnu ); createMenu( separator(), aPVMnu ); // --- Menu "View" aPVMnu = createMenu( tr( "MEN_DESK_VIEW" ), -1, -1 ); - myToolbarsMenuId = createMenu( "Toolbars", aPVMnu ); + /*myToolbarsMenuId = createMenu( "Toolbars", aPVMnu ); aMenu = getMenu( myToolbarsMenuId ); if (aMenu) { buildToolbarsMenu(); connect(aMenu, SIGNAL(aboutToShow()), this, SLOT(buildToolbarsMenu())); } - createMenu( separator(), aPVMnu ); + createMenu( separator(), aPVMnu );*/ + createMenu( FullScreenId, aPVMnu ); // --- Menu "Sources" @@ -479,6 +511,7 @@ void PVGUI_Module::pvCreateMenus() createMenu( RecordTestId, aToolsMnu ); createMenu( PlayTestId, aToolsMnu ); createMenu( MaxWindowSizeId, aToolsMnu ); + createMenu( CustomWindowSizeId, aToolsMnu ); createMenu( separator(), aToolsMnu ); createMenu( TimerLogId, aToolsMnu ); @@ -486,14 +519,18 @@ void PVGUI_Module::pvCreateMenus() createMenu( separator(), aToolsMnu ); createMenu( PythonShellId, aToolsMnu ); + createMenu( separator(), aToolsMnu ); + createMenu( ShowTraceId, aToolsMnu ); // --- Menu "Help" int aHelpMnu = createMenu( tr( "MEN_DESK_HELP" ), -1, -1 ); - createMenu( AboutParaViewId, aHelpMnu ); - - int aHelpModule = createMenu( LightApp_Application::tr( "MEN_DESK_MODULE_HELP" ), aHelpMnu, -1 ); - createMenu( ParaViewHelpId, aHelpModule ); + int aPVHelpMnu = createMenu( tr( "ParaViS module" ), aHelpMnu, -1, 0 ); +#ifdef HAS_PV_DOC + createMenu( ParaViewHelpId, aPVHelpMnu ); + createMenu( separator(), aPVHelpMnu ); +#endif + createMenu( AboutParaViewId, aPVHelpMnu ); } /*! @@ -524,7 +561,7 @@ QMenu* PVGUI_Module::getMenu( const int id ) /*! \brief Returns list of ParaView toolbars */ -QList PVGUI_Module::getParaViewToolbars() +/*QList PVGUI_Module::getParaViewToolbars() { QList all_toolbars = application()->desktop()->findChildren(); // First two toolbars has to be ignored because they are not from ParaView @@ -533,14 +570,14 @@ QList PVGUI_Module::getParaViewToolbars() all_toolbars.removeFirst(); } return all_toolbars; -} + }*/ /*! \brief Builds a menu which referred to toolbars */ -void PVGUI_Module::buildToolbarsMenu() +/*void PVGUI_Module::buildToolbarsMenu() { SUIT_Desktop* desk = application()->desktop(); QMenu* aMenu = menuMgr()->findMenu( myToolbarsMenuId ); @@ -575,5 +612,54 @@ void PVGUI_Module::buildToolbarsMenu() } disconnect(aMenu, SIGNAL(aboutToShow()), this, SLOT(buildToolbarsMenu())); } + }*/ + +/*! + \brief Create actions for ParaViS +*/ +void PVGUI_Module::createActions() +{ + QAction* anAction; + + // New ParaView window + anAction = new QtxAction(tr("MEN_NEW_PV_VIEW"), tr("MEN_NEW_PV_VIEW"), 0, + this, false, "ParaViS:Create new ParaView view"); + connect(anAction, SIGNAL(triggered()), this, SLOT(onNewParaViewWindow())); + registerAction(ParaViewNewWindowId, anAction); + + // Save state under the module root object + anAction = new QAction(tr("MEN_SAVE_MULTI_STATE"), this); + connect(anAction, SIGNAL(triggered()), this, SLOT(onSaveMultiState())); + registerAction(SaveStatePopupId, anAction); + + // Restore the selected state by merging with the current one + anAction = new QAction(tr("MEN_ADD_STATE"), this); + connect(anAction, SIGNAL(triggered()), this, SLOT(onAddState())); + registerAction(AddStatePopupId, anAction); + + // Clean the current state and restore the selected one + anAction = new QAction(tr("MEN_CLEAN_ADD_STATE"), this); + connect(anAction, SIGNAL(triggered()), this, SLOT(onCleanAddState())); + registerAction(CleanAndAddStatePopupId, anAction); + + // Rename the selected object (Object Browser) + anAction = new QAction(tr("MEN_PARAVIS_RENAME"), this); + connect(anAction, SIGNAL(triggered()), this, SLOT(onRename())); + registerAction(ParaVisRenameId, anAction); + + // Delete the selected object (Object Browser) + anAction = new QAction(tr("MEN_PARAVIS_DELETE"), this); + connect(anAction, SIGNAL(triggered()), this, SLOT(onDelete())); + registerAction(ParaVisDeleteId, anAction); } +/*! + \brief Create actions for ParaViS +*/ +void PVGUI_Module::createMenus() +{ + // "Window" - "New Window" - "ParaView view" menu + int aWindowMenu = createMenu(tr( "MEN_DESK_WINDOW" ), -1, -1); + int aNewWindowMenu = createMenu(tr( "MEN_DESK_NEWWINDOW"), aWindowMenu, -1, -1); + createMenu(ParaViewNewWindowId, aNewWindowMenu); +} diff --git a/src/PVGUI/PVGUI_Module_impl.h b/src/PVGUI/PVGUI_Module_impl.h deleted file mode 100644 index 9f94d02a..00000000 --- a/src/PVGUI/PVGUI_Module_impl.h +++ /dev/null @@ -1,61 +0,0 @@ -// PARAVIS : ParaView wrapper SALOME module -// -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is 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 -// -// File : PVGUI_Module_impl.h -// Author : Margarita KARPUNINA -// - -#ifndef PVGUI_Module_impl_H -#define PVGUI_Module_impl_H - -#include "PVGUI_Module.h" -#include "PVGUI_OutputWindowAdapter.h" - -//#include -#include -#include - -#include -#include -#include -#include - - -////////////////////////////////////////////////////////////////////////////// -// PVGUI_Module::pqImplementation - -class PVGUI_Module::pqImplementation -{ - public: - pqImplementation(QWidget* parent): - RecentFilesMenu(0) - { } - - ~pqImplementation() - { } - - pqRecentFilesMenu* RecentFilesMenu; - static pqApplicationCore* Core; - static PVGUI_OutputWindowAdapter* OutputWindowAdapter; - static QPointer helpWindow; -}; - -#endif // PVGUI_Module_impl_H diff --git a/src/PVGUI/PVGUI_Module_widgets.cxx b/src/PVGUI/PVGUI_Module_widgets.cxx index 56d02037..03849f8e 100644 --- a/src/PVGUI/PVGUI_Module_widgets.cxx +++ b/src/PVGUI/PVGUI_Module_widgets.cxx @@ -1,7 +1,6 @@ // PARAVIS : ParaView wrapper SALOME module // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2010-2012 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 @@ -23,7 +22,7 @@ // Author : Margarita KARPUNINA // -#include "PVGUI_Module_impl.h" +#include "PVGUI_Module.h" #include #include @@ -34,18 +33,23 @@ #include #include #include +#include +#include -#include //VSV +#include #include #include #include #include -#include +//#include +#include +#include +#include #include #include #include -#include +#include #include #include @@ -66,6 +70,8 @@ #include #include #include +#include +#include /*! \brief Create dock widgets for ParaView widgets such as object inspector, pipeline browser, etc. @@ -74,6 +80,9 @@ void PVGUI_Module::setupDockWidgets() { SUIT_Desktop* desk = application()->desktop(); + + desk->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); + desk->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); // Pipeline QDockWidget* pipelineBrowserDock = new QDockWidget( tr( "TTL_PIPELINE_BROWSER" ), desk ); @@ -83,21 +92,75 @@ void PVGUI_Module::setupDockWidgets() pqPipelineBrowserWidget* browser = new pqPipelineBrowserWidget(pipelineBrowserDock); pqParaViewMenuBuilders::buildPipelineBrowserContextMenu(*browser); pipelineBrowserDock->setWidget(browser); - myDockWidgets.append(pipelineBrowserDock); + myDockWidgets[pipelineBrowserDock] = true; + + + //Object inspector QDockWidget* objectInspectorDock = new QDockWidget( tr( "TTL_OBJECT_INSPECTOR" ), desk ); objectInspectorDock->setObjectName("objectInspectorDock"); objectInspectorDock->setAllowedAreas( Qt::LeftDockWidgetArea|Qt::NoDockWidgetArea|Qt::RightDockWidgetArea ); desk->addDockWidget( Qt::LeftDockWidgetArea, objectInspectorDock ); - pqProxyTabWidget* proxyTab = new pqProxyTabWidget(objectInspectorDock); - proxyTab->setShowOnAccept(true); - objectInspectorDock->setWidget(proxyTab); - connect( proxyTab->getObjectInspector(), SIGNAL( helpRequested(QString) ), - this, SLOT( showHelpForProxy(QString) ) ); - //connect( proxyTab->getObjectInspector(), SIGNAL( preaccept() ), this, SLOT( onPreAccept() ) ); - //connect( proxyTab->getObjectInspector(), SIGNAL( postaccept() ), this, SLOT( onPostAccept() ) ); - myDockWidgets.append(objectInspectorDock); + + pqObjectInspectorWidget* objectInspectorWidget = new pqObjectInspectorWidget(objectInspectorDock); + objectInspectorDock->setObjectName("objectInspectorWidget"); + objectInspectorWidget->setShowOnAccept(true); + objectInspectorDock->setWidget(objectInspectorWidget); + connect( objectInspectorWidget, SIGNAL( helpRequested(const QString&, const QString&) ), this, SLOT( showHelpForProxy(const QString&, const QString&) ) ); + myDockWidgets[objectInspectorDock] = true; + + //Display Dock + QDockWidget* displayDock = new QDockWidget( tr( "TTL_DISPLAY" ), desk ); + displayDock->setObjectName("displayDock"); + QWidget* displayWidgetFrame = new QWidget(displayDock); + displayWidgetFrame->setObjectName("displayWidgetFrame"); + displayDock->setWidget(displayWidgetFrame); + + QScrollArea* displayScrollArea = new QScrollArea(displayWidgetFrame); + displayScrollArea->setObjectName("displayScrollArea"); + displayScrollArea->setWidgetResizable(true); + + QVBoxLayout* verticalLayout = new QVBoxLayout(displayWidgetFrame); + verticalLayout->setSpacing(0); + verticalLayout->setContentsMargins(0, 0, 0, 0); + + pqDisplayProxyEditorWidget* displayWidget = new pqDisplayProxyEditorWidget(displayDock); + displayWidget->setObjectName("displayWidget"); + displayScrollArea->setWidget(displayWidget); + verticalLayout->addWidget(displayScrollArea); + + myDockWidgets[displayDock] = true; + + // information dock + QDockWidget* informationDock = new QDockWidget(tr( "TTL_INFORMATION" ), desk); + informationDock->setObjectName("informationDock"); + + QWidget* informationWidgetFrame = new QWidget(informationDock); + informationWidgetFrame->setObjectName("informationWidgetFrame"); + + QVBoxLayout* verticalLayout_2 = new QVBoxLayout(informationWidgetFrame); + verticalLayout_2->setSpacing(0); + verticalLayout_2->setContentsMargins(0, 0, 0, 0); + + QScrollArea* informationScrollArea = new QScrollArea(informationWidgetFrame); + informationScrollArea->setObjectName("informationScrollArea") ; + informationScrollArea->setWidgetResizable(true); + + pqProxyInformationWidget* informationWidget = new pqProxyInformationWidget(); + informationWidget->setObjectName("informationWidget"); + informationWidget->setGeometry(QRect(0, 0, 77, 214)); + informationScrollArea->setWidget(informationWidget); + + verticalLayout_2->addWidget(informationScrollArea); + informationDock->setWidget(informationWidgetFrame); + + myDockWidgets[informationDock] = true; + + desk->setTabPosition(Qt::LeftDockWidgetArea, QTabWidget::North); + desk->tabifyDockWidget(objectInspectorDock, displayDock); + desk->tabifyDockWidget(objectInspectorDock, informationDock); + objectInspectorDock->raise(); // Statistic View QDockWidget* statisticsViewDock = new QDockWidget( tr( "TTL_STATISTICS_VIEW" ), desk ); @@ -107,7 +170,7 @@ void PVGUI_Module::setupDockWidgets() desk->addDockWidget( Qt::BottomDockWidgetArea, statisticsViewDock ); pqDataInformationWidget* aStatWidget = new pqDataInformationWidget(statisticsViewDock); statisticsViewDock->setWidget(aStatWidget); - myDockWidgets.append(statisticsViewDock); + myDockWidgets[statisticsViewDock] = false; // hidden by default //Animation view QDockWidget* animationViewDock = new QDockWidget( tr( "TTL_ANIMATION_VIEW" ), desk ); @@ -115,16 +178,18 @@ void PVGUI_Module::setupDockWidgets() desk->addDockWidget( Qt::BottomDockWidgetArea, animationViewDock ); pqPVAnimationWidget* animation_panel = new pqPVAnimationWidget(animationViewDock); animationViewDock->setWidget(animation_panel); - myDockWidgets.append(animationViewDock); + myDockWidgets[animationViewDock] = false; // hidden by default + + desk->tabifyDockWidget(animationViewDock, statisticsViewDock); // Selection view QDockWidget* selectionInspectorDock = new QDockWidget( tr( "TTL_SELECTION_INSPECTOR" ), desk ); selectionInspectorDock->setObjectName("selectionInspectorDock"); selectionInspectorDock->setAllowedAreas( Qt::AllDockWidgetAreas ); desk->addDockWidget( Qt::LeftDockWidgetArea, selectionInspectorDock ); - pqSelectionInspectorPanel* aSelInspector = new pqSelectionInspectorPanel(selectionInspectorDock); + pqSelectionInspectorPanel* aSelInspector = new pqSelectionInspectorWidget(selectionInspectorDock); selectionInspectorDock->setWidget(aSelInspector); - myDockWidgets.append(selectionInspectorDock); + myDockWidgets[selectionInspectorDock] = false; // hidden by default // Comparative View QDockWidget* comparativePanelDock = new QDockWidget( tr( "TTL_COMPARATIVE_VIEW_INSPECTOR" ), desk ); @@ -132,7 +197,26 @@ void PVGUI_Module::setupDockWidgets() desk->addDockWidget( Qt::LeftDockWidgetArea, comparativePanelDock ); pqComparativeVisPanel* cv_panel = new pqComparativeVisPanel( comparativePanelDock ); comparativePanelDock->setWidget(cv_panel); - myDockWidgets.append(comparativePanelDock); + myDockWidgets[comparativePanelDock] = false; // hidden by default + + // Collaboration view + QDockWidget* collaborationPanelDock = new QDockWidget(tr( "TTL_COLLABORATIVE_DOCK" ), desk); + collaborationPanelDock->setObjectName("collaborationPanelDock"); + pqCollaborationPanel* collaborationPanel = new pqCollaborationPanel(); + collaborationPanel->setObjectName("collaborationPanel"); + collaborationPanelDock->setWidget(collaborationPanel); + desk->addDockWidget(Qt::RightDockWidgetArea, collaborationPanelDock); + myDockWidgets[collaborationPanelDock] = false; // hidden by default + + // Memory inspector dock + QDockWidget* memoryInspectorDock = new QDockWidget(tr( "TTL_MEMORY_INSPECTOR" ), desk); + memoryInspectorDock->setObjectName("memoryInspectorDock"); + pqMemoryInspector* dockWidgetContents = new pqMemoryInspector(); + dockWidgetContents->setObjectName("dockWidgetContents"); + memoryInspectorDock->setWidget(dockWidgetContents); + desk->addDockWidget(Qt::RightDockWidgetArea, memoryInspectorDock); + myDockWidgets[memoryInspectorDock] = false; // hidden by default + // Setup the statusbar ... pqProgressWidget* aProgress = new pqProgressWidget(desk->statusBar()); @@ -147,6 +231,8 @@ void PVGUI_Module::setupDockWidgets() comparativePanelDock->hide(); animationViewDock->hide(); selectionInspectorDock->hide(); + collaborationPanelDock->hide(); + memoryInspectorDock->hide(); // Setup quick-launch shortcuts. @@ -164,11 +250,42 @@ void PVGUI_Module::saveDockWidgetsState() { SUIT_Desktop* desk = application()->desktop(); + // VSR: 19/06/2011: do not use Paraview's methods, since it conflicts with SALOME GUI architecture + // ... the following code is commented... // Save the state of the window ... - pqApplicationCore::instance()->settings()->saveState(*desk, "MainWindow"); + // pqApplicationCore::instance()->settings()->saveState(*desk, "MainWindow"); + // + //for (int i = 0; i < myDockWidgets.size(); ++i) + // myDockWidgets.at(i)->setParent(0); + // ... and replaced - manually hide dock windows - for (int i = 0; i < myDockWidgets.size(); ++i) - myDockWidgets.at(i)->setParent(0); + // store dock widgets visibility state and hide'em all + QMapIterator it1( myDockWidgets ); + while( it1.hasNext() ) { + it1.next(); + QDockWidget* dw = qobject_cast( it1.key() ); + myDockWidgets[dw] = dw->isVisible(); + dw->setVisible( false ); + dw->toggleViewAction()->setVisible( false ); + } + // store toolbar breaks state and remove all tollbar breaks + QMapIterator it2( myToolbarBreaks ); + while( it2.hasNext() ) { + it2.next(); + QToolBar* tb = qobject_cast( it2.key() ); + myToolbarBreaks[tb] = desk->toolBarBreak( tb ); + if ( myToolbarBreaks[tb] ) + desk->removeToolBarBreak( tb ); + } + // store toolbars visibility state and hide'em all + QMapIterator it3( myToolbars ); + while( it3.hasNext() ) { + it3.next(); + QToolBar* tb = qobject_cast( it3.key() ); + myToolbars[tb] = tb->isVisible(); + tb->setVisible( false ); + tb->toggleViewAction()->setVisible( false ); + } } /*! @@ -178,9 +295,37 @@ void PVGUI_Module::restoreDockWidgetsState() { SUIT_Desktop* desk = application()->desktop(); - for (int i = 0; i < myDockWidgets.size(); ++i) - myDockWidgets.at(i)->setParent(desk); - + // VSR: 19/06/2011: do not use Paraview's methods, since it conflicts with SALOME GUI architecture + // ... the following code is commented... + //for (int i = 0; i < myDockWidgets.size(); ++i) + // myDockWidgets.at(i)->setParent(desk); + // // Restore the state of the window ... - pqApplicationCore::instance()->settings()->restoreState("MainWindow", *desk); + //pqApplicationCore::instance()->settings()->restoreState("MainWindow", *desk); + // ... and replaced - manually hide dock windows + + // restore dock widgets visibility state + QMapIterator it1( myDockWidgets ); + while( it1.hasNext() ) { + it1.next(); + QDockWidget* dw = qobject_cast( it1.key() ); + dw->setVisible( it1.value() ); + dw->toggleViewAction()->setVisible( true ); + } + // restore toolbar breaks state + QMapIterator it2( myToolbarBreaks ); + while( it2.hasNext() ) { + it2.next(); + QToolBar* tb = qobject_cast( it2.key() ); + if ( myToolbarBreaks[tb] ) + desk->insertToolBarBreak( tb ); + } + // restore toolbar visibility state + QMapIterator it3( myToolbars ); + while( it3.hasNext() ) { + it3.next(); + QToolBar* tb = qobject_cast( it3.key() ); + tb->setVisible( it3.value() ); + tb->toggleViewAction()->setVisible( true ); + } } diff --git a/src/PVGUI/PVGUI_OutputWindowAdapter.cxx b/src/PVGUI/PVGUI_OutputWindowAdapter.cxx index 2fb78e18..8c5c5734 100644 --- a/src/PVGUI/PVGUI_OutputWindowAdapter.cxx +++ b/src/PVGUI/PVGUI_OutputWindowAdapter.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// #include "PVGUI_OutputWindowAdapter.h" @@ -6,10 +24,36 @@ #include #include #include +#include vtkStandardNewMacro(PVGUI_OutputWindowAdapter); vtkCxxRevisionMacro(PVGUI_OutputWindowAdapter, "$Revision$"); + + +/*! + * Put the message in the log window. + */ +class TEvent: public SALOME_Event { + LogWindow* myWindow; + QString myMsg; + QColor myColor; + int myFlags; + public: + TEvent( LogWindow* theWindow, const QString theMsg, const QColor theColor, const int flags) : + myWindow ( theWindow ), + myMsg ( theMsg ), + myColor ( theColor ), + myFlags (flags) + {} + + virtual void Execute() { + if(myWindow) + myWindow->putMessage(myMsg, myColor, myFlags); + } +}; + + PVGUI_OutputWindowAdapter::PVGUI_OutputWindowAdapter() : TextCount(0), ErrorCount(0), @@ -54,31 +98,23 @@ static LogWindow* getLogWindow() void PVGUI_OutputWindowAdapter::DisplayText(const char* text) { ++this->TextCount; - LogWindow* wnd = getLogWindow(); - if ( wnd ) - wnd->putMessage( text, Qt::darkGreen, LogWindow::DisplayNormal ); + ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::darkGreen, LogWindow::DisplayNormal )); } void PVGUI_OutputWindowAdapter::DisplayErrorText(const char* text) { ++this->ErrorCount; - LogWindow* wnd = getLogWindow(); - if ( wnd ) - wnd->putMessage( text, Qt::darkRed, LogWindow::DisplayNormal ); + ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::darkRed, LogWindow::DisplayNormal )); } void PVGUI_OutputWindowAdapter::DisplayWarningText(const char* text) { ++this->WarningCount; - LogWindow* wnd = getLogWindow(); - if ( wnd ) - wnd->putMessage( text, Qt::black, LogWindow::DisplayNormal ); + ProcessVoidEvent( new TEvent( getLogWindow(), text, Qt::black, LogWindow::DisplayNormal )); } void PVGUI_OutputWindowAdapter::DisplayGenericWarningText(const char* text) { ++this->GenericWarningCount; - LogWindow* wnd = getLogWindow(); - if ( wnd ) - wnd->putMessage( text, Qt::black, LogWindow::DisplayNormal ); + ProcessVoidEvent( new TEvent( getLogWindow() , text, Qt::black, LogWindow::DisplayNormal )); } diff --git a/src/PVGUI/PVGUI_OutputWindowAdapter.h b/src/PVGUI/PVGUI_OutputWindowAdapter.h index cb79671a..86c6e41c 100644 --- a/src/PVGUI/PVGUI_OutputWindowAdapter.h +++ b/src/PVGUI/PVGUI_OutputWindowAdapter.h @@ -1,4 +1,21 @@ - +// Copyright (C) 2010-2012 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. +// +// 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 +// #ifndef _PVGUI_OutputWindowAdapter_h #define _PVGUI_OutputWindowAdapter_h diff --git a/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx b/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx new file mode 100644 index 00000000..fb973711 --- /dev/null +++ b/src/PVGUI/PVGUI_ParaViewSettingsPane.cxx @@ -0,0 +1,647 @@ +// PARAVIS : ParaView wrapper SALOME module +// +// Copyright (C) 2010-2012 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. +// +// 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 +// +// File : PVGUI_ParaViewSettingsPane.cxx +// Author : Vitaly Smetannikov +// + +#include "PVGUI_ParaViewSettingsPane.h" +#include "ui_pqOptionsDialog.h" + +#include +#include +#include +#include "pqApplicationCore.h" +#include "pqApplicationOptions.h" +#include "pqGlobalRenderViewOptions.h" +#include "pqPluginManager.h" +#include "pqViewOptionsInterface.h" +#include "pqInterfaceTracker.h" + +#include +#include +#include +#include +#include + + +class OptionsDialogModelItem +{ +public: + OptionsDialogModelItem(); + OptionsDialogModelItem(const QString &name); + ~OptionsDialogModelItem(); + + OptionsDialogModelItem *Parent; + QString Name; + QList Children; +}; + + +class OptionsDialogModel : public QAbstractItemModel +{ +public: + OptionsDialogModel(QObject *parent=0); + virtual ~OptionsDialogModel(); + + virtual int rowCount(const QModelIndex &parent=QModelIndex()) const; + virtual int columnCount(const QModelIndex &parent=QModelIndex()) const; + virtual QModelIndex index(int row, int column, + const QModelIndex &parent=QModelIndex()) const; + virtual QModelIndex parent(const QModelIndex &child) const; + + virtual QVariant data(const QModelIndex &index, + int role=Qt::DisplayRole) const; + + QModelIndex getIndex(const QString &path) const; + QString getPath(const QModelIndex &index) const; + void addPath(const QString &path); + bool removeIndex(const QModelIndex &index); + +private: + QModelIndex getIndex(OptionsDialogModelItem *item) const; + +private: + OptionsDialogModelItem *Root; +}; + + +class OptionsDialogForm : public Ui::pqOptionsFrame +{ +public: + OptionsDialogForm(); + ~OptionsDialogForm(); + + QMap Pages; + OptionsDialogModel *Model; + int ApplyUseCount; + //bool ApplyNeeded; +}; + + +//---------------------------------------------------------------------------- +OptionsDialogModelItem::OptionsDialogModelItem() + : Name(), Children() +{ + this->Parent = 0; +} + +OptionsDialogModelItem::OptionsDialogModelItem(const QString &name) + : Name(name), Children() +{ + this->Parent = 0; +} + +OptionsDialogModelItem::~OptionsDialogModelItem() +{ + QList::Iterator iter = this->Children.begin(); + for( ; iter != this->Children.end(); ++iter) + { + delete *iter; + } +} + + +//---------------------------------------------------------------------------- +OptionsDialogModel::OptionsDialogModel(QObject *parentObject) + : QAbstractItemModel(parentObject) +{ + this->Root = new OptionsDialogModelItem(); +} + +OptionsDialogModel::~OptionsDialogModel() +{ + delete this->Root; +} + +int OptionsDialogModel::rowCount(const QModelIndex &parentIndex) const +{ + OptionsDialogModelItem *item = this->Root; + if(parentIndex.isValid()) + { + item = reinterpret_cast( + parentIndex.internalPointer()); + } + + return item->Children.size(); +} + +int OptionsDialogModel::columnCount(const QModelIndex &) const +{ + return 1; +} + +QModelIndex OptionsDialogModel::index(int row, int column, + const QModelIndex &parentIndex) const +{ + OptionsDialogModelItem *item = this->Root; + if(parentIndex.isValid()) + { + item = reinterpret_cast( + parentIndex.internalPointer()); + } + + if(column == 0 && row >= 0 && row < item->Children.size()) + { + return this->createIndex(row, column, item->Children[row]); + } + + return QModelIndex(); +} + +QModelIndex OptionsDialogModel::parent(const QModelIndex &child) const +{ + if(child.isValid()) + { + OptionsDialogModelItem *item = + reinterpret_cast(child.internalPointer()); + return this->getIndex(item->Parent); + } + + return QModelIndex(); +} + +QVariant OptionsDialogModel::data(const QModelIndex &idx, int role) const +{ + if(idx.isValid()) + { + OptionsDialogModelItem *item = + reinterpret_cast(idx.internalPointer()); + if(role == Qt::DisplayRole || role == Qt::ToolTipRole) + { + return QVariant(item->Name); + } + } + + return QVariant(); +} + +QModelIndex OptionsDialogModel::getIndex(const QString &path) const +{ + OptionsDialogModelItem *item = this->Root; + QStringList names = path.split("."); + QStringList::Iterator iter = names.begin(); + for( ; item && iter != names.end(); ++iter) + { + OptionsDialogModelItem *child = 0; + QList::Iterator jter = item->Children.begin(); + for( ; jter != item->Children.end(); ++jter) + { + if((*jter)->Name == *iter) + { + child = *jter; + break; + } + } + + item = child; + } + + if(item && item != this->Root) + { + return this->getIndex(item); + } + + return QModelIndex(); +} + +QString OptionsDialogModel::getPath(const QModelIndex &idx) const +{ + if(idx.isValid()) + { + QString path; + OptionsDialogModelItem *item = + reinterpret_cast(idx.internalPointer()); + if(item) + { + path = item->Name; + item = item->Parent; + } + + while(item && item != this->Root) + { + path.prepend(".").prepend(item->Name); + item = item->Parent; + } + + return path; + } + + return QString(); +} + +void OptionsDialogModel::addPath(const QString &path) +{ + OptionsDialogModelItem *item = this->Root; + QStringList names = path.split("."); + QStringList::Iterator iter = names.begin(); + for( ; iter != names.end(); ++iter) + { + OptionsDialogModelItem *child = 0; + QList::Iterator jter = item->Children.begin(); + for( ; jter != item->Children.end(); ++jter) + { + if((*jter)->Name == *iter) + { + child = *jter; + break; + } + } + + if(!child) + { + child = new OptionsDialogModelItem(*iter); + child->Parent = item; + QModelIndex parentIndex = this->getIndex(item); + int row = item->Children.size(); + this->beginInsertRows(parentIndex, row, row); + item->Children.append(child); + this->endInsertRows(); + } + + item = child; + } +} + +bool OptionsDialogModel::removeIndex(const QModelIndex &idx) +{ + if(idx.isValid()) + { + OptionsDialogModelItem *item = + reinterpret_cast(idx.internalPointer()); + if(item->Children.size() == 0) + { + QModelIndex parentIndex = this->getIndex(item->Parent); + this->beginRemoveRows(parentIndex, idx.row(), idx.row()); + item->Parent->Children.removeAt(idx.row()); + this->endRemoveRows(); + delete item; + return true; + } + } + + return false; +} + +QModelIndex OptionsDialogModel::getIndex( + OptionsDialogModelItem *item) const +{ + if(item && item->Parent) + { + return this->createIndex(item->Parent->Children.indexOf(item), 0, item); + } + + return QModelIndex(); +} + + +//---------------------------------------------------------------------------- +OptionsDialogForm::OptionsDialogForm() + : Ui::pqOptionsFrame(), Pages() +{ + this->Model = new OptionsDialogModel(); + this->ApplyUseCount = 0; + //this->ApplyNeeded = false; +} + +OptionsDialogForm::~OptionsDialogForm() +{ + delete this->Model; +} + + +//---------------------------------------------------------------------------- +PVGUI_ParaViewSettingsPane::PVGUI_ParaViewSettingsPane(QWidget *widgetParent) + : QtxUserDefinedContent(widgetParent) +{ + this->Form = new OptionsDialogForm(); + this->Form->setupUi(this); + this->Form->PageNames->setModel(this->Form->Model); + + // Hide the tree widget header view. + this->Form->PageNames->header()->hide(); + + // Hide the apply and reset buttons until they are needed. + //this->Form->ApplyButton->setEnabled(false); + //this->Form->ResetButton->setEnabled(false); + //this->Form->ApplyButton->hide(); + //this->Form->ResetButton->hide(); + + this->connect(this->Form->PageNames->selectionModel(), + SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), + this, SLOT(changeCurrentPage())); + //this->connect(this->Form->ApplyButton, SIGNAL(clicked()), + // this, SLOT(applyChanges())); + //this->connect(this->Form->ResetButton, SIGNAL(clicked()), + // this, SLOT(resetChanges())); + //this->connect(this->Form->CloseButton, SIGNAL(clicked()), + // this, SLOT(accept())); + + // Code From pqApplicationOptionsDialog + //this->setApplyNeeded(true); + + pqApplicationOptions* appOptions = new pqApplicationOptions; + this->addOptions(appOptions); + + pqGlobalRenderViewOptions* renOptions = new pqGlobalRenderViewOptions; + this->addOptions(renOptions); + + QStringList pages = appOptions->getPageList(); + if(pages.size()) + { + this->setCurrentPage(pages[0]); + } + + /// Add panes as plugins are loaded. + QObject::connect(pqApplicationCore::instance()->getPluginManager(), + SIGNAL(guiInterfaceLoaded(QObject*)), + this, SLOT(pluginLoaded(QObject*))); + + // Load panes from already loaded plugins. + foreach (QObject* plugin_interface, pqApplicationCore::instance()->interfaceTracker()->interfaces()) + //pqApplicationCore::instance()->getPluginManager()->interfaces()) + { + this->pluginLoaded(plugin_interface); + } +} + +PVGUI_ParaViewSettingsPane::~PVGUI_ParaViewSettingsPane() +{ + delete this->Form; +} +/* +bool PVGUI_ParaViewSettingsPane::isApplyNeeded() const +{ + return this->Form->ApplyNeeded; +} +*/ +/* +void PVGUI_ParaViewSettingsPane::setApplyNeeded(bool applyNeeded) +{ + if(applyNeeded != this->Form->ApplyNeeded) + { + if(!applyNeeded) + { + this->Form->ApplyNeeded = false; + //this->Form->ApplyButton->setEnabled(false); + //this->Form->ResetButton->setEnabled(false); + } + else if(this->Form->ApplyUseCount > 0) + { + this->Form->ApplyNeeded = true; + //this->Form->ApplyButton->setEnabled(true); + //this->Form->ResetButton->setEnabled(true); + } + } +} +*/ +void PVGUI_ParaViewSettingsPane::addOptions(const QString &path, pqOptionsPage *options) +{ + if(!options) + { + return; + } + + // See if the page is a container. + pqOptionsContainer *container = qobject_cast(options); + if(!container && path.isEmpty()) + { + return; + } + + // See if the page/container uses the apply button. + if(options->isApplyUsed()) + { + this->Form->ApplyUseCount++; + /*if(this->Form->ApplyUseCount == 1) + { + //this->Form->ApplyButton->show(); + //this->Form->ResetButton->show(); + //QObject::connect(this, SIGNAL(accepted()), this, SLOT(applyChanges())); + }*/ + + //this->connect(options, SIGNAL(changesAvailable()), + //this, SLOT(enableButtons())); + } + + // Add the widget to the stack. + this->Form->Stack->addWidget(options); + + // Add the page(s) to the map and the model. + if(container) + { + // If the path is not empty, use it as the page prefix. + QString prefix; + if(!path.isEmpty()) + { + prefix = path; + prefix.append("."); + } + + container->setPagePrefix(prefix); + + // Get the list of pages from the container. + QStringList pathList = container->getPageList(); + QStringList::Iterator iter = pathList.begin(); + for( ; iter != pathList.end(); ++iter) + { + this->Form->Pages.insert(prefix + *iter, options); + this->Form->Model->addPath(prefix + *iter); + } + } + else + { + this->Form->Pages.insert(path, options); + this->Form->Model->addPath(path); + } +} + +void PVGUI_ParaViewSettingsPane::addOptions(pqOptionsContainer *options) +{ + this->addOptions(QString(), options); +} + +void PVGUI_ParaViewSettingsPane::removeOptions(pqOptionsPage *options) +{ + if(!options) + { + return; + } + + // Remove the widget from the stack. + this->Form->Stack->removeWidget(options); + + // See if the options use the apply button. + if(options->isApplyUsed()) + { + this->Form->ApplyUseCount--; + /*if(this->Form->ApplyUseCount == 0) + { + //this->Form->ApplyNeeded = false; + //this->Form->ApplyButton->setEnabled(false); + //this->Form->ResetButton->setEnabled(false); + //this->Form->ApplyButton->hide(); + //this->Form->ResetButton->hide(); + //QObject::disconnect(this, SIGNAL(accepted()), this, SLOT(applyChanges())); + }*/ + + this->disconnect(options, 0, this, 0); + } + + // Search the map for the paths to remove. + QMap::Iterator iter = this->Form->Pages.begin(); + while(iter != this->Form->Pages.end()) + { + if(*iter == options) + { + QString path = iter.key(); + iter = this->Form->Pages.erase(iter); + + // Remove the item from the tree model as well. + QModelIndex index = this->Form->Model->getIndex(path); + QPersistentModelIndex parentIndex = index.parent(); + if(this->Form->Model->removeIndex(index)) + { + // Remove any empty parent items. + while(parentIndex.isValid() && + this->Form->Model->rowCount(parentIndex) == 0) + { + index = parentIndex; + parentIndex = index.parent(); + + // Make sure the index path isn't in the map. + path = this->Form->Model->getPath(index); + if(this->Form->Pages.find(path) == this->Form->Pages.end()) + { + if(!this->Form->Model->removeIndex(index)) + { + break; + } + } + } + } + } + else + { + ++iter; + } + } +} + +void PVGUI_ParaViewSettingsPane::setCurrentPage(const QString &path) +{ + QModelIndex current = this->Form->Model->getIndex(path); + this->Form->PageNames->setCurrentIndex(current); +} + +void PVGUI_ParaViewSettingsPane::applyChanges() +{ + //if(this->Form->ApplyNeeded) + // { + BEGIN_UNDO_SET("Changed View Settings"); + emit this->aboutToApplyChanges(); + QMap::Iterator iter = this->Form->Pages.begin(); + for( ; iter != this->Form->Pages.end(); ++iter) + { + (*iter)->applyChanges(); + } + + //this->setApplyNeeded(false); + emit this->appliedChanges(); + END_UNDO_SET(); + //} +} + +void PVGUI_ParaViewSettingsPane::resetChanges() +{ + //if(this->Form->ApplyNeeded) + //{ + QMap::Iterator iter = this->Form->Pages.begin(); + for( ; iter != this->Form->Pages.end(); ++iter) + { + (*iter)->resetChanges(); + } + + //this->setApplyNeeded(false); + //} +} + +void PVGUI_ParaViewSettingsPane::changeCurrentPage() +{ + // Get the current index from the view. + QModelIndex current = this->Form->PageNames->currentIndex(); + + // Look up the path for the current index. + QString path = this->Form->Model->getPath(current); + QMap::Iterator iter = this->Form->Pages.find(path); + if(iter == this->Form->Pages.end()) + { + // If no page is found, show the blank page. + this->Form->Stack->setCurrentWidget(this->Form->BlankPage); + } + else + { + this->Form->Stack->setCurrentWidget(*iter); + pqOptionsContainer *container = qobject_cast(*iter); + if(container) + { + // Get the path prefix from the container. + QString prefix = container->getPagePrefix(); + if(!prefix.isEmpty()) + { + // Remove the prefix from the path. + path.remove(0, prefix.length()); + } + + // Set the page on the container object. + container->setPage(path); + } + } +} + +//----------------------------------------------------------------------------- +void PVGUI_ParaViewSettingsPane::pluginLoaded(QObject* iface) +{ + pqViewOptionsInterface* viewOptions = + qobject_cast(iface); + if (viewOptions) + { + foreach(QString viewtype, viewOptions->viewTypes()) + { + // Try to create global view options + pqOptionsContainer* globalOptions = + viewOptions->createGlobalViewOptions(viewtype, this); + if (globalOptions) + { + this->addOptions(globalOptions); + } + } + } +} + +void PVGUI_ParaViewSettingsPane::store(QtxResourceMgr* , QtxPreferenceMgr* ) +{ + applyChanges(); +} + +void PVGUI_ParaViewSettingsPane::retrieve(QtxResourceMgr* , QtxPreferenceMgr* ) +{ +} + diff --git a/src/PVGUI/PVGUI_ParaViewSettingsPane.h b/src/PVGUI/PVGUI_ParaViewSettingsPane.h new file mode 100644 index 00000000..5f7909df --- /dev/null +++ b/src/PVGUI/PVGUI_ParaViewSettingsPane.h @@ -0,0 +1,123 @@ +// PARAVIS : ParaView wrapper SALOME module +// +// Copyright (C) 2010-2012 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. +// +// 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 +// +// File : PVGUI_ParaViewSettingsPane.h +// Author : Vitaly Smetannikov +// + + +#ifndef PVGUI_ParaViewSettingsPane_H +#define PVGUI_ParaViewSettingsPane_H + +#include + +#include + +#include "pqComponentsExport.h" + +class pqOptionsContainer; +class OptionsDialogForm; +class pqOptionsPage; +class QString; + + +class PVGUI_ParaViewSettingsPane : public QtxUserDefinedContent +{ + Q_OBJECT + +public: + PVGUI_ParaViewSettingsPane(QWidget *parent=0); + virtual ~PVGUI_ParaViewSettingsPane(); + + /// \brief + /// Gets whether or not there are changes to apply. + /// \return + /// True if there are changes to apply. + //bool isApplyNeeded() const; + + /// \brief + /// Sets whether or not there are changes to apply. + /// \param applyNeeded True if there are changes to apply. + //void setApplyNeeded(bool applyNeeded); + + /// \brief + /// Adds a page to the options dialog. + /// + /// When the options object is a page container, the path parameter + /// becomes the path prefix for the container pages. + /// + /// \param path The name hierarchy for the options page. + /// \param options The options page. + void addOptions(const QString &path, pqOptionsPage *options); + + /// \brief + /// Adds a container to the options dialog. + /// + /// Each page listed for the container is added to the root of the + /// selection tree. + /// + /// \param options The options container to add. + void addOptions(pqOptionsContainer *options); + + /// \brief + /// Removes the options page from the options dialog. + /// + /// The page name is removed from the selection tree. If the page + /// is an options container, all the names are removed. + /// + /// \param options The options page/container to remove. + void removeOptions(pqOptionsPage *options); + + /// Implementation of QtxUserDefinedContent interface + virtual void store(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref); + virtual void retrieve(QtxResourceMgr* theRes, QtxPreferenceMgr* thePref); + + +public slots: + /// \brief + /// Sets the current options page. + /// \param path The name of the options page to show. + void setCurrentPage(const QString &path); + + /// Calls each page to apply any changes. + void applyChanges(); + + /// Calls each page to reset any changes. + void resetChanges(); + +signals: + /// Emitted before the option changes are applied. + void aboutToApplyChanges(); + + /// Emitted after the option changes have been applied. + void appliedChanges(); + +protected slots: + void pluginLoaded(QObject* plugin_interface); + +private slots: + /// Changes the current page to match the user selection. + void changeCurrentPage(); + +private: + OptionsDialogForm *Form; /// Stores the form and class data. +}; + +#endif diff --git a/src/PVGUI/PVGUI_Tools.cxx b/src/PVGUI/PVGUI_Tools.cxx index cf79d811..30abd0fb 100644 --- a/src/PVGUI/PVGUI_Tools.cxx +++ b/src/PVGUI/PVGUI_Tools.cxx @@ -1,34 +1,30 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU VISUGUI : GUI of VISU component // File : PVGUI_Tools.cxx // Author : Vitaly Smetannikov // Module : PARAVIS -// #include "PVGUI_Tools.h" #include "CAM_Module.h" #include "SALOME_LifeCycleCORBA.hxx" #include "SalomeApp_Application.h" +#include "SalomeApp_Study.h" #include using namespace std; @@ -42,7 +38,7 @@ namespace PARAVIS static PARAVIS_Gen_i* aGen = NULL; if(!aGen){ SALOME_LifeCycleCORBA aLCC(SalomeApp_Application::namingService()); - Engines::Component_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","PARAVIS"); + Engines::EngineComponent_var aComponent = aLCC.FindOrLoad_Component("FactoryServer","PARAVIS"); PARAVIS_Gen_var aPARAVIS = PARAVIS_Gen::_narrow(aComponent); if(!CORBA::is_nil(aPARAVIS)){ aGen = PARAVIS_Gen_i::GetParavisGenImpl(); @@ -53,4 +49,17 @@ namespace PARAVIS return aGen; } + //------------------------------------------------------------ + _PTR(Study) GetCStudy(const CAM_Module* theModule) + { + if (theModule && theModule->application()) { + SalomeApp_Study* activeStudy = + dynamic_cast(theModule->application()->activeStudy()); + if (activeStudy) { + return activeStudy->studyDS(); + } + } + + return _PTR(Study)(); + } } diff --git a/src/PVGUI/PVGUI_Tools.h b/src/PVGUI/PVGUI_Tools.h index 7b929c84..dde87493 100644 --- a/src/PVGUI/PVGUI_Tools.h +++ b/src/PVGUI/PVGUI_Tools.h @@ -1,7 +1,6 @@ // PARAVIS : ParaView wrapper SALOME module // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2010-2012 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 @@ -28,6 +27,8 @@ #include "PARAVIS_Gen_i.hh" +#include "SALOMEDSClient_Study.hxx" + class CAM_Module; namespace PARAVIS @@ -35,6 +36,7 @@ namespace PARAVIS PARAVIS_Gen_i* GetParavisGen(const CAM_Module* theModule); + _PTR(Study) GetCStudy(const CAM_Module* theModule); }; #endif // PVGUI_Tools_H diff --git a/src/PVGUI/PVGUI_ViewManager.cxx b/src/PVGUI/PVGUI_ViewManager.cxx index 099f16d7..9810d35c 100644 --- a/src/PVGUI/PVGUI_ViewManager.cxx +++ b/src/PVGUI/PVGUI_ViewManager.cxx @@ -1,17 +1,17 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2010-2012 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// 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 +// 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 @@ -20,7 +20,7 @@ #include #include #include -#include +#include /*! Constructor @@ -41,7 +41,7 @@ PVGUI_ViewManager::~PVGUI_ViewManager() /*! \brief Returns the ParaView multi-view manager for the active view window */ -pqViewManager* PVGUI_ViewManager::getMultiViewManager() +pqTabbedMultiViewWidget* PVGUI_ViewManager::getMultiViewManager() { - return qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_MANAGER")); + return qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET")); } diff --git a/src/PVGUI/PVGUI_ViewManager.h b/src/PVGUI/PVGUI_ViewManager.h index dc8be9fc..eb4f86c3 100644 --- a/src/PVGUI/PVGUI_ViewManager.h +++ b/src/PVGUI/PVGUI_ViewManager.h @@ -1,17 +1,17 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2010-2012 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// 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 +// 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 @@ -23,7 +23,7 @@ class SUIT_Desktop; class SUIT_Study; -class pqViewManager; +class pqTabbedMultiViewWidget; class PVGUI_ViewManager : public SUIT_ViewManager { @@ -33,7 +33,7 @@ public: PVGUI_ViewManager( SUIT_Study*, SUIT_Desktop* ); ~PVGUI_ViewManager(); - pqViewManager* getMultiViewManager(); + pqTabbedMultiViewWidget* getMultiViewManager(); }; #endif diff --git a/src/PVGUI/PVGUI_ViewModel.cxx b/src/PVGUI/PVGUI_ViewModel.cxx index 3ff348c2..ea11ad22 100644 --- a/src/PVGUI/PVGUI_ViewModel.cxx +++ b/src/PVGUI/PVGUI_ViewModel.cxx @@ -1,22 +1,21 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2010-2012 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// 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 +// 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 // -// Plot2d_ViewModel.cxx: implementation of the Plot2d_ViewModel class. #include "PVGUI_ViewModel.h" #include "PVGUI_ViewWindow.h" diff --git a/src/PVGUI/PVGUI_ViewModel.h b/src/PVGUI/PVGUI_ViewModel.h index bd25f1c3..a846291b 100644 --- a/src/PVGUI/PVGUI_ViewModel.h +++ b/src/PVGUI/PVGUI_ViewModel.h @@ -1,17 +1,17 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2010-2012 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// 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 +// 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 diff --git a/src/PVGUI/PVGUI_ViewWindow.cxx b/src/PVGUI/PVGUI_ViewWindow.cxx index 6298d3e4..30486c8f 100644 --- a/src/PVGUI/PVGUI_ViewWindow.cxx +++ b/src/PVGUI/PVGUI_ViewWindow.cxx @@ -1,17 +1,17 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2010-2012 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// 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 +// 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 @@ -27,7 +27,7 @@ #include #include -#include +#include #include /*! @@ -44,7 +44,7 @@ PVGUI_ViewWindow::PVGUI_ViewWindow( SUIT_Desktop* theDesktop, PVGUI_Viewer* theM : SUIT_ViewWindow( theDesktop ), myPVMgr( 0 ) { myModel = theModel; - myPVMgr = qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_MANAGER")); + myPVMgr = qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_WIDGET")); if (myPVMgr) { myPVMgr->setParent( this ); // This is mandatory, see setParent() method in Qt 4 documentation @@ -88,25 +88,11 @@ void PVGUI_ViewWindow::setVisualParameters( const QString& parameters ) SUIT_ViewWindow::setVisualParameters( parameters ); } -/*! - \brief Sets the ParaView multi-view manager for this view window -*/ -// void PVGUI_ViewWindow::setMultiViewManager() -// { -// myPVMgr = qobject_cast(pqApplicationCore::instance()->manager("MULTIVIEW_MANAGER")); -// if (myPVMgr) { -// myPVMgr->setParent( this ); -// // This is mandatory, see setParent() method in Qt 4 documentation -// myPVMgr->show(); -// setCentralWidget( myPVMgr ); -// } else -// qDebug("No multiViewManager defined"); -// } /*! \brief Returns the ParaView multi-view manager previously set with setMultiViewManager() */ -pqViewManager* PVGUI_ViewWindow::getMultiViewManager() const +pqTabbedMultiViewWidget* PVGUI_ViewWindow::getMultiViewManager() const { return myPVMgr; } diff --git a/src/PVGUI/PVGUI_ViewWindow.h b/src/PVGUI/PVGUI_ViewWindow.h index 7e2311f6..6cd55b91 100644 --- a/src/PVGUI/PVGUI_ViewWindow.h +++ b/src/PVGUI/PVGUI_ViewWindow.h @@ -1,17 +1,17 @@ -// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D -// +// Copyright (C) 2010-2012 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// +// 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 +// 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 @@ -28,7 +28,7 @@ class SUIT_Desktop; class PVGUI_Viewer; -class pqViewManager; +class pqTabbedMultiViewWidget; class PVGUI_ViewWindow : public SUIT_ViewWindow { @@ -41,12 +41,11 @@ public: virtual QString getVisualParameters(); virtual void setVisualParameters( const QString& ); - //void setMultiViewManager(); - pqViewManager* getMultiViewManager() const; + pqTabbedMultiViewWidget* getMultiViewManager() const; private: PVGUI_Viewer* myModel; - pqViewManager* myPVMgr; + pqTabbedMultiViewWidget* myPVMgr; }; #endif // PLOT2D_VIEWWINDOW_H diff --git a/src/PVGUI/PV_Events.h b/src/PVGUI/PV_Events.h index 30a2060b..f0cae30c 100644 --- a/src/PVGUI/PV_Events.h +++ b/src/PVGUI/PV_Events.h @@ -1,25 +1,21 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU OBJECT : interactive object for VISU entities implementation // File : PV_Events.h // Author : Vitaly Smetannikov // Module : PARAVIS @@ -49,9 +45,7 @@ namespace PARAVIS { typedef SalomeApp_Application* TResult; TResult myResult; - TGetGUIApplication(const int theStudyId): - myStudyId(theStudyId), myResult(0) - {} + TGetGUIApplication(const int theStudyId):myStudyId(theStudyId), myResult(0) {} virtual void Execute() { @@ -59,11 +53,11 @@ namespace PARAVIS { SUIT_Session* aSession = SUIT_Session::session(); QList anApplications = aSession->applications(); for (int i = 0; i < anApplications.count() && !myResult; i++ ){ - if ( anApplications[i]->activeStudy() && anApplications[i]->activeStudy()->id() == myStudyId ) - myResult = dynamic_cast( anApplications[i] ); + if ( anApplications[i]->activeStudy() && anApplications[i]->activeStudy()->id() == myStudyId ) + myResult = dynamic_cast( anApplications[i] ); } if ( !myResult ) { - MESSAGE("Error: application is not found for study with id = : " << myStudyId); + MESSAGE("Error: application is not found for study with id = : " << myStudyId); } } }; @@ -75,9 +69,7 @@ namespace PARAVIS { { SalomeApp_Application* myApp; - TModuleEvent(SalomeApp_Application* theApp ) : - myApp(theApp) - {} + TModuleEvent(SalomeApp_Application* theApp ):myApp(theApp) {} //! Returns pointer on PARAVIS module instance PVGUI_Module* getModule() @@ -99,9 +91,7 @@ namespace PARAVIS { */ struct TActivateModule: public TModuleEvent { - TActivateModule(SalomeApp_Application* theApp ) : - TModuleEvent(theApp) - {} + TActivateModule(SalomeApp_Application* theApp ):TModuleEvent(theApp) {} virtual void Execute() { @@ -180,6 +170,22 @@ namespace PARAVIS { } }; + /*! + * Event to execute a script to PARAVIS + */ + struct TExecuteScript: public TParavisFileEvent + { + TExecuteScript(SalomeApp_Application* theApp, const char* theFileName ) : + TParavisFileEvent(theApp, theFileName) + {} + + virtual void Execute() + { + PVGUI_Module* aPVModule = getModule(); + if (aPVModule) + aPVModule->executeScript(myName); + } + }; /*! * Event to save current Paraview state. diff --git a/src/PVGUI/PV_I.h b/src/PVGUI/PV_I.h index cb9edae6..c15e41d9 100644 --- a/src/PVGUI/PV_I.h +++ b/src/PVGUI/PV_I.h @@ -1,23 +1,20 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : PARAVIS_I.hxx // Author : Vitaly Smetannikov @@ -27,7 +24,7 @@ #define _PARAVIS_I_HXX_ #ifdef WNT -# if defined PARAVIS_I_EXPORTS || defined PARAVISEngineImpl_EXPORTS +# if defined PARAVIS_EXPORTS # define PARAVIS_I_EXPORT __declspec( dllexport ) # else # define PARAVIS_I_EXPORT __declspec( dllimport ) diff --git a/src/PVGUI/PV_Tools.cxx b/src/PVGUI/PV_Tools.cxx index 42d9edb5..2324830f 100644 --- a/src/PVGUI/PV_Tools.cxx +++ b/src/PVGUI/PV_Tools.cxx @@ -1,25 +1,21 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// VISU OBJECT : interactive object for VISU entities implementation // File : PV_Tools.cxx // Author : Alexey PETROV // Module : VISU diff --git a/src/PVGUI/PV_Tools.h b/src/PVGUI/PV_Tools.h index bc643d4a..d0a360d1 100644 --- a/src/PVGUI/PV_Tools.h +++ b/src/PVGUI/PV_Tools.h @@ -1,23 +1,20 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2010-2012 CEA/DEN, EDF R&D // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // // File : PV_Tools.h // Author : Vitaly Smetannikov @@ -31,16 +28,12 @@ #include CORBA_SERVER_HEADER(SALOMEDS) #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) -//#include -//#include - #include namespace PARAVIS { class PARAVIS_Base_i; - //SALOMEDS::ListOfFileNames* GetListOfFileNames(const std::vector& theFileNames); SALOMEDS::ListOfFileNames* GetListOfFileNames(const QStringList& theFileNames); @@ -53,7 +46,6 @@ namespace PARAVIS bool GetRestoreParam(SALOMEDS::SComponent_ptr theComponent); PARAVIS_Base_i* GET_SERVANT(CORBA::Object_ptr aObj); - //dynamic_cast(PARAVIS_Gen_i::GetPOA()->reference_to_servant(OBJ).in()) }; diff --git a/src/PVGUI/create_class.py b/src/PVGUI/create_class.py new file mode 100755 index 00000000..d094c2c3 --- /dev/null +++ b/src/PVGUI/create_class.py @@ -0,0 +1,55 @@ +#!/bin/bash +# Copyright (C) 2010-2012 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. +# +# 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 +# + +import sys +import os + +ffile = "PARAVIS_CreateClass.cxx" +wfile = os.path.join(sys.argv[1], "wrapfiles.txt") + +ffile_stream = open(ffile, "w") + +ffile_stream.write('#include ' + '\n') +ffile_stream.write('#include ' + '\n') +ffile_stream.write('#include "PARAVIS_Gen_i.hh"' + '\n') +wfile_stream = open(wfile) +for line in wfile_stream: + ffile_stream.write('#include "PARAVIS_Gen_%s_i.hh"'%(line.split()[0]) + '\n') + pass +wfile_stream.close() +ffile_stream.write('' + '\n') +ffile_stream.write('PARAVIS::PARAVIS_Base_i* CreateInstance(::vtkObjectBase* Inst, const QString& theClassName)' + '\n') +ffile_stream.write('{' + '\n') +wfile_stream = open(wfile) +lst = [] +for line in wfile_stream: + lst.append(line.split()[0]) + pass +wfile_stream.close() +lst.reverse() +for item in lst: + ffile_stream.write(' if(theClassName == "%s" || (Inst != NULL && Inst->IsA("%s")))'%(item, item) + '\n') + ffile_stream.write(' return new PARAVIS::%s_i();'%(item) + '\n') + pass +ffile_stream.write('' + '\n') +ffile_stream.write(' cerr << "The class " << theClassName.toStdString() << " is not created!" << endl;' + '\n') +ffile_stream.write(' return new PARAVIS::PARAVIS_Base_i();' + '\n') +ffile_stream.write('}' + '\n') +ffile_stream.close() diff --git a/src/PVGUI/create_class.sh b/src/PVGUI/create_class.sh index 73c04502..e903c855 100755 --- a/src/PVGUI/create_class.sh +++ b/src/PVGUI/create_class.sh @@ -1,4 +1,22 @@ #!/bin/bash +# Copyright (C) 2010-2012 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. +# +# 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 +# file=PARAVIS_CreateClass.cxx wfile=$1/wrapfiles.txt diff --git a/src/PVGUI/resources/PARAVIS_msg_en.ts b/src/PVGUI/resources/PARAVIS_msg_en.ts index d847a290..fe8abdbc 100644 --- a/src/PVGUI/resources/PARAVIS_msg_en.ts +++ b/src/PVGUI/resources/PARAVIS_msg_en.ts @@ -1,4 +1,6 @@ - + + + @default @@ -157,12 +159,24 @@ MEN_EDIT_LINE Edit selected line + + MEN_SHOW_TRACE + Show Trace... + + + TOP_SHOW_TRACE + Show Trace + + + STB_SHOW_TRACE + Show Trace + PVGUI_ViewManager - PARAVIEW_VIEW_TITLE - ParaView scene:%M - viewer:%V + PARAVIEW_VIEW_TITLE + ParaView scene:%M - viewer:%V @@ -173,7 +187,15 @@ TTL_OBJECT_INSPECTOR - Object Inspector + Properties + + + TTL_DISPLAY + Display + + + TTL_INFORMATION + Information TTL_STATISTICS_VIEW @@ -203,9 +225,17 @@ TTL_SELECTION_INSPECTOR Selection Inspector - + + TTL_COLLABORATIVE_DOCK + Collaboration Panel + + + TTL_MEMORY_INSPECTOR + Memory Inspector + + TOP_OPEN_FILE - Import File + Open Paraview File MEN_OPEN @@ -213,11 +243,11 @@ MEN_OPEN_FILE - &Import ParaView File... + Open ParaView File... STB_OPEN_FILE - Import File + Open Paraview File MEN_RECENT_FILES @@ -341,7 +371,7 @@ MEN_CANTUNDO - Can't Undo + Can't Undo MEN_UNDO_ACTION @@ -369,7 +399,7 @@ MEN_CANTREDO - Can't Redo + Can't Redo MEN_REDO_ACTION @@ -397,7 +427,7 @@ MEN_CANT_CAMERA_UNDO - Can't Undo Camera + Can't Undo Camera MEN_CAMERA_UNDO_ACTION @@ -425,7 +455,7 @@ MEN_CANT_CAMERA_REDO - Can't Redo Camera + Can't Redo Camera MEN_CAMERA_REDO_ACTION @@ -447,17 +477,21 @@ TOP_CHANGE_INPUT Change Input... + + MEN_FIND_DATA + Find Data... + MEN_CHANGE_INPUT Change &Input... STB_CHANGE_INPUT - Change a Filter's Input + Change a Filter's Input INF_APP_CHANGE_INPUTACTIONS - Change a Filter's Input + Change a Filter's Input MEN_IGNORE_TIME @@ -469,7 +503,7 @@ STB_IGNORE_TIME - Disregard this source/filter's time from animation + Disregard this source/filter's time from animation TOP_DELETE @@ -971,6 +1005,10 @@ MEN_MAX_WINDOW_SIZE Lock View Size + + MEN_CUSTOM_WINDOW_SIZE + Lock View Size Custom... + PRP_APP_MAX_WINDOW_SIZE Lock View Size @@ -1019,6 +1057,10 @@ MEN_ABOUT About ParaView... + + MEN_PVHELP + ParaView help + STB_ABOUT About ParaView @@ -1104,8 +1146,12 @@ Deactivate Trace (for next session only) - TIT_TRACE - Trace + TIT_PVISSETTINGS + ParaVis Settings + + + TIT_PVIEWSETTINGS + ParaView Settings MEN_MACROS @@ -1117,7 +1163,7 @@ PREF_SAVE_TYPE_0 - Save referenced files only for builin server + Save referenced files only for builtin server PREF_SAVE_TYPE_1 @@ -1127,5 +1173,41 @@ PREF_SAVE_TYPE_2 Never save referenced files + + MEN_NEW_PV_VIEW + ParaView view + + + MEN_SAVE_MULTI_STATE + Save state + + + MEN_ADD_STATE + Add state + + + MEN_CLEAN_ADD_STATE + Clean and add state + + + MEN_PARAVIS_RENAME + Rename + + + MEN_PARAVIS_DELETE + Delete + + + SAVED_PARAVIEW_STATE_NAME + Paraview state: + + + ERR_ERROR + Error + + + ERR_STATE_CANNOT_BE_RESTORED + The state can't be restored. + diff --git a/src/PVGUI/resources/PARAVIS_msg_fr.ts b/src/PVGUI/resources/PARAVIS_msg_fr.ts new file mode 100644 index 00000000..7238c218 --- /dev/null +++ b/src/PVGUI/resources/PARAVIS_msg_fr.ts @@ -0,0 +1,1213 @@ + + + + + @default + + TOP_CLEAR_ALL + Effacer tout + + + STB_CLEAR_ALL + Effacer toutes les lignes de texte + + + STB_SAVE_FILE + Enregistrer le fichier texte + + + TOP_SAVE_FILE + Enregistrer le fichier texte + + + MEN_LIGHT + LIGHT + + + MEN_LOAD_FILE + Ouvrir le fichier texte + + + WRN_UNKNOWN_COMMAND + Commande inconnue ! + + + BUT_OK + &OK + + + WRN_ADD_FAILED + Impossible d'insérer la ligne ! + + + STB_DISPLAY_LINE + Montrer la ligne choisie + + + TOP_DISPLAY_LINE + Montrer la ligne + + + MEN_DISPLAY_LINE + Montrer la ligne choisie + + + STB_ERASE_LINE + Effacer la ligne choisie + + + TOP_ERASE_LINE + Effacer la ligne + + + MEN_ERASE_LINE + Effacer la ligne choisie + + + STB_EDIT_LINE + Editer la ligne choisie + + + WRN_EDIT_FAILED + Impossible d'éditer la ligne ! + + + WRN_DUMP_FAILED + Impossible d'enregistrer le fichier ! + + + WRN_LOAD_FAILED + Impossible d'ouvrir le fichier ! + + + TOP_EDIT_LINE + Editer la ligne + + + MEN_CLEAR_ALL + Effacer tout + + + MEN_FILE + &Fichier + + + LIGHT_ROOT_TOOLTIP + Objet racine du module LIGHT + + + LIGHT_LIGHT + LIGHT + + + MEN_SAVE_FILE + Enregistrer le fichier texte + + + WRN_WARNING + Attention ! + + + WRN_DELETE_FAILED + Impossible de supprimer la ligne + + + WRN_SELECT_LINE + Sélection incorrecte ! + + + TOP_LOAD_FILE + Ouvrir le fichier texte + + + TOP_ADD_LINE + Ajouter la ligne + + + MEN_DEL_LINE + Supprimer la ligne + + + STB_LOAD_FILE + Ouvrir le fichier texte + + + STB_ADD_LINE + Insérer une nouvelle ligne avant la ligne choisie + + + LIGHT_PARAGRAPH + Paragraphe + + + TOP_DEL_LINE + Supprimer la ligne + + + MEN_ADD_LINE + Insérer une nouvelle ligne de texte + + + LIGHT_LINE + Ligne + + + STB_DEL_LINE + Supprimer la ligne choisie + + + MEN_EDIT_LINE + Editer la ligne choisie + + + MEN_SHOW_TRACE + Montrer la trace... + + + TOP_SHOW_TRACE + Montrer la trace + + + STB_SHOW_TRACE + Montrer la trace + + + + PVGUI_ViewManager + + PARAVIEW_VIEW_TITLE + Scène ParaView:%M - visualisateur:%V + + + + PVGUI_Module + + TTL_PIPELINE_BROWSER + Navigateur des conduites + + + TTL_OBJECT_INSPECTOR + Inspecteur d'objets + + + TTL_DISPLAY + Affichage + + + TTL_INFORMATION + Informations + + + TTL_STATISTICS_VIEW + Vue Statistique + + + TTL_ANIMATION_INSPECTOR + Inspecteur d'animation + + + TTL_LOOKMARK_BROWSER + Navigateur des signets visuels + + + TTL_LOOKMARK_INSPECTOR + Navigateur des signets visuels + + + TTL_COMPARATIVE_VIEW_INSPECTOR + Navigateur des vues comparatif + + + TTL_ANIMATION_VIEW + Vue d'animation + + + TTL_SELECTION_INSPECTOR + Navigateur de sélection + + + TTL_COLLABORATIVE_DOCK + Panneau collaboratif + + + TTL_MEMORY_INSPECTOR + Utilisation de la mémoire + + + TOP_OPEN_FILE + Ouvrir un fichier ParaView + + + MEN_OPEN + &Importer... + + + MEN_OPEN_FILE + Ouvrir un fichier ParaView... + + + STB_OPEN_FILE + Ouvrir un fichier ParaView + + + MEN_RECENT_FILES + Fichiers récents de ParaView + + + TOP_LOAD_STATE + Ouvrir l'état + + + MEN_LOAD_STATE + &Ouvrir l'état... + + + STB_LOAD_STATE + Ouvrir l'état + + + TOP_SAVE_STATE + Enregistrer l'Etat + + + MEN_SAVE_STATE + &Enregistrer l'état... + + + STB_SAVE_STATE + Enregistrer l'état + + + TOP_SAVE_DATA + Enregistrer les données + + + MEN_SAVE_DATA + Enregistrer les données... + + + STB_SAVE_DATA + Enregistrer les données + + + TOP_SAVE_SCREENSHOT + Enregistrer l'Instantané + + + MEN_SAVE_SCREENSHOT + Enregistrer l'Instantané... + + + STB_SAVE_SCREENSHOT + Enregistrer l'Instantané + + + TOP_EXPORT + Exporter + + + MEN_EXPORT + Exporter... + + + STB_EXPORT + Exporter + + + TOP_SAVE_ANIMATION + Enregistrer l'Animation + + + MEN_SAVE_ANIMATION + Enregistrer l'&Animation... + + + STB_SAVE_ANIMATION + Enregistrer l'Animation + + + TOP_SAVE_GEOMETRY + Enregistrer la Géométrie + + + MEN_SAVE_GEOMETRY + Enregistrer la &Géométrie. + + + STB_SAVE_GEOMETRY + Enregistrer la Géométrie + + + TOP_CONNECT + Connecter + + + MEN_CONNECT + &Connecter... + + + STB_CONNECT + Connecter au serveur + + + TOP_DISCONNECT + Déconnecter + + + MEN_DISCONNECT + &Déconnecter + + + STB_DISCONNECT + Déconnecter du serveur + + + TOP_UNDO + Annuler + + + MEN_UNDO + &Annuler + + + MEN_CANTUNDO + Impossible d'Annuler + + + MEN_UNDO_ACTION + &Annuler %1 + + + MEN_UNDO_ACTION_TIP + Annuler %1 + + + STB_UNDO + Annuler la dernière opération + + + INF_APP_UNDOACTIONS + Annule %1 action(s) + + + TOP_REDO + Rétablir + + + MEN_REDO + &Rétablir + + + MEN_CANTREDO + Impossible de rétablir + + + MEN_REDO_ACTION + &Rétablir %1 + + + MEN_REDO_ACTION_TIP + Rétablir %1 + + + STB_REDO + Rétablir la dernière opération + + + INF_APP_REDOACTIONS + Rétablit %1 action(s) + + + TOP_CAMERA_UNDO + Annuler le Caméra + + + MEN_CAMERA_UNDO + Annuler le Caméra + + + MEN_CANT_CAMERA_UNDO + Impossible d'Annuler le Caméra + + + MEN_CAMERA_UNDO_ACTION + &Annuler %1 + + + MEN_CAMERA_UNDO_ACTION_TIP + Annuler %1 + + + STB_CAMERA_UNDO + Annuler la dernière opération de caméra + + + INF_APP_CAMERA_UNDOACTIONS + Annule %1 action(s) de caméra + + + TOP_CAMERA_REDO + Rétablir la caméra + + + MEN_CAMERA_REDO + Rétablir la caméra + + + MEN_CANT_CAMERA_REDO + Impossible de rétablir la caméra + + + MEN_CAMERA_REDO_ACTION + &Rétablir %1 + + + MEN_CAMERA_REDO_ACTION_TIP + Rétablir %1 + + + STB_CAMERA_REDO + Rétablir la dernière opération du caméra + + + INF_APP_CAMERA_REDOACTIONS + Rétablir %1 action(s) du caméra + + + TOP_CHANGE_INPUT + Changer les entrées... + + + MEN_FIND_DATA + Trouver les données... + + + MEN_CHANGE_INPUT + Changer les &entrées... + + + STB_CHANGE_INPUT + Changer les entrées du filtre + + + INF_APP_CHANGE_INPUTACTIONS + Changer les entrées du filtre... + + + MEN_IGNORE_TIME + Négliger le Temps + + + TOP_IGNORE_TIME + Négliger le temps + + + STB_IGNORE_TIME + Négliger cette source/temps d'animation du filtre + + + TOP_DELETE + Supprimer + + + MEN_DELETE + &Supprimer + + + STB_DELETE + Supprimer + + + TOP_DELETE_ALL + Supprimer tout + + + MEN_DELETE_ALL + Supprimer tout + + + STB_DELETE_ALL + Supprimer tout + + + TOP_INTERACT + Interagir + + + MEN_INTERACT + Interagir + + + STB_INTERACT + Interagir + + + TOP_SELECT_CELLS_ON + Choisir les cellules sur + + + MEN_SELECT_CELLS_ON + Choisir les cellules sur + + + STB_SELECT_CELLS_ON + Choisir les cellules sur + + + TOP_SELECT_POINTS_ON + Choisir les points sur + + + MEN_SELECT_POINTS_ON + Choisir les points sur + + + STB_SELECT_POINTS_ON + Choisir les points sur + + + TOP_SELECT_CELLS_THROUGH + Choisir les cellules par... + + + MEN_SELECT_CELLS_THROUGH + Choisir les cellules par... + + + STB_SELECT_CELLS_THROUGH + Choisir les cellules par... + + + TOP_SELECT_POINTS_THROUGH + Choisir les points par... + + + MEN_SELECT_POINTS_THROUGH + Choisir les points par... + + + STB_SELECT_POINTS_THROUGH + Choisir les points par... + + + TOP_SELECT_BLOCK + Choisir un bloc + + + MEN_SELECT_BLOCK + Choisir un bloc + + + STB_SELECT_BLOCK + Choisir un bloc + + + TOP_SETTINGS + Options + + + MEN_SETTINGS + Options + + + STB_SETTINGS + Options + + + TOP_VIEW_SETTINGS + Options de visualisation + + + MEN_VIEW_SETTINGS + Options de visualisation... + + + STB_VIEW_SETTINGS + Options de visualisation + + + MEN_CAMERA + Caméra + + + TOP_RESET_CAMERA + Réinitialiser la caméra + + + MEN_RESET_CAMERA + &Réinitialiser + + + STB_RESET_CAMERA + Réinitialiser la caméra + + + TOP_+X + Initialiser la direction de vue à +X + + + MEN_+X + +X + + + STB_+X + Initialiser la direction de vue à +X + + + TOP_-X + Initialiser la direction de vue à -X + + + MEN_-X + -X + + + STB_-X + Initialiser la direction de vue à -X + + + TOP_+Y + Initialiser la direction de vue à +Y + + + MEN_+Y + +Y + + + STB_+Y + Initialiser la direction de vue à +Y + + + TOP_-Y + Initialiser la direction de vue à -Y + + + MEN_-Y + -Y + + + STB_-Y + Initialiser la direction de vue à -Y + + + TOP_+Z + Initialiser la direction de vue à +Z + + + MEN_+Z + +Z + + + STB_+Z + Initialiser la direction de vue à +Z + + + TOP_-Z + Initialiser la direction de vue à -Z + + + MEN_-Z + -Z + + + STB_-Z + Initialiser la direction de vue à -Z + + + TOP_SHOW_CENTER + Montrer le centre + + + MEN_SHOW_CENTER + Montrer le centre + + + PRP_APP_SHOW_CENTER + Montrer/Cacher le centre de rotation + + + TOP_RESET_CENTER + Réinitialiser le centre + + + MEN_RESET_CENTER + Réinitialiser le centre + + + STB_RESET_CENTER + Réinitialiser le centre de rotation + + + TOP_PICK_CENTER + Choisir le centre + + + MEN_PICK_CENTER + Choisir le centre + + + PRP_APP_PICK_CENTER + Cliquez la souris pour choisir le centre de rotation + + + TOP_SHOW_COLOR_LEGEND + Visualiser la légende des couleurs + + + MEN_SHOW_COLOR_LEGEND + Visualiser la légende des couleurs + + + PRP_APP_SHOW_COLOR_LEGEND + Visualiser la légende des couleurs + + + TOP_EDIT_COLOR_MAP + Editer la palette de couleurs + + + MEN_EDIT_COLOR_MAP + Editer la Palette de Couleurs + + + PRP_APP_EDIT_COLOR_MAP + Editer la palette de couleurs + + + TOP_RESET_RANGE + Remettre à l'éventail de données + + + MEN_RESET_RANGE + Réinitialiser l'éventail + + + PRP_APP_RESET_RANGE + Remettre à l'éventail de données + + + MEN_DESK_SOURCES + &Sources + + + MEN_DESK_FILTERS + F&iltres + + + MEN_DESK_ANIMATION + A&nimation + + + TOP_FIRST_FRAME + Premier cadre + + + MEN_FIRST_FRAME + &Premier cadre + + + STB_FIRST_FRAME + Premier cadre + + + TOP_PREVIOUS_FRAME + Cadre précédent + + + MEN_PREVIOUS_FRAME + Cadre &précédent + + + STB_PREVIOUS_FRAME + Cadre précédent + + + TOP_PLAY + Jouer + + + MEN_PLAY + &Jouer + + + STB_PLAY + Jouer + + + TOP_NEXT_FRAME + Cadre suivant + + + MEN_NEXT_FRAME + Cadre &suivant + + + STB_NEXT_FRAME + Cadre suivant + + + TOP_LAST_FRAME + Dernier cadre + + + MEN_LAST_FRAME + &Dernier cadre + + + STB_LAST_FRAME + Dernier cadre + + + TOP_LOOP + Boucler + + + MEN_LOOP + &Boucler + + + PRP_APP_LOOP + Boucler + + + MEN_DESK_TOOLS + &Outils + + + TOP_CREATE_CUSTOM_FILTER + Créer un filtre personnalisé + + + MEN_CREATE_CUSTOM_FILTER + &Créer un filtre personnalisé... + + + STB_CREATE_CUSTOM_FILTER + Créer un filtre Personnalisé + + + TOP_MANAGE_CUSTOM_FILTERS + Gérer les filtres personnalisés + + + MEN_MANAGE_CUSTOM_FILTERS + Gérer les filtres personnalisés... + + + STB_MANAGE_CUSTOM_FILTERS + Gérer les filtres personnalisés + + + TOP_CREATE_LOOKMARK + Créer un signet visuel + + + MEN_CREATE_LOOKMARK + Créer un signet visuel + + + STB_CREATE_LOOKMARK + Créer un signet visuel + + + TOP_MANAGE_LINKS + Gérer les Liens + + + MEN_MANAGE_LINKS + Gérer les liens... + + + STB_MANAGE_LINKS + Gérer les liens + + + TOP_ADD_CAMERA_LINK + Ajouter un lien de caméra + + + MEN_ADD_CAMERA_LINK + Ajouter un lien de caméra... + + + STB_ADD_CAMERA_LINK + Ajouter un lien de caméra + + + WRN_ADD_CAMERA_LINK + Ajouter un lien de caméra... : Aucune module de rendu n'est actif + + + TOP_MANAGE_PLUGINS + Gérer les plugins/extensions + + + MEN_MANAGE_PLUGINS + Gérer les plugins... + + + STB_MANAGE_PLUGINS + Gérer les plugins/extensions + + + TOP_DUMP_WIDGET_NAMES + Mémoriser les noms des fenêtres + + + MEN_DUMP_WIDGET_NAMES + &Mémoriser les noms des fenêtres + + + STB_DUMP_WIDGET_NAMES + Mémoriser les noms des fenêtres + + + TOP_RECORD_TEST + Enregistrer un test + + + MEN_RECORD_TEST + Enregistrer un &test + + + STB_RECORD_TEST + Enregistrer un test + + + TOP_RECORD_TEST_SCREENSHOT + Enregistrer un instantané de test + + + MEN_RECORD_TEST_SCREENSHOT + Enregistrer un &instantané de test + + + STB_RECORD_TEST_SCREENSHOT + Enregistrer un instantané de test + + + TOP_PLAY_TEST + Jouer un Test + + + MEN_PLAY_TEST + Jouer un Test + + + STB_PLAY_TEST + Jouer un Test + + + TOP_MAX_WINDOW_SIZE + Verrouiller la taille de la vue + + + MEN_MAX_WINDOW_SIZE + Verrouiller la taille de la vue + + + MEN_CUSTOM_WINDOW_SIZE + Verrouiller la taille de la vue personnalisée + + + PRP_APP_MAX_WINDOW_SIZE + Verrouiller la taille de la vue + + + TOP_TIMER_LOG + Journal du temporisateur + + + MEN_TIMER_LOG + &Journal du temporisateur + + + STB_TIMER_LOG + Journal du temporisateur + + + TOP_OUTPUT_WINDOW + Fenêtre de sortie + + + MEN_OUTPUT_WINDOW + &Fenêtre de sortie + + + STB_OUTPUT_WINDOW + Fenêtre de sortie + + + TOP_PYTHON_SHELL + Emballage Python + + + MEN_PYTHON_SHELL + Emballage &Python + + + STB_PYTHON_SHELL + Emballage Python + + + TOP_ABOUT + A propos de ParaView + + + MEN_ABOUT + A propos de ParaView... + + + MEN_PVHELP + Aide de ParaView + + + STB_ABOUT + A propos de ParaView + + + TOP_PARAVIEW_HELP + Manuel Utilisateur de ParaView + + + MEN_PARAVIEW_HELP + Aide de ParaView + + + STB_PARAVIEW_HELP + Documentation de référence de ParaView + + + TOP_ENABLE_TOOLTIPS + Activer les infobulles + + + MEN_ENABLE_TOOLTIPS + Activer les infobulles + + + STB_ENABLE_TOOLTIPS + Activer les infobulles + + + STB_PREACCEPT + Mise à jour... + + + STB_POSTACCEPT + Prêt + + + TOOL_ACTIVE_VARIABLE_CONTROLS + Activer les contrôles des variables + + + TOOL_CAMERA_CONTROLS + Contrôles de la caméra + + + TOOL_CENTER_AXES_CONTROLS + Contrôles de centrage des axes + + + TOOL_COMMON_FILTERS + Filtres communs + + + TOOL_CURRENT_TIME_CONTROLS + Contrôles du temps actuel + + + TOOL_LOOKMARKS + Signets visuels + + + TOOL_MAIN_CONTROLS + Contrôles principaux + + + TOOL_REPRESENTATION + Représentation + + + TOOL_SELECTION_CONTROLS + Contrôles de Sélection + + + TOOL_UNDOREDO_CONTROLS + Contrôles annuler/rétablir + + + TOOL_VCR_CONTROLS + Contrôles VCR + + + PREF_STOP_TRACE + Déactiver la trace (seulement pour la session suivante) + + + TIT_PVISSETTINGS + Options de ParaVis + + + TIT_PVIEWSETTINGS + Options de ParaView + + + MEN_MACROS + &Macros + + + PREF_SAVE_TYPE_LBL + Type d'enregistrement d'état de Paraview + + + PREF_SAVE_TYPE_0 + N'enregistrer les fichiers de référence qu'au serveur de babillard + + + PREF_SAVE_TYPE_1 + Toujours enregistrer les fichiers de référence s'ils sont accessibles + + + PREF_SAVE_TYPE_2 + Ne pas enregistrer les fichiers de référence + + + MEN_NEW_PV_VIEW + Vue ParaView + + + MEN_SAVE_MULTI_STATE + Enregistrer l'état + + + MEN_ADD_STATE + Ajouter l'état + + + MEN_CLEAN_ADD_STATE + Effacer et ajouter l'état + + + MEN_PARAVIS_RENAME + Renommer + + + MEN_PARAVIS_DELETE + Supprimer + + + SAVED_PARAVIEW_STATE_NAME + Etat de Paraview: + + + ERR_ERROR + Erreur + + + ERR_STATE_CANNOT_BE_RESTORED + Impossible de restaurer l'état. + + + diff --git a/src/PVGUI/ui_pqOptionsDialog.h b/src/PVGUI/ui_pqOptionsDialog.h new file mode 100644 index 00000000..638f7b70 --- /dev/null +++ b/src/PVGUI/ui_pqOptionsDialog.h @@ -0,0 +1,145 @@ +/******************************************************************************** +** Form generated from reading ui file 'pqOptionsDialog.ui' +** +** Created: Wed Apr 21 12:59:58 2010 +** by: Qt User Interface Compiler version 4.5.3 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + +#ifndef UI_PQOPTIONSDIALOG_H +#define UI_PQOPTIONSDIALOG_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_pqOptionsFrame +{ +public: + QGridLayout *gridLayout; + QHBoxLayout *hboxLayout; + QSpacerItem *spacerItem; + //QPushButton *ApplyButton; + //QPushButton *ResetButton; + //QPushButton *CloseButton; + QStackedWidget *Stack; + QWidget *BlankPage; + QTreeView *PageNames; + QFrame *Separator; + + void setupUi(QWidget *pqOptionsFrame) + { + if (pqOptionsFrame->objectName().isEmpty()) + pqOptionsFrame->setObjectName(QString::fromUtf8("pqOptionsFrame")); + pqOptionsFrame->resize(514, 382); + gridLayout = new QGridLayout(pqOptionsFrame); +#ifndef Q_OS_MAC + gridLayout->setSpacing(6); +#endif +#ifndef Q_OS_MAC + gridLayout->setMargin(9); +#endif + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + hboxLayout = new QHBoxLayout(); +#ifndef Q_OS_MAC + hboxLayout->setSpacing(6); +#endif + hboxLayout->setMargin(4); + hboxLayout->setObjectName(QString::fromUtf8("hboxLayout")); + spacerItem = new QSpacerItem(0, 26, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hboxLayout->addItem(spacerItem); + + //ApplyButton = new QPushButton(pqOptionsFrame); + //ApplyButton->setObjectName(QString::fromUtf8("ApplyButton")); + + //hboxLayout->addWidget(ApplyButton); + + //ResetButton = new QPushButton(pqOptionsFrame); + //ResetButton->setObjectName(QString::fromUtf8("ResetButton")); + + //hboxLayout->addWidget(ResetButton); + + //CloseButton = new QPushButton(pqOptionsFrame); + //CloseButton->setObjectName(QString::fromUtf8("CloseButton")); + //CloseButton->setDefault(true); + + //hboxLayout->addWidget(CloseButton); + + + gridLayout->addLayout(hboxLayout, 2, 0, 1, 2); + + Stack = new QStackedWidget(pqOptionsFrame); + Stack->setObjectName(QString::fromUtf8("Stack")); + BlankPage = new QWidget(); + BlankPage->setObjectName(QString::fromUtf8("BlankPage")); + Stack->addWidget(BlankPage); + + gridLayout->addWidget(Stack, 0, 1, 1, 1); + + PageNames = new QTreeView(pqOptionsFrame); + PageNames->setObjectName(QString::fromUtf8("PageNames")); + QSizePolicy sizePolicy(static_cast(0), static_cast(7)); + sizePolicy.setHorizontalStretch(0); + sizePolicy.setVerticalStretch(0); + sizePolicy.setHeightForWidth(PageNames->sizePolicy().hasHeightForWidth()); + PageNames->setSizePolicy(sizePolicy); + PageNames->setMinimumSize(QSize(160, 0)); + PageNames->setMaximumSize(QSize(160, 16777215)); + + gridLayout->addWidget(PageNames, 0, 0, 1, 1); + + Separator = new QFrame(pqOptionsFrame); + Separator->setObjectName(QString::fromUtf8("Separator")); + Separator->setFrameShape(QFrame::HLine); + Separator->setFrameShadow(QFrame::Sunken); + + gridLayout->addWidget(Separator, 1, 0, 1, 2); + + //QWidget::setTabOrder(CloseButton, PageNames); + //QWidget::setTabOrder(PageNames, ApplyButton); + //QWidget::setTabOrder(ApplyButton, ResetButton); + + retranslateUi(pqOptionsFrame); + + Stack->setCurrentIndex(0); + + + QMetaObject::connectSlotsByName(pqOptionsFrame); + } // setupUi + + void retranslateUi(QWidget *pqOptionsFrame) + { + pqOptionsFrame->setWindowTitle(QApplication::translate("pqOptionsFrame", "Options", 0, QApplication::UnicodeUTF8)); + //ApplyButton->setText(QApplication::translate("pqOptionsFrame", "&Apply", 0, QApplication::UnicodeUTF8)); + //ResetButton->setText(QApplication::translate("pqOptionsFrame", "&Reset", 0, QApplication::UnicodeUTF8)); + //CloseButton->setText(QApplication::translate("pqOptionsFrame", "&Ok", 0, QApplication::UnicodeUTF8)); +#ifndef QT_NO_WHATSTHIS + PageNames->setWhatsThis(QApplication::translate("pqOptionsFrame", "Select a category to show the options for that category.", 0, QApplication::UnicodeUTF8)); +#endif // QT_NO_WHATSTHIS + Q_UNUSED(pqOptionsFrame); + } // retranslateUi + +}; + +namespace Ui { + class pqOptionsFrame: public Ui_pqOptionsFrame {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PQOPTIONSDIALOG_H diff --git a/src/PVGUI/wrap.cmake b/src/PVGUI/wrap.cmake index a957af52..3947abf0 100755 --- a/src/PVGUI/wrap.cmake +++ b/src/PVGUI/wrap.cmake @@ -1,9 +1,28 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + SET(WRAP_IDL_I_HH) SET(WRAP_IDL_I_CC) IF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) EXECUTE_PROCESS( - COMMAND cat ${CMAKE_BINARY_DIR}/wrapfiles.txt + COMMAND ${PYTHON_EXECUTABLE} -c "f = open('${CMAKE_BINARY_DIR}/wrapfiles.txt') ; print f.read(), ; f.close()" OUTPUT_VARIABLE WRAP_LIST_FULL ) @@ -31,16 +50,34 @@ IF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) SET(WRAP_IDL_I_HH ${WRAP_IDL_I_HH} PARAVIS_Gen_${VAL}_i.hh) SET(WRAP_IDL_I_CC ${WRAP_IDL_I_CC} PARAVIS_Gen_${VAL}_i.cc) + SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_HH) + IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_HH.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_HH_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL_HH.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) + ENDIF(WINDOWS) + ADD_CUSTOM_COMMAND( OUTPUT PARAVIS_Gen_${VAL}_i.hh - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_HH_exe ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints 0 PARAVIS_Gen_${VAL}_i.hh - DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_HH_exe ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints ${DEP_HH} + COMMAND ${vtkWrapIDL_HH_EXEFILE} ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints 0 PARAVIS_Gen_${VAL}_i.hh + DEPENDS vtkWrapIDL_HH ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints ${DEP_HH} ) + SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_CC) + IF(WINDOWS) + IF(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_CC.exe) + ELSE(CMAKE_BUILD_TOOL STREQUAL nmake) + SET(vtkWrapIDL_CC_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL_CC.exe) + ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake) + ENDIF(WINDOWS) + ADD_CUSTOM_COMMAND( OUTPUT PARAVIS_Gen_${VAL}_i.cc - COMMAND ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_CC_exe ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints 0 PARAVIS_Gen_${VAL}_i.cc - DEPENDS PARAVIS_Gen_${VAL}_i.hh ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL_CC_exe ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints ${DEP_CC} + COMMAND ${vtkWrapIDL_CC_EXEFILE} ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints 0 PARAVIS_Gen_${VAL}_i.cc + DEPENDS PARAVIS_Gen_${VAL}_i.hh vtkWrapIDL_CC ${PARAVIEW_INCLUDE_DIRS}/${VAL}.h ${CMAKE_BINARY_DIR}/idl/hints ${DEP_CC} ) ENDFOREACH(STR ${WRAP_LIST_REG}) @@ -48,7 +85,7 @@ ENDIF(EXISTS ${CMAKE_BINARY_DIR}/wrapfiles.txt) ADD_CUSTOM_COMMAND( OUTPUT PARAVIS_CreateClass.cxx - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/create_class.sh ${CMAKE_SOURCE_DIR} + COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/create_class.py ${CMAKE_BINARY_DIR} DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt ${WRAP_IDL_I_HH} ) ADD_CUSTOM_TARGET(generate_pvgui ALL DEPENDS ${CMAKE_BINARY_DIR}/wrapfiles.txt PARAVIS_CreateClass.cxx ${WRAP_IDL_I_HH} ${WRAP_IDL_I_CC}) diff --git a/src/PV_SWIG/CMakeLists.txt b/src/PV_SWIG/CMakeLists.txt index 4c710923..004fc45c 100644 --- a/src/PV_SWIG/CMakeLists.txt +++ b/src/PV_SWIG/CMakeLists.txt @@ -1,123 +1,36 @@ - - SET(VERSION_INFO 0.0.0) - SET(SOVERSION_INFO 0) - SET(SUBDIRS) - SET(AM_CPPFLAGS) - SET(AM_CXXFLAGS) - SET(LDADD) - - - SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h) - -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# 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. +# Copyright (C) 2010-2012 CEA/DEN, EDF R&D # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# This library is 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. # -# 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 +# 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. # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# 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 # -# VISU VISU_SWIG : binding of C++ implementation and Python -# File : Makefile.am -# Author : Paul RASCLE, EDF -# Module : VISU +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# include $(top_srcdir)/adm_local/unix/make_common_starter.am SET(dist_salomescript_DATA - paravis.py - paravisSM.py - pvsimple.py -) + paravis.py + paravisSM.py + pvsimple.py + presentations.py + ) - - - FOREACH(dir ${SUBDIRS}) - IF(NOT dir STREQUAL .) - ADD_SUBDIRECTORY(${dir}) - ENDIF(NOT dir STREQUAL .) - ENDFOREACH(dir ${SUBDIRS}) - FOREACH(f ${dist_salomescript_DATA}) - - SET(DEST bin/salome) - - - STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in) - IF(test_SALOMEconfig.h.in) - INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in) - ELSE(test_SALOMEconfig.h.in) - SET(dummy dummy-NOTFOUND) - MARK_AS_ADVANCED(dummy) - # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f}) - FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) - IF(dummy) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - IF(DEST STREQUAL bin/salome) - SET(PERMS) - SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE) - SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE) - SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE) - INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS}) - ELSE(DEST STREQUAL bin/salome) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(DEST STREQUAL bin/salome) - ELSE(ext STREQUAL .py) - INSTALL(FILES ${f} DESTINATION ${DEST}) - ENDIF(ext STREQUAL .py) - - - ELSE(dummy) - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .qm) - STRING(REGEX REPLACE .qm .ts input ${f}) - - - SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input}) - - - SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f}) - # ADD_CUSTOM_COMMAND( - # OUTPUT ${output} - # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output} - # MAIN_DEPENDENCY ${input} - # ) - EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}) - ENDIF(ext STREQUAL .qm) - INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST}) - ENDIF(dummy) - ENDIF(test_SALOMEconfig.h.in) - - - GET_FILENAME_COMPONENT(ext ${f} EXT) - IF(ext STREQUAL .py) - INSTALL(CODE "SET(PYTHON_FILE ${f})") - INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") - INSTALL(CODE "SET(DEST ${DEST})") - INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") - - - STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR}) - INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) - - - ENDIF(ext STREQUAL .py) - + INSTALL(FILES ${f} DESTINATION bin/salome) + + INSTALL(CODE "SET(PYTHON_FILE ${f})") + INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") + INSTALL(CODE "SET(DEST bin/salome)") + INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") + INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) + ENDFOREACH(f ${dist_salomescript_DATA}) diff --git a/src/PV_SWIG/paravis.py b/src/PV_SWIG/paravis.py index d330fc7a..7ca45646 100644 --- a/src/PV_SWIG/paravis.py +++ b/src/PV_SWIG/paravis.py @@ -1,25 +1,21 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2010-2012 CEA/DEN, EDF R&D # -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. # -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License. +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. # -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# -# VISU VISU_SWIG : binding of C++ implementation and Python # File : paravis.py # Module : PARAVIS # @@ -62,6 +58,7 @@ def Initialize(theORB, theNamingService, theLifeCycleCORBA, theStudyManager, the sleep(myDelay) myLocalParavis = myLifeCycleCORBA.FindOrLoadComponent("FactoryServer", "PARAVIS") myLocalStudy = theStudy + myLocalParavis.SetCurrentStudy(myLocalStudy) myLocalParavis.ActivateModule() return myLocalParavis diff --git a/src/PV_SWIG/paravisSM.py b/src/PV_SWIG/paravisSM.py index 9bce3efc..b2abdb78 100644 --- a/src/PV_SWIG/paravisSM.py +++ b/src/PV_SWIG/paravisSM.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + r"""servermanager is a module for using paraview server manager in Python. One can always use the server manager API directly. However, this module provides an interface easier to use from Python by wrapping several VTK @@ -10,13 +29,13 @@ proxy types. For a list, try "dir(servermanager.sources)" A simple example: from paraview.servermanager import * - # Creates a new built-in connection and makes it the active connection. + # Creates a new built-in session and makes it the active session. Connect() - # Creates a new render view on the active connection. + # Creates a new render view on the active session. renModule = CreateRenderView() - # Create a new sphere proxy on the active connection and register it + # Create a new sphere proxy on the active session and register it # in the sources group. sphere = sources.SphereSource(registrationGroup="sources", ThetaResolution=16, PhiResolution=32) @@ -42,7 +61,8 @@ def _wrap_property(proxy, smproperty): property = None if smproperty.IsA("vtkSMStringVectorProperty"): al = smproperty.GetDomain("array_list") - if al and al.IsA("vtkSMArraySelectionDomain") and smproperty.GetRepeatable(): + if al and al.IsA("vtkSMArraySelectionDomain") and \ + smproperty.GetRepeatable(): property = ArrayListProperty(proxy, smproperty) elif al and al.IsA("vtkSMArrayListDomain") and smproperty.GetNumberOfElements() == 5: property = ArraySelectionProperty(proxy, smproperty) @@ -50,7 +70,10 @@ def _wrap_property(proxy, smproperty): iter = smproperty.NewDomainIterator() isFileName = False while not iter.IsAtEnd(): - if iter.GetDomain().IsA("vtkSMFileListDomain"): + # Refer to BUG #9710 to see why optional domains need to be + # ignored. + if iter.GetDomain().IsA("vtkSMFileListDomain") and \ + iter.GetDomain().GetIsOptional() == 0 : isFileName = True break iter.Next() @@ -62,7 +85,8 @@ def _wrap_property(proxy, smproperty): else: property = VectorProperty(proxy, smproperty) elif smproperty.IsA("vtkSMVectorProperty"): - if smproperty.IsA("vtkSMIntVectorProperty") and smproperty.GetDomain("enum"): + if smproperty.IsA("vtkSMIntVectorProperty") and \ + smproperty.GetDomain("enum"): property = EnumerationProperty(proxy, smproperty) else: property = VectorProperty(proxy, smproperty) @@ -145,23 +169,30 @@ class Proxy(object): self.Port = args['port'] del args['port'] + update = True + if 'no_update' in args: + if args['no_update']: + update = False + del args['no_update'] + if 'proxy' in args: self.InitializeFromProxy(args['proxy']) del args['proxy'] else: - self.Initialize() + self.Initialize(None, update) if 'registrationGroup' in args: registrationGroup = args['registrationGroup'] del args['registrationGroup'] - registrationName = self.SMProxy.GetSelfIDAsString() + registrationName = self.SMProxy.GetGlobalIDAsString() if 'registrationName' in args: registrationName = args['registrationName'] del args['registrationName'] pxm = ProxyManager() pxm.RegisterProxy(registrationGroup, registrationName, self.SMProxy) + if update: + self.UpdateVTKObjects() for key in args.keys(): setattr(self, key, args[key]) - self.UpdateVTKObjects() # Visit all properties so that they are created for prop in self: pass @@ -196,12 +227,13 @@ class Proxy(object): if self.SMProxy and (self.SMProxy, self.Port) in _pyproxies: del _pyproxies[(self.SMProxy, self.Port)] - def InitializeFromProxy(self, aProxy): + def InitializeFromProxy(self, aProxy, update=True): """Constructor. Assigns proxy to self.SMProxy, updates the server object as well as register the proxy in _pyproxies dictionary.""" import weakref self.SMProxy = aProxy - self.SMProxy.UpdateVTKObjects() + if update: + self.SMProxy.UpdateVTKObjects() _pyproxies[(self.SMProxy, self.Port)] = weakref.ref(self) def Initialize(self): @@ -211,7 +243,12 @@ class Proxy(object): def __eq__(self, other): "Returns true if the underlying SMProxies are the same." if isinstance(other, Proxy): - ## VSV using IsSame instead + try: + if self.Port != other.Port: + return False + except: + pass + ## VSV using IsSame instead == return self.SMProxy.IsSame(other.SMProxy) return self.SMProxy.IsSame(other) @@ -318,7 +355,7 @@ class Proxy(object): """With the exception of a few overloaded methods, returns the SMProxy method""" if not self.SMProxy: - raise AttributeError("class has no attribute %s" % name) + raise AttributeError("class %s has no attribute %s" % ("None", name)) return None # Handle GetActiveCamera specially. if name == "GetActiveCamera" and \ @@ -347,13 +384,14 @@ class SourceProxy(Proxy): """This method updates the server-side VTK pipeline and the associated data information. Make sure to update a source to validate the output meta-data.""" - if time: + if time != None: self.SMProxy.UpdatePipeline(time) else: self.SMProxy.UpdatePipeline() - # Fetch the new information. This is also here to cause a receive + # This is here to cause a receive # on the client side so that progress works properly. - self.SMProxy.GetDataInformation() + if ActiveConnection and ActiveConnection.IsRemote(): + self.SMProxy.GetDataInformation() def FileNameChanged(self): "Called when the filename of a source proxy is changed." @@ -367,7 +405,7 @@ class SourceProxy(Proxy): def GetDataInformation(self, idx=None): """This method returns a DataInformation wrapper around a vtkPVDataInformation""" - if not idx: + if idx == None: idx = self.Port if self.SMProxy: return DataInformation( \ @@ -433,6 +471,49 @@ class ExodusIIReaderProxy(SourceProxy): f = getattr(self, prop) f.DeselectAll() +class ViewLayoutProxy(Proxy): + """Special class to define convenience methods for View Layout""" + + def SplitViewHorizontal(self, view, fraction=0.5): + """Split the cell containing the specified view horizontally. + If no fraction is specified, the frame is split into equal parts. + On success returns a positve number that identifying the new cell + location that can be used to assign view to, or split further. + Return -1 on failure.""" + location = self.GetViewLocation(view) + if location == -1: + raise RuntimeError, "View is not present in this layout." + if fraction < 0.0 or fraction > 1.0: + raise RuntimeError, "'fraction' must be in the range [0.0, 1.0]" + return self.SMProxy.SplitHorizontal(location, fraction) + + def SplitViewVertical(self, view=None, fraction=0.5): + """Split the cell containing the specified view horizontally. + If no view is specified, active view is used. + If no fraction is specified, the frame is split into equal parts. + On success returns a positve number that identifying the new cell + location that can be used to assign view to, or split further. + Return -1 on failure.""" + location = self.GetViewLocation(view) + if location == -1: + raise RuntimeError, "View is not present in this layout." + if fraction < 0.0 or fraction > 1.0: + raise RuntimeError, "'fraction' must be in the range [0.0, 1.0]" + return self.SMProxy.SplitVertical(location, fraction) + + def AssignView(self, location, view): + """Assign a view at a particular location. Note that the view's position may + be changed by subsequent Split() calls. Returns true on success.""" + viewproxy = None + if isinstance(view, Proxy): + view = view.SMProxy + return self.SMProxy.AssignView(location, view) + + def GetViewLocation(self, view): + if isinstance(view, Proxy): + view = view.SMProxy + return self.SMProxy.GetViewLocation(view) + class Property(object): """Generic property object that provides access to one of the properties of a server object. This class does not allow setting/getting any values but @@ -505,6 +586,9 @@ class Property(object): "Unknown attribute requests get forwarded to SMProperty." return getattr(self.SMProperty, name) + Name = property(_FindPropertyName, None, None, + "Returns the name for the property") + class GenericIterator(object): """Iterator for container type objects""" @@ -594,8 +678,6 @@ class VectorProperty(Property): a iterable object.""" if not hasattr(values, "__iter__"): values = (values,) - iup = self.SMProperty.GetImmediateUpdate() - self.SMProperty.SetImmediateUpdate(False) if not self.GetRepeatable() and len(values) != self.GetNumberOfElements(): raise RuntimeError("This property requires %d values." % self.GetNumberOfElements()) if self.GetRepeatable(): @@ -605,7 +687,6 @@ class VectorProperty(Property): for val in values: self.SMProperty.SetElement(idx, self.ConvertValue(val)) idx += 1 - self.SMProperty.SetImmediateUpdate(iup) self._UpdateProperty() def Clear(self): @@ -618,7 +699,7 @@ class ColorArrayProperty(VectorProperty): color by. It handles attribute type as well as well array name.""" def GetAvailable(self): - """"Returns the list of available arrays as (attribute type, array name + """Returns the list of available arrays as (attribute type, array name tuples.""" arrays = [] for a in self.Proxy.Input.PointData: @@ -654,10 +735,18 @@ class ColorArrayProperty(VectorProperty): break if not found: - raise ValueError("Could not locate array %s in the input." % arr) + pvoptions = vtkProcessModule.GetProcessModule().GetOptions() + # if this process is from a parallel batch run in symmetric mpi mode + # then we may not have any points or cells on some processes in which + # case we'll probably be missing the point and cell data too. the + # check below makes sure that we avoid this situation. + if pvoptions.GetProcessType() != 0x40 or pvoptions.GetSymmetricMPIMode() == False \ + or len(self.Available) != 0: + raise ValueError("Could not locate array %s in the input." % arr) catt = self.Proxy.GetProperty("ColorAttributeType") - catt.SetData(att) + if att != None: + catt.SetData(att) self.SMProperty.SetElement(0, arr) self._UpdateProperty() @@ -666,7 +755,7 @@ class ColorArrayProperty(VectorProperty): class EnumerationProperty(VectorProperty): - """"Subclass of VectorProperty that is applicable for enumeration type + """Subclass of VectorProperty that is applicable for enumeration type properties.""" def GetElement(self, index): @@ -766,6 +855,10 @@ class ArraySelectionProperty(VectorProperty): elif len(values) == 2: if isinstance(values[0], str): val = str(ASSOCIATIONS[values[0]]) + else: + # In case user didn't specify valid association, + # just pick POINTS. + val = str(ASSOCIATIONS['POINTS']) self.SMProperty.SetElement(3, str(val)) self.SMProperty.SetElement(4, values[1]) else: @@ -922,7 +1015,7 @@ class ProxyProperty(Property): if listdomain.GetClassName() != 'vtkSMProxyListDomain': raise ValueError, "Found a 'proxy_list' domain on an InputProperty that is not a ProxyListDomain." pm = ProxyManager() - group = "pq_helper_proxies." + proxy.GetSelfIDAsString() + group = "pq_helper_proxies." + proxy.GetGlobalIDAsString() if listdomain.GetNumberOfProxies() == 0: for i in xrange(listdomain.GetNumberOfProxyTypes()): igroup = listdomain.GetProxyGroup(i) @@ -1192,7 +1285,7 @@ class DataInformation(object): def GetDataSetTypeAsString(self): """Returns the dataset type as a user-friendly string. This is not the same as the enumaration used by VTK""" - return vtkDataObjectTypes.GetClassNameFromTypeId(self.GetDataSetType()) + return vtk.vtkDataObjectTypes.GetClassNameFromTypeId(self.GetDataSetType()) def __getattr__(self, name): """Forwards unknown attribute requests to the underlying @@ -1234,7 +1327,6 @@ class ArrayInformation(object): range = array.GetComponentRange(component) return (range[0], range[1]) - class FieldDataInformationIterator(object): """Iterator for FieldDataInformation""" @@ -1381,7 +1473,7 @@ def OutputPort(proxy, outputPort=0): class ProxyManager(object): """When running scripts from the python shell in the ParaView application, - registering proxies with the proxy manager is the ony mechanism to + registering proxies with the proxy manager is the only mechanism to notify the graphical user interface (GUI) that a proxy exists. Therefore, unless a proxy is registered, it will not show up in the user interface. Also, the proxy manager is the only way to get @@ -1393,7 +1485,7 @@ class ProxyManager(object): This class is a python wrapper for vtkSMProxyManager. Note that the underlying vtkSMProxyManager is a singleton. All instances of this - class wil refer to the same object. In addition to all methods provided by + class will refer to the same object. In addition to all methods provided by vtkSMProxyManager (all unknown attribute requests are forwarded to the vtkSMProxyManager), this class provides several convenience methods. @@ -1405,10 +1497,13 @@ class ProxyManager(object): of the vtkSMProxyManager C++ class. """ - def __init__(self): + def __init__(self, session=None): """Constructor. Assigned self.SMProxyManager to - vtkSMObject.GetPropertyManager().""" - self.SMProxyManager = vtkSMObject.GetProxyManager() + vtkSMProxyManager.GetProxyManager().""" + global ActiveConnection + if not session: + session = ActiveConnection.Session + self.SMProxyManager = session.GetSessionProxyManager() def RegisterProxy(self, group, name, aProxy): """Registers a proxy (either SMProxy or proxy) with the @@ -1425,7 +1520,7 @@ class ProxyManager(object): obj = servermanager.sources.SphereSource()""" if not self.SMProxyManager: return None - aProxy = self.SMProxyManager.NewProxy(group, name) + aProxy = self.SMProxyManager.NewProxy(group, name, "NULL") if not aProxy: return None aProxy.UnRegister(None) @@ -1451,28 +1546,12 @@ class ProxyManager(object): return None return aProxy - def GetProxiesOnConnection(self, connection): - """Returns a map of proxies registered with the proxy manager - on the particular connection.""" - proxy_groups = {} - iter = self.NewConnectionIterator(connection) - for proxy in iter: - if not proxy_groups.has_key(iter.GetGroup()): - proxy_groups[iter.GetGroup()] = {} - group = proxy_groups[iter.GetGroup()] - group[(iter.GetKey(), proxy.GetSelfIDAsString())] = proxy - return proxy_groups - - def GetProxiesInGroup(self, groupname, connection=None): - """Returns a map of proxies in a particular group. - If connection is not None, then only those proxies - in the group that are on the particular connection - are returned. - """ + def GetProxiesInGroup(self, groupname): + """Returns a map of proxies in a particular group.""" proxies = {} iter = self.NewGroupIterator(groupname) for aProxy in iter: - proxies[(iter.GetKey(), aProxy.GetSelfIDAsString())] = aProxy + proxies[(iter.GetKey(), aProxy.GetGlobalIDAsString())] = aProxy return proxies def UnRegisterProxy(self, groupname, proxyname, aProxy): @@ -1493,7 +1572,7 @@ class ProxyManager(object): with this name.""" if not self.SMProxyManager: return [] - collection = vtkCollection() + collection = vtk.vtkCollection() result = [] self.SMProxyManager.GetProxies(groupname, proxyname, collection) for i in range(0, collection.GetNumberOfItems()): @@ -1506,43 +1585,28 @@ class ProxyManager(object): def __iter__(self): """Returns a new ProxyIterator.""" iter = ProxyIterator() - if ActiveConnection: - iter.SetConnectionID(ActiveConnection.ID) iter.Begin() return iter - def NewGroupIterator(self, group_name, connection=None): + def NewGroupIterator(self, group_name): """Returns a ProxyIterator for a group. The resulting object can be used to traverse the proxies that are in the given group.""" iter = self.__iter__() - if not connection: - connection = ActiveConnection - if connection: - iter.SetConnectionID(connection.ID) iter.SetModeToOneGroup() iter.Begin(group_name) return iter - def NewConnectionIterator(self, connection=None): - """Returns a ProxyIterator for a given connection. This can be - used to travers ALL proxies managed by the proxy manager.""" - iter = self.__iter__() - if not connection: - connection = ActiveConnection - if connection: - iter.SetConnectionID(connection.ID) - iter.Begin() - return iter - def NewDefinitionIterator(self, groupname=None): """Returns an iterator that can be used to iterate over all groups and types of proxies that the proxy manager can create.""" - iter = ProxyDefinitionIterator() + iter = None if groupname != None: - iter.SetModeToOneGroup() - iter.Begin(groupname) + iter = ProxyDefinitionIterator(self.GetProxyDefinitionManager().NewSingleGroupIterator(groupname,0)) + else: + iter = ProxyDefinitionIterator(self.GetProxyDefinitionManager().NewIterator(0)) + return iter def __ConvertArgumentsAndCall(self, *args): @@ -1569,6 +1633,11 @@ class ProxyManager(object): pass return getattr(self.SMProxyManager, name) + def LoadState(self, filename, loader = None): + self.SMProxyManager.LoadXMLState(filename, loader) + + def SaveState(self, filename): + self.SMProxyManager.SaveXMLState(filename) class PropertyIterator(object): """Wrapper for a vtkSMPropertyIterator class to satisfy @@ -1618,16 +1687,19 @@ class PropertyIterator(object): return self.Proxy.GetProperty(self.Key) def __getattr__(self, name): - """returns attributes from the vtkSMProxyIterator.""" + """returns attributes from the vtkSMPropertyIterator.""" return getattr(self.SMIterator, name) class ProxyDefinitionIterator(object): - """Wrapper for a vtkSMProxyDefinitionIterator class to satisfy + """Wrapper for a vtkPVProxyDefinitionIterator class to satisfy the python iterator protocol. - See the doxygen documentation of the vtkSMProxyDefinitionIterator + See the doxygen documentation of the vtkPVProxyDefinitionIterator C++ class for more information.""" - def __init__(self): - self.SMIterator = vtkSMProxyDefinitionIterator() + def __init__(self, iter): + self.SMIterator = iter + if self.SMIterator: + self.SMIterator.UnRegister(None) + self.SMIterator.InitTraversal() self.Group = None self.Key = None @@ -1635,16 +1707,16 @@ class ProxyDefinitionIterator(object): return self def next(self): - if self.SMIterator.IsAtEnd(): + if self.SMIterator.IsDoneWithTraversal(): self.Group = None self.Key = None raise StopIteration - self.Group = self.SMIterator.GetGroup() - self.Key = self.SMIterator.GetKey() - self.SMIterator.Next() + self.Group = self.SMIterator.GetGroupName() + self.Key = self.SMIterator.GetProxyName() + self.SMIterator.GoToNextItem() return {"group": self.Group, "key":self.Key } - def GetKey(self): + def GetProxyName(self): """Returns the key for the proxy definition last returned by the call to 'next()' """ return self.Key @@ -1655,7 +1727,7 @@ class ProxyDefinitionIterator(object): return self.Group def __getattr__(self, name): - """returns attributes from the vtkSMProxyDefinitionIterator.""" + """returns attributes from the vtkPVProxyDefinitionIterator.""" return getattr(self.SMIterator, name) @@ -1667,6 +1739,7 @@ class ProxyIterator(object): """ def __init__(self): self.SMIterator = vtkSMProxyIterator() + self.SMIterator.SetSession(ActiveConnection.Session) self.SMIterator.Begin() self.AProxy = None self.Group = None @@ -1706,127 +1779,78 @@ class ProxyIterator(object): """returns attributes from the vtkSMProxyIterator.""" return getattr(self.SMIterator, name) +# Caution: Observers must be global methods otherwise we run into memory +# leak when the interpreter get reset from the C++ layer. +def _update_definitions(caller, event): + updateModules(ActiveConnection.Modules) + class Connection(object): """ - This is a python representation for a connection. + This is a python representation for a session/connection. """ - def __init__(self, connectionId): + def __init__(self, connectionId, session): """Default constructor. Creates a Connection with the given ID, all other data members initialized to None.""" + global MultiServerConnections + global ActiveConnection self.ID = connectionId - self.Hostname = None - self.Port = None - self.RSHostname = None - self.RSPort = None - self.Reverse = False - return + self.Session = session + self.Modules = PVModule() + self.Alive = True + self.DefinitionObserverTag = 0 + self.CustomDefinitionObserverTag = 0 + if MultiServerConnections == None and ActiveConnection: + raise RuntimeError, "Concurrent connections not supported!" + if MultiServerConnections != None and not self in MultiServerConnections: + MultiServerConnections.append(self) + ActiveConnection = self + __InitAfterConnect__(self) + __exposeActiveModules__() def __eq__(self, other): "Returns true if the connection ids are the same." - return self.ID == other.ID - - def SetHost(self, ds_host=None, ds_port=None, rs_host=None, rs_port=None, - reverse=False): - """ - Set the hostname of a given connection. Used by Connect(). - If all args are None, it's assumed to be a built-in connection i.e. - connection scheme = builtin. - """ - self.Hostname = ds_host - self.Port = ds_port - self.RSHostname = rs_host - self.RSPort = rs_port - self.Reversed = reverse - return + return (self.ID == other.ID) def __repr__(self): """User friendly string representation""" - if not self.Hostname: - return "Connection (builtin[%d]:)" % self.ID - if not self.RSHostname: - return "Connection (%s:%d)" % (self.Hostname, self.Port) - return "Connection data(%s:%d), render(%s:%d)" % \ - (self.Hostname, self.Port, self.RSHostname, self.RSPort) + return "Connection (%s) [%d]" % (self.Session.GetURI(), self.ID) def GetURI(self): """Get URI of the connection""" - if not self.Hostname or self.Hostname == "builtin": - return "builtin:" - if self.Reversed: - if not self.RSHostname: - return "csrc://%s:%d" % (self.Hostname, self.Port) - return "cdsrsrc://%s:%d//%s:%d" % (self.Hostname, self.Port, - self.RSHostname, self.RSPort) - if not self.RSHostname: - return "cs://%s:%d" % (self.Hostname, self.Port) - return "cdsrs://%s:%d//%s:%d" % (self.Hostname, self.Port, - self.RSHostname, self.RSPort) + return self.Session.GetURI() def IsRemote(self): """Returns True if the connection to a remote server, False if it is local (built-in)""" - pm = vtkProcessModule.GetProcessModule() - if pm.IsRemote(self.ID): + if self.Session.IsA("vtkSMSessionClient"): return True return False def GetNumberOfDataPartitions(self): """Returns the number of partitions on the data server for this connection""" - pm = vtkProcessModule.GetProcessModule() - return pm.GetNumberOfPartitions(self.ID) - - -## These are methods to create a new connection. -## One can connect to a server, (data-server,render-server) -## or simply create a built-in connection. -## Note: these are internal methods. Use Connect() instead. -def _connectServer(host, port, rc=False): - """Connect to a host:port. Returns the connection object if successfully - connected with the server. Internal method, use Connect() instead.""" - pm = vtkProcessModule.GetProcessModule() - if not rc: - cid = pm.ConnectToRemote(host, port) - if not cid: - return None - conn = Connection(cid) - else: - pm.AcceptConnectionsOnPort(port) - print "Waiting for connection..." - while True: - cid = pm.MonitorConnections(10) - if cid > 0: - conn = Connection(cid) - break - pm.StopAcceptingAllConnections() - conn.SetHost(host, port, None, None, rc) - return conn - -def _connectDsRs(ds_host, ds_port, rs_host, rs_port): - """Connect to a dataserver at (ds_host:ds_port) and to a render server - at (rs_host:rs_port). - Returns the connection object if successfully connected - with the server. Internal method, use Connect() instead.""" - pm = vtkProcessModule.GetProcessModule() - cid = pm.ConnectToRemote(ds_host, ds_port, rs_host, rs_port) - if not cid: - return None - conn = Connection(cid) - conn.SetHost(ds_host, ds_port, rs_host, rs_port) - return conn - -def _connectSelf(): - """Creates a new self connection.Internal method, use Connect() instead.""" - pm = vtkProcessModule.GetProcessModule() - pmOptions = pm.GetOptions() - if pmOptions.GetProcessType() == 0x40: # PVBATCH - return Connection(vtkProcessModuleConnectionManager.GetRootServerConnectionID()) - cid = pm.ConnectToSelf() - if not cid: - return None - conn = Connection(cid) - conn.SetHost("builtin", cid) - return conn + return self.Session.GetServerInformation().GetNumberOfProcesses() + + def AttachDefinitionUpdater(self): + """Attach observer to automatically update modules when needed.""" + # VTN: Observers are not supported + # ProxyDefinitionsUpdated = 2000 +## self.DefinitionObserverTag = self.Session.GetProxyDefinitionManager().AddObserver(2000, _update_definitions) + # CompoundProxyDefinitionsUpdated = 2001 +## self.CustomDefinitionObserverTag = self.Session.GetProxyDefinitionManager().AddObserver(2001, _update_definitions) + pass + + def close(self): + if self.DefinitionObserverTag: + self.Session.GetProxyDefinitionManager().RemoveObserver(self.DefinitionObserverTag) + self.Session.GetProxyDefinitionManager().RemoveObserver(self.CustomDefinitionObserverTag) + self.Session = None + self.Modules = None + self.Alive = False + + def __del__(self): + if self.Alive: + self.close() def SaveState(filename): """Given a state filename, saves the state of objects registered @@ -1841,9 +1865,8 @@ def LoadState(filename, connection=None): connection = ActiveConnection if not connection: raise RuntimeError, "Cannot load state without a connection" - loader = vtkSMPQStateLoader() pm = ProxyManager() - pm.LoadState(filename, ActiveConnection.ID, loader) + pm.LoadState(filename, None) views = GetRenderViews() for view in views: # Make sure that the client window size matches the @@ -1853,14 +1876,38 @@ def LoadState(filename, connection=None): view.GetRenderWindow().SetSize(view.ViewSize[0], \ view.ViewSize[1]) -def Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=11111): +def InitFromGUI(): + """ + Method used to initialize the Python Shell from the ParaView GUI. """ - Use this function call to create a new connection. On success, - it returns a Connection object that abstracts the connection. + global fromGUI, ActiveConnection + if not fromGUI: + print "from paraview.simple import *" + fromGUI = True + # ToggleProgressPrinting() ### FIXME COLLABORATION + enableMultiServer(vtkProcessModule.GetProcessModule().GetMultipleSessionsSupport()) + iter = vtkProcessModule.GetProcessModule().NewSessionIterator(); + iter.InitTraversal() + ActiveConnection = None + activeSession = vtkSMProxyManager.GetProxyManager().GetActiveSession() + tmpActiveConnection = None + while not iter.IsDoneWithTraversal(): + c = Connection(iter.GetCurrentSessionId(), iter.GetCurrentSession()) + if c.Session == activeSession: + tmpActiveConnection = c + iter.GoToNextItem() + iter.UnRegister(None) + if tmpActiveConnection: + ActiveConnection = tmpActiveConnection + +def Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=22221): + """ + Use this function call to create a new session. On success, + it returns a vtkSMSession object that abstracts the connection. Otherwise, it returns None. There are several ways in which this function can be called: - * When called with no arguments, it creates a new connection - to the built-in server on the client itself. + * When called with no arguments, it creates a new session + to the built-in server on the client itself. * When called with ds_host and ds_port arguments, it attempts to connect to a server(data and render server on the same server) on the indicated host:port. @@ -1868,24 +1915,25 @@ def Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=11111): creates a new connection to the data server on ds_host:ds_port and to the render server on rs_host: rs_port. """ - global ActiveConnection global fromGUI if fromGUI: - raise RuntimeError, "Cannot create a connection through python. Use the GUI to setup the connection." + raise RuntimeError, "Cannot create a session through python. Use the GUI to setup the connection." if ds_host == None: - connectionId = _connectSelf() + session = vtkSMSession() elif rs_host == None: - connectionId = _connectServer(ds_host, ds_port) + session = vtkSMSessionClient() + session.Connect("cs://%s:%d" % (ds_host, ds_port)) else: - connectionId = _connectDsRs(ds_host, ds_port, rs_host, rs_port) - if not ActiveConnection: - ActiveConnection = connectionId - return connectionId - + session = vtkSMSessionClient() + session.Connect("cdsrs://%s:%d/%s:%d" % (ds_host, ds_port, rs_host, rs_port)) + id = vtkProcessModule.GetProcessModule().RegisterSession(session) + connection = Connection(id, session) + return connection + def ReverseConnect(port=11111): """ - Use this function call to create a new connection. On success, - it returns a Connection object that abstracts the connection. + Use this function call to create a new session. On success, + it returns a Session object that abstracts the connection. Otherwise, it returns None. In reverse connection mode, the client waits for a connection from the server (client has to be started first). The server @@ -1893,55 +1941,62 @@ def ReverseConnect(port=11111): option). The optional port specified the port to listen to. """ - global ActiveConnection global fromGUI if fromGUI: raise RuntimeError, "Cannot create a connection through python. Use the GUI to setup the connection." - connectionId = _connectServer("Reverse connection", port, True) - if not ActiveConnection: - ActiveConnection = connectionId - return connectionId + session = vtkSMSessionClient() + session.Connect("csrc://hostname:" + port) + id = vtkProcessModule.GetProcessModule().RegisterSession(session) + connection = Connection(id, session) + return connection -def Disconnect(connection=None): +def Disconnect(session=None): """Disconnects the connection. Make sure to clear the proxy manager first.""" global ActiveConnection + global MultiServerConnections global fromGUI if fromGUI: raise RuntimeError, "Cannot disconnect through python. Use the GUI to disconnect." - if not connection or connection == ActiveConnection: - connection = ActiveConnection - ActiveConnection = None - if connection: - pm = vtkProcessModule.GetProcessModule() - pm.Disconnect(connection.ID) + if ActiveConnection and (not session or session == ActiveConnection.Session): + session = ActiveConnection.Session + if MultiServerConnections: + MultiServerConnections.remove(ActiveConnection) + ActiveConnection.close() + ActiveConnection = None + switchActiveConnection() + else: + ActiveConnection.close() + ActiveConnection = None + elif MultiServerConnections: + for connection in MultiServerConnections: + if connection.Session == session: + connection.close() + MultiServerConnections.remove(connection) + if session: + vtkProcessModule.GetProcessModule().UnRegisterSession(session) return -def CreateProxy(xml_group, xml_name, connection=None): - """Creates a proxy. If connection is set, the proxy's connection ID is - set accordingly. If connection is None, ActiveConnection is used, if +def CreateProxy(xml_group, xml_name, session=None): + """Creates a proxy. If session is set, the proxy's session is + set accordingly. If session is None, the current Session is used, if present. You should not have to use method normally. Instantiate the appropriate class from the appropriate module, for example: sph = servermanager.sources.SphereSource()""" - - pxm = ProxyManager() - aProxy = pxm.NewProxy(xml_group, xml_name) - if not aProxy: - return None - if not connection: - connection = ActiveConnection - if connection: - aProxy.SetConnectionID(connection.ID) - return aProxy + global ActiveConnection + if not session: + session = ActiveConnection.Session + if not session: + raise RuntimeError, "Cannot create objects without a session." + pxm = ProxyManager(session) + return pxm.NewProxy(xml_group, xml_name) def GetRenderView(connection=None): """Return the render view in use. If more than one render view is in use, return the first one.""" - if not connection: - connection = ActiveConnection render_module = None - for aProxy in ProxyManager().NewConnectionIterator(connection): + for aProxy in ProxyManager(): if aProxy.IsA("vtkSMRenderViewProxy"): render_module = aProxy break @@ -1949,45 +2004,49 @@ def GetRenderView(connection=None): def GetRenderViews(connection=None): """Returns the set of all render views.""" - - if not connection: - connection = ActiveConnection render_modules = [] - for aProxy in ProxyManager().NewConnectionIterator(connection): + for aProxy in ProxyManager(): if aProxy.IsA("vtkSMRenderViewProxy"): render_modules.append(aProxy) return render_modules -def CreateRenderView(connection=None, **extraArgs): - """Creates a render window on the particular connection. If connection - is not specified, then the active connection is used, if available. +def GetContextViews(connection=None): + """Returns the set of all context views.""" + context_modules = [] + for aProxy in ProxyManager(): + if aProxy.IsA("vtkSMContextViewProxy"): + context_modules.append(aProxy) + return context_modules + +def CreateRenderView(session=None, **extraArgs): + """Creates a render window on the particular session. If session + is not specified, then the active session is used, if available. This method can also be used to initialize properties by passing keyword arguments where the key is the name of the property. In addition registrationGroup and registrationName (optional) can be specified (as keyword arguments) to automatically register the proxy with the proxy manager.""" - return _create_view("RenderView", connection, **extraArgs) + return _create_view("RenderView", session, **extraArgs) -def _create_view(view_xml_name, connection=None, **extraArgs): - """Creates a view on the particular connection. If connection - is not specified, then the active connection is used, if available. +def _create_view(view_xml_name, session=None, **extraArgs): + """Creates a view on the particular session. If session + is not specified, then the active session is used, if available. This method can also be used to initialize properties by passing keyword arguments where the key is the name of the property.""" - if not connection: - connection = ActiveConnection - if not connection: - raise RuntimeError, "Cannot create view without connection." + if not session: + session = ActiveConnection.Session + if not session: + raise RuntimeError, "Cannot create view without session." pxm = ProxyManager() - prototype = pxm.GetPrototypeProxy("views", view_xml_name) - proxy_xml_name = prototype.GetSuggestedViewType(connection.ID) view_module = None - if proxy_xml_name: - view_module = CreateProxy("views", proxy_xml_name, connection) + if view_xml_name: + view_module = CreateProxy("views", view_xml_name, session) if not view_module: return None extraArgs['proxy'] = view_module - proxy = rendering.__dict__[view_module.GetXMLName()](**extraArgs) + python_proxy_name = _make_name_valid(view_module.GetXMLName()) + proxy = rendering.__dict__[python_proxy_name](**extraArgs) return proxy def GetRepresentation(aProxy, view): @@ -2026,7 +2085,6 @@ def CreateRepresentation(aProxy, view, **extraArgs): display.UnRegister(None) if not display: return None - display.SetConnectionID(aProxy.GetConnectionID()) extraArgs['proxy'] = display proxy = rendering.__dict__[display.GetXMLName()](**extraArgs) proxy.Input = aProxy @@ -2055,16 +2113,12 @@ class _ModuleLoader(object): return module def LoadXML(xmlstring): - """Given a server manager XML as a string, parse and process it.""" - parser = vtkSMXMLParser() - if not parser.Parse(xmlstring): - raise RuntimeError, "Problem parsing XML string." - parser.ProcessConfiguration(vtkSMObject.GetProxyManager()) - # Update the modules - updateModules() + """DEPRECATED. Given a server manager XML as a string, parse and process it.""" + raise RuntimeError, "Deprecated. Use LoadPlugin(...) instead." + def LoadPlugin(filename, remote=True, connection=None): - """ Given a filename and a connection (optional, otherwise uses + """ Given a filename and a session (optional, otherwise uses ActiveConnection), loads a plugin. It then updates the sources, filters and rendering modules.""" @@ -2072,27 +2126,19 @@ def LoadPlugin(filename, remote=True, connection=None): connection = ActiveConnection if not connection: raise RuntimeError, "Cannot load a plugin without a connection." + plm = vtkSMProxyManager.GetProxyManager().GetPluginManager() - pxm=ProxyManager() - plm=pxm.GetApplication().GetPluginManager() - - """ Load the plugin on server. """ if remote: - serverURI = connection.GetURI() + status = plm.LoadRemotePlugin(filename, connection.Session) else: - serverURI = "builtin:" - - plinfo = plm.LoadPlugin(filename, connection.ID, serverURI, remote) - - if not plinfo or not plinfo.GetLoaded(): - # Assume that it is an xml file - f = open(filename, 'r') - try: - LoadXML(f.read()) - except RuntimeError: - raise RuntimeError, "Problem loading plugin %s: %s" % (filename, pld.GetProperty("Error").GetElement(0)) + status = plm.LoadLocalPlugin(filename) + + # shouldn't the extension check happend before attempting to load the plugin? + if not status: + raise RuntimeError, "Problem loading plugin %s" % (filename) else: - updateModules() + # we should never have to call this. The modules should update automatically. + updateModules(connection.Modules) def Fetch(input, arg1=None, arg2=None, idx=0): @@ -2129,50 +2175,49 @@ def Fetch(input, arg1=None, arg2=None, idx=0): import types - #create the pipeline that reduces and transmits the data - gvd = rendering.ClientDeliveryRepresentationBase() - gvd.AddInput(0, input, idx, "DONTCARE") + reducer = filters.ReductionFilter(Input=OutputPort(input,idx)) + #create the pipeline that reduces and transmits the data if arg1 == None: - print "getting appended" - cdinfo = input.GetDataInformation(idx).GetCompositeDataInformation() if cdinfo.GetDataIsComposite(): print "use composite data append" - gvd.SetReductionType(5) + reducer.PostGatherHelperName = "vtkMultiBlockDataGroupFilter" elif input.GetDataInformation(idx).GetDataClassName() == "vtkPolyData": print "use append poly data filter" - gvd.SetReductionType(1) + reducer.PostGatherHelperName = "vtkAppendPolyData" elif input.GetDataInformation(idx).GetDataClassName() == "vtkRectilinearGrid": print "use append rectilinear grid filter" - gvd.SetReductionType(4) + reducer.PostGatherHelperName = "vtkAppendRectilinearGrid" elif input.GetDataInformation(idx).IsA("vtkDataSet"): print "use unstructured append filter" - gvd.SetReductionType(2) - + reducer.PostGatherHelperName = "vtkAppendFilter" elif type(arg1) is types.IntType: - print "getting node %d" % arg1 - gvd.SetReductionType(3) - gvd.SetPreGatherHelper(None) - gvd.SetPostGatherHelper(None) - gvd.SetPassThrough(arg1) + reducer.PassThrough = arg1 else: - print "applying operation" - gvd.SetReductionType(6) # CUSTOM - gvd.SetPreGatherHelper(arg1) - gvd.SetPostGatherHelper(arg2) - gvd.SetPassThrough(-1) - - #go! - gvd.UpdateVTKObjects() - gvd.Update() - op = gvd.GetOutput() - opc = gvd.GetOutput().NewInstance() + reducer.PreGatherHelper = arg1 + reducer.PostGatherHelper = arg2 + + # reduce + reducer.UpdatePipeline() + dataInfo = reducer.GetDataInformation(0) + dataType = dataInfo.GetDataSetType() + if dataInfo.GetCompositeDataSetType() > 0: + dataType = dataInfo.GetCompositeDataSetType() + + fetcher = filters.ClientServerMoveData(Input=reducer) + fetcher.OutputDataType = dataType + fetcher.WholeExtent = dataInfo.GetExtent()[:] + #fetch + fetcher.UpdatePipeline() + + op = fetcher.GetClientSideObject().GetOutputDataObject(0) + opc = op.NewInstance() opc.ShallowCopy(op) opc.UnRegister(None) return opc @@ -2293,14 +2338,17 @@ def _createInitialize(group, name): of Proxy""" pgroup = group pname = name - def aInitialize(self, connection=None): + def aInitialize(self, connection=None, update=True): if not connection: connection = ActiveConnection if not connection: raise RuntimeError,\ - 'Cannot create a proxy without a connection.' + 'Cannot create a proxy without a session.' + if not connection.Session.GetProxyDefinitionManager().HasDefinition(pgroup, pname): + error_msg = "The connection does not provide any definition for %s." % pname + raise RuntimeError, error_msg self.InitializeFromProxy(\ - CreateProxy(pgroup, pname, connection)) + CreateProxy(pgroup, pname, connection.Session), update) return aInitialize def _createGetProperty(pName): @@ -2379,55 +2427,52 @@ def _printProgress(caller, event): currentAlgorithm = None currentProgress = 0 -def updateModules(): +def updateModules(m): """Called when a plugin is loaded, this method updates the proxy class object in all known modules.""" - global sources, filters, writers, rendering, animation, implicit_functions,\ - piecewise_functions, extended_sources, misc - createModule("sources", sources) - createModule("filters", filters) - createModule("writers", writers) - createModule("representations", rendering) - createModule("views", rendering) - createModule("lookup_tables", rendering) - createModule("textures", rendering) - createModule("animation", animation) - createModule("misc", misc) - createModule('animation_keyframes', animation) - createModule('implicit_functions', implicit_functions) - createModule('piecewise_functions', piecewise_functions) - createModule("extended_sources", extended_sources) - createModule("incremental_point_locators", misc) - -def _createModules(): + createModule("sources", m.sources) + createModule("filters", m.filters) + createModule("writers", m.writers) + createModule("representations", m.rendering) + createModule("views", m.rendering) + createModule("lookup_tables", m.rendering) + createModule("textures", m.rendering) + createModule('cameramanipulators', m.rendering) + createModule("animation", m.animation) + createModule("misc", m.misc) + createModule('animation_keyframes', m.animation) + createModule('implicit_functions', m.implicit_functions) + createModule('piecewise_functions', m.piecewise_functions) + createModule("extended_sources", m.extended_sources) + createModule("incremental_point_locators", m.misc) + +def _createModules(m): """Called when the module is loaded, this creates sub- modules for all know proxy groups.""" - global sources, filters, writers, rendering, animation, implicit_functions,\ - piecewise_functions, extended_sources, misc - sources = createModule('sources') - filters = createModule('filters') - writers = createModule('writers') - rendering = createModule('representations') - createModule('views', rendering) - createModule("lookup_tables", rendering) - createModule("textures", rendering) - animation = createModule('animation') - createModule('animation_keyframes', animation) - implicit_functions = createModule('implicit_functions') - piecewise_functions = createModule('piecewise_functions') - extended_sources = createModule("extended_sources") - misc = createModule("misc") - createModule("incremental_point_locators", misc) + m.sources = createModule('sources') + m.filters = createModule('filters') + m.writers = createModule('writers') + m.rendering = createModule('representations') + createModule('views', m.rendering) + createModule("lookup_tables", m.rendering) + createModule("textures", m.rendering) + createModule('cameramanipulators', m.rendering) + m.animation = createModule('animation') + createModule('animation_keyframes', m.animation) + m.implicit_functions = createModule('implicit_functions') + m.piecewise_functions = createModule('piecewise_functions') + m.extended_sources = createModule("extended_sources") + m.misc = createModule("misc") + createModule("incremental_point_locators", m.misc) class PVModule(object): pass def _make_name_valid(name): - """Make a string into a valid Python variable name. Return None if - the name contains parentheses.""" - if not name or '(' in name or ')' in name: + """Make a string into a valid Python variable name.""" + if not name: return None import string valid_chars = "_%s%s" % (string.ascii_letters, string.digits) @@ -2439,8 +2484,12 @@ def _make_name_valid(name): def createModule(groupName, mdl=None): """Populates a module with proxy classes defined in the given group. If mdl is not specified, it also creates the module""" + global ActiveConnection + + if not ActiveConnection: + raise RuntimeError, "Please connect to a server using \"Connect\"" - pxm = vtkSMObject.GetProxyManager() + pxm = ProxyManager() # Use prototypes to find all proxy types. pxm.InstantiateGroupPrototypes(groupName) @@ -2448,10 +2497,13 @@ def createModule(groupName, mdl=None): if not mdl: debug = True mdl = PVModule() - numProxies = pxm.GetNumberOfXMLProxies(groupName) - for i in range(numProxies): - proxyName = pxm.GetXMLProxyName(groupName, i) + definitionIter = pxm.NewDefinitionIterator(groupName) + for i in definitionIter: + proxyName = i['key'] proto = pxm.GetPrototypeProxy(groupName, proxyName) + if not proto: + print "Error while loading %s/%s %s"%(groupName, i['group'], proxyName) + continue pname = proxyName if proto.GetXMLLabel(): pname = proto.GetXMLLabel() @@ -2468,7 +2520,8 @@ def createModule(groupName, mdl=None): # Add all properties as python properties. for prop in iter: propName = iter.GetKey() - if (prop.GetInformationOnly() and propName != "TimestepValues" ) or prop.GetIsInternal(): + if (prop.GetInformationOnly() and propName != "TimestepValues" ) \ + or prop.GetIsInternal(): continue names = [propName] names = [iter.PropertyLabel] @@ -2495,6 +2548,8 @@ def createModule(groupName, mdl=None): superclasses = (ExodusIIReaderProxy,) elif proto.IsA("vtkSMSourceProxy"): superclasses = (SourceProxy,) + elif proto.IsA("vtkSMViewLayoutProxy"): + superclasses = (ViewLayoutProxy,) else: superclasses = (Proxy,) @@ -2511,22 +2566,26 @@ def __determineGroup(proxy): xmlgroup = proxy.GetXMLGroup() xmlname = proxy.GetXMLName() if xmlgroup == "sources": + if xmlname in ["BlockSelectionSource", + "FrustumSelectionSource", + "GlobalIDSelectionSource", + "PedigreeIDSelectionSource", + "IDSelectionSource", + "CompositeDataIDSelectionSource", + "HierarchicalDataIDSelectionSource", + "ThresholdSelectionSource", + "LocationSelectionSource"]: + return "selection_sources" return "sources" elif xmlgroup == "filters": return "sources" - elif xmlgroup == "views": - return "views" elif xmlgroup == "representations": if xmlname == "ScalarBarWidgetRepresentation": return "scalar_bars" return "representations" - elif xmlgroup == "lookup_tables": - return "lookup_tables" - elif xmlgroup == "implicit_functions": - return "implicit_functions" - elif xmlgroup == "piecewise_functions": - return "piecewise_functions" - return None + elif xmlgroup == "animation_keyframes": + return "animation" + return xmlgroup __nameCounter = {} def __determineName(proxy, group): @@ -2543,7 +2602,7 @@ def __determineName(proxy, group): return "%s%d" % (name, val) def __getName(proxy, group): - pxm = ProxyManager() + pxm = ProxyManager(proxy.GetSession()) if isinstance(proxy, Proxy): proxy = proxy.SMProxy return pxm.GetProxyName(group, proxy) @@ -2552,6 +2611,10 @@ class MissingRegistrationInformation(Exception): """Exception for missing registration information. Raised when a name or group is not specified or when a group cannot be deduced.""" pass + +class MissingProxy(Exception): + """Exception fired when the requested proxy is missing.""" + pass def Register(proxy, **extraArgs): """Registers a proxy with the proxy manager. If no 'registrationGroup' is @@ -2629,7 +2692,7 @@ def demo2(fname="/Users/berk/Work/ParaViewData/Data/disk_out_ref.ex2"): # Select all arrays arraySelection.SetData(arraySelection.Available) - # Next create a default render view appropriate for the connection type. + # Next create a default render view appropriate for the session type. rv = CreateRenderView() # Create the matching representation rep = CreateRepresentation(reader, rv) @@ -2811,10 +2874,59 @@ ASSOCIATIONS = { 'POINTS' : 0, 'CELLS' : 1, 'VERTICES' : 4, 'EDGES' : 5, 'ROWS' # Connect() automatically sets this if it is not already set. ActiveConnection = None +# Fields for multi-server support +MultiServerConnections = None + +# API for multi-server support +def enableMultiServer(multiServer=True): + """This method enable the current servermanager to support several + connections. Once we enable the multi-server support, the user can create + as many connection as he want and switch from one to another in order to + create and manage proxy.""" + global MultiServerConnections, ActiveConnection + if not multiServer and MultiServerConnections: + raise RuntimeError, "Once we enable Multi-Server support we can not get back" + MultiServerConnections = [] + if ActiveConnection: + MultiServerConnections.append(ActiveConnection) + +def switchActiveConnection(newActiveConnection=None): + """Switch active connection to be the provided one or if none just pick the + other one""" + global MultiServerConnections, ActiveConnection + if MultiServerConnections == None: + raise RuntimeError, "enableMultiServer() must be called before" + + # Manage the case when no connection is provided + if newActiveConnection: + ActiveConnection = newActiveConnection + __exposeActiveModules__() + # Update active session for ParaView + if vtkSMProxyManager.GetProxyManager().GetActiveSession() != ActiveConnection.Session: + vtkSMProxyManager.GetProxyManager().SetActiveSession(ActiveConnection.Session) + return ActiveConnection + else: + for connection in MultiServerConnections: + if connection != ActiveConnection: + ActiveConnection = connection + __exposeActiveModules__() + # Update active session for ParaView + if vtkSMProxyManager.GetProxyManager().GetActiveSession() != ActiveConnection.Session: + vtkSMProxyManager.GetProxyManager().SetActiveSession(ActiveConnection.Session) + return ActiveConnection + return None + # Needs to be called when paraview module is loaded from python instead # of pvpython, pvbatch or GUI. -if not vtkSMObject.GetProxyManager(): - vtkInitializationHelper.Initialize(sys.executable) +if not vtkProcessModule.GetProcessModule(): +# pvoptions = None Not applicable for SALOME Python console +# if paraview.options.batch: +# pvoptions = vtkPVOptions(); +# pvoptions.SetProcessType(0x40) +# if paraview.options.symmetric: +# pvoptions.SetSymmetricMPIMode(True) + vtkInitializationHelper.Initialize(sys.executable, + vtkProcessModule.PROCESS_CLIENT, pvoptions) # Initialize progress printing. Can be turned off by calling # ToggleProgressPrinting() again. @@ -2827,18 +2939,65 @@ ToggleProgressPrinting() _pyproxies = {} # Create needed sub-modules -_createModules() +# We can no longer create modules, unless we have connected to a server. +# _createModules() # Set up our custom importer (if possible) loader = _ModuleLoader() sys.meta_path.append(loader) -# Definitions for working in SALOME GUI mode -aParams = myParavis.GetConnectionParameters() -ActiveConnection = Connection(aParams[0]) -ActiveConnection.SetHost(aParams[1], aParams[2], aParams[3], aParams[4], aParams[5]) -ToggleProgressPrinting() -fromGUI = True +def __InitAfterConnect__(connection): + """ + This function is called everytime after a server connection is made. + Since the ProxyManager and all proxy definitions are changed every time a + new connection is made, we re-create all the modules + """ + _createModules(connection.Modules) + ## VSV fromFilter is alwais False for SALOME because it can't be changed from ParaView code + #if not paraview.fromFilter: + # fromFilter is set when this module is imported from the programmable + # filter +# global _defUpdater +# _defUpdater = __DefinitionUpdater() + connection.AttachDefinitionUpdater() + pass -print vtkSMProxyManager.GetParaViewSourceVersion(); +def __exposeActiveModules__(): + """Update servermanager submodules to point to the current + ActiveConnection.Modules.*""" + # Expose all active module to the current servermanager module + if ActiveConnection: + for m in [mName for mName in dir(ActiveConnection.Modules) if mName[0] != '_' ]: + exec "global %s;%s = ActiveConnection.Modules.%s" % (m,m,m) +# Definitions for working in SALOME GUI mode +#aParams = myParavis.GetConnectionParameters() +#ActiveConnection = Connect() +##Connection(aParams[0]) +#ActiveConnection.SetHost(aParams[1], aParams[2], aParams[3], aParams[4], aParams[5]) +#ToggleProgressPrinting() +#fromGUI = True + +InitFromGUI() + +if hasattr(sys, "ps1"): + # session is interactive. + print vtkSMProxyManager.GetParaViewSourceVersion(); + +def GetConnectionFromId(id): + for connection in MultiServerConnections: + if connection.ID == id: + return connection + return None + +def GetConnectionFromSession(session): + for connection in MultiServerConnections: + if connection.Session == session: + return connection + return None + +def GetConnectionAt(index): + return MultiServerConnections[index] + +def GetNumberOfConnections(): + return len(MultiServerConnections) diff --git a/src/PV_SWIG/presentations.py b/src/PV_SWIG/presentations.py new file mode 100644 index 00000000..78a391f5 --- /dev/null +++ b/src/PV_SWIG/presentations.py @@ -0,0 +1,2504 @@ +# Copyright (C) 2010-2012 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. +# +# 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 module is intended to provide Python API for building presentations +typical for Post-Pro module (Scalar Map, Deformed Shape, Vectors, etc.) +""" + + +from __future__ import division +##from __future__ import print_function + +import os +import re +import warnings +from math import sqrt, sin, cos, radians +from string import upper + +try: + import pvsimple as pv + # TODO(MZN): to be removed (issue with Point Sprite texture) + #import paravisSM as sm +except: + import paraview.simple as pv + import paraview.servermanager as sm + + +# Constants +EPS = 1E-3 +FLT_MIN = 1E-37 +VTK_LARGE_FLOAT = 1E+38 +GAP_COEFFICIENT = 0.0001 + + +# Globals +_current_bar = None + + +# Enumerations +class PrsTypeEnum: + """ + Post-Pro presentation types. + """ + MESH = 0 + SCALARMAP = 1 + ISOSURFACES = 2 + CUTPLANES = 3 + CUTLINES = 4 + DEFORMEDSHAPE = 5 + DEFORMEDSHAPESCALARMAP = 6 + VECTORS = 7 + PLOT3D = 8 + STREAMLINES = 9 + GAUSSPOINTS = 10 + + _type2name = {MESH: 'Mesh', + SCALARMAP: 'Scalar Map', + ISOSURFACES: 'Iso Surfaces', + CUTPLANES: 'Cut Planes', + CUTLINES: 'Cut Lines', + DEFORMEDSHAPE: 'Deformed Shape', + DEFORMEDSHAPESCALARMAP: 'Deformed Shape And Scalar Map', + VECTORS: 'Vectors', + PLOT3D: 'Plot3D', + STREAMLINES: 'Stream Lines', + GAUSSPOINTS: 'Gauss Points'} + + @classmethod + def get_name(cls, type): + """Return presentaion name by its type.""" + return cls._type2name[type] + + +class EntityType: + """ + Entity types. + """ + NODE = 0 + CELL = 1 + + _type2name = {NODE: 'OnPoint', + CELL: 'OnCell'} + + _name2type = {'OnPoint': NODE, + 'OnCell': CELL} + + _type2pvtype = {NODE: 'POINT_DATA', + CELL: 'CELL_DATA'} + + @classmethod + def get_name(cls, type): + """Return entity name (used in full group names) by its type.""" + return cls._type2name[type] + + @classmethod + def get_type(cls, name): + """Return entity type by its name (used in full group names).""" + return cls._name2type[name] + + @classmethod + def get_pvtype(cls, type): + """Return entity type from ['CELL_DATA', 'POINT_DATA']""" + return cls._type2pvtype[type] + + +class Orientation: + """Orientation types. + + Defines a set of plane orientation possibilities: + AUTO: plane orientation should be calculated. + XY: plane formed by X and Y axis. + YZ: plane formed by Y and Z axis. + ZX: plane formed by Z and X axis + + """ + AUTO = 0 + XY = 1 + YZ = 2 + ZX = 3 + + +class GlyphPos: + """Glyph positions. + + Set of elements defining the position of the vector head: + CENTER: in the center of the vector + TAIL: in the tail of the vector + HEAD: in the head of the vector + + """ + CENTER = 0 + TAIL = 1 + HEAD = 2 + + +class GaussType: + """ + Gauss Points primitive types. + """ + SPRITE = 0 + POINT = 1 + SPHERE = 2 + + _type2mode = {SPRITE: 'Texture', + POINT: 'SimplePoint', + SPHERE: 'Sphere (Texture)'} + + @classmethod + def get_mode(cls, type): + """Return paraview point sprite mode by the primitive type.""" + return cls._type2mode[type] + + +# Auxiliary functions +def process_prs_for_test(prs, view, picture_name, show_bar=True): + """Show presentation and record snapshot image. + + Arguments: + prs: the presentation to show + view: the render view + picture_name: the full name of the graphics file to save + show_bar: to show scalar bar or not + + """ + # Show the presentation only + display_only(prs, view) + + # Show scalar bar + if show_bar and _current_bar: + _current_bar.Visibility = 1 + + # Reset the view + reset_view(view) + + # Create a directory for screenshot if necessary + file_name = re.sub("\s+", "_", picture_name) + pic_dir = os.path.dirname(picture_name) + if not os.path.exists(pic_dir): + os.makedirs(pic_dir) + + # Save picture + pv.WriteImage(file_name, view=view, Magnification=1) + + +def reset_view(view=None): + """Reset the view. + + Set predefined (taken from Post-Pro) camera settings. + If the view is not passed, the active view is used. + + """ + if not view: + view = pv.GetRenderView() + + # Camera preferences + view.CameraFocalPoint = [0.0, 0.0, 0.0] + view.CameraViewUp = [0.0, 0.0, 1.0] + view.CameraPosition = [738.946, -738.946, 738.946] + + # Turn on the headligth + view.LightSwitch = 1 + view.LightIntensity = 0.5 + + # Use parallel projection + view.CameraParallelProjection = 1 + + view.ResetCamera() + pv.Render(view=view) + + +def hide_all(view, to_remove=False): + """Hide all representations in the view.""" + if not view: + view = pv.GetRenderView() + + rep_list = view.Representations + for rep in rep_list: + if hasattr(rep, 'Visibility') and rep.Visibility != 0: + rep.Visibility = 0 + if to_remove: + view.Representations.remove(rep) + pv.Render(view=view) + + +def display_only(prs, view=None): + """Display only the given presentation in the view.""" + hide_all(view) + if (hasattr(prs, 'Visibility') and prs.Visibility != 1): + prs.Visibility = 1 + pv.Render(view=view) + + +def set_visible_lines(xy_prs, lines): + """Set visible only the given lines for XYChartRepresentation.""" + sv = xy_prs.GetProperty("SeriesVisibilityInfo").GetData() + visible = '0' + + for i in xrange(0, len(sv)): + if i % 2 == 0: + line_name = sv[i] + if line_name in lines: + visible = '1' + else: + visible = '0' + else: + sv[i] = visible + + xy_prs.SeriesVisibility = sv + + +def check_vector_mode(vector_mode, nb_components): + """Check vector mode. + + Check if vector mode is correct for the data array with the + given number of components. + + Arguments: + vector_mode: 'Magnitude', 'X', 'Y' or 'Z' + nb_components: number of component in the data array + + Raises: + ValueError: in case of the vector mode is unexistent + or nonapplicable. + + """ + if vector_mode not in ('Magnitude', 'X', 'Y', 'Z'): + raise ValueError("Unexistent vector mode: " + vector_mode) + + if ((nb_components == 1 and (vector_mode == 'Y' or vector_mode == 'Z')) or + (nb_components == 2 and vector_mode == 'Z')): + raise ValueError("Incorrect vector mode " + vector_mode + " for " + + nb_components + "-component field") + + +def get_vector_component(vector_mode): + """Get vector component as ineger. + + Translate vector component notation from string + to integer: + 'Magnitude': -1 + 'X': 0 + 'Y': 1 + 'Z': 2 + + """ + vcomponent = -1 + + if vector_mode == 'X': + vcomponent = 0 + elif vector_mode == 'Y': + vcomponent = 1 + elif vector_mode == 'Z': + vcomponent = 2 + + return vcomponent + + +def get_data_range(proxy, entity, field_name, vector_mode='Magnitude', + cut_off=False): + """Get data range for the field. + + Arguments: + proxy: the pipeline object, containig data array for the field + entity: the field entity + field_name: the field name + vector_mode: the vector mode ('Magnitude', 'X', 'Y' or 'Z') + + Returns: + Data range as [min, max] + + """ + entity_data_info = None + field_data = proxy.GetFieldDataInformation() + + if field_name in field_data.keys(): + entity_data_info = field_data + elif entity == EntityType.CELL: + entity_data_info = proxy.GetCellDataInformation() + elif entity == EntityType.NODE: + entity_data_info = proxy.GetPointDataInformation() + + data_range = [] + + if field_name in entity_data_info.keys(): + vcomp = get_vector_component(vector_mode) + data_range = entity_data_info[field_name].GetComponentRange(vcomp) + else: + pv_entity = EntityType.get_pvtype(entity) + warnings.warn("Field " + field_name + + " is unknown for " + pv_entity + "!") + + # Cut off the range + if cut_off and (data_range[0] <= data_range[1]): + data_range = list(data_range) + delta = abs(data_range[1] - data_range[0]) * GAP_COEFFICIENT + data_range[0] += delta + data_range[1] -= delta + + return data_range + + +def get_bounds(proxy): + """Get bounds of the proxy in 3D.""" + dataInfo = proxy.GetDataInformation() + bounds_info = dataInfo.GetBounds() + return bounds_info + + +def get_x_range(proxy): + """Get X range of the proxy bounds in 3D.""" + bounds_info = get_bounds(proxy) + return bounds_info[0:2] + + +def get_y_range(proxy): + """Get Y range of the proxy bounds in 3D.""" + bounds_info = get_bounds(proxy) + return bounds_info[2:4] + + +def get_z_range(proxy): + """Get Z range of the proxy bounds in 3D.""" + bounds_info = get_bounds(proxy) + return bounds_info[4:6] + + +def is_planar_input(proxy): + """Check if the given input is planar.""" + bounds_info = get_bounds(proxy) + + if (abs(bounds_info[0] - bounds_info[1]) <= FLT_MIN or + abs(bounds_info[2] - bounds_info[3]) <= FLT_MIN or + abs(bounds_info[4] - bounds_info[5]) <= FLT_MIN): + return True + + return False + + +def is_data_on_cells(proxy, field_name): + """Check the existence of a field on cells with the given name.""" + cell_data_info = proxy.GetCellDataInformation() + return (field_name in cell_data_info.keys()) + + +def is_empty(proxy): + """Check if the object contains any points or cells. + + Returns: + True: if the given proxy doesn't contain any points or cells + False: otherwise + + """ + data_info = proxy.GetDataInformation() + + nb_cells = data_info.GetNumberOfCells() + nb_points = data_info.GetNumberOfPoints() + + return not(nb_cells + nb_points) + + +def get_orientation(proxy): + """Get the optimum cutting plane orientation for Plot 3D.""" + orientation = Orientation.XY + + bounds = get_bounds(proxy) + delta = [bounds[1] - bounds[0], + bounds[3] - bounds[2], + bounds[5] - bounds[4]] + + if (delta[0] >= delta[1] and delta[0] >= delta[2]): + if (delta[1] >= delta[2]): + orientation = Orientation.XY + else: + orientation = Orientation.ZX + elif (delta[1] >= delta[0] and delta[1] >= delta[2]): + if (delta[0] >= delta[2]): + orientation = Orientation.XY + else: + orientation = Orientation.YZ + elif (delta[2] >= delta[0] and delta[2] >= delta[1]): + if (delta[0] >= delta[1]): + orientation = Orientation.ZX + else: + orientation = Orientation.YZ + + return orientation + + +def dot_product(a, b): + """Dot product of two 3-vectors.""" + dot = a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + return dot + + +def multiply3x3(a, b): + """Mutltiply one 3x3 matrix by another.""" + c = [[0, 0, 0], + [0, 0, 0], + [0, 0, 0]] + + for i in xrange(3): + c[0][i] = a[0][0] * b[0][i] + a[0][1] * b[1][i] + a[0][2] * b[2][i] + c[1][i] = a[1][0] * b[0][i] + a[1][1] * b[1][i] + a[1][2] * b[2][i] + c[2][i] = a[2][0] * b[0][i] + a[2][1] * b[1][i] + a[2][2] * b[2][i] + + return c + + +def get_rx(ang): + """Get X rotation matrix by angle.""" + rx = [[1.0, 0.0, 0.0], + [0.0, cos(ang), -sin(ang)], + [0.0, sin(ang), cos(ang)]] + + return rx + + +def get_ry(ang): + """Get Y rotation matrix by angle.""" + ry = [[cos(ang), 0.0, sin(ang)], + [0.0, 1.0, 0.0], + [-sin(ang), 0.0, cos(ang)]] + + return ry + + +def get_rz(ang): + """Get Z rotation matrix by angle.""" + rz = [[cos(ang), -sin(ang), 0.0], + [sin(ang), cos(ang), 0.0], + [0.0, 0.0, 1.0]] + + return rz + + +def get_normal_by_orientation(orientation, ang1=0, ang2=0): + """Get normal for the plane by its orientation.""" + i_plane = 0 + rotation = [[], [], []] + rx = ry = rz = [[1.0, 0.0, 0.0], + [0.0, 1.0, 0.0], + [0.0, 0.0, 1.0]] + + normal = [0.0, 0.0, 0.0] + if orientation == Orientation.XY: + if abs(ang1) > EPS: + rx = get_rx(ang1) + if abs(ang2) > EPS: + ry = get_ry(ang2) + rotation = multiply3x3(rx, ry) + i_plane = 2 + elif orientation == Orientation.ZX: + if abs(ang1) > EPS: + rz = get_rz(ang1) + if abs(ang2) > EPS: + rx = get_rx(ang2) + rotation = multiply3x3(rz, rx) + i_plane = 1 + elif orientation == Orientation.YZ: + if abs(ang1) > EPS: + ry = get_ry(ang1) + if abs(ang2) > EPS: + rz = get_rz(ang2) + rotation = multiply3x3(ry, rz) + i_plane = 0 + + for i in xrange(0, 3): + normal[i] = rotation[i][i_plane] + + return normal + + +def get_bound_project(bound_box, dir): + """Get bounds projection""" + bound_points = [[bound_box[0], bound_box[2], bound_box[4]], + [bound_box[1], bound_box[2], bound_box[4]], + [bound_box[0], bound_box[3], bound_box[4]], + [bound_box[1], bound_box[3], bound_box[4]], + [bound_box[0], bound_box[2], bound_box[5]], + [bound_box[1], bound_box[2], bound_box[5]], + [bound_box[0], bound_box[3], bound_box[5]], + [bound_box[1], bound_box[3], bound_box[5]]] + + bound_prj = [0, 0, 0] + bound_prj[0] = dot_product(dir, bound_points[0]) + bound_prj[1] = bound_prj[0] + + for i in xrange(1, 8): + tmp = dot_product(dir, bound_points[i]) + if bound_prj[1] < tmp: + bound_prj[1] = tmp + if bound_prj[0] > tmp: + bound_prj[0] = tmp + + bound_prj[2] = bound_prj[1] - bound_prj[0] + bound_prj[1] = bound_prj[0] + (1.0 - EPS) * bound_prj[2] + bound_prj[0] = bound_prj[0] + EPS * bound_prj[2] + bound_prj[2] = bound_prj[1] - bound_prj[0] + + return bound_prj + + +def get_positions(nb_planes, dir, bounds, displacement): + """Compute plane positions.""" + positions = [] + bound_prj = get_bound_project(bounds, dir) + if nb_planes > 1: + step = bound_prj[2] / (nb_planes - 1) + abs_displacement = step * displacement + start_pos = bound_prj[0] - 0.5 * step + abs_displacement + for i in xrange(nb_planes): + pos = start_pos + i * step + positions.append(pos) + else: + pos = bound_prj[0] + bound_prj[2] * displacement + positions.append(pos) + + return positions + + +def get_contours(scalar_range, nb_contours): + """Generate contour values.""" + contours = [] + for i in xrange(nb_contours): + pos = scalar_range[0] + i * ( + scalar_range[1] - scalar_range[0]) / (nb_contours - 1) + contours.append(pos) + + return contours + + +def get_nb_components(proxy, entity, field_name): + """Return number of components for the field.""" + entity_data_info = None + field_data = proxy.GetFieldDataInformation() + + if field_name in field_data.keys(): + entity_data_info = field_data + elif entity == EntityType.CELL: + entity_data_info = proxy.GetCellDataInformation() + elif entity == EntityType.NODE: + entity_data_info = proxy.GetPointDataInformation() + + nb_comp = None + if field_name in entity_data_info.keys(): + nb_comp = entity_data_info[field_name].GetNumberOfComponents() + else: + pv_entity = EntityType.get_pvtype(entity) + raise ValueError("Field " + field_name + + " is unknown for " + pv_entity + "!") + + return nb_comp + + +def get_scale_factor(proxy): + """Compute scale factor.""" + if not proxy: + return 0.0 + + proxy.UpdatePipeline() + data_info = proxy.GetDataInformation() + + nb_cells = data_info.GetNumberOfCells() + nb_points = data_info.GetNumberOfPoints() + nb_elements = nb_cells if nb_cells > 0 else nb_points + bounds = get_bounds(proxy) + + volume = 1 + vol = dim = 0 + + for i in xrange(0, 6, 2): + vol = abs(bounds[i + 1] - bounds[i]) + if vol > 0: + dim += 1 + volume *= vol + + if nb_elements == 0 or dim < 1 / VTK_LARGE_FLOAT: + return 0 + + volume /= nb_elements + + return pow(volume, 1 / dim) + + +def get_default_scale(prs_type, proxy, entity, field_name): + """Get default scale factor.""" + data_range = get_data_range(proxy, entity, field_name) + + if prs_type == PrsTypeEnum.DEFORMEDSHAPE: + EPS = 1.0 / VTK_LARGE_FLOAT + if abs(data_range[1]) > EPS: + scale_factor = get_scale_factor(proxy) + return scale_factor / data_range[1] + elif prs_type == PrsTypeEnum.PLOT3D: + bounds = get_bounds(proxy) + length = sqrt((bounds[1] - bounds[0]) ** 2 + + (bounds[3] - bounds[2]) ** 2 + + (bounds[5] - bounds[4]) ** 2) + + EPS = 0.3 + if data_range[1] > 0: + return length / data_range[1] * EPS + + return 0 + + +def get_calc_magnitude(proxy, array_entity, array_name): + """Compute magnitude for the given vector array via Calculator. + + Returns: + the calculator object. + + """ + calculator = None + + # Transform vector array to scalar array if possible + nb_components = get_nb_components(proxy, array_entity, array_name) + if (nb_components > 1): + calculator = pv.Calculator(proxy) + attribute_mode = "point_data" + if array_entity != EntityType.NODE: + attribute_mode = "cell_data" + calculator.AttributeMode = attribute_mode + if (nb_components == 2): + # Workaroud: calculator unable to compute magnitude + # if number of components equal to 2 + func = "sqrt(" + array_name + "_X^2+" + array_name + "_Y^2)" + calculator.Function = func + else: + calculator.Function = "mag(" + array_name + ")" + calculator.ResultArrayName = array_name + "_magnitude" + calculator.UpdatePipeline() + + return calculator + + +def get_add_component_calc(proxy, array_entity, array_name): + """Creates 3-component array from 2-component. + + The first two components is from the original array. The 3rd component + is zero. + If the number of components is not equal to 2 - return original array name. + + Returns: + the calculator object. + + """ + calculator = None + + nb_components = get_nb_components(proxy, array_entity, array_name) + if nb_components == 2: + calculator = pv.Calculator(proxy) + attribute_mode = "point_data" + if array_entity != EntityType.NODE: + attribute_mode = "cell_data" + calculator.AttributeMode = attribute_mode + expression = "iHat * " + array_name + "_X + jHat * " + array_name + "_Y + kHat * 0" + calculator.Function = expression + calculator.ResultArrayName = array_name + "_3c" + calculator.UpdatePipeline() + + return calculator + + +def select_all_cells(proxy): + """Select all cell types. + + Used in creation of mesh/submesh presentation. + + """ + ### Old API all_cell_types = proxy.CellTypes.Available + all_cell_types = proxy.Entity.Available + ### Old API proxy.CellTypes = all_cell_types + proxy.Entity = all_cell_types + proxy.UpdatePipeline() + + +def select_cells_with_data(proxy, on_points=None, on_cells=None): + """Select cell types with data. + + Only cell types with data for the given fields will be selected. + If no fields defined (neither on points nor on cells) only cell + types with data for even one field (from available) will be selected. + + """ + #all_cell_types = proxy.CellTypes.Available + all_cell_types = proxy.Entity.Available + all_arrays = list(proxy.CellArrays.GetData()) + all_arrays.extend(proxy.PointArrays.GetData()) + + if not all_arrays: + file_name = proxy.FileName.split(os.sep)[-1] + print "Warning: " + file_name + " doesn't contain any data array." + + # List of cell types to be selected + cell_types_on = [] + + for cell_type in all_cell_types: + #proxy.CellTypes = [cell_type] + proxy.Entity = [cell_type] + proxy.UpdatePipeline() + + cell_arrays = proxy.GetCellDataInformation().keys() + point_arrays = proxy.GetPointDataInformation().keys() + + if on_points or on_cells: + if on_points is None: + on_points = [] + if on_cells is None: + on_cells = [] + + if (all(array in cell_arrays for array in on_cells) and + all(array in point_arrays for array in on_points)): + # Add cell type to the list + cell_types_on.append(cell_type) + else: + in_arrays = lambda array: ((array in cell_arrays) or + (array in point_arrays)) + if any(in_arrays(array) for array in all_arrays): + cell_types_on.append(cell_type) + + # Select cell types + #proxy.CellTypes = cell_types_on + proxy.Entity = cell_types_on + proxy.UpdatePipeline() + + +def extract_groups_for_field(proxy, field_name, field_entity, force=False): + """Exctract only groups which have the field. + + Arguments: + proxy: the pipeline object, containig data + field_name: the field name + field_entity: the field entity + force: if True - ExtractGroup object will be created in any case + + Returns: + ExtractGroup object: if not all groups have the field or + the force argument is true + The initial proxy: if no groups had been filtered. + + """ + source = proxy + + # Remember the state + initial_groups = list(proxy.Groups) + + # Get data information for the field entity + entity_data_info = None + field_data = proxy.GetFieldDataInformation() + + if field_name in field_data.keys(): + entity_data_info = field_data + elif field_entity == EntityType.CELL: + entity_data_info = proxy.GetCellDataInformation() + elif field_entity == EntityType.NODE: + entity_data_info = proxy.GetPointDataInformation() + + # Collect groups for extraction + groups_to_extract = [] + + for group in initial_groups: + proxy.Groups = [group] + proxy.UpdatePipeline() + if field_name in entity_data_info.keys(): + groups_to_extract.append(group) + + # Restore state + proxy.Groups = initial_groups + proxy.UpdatePipeline() + + # Extract groups if necessary + if force or (len(groups_to_extract) < len(initial_groups)): + extract_group = pv.ExtractGroup(proxy) + extract_group.Groups = groups_to_extract + extract_group.UpdatePipeline() + source = extract_group + + return source + + +def if_possible(proxy, field_name, entity, prs_type): + """Check if the presentation creation is possible on the given field.""" + result = True + if (prs_type == PrsTypeEnum.DEFORMEDSHAPE or + prs_type == PrsTypeEnum.DEFORMEDSHAPESCALARMAP or + prs_type == PrsTypeEnum.VECTORS or + prs_type == PrsTypeEnum.STREAMLINES): + nb_comp = get_nb_components(proxy, entity, field_name) + result = (nb_comp > 1) + elif (prs_type == PrsTypeEnum.GAUSSPOINTS): + result = (entity == EntityType.CELL or + field_name in proxy.QuadraturePointArrays.Available) + elif (prs_type == PrsTypeEnum.MESH): + result = len(get_group_names(proxy, field_name, entity)) > 0 + + return result + + +def add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value): + """Add scalar bar with predefined properties.""" + global _current_bar + + # Construct bar title + title = "\n".join([field_name, str(time_value)]) + if nb_components > 1: + title = "\n".join([title, vector_mode]) + + # Create scalar bar + scalar_bar = pv.CreateScalarBar(Enabled=1) + scalar_bar.Orientation = 'Vertical' + scalar_bar.Title = title + scalar_bar.LookupTable = lookup_table + + # Set default properties same as in Post-Pro + scalar_bar.NumberOfLabels = 5 + scalar_bar.AutomaticLabelFormat = 0 + scalar_bar.LabelFormat = '%-#6.6g' + # Title + scalar_bar.TitleFontFamily = 'Arial' + scalar_bar.TitleFontSize = 8 + scalar_bar.TitleBold = 1 + scalar_bar.TitleItalic = 1 + scalar_bar.TitleShadow = 1 + # Labels + scalar_bar.LabelFontFamily = 'Arial' + scalar_bar.LabelFontSize = 8 + scalar_bar.LabelBold = 1 + scalar_bar.LabelItalic = 1 + scalar_bar.LabelShadow = 1 + + # Add the scalar bar to the view + pv.GetRenderView().Representations.append(scalar_bar) + + # Reassign the current bar + _current_bar = scalar_bar + + return scalar_bar + + +def get_bar(): + """Get current scalar bar.""" + global _current_bar + + return _current_bar + + +def get_lookup_table(field_name, nb_components, vector_mode='Magnitude'): + """Get lookup table for the given field.""" + lookup_table = pv.GetLookupTableForArray(field_name, nb_components) + + if vector_mode == 'Magnitude': + lookup_table.VectorMode = vector_mode + elif vector_mode == 'X': + lookup_table.VectorMode = 'Component' + lookup_table.VectorComponent = 0 + elif vector_mode == 'Y': + lookup_table.VectorMode = 'Component' + lookup_table.VectorComponent = 1 + elif vector_mode == 'Z': + lookup_table.VectorMode = 'Component' + lookup_table.VectorComponent = 2 + else: + raise ValueError("Incorrect vector mode: " + vector_mode) + + lookup_table.Discretize = 0 + lookup_table.ColorSpace = 'HSV' + lookup_table.LockScalarRange = 0 + + return lookup_table + + +def get_group_mesh_name(full_group_name): + """Return mesh name of the group by its full name.""" + aList = full_group_name.split('/') + if len(aList) >= 2 : + 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('/') + if len(aList) >= 3 : + entity_name = full_group_name.split('/')[2] + entity = EntityType.get_type(entity_name) + return entity + + +def get_group_short_name(full_group_name): + """Return short name of the group by its full name.""" + aList = full_group_name.split('/') + if len(aList) >= 4 : + short_name = full_group_name.split('/')[3] + return short_name + + +def get_mesh_names(proxy): + """Return all mesh names in the given proxy as a set.""" + groups = proxy.Groups.Available + mesh_names = set([get_group_mesh_name(item) for item in groups]) + + return mesh_names + + +def get_group_names(proxy, mesh_name, entity, wo_nogroups=False): + """Return full names of all groups of the given entity type + from the mesh with the given name as a list. + """ + groups = proxy.Groups.Available + + condition = lambda item: (get_group_mesh_name(item) == mesh_name and + get_group_entity(item) == entity) + group_names = [item for item in groups if condition(item)] + + if wo_nogroups: + # Remove "No_Group" group + not_no_group = lambda item: get_group_short_name(item) != "No_Group" + group_names = filter(not_no_group, group_names) + + return group_names + + +def get_time(proxy, timestamp_nb): + """Get time value by timestamp number.""" + # Check timestamp number + timestamps = proxy.TimestepValues.GetData() + if ((timestamp_nb - 1) not in xrange(len(timestamps))): + raise ValueError("Timestamp number is out of range: " + timestamp_nb) + + # Return time value + return timestamps[timestamp_nb - 1] + + +def create_prs(prs_type, proxy, field_entity, field_name, timestamp_nb): + """Auxiliary function. + + Build presentation of the given type on the given field and + timestamp number. + Set the presentation properties like visu.CreatePrsForResult() do. + + """ + prs = None + + if prs_type == PrsTypeEnum.SCALARMAP: + prs = ScalarMapOnField(proxy, field_entity, field_name, timestamp_nb) + elif prs_type == PrsTypeEnum.CUTPLANES: + prs = CutPlanesOnField(proxy, field_entity, field_name, timestamp_nb, + orientation=Orientation.ZX) + elif prs_type == PrsTypeEnum.CUTLINES: + prs = CutLinesOnField(proxy, field_entity, field_name, timestamp_nb, + orientation1=Orientation.XY, + orientation2=Orientation.ZX) + elif prs_type == PrsTypeEnum.DEFORMEDSHAPE: + prs = DeformedShapeOnField(proxy, field_entity, + field_name, timestamp_nb) + elif prs_type == PrsTypeEnum.DEFORMEDSHAPESCALARMAP: + prs = DeformedShapeAndScalarMapOnField(proxy, field_entity, + field_name, timestamp_nb) + elif prs_type == PrsTypeEnum.VECTORS: + prs = VectorsOnField(proxy, field_entity, field_name, timestamp_nb) + elif prs_type == PrsTypeEnum.PLOT3D: + prs = Plot3DOnField(proxy, field_entity, field_name, timestamp_nb) + elif prs_type == PrsTypeEnum.ISOSURFACES: + prs = IsoSurfacesOnField(proxy, field_entity, field_name, timestamp_nb) + elif prs_type == PrsTypeEnum.GAUSSPOINTS: + prs = GaussPointsOnField(proxy, field_entity, field_name, timestamp_nb) + elif prs_type == PrsTypeEnum.STREAMLINES: + prs = StreamLinesOnField(proxy, field_entity, field_name, timestamp_nb) + else: + raise ValueError("Unexistent presentation type.") + + return prs + + +# Functions for building Post-Pro presentations +def ScalarMapOnField(proxy, entity, field_name, timestamp_nb, + vector_mode='Magnitude'): + """Creates Scalar Map presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Scalar Map as representation object. + + """ + # We don't need mesh parts with no data on them + if entity == EntityType.NODE: + select_cells_with_data(proxy, on_points=[field_name]) + else: + select_cells_with_data(proxy, on_cells=[field_name]) + + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Extract only groups with data for the field + new_proxy = extract_groups_for_field(proxy, field_name, entity, + force=True) + + # Get Scalar Map representation object + scalarmap = pv.GetRepresentation(new_proxy) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + # Set properties + scalarmap.ColorAttributeType = EntityType.get_pvtype(entity) + scalarmap.ColorArrayName = field_name + scalarmap.LookupTable = lookup_table + + # Add scalar bar + bar_title = field_name + ", " + str(time_value) + if (nb_components > 1): + bar_title += "\n" + vector_mode + add_scalar_bar(field_name, nb_components, vector_mode, + lookup_table, time_value) + + return scalarmap + + +def CutPlanesOnField(proxy, entity, field_name, timestamp_nb, + nb_planes=10, orientation=Orientation.YZ, + angle1=0, angle2=0, + displacement=0.5, vector_mode='Magnitude'): + """Creates Cut Planes presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + nb_planes: number of cutting planes + orientation: cutting planes orientation in 3D space + angle1: rotation of the planes in 3d space around the first axis of the + selected orientation (X axis for XY, Y axis for YZ, Z axis for ZX). + The angle of rotation is set in degrees. Acceptable range: [-45, 45]. + angle2: rotation of the planes in 3d space around the second axis of the + selected orientation. Acceptable range: [-45, 45]. + displacement: the displacement of the planes into one or another side + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Cut Planes as representation object. + + """ + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Create slice filter + slice_filter = pv.Slice(proxy) + slice_filter.SliceType = "Plane" + + # Set cut planes normal + normal = get_normal_by_orientation(orientation, + radians(angle1), radians(angle2)) + slice_filter.SliceType.Normal = normal + + # Set cut planes positions + positions = get_positions(nb_planes, normal, + get_bounds(proxy), displacement) + slice_filter.SliceOffsetValues = positions + + # Get Cut Planes representation object + cut_planes = pv.GetRepresentation(slice_filter) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set properties + cut_planes.ColorAttributeType = EntityType.get_pvtype(entity) + cut_planes.ColorArrayName = field_name + cut_planes.LookupTable = lookup_table + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + return cut_planes + + +def CutLinesOnField(proxy, entity, field_name, timestamp_nb, + nb_lines=10, + orientation1=Orientation.XY, + base_angle1=0, base_angle2=0, + orientation2=Orientation.YZ, + cut_angle1=0, cut_angle2=0, + displacement1=0.5, displacement2=0.5, + generate_curves=False, + vector_mode='Magnitude'): + """Creates Cut Lines presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + nb_lines: number of lines + orientation1: base plane orientation in 3D space + base_angle1: rotation of the base plane in 3d space around the first + axis of the orientation1 (X axis for XY, Y axis for YZ, Z axis for ZX). + The angle of rotation is set in degrees. Acceptable range: [-45, 45]. + base_angle2: rotation of the base plane in 3d space around the second + axis of the orientation1. Acceptable range: [-45, 45]. + orientation2: cutting planes orientation in 3D space + cut_angle1: rotation of the cut planes in 3d space around the first + axis of the orientation2. Acceptable range: [-45, 45]. + cut_angle2: rotation of the cuting planes in 3d space around the second + axis of the orientation2. Acceptable range: [-45, 45]. + displacement1: base plane displacement + displacement2: cutting planes displacement + generate_curves: if true, 'PlotOverLine' filter will be created + for each cut line + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Cut Lines as representation object if generate_curves == False, + (Cut Lines as representation object, list of 'PlotOverLine') otherwise + + """ + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Create base plane + base_plane = pv.Slice(proxy) + base_plane.SliceType = "Plane" + + # Set base plane normal + base_normal = get_normal_by_orientation(orientation1, + radians(base_angle1), + radians(base_angle2)) + base_plane.SliceType.Normal = base_normal + + # Set base plane position + base_position = get_positions(1, base_normal, + get_bounds(proxy), displacement1) + base_plane.SliceOffsetValues = base_position + + # Check base plane + base_plane.UpdatePipeline() + if (base_plane.GetDataInformation().GetNumberOfCells() == 0): + base_plane = proxy + + # Create cutting planes + cut_planes = pv.Slice(base_plane) + cut_planes.SliceType = "Plane" + + # Set cutting planes normal and get positions + cut_normal = get_normal_by_orientation(orientation2, + radians(cut_angle1), + radians(cut_angle2)) + cut_planes.SliceType.Normal = cut_normal + + # Set cutting planes position + cut_positions = get_positions(nb_lines, cut_normal, + get_bounds(base_plane), displacement2) + + # Generate curves + curves = [] + if generate_curves: + index = 0 + for pos in cut_positions: + # Get points for plot over line objects + cut_planes.SliceOffsetValues = pos + cut_planes.UpdatePipeline() + bounds = get_bounds(cut_planes) + point1 = [bounds[0], bounds[2], bounds[4]] + point2 = [bounds[1], bounds[3], bounds[5]] + + # Create plot over line filter + pol = pv.PlotOverLine(cut_planes, + Source="High Resolution Line Source") + pv.RenameSource('Y' + str(index), pol) + pol.Source.Point1 = point1 + pol.Source.Point2 = point2 + pol.UpdatePipeline() + curves.append(pol) + + index += 1 + + cut_planes.SliceOffsetValues = cut_positions + cut_planes.UpdatePipeline() + + # Get Cut Lines representation object + cut_lines = pv.GetRepresentation(cut_planes) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set properties + cut_lines.ColorAttributeType = EntityType.get_pvtype(entity) + cut_lines.ColorArrayName = field_name + cut_lines.LookupTable = lookup_table + + # Set wireframe represenatation mode + cut_lines.Representation = 'Wireframe' + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + result = cut_lines + # If curves were generated return tuple (cut lines, list of curves) + if curves: + result = cut_lines, curves + + return result + + +def CutSegmentOnField(proxy, entity, field_name, timestamp_nb, + point1, point2, vector_mode='Magnitude'): + """Creates Cut Segment presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + point1: set the first point of the segment (as [x, y, z]) + point1: set the second point of the segment (as [x, y, z]) + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Cut Segment as 3D representation object. + + """ + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Create plot over line filter + pol = pv.PlotOverLine(proxy, Source="High Resolution Line Source") + pol.Source.Point1 = point1 + pol.Source.Point2 = point2 + pol.UpdatePipeline() + + # Get Cut Segment representation object + cut_segment = pv.GetRepresentation(pol) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set properties + cut_segment.ColorAttributeType = EntityType.get_pvtype(entity) + cut_segment.ColorArrayName = field_name + cut_segment.LookupTable = lookup_table + + # Set wireframe represenatation mode + cut_segment.Representation = 'Wireframe' + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + return cut_segment + + +def VectorsOnField(proxy, entity, field_name, timestamp_nb, + scale_factor=None, + glyph_pos=GlyphPos.TAIL, glyph_type='2D Glyph', + is_colored=False, vector_mode='Magnitude'): + """Creates Vectors presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + scale_factor: scale factor + glyph_pos: the position of glyphs + glyph_type: the type of glyphs + is_colored: this option allows to color the presentation according to + the corresponding data array values + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Vectors as representation object. + + """ + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Extract only groups with data for the field + new_proxy = extract_groups_for_field(proxy, field_name, entity) + source = new_proxy + + # Cell centers + if is_data_on_cells(proxy, field_name): + cell_centers = pv.CellCenters(source) + cell_centers.VertexCells = 1 + source = cell_centers + + vector_array = field_name + # If the given vector array has only 2 components, add the third one + if nb_components == 2: + calc = get_add_component_calc(source, EntityType.NODE, field_name) + vector_array = calc.ResultArrayName + source = calc + + # Glyph + glyph = pv.Glyph(source) + glyph.Vectors = vector_array + glyph.ScaleMode = 'vector' + glyph.MaskPoints = 0 + + # Set glyph type + glyph.GlyphType = glyph_type + if glyph_type == '2D Glyph': + glyph.GlyphType.GlyphType = 'Arrow' + elif glyph_type == 'Cone': + glyph.GlyphType.Resolution = 7 + glyph.GlyphType.Height = 2 + glyph.GlyphType.Radius = 0.2 + + # Set glyph position if possible + if glyph.GlyphType.GetProperty("Center"): + if (glyph_pos == GlyphPos.TAIL): + glyph.GlyphType.Center = [0.5, 0.0, 0.0] + elif (glyph_pos == GlyphPos.HEAD): + glyph.GlyphType.Center = [-0.5, 0.0, 0.0] + elif (glyph_pos == GlyphPos.CENTER): + glyph.GlyphType.Center = [0.0, 0.0, 0.0] + + if scale_factor is not None: + glyph.SetScaleFactor = scale_factor + else: + def_scale = get_default_scale(PrsTypeEnum.DEFORMEDSHAPE, + new_proxy, entity, field_name) + glyph.SetScaleFactor = def_scale + + glyph.UpdatePipeline() + + # Get Vectors representation object + vectors = pv.GetRepresentation(glyph) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set properties + if (is_colored): + vectors.ColorArrayName = 'GlyphVector' + else: + vectors.ColorArrayName = '' + vectors.LookupTable = lookup_table + + vectors.LineWidth = 1.0 + + # Set wireframe represenatation mode + vectors.Representation = 'Wireframe' + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + return vectors + + +def DeformedShapeOnField(proxy, entity, field_name, + timestamp_nb, + scale_factor=None, is_colored=False, + vector_mode='Magnitude'): + """Creates Defromed Shape presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + scale_factor: scale factor of the deformation + is_colored: this option allows to color the presentation according to + the corresponding data array values + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Defromed Shape as representation object. + + """ + # We don't need mesh parts with no data on them + if entity == EntityType.NODE: + select_cells_with_data(proxy, on_points=[field_name]) + else: + select_cells_with_data(proxy, on_cells=[field_name]) + + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Extract only groups with data for the field + new_proxy = extract_groups_for_field(proxy, field_name, entity) + + # Do merge + source = pv.MergeBlocks(new_proxy) + + # Cell data to point data + if is_data_on_cells(proxy, field_name): + cell_to_point = pv.CellDatatoPointData() + cell_to_point.PassCellData = 1 + source = cell_to_point + + vector_array = field_name + # If the given vector array has only 2 components, add the third one + if nb_components == 2: + calc = get_add_component_calc(source, EntityType.NODE, field_name) + vector_array = calc.ResultArrayName + source = calc + + # Warp by vector + warp_vector = pv.WarpByVector(source) + warp_vector.Vectors = [vector_array] + if scale_factor is not None: + warp_vector.ScaleFactor = scale_factor + else: + def_scale = get_default_scale(PrsTypeEnum.DEFORMEDSHAPE, + proxy, entity, field_name) + warp_vector.ScaleFactor = def_scale + + # Get Deformed Shape representation object + defshape = pv.GetRepresentation(warp_vector) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set properties + if is_colored: + defshape.ColorAttributeType = EntityType.get_pvtype(entity) + defshape.ColorArrayName = field_name + else: + defshape.ColorArrayName = '' + defshape.LookupTable = lookup_table + + # Set wireframe represenatation mode + defshape.Representation = 'Wireframe' + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + return defshape + + +def DeformedShapeAndScalarMapOnField(proxy, entity, field_name, + timestamp_nb, + scale_factor=None, + scalar_entity=None, + scalar_field_name=None, + vector_mode='Magnitude'): + """Creates Defromed Shape And Scalar Map presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + scale_factor: scale factor of the deformation + scalar_entity: scalar field entity + scalar_field_name: scalar field, i.e. the field for coloring + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Defromed Shape And Scalar Map as representation object. + + """ + # We don't need mesh parts with no data on them + on_points = [] + on_cells = [] + + if entity == EntityType.NODE: + on_points.append(field_name) + else: + on_cells.append(field_name) + + if scalar_entity and scalar_field_name: + if scalar_entity == EntityType.NODE: + on_points.append(scalar_field_name) + else: + on_cells.append(scalar_field_name) + + select_cells_with_data(proxy, on_points, on_cells) + + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Set scalar field by default + scalar_field_entity = scalar_entity + scalar_field = scalar_field_name + if (scalar_field_entity is None) or (scalar_field is None): + scalar_field_entity = entity + scalar_field = field_name + + # Extract only groups with data for the field + new_proxy = extract_groups_for_field(proxy, field_name, entity) + + # Do merge + source = pv.MergeBlocks(new_proxy) + + # Cell data to point data + if is_data_on_cells(proxy, field_name): + cell_to_point = pv.CellDatatoPointData(source) + cell_to_point.PassCellData = 1 + source = cell_to_point + + vector_array = field_name + # If the given vector array has only 2 components, add the third one + if nb_components == 2: + calc = get_add_component_calc(source, EntityType.NODE, field_name) + vector_array = calc.ResultArrayName + source = calc + + # Warp by vector + warp_vector = pv.WarpByVector(source) + warp_vector.Vectors = [vector_array] + if scale_factor is not None: + warp_vector.ScaleFactor = scale_factor + else: + def_scale = get_default_scale(PrsTypeEnum.DEFORMEDSHAPE, + new_proxy, entity, field_name) + warp_vector.ScaleFactor = def_scale + + # Get Defromed Shape And Scalar Map representation object + defshapemap = pv.GetRepresentation(warp_vector) + + # Get lookup table + lookup_table = get_lookup_table(scalar_field, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, scalar_field_entity, + scalar_field, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set properties + defshapemap.ColorArrayName = scalar_field + defshapemap.LookupTable = lookup_table + defshapemap.ColorAttributeType = EntityType.get_pvtype(scalar_field_entity) + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + return defshapemap + + +def Plot3DOnField(proxy, entity, field_name, timestamp_nb, + orientation=Orientation.AUTO, + angle1=0, angle2=0, + position=0.5, is_relative=True, + scale_factor=None, + is_contour=False, nb_contours=32, + vector_mode='Magnitude'): + """Creates Plot 3D presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + orientation: the cut plane plane orientation in 3D space, if + the input is planar - will not be taken into account + angle1: rotation of the cut plane in 3d space around the first axis + of the selected orientation (X axis for XY, Y axis for YZ, + Z axis for ZX). + The angle of rotation is set in degrees. Acceptable range: [-45, 45]. + angle2: rotation of the cut plane in 3d space around the second axis + of the selected orientation. Acceptable range: [-45, 45]. + position: position of the cut plane in the object (ranging from 0 to 1). + The value 0.5 corresponds to cutting by halves. + is_relative: defines if the cut plane position is relative or absolute + scale_factor: deformation scale factor + is_contour: if True - Plot 3D will be represented with a set of contours, + otherwise - Plot 3D will be represented with a smooth surface + nb_contours: number of contours, applied if is_contour is True + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Plot 3D as representation object. + + """ + # We don't need mesh parts with no data on them + if entity == EntityType.NODE: + select_cells_with_data(proxy, on_points=[field_name]) + else: + select_cells_with_data(proxy, on_cells=[field_name]) + + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Extract only groups with data for the field + new_proxy = extract_groups_for_field(proxy, field_name, entity) + + # Do merge + merge_blocks = pv.MergeBlocks(new_proxy) + merge_blocks.UpdatePipeline() + + poly_data = None + + # Cutting plane + + # Define orientation if necessary (auto mode) + plane_orientation = orientation + if (orientation == Orientation.AUTO): + plane_orientation = get_orientation(proxy) + + # Get cutting plane normal + normal = None + + if (not is_planar_input(proxy)): + normal = get_normal_by_orientation(plane_orientation, + radians(angle1), radians(angle2)) + + # Create slice filter + slice_filter = pv.Slice(merge_blocks) + slice_filter.SliceType = "Plane" + + # Set cutting plane normal + slice_filter.SliceType.Normal = normal + + # Set cutting plane position + if (is_relative): + base_position = get_positions(1, normal, + get_bounds(proxy), position) + slice_filter.SliceOffsetValues = base_position + else: + slice_filter.SliceOffsetValues = position + + slice_filter.UpdatePipeline() + poly_data = slice_filter + else: + normal = get_normal_by_orientation(plane_orientation, 0, 0) + + use_normal = 0 + # Geometry filter + if not poly_data or poly_data.GetDataInformation().GetNumberOfCells() == 0: + geometry_filter = pv.GeometryFilter(merge_blocks) + poly_data = geometry_filter + use_normal = 1 # TODO(MZN): workaround + + warp_scalar = None + plot3d = None + source = poly_data + + if is_data_on_cells(poly_data, field_name): + # Cell data to point data + cell_to_point = pv.CellDatatoPointData(poly_data) + cell_to_point.PassCellData = 1 + source = cell_to_point + + scalars = ['POINTS', field_name] + + # Transform vector array to scalar array if necessary + if (nb_components > 1): + calc = get_calc_magnitude(source, EntityType.NODE, field_name) + scalars = ['POINTS', calc.ResultArrayName] + source = calc + + # Warp by scalar + warp_scalar = pv.WarpByScalar(source) + warp_scalar.Scalars = scalars + warp_scalar.Normal = normal + warp_scalar.UseNormal = use_normal + if scale_factor is not None: + warp_scalar.ScaleFactor = scale_factor + else: + def_scale = get_default_scale(PrsTypeEnum.PLOT3D, + proxy, entity, field_name) + warp_scalar.ScaleFactor = def_scale + + warp_scalar.UpdatePipeline() + source = warp_scalar + + if (is_contour): + # Contours + contour = pv.Contour(warp_scalar) + contour.PointMergeMethod = "Uniform Binning" + contour.ContourBy = ['POINTS', field_name] + scalar_range = get_data_range(proxy, entity, + field_name, vector_mode) + contour.Isosurfaces = get_contours(scalar_range, nb_contours) + contour.UpdatePipeline() + source = contour + + # Get Plot 3D representation object + plot3d = pv.GetRepresentation(source) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set properties + plot3d.ColorAttributeType = EntityType.get_pvtype(entity) + plot3d.ColorArrayName = field_name + plot3d.LookupTable = lookup_table + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + return plot3d + + +def IsoSurfacesOnField(proxy, entity, field_name, timestamp_nb, + custom_range=None, nb_surfaces=10, + is_colored=True, color=None, vector_mode='Magnitude'): + """Creates Iso Surfaces presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + custom_range: scalar range, if undefined the source range will be applied + nb_surfaces: number of surfaces, which will be generated + is_colored: this option allows to color the presentation according to + the corresponding data array values. If False - the presentation will + be one-coloured. + color: defines the presentation color as [R, G, B] triple. Taken into + account only if is_colored is False. + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Iso Surfaces as representation object. + + """ + # We don't need mesh parts with no data on them + if entity == EntityType.NODE: + select_cells_with_data(proxy, on_points=[field_name]) + else: + select_cells_with_data(proxy, on_cells=[field_name]) + + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Extract only groups with data for the field + new_proxy = extract_groups_for_field(proxy, field_name, entity) + + # Do merge + source = pv.MergeBlocks(new_proxy) + + # Transform cell data into point data if necessary + if is_data_on_cells(proxy, field_name): + cell_to_point = pv.CellDatatoPointData(source) + cell_to_point.PassCellData = 1 + source = cell_to_point + + contour_by = ['POINTS', field_name] + + # Transform vector array to scalar array if necessary + if (nb_components > 1): + calc = get_calc_magnitude(source, EntityType.NODE, field_name) + contour_by = ['POINTS', calc.ResultArrayName] + source = calc + + # Contour filter settings + contour = pv.Contour(source) + contour.ComputeScalars = 1 + contour.ContourBy = contour_by + + # Specify the range + scalar_range = custom_range + 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) + + # Set contour values + contour.Isosurfaces = surfaces + + # Get Iso Surfaces representation object + isosurfaces = pv.GetRepresentation(contour) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set display properties + if (is_colored): + isosurfaces.ColorAttributeType = EntityType.get_pvtype(entity) + isosurfaces.ColorArrayName = field_name + else: + isosurfaces.ColorArrayName = '' + if color: + isosurfaces.DiffuseColor = color + isosurfaces.LookupTable = lookup_table + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + return isosurfaces + + +def GaussPointsOnField(proxy, entity, field_name, + timestamp_nb, + is_deformed=True, scale_factor=None, + is_colored=True, color=None, + primitive=GaussType.SPRITE, + is_proportional=True, + max_pixel_size=256, + multiplier=None, vector_mode='Magnitude'): + """Creates Gauss Points on the given field. + + Arguments: + + proxy: the pipeline object, containig data + entity: the field entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + is_deformed: defines whether the Gauss Points will be deformed or not + scale_factor -- the scale factor for deformation. Will be taken into + account only if is_deformed is True. + If not passed by user, default scale will be computed. + is_colored -- defines whether the Gauss Points will be multicolored, + using the corresponding data values + color: defines the presentation color as [R, G, B] triple. Taken into + account only if is_colored is False. + primitive: primitive type from GaussType + is_proportional: if True, the size of primitives will depends on + the gauss point value + max_pixel_size: the maximum sizr of the Gauss Points primitive in pixels + multiplier: coefficient between data values and the size of primitives + If not passed by user, default scale will be computed. + vector_mode: the mode of transformation of vector values into + scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude' - vector module; + 'X', 'Y', 'Z' - vector components. + + Returns: + Gauss Points as representation object. + + """ + # We don't need mesh parts with no data on them + if entity == EntityType.NODE: + select_cells_with_data(proxy, on_points=[field_name]) + else: + select_cells_with_data(proxy, on_cells=[field_name]) + + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + proxy.UpdatePipeline(time=time_value) + + # Extract only groups with data for the field + source = extract_groups_for_field(proxy, field_name, entity) + + # Quadrature point arrays + qp_arrays = proxy.QuadraturePointArrays.Available + + # If no quadrature point array is passed, use cell centers + if field_name in qp_arrays: + generate_qp = pv.GenerateQuadraturePoints(source) + generate_qp.SelectSourceArray = ['CELLS', 'ELGA_Offset'] + source = generate_qp + else: + # Cell centers + cell_centers = pv.CellCenters(source) + cell_centers.VertexCells = 1 + source = cell_centers + + source.UpdatePipeline() + + # Check if deformation enabled + if is_deformed and nb_components > 1: + vector_array = field_name + # If the given vector array has only 2 components, add the third one + if nb_components == 2: + calc = get_add_component_calc(source, + EntityType.NODE, field_name) + vector_array = calc.ResultArrayName + source = calc + + # Warp by vector + warp_vector = pv.WarpByVector(source) + warp_vector.Vectors = [vector_array] + if scale_factor is not None: + warp_vector.ScaleFactor = scale_factor + else: + def_scale = get_default_scale(PrsTypeEnum.DEFORMEDSHAPE, proxy, + entity, field_name) + warp_vector.ScaleFactor = def_scale + warp_vector.UpdatePipeline() + source = warp_vector + + # Get Gauss Points representation object + gausspnt = pv.GetRepresentation(source) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set display properties + if is_colored: + gausspnt.ColorAttributeType = EntityType.get_pvtype(entity) + gausspnt.ColorArrayName = field_name + else: + gausspnt.ColorArrayName = '' + if color: + gausspnt.DiffuseColor = color + + gausspnt.LookupTable = lookup_table + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + # Set point sprite representation + gausspnt.Representation = 'Point Sprite' + + # Point sprite settings + gausspnt.InterpolateScalarsBeforeMapping = 0 + gausspnt.MaxPixelSize = max_pixel_size + + # Render mode + gausspnt.RenderMode = GaussType.get_mode(primitive) + + #if primitive == GaussType.SPRITE: + # Set texture + # TODO(MZN): replace with pvsimple high-level interface + # texture = sm.CreateProxy("textures", "SpriteTexture") + # alphamprop = texture.GetProperty("AlphaMethod") + # alphamprop.SetElement(0, 2) # Clamp + # alphatprop = texture.GetProperty("AlphaThreshold") + # alphatprop.SetElement(0, 63) + # maxprop = texture.GetProperty("Maximum") + # maxprop.SetElement(0, 255) + # texture.UpdateVTKObjects() + + # gausspnt.Texture = texture + #gausspnt.Texture.AlphaMethod = 'Clamp' + #gausspnt.Texture.AlphaThreshold = 63 + #gausspnt.Texture.Maximum= 255 + + # Proportional radius + gausspnt.RadiusUseScalarRange = 0 + gausspnt.RadiusIsProportional = 0 + + if is_proportional: + mult = multiplier + if mult is None: + mult = abs(0.1 / data_range[1]) + + gausspnt.RadiusScalarRange = data_range + gausspnt.RadiusTransferFunctionEnabled = 1 + gausspnt.RadiusMode = 'Scalar' + gausspnt.RadiusArray = ['POINTS', field_name] + if nb_components > 1: + v_comp = get_vector_component(vector_mode) + gausspnt.RadiusVectorComponent = v_comp + gausspnt.RadiusTransferFunctionMode = 'Table' + gausspnt.RadiusScalarRange = data_range + gausspnt.RadiusUseScalarRange = 1 + gausspnt.RadiusIsProportional = 1 + gausspnt.RadiusProportionalFactor = mult + else: + gausspnt.RadiusTransferFunctionEnabled = 0 + gausspnt.RadiusMode = 'Constant' + gausspnt.RadiusArray = ['POINTS', 'Constant Radius'] + + return gausspnt + + +def StreamLinesOnField(proxy, entity, field_name, timestamp_nb, + direction='BOTH', is_colored=False, color=None, + vector_mode='Magnitude'): + """Creates Stream Lines presentation on the given field. + + Arguments: + proxy: the pipeline object, containig data + entity: the entity type from PrsTypeEnum + field_name: the field name + timestamp_nb: the number of time step (1, 2, ...) + direction: the stream lines direction ('FORWARD', 'BACKWARD' or 'BOTH') + is_colored: this option allows to color the presentation according to + the corresponding data values. If False - the presentation will + be one-coloured. + color: defines the presentation color as [R, G, B] triple. Taken into + account only if is_colored is False. + vector_mode: the mode of transformation of vector values + into scalar values, applicable only if the field contains vector values. + Possible modes: 'Magnitude', 'X', 'Y' or 'Z'. + + Returns: + Stream Lines as representation object. + + """ + # We don't need mesh parts with no data on them + if entity == EntityType.NODE: + select_cells_with_data(proxy, on_points=[field_name]) + else: + select_cells_with_data(proxy, on_cells=[field_name]) + + # Check vector mode + nb_components = get_nb_components(proxy, entity, field_name) + check_vector_mode(vector_mode, nb_components) + + # Get time value + time_value = get_time(proxy, timestamp_nb) + + # Set timestamp + pv.GetRenderView().ViewTime = time_value + pv.UpdatePipeline(time_value, proxy) + + # Extract only groups with data for the field + new_proxy = extract_groups_for_field(proxy, field_name, entity) + + # Do merge + source = pv.MergeBlocks(new_proxy) + + # Cell data to point data + if is_data_on_cells(proxy, field_name): + cell_to_point = pv.CellDatatoPointData(source) + cell_to_point.PassCellData = 1 + cell_to_point.UpdatePipeline() + source = cell_to_point + + vector_array = field_name + # If the given vector array has only 2 components, add the third one + if nb_components == 2: + calc = get_add_component_calc(source, EntityType.NODE, field_name) + vector_array = calc.ResultArrayName + calc.UpdatePipeline() + source = calc + + # Stream Tracer + stream = pv.StreamTracer(source) + stream.SeedType = "Point Source" + stream.Vectors = ['POINTS', vector_array] + stream.SeedType = "Point Source" + stream.IntegrationDirection = direction + stream.IntegratorType = 'Runge-Kutta 2' + stream.UpdatePipeline() + + # Get Stream Lines representation object + if is_empty(stream): + return None + streamlines = pv.GetRepresentation(stream) + + # Get lookup table + lookup_table = get_lookup_table(field_name, nb_components, vector_mode) + + # Set field range if necessary + data_range = get_data_range(new_proxy, entity, + field_name, vector_mode) + lookup_table.LockScalarRange = 1 + lookup_table.RGBPoints = [data_range[0], 0, 0, 1, data_range[1], 1, 0, 0] + + # Set properties + if is_colored: + streamlines.ColorAttributeType = EntityType.get_pvtype(entity) + streamlines.ColorArrayName = field_name + else: + streamlines.ColorArrayName = '' + if color: + streamlines.DiffuseColor = color + + streamlines.LookupTable = lookup_table + + # Add scalar bar + add_scalar_bar(field_name, nb_components, + vector_mode, lookup_table, time_value) + + return streamlines + + +def MeshOnEntity(proxy, mesh_name, entity): + """Creates submesh of the entity type for the mesh. + + Arguments: + proxy -- the pipeline object, containig data + mesh_name -- the mesh name + entity -- the entity type + + Returns: + Submesh as representation object of the given source. + + """ + # Select all cell types + select_all_cells(proxy) + + # Get subset of groups on the given entity + subset = get_group_names(proxy, mesh_name, entity) + + # Select only groups of the given entity type + proxy.Groups = subset + proxy.UpdatePipeline() + + # Get representation object if the submesh is not empty + prs = None + if (proxy.GetDataInformation().GetNumberOfPoints() or + proxy.GetDataInformation().GetNumberOfCells()): + prs = pv.GetRepresentation(proxy) + prs.ColorArrayName = '' + + return prs + + +def MeshOnGroup(proxy, group_name): + """Creates submesh on the group. + + Arguments: + proxy -- the pipeline object, containig data + group_name -- the full group name + + Returns: + Representation object of the given source with single group + selected. + + """ + # Select all cell types + select_all_cells(proxy) + + # Select only the group with the given name + one_group = [group_name] + proxy.Groups = one_group + proxy.UpdatePipeline() + + # Get representation object if the submesh is not empty + prs = None + + # Check if the group was set + if proxy.Groups.GetData() == one_group: + group_entity = get_group_entity(group_name) + # Check if the submesh is not empty + nb_items = 0 + if group_entity == EntityType.NODE: + nb_items = proxy.GetDataInformation().GetNumberOfPoints() + elif group_entity == EntityType.CELL: + nb_items = proxy.GetDataInformation().GetNumberOfCells() + + if nb_items: + prs = pv.GetRepresentation(proxy) + prs.ColorArrayName = '' + + return prs + + +def CreatePrsForFile(paravis_instance, file_name, prs_types, + picture_dir, picture_ext): + """Build presentations of the given types for the file. + + Build presentations for all fields on all timestamps. + + Arguments: + paravis_instance: ParaVis module instance object + file_name: full path to the MED file + prs_types: the list of presentation types to build + picture_dir: the directory path for saving snapshots + picture_ext: graphics files extension (determines file type) + + """ + # Import MED file + print "Import " + file_name.split(os.sep)[-1] + "..." + + try: + paravis_instance.ImportFile(file_name) + proxy = pv.GetActiveSource() + if proxy is None: + print "FAILED" + else: + proxy.UpdatePipeline() + print "OK" + except: + print "FAILED" + else: + # Get view + view = pv.GetRenderView() + + # Create required presentations for the proxy + CreatePrsForProxy(proxy, view, prs_types, + picture_dir, picture_ext) + + +def CreatePrsForProxy(proxy, view, prs_types, picture_dir, picture_ext): + """Build presentations of the given types for all fields of the proxy. + + Save snapshots in graphics files (type depends on the given extension). + Stores the files in the given directory. + + Arguments: + proxy: the pipeline object, containig data + view: the render view + prs_types: the list of presentation types to build + picture_dir: the directory path for saving snapshots + picture_ext: graphics files extension (determines file type) + + """ + # List of the field names + field_names = list(proxy.PointArrays.GetData()) + nb_on_nodes = len(field_names) + field_names.extend(proxy.CellArrays.GetData()) + + # Add path separator to the end of picture path if necessery + if not picture_dir.endswith(os.sep): + picture_dir += os.sep + + # Mesh Presentation + if PrsTypeEnum.MESH in prs_types: + # Create Mesh presentation. Build all possible submeshes. + + # Remember the current state + groups = list(proxy.Groups) + + # Iterate on meshes + mesh_names = get_mesh_names(proxy) + for mesh_name in mesh_names: + # Build mesh on nodes and cells + for entity in (EntityType.NODE, EntityType.CELL): + entity_name = EntityType.get_name(entity) + if if_possible(proxy, mesh_name, entity, PrsTypeEnum.MESH): + print "Creating submesh on " + entity_name + " for '" + mesh_name + "' mesh... " + prs = MeshOnEntity(proxy, mesh_name, entity) + if prs is None: + print "FAILED" + continue + else: + print "OK" + # Construct image file name + pic_name = picture_dir + mesh_name + "_" + entity_name + "." + picture_ext + + # Show and dump the presentation into a graphics file + process_prs_for_test(prs, view, pic_name, False) + + # Build submesh on all groups of the mesh + mesh_groups = get_group_names(proxy, mesh_name, + entity, wo_nogroups=True) + for group in mesh_groups: + print "Creating submesh on group " + group + "... " + prs = MeshOnGroup(proxy, group) + if prs is None: + print "FAILED" + continue + else: + print "OK" + # Construct image file name + pic_name = picture_dir + group.replace('/', '_') + "." + picture_ext + + # Show and dump the presentation into a graphics file + process_prs_for_test(prs, view, pic_name, False) + + # Restore the state + proxy.Groups = groups + proxy.UpdatePipeline() + + # Presentations on fields + for (i, field_name) in enumerate(field_names): + # Select only the current field: + # necessary for getting the right timestamps + cell_arrays = proxy.CellArrays.GetData() + point_arrays = proxy.PointArrays.GetData() + field_entity = None + if (i >= nb_on_nodes): + field_entity = EntityType.CELL + proxy.PointArrays.DeselectAll() + proxy.CellArrays = [field_name] + else: + field_entity = EntityType.NODE + proxy.CellArrays.DeselectAll() + proxy.PointArrays = [field_name] + + # Get timestamps + proxy.UpdatePipelineInformation() + timestamps = proxy.TimestepValues.GetData() + + # Restore fields selection state + proxy.CellArrays = cell_arrays + proxy.PointArrays = point_arrays + proxy.UpdatePipelineInformation() + + for prs_type in prs_types: + # Ignore mesh presentation + if prs_type == PrsTypeEnum.MESH: + continue + + # Get name of presentation type + prs_name = PrsTypeEnum.get_name(prs_type) + + # Build the presentation if possible + possible = if_possible(proxy, field_name, + field_entity, prs_type) + if possible: + # Presentation type for graphics file name + f_prs_type = prs_name.replace(' ', '').upper() + + for timestamp_nb in xrange(1, len(timestamps) + 1): + time = timestamps[timestamp_nb - 1] + print "Creating " + prs_name + " on " + field_name + ", time = " + str(time) + "... " + prs = create_prs(prs_type, proxy, + field_entity, field_name, timestamp_nb) + if prs is None: + print "FAILED" + continue + else: + print "OK" + + # Construct image file name + pic_name = picture_dir + field_name + "_" + str(time) + "_" + f_prs_type + "." + picture_ext + + # Show and dump the presentation into a graphics file + process_prs_for_test(prs, view, pic_name) diff --git a/src/PV_SWIG/pvsimple.py b/src/PV_SWIG/pvsimple.py index 9a48623c..2a5d96a0 100644 --- a/src/PV_SWIG/pvsimple.py +++ b/src/PV_SWIG/pvsimple.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + r"""simple is a module for using paraview server manager in Python. It provides a simple convenience layer to functionality provided by the C++ classes wrapped to Python as well as the servermanager module. @@ -24,12 +43,13 @@ import paravisSM servermanager = paravisSM def _disconnect(): - servermanager.ProxyManager().UnRegisterProxies() - active_objects.view = None - active_objects.source = None - import gc - gc.collect() - servermanager.Disconnect() + if servermanager.ActiveConnection: + servermanager.ProxyManager().UnRegisterProxies() + active_objects.view = None + active_objects.source = None + import gc + gc.collect() + servermanager.Disconnect() def Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=11111): """Creates a connection to a server. Example usage: @@ -37,17 +57,26 @@ def Connect(ds_host=None, ds_port=11111, rs_host=None, rs_port=11111): > Connect("amber", 12345) # Connect to a single server at port 12345 > Connect("amber", 11111, "vis_cluster", 11111) # connect to data server, render server pair""" _disconnect() - cid = servermanager.Connect(ds_host, ds_port, rs_host, rs_port) - servermanager.ProxyManager().RegisterProxy("timekeeper", "tk", servermanager.misc.TimeKeeper()) - return cid + session = servermanager.Connect(ds_host, ds_port, rs_host, rs_port) + _add_functions(globals()) + + tk = servermanager.misc.TimeKeeper() + servermanager.ProxyManager().RegisterProxy("timekeeper", "tk", tk) + scene = AnimationScene() + scene.TimeKeeper = tk + return session def ReverseConnect(port=11111): """Create a reverse connection to a server. Listens on port and waits for an incoming connection from the server.""" _disconnect() - cid = servermanager.ReverseConnect(port) - servermanager.ProxyManager().RegisterProxy("timekeeper", "tk", servermanager.misc.TimeKeeper()) - return cid + session = servermanager.ReverseConnect(port) + _add_functions(globals()) + tk = servermanager.misc.TimeKeeper() + servermanager.ProxyManager().RegisterProxy("timekeeper", "tk", tk) + scene = AnimationScene() + scene.TimeKeeper = tk + return session def _create_view(view_xml_name): "Creates and returns a 3D render view." @@ -61,30 +90,97 @@ def _create_view(view_xml_name): views = tk.Views if not view in views: views.append(view) - + try: + scene = GetAnimationScene() + if not view in scene.ViewModules: + scene.ViewModules.append(view) + except servermanager.MissingProxy: + pass return view def CreateRenderView(): return _create_view("RenderView") def CreateXYPlotView(): - return _create_view("XYPlotView") + return _create_view("XYChartView") def CreateBarChartView(): - return _create_view("BarChart") + return _create_view("XYBarChartView") + +def CreateComparativeRenderView(): + return _create_view("ComparativeRenderView") + +def CreateComparativeXYPlotView(): + return _create_view("ComparativeXYPlotView") + +def CreateComparativeBarChartView(): + return _create_view("ComparativeBarChartView") + +def CreateParallelCoordinatesChartView(): + return _create_view("ParallelCoordinatesChartView") + +def Create2DRenderView(): + return _create_view("2DRenderView") + +def OpenDataFile(filename, **extraArgs): + """Creates a reader to read the give file, if possible. + This uses extension matching to determine the best reader possible. + If a reader cannot be identified, then this returns None.""" + reader_factor = servermanager.ProxyManager().GetReaderFactory() + if reader_factor.GetNumberOfRegisteredPrototypes() == 0: + reader_factor.RegisterPrototypes("sources") + session = servermanager.ActiveConnection.Session + first_file = filename + if type(filename) == list: + first_file = filename[0] + if not reader_factor.TestFileReadability(first_file, session): + raise RuntimeError, "File not readable: %s " % first_file + if not reader_factor.CanReadFile(first_file, session): + raise RuntimeError, "File not readable. No reader found for '%s' " % first_file + prototype = servermanager.ProxyManager().GetPrototypeProxy( + reader_factor.GetReaderGroup(), reader_factor.GetReaderName()) + xml_name = paraview.make_name_valid(prototype.GetXMLLabel()) + reader_func = _create_func(xml_name, servermanager.sources) + if prototype.GetProperty("FileNames"): + reader = reader_func(FileNames=filename, **extraArgs) + else : + reader = reader_func(FileName=filename, **extraArgs) + return reader + +def CreateWriter(filename, proxy=None, **extraArgs): + """Creates a writer that can write the data produced by the source proxy in + the given file format (identified by the extension). If no source is + provided, then the active source is used. This doesn't actually write the + data, it simply creates the writer and returns it.""" + if not filename: + raise RuntimeError, "filename must be specified" + writer_factory = servermanager.ProxyManager().GetWriterFactory() + if writer_factory.GetNumberOfRegisteredPrototypes() == 0: + writer_factory.RegisterPrototypes("writers") + if not proxy: + proxy = GetActiveSource() + if not proxy: + raise RuntimeError, "Could not locate source to write" + writer_proxy = writer_factory.CreateWriter(filename, proxy.SMProxy, proxy.Port) + return servermanager._getPyProxy(writer_proxy) def GetRenderView(): - "Returns the active view if there is one. Else creates and returns a new view." + """Returns the active view if there is one. Else creates and returns a new view.""" view = active_objects.view - if not view: view = CreateRenderView() + if not view: + # it's possible that there's no active view, but a render view exists. + # If so, locate that and return it (before trying to create a new one). + view = servermanager.GetRenderView() + if not view: + view = CreateRenderView() return view def GetRenderViews(): - "Returns all render views as a list." + """Returns all render views as a list.""" return servermanager.GetRenderViews() def GetRepresentation(proxy=None, view=None): - """"Given a pipeline object and view, returns the corresponding representation object. + """Given a pipeline object and view, returns the corresponding representation object. If pipeline object and view are not specified, active objects are used.""" if not view: view = active_objects.view @@ -99,7 +195,7 @@ def GetRepresentation(proxy=None, view=None): return rep def GetDisplayProperties(proxy=None, view=None): - """"Given a pipeline object and view, returns the corresponding representation object. + """Given a pipeline object and view, returns the corresponding representation object. If pipeline object and/or view are not specified, active objects are used.""" return GetRepresentation(proxy, view) @@ -146,9 +242,18 @@ def ResetCamera(view=None): used.""" if not view: view = active_objects.view - view.ResetCamera() + if hasattr(view, "ResetCamera"): + view.ResetCamera() + if hasattr(view, "ResetDisplay"): + view.ResetDisplay() Render(view) +def _DisableFirstRenderCameraReset(): + """Disable the first render camera reset. Normally a ResetCamera is called + automatically when Render is called for the first time after importing + this module.""" + _funcs_internals.first_render = False + def SetProperties(proxy=None, **params): """Sets one or more properties of the given pipeline object. If an argument is not provided, the active source is used. Pass a list of property_name=value @@ -162,6 +267,40 @@ def SetProperties(proxy=None, **params): raise AttributeError("object has no property %s" % param) setattr(proxy, param, params[param]) +def GetProperty(*arguments, **keywords): + """Get one property of the given pipeline object. If keywords are used, + you can set the proxy and the name of the property that you want to get + like in the following example : + GetProperty({proxy=sphere, name="Radius"}) + If it's arguments that are used, then you have two case: + - if only one argument is used that argument will be + the property name. + - if two arguments are used then the first one will be + the proxy and the second one the property name. + Several example are given below: + GetProperty({name="Radius"}) + GetProperty({proxy=sphereProxy, name="Radius"}) + GetProperty( sphereProxy, "Radius" ) + GetProperty( "Radius" ) + """ + name = None + proxy = None + for key in keywords: + if key == "name": + name = keywords[key] + if key == "proxy": + proxy = keywords[key] + if len(arguments) == 1 : + name = arguments[0] + if len(arguments) == 2 : + proxy = arguments[0] + name = arguments[1] + if not name: + raise RuntimeError, "Expecting at least a property name as input. Otherwise keyword could be used to set 'proxy' and property 'name'" + if not proxy: + proxy = active_objects.source + return proxy.GetProperty(name) + def SetDisplayProperties(proxy=None, view=None, **params): """Sets one or more display properties of the given pipeline object. If an argument is not provided, the active source is used. Pass a list of property_name=value @@ -226,7 +365,7 @@ def Delete(proxy=None): if listdomain: if listdomain.GetClassName() != 'vtkSMProxyListDomain': continue - group = "pq_helper_proxies." + proxy.GetSelfIDAsString() + group = "pq_helper_proxies." + proxy.GetGlobalIDAsString() for i in xrange(listdomain.GetNumberOfProxies()): pm = servermanager.ProxyManager() iproxy = listdomain.GetProxy(i) @@ -251,7 +390,8 @@ def Delete(proxy=None): servermanager.UnRegister(proxy) # If this is a representation, remove it from all views. - if proxy.SMProxy.IsA("vtkSMRepresentationProxy"): + if proxy.SMProxy.IsA("vtkSMRepresentationProxy") or \ + proxy.SMProxy.IsA("vtkSMNewWidgetRepresentationProxy"): for view in GetRenderViews(): view.Representations.remove(proxy) # If this is a source, remove the representation iff it has no consumers @@ -301,6 +441,24 @@ def CreatePiecewiseFunction(**params): SetProperties(pfunc, **params) return pfunc +def GetLookupTableForArray(arrayname, num_components, **params): + """Used to get an existing lookuptable for a array or to create one if none + exists. Keyword arguments can be passed in to initialize the LUT if a new + one is created.""" + proxyName = "%d.%s.PVLookupTable" % (int(num_components), arrayname) + lut = servermanager.ProxyManager().GetProxy("lookup_tables", proxyName) + if lut: + return lut + # No LUT exists for this array, create a new one. + # TODO: Change this to go a LookupTableManager that is shared with the GUI, + # so that the GUI and python end up create same type of LUTs. For now, + # python will create a Blue-Red LUT, unless overridden by params. + lut = servermanager.rendering.PVLookupTable( + ColorSpace="HSV", RGBPoints=[0, 0, 0, 1, 1, 1, 0, 0]) + SetProperties(lut, **params) + servermanager.Register(lut, registrationName=proxyName) + return lut + def CreateScalarBar(**params): """Create and return a scalar bar widget. The returned widget may be added to a render view by appending it to the view's representations @@ -332,7 +490,7 @@ def MakeBlueToRedLT(min, max): return CreateLookupTable(RGBPoints=rgbPoints, ColorSpace="HSV") def _find_writer(filename): - "Internal function." + """Internal function.""" extension = None parts = filename.split('.') if len(parts) > 1: @@ -408,7 +566,7 @@ def AnimateReader(reader=None, view=None, filename=None): def _create_func(key, module): - "Internal function." + """Internal function.""" def CreateObject(*input, **params): """This function creates a new proxy. For pipeline objects that accept inputs, @@ -475,7 +633,7 @@ def _create_func(key, module): return CreateObject def _create_doc(new, old): - "Internal function." + """Internal function.""" import string res = "" for doc in (new, old): @@ -488,7 +646,7 @@ def _create_doc(new, old): return res def _func_name_valid(name): - "Internal function." + """Internal function.""" valid = True for c in name: if c == '(' or c ==')': @@ -497,7 +655,8 @@ def _func_name_valid(name): return valid def _add_functions(g): - for m in [servermanager.filters, servermanager.sources, servermanager.writers]: + for m in [servermanager.filters, servermanager.sources, + servermanager.writers, servermanager.animation]: dt = m.__dict__ for key in dt.keys(): cl = dt[key] @@ -507,19 +666,19 @@ def _add_functions(g): exec "g[key].__doc__ = _create_doc(m.%s.__doc__, g[key].__doc__)" % key def GetActiveView(): - "Returns the active view." + """Returns the active view.""" return active_objects.view def SetActiveView(view): - "Sets the active view." + """Sets the active view.""" active_objects.view = view def GetActiveSource(): - "Returns the active source." + """Returns the active source.""" return active_objects.source def SetActiveSource(source): - "Sets the active source." + """Sets the active source.""" active_objects.source = source def GetActiveCamera(): @@ -527,6 +686,166 @@ def GetActiveCamera(): is an instance of vtkCamera.""" return GetActiveView().GetActiveCamera() +def GetAnimationScene(): + """Returns the application-wide animation scene. ParaView has only one + global animation scene. This method provides access to that. Users are + free to create additional animation scenes directly, but those scenes + won't be shown in the ParaView GUI.""" + animation_proxies = servermanager.ProxyManager().GetProxiesInGroup("animation") + scene = None + for aProxy in animation_proxies.values(): + if aProxy.GetXMLName() == "AnimationScene": + scene = aProxy + break + if not scene: + raise servermanager.MissingProxy, "Could not locate global AnimationScene." + return scene + +def WriteAnimation(filename, **params): + """Writes the current animation as a file. Optionally one can specify + arguments that qualify the saved animation files as keyword arguments. + Accepted options are as follows: + * Magnification (integer) : set the maginification factor for the saved + animation. + * Quality (0 [worst] or 1 or 2 [best]) : set the quality of the generated + movie (if applicable). + * Subsampling (integer) : setting whether the movie encoder should use + subsampling of the chrome planes or not, if applicable. Since the human + eye is more sensitive to brightness than color variations, subsampling + can be useful to reduce the bitrate. Default value is 0. + * BackgroundColor (3-tuple of doubles) : set the RGB background color to + use to fill empty spaces in the image. + * FrameRate (double): set the frame rate (if applicable).""" + scene = GetAnimationScene() + # ensures that the TimeKeeper track is created. + GetTimeTrack() + iw = servermanager.vtkSMAnimationSceneImageWriter() + iw.SetAnimationScene(scene.SMProxy) + iw.SetFileName(filename) + if params.has_key("Magnification"): + iw.SetMagnification(int(params["Magnification"])) + if params.has_key("Quality"): + iw.SetQuality(int(params["Quality"])) + if params.has_key("Subsampling"): + iw.SetSubsampling(int(params["Subsampling"])) + if params.has_key("BackgroundColor"): + iw.SetBackgroundColor(params["BackgroundColor"]) + if params.has_key("FrameRate"): + iw.SetFrameRate(float(params["FrameRate"])) + iw.Save() + +def _GetRepresentationAnimationHelper(sourceproxy): + """Internal method that returns the representation animation helper for a + source proxy. It creates a new one if none exists.""" + # ascertain that proxy is a source proxy + if not sourceproxy in GetSources().values(): + return None + for proxy in servermanager.ProxyManager(): + if proxy.GetXMLName() == "RepresentationAnimationHelper" and\ + proxy.GetProperty("Source").IsProxyAdded(sourceproxy.SMProxy): + return proxy + # create a new helper + proxy = servermanager.misc.RepresentationAnimationHelper( + Source=sourceproxy) + servermanager.ProxyManager().RegisterProxy( + "pq_helper_proxies.%s" % sourceproxy.GetGlobalIDAsString(), + "RepresentationAnimationHelper", proxy) + return proxy + +def GetAnimationTrack(propertyname_or_property, index=None, proxy=None): + """Returns an animation cue for the property. If one doesn't exist then a + new one will be created. + Typical usage: + track = GetAnimationTrack("Center", 0, sphere) or + track = GetAnimationTrack(sphere.GetProperty("Radius")) or + + # this returns the track to animate visibility of the active source in + # all views. + track = GetAnimationTrack("Visibility") + + For animating properties on implicit planes etc., use the following + signatures: + track = GetAnimationTrack(slice.SliceType.GetProperty("Origin"), 0) or + track = GetAnimationTrack("Origin", 0, slice.SliceType) + + """ + if not proxy: + proxy = GetActiveSource() + if not isinstance(proxy, servermanager.Proxy): + raise TypeError, "proxy must be a servermanager.Proxy instance" + if isinstance(propertyname_or_property, str): + propertyname = propertyname_or_property + elif isinstance(propertyname_or_property, servermanager.Property): + prop = propertyname_or_property + propertyname = prop.Name + proxy = prop.Proxy + else: + raise TypeError, "propertyname_or_property must be a string or servermanager.Property" + + # To handle the case where the property is actually a "display" property, in + # which case we are actually animating the "RepresentationAnimationHelper" + # associated with the source. + if propertyname in ["Visibility", "Opacity"]: + proxy = _GetRepresentationAnimationHelper(proxy) + if not proxy or not proxy.GetProperty(propertyname): + raise AttributeError, "Failed to locate property %s" % propertyname + + scene = GetAnimationScene() + for cue in scene.Cues: + try: + if cue.AnimatedProxy.IsSame(proxy) and\ + cue.AnimatedPropertyName == propertyname: + if index == None or index.IsSame(cue.AnimatedElement): ##index == cue.AnimatedElement: + return cue + except AttributeError: + pass + + # matching animation track wasn't found, create a new one. + cue = KeyFrameAnimationCue() + cue.AnimatedProxy = proxy + cue.AnimatedPropertyName = propertyname + if index != None: + cue.AnimatedElement = index + scene.Cues.append(cue) + return cue + +def GetCameraTrack(view=None): + """Returns the camera animation track for the given view. If no view is + specified, active view will be used. If no exisiting camera animation track + is found, a new one will be created.""" + if not view: + view = GetActiveView() + if not view: + raise ValueError, "No view specified" + scene = GetAnimationScene() + for cue in scene.Cues: + if cue.AnimatedProxy.IsSame(view) and\ + cue.GetXMLName() == "CameraAnimationCue": + return cue + # no cue was found, create a new one. + cue = CameraAnimationCue() + cue.AnimatedProxy = view + scene.Cues.append(cue) + return cue + +def GetTimeTrack(): + """Returns the animation track used to control the time requested from all + readers/filters during playback. + This is the "TimeKeeper - Time" track shown in ParaView's 'Animation View'. + If none exists, a new one will be created.""" + scene = GetAnimationScene() + tk = scene.TimeKeeper + for cue in scene.Cues: + if cue.GetXMLName() == "TimeAnimationCue" and cue.AnimatedProxy.IsSame(tk)\ + and cue.AnimatedPropertyName == "Time": + return cue + # no cue was found, create a new one. + cue = TimeAnimationCue() + cue.AnimatedProxy = tk + cue.AnimatedPropertyName = "Time" + scene.Cues.append(cue) + return cue + def LoadXML(xmlstring, ns=None): """Given a server manager XML as a string, parse and process it. If you loaded the simple module with from paraview.simple import *, @@ -554,6 +873,22 @@ def LoadPlugin(filename, remote=True, ns=None): servermanager.LoadPlugin(filename, remote) _add_functions(ns) +def LoadDistributedPlugin(pluginname, remote=True, ns=None): + """Loads a plugin that's distributed with the executable. This uses the + information known about plugins distributed with ParaView to locate the + shared library for the plugin to load. Raises a RuntimeError if the plugin + was not found.""" + plm = servermanager.ProxyManager().GetSession().GetPluginManager() + if remote: + info = plm.GetRemoteInformation() + else: + info = plm.GetLocalInformation() + for cc in range(0, info.GetNumberOfPlugins()): + if info.GetPluginName(cc) == pluginname: + return LoadPlugin(info.GetPluginFileName(cc), remote, ns) + raise RuntimeError, "Plugin '%s' not found" % pluginname + + class ActiveObjects(object): """This class manages the active objects (source and view). The active objects are shared between Python and the user interface. This class @@ -618,7 +953,7 @@ class ActiveObjects(object): source = property(get_source, set_source) class _funcs_internals: - "Internal class." + """Internal class.""" first_render = True view_counter = 0 rep_counter = 0 @@ -703,12 +1038,12 @@ def SaveTrace(fileName): _add_functions(globals()) -active_objects = ActiveObjects() -## Initialisation for SALOME GUI -active_objects.view = servermanager.GetRenderView() if not servermanager.ActiveConnection: Connect() def ImportFile(theFileName): paravisSM.ImportFile(theFileName) + +active_objects = ActiveObjects() +active_objects.view = GetRenderView() diff --git a/src/PV_SWIG/servermanager.diff b/src/PV_SWIG/servermanager.diff index 937070a4..d939c69c 100644 --- a/src/PV_SWIG/servermanager.diff +++ b/src/PV_SWIG/servermanager.diff @@ -1,8 +1,28 @@ -29,55c29,35 +0a1,19 +> # Copyright (C) 2010-2012 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. +> # +> # 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 +> # +> +29,43d47 < #============================================================================== < # < # Program: ParaView -< # Module: $RCSfile: servermanager.diff,v $ +< # Module: servermanager.py < # < # Copyright (c) Kitware, Inc. < # All rights reserved. @@ -13,50 +33,37 @@ < # PURPOSE. See the above copyright notice for more information. < # < #============================================================================== -< import paraview, re, os, new, sys, vtk -< +< import paraview, re, os, os.path, new, sys, vtk +45,53c49,54 < if not paraview.compatibility.minor: < paraview.compatibility.major = 3 < if not paraview.compatibility.major: < paraview.compatibility.minor = 5 < -< if os.name == "posix": -< from libvtkPVServerCommonPython import * -< from libvtkPVServerManagerPython import * -< else: -< from vtkPVServerCommonPython import * -< from vtkPVServerManagerPython import * +< from vtkPVClientServerCorePython import * +< from vtkPVServerImplementationPython import * +< from vtkPVServerManagerPython import * +< from vtkPVCommonPython import * --- > > -> > import re, os, new, sys > from paravis import * > > -63,64c43 +61,62c62 < if paraview.compatibility.GetVersion() >= 3.5 and \ < smproperty.IsA("vtkSMStringVectorProperty"): --- > if smproperty.IsA("vtkSMStringVectorProperty"): -66,67c45 -< if al and al.IsA("vtkSMArraySelectionDomain") and \ -< smproperty.GetRepeatable(): ---- -> if al and al.IsA("vtkSMArraySelectionDomain") and smproperty.GetRepeatable(): -87,88c65 -< if smproperty.IsA("vtkSMIntVectorProperty") and \ -< smproperty.GetDomain("enum"): ---- -> if smproperty.IsA("vtkSMIntVectorProperty") and smproperty.GetDomain("enum"): -237,238c214,216 +251,252c251,253 < return self.SMProxy == other.SMProxy < return self.SMProxy == other --- -> ## VSV using IsSame instead +> ## VSV using IsSame instead == > return self.SMProxy.IsSame(other.SMProxy) > return self.SMProxy.IsSame(other) -333,336c311,314 +347,350c348,351 < if not c.HasObserver("ModifiedEvent"): < self.ObserverTag =c.AddObserver("ModifiedEvent", \ < _makeUpdateCameraMethod(weakref.ref(self))) @@ -66,7 +73,7 @@ > ## if not c.HasObserver("ModifiedEvent"): > ## self.ObserverTag =c.AddObserver("ModifiedEvent", _makeUpdateCameraMethod(weakref.ref(self))) > ## self.Observed = c -439,457c417,434 +454,472c455,472 < if paraview.compatibility.GetVersion() >= 3.5: < def FileNameChanged(self): < "Called when the filename changes. Selects all variables." @@ -105,33 +112,36 @@ > 'ElementVariables', 'GlobalVariables'): > f = getattr(self, prop) > f.DeselectAll() -1040c1017,1018 +1110c1110,1111 < if proxy == px: --- > ## VSV: == > if proxy.IsSame(px): -1217c1195 -< return vtk.vtkDataObjectTypes.GetClassNameFromTypeId(self.GetDataSetType()) ---- -> return vtkDataObjectTypes.GetClassNameFromTypeId(self.GetDataSetType()) -1259,1261d1236 +1329,1332d1329 < if paraview.compatibility.GetVersion() <= 3.4: < def Range(self, component=0): < return self.GetRange(component) -1521c1496 -< collection = vtk.vtkCollection() ---- -> collection = vtkCollection() -1909c1884 < +1526c1523 +< aProxy = self.SMProxyManager.NewProxy(group, name) --- -> -2020c1995,1996 +> aProxy = self.SMProxyManager.NewProxy(group, name, "NULL") +1838a1836 +> # VTN: Observers are not supported +1840c1838 +< self.DefinitionObserverTag = self.Session.GetProxyDefinitionManager().AddObserver(2000, _update_definitions) +--- +> ## self.DefinitionObserverTag = self.Session.GetProxyDefinitionManager().AddObserver(2000, _update_definitions) +1842c1840 +< self.CustomDefinitionObserverTag = self.Session.GetProxyDefinitionManager().AddObserver(2001, _update_definitions) +--- +> ## self.CustomDefinitionObserverTag = self.Session.GetProxyDefinitionManager().AddObserver(2001, _update_definitions) +2056c2054,2055 < try: isRep = rep.Input == aProxy --- > #VSV: == > try: isRep = rep.Input.IsSame(aProxy) -2265,2281c2241,2242 +2287,2303c2286,2287 < """Turn on/off printing of progress (by default, it is on). You can < always turn progress off and add your own observer to the process < module to handle progress in a custom way. See _printProgress for @@ -152,26 +162,25 @@ --- > """Is not supported because of not supported observers""" > pass -2308,2310c2269,2270 +2330,2332c2314,2315 < if paraview.compatibility.GetVersion() >= 3.5: < if smproxy.GetXMLLabel(): < xmlName = smproxy.GetXMLLabel() --- > if smproxy.GetXMLLabel(): > xmlName = smproxy.GetXMLLabel() -2350,2353c2310 +2375,2378c2358 < if paraview.compatibility.GetVersion() >= 3.5: < return self.GetPropertyValue(propName) < else: < return self.GetProperty(propName) --- > return self.GetPropertyValue(propName) -2471c2428,2437 +2494c2474,2482 < return paraview.make_name_valid(name) --- -> """Make a string into a valid Python variable name. Return None if -> the name contains parentheses.""" -> if not name or '(' in name or ')' in name: +> """Make a string into a valid Python variable name.""" +> if not name: > return None > import string > valid_chars = "_%s%s" % (string.ascii_letters, string.digits) @@ -179,25 +188,26 @@ > if not name[0].isalpha(): > name = 'a' + name > return name -2490,2491c2456 +2520,2521c2508 < if paraview.compatibility.GetVersion() >= 3.5 and\ < proto.GetXMLLabel(): --- > if proto.GetXMLLabel(): -2506,2509c2471,2472 +2536,2539c2523,2525 < if paraview.compatibility.GetVersion() >= 3.5: < if (prop.GetInformationOnly() and propName != "TimestepValues" ) \ < or prop.GetIsInternal(): < continue --- -> if (prop.GetInformationOnly() and propName != "TimestepValues" ) or prop.GetIsInternal(): +> if (prop.GetInformationOnly() and propName != "TimestepValues" ) \ +> or prop.GetIsInternal(): > continue -2511,2512c2474 +2541,2542c2527 < if paraview.compatibility.GetVersion() >= 3.5: < names = [iter.PropertyLabel] --- > names = [iter.PropertyLabel] -2641,2650c2603,2606 +2681,2690c2666,2669 < if paraview.compatibility.GetVersion() <= 3.4: < ss = sources.SphereSource(Radius=2, ThetaResolution=32) < shr = filters.ShrinkFilter(Input=OutputPort(ss,0)) @@ -213,28 +223,28 @@ > shr = filters.Shrink(Input=OutputPort(ss,0)) > cs = sources.Cone() > app = filters.AppendDatasets() -2671,2674c2627 +2711,2714c2690 < if paraview.compatibility.GetVersion() <= 3.4: < arraySelection = reader.PointResultArrayStatus < else: < arraySelection = reader.PointVariables --- > arraySelection = reader.PointVariables -2708,2711c2661 +2748,2751c2724 < if paraview.compatibility.GetVersion() <= 3.4: < print "Range:", ai.Range(j) < else: < print "Range:", ai.GetRange(j) --- > print "Range:", ai.GetRange(j) -2742,2745c2692 +2782,2785c2755 < if paraview.compatibility.GetVersion() <= 3.4: < source = sources.RTAnalyticSource() < else: < source = sources.Wavelet() --- > source = sources.Wavelet() -2776,2783c2723,2725 +2816,2823c2786,2788 < if paraview.compatibility.GetVersion() <= 3.4: < probe = filters.Probe(Input=source) < # with a line @@ -247,24 +257,49 @@ > probe = filters.ResampleWithDataset(Input=source) > # with a line > line = sources.Line(Resolution=60) -2827,2830c2769 +2867,2870c2832 < if paraview.compatibility.GetVersion() <= 3.4: < sphere = sources.SphereSource() < else: < sphere = sources.Sphere() --- > sphere = sources.Sphere() -2897,2899c2836,2844 -< if hasattr(sys, "ps1"): -< # session is interactive. -< print vtkSMProxyManager.GetParaViewSourceVersion(); +2960,2965c2922,2927 +< pvoptions = None +< if paraview.options.batch: +< pvoptions = vtkPVOptions(); +< pvoptions.SetProcessType(0x40) +< if paraview.options.symmetric: +< pvoptions.SetSymmetricMPIMode(True) +--- +> # pvoptions = None Not applicable for SALOME Python console +> # if paraview.options.batch: +> # pvoptions = vtkPVOptions(); +> # pvoptions.SetProcessType(0x40) +> # if paraview.options.symmetric: +> # pvoptions.SetSymmetricMPIMode(True) +2994,2995c2956,2957 +< +< if not paraview.fromFilter: +--- +> ## VSV fromFilter is alwais False for SALOME because it can't be changed from ParaView code +> #if not paraview.fromFilter: +2998,2999c2960,2963 +< connection.AttachDefinitionUpdater() +< pass --- +> # global _defUpdater +> # _defUpdater = __DefinitionUpdater() +> connection.AttachDefinitionUpdater() +> pass +3008a2973,2982 > # Definitions for working in SALOME GUI mode -> aParams = myParavis.GetConnectionParameters() -> ActiveConnection = Connection(aParams[0]) -> ActiveConnection.SetHost(aParams[1], aParams[2], aParams[3], aParams[4], aParams[5]) -> ToggleProgressPrinting() -> fromGUI = True +> #aParams = myParavis.GetConnectionParameters() +> #ActiveConnection = Connect() +> ##Connection(aParams[0]) +> #ActiveConnection.SetHost(aParams[1], aParams[2], aParams[3], aParams[4], aParams[5]) +> #ToggleProgressPrinting() +> #fromGUI = True > -> print vtkSMProxyManager.GetParaViewSourceVersion(); +> InitFromGUI() > diff --git a/src/PV_SWIG/simple.diff b/src/PV_SWIG/simple.diff index 18ffcb82..323c3bbe 100644 --- a/src/PV_SWIG/simple.diff +++ b/src/PV_SWIG/simple.diff @@ -1,8 +1,28 @@ -21,39c21,24 +0a1,19 +> # Copyright (C) 2010-2012 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. +> # +> # 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 +> # +> +21,34d39 < #============================================================================== < # < # Program: ParaView -< # Module: $RCSfile: simple.diff,v $ +< # Module: simple.py < # < # Copyright (c) Kitware, Inc. < # All rights reserved. @@ -13,32 +33,240 @@ < # PURPOSE. See the above copyright notice for more information. < # < #============================================================================== -< +36,39c41 < import paraview < paraview.compatibility.major = 3 < paraview.compatibility.minor = 5 < import servermanager --- -> > import paravisSM -> +41,42c43 +< def enableMultiServer(): +< servermanager.enableMultiServer() +--- > servermanager = paravisSM -280c265,266 +44,56c45,46 +< def switchActiveConnection(newActiveConnection=None, ns=None): +< if not ns: +< ns = globals() +< _remove_functions(ns) +< servermanager.switchActiveConnection(newActiveConnection) +< _add_functions(ns) +< +< def Disconnect(ns=None, force=True): +< if servermanager.ActiveConnection and (force or servermanager.MultiServerConnections == None): +< if ns: +< _remove_functions(ns) +< _remove_functions(globals()) +< servermanager.ProxyManager().DisableStateUpdateNotification() +--- +> def _disconnect(): +> if servermanager.ActiveConnection: +61d50 +< servermanager.Disconnect() +62a52 +> servermanager.Disconnect() +69,70c59,60 +< Disconnect(globals(), False) +< connection = servermanager.Connect(ds_host, ds_port, rs_host, rs_port) +--- +> _disconnect() +> session = servermanager.Connect(ds_host, ds_port, rs_host, rs_port) +73,88c63,67 +< servermanager.ProxyManager().DisableStateUpdateNotification() +< servermanager.ProxyManager().UpdateFromRemote() +< tk = servermanager.ProxyManager().GetProxy("timekeeper", "TimeKeeper") +< if not tk: +< tk = servermanager.misc.TimeKeeper() +< servermanager.ProxyManager().RegisterProxy("timekeeper", "TimeKeeper", tk) +< +< scene = servermanager.ProxyManager().GetProxy("animation", "AnimationScene") +< if not scene: +< scene = AnimationScene() +< scene.TimeKeeper = tk +< +< servermanager.ProxyManager().EnableStateUpdateNotification() +< servermanager.ProxyManager().TriggerStateUpdate() +< +< return connection +--- +> tk = servermanager.misc.TimeKeeper() +> servermanager.ProxyManager().RegisterProxy("timekeeper", "tk", tk) +> scene = AnimationScene() +> scene.TimeKeeper = tk +> return session +93,94c72,73 +< Disconnect(globals(), False) +< connection = servermanager.ReverseConnect(port) +--- +> _disconnect() +> session = servermanager.ReverseConnect(port) +96,112c75,79 +< +< servermanager.ProxyManager().DisableStateUpdateNotification() +< servermanager.ProxyManager().UpdateFromRemote() +< tk = servermanager.ProxyManager().GetProxy("timekeeper", "TimeKeeper") +< if not tk: +< tk = servermanager.misc.TimeKeeper() +< servermanager.ProxyManager().RegisterProxy("timekeeper", "TimeKeeper", tk) +< +< scene = servermanager.ProxyManager().GetProxy("animation", "AnimationScene") +< if not scene: +< scene = AnimationScene() +< scene.TimeKeeper = tk +< +< servermanager.ProxyManager().EnableStateUpdateNotification() +< servermanager.ProxyManager().TriggerStateUpdate() +< +< return connection +--- +> tk = servermanager.misc.TimeKeeper() +> servermanager.ProxyManager().RegisterProxy("timekeeper", "tk", tk) +> scene = AnimationScene() +> scene.TimeKeeper = tk +> return session +121c88 +< +--- +> +161a129,131 +> reader_factor = servermanager.ProxyManager().GetReaderFactory() +> if reader_factor.GetNumberOfRegisteredPrototypes() == 0: +> reader_factor.RegisterPrototypes("sources") +163,165d132 +< reader_factor = servermanager.vtkSMProxyManager.GetProxyManager().GetReaderFactory() +< if reader_factor.GetNumberOfRegisteredPrototypes() == 0: +< reader_factor.RegisterPrototypes(session, "sources") +170,171c137 +< msg = "File not readable: %s " % first_file +< raise RuntimeError, msg +--- +> raise RuntimeError, "File not readable: %s " % first_file +173,174c139 +< msg = "File not readable. No reader found for '%s' " % first_file +< raise RuntimeError, msg +--- +> raise RuntimeError, "File not readable. No reader found for '%s' " % first_file +192,193c157 +< session = servermanager.ActiveConnection.Session +< writer_factory = servermanager.vtkSMProxyManager.GetProxyManager().GetWriterFactory() +--- +> writer_factory = servermanager.ProxyManager().GetWriterFactory() +195c159 +< writer_factory.RegisterPrototypes(session, "writers") +--- +> writer_factory.RegisterPrototypes("writers") +441c405,406 < if proxy == GetActiveSource(): --- > #VSV:== > if proxy.IsSame(GetActiveSource()): -288c274,275 +449c414,415 < if rep.Input == proxy: --- > #VSV:== > if rep.Input.IsSame(proxy): -292c279,280 +453c419,420 < if proxy == GetActiveView(): --- > ##VSV:== > if proxy.IsSame(GetActiveView()): -709a698,704 +691,693c658,659 +< activeModule = servermanager.ActiveConnection.Modules +< for m in [activeModule.filters, activeModule.sources, +< activeModule.writers, activeModule.animation]: +--- +> for m in [servermanager.filters, servermanager.sources, +> servermanager.writers, servermanager.animation]: +699d664 +< #print "add %s function" % key +703,715d667 +< def _remove_functions(g): +< list = [] +< if servermanager.ActiveConnection: +< list = [m for m in dir(servermanager.ActiveConnection.Modules) if m[0] != '_'] +< +< for m in list: +< dt = servermanager.ActiveConnection.Modules.__dict__[m].__dict__ +< for key in dt.keys(): +< cl = dt[key] +< if not isinstance(cl, str) and g.has_key(key): +< g.pop(key) +< #print "remove %s function" % key +< +844c796 +< if cue.AnimatedProxy == proxy and\ +--- +> if cue.AnimatedProxy.IsSame(proxy) and\ +846c798 +< if index == None or index == cue.AnimatedElement: +--- +> if index == None or index.IsSame(cue.AnimatedElement): ##index == cue.AnimatedElement: +870c822 +< if cue.AnimatedProxy == view and\ +--- +> if cue.AnimatedProxy.IsSame(view) and\ +887c839 +< if cue.GetXMLName() == "TimeAnimationCue" and cue.AnimatedProxy == tk\ +--- +> if cue.GetXMLName() == "TimeAnimationCue" and cue.AnimatedProxy.IsSame(tk)\ +929,931c881 +< if not servermanager.ActiveConnection: +< raise RuntimeError, "Cannot load a plugin without a session." +< plm = servermanager.vtkSMProxyManager.GetProxyManager().GetPluginManager() +--- +> plm = servermanager.ProxyManager().GetSession().GetPluginManager() +933,934c883 +< session = servermanager.ActiveConnection.Session +< info = plm.GetRemoteInformation(session) +--- +> info = plm.GetRemoteInformation() +942,959d890 +< def GetLayouts(): +< """Returns the layout proxies on the active session. +< Layout proxies are used to place views in a grid.""" +< return servermanager.ProxyManager().GetProxiesInGroup("layouts") +< +< def GetLayout(view=None): +< """Return the layout containing the give view, if any. +< If no view is specified, active view is used. +< """ +< if not view: +< view = GetActiveView() +< if not view: +< raise RuntimeError, "No active view was found." +< layouts = GetLayouts() +< for layout in layouts.values(): +< if layout.GetViewLocation(view) != -1: +< return layout +< return None +966c897 +< def __get_selection_model(self, name, session=None): +--- +> def __get_selection_model(self, name): +968,970c899 +< if session and session != servermanager.ActiveConnection.Session: +< raise RuntimeError, "Try to set an active object with invalid active connection." +< pxm = servermanager.ProxyManager(session) +--- +> pxm = servermanager.ProxyManager() +979c908 +< active_view_model = self.__get_selection_model("ActiveView") +--- +> active_view_model = self.__get_selection_model("ActiveView") +981d909 +< active_view_model = self.__get_selection_model("ActiveView", view.GetSession()) +984d911 +< active_view_model = self.__get_selection_model("ActiveView") +994c921 +< active_sources_model = self.__get_selection_model("ActiveSources") +--- +> active_sources_model = self.__get_selection_model("ActiveSources") +997d923 +< active_sources_model = self.__get_selection_model("ActiveSources", source.GetSession()) +1000d925 +< active_sources_model = self.__get_selection_model("ActiveSources") +1107a1033,1041 > def PrintTrace(): > print paravisSM.myParavis.GetTrace() > @@ -46,10 +274,32 @@ > paravisSM.myParavis.SaveTrace(fileName) > > -711a707,708 -> ## Initialisation for SALOME GUI -> active_objects.view = servermanager.GetRenderView() -714a712,714 +> _add_functions(globals()) > +1110,1111d1043 +< else: +< _add_functions(globals()) +1113c1045,1046 +< active_objects = ActiveObjects() +--- > def ImportFile(theFileName): > paravisSM.ImportFile(theFileName) +1115,1129c1048,1049 +< def _switchToActiveConnectionCallback(caller, event): +< if servermanager: +< session = servermanager.vtkSMProxyManager.GetProxyManager().GetActiveSession() +< if session and ((not servermanager.ActiveConnection) or session != servermanager.ActiveConnection.Session): +< switchActiveConnection(servermanager.GetConnectionFromSession(session)) +< +< class ActiveSessionObserver: +< def __init__(self): +< self.ObserverTag = servermanager.vtkSMProxyManager.GetProxyManager().AddObserver(9753, _switchToActiveConnectionCallback) +< +< def __del__(self): +< if servermanager: +< servermanager.vtkSMProxyManager.GetProxyManager().RemoveObserver(self.ObserverTag) +< +< active_session_observer = ActiveSessionObserver() +--- +> active_objects = ActiveObjects() +> active_objects.view = GetRenderView() diff --git a/src/ParaView/lex.yy.c b/src/ParaView/lex.yy.c index 2b12ad47..d64e2ad9 100644 --- a/src/ParaView/lex.yy.c +++ b/src/ParaView/lex.yy.c @@ -1,5 +1,6 @@ +#line 2 "lex.yy.c" -#line 3 "lex.yy.c" +#line 4 "lex.yy.c" #define YY_INT_ALIGNED short int @@ -33,7 +34,7 @@ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. + * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 @@ -50,9 +51,10 @@ typedef uint32_t flex_uint32_t; typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; +typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -83,8 +85,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -92,15 +92,15 @@ typedef unsigned int flex_uint32_t; /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST -#else /* ! __cplusplus */ +#else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ +#endif /* defined (__STDC__) */ +#endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const @@ -141,15 +141,7 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -161,7 +153,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int yyleng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t yyleng; extern FILE *yyin, *yyout; @@ -171,101 +168,98 @@ extern FILE *yyin, *yyout; /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. + * existing scanners that call yyless() from OUTSIDE yylex. * One obvious solution it to make yy_act a global. I tried that, and saw * a 5% performance hit in a non-yylineno scanner, because yy_act is * normally declared as a register variable-- so it is not worth it. */ #define YY_LESS_LINENO(n) \ do { \ - int yyl;\ + yy_size_t yyl;\ for ( yyl = n; yyl < yyleng; ++yyl )\ if ( yytext[yyl] == '\n' )\ --yylineno;\ }while(0) - + /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) + *yy_cp = (yy_hold_char); \ + YY_RESTORE_YY_MORE_OFFSET \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif +#define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - size_t yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + yy_size_t yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - int yy_buffer_status; + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ #define YY_BUFFER_EOF_PENDING 2 - }; + }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ @@ -290,13 +284,13 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; -static size_t yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ +static int yy_init = 0; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... @@ -319,7 +313,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); @@ -328,24 +322,24 @@ void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } #define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ + { \ + if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ + YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ + } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) @@ -373,108 +367,238 @@ static void yy_fatal_error (yyconst char msg[] ); * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 94 -#define YY_END_OF_BUFFER 95 + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ + *yy_cp = '\0'; \ + (yy_c_buf_p) = yy_cp; + +#define YY_NUM_RULES 247 +#define YY_END_OF_BUFFER 248 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[772] = + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[1956] = { 0, - 0, 0, 95, 93, 89, 89, 93, 92, 93, 84, - 88, 88, 90, 91, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 89, 9, 9, 93, - 93, 0, 1, 11, 84, 0, 0, 88, 88, 88, - 0, 0, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, - 88, 88, 88, 0, 9, 0, 0, 86, 10, 85, - 11, 0, 88, 0, 0, 14, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 30, 88, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 88, 87, 10, 10, - - 10, 10, 0, 88, 88, 88, 37, 36, 88, 88, - 88, 88, 88, 0, 88, 88, 33, 88, 88, 88, - 88, 88, 88, 88, 88, 88, 35, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 10, - 10, 10, 10, 10, 10, 0, 88, 88, 88, 88, - 26, 39, 88, 31, 88, 0, 0, 88, 88, 0, - 88, 88, 88, 88, 88, 88, 32, 88, 88, 88, - 88, 0, 0, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 10, 10, 10, 10, 10, - 10, 10, 0, 88, 88, 88, 88, 0, 34, 42, - - 0, 0, 88, 88, 0, 0, 88, 88, 88, 88, - 88, 27, 0, 88, 88, 43, 88, 88, 0, 0, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 10, 10, 10, 10, 10, 10, 10, 10, - 2, 0, 88, 88, 12, 24, 0, 0, 0, 0, - 20, 88, 0, 0, 18, 88, 88, 28, 88, 0, - 88, 0, 88, 88, 38, 0, 0, 0, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 10, 10, - 10, 10, 10, 10, 10, 12, 88, 88, 0, 20, - - 0, 0, 88, 19, 18, 0, 21, 40, 88, 0, - 17, 0, 88, 41, 0, 0, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 10, 10, 10, 3, 10, 10, 88, 88, 0, 0, - 19, 88, 21, 0, 88, 29, 17, 0, 88, 0, - 0, 87, 87, 87, 87, 87, 87, 87, 45, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 3, 10, 10, 3, 10, - 10, 72, 88, 0, 0, 15, 0, 88, 0, 88, - - 0, 25, 0, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 12, 3, 10, 10, 10, - 10, 88, 0, 22, 0, 23, 25, 0, 87, 87, - 87, 48, 87, 87, 87, 0, 0, 87, 47, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 74, 87, - 87, 87, 87, 87, 10, 10, 10, 10, 88, 22, - 23, 0, 87, 87, 87, 87, 87, 87, 0, 13, - 87, 87, 87, 87, 87, 46, 87, 76, 78, 80, - 70, 87, 87, 87, 87, 75, 87, 87, 10, 10, - - 10, 10, 88, 0, 0, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 77, 79, 81, - 87, 87, 10, 10, 10, 10, 10, 10, 10, 88, - 0, 16, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 82, 83, 87, 87, 87, 10, 10, 10, 10, - 10, 10, 10, 10, 10, 10, 73, 55, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 10, - - 10, 10, 10, 10, 10, 10, 10, 10, 8, 87, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 51, - 87, 87, 87, 87, 87, 87, 87, 87, 87, 87, - 87, 10, 10, 10, 10, 8, 10, 10, 10, 10, - 8, 87, 87, 87, 54, 50, 87, 87, 87, 87, - 65, 52, 87, 49, 87, 87, 87, 87, 64, 87, - 87, 87, 10, 10, 10, 10, 8, 10, 10, 10, - 10, 87, 87, 87, 60, 61, 62, 63, 87, 56, - 57, 58, 59, 87, 87, 87, 10, 10, 10, 10, - 10, 10, 10, 10, 87, 87, 87, 87, 87, 87, - - 87, 10, 10, 10, 10, 7, 10, 10, 10, 68, - 87, 44, 87, 71, 87, 87, 7, 10, 10, 10, - 7, 10, 5, 6, 87, 87, 87, 87, 7, 10, - 5, 6, 10, 5, 6, 87, 87, 87, 87, 10, - 5, 6, 10, 87, 87, 87, 67, 10, 4, 87, - 87, 87, 4, 4, 87, 87, 87, 4, 87, 87, - 66, 87, 87, 69, 87, 87, 87, 87, 87, 53, - 0 + 0, 0, 248, 246, 216, 216, 245, 246, 245, 245, + 246, 245, 245, 245, 245, 245, 245, 245, 213, 212, + 245, 245, 245, 245, 208, 208, 208, 208, 208, 208, + 243, 246, 244, 245, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 245, 216, 11, 11, 15, 245, 246, + 238, 0, 16, 0, 229, 235, 230, 0, 0, 0, + 192, 193, 0, 0, 0, 0, 0, 227, 0, 223, + 225, 224, 226, 221, 0, 1, 13, 228, 209, 211, + 0, 0, 0, 212, 212, 212, 242, 219, 239, 237, + + 240, 222, 208, 208, 208, 208, 208, 208, 208, 208, + 214, 0, 232, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 142, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 231, 236, 0, 11, 15, 0, + 0, 15, 15, 15, 15, 12, 0, 16, 233, 17, + 17, 0, 0, 0, 0, 0, 0, 220, 241, 13, + 209, 209, 209, 211, 211, 210, 0, 212, 217, 218, + 208, 208, 208, 0, 208, 208, 215, 208, 208, 208, + + 140, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 98, 208, 208, + 208, 208, 130, 144, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 146, 234, + 12, 15, 15, 12, 12, 12, 12, 0, 0, 0, + 0, 0, 0, 0, 0, 209, 211, 210, 210, 0, + 212, 208, 208, 208, 206, 205, 208, 208, 208, 208, + 208, 137, 208, 208, 102, 93, 208, 208, 208, 208, + 208, 208, 115, 208, 208, 208, 208, 208, 0, 208, + + 208, 208, 208, 88, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 0, 208, 208, 208, 208, 208, 208, 208, 208, 101, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 12, 12, 12, 12, 15, + 12, 12, 12, 12, 0, 0, 0, 0, 0, 0, + 211, 0, 212, 208, 208, 208, 206, 205, 205, 205, + 205, 205, 205, 208, 208, 208, 208, 208, 208, 149, + 0, 208, 208, 110, 150, 118, 208, 208, 208, 208, + 208, 26, 208, 208, 0, 0, 0, 208, 208, 208, + + 208, 208, 0, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 143, 208, 208, 208, 208, 208, 208, 69, + 208, 208, 208, 208, 208, 0, 208, 208, 208, 208, + 208, 116, 208, 129, 208, 0, 0, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 12, 12, 12, 12, 15, 12, 12, + 12, 2, 3, 0, 0, 0, 0, 0, 190, 211, + 0, 212, 208, 208, 208, 205, 205, 205, 205, 199, + 208, 208, 208, 141, 148, 0, 0, 208, 208, 0, + 0, 191, 208, 131, 25, 208, 208, 124, 121, 122, + + 0, 0, 0, 0, 208, 208, 208, 208, 208, 0, + 0, 0, 0, 0, 208, 208, 208, 208, 208, 208, + 208, 145, 208, 208, 208, 208, 112, 208, 208, 0, + 208, 208, 208, 208, 100, 103, 208, 123, 0, 0, + 0, 208, 111, 208, 208, 208, 0, 208, 208, 0, + 0, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 147, 12, 12, 12, + 2, 3, 15, 12, 12, 12, 2, 3, 0, 0, + 0, 0, 0, 211, 0, 212, 208, 208, 208, 205, + 205, 205, 205, 196, 18, 208, 31, 0, 0, 208, + + 208, 0, 208, 208, 208, 0, 0, 0, 0, 0, + 86, 208, 208, 208, 201, 0, 0, 0, 0, 0, + 208, 87, 208, 208, 208, 119, 208, 208, 200, 113, + 208, 0, 208, 208, 208, 0, 0, 0, 208, 208, + 208, 208, 0, 208, 208, 208, 208, 208, 104, 208, + 0, 0, 0, 0, 0, 208, 127, 208, 0, 208, + 117, 0, 0, 0, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 0, 12, 12, 12, 2, + 3, 15, 12, 12, 12, 0, 0, 0, 0, 0, + + 194, 195, 211, 18, 18, 197, 198, 105, 205, 205, + 205, 205, 208, 0, 208, 208, 0, 0, 208, 208, + 0, 0, 0, 20, 208, 208, 132, 0, 0, 0, + 0, 86, 0, 0, 0, 0, 208, 208, 208, 67, + 208, 208, 0, 87, 0, 0, 0, 208, 0, 208, + 208, 50, 208, 208, 208, 120, 0, 208, 208, 0, + 208, 138, 208, 0, 0, 0, 68, 208, 208, 109, + 0, 0, 0, 0, 0, 208, 208, 208, 208, 208, + 208, 0, 0, 0, 0, 0, 125, 126, 0, 0, + 0, 22, 99, 0, 0, 139, 208, 208, 208, 208, + + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 12, 12, 12, 15, 5, 12, 12, 0, 0, 0, + 0, 18, 205, 205, 205, 205, 208, 0, 0, 208, + 208, 0, 0, 208, 208, 0, 208, 208, 0, 0, + 0, 0, 0, 0, 0, 67, 0, 0, 208, 208, + 208, 0, 208, 208, 97, 208, 0, 0, 0, 50, + 0, 0, 208, 208, 208, 0, 208, 208, 208, 208, + 208, 128, 0, 208, 114, 0, 208, 208, 68, 0, + 0, 0, 208, 208, 208, 208, 0, 0, 0, 0, + + 0, 208, 208, 96, 208, 208, 208, 0, 0, 0, + 0, 0, 0, 0, 21, 0, 0, 0, 0, 208, + 208, 208, 208, 208, 0, 0, 208, 208, 208, 208, + 208, 208, 208, 208, 152, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 5, 12, 12, 15, 5, 12, 12, 0, 0, 205, + 18, 177, 205, 208, 0, 0, 208, 208, 0, 0, + 91, 208, 0, 135, 208, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 97, 0, 208, 208, 208, 208, + 208, 0, 208, 208, 208, 0, 0, 0, 0, 0, + + 0, 0, 0, 24, 208, 208, 208, 208, 208, 85, + 208, 0, 208, 0, 208, 0, 208, 208, 0, 0, + 0, 0, 208, 208, 208, 208, 0, 0, 96, 0, + 0, 208, 92, 0, 208, 208, 84, 208, 208, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 208, 208, 208, 208, 208, 0, 208, 208, + 208, 208, 208, 208, 208, 208, 19, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 5, 12, 12, 15, 12, 12, 0, 4, 205, + 205, 208, 0, 0, 208, 208, 91, 0, 208, 0, + + 208, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 48, 208, 208, 208, 208, 208, 208, + 95, 24, 0, 0, 0, 0, 0, 85, 0, 208, + 208, 49, 208, 208, 0, 208, 208, 0, 208, 0, + 208, 0, 208, 208, 0, 0, 0, 0, 208, 208, + 66, 208, 0, 92, 0, 0, 84, 0, 208, 208, + 208, 0, 208, 208, 65, 133, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 208, 208, + 94, 208, 208, 0, 208, 208, 208, 208, 154, 208, + 208, 208, 0, 0, 208, 153, 208, 208, 208, 208, + + 208, 208, 208, 208, 180, 208, 208, 208, 208, 208, + 208, 12, 12, 15, 12, 12, 0, 205, 205, 208, + 0, 0, 208, 208, 0, 90, 134, 0, 0, 0, + 0, 48, 0, 0, 0, 0, 0, 0, 95, 0, + 208, 208, 208, 208, 208, 208, 208, 208, 0, 208, + 208, 0, 0, 49, 0, 0, 0, 0, 208, 208, + 0, 208, 208, 208, 208, 208, 77, 0, 208, 0, + 208, 0, 106, 208, 0, 0, 66, 0, 208, 208, + 0, 208, 208, 0, 0, 0, 0, 0, 65, 208, + 208, 208, 208, 208, 0, 208, 201, 200, 0, 0, + + 0, 0, 94, 0, 0, 208, 89, 0, 208, 208, + 76, 208, 0, 208, 204, 208, 208, 208, 208, 208, + 0, 19, 208, 208, 208, 208, 202, 208, 182, 184, + 186, 175, 208, 208, 208, 208, 181, 208, 208, 208, + 12, 12, 15, 12, 12, 0, 205, 205, 207, 0, + 0, 30, 208, 90, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 208, 208, 82, 208, + 208, 208, 78, 208, 208, 208, 0, 0, 0, 0, + 0, 0, 0, 77, 81, 208, 208, 208, 208, 208, + 80, 0, 208, 0, 107, 0, 208, 208, 0, 0, + + 0, 0, 208, 208, 208, 58, 0, 0, 0, 0, + 0, 0, 29, 79, 208, 83, 208, 208, 0, 0, + 89, 0, 0, 76, 0, 208, 208, 208, 0, 208, + 208, 57, 0, 0, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 183, 185, 187, 208, 208, + 208, 12, 12, 15, 12, 12, 12, 12, 12, 0, + 205, 205, 30, 0, 208, 0, 0, 0, 82, 0, + 0, 0, 78, 0, 0, 0, 208, 208, 208, 63, + 208, 0, 208, 59, 208, 208, 81, 0, 0, 0, + + 0, 0, 80, 0, 208, 208, 208, 47, 208, 208, + 0, 208, 208, 0, 0, 0, 58, 62, 208, 61, + 0, 208, 29, 79, 0, 83, 0, 0, 0, 208, + 60, 46, 64, 0, 0, 0, 0, 0, 0, 57, + 208, 208, 208, 208, 208, 0, 208, 0, 23, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 188, 189, 208, + 208, 208, 208, 12, 12, 12, 12, 12, 14, 14, + 14, 14, 12, 12, 12, 12, 12, 0, 205, 178, + 0, 28, 0, 0, 0, 0, 63, 0, 0, 59, + + 0, 0, 208, 208, 74, 208, 208, 70, 208, 0, + 0, 0, 47, 0, 0, 73, 208, 208, 0, 208, + 208, 72, 0, 108, 208, 62, 0, 61, 0, 208, + 208, 0, 60, 46, 64, 208, 0, 208, 0, 0, + 0, 0, 0, 0, 0, 27, 71, 208, 75, 208, + 208, 160, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, + 208, 208, 208, 12, 12, 12, 12, 12, 14, 14, + 14, 14, 14, 14, 14, 14, 12, 12, 12, 12, + 6, 205, 28, 0, 0, 74, 0, 0, 70, 0, + + 208, 208, 55, 208, 0, 208, 51, 73, 0, 0, + 0, 0, 72, 208, 208, 208, 39, 136, 0, 0, + 54, 53, 0, 0, 208, 208, 202, 27, 71, 0, + 75, 0, 0, 0, 208, 52, 38, 56, 208, 208, + 208, 208, 208, 208, 208, 208, 208, 208, 157, 208, + 208, 208, 208, 208, 208, 208, 208, 203, 208, 208, + 12, 12, 12, 12, 6, 14, 14, 12, 12, 12, + 12, 6, 205, 0, 0, 55, 0, 0, 51, 44, + 208, 40, 208, 0, 0, 0, 39, 43, 208, 42, + 0, 208, 54, 53, 0, 0, 41, 45, 0, 52, + + 38, 56, 208, 0, 208, 208, 208, 208, 159, 156, + 208, 208, 208, 208, 170, 158, 155, 208, 208, 208, + 208, 169, 208, 208, 208, 12, 12, 12, 12, 6, + 12, 12, 12, 12, 179, 44, 0, 40, 0, 208, + 208, 43, 0, 42, 0, 208, 208, 41, 45, 0, + 0, 208, 208, 208, 208, 208, 165, 166, 167, 168, + 161, 162, 163, 164, 208, 208, 208, 12, 12, 12, + 12, 12, 12, 12, 12, 0, 0, 36, 32, 0, + 0, 35, 34, 0, 0, 33, 37, 208, 208, 208, + 208, 208, 208, 12, 12, 12, 12, 10, 12, 12, + + 12, 36, 32, 35, 34, 33, 37, 173, 208, 151, + 176, 208, 208, 10, 12, 12, 12, 10, 12, 8, + 9, 208, 208, 208, 10, 12, 8, 9, 12, 8, + 9, 208, 208, 208, 12, 8, 9, 12, 208, 208, + 172, 12, 7, 208, 208, 7, 7, 208, 208, 7, + 208, 171, 208, 174, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -482,17 +606,17 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 6, 7, 1, 1, 8, 1, 9, - 10, 11, 1, 8, 8, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 19, 21, 19, 22, 23, 1, - 8, 1, 1, 1, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 31, 33, 34, 35, 36, 37, 38, - 31, 39, 40, 41, 42, 43, 44, 45, 46, 31, - 47, 1, 48, 1, 49, 1, 50, 51, 52, 53, - - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 31, 66, 67, 68, 69, 70, 71, 72, - 73, 31, 8, 1, 8, 8, 1, 1, 1, 1, + 1, 5, 6, 7, 8, 1, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 25, 27, 25, 28, 29, 30, + 31, 32, 1, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 64, 1, 65, 66, 67, 68, + + 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, + 89, 90, 16, 91, 16, 16, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -509,403 +633,993 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[74] = +static yyconst flex_int32_t yy_meta[92] = { 0, - 1, 2, 3, 2, 2, 4, 1, 1, 1, 5, - 1, 1, 1, 6, 7, 7, 7, 7, 7, 7, - 7, 1, 8, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 1, 10, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, - 9, 9, 9 + 1, 2, 3, 2, 2, 1, 1, 1, 1, 4, + 5, 1, 6, 4, 1, 1, 1, 7, 1, 8, + 8, 8, 8, 8, 8, 8, 8, 9, 10, 1, + 1, 1, 1, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 1, + 1, 1, 1, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, + 1 + } ; -static yyconst flex_int16_t yy_base[799] = +static yyconst flex_int16_t yy_base[2008] = { 0, - 0, 72, 1713, 1714, 1714, 1714, 0, 1714, 67, 72, - 1663, 53, 79, 1714, 67, 47, 48, 49, 54, 51, - 55, 52, 57, 50, 61, 73, 125, 1714, 1714, 1708, - 121, 1704, 1714, 0, 128, 1660, 105, 1659, 107, 103, - 155, 159, 106, 122, 76, 116, 118, 90, 120, 121, - 123, 124, 125, 129, 126, 142, 130, 146, 137, 133, - 147, 148, 149, 212, 1714, 1694, 1703, 1714, 194, 1714, - 0, 156, 1656, 218, 224, 1714, 186, 155, 181, 182, - 183, 184, 159, 162, 185, 241, 191, 187, 188, 189, - 200, 203, 192, 205, 207, 210, 211, 284, 257, 0, - - 256, 1663, 225, 242, 230, 226, 1654, 1653, 222, 228, - 231, 232, 235, 301, 246, 236, 327, 238, 268, 272, - 285, 270, 286, 287, 266, 288, 344, 1652, 290, 292, - 250, 301, 248, 295, 302, 293, 303, 309, 332, 0, - 351, 1659, 329, 1645, 1653, 330, 343, 333, 335, 355, - 372, 1648, 337, 1647, 334, 1631, 1637, 331, 341, 393, - 340, 350, 351, 352, 357, 358, 413, 359, 373, 364, - 374, 426, 434, 362, 258, 383, 384, 393, 391, 392, - 395, 400, 401, 397, 408, 428, 1639, 1647, 1667, 1662, - 1622, 1685, 417, 428, 437, 426, 425, 476, 1638, 1637, - - 1622, 1620, 420, 421, 1620, 1618, 423, 433, 424, 435, - 434, 1632, 490, 436, 501, 1631, 458, 448, 511, 515, - 449, 459, 451, 489, 462, 479, 517, 487, 485, 484, - 481, 502, 1655, 1650, 1610, 1673, 1640, 1648, 1621, 1669, - 1714, 496, 520, 509, 1622, 1621, 559, 1601, 1612, 1601, - 569, 500, 1598, 1602, 1615, 521, 510, 1614, 526, 1599, - 516, 583, 532, 529, 1612, 588, 592, 600, 557, 534, - 558, 559, 563, 564, 566, 568, 567, 518, 572, 574, - 570, 578, 582, 579, 609, 588, 590, 603, 1625, 1633, - 1606, 1654, 1628, 1614, 1588, 1604, 616, 1603, 1591, 652, - - 1582, 657, 600, 1600, 1714, 1592, 665, 1598, 622, 1578, - 1596, 1587, 623, 1594, 674, 682, 631, 614, 639, 640, - 482, 625, 641, 596, 645, 646, 649, 651, 653, 654, - 655, 656, 660, 662, 666, 663, 687, 675, 680, 688, - 1614, 1600, 1574, 0, 1607, 1580, 682, 698, 730, 1573, - 1714, 681, 738, 746, 696, 1587, 1714, 1585, 689, 758, - 1570, 705, 715, 707, 708, 717, 709, 697, 1584, 723, - 724, 726, 728, 729, 730, 731, 732, 736, 735, 742, - 738, 744, 740, 746, 756, 0, 1600, 1573, 0, 1593, - 1564, 1579, 753, 809, 813, 1714, 1564, 770, 1563, 752, - - 1559, 1575, 1565, 774, 772, 773, 775, 778, 782, 784, - 829, 786, 788, 791, 792, 793, 795, 797, 800, 846, - 798, 804, 805, 806, 808, 1573, 0, 1584, 1555, 1583, - 1550, 827, 1561, 1567, 1547, 1565, 1714, 1560, 820, 830, - 837, 1563, 828, 831, 832, 879, 1601, 848, 1561, 833, - 836, 843, 840, 844, 842, 874, 886, 885, 1560, 855, - 858, 894, 879, 863, 1572, 1539, 1601, 1547, 888, 1714, - 1714, 928, 868, 869, 872, 873, 878, 928, 1594, 1714, - 891, 889, 898, 915, 935, 1554, 937, 1553, 1552, 1551, - 1550, 900, 936, 910, 942, 1549, 916, 913, 1592, 1538, - - 941, 1531, 930, 971, 985, 923, 929, 934, 947, 949, - 958, 965, 966, 967, 954, 957, 961, 968, 963, 970, - 983, 986, 987, 974, 1009, 1008, 978, 1545, 1544, 1543, - 979, 980, 1004, 1527, 1540, 1535, 1534, 1533, 1523, 997, - 1045, 1714, 985, 991, 988, 1004, 1010, 1011, 1014, 1016, - 1018, 1020, 1021, 1024, 1025, 1026, 1031, 1033, 1035, 1039, - 1041, 1536, 1535, 1028, 1037, 1043, 1533, 1528, 1527, 1526, - 1516, 1508, 1510, 1522, 1521, 1552, 1524, 1523, 1059, 1046, - 1047, 1050, 1048, 1052, 1053, 1058, 1060, 990, 1062, 1086, - 1066, 1068, 1069, 1070, 1075, 1074, 1090, 1080, 1081, 1501, - - 1503, 1515, 1514, 1545, 1512, 1513, 1559, 1558, 0, 1087, - 1089, 1093, 1092, 1095, 1096, 1097, 1098, 1099, 1102, 1513, - 1103, 1104, 1105, 1106, 1108, 1109, 1111, 1112, 1100, 1121, - 1122, 1507, 1508, 1554, 1553, 0, 1507, 1490, 1531, 1504, - 0, 1129, 1124, 1131, 1497, 1487, 1133, 1134, 1135, 1136, - 1477, 1467, 1137, 1457, 1138, 1139, 1143, 1144, 1447, 1160, - 1142, 1147, 1436, 1410, 1442, 1406, 0, 1368, 1371, 1367, - 1357, 1161, 1162, 1164, 1355, 1351, 1331, 1327, 1165, 1317, - 1313, 1312, 1309, 1166, 1167, 1184, 1289, 1289, 1272, 1271, - 1264, 1262, 1256, 1247, 1172, 1173, 1169, 1175, 1177, 1176, - - 1181, 1242, 1243, 1239, 1238, 0, 1235, 1238, 1236, 1249, - 1188, 1248, 1185, 1247, 1193, 1186, 0, 1224, 1198, 1131, - 0, 1131, 0, 0, 1196, 1199, 1214, 1201, 0, 994, - 0, 0, 977, 0, 0, 1202, 1217, 1206, 1204, 907, - 0, 0, 603, 1222, 1210, 1220, 550, 427, 0, 1224, - 1221, 1209, 0, 0, 1227, 1228, 1229, 0, 1215, 1234, - 353, 1235, 1236, 154, 1252, 1239, 1242, 1241, 1246, 127, - 1714, 1310, 1315, 1319, 1327, 1334, 1344, 1353, 1363, 1368, - 1377, 1387, 1396, 1405, 1415, 1424, 1433, 1443, 1453, 1463, - 1473, 1483, 1493, 1503, 1513, 1523, 1533, 1543 - + 0, 90, 4604, 4605, 4605, 4605, 4572, 89, 4571, 87, + 4540, 97, 4605, 101, 93, 95, 4582, 103, 117, 134, + 4571, 83, 4567, 84, 61, 4533, 85, 64, 83, 87, + 4605, 117, 4605, 4565, 107, 98, 99, 101, 100, 106, + 111, 118, 121, 82, 138, 126, 128, 122, 147, 135, + 150, 148, 158, 135, 236, 4605, 4605, 213, 215, 4522, + 4605, 181, 4605, 188, 4605, 4563, 4605, 186, 205, 248, + 4605, 4605, 207, 4565, 220, 215, 268, 4605, 4513, 4605, + 4605, 4605, 4605, 4577, 4572, 4605, 0, 4605, 265, 275, + 241, 322, 242, 289, 299, 344, 4605, 4558, 4605, 4605, + + 4605, 4557, 4523, 181, 230, 219, 290, 197, 286, 308, + 4605, 4583, 4605, 272, 336, 199, 267, 268, 254, 211, + 213, 316, 309, 311, 201, 312, 315, 319, 338, 339, + 320, 263, 341, 342, 343, 348, 349, 4521, 350, 356, + 358, 367, 357, 362, 364, 377, 379, 375, 380, 384, + 382, 385, 352, 383, 4605, 4553, 464, 4605, 449, 4564, + 4509, 4520, 468, 471, 410, 455, 300, 443, 4605, 4605, + 451, 4552, 4551, 449, 450, 452, 4500, 4605, 4605, 0, + 499, 518, 531, 549, 559, 604, 470, 580, 4605, 4605, + 438, 436, 273, 4549, 4512, 450, 4605, 437, 421, 418, + + 4511, 428, 451, 430, 449, 425, 423, 445, 495, 469, + 485, 434, 502, 496, 497, 523, 526, 612, 527, 346, + 524, 581, 4510, 4509, 529, 582, 530, 532, 568, 546, + 583, 555, 571, 570, 585, 531, 591, 629, 594, 483, + 595, 598, 614, 602, 597, 618, 619, 663, 4508, 4605, + 685, 633, 638, 0, 667, 4518, 4517, 4489, 4484, 726, + 668, 664, 679, 4484, 727, 735, 745, 790, 4528, 673, + 755, 674, 625, 668, 0, 785, 675, 677, 650, 680, + 736, 4501, 648, 719, 4500, 782, 724, 669, 734, 758, + 727, 729, 4499, 726, 757, 767, 730, 769, 832, 774, + + 797, 784, 728, 869, 599, 780, 812, 678, 802, 776, + 731, 811, 779, 804, 800, 813, 821, 4498, 824, 818, + 4533, 814, 831, 825, 832, 835, 838, 840, 839, 916, + 830, 843, 841, 848, 859, 861, 863, 862, 865, 868, + 875, 874, 876, 879, 906, 0, 928, 4507, 4506, 887, + 904, 4489, 4500, 4499, 4479, 4485, 922, 931, 930, 4469, + 963, 943, 974, 909, 938, 929, 0, 4488, 910, 907, + 939, 953, 944, 964, 954, 947, 950, 945, 951, 4487, + 1028, 952, 946, 1032, 4486, 1037, 979, 980, 981, 956, + 982, 4485, 983, 986, 4469, 980, 4469, 992, 993, 994, + + 995, 997, 1071, 1000, 999, 1002, 1007, 1005, 1018, 1020, + 1021, 1003, 4482, 1024, 1022, 1026, 1028, 1033, 1034, 1105, + 1040, 1050, 1061, 4481, 1048, 1047, 1057, 1058, 1059, 1063, + 1069, 1133, 1027, 4480, 1076, 1146, 1157, 1079, 1067, 1089, + 1099, 1091, 1093, 1111, 1101, 1102, 1104, 1103, 1116, 1112, + 1110, 1123, 1118, 1146, 4474, 4485, 4484, 1123, 4506, 4501, + 4455, 0, 0, 4468, 4454, 1166, 1168, 1167, 4605, 1190, + 1182, 1200, 1177, 1167, 1168, 1176, 1181, 1194, 1171, 1188, + 1183, 1175, 1218, 4471, 4470, 4460, 4454, 1179, 1180, 1257, + 1263, 4605, 1211, 4467, 4466, 1189, 1206, 4465, 1269, 4464, + + 4449, 4447, 4454, 4441, 1205, 1213, 1219, 1216, 1221, 4444, + 4444, 4442, 4447, 4441, 1217, 1220, 1222, 1228, 1223, 1224, + 1142, 4454, 1226, 1232, 1239, 1227, 1310, 1252, 1237, 1321, + 1253, 1254, 1256, 1246, 1334, 4453, 1284, 4452, 4432, 4431, + 4429, 1268, 1338, 1266, 1281, 1280, 1350, 1292, 1271, 1361, + 1367, 1282, 1303, 1295, 1298, 1317, 1344, 1314, 1065, 1373, + 1321, 1319, 1320, 1325, 1347, 1358, 4448, 4477, 4472, 4426, + 0, 0, 952, 4462, 4471, 4439, 0, 0, 4428, 4434, + 1363, 1369, 1427, 1422, 1397, 1442, 1360, 1356, 1363, 1375, + 1387, 1392, 1389, 4439, 4438, 1191, 1475, 4430, 4417, 1393, + + 1408, 1480, 1369, 4435, 1390, 1485, 4427, 4415, 4418, 4422, + 1489, 1432, 1406, 1388, 4430, 4408, 4408, 4413, 4419, 4406, + 1433, 1498, 1434, 1440, 1446, 4424, 1447, 1443, 4423, 1518, + 1448, 1524, 1460, 1449, 1466, 4408, 4412, 4406, 1451, 1469, + 1312, 1509, 1539, 1500, 1483, 1470, 1487, 1485, 4419, 1512, + 4398, 4397, 4398, 4416, 1582, 1490, 4414, 1492, 1588, 1499, + 4413, 1592, 1606, 1621, 1511, 1535, 1555, 1538, 1514, 1549, + 1563, 1557, 1564, 1566, 1567, 1524, 1571, 1573, 1568, 1574, + 1576, 1603, 1580, 1583, 1587, 4448, 4429, 4438, 4406, 0, + 0, 1651, 4434, 4418, 4388, 4400, 4403, 1620, 1630, 1666, + + 4605, 4439, 1661, 1643, 1671, 1613, 1626, 4402, 4401, 1481, + 1636, 4400, 1635, 1699, 1600, 1641, 4385, 4389, 1642, 1644, + 1719, 1724, 4433, 4605, 1649, 1672, 4396, 4383, 4374, 4388, + 4378, 1738, 4371, 4385, 4382, 1742, 1652, 1645, 1673, 1752, + 1666, 1685, 4386, 1756, 4380, 4372, 4376, 1674, 1762, 1698, + 1705, 1770, 1712, 1706, 1716, 4384, 1784, 1714, 1727, 4371, + 1715, 4382, 1728, 4361, 4373, 4360, 1794, 1729, 1736, 4605, + 4378, 4369, 4362, 4360, 4366, 1765, 1601, 1738, 1737, 1740, + 1741, 4355, 4354, 4362, 4369, 1828, 1846, 4369, 1857, 1861, + 4404, 4605, 1866, 1870, 1889, 4367, 1747, 1744, 1756, 1814, + + 1816, 1772, 1760, 1817, 1831, 1832, 1833, 1821, 1780, 1835, + 1838, 1839, 1840, 1842, 1843, 1845, 1394, 1749, 1847, 1876, + 4392, 4376, 4346, 1913, 0, 4385, 4353, 4347, 4357, 1920, + 1933, 1932, 1908, 1879, 1513, 1881, 1867, 4350, 4344, 1899, + 1898, 4352, 4349, 1903, 1849, 0, 1880, 1864, 4354, 4336, + 4340, 4343, 4336, 4341, 4335, 1974, 4344, 4333, 1902, 1919, + 1901, 1983, 1925, 1927, 1997, 1928, 4334, 4336, 4330, 2004, + 4338, 4335, 1946, 1940, 1929, 2015, 1949, 1930, 1950, 1957, + 1952, 4341, 4328, 1958, 2029, 4324, 1959, 1960, 2036, 4324, + 4328, 2042, 1962, 1972, 1984, 1978, 4327, 4334, 4314, 4319, + + 4317, 1987, 1988, 2079, 1991, 1990, 1992, 4326, 4325, 4315, + 4375, 2099, 2103, 4363, 4605, 2092, 4358, 0, 2111, 2022, + 1999, 2000, 2012, 2045, 2131, 4310, 2021, 2010, 2054, 2046, + 2047, 2073, 1994, 2056, 4324, 2062, 2074, 2075, 2077, 2080, + 2081, 2083, 2084, 2085, 2094, 1909, 2086, 2090, 2088, 2102, + 0, 4345, 4313, 2107, 0, 4337, 4304, 4299, 4313, 2115, + 4317, 4316, 2110, 2108, 4308, 4295, 2112, 2109, 4309, 4298, + 4311, 2116, 2193, 4310, 2119, 4290, 4287, 4291, 4291, 4291, + 4297, 4284, 4293, 4287, 2201, 4295, 2122, 2135, 2127, 2137, + 2124, 2207, 2150, 2151, 2152, 4294, 4291, 4278, 4282, 4286, + + 4280, 4289, 4278, 4291, 2154, 2155, 2160, 2162, 2163, 2232, + 2161, 4275, 2167, 2236, 2178, 4269, 2179, 2181, 4279, 4273, + 4281, 4278, 2184, 2183, 2185, 2186, 4270, 4265, 2254, 4275, + 4263, 2188, 4280, 2265, 2196, 2199, 2276, 2209, 2210, 4278, + 4277, 4270, 4250, 0, 4307, 2283, 2295, 4274, 4265, 4258, + 4256, 4262, 2238, 2227, 2225, 2237, 2231, 4260, 2257, 2242, + 2240, 2249, 2248, 2125, 2250, 2252, 2320, 1653, 2254, 2262, + 2275, 2272, 2278, 2270, 2334, 2280, 2274, 2279, 2294, 2281, + 2290, 0, 4284, 4251, 2315, 4283, 4245, 4263, 4605, 2330, + 2318, 4263, 4248, 4252, 2306, 2308, 4605, 4255, 2309, 2383, + + 2316, 4240, 4255, 4245, 4242, 4248, 4240, 4244, 4245, 4232, + 4235, 4241, 4244, 2387, 2314, 2310, 2329, 2331, 2332, 2335, + 2413, 4605, 4233, 4237, 4225, 4237, 4224, 2417, 4237, 2333, + 2337, 2421, 2349, 2364, 2427, 2369, 2341, 4221, 2370, 4228, + 2371, 4220, 2375, 4238, 4230, 4217, 4231, 4220, 2374, 2372, + 2438, 2380, 4213, 4605, 4217, 4223, 2452, 4210, 2420, 2384, + 2394, 2461, 2396, 2397, 2476, 4229, 4215, 4214, 4230, 4255, + 2489, 2505, 2510, 4215, 4222, 4202, 4207, 4205, 2404, 2405, + 2517, 2424, 2419, 4215, 2433, 2435, 2026, 2422, 4218, 2439, + 2462, 2463, 2530, 4268, 2483, 4216, 2452, 2477, 2479, 2480, + + 2466, 2441, 1285, 2507, 4215, 2488, 2482, 2532, 2490, 2520, + 2493, 4231, 4193, 2499, 4271, 4202, 4190, 2513, 2528, 2530, + 4204, 4201, 2505, 2500, 4203, 4206, 4205, 2599, 4184, 4202, + 2603, 2607, 4197, 4194, 4186, 4190, 4184, 4182, 2611, 2615, + 2506, 2519, 2512, 2521, 2518, 2527, 2557, 2558, 2621, 2563, + 2565, 4191, 4188, 2628, 4180, 4184, 4178, 4187, 2570, 2571, + 2641, 2522, 2572, 2583, 2577, 2575, 2652, 4171, 2625, 4174, + 2587, 4224, 4605, 2624, 4173, 4177, 2661, 4180, 2603, 2597, + 2671, 2605, 2613, 4222, 4169, 4167, 4167, 4165, 2703, 2646, + 2614, 2620, 2596, 2615, 2715, 2618, 4605, 4605, 4226, 2725, + + 4164, 4159, 2733, 4169, 4157, 2631, 4174, 2737, 2622, 2650, + 2746, 2639, 2753, 2645, 4173, 2657, 2668, 2697, 2699, 2747, + 4223, 4605, 2695, 2716, 2718, 2761, 4171, 2742, 4170, 4169, + 4168, 4167, 2702, 2726, 2750, 2753, 4166, 2710, 2715, 2727, + 4224, 4155, 2825, 2763, 4148, 4153, 4161, 2738, 2740, 4156, + 4145, 4158, 2717, 4605, 2845, 4137, 4147, 4141, 4150, 4139, + 4147, 4144, 4143, 4131, 4133, 4139, 2732, 2741, 4146, 2754, + 2733, 2734, 2857, 2744, 2787, 2788, 4133, 4112, 4106, 4090, + 4088, 4075, 4051, 2866, 4060, 2808, 2802, 2781, 2810, 2811, + 4049, 2877, 2812, 4074, 4605, 3996, 2819, 2827, 4000, 3976, + + 3951, 3960, 2829, 2820, 2830, 2901, 4003, 3955, 3937, 3934, + 3939, 3938, 3945, 2905, 2831, 3944, 2847, 2835, 3948, 3922, + 4605, 3916, 3901, 2920, 3882, 2837, 2848, 2849, 2927, 2856, + 2863, 2933, 2941, 2946, 2876, 2395, 2883, 2888, 2896, 2908, + 2911, 2916, 2918, 2902, 2904, 2912, 2914, 2924, 2927, 2937, + 2938, 2921, 2941, 2963, 2925, 3901, 3900, 3899, 2926, 2928, + 2944, 2958, 3877, 3041, 3890, 3885, 3884, 3880, 3870, 3868, + 2974, 2853, 4605, 3877, 2945, 3876, 3873, 3860, 4605, 3867, + 3867, 3856, 3016, 3849, 3844, 3832, 2950, 2951, 2958, 3843, + 2961, 3029, 2997, 3842, 2952, 2998, 4605, 3835, 3831, 3818, + + 3829, 3818, 4605, 3817, 2971, 2999, 3002, 3079, 3021, 3003, + 3811, 3001, 3014, 3825, 3814, 3807, 3091, 3823, 3022, 3822, + 3104, 3034, 4605, 3111, 3801, 4605, 3813, 3799, 3115, 3000, + 3818, 3119, 3817, 3806, 3833, 3777, 3775, 3773, 3771, 3123, + 3065, 3066, 3067, 3004, 3069, 3136, 3070, 3148, 4605, 3078, + 3090, 3080, 2973, 3096, 3035, 3046, 3071, 3081, 3098, 3091, + 3102, 3103, 3107, 3110, 3114, 3116, 3118, 3776, 3772, 3112, + 3120, 3104, 3124, 3770, 3756, 3752, 3751, 3738, 3754, 3744, + 3209, 3190, 3715, 3707, 3717, 3716, 3754, 3703, 3165, 3713, + 3708, 3708, 3202, 3693, 3697, 3701, 4605, 3699, 3688, 4605, + + 3686, 3658, 3131, 3137, 3674, 3166, 3167, 3244, 3169, 3667, + 3656, 3660, 3252, 3663, 3647, 66, 3194, 3172, 3257, 3186, + 3209, 172, 353, 4605, 3201, 4605, 449, 4605, 530, 3210, + 3202, 656, 4605, 3277, 4605, 3211, 3288, 3219, 727, 808, + 808, 834, 894, 1598, 1690, 1764, 3299, 3203, 1788, 3224, + 3212, 1877, 3248, 3234, 3241, 3242, 3243, 3247, 3249, 3255, + 3245, 3253, 3251, 3257, 3262, 3264, 3270, 3271, 3272, 3294, + 3277, 3278, 3279, 1983, 2178, 2213, 2248, 2378, 2528, 3348, + 2597, 3352, 2638, 3413, 3373, 3342, 2662, 2666, 2816, 2891, + 0, 3317, 4605, 2872, 2927, 4605, 2968, 3078, 3362, 3105, + + 3304, 3293, 3133, 3298, 3380, 3295, 3135, 4605, 3166, 3173, + 3174, 3200, 4605, 3322, 3309, 3296, 3389, 3220, 3279, 3265, + 3306, 3314, 3301, 3310, 3325, 3371, 4605, 4605, 3395, 3311, + 4605, 3330, 3318, 3402, 3369, 3344, 3447, 3346, 3347, 3390, + 3383, 3393, 3400, 3376, 3399, 3401, 3402, 3403, 3373, 3406, + 3413, 3404, 3405, 3416, 3424, 3426, 3396, 3375, 3427, 3425, + 3424, 3427, 3490, 3491, 0, 3494, 3496, 3436, 3420, 3469, + 3442, 0, 3463, 3442, 3434, 4605, 3442, 3435, 4605, 3451, + 3452, 3453, 3454, 3451, 3444, 3439, 3526, 3460, 3469, 3461, + 3532, 3462, 4605, 4605, 3468, 3457, 3478, 3479, 3465, 4605, + + 3543, 4605, 3485, 3548, 3490, 3492, 3494, 3496, 3497, 3498, + 3500, 3502, 3503, 3505, 3501, 3506, 3507, 3508, 3509, 3510, + 3511, 3512, 3519, 3513, 3528, 3513, 3511, 3560, 3530, 0, + 3512, 3525, 3524, 3525, 3538, 4605, 3534, 4605, 3526, 3542, + 3543, 4605, 3539, 4605, 3531, 3547, 3548, 4605, 4605, 3535, + 3539, 3554, 3555, 3556, 3558, 3560, 3559, 3562, 3563, 3564, + 3565, 3566, 3569, 3570, 3571, 3572, 3595, 3558, 3570, 3568, + 3569, 3563, 3567, 3565, 3566, 3582, 3580, 3588, 3590, 3587, + 3572, 3593, 3594, 3589, 3577, 3598, 3599, 3600, 3601, 3602, + 3603, 3604, 3605, 3589, 3593, 3591, 3592, 0, 3592, 3598, + + 3599, 4605, 4605, 4605, 4605, 4605, 4605, 3616, 3617, 3619, + 3621, 3622, 3625, 0, 3603, 3614, 3615, 0, 3622, 0, + 0, 3632, 3651, 3634, 0, 3626, 0, 0, 3621, 0, + 0, 3639, 3637, 3640, 3626, 0, 0, 3628, 3661, 3645, + 3644, 3632, 0, 3649, 3654, 0, 0, 3656, 3658, 0, + 3657, 3660, 3662, 3663, 4605, 3741, 3752, 3762, 3767, 3772, + 3776, 3787, 3791, 3802, 3806, 3811, 3822, 3826, 3837, 3841, + 3845, 3856, 3867, 3877, 3887, 3897, 3908, 3919, 3929, 3939, + 3949, 3959, 3970, 3717, 3981, 3718, 3992, 4002, 3719, 4012, + 4022, 4033, 4044, 4055, 4066, 4077, 4088, 4099, 4110, 4121, + + 4132, 4143, 4154, 4165, 4176, 4187, 4198 } ; -static yyconst flex_int16_t yy_def[799] = +static yyconst flex_int16_t yy_def[2008] = { 0, - 771, 1, 771, 771, 771, 771, 772, 771, 771, 773, - 774, 774, 775, 771, 774, 774, 774, 774, 774, 774, - 774, 774, 774, 774, 774, 774, 771, 771, 771, 776, - 771, 772, 771, 777, 773, 773, 773, 774, 774, 774, - 775, 778, 774, 774, 774, 774, 774, 774, 774, 774, - 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, - 774, 774, 774, 771, 771, 771, 776, 771, 779, 771, - 777, 773, 774, 771, 778, 771, 774, 774, 774, 774, - 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, - 774, 774, 774, 774, 774, 774, 774, 780, 781, 779, - - 779, 779, 773, 774, 774, 774, 774, 774, 774, 774, - 774, 774, 774, 771, 774, 774, 774, 774, 774, 774, - 774, 774, 774, 774, 774, 774, 774, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 781, - 781, 781, 779, 779, 779, 773, 774, 774, 774, 774, - 774, 774, 774, 774, 774, 771, 771, 774, 774, 771, - 774, 774, 774, 774, 774, 774, 774, 774, 774, 774, - 774, 771, 771, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 781, 781, 781, 779, 779, - 779, 782, 773, 774, 774, 774, 774, 771, 774, 774, - - 771, 771, 774, 774, 771, 771, 774, 774, 774, 774, - 774, 774, 771, 774, 774, 774, 774, 774, 771, 783, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 781, 781, 781, 784, 779, 779, 779, 782, - 771, 773, 774, 774, 774, 774, 771, 771, 771, 771, - 774, 774, 771, 771, 774, 774, 774, 774, 774, 771, - 774, 771, 774, 774, 774, 771, 771, 783, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 781, 781, - 781, 784, 779, 779, 779, 773, 774, 774, 771, 771, - - 771, 771, 774, 774, 771, 771, 774, 774, 774, 771, - 774, 771, 774, 774, 771, 771, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 781, 781, 781, 785, 779, 779, 774, 774, 786, 771, - 771, 774, 771, 771, 774, 774, 771, 771, 774, 771, - 771, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 787, 781, 781, 785, 779, - 779, 774, 774, 771, 786, 771, 771, 774, 771, 774, - - 771, 774, 771, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 787, 781, 781, 779, - 779, 774, 771, 774, 771, 774, 771, 771, 780, 780, - 780, 780, 780, 780, 780, 771, 788, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 781, 781, 779, 779, 774, 771, - 771, 771, 780, 780, 780, 780, 780, 780, 788, 771, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 781, 781, - - 779, 779, 774, 771, 771, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 781, 781, 779, 779, 779, 779, 779, 774, - 771, 771, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 781, 781, 781, 781, - 781, 779, 779, 779, 779, 779, 774, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 781, - - 781, 781, 781, 781, 779, 779, 779, 779, 789, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 781, 781, 781, 781, 790, 779, 779, 779, 779, - 789, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 781, 781, 781, 781, 790, 779, 779, 779, - 779, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 781, 781, 781, 781, - 779, 779, 779, 779, 780, 780, 780, 780, 780, 780, - - 780, 781, 781, 781, 781, 791, 779, 779, 779, 780, - 780, 780, 780, 780, 780, 780, 792, 781, 781, 781, - 791, 779, 793, 794, 780, 780, 780, 780, 792, 781, - 795, 796, 779, 793, 794, 780, 780, 780, 780, 781, - 795, 796, 779, 780, 780, 780, 780, 781, 797, 780, - 780, 780, 798, 797, 780, 780, 780, 798, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 0, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771 - + 1955, 1, 1955, 1955, 1955, 1955, 1955, 1956, 1955, 1955, + 1957, 1958, 1955, 1955, 1955, 1955, 1955, 1955, 1959, 1960, + 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1955, 1955, 1955, 1955, 1962, 1955, 1955, + 1955, 1956, 1955, 1956, 1955, 1955, 1955, 1957, 1957, 1958, + 1955, 1955, 1963, 1963, 1963, 1963, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1964, 1955, 1965, 1966, + 1959, 1959, 1959, 1960, 1960, 1960, 1955, 1955, 1955, 1955, + + 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, 1962, 1955, + 1955, 1962, 1962, 1962, 1962, 1967, 1955, 1956, 1955, 1955, + 1957, 1963, 1955, 1963, 1963, 1963, 1955, 1955, 1955, 1964, + 1965, 1965, 1965, 1966, 1966, 1968, 1959, 1960, 1955, 1955, + 1961, 1961, 1961, 1955, 1961, 1961, 1955, 1961, 1961, 1961, + + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1955, + 1969, 1962, 1962, 1967, 1967, 1967, 1967, 1955, 1955, 1958, + 1963, 1963, 1963, 1955, 1955, 1965, 1966, 1968, 268, 1959, + 1960, 1961, 1961, 1961, 1970, 1971, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1955, 1961, + + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1969, 1969, 1969, 1969, 1962, + 1967, 1967, 1967, 1967, 1955, 1955, 1963, 1963, 1963, 1955, + 1966, 1959, 1960, 1961, 1961, 1961, 1970, 1971, 1971, 1971, + 1971, 1971, 1971, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1961, 1961, 1961, + + 1961, 1961, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1955, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1955, 1955, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1969, 1969, 1969, 1969, 1962, 1967, 1967, + 1967, 1972, 1973, 1955, 1955, 1963, 1963, 1963, 1955, 1966, + 1959, 1960, 1961, 1961, 1961, 1971, 1971, 1971, 1971, 1961, + 1961, 1961, 1961, 1961, 1961, 1955, 1955, 1961, 1961, 1974, + 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + + 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1955, + 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1955, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1955, 1955, + 1955, 1961, 1961, 1961, 1961, 1961, 1975, 1961, 1961, 1955, + 1976, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1969, 1969, 1969, + 1977, 1978, 1962, 1967, 1967, 1967, 1972, 1973, 1955, 1955, + 1963, 1963, 1963, 1966, 1959, 1960, 1961, 1961, 1961, 1971, + 1971, 1971, 1971, 1961, 1961, 1961, 1961, 1955, 1955, 1961, + + 1961, 1979, 1961, 1961, 1961, 1955, 1955, 1955, 1955, 1955, + 1961, 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, 1955, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1955, 1961, 1961, 1961, 1955, 1955, 1955, 1961, 1961, + 1961, 1961, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1955, 1955, 1955, 1955, 1980, 1961, 1961, 1961, 1981, 1961, + 1961, 1955, 1955, 1976, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1955, 1969, 1969, 1969, 1977, + 1978, 1962, 1967, 1967, 1967, 1955, 1955, 1963, 1963, 1955, + + 1955, 1963, 1966, 1959, 1960, 1961, 1961, 1961, 1971, 1971, + 1971, 1971, 1961, 1955, 1961, 1961, 1955, 1955, 1961, 1961, + 1955, 1979, 1955, 1955, 1961, 1961, 1961, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, + 1961, 1961, 1955, 1955, 1955, 1955, 1955, 1961, 1955, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1955, 1961, 1961, 1955, + 1961, 1961, 1961, 1955, 1955, 1955, 1961, 1961, 1961, 1955, + 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, + 1961, 1955, 1955, 1955, 1955, 1982, 1961, 1961, 1955, 1981, + 1955, 1955, 1961, 1955, 1955, 1961, 1961, 1961, 1961, 1961, + + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1969, 1969, 1969, 1962, 1983, 1967, 1967, 1955, 1955, 1963, + 1963, 1966, 1971, 1971, 1971, 1971, 1961, 1955, 1955, 1961, + 1961, 1955, 1955, 1961, 1961, 1984, 1961, 1961, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1961, 1961, + 1961, 1955, 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, + 1955, 1955, 1961, 1961, 1961, 1955, 1961, 1961, 1961, 1961, + 1961, 1961, 1955, 1961, 1961, 1955, 1961, 1961, 1955, 1955, + 1955, 1955, 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, + + 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1955, 1955, 1955, + 1955, 1955, 1982, 1955, 1955, 1955, 1985, 1986, 1955, 1961, + 1961, 1961, 1961, 1961, 1955, 1955, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1987, 1969, 1969, 1962, 1983, 1967, 1967, 1955, 1955, 1971, + 1971, 1971, 1971, 1961, 1955, 1955, 1961, 1961, 1955, 1955, + 1961, 1961, 1988, 1961, 1961, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, + 1961, 1955, 1961, 1961, 1961, 1955, 1955, 1955, 1955, 1955, + + 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1955, 1961, 1955, 1961, 1955, 1961, 1961, 1955, 1955, + 1955, 1955, 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, + 1955, 1961, 1961, 1955, 1961, 1961, 1961, 1961, 1961, 1955, + 1955, 1955, 1955, 1989, 1985, 1955, 1990, 1955, 1955, 1955, + 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1955, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1987, 1969, 1969, 1962, 1967, 1967, 1955, 1955, 1971, + 1971, 1961, 1955, 1955, 1961, 1961, 1955, 1955, 1961, 1988, + + 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1961, + 1961, 1961, 1961, 1961, 1955, 1961, 1961, 1955, 1961, 1955, + 1961, 1955, 1961, 1961, 1955, 1955, 1955, 1955, 1961, 1961, + 1961, 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1961, 1961, + 1961, 1955, 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, + 1991, 1955, 1990, 1955, 1955, 1955, 1955, 1955, 1961, 1961, + 1961, 1961, 1961, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1955, 1992, 1961, 1961, 1961, 1961, 1961, 1961, + + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1969, 1969, 1962, 1967, 1967, 1955, 1971, 1971, 1961, + 1955, 1955, 1961, 1961, 1955, 1961, 1961, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1955, 1961, + 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1961, 1961, + 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1955, 1961, 1955, + 1961, 1955, 1955, 1961, 1955, 1955, 1955, 1955, 1961, 1961, + 1955, 1961, 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1961, + 1961, 1961, 1961, 1961, 1955, 1961, 1955, 1955, 1955, 1991, + + 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1955, 1961, 1961, + 1961, 1961, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1992, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1969, 1969, 1993, 1967, 1967, 1955, 1971, 1971, 1961, 1955, + 1955, 1961, 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1955, 1961, 1955, 1955, 1955, 1961, 1961, 1955, 1955, + + 1955, 1955, 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, + 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1955, 1961, + 1961, 1961, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1969, 1969, 1994, 1967, 1967, 1967, 1967, 1967, 1955, + 1971, 1971, 1955, 1955, 1961, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, + 1961, 1955, 1961, 1961, 1961, 1961, 1955, 1955, 1955, 1955, + + 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1955, 1961, 1961, 1955, 1955, 1955, 1955, 1961, 1961, 1961, + 1955, 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1961, + 1961, 1961, 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1961, 1961, 1961, 1961, 1961, 1955, 1961, 1955, 1955, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1969, 1969, 1969, 1969, 1969, 1995, 1996, + 1997, 1995, 1967, 1967, 1967, 1967, 1967, 1955, 1971, 1971, + 1955, 1961, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + + 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1955, + 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1955, 1961, + 1961, 1961, 1955, 1955, 1961, 1955, 1955, 1955, 1955, 1961, + 1961, 1955, 1955, 1955, 1955, 1961, 1955, 1961, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1969, 1969, 1969, 1969, 1969, 1995, 1995, + 1996, 1996, 1995, 1997, 1995, 1995, 1967, 1967, 1967, 1967, + 1998, 1971, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + + 1961, 1961, 1961, 1961, 1955, 1961, 1961, 1955, 1955, 1955, + 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1955, 1955, + 1961, 1961, 1955, 1955, 1961, 1961, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1969, 1969, 1969, 1969, 1999, 1995, 1996, 1967, 1967, 1967, + 1967, 1998, 1971, 1955, 1955, 1955, 1955, 1955, 1955, 1961, + 1961, 1961, 1961, 1955, 1955, 1955, 1955, 1961, 1961, 1961, + 1955, 1961, 1955, 1955, 1955, 1955, 1961, 1961, 1955, 1955, + + 1955, 1955, 1961, 1955, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1969, 1969, 1969, 1969, 1999, + 1967, 1967, 1967, 1967, 1971, 1955, 1955, 1955, 1955, 1961, + 1961, 1955, 1955, 1955, 1955, 1961, 1961, 1955, 1955, 1955, + 1955, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1961, 1961, 1961, 1961, 1969, 1969, 1969, + 1969, 1967, 1967, 1967, 1967, 1955, 1955, 1961, 1961, 1955, + 1955, 1961, 1961, 1955, 1955, 1961, 1961, 1961, 1961, 1961, + 1961, 1961, 1961, 1969, 1969, 1969, 1969, 2000, 1967, 1967, + + 1967, 1955, 1955, 1955, 1955, 1955, 1955, 1961, 1961, 1961, + 1961, 1961, 1961, 2001, 1969, 1969, 1969, 2000, 1967, 2002, + 2003, 1961, 1961, 1961, 2001, 1969, 2004, 2005, 1967, 2002, + 2003, 1961, 1961, 1961, 1969, 2004, 2005, 1967, 1961, 1961, + 1961, 1969, 2006, 1961, 1961, 2007, 2006, 1961, 1961, 2007, + 1961, 1961, 1961, 1961, 0, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + + 1955, 1955, 1955, 1955, 1955, 1955, 1955 } ; -static yyconst flex_int16_t yy_nxt[1788] = +static yyconst flex_int16_t yy_nxt[4697] = { 0, - 4, 5, 6, 5, 5, 7, 4, 8, 8, 8, - 8, 8, 9, 10, 10, 10, 10, 10, 10, 10, - 10, 8, 8, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, - 11, 11, 12, 11, 11, 11, 13, 14, 15, 11, - 16, 17, 18, 11, 19, 11, 11, 20, 11, 11, - 21, 11, 11, 22, 23, 11, 24, 11, 25, 26, - 11, 11, 11, 27, 28, 29, 27, 33, 30, 34, - 41, 41, 41, 41, 31, 35, 35, 35, 35, 35, - 35, 35, 35, 40, 43, 39, 39, 39, 39, 39, - - 39, 39, 39, 39, 46, 39, 57, 58, 47, 39, - 45, 48, 49, 52, 50, 44, 54, 59, 53, 51, - 37, 39, 55, 60, 39, 56, 64, 65, 65, 64, - 61, 33, 72, 69, 43, 73, 62, 66, 39, 79, - 63, 35, 35, 35, 35, 35, 35, 35, 35, 43, - 77, 39, 82, 37, 39, 39, 41, 41, 41, 41, - 74, 74, 74, 74, 39, 80, 39, 81, 39, 39, - 39, 39, 39, 39, 39, 139, 37, 39, 39, 78, - 85, 39, 88, 89, 84, 39, 94, 87, 83, 90, - 39, 86, 91, 92, 39, 39, 39, 39, 101, 95, - - 103, 93, 139, 39, 37, 97, 76, 39, 98, 111, - 39, 112, 96, 64, 65, 65, 64, 106, 102, 74, - 74, 74, 74, 105, 66, 74, 74, 74, 74, 39, - 39, 39, 39, 39, 39, 39, 39, 39, 113, 39, - 39, 107, 114, 114, 114, 114, 117, 108, 39, 109, - 110, 39, 118, 39, 123, 39, 120, 119, 39, 39, - 121, 141, 146, 127, 125, 76, 149, 143, 122, 43, - 39, 76, 124, 37, 39, 147, 39, 126, 39, 39, - 39, 142, 144, 39, 39, 148, 39, 163, 151, 39, - 39, 153, 159, 150, 39, 152, 139, 155, 139, 154, - - 178, 115, 114, 114, 114, 114, 139, 116, 129, 158, - 176, 130, 131, 132, 39, 133, 39, 164, 39, 134, - 39, 170, 222, 135, 136, 165, 137, 138, 160, 160, - 160, 160, 139, 39, 39, 39, 39, 167, 139, 168, - 139, 139, 166, 139, 169, 172, 172, 172, 172, 139, - 139, 139, 173, 174, 177, 180, 171, 139, 179, 185, - 183, 156, 186, 175, 189, 182, 193, 157, 190, 181, - 194, 195, 184, 196, 197, 39, 198, 187, 37, 39, - 139, 39, 39, 39, 161, 39, 200, 162, 39, 39, - 199, 39, 39, 203, 160, 160, 160, 160, 39, 39, - - 39, 139, 207, 39, 204, 39, 39, 39, 211, 212, - 139, 215, 39, 208, 213, 213, 213, 213, 209, 210, - 39, 39, 39, 218, 216, 221, 217, 172, 172, 172, - 172, 139, 139, 225, 173, 219, 219, 219, 219, 139, - 139, 139, 246, 139, 220, 139, 223, 228, 139, 139, - 205, 224, 232, 206, 230, 242, 139, 243, 226, 227, - 244, 39, 231, 233, 229, 37, 245, 234, 39, 39, - 214, 39, 39, 39, 39, 251, 39, 247, 247, 247, - 247, 39, 39, 39, 39, 39, 252, 257, 258, 753, - 255, 213, 213, 213, 213, 256, 39, 139, 261, 139, - - 271, 259, 262, 262, 262, 262, 39, 139, 265, 269, - 139, 264, 219, 219, 219, 219, 266, 266, 266, 266, - 277, 220, 270, 272, 267, 273, 284, 139, 274, 139, - 139, 275, 139, 139, 276, 139, 296, 139, 285, 288, - 366, 287, 278, 297, 37, 248, 298, 260, 39, 39, - 139, 279, 263, 280, 286, 281, 282, 39, 39, 283, - 247, 247, 247, 247, 39, 139, 139, 304, 39, 39, - 302, 302, 302, 302, 39, 308, 307, 39, 326, 309, - 39, 314, 139, 311, 262, 262, 262, 262, 313, 266, - 266, 266, 266, 315, 315, 315, 315, 267, 139, 318, - - 316, 266, 266, 266, 266, 139, 139, 139, 320, 267, - 317, 139, 139, 321, 139, 139, 139, 39, 139, 323, - 139, 327, 139, 329, 328, 319, 139, 139, 248, 303, - 139, 322, 324, 325, 312, 331, 139, 333, 139, 340, - 334, 347, 339, 335, 139, 330, 332, 336, 39, 369, - 337, 139, 338, 302, 302, 302, 302, 139, 302, 302, - 302, 302, 139, 352, 39, 749, 354, 354, 354, 354, - 39, 39, 359, 139, 356, 315, 315, 315, 315, 139, - 362, 363, 316, 360, 360, 360, 360, 139, 139, 139, - 367, 365, 368, 139, 139, 371, 364, 139, 370, 139, - - 372, 139, 139, 139, 139, 384, 376, 374, 139, 373, - 139, 139, 350, 39, 139, 380, 381, 350, 382, 375, - 378, 377, 355, 139, 379, 393, 385, 392, 139, 39, - 39, 394, 394, 394, 394, 139, 139, 39, 383, 354, - 354, 354, 354, 398, 39, 139, 39, 354, 354, 354, - 354, 361, 396, 139, 402, 139, 139, 139, 400, 360, - 360, 360, 360, 139, 410, 139, 409, 404, 405, 406, - 408, 139, 139, 407, 139, 411, 139, 139, 139, 139, - 139, 414, 415, 139, 139, 412, 139, 416, 139, 418, - 139, 413, 139, 421, 139, 399, 426, 432, 417, 419, - - 39, 39, 420, 399, 139, 424, 423, 422, 439, 425, - 394, 394, 394, 394, 394, 394, 394, 394, 39, 436, - 139, 139, 139, 139, 440, 434, 139, 361, 441, 443, - 139, 396, 139, 446, 139, 396, 139, 447, 442, 139, - 139, 139, 450, 139, 444, 139, 139, 445, 139, 455, - 448, 449, 139, 139, 139, 452, 139, 451, 453, 454, - 456, 461, 457, 460, 105, 458, 459, 469, 139, 473, - 474, 464, 462, 463, 475, 39, 139, 139, 139, 139, - 139, 139, 481, 446, 139, 139, 477, 447, 139, 483, - 139, 139, 139, 488, 139, 476, 139, 478, 484, 486, - - 482, 489, 490, 139, 497, 485, 139, 509, 493, 487, - 494, 139, 510, 495, 496, 503, 139, 139, 491, 506, - 139, 139, 139, 517, 492, 529, 139, 139, 498, 504, - 504, 504, 504, 139, 139, 508, 39, 139, 505, 139, - 516, 507, 139, 511, 512, 513, 139, 514, 139, 519, - 520, 521, 522, 525, 523, 528, 526, 527, 139, 530, - 518, 139, 515, 139, 139, 532, 535, 536, 540, 524, - 748, 139, 504, 504, 504, 504, 139, 139, 39, 531, - 537, 505, 139, 139, 139, 139, 541, 541, 543, 541, - 139, 545, 548, 544, 542, 139, 546, 139, 547, 549, - - 550, 551, 139, 552, 557, 139, 139, 538, 553, 139, - 554, 139, 556, 139, 139, 139, 139, 558, 139, 555, - 559, 560, 139, 561, 562, 563, 139, 139, 139, 567, - 568, 139, 577, 139, 139, 139, 139, 566, 139, 139, - 743, 564, 565, 569, 579, 39, 541, 541, 578, 541, - 580, 740, 139, 620, 542, 581, 139, 139, 139, 139, - 583, 582, 139, 584, 139, 585, 139, 586, 139, 139, - 570, 587, 139, 139, 139, 589, 139, 591, 590, 139, - 592, 139, 593, 139, 594, 139, 588, 139, 595, 139, - 597, 139, 596, 610, 139, 139, 139, 611, 139, 615, - - 139, 139, 598, 616, 617, 599, 139, 139, 139, 618, - 139, 622, 613, 612, 139, 614, 139, 139, 139, 624, - 625, 626, 139, 139, 629, 619, 627, 621, 139, 139, - 631, 623, 630, 644, 139, 139, 642, 139, 139, 628, - 139, 139, 643, 139, 139, 139, 139, 139, 139, 660, - 139, 139, 139, 139, 139, 645, 139, 139, 646, 139, - 139, 647, 648, 649, 650, 651, 652, 653, 654, 139, - 139, 655, 139, 656, 657, 659, 658, 139, 661, 139, - 672, 139, 139, 139, 139, 139, 139, 139, 733, 662, - 139, 139, 139, 673, 732, 139, 675, 676, 677, 678, - - 686, 680, 681, 674, 685, 679, 682, 683, 139, 139, - 139, 684, 139, 139, 139, 139, 700, 139, 701, 696, - 139, 139, 712, 139, 139, 139, 695, 698, 697, 139, - 716, 699, 139, 139, 139, 710, 139, 728, 726, 711, - 714, 139, 713, 715, 139, 725, 727, 139, 738, 139, - 139, 737, 139, 745, 139, 746, 750, 139, 139, 736, - 751, 731, 139, 139, 744, 139, 739, 747, 139, 139, - 139, 752, 139, 755, 757, 139, 139, 139, 759, 756, - 762, 760, 139, 139, 139, 763, 766, 139, 767, 139, - 139, 730, 761, 768, 139, 139, 139, 139, 764, 724, - - 139, 723, 722, 765, 720, 719, 769, 718, 717, 770, - 32, 32, 32, 709, 32, 32, 32, 32, 32, 32, - 36, 36, 708, 36, 38, 38, 707, 38, 42, 42, - 706, 705, 704, 42, 67, 67, 67, 67, 67, 67, - 67, 67, 67, 67, 71, 71, 703, 71, 71, 71, - 71, 71, 71, 71, 75, 75, 702, 139, 75, 75, - 139, 139, 75, 100, 100, 139, 100, 100, 100, 100, - 100, 100, 100, 128, 128, 139, 128, 140, 140, 139, - 140, 140, 140, 140, 140, 140, 140, 240, 240, 240, - 240, 240, 240, 240, 240, 240, 240, 268, 268, 139, - - 268, 268, 268, 139, 268, 292, 292, 292, 292, 292, - 292, 292, 292, 292, 292, 389, 389, 694, 389, 389, - 389, 389, 389, 389, 389, 395, 395, 693, 692, 395, - 395, 395, 395, 427, 427, 691, 427, 427, 427, 427, - 427, 427, 427, 479, 479, 479, 479, 479, 479, 479, - 479, 479, 479, 641, 641, 690, 641, 641, 641, 641, - 641, 641, 641, 667, 667, 689, 667, 667, 667, 667, - 667, 667, 667, 721, 721, 688, 721, 721, 721, 721, - 721, 721, 721, 729, 729, 687, 729, 729, 729, 729, - 729, 729, 729, 734, 734, 139, 734, 734, 734, 734, - - 734, 734, 734, 735, 735, 139, 735, 735, 735, 735, - 735, 735, 735, 741, 741, 139, 741, 741, 741, 741, - 741, 741, 741, 742, 742, 139, 742, 742, 742, 742, - 742, 742, 742, 754, 754, 139, 754, 754, 754, 754, - 754, 754, 754, 758, 758, 139, 758, 758, 758, 758, - 758, 758, 758, 671, 670, 669, 668, 666, 665, 664, - 663, 139, 640, 639, 638, 637, 636, 635, 634, 633, - 632, 139, 39, 609, 608, 607, 606, 605, 604, 603, - 602, 601, 600, 139, 139, 576, 575, 574, 573, 572, - 571, 139, 139, 139, 539, 534, 533, 139, 139, 139, - - 139, 139, 139, 480, 502, 501, 500, 499, 139, 139, - 480, 139, 472, 39, 471, 39, 470, 468, 467, 466, - 465, 139, 438, 39, 437, 435, 433, 39, 431, 430, - 429, 428, 139, 403, 401, 39, 397, 391, 390, 388, - 387, 386, 39, 358, 39, 357, 39, 353, 39, 351, - 349, 348, 37, 346, 345, 344, 241, 343, 342, 341, - 39, 310, 39, 39, 306, 305, 301, 300, 299, 39, - 39, 241, 295, 294, 293, 241, 291, 290, 289, 39, - 39, 254, 253, 250, 249, 39, 39, 241, 239, 238, - 237, 236, 235, 202, 201, 39, 39, 192, 191, 188, - - 139, 39, 39, 145, 104, 68, 99, 39, 37, 70, - 68, 39, 771, 3, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771 + 4, 5, 6, 5, 5, 7, 8, 4, 9, 10, + 11, 12, 13, 14, 15, 13, 16, 17, 18, 19, + 20, 20, 20, 20, 20, 20, 20, 21, 13, 22, + 23, 24, 4, 25, 26, 27, 26, 26, 26, 26, + 26, 26, 26, 26, 26, 26, 26, 26, 26, 28, + 26, 26, 26, 26, 29, 30, 26, 26, 26, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 26, 26, 42, 26, 26, 43, 44, 45, 46, 47, + 26, 48, 49, 50, 51, 52, 26, 53, 26, 26, + 54, 55, 56, 57, 55, 63, 66, 58, 70, 70, + + 70, 70, 77, 77, 77, 77, 71, 80, 59, 104, + 72, 82, 98, 99, 101, 102, 86, 67, 106, 111, + 112, 87, 60, 81, 105, 83, 84, 107, 110, 105, + 73, 78, 75, 88, 89, 109, 90, 90, 90, 90, + 90, 90, 90, 90, 114, 105, 105, 108, 105, 64, + 105, 89, 76, 94, 94, 94, 94, 94, 94, 94, + 94, 105, 105, 105, 105, 155, 133, 79, 123, 105, + 115, 118, 120, 92, 105, 116, 121, 119, 124, 122, + 93, 105, 117, 126, 105, 105, 128, 63, 125, 105, + 142, 105, 129, 127, 168, 130, 170, 96, 105, 132, + + 131, 105, 134, 147, 92, 137, 135, 138, 139, 140, + 105, 105, 141, 105, 163, 171, 136, 163, 143, 144, + 151, 105, 191, 148, 194, 156, 152, 149, 86, 145, + 146, 153, 150, 166, 173, 105, 154, 157, 158, 158, + 157, 64, 173, 159, 105, 88, 69, 173, 64, 70, + 70, 70, 70, 175, 160, 174, 176, 71, 1955, 1955, + 105, 72, 105, 192, 105, 69, 201, 114, 161, 77, + 77, 77, 77, 164, 105, 205, 105, 206, 211, 187, + 165, 73, 105, 75, 181, 181, 181, 181, 181, 181, + 181, 181, 89, 105, 90, 90, 90, 90, 90, 90, + + 90, 90, 183, 76, 93, 93, 89, 274, 94, 94, + 94, 94, 94, 94, 94, 94, 1955, 105, 91, 91, + 91, 91, 91, 91, 91, 91, 105, 114, 198, 195, + 105, 105, 204, 183, 79, 105, 105, 193, 185, 1955, + 220, 186, 186, 186, 186, 186, 186, 186, 186, 105, + 202, 203, 96, 105, 196, 186, 186, 186, 186, 186, + 186, 1955, 96, 91, 91, 91, 91, 91, 91, 91, + 91, 105, 105, 114, 105, 105, 258, 259, 105, 105, + 1624, 188, 105, 105, 209, 93, 186, 186, 186, 186, + 186, 186, 207, 208, 213, 210, 212, 215, 214, 105, + + 199, 105, 105, 219, 105, 105, 105, 96, 200, 105, + 216, 105, 105, 105, 217, 105, 304, 225, 222, 105, + 105, 105, 218, 230, 221, 105, 248, 105, 228, 223, + 105, 224, 234, 227, 229, 233, 236, 231, 105, 232, + 105, 237, 105, 105, 238, 105, 105, 105, 105, 63, + 163, 235, 242, 163, 241, 240, 244, 246, 239, 255, + 247, 170, 243, 245, 249, 157, 158, 158, 157, 163, + 164, 159, 163, 162, 252, 272, 173, 173, 253, 173, + 273, 105, 160, 277, 105, 278, 105, 1955, 105, 256, + 261, 105, 257, 105, 262, 280, 161, 105, 263, 105, + + 105, 105, 288, 64, 279, 285, 282, 287, 105, 164, + 293, 69, 105, 105, 105, 283, 165, 1719, 181, 181, + 181, 181, 181, 181, 181, 181, 270, 289, 164, 284, + 286, 164, 105, 93, 291, 165, 183, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 265, 105, 265, 105, 292, + 266, 266, 266, 266, 266, 266, 266, 266, 105, 105, + 105, 296, 324, 290, 295, 105, 1955, 183, 91, 91, + 91, 91, 91, 91, 91, 91, 1955, 294, 91, 91, + 91, 91, 91, 91, 91, 91, 105, 105, 305, 105, + 105, 297, 105, 105, 105, 105, 267, 1955, 298, 91, + + 91, 91, 91, 91, 91, 91, 91, 1720, 303, 105, + 308, 310, 185, 299, 299, 299, 299, 311, 105, 114, + 319, 313, 185, 186, 186, 186, 186, 186, 186, 186, + 186, 105, 315, 105, 105, 162, 271, 186, 186, 186, + 186, 186, 186, 96, 105, 105, 105, 317, 105, 306, + 309, 312, 316, 318, 105, 314, 321, 105, 105, 365, + 105, 105, 105, 325, 409, 105, 322, 269, 186, 186, + 186, 186, 186, 186, 320, 105, 326, 105, 323, 328, + 329, 105, 105, 331, 351, 330, 327, 300, 105, 347, + 1955, 173, 105, 164, 301, 173, 302, 332, 164, 333, + + 334, 335, 336, 352, 337, 357, 173, 350, 358, 338, + 366, 105, 359, 105, 339, 340, 341, 342, 343, 348, + 364, 362, 349, 374, 375, 379, 105, 1955, 1955, 1955, + 1955, 105, 105, 376, 1723, 71, 93, 105, 105, 72, + 105, 105, 412, 105, 385, 344, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 1955, 377, 91, 91, 91, 91, 91, 91, + 91, 91, 1955, 114, 91, 91, 91, 91, 91, 91, + 91, 91, 105, 381, 381, 381, 381, 105, 1727, 105, + 105, 105, 105, 105, 105, 415, 402, 105, 390, 105, + + 380, 361, 388, 363, 378, 389, 384, 393, 185, 91, + 91, 91, 91, 91, 91, 91, 91, 386, 96, 369, + 105, 105, 370, 91, 91, 91, 91, 91, 91, 371, + 105, 1728, 105, 299, 299, 299, 299, 105, 391, 105, + 372, 387, 105, 105, 414, 105, 394, 105, 373, 114, + 392, 417, 398, 269, 91, 91, 91, 91, 91, 91, + 105, 401, 410, 105, 382, 105, 383, 105, 399, 400, + 403, 403, 403, 403, 105, 105, 105, 105, 1729, 416, + 411, 105, 413, 419, 105, 421, 418, 105, 105, 422, + 425, 427, 424, 105, 105, 105, 420, 428, 105, 430, + + 429, 105, 105, 105, 105, 440, 105, 395, 433, 431, + 434, 105, 432, 438, 396, 1730, 397, 436, 436, 436, + 436, 439, 105, 435, 105, 105, 105, 437, 105, 443, + 444, 105, 105, 446, 442, 441, 404, 105, 105, 105, + 445, 405, 105, 114, 406, 454, 450, 164, 447, 173, + 459, 407, 449, 408, 451, 460, 448, 173, 173, 458, + 1955, 473, 452, 477, 455, 467, 475, 476, 466, 105, + 373, 474, 105, 373, 453, 483, 478, 1731, 468, 105, + 1955, 370, 91, 91, 91, 91, 91, 91, 91, 91, + 471, 1955, 105, 91, 91, 91, 91, 91, 91, 91, + + 91, 105, 373, 479, 481, 480, 93, 373, 105, 105, + 105, 470, 164, 105, 105, 105, 373, 105, 485, 105, + 692, 472, 497, 489, 488, 484, 185, 105, 482, 381, + 381, 381, 381, 490, 490, 490, 490, 96, 491, 491, + 491, 491, 105, 105, 105, 105, 105, 494, 495, 105, + 499, 502, 503, 496, 500, 105, 105, 105, 105, 498, + 105, 509, 105, 105, 507, 105, 105, 492, 105, 505, + 105, 506, 403, 403, 403, 403, 516, 508, 515, 518, + 517, 105, 519, 105, 105, 105, 523, 105, 524, 105, + 105, 105, 526, 520, 527, 105, 105, 105, 114, 521, + + 493, 522, 529, 105, 548, 525, 530, 530, 530, 530, + 486, 105, 487, 105, 538, 534, 528, 535, 675, 539, + 105, 105, 105, 544, 105, 540, 105, 542, 105, 541, + 105, 545, 105, 546, 547, 547, 547, 547, 510, 105, + 549, 543, 105, 511, 536, 553, 512, 436, 436, 436, + 436, 552, 105, 513, 105, 514, 105, 437, 550, 550, + 550, 550, 105, 558, 105, 105, 105, 105, 105, 556, + 551, 561, 554, 105, 105, 105, 557, 531, 555, 105, + 564, 105, 562, 164, 559, 560, 105, 532, 563, 533, + 566, 565, 568, 173, 173, 173, 105, 569, 567, 1955, + + 573, 582, 588, 589, 593, 105, 627, 1955, 583, 91, + 91, 91, 91, 91, 91, 91, 91, 1955, 581, 91, + 91, 91, 91, 91, 91, 91, 91, 587, 590, 591, + 105, 105, 585, 592, 373, 595, 594, 584, 105, 373, + 105, 597, 105, 105, 373, 93, 105, 596, 114, 600, + 586, 105, 105, 185, 105, 604, 713, 373, 490, 490, + 490, 490, 601, 96, 491, 491, 491, 491, 105, 105, + 606, 606, 606, 606, 105, 611, 105, 603, 605, 105, + 105, 105, 105, 105, 105, 105, 105, 105, 614, 105, + 105, 105, 626, 492, 612, 105, 613, 615, 624, 623, + + 105, 621, 105, 622, 628, 625, 1330, 630, 629, 105, + 631, 632, 632, 632, 632, 105, 105, 105, 635, 105, + 634, 114, 530, 530, 530, 530, 640, 654, 642, 105, + 639, 105, 105, 641, 105, 643, 643, 643, 643, 655, + 655, 655, 655, 105, 105, 105, 661, 105, 105, 656, + 657, 547, 547, 547, 547, 105, 658, 665, 105, 667, + 660, 105, 550, 550, 550, 550, 105, 649, 662, 662, + 662, 662, 681, 105, 551, 105, 668, 105, 666, 663, + 105, 669, 105, 105, 105, 686, 683, 682, 105, 670, + 173, 671, 633, 636, 769, 672, 173, 644, 673, 707, + + 645, 105, 674, 637, 699, 638, 646, 105, 676, 647, + 105, 684, 709, 698, 1955, 708, 648, 706, 677, 105, + 678, 105, 685, 105, 679, 711, 105, 680, 700, 700, + 700, 700, 105, 725, 710, 947, 105, 712, 373, 1955, + 701, 91, 91, 91, 91, 91, 91, 91, 91, 704, + 373, 105, 373, 105, 173, 373, 105, 105, 742, 1955, + 93, 91, 91, 91, 91, 91, 91, 91, 91, 105, + 719, 105, 703, 727, 741, 702, 714, 714, 714, 714, + 720, 721, 721, 721, 721, 185, 606, 606, 606, 606, + 736, 736, 736, 736, 705, 105, 105, 105, 748, 749, + + 749, 749, 749, 105, 752, 96, 105, 723, 724, 105, + 105, 105, 105, 755, 105, 740, 759, 753, 754, 757, + 757, 757, 757, 105, 756, 632, 632, 632, 632, 105, + 762, 834, 105, 105, 767, 761, 770, 114, 105, 768, + 643, 643, 643, 643, 373, 763, 105, 778, 105, 114, + 105, 728, 105, 105, 777, 105, 780, 715, 787, 716, + 788, 105, 105, 776, 737, 779, 793, 729, 730, 731, + 962, 738, 105, 739, 105, 105, 373, 105, 781, 796, + 750, 105, 751, 655, 655, 655, 655, 105, 798, 789, + 789, 789, 789, 662, 662, 662, 662, 800, 105, 807, + + 758, 105, 771, 797, 663, 772, 760, 794, 794, 794, + 794, 773, 105, 801, 774, 791, 792, 795, 105, 799, + 105, 775, 662, 662, 662, 662, 105, 105, 802, 105, + 105, 105, 804, 663, 105, 808, 105, 105, 809, 105, + 803, 813, 811, 105, 814, 805, 105, 173, 815, 806, + 105, 810, 824, 816, 820, 824, 817, 173, 818, 812, + 1955, 594, 819, 105, 105, 903, 105, 700, 700, 700, + 700, 835, 840, 831, 594, 1732, 105, 830, 1955, 701, + 91, 91, 91, 91, 91, 91, 91, 91, 1955, 105, + 91, 91, 91, 91, 91, 91, 91, 91, 105, 373, + + 714, 714, 714, 714, 105, 105, 93, 105, 105, 114, + 844, 164, 105, 832, 845, 105, 105, 860, 841, 837, + 721, 721, 721, 721, 185, 721, 721, 721, 721, 105, + 859, 847, 1195, 865, 96, 105, 105, 105, 848, 736, + 736, 736, 736, 736, 736, 736, 736, 724, 105, 873, + 861, 723, 724, 862, 862, 862, 862, 749, 749, 749, + 749, 105, 866, 749, 749, 749, 749, 1733, 105, 105, + 874, 876, 876, 876, 876, 105, 881, 105, 105, 105, + 880, 838, 875, 839, 882, 757, 757, 757, 757, 884, + 105, 105, 105, 887, 885, 892, 892, 892, 892, 105, + + 105, 105, 114, 105, 105, 907, 895, 105, 896, 888, + 105, 927, 105, 853, 905, 105, 948, 853, 906, 105, + 854, 904, 855, 105, 854, 928, 855, 105, 105, 912, + 912, 912, 912, 105, 863, 105, 864, 902, 868, 929, + 869, 933, 877, 105, 868, 932, 869, 916, 916, 916, + 916, 105, 878, 939, 879, 914, 915, 105, 789, 789, + 789, 789, 789, 789, 789, 789, 883, 919, 919, 919, + 919, 794, 794, 794, 794, 917, 893, 105, 894, 105, + 105, 795, 931, 934, 105, 792, 930, 938, 791, 792, + 925, 925, 925, 925, 105, 105, 105, 937, 105, 935, + + 936, 105, 105, 105, 941, 105, 105, 945, 105, 105, + 105, 950, 105, 946, 824, 943, 940, 824, 963, 944, + 942, 700, 700, 700, 700, 949, 972, 105, 975, 920, + 105, 961, 921, 701, 700, 700, 700, 700, 922, 105, + 105, 923, 373, 105, 373, 370, 701, 173, 924, 1955, + 964, 91, 91, 91, 91, 91, 91, 91, 91, 960, + 173, 105, 105, 974, 105, 105, 105, 954, 702, 967, + 971, 373, 105, 164, 926, 862, 862, 862, 862, 987, + 968, 702, 105, 989, 862, 862, 862, 862, 105, 988, + 105, 105, 105, 105, 1077, 185, 995, 990, 992, 992, + + 992, 992, 1008, 105, 991, 876, 876, 876, 876, 105, + 1005, 1006, 105, 105, 1004, 105, 876, 876, 876, 876, + 105, 105, 105, 105, 1010, 105, 1007, 1009, 1018, 1011, + 1014, 1014, 1014, 1014, 1023, 105, 1013, 892, 892, 892, + 892, 105, 1017, 892, 892, 892, 892, 105, 1026, 1024, + 105, 105, 1025, 105, 105, 105, 983, 105, 984, 114, + 105, 1037, 105, 105, 1032, 983, 1065, 984, 1761, 1033, + 1054, 1038, 993, 105, 1039, 105, 999, 1055, 1316, 994, + 1034, 1034, 1034, 1034, 105, 1053, 1000, 999, 1001, 105, + 1056, 1060, 105, 916, 916, 916, 916, 1000, 1059, 1001, + + 912, 912, 912, 912, 912, 912, 912, 912, 105, 105, + 105, 1015, 919, 919, 919, 919, 1057, 105, 1019, 105, + 1020, 917, 1061, 1062, 1019, 105, 1020, 915, 1063, 1067, + 914, 915, 925, 925, 925, 925, 105, 105, 105, 1066, + 105, 1064, 105, 105, 105, 1070, 105, 105, 105, 105, + 1068, 105, 1071, 105, 1035, 1073, 1069, 105, 1079, 1085, + 1076, 1036, 1074, 1078, 1072, 105, 1091, 164, 1075, 1080, + 1090, 105, 105, 373, 1048, 105, 1092, 1049, 373, 105, + 1081, 1096, 105, 1050, 1099, 105, 1051, 105, 105, 1095, + 105, 1190, 1114, 1052, 721, 721, 721, 721, 105, 1116, + + 105, 1101, 992, 992, 992, 992, 1118, 1117, 992, 992, + 992, 992, 1115, 105, 105, 105, 926, 105, 105, 1121, + 723, 724, 1120, 105, 105, 105, 105, 1131, 1119, 1137, + 105, 1130, 1133, 1135, 1135, 1135, 1135, 1014, 1014, 1014, + 1014, 105, 105, 1132, 105, 1134, 105, 105, 105, 105, + 1139, 105, 1151, 1141, 1149, 1034, 1034, 1034, 1034, 105, + 1762, 1143, 105, 1152, 1144, 1150, 1034, 1034, 1034, 1034, + 1161, 1159, 105, 105, 1160, 114, 1111, 1162, 1162, 1162, + 1162, 1763, 1111, 1112, 1172, 1172, 1172, 1172, 105, 1112, + 105, 1180, 1165, 1166, 105, 105, 789, 789, 789, 789, + + 105, 105, 1185, 105, 1136, 105, 1186, 1187, 1181, 1183, + 1179, 105, 105, 105, 1182, 105, 1764, 105, 1140, 1188, + 105, 1193, 791, 792, 1193, 105, 1189, 1191, 1197, 1155, + 1192, 1194, 1196, 105, 1201, 105, 1156, 105, 105, 105, + 1155, 105, 105, 105, 105, 1209, 1207, 1156, 1163, 728, + 1199, 1164, 1198, 105, 1202, 1200, 1203, 105, 1214, 1204, + 1205, 1206, 1208, 1218, 1210, 729, 591, 731, 1211, 105, + 1219, 105, 105, 105, 1223, 164, 1226, 105, 1224, 105, + 1244, 373, 1243, 105, 721, 721, 721, 721, 1240, 1240, + 1240, 1240, 105, 373, 105, 105, 105, 105, 105, 1227, + + 105, 1259, 1273, 1246, 105, 1765, 1245, 1260, 1267, 1247, + 723, 724, 105, 1248, 1249, 1249, 1249, 1249, 1135, 1135, + 1135, 1135, 1261, 1261, 1261, 1261, 1264, 105, 1135, 1135, + 1135, 1135, 105, 105, 105, 105, 1265, 105, 105, 1281, + 1281, 1281, 1281, 105, 1280, 1290, 1266, 105, 1283, 1271, + 105, 1279, 1269, 1162, 1162, 1162, 1162, 105, 105, 105, + 105, 1291, 1162, 1162, 1162, 1162, 1329, 105, 105, 1241, + 1317, 1242, 1292, 1293, 1551, 1294, 105, 1295, 1295, 1295, + 1295, 1306, 105, 105, 105, 105, 1307, 105, 1250, 1257, + 912, 912, 912, 912, 1311, 1251, 105, 1314, 105, 1257, + + 1312, 105, 105, 1262, 105, 1263, 1172, 1172, 1172, 1172, + 1282, 789, 789, 789, 789, 105, 914, 915, 1308, 1308, + 1308, 1308, 1318, 1315, 1287, 105, 105, 1288, 1323, 105, + 1331, 1193, 1319, 1287, 1193, 1324, 1288, 791, 792, 105, + 105, 1194, 105, 105, 1320, 105, 105, 1325, 1296, 1328, + 1327, 105, 1334, 105, 1335, 1339, 105, 1336, 1337, 164, + 1326, 1347, 1343, 105, 1333, 1348, 1332, 114, 105, 105, + 105, 728, 1352, 1338, 1340, 105, 373, 1353, 1367, 1369, + 105, 105, 105, 105, 105, 105, 1371, 729, 1680, 731, + 105, 373, 1309, 1349, 1387, 105, 1368, 1372, 1370, 1310, + + 490, 490, 490, 490, 547, 547, 547, 547, 1240, 1240, + 1240, 1240, 1249, 1249, 1249, 1249, 1240, 1240, 1240, 1240, + 105, 105, 1249, 1249, 1249, 1249, 105, 1373, 105, 1261, + 1261, 1261, 1261, 105, 105, 105, 1376, 1385, 105, 1374, + 105, 1375, 1261, 1261, 1261, 1261, 105, 1390, 1386, 1388, + 105, 1389, 1395, 1392, 1392, 1392, 1392, 1682, 1391, 105, + 105, 114, 1281, 1281, 1281, 1281, 105, 1404, 105, 1413, + 1397, 1403, 1281, 1281, 1281, 1281, 105, 105, 105, 1416, + 1406, 105, 1405, 105, 1414, 105, 1365, 105, 105, 1357, + 1398, 1358, 1417, 1366, 105, 1418, 1365, 1357, 1680, 1358, + + 1427, 1415, 105, 1366, 1295, 1295, 1295, 1295, 105, 105, + 1379, 1435, 1380, 105, 1426, 105, 1295, 1295, 1295, 1295, + 105, 1428, 1432, 1379, 1393, 1380, 912, 912, 912, 912, + 1768, 105, 1769, 1401, 1308, 1308, 1308, 1308, 1308, 1308, + 1308, 1308, 1438, 1401, 1439, 1436, 1437, 1429, 1429, 1429, + 1429, 1456, 914, 915, 1433, 1433, 1433, 1433, 105, 1445, + 105, 1446, 105, 1447, 1453, 105, 1434, 1454, 1440, 1441, + 1442, 1457, 1443, 105, 1455, 1412, 1458, 114, 105, 105, + 105, 105, 1448, 1449, 1450, 1475, 1451, 1412, 1472, 105, + 105, 1459, 1444, 1460, 1461, 105, 105, 105, 1465, 1466, + + 1490, 373, 1487, 105, 105, 105, 1452, 105, 1422, 105, + 105, 1491, 1422, 105, 1467, 1423, 105, 105, 1430, 1423, + 1770, 1431, 1489, 1488, 105, 162, 162, 1494, 162, 162, + 162, 162, 162, 162, 162, 162, 162, 162, 162, 162, + 162, 162, 162, 162, 105, 1468, 655, 655, 655, 655, + 105, 105, 162, 162, 162, 162, 162, 162, 1492, 1492, + 1492, 1492, 1541, 1507, 1495, 105, 1496, 1392, 1392, 1392, + 1392, 105, 1506, 105, 105, 105, 1505, 1508, 1392, 1392, + 1392, 1392, 105, 105, 162, 164, 162, 162, 1509, 1510, + 105, 1513, 105, 105, 105, 1771, 1518, 1519, 105, 1590, + + 105, 1512, 1521, 1521, 1521, 1521, 1529, 1529, 1529, 1529, + 105, 105, 105, 1520, 1531, 162, 373, 1532, 1533, 105, + 105, 1429, 1429, 1429, 1429, 1542, 105, 1543, 1429, 1429, + 1429, 1429, 1493, 1544, 1546, 1546, 1546, 1546, 1504, 105, + 1774, 1545, 1433, 1433, 1433, 1433, 105, 1548, 1548, 1504, + 1548, 105, 1553, 1555, 1434, 1552, 1556, 1550, 1549, 105, + 1554, 1557, 1568, 1558, 105, 105, 1559, 105, 105, 1563, + 1560, 105, 1564, 1522, 105, 105, 1561, 105, 1562, 105, + 1530, 105, 1565, 1566, 105, 1567, 1569, 105, 105, 105, + 105, 105, 1538, 1574, 1575, 1539, 105, 1775, 1571, 1538, + + 105, 105, 1539, 1570, 105, 1547, 1572, 105, 105, 1576, + 1589, 370, 1592, 105, 105, 105, 1573, 1492, 1492, 1492, + 1492, 105, 1608, 1604, 105, 1605, 105, 1603, 1624, 1606, + 1492, 1492, 1492, 1492, 105, 1776, 105, 373, 1616, 1655, + 1577, 1579, 1579, 1580, 1579, 1579, 1579, 1579, 1579, 1579, + 1579, 1579, 162, 1579, 1579, 1579, 1579, 1579, 1579, 1579, + 105, 105, 105, 105, 105, 105, 105, 105, 1579, 1579, + 1579, 1579, 1579, 1579, 1618, 1607, 1617, 105, 1636, 1609, + 1619, 1619, 1619, 1619, 105, 105, 1622, 1649, 1646, 1621, + 1630, 1599, 1521, 1521, 1521, 1521, 1625, 105, 105, 1657, + + 1579, 1582, 1579, 1579, 1599, 1521, 1521, 1521, 1521, 105, + 1658, 1631, 1529, 1529, 1529, 1529, 1529, 1529, 1529, 1529, + 1637, 1637, 1637, 1637, 1546, 1546, 1546, 1546, 105, 105, + 105, 1579, 105, 105, 105, 1659, 1647, 1546, 1546, 1546, + 1546, 105, 105, 105, 105, 1660, 1650, 1651, 1648, 1548, + 1548, 1620, 1548, 105, 105, 1777, 1652, 1654, 1653, 105, + 1549, 105, 1656, 1629, 1661, 105, 105, 105, 1663, 1664, + 105, 1665, 1662, 105, 1666, 105, 1629, 105, 1667, 105, + 1668, 105, 105, 105, 1669, 1672, 1632, 105, 1779, 1670, + 1632, 1638, 162, 1686, 105, 1645, 105, 1671, 105, 1701, + + 105, 1673, 1692, 916, 916, 916, 916, 1702, 1645, 1683, + 1683, 1580, 1683, 1683, 1683, 1683, 1683, 1683, 1683, 1683, + 1679, 1683, 1683, 1683, 1683, 1683, 1683, 1683, 373, 105, + 105, 917, 105, 1703, 1784, 105, 1683, 1683, 1683, 1683, + 1683, 1683, 1715, 1785, 1704, 1705, 1705, 1705, 1705, 105, + 1680, 1786, 1707, 1619, 1619, 1619, 1619, 105, 1619, 1619, + 1619, 1619, 1714, 1716, 105, 105, 105, 1787, 1683, 1685, + 1683, 1683, 105, 105, 105, 105, 1717, 1721, 1637, 1637, + 1637, 1637, 105, 105, 1718, 1722, 1736, 105, 1725, 1637, + 1637, 1637, 1637, 1739, 1737, 1738, 1726, 105, 1740, 1683, + + 1734, 1734, 1734, 1734, 105, 105, 105, 105, 105, 1744, + 105, 105, 105, 1745, 105, 1746, 105, 1741, 105, 1706, + 105, 1747, 1742, 1743, 1711, 105, 1748, 105, 1752, 1711, + 1753, 1749, 1750, 105, 105, 105, 1754, 1755, 1751, 1757, + 105, 105, 105, 1760, 162, 1759, 1793, 1758, 1794, 1724, + 1679, 1766, 1773, 1756, 1681, 1767, 105, 105, 105, 105, + 1724, 105, 105, 1705, 1705, 1705, 1705, 105, 1782, 105, + 1781, 1780, 105, 1783, 1735, 1679, 1766, 105, 1795, 1790, + 373, 1705, 1705, 1705, 1705, 105, 1789, 1796, 105, 1788, + 1791, 1791, 1791, 1791, 1800, 1797, 1734, 1734, 1734, 1734, + + 1801, 1802, 1680, 1734, 1734, 1734, 1734, 105, 1680, 105, + 105, 1806, 1682, 1683, 1683, 1580, 1683, 1683, 1683, 1683, + 1683, 1683, 1683, 1683, 1679, 1683, 1683, 1683, 1683, 1683, + 1683, 1683, 105, 1680, 105, 1808, 105, 1778, 105, 105, + 1683, 1683, 1683, 1683, 1683, 1683, 105, 1803, 1804, 1804, + 1804, 1804, 105, 105, 1798, 1778, 105, 1811, 1807, 105, + 1823, 1792, 105, 105, 105, 105, 105, 105, 105, 105, + 1799, 1809, 1683, 1685, 1683, 1683, 105, 1799, 1810, 105, + 1812, 1815, 1813, 1814, 1816, 1818, 1819, 105, 105, 105, + 105, 1817, 1826, 1827, 1828, 1829, 1679, 1820, 1681, 1824, + + 1831, 1832, 1833, 1683, 1822, 1821, 1834, 1835, 1825, 1836, + 105, 1837, 1838, 1839, 105, 105, 105, 105, 1842, 1805, + 1840, 1843, 1844, 105, 105, 105, 373, 1791, 1791, 1791, + 1791, 1841, 105, 1791, 1791, 1791, 1791, 1846, 1848, 1847, + 1849, 105, 105, 1850, 1804, 1804, 1804, 1804, 105, 1804, + 1804, 1804, 1804, 105, 1680, 105, 1682, 105, 1854, 105, + 105, 105, 1852, 105, 105, 105, 105, 1853, 105, 105, + 105, 105, 105, 105, 105, 105, 105, 1868, 1857, 1855, + 1858, 1859, 105, 1860, 1856, 1865, 1861, 1862, 1863, 1864, + 1866, 105, 1869, 1870, 1871, 1872, 1867, 1873, 1845, 1874, + + 1875, 373, 1876, 1877, 1845, 105, 105, 1880, 1881, 1878, + 105, 105, 1884, 1879, 1882, 1851, 1885, 105, 105, 105, + 1851, 105, 105, 105, 1886, 105, 105, 105, 105, 105, + 1889, 1883, 105, 105, 105, 105, 1892, 1888, 1887, 1890, + 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, + 1903, 105, 1891, 105, 1904, 1905, 105, 105, 105, 1906, + 1907, 105, 105, 105, 105, 105, 105, 105, 105, 1913, + 1910, 1914, 1915, 1916, 1917, 1919, 1920, 1921, 1908, 105, + 105, 1911, 105, 1909, 105, 105, 1926, 1912, 105, 1922, + 1923, 1924, 1927, 1928, 1929, 105, 1933, 105, 1935, 1938, + + 105, 1940, 105, 105, 1942, 1943, 1944, 105, 105, 1946, + 1932, 1945, 105, 1948, 105, 1934, 1939, 105, 1941, 105, + 105, 105, 1951, 105, 105, 105, 105, 973, 1047, 1171, + 1713, 1712, 1710, 1709, 1708, 1949, 1952, 105, 1953, 1700, + 1954, 62, 62, 62, 62, 62, 62, 62, 62, 62, + 62, 62, 68, 68, 68, 68, 1699, 68, 68, 68, + 68, 68, 68, 74, 74, 74, 1698, 1697, 1696, 1695, + 1694, 105, 74, 91, 91, 1693, 373, 91, 95, 95, + 1089, 1691, 95, 103, 1690, 1689, 103, 162, 162, 1688, + 162, 162, 162, 162, 162, 162, 162, 162, 172, 172, + + 1687, 172, 180, 180, 1682, 180, 180, 180, 180, 180, + 180, 180, 180, 182, 1680, 1678, 182, 184, 184, 1677, + 1676, 184, 254, 254, 1675, 254, 254, 254, 254, 254, + 254, 254, 254, 268, 1674, 105, 268, 346, 346, 105, + 346, 346, 346, 346, 346, 346, 346, 346, 367, 1644, + 1643, 367, 368, 1642, 1641, 368, 577, 577, 1640, 577, + 577, 577, 577, 577, 577, 577, 577, 578, 578, 1639, + 578, 578, 578, 578, 578, 578, 578, 578, 602, 602, + 105, 105, 1635, 1634, 1633, 105, 105, 602, 659, 659, + 1628, 1627, 1626, 1623, 1615, 1614, 1613, 659, 664, 664, + + 1612, 1611, 664, 1610, 664, 105, 105, 664, 690, 690, + 1602, 690, 690, 690, 690, 690, 690, 690, 690, 691, + 691, 1601, 691, 691, 691, 691, 691, 691, 691, 691, + 722, 722, 1600, 1598, 1597, 1596, 722, 722, 722, 722, + 786, 786, 1595, 1594, 1593, 1591, 1588, 1587, 1586, 786, + 790, 790, 1585, 1584, 1583, 1578, 790, 790, 790, 790, + 913, 913, 105, 105, 105, 1540, 913, 913, 913, 913, + 955, 955, 1537, 955, 955, 955, 955, 955, 955, 955, + 955, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, 1045, + 1045, 1045, 1082, 1082, 1536, 1082, 1082, 1082, 1082, 1082, + + 1082, 1082, 1082, 1100, 1100, 1535, 1534, 105, 105, 1100, + 1100, 1100, 1100, 1173, 1173, 1528, 1527, 1526, 1525, 1173, + 1173, 1173, 1173, 1300, 1300, 1524, 1523, 1517, 1516, 1300, + 1300, 1300, 1300, 1321, 1321, 1321, 1321, 1321, 1321, 1321, + 1321, 1321, 1321, 1321, 1464, 1464, 1515, 1464, 1464, 1464, + 1464, 1464, 1464, 1464, 1464, 1581, 1581, 1581, 1581, 1581, + 1581, 1581, 1581, 1581, 1581, 1581, 1679, 1679, 1514, 1679, + 1679, 1679, 1679, 1679, 1679, 1679, 1679, 1681, 1681, 1511, + 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1681, 1684, 1684, + 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1772, + + 1772, 1395, 1772, 1772, 1772, 1772, 1772, 1772, 1772, 1772, + 1830, 1830, 105, 1830, 1830, 1830, 1830, 1830, 1830, 1830, + 1830, 1918, 1918, 105, 1918, 1918, 1918, 1918, 1918, 1918, + 1918, 1918, 1925, 1925, 1503, 1925, 1925, 1925, 1925, 1925, + 1925, 1925, 1925, 1930, 1930, 1502, 1930, 1930, 1930, 1930, + 1930, 1930, 1930, 1930, 1931, 1931, 1501, 1931, 1931, 1931, + 1931, 1931, 1931, 1931, 1931, 1936, 1936, 1500, 1936, 1936, + 1936, 1936, 1936, 1936, 1936, 1936, 1937, 1937, 1499, 1937, + 1937, 1937, 1937, 1937, 1937, 1937, 1937, 1947, 1947, 1498, + 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1947, 1950, 1950, + + 1497, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 1950, 105, + 1486, 1485, 1484, 1483, 1482, 1481, 1480, 1479, 1478, 1477, + 1476, 105, 1474, 1473, 1471, 1470, 1469, 1463, 1462, 105, + 105, 105, 105, 105, 105, 1322, 105, 105, 1425, 1424, + 1421, 1420, 1419, 1411, 1410, 1409, 1408, 1407, 1402, 1400, + 1399, 1273, 1396, 1394, 1384, 1383, 1382, 1381, 1378, 1377, + 1364, 1363, 1362, 1361, 1360, 1359, 1356, 1355, 105, 105, + 1354, 1351, 1350, 1346, 1345, 1344, 1342, 1341, 105, 105, + 1322, 105, 1313, 1305, 1304, 1303, 1302, 1301, 1299, 654, + 1298, 1297, 105, 1289, 1286, 1285, 1284, 1278, 1277, 1276, + + 1275, 1274, 1272, 1270, 1268, 1258, 1256, 1255, 1254, 1253, + 1252, 1239, 1238, 1237, 1236, 1235, 1234, 1233, 1232, 1231, + 1230, 1229, 1228, 1225, 1222, 1221, 1220, 1217, 1216, 1215, + 1213, 1212, 1184, 1178, 1177, 1176, 1175, 1174, 1046, 1170, + 1169, 1168, 1167, 105, 1158, 1157, 1154, 1153, 1148, 1147, + 1146, 1145, 1142, 1138, 105, 1129, 1128, 1127, 1126, 1125, + 1124, 1123, 1122, 1113, 1110, 1109, 1108, 1107, 1106, 1105, + 1104, 1103, 1102, 105, 105, 1098, 1097, 1094, 1093, 373, + 373, 1089, 1088, 1087, 1086, 1084, 1083, 105, 1058, 1046, + 1044, 1043, 1042, 1041, 1040, 1031, 1030, 1029, 1028, 1027, + + 1022, 1021, 1016, 1012, 105, 1003, 1002, 998, 997, 996, + 986, 985, 982, 981, 980, 979, 978, 977, 976, 970, + 969, 966, 965, 959, 958, 957, 956, 953, 952, 951, + 105, 918, 105, 911, 910, 909, 908, 901, 900, 899, + 898, 897, 891, 890, 889, 105, 886, 105, 872, 871, + 870, 867, 858, 857, 856, 852, 851, 850, 849, 105, + 846, 843, 842, 836, 833, 105, 173, 829, 828, 827, + 826, 825, 823, 822, 821, 426, 105, 105, 785, 784, + 783, 782, 105, 766, 765, 764, 105, 105, 747, 746, + 745, 744, 743, 105, 735, 734, 733, 732, 726, 718, + + 717, 105, 105, 697, 696, 695, 694, 693, 689, 688, + 687, 105, 653, 652, 651, 650, 105, 105, 620, 619, + 618, 617, 616, 610, 609, 608, 607, 105, 105, 105, + 105, 599, 598, 105, 105, 580, 579, 576, 575, 574, + 572, 571, 570, 105, 537, 105, 504, 501, 105, 105, + 105, 373, 469, 465, 464, 463, 462, 461, 457, 456, + 426, 423, 105, 105, 105, 187, 360, 356, 355, 354, + 353, 345, 307, 105, 281, 276, 275, 264, 260, 173, + 164, 167, 251, 250, 226, 197, 105, 190, 189, 179, + 178, 177, 173, 169, 167, 113, 105, 100, 97, 85, + + 69, 65, 61, 1955, 3, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955 + } ; -static yyconst flex_int16_t yy_chk[1788] = +static yyconst flex_int16_t yy_chk[4697] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -914,205 +1628,534 @@ static yyconst flex_int16_t yy_chk[1788] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 9, 2, 9, - 13, 13, 13, 13, 2, 10, 10, 10, 10, 10, - 10, 10, 10, 12, 15, 16, 17, 18, 24, 20, - - 22, 12, 19, 21, 17, 23, 24, 24, 17, 25, - 16, 17, 18, 20, 19, 15, 22, 24, 21, 19, - 10, 26, 23, 25, 45, 23, 27, 27, 27, 27, - 26, 31, 37, 31, 39, 40, 26, 27, 48, 45, - 26, 35, 35, 35, 35, 35, 35, 35, 35, 44, - 43, 40, 48, 37, 43, 39, 41, 41, 41, 41, - 42, 42, 42, 42, 46, 46, 47, 47, 49, 50, - 44, 51, 52, 53, 55, 770, 35, 54, 57, 44, - 51, 60, 54, 55, 50, 59, 59, 53, 49, 55, - 56, 52, 56, 57, 58, 61, 62, 63, 69, 60, - - 72, 58, 764, 78, 72, 62, 42, 83, 63, 83, - 84, 84, 61, 64, 64, 64, 64, 78, 69, 74, - 74, 74, 74, 77, 64, 75, 75, 75, 75, 79, - 80, 81, 82, 85, 77, 88, 89, 90, 85, 87, - 93, 79, 86, 86, 86, 86, 87, 80, 91, 81, - 82, 92, 88, 94, 93, 95, 90, 89, 96, 97, - 91, 99, 103, 97, 95, 74, 105, 101, 92, 104, - 109, 75, 94, 103, 106, 104, 110, 96, 105, 111, - 112, 99, 101, 113, 116, 104, 118, 118, 109, 86, - 104, 111, 116, 106, 115, 110, 133, 113, 131, 112, - - 133, 86, 114, 114, 114, 114, 175, 86, 98, 115, - 131, 98, 98, 98, 125, 98, 119, 119, 122, 98, - 120, 125, 175, 98, 98, 120, 98, 98, 117, 117, - 117, 117, 98, 121, 123, 124, 126, 122, 129, 123, - 130, 136, 121, 134, 124, 127, 127, 127, 127, 132, - 135, 137, 127, 129, 132, 135, 126, 138, 134, 139, - 137, 114, 141, 130, 143, 136, 146, 114, 143, 135, - 147, 148, 138, 149, 150, 117, 151, 141, 146, 158, - 139, 148, 155, 149, 117, 153, 155, 117, 161, 159, - 153, 147, 127, 158, 160, 160, 160, 160, 162, 163, - - 164, 761, 161, 150, 159, 165, 166, 168, 165, 166, - 174, 168, 170, 162, 167, 167, 167, 167, 163, 164, - 151, 169, 171, 171, 169, 174, 170, 172, 172, 172, - 172, 176, 177, 178, 172, 173, 173, 173, 173, 179, - 180, 178, 197, 181, 173, 184, 176, 181, 182, 183, - 160, 177, 185, 160, 183, 193, 185, 194, 179, 180, - 195, 167, 184, 186, 182, 193, 196, 186, 203, 204, - 167, 207, 209, 197, 196, 203, 194, 198, 198, 198, - 198, 208, 211, 210, 214, 195, 204, 209, 210, 748, - 207, 213, 213, 213, 213, 208, 218, 221, 214, 223, - - 223, 211, 215, 215, 215, 215, 217, 222, 218, 221, - 225, 217, 219, 219, 219, 219, 220, 220, 220, 220, - 226, 219, 222, 224, 220, 224, 228, 226, 224, 231, - 321, 224, 230, 229, 225, 228, 242, 224, 229, 232, - 321, 231, 227, 243, 242, 198, 244, 213, 252, 215, - 232, 227, 215, 227, 230, 227, 227, 244, 257, 227, - 247, 247, 247, 247, 261, 227, 278, 252, 243, 256, - 251, 251, 251, 251, 259, 257, 256, 264, 278, 259, - 263, 264, 270, 261, 262, 262, 262, 262, 263, 266, - 266, 266, 266, 267, 267, 267, 267, 266, 747, 270, - - 267, 268, 268, 268, 268, 269, 271, 272, 272, 268, - 269, 273, 274, 273, 275, 277, 276, 251, 281, 275, - 279, 279, 280, 281, 280, 271, 282, 284, 247, 251, - 283, 274, 276, 277, 262, 283, 286, 285, 287, 288, - 285, 297, 287, 285, 324, 282, 284, 285, 303, 324, - 285, 288, 286, 300, 300, 300, 300, 285, 302, 302, - 302, 302, 318, 303, 297, 743, 307, 307, 307, 307, - 309, 313, 313, 322, 309, 315, 315, 315, 315, 317, - 317, 318, 315, 316, 316, 316, 316, 319, 320, 323, - 322, 320, 323, 325, 326, 326, 319, 327, 325, 328, - - 327, 329, 330, 331, 332, 339, 331, 329, 333, 328, - 334, 336, 300, 307, 335, 335, 336, 302, 337, 330, - 333, 332, 307, 338, 334, 348, 340, 347, 339, 352, - 347, 349, 349, 349, 349, 337, 340, 359, 338, 353, - 353, 353, 353, 352, 355, 368, 348, 354, 354, 354, - 354, 316, 349, 362, 359, 364, 365, 367, 355, 360, - 360, 360, 360, 363, 368, 366, 367, 362, 363, 364, - 366, 370, 371, 365, 372, 370, 373, 374, 375, 376, - 377, 373, 374, 379, 378, 371, 381, 375, 383, 377, - 380, 372, 382, 380, 384, 353, 385, 393, 376, 378, - - 400, 393, 379, 354, 385, 383, 382, 381, 404, 384, - 394, 394, 394, 394, 395, 395, 395, 395, 398, 400, - 405, 406, 404, 407, 405, 398, 408, 360, 406, 408, - 409, 394, 410, 411, 412, 395, 413, 411, 407, 414, - 415, 416, 414, 417, 409, 418, 421, 410, 419, 419, - 412, 413, 422, 423, 424, 416, 425, 415, 417, 418, - 420, 422, 420, 421, 432, 420, 420, 432, 439, 439, - 440, 425, 423, 424, 441, 432, 443, 411, 440, 444, - 445, 450, 448, 446, 451, 441, 444, 446, 453, 451, - 455, 452, 454, 456, 420, 443, 448, 445, 452, 454, - - 450, 457, 458, 460, 463, 453, 461, 476, 462, 455, - 462, 464, 477, 462, 462, 469, 473, 474, 460, 473, - 475, 476, 456, 482, 461, 494, 477, 463, 464, 472, - 472, 472, 472, 458, 457, 475, 469, 482, 472, 481, - 481, 474, 462, 478, 478, 478, 483, 478, 492, 484, - 485, 485, 485, 487, 485, 493, 487, 492, 494, 495, - 483, 498, 478, 484, 497, 498, 501, 501, 503, 485, - 740, 506, 504, 504, 504, 504, 478, 507, 503, 497, - 501, 504, 508, 485, 493, 487, 505, 505, 506, 505, - 495, 508, 511, 507, 505, 509, 509, 510, 510, 512, - - 513, 514, 515, 515, 520, 516, 511, 501, 516, 517, - 517, 519, 519, 512, 513, 514, 518, 521, 520, 518, - 522, 523, 524, 524, 525, 526, 527, 531, 532, 533, - 533, 521, 540, 543, 522, 523, 545, 532, 588, 544, - 733, 527, 531, 533, 544, 540, 541, 541, 543, 541, - 545, 730, 546, 588, 541, 546, 526, 525, 547, 548, - 548, 547, 549, 549, 550, 550, 551, 551, 552, 553, - 533, 552, 554, 555, 556, 554, 564, 556, 555, 557, - 557, 558, 558, 559, 559, 565, 553, 560, 560, 561, - 564, 566, 561, 579, 580, 581, 583, 579, 582, 583, - - 584, 585, 565, 584, 585, 566, 586, 579, 587, 586, - 589, 590, 581, 580, 591, 582, 592, 593, 594, 592, - 593, 594, 596, 595, 597, 587, 595, 589, 598, 599, - 599, 591, 598, 612, 590, 610, 610, 611, 597, 596, - 613, 612, 611, 614, 615, 616, 617, 618, 629, 629, - 619, 621, 622, 623, 624, 613, 625, 626, 614, 627, - 628, 615, 616, 617, 618, 619, 621, 622, 623, 630, - 631, 624, 643, 625, 626, 628, 627, 642, 630, 644, - 642, 647, 648, 649, 650, 653, 655, 656, 722, 631, - 661, 657, 658, 643, 720, 662, 647, 648, 649, 650, - - 662, 655, 656, 644, 661, 653, 657, 658, 660, 672, - 673, 660, 674, 679, 684, 685, 685, 697, 686, 673, - 695, 696, 697, 698, 700, 699, 672, 679, 674, 701, - 701, 684, 686, 713, 716, 695, 711, 716, 713, 696, - 699, 715, 698, 700, 725, 711, 715, 726, 727, 728, - 736, 726, 739, 737, 738, 738, 744, 752, 745, 725, - 745, 719, 727, 759, 736, 737, 728, 739, 746, 751, - 744, 746, 750, 750, 752, 755, 756, 757, 755, 751, - 759, 756, 760, 762, 763, 760, 765, 766, 766, 768, - 767, 718, 757, 767, 769, 714, 712, 710, 762, 709, - - 765, 708, 707, 763, 705, 704, 768, 703, 702, 769, - 772, 772, 772, 694, 772, 772, 772, 772, 772, 772, - 773, 773, 693, 773, 774, 774, 692, 774, 775, 775, - 691, 690, 689, 775, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 777, 777, 688, 777, 777, 777, - 777, 777, 777, 777, 778, 778, 687, 683, 778, 778, - 682, 681, 778, 779, 779, 680, 779, 779, 779, 779, - 779, 779, 779, 780, 780, 678, 780, 781, 781, 677, - 781, 781, 781, 781, 781, 781, 781, 782, 782, 782, - 782, 782, 782, 782, 782, 782, 782, 783, 783, 676, - - 783, 783, 783, 675, 783, 784, 784, 784, 784, 784, - 784, 784, 784, 784, 784, 785, 785, 671, 785, 785, - 785, 785, 785, 785, 785, 786, 786, 670, 669, 786, - 786, 786, 786, 787, 787, 668, 787, 787, 787, 787, - 787, 787, 787, 788, 788, 788, 788, 788, 788, 788, - 788, 788, 788, 789, 789, 666, 789, 789, 789, 789, - 789, 789, 789, 790, 790, 665, 790, 790, 790, 790, - 790, 790, 790, 791, 791, 664, 791, 791, 791, 791, - 791, 791, 791, 792, 792, 663, 792, 792, 792, 792, - 792, 792, 792, 793, 793, 659, 793, 793, 793, 793, - - 793, 793, 793, 794, 794, 654, 794, 794, 794, 794, - 794, 794, 794, 795, 795, 652, 795, 795, 795, 795, - 795, 795, 795, 796, 796, 651, 796, 796, 796, 796, - 796, 796, 796, 797, 797, 646, 797, 797, 797, 797, - 797, 797, 797, 798, 798, 645, 798, 798, 798, 798, - 798, 798, 798, 640, 639, 638, 637, 635, 634, 633, - 632, 620, 608, 607, 606, 605, 604, 603, 602, 601, - 600, 578, 577, 576, 575, 574, 573, 572, 571, 570, - 569, 568, 567, 563, 562, 539, 538, 537, 536, 535, - 534, 530, 529, 528, 502, 500, 499, 496, 491, 490, - - 489, 488, 486, 479, 468, 467, 466, 465, 459, 449, - 447, 442, 438, 436, 435, 434, 433, 431, 430, 429, - 428, 426, 403, 402, 401, 399, 397, 392, 391, 390, - 388, 387, 369, 361, 358, 356, 350, 346, 345, 343, - 342, 341, 314, 312, 311, 310, 308, 306, 304, 301, - 299, 298, 296, 295, 294, 293, 292, 291, 290, 289, - 265, 260, 258, 255, 254, 253, 250, 249, 248, 246, - 245, 240, 239, 238, 237, 236, 235, 234, 233, 216, - 212, 206, 205, 202, 201, 200, 199, 192, 191, 190, - 189, 188, 187, 157, 156, 154, 152, 145, 144, 142, - - 128, 108, 107, 102, 73, 67, 66, 38, 36, 32, - 30, 11, 3, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, - 771, 771, 771, 771, 771, 771, 771 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 8, 10, 2, 12, 12, + + 12, 12, 14, 14, 14, 14, 12, 15, 2, 25, + 12, 16, 22, 22, 24, 24, 18, 10, 27, 32, + 32, 18, 2, 15, 25, 16, 16, 28, 30, 1616, + 12, 14, 12, 18, 19, 29, 19, 19, 19, 19, + 19, 19, 19, 19, 35, 44, 29, 28, 27, 8, + 30, 20, 12, 20, 20, 20, 20, 20, 20, 20, + 20, 36, 37, 39, 38, 54, 44, 14, 39, 40, + 35, 37, 38, 19, 41, 36, 38, 37, 39, 38, + 19, 42, 36, 40, 43, 48, 41, 62, 39, 46, + 48, 47, 41, 40, 64, 42, 68, 20, 50, 43, + + 42, 45, 45, 50, 19, 46, 45, 46, 46, 47, + 49, 52, 47, 51, 58, 69, 45, 58, 49, 49, + 52, 53, 104, 50, 108, 54, 52, 51, 59, 49, + 49, 52, 51, 59, 73, 1622, 53, 55, 55, 55, + 55, 62, 76, 55, 104, 59, 68, 75, 64, 70, + 70, 70, 70, 75, 55, 73, 76, 70, 91, 93, + 108, 70, 116, 106, 125, 69, 116, 105, 55, 77, + 77, 77, 77, 58, 120, 120, 121, 121, 125, 93, + 58, 70, 106, 70, 89, 89, 89, 89, 89, 89, + 89, 89, 90, 105, 90, 90, 90, 90, 90, 90, + + 90, 90, 89, 70, 91, 93, 94, 193, 94, 94, + 94, 94, 94, 94, 94, 94, 95, 119, 95, 95, + 95, 95, 95, 95, 95, 95, 132, 107, 114, 109, + 117, 118, 119, 89, 77, 114, 193, 107, 90, 92, + 132, 92, 92, 92, 92, 92, 92, 92, 92, 109, + 117, 118, 94, 107, 110, 92, 92, 92, 92, 92, + 92, 96, 95, 96, 96, 96, 96, 96, 96, 96, + 96, 110, 123, 115, 124, 126, 167, 167, 127, 122, + 1623, 96, 128, 131, 123, 92, 92, 92, 92, 92, + 92, 92, 122, 122, 127, 124, 126, 128, 127, 115, + + 115, 129, 130, 131, 133, 134, 135, 96, 115, 220, + 129, 136, 137, 139, 130, 153, 220, 137, 134, 140, + 143, 141, 130, 141, 133, 144, 153, 145, 140, 135, + 142, 136, 144, 139, 140, 143, 145, 142, 148, 142, + 146, 146, 147, 149, 146, 151, 154, 150, 152, 168, + 159, 144, 149, 159, 148, 147, 150, 152, 146, 166, + 152, 171, 149, 151, 154, 157, 157, 157, 157, 163, + 165, 157, 163, 164, 164, 191, 174, 175, 165, 176, + 192, 200, 157, 196, 199, 198, 207, 187, 206, 166, + 174, 202, 166, 204, 175, 200, 157, 212, 176, 192, + + 198, 191, 207, 168, 199, 204, 202, 206, 208, 159, + 212, 171, 205, 196, 203, 203, 159, 1627, 181, 181, + 181, 181, 181, 181, 181, 181, 187, 208, 163, 203, + 205, 164, 210, 187, 210, 163, 181, 182, 182, 182, + 182, 182, 182, 182, 182, 183, 240, 183, 211, 211, + 183, 183, 183, 183, 183, 183, 183, 183, 209, 214, + 215, 215, 240, 209, 214, 213, 184, 181, 184, 184, + 184, 184, 184, 184, 184, 184, 185, 213, 185, 185, + 185, 185, 185, 185, 185, 185, 216, 221, 221, 217, + 219, 216, 225, 227, 236, 228, 185, 188, 217, 188, + + 188, 188, 188, 188, 188, 188, 188, 1629, 219, 230, + 225, 227, 184, 218, 218, 218, 218, 228, 232, 226, + 236, 230, 185, 186, 186, 186, 186, 186, 186, 186, + 186, 229, 232, 234, 233, 252, 188, 186, 186, 186, + 186, 186, 186, 188, 222, 226, 231, 234, 235, 222, + 226, 229, 233, 235, 237, 231, 238, 239, 241, 273, + 245, 242, 305, 241, 305, 244, 239, 186, 186, 186, + 186, 186, 186, 186, 237, 218, 242, 243, 239, 244, + 245, 246, 247, 247, 255, 246, 243, 218, 273, 251, + 270, 262, 238, 252, 218, 261, 218, 248, 253, 248, + + 248, 248, 248, 255, 248, 261, 263, 253, 262, 248, + 274, 283, 263, 279, 248, 248, 248, 248, 248, 251, + 272, 270, 251, 277, 278, 283, 248, 260, 260, 260, + 260, 274, 288, 279, 1632, 260, 270, 272, 277, 260, + 278, 308, 308, 280, 288, 248, 265, 265, 265, 265, + 265, 265, 265, 265, 266, 266, 266, 266, 266, 266, + 266, 266, 267, 280, 267, 267, 267, 267, 267, 267, + 267, 267, 271, 281, 271, 271, 271, 271, 271, 271, + 271, 271, 284, 286, 286, 286, 286, 287, 1639, 294, + 291, 303, 292, 297, 311, 311, 303, 289, 294, 281, + + 284, 267, 291, 271, 281, 292, 287, 297, 267, 268, + 268, 268, 268, 268, 268, 268, 268, 289, 271, 276, + 295, 290, 276, 268, 268, 268, 268, 268, 268, 276, + 296, 1640, 298, 299, 299, 299, 299, 300, 295, 310, + 276, 290, 313, 306, 310, 286, 298, 302, 276, 307, + 296, 313, 300, 268, 268, 268, 268, 268, 268, 268, + 301, 302, 306, 315, 286, 309, 286, 314, 301, 301, + 304, 304, 304, 304, 312, 307, 316, 322, 1641, 312, + 307, 320, 309, 315, 317, 317, 314, 319, 324, 317, + 320, 322, 319, 331, 323, 325, 316, 323, 326, 325, + + 324, 327, 329, 328, 333, 333, 332, 299, 327, 325, + 328, 334, 326, 331, 299, 1642, 299, 330, 330, 330, + 330, 332, 335, 329, 336, 338, 337, 330, 339, 336, + 337, 340, 304, 339, 335, 334, 304, 342, 341, 343, + 338, 304, 344, 345, 304, 347, 342, 350, 339, 357, + 351, 304, 341, 304, 343, 351, 340, 359, 358, 350, + 362, 364, 344, 370, 347, 358, 366, 369, 357, 345, + 370, 365, 364, 369, 345, 377, 371, 1643, 359, 330, + 361, 373, 361, 361, 361, 361, 361, 361, 361, 361, + 362, 363, 366, 363, 363, 363, 363, 363, 363, 363, + + 363, 365, 371, 372, 375, 374, 362, 373, 378, 383, + 376, 361, 573, 377, 379, 382, 372, 375, 379, 390, + 573, 363, 390, 383, 382, 378, 361, 374, 376, 381, + 381, 381, 381, 384, 384, 384, 384, 363, 386, 386, + 386, 386, 387, 388, 389, 391, 393, 387, 388, 394, + 393, 396, 396, 389, 394, 398, 399, 400, 401, 391, + 402, 402, 405, 404, 400, 406, 412, 386, 408, 398, + 407, 399, 403, 403, 403, 403, 405, 401, 404, 407, + 406, 409, 408, 410, 411, 415, 412, 414, 414, 416, + 433, 417, 416, 409, 417, 384, 418, 419, 423, 410, + + 386, 411, 419, 421, 433, 415, 420, 420, 420, 420, + 381, 425, 381, 422, 425, 421, 418, 422, 559, 426, + 427, 428, 429, 429, 423, 426, 430, 427, 559, 426, + 439, 430, 431, 431, 432, 432, 432, 432, 403, 435, + 435, 428, 438, 403, 423, 439, 403, 436, 436, 436, + 436, 438, 440, 403, 442, 403, 443, 436, 437, 437, + 437, 437, 441, 444, 445, 446, 448, 447, 420, 442, + 437, 447, 440, 451, 444, 450, 443, 420, 441, 449, + 450, 453, 448, 458, 445, 446, 452, 420, 449, 420, + 452, 451, 454, 466, 468, 467, 432, 454, 453, 471, + + 458, 467, 474, 475, 479, 521, 521, 470, 468, 470, + 470, 470, 470, 470, 470, 470, 470, 472, 466, 472, + 472, 472, 472, 472, 472, 472, 472, 473, 476, 477, + 474, 475, 471, 478, 479, 481, 480, 470, 482, 476, + 473, 483, 488, 489, 477, 471, 481, 482, 493, 488, + 472, 480, 496, 470, 596, 496, 596, 478, 490, 490, + 490, 490, 489, 472, 491, 491, 491, 491, 505, 497, + 499, 499, 499, 499, 493, 505, 506, 493, 497, 508, + 515, 483, 507, 516, 509, 517, 519, 520, 508, 523, + 526, 518, 520, 491, 506, 524, 507, 509, 518, 517, + + 529, 515, 525, 516, 523, 519, 1203, 525, 524, 534, + 526, 527, 527, 527, 527, 528, 531, 532, 529, 533, + 528, 537, 530, 530, 530, 530, 532, 542, 534, 544, + 531, 542, 499, 533, 549, 535, 535, 535, 535, 543, + 543, 543, 543, 546, 545, 552, 549, 537, 1203, 544, + 545, 547, 547, 547, 547, 548, 546, 552, 554, 554, + 548, 555, 550, 550, 550, 550, 553, 537, 551, 551, + 551, 551, 561, 527, 550, 641, 555, 558, 553, 551, + 556, 556, 562, 563, 561, 566, 563, 562, 564, 557, + 581, 557, 527, 530, 641, 557, 582, 535, 557, 588, + + 535, 543, 558, 530, 582, 530, 535, 557, 560, 535, + 565, 564, 590, 581, 585, 589, 535, 587, 560, 588, + 560, 566, 565, 587, 560, 592, 589, 560, 583, 583, + 583, 583, 603, 603, 591, 817, 560, 593, 590, 584, + 583, 584, 584, 584, 584, 584, 584, 584, 584, 585, + 591, 614, 593, 605, 583, 592, 600, 817, 614, 586, + 585, 586, 586, 586, 586, 586, 586, 586, 586, 613, + 600, 601, 584, 605, 613, 583, 597, 597, 597, 597, + 601, 602, 602, 602, 602, 584, 606, 606, 606, 606, + 611, 611, 611, 611, 586, 612, 621, 623, 621, 622, + + 622, 622, 622, 624, 623, 586, 628, 602, 602, 625, + 627, 631, 634, 627, 639, 612, 631, 624, 625, 630, + 630, 630, 630, 633, 628, 632, 632, 632, 632, 635, + 634, 710, 640, 646, 639, 633, 642, 644, 597, 640, + 643, 643, 643, 643, 710, 635, 645, 646, 648, 650, + 647, 606, 611, 656, 645, 658, 648, 597, 656, 597, + 658, 622, 660, 644, 611, 647, 660, 606, 606, 606, + 835, 611, 642, 611, 665, 650, 835, 669, 650, 665, + 622, 630, 622, 655, 655, 655, 655, 676, 667, 659, + 659, 659, 659, 662, 662, 662, 662, 669, 666, 676, + + 630, 668, 643, 666, 662, 643, 632, 663, 663, 663, + 663, 643, 670, 670, 643, 659, 659, 663, 667, 668, + 672, 643, 664, 664, 664, 664, 671, 673, 671, 674, + 675, 679, 673, 664, 677, 677, 678, 680, 678, 681, + 672, 682, 680, 683, 682, 674, 684, 698, 682, 675, + 685, 679, 692, 682, 685, 692, 682, 699, 683, 681, + 704, 706, 684, 715, 777, 777, 682, 700, 700, 700, + 700, 711, 715, 699, 707, 1644, 706, 698, 703, 700, + 703, 703, 703, 703, 703, 703, 703, 703, 705, 707, + 705, 705, 705, 705, 705, 705, 705, 705, 713, 711, + + 714, 714, 714, 714, 716, 719, 704, 720, 738, 726, + 719, 692, 725, 703, 720, 737, 1068, 738, 716, 713, + 721, 721, 721, 721, 703, 722, 722, 722, 722, 741, + 737, 725, 1068, 741, 705, 726, 739, 748, 726, 732, + 732, 732, 732, 736, 736, 736, 736, 721, 742, 748, + 739, 722, 722, 740, 740, 740, 740, 744, 744, 744, + 744, 750, 742, 749, 749, 749, 749, 1645, 751, 754, + 750, 752, 752, 752, 752, 753, 754, 758, 761, 755, + 753, 714, 751, 714, 755, 757, 757, 757, 757, 758, + 759, 763, 768, 761, 759, 767, 767, 767, 767, 769, + + 779, 778, 776, 780, 781, 781, 768, 798, 769, 763, + 797, 797, 818, 732, 779, 740, 818, 736, 780, 799, + 732, 778, 732, 803, 736, 798, 736, 1646, 776, 786, + 786, 786, 786, 752, 740, 802, 740, 776, 744, 799, + 744, 803, 752, 809, 749, 802, 749, 787, 787, 787, + 787, 1649, 752, 809, 752, 786, 786, 767, 789, 789, + 789, 789, 790, 790, 790, 790, 757, 793, 793, 793, + 793, 794, 794, 794, 794, 787, 767, 800, 767, 801, + 804, 794, 801, 804, 808, 789, 800, 808, 790, 790, + 795, 795, 795, 795, 805, 806, 807, 807, 810, 805, + + 806, 811, 812, 813, 811, 814, 815, 815, 816, 787, + 819, 820, 845, 816, 824, 813, 810, 824, 836, 814, + 812, 830, 830, 830, 830, 819, 845, 848, 848, 793, + 837, 834, 793, 830, 831, 831, 831, 831, 793, 820, + 1652, 793, 834, 847, 836, 833, 831, 830, 793, 832, + 837, 832, 832, 832, 832, 832, 832, 832, 832, 833, + 831, 841, 840, 847, 861, 859, 844, 824, 830, 840, + 844, 833, 946, 824, 795, 856, 856, 856, 856, 859, + 841, 831, 860, 861, 862, 862, 862, 862, 863, 860, + 864, 866, 875, 878, 946, 832, 866, 863, 865, 865, + + 865, 865, 878, 874, 864, 870, 870, 870, 870, 873, + 874, 875, 877, 879, 873, 881, 876, 876, 876, 876, + 880, 884, 887, 888, 880, 893, 877, 879, 888, 881, + 885, 885, 885, 885, 893, 894, 884, 889, 889, 889, + 889, 896, 887, 892, 892, 892, 892, 895, 896, 894, + 902, 903, 895, 906, 905, 907, 856, 933, 856, 920, + 865, 905, 921, 922, 902, 862, 933, 862, 1674, 903, + 921, 906, 865, 928, 907, 923, 870, 922, 1187, 865, + 904, 904, 904, 904, 927, 920, 870, 876, 870, 1187, + 923, 928, 885, 916, 916, 916, 916, 876, 927, 876, + + 912, 912, 912, 912, 913, 913, 913, 913, 924, 930, + 931, 885, 919, 919, 919, 919, 924, 929, 889, 934, + 889, 916, 929, 930, 892, 936, 892, 912, 931, 936, + 913, 913, 925, 925, 925, 925, 932, 937, 938, 934, + 939, 932, 904, 940, 941, 939, 942, 943, 944, 947, + 937, 949, 940, 948, 904, 942, 938, 945, 948, 954, + 945, 904, 943, 947, 941, 950, 963, 954, 944, 949, + 960, 964, 968, 963, 919, 967, 964, 919, 960, 972, + 950, 968, 975, 919, 972, 987, 919, 991, 1064, 967, + 989, 1064, 987, 919, 973, 973, 973, 973, 988, 989, + + 990, 975, 985, 985, 985, 985, 991, 990, 992, 992, + 992, 992, 988, 993, 994, 995, 925, 1005, 1006, 995, + 973, 973, 994, 1007, 1011, 1008, 1009, 1006, 993, 1011, + 1013, 1005, 1008, 1010, 1010, 1010, 1010, 1014, 1014, 1014, + 1014, 1015, 1017, 1007, 1018, 1009, 1024, 1023, 1025, 1026, + 1013, 1032, 1025, 1015, 1023, 1029, 1029, 1029, 1029, 1035, + 1675, 1017, 1036, 1026, 1018, 1024, 1034, 1034, 1034, 1034, + 1036, 1032, 1038, 1039, 1035, 1053, 985, 1037, 1037, 1037, + 1037, 1676, 992, 985, 1046, 1046, 1046, 1046, 1055, 992, + 1054, 1054, 1038, 1039, 1057, 1010, 1047, 1047, 1047, 1047, + + 1056, 1053, 1059, 1061, 1010, 1060, 1060, 1061, 1055, 1057, + 1053, 1063, 1062, 1065, 1056, 1066, 1677, 1069, 1014, 1062, + 1059, 1067, 1047, 1047, 1067, 1070, 1063, 1065, 1070, 1029, + 1066, 1067, 1069, 1074, 1074, 1072, 1029, 1077, 1071, 1037, + 1034, 1073, 1078, 1076, 1080, 1079, 1077, 1034, 1037, 1046, + 1072, 1037, 1071, 1081, 1075, 1073, 1075, 1079, 1085, 1075, + 1075, 1076, 1078, 1090, 1080, 1046, 1091, 1046, 1081, 1095, + 1091, 1096, 1099, 1116, 1095, 1085, 1099, 1115, 1096, 1101, + 1116, 1091, 1115, 1067, 1100, 1100, 1100, 1100, 1114, 1114, + 1114, 1114, 1117, 1090, 1118, 1119, 1130, 1075, 1120, 1101, + + 1131, 1130, 1143, 1118, 1137, 1678, 1117, 1131, 1137, 1119, + 1100, 1100, 1133, 1120, 1121, 1121, 1121, 1121, 1128, 1128, + 1128, 1128, 1132, 1132, 1132, 1132, 1133, 1134, 1135, 1135, + 1135, 1135, 1136, 1139, 1141, 1150, 1134, 1149, 1143, 1151, + 1151, 1151, 1151, 1152, 1150, 1159, 1136, 1160, 1152, 1141, + 1114, 1149, 1139, 1157, 1157, 1157, 1157, 1161, 1436, 1163, + 1164, 1160, 1162, 1162, 1162, 1162, 1202, 1179, 1180, 1114, + 1188, 1114, 1161, 1163, 1436, 1164, 1121, 1165, 1165, 1165, + 1165, 1179, 1183, 1159, 1132, 1188, 1180, 1182, 1121, 1128, + 1171, 1171, 1171, 1171, 1182, 1121, 1185, 1185, 1186, 1135, + + 1183, 1151, 1190, 1132, 1202, 1132, 1172, 1172, 1172, 1172, + 1151, 1173, 1173, 1173, 1173, 1197, 1171, 1171, 1181, 1181, + 1181, 1181, 1190, 1186, 1157, 1191, 1192, 1157, 1195, 1201, + 1204, 1193, 1191, 1162, 1193, 1197, 1162, 1173, 1173, 1165, + 1198, 1193, 1199, 1200, 1192, 1207, 1195, 1198, 1165, 1201, + 1200, 1206, 1208, 1209, 1208, 1210, 1211, 1208, 1208, 1214, + 1199, 1218, 1214, 1224, 1207, 1219, 1206, 1220, 1223, 1241, + 1204, 1172, 1223, 1209, 1211, 1243, 1218, 1224, 1241, 1243, + 1181, 1245, 1242, 1210, 1244, 1262, 1245, 1172, 1679, 1172, + 1246, 1219, 1181, 1220, 1262, 1208, 1242, 1246, 1244, 1181, + + 1228, 1228, 1228, 1228, 1231, 1231, 1231, 1231, 1232, 1232, + 1232, 1232, 1239, 1239, 1239, 1239, 1240, 1240, 1240, 1240, + 1247, 1248, 1249, 1249, 1249, 1249, 1250, 1247, 1251, 1254, + 1254, 1254, 1254, 1259, 1260, 1263, 1251, 1259, 1266, 1248, + 1265, 1250, 1261, 1261, 1261, 1261, 1264, 1265, 1260, 1263, + 1271, 1264, 1269, 1267, 1267, 1267, 1267, 1681, 1266, 1293, + 1280, 1274, 1277, 1277, 1277, 1277, 1279, 1280, 1282, 1290, + 1271, 1279, 1281, 1281, 1281, 1281, 1283, 1291, 1294, 1293, + 1283, 1296, 1282, 1292, 1291, 1309, 1239, 1274, 1269, 1232, + 1274, 1232, 1294, 1239, 1306, 1296, 1249, 1240, 1683, 1240, + + 1309, 1292, 1312, 1249, 1289, 1289, 1289, 1289, 1314, 1290, + 1254, 1314, 1254, 1310, 1306, 1267, 1295, 1295, 1295, 1295, + 1316, 1310, 1312, 1261, 1267, 1261, 1300, 1300, 1300, 1300, + 1687, 1317, 1688, 1277, 1303, 1303, 1303, 1303, 1308, 1308, + 1308, 1308, 1318, 1281, 1319, 1316, 1317, 1311, 1311, 1311, + 1311, 1334, 1300, 1300, 1313, 1313, 1313, 1313, 1323, 1323, + 1318, 1324, 1319, 1325, 1328, 1333, 1313, 1328, 1320, 1320, + 1320, 1335, 1320, 1338, 1333, 1289, 1336, 1349, 1339, 1324, + 1353, 1325, 1326, 1326, 1326, 1353, 1326, 1295, 1348, 1334, + 1340, 1338, 1320, 1339, 1340, 1367, 1371, 1372, 1344, 1344, + + 1371, 1348, 1367, 1349, 1368, 1328, 1326, 1374, 1303, 1311, + 1320, 1372, 1308, 1335, 1344, 1303, 1336, 1370, 1311, 1308, + 1689, 1311, 1370, 1368, 1326, 1343, 1343, 1374, 1343, 1343, + 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, 1343, + 1343, 1343, 1343, 1343, 1388, 1344, 1355, 1355, 1355, 1355, + 1375, 1376, 1343, 1343, 1343, 1343, 1343, 1343, 1373, 1373, + 1373, 1373, 1426, 1388, 1375, 1387, 1376, 1384, 1384, 1384, + 1384, 1386, 1387, 1389, 1390, 1393, 1386, 1389, 1392, 1392, + 1392, 1392, 1397, 1404, 1343, 1343, 1343, 1343, 1390, 1393, + 1398, 1398, 1403, 1405, 1415, 1690, 1403, 1404, 1418, 1472, + + 1426, 1397, 1406, 1406, 1406, 1406, 1414, 1414, 1414, 1414, + 1417, 1427, 1428, 1405, 1415, 1343, 1472, 1417, 1418, 1430, + 1373, 1424, 1424, 1424, 1424, 1427, 1431, 1428, 1429, 1429, + 1429, 1429, 1373, 1430, 1432, 1432, 1432, 1432, 1384, 1435, + 1694, 1431, 1433, 1433, 1433, 1433, 1437, 1434, 1434, 1392, + 1434, 1438, 1438, 1440, 1433, 1437, 1441, 1435, 1434, 1439, + 1439, 1442, 1453, 1443, 1406, 1444, 1444, 1445, 1414, 1448, + 1445, 1440, 1449, 1406, 1441, 1446, 1446, 1447, 1447, 1442, + 1414, 1443, 1450, 1451, 1452, 1452, 1454, 1448, 1455, 1459, + 1449, 1460, 1424, 1462, 1462, 1424, 1432, 1695, 1459, 1429, + + 1450, 1451, 1429, 1455, 1453, 1432, 1460, 1461, 1475, 1462, + 1471, 1471, 1475, 1487, 1488, 1495, 1461, 1483, 1483, 1483, + 1483, 1489, 1495, 1488, 1491, 1489, 1454, 1487, 1512, 1491, + 1492, 1492, 1492, 1492, 1505, 1697, 1553, 1471, 1505, 1553, + 1462, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, + 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, 1464, + 1493, 1496, 1506, 1530, 1512, 1507, 1510, 1544, 1464, 1464, + 1464, 1464, 1464, 1464, 1507, 1493, 1506, 1513, 1530, 1496, + 1508, 1508, 1508, 1508, 1509, 1519, 1510, 1544, 1541, 1509, + 1519, 1483, 1517, 1517, 1517, 1517, 1513, 1522, 1555, 1555, + + 1464, 1464, 1464, 1464, 1492, 1521, 1521, 1521, 1521, 1556, + 1556, 1522, 1524, 1524, 1524, 1524, 1529, 1529, 1529, 1529, + 1532, 1532, 1532, 1532, 1540, 1540, 1540, 1540, 1541, 1542, + 1543, 1464, 1545, 1547, 1557, 1557, 1542, 1546, 1546, 1546, + 1546, 1550, 1508, 1552, 1558, 1558, 1545, 1547, 1543, 1548, + 1548, 1508, 1548, 1551, 1560, 1698, 1550, 1552, 1551, 1554, + 1548, 1559, 1554, 1517, 1559, 1561, 1562, 1572, 1561, 1562, + 1563, 1563, 1560, 1564, 1564, 1570, 1521, 1565, 1565, 1566, + 1566, 1567, 1532, 1571, 1567, 1572, 1524, 1573, 1700, 1570, + 1529, 1532, 1582, 1582, 1603, 1540, 1703, 1571, 1707, 1603, + + 1604, 1573, 1589, 1593, 1593, 1593, 1593, 1604, 1546, 1581, + 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, + 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1581, 1589, 1606, + 1607, 1593, 1609, 1606, 1709, 1618, 1581, 1581, 1581, 1581, + 1581, 1581, 1618, 1710, 1607, 1608, 1608, 1608, 1608, 1620, + 1582, 1711, 1609, 1613, 1613, 1613, 1613, 1617, 1619, 1619, + 1619, 1619, 1617, 1620, 1625, 1631, 1648, 1712, 1581, 1581, + 1581, 1581, 1621, 1630, 1636, 1651, 1621, 1630, 1634, 1634, + 1634, 1634, 1638, 1718, 1625, 1631, 1648, 1650, 1636, 1637, + 1637, 1637, 1637, 1653, 1650, 1651, 1638, 1654, 1653, 1581, + + 1647, 1647, 1647, 1647, 1655, 1656, 1657, 1608, 1661, 1657, + 1658, 1653, 1659, 1658, 1663, 1659, 1662, 1654, 1660, 1608, + 1664, 1660, 1655, 1656, 1613, 1665, 1661, 1666, 1665, 1619, + 1666, 1662, 1663, 1667, 1668, 1669, 1667, 1668, 1664, 1670, + 1671, 1672, 1673, 1673, 1686, 1672, 1719, 1671, 1720, 1634, + 1680, 1680, 1692, 1669, 1682, 1682, 1702, 1670, 1706, 1716, + 1637, 1704, 1647, 1699, 1699, 1699, 1699, 1701, 1704, 1721, + 1702, 1701, 1715, 1706, 1647, 1685, 1685, 1722, 1723, 1716, + 1692, 1705, 1705, 1705, 1705, 1714, 1715, 1724, 1725, 1714, + 1717, 1717, 1717, 1717, 1730, 1725, 1729, 1729, 1729, 1729, + + 1732, 1733, 1686, 1734, 1734, 1734, 1734, 1736, 1680, 1738, + 1739, 1739, 1682, 1684, 1684, 1684, 1684, 1684, 1684, 1684, + 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, 1684, + 1684, 1684, 1735, 1685, 1726, 1741, 1749, 1699, 1758, 1744, + 1684, 1684, 1684, 1684, 1684, 1684, 1741, 1735, 1737, 1737, + 1737, 1737, 1717, 1740, 1726, 1705, 1742, 1744, 1740, 1757, + 1757, 1717, 1745, 1743, 1746, 1747, 1748, 1752, 1753, 1750, + 1729, 1742, 1684, 1684, 1684, 1684, 1751, 1734, 1743, 1754, + 1745, 1748, 1746, 1747, 1750, 1752, 1753, 1755, 1760, 1756, + 1759, 1751, 1761, 1762, 1763, 1764, 1766, 1754, 1767, 1759, + + 1768, 1769, 1770, 1684, 1756, 1755, 1771, 1773, 1760, 1774, + 1737, 1775, 1777, 1778, 1780, 1781, 1782, 1783, 1784, 1737, + 1781, 1785, 1786, 1788, 1790, 1792, 1773, 1787, 1787, 1787, + 1787, 1783, 1789, 1791, 1791, 1791, 1791, 1789, 1795, 1792, + 1796, 1797, 1798, 1799, 1801, 1801, 1801, 1801, 1803, 1804, + 1804, 1804, 1804, 1805, 1766, 1806, 1767, 1807, 1806, 1808, + 1809, 1810, 1803, 1811, 1815, 1812, 1813, 1805, 1814, 1816, + 1817, 1818, 1819, 1820, 1821, 1822, 1824, 1826, 1811, 1807, + 1812, 1813, 1823, 1814, 1808, 1823, 1818, 1819, 1820, 1821, + 1824, 1825, 1827, 1828, 1829, 1831, 1825, 1832, 1787, 1833, + + 1834, 1835, 1837, 1839, 1791, 1840, 1841, 1843, 1845, 1840, + 1846, 1847, 1850, 1841, 1846, 1801, 1851, 1852, 1853, 1854, + 1804, 1855, 1857, 1856, 1852, 1858, 1859, 1860, 1861, 1862, + 1855, 1847, 1863, 1864, 1865, 1866, 1866, 1854, 1853, 1856, + 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, + 1877, 1878, 1865, 1879, 1880, 1881, 1882, 1883, 1867, 1884, + 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1893, + 1890, 1894, 1895, 1896, 1897, 1899, 1900, 1901, 1888, 1908, + 1909, 1891, 1910, 1889, 1911, 1912, 1915, 1892, 1913, 1909, + 1912, 1913, 1916, 1917, 1919, 1922, 1923, 1924, 1926, 1929, + + 1933, 1933, 1932, 1934, 1935, 1938, 1939, 1941, 1940, 1942, + 1922, 1940, 1944, 1944, 1923, 1924, 1932, 1945, 1934, 1948, + 1951, 1949, 1948, 1952, 1939, 1953, 1954, 1984, 1986, 1989, + 1615, 1614, 1612, 1611, 1610, 1945, 1949, 1605, 1951, 1602, + 1953, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, 1956, + 1956, 1956, 1957, 1957, 1957, 1957, 1601, 1957, 1957, 1957, + 1957, 1957, 1957, 1958, 1958, 1958, 1599, 1598, 1596, 1595, + 1594, 1592, 1958, 1959, 1959, 1591, 1590, 1959, 1960, 1960, + 1588, 1587, 1960, 1961, 1586, 1585, 1961, 1962, 1962, 1584, + 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1962, 1963, 1963, + + 1583, 1963, 1964, 1964, 1580, 1964, 1964, 1964, 1964, 1964, + 1964, 1964, 1964, 1965, 1579, 1578, 1965, 1966, 1966, 1577, + 1576, 1966, 1967, 1967, 1575, 1967, 1967, 1967, 1967, 1967, + 1967, 1967, 1967, 1968, 1574, 1569, 1968, 1969, 1969, 1568, + 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1969, 1970, 1539, + 1538, 1970, 1971, 1537, 1536, 1971, 1972, 1972, 1535, 1972, + 1972, 1972, 1972, 1972, 1972, 1972, 1972, 1973, 1973, 1534, + 1973, 1973, 1973, 1973, 1973, 1973, 1973, 1973, 1974, 1974, + 1533, 1531, 1528, 1527, 1525, 1520, 1518, 1974, 1975, 1975, + 1516, 1515, 1514, 1511, 1504, 1502, 1501, 1975, 1976, 1976, + + 1500, 1499, 1976, 1498, 1976, 1494, 1490, 1976, 1977, 1977, + 1486, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1977, 1978, + 1978, 1485, 1978, 1978, 1978, 1978, 1978, 1978, 1978, 1978, + 1979, 1979, 1484, 1482, 1481, 1480, 1979, 1979, 1979, 1979, + 1980, 1980, 1478, 1477, 1476, 1474, 1470, 1469, 1468, 1980, + 1981, 1981, 1467, 1466, 1465, 1463, 1981, 1981, 1981, 1981, + 1982, 1982, 1458, 1457, 1456, 1425, 1982, 1982, 1982, 1982, + 1983, 1983, 1423, 1983, 1983, 1983, 1983, 1983, 1983, 1983, + 1983, 1985, 1985, 1985, 1985, 1985, 1985, 1985, 1985, 1985, + 1985, 1985, 1987, 1987, 1422, 1987, 1987, 1987, 1987, 1987, + + 1987, 1987, 1987, 1988, 1988, 1420, 1419, 1416, 1413, 1988, + 1988, 1988, 1988, 1990, 1990, 1412, 1411, 1410, 1409, 1990, + 1990, 1990, 1990, 1991, 1991, 1408, 1407, 1402, 1401, 1991, + 1991, 1991, 1991, 1992, 1992, 1992, 1992, 1992, 1992, 1992, + 1992, 1992, 1992, 1992, 1993, 1993, 1400, 1993, 1993, 1993, + 1993, 1993, 1993, 1993, 1993, 1994, 1994, 1994, 1994, 1994, + 1994, 1994, 1994, 1994, 1994, 1994, 1995, 1995, 1399, 1995, + 1995, 1995, 1995, 1995, 1995, 1995, 1995, 1996, 1996, 1396, + 1996, 1996, 1996, 1996, 1996, 1996, 1996, 1996, 1997, 1997, + 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1997, 1998, + + 1998, 1394, 1998, 1998, 1998, 1998, 1998, 1998, 1998, 1998, + 1999, 1999, 1391, 1999, 1999, 1999, 1999, 1999, 1999, 1999, + 1999, 2000, 2000, 1385, 2000, 2000, 2000, 2000, 2000, 2000, + 2000, 2000, 2001, 2001, 1383, 2001, 2001, 2001, 2001, 2001, + 2001, 2001, 2001, 2002, 2002, 1382, 2002, 2002, 2002, 2002, + 2002, 2002, 2002, 2002, 2003, 2003, 1381, 2003, 2003, 2003, + 2003, 2003, 2003, 2003, 2003, 2004, 2004, 1380, 2004, 2004, + 2004, 2004, 2004, 2004, 2004, 2004, 2005, 2005, 1379, 2005, + 2005, 2005, 2005, 2005, 2005, 2005, 2005, 2006, 2006, 1378, + 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2007, 2007, + + 1377, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 2007, 1369, + 1366, 1365, 1364, 1363, 1362, 1361, 1360, 1359, 1358, 1357, + 1356, 1352, 1351, 1350, 1347, 1346, 1345, 1342, 1341, 1337, + 1332, 1331, 1330, 1329, 1327, 1321, 1315, 1307, 1305, 1304, + 1302, 1301, 1299, 1288, 1287, 1286, 1285, 1284, 1278, 1276, + 1275, 1272, 1270, 1268, 1258, 1257, 1256, 1255, 1253, 1252, + 1238, 1237, 1236, 1235, 1234, 1233, 1230, 1229, 1227, 1226, + 1225, 1222, 1221, 1217, 1216, 1215, 1213, 1212, 1205, 1196, + 1194, 1189, 1184, 1178, 1177, 1176, 1175, 1174, 1170, 1169, + 1168, 1167, 1166, 1158, 1156, 1155, 1153, 1148, 1147, 1146, + + 1145, 1144, 1142, 1140, 1138, 1129, 1127, 1126, 1125, 1124, + 1123, 1113, 1112, 1111, 1110, 1109, 1108, 1107, 1106, 1105, + 1104, 1103, 1102, 1098, 1094, 1093, 1092, 1088, 1087, 1086, + 1084, 1083, 1058, 1052, 1051, 1050, 1049, 1048, 1045, 1043, + 1042, 1041, 1040, 1033, 1031, 1030, 1028, 1027, 1022, 1021, + 1020, 1019, 1016, 1012, 1004, 1003, 1002, 1001, 1000, 999, + 998, 997, 996, 986, 984, 983, 982, 981, 980, 979, + 978, 977, 976, 974, 971, 970, 969, 966, 965, 962, + 961, 959, 958, 957, 956, 953, 952, 935, 926, 917, + 914, 911, 910, 909, 908, 901, 900, 899, 898, 897, + + 891, 890, 886, 883, 882, 872, 871, 869, 868, 867, + 858, 857, 855, 854, 853, 852, 851, 850, 849, 843, + 842, 839, 838, 829, 828, 827, 826, 823, 822, 821, + 796, 791, 788, 785, 784, 783, 782, 775, 774, 773, + 772, 771, 766, 765, 764, 762, 760, 756, 747, 746, + 745, 743, 735, 734, 733, 731, 730, 729, 728, 727, + 723, 718, 717, 712, 709, 708, 702, 697, 696, 695, + 694, 693, 689, 688, 687, 686, 661, 657, 654, 653, + 652, 651, 649, 638, 637, 636, 629, 626, 620, 619, + 618, 617, 616, 615, 610, 609, 608, 607, 604, 599, + + 598, 595, 594, 580, 579, 576, 575, 574, 570, 569, + 568, 567, 541, 540, 539, 538, 536, 522, 514, 513, + 512, 511, 510, 504, 503, 502, 501, 500, 498, 495, + 494, 487, 486, 485, 484, 465, 464, 461, 460, 459, + 457, 456, 455, 434, 424, 413, 397, 395, 392, 385, + 380, 368, 360, 356, 355, 354, 353, 352, 349, 348, + 321, 318, 293, 285, 282, 269, 264, 259, 258, 257, + 256, 249, 224, 223, 201, 195, 194, 177, 173, 172, + 162, 161, 160, 156, 138, 112, 103, 102, 98, 85, + 84, 79, 74, 66, 60, 34, 26, 23, 21, 17, + + 11, 9, 7, 3, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, 1955, + 1955, 1955, 1955, 1955, 1955, 1955 + } ; /* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[95] = +static yyconst flex_int32_t yy_rule_can_match_eol[248] = { 0, -0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, }; +0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, + 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, }; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; @@ -1137,22 +2180,19 @@ This file must be translated to C and modified to build everywhere. Run flex like this: - flex -olex.yy.c vtkParse.l + flex --nodefault -olex.yy.c vtkParse.l Modify lex.yy.c: - - remove yyunput function - - remove TABs - - change yy_n_chars declarations from "int yy_n_chars;" to - "size_t yy_n_chars;" in both the yy_buffer_state structure - and the global scope. - - change num_to_read declaration from "int num_to_read;" to - "size_t num_to_read;" in yy_get_next_buffer function. + - convert tabs to spaces (8 spaces per tab) + - remove extra space from end of lines + - remove blank lines from end of file + - replace "int yyl" with "yy_size_t yyl" + - compile with gcc and "-Wsign-compare", there should be no warnings */ /* We do not care of interactive mode */ #define YY_NEVER_INTERACTIVE 1 -#define YY_NO_UNPUT 1 /* Do not include unistd.h in generated source. */ #define YY_NO_UNISTD_H @@ -1173,7 +2213,26 @@ Modify lex.yy.c: #pragma warning ( disable : 4786 ) #endif -#line 1179 "lex.yy.c" +#define SKIP_MATCH_MAXLEN 15 + +/* + * Skip ahead until one of the strings is found, + * then skip to the end of the line. + * Return 0 if no match found. + */ +static int skip_comment(); +static int skip_ahead_multi(const char *strings[]); +static int skip_ahead_until(const char *text); +static int skip_to_next_directive(); +static int skip_conditional_block(); + +static void print_preprocessor_error(int result, const char *cp, size_t n); +static const char *get_macro_arguments(); + +static void push_buffer(); +static int pop_buffer(); + +#line 2236 "lex.yy.c" #define INITIAL 0 @@ -1212,7 +2271,7 @@ FILE *yyget_out (void ); void yyset_out (FILE * out_str ); -int yyget_leng (void ); +yy_size_t yyget_leng (void ); char *yyget_text (void ); @@ -1232,6 +2291,8 @@ extern int yywrap (void ); #endif #endif + static void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif @@ -1252,12 +2313,7 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1265,7 +2321,7 @@ static int input (void ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1273,33 +2329,33 @@ static int input (void ); */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ + { \ + int c = '*'; \ + yy_size_t n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ \ #endif @@ -1348,1024 +2404,1986 @@ extern int yylex (void); #endif #define YY_RULE_SETUP \ - if ( yyleng > 0 ) \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ - (yytext[yyleng - 1] == '\n'); \ - YY_USER_ACTION + if ( yyleng > 0 ) \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \ + (yytext[yyleng - 1] == '\n'); \ + YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - -#line 49 "vtkParse.l" + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; +#line 65 "vtkParse.l" -#line 1372 "lex.yy.c" - if ( !(yy_init) ) - { - (yy_init) = 1; +#line 2424 "lex.yy.c" + + if ( !(yy_init) ) + { + (yy_init) = 1; #ifdef YY_USER_INIT - YY_USER_INIT; + YY_USER_INIT; #endif - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ - if ( ! yyin ) - yyin = stdin; + if ( ! yyin ) + yyin = stdin; - if ( ! yyout ) - yyout = stdout; + if ( ! yyout ) + yyout = stdout; - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } - yy_load_buffer_state( ); - } + yy_load_buffer_state( ); + } - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = (yy_c_buf_p); - /* Support of yytext. */ - *yy_cp = (yy_hold_char); + /* Support of yytext. */ + *yy_cp = (yy_hold_char); - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 772 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_base[yy_current_state] != 1714 ); + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1956 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 4605 ); yy_find_action: - yy_act = yy_accept[yy_current_state]; - if ( yy_act == 0 ) - { /* have to back up */ - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - yy_act = yy_accept[yy_current_state]; - } + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + yy_act = yy_accept[yy_current_state]; + } - YY_DO_BEFORE_ACTION; + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) + { + yy_size_t yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - yylineno++; ; - } + } -do_action: /* This label is used only to access EOF actions. */ +do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; + switch ( yy_act ) + { /* beginning of action switch */ + case 0: /* must back up */ + /* undo the effects of YY_DO_BEFORE_ACTION */ + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); + goto yy_find_action; case 1: YY_RULE_SETUP -#line 51 "vtkParse.l" -{ int c1 = 0, c2 = input(); - for (;;) - { - if (c2 == 0) - { - fprintf(yyout,"Cannot find closing comment.\n"); - break; - } - if (c1 == '*' && c2 == '/') break; - c1 = c2; c2 = input(); - } - }; - YY_BREAK +#line 67 "vtkParse.l" +{ skip_comment(); }; + YY_BREAK case 2: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 64 "vtkParse.l" -{ - int c1 = 0, c2 = 0, c3 = 0, c4 = 0, c5 = input(); - for (;;) - { - if (c5 == 0) - { - fprintf(yyout,"Cannot find matching //ETX.\n"); - break; - } - if (c1 == '/' && c2 == '/' && c3 == 'E' && c4 == 'T' && c5 == 'X') break; - c1 = c2; c2 = c3; c3 = c4; c4 = c5; c5 = input(); - } - for (;;) - { - if (c5 == 0) break; - if (c5 == '\n') break; - c5 = input(); - } +#line 69 "vtkParse.l" +{ + if (!IgnoreBTX) { + skip_ahead_until("//ETX"); + } }; - YY_BREAK + YY_BREAK case 3: YY_RULE_SETUP -#line 84 "vtkParse.l" -{ - int pos = 1; - while (yytext[pos-1] != 'M' || yytext[pos] != 'E') - { - pos++; - } - yylval.str = (char *)malloc(yyleng + 1 - pos - 1); - memcpy(yylval.str,yytext+ pos + 1,yyleng - pos - 1); - yylval.str[yyleng - pos - 1] = '\0'; - data.NameComment = vtkstrdup(yylval.str); - }; - YY_BREAK +#line 75 "vtkParse.l" +; + YY_BREAK case 4: YY_RULE_SETUP -#line 96 "vtkParse.l" -{ - CommentState = 1; - data.Description = (char*)malloc(100000); - data.Description[0] = '\0'; +#line 77 "vtkParse.l" +{ + skip_ahead_until("@end"); }; - YY_BREAK + YY_BREAK case 5: YY_RULE_SETUP -#line 102 "vtkParse.l" -{ - CommentState = 3; - data.SeeAlso = (char*)malloc(100000); - data.SeeAlso[0] = '\0'; +#line 81 "vtkParse.l" +{ + size_t pos = 1; + while (yytext[pos-1] != 'M' || yytext[pos] != 'E') + { + pos++; + } + data.NameComment = vtkstrndup(&yytext[pos + 1], yyleng - pos - 1); }; - YY_BREAK + YY_BREAK case 6: YY_RULE_SETUP -#line 108 "vtkParse.l" -{ - CommentState = 3; - data.SeeAlso = (char*)malloc(100000); - data.SeeAlso[0] = '\0'; - }; - YY_BREAK +#line 90 "vtkParse.l" +{ setCommentState(1); }; + YY_BREAK case 7: YY_RULE_SETUP -#line 114 "vtkParse.l" -{ - CommentState = 4; - data.Caveats = (char*)malloc(100000); - data.Caveats[0] = '\0'; - }; - YY_BREAK +#line 91 "vtkParse.l" +{ setCommentState(2); }; + YY_BREAK case 8: YY_RULE_SETUP -#line 120 "vtkParse.l" -{ - CommentState = 2; - HaveComment = 1; - CommentText[0] = '\0'; - }; - YY_BREAK +#line 92 "vtkParse.l" +{ setCommentState(3); }; + YY_BREAK case 9: -/* rule 9 can match eol */ YY_RULE_SETUP -#line 126 "vtkParse.l" -{ - HaveComment = 0; - CommentState = 0; - }; - YY_BREAK +#line 93 "vtkParse.l" +{ setCommentState(3); }; + YY_BREAK case 10: YY_RULE_SETUP -#line 131 "vtkParse.l" -{ - int pos = 1; - while (yytext[pos-1] != '/' || yytext[pos] != '/') pos++; - yylval.str = (char *)malloc(yyleng + 1 - pos - 1 + 1); - memcpy(yylval.str,yytext+ pos + 1,yyleng - pos - 1); - yylval.str[yyleng - pos - 1] = '\n'; - yylval.str[yyleng - pos] = '\0'; - switch (CommentState) - { - case 1: strcat(data.Description,yylval.str); break; - case 2: strcat(CommentText,yylval.str); break; - case 3: strcat(data.SeeAlso,yylval.str); break; - case 4: strcat(data.Caveats,yylval.str); break; - } - }; - YY_BREAK +#line 94 "vtkParse.l" +{ setCommentState(4); }; + YY_BREAK case 11: +/* rule 11 can match eol */ YY_RULE_SETUP -#line 147 "vtkParse.l" -; - YY_BREAK +#line 95 "vtkParse.l" +{ closeOrClearComment(); }; + YY_BREAK case 12: YY_RULE_SETUP -#line 149 "vtkParse.l" -; - YY_BREAK +#line 96 "vtkParse.l" +{ + size_t pos = 2; + while (yytext[pos-2] != '/' || yytext[pos-1] != '/') pos++; + addCommentLine(&yytext[pos], yyleng - pos); + }; + YY_BREAK case 13: -/* rule 13 can match eol */ YY_RULE_SETUP -#line 151 "vtkParse.l" +#line 102 "vtkParse.l" ; - YY_BREAK + YY_BREAK case 14: /* rule 14 can match eol */ YY_RULE_SETUP -#line 153 "vtkParse.l" +#line 104 "vtkParse.l" { - sscanf(yytext+1,"%d",&yylval.integer); return(ARRAY_NUM);} - YY_BREAK + int result; + MacroInfo *macro; + result = vtkParsePreprocess_HandleDirective(&preprocessor, yytext); + if (result == VTK_PARSE_OK) + { + macro = preprocessor.Macros[preprocessor.NumberOfMacros-1]; + if (!macro->IsFunction) + { + add_constant(macro->Name, vtkstrdup(macro->Definition), 0, NULL, 1); + } + } + }; + YY_BREAK case 15: /* rule 15 can match eol */ YY_RULE_SETUP -#line 157 "vtkParse.l" -return(CLASS_REF); - YY_BREAK +#line 118 "vtkParse.l" +{ + int result = 0; + result = vtkParsePreprocess_HandleDirective(&preprocessor, yytext); + if (result == VTK_PARSE_SKIP) + { + skip_conditional_block(); + } + else if (result != VTK_PARSE_OK) + { + print_preprocessor_error(result, yytext, yyleng); + } + }; + YY_BREAK case 16: /* rule 16 can match eol */ YY_RULE_SETUP -#line 159 "vtkParse.l" -return(VAR_FUNCTION); - YY_BREAK +#line 131 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(STRING_LITERAL); } + YY_BREAK case 17: /* rule 17 can match eol */ YY_RULE_SETUP -#line 161 "vtkParse.l" -return(SHORT); - YY_BREAK +#line 135 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(CHAR_LITERAL); } + YY_BREAK case 18: -/* rule 18 can match eol */ YY_RULE_SETUP -#line 162 "vtkParse.l" -return(LONG); - YY_BREAK +#line 139 "vtkParse.l" +; + YY_BREAK case 19: /* rule 19 can match eol */ YY_RULE_SETUP -#line 163 "vtkParse.l" -return(SHORT); - YY_BREAK +#line 141 "vtkParse.l" +{ + size_t i; size_t j = 0; + yylval.str = ""; + if (yytext[yyleng-1] == ')') + { + while (yytext[j]!='(') { j++; } + while (yytext[j]==' ' || yytext[j]=='\t') { j++; } + j++; i = j; + while (yytext[j]!=')' && yytext[j] != ' ' && yytext[j] != '\t') { j++; } + yylval.str = vtkstrndup(&yytext[i], j-i); + return(ID); + } + }; + YY_BREAK case 20: /* rule 20 can match eol */ YY_RULE_SETUP -#line 164 "vtkParse.l" -return(LONG); - YY_BREAK +#line 155 "vtkParse.l" +{ + return(CLASS_REF); + }; + YY_BREAK case 21: /* rule 21 can match eol */ YY_RULE_SETUP -#line 166 "vtkParse.l" -return(LONG_LONG); - YY_BREAK +#line 159 "vtkParse.l" +{ + return(CLASS_REF); + }; + YY_BREAK case 22: /* rule 22 can match eol */ YY_RULE_SETUP -#line 167 "vtkParse.l" -return(LONG_LONG); - YY_BREAK +#line 163 "vtkParse.l" +{ + return(CLASS_REF); + }; + YY_BREAK case 23: /* rule 23 can match eol */ YY_RULE_SETUP -#line 168 "vtkParse.l" -return(LONG_LONG); - YY_BREAK +#line 167 "vtkParse.l" +{ + size_t i = 0; size_t j = 0; + while (yytext[j] != '*') { i++; j++; } + i++; j++; + while (yytext[i] != ' ' && yytext[i] != '\t' && + yytext[i] != '\n' && yytext[i] != '\r' && yytext[i] != ')') {i++;} + yylval.str = vtkstrndup(&yytext[j], i-j); + return(VAR_FUNCTION); + }; + YY_BREAK case 24: +/* rule 24 can match eol */ YY_RULE_SETUP -#line 170 "vtkParse.l" -return(INT64__); - YY_BREAK +#line 177 "vtkParse.l" +return(LONG_DOUBLE); + YY_BREAK case 25: -/* rule 25 can match eol */ YY_RULE_SETUP -#line 172 "vtkParse.l" -return(SIGNED_CHAR); - YY_BREAK +#line 178 "vtkParse.l" +return(DOUBLE); + YY_BREAK case 26: YY_RULE_SETUP -#line 174 "vtkParse.l" -return(CLASS); - YY_BREAK +#line 179 "vtkParse.l" +return(FLOAT); + YY_BREAK case 27: +/* rule 27 can match eol */ YY_RULE_SETUP -#line 175 "vtkParse.l" -return(PUBLIC); - YY_BREAK +#line 181 "vtkParse.l" +return(UNSIGNED_INT64__); + YY_BREAK case 28: +/* rule 28 can match eol */ YY_RULE_SETUP -#line 176 "vtkParse.l" -return(PRIVATE); - YY_BREAK +#line 182 "vtkParse.l" +return(UNSIGNED_INT64__); + YY_BREAK case 29: +/* rule 29 can match eol */ YY_RULE_SETUP -#line 177 "vtkParse.l" -return(PROTECTED); - YY_BREAK +#line 184 "vtkParse.l" +return(INT64__); + YY_BREAK case 30: +/* rule 30 can match eol */ YY_RULE_SETUP -#line 178 "vtkParse.l" -return(INT); - YY_BREAK +#line 185 "vtkParse.l" +return(INT64__); + YY_BREAK case 31: YY_RULE_SETUP -#line 179 "vtkParse.l" -return(FLOAT); - YY_BREAK +#line 186 "vtkParse.l" +return(INT64__); + YY_BREAK case 32: +/* rule 32 can match eol */ YY_RULE_SETUP -#line 180 "vtkParse.l" -return(SHORT); - YY_BREAK +#line 188 "vtkParse.l" +return(UNSIGNED_LONG_LONG); + YY_BREAK case 33: +/* rule 33 can match eol */ YY_RULE_SETUP -#line 181 "vtkParse.l" -return(LONG); - YY_BREAK +#line 189 "vtkParse.l" +return(UNSIGNED_LONG_LONG); + YY_BREAK case 34: +/* rule 34 can match eol */ YY_RULE_SETUP -#line 182 "vtkParse.l" -return(DOUBLE); - YY_BREAK +#line 190 "vtkParse.l" +return(UNSIGNED_LONG_LONG); + YY_BREAK case 35: +/* rule 35 can match eol */ YY_RULE_SETUP -#line 183 "vtkParse.l" -return(VOID); - YY_BREAK +#line 191 "vtkParse.l" +return(UNSIGNED_LONG_LONG); + YY_BREAK case 36: +/* rule 36 can match eol */ YY_RULE_SETUP -#line 184 "vtkParse.l" -return(CHAR); - YY_BREAK +#line 192 "vtkParse.l" +return(UNSIGNED_LONG_LONG); + YY_BREAK case 37: +/* rule 37 can match eol */ YY_RULE_SETUP -#line 185 "vtkParse.l" -return(BOOL); - YY_BREAK +#line 193 "vtkParse.l" +return(UNSIGNED_LONG_LONG); + YY_BREAK case 38: +/* rule 38 can match eol */ YY_RULE_SETUP -#line 186 "vtkParse.l" -return(VIRTUAL); - YY_BREAK +#line 194 "vtkParse.l" +return(UNSIGNED_LONG_LONG); + YY_BREAK case 39: +/* rule 39 can match eol */ YY_RULE_SETUP -#line 187 "vtkParse.l" -return(CONST); - YY_BREAK +#line 195 "vtkParse.l" +return(UNSIGNED_LONG_LONG); + YY_BREAK case 40: +/* rule 40 can match eol */ YY_RULE_SETUP -#line 188 "vtkParse.l" -return(OPERATOR); - YY_BREAK +#line 197 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 41: +/* rule 41 can match eol */ YY_RULE_SETUP -#line 189 "vtkParse.l" -return(UNSIGNED); - YY_BREAK +#line 198 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 42: +/* rule 42 can match eol */ YY_RULE_SETUP -#line 190 "vtkParse.l" -return(FRIEND); - YY_BREAK +#line 199 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 43: +/* rule 43 can match eol */ YY_RULE_SETUP -#line 191 "vtkParse.l" -return(STATIC); - YY_BREAK +#line 200 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 44: +/* rule 44 can match eol */ YY_RULE_SETUP -#line 193 "vtkParse.l" -return(DOUBLE); - YY_BREAK +#line 201 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 45: +/* rule 45 can match eol */ YY_RULE_SETUP -#line 194 "vtkParse.l" -return(IdType); - YY_BREAK +#line 202 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 46: +/* rule 46 can match eol */ YY_RULE_SETUP -#line 195 "vtkParse.l" -return(StdString); - YY_BREAK +#line 203 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 47: +/* rule 47 can match eol */ YY_RULE_SETUP -#line 196 "vtkParse.l" -return(SetMacro); - YY_BREAK +#line 204 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 48: +/* rule 48 can match eol */ YY_RULE_SETUP -#line 197 "vtkParse.l" -return(GetMacro); - YY_BREAK +#line 205 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 49: +/* rule 49 can match eol */ YY_RULE_SETUP -#line 198 "vtkParse.l" -return(SetStringMacro); - YY_BREAK +#line 206 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 50: +/* rule 50 can match eol */ YY_RULE_SETUP -#line 199 "vtkParse.l" -return(GetStringMacro); - YY_BREAK +#line 207 "vtkParse.l" +return(LONG_LONG); + YY_BREAK case 51: +/* rule 51 can match eol */ YY_RULE_SETUP -#line 200 "vtkParse.l" -return(SetClampMacro); - YY_BREAK +#line 209 "vtkParse.l" +return(UNSIGNED_SHORT); + YY_BREAK case 52: +/* rule 52 can match eol */ YY_RULE_SETUP -#line 201 "vtkParse.l" -return(SetObjectMacro); - YY_BREAK +#line 210 "vtkParse.l" +return(UNSIGNED_SHORT); + YY_BREAK case 53: +/* rule 53 can match eol */ YY_RULE_SETUP -#line 202 "vtkParse.l" -return(SetReferenceCountedObjectMacro); - YY_BREAK +#line 211 "vtkParse.l" +return(UNSIGNED_SHORT); + YY_BREAK case 54: +/* rule 54 can match eol */ YY_RULE_SETUP -#line 203 "vtkParse.l" -return(GetObjectMacro); - YY_BREAK +#line 212 "vtkParse.l" +return(UNSIGNED_SHORT); + YY_BREAK case 55: +/* rule 55 can match eol */ YY_RULE_SETUP -#line 204 "vtkParse.l" -return(BooleanMacro); - YY_BREAK +#line 213 "vtkParse.l" +return(UNSIGNED_SHORT); + YY_BREAK case 56: +/* rule 56 can match eol */ YY_RULE_SETUP -#line 205 "vtkParse.l" -return(SetVector2Macro); - YY_BREAK +#line 214 "vtkParse.l" +return(UNSIGNED_SHORT); + YY_BREAK case 57: +/* rule 57 can match eol */ YY_RULE_SETUP -#line 206 "vtkParse.l" -return(SetVector3Macro); - YY_BREAK +#line 215 "vtkParse.l" +return(UNSIGNED_SHORT); + YY_BREAK case 58: +/* rule 58 can match eol */ YY_RULE_SETUP -#line 207 "vtkParse.l" -return(SetVector4Macro); - YY_BREAK +#line 216 "vtkParse.l" +return(UNSIGNED_SHORT); + YY_BREAK case 59: +/* rule 59 can match eol */ +YY_RULE_SETUP +#line 218 "vtkParse.l" +return(SHORT); + YY_BREAK +case 60: +/* rule 60 can match eol */ +YY_RULE_SETUP +#line 219 "vtkParse.l" +return(SHORT); + YY_BREAK +case 61: +/* rule 61 can match eol */ +YY_RULE_SETUP +#line 220 "vtkParse.l" +return(SHORT); + YY_BREAK +case 62: +/* rule 62 can match eol */ +YY_RULE_SETUP +#line 221 "vtkParse.l" +return(SHORT); + YY_BREAK +case 63: +/* rule 63 can match eol */ +YY_RULE_SETUP +#line 222 "vtkParse.l" +return(SHORT); + YY_BREAK +case 64: +/* rule 64 can match eol */ +YY_RULE_SETUP +#line 223 "vtkParse.l" +return(SHORT); + YY_BREAK +case 65: +/* rule 65 can match eol */ +YY_RULE_SETUP +#line 224 "vtkParse.l" +return(SHORT); + YY_BREAK +case 66: +/* rule 66 can match eol */ +YY_RULE_SETUP +#line 225 "vtkParse.l" +return(SHORT); + YY_BREAK +case 67: +/* rule 67 can match eol */ +YY_RULE_SETUP +#line 226 "vtkParse.l" +return(SHORT); + YY_BREAK +case 68: +/* rule 68 can match eol */ +YY_RULE_SETUP +#line 227 "vtkParse.l" +return(SHORT); + YY_BREAK +case 69: +YY_RULE_SETUP +#line 228 "vtkParse.l" +return(SHORT); + YY_BREAK +case 70: +/* rule 70 can match eol */ +YY_RULE_SETUP +#line 230 "vtkParse.l" +return(UNSIGNED_LONG); + YY_BREAK +case 71: +/* rule 71 can match eol */ +YY_RULE_SETUP +#line 231 "vtkParse.l" +return(UNSIGNED_LONG); + YY_BREAK +case 72: +/* rule 72 can match eol */ +YY_RULE_SETUP +#line 232 "vtkParse.l" +return(UNSIGNED_LONG); + YY_BREAK +case 73: +/* rule 73 can match eol */ +YY_RULE_SETUP +#line 233 "vtkParse.l" +return(UNSIGNED_LONG); + YY_BREAK +case 74: +/* rule 74 can match eol */ +YY_RULE_SETUP +#line 234 "vtkParse.l" +return(UNSIGNED_LONG); + YY_BREAK +case 75: +/* rule 75 can match eol */ +YY_RULE_SETUP +#line 235 "vtkParse.l" +return(UNSIGNED_LONG); + YY_BREAK +case 76: +/* rule 76 can match eol */ +YY_RULE_SETUP +#line 236 "vtkParse.l" +return(UNSIGNED_LONG); + YY_BREAK +case 77: +/* rule 77 can match eol */ +YY_RULE_SETUP +#line 237 "vtkParse.l" +return(UNSIGNED_LONG); + YY_BREAK +case 78: +/* rule 78 can match eol */ +YY_RULE_SETUP +#line 239 "vtkParse.l" +return(LONG); + YY_BREAK +case 79: +/* rule 79 can match eol */ +YY_RULE_SETUP +#line 240 "vtkParse.l" +return(LONG); + YY_BREAK +case 80: +/* rule 80 can match eol */ +YY_RULE_SETUP +#line 241 "vtkParse.l" +return(LONG); + YY_BREAK +case 81: +/* rule 81 can match eol */ +YY_RULE_SETUP +#line 242 "vtkParse.l" +return(LONG); + YY_BREAK +case 82: +/* rule 82 can match eol */ +YY_RULE_SETUP +#line 243 "vtkParse.l" +return(LONG); + YY_BREAK +case 83: +/* rule 83 can match eol */ +YY_RULE_SETUP +#line 244 "vtkParse.l" +return(LONG); + YY_BREAK +case 84: +/* rule 84 can match eol */ +YY_RULE_SETUP +#line 245 "vtkParse.l" +return(LONG); + YY_BREAK +case 85: +/* rule 85 can match eol */ +YY_RULE_SETUP +#line 246 "vtkParse.l" +return(LONG); + YY_BREAK +case 86: +/* rule 86 can match eol */ +YY_RULE_SETUP +#line 247 "vtkParse.l" +return(LONG); + YY_BREAK +case 87: +/* rule 87 can match eol */ +YY_RULE_SETUP +#line 248 "vtkParse.l" +return(LONG); + YY_BREAK +case 88: +YY_RULE_SETUP +#line 249 "vtkParse.l" +return(LONG); + YY_BREAK +case 89: +/* rule 89 can match eol */ +YY_RULE_SETUP +#line 251 "vtkParse.l" +return(UNSIGNED_CHAR); + YY_BREAK +case 90: +/* rule 90 can match eol */ +YY_RULE_SETUP +#line 252 "vtkParse.l" +return(UNSIGNED_CHAR); + YY_BREAK +case 91: +/* rule 91 can match eol */ +YY_RULE_SETUP +#line 253 "vtkParse.l" +return(SIGNED_CHAR); + YY_BREAK +case 92: +/* rule 92 can match eol */ +YY_RULE_SETUP +#line 254 "vtkParse.l" +return(SIGNED_CHAR); + YY_BREAK +case 93: +YY_RULE_SETUP +#line 255 "vtkParse.l" +return(CHAR); + YY_BREAK +case 94: +/* rule 94 can match eol */ +YY_RULE_SETUP +#line 257 "vtkParse.l" +return(UNSIGNED_INT); + YY_BREAK +case 95: +/* rule 95 can match eol */ +YY_RULE_SETUP +#line 258 "vtkParse.l" +return(UNSIGNED_INT); + YY_BREAK +case 96: +/* rule 96 can match eol */ +YY_RULE_SETUP +#line 260 "vtkParse.l" +return(INT); + YY_BREAK +case 97: +/* rule 97 can match eol */ +YY_RULE_SETUP +#line 261 "vtkParse.l" +return(INT); + YY_BREAK +case 98: +YY_RULE_SETUP +#line 262 "vtkParse.l" +return(INT); + YY_BREAK +case 99: +YY_RULE_SETUP +#line 264 "vtkParse.l" +return(UNSIGNED); + YY_BREAK +case 100: +YY_RULE_SETUP +#line 265 "vtkParse.l" +return(SIGNED); + YY_BREAK +case 101: +YY_RULE_SETUP +#line 267 "vtkParse.l" +return(VOID); + YY_BREAK +case 102: +YY_RULE_SETUP +#line 268 "vtkParse.l" +return(BOOL); + YY_BREAK +case 103: +YY_RULE_SETUP +#line 270 "vtkParse.l" +return(SIZE_T); + YY_BREAK +case 104: +YY_RULE_SETUP +#line 271 "vtkParse.l" +return(SSIZE_T); + YY_BREAK +case 105: +YY_RULE_SETUP +#line 273 "vtkParse.l" +; + YY_BREAK +case 106: +/* rule 106 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 274 "vtkParse.l" +return(PUBLIC); + YY_BREAK +case 107: +/* rule 107 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 275 "vtkParse.l" +return(PRIVATE); + YY_BREAK +case 108: +/* rule 108 can match eol */ +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +(yy_c_buf_p) = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 276 "vtkParse.l" +return(PROTECTED); + YY_BREAK +case 109: +*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ +(yy_c_buf_p) = yy_cp = yy_bp + 7; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 277 "vtkParse.l" +return(PROTECTED); + YY_BREAK +case 110: +YY_RULE_SETUP +#line 279 "vtkParse.l" +return(CLASS); + YY_BREAK +case 111: +YY_RULE_SETUP +#line 280 "vtkParse.l" +return(STRUCT); + YY_BREAK +case 112: +YY_RULE_SETUP +#line 281 "vtkParse.l" +return(PUBLIC); + YY_BREAK +case 113: +YY_RULE_SETUP +#line 282 "vtkParse.l" +return(PRIVATE); + YY_BREAK +case 114: +YY_RULE_SETUP +#line 283 "vtkParse.l" +return(PROTECTED); + YY_BREAK +case 115: +YY_RULE_SETUP +#line 284 "vtkParse.l" +return(ENUM); + YY_BREAK +case 116: +YY_RULE_SETUP +#line 285 "vtkParse.l" +return(UNION); + YY_BREAK +case 117: +YY_RULE_SETUP +#line 286 "vtkParse.l" +return(VIRTUAL); + YY_BREAK +case 118: +YY_RULE_SETUP +#line 287 "vtkParse.l" +return(CONST); + YY_BREAK +case 119: +YY_RULE_SETUP +#line 288 "vtkParse.l" +return(MUTABLE); + YY_BREAK +case 120: +YY_RULE_SETUP +#line 289 "vtkParse.l" +return(OPERATOR); + YY_BREAK +case 121: +YY_RULE_SETUP +#line 290 "vtkParse.l" +return(FRIEND); + YY_BREAK +case 122: +YY_RULE_SETUP +#line 291 "vtkParse.l" +return(INLINE); + YY_BREAK +case 123: +YY_RULE_SETUP +#line 292 "vtkParse.l" +return(STATIC); + YY_BREAK +case 124: +YY_RULE_SETUP +#line 293 "vtkParse.l" +return(EXTERN); + YY_BREAK +case 125: +YY_RULE_SETUP +#line 294 "vtkParse.l" +return(TEMPLATE); + YY_BREAK +case 126: +YY_RULE_SETUP +#line 295 "vtkParse.l" +return(TYPENAME); + YY_BREAK +case 127: +YY_RULE_SETUP +#line 296 "vtkParse.l" +return(TYPEDEF); + YY_BREAK +case 128: +YY_RULE_SETUP +#line 297 "vtkParse.l" +return(NAMESPACE); + YY_BREAK +case 129: +YY_RULE_SETUP +#line 298 "vtkParse.l" +return(USING); + YY_BREAK +case 130: +YY_RULE_SETUP +#line 299 "vtkParse.l" +return(NEW); + YY_BREAK +case 131: +YY_RULE_SETUP +#line 300 "vtkParse.l" +return(DELETE); + YY_BREAK +case 132: +YY_RULE_SETUP +#line 301 "vtkParse.l" +return(EXPLICIT); + YY_BREAK +case 133: +YY_RULE_SETUP +#line 303 "vtkParse.l" +return(STATIC_CAST); + YY_BREAK +case 134: +YY_RULE_SETUP +#line 304 "vtkParse.l" +return(DYNAMIC_CAST); + YY_BREAK +case 135: +YY_RULE_SETUP +#line 305 "vtkParse.l" +return(CONST_CAST); + YY_BREAK +case 136: +YY_RULE_SETUP +#line 306 "vtkParse.l" +return(REINTERPRET_CAST); + YY_BREAK +case 137: +YY_RULE_SETUP +#line 308 "vtkParse.l" +; + YY_BREAK +case 138: +YY_RULE_SETUP +#line 309 "vtkParse.l" +; + YY_BREAK +case 139: +YY_RULE_SETUP +#line 310 "vtkParse.l" +; + YY_BREAK +case 140: +YY_RULE_SETUP +#line 312 "vtkParse.l" +return(OP_LOGIC_AND); + YY_BREAK +case 141: +YY_RULE_SETUP +#line 313 "vtkParse.l" +return(OP_AND_EQ); + YY_BREAK +case 142: +YY_RULE_SETUP +#line 314 "vtkParse.l" +return(OP_LOGIC_OR); + YY_BREAK +case 143: +YY_RULE_SETUP +#line 315 "vtkParse.l" +return(OP_OR_EQ); + YY_BREAK +case 144: +YY_RULE_SETUP +#line 316 "vtkParse.l" +return('!'); + YY_BREAK +case 145: +YY_RULE_SETUP +#line 317 "vtkParse.l" +return(OP_LOGIC_NEQ); + YY_BREAK +case 146: +YY_RULE_SETUP +#line 318 "vtkParse.l" +return('^'); + YY_BREAK +case 147: +YY_RULE_SETUP +#line 319 "vtkParse.l" +return(OP_XOR_EQ); + YY_BREAK +case 148: +YY_RULE_SETUP +#line 320 "vtkParse.l" +return('&'); + YY_BREAK +case 149: +YY_RULE_SETUP +#line 321 "vtkParse.l" +return('|'); + YY_BREAK +case 150: +YY_RULE_SETUP +#line 322 "vtkParse.l" +return('~'); + YY_BREAK +case 151: +YY_RULE_SETUP +#line 324 "vtkParse.l" +return(FloatType); + YY_BREAK +case 152: +YY_RULE_SETUP +#line 325 "vtkParse.l" +return(IdType); + YY_BREAK +case 153: +YY_RULE_SETUP +#line 326 "vtkParse.l" +return(SetMacro); + YY_BREAK +case 154: +YY_RULE_SETUP +#line 327 "vtkParse.l" +return(GetMacro); + YY_BREAK +case 155: +YY_RULE_SETUP +#line 328 "vtkParse.l" +return(SetStringMacro); + YY_BREAK +case 156: +YY_RULE_SETUP +#line 329 "vtkParse.l" +return(GetStringMacro); + YY_BREAK +case 157: +YY_RULE_SETUP +#line 330 "vtkParse.l" +return(SetClampMacro); + YY_BREAK +case 158: +YY_RULE_SETUP +#line 331 "vtkParse.l" +return(SetObjectMacro); + YY_BREAK +case 159: +YY_RULE_SETUP +#line 332 "vtkParse.l" +return(GetObjectMacro); + YY_BREAK +case 160: +YY_RULE_SETUP +#line 333 "vtkParse.l" +return(BooleanMacro); + YY_BREAK +case 161: +YY_RULE_SETUP +#line 334 "vtkParse.l" +return(SetVector2Macro); + YY_BREAK +case 162: +YY_RULE_SETUP +#line 335 "vtkParse.l" +return(SetVector3Macro); + YY_BREAK +case 163: +YY_RULE_SETUP +#line 336 "vtkParse.l" +return(SetVector4Macro); + YY_BREAK +case 164: +YY_RULE_SETUP +#line 337 "vtkParse.l" +return(SetVector6Macro); + YY_BREAK +case 165: +YY_RULE_SETUP +#line 338 "vtkParse.l" +return(GetVector2Macro); + YY_BREAK +case 166: +YY_RULE_SETUP +#line 339 "vtkParse.l" +return(GetVector3Macro); + YY_BREAK +case 167: +YY_RULE_SETUP +#line 340 "vtkParse.l" +return(GetVector4Macro); + YY_BREAK +case 168: +YY_RULE_SETUP +#line 341 "vtkParse.l" +return(GetVector6Macro); + YY_BREAK +case 169: +YY_RULE_SETUP +#line 342 "vtkParse.l" +return(SetVectorMacro); + YY_BREAK +case 170: +YY_RULE_SETUP +#line 343 "vtkParse.l" +return(GetVectorMacro); + YY_BREAK +case 171: +YY_RULE_SETUP +#line 344 "vtkParse.l" +return(ViewportCoordinateMacro); + YY_BREAK +case 172: +YY_RULE_SETUP +#line 345 "vtkParse.l" +return(WorldCoordinateMacro); + YY_BREAK +case 173: +YY_RULE_SETUP +#line 346 "vtkParse.l" +return(TypeMacro); + YY_BREAK +case 174: +YY_RULE_SETUP +#line 347 "vtkParse.l" +return(TypeMacro); + YY_BREAK +case 175: +YY_RULE_SETUP +#line 348 "vtkParse.l" +return(TypeMacro); + YY_BREAK +case 176: +YY_RULE_SETUP +#line 349 "vtkParse.l" +return(TypeMacro); + YY_BREAK +case 177: +YY_RULE_SETUP +#line 350 "vtkParse.l" +return(VTK_LEGACY); + YY_BREAK +case 178: +YY_RULE_SETUP +#line 351 "vtkParse.l" +; + YY_BREAK +case 179: +YY_RULE_SETUP +#line 352 "vtkParse.l" +return(VTK_BYTE_SWAP_DECL); + YY_BREAK +case 180: +YY_RULE_SETUP +#line 353 "vtkParse.l" +return(TypeInt8); + YY_BREAK +case 181: +YY_RULE_SETUP +#line 354 "vtkParse.l" +return(TypeUInt8); + YY_BREAK +case 182: +YY_RULE_SETUP +#line 355 "vtkParse.l" +return(TypeInt16); + YY_BREAK +case 183: +YY_RULE_SETUP +#line 356 "vtkParse.l" +return(TypeUInt16); + YY_BREAK +case 184: +YY_RULE_SETUP +#line 357 "vtkParse.l" +return(TypeInt32); + YY_BREAK +case 185: +YY_RULE_SETUP +#line 358 "vtkParse.l" +return(TypeUInt32); + YY_BREAK +case 186: +YY_RULE_SETUP +#line 359 "vtkParse.l" +return(TypeInt64); + YY_BREAK +case 187: +YY_RULE_SETUP +#line 360 "vtkParse.l" +return(TypeUInt64); + YY_BREAK +case 188: +YY_RULE_SETUP +#line 361 "vtkParse.l" +return(TypeFloat32); + YY_BREAK +case 189: +YY_RULE_SETUP +#line 362 "vtkParse.l" +return(TypeFloat64); + YY_BREAK +case 190: +/* rule 190 can match eol */ +YY_RULE_SETUP +#line 364 "vtkParse.l" +return(CONST_PTR); + YY_BREAK +case 191: +/* rule 191 can match eol */ +YY_RULE_SETUP +#line 365 "vtkParse.l" +return(CONST_EQUAL); + YY_BREAK +case 192: +/* rule 192 can match eol */ +YY_RULE_SETUP +#line 367 "vtkParse.l" +{ + size_t i = 1; + size_t j; + while (yytext[i]==' ' || yytext[i]=='\t' || + yytext[i]=='\r' || yytext[i]=='\n') { i++; } + j = i; + while (yytext[j]!='&') { j++; } + yylval.str = vtkstrndup(&yytext[i], j-i); + return(LA); } + YY_BREAK +case 193: +/* rule 193 can match eol */ +YY_RULE_SETUP +#line 377 "vtkParse.l" +{ + size_t i = 1; + size_t j; + while (yytext[i]==' ' || yytext[i]=='\t' || + yytext[i]=='\r' || yytext[i]=='\n') { i++; } + j = i; + while (yytext[j]!='*') { j++; } + yylval.str = vtkstrndup(&yytext[i], j-i); + return(LP); } + YY_BREAK +case 194: +/* rule 194 can match eol */ +YY_RULE_SETUP +#line 387 "vtkParse.l" +{ + yylval.str = ""; + return(LP); } + YY_BREAK +case 195: +/* rule 195 can match eol */ +YY_RULE_SETUP +#line 391 "vtkParse.l" +{ + yylval.str = ""; + return(LP); } + YY_BREAK +case 196: +YY_RULE_SETUP +#line 395 "vtkParse.l" +{ return('*'); } + YY_BREAK +case 197: +YY_RULE_SETUP +#line 397 "vtkParse.l" +; + YY_BREAK +case 198: +YY_RULE_SETUP +#line 398 "vtkParse.l" +; + YY_BREAK +case 199: +YY_RULE_SETUP +#line 399 "vtkParse.l" +; + YY_BREAK +case 200: +YY_RULE_SETUP +#line 401 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(OSTREAM); } + YY_BREAK +case 201: +YY_RULE_SETUP +#line 405 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(ISTREAM); } + YY_BREAK +case 202: +YY_RULE_SETUP +#line 409 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(StdString); } + YY_BREAK +case 203: +YY_RULE_SETUP +#line 413 "vtkParse.l" +{ yylval.str = vtkstrndup(yytext, yyleng); + return(UnicodeString); } + YY_BREAK +case 204: +YY_RULE_SETUP +#line 416 "vtkParse.l" +{ yylval.str = vtkstrdup("vtkDataArray"); return(VTK_ID); } + YY_BREAK +case 205: +YY_RULE_SETUP +#line 418 "vtkParse.l" +{ yylval.str = vtkstrndup(yytext, yyleng); + return(ID); } + YY_BREAK +case 206: +YY_RULE_SETUP +#line 421 "vtkParse.l" +{ yylval.str = vtkstrndup(yytext, yyleng); + return(QT_ID); } + YY_BREAK +case 207: +YY_RULE_SETUP +#line 424 "vtkParse.l" +{ get_macro_arguments(); }; + YY_BREAK +case 208: +YY_RULE_SETUP +#line 426 "vtkParse.l" +{ + const char *name = vtkstrndup(yytext, yyleng); + MacroInfo *macro = vtkParsePreprocess_GetMacro(&preprocessor, name); + int expanded = 0; + + if (macro) + { + if (macro->IsFunction) + { + const char *args = get_macro_arguments(); + const char *emacro = NULL; + if (args) + { + emacro = vtkParsePreprocess_ExpandMacro(macro, args); + free((char *)args); + if (emacro) + { + push_buffer(); + yy_switch_to_buffer(yy_scan_string(emacro)); + vtkParsePreprocess_FreeExpandedMacro(emacro); + expanded = 1; + } + else + { + print_preprocessor_error( + VTK_PARSE_MACRO_NUMARGS, macro->Name, strlen(macro->Name)); + } + } + } + /* non-function macro expansion breaks "real superclass" trick + else if (macro->Definition) + { + push_buffer(); + yy_switch_to_buffer(yy_scan_string(macro->Definition)); + expanded = 1; + } + */ + } + if (!expanded) + { + yylval.str = name; + if (yyleng > 3 && name[0] == 'v' && name[1] == 't' && name[2] == 'k') + { + return(VTK_ID); + } + else if (name[0] == 'Q') + { + return(QT_ID); + } + else + { + return(ID); + } + } + }; + YY_BREAK +case 209: +YY_RULE_SETUP +#line 482 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(FLOAT_LITERAL); } + YY_BREAK +case 210: YY_RULE_SETUP -#line 208 "vtkParse.l" -return(SetVector6Macro); - YY_BREAK -case 60: +#line 486 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(HEX_LITERAL); } + YY_BREAK +case 211: YY_RULE_SETUP -#line 209 "vtkParse.l" -return(GetVector2Macro); - YY_BREAK -case 61: +#line 490 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(OCT_LITERAL); } + YY_BREAK +case 212: YY_RULE_SETUP -#line 210 "vtkParse.l" -return(GetVector3Macro); - YY_BREAK -case 62: +#line 494 "vtkParse.l" +{ + yylval.str = vtkstrndup(yytext, yyleng); + return(INT_LITERAL); } + YY_BREAK +case 213: YY_RULE_SETUP -#line 211 "vtkParse.l" -return(GetVector4Macro); - YY_BREAK -case 63: +#line 498 "vtkParse.l" +{ yylval.str = vtkstrndup(yytext, yyleng); + return(ZERO); }; + YY_BREAK +case 214: +/* rule 214 can match eol */ YY_RULE_SETUP -#line 212 "vtkParse.l" -return(GetVector6Macro); - YY_BREAK -case 64: +#line 501 "vtkParse.l" +; + YY_BREAK +case 215: +/* rule 215 can match eol */ YY_RULE_SETUP -#line 213 "vtkParse.l" -return(SetVectorMacro); - YY_BREAK -case 65: +#line 502 "vtkParse.l" +; + YY_BREAK +case 216: +/* rule 216 can match eol */ YY_RULE_SETUP -#line 214 "vtkParse.l" -return(GetVectorMacro); - YY_BREAK -case 66: +#line 503 "vtkParse.l" +; + YY_BREAK +case 217: YY_RULE_SETUP -#line 215 "vtkParse.l" -return(ViewportCoordinateMacro); - YY_BREAK -case 67: +#line 505 "vtkParse.l" +return(OP_LSHIFT_EQ); + YY_BREAK +case 218: YY_RULE_SETUP -#line 216 "vtkParse.l" -return(WorldCoordinateMacro); - YY_BREAK -case 68: +#line 506 "vtkParse.l" +return(OP_RSHIFT_EQ); + YY_BREAK +case 219: YY_RULE_SETUP -#line 217 "vtkParse.l" -return(TypeMacro); - YY_BREAK -case 69: +#line 507 "vtkParse.l" +return(OP_LSHIFT); + YY_BREAK +case 220: YY_RULE_SETUP -#line 218 "vtkParse.l" -return(TypeMacro); - YY_BREAK -case 70: +#line 508 "vtkParse.l" +return(OP_ARROW_POINTER); + YY_BREAK +case 221: YY_RULE_SETUP -#line 219 "vtkParse.l" -return(TypeMacro); - YY_BREAK -case 71: +#line 509 "vtkParse.l" +return(OP_ARROW); + YY_BREAK +case 222: YY_RULE_SETUP -#line 220 "vtkParse.l" -return(TypeMacro); - YY_BREAK -case 72: +#line 510 "vtkParse.l" +return(OP_RSHIFT); + YY_BREAK +case 223: YY_RULE_SETUP -#line 221 "vtkParse.l" -return(VTK_LEGACY); - YY_BREAK -case 73: +#line 511 "vtkParse.l" +return(OP_INCR); + YY_BREAK +case 224: YY_RULE_SETUP -#line 222 "vtkParse.l" -return(VTK_WRAP_EXTERN); - YY_BREAK -case 74: +#line 512 "vtkParse.l" +return(OP_DECR); + YY_BREAK +case 225: YY_RULE_SETUP -#line 223 "vtkParse.l" -return(TypeInt8); - YY_BREAK -case 75: +#line 513 "vtkParse.l" +return(OP_PLUS_EQ); + YY_BREAK +case 226: YY_RULE_SETUP -#line 224 "vtkParse.l" -return(TypeUInt8); - YY_BREAK -case 76: +#line 514 "vtkParse.l" +return(OP_MINUS_EQ); + YY_BREAK +case 227: YY_RULE_SETUP -#line 225 "vtkParse.l" -return(TypeInt16); - YY_BREAK -case 77: +#line 515 "vtkParse.l" +return(OP_TIMES_EQ); + YY_BREAK +case 228: YY_RULE_SETUP -#line 226 "vtkParse.l" -return(TypeUInt16); - YY_BREAK -case 78: +#line 516 "vtkParse.l" +return(OP_DIVIDE_EQ); + YY_BREAK +case 229: YY_RULE_SETUP -#line 227 "vtkParse.l" -return(TypeInt32); - YY_BREAK -case 79: +#line 517 "vtkParse.l" +return(OP_REMAINDER_EQ); + YY_BREAK +case 230: YY_RULE_SETUP -#line 228 "vtkParse.l" -return(TypeUInt32); - YY_BREAK -case 80: +#line 518 "vtkParse.l" +return(OP_AND_EQ); + YY_BREAK +case 231: YY_RULE_SETUP -#line 229 "vtkParse.l" -return(TypeInt64); - YY_BREAK -case 81: +#line 519 "vtkParse.l" +return(OP_OR_EQ); + YY_BREAK +case 232: YY_RULE_SETUP -#line 230 "vtkParse.l" -return(TypeUInt64); - YY_BREAK -case 82: +#line 520 "vtkParse.l" +return(OP_XOR_EQ); + YY_BREAK +case 233: YY_RULE_SETUP -#line 231 "vtkParse.l" -return(TypeFloat32); - YY_BREAK -case 83: +#line 521 "vtkParse.l" +return(OP_LOGIC_AND_EQ); + YY_BREAK +case 234: YY_RULE_SETUP -#line 232 "vtkParse.l" -return(TypeFloat64); - YY_BREAK -case 84: +#line 522 "vtkParse.l" +return(OP_LOGIC_OR_EQ); + YY_BREAK +case 235: YY_RULE_SETUP -#line 235 "vtkParse.l" -{ sscanf(yytext,"%d",&yylval.integer); return(NUM);} - YY_BREAK -case 85: -/* rule 85 can match eol */ +#line 523 "vtkParse.l" +return(OP_LOGIC_AND); + YY_BREAK +case 236: YY_RULE_SETUP -#line 237 "vtkParse.l" -{ - yylval.str = vtkstrdup(yytext + 1); - yylval.str[strlen(yytext)-2] = '\0'; - return(STRING); - } - YY_BREAK -case 86: -*yy_cp = (yy_hold_char); /* undo effects of setting up yytext */ -(yy_c_buf_p) = yy_cp -= 1; -YY_DO_BEFORE_ACTION; /* set up yytext again */ +#line 524 "vtkParse.l" +return(OP_LOGIC_OR); + YY_BREAK +case 237: YY_RULE_SETUP -#line 243 "vtkParse.l" -; - YY_BREAK -case 87: +#line 525 "vtkParse.l" +return(OP_LOGIC_EQ); + YY_BREAK +case 238: YY_RULE_SETUP -#line 246 "vtkParse.l" -{ yylval.str = (char *)malloc(yyleng + 1); - memcpy(yylval.str,yytext,yyleng); - yylval.str[yyleng] = '\0'; - return(VTK_ID); - } - YY_BREAK -case 88: +#line 526 "vtkParse.l" +return(OP_LOGIC_NEQ); + YY_BREAK +case 239: YY_RULE_SETUP -#line 252 "vtkParse.l" -{ yylval.str = (char *)malloc(yyleng + 1); - memcpy(yylval.str,yytext,yyleng); - yylval.str[yyleng] = '\0'; - return(ID); - } - YY_BREAK -case 89: -/* rule 89 can match eol */ +#line 527 "vtkParse.l" +return(OP_LOGIC_LEQ); + YY_BREAK +case 240: YY_RULE_SETUP -#line 258 "vtkParse.l" -; - YY_BREAK -case 90: +#line 528 "vtkParse.l" +return(OP_LOGIC_GEQ); + YY_BREAK +case 241: YY_RULE_SETUP -#line 261 "vtkParse.l" -return(yytext[0]); - YY_BREAK -case 91: +#line 529 "vtkParse.l" +return(ELLIPSIS); + YY_BREAK +case 242: YY_RULE_SETUP -#line 262 "vtkParse.l" -return(yytext[0]); - YY_BREAK -case 92: +#line 530 "vtkParse.l" +return(DOUBLE_COLON); + YY_BREAK +case 243: YY_RULE_SETUP -#line 265 "vtkParse.l" -{ return(yytext[0]); } - YY_BREAK -case 93: +#line 532 "vtkParse.l" +{ return(yytext[0]); } + YY_BREAK +case 244: YY_RULE_SETUP -#line 267 "vtkParse.l" -return(OTHER); - YY_BREAK -case 94: +#line 533 "vtkParse.l" +{ return(yytext[0]); } + YY_BREAK +case 245: YY_RULE_SETUP -#line 268 "vtkParse.l" -ECHO; - YY_BREAK -#line 2046 "lex.yy.c" +#line 535 "vtkParse.l" +{ return(yytext[0]); } + YY_BREAK case YY_STATE_EOF(INITIAL): - yyterminate(); - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_c_buf_p); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); +#line 537 "vtkParse.l" +{ if (!pop_buffer()) { yyterminate(); } } + YY_BREAK +case 246: +YY_RULE_SETUP +#line 539 "vtkParse.l" +{ return(OTHER); } + YY_BREAK +case 247: +YY_RULE_SETUP +#line 541 "vtkParse.l" +YY_FATAL_ERROR( "flex scanner jammed" ); + YY_BREAK +#line 4021 "lex.yy.c" + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = (yy_hold_char); + YY_RESTORE_YY_MORE_OFFSET + + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between YY_CURRENT_BUFFER and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; + } - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++(yy_c_buf_p); + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = (yy_c_buf_p); + goto yy_find_action; + } + } - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ + else switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_END_OF_FILE: + { + (yy_did_buffer_switch_on_eof) = 0; + + if ( yywrap( ) ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; + + yy_current_state = yy_get_previous_state( ); + + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); + register int number_to_move, i; + int ret_val; + + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) + { + /* We matched a single character, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } - /* Try to read more data. */ + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; + /* Try to read more data. */ - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); + /* First move last chars to start of buffer. */ + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); - else - { - size_t num_to_read = - YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - while ( num_to_read <= 0 ) - { /* Not enough room in the buffer - grow it. */ + else + { + yy_size_t num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; - /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; + int yy_c_buf_p_offset = + (int) ((yy_c_buf_p) - b->yy_ch_buf); - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; + if ( b->yy_is_our_buffer ) + { + yy_size_t new_size = b->yy_buf_size * 2; - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - } + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - + number_to_move - 1; - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; + } - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } + /* Read in more data. */ + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } + if ( (yy_n_chars) == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ); + } - else - ret_val = EOB_ACT_CONTINUE_SCAN; + else + { + ret_val = EOB_ACT_LAST_MATCH; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } - if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { - /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - return ret_val; + return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - yy_current_state += YY_AT_BOL(); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 772 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = (yy_start); + yy_current_state += YY_AT_BOL(); + + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1956 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + } - return yy_current_state; + return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis - * next_state = yy_try_NUL_trans( current_state ); + * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); + register int yy_is_jam; + register char *yy_cp = (yy_c_buf_p); + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; + } + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 1956 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + yy_is_jam = (yy_current_state == 1955); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 772 ) - yy_c = yy_meta[(unsigned int) yy_c]; + yy_cp = (yy_c_buf_p); + + /* undo effects of setting up yytext */ + *yy_cp = (yy_hold_char); + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register yy_size_t number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + if ( c == '\n' ){ + --yylineno; } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 771); - return yy_is_jam ? 0 : yy_current_state; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; } #ifndef YY_NO_INPUT @@ -2376,192 +4394,192 @@ static int yy_get_next_buffer (void) #endif { - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; + int c; + + *(yy_c_buf_p) = (yy_hold_char); + + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) + /* This was really a NUL. */ + *(yy_c_buf_p) = '\0'; + + else + { /* need more input */ + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); + + switch ( yy_get_next_buffer( ) ) + { + case EOB_ACT_LAST_MATCH: + /* This happens because yy_g_n_b() + * sees that we've accumulated a + * token and flags that we need to + * try matching the token before + * proceeding. But for input(), + * there's no matching to consider. + * So convert the EOB_ACT_LAST_MATCH + * to EOB_ACT_END_OF_FILE. + */ + + /* Reset buffer status. */ + yyrestart(yyin ); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap( ) ) + return 0; + + if ( ! (yy_did_buffer_switch_on_eof) ) + YY_NEW_FILE; #ifdef __cplusplus - return yyinput(); + return yyinput(); #else - return input(); + return input(); #endif - } + } - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } + case EOB_ACT_CONTINUE_SCAN: + (yy_c_buf_p) = (yytext_ptr) + offset; + break; + } + } + } + + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); + if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n'); - if ( YY_CURRENT_BUFFER_LVALUE->yy_at_bol ) - yylineno++; ; - return c; + return c; } -#endif /* ifndef YY_NO_INPUT */ +#endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. - * + * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { - - if ( ! YY_CURRENT_BUFFER ){ + + if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = + YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); - } + } - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. - * + * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * + * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = size; - /* yy_ch_buf has to be 2 characters longer than the size given because - * we need to put in 2 end-of-buffer characters. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + /* yy_ch_buf has to be 2 characters longer than the size given because + * we need to put in 2 end-of-buffer characters. + */ + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - b->yy_is_our_buffer = 1; + b->yy_is_our_buffer = 1; - yy_init_buffer(b,file ); + yy_init_buffer(b,file ); - return b; + return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() - * + * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { - - if ( ! b ) - return; - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; + if ( ! b ) + return; + + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); + if ( b->yy_is_our_buffer ) + yyfree((void *) b->yy_ch_buf ); - yyfree((void *) b ); + yyfree((void *) b ); } #ifndef __cplusplus extern int isatty (int ); #endif /* __cplusplus */ - + /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. @@ -2569,12 +4587,12 @@ extern int isatty (int ); static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { - int oerrno = errno; - - yy_flush_buffer(b ); + int oerrno = errno; + + yy_flush_buffer(b ); - b->yy_input_file = file; - b->yy_fill_buffer = 1; + b->yy_input_file = file; + b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. @@ -2586,87 +4604,87 @@ extern int isatty (int ); } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; - - errno = oerrno; + + errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * + * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { - if ( ! b ) - return; + if ( ! b ) + return; - b->yy_n_chars = 0; + b->yy_n_chars = 0; - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - b->yy_buf_pos = &b->yy_ch_buf[0]; + b->yy_buf_pos = &b->yy_ch_buf[0]; - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. - * + * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. - * + * */ void yypop_buffer_state (void) { - if (!YY_CURRENT_BUFFER) - return; + if (!YY_CURRENT_BUFFER) + return; - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; + } } /* Allocates the stack if it does not exist. @@ -2674,131 +4692,130 @@ void yypop_buffer_state (void) */ static void yyensure_buffer_stack (void) { - int num_to_alloc; - - if (!(yy_buffer_stack)) { + yy_size_t num_to_alloc; + + if (!(yy_buffer_stack)) { - /* First allocation is just for 2 elements, since we don't know if this - * scanner will even need a stack. We use 2 instead of 1 to avoid an - * immediate realloc on the next call. + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. */ - num_to_alloc = 1; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + if ( ! (yy_buffer_stack) ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. + * + * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b ); - - return b; + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer(b ); + + return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan - * + * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { - - return yy_scan_bytes(yystr,strlen(yystr) ); + + return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) +{ + YY_BUFFER_STATE b; + char *buf; + yy_size_t n, i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; + + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer(buf,n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; } #ifndef YY_EXIT_FAILURE @@ -2807,40 +4824,40 @@ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) static void yy_fatal_error (yyconst char* msg ) { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. - * + * */ int yyget_lineno (void) { - + return yylineno; } /** Get the input stream. - * + * */ FILE *yyget_in (void) { @@ -2848,7 +4865,7 @@ FILE *yyget_in (void) } /** Get the output stream. - * + * */ FILE *yyget_out (void) { @@ -2856,15 +4873,15 @@ FILE *yyget_out (void) } /** Get the length of the current token. - * + * */ -int yyget_leng (void) +yy_size_t yyget_leng (void) { return yyleng; } /** Get the current token. - * + * */ char *yyget_text (void) @@ -2874,18 +4891,18 @@ char *yyget_text (void) /** Set the current line number. * @param line_number - * + * */ void yyset_lineno (int line_number ) { - + yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. - * + * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) @@ -2916,7 +4933,7 @@ static int yy_init_globals (void) /* We do not touch yylineno unless the option is enabled. */ yylineno = 1; - + (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; @@ -2942,17 +4959,17 @@ static int yy_init_globals (void) /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { - + /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ @@ -2968,49 +4985,515 @@ int yylex_destroy (void) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { - register int n; - for ( n = 0; s[n]; ++n ) - ; + register int n; + for ( n = 0; s[n]; ++n ) + ; - return n; + return n; } #endif void *yyalloc (yy_size_t size ) { - return (void *) malloc( size ); + return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { - /* The cast to (char *) in the following accommodates both - * implementations that use char* generic pointers, and those - * that use void* generic pointers. It works with the latter - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); + /* The cast to (char *) in the following accommodates both + * implementations that use char* generic pointers, and those + * that use void* generic pointers. It works with the latter + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 268 "vtkParse.l" +#line 541 "vtkParse.l" + + + +/* + * Return a parenthetical macro arg list as a new string. + */ +const char *get_macro_arguments() +{ + char *cp = NULL; + size_t i = 0; + int depth; + int ws = 0; + int sl = 0; + int c1 = input(); + while (c1 == ' ' || c1 == '\t' || c1 == '\r' || c1 == '\n') + { + c1 = input(); + } + + cp = (char *)malloc(4); + + if (c1 != '(') + { + unput(c1); + return NULL; + } + + cp[i++] = '('; + depth = 1; + c1 = input(); + + for (;;) + { + ws = 0; + sl = 0; + /* skip all whitespace */ + while (c1 == ' ' || c1 == '\t' || c1 == '\r' || c1 == '\n') + { + ws = 1; + c1 = input(); + } + if (c1 == '/') + { + c1 = input(); + if (c1 == '*') + { + /* skip a C style comment */ + ws = 1; + if (skip_comment() == 0) + { + return NULL; + } + c1 = input(); + } + else if (c1 == '/') + { + /* skip a C++ style comment */ + ws = 1; + do { c1 = input(); } + while (c1 != '\n' && c1 != '\0'); + if (c1 == '\0') + { + return NULL; + } + c1 = input(); + } + else + { + sl = 1; + } + } + if (ws) + { + /* add a single space to replace any whitespace */ + cp[i++] = ' '; + if (i >= 4 && (i & (i-1)) == 0) + { + cp = (char *)realloc(cp, 2*i); + } + } + if (sl) + { + /* add a single space to replace any whitespace */ + cp[i++] = '/'; + if (i >= 4 && (i & (i-1)) == 0) + { + cp = (char *)realloc(cp, 2*i); + } + } + if (c1 == '\"' || c1 == '\'') + { + int c2 = c1; + int escaped = 2; + int firstloop = 1; + do + { + if (escaped) + { + --escaped; + } + if (!firstloop) + { + c1 = input(); + } + firstloop = 0; + if (c1 == '\0') + { + break; + } + if (escaped == 0 && c1 == '\\') + { + escaped = 2; + } + cp[i++] = (char)c1; + if (i >= 4 && (i & (i-1)) == 0) + { + cp = (char *)realloc(cp, 2*i); + } + } + while (c1 != c2 || escaped); + } + else if (c1 != '\0') + { + cp[i++] = (char)c1; + if (i >= 4 && (i & (i-1)) == 0) + { + cp = (char *)realloc(cp, 2*i); + } + cp[i] = '\0'; + if (c1 == '(') + { + depth++; + } + if (c1 == ')') + { + if (--depth == 0) + { + break; + } + } + } + else + { + return NULL; + } + c1 = input(); + } + + return cp; +} + +/* + * Skip a C-style comment, return 0 if unterminated. + */ +int skip_comment() +{ + int c1 = 0, c2 = input(); + for (;;) + { + if (c2 == 0) + { + fprintf(yyout,"Cannot find closing comment.\n"); + return 0; + } + if (c1 == '*' && c2 == '/') break; + c1 = c2; c2 = input(); + } + return 1; +} + +/* + * Skip ahead until the next preprocessor directive. + * This will eat the '#' that starts the directive. + * Return 0 if none found. + */ +int skip_to_next_directive() +{ + int state = 0; + int c; + + do + { + c = input(); + if (c == 0) + { + break; + } + + /* newline changes state */ + if (c == '\n') + { + state = 0; + c = input(); + } + /* skip comments */ + if (c == '/') + { + if ( (c = input()) == '*') + { + if (skip_comment() == 0) + { + return 0; + } + c = input(); + } + } + /* skip escaped newlines */ + if (c == '\\') + { + if ( (c = input()) == '\r') + { + c = input(); + } + if (c == '\n') + { + c = input(); + } + } + /* skip allowed whitespace */ + while (c == ' ' || c == '\t') + { + c = input(); + } + /* look for the directive */ + if (state == 0 && c == '#') + { + break; + } + } + while (c != 0); + + return c; +} + +/* + * Skip to the next #else or #elif or #endif + */ +int skip_conditional_block() +{ + static char *linebuf = NULL; + static size_t linemaxlen = 80; + size_t i; + int c; + int result; + + if (linebuf == 0) + { + linebuf = (char *)malloc(linemaxlen); + } + + for (;;) + { + if (skip_to_next_directive() == 0) + { + return 0; + } + c = input(); + while (c == ' ' || c == '\t') + { + c = input(); + } + if (c == 0) + { + return 0; + } + + /* eat the whole line */ + i = 0; + linebuf[i++] = '#'; + while (c != 0 && c != '\n') + { + if (i >= linemaxlen-5) + { + linemaxlen += i+5; + linebuf = (char *)realloc(linebuf, linemaxlen); + } + linebuf[i++] = c; + /* be sure to skip escaped newlines */ + if (c == '\\') + { + c = input(); + linebuf[i++] = c; + if (c == '\r') + { + c = input(); + linebuf[i++] = c; + } + } + c = input(); + } + linebuf[i++] = c; + + result = vtkParsePreprocess_HandleDirective(&preprocessor, linebuf); + if (result != VTK_PARSE_SKIP && result != VTK_PARSE_OK) + { + print_preprocessor_error(result, linebuf, i); + } + else if (result != VTK_PARSE_SKIP) + { + break; + } + } + + return 1; +} + +/* + * Skip ahead until one of the strings is found, + * then skip to the end of the line. + */ +int skip_ahead_multi(const char *strings[]) +{ + char textbuf[SKIP_MATCH_MAXLEN+1]; + char c = 0; + size_t i; + + for (i = 0; i < (SKIP_MATCH_MAXLEN+1); i++) + { + textbuf[i] = '\0'; + } + + for (;;) + { + for (i = 0; i < SKIP_MATCH_MAXLEN; i++) + { + textbuf[i] = textbuf[i+1]; + } + + if ((c = (char)input()) == '\0') + { + fprintf(yyout, "Cannot find matching %s.\n", strings[0]); + return 0; + } + + textbuf[SKIP_MATCH_MAXLEN-1] = c; + + for (i = 0; strings[i]; i++) + { + if (strcmp(&textbuf[SKIP_MATCH_MAXLEN-strlen(strings[i])], + strings[i]) == 0) + { + break; + } + } + if (strings[i]) + { + break; + } + } + + while (c != '\0' && c != '\n') + { + c = (char)input(); + } + + return 1; +} + +/* + * Skip ahead until the string is found. + */ +int skip_ahead_until(const char *text) +{ + const char *strings[2]; + strings[0] = text; + strings[1] = NULL; + + return skip_ahead_multi(strings); +} + +/* + * buffer stack, used for macro expansion and include files + */ +static size_t buffer_stack_size = 0; +static YY_BUFFER_STATE *buffer_stack = NULL; + +/* + * push the current buffer onto the buffer stack. + */ +void push_buffer() +{ + size_t n = buffer_stack_size; + if (buffer_stack == NULL) + { + buffer_stack = (YY_BUFFER_STATE *)malloc(4*sizeof(YY_BUFFER_STATE)); + } + // grow the stack whenever size reaches a power of two + else if (n >= 4 && (n & (n-1)) == 0) + { + buffer_stack = (YY_BUFFER_STATE *)realloc( + buffer_stack, 2*n*sizeof(YY_BUFFER_STATE)); + } + buffer_stack[buffer_stack_size++] = YY_CURRENT_BUFFER; +} + +/* + * pop the buffer stack and restore the previous buffer + */ +int pop_buffer() +{ + if (buffer_stack_size == 0) + { + return 0; + } + yy_delete_buffer(YY_CURRENT_BUFFER); + yy_switch_to_buffer(buffer_stack[--buffer_stack_size]); + return 1; +} +/* + * print an error with filename and line number. + */ +void print_preprocessor_error(int result, const char *cp, size_t n) +{ + size_t j = 0; + const char *fn = ""; + const char *text = ""; + switch (result) + { + case VTK_PARSE_OK: + case VTK_PARSE_SKIP: + return; + case VTK_PARSE_PREPROC_DOUBLE: + text = "double in preprocessor conditional"; + break; + case VTK_PARSE_PREPROC_FLOAT: + text = "float in preprocessor conditional"; + break; + case VTK_PARSE_PREPROC_STRING: + text = "string in preprocessor conditional"; + break; + case VTK_PARSE_MACRO_UNDEFINED: + text = "undefined macro"; + break; + case VTK_PARSE_MACRO_REDEFINED: + text = "redefined macro"; + break; + case VTK_PARSE_FILE_NOT_FOUND: + text = "file not found"; + break; + case VTK_PARSE_FILE_OPEN_ERROR: + text = "can\'t open file"; + break; + case VTK_PARSE_FILE_READ_ERROR: + text = "input/output error"; + break; + case VTK_PARSE_MACRO_NUMARGS: + text = "wrong number of args for macro"; + break; + case VTK_PARSE_SYNTAX_ERROR: + text = "syntax error"; + break; + } + /* be silent about missing include files */ + if (result == VTK_PARSE_FILE_NOT_FOUND) + { + return; + } + if (data.FileName) + { + j = strlen(data.FileName); + while (j > 0 && data.FileName[j-1] != '/') { j--; } + fn = &data.FileName[j]; + } + fprintf(yyout, "In %s:%i: %s: ", fn, yylineno, text); + fprintf(yyout, "%*.*s\n", (int)n, (int)n, cp); +} diff --git a/src/ParaView/vtkParse.h b/src/ParaView/vtkParse.h deleted file mode 100644 index febcdf26..00000000 --- a/src/ParaView/vtkParse.h +++ /dev/null @@ -1,167 +0,0 @@ -/*========================================================================= - - Program: Visualization Toolkit - Module: $RCSfile$ - - Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen - All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notice for more information. - -=========================================================================*/ -#ifndef __vtkParse_h -#define __vtkParse_h - -#if defined(__cplusplus) -#include -#include -#endif - -#define MAX_ARGS 20 - -typedef struct _FunctionInfo - { -#if defined(__cplusplus) - vtkstd::string Name; -#else - char *Name; -#endif - int NumberOfArguments; - int ArrayFailure; - int IsPureVirtual; - int IsPublic; - int IsProtected; - int IsOperator; - int HaveHint; - int HintSize; - int ArgTypes[MAX_ARGS]; - int ArgCounts[MAX_ARGS]; - -#if defined(__cplusplus) - vtkstd::string ArgClasses[MAX_ARGS]; -#else - char *ArgClasses[MAX_ARGS]; -#endif - int ArgExternals[MAX_ARGS]; - int ReturnType; - -#if defined(__cplusplus) - vtkstd::string ReturnClass; - vtkstd::string Comment; - vtkstd::string Signature; -#else - char *ReturnClass; - char *Comment; - char *Signature; -#endif - int ReturnExternal; - int IsLegacy; - } FunctionInfo; - -#if defined(__cplusplus) -#else -typedef struct _FileInfo - { - int HasDelete; - int IsAbstract; - int IsConcrete; -#if defined(__cplusplus) - vtkstd::string ClassName; - vtkstd::string FileName; - vtkstd::string OutputFileName; - vtkstd::string SuperClasses[10]; -#else - char *ClassName; - char *FileName; - char *OutputFileName; - char *SuperClasses[10]; -#endif - - int NumberOfSuperClasses; - int NumberOfFunctions; - FunctionInfo Functions[1000]; -#if defined(__cplusplus) - vtkstd::string NameComment; - vtkstd::string Description; - vtkstd::string Caveats; - vtkstd::string SeeAlso; -#else - char *NameComment; - char *Description; - char *Caveats; - char *SeeAlso; -#endif - - } FileInfo; - -#endif -//--------------------------------------------------------------------------nix -/* - * This structure is used internally to sort+collect individual functions. - * Polymorphed functions will be combined and can be handeled together. - * - */ -typedef struct _UniqueFunctionInfo -{ -#if defined(__cplusplus) - vtkstd::string Name; -#else - char *Name; -#endif - int TotalPolymorphTypes; -#if defined(__cplusplus) - vtkstd::vector Function; -#else - FunctionInfo Function[20]; -#endif -}UniqueFunctionInfo; - - -//--------------------------------------------------------------------------nix -/* - * This structure is used to collect and hold class information. It is a - * modified version of FileInfo - * - */ -typedef struct _ClassInfo -{ - int HasDelete; - int IsAbstract; - int IsConcrete; -#if defined(__cplusplus) - vtkstd::string ClassName; - vtkstd::string FileName; - vtkstd::string OutputFileName; - vtkstd::string SuperClasses[10]; -#else - char *ClassName; - char *FileName; - char *OutputFileName; - char *SuperClasses[10]; -#endif - - int NumberOfSuperClasses; - int NumberOfFunctions; -#if defined(__cplusplus) - vtkstd::vector Functions; -#else - UniqueFunctionInfo Functions[1000]; -#endif -#if defined(__cplusplus) - vtkstd::string NameComment; - vtkstd::string Description; - vtkstd::string Caveats; - vtkstd::string SeeAlso; -#else - char *NameComment; - char *Description; - char *Caveats; - char *SeeAlso; -#endif -}ClassInfo; - - -#endif //__vtkParse_h diff --git a/src/ParaView/vtkParse.tab.c b/src/ParaView/vtkParse.tab.c index 2a9f1b29..bb807521 100644 --- a/src/ParaView/vtkParse.tab.c +++ b/src/ParaView/vtkParse.tab.c @@ -2,20 +2,20 @@ /* A Bison parser, made by GNU Bison 2.4.1. */ /* Skeleton implementation for Bison's Yacc-like parsers in C - + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program 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 General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ @@ -28,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -80,8 +80,10 @@ Run yacc like this: yacc -b vtkParse vtkParse.y Modify vtkParse.tab.c: - - remove TABs - - remove yyerrorlab stuff in range ["goto yyerrlab1;", "yyerrstatus = 3;") + - convert TABs to spaces (eight per tab) + - remove spaces from ends of lines, s/ *$//g + - remove the "goto yyerrlab1;" that appears right before yyerrlab1: + - remove the #defined constants that appear right after the anonymous_enums */ @@ -97,51 +99,6 @@ Modify vtkParse.tab.c: #endif #define YYINCLUDED_STDLIB_H -/* Map from the type enumeration in vtkType.h to the VTK wrapping type - system number for the type. Note that the wrapping type system - does not enumerate its type values by name. Look in the - type_primitive production rule in the grammar for the "official" - enumeration. */ -static int vtkParseTypeMap[] = - { - 0x2, /* VTK_VOID 0 */ - 0, /* VTK_BIT 1 */ - 0x3, /* VTK_CHAR 2 */ - 0x13, /* VTK_UNSIGNED_CHAR 3 */ - 0x5, /* VTK_SHORT 4 */ - 0x15, /* VTK_UNSIGNED_SHORT 5 */ - 0x4, /* VTK_INT 6 */ - 0x14, /* VTK_UNSIGNED_INT 7 */ - 0x6, /* VTK_LONG 8 */ - 0x16, /* VTK_UNSIGNED_LONG 9 */ - 0x1, /* VTK_FLOAT 10 */ - 0x7, /* VTK_DOUBLE 11 */ - 0xA, /* VTK_ID_TYPE 12 */ - 0, /* VTK_STRING 13 */ - 0, /* VTK_OPAQUE 14 */ - 0xD, /* VTK_SIGNED_CHAR 15 */ - 0xB, /* VTK_LONG_LONG 16 */ - 0x1B, /* VTK_UNSIGNED_LONG_LONG 17 */ - 0xC, /* VTK___INT64 18 */ - 0x1C /* VTK_UNSIGNED___INT64 19 */ - }; - -/* Define some constants to simplify references to the table lookup in - the type_primitive production rule code. */ -#include "vtkType.h" -#define VTK_PARSE_INT8 vtkParseTypeMap[VTK_TYPE_INT8] -#define VTK_PARSE_UINT8 vtkParseTypeMap[VTK_TYPE_UINT8] -#define VTK_PARSE_INT16 vtkParseTypeMap[VTK_TYPE_INT16] -#define VTK_PARSE_UINT16 vtkParseTypeMap[VTK_TYPE_UINT16] -#define VTK_PARSE_INT32 vtkParseTypeMap[VTK_TYPE_INT32] -#define VTK_PARSE_UINT32 vtkParseTypeMap[VTK_TYPE_UINT32] -#define VTK_PARSE_INT64 vtkParseTypeMap[VTK_TYPE_INT64] -#define VTK_PARSE_UINT64 vtkParseTypeMap[VTK_TYPE_UINT64] -#define VTK_PARSE_FLOAT32 vtkParseTypeMap[VTK_TYPE_FLOAT32] -#define VTK_PARSE_FLOAT64 vtkParseTypeMap[VTK_TYPE_FLOAT64] - -static void vtkParseDebug(const char* s1, const char* s2); - /* Borland and MSVC do not define __STDC__ properly. */ #if !defined(__STDC__) # if (defined(_MSC_VER) && _MSC_VER >= 1200) || defined(__BORLANDC__) @@ -160,3841 +117,10379 @@ static void vtkParseDebug(const char* s1, const char* s2); # pragma warn -8066 /* unreachable code */ #endif +/* Map from the type anonymous_enumeration in vtkType.h to the VTK wrapping type + system number for the type. */ + +#include "vtkParse.h" +#include "vtkParseInternal.h" +#include "vtkParsePreprocess.h" +#include "vtkType.h" + +static unsigned int vtkParseTypeMap[] = + { + VTK_PARSE_VOID, /* VTK_VOID 0 */ + 0, /* VTK_BIT 1 */ + VTK_PARSE_CHAR, /* VTK_CHAR 2 */ + VTK_PARSE_UNSIGNED_CHAR, /* VTK_UNSIGNED_CHAR 3 */ + VTK_PARSE_SHORT, /* VTK_SHORT 4 */ + VTK_PARSE_UNSIGNED_SHORT, /* VTK_UNSIGNED_SHORT 5 */ + VTK_PARSE_INT, /* VTK_INT 6 */ + VTK_PARSE_UNSIGNED_INT, /* VTK_UNSIGNED_INT 7 */ + VTK_PARSE_LONG, /* VTK_LONG 8 */ + VTK_PARSE_UNSIGNED_LONG, /* VTK_UNSIGNED_LONG 9 */ + VTK_PARSE_FLOAT, /* VTK_FLOAT 10 */ + VTK_PARSE_DOUBLE, /* VTK_DOUBLE 11 */ + VTK_PARSE_ID_TYPE, /* VTK_ID_TYPE 12 */ + VTK_PARSE_STRING, /* VTK_STRING 13 */ + 0, /* VTK_OPAQUE 14 */ + VTK_PARSE_SIGNED_CHAR, /* VTK_SIGNED_CHAR 15 */ + VTK_PARSE_LONG_LONG, /* VTK_LONG_LONG 16 */ + VTK_PARSE_UNSIGNED_LONG_LONG, /* VTK_UNSIGNED_LONG_LONG 17 */ + VTK_PARSE___INT64, /* VTK___INT64 18 */ + VTK_PARSE_UNSIGNED___INT64, /* VTK_UNSIGNED___INT64 19 */ + 0, /* VTK_VARIANT 20 */ + 0, /* VTK_OBJECT 21 */ + VTK_PARSE_UNICODE_STRING /* VTK_UNICODE_STRING 22 */ + }; + +/* Define some constants to simplify references to the table lookup in + the type_primitive production rule code. */ +#define VTK_PARSE_INT8 vtkParseTypeMap[VTK_TYPE_INT8] +#define VTK_PARSE_UINT8 vtkParseTypeMap[VTK_TYPE_UINT8] +#define VTK_PARSE_INT16 vtkParseTypeMap[VTK_TYPE_INT16] +#define VTK_PARSE_UINT16 vtkParseTypeMap[VTK_TYPE_UINT16] +#define VTK_PARSE_INT32 vtkParseTypeMap[VTK_TYPE_INT32] +#define VTK_PARSE_UINT32 vtkParseTypeMap[VTK_TYPE_UINT32] +#define VTK_PARSE_INT64 vtkParseTypeMap[VTK_TYPE_INT64] +#define VTK_PARSE_UINT64 vtkParseTypeMap[VTK_TYPE_UINT64] +#define VTK_PARSE_FLOAT32 vtkParseTypeMap[VTK_TYPE_FLOAT32] +#define VTK_PARSE_FLOAT64 vtkParseTypeMap[VTK_TYPE_FLOAT64] + +#define vtkParseDebug(s1, s2) \ + if ( parseDebug ) { fprintf(stderr, " %s %s\n", s1, s2); } + +/* the tokenizer */ int yylex(void); -void output_function(void); -/* vtkstrdup is not part of POSIX so we create our own */ -char *vtkstrdup(const char *in) +/* the "preprocessor" */ +PreprocessInfo preprocessor = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + +/* global variables */ +FileInfo data; + +int NumberOfConcreteClasses = 0; +const char **ConcreteClasses; + +NamespaceInfo *currentNamespace = NULL; +ClassInfo *currentClass = NULL; +FunctionInfo *currentFunction = NULL; +TemplateArgs *currentTemplate = NULL; + +const char *currentEnumName = 0; +const char *currentEnumValue = 0; + +int parseDebug; +parse_access_t access_level = VTK_ACCESS_PUBLIC; +int IgnoreBTX = 0; + +/* helper functions */ +void start_class(const char *classname, int is_struct_or_union); +void reject_class(const char *classname, int is_struct_or_union); +void end_class(); +void output_function(void); +void reject_function(void); +void set_return(FunctionInfo *func, unsigned int type, + const char *typeclass, int count); +void add_argument(FunctionInfo *func, unsigned int type, + const char *classname, int count); +void add_using(const char *name, int is_namespace); +void start_enum(const char *enumname); +void add_enum(const char *name, const char *value); +void end_enum(); +void add_constant(const char *name, const char *value, + unsigned int type, const char *typeclass, int global); +const char *add_const_scope(const char *name); +void prepend_scope(char *cp, const char *arg); +unsigned int add_indirection(unsigned int tval, unsigned int ptr); +unsigned int add_indirection_to_array(unsigned int ptr); +void handle_complex_type(ValueInfo *val, unsigned int datatype, + unsigned int extra, const char *funcSig); +void handle_function_type(ValueInfo *arg, const char *name, + const char *funcSig); + +void outputSetVectorMacro(const char *var, unsigned int argType, + const char *typeText, int n); +void outputGetVectorMacro(const char *var, unsigned int argType, + const char *typeText, int n); + +/*---------------------------------------------------------------- + * String utility methods + * + * Strings are centrally allocated and are const, and they are not + * freed until the program exits. If they need to be freed before + * then, vtkstrfree() can be called. + */ + +size_t stringChunkPos = 0; +int numberOfChunks = 0; +char **stringArray = NULL; + +/* allocate a string of n+1 bytes */ +static char *vtkstralloc(size_t n) { - char *res = malloc(strlen(in)+1); - strcpy(res,in); - return res; -} + size_t chunk_size = 8176; + size_t nextChunkPos; + char *cp; -#include "vtkParse.h" - - FileInfo data; - FunctionInfo *currentFunction; - - FILE *fhint; - char temps[2048]; - int in_public; - int in_protected; - int HaveComment; - char CommentText[50000]; - int CommentState; - int openSig; - int invertSig; - unsigned int sigAllocatedLength; - -#define YYMAXDEPTH 1000 - - void checkSigSize(const char *arg) - { - if (strlen(currentFunction->Signature) + strlen(arg) + 3 > - sigAllocatedLength) - { - currentFunction->Signature = (char *) - realloc(currentFunction->Signature, sigAllocatedLength*2); - sigAllocatedLength = sigAllocatedLength*2; - } - } - void preSig(const char *arg) - { - if (!currentFunction->Signature) - { - currentFunction->Signature = (char*)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"%s",arg); - } - else if (openSig) - { - char *tmp; - checkSigSize(arg); - tmp = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"%s%s",arg,tmp); - free(tmp); - } - } - void postSig(const char *arg) - { - if (!currentFunction->Signature) - { - currentFunction->Signature = (char*)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"%s",arg); - } - else if (openSig) - { - char *tmp; - checkSigSize(arg); - tmp = vtkstrdup(currentFunction->Signature); - if (invertSig) - { - sprintf(currentFunction->Signature,"%s%s",arg,tmp); - } - else - { - sprintf(currentFunction->Signature,"%s%s",tmp,arg); - } - free(tmp); - } - } - void delSig(void) + // align next start position on an 8-byte boundary + nextChunkPos = (((stringChunkPos + n + 8) | 7 ) - 7); + + if (numberOfChunks == 0 || nextChunkPos > chunk_size) { - if (currentFunction->Signature) + if (n + 1 > chunk_size) { - free(currentFunction->Signature); - currentFunction->Signature = NULL; + chunk_size = n + 1; } + cp = (char *)malloc(chunk_size); + vtkParse_AddStringToArray((const char ***)&stringArray, &numberOfChunks, + cp); + stringChunkPos = 0; + nextChunkPos = (((n + 8) | 7) - 7); + } + + cp = &stringArray[numberOfChunks-1][stringChunkPos]; + cp[0] = '\0'; + + stringChunkPos = nextChunkPos; + + return cp; +} + +/* free all allocated strings */ +void vtkstrfree() +{ + int i; + + for (i = 0; i < numberOfChunks; i++) + { + free(stringArray[i]); } - void legacySig(void) + if (stringArray) { - currentFunction->IsLegacy = 1; + free(stringArray); } + stringArray = NULL; + numberOfChunks = 0; +} -/* Line 189 of yacc.c */ -#line 259 "vtkParse.tab.c" +/* duplicate the first n bytes of a string and terminate */ +static const char *vtkstrndup(const char *in, size_t n) +{ + char *res = NULL; -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif + res = vtkstralloc(n); + strncpy(res, in, n); + res[n] = '\0'; -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif + return res; +} -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 -#endif +/* duplicate a string */ +static const char *vtkstrdup(const char *in) +{ + if (in) + { + return vtkstrndup(in, strlen(in)); + } + return in; +} -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - CLASS = 258, - PUBLIC = 259, - PRIVATE = 260, - PROTECTED = 261, - VIRTUAL = 262, - STRING = 263, - NUM = 264, - ID = 265, - INT = 266, - FLOAT = 267, - SHORT = 268, - LONG = 269, - LONG_LONG = 270, - INT64__ = 271, - DOUBLE = 272, - VOID = 273, - CHAR = 274, - SIGNED_CHAR = 275, - BOOL = 276, - CLASS_REF = 277, - OTHER = 278, - CONST = 279, - OPERATOR = 280, - UNSIGNED = 281, - FRIEND = 282, - VTK_ID = 283, - STATIC = 284, - VAR_FUNCTION = 285, - ARRAY_NUM = 286, - VTK_LEGACY = 287, - TypeInt8 = 288, - TypeUInt8 = 289, - TypeInt16 = 290, - TypeUInt16 = 291, - TypeInt32 = 292, - TypeUInt32 = 293, - TypeInt64 = 294, - TypeUInt64 = 295, - TypeFloat32 = 296, - TypeFloat64 = 297, - IdType = 298, - StdString = 299, - SetMacro = 300, - GetMacro = 301, - SetStringMacro = 302, - GetStringMacro = 303, - SetClampMacro = 304, - SetObjectMacro = 305, - SetReferenceCountedObjectMacro = 306, - GetObjectMacro = 307, - BooleanMacro = 308, - SetVector2Macro = 309, - SetVector3Macro = 310, - SetVector4Macro = 311, - SetVector6Macro = 312, - GetVector2Macro = 313, - GetVector3Macro = 314, - GetVector4Macro = 315, - GetVector6Macro = 316, - SetVectorMacro = 317, - GetVectorMacro = 318, - ViewportCoordinateMacro = 319, - WorldCoordinateMacro = 320, - TypeMacro = 321, - VTK_WRAP_EXTERN = 322 - }; -#endif +/* helper function for concatenating strings */ +static const char *vtkstrncat(size_t n, const char **str) +{ + char *cp; + size_t i; + size_t j[8]; + size_t m = 0; + for (i = 0; i < n; i++) + { + j[i] = 0; + if (str[i]) + { + j[i] = strlen(str[i]); + m += j[i]; + } + } + cp = vtkstralloc(m); + m = 0; + for (i = 0; i < n; i++) + { + if (j[i]) + { + strncpy(&cp[m], str[i], j[i]); + m += j[i]; + } + } + cp[m] = '\0'; + return cp; +} -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE +/* concatenate strings */ +static const char *vtkstrcat(const char *str1, const char *str2) { + const char *cp[2]; -/* Line 214 of yacc.c */ -#line 200 "vtkParse.y" - - char *str; - int integer; - struct { - char* name; - int external; - } vtkid; + cp[0] = str1; + cp[1] = str2; + return vtkstrncat(2, cp); +} +static const char *vtkstrcat3(const char *str1, const char *str2, + const char *str3) +{ + const char *cp[3]; + cp[0] = str1; + cp[1] = str2; + cp[2] = str3; + return vtkstrncat(3, cp); +} -/* Line 214 of yacc.c */ -#line 373 "vtkParse.tab.c" -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif +static const char *vtkstrcat4(const char *str1, const char *str2, + const char *str3, const char *str4) +{ + const char *cp[4]; + cp[0] = str1; + cp[1] = str2; + cp[2] = str3; + cp[3] = str4; + return vtkstrncat(4, cp); +} -/* Copy the second part of user declarations. */ +static const char *vtkstrcat5(const char *str1, const char *str2, + const char *str3, const char *str4, + const char *str5) +{ + const char *cp[5]; + + cp[0] = str1; + cp[1] = str2; + cp[2] = str3; + cp[3] = str4; + cp[4] = str5; + return vtkstrncat(5, cp); +} +static const char *vtkstrcat6(const char *str1, const char *str2, + const char *str3, const char *str4, + const char *str5, const char *str6) +{ + const char *cp[6]; + + cp[0] = str1; + cp[1] = str2; + cp[2] = str3; + cp[3] = str4; + cp[4] = str5; + cp[5] = str6; + return vtkstrncat(6, cp); +} -/* Line 264 of yacc.c */ -#line 385 "vtkParse.tab.c" +static const char *vtkstrcat7(const char *str1, const char *str2, + const char *str3, const char *str4, + const char *str5, const char *str6, + const char *str7) +{ + const char *cp[7]; + + cp[0] = str1; + cp[1] = str2; + cp[2] = str3; + cp[3] = str4; + cp[4] = str5; + cp[5] = str6; + cp[6] = str7; + return vtkstrncat(7, cp); +} -#ifdef short -# undef short -#endif +/*---------------------------------------------------------------- + * Comments + */ -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif +/* "private" variables */ +char *commentText = NULL; +size_t commentLength = 0; +size_t commentAllocatedLength = 0; +int commentState = 0; -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif +const char *getComment() +{ + if (commentState != 0) + { + return commentText; + } + return NULL; +} -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif +void clearComment() +{ + commentLength = 0; + if (commentText) + { + commentText[commentLength] = '\0'; + } + commentState = 0; +} -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif +void addCommentLine(const char *line, size_t n) +{ + if (commentState <= 0) + { + clearComment(); + return; + } -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif + if (commentText == NULL) + { + commentAllocatedLength = n+80; + commentText = (char *)malloc(commentAllocatedLength); + commentLength = 0; + commentText[0] = '\0'; + } + else if (commentLength + n + 2 > commentAllocatedLength) + { + commentAllocatedLength = commentAllocatedLength + commentLength + n + 2; + commentText = (char *)realloc(commentText, commentAllocatedLength); + } -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + if (n > 0) + { + memcpy(&commentText[commentLength], line, n); + } + commentLength += n; + commentText[commentLength++] = '\n'; + commentText[commentLength] = '\0'; +} -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif +void closeComment() +{ + switch (commentState) + { + case 1: + /* Make comment persist until a new comment starts */ + commentState = -1; + break; + case 2: + data.Description = vtkstrdup(getComment()); + clearComment(); + break; + case 3: + data.SeeAlso = vtkstrdup(getComment()); + clearComment(); + break; + case 4: + data.Caveats = vtkstrdup(getComment()); + clearComment(); + break; + } +} -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif +void closeOrClearComment() +{ + if (commentState < 0) + { + clearComment(); + } + else + { + closeComment(); + } +} -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif +void setCommentState(int state) { - return yyi; + switch (state) + { + case 0: + closeComment(); + break; + default: + closeComment(); + clearComment(); + break; + } + + commentState = state; } -#endif -#if ! defined yyoverflow || YYERROR_VERBOSE -/* The parser invokes alloca or malloc; define the necessary symbols. */ +/*---------------------------------------------------------------- + * Namespaces + * + * operates on: currentNamespace + */ -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif +/* "private" variables */ +NamespaceInfo *namespaceStack[10]; +int namespaceDepth = 0; -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ +/* enter a namespace */ +void pushNamespace(const char *name) +{ + int i; + NamespaceInfo *oldNamespace = currentNamespace; + + for (i = 0; i < oldNamespace->NumberOfNamespaces; i++) + { + /* see if the namespace already exists */ + if (strcmp(name, oldNamespace->Namespaces[i]->Name) == 0) + { + currentNamespace = oldNamespace->Namespaces[i]; + } + } + /* create a new namespace */ + if (i == oldNamespace->NumberOfNamespaces) + { + currentNamespace = (NamespaceInfo *)malloc(sizeof(NamespaceInfo)); + vtkParse_InitNamespace(currentNamespace); + currentNamespace->Name = vtkstrdup(name); + vtkParse_AddNamespaceToNamespace(oldNamespace, currentNamespace); + } -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + namespaceStack[namespaceDepth++] = oldNamespace; +} -/* A type that is properly aligned for any stack member. */ -union yyalloc +/* leave the namespace */ +void popNamespace() { - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + currentNamespace = namespaceStack[--namespaceDepth]; +} -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +/*---------------------------------------------------------------- + * Classes + * + * operates on: currentClass, access_level + */ -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +/* "private" variables */ +ClassInfo *classStack[10]; +parse_access_t classAccessStack[10]; +int classDepth = 0; -#endif +/* start an internal class definition */ +void pushClass() +{ + classAccessStack[classDepth] = access_level; + classStack[classDepth++] = currentClass; +} -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 63 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 891 +/* leave the internal class */ +void popClass() +{ + currentClass = classStack[--classDepth]; + access_level = classAccessStack[classDepth]; +} -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 83 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 75 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 197 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 370 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 322 +/*---------------------------------------------------------------- + * Templates + * + * operates on: currentTemplate + */ -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) +/* "private" variables */ +TemplateArgs *templateStack[10]; +int templateDepth = 0; -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = +/* begin a template */ +void startTemplate() { - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 79, 2, - 72, 73, 80, 2, 76, 81, 82, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 70, 71, - 2, 75, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 77, 2, 78, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 68, 2, 69, 74, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67 -}; + currentTemplate = (TemplateArgs *)malloc(sizeof(TemplateArgs)); + vtkParse_InitTemplateArgs(currentTemplate); +} -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = +/* clear a template, if set */ +void clearTemplate() { - 0, 0, 3, 7, 10, 12, 13, 21, 23, 26, - 29, 31, 33, 36, 39, 43, 46, 49, 51, 56, - 59, 63, 65, 68, 72, 77, 81, 84, 86, 89, - 93, 98, 102, 105, 109, 110, 111, 116, 120, 121, - 123, 124, 130, 132, 134, 136, 138, 140, 145, 149, - 153, 154, 156, 158, 159, 164, 166, 167, 172, 174, - 175, 178, 182, 185, 188, 189, 190, 194, 199, 202, - 204, 207, 211, 213, 216, 218, 220, 223, 226, 228, - 230, 232, 235, 238, 239, 243, 245, 247, 249, 251, - 253, 255, 257, 259, 261, 263, 265, 267, 269, 271, - 273, 275, 277, 279, 281, 283, 285, 287, 289, 291, - 293, 294, 297, 300, 301, 307, 309, 311, 313, 316, - 318, 320, 324, 326, 327, 335, 336, 337, 346, 347, - 353, 354, 360, 361, 362, 373, 374, 382, 383, 391, - 392, 393, 402, 403, 411, 412, 420, 421, 429, 430, - 438, 439, 447, 448, 456, 457, 465, 466, 474, 475, - 483, 484, 494, 495, 505, 510, 515, 522, 530, 531, - 534, 535, 538, 540, 542, 544, 546, 548, 550, 552, - 554, 556, 558, 560, 562, 564, 566, 568, 570, 572, - 574, 576, 578, 580, 582, 584, 588, 592 -}; + if (currentTemplate) + { + free(currentTemplate); + } + currentTemplate = NULL; +} -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = +/* push the template onto the stack, and start a new one */ +void pushTemplate() { - 84, 0, -1, 151, 86, 151, -1, 28, 67, -1, - 28, -1, -1, 3, 28, 87, 122, 68, 88, 69, - -1, 89, -1, 89, 88, -1, 125, 70, -1, 110, - -1, 92, -1, 27, 92, -1, 91, 103, -1, 27, - 91, 103, -1, 90, 103, -1, 128, 71, -1, 128, - -1, 32, 72, 91, 73, -1, 74, 94, -1, 7, - 74, 94, -1, 94, -1, 114, 94, -1, 114, 24, - 94, -1, 7, 114, 24, 94, -1, 7, 114, 94, - -1, 7, 94, -1, 93, -1, 114, 93, -1, 114, - 24, 93, -1, 7, 114, 24, 93, -1, 7, 114, - 93, -1, 7, 93, -1, 25, 152, 71, -1, -1, - -1, 98, 95, 97, 96, -1, 98, 75, 9, -1, - -1, 24, -1, -1, 102, 72, 99, 104, 73, -1, - 24, -1, 29, -1, 85, -1, 10, -1, 71, -1, - 68, 151, 69, 71, -1, 68, 151, 69, -1, 70, - 152, 71, -1, -1, 105, -1, 107, -1, -1, 107, - 106, 76, 105, -1, 114, -1, -1, 114, 111, 108, - 109, -1, 30, -1, -1, 75, 126, -1, 114, 111, - 71, -1, 30, 71, -1, 102, 112, -1, -1, -1, - 31, 113, 112, -1, 77, 152, 78, 112, -1, 100, - 115, -1, 115, -1, 101, 115, -1, 101, 100, 115, - -1, 119, -1, 119, 118, -1, 116, -1, 117, -1, - 117, 79, -1, 117, 80, -1, 44, -1, 79, -1, - 80, -1, 79, 118, -1, 80, 118, -1, -1, 26, - 120, 121, -1, 121, -1, 33, -1, 34, -1, 35, - -1, 36, -1, 37, -1, 38, -1, 39, -1, 40, - -1, 41, -1, 42, -1, 12, -1, 18, -1, 19, - -1, 11, -1, 13, -1, 14, -1, 17, -1, 10, - -1, 85, -1, 43, -1, 15, -1, 16, -1, 20, - -1, 21, -1, -1, 70, 123, -1, 125, 28, -1, - -1, 125, 28, 124, 76, 123, -1, 4, -1, 5, - -1, 6, -1, 81, 127, -1, 127, -1, 9, -1, - 9, 82, 9, -1, 102, -1, -1, 45, 72, 102, - 76, 129, 119, 73, -1, -1, -1, 46, 72, 130, - 102, 76, 131, 119, 73, -1, -1, 47, 72, 132, - 102, 73, -1, -1, 48, 72, 133, 102, 73, -1, - -1, -1, 49, 72, 102, 76, 134, 119, 135, 76, - 152, 73, -1, -1, 50, 72, 102, 76, 136, 119, - 73, -1, -1, 51, 72, 102, 76, 137, 119, 73, - -1, -1, -1, 52, 72, 138, 102, 76, 139, 119, - 73, -1, -1, 53, 72, 102, 140, 76, 119, 73, - -1, -1, 54, 72, 102, 76, 141, 119, 73, -1, - -1, 58, 72, 102, 76, 142, 119, 73, -1, -1, - 55, 72, 102, 76, 143, 119, 73, -1, -1, 59, - 72, 102, 76, 144, 119, 73, -1, -1, 56, 72, - 102, 76, 145, 119, 73, -1, -1, 60, 72, 102, - 76, 146, 119, 73, -1, -1, 57, 72, 102, 76, - 147, 119, 73, -1, -1, 61, 72, 102, 76, 148, - 119, 73, -1, -1, 62, 72, 102, 76, 149, 119, - 76, 126, 73, -1, -1, 63, 72, 102, 76, 150, - 119, 76, 126, 73, -1, 64, 72, 102, 73, -1, - 65, 72, 102, 73, -1, 66, 72, 102, 76, 102, - 73, -1, 66, 72, 102, 76, 102, 76, 73, -1, - -1, 153, 151, -1, -1, 154, 152, -1, 71, -1, - 154, -1, 23, -1, 155, -1, 156, -1, 80, -1, - 75, -1, 70, -1, 76, -1, 82, -1, 8, -1, - 119, -1, 117, -1, 9, -1, 22, -1, 79, -1, - 157, -1, 24, -1, 25, -1, 81, -1, 74, -1, - 29, -1, 31, -1, 68, 151, 69, -1, 72, 151, - 73, -1, 77, 151, 78, -1 -}; + templateStack[templateDepth++] = currentTemplate; + startTemplate(); +} -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = +/* pop a template off the stack */ +void popTemplate() { - 0, 281, 281, 283, 288, 295, 294, 300, 300, 302, - 302, 303, 304, 305, 306, 307, 308, 309, 311, 313, - 314, 315, 316, 320, 324, 329, 334, 340, 344, 349, - 354, 360, 366, 372, 378, 378, 378, 384, 393, 393, - 395, 395, 397, 399, 401, 401, 403, 404, 405, 406, - 408, 408, 410, 411, 411, 413, 419, 418, 425, 432, - 432, 434, 434, 436, 444, 445, 445, 448, 451, 452, - 453, 454, 456, 457, 459, 461, 462, 463, 465, 475, - 476, 477, 478, 480, 480, 482, 485, 486, 487, 488, - 489, 490, 491, 492, 493, 494, 495, 496, 497, 498, - 499, 500, 501, 502, 507, 527, 528, 529, 530, 531, - 533, 533, 535, 541, 540, 546, 547, 548, 550, 550, - 552, 553, 553, 557, 556, 568, 568, 568, 577, 577, - 588, 588, 598, 599, 597, 630, 629, 642, 641, 653, - 654, 653, 663, 662, 680, 679, 710, 709, 727, 726, - 759, 758, 776, 775, 810, 809, 827, 826, 865, 864, - 882, 881, 900, 899, 916, 963, 1012, 1063, 1119, 1119, - 1120, 1120, 1122, 1122, 1124, 1124, 1124, 1124, 1124, 1124, - 1124, 1124, 1125, 1125, 1125, 1125, 1125, 1125, 1125, 1126, - 1126, 1126, 1126, 1126, 1126, 1128, 1129, 1130 -}; -#endif + currentTemplate = templateStack[--templateDepth]; +} -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = +/*---------------------------------------------------------------- + * Function signatures + * + * operates on: currentFunction + */ + +/* "private" variables */ +int sigClosed = 0; +size_t sigMark[10]; +size_t sigLength = 0; +size_t sigAllocatedLength = 0; +int sigMarkDepth = 0; +char *signature = NULL; + +/* start a new signature */ +void startSig() { - "$end", "error", "$undefined", "CLASS", "PUBLIC", "PRIVATE", - "PROTECTED", "VIRTUAL", "STRING", "NUM", "ID", "INT", "FLOAT", "SHORT", - "LONG", "LONG_LONG", "INT64__", "DOUBLE", "VOID", "CHAR", "SIGNED_CHAR", - "BOOL", "CLASS_REF", "OTHER", "CONST", "OPERATOR", "UNSIGNED", "FRIEND", - "VTK_ID", "STATIC", "VAR_FUNCTION", "ARRAY_NUM", "VTK_LEGACY", - "TypeInt8", "TypeUInt8", "TypeInt16", "TypeUInt16", "TypeInt32", - "TypeUInt32", "TypeInt64", "TypeUInt64", "TypeFloat32", "TypeFloat64", - "IdType", "StdString", "SetMacro", "GetMacro", "SetStringMacro", - "GetStringMacro", "SetClampMacro", "SetObjectMacro", - "SetReferenceCountedObjectMacro", "GetObjectMacro", "BooleanMacro", - "SetVector2Macro", "SetVector3Macro", "SetVector4Macro", - "SetVector6Macro", "GetVector2Macro", "GetVector3Macro", - "GetVector4Macro", "GetVector6Macro", "SetVectorMacro", "GetVectorMacro", - "ViewportCoordinateMacro", "WorldCoordinateMacro", "TypeMacro", - "VTK_WRAP_EXTERN", "'{'", "'}'", "':'", "';'", "'('", "')'", "'~'", - "'='", "','", "'['", "']'", "'&'", "'*'", "'-'", "'.'", "$accept", - "strt", "vtk_id", "class_def", "$@1", "class_def_body", "class_def_item", - "legacy_function", "function", "operator", "operator_sig", "func", "$@2", - "$@3", "maybe_const", "func_sig", "$@4", "const_mod", "static_mod", - "any_id", "func_body", "args_list", "more_args", "$@5", "arg", "$@6", - "opt_var_assign", "var", "var_id", "var_array", "$@7", "type", - "type_red1", "type_string1", "type_string2", "type_indirection", - "type_red2", "$@8", "type_primitive", "optional_scope", "scope_list", - "$@9", "scope_type", "float_num", "float_prim", "macro", "$@10", "$@11", - "$@12", "$@13", "$@14", "$@15", "$@16", "$@17", "$@18", "$@19", "$@20", - "$@21", "$@22", "$@23", "$@24", "$@25", "$@26", "$@27", "$@28", "$@29", - "$@30", "$@31", "maybe_other", "maybe_other_no_semi", "other_stuff", - "other_stuff_no_semi", "braces", "parens", "brackets", 0 -}; -#endif + signature = NULL; + sigLength = 0; + sigAllocatedLength = 0; + sigClosed = 0; + sigMarkDepth = 0; + sigMark[0] = 0; +} -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = +/* get the signature */ +const char *getSig() { - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 123, 125, - 58, 59, 40, 41, 126, 61, 44, 91, 93, 38, - 42, 45, 46 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 83, 84, 85, 85, 87, 86, 88, 88, 89, - 89, 89, 89, 89, 89, 89, 89, 89, 90, 91, - 91, 91, 91, 91, 91, 91, 91, 92, 92, 92, - 92, 92, 92, 93, 95, 96, 94, 94, 97, 97, - 99, 98, 100, 101, 102, 102, 103, 103, 103, 103, - 104, 104, 105, 106, 105, 107, 108, 107, 107, 109, - 109, 110, 110, 111, 112, 113, 112, 112, 114, 114, - 114, 114, 115, 115, 115, 116, 116, 116, 117, 118, - 118, 118, 118, 120, 119, 119, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, - 122, 122, 123, 124, 123, 125, 125, 125, 126, 126, - 127, 127, 127, 129, 128, 130, 131, 128, 132, 128, - 133, 128, 134, 135, 128, 136, 128, 137, 128, 138, - 139, 128, 140, 128, 141, 128, 142, 128, 143, 128, - 144, 128, 145, 128, 146, 128, 147, 128, 148, 128, - 149, 128, 150, 128, 128, 128, 128, 128, 151, 151, - 152, 152, 153, 153, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 154, 154, 154, 154, 154, - 154, 154, 154, 154, 154, 155, 156, 157 -}; + return signature; +} -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +/* reallocate Signature if n chars cannot be appended */ +void checkSigSize(size_t n) { - 0, 2, 3, 2, 1, 0, 7, 1, 2, 2, - 1, 1, 2, 2, 3, 2, 2, 1, 4, 2, - 3, 1, 2, 3, 4, 3, 2, 1, 2, 3, - 4, 3, 2, 3, 0, 0, 4, 3, 0, 1, - 0, 5, 1, 1, 1, 1, 1, 4, 3, 3, - 0, 1, 1, 0, 4, 1, 0, 4, 1, 0, - 2, 3, 2, 2, 0, 0, 3, 4, 2, 1, - 2, 3, 1, 2, 1, 1, 2, 2, 1, 1, - 1, 2, 2, 0, 3, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 0, 2, 2, 0, 5, 1, 1, 1, 2, 1, - 1, 3, 1, 0, 7, 0, 0, 8, 0, 5, - 0, 5, 0, 0, 10, 0, 7, 0, 7, 0, - 0, 8, 0, 7, 0, 7, 0, 7, 0, 7, - 0, 7, 0, 7, 0, 7, 0, 7, 0, 7, - 0, 9, 0, 9, 4, 4, 6, 7, 0, 2, - 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 3, 3, 3 -}; + const char *ccp; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 168, 182, 185, 103, 99, 96, 100, 101, 106, 107, - 102, 97, 98, 108, 109, 186, 174, 189, 190, 83, - 4, 193, 194, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 105, 78, 168, 179, 172, 168, 192, - 178, 180, 168, 187, 177, 191, 181, 0, 104, 184, - 183, 85, 0, 168, 173, 175, 176, 188, 0, 3, - 0, 0, 0, 1, 0, 168, 169, 84, 195, 196, - 197, 5, 2, 110, 0, 0, 115, 116, 117, 111, - 0, 0, 112, 0, 103, 42, 170, 0, 43, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 104, 0, 7, 0, 0, 11, - 27, 21, 34, 0, 0, 0, 10, 0, 69, 74, - 75, 72, 0, 17, 0, 0, 32, 26, 0, 0, - 170, 0, 12, 0, 62, 0, 0, 125, 128, 130, - 0, 0, 0, 139, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 45, 44, - 19, 6, 8, 168, 170, 46, 15, 13, 0, 38, - 68, 0, 70, 40, 0, 28, 22, 64, 0, 76, - 77, 79, 80, 73, 9, 16, 0, 20, 0, 31, - 25, 33, 171, 14, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 142, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 37, 39, 35, 71, 50, 29, 23, 65, 170, - 63, 61, 81, 82, 114, 30, 24, 0, 18, 0, - 123, 0, 0, 0, 132, 135, 137, 0, 0, 144, - 148, 152, 156, 146, 150, 154, 158, 160, 162, 164, - 165, 0, 48, 49, 36, 58, 0, 51, 52, 55, - 64, 0, 0, 0, 126, 129, 131, 0, 0, 0, - 140, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 47, 41, 0, 64, 56, 66, 64, - 0, 0, 133, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 166, 0, 0, - 59, 67, 124, 0, 0, 136, 138, 0, 143, 145, - 149, 153, 157, 147, 151, 155, 159, 0, 0, 167, - 54, 0, 57, 127, 170, 141, 120, 0, 122, 0, - 119, 0, 60, 0, 0, 118, 161, 163, 134, 121 -}; + if (sigAllocatedLength == 0) + { + sigAllocatedLength = 80 + n; + signature = vtkstralloc(sigAllocatedLength); + signature[0] = '\0'; + } + else if (sigLength + n > sigAllocatedLength) + { + sigAllocatedLength += sigLength + n; + ccp = signature; + signature = vtkstralloc(sigAllocatedLength); + strncpy(signature, ccp, sigLength); + signature[sigLength] = '\0'; + } +} -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = +/* close the signature, i.e. allow no more additions to it */ +void closeSig() { - -1, 47, 169, 65, 73, 115, 116, 117, 118, 119, - 120, 121, 179, 274, 233, 122, 235, 123, 124, 125, - 176, 276, 277, 305, 278, 330, 352, 126, 188, 240, - 280, 127, 128, 129, 49, 193, 50, 58, 51, 75, - 79, 134, 80, 359, 360, 133, 283, 208, 311, 209, - 210, 287, 334, 288, 289, 214, 315, 258, 292, 296, - 293, 297, 294, 298, 295, 299, 300, 301, 52, 139, - 53, 54, 55, 56, 57 -}; + sigClosed = 1; +} -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -274 -static const yytype_int16 yypact[] = +/* re-open the signature */ +void openSig() { - 322, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -44, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, 322, -274, -274, 322, -274, - -274, -274, 322, -274, -274, -274, -274, 37, -274, -274, - -274, -274, 46, 322, -274, -274, -274, -274, 848, -274, - -3, -17, 4, -274, 56, 322, -274, -274, -274, -274, - -274, -274, -274, 29, 131, 39, -274, -274, -274, -274, - 77, 476, 32, 625, 38, -274, 397, 541, -274, 41, - 45, 47, 49, 50, 58, 59, 61, 67, 69, 71, - 72, 74, 75, 76, 80, 81, 83, 85, 93, 94, - 95, 96, 97, 22, 98, 102, 476, -46, -46, -274, - -274, -274, 53, 779, 744, 100, -274, 66, -274, -274, - -51, -2, 68, 79, 73, 22, -274, -274, 78, 88, - 397, -46, -274, 66, -274, 583, 22, -274, -274, -274, - 22, 22, 22, -274, 22, 22, 22, 22, 22, 22, - 22, 22, 22, 22, 22, 22, 22, 22, -274, -274, - -274, -274, -274, 322, 397, -274, -274, -274, 166, 152, - -274, 779, -274, -274, 44, -274, -274, -13, 106, -274, - -274, -2, -2, -274, -274, -274, 131, -274, 44, -274, - -274, -274, -274, -274, 667, 105, 87, 103, 22, 22, - 22, 107, 111, 126, 22, -274, 127, 132, 133, 137, - 149, 150, 151, 153, 154, 155, 109, 159, 157, 167, - 170, -274, -274, -274, -274, 709, -274, -274, -274, 397, - -274, -274, -274, -274, -274, -274, -274, 90, -274, 22, - -274, 161, 172, 173, -274, -274, -274, 171, 174, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, 22, 178, -274, -274, -274, 180, -274, 175, 22, - -10, 177, 22, 814, -274, -274, -274, 814, 814, 814, - -274, 814, 814, 814, 814, 814, 814, 814, 814, 814, - 814, 814, -43, -274, -274, 182, -10, -274, -274, -10, - 183, 814, -274, 186, 187, 814, 188, 189, 190, 191, - 192, 193, 194, 195, 197, 196, 198, -274, 200, 709, - 201, -274, -274, 202, 203, -274, -274, 204, -274, -274, - -274, -274, -274, -274, -274, -274, -274, 17, 17, -274, - -274, 17, -274, -274, 397, -274, 199, 52, -274, 205, - -274, 207, -274, 209, 262, -274, -274, -274, -274, -274 -}; + sigClosed = 0; +} -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = +/* insert text at the beginning of the signature */ +void preSig(const char *arg) { - -274, -274, 0, -274, -274, 168, -274, -274, -70, 215, - -64, -42, -274, -274, -274, -274, -274, 162, -274, 34, - -84, -274, -39, -274, -274, -274, -274, -274, 6, -273, - -274, -75, -121, -274, -72, -66, -77, -274, 245, -274, - 108, -274, -76, -256, -50, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -274, -274, - -274, -274, -274, -274, -274, -274, -274, -274, -22, -126, - -274, -85, -274, -274, -274 -}; + size_t n; -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -114 -static const yytype_int16 yytable[] = -{ - 48, 140, 180, 182, 131, 132, 131, 308, 138, 130, - 131, 130, 143, 60, 202, 130, 61, 141, 238, 136, - 62, 238, 173, 59, 174, 175, 356, 168, 189, 190, - 327, 66, 168, 328, 177, 48, 331, 63, 48, 131, - 132, 137, 48, 72, 130, 20, 131, 131, 230, 64, - 20, 130, 130, 48, 168, 140, 69, 203, 48, 183, - 234, 356, 168, 185, 239, 48, 68, 239, 131, 86, - 206, 170, 20, 130, 199, 205, 168, 191, 192, 185, - 20, 114, 70, 114, 71, 186, 48, 114, 168, 140, - 184, 86, 361, 197, 20, 362, 200, 168, 357, 74, - 168, 186, 198, 86, 131, 82, 20, 81, -113, 130, - -45, 249, 144, 281, 282, 20, 114, 145, 20, 146, - 236, 147, 148, 48, 48, 242, 243, 131, 178, 247, - 149, 150, 130, 151, 245, 76, 77, 78, 194, 152, - 48, 153, 237, 154, 155, 114, 156, 157, 158, 196, - 195, 229, 159, 160, 140, 161, 246, 162, 131, 201, - 279, 187, 137, 130, 186, 163, 164, 165, 166, 167, - -44, 171, 183, 48, 48, 231, 232, 241, 248, 250, - 207, 48, 269, 254, 211, 212, 213, 255, 215, 216, - 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, - 227, 228, 256, 259, 114, 200, 310, 237, 260, 261, - 312, 313, 314, 262, 316, 317, 318, 319, 320, 321, - 322, 323, 324, 325, 326, 263, 264, 265, 363, 266, - 267, 268, 270, 271, 333, 48, 272, 284, 337, 48, - 246, 273, 251, 252, 253, 285, 286, 290, 257, 303, - 291, -53, 131, 304, 279, 309, 332, 130, 329, 335, - 336, 338, 339, 340, 341, 342, 343, 344, 345, 140, - 346, 369, 347, 349, 348, 353, 351, 355, 366, 354, - 367, 364, 368, 48, 172, 307, 181, 48, 48, 48, - 350, 48, 48, 48, 48, 48, 48, 48, 48, 48, - 48, 48, 142, 67, 244, 302, 0, 365, 0, 0, - 0, 48, 0, 306, 0, 48, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 0, - 20, 21, 0, 22, 48, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 33, 34, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 358, 358, 0, 0, 358, 0, 0, 0, 0, - 35, 358, 36, 37, 38, 0, 39, 40, 41, 42, - 0, 43, 44, 45, 46, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 0, 20, 21, 0, 22, 0, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 35, 0, 36, 0, 38, - 0, 39, 40, 41, 42, 0, 43, 44, 45, 46, - 76, 77, 78, 83, 0, 0, 84, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 0, 0, - 85, 86, 19, 87, 20, 88, 89, 0, 90, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 0, 0, 0, 0, 0, 83, 0, - 113, 84, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 0, 0, 85, 86, 19, 0, 20, - 88, 0, 0, 0, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, 33, 34, 0, 0, 0, 0, - 204, 0, 0, 84, 4, 5, 6, 7, 8, 9, - 10, 11, 12, 13, 14, 0, 0, 85, 0, 19, - 0, 20, 88, 0, 0, 113, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 0, 0, - 0, 0, 0, 0, 0, 84, 4, 5, 6, 7, - 8, 9, 10, 11, 12, 13, 14, 0, 0, 85, - 86, 19, 0, 20, 88, 0, 0, 113, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 0, 0, 0, 0, 0, 0, 0, 84, 4, 5, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 0, - 0, 85, 0, 19, 0, 20, 88, 0, 0, 135, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 0, 0, 0, 0, 0, 0, 0, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 0, 0, 85, 0, 19, 0, 20, 88, 275, - 0, 135, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 0, 0, 85, 0, - 19, 0, 20, 0, 0, 0, 0, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 3, - 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, - 14, 0, 0, 0, 0, 19, 0, 20, 0, 0, - 0, 0, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 0, 0, 0, 0, - 19, 0, 20, 0, 0, 0, 0, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 0, 0, 0, 0, 0, 0, 20, 0, 0, 0, - 0, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33 -}; + n = strlen(arg); -static const yytype_int16 yycheck[] = -{ - 0, 86, 123, 124, 81, 81, 83, 280, 83, 81, - 87, 83, 87, 35, 140, 87, 38, 87, 31, 83, - 42, 31, 68, 67, 70, 71, 9, 10, 79, 80, - 73, 53, 10, 76, 118, 35, 309, 0, 38, 116, - 116, 83, 42, 65, 116, 28, 123, 124, 174, 3, - 28, 123, 124, 53, 10, 140, 73, 141, 58, 72, - 181, 9, 10, 127, 77, 65, 69, 77, 145, 25, - 145, 113, 28, 145, 138, 145, 10, 79, 80, 143, - 28, 81, 78, 83, 28, 127, 86, 87, 10, 174, - 24, 25, 348, 135, 28, 351, 138, 10, 81, 70, - 10, 143, 24, 25, 181, 28, 28, 68, 76, 181, - 72, 24, 71, 239, 24, 28, 116, 72, 28, 72, - 184, 72, 72, 123, 124, 191, 192, 204, 75, 204, - 72, 72, 204, 72, 198, 4, 5, 6, 70, 72, - 140, 72, 184, 72, 72, 145, 72, 72, 72, 76, - 71, 173, 72, 72, 239, 72, 198, 72, 235, 71, - 235, 127, 204, 235, 206, 72, 72, 72, 72, 72, - 72, 69, 72, 173, 174, 9, 24, 71, 73, 76, - 146, 181, 73, 76, 150, 151, 152, 76, 154, 155, - 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, - 166, 167, 76, 76, 204, 247, 283, 249, 76, 76, - 287, 288, 289, 76, 291, 292, 293, 294, 295, 296, - 297, 298, 299, 300, 301, 76, 76, 76, 354, 76, - 76, 76, 73, 76, 311, 235, 69, 76, 315, 239, - 282, 71, 208, 209, 210, 73, 73, 76, 214, 71, - 76, 76, 329, 73, 329, 78, 73, 329, 76, 73, - 73, 73, 73, 73, 73, 73, 73, 73, 73, 354, - 73, 9, 76, 73, 76, 73, 75, 73, 73, 76, - 73, 82, 73, 283, 116, 279, 124, 287, 288, 289, - 329, 291, 292, 293, 294, 295, 296, 297, 298, 299, - 300, 301, 87, 58, 196, 271, -1, 357, -1, -1, - -1, 311, -1, 279, -1, 315, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 329, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 23, 24, 25, 26, -1, - 28, 29, -1, 31, 354, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 44, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 347, 348, -1, -1, 351, -1, -1, -1, -1, - 68, 357, 70, 71, 72, -1, 74, 75, 76, 77, - -1, 79, 80, 81, 82, 8, 9, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, -1, 28, 29, -1, 31, -1, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 68, -1, 70, -1, 72, - -1, 74, 75, 76, 77, -1, 79, 80, 81, 82, - 4, 5, 6, 7, -1, -1, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, -1, -1, - 24, 25, 26, 27, 28, 29, 30, -1, 32, 33, - 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, -1, -1, -1, -1, -1, 7, -1, - 74, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, -1, -1, 24, 25, 26, -1, 28, - 29, -1, -1, -1, 33, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, -1, -1, -1, -1, - 7, -1, -1, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, -1, -1, 24, -1, 26, - -1, 28, 29, -1, -1, 74, 33, 34, 35, 36, - 37, 38, 39, 40, 41, 42, 43, 44, -1, -1, - -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, -1, -1, 24, - 25, 26, -1, 28, 29, -1, -1, 74, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - -1, -1, -1, -1, -1, -1, -1, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, -1, - -1, 24, -1, 26, -1, 28, 29, -1, -1, 74, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, -1, -1, -1, -1, -1, -1, -1, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, -1, -1, 24, -1, 26, -1, 28, 29, 30, - -1, 74, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, -1, -1, 24, -1, - 26, -1, 28, -1, -1, -1, -1, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 44, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, -1, -1, -1, -1, 26, -1, 28, -1, -1, - -1, -1, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, -1, -1, -1, -1, - 26, -1, 28, -1, -1, -1, -1, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - -1, -1, -1, -1, -1, -1, 28, -1, -1, -1, - -1, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43 -}; + if (!signature) + { + checkSigSize(n); + strncpy(signature, arg, n); + signature[n] = '\0'; + sigLength = n; + } + else if (!sigClosed && n > 0) + { + checkSigSize(n); + memmove(&signature[n], signature, sigLength); + strncpy(signature, arg, n); + sigLength += n; + signature[sigLength] = '\0'; + } +} -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +/* append text to the end of the signature */ +void postSig(const char *arg) { - 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 28, 29, 31, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 44, 68, 70, 71, 72, 74, - 75, 76, 77, 79, 80, 81, 82, 84, 85, 117, - 119, 121, 151, 153, 154, 155, 156, 157, 120, 67, - 151, 151, 151, 0, 3, 86, 151, 121, 69, 73, - 78, 28, 151, 87, 70, 122, 4, 5, 6, 123, - 125, 68, 28, 7, 10, 24, 25, 27, 29, 30, - 32, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 66, 74, 85, 88, 89, 90, 91, 92, - 93, 94, 98, 100, 101, 102, 110, 114, 115, 116, - 117, 119, 125, 128, 124, 74, 93, 94, 114, 152, - 154, 91, 92, 114, 71, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 72, 72, - 72, 72, 72, 72, 72, 72, 72, 72, 10, 85, - 94, 69, 88, 68, 70, 71, 103, 103, 75, 95, - 115, 100, 115, 72, 24, 93, 94, 102, 111, 79, - 80, 79, 80, 118, 70, 71, 76, 94, 24, 93, - 94, 71, 152, 103, 7, 91, 114, 102, 130, 132, - 133, 102, 102, 102, 138, 102, 102, 102, 102, 102, - 102, 102, 102, 102, 102, 102, 102, 102, 102, 151, - 152, 9, 24, 97, 115, 99, 93, 94, 31, 77, - 112, 71, 118, 118, 123, 93, 94, 114, 73, 24, - 76, 102, 102, 102, 76, 76, 76, 102, 140, 76, - 76, 76, 76, 76, 76, 76, 76, 76, 76, 73, - 73, 76, 69, 71, 96, 30, 104, 105, 107, 114, - 113, 152, 24, 129, 76, 73, 73, 134, 136, 137, - 76, 76, 141, 143, 145, 147, 142, 144, 146, 148, - 149, 150, 102, 71, 73, 106, 102, 111, 112, 78, - 119, 131, 119, 119, 119, 139, 119, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 73, 76, 76, - 108, 112, 73, 119, 135, 73, 73, 119, 73, 73, - 73, 73, 73, 73, 73, 73, 73, 76, 76, 73, - 105, 75, 109, 73, 76, 73, 9, 81, 102, 126, - 127, 126, 126, 152, 82, 127, 73, 73, 73, 9 -}; + size_t n; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + n = strlen(arg); -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ + if (!signature) + { + checkSigSize(n); + strncpy(signature, arg, n); + signature[n] = '\0'; + sigLength = n; + } + else if (!sigClosed) + { + checkSigSize(n); + strncpy(&signature[sigLength], arg, n); + sigLength += n; + signature[sigLength] = '\0'; + } +} -#define YYFAIL goto yyerrlab +/* prepend a scope:: to the ID at the end of the signature */ +void preScopeSig(const char *arg) +{ + size_t n; -#define YYRECOVERING() (!!yyerrstatus) + n = strlen(arg); -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) + if (!signature) + { + checkSigSize(n); + strncpy(signature, arg, n); + signature[n] = '\0'; + sigLength = n; + } + else if (!sigClosed) + { + checkSigSize(n+2); + prepend_scope(signature, arg); + sigLength = strlen(signature); + } +} +/* set a mark in the signature for later operations */ +void markSig() +{ + sigMark[sigMarkDepth] = 0; + if (signature) + { + sigMark[sigMarkDepth] = sigLength; + } + sigMarkDepth++; +} -#define YYTERROR 1 -#define YYERRCODE 256 +/* get the contents of the sig from the mark, and clear the mark */ +const char *copySig() +{ + const char *cp = NULL; + if (sigMarkDepth > 0) + { + sigMarkDepth--; + } + if (signature) + { + cp = &signature[sigMark[sigMarkDepth]]; + } + return cp; +} +/* swap the signature text using the mark as the radix */ +void swapSig() +{ + if (sigMarkDepth > 0) + { + sigMarkDepth--; + } + if (signature && sigMark[sigMarkDepth] > 0) + { + size_t i, m, n, nn; + char c; + char *cp; + cp = signature; + n = sigLength; + m = sigMark[sigMarkDepth]; + nn = m/2; + for (i = 0; i < nn; i++) + { + c = cp[i]; cp[i] = cp[m-i-1]; cp[m-i-1] = c; + } + nn = (n-m)/2; + for (i = 0; i < nn; i++) + { + c = cp[i+m]; cp[i+m] = cp[n-i-1]; cp[n-i-1] = c; + } + nn = n/2; + for (i = 0; i < nn; i++) + { + c = cp[i]; cp[i] = cp[n-i-1]; cp[n-i-1] = c; + } + } +} -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ +/* chop the last space from the signature */ +void chopSig(void) +{ + if (signature) + { + size_t n = sigLength; + if (n > 0 && signature[n-1] == ' ') + { + signature[n-1] = '\0'; + sigLength--; + } + } +} -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif +/* mark this signature as legacy */ +void legacySig(void) +{ + currentFunction->IsLegacy = 1; +} +/*---------------------------------------------------------------- + * Storage type for vars and functions + */ -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ +/* "private" variables */ +unsigned int storageType = 0; -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif +/* save the storage type */ +void setStorageType(unsigned int val) +{ + storageType = val; +} +/* modify the indirection (pointers, refs) in the storage type */ +void setStorageTypeIndirection(unsigned int ind) +{ + storageType = (storageType & ~VTK_PARSE_INDIRECT); + ind = (ind & VTK_PARSE_INDIRECT); + storageType = (storageType | ind); +} -/* YYLEX -- calling `yylex' with the right arguments. */ +/* retrieve the storage type */ +unsigned int getStorageType() +{ + return storageType; +} -#ifdef YYLEX_PARAM -# define YYLEX yylex (YYLEX_PARAM) -#else -# define YYLEX yylex () -#endif +/*---------------------------------------------------------------- + * Array information + */ -/* Enable debugging if requested. */ -#if YYDEBUG +/* "private" variables */ +int numberOfDimensions = 0; +const char **arrayDimensions = NULL; -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif +/* clear the array counter */ +void clearArray(void) +{ + numberOfDimensions = 0; + arrayDimensions = NULL; +} -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +/* add another dimension */ +void pushArraySize(const char *size) +{ + vtkParse_AddStringToArray(&arrayDimensions, &numberOfDimensions, + vtkstrdup(size)); +} -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* add another dimension to the front */ +void pushArrayFront(const char *size) +{ + int i; + vtkParse_AddStringToArray(&arrayDimensions, &numberOfDimensions, 0); -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + for (i = numberOfDimensions-1; i > 0; i--) + { + arrayDimensions[i] = arrayDimensions[i-1]; + } -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif + arrayDimensions[0] = vtkstrdup(size); +} + +/* get the number of dimensions */ +int getArrayNDims() { - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) + return numberOfDimensions; +} + +/* get the whole array */ +const char **getArray() +{ + if (numberOfDimensions > 0) { - default: - break; + return arrayDimensions; } + return NULL; } +/*---------------------------------------------------------------- + * Variables and Arguments + */ -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +/* "private" variables */ +char *currentVarName = 0; +char *currentVarValue = 0; +char *currentId = 0; -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif +/* clear the var Id */ +void clearVarName(void) { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + currentVarName = NULL; +} - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); +/* set the var Id */ +void setVarName(const char *text) +{ + static char static_text[2048]; + currentVarName = static_text; + strcpy(static_text, text); } -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ +/* return the var id */ +const char *getVarName() +{ + return currentVarName; +} -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif +/* variable value -------------- */ + +/* clear the var value */ +void clearVarValue(void) { - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) + currentVarValue = NULL; +} + +/* set the var value */ +void setVarValue(const char *text) +{ + static char static_text[2048]; + currentVarValue = static_text; + strcpy(static_text, text); +} + +/* return the var value */ +const char *getVarValue() +{ + return currentVarValue; +} + +/* variable type -------------- */ + +/* clear the current Id */ +void clearTypeId(void) +{ + currentId = NULL; +} + +/* set the current Id, it is sticky until cleared */ +void setTypeId(const char *text) +{ + static char static_text[2048]; + if (currentId == NULL) { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); + currentId = static_text; + strcpy(static_text, text); } - YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +/* set the signature and type together */ +void typeSig(const char *text) +{ + size_t n; + postSig(text); + postSig(" "); -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ + if (currentId == 0) + { + setTypeId(text); + } + else if ((currentId[0] == 'u' && strcmp(currentId, "unsigned") == 0) || + (currentId[0] == 's' && strcmp(currentId, "signed") == 0)) + { + n = strlen(currentId); + currentId[n] = ' '; + strcpy(¤tId[n+1], text); + } +} -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +/* return the current Id */ +const char *getTypeId() { - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) + return currentId; +} + +/*---------------------------------------------------------------- + * Specifically for function pointers, the scope (i.e. class) that + * the function is a method of. + */ + +const char *pointerScopeStack[10]; +int pointerScopeDepth = 0; + +/* save the scope for scoped method pointers */ +void scopeSig(const char *scope) +{ + if (scope && scope[0] != '\0') { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - YYFPRINTF (stderr, "\n"); + postSig(scope); + } + else + { + scope = NULL; } + pointerScopeStack[pointerScopeDepth++] = vtkstrdup(scope); } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +/* get the scope back */ +const char *getScope() +{ + return pointerScopeStack[--pointerScopeDepth]; +} -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ +/*---------------------------------------------------------------- + * Function stack + * + * operates on: currentFunction + */ +/* "private" variables */ +FunctionInfo *functionStack[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; +const char *functionVarNameStack[10]; +const char *functionTypeIdStack[10]; +int functionDepth = 0; -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif +void pushFunction() +{ + functionStack[functionDepth] = currentFunction; + currentFunction = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + vtkParse_InitFunction(currentFunction); + if (!functionStack[functionDepth]) + { + startSig(); + } + functionVarNameStack[functionDepth] = vtkstrdup(getVarName()); + functionTypeIdStack[functionDepth] = vtkstrdup(getTypeId()); + clearVarName(); + clearTypeId(); + functionDepth++; + functionStack[functionDepth] = 0; +} -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). +void popFunction() +{ + FunctionInfo *newFunction = currentFunction; - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ + --functionDepth; + currentFunction = functionStack[functionDepth]; + clearVarName(); + if (functionVarNameStack[functionDepth]) + { + setVarName(functionVarNameStack[functionDepth]); + } + clearTypeId(); + if (functionTypeIdStack[functionDepth]) + { + setTypeId(functionTypeIdStack[functionDepth]); + } -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif + functionStack[functionDepth+1] = newFunction; +} - +FunctionInfo *getFunction() +{ + return functionStack[functionDepth+1]; +} -#if YYERROR_VERBOSE +/*---------------------------------------------------------------- + * Utility methods + */ -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif +/* prepend a scope:: to a name */ +void prepend_scope(char *cp, const char *arg) { - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; + size_t i, j, m, n; + int depth; + + m = strlen(cp); + n = strlen(arg); + i = m; + while (i > 0 && + ((cp[i-1] >= 'a' && cp[i-1] <= 'z') || + (cp[i-1] >= 'A' && cp[i-1] <= 'Z') || + (cp[i-1] >= '0' && cp[i-1] <= '9') || + cp[i-1] == '_' || cp[i-1] == ':' || + cp[i-1] == '>')) + { + i--; + if (cp[i] == '>') + { + depth = 1; + while (i > 0) + { + i--; + if (cp[i] == '<') + { + if (--depth == 0) + { + break; + } + } + if (cp[i] == '>') + { + depth++; + } + } + } + } + + for (j = m; j > i; j--) + { + cp[j+n+1] = cp[j-1]; + } + for (j = 0; j < n; j++) + { + cp[j+i] = arg[j]; + } + cp[n+i] = ':'; cp[n+i+1] = ':'; + cp[m+n+2] = '\0'; } -# endif -# endif -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif +/* expand a type by including pointers from another */ +unsigned int add_indirection(unsigned int type1, unsigned int type2) { - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; + unsigned int ptr1 = (type1 & VTK_PARSE_POINTER_MASK); + unsigned int ptr2 = (type2 & VTK_PARSE_POINTER_MASK); + unsigned int reverse = 0; + unsigned int result; - return yyd - 1; -} -# endif -# endif + /* one of type1 or type2 will only have VTK_PARSE_INDIRECT, but + * we don't know which one. */ + result = ((type1 & ~VTK_PARSE_POINTER_MASK) | + (type2 & ~VTK_PARSE_POINTER_MASK)); -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') + while (ptr2) { - YYSIZE_T yyn = 0; - char const *yyp = yystr; + reverse = ((reverse << 2) | (ptr2 & VTK_PARSE_POINTER_LOWMASK)); + ptr2 = ((ptr2 >> 2) & VTK_PARSE_POINTER_MASK); + } - for (;;) - switch (*++yyp) + while (reverse) { - case '\'': - case ',': - goto do_not_strip_quotes; + ptr1 = ((ptr1 << 2) | (reverse & VTK_PARSE_POINTER_LOWMASK)); + reverse = ((reverse >> 2) & VTK_PARSE_POINTER_MASK); - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; + /* make sure we don't exceed the VTK_PARSE_POINTER bitfield */ + if ((ptr1 & VTK_PARSE_POINTER_MASK) != ptr1) + { + ptr1 = VTK_PARSE_BAD_INDIRECT; break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; + } } - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; + return (ptr1 | result); } -# endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* There is only one array, so add any parenthetical indirection to it */ +unsigned int add_indirection_to_array(unsigned int type) { - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); + unsigned int ptrs = (type & VTK_PARSE_POINTER_MASK); + unsigned int result = (type & ~VTK_PARSE_POINTER_MASK); + unsigned int reverse = 0; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + if ((type & VTK_PARSE_INDIRECT) == VTK_PARSE_BAD_INDIRECT) { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; + return (result | VTK_PARSE_BAD_INDIRECT); } - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + while (ptrs) { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; + reverse = ((reverse << 2) | (ptrs & VTK_PARSE_POINTER_LOWMASK)); + ptrs = ((ptrs >> 2) & VTK_PARSE_POINTER_MASK); } - else + + /* I know the reversal makes no difference, but it is still + * nice to add the pointers in the correct order, just in + * case const pointers are thrown into the mix. */ + while (reverse) { - yyp++; - yyf++; - } - } - } - return yysize; + pushArrayFront(""); + reverse = ((reverse >> 2) & VTK_PARSE_POINTER_MASK); } + + return result; } -#endif /* YYERROR_VERBOSE */ - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) + +/* Line 189 of yacc.c */ +#line 1235 "vtkParse.tab.c" + +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 #else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; +# define YYERROR_VERBOSE 0 +#endif + +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + STRUCT = 258, + CLASS = 259, + PUBLIC = 260, + PRIVATE = 261, + PROTECTED = 262, + VIRTUAL = 263, + ID = 264, + STRING_LITERAL = 265, + INT_LITERAL = 266, + HEX_LITERAL = 267, + OCT_LITERAL = 268, + FLOAT_LITERAL = 269, + CHAR_LITERAL = 270, + ZERO = 271, + FLOAT = 272, + DOUBLE = 273, + LONG_DOUBLE = 274, + INT = 275, + UNSIGNED_INT = 276, + SHORT = 277, + UNSIGNED_SHORT = 278, + LONG = 279, + UNSIGNED_LONG = 280, + LONG_LONG = 281, + UNSIGNED_LONG_LONG = 282, + INT64__ = 283, + UNSIGNED_INT64__ = 284, + CHAR = 285, + SIGNED_CHAR = 286, + UNSIGNED_CHAR = 287, + VOID = 288, + BOOL = 289, + SSIZE_T = 290, + SIZE_T = 291, + OSTREAM = 292, + ISTREAM = 293, + ENUM = 294, + UNION = 295, + CLASS_REF = 296, + OTHER = 297, + CONST = 298, + CONST_PTR = 299, + CONST_EQUAL = 300, + OPERATOR = 301, + UNSIGNED = 302, + SIGNED = 303, + FRIEND = 304, + INLINE = 305, + MUTABLE = 306, + TEMPLATE = 307, + TYPENAME = 308, + TYPEDEF = 309, + NAMESPACE = 310, + USING = 311, + VTK_ID = 312, + STATIC = 313, + EXTERN = 314, + VAR_FUNCTION = 315, + VTK_LEGACY = 316, + NEW = 317, + DELETE = 318, + EXPLICIT = 319, + STATIC_CAST = 320, + DYNAMIC_CAST = 321, + CONST_CAST = 322, + REINTERPRET_CAST = 323, + OP_LSHIFT_EQ = 324, + OP_RSHIFT_EQ = 325, + OP_LSHIFT = 326, + OP_RSHIFT = 327, + OP_ARROW_POINTER = 328, + OP_ARROW = 329, + OP_INCR = 330, + OP_DECR = 331, + OP_PLUS_EQ = 332, + OP_MINUS_EQ = 333, + OP_TIMES_EQ = 334, + OP_DIVIDE_EQ = 335, + OP_REMAINDER_EQ = 336, + OP_AND_EQ = 337, + OP_OR_EQ = 338, + OP_XOR_EQ = 339, + OP_LOGIC_AND_EQ = 340, + OP_LOGIC_OR_EQ = 341, + OP_LOGIC_AND = 342, + OP_LOGIC_OR = 343, + OP_LOGIC_EQ = 344, + OP_LOGIC_NEQ = 345, + OP_LOGIC_LEQ = 346, + OP_LOGIC_GEQ = 347, + ELLIPSIS = 348, + DOUBLE_COLON = 349, + LP = 350, + LA = 351, + QT_ID = 352, + StdString = 353, + UnicodeString = 354, + IdType = 355, + FloatType = 356, + TypeInt8 = 357, + TypeUInt8 = 358, + TypeInt16 = 359, + TypeUInt16 = 360, + TypeInt32 = 361, + TypeUInt32 = 362, + TypeInt64 = 363, + TypeUInt64 = 364, + TypeFloat32 = 365, + TypeFloat64 = 366, + SetMacro = 367, + GetMacro = 368, + SetStringMacro = 369, + GetStringMacro = 370, + SetClampMacro = 371, + SetObjectMacro = 372, + GetObjectMacro = 373, + BooleanMacro = 374, + SetVector2Macro = 375, + SetVector3Macro = 376, + SetVector4Macro = 377, + SetVector6Macro = 378, + GetVector2Macro = 379, + GetVector3Macro = 380, + GetVector4Macro = 381, + GetVector6Macro = 382, + SetVectorMacro = 383, + GetVectorMacro = 384, + ViewportCoordinateMacro = 385, + WorldCoordinateMacro = 386, + TypeMacro = 387, + VTK_BYTE_SWAP_DECL = 388 + }; #endif + + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE { - YYUSE (yyvaluep); - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); +/* Line 214 of yacc.c */ +#line 1182 "vtkParse.y" - switch (yytype) - { + const char *str; + unsigned int integer; - default: - break; - } -} -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); + +/* Line 214 of yacc.c */ +#line 1544 "vtkParse.tab.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + +/* Copy the second part of user declarations. */ + + +/* Line 264 of yacc.c */ +#line 1556 "vtkParse.tab.c" + +#ifdef short +# undef short +#endif + +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; #else -int yyparse (); +typedef unsigned char yytype_uint8; #endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; #else -int yyparse (); +typedef short int yytype_int8; #endif -#endif /* ! YYPARSE_PARAM */ +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int yyi) +#else +static int +YYID (yyi) + int yyi; +#endif +{ + return yyi; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +/* Copy COUNT objects from FROM to TO. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(To, From, Count) \ + __builtin_memcpy (To, From, (Count) * sizeof (*(From))) +# else +# define YYCOPY(To, From, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (YYID (0)) + +#endif + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 2 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 7055 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 157 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 196 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 581 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 1021 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 388 + +#define YYTRANSLATE(YYX) \ + ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 155, 2, 2, 2, 149, 150, 2, + 135, 136, 147, 145, 142, 144, 156, 148, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 141, 134, + 139, 143, 140, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 153, 2, 154, 152, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 137, 151, 138, 146, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, + 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 4, 5, 9, 11, 15, 17, 19, + 21, 23, 27, 32, 34, 37, 41, 44, 47, 50, + 54, 57, 59, 62, 67, 72, 77, 79, 85, 86, + 93, 98, 99, 107, 108, 119, 120, 128, 129, 140, + 145, 146, 154, 155, 166, 171, 172, 173, 177, 181, + 183, 187, 189, 191, 195, 200, 203, 206, 208, 211, + 215, 219, 222, 226, 230, 233, 239, 241, 243, 244, + 247, 249, 253, 255, 258, 261, 264, 266, 268, 270, + 271, 278, 279, 285, 286, 288, 292, 294, 298, 300, + 302, 304, 306, 308, 310, 312, 314, 316, 318, 319, + 323, 324, 329, 330, 335, 337, 339, 341, 343, 345, + 347, 349, 351, 353, 355, 357, 359, 361, 364, 368, + 372, 375, 379, 382, 384, 390, 394, 399, 404, 409, + 413, 415, 420, 425, 429, 433, 434, 440, 442, 443, + 448, 451, 454, 455, 459, 461, 463, 464, 465, 469, + 474, 479, 482, 486, 491, 497, 501, 506, 513, 521, + 527, 534, 537, 541, 544, 548, 552, 554, 557, 560, + 563, 567, 569, 572, 575, 579, 583, 585, 588, 592, + 593, 594, 603, 604, 608, 609, 610, 618, 619, 623, + 624, 627, 630, 632, 634, 638, 639, 645, 646, 647, + 657, 658, 662, 663, 669, 670, 674, 675, 679, 684, + 686, 687, 693, 694, 695, 698, 700, 702, 703, 708, + 709, 710, 716, 718, 720, 723, 724, 726, 727, 731, + 736, 741, 745, 748, 749, 752, 753, 754, 759, 760, + 763, 764, 768, 771, 772, 778, 781, 782, 788, 790, + 792, 794, 796, 798, 799, 801, 802, 803, 809, 811, + 813, 816, 818, 821, 822, 824, 826, 827, 829, 830, + 833, 834, 840, 841, 843, 844, 846, 848, 850, 852, + 854, 856, 858, 860, 862, 864, 866, 868, 870, 872, + 874, 876, 878, 880, 882, 884, 886, 888, 890, 893, + 896, 900, 903, 906, 910, 912, 915, 917, 920, 922, + 925, 928, 930, 932, 934, 936, 937, 941, 942, 948, + 949, 955, 956, 962, 964, 965, 970, 972, 974, 976, + 978, 980, 982, 984, 986, 988, 990, 992, 996, 1000, + 1002, 1004, 1006, 1008, 1010, 1012, 1014, 1016, 1019, 1021, + 1023, 1026, 1028, 1030, 1032, 1035, 1038, 1041, 1044, 1046, + 1048, 1050, 1052, 1054, 1056, 1058, 1060, 1062, 1064, 1066, + 1068, 1070, 1072, 1074, 1076, 1078, 1080, 1082, 1084, 1086, + 1088, 1090, 1092, 1094, 1096, 1098, 1100, 1102, 1104, 1106, + 1108, 1110, 1112, 1114, 1116, 1118, 1120, 1122, 1124, 1126, + 1128, 1130, 1132, 1133, 1140, 1141, 1143, 1144, 1145, 1150, + 1152, 1153, 1157, 1158, 1162, 1164, 1165, 1170, 1171, 1172, + 1182, 1184, 1186, 1188, 1190, 1192, 1195, 1197, 1199, 1201, + 1203, 1205, 1207, 1209, 1210, 1218, 1219, 1220, 1221, 1231, + 1232, 1238, 1239, 1245, 1246, 1247, 1258, 1259, 1267, 1268, + 1269, 1270, 1280, 1287, 1288, 1296, 1297, 1305, 1306, 1314, + 1315, 1323, 1324, 1332, 1333, 1341, 1342, 1350, 1351, 1359, + 1360, 1370, 1371, 1381, 1386, 1391, 1399, 1402, 1405, 1409, + 1413, 1415, 1417, 1419, 1421, 1423, 1425, 1427, 1429, 1431, + 1433, 1435, 1437, 1439, 1441, 1443, 1445, 1447, 1449, 1451, + 1453, 1455, 1457, 1459, 1461, 1463, 1465, 1467, 1469, 1471, + 1473, 1475, 1477, 1479, 1481, 1483, 1485, 1487, 1489, 1491, + 1493, 1495, 1496, 1499, 1500, 1503, 1505, 1507, 1509, 1511, + 1513, 1515, 1517, 1519, 1521, 1523, 1525, 1527, 1529, 1531, + 1533, 1535, 1537, 1539, 1541, 1543, 1545, 1547, 1549, 1551, + 1553, 1555, 1557, 1559, 1561, 1563, 1565, 1567, 1569, 1571, + 1573, 1575, 1577, 1579, 1581, 1583, 1585, 1587, 1589, 1591, + 1593, 1595, 1597, 1599, 1601, 1603, 1605, 1607, 1611, 1615, + 1619, 1623 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 158, 0, -1, -1, -1, 158, 159, 160, -1, 252, + -1, 178, 254, 134, -1, 196, -1, 162, -1, 161, + -1, 194, -1, 164, 254, 134, -1, 197, 164, 254, + 134, -1, 41, -1, 214, 226, -1, 197, 214, 226, + -1, 213, 226, -1, 208, 226, -1, 209, 226, -1, + 197, 208, 226, -1, 206, 226, -1, 321, -1, 299, + 134, -1, 9, 135, 346, 136, -1, 57, 135, 346, + 136, -1, 97, 135, 346, 136, -1, 134, -1, 59, + 10, 137, 158, 138, -1, -1, 55, 299, 163, 137, + 158, 138, -1, 55, 137, 346, 138, -1, -1, 4, + 280, 165, 174, 137, 171, 138, -1, -1, 4, 280, + 139, 294, 140, 166, 174, 137, 171, 138, -1, -1, + 3, 280, 167, 174, 137, 171, 138, -1, -1, 3, + 280, 139, 294, 140, 168, 174, 137, 171, 138, -1, + 3, 137, 346, 138, -1, -1, 40, 280, 169, 174, + 137, 171, 138, -1, -1, 40, 280, 139, 294, 140, + 170, 174, 137, 171, 138, -1, 40, 137, 346, 138, + -1, -1, -1, 171, 172, 173, -1, 171, 177, 141, + -1, 252, -1, 178, 254, 134, -1, 196, -1, 194, + -1, 164, 254, 134, -1, 197, 164, 254, 134, -1, + 49, 192, -1, 49, 191, -1, 41, -1, 214, 226, + -1, 49, 214, 226, -1, 197, 214, 226, -1, 211, + 226, -1, 49, 211, 226, -1, 197, 211, 226, -1, + 207, 226, -1, 133, 135, 346, 136, 134, -1, 321, + -1, 134, -1, -1, 141, 175, -1, 176, -1, 176, + 142, 175, -1, 297, -1, 6, 297, -1, 7, 297, + -1, 5, 297, -1, 5, -1, 6, -1, 7, -1, + -1, 39, 280, 179, 137, 181, 138, -1, -1, 39, + 180, 137, 181, 138, -1, -1, 182, -1, 182, 142, + 181, -1, 280, -1, 280, 143, 185, -1, 184, -1, + 280, -1, 298, -1, 290, -1, 16, -1, 11, -1, + 13, -1, 12, -1, 15, -1, 183, -1, -1, 189, + 186, 185, -1, -1, 183, 190, 187, 185, -1, -1, + 135, 188, 185, 136, -1, 144, -1, 145, -1, 146, + -1, 144, -1, 145, -1, 147, -1, 148, -1, 149, + -1, 150, -1, 151, -1, 152, -1, 71, -1, 72, + -1, 197, 192, -1, 4, 280, 193, -1, 3, 280, + 193, -1, 3, 193, -1, 40, 280, 193, -1, 40, + 193, -1, 134, -1, 137, 346, 138, 347, 134, -1, + 141, 347, 134, -1, 195, 285, 262, 134, -1, 195, + 164, 248, 134, -1, 195, 178, 248, 134, -1, 195, + 60, 134, -1, 54, -1, 56, 55, 297, 134, -1, + 56, 53, 297, 134, -1, 56, 297, 134, -1, 52, + 139, 140, -1, -1, 52, 139, 198, 199, 140, -1, + 201, -1, -1, 201, 142, 200, 199, -1, 304, 204, + -1, 203, 204, -1, -1, 202, 197, 204, -1, 4, + -1, 53, -1, -1, -1, 280, 205, 249, -1, 61, + 135, 208, 136, -1, 61, 135, 211, 136, -1, 283, + 223, -1, 283, 210, 223, -1, 299, 94, 146, 238, + -1, 50, 299, 94, 146, 238, -1, 299, 94, 231, + -1, 50, 299, 94, 231, -1, 299, 94, 299, 94, + 146, 238, -1, 50, 299, 94, 299, 94, 146, 238, + -1, 299, 94, 299, 94, 231, -1, 50, 299, 94, + 299, 94, 231, -1, 299, 94, -1, 210, 299, 94, + -1, 146, 238, -1, 50, 146, 238, -1, 8, 146, + 238, -1, 231, -1, 50, 231, -1, 212, 231, -1, + 283, 223, -1, 8, 283, 223, -1, 64, -1, 50, + 64, -1, 64, 50, -1, 299, 94, 215, -1, 283, + 210, 218, -1, 215, -1, 283, 218, -1, 8, 285, + 218, -1, -1, -1, 46, 283, 135, 216, 241, 136, + 217, 225, -1, -1, 220, 219, 225, -1, -1, -1, + 46, 344, 221, 135, 222, 241, 136, -1, -1, 227, + 224, 225, -1, -1, 143, 16, -1, 45, 16, -1, + 43, -1, 134, -1, 137, 346, 138, -1, -1, 280, + 135, 228, 241, 136, -1, -1, -1, 280, 139, 229, + 294, 140, 135, 230, 241, 136, -1, -1, 233, 232, + 235, -1, -1, 280, 135, 234, 241, 136, -1, -1, + 141, 237, 236, -1, -1, 142, 237, 236, -1, 297, + 135, 346, 136, -1, 239, -1, -1, 280, 135, 240, + 241, 136, -1, -1, -1, 242, 243, -1, 93, -1, + 245, -1, -1, 245, 142, 244, 243, -1, -1, -1, + 246, 285, 260, 247, 249, -1, 60, -1, 280, -1, + 300, 280, -1, -1, 250, -1, -1, 143, 251, 307, + -1, 283, 253, 255, 134, -1, 58, 60, 255, 134, + -1, 60, 255, 134, -1, 262, 249, -1, -1, 257, + 255, -1, -1, -1, 255, 142, 256, 257, -1, -1, + 258, 253, -1, -1, 300, 259, 253, -1, 271, 273, + -1, -1, 264, 269, 136, 261, 267, -1, 272, 273, + -1, -1, 265, 270, 136, 263, 267, -1, 135, -1, + 95, -1, 96, -1, 95, -1, 96, -1, -1, 43, + -1, -1, -1, 135, 268, 241, 136, 266, -1, 274, + -1, 260, -1, 300, 260, -1, 262, -1, 300, 262, + -1, -1, 272, -1, 280, -1, -1, 274, -1, -1, + 275, 276, -1, -1, 278, 153, 277, 279, 154, -1, + -1, 276, -1, -1, 185, -1, 57, -1, 97, -1, + 9, -1, 38, -1, 37, -1, 98, -1, 99, -1, + 281, -1, 282, -1, 102, -1, 103, -1, 104, -1, + 105, -1, 106, -1, 107, -1, 108, -1, 109, -1, + 110, -1, 111, -1, 100, -1, 101, -1, 285, -1, + 51, 285, -1, 59, 285, -1, 59, 10, 285, -1, + 50, 285, -1, 284, 285, -1, 50, 284, 285, -1, + 58, -1, 58, 50, -1, 286, -1, 286, 300, -1, + 288, -1, 287, 288, -1, 288, 287, -1, 43, -1, + 303, -1, 290, -1, 298, -1, -1, 53, 289, 297, + -1, -1, 57, 139, 291, 294, 140, -1, -1, 9, + 139, 292, 294, 140, -1, -1, 97, 139, 293, 294, + 140, -1, 296, -1, -1, 296, 142, 295, 294, -1, + 285, -1, 184, -1, 57, -1, 9, -1, 97, -1, + 38, -1, 37, -1, 98, -1, 99, -1, 290, -1, + 298, -1, 299, 94, 297, -1, 290, 94, 297, -1, + 9, -1, 97, -1, 57, -1, 38, -1, 37, -1, + 98, -1, 99, -1, 150, -1, 301, 150, -1, 301, + -1, 302, -1, 301, 302, -1, 147, -1, 44, -1, + 304, -1, 4, 305, -1, 3, 305, -1, 40, 305, + -1, 39, 305, -1, 306, -1, 305, -1, 98, -1, + 99, -1, 37, -1, 38, -1, 9, -1, 57, -1, + 97, -1, 33, -1, 34, -1, 35, -1, 36, -1, + 102, -1, 103, -1, 104, -1, 105, -1, 106, -1, + 107, -1, 108, -1, 109, -1, 110, -1, 111, -1, + 100, -1, 101, -1, 17, -1, 18, -1, 19, -1, + 30, -1, 31, -1, 32, -1, 20, -1, 21, -1, + 22, -1, 23, -1, 24, -1, 25, -1, 26, -1, + 27, -1, 28, -1, 29, -1, 48, -1, 47, -1, + 312, -1, -1, 137, 308, 307, 310, 309, 138, -1, + -1, 142, -1, -1, -1, 310, 142, 311, 307, -1, + 320, -1, -1, 145, 313, 320, -1, -1, 144, 314, + 320, -1, 319, -1, -1, 135, 315, 312, 136, -1, + -1, -1, 318, 139, 316, 286, 140, 135, 317, 312, + 136, -1, 65, -1, 67, -1, 66, -1, 68, -1, + 10, -1, 319, 10, -1, 16, -1, 11, -1, 13, + -1, 12, -1, 14, -1, 15, -1, 297, -1, -1, + 112, 135, 280, 142, 322, 285, 136, -1, -1, -1, + -1, 113, 135, 323, 280, 142, 324, 285, 325, 136, + -1, -1, 114, 135, 326, 280, 136, -1, -1, 115, + 135, 327, 280, 136, -1, -1, -1, 116, 135, 280, + 142, 328, 303, 329, 142, 347, 136, -1, -1, 117, + 135, 280, 142, 330, 303, 136, -1, -1, -1, -1, + 118, 135, 331, 280, 142, 332, 303, 333, 136, -1, + 119, 135, 280, 142, 303, 136, -1, -1, 120, 135, + 280, 142, 334, 303, 136, -1, -1, 124, 135, 280, + 142, 335, 303, 136, -1, -1, 121, 135, 280, 142, + 336, 303, 136, -1, -1, 125, 135, 280, 142, 337, + 303, 136, -1, -1, 122, 135, 280, 142, 338, 303, + 136, -1, -1, 126, 135, 280, 142, 339, 303, 136, + -1, -1, 123, 135, 280, 142, 340, 303, 136, -1, + -1, 127, 135, 280, 142, 341, 303, 136, -1, -1, + 128, 135, 280, 142, 342, 303, 142, 11, 136, -1, + -1, 129, 135, 280, 142, 343, 303, 142, 11, 136, + -1, 130, 135, 280, 136, -1, 131, 135, 280, 136, + -1, 132, 135, 280, 142, 280, 309, 136, -1, 135, + 136, -1, 153, 154, -1, 62, 153, 154, -1, 63, + 153, 154, -1, 345, -1, 143, -1, 147, -1, 148, + -1, 144, -1, 145, -1, 155, -1, 146, -1, 142, + -1, 139, -1, 140, -1, 150, -1, 151, -1, 152, + -1, 149, -1, 62, -1, 63, -1, 69, -1, 70, + -1, 71, -1, 72, -1, 73, -1, 74, -1, 77, + -1, 78, -1, 79, -1, 80, -1, 81, -1, 75, + -1, 76, -1, 82, -1, 83, -1, 84, -1, 85, + -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, + -1, 91, -1, 92, -1, -1, 346, 348, -1, -1, + 347, 349, -1, 134, -1, 349, -1, 42, -1, 350, + -1, 352, -1, 351, -1, 54, -1, 345, -1, 141, + -1, 156, -1, 94, -1, 4, -1, 52, -1, 38, + -1, 37, -1, 98, -1, 99, -1, 306, -1, 13, + -1, 11, -1, 12, -1, 14, -1, 15, -1, 10, + -1, 41, -1, 43, -1, 44, -1, 45, -1, 3, + -1, 46, -1, 58, -1, 50, -1, 8, -1, 39, + -1, 40, -1, 53, -1, 16, -1, 60, -1, 93, + -1, 5, -1, 7, -1, 6, -1, 55, -1, 56, + -1, 59, -1, 9, -1, 57, -1, 97, -1, 67, + -1, 66, -1, 65, -1, 68, -1, 137, 346, 138, + -1, 153, 346, 154, -1, 135, 346, 136, -1, 95, + 346, 136, -1, 96, 346, 136, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 1332, 1332, 1333, 1332, 1337, 1338, 1339, 1340, 1341, + 1342, 1343, 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1351, + 1352, 1353, 1354, 1355, 1356, 1357, 1358, 1364, 1370, 1370, + 1372, 1378, 1378, 1380, 1380, 1382, 1382, 1384, 1384, 1386, + 1387, 1387, 1389, 1389, 1391, 1393, 1395, 1394, 1397, 1400, + 1401, 1402, 1403, 1404, 1405, 1406, 1407, 1408, 1409, 1410, + 1412, 1413, 1414, 1416, 1417, 1418, 1419, 1420, 1422, 1422, + 1424, 1424, 1426, 1427, 1428, 1429, 1436, 1437, 1438, 1448, + 1448, 1450, 1450, 1453, 1453, 1453, 1455, 1456, 1458, 1459, + 1460, 1460, 1462, 1462, 1462, 1462, 1462, 1464, 1465, 1465, + 1469, 1469, 1473, 1473, 1478, 1478, 1479, 1481, 1481, 1482, + 1482, 1483, 1483, 1484, 1484, 1485, 1486, 1492, 1494, 1495, + 1496, 1497, 1498, 1500, 1501, 1502, 1508, 1531, 1532, 1533, + 1535, 1542, 1543, 1544, 1551, 1552, 1552, 1558, 1559, 1559, + 1562, 1572, 1580, 1580, 1592, 1593, 1595, 1595, 1595, 1602, + 1604, 1610, 1612, 1613, 1614, 1615, 1616, 1617, 1618, 1619, + 1620, 1622, 1623, 1625, 1626, 1627, 1632, 1633, 1634, 1641, + 1642, 1650, 1650, 1650, 1652, 1653, 1656, 1657, 1658, 1668, + 1672, 1667, 1684, 1684, 1693, 1694, 1693, 1701, 1701, 1710, + 1711, 1720, 1730, 1736, 1736, 1739, 1738, 1743, 1744, 1743, + 1751, 1751, 1758, 1758, 1760, 1760, 1762, 1762, 1764, 1766, + 1775, 1775, 1781, 1781, 1781, 1784, 1785, 1786, 1786, 1789, + 1791, 1789, 1820, 1844, 1844, 1846, 1846, 1848, 1848, 1855, + 1856, 1857, 1859, 1910, 1911, 1913, 1914, 1914, 1917, 1917, + 1918, 1918, 1922, 1923, 1923, 1937, 1938, 1938, 1951, 1952, + 1954, 1957, 1959, 1962, 1962, 1964, 1965, 1965, 1967, 1970, + 1971, 1975, 1976, 1979, 1979, 1981, 1983, 1983, 1985, 1985, + 1987, 1987, 1989, 1989, 1991, 1992, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005, 2006, 2009, 2010, 2011, 2012, 2013, + 2014, 2015, 2016, 2017, 2018, 2021, 2022, 2029, 2030, 2031, + 2032, 2034, 2035, 2037, 2041, 2042, 2044, 2045, 2047, 2048, + 2049, 2051, 2053, 2054, 2056, 2058, 2058, 2062, 2062, 2065, + 2065, 2068, 2068, 2072, 2073, 2073, 2076, 2076, 2078, 2079, + 2080, 2081, 2082, 2083, 2084, 2085, 2086, 2088, 2093, 2099, + 2099, 2099, 2099, 2099, 2100, 2100, 2116, 2117, 2118, 2123, + 2124, 2136, 2137, 2140, 2141, 2142, 2143, 2144, 2147, 2148, + 2151, 2152, 2153, 2154, 2155, 2156, 2157, 2160, 2161, 2162, + 2163, 2164, 2165, 2166, 2167, 2168, 2169, 2170, 2171, 2172, + 2173, 2174, 2175, 2176, 2177, 2178, 2179, 2180, 2181, 2183, + 2184, 2186, 2187, 2189, 2190, 2192, 2193, 2195, 2196, 2198, + 2199, 2205, 2206, 2206, 2212, 2212, 2214, 2215, 2215, 2220, + 2221, 2221, 2222, 2222, 2226, 2227, 2227, 2228, 2230, 2228, + 2250, 2251, 2252, 2253, 2255, 2256, 2259, 2260, 2261, 2262, + 2263, 2264, 2265, 2275, 2275, 2285, 2286, 2286, 2285, 2295, + 2295, 2305, 2305, 2314, 2314, 2314, 2347, 2346, 2357, 2358, + 2358, 2357, 2367, 2385, 2385, 2390, 2390, 2395, 2395, 2400, + 2400, 2405, 2405, 2410, 2410, 2415, 2415, 2420, 2420, 2425, + 2425, 2442, 2442, 2456, 2493, 2531, 2588, 2589, 2590, 2591, + 2592, 2594, 2595, 2595, 2596, 2596, 2597, 2597, 2598, 2598, + 2599, 2599, 2600, 2600, 2601, 2602, 2603, 2604, 2605, 2606, + 2607, 2608, 2609, 2610, 2611, 2612, 2613, 2614, 2615, 2616, + 2617, 2618, 2619, 2620, 2621, 2622, 2623, 2624, 2625, 2626, + 2627, 2633, 2633, 2634, 2634, 2636, 2636, 2638, 2638, 2638, + 2638, 2638, 2639, 2639, 2639, 2639, 2639, 2639, 2640, 2640, + 2640, 2640, 2640, 2641, 2641, 2641, 2641, 2641, 2642, 2642, + 2642, 2642, 2642, 2642, 2643, 2643, 2643, 2643, 2643, 2643, + 2643, 2644, 2644, 2644, 2644, 2644, 2644, 2645, 2645, 2645, + 2645, 2645, 2645, 2646, 2646, 2646, 2646, 2648, 2649, 2650, + 2650, 2650 +}; +#endif + +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "STRUCT", "CLASS", "PUBLIC", "PRIVATE", + "PROTECTED", "VIRTUAL", "ID", "STRING_LITERAL", "INT_LITERAL", + "HEX_LITERAL", "OCT_LITERAL", "FLOAT_LITERAL", "CHAR_LITERAL", "ZERO", + "FLOAT", "DOUBLE", "LONG_DOUBLE", "INT", "UNSIGNED_INT", "SHORT", + "UNSIGNED_SHORT", "LONG", "UNSIGNED_LONG", "LONG_LONG", + "UNSIGNED_LONG_LONG", "INT64__", "UNSIGNED_INT64__", "CHAR", + "SIGNED_CHAR", "UNSIGNED_CHAR", "VOID", "BOOL", "SSIZE_T", "SIZE_T", + "OSTREAM", "ISTREAM", "ENUM", "UNION", "CLASS_REF", "OTHER", "CONST", + "CONST_PTR", "CONST_EQUAL", "OPERATOR", "UNSIGNED", "SIGNED", "FRIEND", + "INLINE", "MUTABLE", "TEMPLATE", "TYPENAME", "TYPEDEF", "NAMESPACE", + "USING", "VTK_ID", "STATIC", "EXTERN", "VAR_FUNCTION", "VTK_LEGACY", + "NEW", "DELETE", "EXPLICIT", "STATIC_CAST", "DYNAMIC_CAST", "CONST_CAST", + "REINTERPRET_CAST", "OP_LSHIFT_EQ", "OP_RSHIFT_EQ", "OP_LSHIFT", + "OP_RSHIFT", "OP_ARROW_POINTER", "OP_ARROW", "OP_INCR", "OP_DECR", + "OP_PLUS_EQ", "OP_MINUS_EQ", "OP_TIMES_EQ", "OP_DIVIDE_EQ", + "OP_REMAINDER_EQ", "OP_AND_EQ", "OP_OR_EQ", "OP_XOR_EQ", + "OP_LOGIC_AND_EQ", "OP_LOGIC_OR_EQ", "OP_LOGIC_AND", "OP_LOGIC_OR", + "OP_LOGIC_EQ", "OP_LOGIC_NEQ", "OP_LOGIC_LEQ", "OP_LOGIC_GEQ", + "ELLIPSIS", "DOUBLE_COLON", "LP", "LA", "QT_ID", "StdString", + "UnicodeString", "IdType", "FloatType", "TypeInt8", "TypeUInt8", + "TypeInt16", "TypeUInt16", "TypeInt32", "TypeUInt32", "TypeInt64", + "TypeUInt64", "TypeFloat32", "TypeFloat64", "SetMacro", "GetMacro", + "SetStringMacro", "GetStringMacro", "SetClampMacro", "SetObjectMacro", + "GetObjectMacro", "BooleanMacro", "SetVector2Macro", "SetVector3Macro", + "SetVector4Macro", "SetVector6Macro", "GetVector2Macro", + "GetVector3Macro", "GetVector4Macro", "GetVector6Macro", + "SetVectorMacro", "GetVectorMacro", "ViewportCoordinateMacro", + "WorldCoordinateMacro", "TypeMacro", "VTK_BYTE_SWAP_DECL", "';'", "'('", + "')'", "'{'", "'}'", "'<'", "'>'", "':'", "','", "'='", "'-'", "'+'", + "'~'", "'*'", "'/'", "'%'", "'&'", "'|'", "'^'", "'['", "']'", "'!'", + "'.'", "$accept", "strt", "$@1", "file_item", "extern", "namespace", + "$@2", "class_def", "$@3", "$@4", "$@5", "$@6", "$@7", "$@8", + "class_def_body", "$@9", "class_def_item", "optional_scope", + "scope_list", "scope_list_item", "scope_type", "enum_def", "$@10", + "$@11", "enum_list", "enum_item", "integer_value", "integer_literal", + "integer_expression", "$@12", "$@13", "$@14", "math_unary_op", + "math_binary_op", "template_internal_class", "internal_class", + "internal_class_body", "type_def", "typedef_start", "using", "template", + "$@15", "template_args", "$@16", "template_arg", "$@17", + "class_or_typename", "maybe_template_id", "$@18", "legacy_function", + "legacy_method", "function", "scoped_method", "scope", "method", + "explicit_mod", "scoped_operator", "operator", "typecast_op_func", + "$@19", "$@20", "op_func", "$@21", "op_sig", "$@22", "$@23", "func", + "$@24", "func_trailer", "func_body", "func_sig", "$@25", "$@26", "@27", + "constructor", "$@28", "constructor_sig", "$@29", "maybe_initializers", + "more_initializers", "initializer", "destructor", "destructor_sig", + "$@30", "args_list", "$@31", "more_args", "$@32", "arg", "$@33", "$@34", + "maybe_indirect_id", "maybe_var_assign", "var_assign", "$@35", "var", + "var_id_maybe_assign", "maybe_vars", "maybe_other_vars", "$@36", + "other_var", "$@37", "$@38", "maybe_complex_var_id", "$@39", + "complex_var_id", "$@40", "p_or_lp_or_la", "lp_or_la", + "maybe_func_const", "maybe_array_or_args", "$@41", + "maybe_indirect_maybe_var_id", "maybe_indirect_var_id", "maybe_var_id", + "var_id", "maybe_var_array", "var_array", "$@42", "array", "$@43", + "more_array", "array_size", "any_id", "sized_type_id", "special_type_id", + "storage_type", "static_mod", "type", "type_red", "const_mod", + "type_red1", "$@44", "templated_id", "$@45", "$@46", "$@47", + "template_params", "$@48", "template_param", "maybe_scoped_id", + "scoped_id", "class_id", "type_indirection", "pointers", + "pointer_or_const_pointer", "type_red2", "type_simple", "type_id", + "type_primitive", "value", "$@49", "maybe_comma", "more_values", "$@50", + "literal", "$@51", "$@52", "$@53", "$@54", "$@55", "any_cast", + "string_literal", "literal2", "macro", "$@56", "$@57", "$@58", "$@59", + "$@60", "$@61", "$@62", "$@63", "$@64", "$@65", "$@66", "$@67", "$@68", + "$@69", "$@70", "$@71", "$@72", "$@73", "$@74", "$@75", "$@76", "$@77", + "op_token", "op_token_no_delim", "maybe_other", "maybe_other_no_semi", + "other_stuff", "other_stuff_no_semi", "braces", "brackets", "parens", 0 +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to + token YYLEX-NUM. */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, + 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, + 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, + 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, + 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, + 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, + 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, + 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, + 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, + 375, 376, 377, 378, 379, 380, 381, 382, 383, 384, + 385, 386, 387, 388, 59, 40, 41, 123, 125, 60, + 62, 58, 44, 61, 45, 43, 126, 42, 47, 37, + 38, 124, 94, 91, 93, 33, 46 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint16 yyr1[] = +{ + 0, 157, 158, 159, 158, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 161, 163, 162, + 162, 165, 164, 166, 164, 167, 164, 168, 164, 164, + 169, 164, 170, 164, 164, 171, 172, 171, 171, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 174, 174, + 175, 175, 176, 176, 176, 176, 177, 177, 177, 179, + 178, 180, 178, 181, 181, 181, 182, 182, 183, 183, + 183, 183, 184, 184, 184, 184, 184, 185, 186, 185, + 187, 185, 188, 185, 189, 189, 189, 190, 190, 190, + 190, 190, 190, 190, 190, 190, 190, 191, 192, 192, + 192, 192, 192, 193, 193, 193, 194, 194, 194, 194, + 195, 196, 196, 196, 197, 198, 197, 199, 200, 199, + 201, 201, 202, 201, 203, 203, 204, 205, 204, 206, + 207, 208, 209, 209, 209, 209, 209, 209, 209, 209, + 209, 210, 210, 211, 211, 211, 211, 211, 211, 211, + 211, 212, 212, 212, 213, 213, 214, 214, 214, 216, + 217, 215, 219, 218, 221, 222, 220, 224, 223, 225, + 225, 225, 225, 226, 226, 228, 227, 229, 230, 227, + 232, 231, 234, 233, 235, 235, 236, 236, 237, 238, + 240, 239, 241, 242, 241, 243, 243, 244, 243, 246, + 247, 245, 245, 248, 248, 249, 249, 251, 250, 252, + 252, 252, 253, 254, 254, 255, 256, 255, 258, 257, + 259, 257, 260, 261, 260, 262, 263, 262, 264, 264, + 264, 265, 265, 266, 266, 267, 268, 267, 267, 269, + 269, 270, 270, 271, 271, 272, 273, 273, 275, 274, + 277, 276, 278, 278, 279, 279, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 281, 281, 281, 281, 281, + 281, 281, 281, 281, 281, 282, 282, 283, 283, 283, + 283, 283, 283, 283, 284, 284, 285, 285, 286, 286, + 286, 287, 288, 288, 288, 289, 288, 291, 290, 292, + 290, 293, 290, 294, 295, 294, 296, 296, 297, 297, + 297, 297, 297, 297, 297, 297, 297, 298, 298, 299, + 299, 299, 299, 299, 299, 299, 300, 300, 300, 301, + 301, 302, 302, 303, 303, 303, 303, 303, 304, 304, + 305, 305, 305, 305, 305, 305, 305, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 306, 306, 306, 306, 306, 306, 306, 306, 306, + 306, 307, 308, 307, 309, 309, 310, 311, 310, 312, + 313, 312, 314, 312, 312, 315, 312, 316, 317, 312, + 318, 318, 318, 318, 319, 319, 320, 320, 320, 320, + 320, 320, 320, 322, 321, 323, 324, 325, 321, 326, + 321, 327, 321, 328, 329, 321, 330, 321, 331, 332, + 333, 321, 321, 334, 321, 335, 321, 336, 321, 337, + 321, 338, 321, 339, 321, 340, 321, 341, 321, 342, + 321, 343, 321, 321, 321, 321, 344, 344, 344, 344, + 344, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 345, 345, 345, 345, 345, 345, 345, 345, 345, + 345, 346, 346, 347, 347, 348, 348, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 349, 349, 349, + 349, 349, 349, 349, 349, 349, 349, 350, 351, 352, + 352, 352 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 0, 0, 3, 1, 3, 1, 1, 1, + 1, 3, 4, 1, 2, 3, 2, 2, 2, 3, + 2, 1, 2, 4, 4, 4, 1, 5, 0, 6, + 4, 0, 7, 0, 10, 0, 7, 0, 10, 4, + 0, 7, 0, 10, 4, 0, 0, 3, 3, 1, + 3, 1, 1, 3, 4, 2, 2, 1, 2, 3, + 3, 2, 3, 3, 2, 5, 1, 1, 0, 2, + 1, 3, 1, 2, 2, 2, 1, 1, 1, 0, + 6, 0, 5, 0, 1, 3, 1, 3, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, + 0, 4, 0, 4, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, + 2, 3, 2, 1, 5, 3, 4, 4, 4, 3, + 1, 4, 4, 3, 3, 0, 5, 1, 0, 4, + 2, 2, 0, 3, 1, 1, 0, 0, 3, 4, + 4, 2, 3, 4, 5, 3, 4, 6, 7, 5, + 6, 2, 3, 2, 3, 3, 1, 2, 2, 2, + 3, 1, 2, 2, 3, 3, 1, 2, 3, 0, + 0, 8, 0, 3, 0, 0, 7, 0, 3, 0, + 2, 2, 1, 1, 3, 0, 5, 0, 0, 9, + 0, 3, 0, 5, 0, 3, 0, 3, 4, 1, + 0, 5, 0, 0, 2, 1, 1, 0, 4, 0, + 0, 5, 1, 1, 2, 0, 1, 0, 3, 4, + 4, 3, 2, 0, 2, 0, 0, 4, 0, 2, + 0, 3, 2, 0, 5, 2, 0, 5, 1, 1, + 1, 1, 1, 0, 1, 0, 0, 5, 1, 1, + 2, 1, 2, 0, 1, 1, 0, 1, 0, 2, + 0, 5, 0, 1, 0, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, + 3, 2, 2, 3, 1, 2, 1, 2, 1, 2, + 2, 1, 1, 1, 1, 0, 3, 0, 5, 0, + 5, 0, 5, 1, 0, 4, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, + 2, 1, 1, 1, 2, 2, 2, 2, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 6, 0, 1, 0, 0, 4, 1, + 0, 3, 0, 3, 1, 0, 4, 0, 0, 9, + 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, + 1, 1, 1, 0, 7, 0, 0, 0, 9, 0, + 5, 0, 5, 0, 0, 10, 0, 7, 0, 0, + 0, 9, 6, 0, 7, 0, 7, 0, 7, 0, + 7, 0, 7, 0, 7, 0, 7, 0, 7, 0, + 9, 0, 9, 4, 4, 7, 2, 2, 3, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 0, 2, 0, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, + 3, 3 +}; + +/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state + STATE-NUM when YYTABLE doesn't specify something else to do. Zero + means the default is an error. */ +static const yytype_uint16 yydefact[] = +{ + 2, 3, 1, 0, 0, 0, 0, 364, 383, 384, + 385, 389, 390, 391, 392, 393, 394, 395, 396, 397, + 398, 386, 387, 388, 367, 368, 369, 370, 362, 363, + 81, 0, 13, 311, 0, 400, 399, 0, 0, 0, + 315, 130, 0, 0, 365, 304, 0, 235, 0, 366, + 360, 361, 381, 382, 371, 372, 373, 374, 375, 376, + 377, 378, 379, 380, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 26, 4, 9, 8, 238, + 238, 10, 0, 7, 0, 0, 0, 0, 0, 0, + 176, 5, 0, 0, 297, 306, 0, 308, 313, 314, + 0, 312, 353, 359, 358, 21, 364, 362, 363, 365, + 366, 360, 361, 295, 296, 285, 286, 287, 288, 289, + 290, 291, 292, 293, 294, 521, 35, 283, 284, 355, + 31, 354, 0, 0, 364, 0, 0, 365, 366, 0, + 0, 521, 319, 0, 79, 357, 521, 40, 356, 0, + 304, 0, 0, 0, 301, 0, 298, 135, 0, 339, + 343, 342, 341, 340, 344, 345, 521, 28, 329, 332, + 331, 0, 0, 328, 330, 333, 334, 335, 0, 336, + 521, 317, 305, 235, 0, 299, 0, 0, 521, 321, + 0, 435, 439, 441, 0, 0, 448, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 352, 351, 346, 0, 235, 0, 240, 348, 349, + 0, 0, 0, 0, 0, 238, 0, 0, 0, 193, + 521, 20, 17, 18, 16, 14, 278, 280, 279, 0, + 276, 251, 252, 277, 281, 282, 0, 177, 182, 151, + 187, 235, 225, 0, 266, 265, 0, 302, 307, 309, + 310, 0, 0, 22, 0, 0, 68, 0, 68, 364, + 362, 363, 365, 366, 360, 361, 178, 0, 0, 0, + 83, 0, 0, 0, 68, 0, 179, 303, 0, 134, + 142, 316, 0, 0, 0, 0, 133, 0, 0, 0, + 2, 300, 231, 236, 0, 0, 0, 0, 278, 280, + 279, 276, 277, 281, 282, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 11, 234, 239, 265, + 0, 347, 350, 6, 129, 0, 223, 0, 0, 0, + 0, 19, 15, 0, 0, 495, 496, 497, 498, 499, + 500, 501, 502, 508, 509, 503, 504, 505, 506, 507, + 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, + 520, 0, 489, 490, 488, 481, 484, 485, 487, 482, + 483, 494, 491, 492, 493, 0, 486, 184, 480, 175, + 152, 0, 189, 189, 0, 227, 232, 226, 261, 0, + 0, 245, 267, 272, 195, 197, 161, 338, 329, 332, + 331, 328, 330, 333, 334, 0, 174, 155, 200, 0, + 337, 0, 553, 536, 564, 566, 565, 557, 570, 548, + 544, 545, 543, 546, 547, 561, 539, 538, 558, 559, + 549, 527, 550, 551, 552, 554, 556, 537, 560, 531, + 567, 568, 571, 555, 569, 562, 495, 496, 575, 574, + 573, 576, 563, 535, 521, 521, 572, 540, 541, 525, + 521, 521, 39, 533, 521, 534, 542, 532, 522, 526, + 528, 530, 529, 93, 95, 94, 96, 92, 327, 326, + 0, 323, 0, 0, 0, 0, 23, 0, 0, 84, + 86, 83, 44, 0, 0, 213, 0, 156, 0, 144, + 145, 0, 137, 0, 146, 146, 30, 2, 132, 131, + 24, 0, 230, 3, 238, 149, 25, 0, 433, 0, + 0, 0, 443, 446, 0, 0, 453, 457, 461, 465, + 455, 459, 463, 467, 469, 471, 473, 474, 0, 241, + 127, 224, 128, 126, 12, 194, 0, 0, 476, 477, + 0, 162, 192, 0, 0, 183, 188, 229, 0, 246, + 262, 269, 0, 213, 0, 153, 209, 0, 204, 202, + 0, 0, 0, 0, 0, 0, 37, 324, 0, 0, + 0, 69, 70, 72, 45, 33, 45, 320, 82, 83, + 0, 0, 42, 45, 0, 219, 154, 0, 136, 138, + 146, 141, 147, 140, 3, 318, 27, 237, 322, 0, + 436, 440, 442, 0, 0, 449, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 404, 478, 479, + 185, 191, 190, 424, 427, 429, 428, 430, 431, 426, + 420, 422, 421, 423, 415, 402, 412, 410, 432, 228, + 401, 0, 414, 409, 255, 270, 0, 0, 210, 0, + 201, 213, 0, 159, 580, 581, 579, 577, 578, 68, + 0, 75, 73, 74, 0, 46, 68, 46, 85, 278, + 276, 277, 102, 104, 105, 106, 97, 88, 87, 98, + 89, 91, 90, 80, 68, 46, 180, 222, 215, 214, + 216, 0, 0, 160, 142, 143, 225, 29, 0, 0, + 444, 0, 0, 452, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 405, 0, 213, 0, 0, 0, + 0, 417, 425, 256, 247, 258, 274, 196, 0, 213, + 206, 0, 0, 157, 0, 325, 71, 76, 77, 78, + 36, 0, 0, 0, 32, 0, 115, 116, 107, 108, + 109, 110, 111, 112, 113, 114, 100, 0, 0, 41, + 189, 217, 263, 158, 139, 148, 434, 437, 0, 447, + 450, 454, 458, 462, 466, 456, 460, 464, 468, 0, + 0, 475, 0, 0, 406, 413, 411, 0, 213, 275, + 0, 198, 0, 0, 205, 521, 203, 45, 0, 364, + 362, 363, 57, 0, 0, 365, 0, 171, 366, 360, + 361, 381, 382, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 0, 67, 0, 238, 47, 238, 52, + 51, 0, 0, 0, 0, 0, 166, 49, 0, 66, + 48, 45, 0, 0, 99, 45, 181, 219, 249, 250, + 248, 220, 263, 266, 264, 0, 523, 0, 0, 0, + 186, 416, 404, 0, 0, 271, 213, 211, 206, 0, + 46, 0, 0, 297, 0, 0, 0, 56, 55, 0, + 0, 0, 0, 172, 0, 167, 0, 173, 521, 163, + 0, 0, 238, 0, 0, 64, 61, 168, 58, 169, + 46, 103, 101, 46, 218, 225, 259, 0, 263, 242, + 438, 0, 451, 470, 472, 407, 0, 0, 253, 0, + 207, 208, 38, 165, 170, 123, 521, 523, 120, 0, + 0, 122, 0, 0, 0, 0, 117, 62, 59, 164, + 0, 0, 0, 0, 53, 50, 0, 63, 60, 34, + 43, 221, 243, 260, 445, 524, 0, 403, 418, 254, + 257, 199, 0, 0, 119, 118, 121, 150, 0, 54, + 255, 408, 0, 523, 125, 65, 244, 0, 0, 419, + 124 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 1, 3, 86, 87, 88, 303, 89, 278, 706, + 276, 699, 294, 724, 705, 781, 867, 513, 611, 612, + 782, 90, 291, 153, 518, 519, 716, 508, 718, 797, + 883, 785, 719, 796, 917, 918, 968, 91, 92, 93, + 94, 300, 531, 734, 532, 533, 534, 631, 736, 95, + 872, 96, 97, 256, 873, 874, 98, 99, 100, 525, + 800, 257, 412, 258, 580, 756, 259, 413, 585, 241, + 260, 593, 594, 906, 876, 598, 438, 691, 690, 834, + 770, 595, 596, 769, 624, 625, 729, 887, 730, 731, + 945, 355, 416, 417, 588, 101, 261, 224, 196, 544, + 225, 226, 350, 891, 1010, 262, 684, 892, 263, 1000, + 764, 828, 947, 419, 893, 264, 421, 422, 423, 591, + 766, 592, 830, 439, 137, 138, 912, 103, 104, 105, + 106, 107, 168, 108, 308, 289, 317, 510, 700, 511, + 678, 109, 150, 227, 228, 229, 111, 112, 113, 114, + 679, 758, 755, 902, 996, 680, 760, 759, 757, 827, + 1012, 681, 682, 683, 115, 639, 326, 739, 895, 327, + 328, 643, 808, 644, 331, 742, 897, 647, 651, 648, + 652, 649, 653, 650, 654, 655, 656, 407, 497, 274, + 951, 498, 499, 500, 501, 502 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -917 +static const yytype_int16 yypact[] = +{ + -917, 52, -917, 5135, 5259, 6825, 6259, 51, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -14, 98, + 6825, 5274, -917, -917, 5714, -917, -917, 5823, 6259, -63, + -917, -917, 81, 264, 170, 55, 5932, -917, -44, 181, + 108, 132, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, 38, 49, 53, 54, 64, 86, + 113, 122, 156, 158, 171, 172, 196, 198, 201, 209, + 215, 216, 219, 220, 224, -917, -917, -917, -917, 10, + 10, -917, 6041, -917, 5496, 134, 134, 134, 134, 134, + -917, -917, 6615, 6259, -917, 15, 6368, 151, 188, -917, + 147, -917, -917, -917, -917, -917, 191, 206, 272, 387, + 395, 412, 413, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, 36, -917, -917, -917, + 229, -917, 343, 343, -22, 343, 343, 0, 22, 289, + 282, -917, -917, 240, -917, -917, -917, 239, -917, 5823, + 332, 6150, 249, 6259, -917, 296, -917, 251, 408, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -22, 300, + 301, 408, 408, 0, 22, 303, 310, 188, 271, -917, + -917, -917, -917, -917, 4932, -917, 138, 5714, -917, -917, + 6850, -917, -917, -917, 6850, 6850, -917, 6850, 6850, 6850, + 6850, 6850, 6850, 6850, 6850, 6850, 6850, 6850, 6850, 6850, + 6850, -917, -917, -917, 278, -917, 4819, -917, 19, -917, + 280, 281, 848, 848, 4819, 10, 134, 134, 6720, -917, + -917, -917, -917, -917, -917, -917, 325, 300, 301, 6900, + 326, -917, -917, 327, 303, 310, 6795, -917, -917, -917, + -917, -917, 279, 4456, 277, -58, 330, -917, -917, -917, + -917, 408, 4606, -917, 1000, 5605, 284, 5605, 284, -917, + -917, -917, -917, -917, -917, -917, -917, 408, 1154, 5605, + 6850, 295, 1308, 5605, 284, 6259, -917, -917, 4588, -917, + 6585, -917, 1462, 302, 304, 318, -917, 1616, 5605, 166, + -917, -917, -917, -917, 308, 6850, 1770, 5605, -917, -917, + -917, -917, -917, -917, -917, 311, 6850, 6850, 6850, 314, + 324, 6850, 335, 336, 338, 339, 340, 362, 368, 376, + 377, 378, 381, 391, 397, 393, -917, 396, -917, -917, + 4819, -917, -917, -917, -917, 405, -917, 6850, 407, 414, + 422, -917, -917, -58, 1924, 389, 404, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, 423, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, 283, -917, -917, -917, -917, + -917, 464, 40, 40, 184, -917, -917, -917, -917, 424, + 4819, -917, -917, -917, -917, -917, -917, -917, 28, -12, + 5, 139, 175, 123, 125, 6850, -917, -917, -917, 426, + -917, 469, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + 425, 427, 351, 429, 428, 433, -917, 431, 434, 432, + 430, 6850, -917, 439, 443, 445, 6850, -917, 488, -917, + -917, 444, 447, 533, 6850, 6850, -917, -917, -917, -917, + -917, 448, -917, 453, 15, -917, -917, 452, -917, 451, + 450, 459, -917, -917, 454, 6477, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, 6850, -917, + -917, -917, -917, -917, -917, -917, 449, 455, -917, -917, + 462, -917, -917, 585, 586, -917, -917, -917, 4768, -917, + -917, 458, 461, 445, 5605, -917, -917, 470, 463, -917, + 4663, 2078, 2232, 2386, 2540, 2694, -917, -917, 408, 408, + 408, -917, 465, -917, -917, -917, -917, -917, -917, 6850, + 4531, 468, -917, -917, 472, 41, -917, 4693, -917, -917, + 6850, -917, -917, -917, 474, -917, -917, -917, -917, 6259, + -917, -917, -917, 6477, 6477, -917, 482, 6477, 6477, 6477, + 6477, 6477, 6477, 6477, 6477, 6477, 6477, 477, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, 481, 611, -917, 144, -917, 486, 483, -917, 408, + -917, 445, 6850, -917, -917, -917, -917, -917, -917, 284, + 5605, -917, -917, -917, 351, 43, 284, 59, -917, -22, + 0, 22, -917, -917, -917, -917, 364, -917, -917, -917, + -917, 188, -917, -917, 284, 82, -917, -917, -917, -917, + 485, 6259, 6850, -917, 6585, -917, 279, -917, 489, 6259, + -917, 493, 6477, -917, 494, 495, 496, 497, 498, 499, + 500, 501, 502, 503, -917, 504, 445, 4803, 4768, 446, + 446, -917, -917, -917, -917, -917, 4531, -917, 506, 445, + 505, 507, 510, -917, 487, -917, -917, -917, -917, -917, + -917, 3772, 508, 511, -917, 4531, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, 4531, 513, -917, + 40, -917, 5377, -917, -917, -917, -917, -917, 509, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, 627, + 628, -917, 516, 517, -917, -917, -917, 6259, 445, -917, + 512, -917, 518, 408, -917, -917, -917, -917, 4294, 28, + -12, 5, -917, 3904, 4424, 139, 520, 607, 175, 123, + 125, 523, 524, 525, 526, 528, 529, 530, 532, 534, + 535, 538, 539, 540, -917, 6850, 10, -917, 10, -917, + -917, 4034, 134, 134, 6850, 134, -917, -917, 6690, -917, + -917, -917, 542, 4531, -917, -917, -917, 41, -917, -917, + -917, -917, 390, 277, -917, 544, -917, 545, 546, 547, + -917, -917, 543, 536, 550, -917, 445, -917, 505, 2848, + 97, 6850, 6850, 289, 4987, 6825, 4987, -917, -917, 243, + 134, 134, 6720, -917, 6850, -917, 4164, -917, -917, -917, + 553, 555, 10, 134, 134, -917, -917, -917, -917, -917, + 102, -917, -917, 107, -917, 279, -917, 554, 5377, -917, + -917, 3310, -917, -917, -917, 557, 558, 556, 625, 562, + -917, -917, -917, -917, -917, -917, -917, -917, -917, 200, + 200, -917, 200, 5008, 6850, 5008, -917, -917, -917, -917, + 4294, 563, 6850, 3002, -917, -917, 559, -917, -917, -917, + -917, -917, -917, -917, -917, -917, 4768, -917, -917, -917, + -917, -917, 3156, 3464, -917, -917, -917, -917, 566, -917, + 144, -917, 4803, -917, -917, -917, -917, 565, 3618, -917, + -917 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -917, -270, -917, -917, -917, -917, -917, -72, -917, -917, + -917, -917, -917, -917, -587, -917, -917, -273, -2, -917, + -917, -84, -917, -917, -476, -917, -917, -541, -660, -917, + -917, -917, -917, -917, -917, -227, -680, -78, -917, -77, + -505, -917, -29, -917, -917, -917, -917, -466, -917, -917, + -917, -27, -917, -917, -750, -917, -917, -70, 435, -917, + -917, -146, -917, -917, -917, -917, -250, -917, -399, -81, + -917, -917, -917, -917, -261, -917, -917, -917, -917, -202, + -125, -501, -917, -917, -532, -917, -175, -917, -917, -917, + -917, 480, -690, -917, -917, -71, -182, -83, 2, -917, + 173, -917, -917, -837, -917, -177, -917, -917, -917, -917, + -296, -917, -917, -917, -917, -761, -178, -661, -917, -917, + -917, -917, -917, -4, -917, -917, 1, -35, 90, -111, + 613, 612, -917, -33, -917, -917, -917, -246, -917, -917, + 131, -10, 31, -86, -917, 514, -180, -291, 8, -232, + -726, -917, -181, -917, -917, -727, -917, -917, -917, -917, + -917, -917, -917, -630, -59, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, -917, -917, + -917, -917, -917, -917, -917, -917, -917, -917, 519, -98, + -916, -917, -877, -917, -917, -917 +}; + +/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule which + number is the opposite. If zero, do what YYDEFACT says. + If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -406 +static const yytype_int16 yytable[] = +{ + 136, 140, 163, 286, 102, 515, 410, 230, 233, 535, + 187, 437, 139, 141, 586, 242, 243, 244, 245, 268, + 232, 524, 235, 765, 237, 626, 154, 157, 630, 707, + 823, 514, 824, 189, 110, 162, 725, 527, 155, 158, + 543, 894, 496, 517, 348, 621, 805, 523, 777, 778, + 779, 1003, 2, 288, 221, 946, 496, 359, 292, 221, + 496, 686, 541, 221, 777, 778, 779, 236, 165, 633, + 496, 547, -339, 177, 995, 496, 167, 424, 302, 717, + -343, 425, -343, 582, 496, 583, 418, 777, 778, 779, + 169, 197, 307, 920, -341, 238, 149, 1018, 265, -342, + 316, 727, 777, 778, 779, 192, 829, 777, 778, 779, + 409, 993, 777, 778, 779, 193, -340, 152, 170, 171, + -343, 933, -339, -280, 163, 882, 995, 164, 166, 825, + 826, 894, 496, 266, 728, 187, 195, 884, 172, 191, + -279, 995, 364, 708, -233, -339, 357, 357, 187, 187, + 139, 141, 360, 155, 158, 361, 362, 222, 189, 772, + 223, 199, 222, -278, 735, 223, 222, 152, 569, 351, + 314, 189, 189, 200, 188, 275, 981, 420, 173, 174, + 175, 780, 234, 584, 201, -339, 151, 894, 202, 203, + 152, 773, -342, 267, 33, 309, 325, 784, 315, 204, + 329, 330, -344, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 341, 342, 343, 344, 345, -344, 176, -345, + 799, 205, 349, 942, 822, 717, -345, 347, 356, 356, + 349, 803, -342, -341, 363, 962, 971, 832, 187, 187, + 989, 272, -344, 590, 717, 990, 973, 974, 206, 164, + 910, 195, 363, 297, 187, 991, 717, 207, -281, 349, + -282, 189, 189, 414, -341, 187, -345, 634, 239, -340, + 1011, 240, 312, 178, -276, -340, 871, 189, 191, 763, + 313, 273, 271, 975, 311, 1017, 520, 411, 189, 1004, + 1005, 208, 1006, 209, 940, 971, 904, -268, 943, 301, + 542, 179, 180, 441, -341, 190, 210, 211, 313, 191, + -277, 363, 304, 305, 199, -340, 198, 181, 587, 182, + 199, 183, 549, 550, 551, -278, 313, 554, -278, 528, + -278, 212, -278, 213, 965, 249, 214, 966, 919, 693, + -280, 967, 717, -280, 215, -280, 349, -280, 687, 765, + 216, 217, 279, 571, 218, 219, 608, 609, 610, 220, + 178, 184, 185, 186, 929, 509, 733, 509, 277, 496, + 496, 496, 496, 496, 959, 646, 287, 290, 293, 509, + 280, 281, 192, 509, 296, 311, 601, 602, 179, 180, + 298, 299, 603, 604, -343, -342, 605, -344, 509, 318, + 282, 886, 427, 440, -345, 306, -279, 509, 183, -279, + 963, -279, 346, -279, 353, 354, 349, 178, 440, -339, + -341, -340, 415, 979, 426, 512, 774, 319, 320, 440, + -268, 597, 521, 783, 221, 786, 787, 579, 538, 537, + 283, 284, 285, 535, 545, 179, 180, 321, 184, 185, + 186, 798, 539, 548, 775, 178, 552, 664, 665, 666, + 667, 668, 669, 740, 741, 183, 553, 744, 745, 746, + 747, 748, 749, 750, 751, 752, 753, 555, 556, 187, + 557, 558, 559, 179, 180, 888, 889, 322, 323, 324, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 189, 183, 560, 184, 185, 186, 788, 789, + 561, 790, 791, 792, 793, 794, 795, 520, 562, 563, + 564, -276, 597, 565, -276, 890, -276, 566, -276, -277, + 632, 632, -277, 567, -277, 568, -277, 222, 313, 570, + 223, 572, 576, 184, 185, 186, -281, -282, 573, -281, + -282, -281, -282, -281, -282, 187, 574, 577, 581, 578, + 589, 599, 810, 600, 657, 606, 614, 187, 615, 607, + 616, 617, 618, 620, 619, 187, 187, 187, 189, 622, + 623, -212, 627, 925, 628, 39, 641, 721, 635, 629, + 189, 636, 638, 640, 187, 642, 645, 660, 189, 189, + 189, 661, 662, 658, 689, 688, 723, 704, 726, 659, + 722, -273, 737, 937, 685, 520, 720, 189, 743, 754, + 761, 762, 767, 768, 837, 806, 632, 801, 939, 809, + 811, 812, 813, 814, 815, 816, 817, 818, 898, 899, + 821, 831, 835, 613, 819, 820, 836, 833, 881, 880, + 885, 896, 900, 901, 907, 926, 187, 927, -295, -296, + -285, -286, 964, -287, -288, -289, 905, -290, 999, -291, + -292, 187, 939, -293, -294, 928, 957, 496, 941, 189, + 950, 952, 953, 954, 509, 955, 958, 984, 597, 985, + 992, 998, 976, 1009, 189, -405, 997, 868, 1001, 1007, + 1015, 1019, 776, 869, 870, 804, 960, 436, 908, 866, + 877, 875, 944, 358, 1016, 949, 903, 637, 269, 496, + 270, 956, 879, 0, 187, 187, 187, 187, 597, 738, + 0, 440, 939, 721, 0, 0, 0, 909, 0, 701, + 702, 703, 352, 0, 0, 0, 0, 189, 189, 189, + 189, 496, 721, 0, 0, 0, 722, 0, 440, 0, + 0, 0, 720, 0, 721, 0, 0, 286, 408, 0, + 496, 496, 0, 921, 0, 722, 0, 0, 0, 0, + 0, 720, 878, 930, 0, 931, 496, 722, 0, 0, + 509, 935, 936, 720, 938, 0, 0, 0, 349, 932, + 187, 934, 0, 0, 0, 0, 948, 0, 0, 163, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 771, 802, 0, 189, 0, 0, 0, 0, 0, 807, + 983, 0, 0, 0, 0, 613, 0, 0, 0, 977, + 978, 0, 0, 0, 922, 0, 0, 0, 0, 986, + 721, 0, 987, 988, 0, 0, 0, 318, 0, 0, + 0, 597, 0, 0, 0, 0, 0, 0, 1002, 0, + 0, 0, 922, 722, 265, 0, 0, 0, 0, 720, + 0, 0, 0, 0, 0, 319, 320, 0, 349, 0, + 0, 0, 221, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 321, 0, 597, 363, 0, + 969, 970, 972, 0, 0, 0, 0, 0, 363, 0, + 597, 0, 139, 141, 158, 0, 0, 982, 913, 0, + 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 349, 322, 323, 324, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 0, 0, 0, 187, 771, 0, 0, 0, 0, 969, + 970, 972, 0, 0, 0, 0, 0, 0, 363, 187, + 0, 0, 0, 0, 0, 0, 189, 0, 0, 0, + 0, 0, 0, 0, 0, 222, 0, 0, 223, 0, + 0, 0, 189, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 35, 36, 0, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 0, 476, 477, 0, 478, 479, 480, 481, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 482, 483, 484, 485, 486, 487, 488, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 489, 490, 0, 491, 492, 392, + 393, 493, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 494, 0, 406, 495, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 35, 36, 0, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 0, 476, 477, 0, 478, + 479, 480, 481, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 482, 483, 484, + 485, 486, 487, 488, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 489, 490, + 516, 491, 0, 392, 393, 493, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 494, 0, 406, + 495, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 35, 36, 0, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 0, + 476, 477, 0, 478, 479, 480, 481, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 482, 483, 484, 485, 486, 487, 488, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 489, 490, 0, 491, 522, 392, 393, 493, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 494, 0, 406, 495, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 35, + 36, 0, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 0, 476, 477, 0, 478, 479, 480, + 481, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 482, 483, 484, 485, 486, + 487, 488, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 489, 490, 0, 491, + 536, 392, 393, 493, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 494, 0, 406, 495, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 35, 36, 0, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 475, 0, 476, 477, + 0, 478, 479, 480, 481, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 388, 389, 390, 482, + 483, 484, 485, 486, 487, 488, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 489, 490, 540, 491, 0, 392, 393, 493, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 494, + 0, 406, 495, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 35, 36, 0, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 0, 476, 477, 0, 478, 479, 480, 481, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 482, 483, 484, 485, 486, 487, 488, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 489, 490, 546, 491, 0, 392, + 393, 493, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 494, 0, 406, 495, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 35, 36, 0, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 0, 476, 477, 0, 478, + 479, 480, 481, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 482, 483, 484, + 485, 486, 487, 488, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 489, 490, + 0, 491, 575, 392, 393, 493, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 494, 0, 406, + 495, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 35, 36, 0, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 0, + 476, 477, 0, 478, 479, 480, 481, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 482, 483, 484, 485, 486, 487, 488, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 489, 490, 694, 491, 0, 392, 393, 493, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 494, 0, 406, 495, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 35, + 36, 0, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 0, 476, 477, 0, 478, 479, 480, + 481, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 482, 483, 484, 485, 486, + 487, 488, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 489, 490, 695, 491, + 0, 392, 393, 493, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 494, 0, 406, 495, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 35, 36, 0, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 475, 0, 476, 477, + 0, 478, 479, 480, 481, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 388, 389, 390, 482, + 483, 484, 485, 486, 487, 488, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 489, 490, 696, 491, 0, 392, 393, 493, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 494, + 0, 406, 495, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 35, 36, 0, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 0, 476, 477, 0, 478, 479, 480, 481, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 482, 483, 484, 485, 486, 487, 488, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 489, 490, 0, 491, 697, 392, + 393, 493, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 494, 0, 406, 495, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 35, 36, 0, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 0, 476, 477, 0, 478, + 479, 480, 481, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 482, 483, 484, + 485, 486, 487, 488, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 489, 490, + 0, 491, 0, 392, 393, 493, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 494, 698, 406, + 495, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 35, 36, 0, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 0, + 476, 477, 0, 478, 479, 480, 481, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 482, 483, 484, 485, 486, 487, 488, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 489, 490, 961, 491, 0, 392, 393, 493, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 494, 0, 406, 495, 442, 443, 444, 445, 446, + 447, 448, 449, 450, 451, 452, 453, 454, 455, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 456, + 457, 458, 459, 460, 461, 462, 463, 464, 465, 35, + 36, 0, 466, 0, 467, 468, 469, 470, 471, 472, + 473, 474, 475, 0, 476, 477, 0, 478, 479, 480, + 481, 367, 368, 369, 370, 371, 372, 373, 374, 375, + 376, 377, 378, 379, 380, 381, 382, 383, 384, 385, + 386, 387, 388, 389, 390, 482, 483, 484, 485, 486, + 487, 488, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 489, 490, 1008, 491, + 0, 392, 393, 493, 394, 395, 396, 397, 398, 399, + 400, 401, 402, 403, 404, 494, 0, 406, 495, 442, + 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, + 453, 454, 455, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 35, 36, 0, 466, 0, 467, 468, + 469, 470, 471, 472, 473, 474, 475, 0, 476, 477, + 0, 478, 479, 480, 481, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, + 382, 383, 384, 385, 386, 387, 388, 389, 390, 482, + 483, 484, 485, 486, 487, 488, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 489, 490, 0, 491, 1013, 392, 393, 493, 394, 395, + 396, 397, 398, 399, 400, 401, 402, 403, 404, 494, + 0, 406, 495, 442, 443, 444, 445, 446, 447, 448, + 449, 450, 451, 452, 453, 454, 455, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 456, 457, 458, + 459, 460, 461, 462, 463, 464, 465, 35, 36, 0, + 466, 0, 467, 468, 469, 470, 471, 472, 473, 474, + 475, 0, 476, 477, 0, 478, 479, 480, 481, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 482, 483, 484, 485, 486, 487, 488, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 490, 994, 491, 0, 392, + 393, 493, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 494, 0, 406, 495, 442, 443, 444, + 445, 446, 447, 448, 449, 450, 451, 452, 453, 454, + 455, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 456, 457, 458, 459, 460, 461, 462, 463, 464, + 465, 35, 36, 0, 466, 0, 467, 468, 469, 470, + 471, 472, 473, 474, 475, 0, 476, 477, 0, 478, + 479, 480, 481, 367, 368, 369, 370, 371, 372, 373, + 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, + 384, 385, 386, 387, 388, 389, 390, 482, 483, 484, + 485, 486, 487, 488, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 1014, 490, + 0, 491, 0, 392, 393, 493, 394, 395, 396, 397, + 398, 399, 400, 401, 402, 403, 404, 494, 0, 406, + 495, 442, 443, 444, 445, 446, 447, 448, 449, 450, + 451, 452, 453, 454, 455, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 465, 35, 36, 0, 466, 0, + 467, 468, 469, 470, 471, 472, 473, 474, 475, 0, + 476, 477, 0, 478, 479, 480, 481, 367, 368, 369, + 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, + 380, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 482, 483, 484, 485, 486, 487, 488, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1020, 490, 0, 491, 0, 392, 393, 493, + 394, 395, 396, 397, 398, 399, 400, 401, 402, 403, + 404, 494, 0, 406, 495, 4, 5, 0, 0, 0, + 838, 839, 0, 0, 0, 0, 0, 0, 0, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 840, + 841, 30, 31, 842, 0, 33, 0, 0, 34, 35, + 36, 843, 844, 38, 39, 40, 41, 0, 43, 845, + 45, 161, 47, 846, 0, 0, 847, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 848, + 849, 850, 851, 852, 853, 854, 855, 856, 857, 858, + 859, 860, 861, 862, 64, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 863, 864, 914, 915, 0, + 0, 0, 838, 839, 0, 0, 0, 0, 865, 0, + 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 840, 841, 145, 916, 0, 0, 33, 0, 0, + 34, 35, 36, 0, 844, 38, 39, 40, 0, 0, + 0, 845, 160, 161, 0, 0, 0, 0, 847, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 4, 5, 0, + 0, 0, 838, 839, 0, 0, 0, 0, 0, 0, + 865, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 840, 841, 145, 31, 0, 0, 33, 0, 0, + 34, 35, 36, 0, 844, 38, 0, 40, 0, 0, + 0, 845, 160, 161, 0, 0, 0, 0, 847, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 142, 143, 0, + 0, 0, 980, 839, 0, 0, 0, 0, 0, 0, + 865, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 840, 841, 145, 146, 0, 0, 33, 0, 0, + 0, 35, 36, 0, 844, 38, 0, 40, 0, 0, + 0, 845, 160, 161, 0, 0, 0, 0, 847, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 142, 143, 0, + 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, + 865, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 145, 146, 0, 0, 33, 0, 0, + 0, 35, 36, 0, 159, 38, 0, 40, 0, 0, + 0, 147, 160, 161, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 148, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 142, 143, 0, + 0, 0, 0, 839, 0, 0, 0, 0, 0, 0, + 911, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 840, 841, 145, 146, 318, 0, 33, 0, 0, + 0, 35, 36, 0, 0, 0, 0, 40, 0, 0, + 0, 845, 160, 0, 0, 0, 0, 0, 923, 0, + 0, 0, 0, 319, 320, 0, 0, 0, 0, 0, + 221, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 321, 0, 0, 0, 0, 0, 0, + 0, 848, 849, 850, 851, 852, 853, 854, 855, 856, + 857, 858, 859, 860, 861, 862, 0, 0, 0, 0, + 709, 0, 503, 504, 505, 0, 506, 507, 0, 0, + 0, 251, 252, 322, 323, 324, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 247, 248, + 924, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 710, 0, + 0, 0, 0, 0, 0, 0, 0, 428, 0, 0, + 0, 0, 0, 222, 0, 0, 223, 0, 0, 0, + 0, 0, 0, 0, 0, 428, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 429, 430, 0, 711, 254, + 255, 123, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 429, 430, 431, 0, 0, 0, 0, + 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 431, 0, 0, 712, 0, 0, 0, + 0, 0, 428, 0, 0, 713, 714, 715, 0, 0, + 0, 0, 0, 0, 0, 432, 433, 434, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 429, 430, 428, 432, 433, 434, 123, 124, 125, 126, + 127, 128, 129, 130, 131, 132, 133, 134, 0, 0, + 431, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 429, 430, 0, 0, 526, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 431, 0, 435, 0, 0, 0, 0, 0, 0, 0, + 432, 433, 434, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 0, 0, 178, 663, 664, + 665, 666, 667, 668, 669, 0, 0, 0, 0, 0, + 432, 433, 434, 123, 124, 125, 126, 127, 128, 129, + 130, 131, 132, 133, 134, 179, 180, 0, 0, 692, + 0, 0, 178, 663, 664, 665, 666, 667, 668, 669, + 0, 0, 0, 0, 0, 183, 0, 0, 318, 0, + 0, 0, 0, 670, 671, 672, 673, 0, 0, 732, + 179, 180, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 319, 320, 0, 0, + 183, 0, 0, 0, 0, 184, 185, 186, 670, 671, + 672, 673, 0, 0, 0, 0, 321, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 184, 185, 186, 674, 0, 675, 0, 0, 0, 0, + 0, 0, 676, 677, 251, 252, 322, 323, 324, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 0, 0, 0, 0, 142, 143, 0, 674, 0, + 0, 144, 0, 0, 0, 0, 0, 676, 677, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 145, 146, 0, 0, 33, 0, 0, 0, 35, + 36, 0, 0, 0, 0, 40, 0, 0, 0, 147, + 0, 0, 0, 0, 0, 0, 116, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 318, 0, 0, + 0, 0, 0, 0, 117, 118, 0, 0, 0, 148, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 119, 319, 320, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 321, 0, 0, 0, 310, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 120, 121, 122, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 0, + 0, 0, 0, 0, 0, 322, 323, 324, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 0, 965, 0, 0, 966, 0, 0, 0, 967, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, + 0, 0, 965, 6, 7, 966, 0, 0, 0, 967, + 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 0, 33, 0, + 0, 34, 35, 36, 0, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 116, 85, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 116, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 117, 118, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 117, 118, 0, 0, 0, 119, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 119, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 120, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 120, 121, 122, 123, 124, 125, 126, 127, 128, + 129, 130, 131, 132, 133, 134, 318, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 135, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 156, 0, 0, 319, 320, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 321, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 888, 889, 322, 323, 324, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, + 5, 0, 0, 0, 6, 144, 0, 0, 0, 0, + 0, 0, 890, 8, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 145, 31, 0, 0, 33, + 0, 0, 34, 35, 36, 0, 159, 38, 0, 40, + 0, 0, 0, 147, 160, 161, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 148, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 142, 143, + 0, 0, 0, 0, 144, 0, 503, 504, 505, 0, + 506, 507, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 145, 146, 0, 0, 33, 0, + 0, 0, 35, 36, 0, 0, 0, 0, 40, 0, + 0, 0, 147, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 148, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 142, 143, 0, + 0, 0, 0, 144, 0, 0, 0, 0, 0, 0, + 0, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 145, 146, 0, 0, 33, 0, 0, + 0, 35, 36, 0, 159, 38, 0, 40, 0, 0, + 0, 147, 160, 161, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 148, 50, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 142, 143, 0, 0, + 0, 0, 144, 0, 0, 0, 0, 0, 0, 0, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 145, 146, 0, 0, 33, 0, 0, 0, + 35, 36, 0, 0, 0, 0, 40, 0, 0, 0, + 147, 160, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 148, 50, 51, 52, 53, 54, 55, 56, 57, 58, + 59, 60, 61, 62, 63, 142, 143, 0, 0, 0, + 0, 144, 194, 0, 0, 0, 0, 0, 0, 8, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 145, 146, 0, 0, 33, 0, 0, 0, 35, + 36, 0, 0, 0, 0, 40, 0, 0, 0, 147, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 148, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 60, 61, 62, 63, 4, 5, 0, 0, 0, 0, + 144, 0, 0, 0, 0, 0, 0, 0, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 0, 0, 33, 0, 0, 0, 35, 36, + 0, 0, 0, 0, 40, 0, 0, 0, 147, 0, + 0, 231, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 148, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, + 61, 62, 63, 142, 143, 0, 0, 0, 0, 144, + 295, 0, 0, 0, 0, 0, 0, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 145, + 146, 0, 0, 33, 0, 0, 0, 35, 36, 0, + 0, 0, 0, 40, 0, 0, 0, 147, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 148, 50, 51, + 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 62, 63, 142, 143, 0, 0, 0, 0, 144, 0, + 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 145, 146, + 0, 0, 33, 0, 0, 0, 35, 36, 0, 0, + 0, 0, 40, 0, 0, 0, 147, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 148, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, + 63, 142, 143, 0, 0, 0, 0, 144, 0, 0, + 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 145, 146, 0, + 0, 0, 0, 0, 0, 35, 36, 0, 0, 0, + 0, 40, 0, 0, 0, 147, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 148, 50, 51, 52, 53, + 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, + 142, 143, 0, 0, 0, 0, 279, 0, 0, 0, + 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 280, 281, 145, 146, 0, 0, + 0, 0, 0, 0, 35, 36, 0, 0, 0, 0, + 0, 0, 0, 0, 282, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 283, 284, 285, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 529, + 0, 0, 0, 0, 279, 0, 0, 0, 0, 0, + 0, 0, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 280, 281, 246, 0, 0, 0, 0, 0, + 0, 0, 35, 36, 0, 0, 0, 0, 530, 0, + 0, 0, 282, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 247, 248, 0, 0, 0, 0, 0, 0, + 0, 249, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 283, 284, 285, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 0, 0, 318, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 251, 252, 253, 254, 255, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 319, 320, 318, + 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 321, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 319, 320, 0, + 0, 0, 0, 0, 0, 0, 249, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 321, 0, 0, + 0, 0, 0, 0, 0, 251, 252, 322, 323, 324, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 0, 0, 246, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 322, 323, 324, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 247, 248, 116, 0, 0, 0, 0, 0, + 0, 249, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 250, 0, 0, 0, 0, 0, 0, 318, + 0, 0, 117, 118, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 119, 0, 0, 0, 0, 319, 320, 0, + 0, 0, 253, 254, 255, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 321, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 322, 323, 324, + 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 365, 366, 0, 0, 0, 0, 0, 367, + 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, + 388, 389, 390, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 391, 0, 0, 0, 392, + 393, 0, 394, 395, 396, 397, 398, 399, 400, 401, + 402, 403, 404, 405, 0, 406 +}; + +static const yytype_int16 yycheck[] = +{ + 4, 5, 37, 149, 3, 278, 256, 90, 92, 300, + 43, 272, 4, 5, 413, 96, 97, 98, 99, 105, + 92, 294, 94, 684, 94, 526, 30, 31, 533, 616, + 757, 277, 758, 43, 3, 34, 623, 298, 30, 31, + 310, 802, 274, 289, 226, 521, 736, 293, 5, 6, + 7, 967, 0, 151, 44, 892, 288, 234, 156, 44, + 292, 593, 308, 44, 5, 6, 7, 94, 37, 535, + 302, 317, 94, 42, 951, 307, 139, 135, 176, 620, + 94, 139, 94, 43, 316, 45, 263, 5, 6, 7, + 9, 135, 190, 843, 94, 94, 6, 1013, 102, 94, + 198, 60, 5, 6, 7, 50, 766, 5, 6, 7, + 256, 948, 5, 6, 7, 60, 94, 139, 37, 38, + 134, 871, 94, 135, 159, 785, 1003, 37, 38, 759, + 760, 892, 364, 102, 93, 168, 46, 797, 57, 139, + 135, 1018, 240, 619, 134, 94, 232, 233, 181, 182, + 142, 143, 235, 145, 146, 236, 237, 147, 168, 691, + 150, 139, 147, 135, 630, 150, 147, 139, 350, 150, + 197, 181, 182, 135, 43, 139, 926, 263, 97, 98, + 99, 138, 92, 143, 135, 134, 135, 948, 135, 135, + 139, 692, 94, 103, 43, 193, 200, 138, 197, 135, + 204, 205, 94, 207, 208, 209, 210, 211, 212, 213, + 214, 215, 216, 217, 218, 219, 220, 94, 137, 94, + 138, 135, 226, 883, 756, 766, 94, 225, 232, 233, + 234, 732, 134, 94, 238, 138, 916, 769, 271, 272, + 138, 94, 134, 420, 785, 138, 3, 4, 135, 159, + 837, 161, 256, 163, 287, 945, 797, 135, 135, 263, + 135, 271, 272, 261, 94, 298, 134, 537, 134, 94, + 996, 137, 134, 9, 135, 94, 781, 287, 139, 135, + 142, 134, 94, 40, 194, 1012, 290, 256, 298, 969, + 970, 135, 972, 135, 881, 975, 828, 153, 885, 168, + 134, 37, 38, 272, 134, 135, 135, 135, 142, 139, + 135, 315, 181, 182, 139, 134, 135, 53, 134, 55, + 139, 57, 326, 327, 328, 134, 142, 331, 137, 298, + 139, 135, 141, 135, 134, 46, 135, 137, 843, 600, + 134, 141, 883, 137, 135, 139, 350, 141, 594, 1010, + 135, 135, 9, 357, 135, 135, 5, 6, 7, 135, + 9, 97, 98, 99, 865, 275, 627, 277, 139, 601, + 602, 603, 604, 605, 906, 555, 94, 137, 139, 289, + 37, 38, 50, 293, 135, 295, 484, 485, 37, 38, + 94, 140, 490, 491, 94, 94, 494, 94, 308, 9, + 57, 800, 271, 272, 94, 134, 134, 317, 57, 137, + 911, 139, 134, 141, 134, 134, 420, 9, 287, 94, + 94, 94, 143, 924, 94, 141, 699, 37, 38, 298, + 153, 435, 137, 706, 44, 71, 72, 154, 134, 137, + 97, 98, 99, 734, 136, 37, 38, 57, 97, 98, + 99, 724, 134, 142, 700, 9, 142, 11, 12, 13, + 14, 15, 16, 643, 644, 57, 142, 647, 648, 649, + 650, 651, 652, 653, 654, 655, 656, 142, 142, 512, + 142, 142, 142, 37, 38, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 512, 57, 142, 97, 98, 99, 144, 145, + 142, 147, 148, 149, 150, 151, 152, 521, 142, 142, + 142, 134, 526, 142, 137, 135, 139, 136, 141, 134, + 534, 535, 137, 136, 139, 142, 141, 147, 142, 134, + 150, 134, 153, 97, 98, 99, 134, 134, 134, 137, + 137, 139, 139, 141, 141, 588, 134, 153, 94, 136, + 136, 135, 742, 94, 568, 140, 137, 600, 140, 142, + 137, 140, 138, 143, 142, 608, 609, 610, 588, 140, + 137, 136, 94, 844, 140, 52, 136, 620, 140, 142, + 600, 138, 140, 142, 627, 136, 142, 135, 608, 609, + 610, 16, 16, 154, 141, 135, 138, 142, 136, 154, + 620, 153, 138, 874, 153, 619, 620, 627, 136, 142, + 139, 10, 136, 140, 137, 136, 630, 142, 878, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 11, 11, + 136, 135, 135, 512, 142, 142, 136, 142, 137, 141, + 137, 142, 136, 136, 136, 135, 689, 50, 135, 135, + 135, 135, 912, 135, 135, 135, 154, 135, 43, 135, + 135, 704, 922, 135, 135, 135, 140, 909, 136, 689, + 136, 136, 136, 136, 594, 142, 136, 134, 692, 134, + 136, 135, 919, 134, 704, 138, 138, 781, 136, 136, + 134, 136, 704, 781, 781, 734, 908, 272, 833, 781, + 781, 781, 887, 233, 1010, 893, 827, 544, 106, 951, + 107, 902, 781, -1, 757, 758, 759, 760, 732, 639, + -1, 600, 982, 766, -1, -1, -1, 835, -1, 608, + 609, 610, 228, -1, -1, -1, -1, 757, 758, 759, + 760, 983, 785, -1, -1, -1, 766, -1, 627, -1, + -1, -1, 766, -1, 797, -1, -1, 913, 249, -1, + 1002, 1003, -1, 843, -1, 785, -1, -1, -1, -1, + -1, 785, 781, 866, -1, 868, 1018, 797, -1, -1, + 700, 872, 873, 797, 875, -1, -1, -1, 802, 871, + 833, 871, -1, -1, -1, -1, 892, -1, -1, 844, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 689, 731, -1, 833, -1, -1, -1, -1, -1, 739, + 928, -1, -1, -1, -1, 704, -1, -1, -1, 920, + 921, -1, -1, -1, 843, -1, -1, -1, -1, 932, + 883, -1, 933, 934, -1, -1, -1, 9, -1, -1, + -1, 865, -1, -1, -1, -1, -1, -1, 966, -1, + -1, -1, 871, 883, 878, -1, -1, -1, -1, 883, + -1, -1, -1, -1, -1, 37, 38, -1, 892, -1, + -1, -1, 44, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 57, -1, 911, 912, -1, + 914, 915, 916, -1, -1, -1, -1, -1, 922, -1, + 924, -1, 914, 915, 916, -1, -1, 926, 838, -1, + -1, -1, -1, -1, 844, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 948, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + -1, -1, -1, 996, 833, -1, -1, -1, -1, 973, + 974, 975, -1, -1, -1, -1, -1, -1, 982, 1012, + -1, -1, -1, -1, -1, -1, 996, -1, -1, -1, + -1, -1, -1, -1, -1, 147, -1, -1, 150, -1, + -1, -1, 1012, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, + 50, -1, 52, 53, 54, 55, 56, 57, 58, 59, + 60, -1, 62, 63, -1, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 134, 135, -1, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, -1, 155, 156, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, -1, 50, -1, 52, 53, 54, 55, + 56, 57, 58, 59, 60, -1, 62, 63, -1, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 134, 135, + 136, 137, -1, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, -1, 155, + 156, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, -1, 50, -1, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + 62, 63, -1, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 134, 135, -1, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, -1, 155, 156, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, -1, 50, -1, 52, 53, 54, 55, 56, 57, + 58, 59, 60, -1, 62, 63, -1, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 134, 135, -1, 137, + 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, -1, 155, 156, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, -1, 50, -1, 52, 53, + 54, 55, 56, 57, 58, 59, 60, -1, 62, 63, + -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 134, 135, 136, 137, -1, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + -1, 155, 156, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, + 50, -1, 52, 53, 54, 55, 56, 57, 58, 59, + 60, -1, 62, 63, -1, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 134, 135, 136, 137, -1, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, -1, 155, 156, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, -1, 50, -1, 52, 53, 54, 55, + 56, 57, 58, 59, 60, -1, 62, 63, -1, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 134, 135, + -1, 137, 138, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, -1, 155, + 156, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, -1, 50, -1, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + 62, 63, -1, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 134, 135, 136, 137, -1, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, -1, 155, 156, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, -1, 50, -1, 52, 53, 54, 55, 56, 57, + 58, 59, 60, -1, 62, 63, -1, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 134, 135, 136, 137, + -1, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, -1, 155, 156, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, -1, 50, -1, 52, 53, + 54, 55, 56, 57, 58, 59, 60, -1, 62, 63, + -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 134, 135, 136, 137, -1, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + -1, 155, 156, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, + 50, -1, 52, 53, 54, 55, 56, 57, 58, 59, + 60, -1, 62, 63, -1, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 134, 135, -1, 137, 138, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, -1, 155, 156, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, -1, 50, -1, 52, 53, 54, 55, + 56, 57, 58, 59, 60, -1, 62, 63, -1, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 134, 135, + -1, 137, -1, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, + 156, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, -1, 50, -1, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + 62, 63, -1, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 134, 135, 136, 137, -1, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, -1, 155, 156, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, -1, 50, -1, 52, 53, 54, 55, 56, 57, + 58, 59, 60, -1, 62, 63, -1, 65, 66, 67, + 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 134, 135, 136, 137, + -1, 139, 140, 141, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, -1, 155, 156, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, + 44, 45, 46, 47, 48, -1, 50, -1, 52, 53, + 54, 55, 56, 57, 58, 59, 60, -1, 62, 63, + -1, 65, 66, 67, 68, 69, 70, 71, 72, 73, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 134, 135, -1, 137, 138, 139, 140, 141, 142, 143, + 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, + -1, 155, 156, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, 41, 42, 43, 44, 45, 46, 47, 48, -1, + 50, -1, 52, 53, 54, 55, 56, 57, 58, 59, + 60, -1, 62, 63, -1, 65, 66, 67, 68, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 135, 136, 137, -1, 139, + 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, -1, 155, 156, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, -1, 50, -1, 52, 53, 54, 55, + 56, 57, 58, 59, 60, -1, 62, 63, -1, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 134, 135, + -1, 137, -1, 139, 140, 141, 142, 143, 144, 145, + 146, 147, 148, 149, 150, 151, 152, 153, -1, 155, + 156, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 46, 47, 48, -1, 50, -1, + 52, 53, 54, 55, 56, 57, 58, 59, 60, -1, + 62, 63, -1, 65, 66, 67, 68, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 134, 135, -1, 137, -1, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, + 152, 153, -1, 155, 156, 3, 4, -1, -1, -1, + 8, 9, -1, -1, -1, -1, -1, -1, -1, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, -1, 43, -1, -1, 46, 47, + 48, 49, 50, 51, 52, 53, 54, -1, 56, 57, + 58, 59, 60, 61, -1, -1, 64, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 3, 4, -1, + -1, -1, 8, 9, -1, -1, -1, -1, 146, -1, + -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, -1, -1, 43, -1, -1, + 46, 47, 48, -1, 50, 51, 52, 53, -1, -1, + -1, 57, 58, 59, -1, -1, -1, -1, 64, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, -1, + -1, -1, 8, 9, -1, -1, -1, -1, -1, -1, + 146, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, -1, -1, 43, -1, -1, + 46, 47, 48, -1, 50, 51, -1, 53, -1, -1, + -1, 57, 58, 59, -1, -1, -1, -1, 64, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, -1, + -1, -1, 8, 9, -1, -1, -1, -1, -1, -1, + 146, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, -1, -1, 43, -1, -1, + -1, 47, 48, -1, 50, 51, -1, 53, -1, -1, + -1, 57, 58, 59, -1, -1, -1, -1, 64, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, -1, + -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, + 146, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, -1, -1, 43, -1, -1, + -1, 47, 48, -1, 50, 51, -1, 53, -1, -1, + -1, 57, 58, 59, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 3, 4, -1, + -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, + 146, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 9, -1, 43, -1, -1, + -1, 47, 48, -1, -1, -1, -1, 53, -1, -1, + -1, 57, 58, -1, -1, -1, -1, -1, 64, -1, + -1, -1, -1, 37, 38, -1, -1, -1, -1, -1, + 44, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 57, -1, -1, -1, -1, -1, -1, + -1, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, -1, -1, -1, -1, + 9, -1, 11, 12, 13, -1, 15, 16, -1, -1, + -1, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 37, 38, + 146, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 57, -1, + -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, + -1, -1, -1, 147, -1, -1, 150, -1, -1, -1, + -1, -1, -1, -1, -1, 9, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 37, 38, -1, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 37, 38, 57, -1, -1, -1, -1, + -1, -1, 46, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 57, -1, -1, 135, -1, -1, -1, + -1, -1, 9, -1, -1, 144, 145, 146, -1, -1, + -1, -1, -1, -1, -1, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 37, 38, 9, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, -1, -1, + 57, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 37, 38, -1, -1, 146, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 57, -1, 146, -1, -1, -1, -1, -1, -1, -1, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, -1, -1, 9, 10, 11, + 12, 13, 14, 15, 16, -1, -1, -1, -1, -1, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 37, 38, -1, -1, 146, + -1, -1, 9, 10, 11, 12, 13, 14, 15, 16, + -1, -1, -1, -1, -1, 57, -1, -1, 9, -1, + -1, -1, -1, 65, 66, 67, 68, -1, -1, 146, + 37, 38, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 37, 38, -1, -1, + 57, -1, -1, -1, -1, 97, 98, 99, 65, 66, + 67, 68, -1, -1, -1, -1, 57, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 97, 98, 99, 135, -1, 137, -1, -1, -1, -1, + -1, -1, 144, 145, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, -1, -1, -1, -1, 3, 4, -1, 135, -1, + -1, 9, -1, -1, -1, -1, -1, 144, 145, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, -1, -1, 43, -1, -1, -1, 47, + 48, -1, -1, -1, -1, 53, -1, -1, -1, 57, + -1, -1, -1, -1, -1, -1, 9, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 9, -1, -1, + -1, -1, -1, -1, 37, 38, -1, -1, -1, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 57, 37, 38, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 57, -1, -1, -1, 137, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, + -1, -1, -1, -1, -1, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + -1, 134, -1, -1, 137, -1, -1, -1, 141, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 3, 4, + -1, -1, 134, 8, 9, 137, -1, -1, -1, 141, + -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, 41, -1, 43, -1, + -1, 46, 47, 48, -1, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 9, 134, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 37, 38, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 37, 38, -1, -1, -1, 57, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 57, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 9, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 137, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 137, -1, -1, 37, 38, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 57, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 3, + 4, -1, -1, -1, 8, 9, -1, -1, -1, -1, + -1, -1, 135, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 40, -1, -1, 43, + -1, -1, 46, 47, 48, -1, 50, 51, -1, 53, + -1, -1, -1, 57, 58, 59, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 97, 98, 99, 100, 101, 102, 103, + 104, 105, 106, 107, 108, 109, 110, 111, 3, 4, + -1, -1, -1, -1, 9, -1, 11, 12, 13, -1, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 40, -1, -1, 43, -1, + -1, -1, 47, 48, -1, -1, -1, -1, 53, -1, + -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 3, 4, -1, + -1, -1, -1, 9, -1, -1, -1, -1, -1, -1, + -1, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, -1, -1, 43, -1, -1, + -1, 47, 48, -1, 50, 51, -1, 53, -1, -1, + -1, 57, 58, 59, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 97, 98, 99, 100, 101, 102, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 3, 4, -1, -1, + -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, -1, -1, 43, -1, -1, -1, + 47, 48, -1, -1, -1, -1, 53, -1, -1, -1, + 57, 58, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 3, 4, -1, -1, -1, + -1, 9, 10, -1, -1, -1, -1, -1, -1, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, + 38, 39, 40, -1, -1, 43, -1, -1, -1, 47, + 48, -1, -1, -1, -1, 53, -1, -1, -1, 57, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 3, 4, -1, -1, -1, -1, + 9, -1, -1, -1, -1, -1, -1, -1, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, -1, -1, 43, -1, -1, -1, 47, 48, + -1, -1, -1, -1, 53, -1, -1, -1, 57, -1, + -1, 60, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 3, 4, -1, -1, -1, -1, 9, + 10, -1, -1, -1, -1, -1, -1, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 40, -1, -1, 43, -1, -1, -1, 47, 48, -1, + -1, -1, -1, 53, -1, -1, -1, 57, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 3, 4, -1, -1, -1, -1, 9, -1, + -1, -1, -1, -1, -1, -1, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + -1, -1, 43, -1, -1, -1, 47, 48, -1, -1, + -1, -1, 53, -1, -1, -1, 57, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 97, 98, 99, 100, + 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, + 111, 3, 4, -1, -1, -1, -1, 9, -1, -1, + -1, -1, -1, -1, -1, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, -1, + -1, -1, -1, -1, -1, 47, 48, -1, -1, -1, + -1, 53, -1, -1, -1, 57, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 97, 98, 99, 100, 101, + 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 3, 4, -1, -1, -1, -1, 9, -1, -1, -1, + -1, -1, -1, -1, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 40, -1, -1, + -1, -1, -1, -1, 47, 48, -1, -1, -1, -1, + -1, -1, -1, -1, 57, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 97, 98, 99, 100, 101, 102, + 103, 104, 105, 106, 107, 108, 109, 110, 111, 4, + -1, -1, -1, -1, 9, -1, -1, -1, -1, -1, + -1, -1, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 9, -1, -1, -1, -1, -1, + -1, -1, 47, 48, -1, -1, -1, -1, 53, -1, + -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 37, 38, -1, -1, -1, -1, -1, -1, + -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 57, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, -1, -1, 9, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 37, 38, 9, + -1, -1, -1, -1, -1, -1, 46, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 37, 38, -1, + -1, -1, -1, -1, -1, -1, 46, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 57, -1, -1, + -1, -1, -1, -1, -1, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, -1, -1, 9, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 37, 38, 9, -1, -1, -1, -1, -1, + -1, 46, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 57, -1, -1, -1, -1, -1, -1, 9, + -1, -1, 37, 38, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 57, -1, -1, -1, -1, 37, 38, -1, + -1, -1, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, 57, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 97, 98, 99, 100, 101, 102, 103, 104, + 105, 106, 107, 108, 109, 110, 111, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 97, 98, 99, + 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, + 110, 111, 62, 63, -1, -1, -1, -1, -1, 69, + 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 135, -1, -1, -1, 139, + 140, -1, 142, 143, 144, 145, 146, 147, 148, 149, + 150, 151, 152, 153, -1, 155 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint16 yystos[] = +{ + 0, 158, 0, 159, 3, 4, 8, 9, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, + 39, 40, 41, 43, 46, 47, 48, 50, 51, 52, + 53, 54, 55, 56, 57, 58, 59, 60, 61, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, + 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 131, 132, 134, 160, 161, 162, 164, + 178, 194, 195, 196, 197, 206, 208, 209, 213, 214, + 215, 252, 283, 284, 285, 286, 287, 288, 290, 298, + 299, 303, 304, 305, 306, 321, 9, 37, 38, 57, + 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, + 107, 108, 109, 110, 111, 137, 280, 281, 282, 305, + 280, 305, 3, 4, 9, 39, 40, 57, 97, 285, + 299, 135, 139, 180, 280, 305, 137, 280, 305, 50, + 58, 59, 283, 284, 285, 299, 285, 139, 289, 9, + 37, 38, 57, 97, 98, 99, 137, 299, 9, 37, + 38, 53, 55, 57, 97, 98, 99, 290, 297, 298, + 135, 139, 50, 60, 10, 285, 255, 135, 135, 139, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 44, 147, 150, 254, 257, 258, 300, 301, 302, + 254, 60, 164, 178, 285, 164, 208, 214, 283, 134, + 137, 226, 226, 226, 226, 226, 9, 37, 38, 46, + 57, 95, 96, 97, 98, 99, 210, 218, 220, 223, + 227, 253, 262, 265, 272, 280, 299, 285, 300, 288, + 287, 94, 94, 134, 346, 139, 167, 139, 165, 9, + 37, 38, 57, 97, 98, 99, 218, 94, 346, 292, + 137, 179, 346, 139, 169, 10, 135, 285, 94, 140, + 198, 297, 346, 163, 297, 297, 134, 346, 291, 255, + 137, 285, 134, 142, 208, 283, 346, 293, 9, 37, + 38, 57, 97, 98, 99, 280, 323, 326, 327, 280, + 280, 331, 280, 280, 280, 280, 280, 280, 280, 280, + 280, 280, 280, 280, 280, 280, 134, 255, 253, 280, + 259, 150, 302, 134, 134, 248, 280, 300, 248, 262, + 254, 226, 226, 280, 346, 62, 63, 69, 70, 71, + 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 135, 139, 140, 142, 143, 144, 145, 146, 147, + 148, 149, 150, 151, 152, 153, 155, 344, 345, 218, + 223, 299, 219, 224, 255, 143, 249, 250, 262, 270, + 300, 273, 274, 275, 135, 139, 94, 297, 9, 37, + 38, 57, 97, 98, 99, 146, 215, 231, 233, 280, + 297, 299, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, 13, 14, 15, 16, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 46, 50, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 62, 63, 65, 66, + 67, 68, 93, 94, 95, 96, 97, 98, 99, 134, + 135, 137, 138, 141, 153, 156, 306, 345, 348, 349, + 350, 351, 352, 11, 12, 13, 15, 16, 184, 285, + 294, 296, 141, 174, 294, 174, 136, 294, 181, 182, + 280, 137, 138, 294, 174, 216, 146, 231, 299, 4, + 53, 199, 201, 202, 203, 304, 138, 137, 134, 134, + 136, 294, 134, 158, 256, 136, 136, 294, 142, 280, + 280, 280, 142, 142, 280, 142, 142, 142, 142, 142, + 142, 142, 142, 142, 142, 142, 136, 136, 142, 253, + 134, 280, 134, 134, 134, 138, 153, 153, 136, 154, + 221, 94, 43, 45, 143, 225, 225, 134, 251, 136, + 262, 276, 278, 228, 229, 238, 239, 280, 232, 135, + 94, 346, 346, 346, 346, 346, 140, 142, 5, 6, + 7, 175, 176, 297, 137, 140, 137, 140, 138, 142, + 143, 181, 140, 137, 241, 242, 238, 94, 140, 142, + 197, 204, 280, 204, 158, 140, 138, 257, 140, 322, + 142, 136, 136, 328, 330, 142, 303, 334, 336, 338, + 340, 335, 337, 339, 341, 342, 343, 280, 154, 154, + 135, 16, 16, 10, 11, 12, 13, 14, 15, 16, + 65, 66, 67, 68, 135, 137, 144, 145, 297, 307, + 312, 318, 319, 320, 263, 153, 241, 294, 135, 141, + 235, 234, 146, 231, 136, 136, 136, 138, 154, 168, + 295, 297, 297, 297, 142, 171, 166, 171, 181, 9, + 57, 97, 135, 144, 145, 146, 183, 184, 185, 189, + 280, 290, 298, 138, 170, 171, 136, 60, 93, 243, + 245, 246, 146, 231, 200, 204, 205, 138, 285, 324, + 303, 303, 332, 136, 303, 303, 303, 303, 303, 303, + 303, 303, 303, 303, 142, 309, 222, 315, 308, 314, + 313, 139, 10, 135, 267, 274, 277, 136, 140, 240, + 237, 297, 241, 238, 174, 294, 175, 5, 6, 7, + 138, 172, 177, 174, 138, 188, 71, 72, 144, 145, + 147, 148, 149, 150, 151, 152, 190, 186, 174, 138, + 217, 142, 285, 238, 199, 249, 136, 285, 329, 136, + 303, 136, 136, 136, 136, 136, 136, 136, 136, 142, + 142, 136, 241, 312, 307, 320, 320, 316, 268, 185, + 279, 135, 241, 142, 236, 135, 136, 137, 8, 9, + 37, 38, 41, 49, 50, 57, 61, 64, 97, 98, + 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 133, 134, 146, 164, 173, 178, 194, + 196, 197, 207, 211, 212, 214, 231, 252, 283, 321, + 141, 137, 185, 187, 185, 137, 225, 244, 95, 96, + 135, 260, 264, 271, 272, 325, 142, 333, 11, 11, + 136, 136, 310, 286, 241, 154, 230, 136, 237, 346, + 171, 146, 283, 285, 3, 4, 40, 191, 192, 197, + 211, 214, 283, 64, 146, 231, 135, 50, 135, 238, + 254, 254, 164, 211, 214, 226, 226, 231, 226, 223, + 171, 136, 185, 171, 243, 247, 260, 269, 300, 273, + 136, 347, 136, 136, 136, 142, 309, 140, 136, 241, + 236, 136, 138, 238, 223, 134, 137, 141, 193, 280, + 280, 193, 280, 3, 4, 40, 192, 226, 226, 238, + 8, 211, 283, 346, 134, 134, 254, 226, 226, 138, + 138, 249, 136, 260, 136, 349, 311, 138, 135, 43, + 266, 136, 346, 347, 193, 193, 193, 136, 136, 134, + 261, 307, 317, 138, 134, 134, 267, 312, 347, 136, + 134 +}; + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab + + +/* Like YYERROR except do call yyerror. This remains here temporarily + to ease the transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ + +#define YYFAIL goto yyerrlab + +#define YYRECOVERING() (!!yyerrstatus) + +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + yytoken = YYTRANSLATE (yychar); \ + YYPOPSTACK (1); \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ +while (YYID (0)) + + +#define YYTERROR 1 +#define YYERRCODE 256 + + +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) +#ifndef YYLLOC_DEFAULT +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) +#endif + + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + +/* YYLEX -- calling `yylex' with the right arguments. */ + +#ifdef YYLEX_PARAM +# define YYLEX yylex (YYLEX_PARAM) +#else +# define YYLEX yylex () +#endif + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (YYID (0)) + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +#else +static void +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; +#endif +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (YYID (0)) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) +#else +static void +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; + int yyrule; +#endif +{ + int yynrhs = yyr2[yyrule]; + int yyi; + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). + + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ + +#ifndef YYMAXDEPTH +# define YYMAXDEPTH 10000 +#endif + + + +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static YYSIZE_T +yystrlen (const char *yystr) +#else +static YYSIZE_T +yystrlen (yystr) + const char *yystr; +#endif +{ + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif + +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static char * +yystpcpy (char *yydest, const char *yysrc) +#else +static char * +yystpcpy (yydest, yysrc) + char *yydest; + const char *yysrc; +#endif +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return yystpcpy (yyres, yystr) - yyres; +} +# endif + +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) +{ + int yyn = yypact[yystate]; + + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; + else + { + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; + } +} +#endif /* YYERROR_VERBOSE */ + + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +#else +static void +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; +#endif +{ + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + switch (yytype) + { + + default: + break; + } +} + +/* Prevent warnings from -Wmissing-prototypes. */ +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int yyparse (void *YYPARSE_PARAM); +#else +int yyparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int yyparse (void); +#else +int yyparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + + +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Number of syntax errors so far. */ +int yynerrs; + + + +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ + +#ifdef YYPARSE_PARAM +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif +#else /* ! YYPARSE_PARAM */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void) +#else +int +yyparse () + +#endif +#endif +{ + + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + + goto yysetstate; + +/*------------------------------------------------------------. +| yynewstate -- Push a new state, which is found in yystate. | +`------------------------------------------------------------*/ + yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; + + yysetstate: + *yyssp = yystate; + + if (yyss + yystacksize - 1 <= yyssp) + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = yyssp - yyss + 1; + +#ifdef yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; + } +#else /* no yyoverflow */ +# ifndef YYSTACK_RELOCATE + goto yyexhaustedlab; +# else + /* Extend the stack our own way. */ + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; + yystacksize *= 2; + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; + + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long int) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; + } + + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; + + goto yybackup; + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ + + /* First try to decide what to do without reference to lookahead token. */ + yyn = yypact[yystate]; + if (yyn == YYPACT_NINF) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + if (yychar == YYEMPTY) + { + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = YYLEX; + } + + if (yychar <= YYEOF) + { + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); + } + else + { + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + } + + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + goto yydefault; + yyn = yytable[yyn]; + if (yyn <= 0) + { + if (yyn == 0 || yyn == YYTABLE_NINF) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; + + /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token. */ + yychar = YYEMPTY; + + yystate = yyn; + *++yyvsp = yylval; + + goto yynewstate; + + +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + goto yyreduce; + + +/*-----------------------------. +| yyreduce -- Do a reduction. | +`-----------------------------*/ +yyreduce: + /* yyn is the number of a rule to reduce with. */ + yylen = yyr2[yyn]; + + /* If YYLEN is nonzero, implement the default value of the action: + `$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 3: + +/* Line 1455 of yacc.c */ +#line 1333 "vtkParse.y" + { startSig(); clearTypeId(); clearTemplate(); closeComment(); } + break; + + case 14: + +/* Line 1455 of yacc.c */ +#line 1346 "vtkParse.y" + { output_function(); } + break; + + case 15: + +/* Line 1455 of yacc.c */ +#line 1347 "vtkParse.y" + { output_function(); } + break; + + case 16: + +/* Line 1455 of yacc.c */ +#line 1348 "vtkParse.y" + { reject_function(); } + break; + + case 17: + +/* Line 1455 of yacc.c */ +#line 1349 "vtkParse.y" + { output_function(); } + break; + + case 18: + +/* Line 1455 of yacc.c */ +#line 1350 "vtkParse.y" + { reject_function(); } + break; + + case 19: + +/* Line 1455 of yacc.c */ +#line 1351 "vtkParse.y" + { output_function(); } + break; + + case 20: + +/* Line 1455 of yacc.c */ +#line 1352 "vtkParse.y" + { legacySig(); output_function(); } + break; + + case 28: + +/* Line 1455 of yacc.c */ +#line 1370 "vtkParse.y" + { pushNamespace((yyvsp[(2) - (2)].str)); } + break; + + case 29: + +/* Line 1455 of yacc.c */ +#line 1371 "vtkParse.y" + { popNamespace(); } + break; + + case 31: + +/* Line 1455 of yacc.c */ +#line 1378 "vtkParse.y" + { start_class((yyvsp[(2) - (2)].str), 0); } + break; + + case 32: + +/* Line 1455 of yacc.c */ +#line 1379 "vtkParse.y" + { end_class(); } + break; + + case 33: + +/* Line 1455 of yacc.c */ +#line 1380 "vtkParse.y" + { reject_class((yyvsp[(2) - (5)].str), 0); } + break; + + case 34: + +/* Line 1455 of yacc.c */ +#line 1381 "vtkParse.y" + { end_class(); } + break; + + case 35: + +/* Line 1455 of yacc.c */ +#line 1382 "vtkParse.y" + { start_class((yyvsp[(2) - (2)].str), 1); } + break; + + case 36: + +/* Line 1455 of yacc.c */ +#line 1383 "vtkParse.y" + { end_class(); } + break; + + case 37: + +/* Line 1455 of yacc.c */ +#line 1384 "vtkParse.y" + { reject_class((yyvsp[(2) - (5)].str), 1); } + break; + + case 38: + +/* Line 1455 of yacc.c */ +#line 1385 "vtkParse.y" + { end_class(); } + break; + + case 40: + +/* Line 1455 of yacc.c */ +#line 1387 "vtkParse.y" + { start_class((yyvsp[(2) - (2)].str), 2); } + break; + + case 41: + +/* Line 1455 of yacc.c */ +#line 1388 "vtkParse.y" + { end_class(); } + break; + + case 42: + +/* Line 1455 of yacc.c */ +#line 1389 "vtkParse.y" + { reject_class((yyvsp[(2) - (5)].str), 2); } + break; + + case 43: + +/* Line 1455 of yacc.c */ +#line 1390 "vtkParse.y" + { end_class(); } + break; + + case 46: + +/* Line 1455 of yacc.c */ +#line 1395 "vtkParse.y" + { startSig(); clearTypeId(); clearTemplate(); closeComment(); } + break; + + case 58: + +/* Line 1455 of yacc.c */ +#line 1409 "vtkParse.y" + { output_function(); } + break; + + case 59: + +/* Line 1455 of yacc.c */ +#line 1410 "vtkParse.y" + { ClassInfo *tmpc = currentClass; + currentClass = NULL; output_function(); currentClass = tmpc; } + break; + + case 60: + +/* Line 1455 of yacc.c */ +#line 1412 "vtkParse.y" + { output_function(); } + break; + + case 61: + +/* Line 1455 of yacc.c */ +#line 1413 "vtkParse.y" + { output_function(); } + break; + + case 62: + +/* Line 1455 of yacc.c */ +#line 1414 "vtkParse.y" + { ClassInfo *tmpc = currentClass; + currentClass = NULL; output_function(); currentClass = tmpc; } + break; + + case 63: + +/* Line 1455 of yacc.c */ +#line 1416 "vtkParse.y" + { output_function(); } + break; + + case 64: + +/* Line 1455 of yacc.c */ +#line 1417 "vtkParse.y" + { legacySig(); output_function(); } + break; + + case 75: + +/* Line 1455 of yacc.c */ +#line 1430 "vtkParse.y" + { + vtkParse_AddStringToArray(¤tClass->SuperClasses, + ¤tClass->NumberOfSuperClasses, + vtkstrdup((yyvsp[(2) - (2)].str))); + } + break; + + case 76: + +/* Line 1455 of yacc.c */ +#line 1436 "vtkParse.y" + {access_level = VTK_ACCESS_PUBLIC;} + break; + + case 77: + +/* Line 1455 of yacc.c */ +#line 1437 "vtkParse.y" + {access_level = VTK_ACCESS_PRIVATE;} + break; + + case 78: + +/* Line 1455 of yacc.c */ +#line 1438 "vtkParse.y" + {access_level = VTK_ACCESS_PROTECTED;} + break; + + case 79: + +/* Line 1455 of yacc.c */ +#line 1448 "vtkParse.y" + {start_enum((yyvsp[(2) - (2)].str));} + break; + + case 80: + +/* Line 1455 of yacc.c */ +#line 1449 "vtkParse.y" + {end_enum();} + break; + + case 81: + +/* Line 1455 of yacc.c */ +#line 1450 "vtkParse.y" + {start_enum(NULL);} + break; + + case 82: + +/* Line 1455 of yacc.c */ +#line 1451 "vtkParse.y" + {end_enum();} + break; + + case 86: + +/* Line 1455 of yacc.c */ +#line 1455 "vtkParse.y" + {add_enum((yyvsp[(1) - (1)].str), NULL);} + break; + + case 87: + +/* Line 1455 of yacc.c */ +#line 1456 "vtkParse.y" + {add_enum((yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str));} + break; + + case 88: + +/* Line 1455 of yacc.c */ +#line 1458 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 89: + +/* Line 1455 of yacc.c */ +#line 1459 "vtkParse.y" + {(yyval.str) = vtkstrdup(add_const_scope((yyvsp[(1) - (1)].str)));} + break; + + case 97: + +/* Line 1455 of yacc.c */ +#line 1464 "vtkParse.y" + { (yyval.str) = (yyvsp[(1) - (1)].str); } + break; + + case 98: + +/* Line 1455 of yacc.c */ +#line 1465 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 99: + +/* Line 1455 of yacc.c */ +#line 1466 "vtkParse.y" + { + (yyval.str) = vtkstrcat((yyvsp[(1) - (3)].str), (yyvsp[(3) - (3)].str)); + } + break; + + case 100: + +/* Line 1455 of yacc.c */ +#line 1469 "vtkParse.y" + {postSig((yyvsp[(2) - (2)].str));} + break; + + case 101: + +/* Line 1455 of yacc.c */ +#line 1470 "vtkParse.y" + { + (yyval.str) = vtkstrcat5((yyvsp[(1) - (4)].str), " ", (yyvsp[(2) - (4)].str), " ", (yyvsp[(4) - (4)].str)); + } + break; + + case 102: + +/* Line 1455 of yacc.c */ +#line 1473 "vtkParse.y" + {postSig("(");} + break; + + case 103: + +/* Line 1455 of yacc.c */ +#line 1474 "vtkParse.y" + { + (yyval.str) = vtkstrcat3("(", (yyvsp[(3) - (4)].str), ")"); + } + break; + + case 104: + +/* Line 1455 of yacc.c */ +#line 1478 "vtkParse.y" + { (yyval.str) = "-"; } + break; + + case 105: + +/* Line 1455 of yacc.c */ +#line 1478 "vtkParse.y" + { (yyval.str) = "+"; } + break; + + case 106: + +/* Line 1455 of yacc.c */ +#line 1479 "vtkParse.y" + { (yyval.str) = "~"; } + break; + + case 107: + +/* Line 1455 of yacc.c */ +#line 1481 "vtkParse.y" + { (yyval.str) = "-"; } + break; + + case 108: + +/* Line 1455 of yacc.c */ +#line 1481 "vtkParse.y" + { (yyval.str) = "+"; } + break; + + case 109: + +/* Line 1455 of yacc.c */ +#line 1482 "vtkParse.y" + { (yyval.str) = "*"; } + break; + + case 110: + +/* Line 1455 of yacc.c */ +#line 1482 "vtkParse.y" + { (yyval.str) = "/"; } + break; + + case 111: + +/* Line 1455 of yacc.c */ +#line 1483 "vtkParse.y" + { (yyval.str) = "%"; } + break; + + case 112: + +/* Line 1455 of yacc.c */ +#line 1483 "vtkParse.y" + { (yyval.str) = "&"; } + break; + + case 113: + +/* Line 1455 of yacc.c */ +#line 1484 "vtkParse.y" + { (yyval.str) = "|"; } + break; + + case 114: + +/* Line 1455 of yacc.c */ +#line 1484 "vtkParse.y" + { (yyval.str) = "^"; } + break; + + case 115: + +/* Line 1455 of yacc.c */ +#line 1485 "vtkParse.y" + { (yyval.str) = ">>"; } + break; + + case 116: + +/* Line 1455 of yacc.c */ +#line 1486 "vtkParse.y" + { (yyval.str) = "<<"; } + break; + + case 126: + +/* Line 1455 of yacc.c */ +#line 1509 "vtkParse.y" + { + ValueInfo *item = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(item); + item->ItemType = VTK_TYPEDEF_INFO; + item->Access = access_level; + + handle_complex_type(item, (yyvsp[(2) - (4)].integer), (yyvsp[(3) - (4)].integer), getSig()); + + if (getVarName()) + { + item->Name = vtkstrdup(getVarName()); + } + + if (currentClass) + { + vtkParse_AddTypedefToClass(currentClass, item); + } + else + { + vtkParse_AddTypedefToNamespace(currentNamespace, item); + } + } + break; + + case 127: + +/* Line 1455 of yacc.c */ +#line 1531 "vtkParse.y" + { } + break; + + case 128: + +/* Line 1455 of yacc.c */ +#line 1532 "vtkParse.y" + { } + break; + + case 129: + +/* Line 1455 of yacc.c */ +#line 1533 "vtkParse.y" + { } + break; + + case 130: + +/* Line 1455 of yacc.c */ +#line 1535 "vtkParse.y" + { } + break; + + case 131: + +/* Line 1455 of yacc.c */ +#line 1542 "vtkParse.y" + { add_using((yyvsp[(3) - (4)].str), 1); } + break; + + case 132: + +/* Line 1455 of yacc.c */ +#line 1543 "vtkParse.y" + { add_using((yyvsp[(3) - (4)].str), 0); } + break; + + case 133: + +/* Line 1455 of yacc.c */ +#line 1544 "vtkParse.y" + { add_using((yyvsp[(2) - (3)].str), 0); } + break; + + case 134: + +/* Line 1455 of yacc.c */ +#line 1551 "vtkParse.y" + { postSig("template<> "); clearTypeId(); } + break; + + case 135: + +/* Line 1455 of yacc.c */ +#line 1552 "vtkParse.y" + { postSig("template<"); + clearTypeId(); startTemplate(); } + break; + + case 136: + +/* Line 1455 of yacc.c */ +#line 1554 "vtkParse.y" + { chopSig(); + if (getSig()[strlen(getSig())-1] == '>') { postSig(" "); } + postSig("> "); clearTypeId(); } + break; + + case 138: + +/* Line 1455 of yacc.c */ +#line 1559 "vtkParse.y" + { chopSig(); postSig(", "); clearTypeId(); } + break; + + case 140: + +/* Line 1455 of yacc.c */ +#line 1563 "vtkParse.y" + { + TemplateArg *arg = (TemplateArg *)malloc(sizeof(TemplateArg)); + vtkParse_InitTemplateArg(arg); + arg->Type = (yyvsp[(1) - (2)].integer); + arg->Class = vtkstrdup(getTypeId()); + arg->Name = vtkstrdup(getVarName()); + arg->Value = vtkstrdup(getVarValue()); + vtkParse_AddArgumentToTemplate(currentTemplate, arg); + } + break; + + case 141: + +/* Line 1455 of yacc.c */ +#line 1573 "vtkParse.y" + { + TemplateArg *arg = (TemplateArg *)malloc(sizeof(TemplateArg)); + vtkParse_InitTemplateArg(arg); + arg->Name = vtkstrdup(getVarName()); + arg->Value = vtkstrdup(getVarValue()); + vtkParse_AddArgumentToTemplate(currentTemplate, arg); + } + break; + + case 142: + +/* Line 1455 of yacc.c */ +#line 1580 "vtkParse.y" + { pushTemplate(); } + break; + + case 143: + +/* Line 1455 of yacc.c */ +#line 1581 "vtkParse.y" + { + TemplateArgs *newTemplate = currentTemplate; + TemplateArg *arg = (TemplateArg *)malloc(sizeof(TemplateArg)); + vtkParse_InitTemplateArg(arg); + popTemplate(); + arg->Template = newTemplate; + arg->Name = vtkstrdup(getVarName()); + arg->Value = vtkstrdup(getVarValue()); + vtkParse_AddArgumentToTemplate(currentTemplate, arg); + } + break; + + case 144: + +/* Line 1455 of yacc.c */ +#line 1592 "vtkParse.y" + {postSig("class ");} + break; + + case 145: + +/* Line 1455 of yacc.c */ +#line 1593 "vtkParse.y" + {postSig("typename ");} + break; + + case 147: + +/* Line 1455 of yacc.c */ +#line 1595 "vtkParse.y" + { setVarName((yyvsp[(1) - (1)].str)); } + break; + + case 163: + +/* Line 1455 of yacc.c */ +#line 1625 "vtkParse.y" + {openSig(); preSig("~"); closeSig();} + break; + + case 164: + +/* Line 1455 of yacc.c */ +#line 1626 "vtkParse.y" + {openSig(); preSig("~"); closeSig();} + break; + + case 165: + +/* Line 1455 of yacc.c */ +#line 1628 "vtkParse.y" + { + openSig(); preSig("virtual ~"); closeSig(); + currentFunction->IsVirtual = 1; + } + break; + + case 168: + +/* Line 1455 of yacc.c */ +#line 1635 "vtkParse.y" + { + openSig(); + preSig("explicit "); + closeSig(); + currentFunction->IsExplicit = 1; + } + break; + + case 170: + +/* Line 1455 of yacc.c */ +#line 1643 "vtkParse.y" + { + openSig(); + preSig("virtual "); + closeSig(); + currentFunction->IsVirtual = 1; + } + break; + + case 178: + +/* Line 1455 of yacc.c */ +#line 1659 "vtkParse.y" + { + openSig(); + preSig("virtual "); + closeSig(); + currentFunction->IsVirtual = 1; + } + break; + + case 179: + +/* Line 1455 of yacc.c */ +#line 1668 "vtkParse.y" + { + postSig("("); + set_return(currentFunction, getStorageType(), getTypeId(), 0); + } + break; + + case 180: + +/* Line 1455 of yacc.c */ +#line 1672 "vtkParse.y" + { postSig(")"); } + break; + + case 181: + +/* Line 1455 of yacc.c */ +#line 1673 "vtkParse.y" + { + (yyval.integer) = (yyvsp[(2) - (8)].integer); + postSig(";"); + preSig("operator "); + closeSig(); + currentFunction->IsOperator = 1; + currentFunction->Name = "operator typecast"; + currentFunction->Comment = vtkstrdup(getComment()); + vtkParseDebug("Parsed operator", "operator typecast"); + } + break; + + case 182: + +/* Line 1455 of yacc.c */ +#line 1684 "vtkParse.y" + { postSig(")"); } + break; + + case 183: + +/* Line 1455 of yacc.c */ +#line 1685 "vtkParse.y" + { + postSig(";"); + closeSig(); + currentFunction->Name = vtkstrdup((yyvsp[(1) - (3)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + vtkParseDebug("Parsed operator", currentFunction->Name); + } + break; + + case 184: + +/* Line 1455 of yacc.c */ +#line 1693 "vtkParse.y" + {postSig((yyvsp[(2) - (2)].str));} + break; + + case 185: + +/* Line 1455 of yacc.c */ +#line 1694 "vtkParse.y" + { + postSig("("); + currentFunction->IsOperator = 1; + set_return(currentFunction, getStorageType(), getTypeId(), 0); + } + break; + + case 186: + +/* Line 1455 of yacc.c */ +#line 1699 "vtkParse.y" + { (yyval.str) = (yyvsp[(2) - (7)].str); } + break; + + case 187: + +/* Line 1455 of yacc.c */ +#line 1701 "vtkParse.y" + { postSig(")"); } + break; + + case 188: + +/* Line 1455 of yacc.c */ +#line 1702 "vtkParse.y" + { + postSig(";"); + closeSig(); + currentFunction->Name = vtkstrdup((yyvsp[(1) - (3)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + vtkParseDebug("Parsed func", currentFunction->Name); + } + break; + + case 190: + +/* Line 1455 of yacc.c */ +#line 1712 "vtkParse.y" + { + postSig(" = 0"); + if (currentClass) + { + currentFunction->IsPureVirtual = 1; + currentClass->IsAbstract = 1; + } + } + break; + + case 191: + +/* Line 1455 of yacc.c */ +#line 1721 "vtkParse.y" + { + postSig(" const = 0"); + currentFunction->IsConst = 1; + if (currentClass) + { + currentFunction->IsPureVirtual = 1; + currentClass->IsAbstract = 1; + } + } + break; + + case 192: + +/* Line 1455 of yacc.c */ +#line 1731 "vtkParse.y" + { + postSig(" const"); + currentFunction->IsConst = 1; + } + break; + + case 195: + +/* Line 1455 of yacc.c */ +#line 1739 "vtkParse.y" + { + postSig("("); + set_return(currentFunction, getStorageType(), getTypeId(), 0); + } + break; + + case 196: + +/* Line 1455 of yacc.c */ +#line 1742 "vtkParse.y" + { (yyval.str) = (yyvsp[(1) - (5)].str); } + break; + + case 197: + +/* Line 1455 of yacc.c */ +#line 1743 "vtkParse.y" + {markSig(); postSig("<");} + break; + + case 198: + +/* Line 1455 of yacc.c */ +#line 1744 "vtkParse.y" + { + if (getSig()[strlen(getSig())-1] == '>') { postSig(" "); } + postSig(">("); + set_return(currentFunction, getStorageType(), getTypeId(), 0); + (yyval.str) = vtkstrcat((yyvsp[(1) - (6)].str), copySig()); + } + break; + + case 199: + +/* Line 1455 of yacc.c */ +#line 1749 "vtkParse.y" + { (yyval.str) = (yyvsp[(7) - (9)].str); } + break; + + case 200: + +/* Line 1455 of yacc.c */ +#line 1751 "vtkParse.y" + { postSig(");"); closeSig(); } + break; + + case 201: + +/* Line 1455 of yacc.c */ +#line 1752 "vtkParse.y" + { + currentFunction->Name = vtkstrdup((yyvsp[(1) - (3)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + vtkParseDebug("Parsed func", currentFunction->Name); + } + break; + + case 202: + +/* Line 1455 of yacc.c */ +#line 1758 "vtkParse.y" + { postSig("("); } + break; + + case 209: + +/* Line 1455 of yacc.c */ +#line 1767 "vtkParse.y" + { + postSig(");"); + closeSig(); + currentFunction->Name = vtkstrcat("~", (yyvsp[(1) - (1)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + vtkParseDebug("Parsed func", currentFunction->Name); + } + break; + + case 210: + +/* Line 1455 of yacc.c */ +#line 1775 "vtkParse.y" + { postSig("(");} + break; + + case 213: + +/* Line 1455 of yacc.c */ +#line 1781 "vtkParse.y" + {clearTypeId();} + break; + + case 215: + +/* Line 1455 of yacc.c */ +#line 1784 "vtkParse.y" + { currentFunction->IsVariadic = 1; postSig("..."); } + break; + + case 216: + +/* Line 1455 of yacc.c */ +#line 1785 "vtkParse.y" + { clearTypeId(); } + break; + + case 217: + +/* Line 1455 of yacc.c */ +#line 1786 "vtkParse.y" + { clearTypeId(); postSig(", "); } + break; + + case 219: + +/* Line 1455 of yacc.c */ +#line 1789 "vtkParse.y" + { markSig(); } + break; + + case 220: + +/* Line 1455 of yacc.c */ +#line 1791 "vtkParse.y" + { + int i = currentFunction->NumberOfArguments; + ValueInfo *arg = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(arg); + + handle_complex_type(arg, (yyvsp[(2) - (3)].integer), (yyvsp[(3) - (3)].integer), copySig()); + + if (i < MAX_ARGS) + { + currentFunction->ArgTypes[i] = arg->Type; + currentFunction->ArgClasses[i] = arg->Class; + currentFunction->ArgCounts[i] = arg->Count; + } + + if (getVarName()) + { + arg->Name = vtkstrdup(getVarName()); + } + + vtkParse_AddArgumentToFunction(currentFunction, arg); + } + break; + + case 221: + +/* Line 1455 of yacc.c */ +#line 1813 "vtkParse.y" + { + int i = currentFunction->NumberOfArguments-1; + if (getVarValue()) + { + currentFunction->Arguments[i]->Value = vtkstrdup(getVarValue()); + } + } + break; + + case 222: + +/* Line 1455 of yacc.c */ +#line 1821 "vtkParse.y" + { + int i = currentFunction->NumberOfArguments; + ValueInfo *arg = (ValueInfo *)malloc(sizeof(ValueInfo)); + + vtkParse_InitValue(arg); + + markSig(); + postSig("void (*"); + postSig((yyvsp[(1) - (1)].str)); + postSig(")(void *) "); + + handle_function_type(arg, (yyvsp[(1) - (1)].str), copySig()); + + if (i < MAX_ARGS) + { + currentFunction->ArgTypes[i] = arg->Type; + currentFunction->ArgClasses[i] = arg->Class; + currentFunction->ArgCounts[i] = arg->Count; + } + + vtkParse_AddArgumentToFunction(currentFunction, arg); + } + break; + + case 225: + +/* Line 1455 of yacc.c */ +#line 1846 "vtkParse.y" + {clearVarValue();} + break; + + case 227: + +/* Line 1455 of yacc.c */ +#line 1848 "vtkParse.y" + { postSig("="); clearVarValue();} + break; + + case 228: + +/* Line 1455 of yacc.c */ +#line 1849 "vtkParse.y" + { setVarValue((yyvsp[(3) - (3)].str)); } + break; + + case 232: + +/* Line 1455 of yacc.c */ +#line 1860 "vtkParse.y" + { + unsigned int type = getStorageType(); + ValueInfo *var = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(var); + var->ItemType = VTK_VARIABLE_INFO; + var->Access = access_level; + + handle_complex_type(var, type, (yyvsp[(1) - (2)].integer), getSig()); + + var->Name = vtkstrdup(getVarName()); + + if (getVarValue()) + { + var->Value = vtkstrdup(getVarValue()); + } + + if ((var->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_FUNCTION) + { + var->Type = var->Type; + } + + /* Is this a constant? */ + if (((type & VTK_PARSE_CONST) != 0) && var->Value != NULL && + (((type & VTK_PARSE_INDIRECT) == 0) || + ((type & VTK_PARSE_INDIRECT) == VTK_PARSE_ARRAY))) + { + var->ItemType = VTK_CONSTANT_INFO; + if (currentClass) + { + vtkParse_AddConstantToClass(currentClass, var); + } + else + { + vtkParse_AddConstantToNamespace(currentNamespace, var); + } + } + /* This is a true variable i.e. not constant */ + else + { + if (currentClass) + { + vtkParse_AddVariableToClass(currentClass, var); + } + else + { + vtkParse_AddVariableToNamespace(currentNamespace, var); + } + } + } + break; + + case 236: + +/* Line 1455 of yacc.c */ +#line 1914 "vtkParse.y" + {postSig(", ");} + break; + + case 238: + +/* Line 1455 of yacc.c */ +#line 1917 "vtkParse.y" + { setStorageTypeIndirection(0); } + break; + + case 240: + +/* Line 1455 of yacc.c */ +#line 1918 "vtkParse.y" + { setStorageTypeIndirection((yyvsp[(1) - (1)].integer)); } + break; + + case 242: + +/* Line 1455 of yacc.c */ +#line 1922 "vtkParse.y" + { (yyval.integer) = 0; } + break; + + case 243: + +/* Line 1455 of yacc.c */ +#line 1923 "vtkParse.y" + { postSig(")"); } + break; + + case 244: + +/* Line 1455 of yacc.c */ +#line 1925 "vtkParse.y" + { + const char *scope = getScope(); + unsigned int parens = add_indirection((yyvsp[(1) - (5)].integer), (yyvsp[(2) - (5)].integer)); + if ((yyvsp[(5) - (5)].integer) == VTK_PARSE_FUNCTION) { + if (scope) { scope = vtkstrndup(scope, strlen(scope) - 2); } + getFunction()->Class = scope; + (yyval.integer) = (parens | VTK_PARSE_FUNCTION); } + else if ((yyvsp[(5) - (5)].integer) == VTK_PARSE_ARRAY) { + (yyval.integer) = add_indirection_to_array(parens); } + } + break; + + case 245: + +/* Line 1455 of yacc.c */ +#line 1937 "vtkParse.y" + { (yyval.integer) = 0; } + break; + + case 246: + +/* Line 1455 of yacc.c */ +#line 1938 "vtkParse.y" + { postSig(")"); } + break; + + case 247: + +/* Line 1455 of yacc.c */ +#line 1940 "vtkParse.y" + { + const char *scope = getScope(); + unsigned int parens = add_indirection((yyvsp[(1) - (5)].integer), (yyvsp[(2) - (5)].integer)); + if ((yyvsp[(5) - (5)].integer) == VTK_PARSE_FUNCTION) { + if (scope) { scope = vtkstrndup(scope, strlen(scope) - 2); } + getFunction()->Class = scope; + (yyval.integer) = (parens | VTK_PARSE_FUNCTION); } + else if ((yyvsp[(5) - (5)].integer) == VTK_PARSE_ARRAY) { + (yyval.integer) = add_indirection_to_array(parens); } + } + break; + + case 248: + +/* Line 1455 of yacc.c */ +#line 1951 "vtkParse.y" + { postSig("("); scopeSig(""); (yyval.integer) = 0; } + break; + + case 249: + +/* Line 1455 of yacc.c */ +#line 1952 "vtkParse.y" + { postSig("("); scopeSig((yyvsp[(1) - (1)].str)); postSig("*"); + (yyval.integer) = VTK_PARSE_POINTER; } + break; + + case 250: + +/* Line 1455 of yacc.c */ +#line 1954 "vtkParse.y" + { postSig("("); scopeSig((yyvsp[(1) - (1)].str)); postSig("&"); + (yyval.integer) = VTK_PARSE_REF; } + break; + + case 251: + +/* Line 1455 of yacc.c */ +#line 1957 "vtkParse.y" + { postSig("("); scopeSig((yyvsp[(1) - (1)].str)); postSig("*"); + (yyval.integer) = VTK_PARSE_POINTER; } + break; + + case 252: + +/* Line 1455 of yacc.c */ +#line 1959 "vtkParse.y" + { postSig("("); scopeSig((yyvsp[(1) - (1)].str)); postSig("&"); + (yyval.integer) = VTK_PARSE_REF; } + break; + + case 254: + +/* Line 1455 of yacc.c */ +#line 1962 "vtkParse.y" + { currentFunction->IsConst = 1; } + break; + + case 255: + +/* Line 1455 of yacc.c */ +#line 1964 "vtkParse.y" + { (yyval.integer) = 0; } + break; + + case 256: + +/* Line 1455 of yacc.c */ +#line 1965 "vtkParse.y" + { pushFunction(); postSig("("); } + break; + + case 257: + +/* Line 1455 of yacc.c */ +#line 1966 "vtkParse.y" + { (yyval.integer) = VTK_PARSE_FUNCTION; postSig(")"); popFunction(); } + break; + + case 258: + +/* Line 1455 of yacc.c */ +#line 1967 "vtkParse.y" + { (yyval.integer) = VTK_PARSE_ARRAY; } + break; + + case 259: + +/* Line 1455 of yacc.c */ +#line 1970 "vtkParse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer); } + break; + + case 260: + +/* Line 1455 of yacc.c */ +#line 1972 "vtkParse.y" + { (yyval.integer) = add_indirection((yyvsp[(1) - (2)].integer), (yyvsp[(2) - (2)].integer));} + break; + + case 261: + +/* Line 1455 of yacc.c */ +#line 1975 "vtkParse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer); } + break; + + case 262: + +/* Line 1455 of yacc.c */ +#line 1977 "vtkParse.y" + { (yyval.integer) = add_indirection((yyvsp[(1) - (2)].integer), (yyvsp[(2) - (2)].integer));} + break; + + case 263: + +/* Line 1455 of yacc.c */ +#line 1979 "vtkParse.y" + {clearVarName(); chopSig();} + break; + + case 265: + +/* Line 1455 of yacc.c */ +#line 1981 "vtkParse.y" + {setVarName((yyvsp[(1) - (1)].str));} + break; + + case 266: + +/* Line 1455 of yacc.c */ +#line 1983 "vtkParse.y" + {clearArray();} + break; + + case 268: + +/* Line 1455 of yacc.c */ +#line 1985 "vtkParse.y" + {clearArray();} + break; + + case 270: + +/* Line 1455 of yacc.c */ +#line 1987 "vtkParse.y" + {postSig("[");} + break; + + case 271: + +/* Line 1455 of yacc.c */ +#line 1987 "vtkParse.y" + {postSig("]");} + break; + + case 274: + +/* Line 1455 of yacc.c */ +#line 1991 "vtkParse.y" + {pushArraySize("");} + break; + + case 275: + +/* Line 1455 of yacc.c */ +#line 1992 "vtkParse.y" + {pushArraySize((yyvsp[(1) - (1)].str));} + break; + + case 276: + +/* Line 1455 of yacc.c */ +#line 1998 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 277: + +/* Line 1455 of yacc.c */ +#line 1999 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 278: + +/* Line 1455 of yacc.c */ +#line 2000 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 279: + +/* Line 1455 of yacc.c */ +#line 2001 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 280: + +/* Line 1455 of yacc.c */ +#line 2002 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 281: + +/* Line 1455 of yacc.c */ +#line 2003 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 282: + +/* Line 1455 of yacc.c */ +#line 2004 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 283: + +/* Line 1455 of yacc.c */ +#line 2005 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 284: + +/* Line 1455 of yacc.c */ +#line 2006 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 285: + +/* Line 1455 of yacc.c */ +#line 2009 "vtkParse.y" + {(yyval.str) = "vtkTypeInt8";} + break; + + case 286: + +/* Line 1455 of yacc.c */ +#line 2010 "vtkParse.y" + {(yyval.str) = "vtkTypeUInt8";} + break; + + case 287: + +/* Line 1455 of yacc.c */ +#line 2011 "vtkParse.y" + {(yyval.str) = "vtkTypeInt16";} + break; + + case 288: + +/* Line 1455 of yacc.c */ +#line 2012 "vtkParse.y" + {(yyval.str) = "vtkTypeUInt16";} + break; + + case 289: + +/* Line 1455 of yacc.c */ +#line 2013 "vtkParse.y" + {(yyval.str) = "vtkTypeInt32";} + break; + + case 290: + +/* Line 1455 of yacc.c */ +#line 2014 "vtkParse.y" + {(yyval.str) = "vtkTypeUInt32";} + break; + + case 291: + +/* Line 1455 of yacc.c */ +#line 2015 "vtkParse.y" + {(yyval.str) = "vtkTypeInt64";} + break; + + case 292: + +/* Line 1455 of yacc.c */ +#line 2016 "vtkParse.y" + {(yyval.str) = "vtkTypeUInt64";} + break; + + case 293: + +/* Line 1455 of yacc.c */ +#line 2017 "vtkParse.y" + {(yyval.str) = "vtkTypeFloat32";} + break; + + case 294: + +/* Line 1455 of yacc.c */ +#line 2018 "vtkParse.y" + {(yyval.str) = "vtkTypeFloat64";} + break; + + case 295: + +/* Line 1455 of yacc.c */ +#line 2021 "vtkParse.y" + {(yyval.str) = "vtkIdType";} + break; + + case 296: + +/* Line 1455 of yacc.c */ +#line 2022 "vtkParse.y" + {(yyval.str) = "vtkFloatingPointType";} + break; + + case 297: + +/* Line 1455 of yacc.c */ +#line 2029 "vtkParse.y" + {(yyval.integer) = (yyvsp[(1) - (1)].integer); setStorageType((yyval.integer));} + break; + + case 298: + +/* Line 1455 of yacc.c */ +#line 2030 "vtkParse.y" + {(yyval.integer) = (yyvsp[(2) - (2)].integer); setStorageType((yyval.integer));} + break; + + case 299: + +/* Line 1455 of yacc.c */ +#line 2031 "vtkParse.y" + {(yyval.integer) = (yyvsp[(2) - (2)].integer); setStorageType((yyval.integer));} + break; + + case 300: + +/* Line 1455 of yacc.c */ +#line 2033 "vtkParse.y" + {(yyval.integer) = (yyvsp[(3) - (3)].integer); setStorageType((yyval.integer));} + break; + + case 301: + +/* Line 1455 of yacc.c */ +#line 2034 "vtkParse.y" + {(yyval.integer) = (yyvsp[(2) - (2)].integer); setStorageType((yyval.integer));} + break; + + case 302: + +/* Line 1455 of yacc.c */ +#line 2035 "vtkParse.y" + {(yyval.integer) = ((yyvsp[(1) - (2)].integer) | (yyvsp[(2) - (2)].integer)); + setStorageType((yyval.integer));} + break; + + case 303: + +/* Line 1455 of yacc.c */ +#line 2037 "vtkParse.y" + {(yyval.integer) = ((yyvsp[(2) - (3)].integer) | (yyvsp[(3) - (3)].integer)); + setStorageType((yyval.integer));} + break; + + case 304: + +/* Line 1455 of yacc.c */ +#line 2041 "vtkParse.y" + {postSig("static "); (yyval.integer) = VTK_PARSE_STATIC; } + break; + + case 305: + +/* Line 1455 of yacc.c */ +#line 2042 "vtkParse.y" + {postSig("static "); (yyval.integer) = VTK_PARSE_STATIC; } + break; + + case 306: + +/* Line 1455 of yacc.c */ +#line 2044 "vtkParse.y" + {(yyval.integer) = (yyvsp[(1) - (1)].integer);} + break; + + case 307: + +/* Line 1455 of yacc.c */ +#line 2045 "vtkParse.y" + {(yyval.integer) = ((yyvsp[(1) - (2)].integer) | (yyvsp[(2) - (2)].integer));} + break; + + case 308: + +/* Line 1455 of yacc.c */ +#line 2047 "vtkParse.y" + {(yyval.integer) = (yyvsp[(1) - (1)].integer);} + break; + + case 309: + +/* Line 1455 of yacc.c */ +#line 2048 "vtkParse.y" + {(yyval.integer) = (VTK_PARSE_CONST | (yyvsp[(2) - (2)].integer));} + break; + + case 310: + +/* Line 1455 of yacc.c */ +#line 2049 "vtkParse.y" + {(yyval.integer) = (VTK_PARSE_CONST | (yyvsp[(1) - (2)].integer));} + break; + + case 311: + +/* Line 1455 of yacc.c */ +#line 2051 "vtkParse.y" + {postSig("const ");} + break; + + case 313: + +/* Line 1455 of yacc.c */ +#line 2055 "vtkParse.y" + {postSig(" "); setTypeId((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_UNKNOWN;} + break; + + case 314: + +/* Line 1455 of yacc.c */ +#line 2057 "vtkParse.y" + {postSig(" "); setTypeId((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_UNKNOWN;} + break; + + case 315: + +/* Line 1455 of yacc.c */ +#line 2058 "vtkParse.y" + {postSig("typename ");} + break; + + case 316: + +/* Line 1455 of yacc.c */ +#line 2059 "vtkParse.y" + {postSig(" "); setTypeId((yyvsp[(3) - (3)].str)); (yyval.integer) = VTK_PARSE_UNKNOWN;} + break; + + case 317: + +/* Line 1455 of yacc.c */ +#line 2062 "vtkParse.y" + { markSig(); postSig((yyvsp[(1) - (2)].str)); postSig("<");} + break; + + case 318: + +/* Line 1455 of yacc.c */ +#line 2063 "vtkParse.y" + {chopSig(); if (getSig()[strlen(getSig())-1] == '>') { postSig(" "); } + postSig(">"); (yyval.str) = vtkstrdup(copySig()); clearTypeId();} + break; + + case 319: + +/* Line 1455 of yacc.c */ +#line 2065 "vtkParse.y" + { markSig(); postSig((yyvsp[(1) - (2)].str)); postSig("<");} + break; + + case 320: + +/* Line 1455 of yacc.c */ +#line 2066 "vtkParse.y" + {chopSig(); if (getSig()[strlen(getSig())-1] == '>') { postSig(" "); } + postSig(">"); (yyval.str) = vtkstrdup(copySig()); clearTypeId();} + break; + + case 321: + +/* Line 1455 of yacc.c */ +#line 2068 "vtkParse.y" + { markSig(); postSig((yyvsp[(1) - (2)].str)); postSig("<");} + break; + + case 322: + +/* Line 1455 of yacc.c */ +#line 2069 "vtkParse.y" + {chopSig(); if (getSig()[strlen(getSig())-1] == '>') { postSig(" "); } + postSig(">"); (yyval.str) = vtkstrdup(copySig()); clearTypeId();} + break; + + case 324: + +/* Line 1455 of yacc.c */ +#line 2073 "vtkParse.y" + {chopSig(); postSig(", ");} + break; + + case 327: + +/* Line 1455 of yacc.c */ +#line 2076 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 328: + +/* Line 1455 of yacc.c */ +#line 2078 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 329: + +/* Line 1455 of yacc.c */ +#line 2079 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 330: + +/* Line 1455 of yacc.c */ +#line 2080 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 331: + +/* Line 1455 of yacc.c */ +#line 2081 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 332: + +/* Line 1455 of yacc.c */ +#line 2082 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 333: + +/* Line 1455 of yacc.c */ +#line 2083 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 334: + +/* Line 1455 of yacc.c */ +#line 2084 "vtkParse.y" + {postSig((yyvsp[(1) - (1)].str));} + break; + + case 337: + +/* Line 1455 of yacc.c */ +#line 2089 "vtkParse.y" + { + (yyval.str) = vtkstrcat3((yyvsp[(1) - (3)].str), "::", (yyvsp[(3) - (3)].str)); + preScopeSig((yyvsp[(1) - (3)].str)); + } + break; + + case 338: + +/* Line 1455 of yacc.c */ +#line 2094 "vtkParse.y" + { + (yyval.str) = vtkstrcat3((yyvsp[(1) - (3)].str), "::", (yyvsp[(3) - (3)].str)); + preScopeSig(""); + } + break; + + case 346: + +/* Line 1455 of yacc.c */ +#line 2116 "vtkParse.y" + { postSig("&"); (yyval.integer) = VTK_PARSE_REF;} + break; + + case 347: + +/* Line 1455 of yacc.c */ +#line 2117 "vtkParse.y" + { postSig("&"); (yyval.integer) = ((yyvsp[(1) - (2)].integer) | VTK_PARSE_REF);} + break; + + case 348: + +/* Line 1455 of yacc.c */ +#line 2118 "vtkParse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer); } + break; + + case 349: + +/* Line 1455 of yacc.c */ +#line 2123 "vtkParse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer); } + break; + + case 350: + +/* Line 1455 of yacc.c */ +#line 2125 "vtkParse.y" + { + unsigned int n; + n = (((yyvsp[(1) - (2)].integer) << 2) | (yyvsp[(2) - (2)].integer)); + if ((n & VTK_PARSE_INDIRECT) != n) + { + n = VTK_PARSE_BAD_INDIRECT; + } + (yyval.integer) = n; + } + break; + + case 351: + +/* Line 1455 of yacc.c */ +#line 2136 "vtkParse.y" + { postSig("*"); (yyval.integer) = VTK_PARSE_POINTER; } + break; + + case 352: + +/* Line 1455 of yacc.c */ +#line 2137 "vtkParse.y" + { postSig("*const "); (yyval.integer) = VTK_PARSE_CONST_POINTER; } + break; + + case 353: + +/* Line 1455 of yacc.c */ +#line 2140 "vtkParse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer);} + break; + + case 354: + +/* Line 1455 of yacc.c */ +#line 2141 "vtkParse.y" + { (yyval.integer) = (yyvsp[(2) - (2)].integer); } + break; + + case 355: + +/* Line 1455 of yacc.c */ +#line 2142 "vtkParse.y" + { (yyval.integer) = (yyvsp[(2) - (2)].integer); } + break; + + case 356: + +/* Line 1455 of yacc.c */ +#line 2143 "vtkParse.y" + { typeSig((yyvsp[(2) - (2)].str)); (yyval.integer) = VTK_PARSE_UNKNOWN; } + break; + + case 357: + +/* Line 1455 of yacc.c */ +#line 2144 "vtkParse.y" + { typeSig((yyvsp[(2) - (2)].str)); (yyval.integer) = VTK_PARSE_UNKNOWN; } + break; + + case 358: + +/* Line 1455 of yacc.c */ +#line 2147 "vtkParse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer);} + break; + + case 359: + +/* Line 1455 of yacc.c */ +#line 2148 "vtkParse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer);} + break; + + case 360: + +/* Line 1455 of yacc.c */ +#line 2151 "vtkParse.y" + { typeSig((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_STRING;} + break; + + case 361: + +/* Line 1455 of yacc.c */ +#line 2152 "vtkParse.y" + { typeSig((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_UNICODE_STRING;} + break; + + case 362: + +/* Line 1455 of yacc.c */ +#line 2153 "vtkParse.y" + { typeSig((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_OSTREAM; } + break; + + case 363: + +/* Line 1455 of yacc.c */ +#line 2154 "vtkParse.y" + { typeSig((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_ISTREAM; } + break; + + case 364: + +/* Line 1455 of yacc.c */ +#line 2155 "vtkParse.y" + { typeSig((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_UNKNOWN; } + break; + + case 365: + +/* Line 1455 of yacc.c */ +#line 2156 "vtkParse.y" + { typeSig((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_OBJECT; } + break; + + case 366: + +/* Line 1455 of yacc.c */ +#line 2157 "vtkParse.y" + { typeSig((yyvsp[(1) - (1)].str)); (yyval.integer) = VTK_PARSE_QOBJECT; } + break; + + case 367: + +/* Line 1455 of yacc.c */ +#line 2160 "vtkParse.y" + { typeSig("void"); (yyval.integer) = VTK_PARSE_VOID;} + break; + + case 368: + +/* Line 1455 of yacc.c */ +#line 2161 "vtkParse.y" + { typeSig("bool"); (yyval.integer) = VTK_PARSE_BOOL;} + break; + + case 369: + +/* Line 1455 of yacc.c */ +#line 2162 "vtkParse.y" + { typeSig("ssize_t"); (yyval.integer) = VTK_PARSE_SSIZE_T;} + break; + + case 370: + +/* Line 1455 of yacc.c */ +#line 2163 "vtkParse.y" + { typeSig("size_t"); (yyval.integer) = VTK_PARSE_SIZE_T;} + break; + + case 371: + +/* Line 1455 of yacc.c */ +#line 2164 "vtkParse.y" + { typeSig("vtkTypeInt8"); (yyval.integer) = VTK_PARSE_INT8; } + break; + + case 372: + +/* Line 1455 of yacc.c */ +#line 2165 "vtkParse.y" + { typeSig("vtkTypeUInt8"); (yyval.integer) = VTK_PARSE_UINT8; } + break; + + case 373: + +/* Line 1455 of yacc.c */ +#line 2166 "vtkParse.y" + { typeSig("vtkTypeInt16"); (yyval.integer) = VTK_PARSE_INT16; } + break; + + case 374: + +/* Line 1455 of yacc.c */ +#line 2167 "vtkParse.y" + { typeSig("vtkTypeUInt16"); (yyval.integer) = VTK_PARSE_UINT16; } + break; + + case 375: + +/* Line 1455 of yacc.c */ +#line 2168 "vtkParse.y" + { typeSig("vtkTypeInt32"); (yyval.integer) = VTK_PARSE_INT32; } + break; + + case 376: + +/* Line 1455 of yacc.c */ +#line 2169 "vtkParse.y" + { typeSig("vtkTypeUInt32"); (yyval.integer) = VTK_PARSE_UINT32; } + break; + + case 377: + +/* Line 1455 of yacc.c */ +#line 2170 "vtkParse.y" + { typeSig("vtkTypeInt64"); (yyval.integer) = VTK_PARSE_INT64; } + break; + + case 378: + +/* Line 1455 of yacc.c */ +#line 2171 "vtkParse.y" + { typeSig("vtkTypeUInt64"); (yyval.integer) = VTK_PARSE_UINT64; } + break; + + case 379: + +/* Line 1455 of yacc.c */ +#line 2172 "vtkParse.y" + { typeSig("vtkTypeFloat32"); (yyval.integer) = VTK_PARSE_FLOAT32; } + break; + + case 380: + +/* Line 1455 of yacc.c */ +#line 2173 "vtkParse.y" + { typeSig("vtkTypeFloat64"); (yyval.integer) = VTK_PARSE_FLOAT64; } + break; + + case 381: + +/* Line 1455 of yacc.c */ +#line 2174 "vtkParse.y" + { typeSig("vtkIdType"); (yyval.integer) = VTK_PARSE_ID_TYPE;} + break; + + case 382: + +/* Line 1455 of yacc.c */ +#line 2175 "vtkParse.y" + { typeSig("double"); (yyval.integer) = VTK_PARSE_DOUBLE;} + break; + + case 383: + +/* Line 1455 of yacc.c */ +#line 2176 "vtkParse.y" + { typeSig("float"); (yyval.integer) = VTK_PARSE_FLOAT;} + break; + + case 384: + +/* Line 1455 of yacc.c */ +#line 2177 "vtkParse.y" + { typeSig("double"); (yyval.integer) = VTK_PARSE_DOUBLE;} + break; + + case 385: + +/* Line 1455 of yacc.c */ +#line 2178 "vtkParse.y" + { typeSig("long double"); (yyval.integer) = VTK_PARSE_UNKNOWN;} + break; + + case 386: + +/* Line 1455 of yacc.c */ +#line 2179 "vtkParse.y" + { typeSig("char"); (yyval.integer) = VTK_PARSE_CHAR;} + break; + + case 387: + +/* Line 1455 of yacc.c */ +#line 2180 "vtkParse.y" + { typeSig("signed char"); (yyval.integer) = VTK_PARSE_SIGNED_CHAR;} + break; + + case 388: + +/* Line 1455 of yacc.c */ +#line 2182 "vtkParse.y" + { typeSig("unsigned char"); (yyval.integer) = VTK_PARSE_UNSIGNED_CHAR;} + break; + + case 389: + +/* Line 1455 of yacc.c */ +#line 2183 "vtkParse.y" + { typeSig("int"); (yyval.integer) = VTK_PARSE_INT;} + break; + + case 390: + +/* Line 1455 of yacc.c */ +#line 2185 "vtkParse.y" + { typeSig("unsigned int"); (yyval.integer) = VTK_PARSE_UNSIGNED_INT;} + break; + + case 391: + +/* Line 1455 of yacc.c */ +#line 2186 "vtkParse.y" + { typeSig("short"); (yyval.integer) = VTK_PARSE_SHORT;} + break; + + case 392: + +/* Line 1455 of yacc.c */ +#line 2188 "vtkParse.y" + { typeSig("unsigned short"); (yyval.integer) = VTK_PARSE_UNSIGNED_SHORT;} + break; + + case 393: + +/* Line 1455 of yacc.c */ +#line 2189 "vtkParse.y" + { typeSig("long"); (yyval.integer) = VTK_PARSE_LONG;} + break; + + case 394: + +/* Line 1455 of yacc.c */ +#line 2191 "vtkParse.y" + { typeSig("unsigned long"); (yyval.integer) = VTK_PARSE_UNSIGNED_LONG;} + break; + + case 395: + +/* Line 1455 of yacc.c */ +#line 2192 "vtkParse.y" + { typeSig("long long"); (yyval.integer) = VTK_PARSE_LONG_LONG;} + break; + + case 396: + +/* Line 1455 of yacc.c */ +#line 2194 "vtkParse.y" + {typeSig("unsigned long long");(yyval.integer)=VTK_PARSE_UNSIGNED_LONG_LONG;} + break; + + case 397: + +/* Line 1455 of yacc.c */ +#line 2195 "vtkParse.y" + { typeSig("__int64"); (yyval.integer) = VTK_PARSE___INT64;} + break; + + case 398: + +/* Line 1455 of yacc.c */ +#line 2197 "vtkParse.y" + { typeSig("unsigned __int64"); (yyval.integer) = VTK_PARSE_UNSIGNED___INT64;} + break; + + case 399: + +/* Line 1455 of yacc.c */ +#line 2198 "vtkParse.y" + { typeSig("int"); (yyval.integer) = VTK_PARSE_INT; } + break; + + case 400: + +/* Line 1455 of yacc.c */ +#line 2199 "vtkParse.y" + { typeSig("unsigned int"); (yyval.integer) = VTK_PARSE_UNSIGNED_INT; } + break; + + case 401: + +/* Line 1455 of yacc.c */ +#line 2205 "vtkParse.y" + { (yyval.str) = (yyvsp[(1) - (1)].str); } + break; + + case 402: + +/* Line 1455 of yacc.c */ +#line 2206 "vtkParse.y" + { postSig("{ "); } + break; + + case 403: + +/* Line 1455 of yacc.c */ +#line 2207 "vtkParse.y" + { + postSig("}"); + (yyval.str) = vtkstrcat4("{ ", (yyvsp[(3) - (6)].str), (yyvsp[(4) - (6)].str), " }"); + } + break; + + case 406: + +/* Line 1455 of yacc.c */ +#line 2214 "vtkParse.y" + {(yyval.str) = "";} + break; + + case 407: + +/* Line 1455 of yacc.c */ +#line 2215 "vtkParse.y" + { postSig(", "); } + break; + + case 408: + +/* Line 1455 of yacc.c */ +#line 2216 "vtkParse.y" + { + (yyval.str) = vtkstrcat3((yyvsp[(1) - (4)].str), ", ", (yyvsp[(4) - (4)].str)); + } + break; + + case 409: + +/* Line 1455 of yacc.c */ +#line 2220 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str);} + break; + + case 410: + +/* Line 1455 of yacc.c */ +#line 2221 "vtkParse.y" + {postSig("+");} + break; + + case 411: + +/* Line 1455 of yacc.c */ +#line 2221 "vtkParse.y" + {(yyval.str) = (yyvsp[(3) - (3)].str);} + break; + + case 412: + +/* Line 1455 of yacc.c */ +#line 2222 "vtkParse.y" + {postSig("-");} + break; + + case 413: + +/* Line 1455 of yacc.c */ +#line 2223 "vtkParse.y" + { + (yyval.str) = vtkstrcat("-", (yyvsp[(3) - (3)].str)); + } + break; + + case 414: + +/* Line 1455 of yacc.c */ +#line 2226 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str); postSig((yyvsp[(1) - (1)].str));} + break; + + case 415: + +/* Line 1455 of yacc.c */ +#line 2227 "vtkParse.y" + {postSig("(");} + break; + + case 416: + +/* Line 1455 of yacc.c */ +#line 2227 "vtkParse.y" + {postSig(")"); (yyval.str) = (yyvsp[(3) - (4)].str);} + break; + + case 417: + +/* Line 1455 of yacc.c */ +#line 2228 "vtkParse.y" + {postSig((yyvsp[(1) - (2)].str)); postSig("<");} + break; + + case 418: + +/* Line 1455 of yacc.c */ +#line 2230 "vtkParse.y" + { + chopSig(); + if (getSig()[strlen(getSig())-1] == '>') { postSig(" "); } + postSig(">("); + } + break; + + case 419: + +/* Line 1455 of yacc.c */ +#line 2236 "vtkParse.y" + { + postSig(")"); + if (getTypeId()[strlen(getTypeId())-1] == '>') + { + (yyval.str) = vtkstrcat6( + (yyvsp[(1) - (9)].str), "<", getTypeId(), " >(", (yyvsp[(8) - (9)].str), ")"); + } + else + { + (yyval.str) = vtkstrcat6( + (yyvsp[(1) - (9)].str), "<", getTypeId(), ">(", (yyvsp[(8) - (9)].str), ")"); + } + } + break; + + case 420: + +/* Line 1455 of yacc.c */ +#line 2250 "vtkParse.y" + { (yyval.str) = "static_cast"; } + break; + + case 421: + +/* Line 1455 of yacc.c */ +#line 2251 "vtkParse.y" + { (yyval.str) = "const_cast"; } + break; + + case 422: + +/* Line 1455 of yacc.c */ +#line 2252 "vtkParse.y" + { (yyval.str) = "dynamic_cast"; } + break; + + case 423: + +/* Line 1455 of yacc.c */ +#line 2253 "vtkParse.y" + { (yyval.str) = "reinterpret_cast"; } + break; + + case 424: + +/* Line 1455 of yacc.c */ +#line 2255 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str);} + break; + + case 425: + +/* Line 1455 of yacc.c */ +#line 2257 "vtkParse.y" + { (yyval.str) = vtkstrcat((yyvsp[(1) - (2)].str), (yyvsp[(2) - (2)].str)); } + break; + + case 426: + +/* Line 1455 of yacc.c */ +#line 2259 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str); postSig((yyvsp[(1) - (1)].str));} + break; + + case 427: + +/* Line 1455 of yacc.c */ +#line 2260 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str); postSig((yyvsp[(1) - (1)].str));} + break; + + case 428: + +/* Line 1455 of yacc.c */ +#line 2261 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str); postSig((yyvsp[(1) - (1)].str));} + break; + + case 429: + +/* Line 1455 of yacc.c */ +#line 2262 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str); postSig((yyvsp[(1) - (1)].str));} + break; + + case 430: + +/* Line 1455 of yacc.c */ +#line 2263 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str); postSig((yyvsp[(1) - (1)].str));} + break; -/* The lookahead symbol. */ -int yychar; + case 431: -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +/* Line 1455 of yacc.c */ +#line 2264 "vtkParse.y" + {(yyval.str) = (yyvsp[(1) - (1)].str); postSig((yyvsp[(1) - (1)].str));} + break; -/* Number of syntax errors so far. */ -int yynerrs; + case 432: +/* Line 1455 of yacc.c */ +#line 2266 "vtkParse.y" + { (yyval.str) = vtkstrdup(add_const_scope((yyvsp[(1) - (1)].str))); } + break; + case 433: -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/* Line 1455 of yacc.c */ +#line 2275 "vtkParse.y" + {preSig("void Set"); postSig("(");} + break; -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () + case 434: -#endif -#endif -{ +/* Line 1455 of yacc.c */ +#line 2276 "vtkParse.y" + { + postSig("a);"); + currentFunction->Macro = "vtkSetMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(3) - (7)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, (yyvsp[(6) - (7)].integer), getTypeId(), 0); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + } + break; + case 435: - int yystate; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; +/* Line 1455 of yacc.c */ +#line 2285 "vtkParse.y" + {postSig("Get");} + break; - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + case 436: - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ +/* Line 1455 of yacc.c */ +#line 2286 "vtkParse.y" + {markSig();} + break; - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; + case 437: - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; +/* Line 1455 of yacc.c */ +#line 2286 "vtkParse.y" + {swapSig();} + break; - YYSIZE_T yystacksize; + case 438: - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; +/* Line 1455 of yacc.c */ +#line 2287 "vtkParse.y" + { + postSig("();"); + currentFunction->Macro = "vtkGetMacro"; + currentFunction->Name = vtkstrcat("Get", (yyvsp[(4) - (9)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, (yyvsp[(7) - (9)].integer), getTypeId(), 0); + output_function(); + } + break; -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif + case 439: -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) +/* Line 1455 of yacc.c */ +#line 2295 "vtkParse.y" + {preSig("void Set");} + break; - /* The number of symbols on the RHS of the reduced rule. - Keep to zero when no symbol should be popped. */ - int yylen = 0; + case 440: - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; - yystacksize = YYINITDEPTH; +/* Line 1455 of yacc.c */ +#line 2296 "vtkParse.y" + { + postSig("(char *);"); + currentFunction->Macro = "vtkSetStringMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(4) - (5)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, VTK_PARSE_CHAR_PTR, "char", 0); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + } + break; - YYDPRINTF ((stderr, "Starting parse\n")); + case 441: - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ +/* Line 1455 of yacc.c */ +#line 2305 "vtkParse.y" + {preSig("char *Get");} + break; - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; + case 442: - goto yysetstate; +/* Line 1455 of yacc.c */ +#line 2306 "vtkParse.y" + { + postSig("();"); + currentFunction->Macro = "vtkGetStringMacro"; + currentFunction->Name = vtkstrcat("Get", (yyvsp[(4) - (5)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, VTK_PARSE_CHAR_PTR, "char", 0); + output_function(); + } + break; -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; + case 443: - yysetstate: - *yyssp = yystate; +/* Line 1455 of yacc.c */ +#line 2314 "vtkParse.y" + {startSig(); markSig();} + break; - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + case 444: -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; +/* Line 1455 of yacc.c */ +#line 2314 "vtkParse.y" + {closeSig();} + break; - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); + case 445: - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; +/* Line 1455 of yacc.c */ +#line 2316 "vtkParse.y" + { + const char *typeText; + chopSig(); + typeText = copySig(); + + currentFunction->Macro = "vtkSetClampMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(3) - (10)].str)); + currentFunction->Signature = + vtkstrcat5("void ", currentFunction->Name, "(", typeText, ");"); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, (yyvsp[(6) - (10)].integer), getTypeId(), 0); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ + currentFunction->Macro = "vtkSetClampMacro"; + currentFunction->Name = vtkstrcat3("Get", (yyvsp[(3) - (10)].str), "MinValue"); + currentFunction->Signature = + vtkstrcat4(typeText, " ", currentFunction->Name, "();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, (yyvsp[(6) - (10)].integer), getTypeId(), 0); + output_function(); - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; + currentFunction->Macro = "vtkSetClampMacro"; + currentFunction->Name = vtkstrcat3("Get", (yyvsp[(3) - (10)].str), "MaxValue"); + currentFunction->Signature = + vtkstrcat4(typeText, " ", currentFunction->Name, "();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, (yyvsp[(6) - (10)].integer), getTypeId(), 0); + output_function(); + } + break; - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + case 446: - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } +/* Line 1455 of yacc.c */ +#line 2347 "vtkParse.y" + {preSig("void Set"); postSig("("); } + break; - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + case 447: - if (yystate == YYFINAL) - YYACCEPT; +/* Line 1455 of yacc.c */ +#line 2348 "vtkParse.y" + { + postSig("*);"); + currentFunction->Macro = "vtkSetObjectMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(3) - (7)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, VTK_PARSE_OBJECT_PTR, getTypeId(), 0); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + } + break; - goto yybackup; + case 448: -/*-----------. -| yybackup. | -`-----------*/ -yybackup: +/* Line 1455 of yacc.c */ +#line 2357 "vtkParse.y" + {postSig("*Get");} + break; - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ + case 449: - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; +/* Line 1455 of yacc.c */ +#line 2358 "vtkParse.y" + {markSig();} + break; - /* Not known => get a lookahead token if don't already have one. */ + case 450: - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } +/* Line 1455 of yacc.c */ +#line 2358 "vtkParse.y" + {swapSig();} + break; - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else + case 451: + +/* Line 1455 of yacc.c */ +#line 2359 "vtkParse.y" { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } + postSig("();"); + currentFunction->Macro = "vtkGetObjectMacro"; + currentFunction->Name = vtkstrcat("Get", (yyvsp[(4) - (9)].str)); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, VTK_PARSE_OBJECT_PTR, getTypeId(), 0); + output_function(); + } + break; - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) + case 452: + +/* Line 1455 of yacc.c */ +#line 2368 "vtkParse.y" { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } + currentFunction->Macro = "vtkBooleanMacro"; + currentFunction->Name = vtkstrcat((yyvsp[(3) - (6)].str), "On"); + currentFunction->Comment = vtkstrdup(getComment()); + currentFunction->Signature = + vtkstrcat3("void ", currentFunction->Name, "();"); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + currentFunction->Macro = "vtkBooleanMacro"; + currentFunction->Name = vtkstrcat((yyvsp[(3) - (6)].str), "Off"); + currentFunction->Comment = vtkstrdup(getComment()); + currentFunction->Signature = + vtkstrcat3("void ", currentFunction->Name, "();"); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + } + break; - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + case 453: - /* Discard the shifted token. */ - yychar = YYEMPTY; +/* Line 1455 of yacc.c */ +#line 2385 "vtkParse.y" + {startSig(); markSig();} + break; - yystate = yyn; - *++yyvsp = yylval; + case 454: - goto yynewstate; +/* Line 1455 of yacc.c */ +#line 2386 "vtkParse.y" + { + chopSig(); + outputSetVectorMacro((yyvsp[(3) - (7)].str), (yyvsp[(6) - (7)].integer), copySig(), 2); + } + break; + case 455: -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; +/* Line 1455 of yacc.c */ +#line 2390 "vtkParse.y" + {startSig(); markSig();} + break; + + case 456: + +/* Line 1455 of yacc.c */ +#line 2391 "vtkParse.y" + { + chopSig(); + outputGetVectorMacro((yyvsp[(3) - (7)].str), (yyvsp[(6) - (7)].integer), copySig(), 2); + } + break; + + case 457: + +/* Line 1455 of yacc.c */ +#line 2395 "vtkParse.y" + {startSig(); markSig();} + break; + case 458: -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; +/* Line 1455 of yacc.c */ +#line 2396 "vtkParse.y" + { + chopSig(); + outputSetVectorMacro((yyvsp[(3) - (7)].str), (yyvsp[(6) - (7)].integer), copySig(), 3); + } + break; - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + case 459: - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; +/* Line 1455 of yacc.c */ +#line 2400 "vtkParse.y" + {startSig(); markSig();} + break; + case 460: - YY_REDUCE_PRINT (yyn); - switch (yyn) +/* Line 1455 of yacc.c */ +#line 2401 "vtkParse.y" { - case 3: + chopSig(); + outputGetVectorMacro((yyvsp[(3) - (7)].str), (yyvsp[(6) - (7)].integer), copySig(), 3); + } + break; + + case 461: /* Line 1455 of yacc.c */ -#line 284 "vtkParse.y" - { - ((yyval.vtkid)).name = (yyvsp[(1) - (2)].str); - ((yyval.vtkid)).external = 1; - ;} +#line 2405 "vtkParse.y" + {startSig(); markSig();} break; - case 4: + case 462: /* Line 1455 of yacc.c */ -#line 289 "vtkParse.y" +#line 2406 "vtkParse.y" { - ((yyval.vtkid)).name = (yyvsp[(1) - (1)].str); - ((yyval.vtkid)).external = 0; - ;} + chopSig(); + outputSetVectorMacro((yyvsp[(3) - (7)].str), (yyvsp[(6) - (7)].integer), copySig(), 4); + } + break; + + case 463: + +/* Line 1455 of yacc.c */ +#line 2410 "vtkParse.y" + {startSig(); markSig();} break; - case 5: + case 464: /* Line 1455 of yacc.c */ -#line 295 "vtkParse.y" +#line 2411 "vtkParse.y" { - data.ClassName = vtkstrdup((yyvsp[(2) - (2)].str)); - ;} + chopSig(); + outputGetVectorMacro((yyvsp[(3) - (7)].str), (yyvsp[(6) - (7)].integer), copySig(), 4); + } break; - case 13: + case 465: /* Line 1455 of yacc.c */ -#line 305 "vtkParse.y" - { output_function(); ;} +#line 2415 "vtkParse.y" + {startSig(); markSig();} break; - case 14: + case 466: /* Line 1455 of yacc.c */ -#line 306 "vtkParse.y" - { output_function(); ;} +#line 2416 "vtkParse.y" + { + chopSig(); + outputSetVectorMacro((yyvsp[(3) - (7)].str), (yyvsp[(6) - (7)].integer), copySig(), 6); + } break; - case 15: + case 467: /* Line 1455 of yacc.c */ -#line 307 "vtkParse.y" - { legacySig(); output_function(); ;} +#line 2420 "vtkParse.y" + {startSig(); markSig();} break; - case 19: + case 468: /* Line 1455 of yacc.c */ -#line 313 "vtkParse.y" - { preSig("~"); ;} +#line 2421 "vtkParse.y" + { + chopSig(); + outputGetVectorMacro((yyvsp[(3) - (7)].str), (yyvsp[(6) - (7)].integer), copySig(), 6); + } break; - case 20: + case 469: /* Line 1455 of yacc.c */ -#line 314 "vtkParse.y" - { preSig("virtual ~"); ;} +#line 2425 "vtkParse.y" + {startSig(); markSig();} break; - case 22: + case 470: /* Line 1455 of yacc.c */ -#line 317 "vtkParse.y" +#line 2427 "vtkParse.y" { - currentFunction->ReturnType = (yyvsp[(1) - (2)].integer); - ;} + const char *typeText; + chopSig(); + typeText = copySig(); + currentFunction->Macro = "vtkSetVectorMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(3) - (9)].str)); + currentFunction->Signature = + vtkstrcat7("void ", currentFunction->Name, "(", typeText, + " a[", (yyvsp[(8) - (9)].str), "]);"); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, (VTK_PARSE_POINTER | (yyvsp[(6) - (9)].integer)), + getTypeId(), (int)strtol((yyvsp[(8) - (9)].str), NULL, 0)); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + } break; - case 23: + case 471: /* Line 1455 of yacc.c */ -#line 321 "vtkParse.y" - { - currentFunction->ReturnType = (yyvsp[(1) - (3)].integer); - ;} +#line 2442 "vtkParse.y" + {startSig();} break; - case 24: + case 472: /* Line 1455 of yacc.c */ -#line 325 "vtkParse.y" +#line 2444 "vtkParse.y" { - preSig("virtual "); - currentFunction->ReturnType = (yyvsp[(2) - (4)].integer); - ;} + chopSig(); + currentFunction->Macro = "vtkGetVectorMacro"; + currentFunction->Name = vtkstrcat("Get", (yyvsp[(3) - (9)].str)); + postSig(" *"); + postSig(currentFunction->Name); + postSig("();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, (VTK_PARSE_POINTER | (yyvsp[(6) - (9)].integer)), + getTypeId(), (int)strtol((yyvsp[(8) - (9)].str), NULL, 0)); + output_function(); + } break; - case 25: + case 473: /* Line 1455 of yacc.c */ -#line 330 "vtkParse.y" +#line 2457 "vtkParse.y" { - preSig("virtual "); - currentFunction->ReturnType = (yyvsp[(2) - (3)].integer); - ;} + currentFunction->Macro = "vtkViewportCoordinateMacro"; + currentFunction->Name = vtkstrcat3("Get", (yyvsp[(3) - (4)].str), "Coordinate"); + currentFunction->Signature = + vtkstrcat3("vtkCoordinate *", currentFunction->Name, "();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, VTK_PARSE_OBJECT_PTR, "vtkCoordinate", 0); + output_function(); + + currentFunction->Macro = "vtkViewportCoordinateMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(3) - (4)].str)); + currentFunction->Signature = + vtkstrcat3("void ", currentFunction->Name, "(double, double);"); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, VTK_PARSE_DOUBLE, "double", 0); + add_argument(currentFunction, VTK_PARSE_DOUBLE, "double", 0); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + + currentFunction->Macro = "vtkViewportCoordinateMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(3) - (4)].str)); + currentFunction->Signature = + vtkstrcat3("void ", currentFunction->Name, "(double a[2]);"); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, VTK_PARSE_DOUBLE_PTR, "double", 2); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + + currentFunction->Macro = "vtkViewportCoordinateMacro"; + currentFunction->Name = vtkstrcat("Get", (yyvsp[(3) - (4)].str)); + currentFunction->Signature = + vtkstrcat3("double *", currentFunction->Name, "();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, VTK_PARSE_DOUBLE_PTR, "double", 2); + output_function(); + } break; - case 26: + case 474: /* Line 1455 of yacc.c */ -#line 335 "vtkParse.y" +#line 2494 "vtkParse.y" { - preSig("virtual "); - ;} + currentFunction->Macro = "vtkWorldCoordinateMacro"; + currentFunction->Name = vtkstrcat3("Get", (yyvsp[(3) - (4)].str), "Coordinate"); + currentFunction->Signature = + vtkstrcat3("vtkCoordinate *", currentFunction->Name, "();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, VTK_PARSE_OBJECT_PTR, "vtkCoordinate", 0); + output_function(); + + currentFunction->Macro = "vtkWorldCoordinateMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(3) - (4)].str)); + currentFunction->Signature = + vtkstrcat3("void ", currentFunction->Name, "(double, double, double);"); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, VTK_PARSE_DOUBLE, "double", 0); + add_argument(currentFunction, VTK_PARSE_DOUBLE, "double", 0); + add_argument(currentFunction, VTK_PARSE_DOUBLE, "double", 0); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + + currentFunction->Macro = "vtkWorldCoordinateMacro"; + currentFunction->Name = vtkstrcat("Set", (yyvsp[(3) - (4)].str)); + currentFunction->Signature = + vtkstrcat3("void ", currentFunction->Name, "(double a[3]);"); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, VTK_PARSE_DOUBLE_PTR, "double", 3); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + + currentFunction->Macro = "vtkWorldCoordinateMacro"; + currentFunction->Name = vtkstrcat("Get", (yyvsp[(3) - (4)].str)); + currentFunction->Signature = + vtkstrcat3("double *", currentFunction->Name, "();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, VTK_PARSE_DOUBLE_PTR, "double", 3); + output_function(); + } break; - case 27: + case 475: /* Line 1455 of yacc.c */ -#line 341 "vtkParse.y" +#line 2532 "vtkParse.y" { - output_function(); - ;} + int is_concrete = 0; + int i; + + currentFunction->Macro = "vtkTypeMacro"; + currentFunction->Name = vtkstrdup("GetClassName"); + currentFunction->Signature = vtkstrdup("const char *GetClassName();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, (VTK_PARSE_CONST | VTK_PARSE_CHAR_PTR), + "char", 0); + output_function(); + + currentFunction->Macro = "vtkTypeMacro"; + currentFunction->Name = vtkstrdup("IsA"); + currentFunction->Signature = vtkstrdup("int IsA(const char *name);"); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, (VTK_PARSE_CONST | VTK_PARSE_CHAR_PTR), + "char", 0); + set_return(currentFunction, VTK_PARSE_INT, "int", 0); + output_function(); + + currentFunction->Macro = "vtkTypeMacro"; + currentFunction->Name = vtkstrdup("NewInstance"); + currentFunction->Signature = vtkstrcat((yyvsp[(3) - (7)].str), " *NewInstance();"); + currentFunction->Comment = vtkstrdup(getComment()); + set_return(currentFunction, VTK_PARSE_OBJECT_PTR, (yyvsp[(3) - (7)].str), 0); + output_function(); + + for (i = 0; i < NumberOfConcreteClasses; i++) + { + if (strcmp(currentClass->Name, ConcreteClasses[i]) == 0) + { + is_concrete = 1; + break; + } + } + + if ( is_concrete ) + { + currentFunction->Macro = "vtkTypeMacro"; + currentFunction->Name = vtkstrdup("SafeDownCast"); + currentFunction->Signature = + vtkstrcat((yyvsp[(3) - (7)].str), " *SafeDownCast(vtkObject* o);"); + currentFunction->Comment = vtkstrdup(getComment()); + add_argument(currentFunction, VTK_PARSE_OBJECT_PTR, "vtkObject", 0); + set_return(currentFunction, (VTK_PARSE_STATIC | VTK_PARSE_OBJECT_PTR), + (yyvsp[(3) - (7)].str), 0); + output_function(); + } + } break; - case 28: + case 476: /* Line 1455 of yacc.c */ -#line 345 "vtkParse.y" - { - currentFunction->ReturnType = (yyvsp[(1) - (2)].integer); - output_function(); - ;} +#line 2588 "vtkParse.y" + { (yyval.str) = "operator()"; } break; - case 29: + case 477: /* Line 1455 of yacc.c */ -#line 350 "vtkParse.y" - { - currentFunction->ReturnType = (yyvsp[(1) - (3)].integer); - output_function(); - ;} +#line 2589 "vtkParse.y" + { (yyval.str) = "operator[]"; } break; - case 30: + case 478: /* Line 1455 of yacc.c */ -#line 355 "vtkParse.y" - { - preSig("virtual "); - currentFunction->ReturnType = (yyvsp[(2) - (4)].integer); - output_function(); - ;} +#line 2590 "vtkParse.y" + { (yyval.str) = "operator new[]"; } break; - case 31: + case 479: /* Line 1455 of yacc.c */ -#line 361 "vtkParse.y" - { - preSig("virtual "); - currentFunction->ReturnType = (yyvsp[(2) - (3)].integer); - output_function(); - ;} +#line 2591 "vtkParse.y" + { (yyval.str) = "operator delete[]"; } break; - case 32: + case 481: /* Line 1455 of yacc.c */ -#line 367 "vtkParse.y" - { - preSig("virtual "); - output_function(); - ;} +#line 2594 "vtkParse.y" + { (yyval.str) = "operator="; } break; - case 33: + case 482: /* Line 1455 of yacc.c */ -#line 373 "vtkParse.y" - { - currentFunction->IsOperator = 1; - vtkParseDebug("Converted operator", 0); - ;} +#line 2595 "vtkParse.y" + { (yyval.str) = "operator*"; } break; - case 34: + case 483: /* Line 1455 of yacc.c */ -#line 378 "vtkParse.y" - { postSig(")"); ;} +#line 2595 "vtkParse.y" + { (yyval.str) = "operator/"; } break; - case 35: + case 484: /* Line 1455 of yacc.c */ -#line 378 "vtkParse.y" - { postSig(";"); openSig = 0; ;} +#line 2596 "vtkParse.y" + { (yyval.str) = "operator-"; } break; - case 36: + case 485: /* Line 1455 of yacc.c */ -#line 379 "vtkParse.y" - { - openSig = 1; - currentFunction->Name = (yyvsp[(1) - (4)].str); - vtkParseDebug("Parsed func", (yyvsp[(1) - (4)].str)); - ;} +#line 2596 "vtkParse.y" + { (yyval.str) = "operator+"; } break; - case 37: + case 486: /* Line 1455 of yacc.c */ -#line 385 "vtkParse.y" - { - postSig(") = 0;"); - currentFunction->Name = (yyvsp[(1) - (3)].str); - vtkParseDebug("Parsed func", (yyvsp[(1) - (3)].str)); - currentFunction->IsPureVirtual = 1; - data.IsAbstract = 1; - ;} +#line 2597 "vtkParse.y" + { (yyval.str) = "operator!"; } break; - case 39: + case 487: /* Line 1455 of yacc.c */ -#line 393 "vtkParse.y" - {postSig(" const");;} +#line 2597 "vtkParse.y" + { (yyval.str) = "operator~"; } break; - case 40: + case 488: /* Line 1455 of yacc.c */ -#line 395 "vtkParse.y" - {postSig(" ("); ;} +#line 2598 "vtkParse.y" + { (yyval.str) = "operator,"; } break; - case 42: + case 489: /* Line 1455 of yacc.c */ -#line 397 "vtkParse.y" - {postSig("const ");;} +#line 2598 "vtkParse.y" + { (yyval.str) = "operator<"; } break; - case 43: + case 490: /* Line 1455 of yacc.c */ -#line 399 "vtkParse.y" - {postSig("static ");;} +#line 2599 "vtkParse.y" + { (yyval.str) = "operator>"; } break; - case 44: + case 491: /* Line 1455 of yacc.c */ -#line 401 "vtkParse.y" - {postSig(((yyvsp[(1) - (1)].vtkid)).name);;} +#line 2599 "vtkParse.y" + { (yyval.str) = "operator&"; } break; - case 45: + case 492: /* Line 1455 of yacc.c */ -#line 401 "vtkParse.y" - {postSig((yyvsp[(1) - (1)].str));;} +#line 2600 "vtkParse.y" + { (yyval.str) = "operator|"; } break; - case 52: + case 493: /* Line 1455 of yacc.c */ -#line 410 "vtkParse.y" - { currentFunction->NumberOfArguments++;;} +#line 2600 "vtkParse.y" + { (yyval.str) = "operator^"; } break; - case 53: + case 494: /* Line 1455 of yacc.c */ -#line 411 "vtkParse.y" - { currentFunction->NumberOfArguments++; postSig(", ");;} +#line 2601 "vtkParse.y" + { (yyval.str) = "operator%"; } break; - case 55: + case 495: /* Line 1455 of yacc.c */ -#line 414 "vtkParse.y" - { - currentFunction->ArgCounts[currentFunction->NumberOfArguments] = 0; - currentFunction->ArgTypes[currentFunction->NumberOfArguments] = - (yyvsp[(1) - (1)].integer);;} +#line 2602 "vtkParse.y" + { (yyval.str) = "operator new"; } break; - case 56: + case 496: /* Line 1455 of yacc.c */ -#line 419 "vtkParse.y" - { - currentFunction->ArgCounts[currentFunction->NumberOfArguments] = - (yyvsp[(2) - (2)].integer) / 0x10000; - currentFunction->ArgTypes[currentFunction->NumberOfArguments] = - (yyvsp[(1) - (2)].integer) + (yyvsp[(2) - (2)].integer) % 0x10000; - ;} +#line 2603 "vtkParse.y" + { (yyval.str) = "operator delete"; } break; - case 58: + case 497: /* Line 1455 of yacc.c */ -#line 426 "vtkParse.y" - { - postSig("void (*func)(void *) "); - currentFunction->ArgCounts[currentFunction->NumberOfArguments] = 0; - currentFunction->ArgTypes[currentFunction->NumberOfArguments] = 0x5000; - ;} +#line 2604 "vtkParse.y" + { (yyval.str) = "operator<<="; } break; - case 61: + case 498: /* Line 1455 of yacc.c */ -#line 434 "vtkParse.y" - {delSig();;} +#line 2605 "vtkParse.y" + { (yyval.str) = "operator>>="; } break; - case 62: + case 499: /* Line 1455 of yacc.c */ -#line 434 "vtkParse.y" - {delSig();;} +#line 2606 "vtkParse.y" + { (yyval.str) = "operator<<"; } break; - case 63: + case 500: /* Line 1455 of yacc.c */ -#line 436 "vtkParse.y" - { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} +#line 2607 "vtkParse.y" + { (yyval.str) = "operator>>"; } break; - case 64: + case 501: /* Line 1455 of yacc.c */ -#line 444 "vtkParse.y" - { (yyval.integer) = 0; ;} +#line 2608 "vtkParse.y" + { (yyval.str) = "operator->*"; } break; - case 65: + case 502: /* Line 1455 of yacc.c */ -#line 445 "vtkParse.y" - { char temp[100]; sprintf(temp,"[%i]",(yyvsp[(1) - (1)].integer)); - postSig(temp); ;} +#line 2609 "vtkParse.y" + { (yyval.str) = "operator->"; } break; - case 66: + case 503: /* Line 1455 of yacc.c */ -#line 447 "vtkParse.y" - { (yyval.integer) = 0x300 + 0x10000 * (yyvsp[(1) - (3)].integer) + (yyvsp[(3) - (3)].integer) % 0x1000; ;} +#line 2610 "vtkParse.y" + { (yyval.str) = "operator+="; } break; - case 67: + case 504: /* Line 1455 of yacc.c */ -#line 449 "vtkParse.y" - { postSig("[]"); (yyval.integer) = 0x300 + (yyvsp[(4) - (4)].integer) % 0x1000; ;} +#line 2611 "vtkParse.y" + { (yyval.str) = "operator-="; } break; - case 68: + case 505: /* Line 1455 of yacc.c */ -#line 451 "vtkParse.y" - {(yyval.integer) = 0x1000 + (yyvsp[(2) - (2)].integer);;} +#line 2612 "vtkParse.y" + { (yyval.str) = "operator*="; } break; - case 69: + case 506: /* Line 1455 of yacc.c */ -#line 452 "vtkParse.y" - {(yyval.integer) = (yyvsp[(1) - (1)].integer);;} +#line 2613 "vtkParse.y" + { (yyval.str) = "operator/="; } break; - case 70: + case 507: /* Line 1455 of yacc.c */ -#line 453 "vtkParse.y" - {(yyval.integer) = 0x2000 + (yyvsp[(2) - (2)].integer);;} +#line 2614 "vtkParse.y" + { (yyval.str) = "operator%="; } break; - case 71: + case 508: /* Line 1455 of yacc.c */ -#line 454 "vtkParse.y" - {(yyval.integer) = 0x3000 + (yyvsp[(3) - (3)].integer);;} +#line 2615 "vtkParse.y" + { (yyval.str) = "operator++"; } break; - case 72: + case 509: /* Line 1455 of yacc.c */ -#line 456 "vtkParse.y" - {(yyval.integer) = (yyvsp[(1) - (1)].integer);;} +#line 2616 "vtkParse.y" + { (yyval.str) = "operator--"; } break; - case 73: + case 510: /* Line 1455 of yacc.c */ -#line 458 "vtkParse.y" - {(yyval.integer) = (yyvsp[(1) - (2)].integer) + (yyvsp[(2) - (2)].integer);;} +#line 2617 "vtkParse.y" + { (yyval.str) = "operator&="; } break; - case 74: + case 511: /* Line 1455 of yacc.c */ -#line 459 "vtkParse.y" - {(yyval.integer) = (yyvsp[(1) - (1)].integer);;} +#line 2618 "vtkParse.y" + { (yyval.str) = "operator|="; } break; - case 75: + case 512: /* Line 1455 of yacc.c */ -#line 461 "vtkParse.y" - {(yyval.integer) = (yyvsp[(1) - (1)].integer);;} +#line 2619 "vtkParse.y" + { (yyval.str) = "operator^="; } break; - case 76: + case 513: /* Line 1455 of yacc.c */ -#line 462 "vtkParse.y" - { postSig("&"); (yyval.integer) = (yyvsp[(1) - (2)].integer);;} +#line 2620 "vtkParse.y" + {(yyval.str) = "operator&&=";} break; - case 77: + case 514: /* Line 1455 of yacc.c */ -#line 463 "vtkParse.y" - { postSig("*"); (yyval.integer) = 0x400 + (yyvsp[(1) - (2)].integer);;} +#line 2621 "vtkParse.y" + {(yyval.str) = "operator||=";} break; - case 78: + case 515: /* Line 1455 of yacc.c */ -#line 465 "vtkParse.y" - { postSig("vtkStdString "); (yyval.integer) = 0x1303; ;} +#line 2622 "vtkParse.y" + { (yyval.str) = "operator&&"; } break; - case 79: + case 516: + +/* Line 1455 of yacc.c */ +#line 2623 "vtkParse.y" + { (yyval.str) = "operator||"; } + break; + + case 517: + +/* Line 1455 of yacc.c */ +#line 2624 "vtkParse.y" + { (yyval.str) = "operator=="; } + break; + + case 518: + +/* Line 1455 of yacc.c */ +#line 2625 "vtkParse.y" + { (yyval.str) = "operator!="; } + break; + + case 519: + +/* Line 1455 of yacc.c */ +#line 2626 "vtkParse.y" + { (yyval.str) = "operator<="; } + break; + + case 520: /* Line 1455 of yacc.c */ -#line 475 "vtkParse.y" - { postSig("&"); (yyval.integer) = 0x100;;} +#line 2627 "vtkParse.y" + { (yyval.str) = "operator>="; } break; - case 80: -/* Line 1455 of yacc.c */ -#line 476 "vtkParse.y" - { postSig("*"); (yyval.integer) = 0x300;;} - break; - case 81: +/* Line 1455 of yacc.c */ +#line 8207 "vtkParse.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + + /* Now `shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; + if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTOKENS]; + + goto yynewstate; + + +/*------------------------------------. +| yyerrlab -- here on detecting error | +`------------------------------------*/ +yyerrlab: + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) + { + ++yynerrs; +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + + + if (yyerrstatus == 3) + { + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ + + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } + } + + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; + + +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; + + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + + +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ + + for (;;) + { + yyn = yypact[yystate]; + if (yyn != YYPACT_NINF) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + + yystate = yyn; + goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + +#if !defined(yyoverflow) || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); +} + + -/* Line 1455 of yacc.c */ -#line 477 "vtkParse.y" - { (yyval.integer) = 0x100 + (yyvsp[(2) - (2)].integer);;} - break; +/* Line 1675 of yacc.c */ +#line 2652 "vtkParse.y" - case 82: +#include +#include "lex.yy.c" -/* Line 1455 of yacc.c */ -#line 478 "vtkParse.y" - { (yyval.integer) = 0x400 + (yyvsp[(2) - (2)].integer);;} - break; +/* initialize the structure */ +void vtkParse_InitTemplateArgs(TemplateArgs *args) +{ + args->NumberOfArguments = 0; +} - case 83: +void vtkParse_CopyTemplateArgs(TemplateArgs *args, const TemplateArgs *orig) +{ + unsigned long i, n; -/* Line 1455 of yacc.c */ -#line 480 "vtkParse.y" - {postSig("unsigned ");;} - break; + n = orig->NumberOfArguments; + args->NumberOfArguments = n; + args->Arguments = (TemplateArg **)malloc(n*sizeof(TemplateArg *)); - case 84: + for (i = 0; i < n; i++) + { + args->Arguments[i] = (TemplateArg *)malloc(sizeof(TemplateArg)); + vtkParse_CopyTemplateArg(args->Arguments[i], orig->Arguments[i]); + } +} -/* Line 1455 of yacc.c */ -#line 481 "vtkParse.y" - { (yyval.integer) = 0x10 + (yyvsp[(3) - (3)].integer);;} - break; +void vtkParse_InitTemplateArg(TemplateArg *arg) +{ + arg->Template = NULL; + arg->Type = 0; + arg->Class = NULL; + arg->Name = NULL; + arg->Value = NULL; +} - case 85: +void vtkParse_CopyTemplateArg(TemplateArg *arg, const TemplateArg *orig) +{ + arg->Template = NULL; -/* Line 1455 of yacc.c */ -#line 482 "vtkParse.y" - { (yyval.integer) = (yyvsp[(1) - (1)].integer);;} - break; + if (orig->Template) + { + arg->Template = (TemplateArgs *)malloc(sizeof(TemplateArgs)); + vtkParse_CopyTemplateArgs(arg->Template, orig->Template); + } - case 86: + arg->Type = orig->Type; + arg->Class = orig->Class; + arg->Name = orig->Name; + arg->Value = orig->Value; +} -/* Line 1455 of yacc.c */ -#line 485 "vtkParse.y" - { postSig("vtkTypeInt8 "); (yyval.integer) = VTK_PARSE_INT8; ;} - break; +/* initialize the structure */ +void vtkParse_InitFunction(FunctionInfo *func) +{ + unsigned long i; - case 87: + func->ItemType = VTK_FUNCTION_INFO; + func->Access = VTK_ACCESS_PUBLIC; + func->Name = NULL; + func->Comment = NULL; + func->Class = NULL; + func->Signature = NULL; + func->Template = NULL; + func->NumberOfArguments = 0; + func->ReturnValue = NULL; + func->Macro = NULL; + func->SizeHint = NULL; + func->IsStatic = 0; + func->IsVirtual = 0; + func->IsPureVirtual = 0; + func->IsOperator = 0; + func->IsVariadic = 0; + func->IsConst = 0; + func->IsExplicit = 0; -/* Line 1455 of yacc.c */ -#line 486 "vtkParse.y" - { postSig("vtkTypeUInt8 "); (yyval.integer) = VTK_PARSE_UINT8; ;} - break; + /* everything below here is legacy information, * + * maintained only for backwards compatibility */ + func->ReturnType = VTK_PARSE_VOID; + func->ReturnClass = NULL; + func->HaveHint = 0; + func->HintSize = 0; + func->IsLegacy = 0; + func->ArrayFailure = 0; + func->IsPublic = 0; + func->IsProtected = 0; - case 88: + for (i = 0; i < MAX_ARGS; i++) + { + func->ArgTypes[i] = 0; + func->ArgClasses[i] = 0; + func->ArgCounts[i] = 0; + } +} -/* Line 1455 of yacc.c */ -#line 487 "vtkParse.y" - { postSig("vtkTypeInt16 "); (yyval.integer) = VTK_PARSE_INT16; ;} - break; +void vtkParse_CopyFunction(FunctionInfo *func, const FunctionInfo *orig) +{ + unsigned long i, n; - case 89: + func->ItemType = orig->ItemType; + func->Access = orig->Access; + func->Name = orig->Name; + func->Comment = orig->Comment; + func->Class = orig->Class; + func->Signature = orig->Signature; + func->Template = NULL; -/* Line 1455 of yacc.c */ -#line 488 "vtkParse.y" - { postSig("vtkTypeUInt16 "); (yyval.integer) = VTK_PARSE_UINT16; ;} - break; + if (orig->Template) + { + func->Template = (TemplateArgs *)malloc(sizeof(TemplateArgs)); + vtkParse_CopyTemplateArgs(func->Template, orig->Template); + } - case 90: + n = orig->NumberOfArguments; + func->NumberOfArguments = n; + if (n) + { + func->Arguments = (ValueInfo **)malloc(n*sizeof(ValueInfo *)); + for (i = 0; i < n; i++) + { + func->Arguments[i] = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_CopyValue(func->Arguments[i], orig->Arguments[i]); + } + } -/* Line 1455 of yacc.c */ -#line 489 "vtkParse.y" - { postSig("vtkTypeInt32 "); (yyval.integer) = VTK_PARSE_INT32; ;} - break; + func->ReturnValue = NULL; + if (orig->ReturnValue) + { + func->ReturnValue = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_CopyValue(func->ReturnValue, orig->ReturnValue); + } - case 91: + func->Macro = orig->Macro; + func->SizeHint = orig->SizeHint; + func->IsStatic = orig->IsStatic; + func->IsVirtual = orig->IsVirtual; + func->IsPureVirtual = orig->IsPureVirtual; + func->IsOperator = orig->IsOperator; + func->IsVariadic = orig->IsVariadic; + func->IsConst = orig->IsConst; + func->IsExplicit = orig->IsExplicit; + + /* everything below here is legacy information, * + * maintained only for backwards compatibility */ + func->ReturnType = orig->ReturnType; + func->ReturnClass = orig->ReturnClass; + func->HaveHint = orig->HaveHint; + func->HintSize = orig->HintSize; + func->IsLegacy = orig->IsLegacy; + func->ArrayFailure = orig->ArrayFailure; + func->IsPublic = orig->IsPublic; + func->IsProtected = orig->IsProtected; + + for (i = 0; i < MAX_ARGS; i++) + { + func->ArgTypes[i] = orig->ArgTypes[i]; + func->ArgClasses[i] = orig->ArgClasses[i]; + func->ArgCounts[i] = orig->ArgCounts[i]; + } +} -/* Line 1455 of yacc.c */ -#line 490 "vtkParse.y" - { postSig("vtkTypeUInt32 "); (yyval.integer) = VTK_PARSE_UINT32; ;} - break; +/* initialize the structure */ +void vtkParse_InitValue(ValueInfo *val) +{ + val->ItemType = VTK_VARIABLE_INFO; + val->Access = VTK_ACCESS_PUBLIC; + val->Name = NULL; + val->Comment = NULL; + val->Value = NULL; + val->Type = 0; + val->Class = NULL; + val->Count = 0; + val->CountHint = NULL; + val->NumberOfDimensions = 0; + val->Function = NULL; + val->IsStatic = 0; + val->IsEnum = 0; +} - case 92: +void vtkParse_CopyValue(ValueInfo *val, const ValueInfo *orig) +{ + unsigned long i, n; + + val->ItemType = orig->ItemType; + val->Access = orig->Access; + val->Name = orig->Name; + val->Comment = orig->Comment; + val->Value = orig->Value; + val->Type = orig->Type; + val->Class = orig->Class; + val->Count = orig->Count; + val->CountHint = orig->CountHint; + + n = orig->NumberOfDimensions; + val->NumberOfDimensions = n; + if (n) + { + val->Dimensions = (const char **)malloc(n*sizeof(char *)); + for (i = 0; i < n; i++) + { + val->Dimensions[i] = orig->Dimensions[i]; + } + } -/* Line 1455 of yacc.c */ -#line 491 "vtkParse.y" - { postSig("vtkTypeInt64 "); (yyval.integer) = VTK_PARSE_INT64; ;} - break; + val->Function = NULL; + if (orig->Function) + { + val->Function = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + vtkParse_CopyFunction(val->Function, orig->Function); + } - case 93: + val->IsStatic = orig->IsStatic; + val->IsEnum = orig->IsEnum; +} -/* Line 1455 of yacc.c */ -#line 492 "vtkParse.y" - { postSig("vtkTypeUInt64 "); (yyval.integer) = VTK_PARSE_UINT64; ;} - break; +/* initialize the structure */ +void vtkParse_InitEnum(EnumInfo *item) +{ + item->ItemType = VTK_ENUM_INFO; + item->Access = VTK_ACCESS_PUBLIC; + item->Name = NULL; + item->Comment = NULL; +} - case 94: +void vtkParse_CopyEnum(EnumInfo *item, const EnumInfo *orig) +{ + item->ItemType = orig->ItemType; + item->Access = orig->Access; + item->Name = orig->Name; + item->Comment = orig->Comment; +} -/* Line 1455 of yacc.c */ -#line 493 "vtkParse.y" - { postSig("vtkTypeFloat32 "); (yyval.integer) = VTK_PARSE_FLOAT32; ;} - break; +/* initialize the structure */ +void vtkParse_InitUsing(UsingInfo *item) +{ + item->ItemType = VTK_USING_INFO; + item->Access = VTK_ACCESS_PUBLIC; + item->Name = NULL; + item->Comment = NULL; + item->Scope = NULL; +} - case 95: +void vtkParse_CopyUsing(UsingInfo *item, const UsingInfo *orig) +{ + item->ItemType = orig->ItemType; + item->Access = orig->Access; + item->Name = orig->Name; + item->Comment = orig->Comment; + item->Scope = orig->Scope; +} -/* Line 1455 of yacc.c */ -#line 494 "vtkParse.y" - { postSig("vtkTypeFloat64 "); (yyval.integer) = VTK_PARSE_FLOAT64; ;} - break; +/* initialize the structure */ +void vtkParse_InitClass(ClassInfo *cls) +{ + cls->ItemType = VTK_CLASS_INFO; + cls->Access = VTK_ACCESS_PUBLIC; + cls->Name = NULL; + cls->Comment = NULL; + cls->Template = NULL; + cls->NumberOfSuperClasses = 0; + cls->NumberOfItems = 0; + cls->NumberOfClasses = 0; + cls->NumberOfFunctions = 0; + cls->NumberOfConstants = 0; + cls->NumberOfVariables = 0; + cls->NumberOfEnums = 0; + cls->NumberOfTypedefs = 0; + cls->NumberOfUsings = 0; + cls->IsAbstract = 0; + cls->HasDelete = 0; +} - case 96: +void vtkParse_CopyClass(ClassInfo *cls, const ClassInfo *orig) +{ + unsigned long i, n; -/* Line 1455 of yacc.c */ -#line 495 "vtkParse.y" - { postSig("float "); (yyval.integer) = 0x1;;} - break; + cls->ItemType = orig->ItemType; + cls->Access = orig->Access; + cls->Name = orig->Name; + cls->Comment = orig->Comment; + cls->Template = NULL; - case 97: + if (orig->Template) + { + cls->Template = (TemplateArgs *)malloc(sizeof(TemplateArgs)); + vtkParse_CopyTemplateArgs(cls->Template, orig->Template); + } -/* Line 1455 of yacc.c */ -#line 496 "vtkParse.y" - { postSig("void "); (yyval.integer) = 0x2;;} - break; + n = orig->NumberOfSuperClasses; + cls->NumberOfSuperClasses = n; + if (n) + { + cls->SuperClasses = (const char **)malloc(n*sizeof(char *)); + for (i = 0; i < n; i++) + { + cls->SuperClasses[i] = orig->SuperClasses[i]; + } + } - case 98: + n = orig->NumberOfItems; + cls->NumberOfItems = n; + if (n) + { + cls->Items = (ItemInfo *)malloc(n*sizeof(ItemInfo)); + for (i = 0; i < n; i++) + { + cls->Items[i].Type = orig->Items[i].Type; + cls->Items[i].Index = orig->Items[i].Index; + } + } -/* Line 1455 of yacc.c */ -#line 497 "vtkParse.y" - { postSig("char "); (yyval.integer) = 0x3;;} - break; + n = orig->NumberOfClasses; + cls->NumberOfClasses = n; + if (n) + { + cls->Classes = (ClassInfo **)malloc(n*sizeof(ClassInfo *)); + for (i = 0; i < n; i++) + { + cls->Classes[i] = (ClassInfo *)malloc(sizeof(ClassInfo)); + vtkParse_CopyClass(cls->Classes[i], orig->Classes[i]); + } + } - case 99: + n = orig->NumberOfFunctions; + cls->NumberOfFunctions = n; + if (n) + { + cls->Functions = (FunctionInfo **)malloc(n*sizeof(FunctionInfo *)); + for (i = 0; i < n; i++) + { + cls->Functions[i] = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + vtkParse_CopyFunction(cls->Functions[i], orig->Functions[i]); + } + } -/* Line 1455 of yacc.c */ -#line 498 "vtkParse.y" - { postSig("int "); (yyval.integer) = 0x4;;} - break; + n = orig->NumberOfConstants; + cls->NumberOfConstants = n; + if (n) + { + cls->Constants = (ValueInfo **)malloc(n*sizeof(ValueInfo *)); + for (i = 0; i < n; i++) + { + cls->Constants[i] = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_CopyValue(cls->Constants[i], orig->Constants[i]); + } + } - case 100: + n = orig->NumberOfVariables; + cls->NumberOfVariables = n; + if (n) + { + cls->Variables = (ValueInfo **)malloc(n*sizeof(ValueInfo *)); + for (i = 0; i < n; i++) + { + cls->Variables[i] = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_CopyValue(cls->Variables[i], orig->Variables[i]); + } + } -/* Line 1455 of yacc.c */ -#line 499 "vtkParse.y" - { postSig("short "); (yyval.integer) = 0x5;;} - break; + n = orig->NumberOfEnums; + cls->NumberOfEnums = n; + if (n) + { + cls->Enums = (EnumInfo **)malloc(n*sizeof(EnumInfo *)); + for (i = 0; i < n; i++) + { + cls->Enums[i] = (EnumInfo *)malloc(sizeof(EnumInfo)); + vtkParse_CopyEnum(cls->Enums[i], orig->Enums[i]); + } + } - case 101: + n = orig->NumberOfTypedefs; + cls->NumberOfTypedefs = n; + if (n) + { + cls->Typedefs = (ValueInfo **)malloc(n*sizeof(ValueInfo *)); + for (i = 0; i < n; i++) + { + cls->Typedefs[i] = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_CopyValue(cls->Typedefs[i], orig->Typedefs[i]); + } + } -/* Line 1455 of yacc.c */ -#line 500 "vtkParse.y" - { postSig("long "); (yyval.integer) = 0x6;;} - break; + n = orig->NumberOfUsings; + cls->NumberOfUsings = n; + if (n) + { + cls->Usings = (UsingInfo **)malloc(n*sizeof(UsingInfo *)); + for (i = 0; i < n; i++) + { + cls->Usings[i] = (UsingInfo *)malloc(sizeof(UsingInfo)); + vtkParse_CopyUsing(cls->Usings[i], orig->Usings[i]); + } + } - case 102: + cls->IsAbstract = orig->IsAbstract; + cls->HasDelete = orig->HasDelete; +} -/* Line 1455 of yacc.c */ -#line 501 "vtkParse.y" - { postSig("double "); (yyval.integer) = 0x7;;} - break; - case 103: +/* initialize the structure */ +void vtkParse_InitNamespace(NamespaceInfo *name_info) +{ + /* namespace info */ + name_info->ItemType = VTK_NAMESPACE_INFO; + name_info->Access = VTK_ACCESS_PUBLIC; + name_info->Name = NULL; + name_info->Comment = NULL; + name_info->NumberOfItems = 0; + name_info->NumberOfClasses = 0; + name_info->NumberOfFunctions = 0; + name_info->NumberOfConstants = 0; + name_info->NumberOfVariables = 0; + name_info->NumberOfEnums = 0; + name_info->NumberOfTypedefs = 0; + name_info->NumberOfUsings = 0; + name_info->NumberOfNamespaces = 0; +} -/* Line 1455 of yacc.c */ -#line 502 "vtkParse.y" - { - char ctmpid[2048]; - sprintf(ctmpid,"%s ",(yyvsp[(1) - (1)].str)); - postSig(ctmpid); - (yyval.integer) = 0x8;;} - break; +void vtkParse_CopyNamespace(NamespaceInfo *ninfo, const NamespaceInfo *orig) +{ + unsigned long i, n; - case 104: + /* namespace info */ + ninfo->ItemType = orig->ItemType; + ninfo->Access = orig->Access; + ninfo->Name = orig->Name; + ninfo->Comment = orig->Comment; -/* Line 1455 of yacc.c */ -#line 508 "vtkParse.y" - { - char ctmpid[2048]; - sprintf(ctmpid,"%s ",((yyvsp[(1) - (1)].vtkid)).name); - postSig(ctmpid); - (yyval.integer) = 0x9; - currentFunction->ArgClasses[currentFunction->NumberOfArguments] = - vtkstrdup(((yyvsp[(1) - (1)].vtkid)).name); - currentFunction->ArgExternals[currentFunction->NumberOfArguments] = - ((yyvsp[(1) - (1)].vtkid)).external; - /* store the string into the return value just in case we need it */ - /* this is a parsing hack because the first "type" parser will */ - /* possibly be ht ereturn type of the first argument */ - if ((!currentFunction->ReturnClass) && - (!currentFunction->NumberOfArguments)) - { - currentFunction->ReturnClass = vtkstrdup(((yyvsp[(1) - (1)].vtkid)).name); - currentFunction->ReturnExternal = ((yyvsp[(1) - (1)].vtkid)).external; - } - ;} - break; + n = orig->NumberOfItems; + ninfo->NumberOfItems = n; + if (n) + { + ninfo->Items = (ItemInfo *)malloc(n*sizeof(ItemInfo)); + for (i = 0; i < n; i++) + { + ninfo->Items[i].Type = orig->Items[i].Type; + ninfo->Items[i].Index = orig->Items[i].Index; + } + } - case 105: + n = orig->NumberOfClasses; + ninfo->NumberOfClasses = n; + if (n) + { + ninfo->Classes = (ClassInfo **)malloc(n*sizeof(ClassInfo *)); + for (i = 0; i < n; i++) + { + ninfo->Classes[i] = (ClassInfo *)malloc(sizeof(ClassInfo)); + vtkParse_CopyClass(ninfo->Classes[i], orig->Classes[i]); + } + } -/* Line 1455 of yacc.c */ -#line 527 "vtkParse.y" - { postSig("vtkIdType "); (yyval.integer) = 0xA;;} - break; + n = orig->NumberOfFunctions; + ninfo->NumberOfFunctions = n; + if (n) + { + ninfo->Functions = (FunctionInfo **)malloc(n*sizeof(FunctionInfo *)); + for (i = 0; i < n; i++) + { + ninfo->Functions[i] = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + vtkParse_CopyFunction(ninfo->Functions[i], orig->Functions[i]); + } + } - case 106: + n = orig->NumberOfConstants; + ninfo->NumberOfConstants = n; + if (n) + { + ninfo->Constants = (ValueInfo **)malloc(n*sizeof(ValueInfo *)); + for (i = 0; i < n; i++) + { + ninfo->Constants[i] = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_CopyValue(ninfo->Constants[i], orig->Constants[i]); + } + } -/* Line 1455 of yacc.c */ -#line 528 "vtkParse.y" - { postSig("long long "); (yyval.integer) = 0xB;;} - break; + n = orig->NumberOfVariables; + ninfo->NumberOfVariables = n; + if (n) + { + ninfo->Variables = (ValueInfo **)malloc(n*sizeof(ValueInfo *)); + for (i = 0; i < n; i++) + { + ninfo->Variables[i] = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_CopyValue(ninfo->Variables[i], orig->Variables[i]); + } + } - case 107: + n = orig->NumberOfEnums; + ninfo->NumberOfEnums = n; + if (n) + { + ninfo->Enums = (EnumInfo **)malloc(n*sizeof(EnumInfo *)); + for (i = 0; i < n; i++) + { + ninfo->Enums[i] = (EnumInfo *)malloc(sizeof(EnumInfo)); + vtkParse_CopyEnum(ninfo->Enums[i], orig->Enums[i]); + } + } -/* Line 1455 of yacc.c */ -#line 529 "vtkParse.y" - { postSig("__int64 "); (yyval.integer) = 0xC;;} - break; + n = orig->NumberOfTypedefs; + ninfo->NumberOfTypedefs = n; + if (n) + { + ninfo->Typedefs = (ValueInfo **)malloc(n*sizeof(ValueInfo *)); + for (i = 0; i < n; i++) + { + ninfo->Typedefs[i] = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_CopyValue(ninfo->Typedefs[i], orig->Typedefs[i]); + } + } - case 108: + n = orig->NumberOfUsings; + ninfo->NumberOfUsings = n; + if (n) + { + ninfo->Usings = (UsingInfo **)malloc(n*sizeof(UsingInfo *)); + for (i = 0; i < n; i++) + { + ninfo->Usings[i] = (UsingInfo *)malloc(sizeof(UsingInfo)); + vtkParse_CopyUsing(ninfo->Usings[i], orig->Usings[i]); + } + } +} -/* Line 1455 of yacc.c */ -#line 530 "vtkParse.y" - { postSig("signed char "); (yyval.integer) = 0xD;;} - break; - case 109: -/* Line 1455 of yacc.c */ -#line 531 "vtkParse.y" - { postSig("bool "); (yyval.integer) = 0xE;;} - break; +void vtkParse_InitFile(FileInfo *file_info) +{ + /* file info */ + file_info->FileName = NULL; + file_info->NameComment = NULL; + file_info->Description = NULL; + file_info->Caveats = NULL; + file_info->SeeAlso = NULL; + + file_info->MainClass = NULL; + file_info->Contents = NULL; +} - case 112: +void vtkParse_FreeTemplateArgs(TemplateArgs *template_info) +{ + int j, m; -/* Line 1455 of yacc.c */ -#line 536 "vtkParse.y" - { - data.SuperClasses[data.NumberOfSuperClasses] = vtkstrdup((yyvsp[(2) - (2)].str)); - data.NumberOfSuperClasses++; - ;} - break; + m = template_info->NumberOfArguments; + for (j = 0; j < m; j++) + { + if (template_info->Arguments[j]->Template) + { + vtkParse_FreeTemplateArgs(template_info->Arguments[j]->Template); + } + free(template_info->Arguments[j]); + } - case 113: + free(template_info); +} -/* Line 1455 of yacc.c */ -#line 541 "vtkParse.y" - { - data.SuperClasses[data.NumberOfSuperClasses] = vtkstrdup((yyvsp[(2) - (2)].str)); - data.NumberOfSuperClasses++; - ;} - break; +void vtkParse_FreeFunction(FunctionInfo *function_info); - case 115: +void vtkParse_FreeValue(ValueInfo *value_info) +{ + if (value_info->NumberOfDimensions) + { + free((char **)value_info->Dimensions); + } + if (value_info->Function) + { + vtkParse_FreeFunction(value_info->Function); + } -/* Line 1455 of yacc.c */ -#line 546 "vtkParse.y" - {in_public = 1; in_protected = 0;;} - break; + free(value_info); +} - case 116: +void vtkParse_FreeEnum(EnumInfo *enum_info) +{ + free(enum_info); +} -/* Line 1455 of yacc.c */ -#line 547 "vtkParse.y" - {in_public = 0; in_protected = 0;;} - break; +void vtkParse_FreeUsing(UsingInfo *using_info) +{ + free(using_info); +} - case 117: +void vtkParse_FreeFunction(FunctionInfo *function_info) +{ + int j, m; -/* Line 1455 of yacc.c */ -#line 548 "vtkParse.y" - {in_public = 0; in_protected = 1;;} - break; + if (function_info->Template) + { + vtkParse_FreeTemplateArgs(function_info->Template); + } - case 120: + m = function_info->NumberOfArguments; + for (j = 0; j < m; j++) { vtkParse_FreeValue(function_info->Arguments[j]); } + if (m > 0) { free(function_info->Arguments); } -/* Line 1455 of yacc.c */ -#line 552 "vtkParse.y" - {(yyval.integer) = (yyvsp[(1) - (1)].integer);;} - break; + if (function_info->ReturnValue) + { + vtkParse_FreeValue(function_info->ReturnValue); + } - case 121: + free(function_info); +} -/* Line 1455 of yacc.c */ -#line 553 "vtkParse.y" - {(yyval.integer) = -1;;} - break; +void vtkParse_FreeClass(ClassInfo *class_info) +{ + int j, m; - case 122: + if (class_info->Template) { vtkParse_FreeTemplateArgs(class_info->Template); } -/* Line 1455 of yacc.c */ -#line 553 "vtkParse.y" - {(yyval.integer) = -1;;} - break; + m = class_info->NumberOfSuperClasses; + if (m > 0) { free((char **)class_info->SuperClasses); } - case 123: + m = class_info->NumberOfClasses; + for (j = 0; j < m; j++) { vtkParse_FreeClass(class_info->Classes[j]); } + if (m > 0) { free(class_info->Classes); } -/* Line 1455 of yacc.c */ -#line 557 "vtkParse.y" - {preSig("void Set"); postSig(" ("); ;} - break; + m = class_info->NumberOfFunctions; + for (j = 0; j < m; j++) { vtkParse_FreeFunction(class_info->Functions[j]); } + if (m > 0) { free(class_info->Functions); } - case 124: + m = class_info->NumberOfConstants; + for (j = 0; j < m; j++) { vtkParse_FreeValue(class_info->Constants[j]); } + if (m > 0) { free(class_info->Constants); } -/* Line 1455 of yacc.c */ -#line 558 "vtkParse.y" - { - postSig(");"); - sprintf(temps,"Set%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 0; - currentFunction->ReturnType = 0x2; - output_function(); - ;} - break; + m = class_info->NumberOfVariables; + for (j = 0; j < m; j++) { vtkParse_FreeValue(class_info->Variables[j]); } + if (m > 0) { free(class_info->Variables); } - case 125: + m = class_info->NumberOfEnums; + for (j = 0; j < m; j++) { vtkParse_FreeEnum(class_info->Enums[j]); } + if (m > 0) { free(class_info->Enums); } -/* Line 1455 of yacc.c */ -#line 568 "vtkParse.y" - {postSig("Get");;} - break; + m = class_info->NumberOfTypedefs; + for (j = 0; j < m; j++) { vtkParse_FreeValue(class_info->Typedefs[j]); } + if (m > 0) { free(class_info->Typedefs); } - case 126: + m = class_info->NumberOfUsings; + for (j = 0; j < m; j++) { vtkParse_FreeUsing(class_info->Usings[j]); } + if (m > 0) { free(class_info->Usings); } -/* Line 1455 of yacc.c */ -#line 568 "vtkParse.y" - {postSig(" ();"); invertSig = 1;;} - break; + if (class_info->NumberOfItems > 0) { free(class_info->Items); } - case 127: + free(class_info); +} -/* Line 1455 of yacc.c */ -#line 570 "vtkParse.y" - { - sprintf(temps,"Get%s",(yyvsp[(4) - (8)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = (yyvsp[(7) - (8)].integer); - output_function(); - ;} - break; +void vtkParse_FreeNamespace(NamespaceInfo *namespace_info) +{ + int j, m; - case 128: + m = namespace_info->NumberOfClasses; + for (j = 0; j < m; j++) { vtkParse_FreeClass(namespace_info->Classes[j]); } + if (m > 0) { free(namespace_info->Classes); } -/* Line 1455 of yacc.c */ -#line 577 "vtkParse.y" - {preSig("void Set");;} - break; + m = namespace_info->NumberOfFunctions; + for (j=0; jFunctions[j]); } + if (m > 0) { free(namespace_info->Functions); } - case 129: + m = namespace_info->NumberOfConstants; + for (j=0; jConstants[j]); } + if (m > 0) { free(namespace_info->Constants); } -/* Line 1455 of yacc.c */ -#line 578 "vtkParse.y" - { - postSig(" (char *);"); - sprintf(temps,"Set%s",(yyvsp[(4) - (5)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x303; - currentFunction->ArgCounts[0] = 0; - currentFunction->ReturnType = 0x2; - output_function(); - ;} - break; + m = namespace_info->NumberOfVariables; + for (j=0; jVariables[j]); } + if (m > 0) { free(namespace_info->Variables); } - case 130: + m = namespace_info->NumberOfEnums; + for (j = 0; j < m; j++) { vtkParse_FreeEnum(namespace_info->Enums[j]); } + if (m > 0) { free(namespace_info->Enums); } -/* Line 1455 of yacc.c */ -#line 588 "vtkParse.y" - {preSig("char *Get");;} - break; + m = namespace_info->NumberOfTypedefs; + for (j = 0; j < m; j++) { vtkParse_FreeValue(namespace_info->Typedefs[j]); } + if (m > 0) { free(namespace_info->Typedefs); } - case 131: + m = namespace_info->NumberOfUsings; + for (j = 0; j < m; j++) { vtkParse_FreeUsing(namespace_info->Usings[j]); } + if (m > 0) { free(namespace_info->Usings); } -/* Line 1455 of yacc.c */ -#line 589 "vtkParse.y" - { - postSig(" ();"); - sprintf(temps,"Get%s",(yyvsp[(4) - (5)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x303; - output_function(); - ;} - break; + m = namespace_info->NumberOfNamespaces; + for (j=0; jNamespaces[j]);} + if (m > 0) { free(namespace_info->Namespaces); } - case 132: + free(namespace_info); +} -/* Line 1455 of yacc.c */ -#line 598 "vtkParse.y" - {preSig("void Set"); postSig(" ("); ;} - break; +/* check whether this is the class we are looking for */ +void start_class(const char *classname, int is_struct_or_union) +{ + ClassInfo *outerClass = currentClass; + pushClass(); + currentClass = (ClassInfo *)malloc(sizeof(ClassInfo)); + vtkParse_InitClass(currentClass); + currentClass->Name = vtkstrdup(classname); + if (is_struct_or_union == 1) + { + currentClass->ItemType = VTK_STRUCT_INFO; + } + if (is_struct_or_union == 2) + { + currentClass->ItemType = VTK_UNION_INFO; + } - case 133: + if (outerClass) + { + vtkParse_AddClassToClass(outerClass, currentClass); + } + else + { + vtkParse_AddClassToNamespace(currentNamespace, currentClass); + } -/* Line 1455 of yacc.c */ -#line 599 "vtkParse.y" - {postSig(");"); openSig = 0;;} - break; + /* template information */ + if (currentTemplate) + { + currentClass->Template = currentTemplate; + currentTemplate = NULL; + } - case 134: + /* comment, if any */ + currentClass->Comment = vtkstrdup(getComment()); -/* Line 1455 of yacc.c */ -#line 600 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sscanf (currentFunction->Signature, "%*s %*s (%s);", local); - sprintf(temps,"Set%s",(yyvsp[(3) - (10)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = (yyvsp[(6) - (10)].integer); - currentFunction->ArgCounts[0] = 0; - currentFunction->ReturnType = 0x2; - output_function(); + access_level = VTK_ACCESS_PRIVATE; + if (is_struct_or_union) + { + access_level = VTK_ACCESS_PUBLIC; + } - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"%s Get%sMinValue ();",local,(yyvsp[(3) - (10)].str)); - sprintf(temps,"Get%sMinValue",(yyvsp[(3) - (10)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = (yyvsp[(6) - (10)].integer); - output_function(); + vtkParse_InitFunction(currentFunction); + startSig(); + clearComment(); +} - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"%s Get%sMaxValue ();",local,(yyvsp[(3) - (10)].str)); - sprintf(temps,"Get%sMaxValue",(yyvsp[(3) - (10)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = (yyvsp[(6) - (10)].integer); - output_function(); - ;} - break; +/* reject the class */ +void reject_class(const char *classname, int is_struct_or_union) +{ + static ClassInfo static_class; - case 135: + pushClass(); + currentClass = &static_class; + currentClass->Name = vtkstrdup(classname); + vtkParse_InitClass(currentClass); -/* Line 1455 of yacc.c */ -#line 630 "vtkParse.y" - {preSig("void Set"); postSig(" ("); ;} - break; + access_level = VTK_ACCESS_PRIVATE; + if (is_struct_or_union) + { + access_level = VTK_ACCESS_PUBLIC; + } - case 136: + vtkParse_InitFunction(currentFunction); + startSig(); + clearComment(); +} -/* Line 1455 of yacc.c */ -#line 631 "vtkParse.y" - { - postSig("*);"); - sprintf(temps,"Set%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x309; - currentFunction->ArgCounts[0] = 1; - currentFunction->ReturnType = 0x2; - output_function(); - ;} - break; +/* reached the end of a class definition */ +void end_class() +{ + /* add default constructors */ + vtkParse_AddDefaultConstructors(currentClass); - case 137: + popClass(); +} -/* Line 1455 of yacc.c */ -#line 642 "vtkParse.y" - {preSig("void Set"); postSig(" ("); ;} - break; +/* add a using declaration or directive */ +void add_using(const char *name, int is_namespace) +{ + size_t i; + UsingInfo *item; - case 138: + item = (UsingInfo *)malloc(sizeof(UsingInfo)); + vtkParse_InitUsing(item); + if (is_namespace) + { + item->Name = NULL; + item->Scope = vtkstrdup(name); + } + else + { + i = strlen(name); + while (i > 0 && name[i-1] != ':') { i--; } + item->Name = vtkstrdup(&name[i]); + while (i > 0 && name[i-1] == ':') { i--; } + item->Scope = vtkstrndup(name, i); + } -/* Line 1455 of yacc.c */ -#line 643 "vtkParse.y" - { - postSig("*);"); - sprintf(temps,"Set%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x309; - currentFunction->ArgCounts[0] = 1; - currentFunction->ReturnType = 0x2; - output_function(); - ;} - break; + if (currentClass) + { + vtkParse_AddUsingToClass(currentClass, item); + } + else + { + vtkParse_AddUsingToNamespace(currentNamespace, item); + } +} - case 139: +/* start a new enum */ +void start_enum(const char *name) +{ + static char text[256]; + EnumInfo *item; -/* Line 1455 of yacc.c */ -#line 653 "vtkParse.y" - {postSig("*Get");;} - break; + currentEnumName = "int"; + currentEnumValue = NULL; + if (name) + { + strcpy(text, name); + currentEnumName = text; + item = (EnumInfo *)malloc(sizeof(EnumInfo)); + vtkParse_InitEnum(item); + item->Name = vtkstrdup(name); + item->Access = access_level; + if (currentClass) + { + vtkParse_AddEnumToClass(currentClass, item); + } + else + { + vtkParse_AddEnumToNamespace(currentNamespace, item); + } + } +} - case 140: +/* finish the enum */ +void end_enum() +{ + currentEnumName = NULL; + currentEnumValue = NULL; +} -/* Line 1455 of yacc.c */ -#line 654 "vtkParse.y" - {postSig(" ();"); invertSig = 1;;} - break; +/* add a constant to the enum */ +void add_enum(const char *name, const char *value) +{ + static char text[2048]; + int i; + long j; - case 141: + if (value) + { + strcpy(text, value); + currentEnumValue = text; + } + else if (currentEnumValue) + { + i = strlen(text); + while (i > 0 && text[i-1] >= '0' && + text[i-1] <= '9') { i--; } -/* Line 1455 of yacc.c */ -#line 655 "vtkParse.y" - { - sprintf(temps,"Get%s",(yyvsp[(4) - (8)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x309; - output_function(); - ;} - break; + if (i == 0 || text[i-1] == ' ' || + (i > 1 && text[i-2] == ' ' && + (text[i-1] == '-' || text[i-1] == '+'))) + { + if (i > 0 && text[i-1] != ' ') + { + i--; + } + j = (int)strtol(&text[i], NULL, 10); + sprintf(&text[i], "%li", j+1); + } + else + { + i = strlen(text); + strcpy(&text[i], " + 1"); + } + } + else + { + strcpy(text, "0"); + currentEnumValue = text; + } - case 142: + add_constant(name, currentEnumValue, VTK_PARSE_INT, currentEnumName, 2); +} -/* Line 1455 of yacc.c */ -#line 663 "vtkParse.y" - {preSig("void "); postSig("On ();"); openSig = 0; ;} - break; +/* for a macro constant, guess the constant type */ +unsigned int guess_constant_type(const char *valstring) +{ + unsigned int valtype = 0; + size_t k; + int i; + int is_name = 0; - case 143: + if (valstring == NULL || valstring[0] == '\0') + { + return 0; + } -/* Line 1455 of yacc.c */ -#line 665 "vtkParse.y" - { - sprintf(temps,"%sOn",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x2; - output_function(); - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void %sOff ();",(yyvsp[(3) - (7)].str)); - sprintf(temps,"%sOff",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - output_function(); - ;} - break; + if (valstring[0] < '0' || valstring[0] > '9') + { + k = 0; + while ((valstring[k] >= '0' && valstring[k] <= '9') || + (valstring[k] >= 'a' && valstring[k] <= 'z') || + (valstring[k] >= 'A' && valstring[k] <= 'Z') || + valstring[k] == '_') { k++; } - case 144: + if (valstring[k] == '\0') + { + is_name = 1; + } + } -/* Line 1455 of yacc.c */ -#line 680 "vtkParse.y" + if (strcmp(valstring, "true") == 0 || strcmp(valstring, "false") == 0) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; + return VTK_PARSE_BOOL; + } - case 145: + if (valstring[0] == '\'') + { + return VTK_PARSE_CHAR; + } -/* Line 1455 of yacc.c */ -#line 685 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"void Set%s (%s, %s);",(yyvsp[(3) - (7)].str), - local, local); - sprintf(temps,"Set%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 2; - currentFunction->ArgTypes[0] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 0; - currentFunction->ArgTypes[1] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[1] = 0; - currentFunction->ReturnType = 0x2; - output_function(); + if (strncmp(valstring, "VTK_TYPE_CAST(", 14) == 0 || + strncmp(valstring, "static_cast<", 12) == 0 || + strncmp(valstring, "const_cast<", 11) == 0 || + strncmp(valstring, "(", 1) == 0) + { + const char *cp; + size_t n; + int is_unsigned = 0; - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void Set%s (%s a[2]);",(yyvsp[(3) - (7)].str), - local); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x300 + (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 0x2; - output_function(); - ;} - break; + cp = &valstring[1]; + if (valstring[0] == 'c') + { + cp = &valstring[11]; + } + else if (valstring[0] == 's') + { + cp = &valstring[12]; + } + else if (valstring[0] == 'V') + { + cp = &valstring[14]; + } - case 146: + if (strncmp(cp, "unsigned ", 9) == 0) + { + is_unsigned = 1; + cp += 9; + } -/* Line 1455 of yacc.c */ -#line 710 "vtkParse.y" - { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; + n = strlen(cp); + for (k = 0; k < n && cp[k] != ',' && + cp[k] != '>' && cp[k] != ')'; k++) { ; }; + + if (strncmp(cp, "long long", k) == 0) + { valtype = VTK_PARSE_LONG_LONG; } + else if (strncmp(cp, "__int64", k) == 0) + { valtype = VTK_PARSE___INT64; } + else if (strncmp(cp, "long", k) == 0) + { valtype = VTK_PARSE_LONG; } + else if (strncmp(cp, "short", k) == 0) + { valtype = VTK_PARSE_SHORT; } + else if (strncmp(cp, "signed char", k) == 0) + { valtype = VTK_PARSE_SIGNED_CHAR; } + else if (strncmp(cp, "char", k) == 0) + { valtype = VTK_PARSE_CHAR; } + else if (strncmp(cp, "int", k) == 0 || + strncmp(cp, "signed", k) == 0) + { valtype = VTK_PARSE_INT; } + else if (strncmp(cp, "float", k) == 0) + { valtype = VTK_PARSE_FLOAT; } + else if (strncmp(cp, "double", k) == 0) + { valtype = VTK_PARSE_DOUBLE; } + else if (strncmp(cp, "char *", k) == 0) + { valtype = VTK_PARSE_CHAR_PTR; } + + if (is_unsigned) + { + if (valtype == 0) { valtype = VTK_PARSE_INT; } + valtype = (valtype | VTK_PARSE_UNSIGNED); + } - case 147: + if (valtype != 0) + { + return valtype; + } + } -/* Line 1455 of yacc.c */ -#line 715 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"%s *Get%s ();",local, (yyvsp[(3) - (7)].str)); - sprintf(temps,"Get%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x300 + (yyvsp[(6) - (7)].integer); - currentFunction->HaveHint = 1; - currentFunction->HintSize = 2; - output_function(); - ;} - break; + /* check the current scope */ + if (is_name) + { + NamespaceInfo *scope = currentNamespace; + if (namespaceDepth > 0) + { + scope = namespaceStack[0]; + } - case 148: + for (i = 0; i < scope->NumberOfConstants; i++) + { + if (strcmp(scope->Constants[i]->Name, valstring) == 0) + { + return scope->Constants[i]->Type; + } + } + } -/* Line 1455 of yacc.c */ -#line 727 "vtkParse.y" + /* check for preprocessor macros */ + if (is_name) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; + MacroInfo *macro = vtkParsePreprocess_GetMacro( + &preprocessor, valstring); - case 149: + if (macro && !macro->IsFunction) + { + return guess_constant_type(macro->Definition); + } + } -/* Line 1455 of yacc.c */ -#line 732 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"void Set%s (%s, %s, %s);", - (yyvsp[(3) - (7)].str), local, local, local); - sprintf(temps,"Set%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 3; - currentFunction->ArgTypes[0] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 0; - currentFunction->ArgTypes[1] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[1] = 0; - currentFunction->ArgTypes[2] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[2] = 0; - currentFunction->ReturnType = 0x2; - output_function(); + /* fall back to the preprocessor to evaluate the constant */ + { + preproc_int_t val; + int is_unsigned; + int result = vtkParsePreprocess_EvaluateExpression( + &preprocessor, valstring, &val, &is_unsigned); - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void Set%s (%s a[3]);",(yyvsp[(3) - (7)].str), - local); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x300 + (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 3; - output_function(); - ;} - break; + if (result == VTK_PARSE_PREPROC_DOUBLE) + { + return VTK_PARSE_DOUBLE; + } + else if (result == VTK_PARSE_PREPROC_FLOAT) + { + return VTK_PARSE_FLOAT; + } + else if (result == VTK_PARSE_PREPROC_STRING) + { + return VTK_PARSE_CHAR_PTR; + } + else if (result == VTK_PARSE_OK) + { + if (is_unsigned) + { + if ((preproc_uint_t)val <= VTK_UNSIGNED_INT_MAX) + { + return VTK_PARSE_UNSIGNED_INT; + } + else + { +#if defined(VTK_TYPE_USE_LONG_LONG) + return VTK_PARSE_UNSIGNED_LONG_LONG; +#elif defined(VTK_TYPE_USE___INT64) + return VTK_PARSE_UNSIGNED___INT64; +#else + return VTK_PARSE_UNSIGNED_LONG; +#endif + } + } + else + { + if (val >= VTK_INT_MIN && val <= VTK_INT_MAX) + { + return VTK_PARSE_INT; + } + else + { +#if defined(VTK_TYPE_USE_LONG_LONG) + return VTK_PARSE_LONG_LONG; +#elif defined(VTK_TYPE_USE___INT64) + return VTK_PARSE___INT64; +#else + return VTK_PARSE_LONG; +#endif + } + } + } + } - case 150: + return 0; +} -/* Line 1455 of yacc.c */ -#line 759 "vtkParse.y" +/* add a constant to the current class or namespace */ +void add_constant(const char *name, const char *value, + unsigned int type, const char *typeclass, int flag) +{ + ValueInfo *con = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(con); + con->ItemType = VTK_CONSTANT_INFO; + con->Name = vtkstrdup(name); + con->Value = vtkstrdup(value); + con->Type = type; + if (typeclass) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; - - case 151: - -/* Line 1455 of yacc.c */ -#line 764 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"%s *Get%s ();",local, (yyvsp[(3) - (7)].str)); - sprintf(temps,"Get%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x300 + (yyvsp[(6) - (7)].integer); - currentFunction->HaveHint = 1; - currentFunction->HintSize = 3; - output_function(); - ;} - break; - - case 152: + con->Class = vtkstrdup(typeclass); + } -/* Line 1455 of yacc.c */ -#line 776 "vtkParse.y" + if (flag == 2) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; - - case 153: + con->IsEnum = 1; + } -/* Line 1455 of yacc.c */ -#line 781 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"void Set%s (%s, %s, %s, %s);", - (yyvsp[(3) - (7)].str), local, local, local, local); - sprintf(temps,"Set%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 4; - currentFunction->ArgTypes[0] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 0; - currentFunction->ArgTypes[1] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[1] = 0; - currentFunction->ArgTypes[2] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[2] = 0; - currentFunction->ArgTypes[3] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[3] = 0; - currentFunction->ReturnType = 0x2; - output_function(); + if (flag == 1) + { + con->Access = VTK_ACCESS_PUBLIC; + if (con->Type == 0) + { + con->Type = guess_constant_type(con->Value); + } + vtkParse_AddConstantToNamespace(data.Contents, con); + } + else if (currentClass) + { + con->Access = access_level; + vtkParse_AddConstantToClass(currentClass, con); + } + else + { + con->Access = VTK_ACCESS_PUBLIC; + vtkParse_AddConstantToNamespace(currentNamespace, con); + } +} - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void Set%s (%s a[4]);",(yyvsp[(3) - (7)].str), - local); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x300 + (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 4; - output_function(); - ;} - break; +/* if the name is a const in this namespace, the scope it */ +const char *add_const_scope(const char *name) +{ + static char text[256]; + NamespaceInfo *scope = currentNamespace; + int i, j; + int addscope = 0; - case 154: + strcpy(text, name); -/* Line 1455 of yacc.c */ -#line 810 "vtkParse.y" + if (currentClass) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; + for (j = 0; j < currentClass->NumberOfConstants; j++) + { + if (strcmp(currentClass->Constants[j]->Name, text) == 0) + { + prepend_scope(text, currentClass->Name); + addscope = 1; + } + } + } + i = namespaceDepth; + while (scope && scope->Name) + { + if (addscope) + { + prepend_scope(text, scope->Name); + } + else + { + for (j = 0; j < scope->NumberOfConstants; j++) + { + if (strcmp(scope->Constants[j]->Name, text) == 0) + { + prepend_scope(text, scope->Name); + addscope = 1; + } + } + } - case 155: + scope = 0; + if (i > 0) + { + scope = namespaceStack[--i]; + } + } -/* Line 1455 of yacc.c */ -#line 815 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"%s *Get%s ();",local, (yyvsp[(3) - (7)].str)); - sprintf(temps,"Get%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x300 + (yyvsp[(6) - (7)].integer); - currentFunction->HaveHint = 1; - currentFunction->HintSize = 4; - output_function(); - ;} - break; + return text; +} - case 156: +/* add an arg to a function */ +void add_argument(FunctionInfo *func, unsigned int type, + const char *typeclass, int count) +{ + int i = func->NumberOfArguments; + char text[64]; + ValueInfo *arg = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(arg); -/* Line 1455 of yacc.c */ -#line 827 "vtkParse.y" + arg->Type = type; + if (typeclass) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; + arg->Class = vtkstrdup(typeclass); + } - case 157: + if (count) + { + arg->Count = count; + sprintf(text, "%i", count); + vtkParse_AddStringToArray(&arg->Dimensions, &arg->NumberOfDimensions, + vtkstrdup(text)); + } -/* Line 1455 of yacc.c */ -#line 832 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"void Set%s (%s, %s, %s, %s, %s, %s);", - (yyvsp[(3) - (7)].str), local, local, local, local, local, local); - sprintf(temps,"Set%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 6; - currentFunction->ArgTypes[0] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 0; - currentFunction->ArgTypes[1] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[1] = 0; - currentFunction->ArgTypes[2] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[2] = 0; - currentFunction->ArgTypes[3] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[3] = 0; - currentFunction->ArgTypes[4] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[4] = 0; - currentFunction->ArgTypes[5] = (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[5] = 0; - currentFunction->ReturnType = 0x2; - output_function(); + func->ArgTypes[i] = arg->Type; + func->ArgClasses[i] = arg->Class; + func->ArgCounts[i] = count; - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void Set%s (%s a[6]);",(yyvsp[(3) - (7)].str), - local); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x300 + (yyvsp[(6) - (7)].integer); - currentFunction->ArgCounts[0] = 6; - output_function(); - ;} - break; + vtkParse_AddArgumentToFunction(func, arg); +} - case 158: +/* set the return type for the current function */ +void set_return(FunctionInfo *func, unsigned int type, + const char *typeclass, int count) +{ + char text[64]; + ValueInfo *val = (ValueInfo *)malloc(sizeof(ValueInfo)); -/* Line 1455 of yacc.c */ -#line 865 "vtkParse.y" + vtkParse_InitValue(val); + val->Type = type; + if (typeclass) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; + val->Class = vtkstrdup(typeclass); + } - case 159: + if (count) + { + val->Count = count; + sprintf(text, "%i", count); + vtkParse_AddStringToArray(&val->Dimensions, &val->NumberOfDimensions, + vtkstrdup(text)); + func->HaveHint = 1; + } -/* Line 1455 of yacc.c */ -#line 870 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"%s *Get%s ();",local, (yyvsp[(3) - (7)].str)); - sprintf(temps,"Get%s",(yyvsp[(3) - (7)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x300 + (yyvsp[(6) - (7)].integer); - currentFunction->HaveHint = 1; - currentFunction->HintSize = 6; - output_function(); - ;} - break; + func->ReturnValue = val; + func->ReturnType = val->Type; + func->ReturnClass = val->Class; + func->HintSize = count; +} - case 160: +/* deal with types that include function pointers or arrays */ +void handle_complex_type( + ValueInfo *val, unsigned int datatype, unsigned int extra, + const char *funcSig) +{ + FunctionInfo *func = 0; + int i, n; + const char *cp; -/* Line 1455 of yacc.c */ -#line 882 "vtkParse.y" + /* if "extra" was set, parentheses were involved */ + if ((extra & VTK_PARSE_BASE_TYPE) == VTK_PARSE_FUNCTION) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; - - case 161: - -/* Line 1455 of yacc.c */ -#line 887 "vtkParse.y" + /* the current type becomes the function return type */ + func = getFunction(); + func->ReturnValue = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(func->ReturnValue); + func->ReturnValue->Type = datatype; + func->ReturnValue->Class = vtkstrdup(getTypeId()); + func->ReturnType = func->ReturnValue->Type; + func->ReturnClass = func->ReturnValue->Class; + if (funcSig) { func->Signature = vtkstrdup(funcSig); } + val->Function = func; + + /* the val type is whatever was inside the parentheses */ + clearTypeId(); + setTypeId(func->Class ? "method" : "function"); + datatype = (extra & VTK_PARSE_UNQUALIFIED_TYPE); + } + else if ((extra & VTK_PARSE_INDIRECT) == VTK_PARSE_BAD_INDIRECT) { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"void Set%s (%s [%i]);",(yyvsp[(3) - (9)].str), - local, (yyvsp[(8) - (9)].integer)); - sprintf(temps,"Set%s",(yyvsp[(3) - (9)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->ReturnType = 0x2; - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x300 + (yyvsp[(6) - (9)].integer); - currentFunction->ArgCounts[0] = (yyvsp[(8) - (9)].integer); - output_function(); - ;} - break; - - case 162: - -/* Line 1455 of yacc.c */ -#line 900 "vtkParse.y" + datatype = (datatype | VTK_PARSE_BAD_INDIRECT); + } + else if ((extra & VTK_PARSE_INDIRECT) != 0) { - free (currentFunction->Signature); - currentFunction->Signature = NULL; - ;} - break; - - case 163: - -/* Line 1455 of yacc.c */ -#line 905 "vtkParse.y" - { - char *local = vtkstrdup(currentFunction->Signature); - sprintf(currentFunction->Signature,"%s *Get%s ();",local, (yyvsp[(3) - (9)].str)); - sprintf(temps,"Get%s",(yyvsp[(3) - (9)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x300 + (yyvsp[(6) - (9)].integer); - currentFunction->HaveHint = 1; - currentFunction->HintSize = (yyvsp[(8) - (9)].integer); - output_function(); - ;} - break; + extra = (extra & VTK_PARSE_INDIRECT); - case 164: + if ((extra & VTK_PARSE_REF) != 0) + { + datatype = (datatype | VTK_PARSE_REF); + extra = (extra & ~VTK_PARSE_REF); + } -/* Line 1455 of yacc.c */ -#line 917 "vtkParse.y" - { - sprintf(currentFunction->Signature,"vtkCoordinate *Get%sCoordinate ();", - (yyvsp[(3) - (4)].str)); + if (extra != 0 && getArrayNDims() > 0) + { + /* pointer represents an unsized array bracket */ + datatype = add_indirection(datatype, VTK_PARSE_ARRAY); + extra = ((extra >> 2) & VTK_PARSE_POINTER_MASK); + } - sprintf(temps,"Get%sCoordinate",(yyvsp[(3) - (4)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x309; - currentFunction->ReturnClass = vtkstrdup("vtkCoordinate"); - output_function(); + datatype = add_indirection(datatype, extra); + } - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void Set%s (double, double);", - (yyvsp[(3) - (4)].str)); - sprintf(temps,"Set%s",(yyvsp[(3) - (4)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 2; - currentFunction->ArgTypes[0] = 0x7; - currentFunction->ArgCounts[0] = 0; - currentFunction->ArgTypes[1] = 0x7; - currentFunction->ArgCounts[1] = 0; - currentFunction->ReturnType = 0x2; - output_function(); + if (getArrayNDims() == 1) + { + if ((datatype & VTK_PARSE_POINTER_LOWMASK) != VTK_PARSE_ARRAY) + { + /* turn the first set of brackets into a pointer */ + datatype = add_indirection(datatype, VTK_PARSE_POINTER); + } + else + { + pushArrayFront(""); + } + } + else if (getArrayNDims() > 1) + { + if ((datatype & VTK_PARSE_POINTER_LOWMASK) != VTK_PARSE_ARRAY) + { + /* turn the first set of brackets into a pointer */ + datatype = add_indirection(datatype, VTK_PARSE_ARRAY); + } + else + { + pushArrayFront(""); + } + } - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void Set%s (double a[2]);", - (yyvsp[(3) - (4)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x307; - currentFunction->ArgCounts[0] = 2; - output_function(); - - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"double *Get%s ();", (yyvsp[(3) - (4)].str)); - sprintf(temps,"Get%s",(yyvsp[(3) - (4)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x307; - currentFunction->HaveHint = 1; - currentFunction->HintSize = 2; - output_function(); - ;} - break; + /* get the data type */ + val->Type = datatype; + val->Class = vtkstrdup(getTypeId()); - case 165: + /* copy contents of all brackets to the ArgDimensions */ + val->NumberOfDimensions = getArrayNDims(); + val->Dimensions = getArray(); + clearArray(); -/* Line 1455 of yacc.c */ -#line 964 "vtkParse.y" - { - sprintf(currentFunction->Signature,"vtkCoordinate *Get%sCoordinate ();", - (yyvsp[(3) - (4)].str)); + /* count is the product of the dimensions */ + val->Count = 0; + if (val->NumberOfDimensions) + { + val->Count = 1; + for (i = 0; i < val->NumberOfDimensions; i++) + { + n = 0; + cp = val->Dimensions[i]; + if (cp[0] != '\0') + { + while (*cp != '\0' && *cp >= '0' && *cp <= '9') { cp++; } + if (*cp == '\0') + { + n = (int)strtol(val->Dimensions[i], NULL, 0); + } + } + val->Count *= n; + } + } +} - sprintf(temps,"Get%sCoordinate",(yyvsp[(3) - (4)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x309; - currentFunction->ReturnClass = vtkstrdup("vtkCoordinate"); - output_function(); +/* specifically handle a VAR_FUNCTION argument */ +void handle_function_type( + ValueInfo *arg, const char *name, const char *funcSig) +{ + FunctionInfo *func; + size_t j; - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void Set%s (double, double, double);", - (yyvsp[(3) - (4)].str)); - sprintf(temps,"Set%s",(yyvsp[(3) - (4)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 3; - currentFunction->ArgTypes[0] = 0x7; - currentFunction->ArgCounts[0] = 0; - currentFunction->ArgTypes[1] = 0x7; - currentFunction->ArgCounts[1] = 0; - currentFunction->ArgTypes[2] = 0x7; - currentFunction->ArgCounts[2] = 0; - currentFunction->ReturnType = 0x2; - output_function(); + arg->Type = VTK_PARSE_FUNCTION; + arg->Class = vtkstrdup("function"); - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"void Set%s (double a[3]);", - (yyvsp[(3) - (4)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x307; - currentFunction->ArgCounts[0] = 3; - output_function(); - - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature,"double *Get%s ();", (yyvsp[(3) - (4)].str)); - sprintf(temps,"Get%s",(yyvsp[(3) - (4)].str)); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x307; - currentFunction->HaveHint = 1; - currentFunction->HintSize = 3; - output_function(); - ;} - break; + if (name && name[0] != '\0') + { + arg->Name = vtkstrdup(name); + } - case 166: + func = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + vtkParse_InitFunction(func); + add_argument(func, VTK_PARSE_VOID_PTR, "void", 0); + set_return(func, VTK_PARSE_VOID, "void", 0); + j = strlen(funcSig); + while (j > 0 && funcSig[j-1] == ' ') + { + j--; + } -/* Line 1455 of yacc.c */ -#line 1013 "vtkParse.y" - { - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature, "const char *GetClassName ();"); - sprintf(temps,"GetClassName"); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x1303; - output_function(); + func->Signature = vtkstrndup(funcSig, j); + arg->Function = func; +} - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature, - "int IsA (const char *name);"); - sprintf(temps,"IsA"); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x1303; - currentFunction->ArgCounts[0] = 0; - currentFunction->ReturnType = 0x4; - output_function(); - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature, "%s *NewInstance ();", - (yyvsp[(3) - (6)].str)); - sprintf(temps,"NewInstance"); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x309; - currentFunction->ReturnClass = vtkstrdup((yyvsp[(3) - (6)].str)); - output_function(); +/* reject the function, do not output it */ +void reject_function() +{ + vtkParse_InitFunction(currentFunction); + startSig(); +} - if ( data.IsConcrete ) - { - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature, "%s *SafeDownCast (vtkObject* o);", - (yyvsp[(3) - (6)].str)); - sprintf(temps,"SafeDownCast"); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x309; - currentFunction->ArgCounts[0] = 1; - currentFunction->ArgClasses[0] = vtkstrdup("vtkObject"); - currentFunction->ReturnType = 0x2309; - currentFunction->ReturnClass = vtkstrdup((yyvsp[(3) - (6)].str)); - output_function(); - } - ;} - break; +/* a simple routine that updates a few variables */ +void output_function() +{ + size_t n; + int i, j; + int match; - case 167: + /* reject template specializations */ + n = strlen(currentFunction->Name); + if (currentFunction->Name[n-1] == '>') + { + /* make sure there is a matching angle bracket */ + while (n > 0 && currentFunction->Name[n-1] != '<') { n--; } + if (n > 0) + { + reject_function(); + return; + } + } -/* Line 1455 of yacc.c */ -#line 1064 "vtkParse.y" - { - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature, "const char *GetClassName ();"); - sprintf(temps,"GetClassName"); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x1303; - output_function(); + /* static */ + if (currentFunction->ReturnType & VTK_PARSE_STATIC) + { + currentFunction->IsStatic = 1; + } - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature, - "int IsA (const char *name);"); - sprintf(temps,"IsA"); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x1303; - currentFunction->ArgCounts[0] = 0; - currentFunction->ReturnType = 0x4; - output_function(); + /* the signature */ + if (!currentFunction->Signature) + { + currentFunction->Signature = getSig(); + } - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature, "%s *NewInstance ();", - (yyvsp[(3) - (7)].str)); - sprintf(temps,"NewInstance"); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 0; - currentFunction->ReturnType = 0x309; - currentFunction->ReturnClass = vtkstrdup((yyvsp[(3) - (7)].str)); - output_function(); + /* template information */ + if (currentTemplate) + { + currentFunction->Template = currentTemplate; + currentTemplate = NULL; + } - if ( data.IsConcrete ) - { - currentFunction->Signature = (char *)malloc(2048); - sigAllocatedLength = 2048; - sprintf(currentFunction->Signature, "%s *SafeDownCast (vtkObject* o);", - (yyvsp[(3) - (7)].str)); - sprintf(temps,"SafeDownCast"); - currentFunction->Name = vtkstrdup(temps); - currentFunction->NumberOfArguments = 1; - currentFunction->ArgTypes[0] = 0x309; - currentFunction->ArgCounts[0] = 1; - currentFunction->ArgClasses[0] = vtkstrdup("vtkObject"); - currentFunction->ReturnType = 0x2309; - currentFunction->ReturnClass = vtkstrdup((yyvsp[(3) - (7)].str)); - output_function(); - } - ;} - break; + /* a void argument is the same as no arguments */ + if (currentFunction->NumberOfArguments == 1 && + (currentFunction->Arguments[0]->Type & VTK_PARSE_UNQUALIFIED_TYPE) == + VTK_PARSE_VOID) + { + currentFunction->NumberOfArguments = 0; + } + /* if return type is void, set return class to void */ + if (currentFunction->ReturnClass == NULL && + (currentFunction->ReturnType & VTK_PARSE_UNQUALIFIED_TYPE) == + VTK_PARSE_VOID) + { + currentFunction->ReturnClass = vtkstrdup("void"); + } + /* set public, protected */ + if (currentClass) + { + currentFunction->Access = access_level; + /* set legacy flags */ + currentFunction->IsPublic = (access_level == VTK_ACCESS_PUBLIC); + currentFunction->IsProtected = (access_level == VTK_ACCESS_PROTECTED); + } + else + { + currentFunction->Access = VTK_ACCESS_PUBLIC; + /* set legacy flags */ + currentFunction->IsPublic = 1; + currentFunction->IsProtected = 0; + } -/* Line 1455 of yacc.c */ -#line 3573 "vtkParse.tab.c" - default: break; + /* look for legacy VAR FUNCTIONS */ + if (currentFunction->NumberOfArguments + && (currentFunction->Arguments[0]->Type == VTK_PARSE_FUNCTION)) + { + if (currentFunction->NumberOfArguments != 2 || + currentFunction->Arguments[1]->Type != VTK_PARSE_VOID_PTR) + { + currentFunction->ArrayFailure = 1; + } } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); + /* check for too many arguments */ + if (currentFunction->NumberOfArguments > MAX_ARGS) + { + currentFunction->ArrayFailure = 1; + } - *++yyvsp = yyval; + /* also legacy: tell old wrappers that multi-dimensional arrays are bad */ + for (i = 0; i < currentFunction->NumberOfArguments; i++) + { + ValueInfo *arg = currentFunction->Arguments[i]; + if ((arg->Type & VTK_PARSE_POINTER_MASK) != 0) + { + if (((arg->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_FUNCTION) || + ((arg->Type & VTK_PARSE_INDIRECT) == VTK_PARSE_BAD_INDIRECT) || + ((arg->Type & VTK_PARSE_POINTER_LOWMASK) != VTK_PARSE_POINTER)) + { + currentFunction->ArrayFailure = 1; + } + } + } - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ + if (currentClass) + { + /* is it a delete function */ + if (currentFunction->Name && !strcmp("Delete",currentFunction->Name)) + { + currentClass->HasDelete = 1; + } - yyn = yyr1[yyn]; + currentFunction->Class = vtkstrdup(currentClass->Name); + vtkParse_AddFunctionToClass(currentClass, currentFunction); - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; + currentFunction = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + } else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else + /* make sure this function isn't a repeat */ + match = 0; + for (i = 0; i < currentNamespace->NumberOfFunctions; i++) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else + if (currentNamespace->Functions[i]->Name && + strcmp(currentNamespace->Functions[i]->Name, + currentFunction->Name) == 0) { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; + if (currentNamespace->Functions[i]->NumberOfArguments == + currentFunction->NumberOfArguments) + { + for (j = 0; j < currentFunction->NumberOfArguments; j++) + { + if (currentNamespace->Functions[i]->Arguments[j]->Type == + currentFunction->Arguments[j]->Type) + { + if (currentFunction->Arguments[j]->Type == VTK_PARSE_OBJECT && + strcmp(currentNamespace->Functions[i]->Arguments[j]->Class, + currentFunction->Arguments[j]->Class) == 0) + { + break; + } + } + } + if (j == currentFunction->NumberOfArguments) + { + match = 1; + break; + } + } } + } + + if (!match) + { + vtkParse_AddFunctionToNamespace(currentNamespace, currentFunction); + + currentFunction = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + } } - if (0 < yysize && yysize <= yymsg_alloc) + vtkParse_InitFunction(currentFunction); + startSig(); +} + +void outputSetVectorMacro(const char *var, unsigned int argType, + const char *typeText, int n) +{ + static const char *mnames[] = { + NULL, NULL, + "vtkSetVector2Macro", "vtkSetVector3Macro", "vtkSetVector4Macro", + NULL, + "vtkSetVector6Macro", + NULL }; + char ntext[32]; + int i, m; + m = (n > 7 ? 0 : n); + + sprintf(ntext, "%i", n); + + currentFunction->Macro = mnames[m]; + currentFunction->Name = vtkstrcat("Set", var); + startSig(); + postSig("void "); + postSig(currentFunction->Name); + postSig("("); + postSig(typeText); + for (i = 1; i < n; i++) { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); + postSig(", "); + postSig(typeText); } - else + postSig(");"); + for (i = 0; i < n; i++) { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; + add_argument(currentFunction, argType, getTypeId(), 0); } - } -#endif - } - + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); + + currentFunction->Macro = mnames[m]; + currentFunction->Name = vtkstrcat("Set", var); + currentFunction->Signature = + vtkstrcat7("void ", currentFunction->Name, "(", getTypeId(), + " a[", ntext, "]);"); + add_argument(currentFunction, (VTK_PARSE_POINTER | argType), + getTypeId(), n); + set_return(currentFunction, VTK_PARSE_VOID, "void", 0); + output_function(); +} +void outputGetVectorMacro(const char *var, unsigned int argType, + const char *typeText, int n) +{ + static const char *mnames[] = { + NULL, NULL, + "vtkGetVector2Macro", "vtkGetVector3Macro", "vtkGetVector4Macro", + NULL, + "vtkGetVector6Macro", + NULL }; + int m; + m = (n > 7 ? 0 : n); + + currentFunction->Macro = mnames[m]; + currentFunction->Name = vtkstrcat("Get", var); + currentFunction->Signature = + vtkstrcat4(typeText, " *", currentFunction->Name, "();"); + set_return(currentFunction, (VTK_PARSE_POINTER | argType), getTypeId(), n); + output_function(); +} - if (yyerrstatus == 3) +/* This method is used for extending dynamic arrays in a progression of + * powers of two. If "n" reaches a power of two, then the array size is + * doubled so that "n" can be safely incremented. */ +static void *array_size_check( + void *arraymem, size_t size, int n) +{ + /* if empty, alloc for the first time */ + if (n == 0) { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + return malloc(size); + } + /* if count is power of two, reallocate with double size */ + else if ((n & (n-1)) == 0) + { + return realloc(arraymem, (n << 1)*size); } - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; + /* no reallocation, just return the original array */ + return arraymem; +} +/* Utility method to add a pointer to an array */ +void vtkParse_AddPointerToArray( + void *valueArray, int *count, const void *value) +{ + void **values = *(void ***)valueArray; + int n = *count; -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: + values = (void **)array_size_check(values, sizeof(void *), n); - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; + values[n++] = (void *)value; + *count = n; + *(void ***)valueArray = values; +} - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; +/* + * There is a lot of repetition here, but all the code is written + * out explicitly to avoid the use of macros or typecasts. The + * use of macros for generic programming makes code harder to debug, + * and the use of C typecasts for anything but void* and char* breaks + * the C99 standard. + */ + +/* Utility method to add an item to an array */ +void vtkParse_AddItemToArray( + ItemInfo **valueArray, int *count, + parse_item_t type, int idx) +{ + size_t n = *count; + ItemInfo *values = *valueArray; + values = (ItemInfo *)array_size_check(values, sizeof(ItemInfo), n); -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + values[n].Type = type; + values[n].Index = idx; + *count = n+1; + *valueArray = values; +} - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } +/* Add a ClassInfo to a ClassInfo */ +void vtkParse_AddClassToClass(ClassInfo *info, ClassInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfClasses); + info->Classes = (ClassInfo **)array_size_check( + info->Classes, sizeof(ClassInfo *), info->NumberOfClasses); + info->Classes[info->NumberOfClasses++] = item; +} - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; +/* Add a FunctionInfo to a ClassInfo */ +void vtkParse_AddFunctionToClass(ClassInfo *info, FunctionInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfFunctions); + info->Functions = (FunctionInfo **)array_size_check( + info->Functions, sizeof(FunctionInfo *), info->NumberOfFunctions); + info->Functions[info->NumberOfFunctions++] = item; +} +/* Add a EnumInfo to a ClassInfo */ +void vtkParse_AddEnumToClass(ClassInfo *info, EnumInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfEnums); + info->Enums = (EnumInfo **)array_size_check( + info->Enums, sizeof(EnumInfo *), info->NumberOfEnums); + info->Enums[info->NumberOfEnums++] = item; +} - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } +/* Add a Constant ValueInfo to a ClassInfo */ +void vtkParse_AddConstantToClass(ClassInfo *info, ValueInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfConstants); + info->Constants = (ValueInfo **)array_size_check( + info->Constants, sizeof(ValueInfo *), info->NumberOfConstants); + info->Constants[info->NumberOfConstants++] = item; +} - *++yyvsp = yylval; +/* Add a Variable ValueInfo to a ClassInfo */ +void vtkParse_AddVariableToClass(ClassInfo *info, ValueInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfVariables); + info->Variables = (ValueInfo **)array_size_check( + info->Variables, sizeof(ValueInfo *), info->NumberOfVariables); + info->Variables[info->NumberOfVariables++] = item; +} +/* Add a Typedef ValueInfo to a ClassInfo */ +void vtkParse_AddTypedefToClass(ClassInfo *info, ValueInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfTypedefs); + info->Typedefs = (ValueInfo **)array_size_check( + info->Typedefs, sizeof(ValueInfo *), info->NumberOfTypedefs); + info->Typedefs[info->NumberOfTypedefs++] = item; +} - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); +/* Add a UsingInfo to a ClassInfo */ +void vtkParse_AddUsingToClass(ClassInfo *info, UsingInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfUsings); + info->Usings = (UsingInfo **)array_size_check( + info->Usings, sizeof(UsingInfo *), info->NumberOfUsings); + info->Usings[info->NumberOfUsings++] = item; +} - yystate = yyn; - goto yynewstate; +/* Add a NamespaceInfo to a NamespaceInfo */ +void vtkParse_AddNamespaceToNamespace(NamespaceInfo *info, NamespaceInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfNamespaces); + info->Namespaces = (NamespaceInfo **)array_size_check( + info->Namespaces, sizeof(NamespaceInfo *), info->NumberOfNamespaces); + info->Namespaces[info->NumberOfNamespaces++] = item; +} -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; +/* Add a ClassInfo to a NamespaceInfo */ +void vtkParse_AddClassToNamespace(NamespaceInfo *info, ClassInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfClasses); + info->Classes = (ClassInfo **)array_size_check( + info->Classes, sizeof(ClassInfo *), info->NumberOfClasses); + info->Classes[info->NumberOfClasses++] = item; +} -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; +/* Add a FunctionInfo to a NamespaceInfo */ +void vtkParse_AddFunctionToNamespace(NamespaceInfo *info, FunctionInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfFunctions); + info->Functions = (FunctionInfo **)array_size_check( + info->Functions, sizeof(FunctionInfo *), info->NumberOfFunctions); + info->Functions[info->NumberOfFunctions++] = item; +} -#if !defined(yyoverflow) || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif +/* Add a EnumInfo to a NamespaceInfo */ +void vtkParse_AddEnumToNamespace(NamespaceInfo *info, EnumInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfEnums); + info->Enums = (EnumInfo **)array_size_check( + info->Enums, sizeof(EnumInfo *), info->NumberOfEnums); + info->Enums[info->NumberOfEnums++] = item; +} -yyreturn: - if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); +/* Add a Constant ValueInfo to a NamespaceInfo */ +void vtkParse_AddConstantToNamespace(NamespaceInfo *info, ValueInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfConstants); + info->Constants = (ValueInfo **)array_size_check( + info->Constants, sizeof(ValueInfo *), info->NumberOfConstants); + info->Constants[info->NumberOfConstants++] = item; } +/* Add a Variable ValueInfo to a NamespaceInfo */ +void vtkParse_AddVariableToNamespace(NamespaceInfo *info, ValueInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfVariables); + info->Variables = (ValueInfo **)array_size_check( + info->Variables, sizeof(ValueInfo *), info->NumberOfVariables); + info->Variables[info->NumberOfVariables++] = item; +} +/* Add a Typedef ValueInfo to a NamespaceInfo */ +void vtkParse_AddTypedefToNamespace(NamespaceInfo *info, ValueInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfTypedefs); + info->Typedefs = (ValueInfo **)array_size_check( + info->Typedefs, sizeof(ValueInfo *), info->NumberOfTypedefs); + info->Typedefs[info->NumberOfTypedefs++] = item; +} -/* Line 1675 of yacc.c */ -#line 1132 "vtkParse.y" +/* Add a UsingInfo to a NamespaceInfo */ +void vtkParse_AddUsingToNamespace(NamespaceInfo *info, UsingInfo *item) +{ + vtkParse_AddItemToArray(&info->Items, &info->NumberOfItems, + item->ItemType, info->NumberOfUsings); + info->Usings = (UsingInfo **)array_size_check( + info->Usings, sizeof(UsingInfo *), info->NumberOfUsings); + info->Usings[info->NumberOfUsings++] = item; +} -#include -#include "lex.yy.c" -static void vtkParseDebug(const char* s1, const char* s2) +/* Add a Argument ValueInfo to a FunctionInfo */ +void vtkParse_AddArgumentToFunction(FunctionInfo *info, ValueInfo *item) { - if ( getenv("DEBUG") ) - { - fprintf(stderr, " %s", s1); - if ( s2 ) - { - fprintf(stderr, " %s", s2); - } - fprintf(stderr, "\n"); - } + info->Arguments = (ValueInfo **)array_size_check( + info->Arguments, sizeof(ValueInfo *), info->NumberOfArguments); + info->Arguments[info->NumberOfArguments++] = item; } -/* initialize the structure */ -void InitFunction(FunctionInfo *func) + +/* Add a TemplateArg to a TemplateArgs */ +void vtkParse_AddArgumentToTemplate(TemplateArgs *info, TemplateArg *item) { - func->Name = NULL; - func->NumberOfArguments = 0; - func->ArrayFailure = 0; - func->IsPureVirtual = 0; - func->IsPublic = 0; - func->IsOperator = 0; - func->HaveHint = 0; - func->HintSize = 0; - func->ReturnType = 0x2; - func->ReturnClass = NULL; - func->Comment = NULL; - func->Signature = NULL; - func->IsLegacy = 0; - sigAllocatedLength = 0; - openSig = 1; - invertSig = 0; + info->Arguments = (TemplateArg **)array_size_check( + info->Arguments, sizeof(TemplateArg *), info->NumberOfArguments); + info->Arguments[info->NumberOfArguments++] = item; } -/* when the cpp file doesn't have enough info use the hint file */ -void look_for_hint(void) + +/* Utility method to add a const char pointer to an array */ +void vtkParse_AddStringToArray( + const char ***valueArray, int *count, const char *value) +{ + *valueArray = (const char **)array_size_check( + (char **)*valueArray, sizeof(const char *), *count); + + (*valueArray)[(*count)++] = value; +} + +/* duplicate the first n bytes of a string and terminate */ +const char *vtkParse_DuplicateString(const char *cp, size_t n) { - char h_cls[80]; - char h_func[80]; - unsigned int h_type; - int h_value; + char *res = NULL; + + res = vtkstralloc(n); + strncpy(res, cp, n); + res[n] = '\0'; + + return res; +} - /* reset the position */ - if (!fhint) +/* Add default constructors if they do not already exist */ +void vtkParse_AddDefaultConstructors(ClassInfo *cls) +{ + FunctionInfo *func; + ValueInfo *arg; + size_t k; + int i, n; + int default_constructor = 1; + int copy_constructor = 1; + char *tname; + const char *ccname; + + if (cls == NULL || cls->Name == NULL) { return; } - rewind(fhint); - /* first find a hint */ - while (fscanf(fhint,"%s %s %x %i",h_cls,h_func,&h_type,&h_value) != EOF) + n = cls->NumberOfFunctions; + for (i = 0; i < n; i++) { - if ((!strcmp(h_cls,data.ClassName))&& - currentFunction->Name && - (!strcmp(h_func,currentFunction->Name))&& - ((int)h_type == currentFunction->ReturnType)) + func = cls->Functions[i]; + if (func->Name && strcmp(func->Name, cls->Name) == 0) { - currentFunction->HaveHint = 1; - currentFunction->HintSize = h_value; + default_constructor = 0; + + if (func->NumberOfArguments == 1) + { + arg = func->Arguments[0]; + if (arg->Class && + strcmp(arg->Class, cls->Name) == 0 && + (arg->Type & VTK_PARSE_POINTER_MASK) == 0) + { + copy_constructor = 0; + } + } } } -} - -/* a simple routine that updates a few variables */ -void output_function() -{ - int i; - /* a void argument is the same as no arguements */ - if (currentFunction->ArgTypes[0] % 0x1000 == 0x2) + if (default_constructor) { - currentFunction->NumberOfArguments = 0; + func = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + vtkParse_InitFunction(func); + func->Class = vtkstrdup(cls->Name); + func->Name = vtkstrdup(cls->Name); + func->Signature = vtkstrcat(cls->Name, "()"); + vtkParse_AddFunctionToClass(cls, func); } - currentFunction->IsPublic = in_public; - currentFunction->IsProtected = in_protected; - - /* look for VAR FUNCTIONS */ - if (currentFunction->NumberOfArguments - && (currentFunction->ArgTypes[0] == 0x5000)) + if (copy_constructor) { - if (currentFunction->NumberOfArguments == 2) + if (cls->Template) { - currentFunction->NumberOfArguments = 1; + /* specialize the name */ + n = cls->Template->NumberOfArguments; + + k = strlen(cls->Name) + 2; + for (i = 0; i < n; i++) + { + k += strlen(cls->Template->Arguments[i]->Name) + 2; + } + tname = vtkstralloc(k); + strcpy(tname, cls->Name); + k = strlen(tname); + tname[k++] = '<'; + for (i = 0; i < n; i++) + { + strcpy(&tname[k], cls->Template->Arguments[i]->Name); + k += strlen(cls->Template->Arguments[i]->Name); + if (i+1 < n) + { + tname[k++] = ','; + tname[k++] = ' '; + } + } + tname[k++] = '>'; + tname[k] = '\0'; + ccname = tname; } else { - currentFunction->ArrayFailure = 1; + ccname = vtkstrdup(cls->Name); } - } - - /* is it a delete function */ - if (currentFunction->Name && !strcmp("Delete",currentFunction->Name)) - { - data.HasDelete = 1; - } - - /* if we need a return type hint and dont currently have one */ - /* then try to find one */ - if (!currentFunction->HaveHint) - { - switch (currentFunction->ReturnType % 0x1000) - { - case 0x301: case 0x302: case 0x307: case 0x30A: case 0x30B: case 0x30C: - case 0x304: case 0x305: case 0x306: case 0x313: - look_for_hint(); - break; - } + func = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + vtkParse_InitFunction(func); + func->Class = vtkstrdup(cls->Name); + func->Name = vtkstrdup(cls->Name); + func->Signature = vtkstrcat4(cls->Name, "(const &", ccname, ")"); + arg = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(arg); + arg->Type = (VTK_PARSE_OBJECT_REF | VTK_PARSE_CONST); + arg->Class = ccname; + vtkParse_AddArgumentToFunction(func, arg); + vtkParse_AddFunctionToClass(cls, func); } +} - /* reject multi-dimensional arrays from wrappers */ - for (i = 0; i < currentFunction->NumberOfArguments; i++) +/* Set a flag to ignore BTX/ETX markers in the files */ +void vtkParse_SetIgnoreBTX(int option) +{ + if (option) { - if ((currentFunction->ArgTypes[i] % 0x1000)/0x100 == 0x6 || - (currentFunction->ArgTypes[i] % 0x1000)/0x100 == 0x9) - { - currentFunction->ArrayFailure = 1; - } + IgnoreBTX = 1; } - - if (HaveComment) + else { - currentFunction->Comment = vtkstrdup(CommentText); + IgnoreBTX = 0; } - - data.NumberOfFunctions++; - currentFunction = data.Functions + data.NumberOfFunctions; - InitFunction(currentFunction); } -extern void vtkParseOutput(FILE *,FileInfo *); - -int main(int argc,char *argv[]) +/* Parse a header file and return a FileInfo struct */ +FileInfo *vtkParse_ParseFile( + const char *filename, FILE *ifile, FILE *errfile) { - FILE *fin; + int i, j; + int lineno; int ret; - FILE *fout; - - if (argc < 4 || argc > 5) - { - fprintf(stderr, - "Usage: %s input_file is_concrete output_file\n",argv[0]); - exit(1); - } - - if (!(fin = fopen(argv[1],"r"))) - { - fprintf(stderr,"Error opening input file %s\n",argv[1]); - exit(1); - } + FileInfo *file_info; + char *main_class; + const char **include_dirs; + + vtkParse_InitFile(&data); + + i = preprocessor.NumberOfIncludeDirectories; + include_dirs = preprocessor.IncludeDirectories; + preprocessor.NumberOfIncludeDirectories = 0; + preprocessor.IncludeDirectories = NULL; + vtkParsePreprocess_InitPreprocess(&preprocessor); + vtkParsePreprocess_AddStandardMacros(&preprocessor, VTK_PARSE_NATIVE); + preprocessor.FileName = vtkstrdup(filename); + preprocessor.NumberOfIncludeDirectories = i; + preprocessor.IncludeDirectories = include_dirs; + /* should explicitly check for vtkConfigure.h, or even explicitly load it */ +#ifdef VTK_USE_64BIT_IDS + vtkParsePreprocess_AddMacro(&preprocessor, "VTK_USE_64BIT_IDS", "1"); +#endif - fhint = 0; - data.FileName = argv[1]; - data.NameComment = NULL; - data.Description = NULL; - data.Caveats = NULL; - data.SeeAlso = NULL; - CommentState = 0; + data.FileName = vtkstrdup(filename); - if (argc == 5) - { - if (!(fhint = fopen(argv[2],"r"))) - { - fprintf(stderr,"Error opening hint file %s\n",argv[2]); - exit(1); - } - data.IsConcrete = atoi(argv[3]); - } - else + clearComment(); + + namespaceDepth = 0; + currentNamespace = (NamespaceInfo *)malloc(sizeof(NamespaceInfo)); + vtkParse_InitNamespace(currentNamespace); + data.Contents = currentNamespace; + + templateDepth = 0; + currentTemplate = NULL; + + currentFunction = (FunctionInfo *)malloc(sizeof(FunctionInfo)); + vtkParse_InitFunction(currentFunction); + startSig(); + + parseDebug = 0; + if (getenv("DEBUG") != NULL) { - data.IsConcrete = atoi(argv[2]); + parseDebug = 1; } - - currentFunction = data.Functions; - InitFunction(currentFunction); - - yyin = fin; - yyout = stdout; + + yyset_in(ifile); + yyset_out(errfile); ret = yyparse(); + lineno = yyget_lineno(); + yylex_destroy(); + + free(currentFunction); + if (ret) { - fprintf(stdout, - "*** SYNTAX ERROR found in parsing the header file %s before line %d ***\n", - argv[1], yylineno); - return ret; + fprintf(errfile, + "*** SYNTAX ERROR found in parsing the header file %s " + "before line %d ***\n", + filename, lineno); + return NULL; } - if (argc == 5) + /* The main class name should match the file name */ + i = strlen(filename); + j = i; + while (i > 0) { - fout = fopen(argv[4],"w"); - data.OutputFileName = argv[4]; + --i; + if (filename[i] == '.') + { + j = i; + } + if (filename[i] == '/' || filename[i] == '\\') + { + i++; + break; + } } - else + main_class = (char *)malloc(j-i+1); + strncpy(main_class, &filename[i], j-i); + main_class[j-i] = '\0'; + + /* special treatment of the main class in the file */ + for (i = 0; i < currentNamespace->NumberOfClasses; i++) { - fout = fopen(argv[3],"w"); - data.OutputFileName = argv[3]; + if (strcmp(currentNamespace->Classes[i]->Name, main_class) == 0) + { + data.MainClass = currentNamespace->Classes[i]; + break; + } } - - if (!fout) + + free(main_class); + + file_info = (FileInfo *)malloc(sizeof(FileInfo)); + memcpy(file_info, &data, sizeof(FileInfo)); + + return file_info; +} + +/* Read a hints file and update the FileInfo */ +int vtkParse_ReadHints(FileInfo *file_info, FILE *hfile, FILE *errfile) +{ + char h_cls[512]; + char h_func[512]; + unsigned int h_type, type; + int h_value; + FunctionInfo *func_info; + ClassInfo *class_info; + NamespaceInfo *contents; + int i, j; + int lineno = 0; + int n; + + contents = file_info->Contents; + + /* read each hint line in succession */ + while ((n = fscanf(hfile,"%s %s %x %i", h_cls, h_func, &h_type, &h_value)) + != EOF) { - fprintf(stderr,"Error opening output file %s\n",argv[3]); - exit(1); + lineno++; + if (n < 4) + { + fprintf(errfile, "Wrapping: error parsing hints file line %i\n", lineno); + exit(1); + } + + /* erase "ref" and qualifiers from hint type */ + type = ((h_type & VTK_PARSE_BASE_TYPE) | + (h_type & VTK_PARSE_POINTER_LOWMASK)); + + /* find the matching class */ + for (i = 0; i < contents->NumberOfClasses; i++) + { + class_info = contents->Classes[i]; + + if (strcmp(h_cls, class_info->Name) == 0) + { + /* find the matching function */ + for (j = 0; j < class_info->NumberOfFunctions; j++) + { + func_info = class_info->Functions[j]; + + if (func_info->HaveHint == 0 && func_info->Name && + (strcmp(h_func, func_info->Name) == 0) && + (type == ((func_info->ReturnType & ~VTK_PARSE_REF) & + VTK_PARSE_UNQUALIFIED_TYPE))) + { + /* types that hints are accepted for */ + switch (func_info->ReturnType & VTK_PARSE_UNQUALIFIED_TYPE) + { + case VTK_PARSE_FLOAT_PTR: + case VTK_PARSE_VOID_PTR: + case VTK_PARSE_DOUBLE_PTR: + case VTK_PARSE_ID_TYPE_PTR: + case VTK_PARSE_LONG_LONG_PTR: + case VTK_PARSE_UNSIGNED_LONG_LONG_PTR: + case VTK_PARSE___INT64_PTR: + case VTK_PARSE_UNSIGNED___INT64_PTR: + case VTK_PARSE_INT_PTR: + case VTK_PARSE_UNSIGNED_INT_PTR: + case VTK_PARSE_SHORT_PTR: + case VTK_PARSE_UNSIGNED_SHORT_PTR: + case VTK_PARSE_LONG_PTR: + case VTK_PARSE_UNSIGNED_LONG_PTR: + case VTK_PARSE_SIGNED_CHAR_PTR: + case VTK_PARSE_UNSIGNED_CHAR_PTR: + case VTK_PARSE_CHAR_PTR: + { + if (func_info->ReturnValue && + func_info->ReturnValue->NumberOfDimensions == 0) + { + char text[64]; + func_info->HaveHint = 1; + func_info->HintSize = h_value; + func_info->ReturnValue->Count = h_value; + sprintf(text, "%i", h_value); + vtkParse_AddStringToArray( + &func_info->ReturnValue->Dimensions, + &func_info->ReturnValue->NumberOfDimensions, + vtkstrdup(text)); + } + break; + } + default: + { + fprintf(errfile, + "Wrapping: unhandled hint type %#x\n", h_type); + } + } + } + } + } + } } - vtkParseOutput(fout,&data); - fclose (fout); - return 0; + return 1; +} + +/* Free the FileInfo struct returned by vtkParse_ParseFile() */ +void vtkParse_Free(FileInfo *file_info) +{ + vtkParse_FreeNamespace(file_info->Contents); + file_info->Contents = NULL; +} + +/* Set a property before parsing */ +void vtkParse_SetClassProperty( + const char *classname, const char *property) +{ + /* the only property recognized */ + if (strcmp(property, "concrete") == 0 || + strcmp(property, "CONCRETE") == 0 || + strcmp(property, "Concrete") == 0) + { + vtkParse_AddStringToArray(&ConcreteClasses, + &NumberOfConcreteClasses, + vtkstrdup(classname)); + } +} + +/** Define a preprocessor macro. Function macros are not supported. */ +void vtkParse_DefineMacro(const char *name, const char *definition) +{ + vtkParsePreprocess_AddMacro(&preprocessor, name, definition); } +/** Undefine a preprocessor macro. */ +void vtkParse_UndefineMacro(const char *name) +{ + vtkParsePreprocess_RemoveMacro(&preprocessor, name); +} + +/** Add an include directory, for use with the "-I" option. */ +void vtkParse_IncludeDirectory(const char *dirname) +{ + vtkParsePreprocess_IncludeDirectory(&preprocessor, dirname); +} +/** Return the full path to a header file. */ +const char *vtkParse_FindIncludeFile(const char *filename) +{ + int val; + return vtkParsePreprocess_FindIncludeFile(&preprocessor, filename, 0, &val); +} +/** Simple utility for mapping VTK types to VTK_PARSE types */ +unsigned int vtkParse_MapType(int vtktype) +{ + if (vtktype > 0 && vtktype <= VTK_UNICODE_STRING) + { + return vtkParseTypeMap[vtktype]; + } + return 0; +} diff --git a/src/ParaView/vtkParseExtras.c b/src/ParaView/vtkParseExtras.c new file mode 100644 index 00000000..996b670f --- /dev/null +++ b/src/ParaView/vtkParseExtras.c @@ -0,0 +1,1570 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkParseExtras.c + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright (c) 2011 David Gobbi. + + Contributed to the VisualizationToolkit by the author in May 2011 + under the terms of the Visualization Toolkit 2008 copyright. +-------------------------------------------------------------------------*/ + +#include +#include +#include +#include +#include +#include "vtkParse.h" +#include "vtkParseInternal.h" +#include "vtkParseExtras.h" +#include "vtkType.h" + +/* skip over an identifier */ +static size_t vtkparse_id_len(const char *text) +{ + size_t i = 0; + char c = text[0]; + + if ((c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + c == '_') + { + do + { + c = text[++i]; + } + while ((c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + (c >= '0' && c <= '9') || + c == '_'); + } + + return i; +} + +/* skip over numbers, int or float, including suffixes */ +static size_t vtkparse_number_len(const char *text) +{ + size_t i = 0; + char c = text[0]; + + if (c == '.') + { + c = text[1]; + } + + if (c >= '0' && c <= '9') + { + do + { + do + { + c = text[++i]; + } + while ((c >= '0' && c <= '9') || + (c >= 'a' && c <= 'z') || + (c >= 'A' && c <= 'Z') || + c == '_' || c == '.'); + } + while ((c == '-' || c == '+') && + (text[i-1] == 'e' || text[i-1] == 'E')); + } + + return i; +} + +/* skip over string and char literals. */ +static size_t vtkparse_quote_len(const char *text) +{ + size_t i = 0; + const char qc = text[0]; + char c = text[0]; + + if (c == '\'' || c == '\"') + { + do + { + do + { + c = text[++i]; + } + while (c != qc && c != '\n' && c != '\0'); + } + while (c == qc && text[i-1] == '\\'); + + if (c == qc) + { + ++i; + } + } + + return i; +} + +/* skip over an expression in brackets */ +size_t vtkparse_bracket_len(const char *text) +{ + size_t i = 0; + size_t j = 1; + char bc = text[0]; + char tc = 0; + char semi = ';'; + char c; + + if (bc == '(') { tc = ')'; } + else if (bc == '[') { tc = ']'; } + else if (bc == '{') { tc = '}'; semi = '\0'; } + else if (bc == '<') { tc = '>'; } + else { return 0; } + + do + { + i += j; + j = 1; + c = text[i]; + if (c == '\'' || c == '\"') + { + j = vtkparse_quote_len(&text[i]); + } + else if (c == bc || c == '(' || c == '[' || c == '{') + { + j = vtkparse_bracket_len(&text[i]); + } + } + while (c != tc && c != ')' && c != ']' && c != '}' && + c != '\0' && c != '\n' && c != semi && j != 0); + + if (c == tc) + { + i++; + } + + return i; +} + +/* skip over a name that is neither scoped or templated, return the + * total number of characters in the name */ +size_t vtkParse_IdentifierLength(const char *text) +{ + return vtkparse_id_len(text); +} + +/* skip over a name that might be templated, return the + * total number of characters in the name */ +size_t vtkParse_UnscopedNameLength(const char *text) +{ + size_t i = 0; + + i += vtkparse_id_len(text); + if (text[i] == '<') + { + i += vtkparse_bracket_len(&text[i]); + if (text[i-1] != '>') + { + fprintf(stderr, "Bad template args %*.*s\n", (int)i, (int)i, text); + return 0; + } + } + + return i; +} + +/* skip over a name that might be scoped or templated, return the + * total number of characters in the name */ +size_t vtkParse_NameLength(const char *text) +{ + size_t i = 0; + do + { + if (text[i] == ':' && text[i+1] == ':') { i += 2; } + i += vtkParse_UnscopedNameLength(&text[i]); + } + while (text[i] == ':' && text[i+1] == ':'); + return i; +} + +/* Search and replace, return the initial string if no replacements + * occurred, otherwise return a new string. */ +static const char *vtkparse_string_replace( + const char *str1, int n, const char *name[], const char *val[], + int useDuplicateString) +{ + const char *cp = str1; + char result_store[1024]; + size_t resultMaxLen = 1024; + char *result, *tmp; + int k; + size_t i, j, l, m; + size_t lastPos, nameBegin, nameEnd; + int replaced = 0; + int any_replaced = 0; + + result = result_store; + + if (n == 0) + { + return str1; + } + + i = 0; + j = 0; + result[j] = '\0'; + + while (cp[i] != '\0') + { + lastPos = i; + + /* skip all chars that aren't part of a name */ + while ((cp[i] < 'a' || cp[i] > 'z') && + (cp[i] < 'A' || cp[i] > 'Z') && + cp[i] != '_' && cp[i] != '\0') + { + if (cp[i] == '\'' || cp[i] == '\"') + { + i += vtkparse_quote_len(&cp[i]); + } + else if (cp[i] >= '0' && cp[i] <= '9') + { + i += vtkparse_number_len(&cp[i]); + } + else + { + i++; + } + } + nameBegin = i; + + /* skip all chars that are part of a name */ + i += vtkparse_id_len(&cp[i]); + nameEnd = i; + + /* search through the list of names to replace */ + replaced = 0; + m = nameEnd - nameBegin; + for (k = 0; k < n; k++) + { + l = strlen(name[k]); + if (l > 0 && l == m && strncmp(&cp[nameBegin], name[k], l) == 0) + { + m = strlen(val[k]); + replaced = 1; + any_replaced = 1; + break; + } + } + + /* expand the storage space if needed */ + if (j + m + (nameBegin - lastPos) + 1 >= resultMaxLen) + { + resultMaxLen *= 2; + tmp = (char *)malloc(resultMaxLen); + strcpy(tmp, result); + if (result != result_store) + { + free(result); + } + result = tmp; + } + + /* copy the old bits */ + if (nameBegin > lastPos) + { + strncpy(&result[j], &cp[lastPos], nameBegin - lastPos); + j += (nameBegin - lastPos); + } + + /* do the replacement */ + if (replaced) + { + strncpy(&result[j], val[k], m); + j += m; + /* guard against creating double ">>" */ + if (val[k][m-1] == '>' && cp[nameEnd] == '>') + { + result[j++] = ' '; + } + } + else if (nameEnd > nameBegin) + { + strncpy(&result[j], &cp[nameBegin], nameEnd - nameBegin); + j += (nameEnd - nameBegin); + } + + result[j] = '\0'; + } + + if (useDuplicateString) + { + if (any_replaced) + { + /* use the efficient but leaky DuplicateString method */ + cp = vtkParse_DuplicateString(result, j); + if (result != result_store) + { + free(result); + } + } + } + else + { + if (any_replaced) + { + /* return a string that was allocated with malloc */ + if (result == result_store) + { + tmp = (char *)malloc(strlen(result) + 1); + strcpy(tmp, result); + result = tmp; + } + cp = result; + } + } + + return cp; +} + +/* Wherever one of the specified names exists inside a Value or inside + * a Dimension size, replace it with the corresponding val string. */ +void vtkParse_ExpandValues( + ValueInfo *valinfo, int n, const char *name[], const char *val[]) +{ + int j, m, dim, count; + const char *cp; + + if (valinfo->Value) + { + valinfo->Value = vtkparse_string_replace(valinfo->Value, n, name, val, 1); + } + + m = valinfo->NumberOfDimensions; + if (m) + { + count = 1; + for (j = 0; j < m; j++) + { + cp = valinfo->Dimensions[j]; + if (cp) + { + cp = vtkparse_string_replace(cp, n, name, val, 1); + valinfo->Dimensions[j] = cp; + + /* check whether dimension has become an integer literal */ + if (cp[0] == '0' && (cp[1] == 'x' || cp[1] == 'X')) { cp += 2; } + while (*cp >= '0' && *cp <= '9') { cp++; } + while (*cp == 'u' || *cp == 'l' || *cp == 'U' || *cp == 'L') { cp++; } + dim = 0; + if (*cp == '\0') + { + dim = (int)strtol(valinfo->Dimensions[j], NULL, 0); + } + count *= dim; + } + } + + /* update count if all values are integer literals */ + if (count) + { + valinfo->Count = count; + } + } +} + +/* Expand a typedef within a type declaration. */ +void vtkParse_ExpandTypedef(ValueInfo *valinfo, ValueInfo *typedefinfo) +{ + const char *classname; + unsigned int baseType; + unsigned int pointers; + unsigned int refbit; + unsigned int qualifiers; + unsigned int tmp1, tmp2; + int i; + + classname = typedefinfo->Class; + baseType = (typedefinfo->Type & VTK_PARSE_BASE_TYPE); + pointers = (typedefinfo->Type & VTK_PARSE_POINTER_MASK); + refbit = (valinfo->Type & VTK_PARSE_REF); + qualifiers = (typedefinfo->Type & VTK_PARSE_CONST); + + /* handle const */ + if ((valinfo->Type & VTK_PARSE_CONST) != 0) + { + if ((pointers & VTK_PARSE_POINTER_LOWMASK) != 0) + { + if ((pointers & VTK_PARSE_POINTER_LOWMASK) != VTK_PARSE_ARRAY) + { + /* const turns into const pointer */ + pointers = (pointers & ~VTK_PARSE_POINTER_LOWMASK); + pointers = (pointers | VTK_PARSE_CONST_POINTER); + } + } + else + { + /* const remains as const value */ + qualifiers = (qualifiers | VTK_PARSE_CONST); + } + } + + /* make a reversed copy of the pointer bitfield */ + tmp1 = (valinfo->Type & VTK_PARSE_POINTER_MASK); + tmp2 = 0; + while (tmp1) + { + tmp2 = ((tmp2 << 2) | (tmp1 & VTK_PARSE_POINTER_LOWMASK)); + tmp1 = ((tmp1 >> 2) & VTK_PARSE_POINTER_MASK); + } + + /* turn pointers into zero-element arrays where necessary */ + if ((pointers & VTK_PARSE_POINTER_LOWMASK) == VTK_PARSE_ARRAY) + { + tmp2 = ((tmp2 >> 2) & VTK_PARSE_POINTER_MASK); + while (tmp2) + { + vtkParse_AddStringToArray( + &valinfo->Dimensions, &valinfo->NumberOfDimensions, ""); + tmp2 = ((tmp2 >> 2) & VTK_PARSE_POINTER_MASK); + } + } + else + { + /* combine the pointers */ + while (tmp2) + { + pointers = ((pointers << 2) | (tmp2 & VTK_PARSE_POINTER_LOWMASK)); + tmp2 = ((tmp2 >> 2) & VTK_PARSE_POINTER_MASK); + } + } + + /* combine the arrays */ + for (i = 0; i < typedefinfo->NumberOfDimensions; i++) + { + vtkParse_AddStringToArray( + &valinfo->Dimensions, &valinfo->NumberOfDimensions, + typedefinfo->Dimensions[i]); + } + if (valinfo->NumberOfDimensions > 1) + { + pointers = ((pointers & ~VTK_PARSE_POINTER_LOWMASK) | VTK_PARSE_ARRAY); + } + + /* put everything together */ + valinfo->Type = (baseType | pointers | refbit | qualifiers); + valinfo->Class = classname; + valinfo->Function = typedefinfo->Function; + valinfo->Count *= typedefinfo->Count; +} + +/* Expand any unrecognized types within a variable, parameter, or typedef + * that match any of the supplied typedefs. The expansion is done in-place. */ +void vtkParse_ExpandTypedefs( + ValueInfo *val, int n, const char *names[], const char *values[], + ValueInfo *typedefinfo[]) +{ + int i; + + if (((val->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_OBJECT || + (val->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_UNKNOWN) && + val->Class != 0) + { + for (i = 0; i < n; i++) + { + if (typedefinfo[i] && strcmp(val->Class, typedefinfo[i]->Name) == 0) + { + vtkParse_ExpandTypedef(val, typedefinfo[i]); + break; + } + } + if (i == n) + { + /* in case type appears as a template arg of another type */ + val->Class = vtkparse_string_replace(val->Class, n, names, values, 1); + } + } +} + +/* Helper struct for VTK-specific types */ +struct vtk_type_struct +{ + size_t len; + const char *name; + int type; +}; + +/* Get a type from a type name, and return the number of characters used. + * If the "classname" argument is not NULL, then it is used to return + * the short name for the type, e.g. "long int" becomes "long", while + * typedef names and class names are returned unchanged. If "const" + * appears in the type name, then the const bit flag is set for the + * type, but "const" will not appear in the returned classname. */ +size_t vtkParse_BasicTypeFromString( + const char *text, unsigned int *type_ptr, + const char **classname_ptr, size_t *len_ptr) +{ + /* The various typedefs and types specific to VTK */ + static struct vtk_type_struct vtktypes[] = { + { 9, "vtkIdType", VTK_ID_TYPE }, + { 12, "vtkStdString", VTK_STRING }, + { 16, "vtkUnicodeString", VTK_UNICODE_STRING }, + { 11, "vtkTypeInt8", VTK_TYPE_INT8 }, + { 12, "vtkTypeUInt8", VTK_TYPE_UINT8 }, + { 12, "vtkTypeInt16", VTK_TYPE_INT16 }, + { 13, "vtkTypeUInt16", VTK_TYPE_UINT16 }, + { 12, "vtkTypeInt32", VTK_TYPE_INT32 }, + { 13, "vtkTypeUInt32", VTK_TYPE_UINT32 }, + { 12, "vtkTypeInt64", VTK_TYPE_INT64 }, + { 13, "vtkTypeUInt64", VTK_TYPE_UINT64 }, + { 14, "vtkTypeFloat32", VTK_TYPE_FLOAT32 }, + { 14, "vtkTypeFloat64", VTK_TYPE_FLOAT64 }, + { 0, 0, 0 } }; + + /* Other typedefs and types */ + static struct vtk_type_struct stdtypes[] = { + { 6, "size_t", VTK_PARSE_SIZE_T }, + { 7, "ssize_t", VTK_PARSE_SSIZE_T }, + { 7, "ostream", VTK_PARSE_OSTREAM }, + { 7, "istream", VTK_PARSE_ISTREAM }, + { 8, "string", VTK_PARSE_STRING }, + { 0, 0, 0 } }; + + const char *cp = text; + const char *tmpcp; + size_t k, n, m; + int i; + unsigned int const_bits = 0; + unsigned int static_bits = 0; + unsigned int unsigned_bits = 0; + unsigned int base_bits = 0; + const char *classname = NULL; + size_t len = 0; + + while (*cp == ' ' || *cp == '\t') { cp++; } + + while ((*cp >= 'a' && *cp <= 'z') || + (*cp >= 'A' && *cp <= 'Z') || + (*cp == '_') || (cp[0] == ':' && cp[1] == ':')) + { + /* skip all chars that are part of a name */ + n = vtkParse_NameLength(cp); + + if ((n == 6 && strncmp("static", cp, n) == 0) || + (n == 4 && strncmp("auto", cp, n) == 0) || + (n == 8 && strncmp("register", cp, n) == 0) || + (n == 8 && strncmp("volatile", cp, n) == 0)) + { + if (strncmp("static", cp, n) == 0) + { + static_bits = VTK_PARSE_STATIC; + } + } + else if (n == 5 && strncmp(cp, "const", n) == 0) + { + const_bits |= VTK_PARSE_CONST; + } + else if (n == 8 && strncmp(cp, "unsigned", n) == 0) + { + unsigned_bits |= VTK_PARSE_UNSIGNED; + if (base_bits == 0) + { + classname = "int"; + base_bits = VTK_PARSE_INT; + } + } + else if (n == 6 && strncmp(cp, "signed", n) == 0) + { + if (base_bits == VTK_PARSE_CHAR) + { + classname = "signed char"; + base_bits = VTK_PARSE_SIGNED_CHAR; + } + else + { + classname = "int"; + base_bits = VTK_PARSE_INT; + } + } + else if (n == 3 && strncmp(cp, "int", n) == 0) + { + if (base_bits == 0) + { + classname = "int"; + base_bits = VTK_PARSE_INT; + } + } + else if (n == 4 && strncmp(cp, "long", n) == 0) + { + if (base_bits == VTK_PARSE_LONG) + { + classname = "long long"; + base_bits = VTK_PARSE_LONG_LONG; + } + else + { + classname = "long"; + base_bits = VTK_PARSE_LONG; + } + } + else if (n == 5 && strncmp(cp, "short", n) == 0) + { + classname = "short"; + base_bits = VTK_PARSE_SHORT; + } + else if (n == 4 && strncmp(cp, "char", n) == 0) + { + if (base_bits == VTK_PARSE_INT && unsigned_bits != VTK_PARSE_UNSIGNED) + { + classname = "signed char"; + base_bits = VTK_PARSE_SIGNED_CHAR; + } + else + { + classname = "char"; + base_bits = VTK_PARSE_CHAR; + } + } + else if (n == 5 && strncmp(cp, "float", n) == 0) + { + classname = "float"; + base_bits = VTK_PARSE_FLOAT; + } + else if (n == 6 && strncmp(cp, "double", n) == 0) + { + classname = "double"; + base_bits = VTK_PARSE_DOUBLE; + } + else if (n == 4 && strncmp(cp, "bool", n) == 0) + { + classname = "bool"; + base_bits = VTK_PARSE_BOOL; + } + else if (n == 4 && strncmp(cp, "void", n) == 0) + { + classname = "void"; + base_bits = VTK_PARSE_VOID; + } + else if (n == 7 && strncmp(cp, "__int64", n) == 0) + { + classname = "__int64"; + base_bits = VTK_PARSE___INT64; + } + else + { + /* if type already found, break */ + if (base_bits != 0) + { + break; + } + + /* check vtk typedefs */ + if (strncmp(cp, "vtk", 3) == 0) + { + for (i = 0; vtktypes[i].len != 0; i++) + { + if (n == vtktypes[i].len && strncmp(cp, vtktypes[i].name, n) == 0) + { + classname = vtktypes[i].name; + base_bits = vtkParse_MapType((int)vtktypes[i].type); + } + } + } + + /* check standard typedefs */ + if (base_bits == 0) + { + m = 0; + if (strncmp(cp, "::", 2) == 0) { m = 2; } + else if (strncmp(cp, "std::", 5) == 0) { m = 5; } +#ifndef VTK_LEGACY_REMOVE + else if (strncmp(cp, "vtkstd::", 8) == 0) { m = 8; } +#endif + + /* advance past the namespace */ + tmpcp = cp + m; + + for (i = 0; stdtypes[i].len != 0; i++) + { + if (n == stdtypes[i].len && strncmp(tmpcp, stdtypes[i].name, n) == 0) + { + classname = stdtypes[i].name; + base_bits = stdtypes[i].type; + } + } + + /* include the namespace if present */ + if (base_bits != 0 && m > 0) + { + classname = cp; + len = n; + } + } + + /* anything else is assumed to be a class, enum, or who knows */ + if (base_bits == 0) + { + base_bits = VTK_PARSE_UNKNOWN; + classname = cp; + len = n; + + /* VTK classes all start with vtk */ + if (strncmp(classname, "vtk", 3) == 0) + { + base_bits = VTK_PARSE_OBJECT; + /* make sure the "vtk" isn't just part of the namespace */ + for (k = 0; k < n; k++) + { + if (cp[k] == ':') + { + base_bits = VTK_PARSE_UNKNOWN; + break; + } + } + } + /* Qt objects and enums */ + else if (classname[0] == 'Q' && + ((classname[1] >= 'A' && classname[2] <= 'Z') || + strncmp(classname, "Qt::", 4) == 0)) + { + base_bits = VTK_PARSE_QOBJECT; + } + } + } + + cp += n; + while (*cp == ' ' || *cp == '\t') { cp++; } + } + + if ((unsigned_bits & VTK_PARSE_UNSIGNED) != 0) + { + switch (base_bits) + { + case VTK_PARSE_CHAR: + classname = "unsigned char"; + break; + case VTK_PARSE_SHORT: + classname = "unsigned short"; + break; + case VTK_PARSE_INT: + classname = "unsigned int"; + break; + case VTK_PARSE_LONG: + classname = "unsigned long"; + break; + case VTK_PARSE_LONG_LONG: + classname = "unsigned long long"; + break; + case VTK_PARSE___INT64: + classname = "unsigned __int64"; + break; + } + } + + *type_ptr = (static_bits | const_bits | unsigned_bits | base_bits); + + if (classname_ptr) + { + *classname_ptr = classname; + if (len == 0) + { + len = strlen(classname); + } + *len_ptr = len; + } + + return (size_t)(cp - text); +} + +/* Parse a type description in "text" and generate a typedef named "name" */ +void vtkParse_ValueInfoFromString(ValueInfo *data, const char *text) +{ + const char *cp = text; + size_t n; + int m, count; + unsigned int base_bits = 0; + unsigned int pointer_bits = 0; + unsigned int ref_bits = 0; + const char *classname = NULL; + + /* get the basic type with qualifiers */ + cp += vtkParse_BasicTypeFromString(cp, &base_bits, &classname, &n); + + data->Class = vtkParse_DuplicateString(classname, n); + + if ((base_bits & VTK_PARSE_STATIC) != 0) + { + data->IsStatic = 1; + } + + /* look for pointers (and const pointers) */ + while (*cp == '*') + { + cp++; + pointer_bits = (pointer_bits << 2); + while (*cp == ' ' || *cp == '\t') { cp++; } + if (strncmp(cp, "const", 5) == 0 && + (cp[5] < 'a' || cp[5] > 'z') && + (cp[5] < 'A' || cp[5] > 'Z') && + (cp[5] < '0' || cp[5] > '9') && + cp[5] != '_') + { + cp += 5; + while (*cp == ' ' || *cp == '\t') { cp++; } + pointer_bits = (pointer_bits | VTK_PARSE_CONST_POINTER); + } + else + { + pointer_bits = (pointer_bits | VTK_PARSE_POINTER); + } + pointer_bits = (pointer_bits & VTK_PARSE_POINTER_MASK); + } + + /* look for ref */ + if (*cp == '&') + { + cp++; + while (*cp == ' ' || *cp == '\t') { cp++; } + ref_bits = VTK_PARSE_REF; + } + + /* look for the variable name */ + if ((*cp >= 'a' && *cp <= 'z') || + (*cp >= 'A' && *cp <= 'Z') || + (*cp == '_')) + { + /* skip all chars that are part of a name */ + n = vtkparse_id_len(cp); + data->Name = vtkParse_DuplicateString(cp, n); + cp += n; + while (*cp == ' ' || *cp == '\t') { cp++; } + } + + /* look for array brackets */ + if (*cp == '[') + { + count = 1; + } + + while (*cp == '[') + { + n = vtkparse_bracket_len(cp); + if (n > 0) + { + cp++; + n--; + } + while (*cp == ' ' || *cp == '\t') { cp++; n--; } + while (n > 0 && (cp[n-1] == ' ' || cp[n-1] == '\t')) { n--; } + vtkParse_AddStringToArray(&data->Dimensions, + &data->NumberOfDimensions, + vtkParse_DuplicateString(cp, n)); + m = 0; + if (*cp >= '0' && *cp <= '9' && vtkparse_number_len(cp) == n) + { + m = (int)strtol(cp, NULL, 0); + } + count *= m; + + cp += n; + while (*cp == ' ' || *cp == '\t') { cp++; } + if (cp[n] == ']') { cp++; } + while (*cp == ' ' || *cp == '\t') { cp++; } + } + + /* add pointer indirection to correspond to first array dimension */ + if (data->NumberOfDimensions > 1) + { + pointer_bits = ((pointer_bits << 2) | VTK_PARSE_ARRAY); + } + else if (data->NumberOfDimensions == 1) + { + pointer_bits = ((pointer_bits << 2) | VTK_PARSE_POINTER); + } + pointer_bits = (pointer_bits & VTK_PARSE_POINTER_MASK); + + /* (Add code here to look for "=" followed by a value ) */ + + data->Type = (pointer_bits | ref_bits | base_bits); +} + + + +/* substitute generic types and values with actual types and values */ +static void func_substitution( + FunctionInfo *data, int m, const char *arg_names[], + const char *arg_values[], ValueInfo *arg_types[]); + +static void value_substitution( + ValueInfo *data, int m, const char *arg_names[], + const char *arg_values[], ValueInfo *arg_types[]) +{ + vtkParse_ExpandTypedefs(data, m, arg_names, arg_values, arg_types); + vtkParse_ExpandValues(data, m, arg_names, arg_values); + + if (data->Function) + { + func_substitution(data->Function, m, arg_names, arg_values, arg_types); + } +} + +static void func_substitution( + FunctionInfo *data, int m, const char *arg_names[], + const char *arg_values[], ValueInfo *arg_types[]) +{ + int i, n; + + n = data->NumberOfArguments; + for (i = 0; i < n; i++) + { + value_substitution(data->Arguments[i], m, arg_names, arg_values, arg_types); + if (i < MAX_ARGS) + { + data->ArgTypes[i] = data->Arguments[i]->Type; + data->ArgClasses[i] = data->Arguments[i]->Class; + if (data->Arguments[i]->NumberOfDimensions == 1 && + data->Arguments[i]->Count > 0) + { + data->ArgCounts[i] = data->Arguments[i]->Count; + } + } + } + if (data->ReturnValue) + { + value_substitution(data->ReturnValue, m, arg_names, arg_values, arg_types); + data->ReturnType = data->ReturnValue->Type; + data->ReturnClass = data->ReturnValue->Class; + if (data->ReturnValue->NumberOfDimensions == 1 && + data->ReturnValue->Count > 0) + { + data->HintSize = data->ReturnValue->Count; + data->HaveHint = 1; + } + } + if (data->Signature) + { + data->Signature = + vtkparse_string_replace(data->Signature, m, arg_names, arg_values, 1); + } +} + +static void class_substitution( + ClassInfo *data, int m, const char *arg_names[], + const char *arg_values[], ValueInfo *arg_types[]) +{ + int i, n; + + /* superclasses may be templated */ + n = data->NumberOfSuperClasses; + for (i = 0; i < n; i++) + { + data->SuperClasses[i] = vtkparse_string_replace( + data->SuperClasses[i], m, arg_names, arg_values, 1); + } + + n = data->NumberOfClasses; + for (i = 0; i < n; i++) + { + class_substitution(data->Classes[i], m, arg_names, arg_values, arg_types); + } + + n = data->NumberOfFunctions; + for (i = 0; i < n; i++) + { + func_substitution(data->Functions[i], m, arg_names, arg_values, arg_types); + } + + n = data->NumberOfConstants; + for (i = 0; i < n; i++) + { + value_substitution(data->Constants[i], m, arg_names, arg_values, arg_types); + } + + n = data->NumberOfVariables; + for (i = 0; i < n; i++) + { + value_substitution(data->Variables[i], m, arg_names, arg_values, arg_types); + } + + n = data->NumberOfTypedefs; + for (i = 0; i < n; i++) + { + value_substitution(data->Typedefs[i], m, arg_names, arg_values, arg_types); + } +} + + +/* Search and replace, return the initial string if no replacements + * occurred, otherwise return a new string allocated with malloc. */ +const char *vtkParse_StringReplace( + const char *str1, int n, const char *name[], const char *val[]) +{ + return vtkparse_string_replace(str1, n, name, val, 0); +} + +/* Extract template args from a comma-separated list enclosed + * in angle brackets. Returns zero if no angle brackets found. */ +size_t vtkParse_DecomposeTemplatedType( + const char *text, const char **classname, + int nargs, const char ***argp, const char *defaults[]) +{ + size_t i, j, k, n; + const char *arg; + char *new_text; + const char **template_args = NULL; + int template_arg_count = 0; + + n = vtkParse_NameLength(text); + + /* is the class templated? */ + for (i = 0; i < n; i++) + { + if (text[i] == '<') + { + break; + } + } + + new_text = (char *)malloc(i + 1); + strncpy(new_text, text, i); + new_text[i] = '\0'; + *classname = new_text; + + if (text[i] == '<') + { + i++; + /* extract the template arguments */ + for (;;) + { + while (text[i] == ' ' || text[i] == '\t') { i++; } + j = i; + while (text[j] != ',' && text[j] != '>' && + text[j] != '\n' && text[j] != '\0') + { + if (text[j] == '<' || text[j] == '(' || + text[j] == '[' || text[j] == '{') + { + j += vtkparse_bracket_len(&text[j]); + } + else if (text[j] == '\'' || text[j] == '\"') + { + j += vtkparse_quote_len(&text[j]); + } + else + { + j++; + } + } + + k = j; + while (text[k-1] == ' ' || text[k-1] == '\t') { --k; } + + new_text = (char *)malloc(k-i + 1); + strncpy(new_text, &text[i], k-i); + new_text[k-i] = '\0'; + vtkParse_AddStringToArray(&template_args, &template_arg_count, + new_text); + + assert(template_arg_count <= nargs); + + i = j + 1; + + if (text[j] != ',') + { + break; + } + } + } + + while (template_arg_count < nargs) + { + assert(defaults != NULL); + arg = defaults[template_arg_count]; + assert(arg != NULL); + new_text = (char *)malloc(strlen(arg + 1)); + strcpy(new_text, arg); + vtkParse_AddStringToArray(&template_args, &template_arg_count, new_text); + } + + *argp = template_args; + + return i; +} + +/* Free the list of strings returned by ExtractTemplateArgs. */ +void vtkParse_FreeTemplateDecomposition( + const char *name, int n, const char **args) +{ + int i; + + if (name) + { + free((char *)name); + } + + if (n > 0) + { + for (i = 0; i < n; i++) + { + free((char *)args[i]); + } + + free((char **)args); + } +} + + +/* Instantiate a class template by substituting the provided arguments. */ +void vtkParse_InstantiateClassTemplate( + ClassInfo *data, int n, const char *args[]) +{ + TemplateArgs *t = data->Template; + const char **new_args = NULL; + const char **arg_names = NULL; + ValueInfo **arg_types = NULL; + int i, m; + char *new_name; + size_t k; + + if (t == NULL) + { + fprintf(stderr, "vtkParse_InstantiateClassTemplate: " + "this class is not templated.\n"); + return; + } + + m = t->NumberOfArguments; + if (n > m) + { + fprintf(stderr, "vtkParse_InstantiateClassTemplate: " + "too many template args.\n"); + return; + } + + for (i = n; i < m; i++) + { + if (t->Arguments[i]->Value == NULL || + t->Arguments[i]->Value[0] == '\0') + { + fprintf(stderr, "vtkParse_InstantiateClassTemplate: " + "too few template args.\n"); + return; + } + } + + if (n < m) + { + new_args = (const char **)malloc(m*sizeof(char **)); + for (i = 0; i < n; i++) + { + new_args[i] = args[i]; + } + for (i = n; i < m; i++) + { + new_args[i] = t->Arguments[i]->Value; + } + args = new_args; + } + + arg_names = (const char **)malloc(m*sizeof(char **)); + arg_types = (ValueInfo **)malloc(m*sizeof(ValueInfo *)); + for (i = 0; i < m; i++) + { + arg_names[i] = t->Arguments[i]->Name; + arg_types[i] = NULL; + if (t->Arguments[i]->Type == 0) + { + arg_types[i] = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(arg_types[i]); + vtkParse_ValueInfoFromString(arg_types[i], args[i]); + arg_types[i]->ItemType = VTK_TYPEDEF_INFO; + arg_types[i]->Name = arg_names[i]; + } + } + + /* no longer a template (has been instantiated) */ + if (data->Template) + { + vtkParse_FreeTemplateArgs(data->Template); + } + data->Template = NULL; + + /* append template args to class name */ + k = strlen(data->Name) + 2; + for (i = 0; i < m; i++) + { + k += strlen(args[i]) + 2; + } + new_name = (char *)malloc(k); + strcpy(new_name, data->Name); + k = strlen(new_name); + new_name[k++] = '<'; + for (i = 0; i < m; i++) + { + strcpy(&new_name[k], args[i]); + k += strlen(args[i]); + if (i+1 < m) + { + new_name[k++] = ','; + new_name[k++] = ' '; + } + } + if (new_name[k-1] == '>') + { + new_name[k++] = ' '; + } + new_name[k++] = '>'; + new_name[k] = '\0'; + data->Name = vtkParse_DuplicateString(new_name, k); + free((char *)new_name); + + /* do the template arg substitution */ + class_substitution(data, m, arg_names, args, arg_types); + + /* free all allocated arrays */ + if (new_args) + { + free((char **)new_args); + } + + free((char **)arg_names); + + for (i = 0; i < m; i++) + { + if (arg_types[i]) + { + vtkParse_FreeValue(arg_types[i]); + } + } + free(arg_types); +} + +/* Generate a mangled name for a type, use gcc ia64 ABI. + * The result is placed in new_name, which must be large enough + * to accept the result. This function is incomplete, it cannot + * handle function types, or any literals except for integer literals. */ +size_t vtkParse_MangledTypeName(const char *name, char *new_name) +{ + int scoped = 0; + unsigned int ptype = 0; + size_t j, k, m; + size_t i = 0; + const char *cp; + char basictype; + + m = vtkParse_BasicTypeFromString(name, &ptype, NULL, NULL); + + /* look for pointers */ + cp = &name[m]; + while (*cp == ' ' || *cp == '\t') { cp++; } + while (*cp == '*') + { + do { cp++; } while (*cp == ' ' || *cp == '\t'); + if (*cp == 'c' && strncmp(cp, "const", 5) == 0 && + ((cp[5] < 'A' || cp[5] > 'Z') && + (cp[5] < 'a' || cp[5] > 'z') && + (cp[5] < '0' || cp[5] > '9') && + cp[5] != '_')) + { + cp += 4; + do { cp++; } while (*cp == ' ' || *cp == '\t'); + new_name[i++] = 'K'; + } + new_name[i++] = 'P'; + } + + /* prepend reference if present */ + if (*cp == '&') + { + do { cp++; } while (*cp == ' ' || *cp == '\t'); + for (k = i; k > 0; --k) + { + new_name[k] = new_name[k-1]; + } + new_name[0] = 'R'; + i++; + } + + /* array brackets are not handled */ + + /* qualifiers */ + if (ptype & VTK_PARSE_CONST) + { + new_name[i++] = 'K'; + } + + /* types: the following are unused + * 'w' -> wchar_t + * 'n' -> __int128 + * 'o' -> unsigned __int128 + * 'e' -> __float80 + * 'g' -> __float128 + * 'z' -> ... (varargs) + */ + + basictype = '\0'; + switch (ptype & VTK_PARSE_BASE_TYPE) + { + case VTK_PARSE_VOID: + basictype = 'v'; + break; + case VTK_PARSE_BOOL: + basictype = 'b'; + break; + case VTK_PARSE_CHAR: + basictype = 'c'; + break; + case VTK_PARSE_SIGNED_CHAR: + basictype = 'a'; + break; + case VTK_PARSE_UNSIGNED_CHAR: + basictype = 'h'; + break; + case VTK_PARSE_SHORT: + basictype = 's'; + break; + case VTK_PARSE_UNSIGNED_SHORT: + basictype = 't'; + break; + case VTK_PARSE_INT: + basictype = 'i'; + break; + case VTK_PARSE_UNSIGNED_INT: + basictype = 'j'; + break; + case VTK_PARSE_LONG: + basictype = 'l'; + break; + case VTK_PARSE_UNSIGNED_LONG: + basictype = 'm'; + break; + case VTK_PARSE_LONG_LONG: + case VTK_PARSE___INT64: + basictype = 'x'; + break; + case VTK_PARSE_UNSIGNED_LONG_LONG: + case VTK_PARSE_UNSIGNED___INT64: + basictype = 'y'; + break; + case VTK_PARSE_FLOAT: + basictype = 'f'; + break; + case VTK_PARSE_DOUBLE: + basictype = 'd'; + break; + } + + if (basictype) + { + new_name[i++] = basictype; + new_name[i] = '\0'; + return (size_t)(cp - name); + } + + m = 0; + cp = name; + do + { + cp += m; + while (*cp == ' ' || *cp == '\t') { cp++; } + m = vtkParse_UnscopedNameLength(cp); + } + while ((m == 5 && strncmp("const", cp, 5) == 0) || + (m == 8 && strncmp("volatile", cp, 8) == 0)); + + if (cp[m] == ':' && cp[m+1] == ':') + { + if (m == 3 && strncmp(cp, "std::", 5) == 0) + { + cp += 5; + m = vtkParse_UnscopedNameLength(cp); + if (cp[m] == ':' && cp[m+1] == ':') + { + new_name[i++] = 'N'; + scoped = 1; + } + /* short form for "std::" */ + new_name[i++] = 'S'; + new_name[i++] = 't'; + } + else + { + new_name[i++] = 'N'; + scoped = 1; + } + } + + do + { + if (cp[0] == ':' && cp[1] == ':') + { + cp += 2; + m = vtkParse_UnscopedNameLength(cp); + } + + for (j = 0; j < m; j++) + { + if (cp[j] == '<') + { + break; + } + } + + /* write out identifier length */ + if (j >= 100) { new_name[i++] = '0' + (char)(j/100); } + if (j >= 10) { new_name[i++] = '0' + (char)((j%100)/10); } + new_name[i++] = '0' + (char)(j%10); + + /* write out the identifier */ + strncpy(&new_name[i], cp, j); + i += j; + cp += j; + + /* handle template args */ + if (*cp == '<') + { + new_name[i++] = 'I'; + do + { + do { cp++; } while (*cp == ' ' || *cp == '\t'); + m = 0; + if ((*cp >= '0' && *cp <= '9') || + (*cp == '.' && cp[1] >= '0' && cp[1] <= '9') || + *cp == '\'' || *cp == '\"') + { + m = vtkParse_MangledLiteral(cp, &new_name[i]); + } + else + { + m = vtkParse_MangledTypeName(cp, &new_name[i]); + } + if (m == 0) + { + return 0; + } + cp += m; + i = strlen(new_name); + while (*cp == ' ' || *cp == '\t') { cp++; } + } + while (*cp == ','); + new_name[i++] = 'E'; + if (*cp != '>') + { + new_name[i] = '\0'; + return 0; + } + cp++; + } + } + while (cp[0] == ':' && cp[1] == ':'); + + if (scoped) + { + new_name[i++] = 'E'; + } + + new_name[i] = '\0'; + + return (size_t)(cp - name); +} + +/* Generate a mangled name for a literal, use gcc ia64 ABI. */ +size_t vtkParse_MangledLiteral(const char *name, char *new_name) +{ + const char *cp = name; + size_t i = 0; + char *tmp; + + /* only decimal integers are supported for now */ + if (*cp >= '0' && *cp <= '9') + { + /* reject octal and hexadecimal */ + if (cp[0] == '0' && (cp[1] == 'x' || cp[1] == 'X' || + (cp[1] >= '0' && cp[1] <= '9'))) + { + new_name[0] = '\0'; + return 0; + } + + new_name[i++] = 'L'; + tmp = &new_name[i]; + new_name[i++] = 'i'; + do { new_name[i++] = *cp++; } + while (*cp >= '0' && *cp <= '9'); + + /* reject floats */ + if (*cp == '.' || *cp == 'f' || *cp == 'e' || *cp == 'E') + { + new_name[0] = '\0'; + return 0; + } + + for (;;) + { + if (*cp == 'u' || *cp == 'U') + { + if (*tmp == 'i') { *tmp = 'j'; } + else if (*tmp == 'l') { *tmp = 'm'; } + else if (*tmp == 'x') { *tmp = 'y'; } + cp++; + } + else if (*cp == 'l' || *cp == 'L') + { + if (*tmp == 'i') { *tmp = 'l'; } + else if (*tmp == 'j') { *tmp = 'm'; } + else if (*tmp == 'l') { *tmp = 'x'; } + else if (*tmp == 'm') { *tmp = 'y'; } + cp++; + } + else + { + break; + } + } + new_name[i++] = 'E'; + } + new_name[i] = '\0'; + + return (size_t)(cp - name); +} + +/* Get a zero-terminated array of the types in vtkTemplateMacro. */ +const char **vtkParse_GetTemplateMacroTypes() +{ + static const char *types[] = { + "char", "signed char", "unsigned char", "short", "unsigned short", + "int", "unsigned int", "long", "unsigned long", +#ifdef VTK_TYPE_USE_LONG_LONG + "long long", "unsigned long long", +#endif +#ifdef VTK_TYPE_USE___INT64 + "__int64", "unsigned __int64", +#endif + "float", "double", NULL }; + + return types; +} + +/* Get a zero-terminated array of the types in vtkArray. */ +const char **vtkParse_GetArrayTypes() +{ + static const char *types[] = { + "char", "signed char", "unsigned char", "short", "unsigned short", + "int", "unsigned int", "long", "unsigned long", +#ifdef VTK_TYPE_USE_LONG_LONG + "long long", "unsigned long long", +#endif +#ifdef VTK_TYPE_USE___INT64 + "__int64", "unsigned __int64", +#endif + "float", "double", + "vtkStdString", "vtkUnicodeString", "vtkVariant", NULL }; + + return types; +} diff --git a/src/ParaView/vtkParseExtras.h b/src/ParaView/vtkParseExtras.h new file mode 100644 index 00000000..5a552a6e --- /dev/null +++ b/src/ParaView/vtkParseExtras.h @@ -0,0 +1,173 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkParseExtras.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright (c) 2011 David Gobbi. + + Contributed to the VisualizationToolkit by the author in May 2011 + under the terms of the Visualization Toolkit 2008 copyright. +-------------------------------------------------------------------------*/ + +/** + * This file contains extra utilities for parsing and wrapping. + */ + +#ifndef VTK_PARSE_EXTRAS_H +#define VTK_PARSE_EXTRAS_H + +#include "vtkParse.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Skip over a sequence of characters that begin with an alphabetic + * character or an underscore, and include only alphanumeric + * characters or underscores. Return the number of characters. + */ +size_t vtkParse_IdentifierLength(const char *text); + +/** + * Skip over a name, including any namespace prefixes and + * any template arguments. Return the number of characters. + */ +size_t vtkParse_NameLength(const char *text); + +/** + * Skip over a name, including any template parameters, but stopping + * if a '::' is encoutered. Return the number of characters. + */ +size_t vtkParse_UnscopedNameLength(const char *text); + +/** + * Skip over a literal, which may be a number, a char in single + * quotes, a string in double quotes, or a name, or a name followed + * by arguments in parentheses. + */ +size_t vtkParse_LiteralLength(const char *text); + +/** + * Get a type from a type name, and return the number of characters used. + * If the "classname" argument is not NULL, then it is used to return + * the short name for the type, e.g. "long int" becomes "long", while + * typedef names and class names are returned unchanged. If "const" + * appears in the type name, then the const bit flag is set for the + * type, but "const" will not appear in the returned classname. + */ +size_t vtkParse_BasicTypeFromString( + const char *text, unsigned int *type, + const char **classname, size_t *classname_len); + +/** + * Generate a ValueInfo by parsing the type from the provided text. + * Only simple text strings are supported, e.g. "const T **". + */ +void vtkParse_ValueInfoFromString(ValueInfo *val, const char *text); + +/** + * Expand a typedef within a variable, parameter, or typedef declaration. + * The expansion is done in-place. + */ +void vtkParse_ExpandTypedef(ValueInfo *valinfo, ValueInfo *typedefinfo); + +/** + * Expand any unrecognized types within a variable, parameter, or typedef + * that match any of the supplied typedefs. The expansion is done in-place. + */ +void vtkParse_ExpandTypedefs( + ValueInfo *valinfo, int n, const char *name[], const char *val[], + ValueInfo *typedefinfo[]); + +/** + * Wherever one of the specified names exists inside a Value or inside + * a Dimension size, replace it with the corresponding val string. + * This is used to replace constants with their values. + */ +void vtkParse_ExpandValues( + ValueInfo *valinfo, int n, const char *name[], const char *val[]); + +/** + * Search for all occurences of "name" and replace with the corresponding + * "val", return the initial string if no replacements occurred, otherwise + * return a new string allocated with malloc. + */ +const char *vtkParse_StringReplace( + const char *str1, int n, const char *name[], const char *val[]); + +/** + * Extract the class name and template args from a templated + * class type ID. Returns the full number of characters that + * were consumed during the decomposition. + */ +size_t vtkParse_DecomposeTemplatedType( + const char *text, const char **classname, + int n, const char ***args, const char *defaults[]); + +/** + * Free the list of strings returned by ExtractTemplateArgs. + */ +void vtkParse_FreeTemplateDecomposition( + const char *classname, int n, const char **args); + +/** + * Instantiate a class template by substituting the provided arguments + * for the template parameters. If "n" is less than the number of template + * parameters, then default parameter values (if present) will be used. + * If an error occurs, the error will be printed to stderr and NULL will + * be returned. + */ +void vtkParse_InstantiateClassTemplate( + ClassInfo *data, int n, const char *args[]); + +/** + * Instantiate a function or class method template by substituting the + * provided arguments for the template parameters. If "n" is less than + * the number of template parameters, then default parameter values + * (if present) will be used. If an error occurs, the error will be + * printed to stderr and NULL will be returned. + */ +void vtkParse_IntantiateFunctionTemplate( + FunctionInfo *data, int n, const char *args); + +/** + * Generate a mangled name for a type, use gcc ia64 ABI. + * The result is placed in new_name, which must be large enough + * to accept the result. + */ +size_t vtkParse_MangledTypeName(const char *name, char *new_name); + +/** + * Generate a mangled name for a literal. Only handles decimal + * integer literals. It guesses type from suffix "u", "ul", + * "ull", "l", "ll" so only certain types are supported. + */ +size_t vtkParse_MangledLiteral(const char *name, char *new_name); + +/** + * Get a zero-terminated array of the types in vtkTemplateMacro. + */ +const char **vtkParse_GetTemplateMacroTypes(); + +/** + * Get a zero-terminated array of the types in vtkArray. + */ +const char **vtkParse_GetArrayTypes(); + + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/ParaView/vtkParseHierarchy.c b/src/ParaView/vtkParseHierarchy.c new file mode 100644 index 00000000..c7fafcfe --- /dev/null +++ b/src/ParaView/vtkParseHierarchy.c @@ -0,0 +1,988 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkParseHierarchy.c + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright (c) 2010 David Gobbi. + + Contributed to the VisualizationToolkit by the author in June 2010 + under the terms of the Visualization Toolkit 2008 copyright. +-------------------------------------------------------------------------*/ + +#include "vtkParseHierarchy.h" +#include "vtkParseInternal.h" +#include "vtkParseExtras.h" +#include "vtkType.h" +#include +#include +#include +#include +#include + +static size_t skip_space(const char *text) +{ + size_t i = 0; + while (isspace(text[i]) && text[i] != '\n') { i++; } + return i; +} + +/* helper: comparison of entries */ +static int compare_hierarchy_entries(const void *vp1, const void *vp2) +{ + const HierarchyEntry *entry1 = (const HierarchyEntry *)vp1; + const HierarchyEntry *entry2 = (const HierarchyEntry *)vp2; + + return strcmp(entry1->Name, entry2->Name); +} + +/* helper: sort the entries to facilitate searching */ +static void sort_hierarchy_entries(HierarchyInfo *info) +{ + qsort(info->Entries, info->NumberOfEntries, sizeof(HierarchyEntry), + &compare_hierarchy_entries); +} + +/* Find an entry with a binary search */ +HierarchyEntry *vtkParseHierarchy_FindEntry( + const HierarchyInfo *info, const char *classname) +{ + HierarchyEntry key; + HierarchyEntry *entry; + size_t i, n; + char name[32]; + char *cp; + + /* use classname as-is for the search if possible */ + cp = (char *)classname; + + /* get portion of name before final template parameters */ + n = vtkParse_UnscopedNameLength(classname); + i = 0; + while (classname[i+n] == ':' && classname[i+n+1] == ':') + { + i += n + 2; + n = vtkParse_UnscopedNameLength(&classname[i]); + } + i += vtkParse_IdentifierLength(&classname[i]); + + /* create a new (shorter) search string if necessary */ + if (classname[i] != '\0') + { + /* use stack space if possible */ + cp = name; + /* otherwise, use malloc */ + if (i > 31) + { + cp = (char *)malloc(i+1); + } + strncpy(cp, classname, i); + cp[i] = '\0'; + } + + key.Name = cp; + + entry = (HierarchyEntry *)bsearch(&key, info->Entries, + info->NumberOfEntries, sizeof(HierarchyEntry), + &compare_hierarchy_entries); + + if (cp != classname && cp != name) + { + free(cp); + } + + return entry; +} + + +/* read a hierarchy file into a HeirarchyInfo struct, or return NULL */ +HierarchyInfo *vtkParseHierarchy_ReadFile(const char *filename) +{ + HierarchyInfo *info; + HierarchyEntry *entry; + int maxClasses = 500; + FILE *fp; + char *line; + char *cp; + const char *ccp; + size_t maxlen = 15; + size_t i, j, n, m; + unsigned int bits, pointers; + + line = (char *)malloc(maxlen); + + fp = fopen(filename, "r"); + + if (fp == NULL) + { + return NULL; + } + + info = (HierarchyInfo *)malloc(sizeof(HierarchyInfo)); + info->NumberOfEntries = 0; + info->Entries = (HierarchyEntry *)malloc(maxClasses*sizeof(HierarchyEntry)); + + while (fgets(line, (int)maxlen, fp)) + { + n = strlen(line); + + /* if buffer not long enough, increase it */ + while (n == maxlen-1 && line[n-1] != '\n' && !feof(fp)) + { + maxlen *= 2; + line = (char *)realloc(line, maxlen); + if (!fgets(&line[n], (int)(maxlen-n), fp)) { break; } + n += strlen(&line[n]); + } + + while (n > 0 && isspace(line[n-1])) + { + n--; + } + line[n] = '\0'; + + if (line[0] == '\0') + { + continue; + } + + if (info->NumberOfEntries == maxClasses) + { + maxClasses *= 2; + info->Entries = (HierarchyEntry *)realloc( + info->Entries, sizeof(HierarchyEntry)*maxClasses*2); + } + + entry = &info->Entries[info->NumberOfEntries++]; + entry->Name = NULL; + entry->HeaderFile = NULL; + entry->Module = NULL; + entry->NumberOfTemplateArgs = 0; + entry->TemplateArgs = NULL; + entry->TemplateArgDefaults = NULL; + entry->NumberOfProperties = 0; + entry->Properties = NULL; + entry->NumberOfSuperClasses = 0; + entry->SuperClasses = NULL; + entry->SuperClassIndex = NULL; + entry->Typedef = NULL; + entry->IsTypedef = 0; + entry->IsEnum = 0; + + i = skip_space(line); + n = vtkParse_NameLength(&line[i]); + for (m = 0; m < n; m++) + { + if (line[i+m] == '<') { break; } + } + + cp = (char *)malloc(m+1); + strncpy(cp, &line[i], m); + cp[m] = '\0'; + entry->Name = cp; + i += m; + + if (line[i] == '<') + { + i++; + i += skip_space(&line[i]); + + for (j = 0; line[i] != '>' && line[i] != '\0'; j++) + { + if (j == 0) + { + entry->TemplateArgs = (const char **)malloc(sizeof(char *)); + entry->TemplateArgDefaults = (const char **)malloc(sizeof(char *)); + } + else + { + entry->TemplateArgs = (const char **)realloc( + (char **)entry->TemplateArgs, (j+1)*sizeof(char *)); + entry->TemplateArgDefaults = (const char **)realloc( + (char **)entry->TemplateArgDefaults, (j+1)*sizeof(char *)); + } + entry->NumberOfTemplateArgs++; + entry->TemplateArgDefaults[j] = NULL; + + m = vtkParse_NameLength(&line[i]); + + cp = (char *)malloc(m+1); + strncpy(cp, &line[i], m); + cp[m] = '\0'; + entry->TemplateArgs[j] = cp; + i += m; + i += skip_space(&line[i]); + + if (line[i] == '=') + { + i++; + i += skip_space(&line[i]); + m = vtkParse_NameLength(&line[i]); + + cp = (char *)malloc(m+1); + strncpy(cp, &line[i], m); + cp[m] = '\0'; + entry->TemplateArgDefaults[j] = cp; + i += m; + i += skip_space(&line[i]); + } + + if (line[i] == ',') + { + i++; + i += skip_space(&line[i]); + } + } + + if (line[i] == '>') + { + i++; + i += skip_space(&line[i]); + } + + if (line[i] == ':' && line[i+1] == ':') + { + i += 2; + m = vtkParse_NameLength(&line[i]); + n = strlen(entry->Name); + cp = (char *)malloc(n+m+3); + strcpy(cp, entry->Name); + strcpy(&cp[n], "::"); + strncpy(&cp[n+2], &line[i], m); + i += m; + cp[n+m+2] = '\0'; + free((char *)entry->Name); + entry->Name = cp; + } + } + + i += skip_space(&line[i]); + + /* classes (and possibly enums) */ + if (line[i] == ':') + { + i++; + i += skip_space(&line[i]); + n = vtkParse_NameLength(&line[i]); + /* check for enum indicators */ + if ((n == 3 && strncmp(&line[i], "int", n)) || + (n == 4 && strncmp(&line[i], "enum", n))) + { + entry->IsEnum = 1; + i += n; + i += skip_space(&line[i]); + } + /* else check for superclasses */ + else for (j = 0; ; j++) + { + if (j == 0) + { + entry->SuperClasses = (const char **)malloc(sizeof(char *)); + entry->SuperClassIndex = (int *)malloc(sizeof(int)); + } + else + { + entry->SuperClasses = (const char **)realloc( + (char **)entry->SuperClasses, (j+1)*sizeof(char *)); + entry->SuperClassIndex = (int *)realloc( + entry->SuperClassIndex, (j+1)*sizeof(int)); + } + entry->NumberOfSuperClasses++; + + i += skip_space(&line[i]); + n = vtkParse_NameLength(&line[i]); + cp = (char *)malloc(n+1); + strncpy(cp, &line[i], n); + cp[n] = '\0'; + entry->SuperClasses[j] = cp; + entry->SuperClassIndex[j] = -1; + i += n; + + i += skip_space(&line[i]); + if (line[i] != ',') + { + break; + } + i++; + } + } + + /* read typedefs */ + else if (line[i] == '=') + { + i++; + i += skip_space(&line[i]); + entry->IsTypedef = 1; + entry->Typedef = (ValueInfo *)malloc(sizeof(ValueInfo)); + vtkParse_InitValue(entry->Typedef); + + /* type is a reference (does this ever occur?) */ + if (line[i] == '&') + { + i++; + i += skip_space(&line[i]); + entry->Typedef->Type |= VTK_PARSE_REF; + } + + /* type has array dimensions */ + if (line[i] == '[') + { + entry->Typedef->Count = 1; + } + + while (line[i] == '[') + { + i++; + n = 0; + while (line[i+n] != ']' && line[i+n] != '\n' && line[i+n] != '\0') + { + n++; + } + ccp = vtkParse_DuplicateString(&line[i], n); + vtkParse_AddStringToArray(&entry->Typedef->Dimensions, + &entry->Typedef->NumberOfDimensions, ccp); + if (ccp[0] >= '0' && ccp[0] <= '9') + { + entry->Typedef->Count *= (int)strtol(ccp, NULL, 0); + } + else + { + entry->Typedef->Count = 0; + } + i += n; + if (line[i] == ']') + { + i++; + } + } + i += skip_space(&line[i]); + + /* look for pointers (and const pointers) */ + bits = 0; + while (line[i] == '*' || strncmp(&line[i], "const*", 6) == 0) + { + bits = (bits << 2); + if (line[i] == '*') + { + bits = (bits | VTK_PARSE_POINTER); + } + else + { + bits = (bits | VTK_PARSE_CONST_POINTER); + i += 5; + } + bits = (bits & VTK_PARSE_POINTER_MASK); + i++; + i += skip_space(&line[i]); + } + + /* need to reverse to get correct pointer order */ + pointers = 0; + while (bits) + { + pointers = (pointers << 2); + pointers = (pointers | (bits & VTK_PARSE_POINTER_LOWMASK)); + bits = ((bits >> 2) & VTK_PARSE_POINTER_MASK); + } + + /* add pointer indirection to correspond to first array dimension */ + if (entry->Typedef->NumberOfDimensions > 1) + { + pointers = ((pointers << 2) | VTK_PARSE_ARRAY); + } + else if (entry->Typedef->NumberOfDimensions == 1) + { + pointers = ((pointers << 2) | VTK_PARSE_POINTER); + } + + /* include the pointers in the type */ + entry->Typedef->Type |= (pointers & VTK_PARSE_POINTER_MASK); + + /* read the base type (and const) */ + bits = 0; + i += vtkParse_BasicTypeFromString(&line[i], &bits, &ccp, &n); + entry->Typedef->Class = vtkParse_DuplicateString(ccp, n); + entry->Typedef->Type |= bits; + } + + /* get the header file */ + if (line[i] == ';') + { + i++; + i += skip_space(&line[i]); + n = 0; + while(line[i+n] != '\0' && line[i+n] != ';' && + !isspace(line[i+n])) { n++; }; + cp = (char *)malloc(n+1); + strncpy(cp, &line[i], n); + cp[n] = '\0'; + entry->HeaderFile = cp; + + i += n; + i += skip_space(&line[i]); + + /* get the module */ + if (line[i] == ';') + { + i++; + i += skip_space(&line[i]); + n = 0; + while(line[i+n] != '\0' && line[i+n] != ';' && + !isspace(line[i+n])) { n++; }; + cp = (char *)malloc(n+1); + strncpy(cp, &line[i], n); + cp[n] = '\0'; + entry->Module = cp; + + i += n; + i += skip_space(&line[i]); + } + + /* get all flags */ + while (line[i] == ';') + { + i++; + i += skip_space(&line[i]); + if (entry->NumberOfProperties == 0) + { + entry->Properties = (const char **)malloc(sizeof(char **)); + } + else + { + entry->Properties = (const char **)realloc( + (char **)entry->Properties, + (entry->NumberOfProperties+1)*sizeof(char **)); + } + n = 0; + while (line[i+n] != '\0' && line[i+n] != '\n' && line[i+n] != ';') + { n++; } + if (n && skip_space(&line[i]) != n) + { + cp = (char *)malloc((n+1)*sizeof(char *)); + strncpy(cp, &line[i], n); + cp[n] = '\0'; + entry->Properties[entry->NumberOfProperties++] = cp; + } + i += n; + } + } + } + + if (!feof(fp)) + { + vtkParseHierarchy_Free(info); + info = NULL; + } + + free(line); + + sort_hierarchy_entries(info); + + return info; +} + +/* free a HierarchyInfo struct */ +void vtkParseHierarchy_Free(HierarchyInfo *info) +{ + HierarchyEntry *entry; + int i, j; + + for (i = 0; i < info->NumberOfEntries; i++) + { + entry = &info->Entries[i]; + free((char *)entry->Name); + free((char *)entry->HeaderFile); + for (j = 0; j < entry->NumberOfTemplateArgs; j++) + { + free((char *)entry->TemplateArgs[j]); + if (entry->TemplateArgDefaults[j]) + { + free((char *)entry->TemplateArgDefaults[j]); + } + } + if (entry->NumberOfTemplateArgs) + { + free((char **)entry->TemplateArgs); + free((char **)entry->TemplateArgDefaults); + } + for (j = 0; j < entry->NumberOfSuperClasses; j++) + { + free((char *)entry->SuperClasses[j]); + } + if (entry->NumberOfSuperClasses) + { + free((char **)entry->SuperClasses); + free(entry->SuperClassIndex); + } + for (j = 0; j < entry->NumberOfProperties; j++) + { + free((char *)entry->Properties[j]); + } + if (entry->NumberOfProperties) + { + free((char **)entry->Properties); + } + } + + free(info->Entries); + free(info); +} + + +/* Check whether class is derived from baseclass. You must supply + * the entry for the class (returned by FindEntry) as well as the + * classname. If the class is templated, the classname can include + * template args in angle brackets. If you provide a pointer for + * baseclass_with_args, then it will be used to return the name of + * name of the baseclass with template args in angle brackets. */ + +int vtkParseHierarchy_IsTypeOfTemplated( + const HierarchyInfo *info, + const HierarchyEntry *entry, const char *classname, + const char *baseclass, const char **baseclass_with_args) +{ + HierarchyEntry *tmph; + const char *name; + const char *supername; + char *tmp; + int templated; + int baseclass_is_template_parameter; + int supername_needs_free = 0; + int classname_needs_free = 0; + int i, j, k; + int nargs; + const char **args; + size_t m; + int iterating = 1; + int rval = 0; + + while (iterating) + { + iterating = 0; + templated = 0; + baseclass_is_template_parameter = 0; + nargs = 0; + args = NULL; + + /* if classname is the same as baseclass, done! */ + if (strcmp(entry->Name, baseclass) == 0) + { + if (baseclass_with_args) + { + if (!classname_needs_free) + { + tmp = (char *)malloc(strlen(classname) + 1); + strcpy(tmp, classname); + classname = tmp; + } + *baseclass_with_args = classname; + classname_needs_free = 0; + } + rval = 1; + break; + } + else if (entry->NumberOfSuperClasses == 0) + { + rval = 0; + break; + } + + /* if class is templated */ + if (entry->NumberOfTemplateArgs) + { + /* check for template args for classname */ + m = strlen(entry->Name); + if (classname[m] == '<') + { + templated = 1; + + nargs = entry->NumberOfTemplateArgs; + vtkParse_DecomposeTemplatedType(classname, &name, nargs, &args, + entry->TemplateArgDefaults); + } + } + + /* check all baseclasses */ + for (j = 0; j < entry->NumberOfSuperClasses && rval == 0; j++) + { + supername = entry->SuperClasses[j]; + + if (templated) + { + for (k = 0; k < entry->NumberOfTemplateArgs; k++) + { + /* check if the baseclass itself is a template parameter */ + m = strlen(entry->TemplateArgs[k]); + if (strncmp(entry->TemplateArgs[k], supername, m) == 0 && + !isalnum(supername[m]) && supername[m] != '_') + { + baseclass_is_template_parameter = 1; + break; + } + } + + /* use the class template args to find baseclass template args */ + supername = vtkParse_StringReplace( + supername, entry->NumberOfTemplateArgs, entry->TemplateArgs, args); + if (supername != entry->SuperClasses[j]) + { + supername_needs_free = 1; + } + } + + /* check the cached index for the baseclass entry */ + i = entry->SuperClassIndex[j]; + if (i == -1) + { + /* index was not set yet, so search for the entry */ + tmph = vtkParseHierarchy_FindEntry(info, supername); + while (tmph && tmph->IsTypedef) + { + if (tmph->Typedef->Class) + { + tmph = vtkParseHierarchy_FindEntry(info, tmph->Typedef->Class); + continue; + } + break; + } + + if (tmph) + { + i = (int)(tmph - info->Entries); + } + else + { + /* entry not found, don't try again */ + /* i = -2; messes things up for templates */ + /* fprintf(stderr, "not found \"%s\"\n", entry->SuperClasses[j]); */ + } + + /* if baseclass is a template parameter, its entry cannot be cached */ + if (!baseclass_is_template_parameter) + { + /* cache the position of the baseclass */ + ((HierarchyEntry *)entry)->SuperClassIndex[j] = i; + } + } + + /* if entry was found, continue down the chain */ + if (i >= 0) + { + if (classname_needs_free) + { + free((char *)classname); + } + classname = supername; + classname_needs_free = supername_needs_free; + supername_needs_free = 0; + + /* use the iteration loop instead of recursion */ + if (j+1 >= entry->NumberOfSuperClasses) + { + entry = &info->Entries[i]; + iterating = 1; + } + + /* recurse for multiple inheritance */ + else + { + rval = vtkParseHierarchy_IsTypeOfTemplated( + info, &info->Entries[i], classname, baseclass, + baseclass_with_args); + } + } + + if (supername_needs_free) + { + free((char *)supername); + supername_needs_free = 0; + } + + } /* end of loop over superclasses */ + + if (templated) + { + vtkParse_FreeTemplateDecomposition(name, nargs, args); + } + + } /* end of "while (iterating)" */ + + if (classname_needs_free) + { + free((char *)classname); + } + + if (baseclass_with_args && !rval) + { + *baseclass_with_args = NULL; + } + + return rval; +} + +int vtkParseHierarchy_IsTypeOf( + const HierarchyInfo *info, const HierarchyEntry *entry, + const char *baseclass) +{ + return vtkParseHierarchy_IsTypeOfTemplated( + info, entry, entry->Name, baseclass, NULL); +} + +/* Free args returned by IsTypeOfTemplated */ +void vtkParseHierarchy_FreeTemplateArgs(int n, const char *args[]) +{ + int i; + + for (i = 0; i < n; i++) + { + free((char *)args[i]); + } + + free((char **)args); +} + +/* Given a classname with template parameters, get the superclass name + * with corresponding template parameters. Returns null if 'i' is out + * of range, i.e. greater than or equal to the number of superclasses. + * The returned classname must be freed with "free()". */ +const char *vtkParseHierarchy_TemplatedSuperClass( + const HierarchyEntry *entry, const char *classname, int i) +{ + const char *supername = NULL; + const char *name; + const char **args; + char *cp; + size_t j; + + if (i < entry->NumberOfSuperClasses) + { + supername = entry->SuperClasses[i]; + j = vtkParse_IdentifierLength(classname); + + if (classname[j] == '<') + { + vtkParse_DecomposeTemplatedType(classname, &name, + entry->NumberOfTemplateArgs, &args, entry->TemplateArgDefaults); + supername = vtkParse_StringReplace(entry->SuperClasses[i], + entry->NumberOfTemplateArgs, entry->TemplateArgs, args); + vtkParse_FreeTemplateDecomposition( + name, entry->NumberOfTemplateArgs, args); + } + + if (supername == entry->SuperClasses[i]) + { + cp = (char *)malloc(strlen(supername) + 1); + strcpy(cp, supername); + supername = cp; + } + } + + return supername; +} + +/* get the specified property, or return NULL */ +const char *vtkParseHierarchy_GetProperty( + const HierarchyEntry *entry, const char *property) +{ + int i; + size_t k; + + if (entry) + { + for (i = 0; i < entry->NumberOfProperties; i++) + { + /* skip the property name, everything after is the property */ + k = vtkParse_NameLength(entry->Properties[i]); + if (k == strlen(property) && + strncmp(entry->Properties[i], property, k) == 0) + { + if (entry->Properties[i][k] == ' ' || + entry->Properties[i][k] == '=') { k++; } + return &entry->Properties[i][k]; + } + } + } + + return NULL; +} + +/* Expand all unrecognized types in a ValueInfo struct by + * using the typedefs in the HierarchyInfo struct. */ +int vtkParseHierarchy_ExpandTypedefsInValue( + const HierarchyInfo *info, ValueInfo *val, const char *scope) +{ + char text[128]; + char *cp; + const char *newclass; + size_t n, m; + int i; + HierarchyEntry *entry; + int scope_needs_free = 0; + int result = 1; + + while (((val->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_OBJECT || + (val->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_UNKNOWN) && + val->Class != 0) + { + entry = 0; + + /* search for the type in the provided scope */ + while (entry == 0 && scope != 0) + { + cp = text; + n = strlen(scope); + m = strlen(val->Class); + /* only malloc if more than 128 chars needed */ + if (n + m + 2 >= 128) + { + cp = (char *)malloc(n+m+3); + } + + /* scope the name */ + strncpy(cp, scope, n); + cp[n++] = ':'; + cp[n++] = ':'; + strncpy(&cp[n], val->Class, m); + cp[n+m] = '\0'; + + entry = vtkParseHierarchy_FindEntry(info, cp); + + if (cp != text) { free(cp); } + + /* if not found, try inherited scopes */ + if (entry == 0) + { + entry = vtkParseHierarchy_FindEntry(info, scope); + scope = 0; + scope_needs_free = 0; + if (entry && entry->NumberOfSuperClasses) + { + for (i = 0; i+1 < entry->NumberOfSuperClasses; i++) + { + if (scope_needs_free) { free((char *)scope); } + scope = vtkParseHierarchy_ExpandTypedefsInName( + info, entry->SuperClasses[i], NULL); + scope_needs_free = (scope != entry->SuperClasses[i]); + /* recurse if more than one superclass */ + if (vtkParseHierarchy_ExpandTypedefsInValue(info, val, scope)) + { + if (scope_needs_free) { free((char *)scope); } + return 1; + } + } + if (scope_needs_free) { free((char *)scope); } + scope = vtkParseHierarchy_ExpandTypedefsInName( + info, entry->SuperClasses[i], NULL); + scope_needs_free = (scope != entry->SuperClasses[i]); + } + entry = 0; + } + } + + /* if not found, try again with no scope */ + if (entry == 0) + { + entry = vtkParseHierarchy_FindEntry(info, val->Class); + } + + if (entry && entry->IsTypedef) + { + vtkParse_ExpandTypedef(val, entry->Typedef); + } + else if (entry) + { + newclass = vtkParseHierarchy_ExpandTypedefsInName( + info, val->Class, scope); + if (newclass != val->Class) + { + val->Class = vtkParse_DuplicateString(newclass, strlen(newclass)); + free((char *)newclass); + } + result = 1; + break; + } + else + { + result = 0; + break; + } + } + + if (scope_needs_free) { free((char *)scope); } + + return result; +} + +/* Expand typedefs found in an expression stored as a string. + * The value of "text" will be returned if no expansion occurred, + * else a new string is returned that must be freed with "free()". */ +const char *vtkParseHierarchy_ExpandTypedefsInName( + const HierarchyInfo *info, const char *name, const char *scope) +{ + char text[128]; + char *cp; + size_t n, m; + const char *newname = name; + HierarchyEntry *entry = NULL; + + /* note: unlike ExpandTypedefsInValue, this does not yet recurse + * or look in superclass scopes */ + + /* doesn't yet handle names that are scoped or templated */ + m = vtkParse_IdentifierLength(name); + if (name[m] != '\0') + { + return name; + } + + if (scope) + { + cp = text; + n = strlen(scope); + m = strlen(name); + /* only malloc if more than 128 chars needed */ + if (n + m + 2 >= 128) + { + cp = (char *)malloc(n+m+3); + } + + /* scope the name */ + strncpy(cp, scope, n); + cp[n++] = ':'; + cp[n++] = ':'; + strncpy(&cp[n], name, m); + cp[n+m] = '\0'; + + entry = vtkParseHierarchy_FindEntry(info, cp); + + if (cp != text) { free(cp); } + } + + if (!entry) + { + entry = vtkParseHierarchy_FindEntry(info, name); + } + + newname = NULL; + if (entry && entry->IsTypedef && entry->Typedef->Class) + { + newname = entry->Typedef->Class; + } + if (newname) + { + cp = (char *)malloc(strlen(newname) + 1); + strcpy(cp, newname); + name = cp; + } + + return name; +} diff --git a/src/ParaView/vtkParseHierarchy.h b/src/ParaView/vtkParseHierarchy.h new file mode 100644 index 00000000..7edb869e --- /dev/null +++ b/src/ParaView/vtkParseHierarchy.h @@ -0,0 +1,157 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkParseHierarchy.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright (c) 2010 David Gobbi. + + Contributed to the VisualizationToolkit by the author in June 2010 + under the terms of the Visualization Toolkit 2008 copyright. +--------------------------------------------------------------------------*/ + +/** + This file contains utility functions for loading and parsing + a VTK hierarchy file. The file contains entries like the + following (one per line in the file): + + classname [ : superclass ] ; header.h ; vtkKit [; flags] + + For each typedef, the output file will have a line like this: + + name = &[2][3]* const type ; header.h ; vtkKit [; flags] + + For each enum, the output file will have: + + enumname : enum ; header.h ; vtkKit [; flags] + +*/ + +#ifndef VTK_PARSE_HIERARCHY_H +#define VTK_PARSE_HIERARCHY_H + +/* Need the ValueInfo struct for typedefs */ +#include "vtkParse.h" + +/** + * One entry from the hierarchy file. + * It contains a class name, the superclasses, and the header file. + */ +typedef struct _HierarchyEntry +{ + const char *Name; /* the class or type name */ + const char *HeaderFile; /* header file the class is defined in */ + const char *Module; /* library the class is defined in */ + int NumberOfTemplateArgs; /* number of template arguments */ + const char **TemplateArgs; + const char **TemplateArgDefaults; + int NumberOfProperties; /* number of properties */ + const char **Properties; + int NumberOfSuperClasses; /* number of superclasses */ + const char **SuperClasses; + int *SuperClassIndex; /* for internal use only */ + ValueInfo *Typedef; /* for typedefs */ + int IsEnum; /* this entry is for an enum type */ + int IsTypedef; /* this entry is for a typedef */ +} HierarchyEntry; + +/** + * All the entries from a hierarchy file. + */ +typedef struct _HierarchyInfo +{ + int NumberOfEntries; + HierarchyEntry *Entries; +} HierarchyInfo; + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Read a hierarchy file into a HeirarchyInfo struct, or return NULL + */ +HierarchyInfo *vtkParseHierarchy_ReadFile(const char *filename); + +/** + * Free a HierarchyInfo struct + */ +void vtkParseHierarchy_Free(HierarchyInfo *info); + +/** + * Return the entry for a class or type, or null if not found + */ +HierarchyEntry *vtkParseHierarchy_FindEntry( + const HierarchyInfo *info, const char *classname); + +/** + * Get properties for the class. Returns NULL if the property + * is not set, and returns either an empty string or a value string + * if the property is set. The properties supported are as follows: + * "WRAP_EXCLUDE", "WRAP_SPECIAL", and "ABSTRACT" + */ +const char *vtkParseHierarchy_GetProperty( + const HierarchyEntry *entry, const char *property); + +/** + * Check whether class is derived from baseclass. + */ +int vtkParseHierarchy_IsTypeOf(const HierarchyInfo *info, + const HierarchyEntry *entry, const char *baseclass); + +/** + * Check whether class is derived from baseclass. You must supply + * the entry for the class (returned by FindEntry) as well as the + * classname. The classname can include template args in angle brackets. + * The baseclass_with_args parameter, if not set to NULL, will be used + * to return the name of base class with the template args in angle + * brackets that classname was derived from. If not set to NULL, + * this should be freed with free() to avoid a memory leak. + */ +int vtkParseHierarchy_IsTypeOfTemplated(const HierarchyInfo *info, + const HierarchyEntry *entry, const char *classname, + const char *baseclass, const char **baseclass_with_args); + +/** + * Free the template args returned by IsTypeOfTemplated + */ +void vtkParseHierarchy_FreeTemplateArgs(int n, const char *args[]); + +/** + * Given a classname with template parameters, get the superclass name + * with corresponding template parameters. Returns null if 'i' is out + * of range, i.e. greater than or equal to the number of superclasses. + * The returned classname must be freed with "free()". + */ +const char *vtkParseHierarchy_TemplatedSuperClass( + const HierarchyEntry *entry, const char *classname, int i); + +/** + * Expand all unrecognized types in a ValueInfo struct by + * using the typedefs in the HierarchyInfo struct. + */ +int vtkParseHierarchy_ExpandTypedefsInValue( + const HierarchyInfo *info, ValueInfo *data, const char *scope); + +/** + * Expand typedefs found in a name stored as a string. The value + * of "text" will be returned if no expansion occurred, else a new + * string is returned that must be freed with "free()". + */ +const char *vtkParseHierarchy_ExpandTypedefsInName( + const HierarchyInfo *info, const char *text, const char *scope); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/ParaView/vtkParseInternal.h b/src/ParaView/vtkParseInternal.h new file mode 100644 index 00000000..8d3c9c64 --- /dev/null +++ b/src/ParaView/vtkParseInternal.h @@ -0,0 +1,137 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkParseInternal.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +/* + This is an internal header for vtkParse.y, it contains methods for + manipulating the data structures that are not meant for general + use by the wrappers, and that are likely to change over time. +*/ + +#ifndef VTK_PARSE_PRIVATE_H +#define VTK_PARSE_PRIVATE_H + +#include "vtkParse.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Initializer methods + */ +/*@{*/ +void vtkParse_InitFile(FileInfo *file_info); +void vtkParse_InitNamespace(NamespaceInfo *namespace_info); +void vtkParse_InitClass(ClassInfo *cls); +void vtkParse_InitFunction(FunctionInfo *func); +void vtkParse_InitValue(ValueInfo *val); +void vtkParse_InitEnum(EnumInfo *item); +void vtkParse_InitUsing(UsingInfo *item); +void vtkParse_InitTemplateArgs(TemplateArgs *arg); +void vtkParse_InitTemplateArg(TemplateArg *arg); +/*@}*/ + +/** + * Copy methods + */ +/*@{*/ +void vtkParse_CopyNamespace(NamespaceInfo *data, const NamespaceInfo *orig); +void vtkParse_CopyClass(ClassInfo *data, const ClassInfo *orig); +void vtkParse_CopyFunction(FunctionInfo *data, const FunctionInfo *orig); +void vtkParse_CopyValue(ValueInfo *data, const ValueInfo *orig); +void vtkParse_CopyEnum(EnumInfo *data, const EnumInfo *orig); +void vtkParse_CopyUsing(UsingInfo *data, const UsingInfo *orig); +void vtkParse_CopyTemplateArgs(TemplateArgs *data, const TemplateArgs *orig); +void vtkParse_CopyTemplateArg(TemplateArg *data, const TemplateArg *orig); +/*@}*/ + +/** + * Free methods + */ +/*@{*/ +void vtkParse_FreeFile(FileInfo *file_info); +void vtkParse_FreeNamespace(NamespaceInfo *namespace_info); +void vtkParse_FreeClass(ClassInfo *cls); +void vtkParse_FreeFunction(FunctionInfo *func); +void vtkParse_FreeValue(ValueInfo *val); +void vtkParse_FreeEnum(EnumInfo *item); +void vtkParse_FreeUsing(UsingInfo *item); +void vtkParse_FreeTemplateArgs(TemplateArgs *arg); +void vtkParse_FreeTemplateArg(TemplateArg *arg); +/*@}*/ + +/** + * Make a persistent copy of a string for use with AddStringToArray: + * At most 'n' chars will be copied, and the string will be terminated. + * If a null pointer is provided, then a null pointer will be returned. + */ +const char *vtkParse_DuplicateString(const char *cp, size_t n); + +/** + * Add a string to an array of strings, grow array as necessary. + */ +void vtkParse_AddStringToArray( + const char ***valueArray, int *count, const char *value); + +/** + * Expand the Item array for classes and namespaces. + */ +void vtkParse_AddItemToArray( + ItemInfo **valueArray, int *count, parse_item_t type, int idx); + + +/** + * Add various items to the structs. + */ +/*@{*/ +void vtkParse_AddClassToClass(ClassInfo *info, ClassInfo *item); +void vtkParse_AddFunctionToClass(ClassInfo *info, FunctionInfo *item); +void vtkParse_AddEnumToClass(ClassInfo *info, EnumInfo *item); +void vtkParse_AddConstantToClass(ClassInfo *info, ValueInfo *item); +void vtkParse_AddVariableToClass(ClassInfo *info, ValueInfo *item); +void vtkParse_AddTypedefToClass(ClassInfo *info, ValueInfo *item); +void vtkParse_AddUsingToClass(ClassInfo *info, UsingInfo *item); +void vtkParse_AddNamespaceToNamespace(NamespaceInfo *info,NamespaceInfo *item); +void vtkParse_AddClassToNamespace(NamespaceInfo *info, ClassInfo *item); +void vtkParse_AddFunctionToNamespace(NamespaceInfo *info, FunctionInfo *item); +void vtkParse_AddEnumToNamespace(NamespaceInfo *info, EnumInfo *item); +void vtkParse_AddConstantToNamespace(NamespaceInfo *info, ValueInfo *item); +void vtkParse_AddVariableToNamespace(NamespaceInfo *info, ValueInfo *item); +void vtkParse_AddTypedefToNamespace(NamespaceInfo *info, ValueInfo *item); +void vtkParse_AddUsingToNamespace(NamespaceInfo *info, UsingInfo *item); +void vtkParse_AddArgumentToFunction(FunctionInfo *info, ValueInfo *item); +void vtkParse_AddArgumentToTemplate(TemplateArgs *info, TemplateArg *item); +/*@}*/ + +/** + * Add default constructors if they do not already exist + */ +void vtkParse_AddDefaultConstructors(ClassInfo *data); + +/** + * Simple utility for mapping VTK types to VTK_PARSE types. + */ +unsigned int vtkParse_MapType(int vtktype); + +/** + * Ignore BTX/ETX markers + */ +void vtkParse_SetIgnoreBTX(int option); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/ParaView/vtkParseMain.c b/src/ParaView/vtkParseMain.c new file mode 100644 index 00000000..f7ddbbfb --- /dev/null +++ b/src/ParaView/vtkParseMain.c @@ -0,0 +1,309 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkParseMain.c + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +/* + +This file provides a unified front-end for the wrapper generators. +It contains the main() function and argument parsing, and calls +the code that parses the header file. + +*/ + +#include "vtkParse.h" +#include "vtkParseMain.h" +#include "vtkParseInternal.h" +#include "vtkConfigure.h" // VTK_VERSION +#include +#include +#include +#include + +/* This is the struct that contains the options */ +OptionInfo options; + +/* Flags for --help and --version */ +int vtk_parse_help = 0; +int vtk_parse_version = 0; + +/* This method provides the back-end for the generators */ +extern void vtkParseOutput(FILE *, FileInfo *); + +/* Check the options */ +static int check_options(int argc, char *argv[]) +{ + int i; + size_t j; + + options.InputFileName = NULL; + options.OutputFileName = NULL; + options.IsAbstract = 0; + options.IsConcrete = 0; + options.IsVTKObject = 0; + options.IsSpecialObject = 0; + options.HierarchyFileName = 0; + options.HintFileName = 0; + + for (i = 1; i < argc && argv[i][0] == '-'; i++) + { + if (strcmp(argv[i], "--concrete") == 0) + { + options.IsConcrete = 1; + } + else if (strcmp(argv[i], "--abstract") == 0) + { + options.IsAbstract = 1; + } + else if (strcmp(argv[i], "--vtkobject") == 0) + { + options.IsVTKObject = 1; + } + else if (strcmp(argv[i], "--special") == 0) + { + options.IsSpecialObject = 1; + } + else if (strcmp(argv[i], "--hints") == 0) + { + i++; + if (i >= argc || argv[i][0] == '-') + { + return -1; + } + options.HintFileName = argv[i]; + } + else if (strcmp(argv[i], "--types") == 0) + { + i++; + if (i >= argc || argv[i][0] == '-') + { + return -1; + } + options.HierarchyFileName = argv[i]; + } + else if (strcmp(argv[i], "-I") == 0) + { + i++; + if (i >= argc || argv[i][0] == '-') + { + return -1; + } + vtkParse_IncludeDirectory(argv[i]); + } + else if (strcmp(argv[i], "-D") == 0) + { + i++; + j = 0; + if (i >= argc || argv[i][0] == '-') + { + return -1; + } + while (argv[i][j] != '\0' && argv[i][j] != '=') { j++; } + if (argv[i][j] == '=') { j++; } + vtkParse_DefineMacro(argv[i], &argv[i][j]); + } + else if (strcmp(argv[i], "-U") == 0) + { + i++; + if (i >= argc || argv[i][0] == '-') + { + return -1; + } + vtkParse_UndefineMacro(argv[i]); + } + else if (strcmp(argv[i], "--help") == 0) + { + vtk_parse_help = 1; + } + else if (strcmp(argv[i], "--version") == 0) + { + vtk_parse_version = 1; + } + } + + return i; +} + +/* Return a pointer to the static OptionInfo struct */ +OptionInfo *vtkParse_GetCommandLineOptions() +{ + return &options; +} + +static void vtk_parse_print_help(FILE *stream, const char *cmd) +{ + fprintf(stream, + "Usage: %s [options] input_file output_file\n" + " --help print this help message\n" + " --version print the VTK version\n" + " --concrete force concrete class\n" + " --abstract force abstract class\n" + " --vtkobject vtkObjectBase-derived class\n" + " --special non-vtkObjectBase class\n" + " --hints the hints file to use\n" + " --types the type hierarchy file to use\n" + " -I add an include directory\n" + " -D define a preprocessor macro\n" + " -U undefine a preprocessor macro\n", + cmd); +} + +int main(int argc, char *argv[]) +{ + int argi; + int has_options = 0; + FILE *ifile; + FILE *ofile; + FILE *hfile = 0; + const char *cp; + char *classname; + size_t i; + FileInfo *data; + + argi = check_options(argc, argv); + if (argi > 1 && argc - argi == 2) + { + has_options = 1; + } + else if (argi < 0 || argc > 5 || + (argc < 3 && !vtk_parse_help && !vtk_parse_version)) + { + vtk_parse_print_help(stderr, argv[0]); + exit(1); + } + + if (vtk_parse_version) + { + const char *ver = VTK_VERSION; + const char *exename = argv[0]; + /* remove directory part of exe name */ + for (exename += strlen(exename); exename > argv[0]; --exename) + { + char pc = *(exename - 1); + if (pc == ':' || pc == '/' || pc == '\\') + { + break; + } + } + fprintf(stdout, "%s %s\n", exename, ver); + exit(0); + } + if (vtk_parse_help) + { + vtk_parse_print_help(stdout, argv[0]); + exit(0); + } + + options.InputFileName = argv[argi++]; + + ifile = fopen(options.InputFileName, "r"); + if (!ifile) + { + fprintf(stderr,"Error opening input file %s\n", options.InputFileName); + exit(1); + } + + if (!has_options) + { + if (argc == 5) + { + options.HintFileName = argv[argi++]; + } + if (argc >= 4) + { + options.IsConcrete = atoi(argv[argi++]); + options.IsAbstract = !options.IsConcrete; + } + } + + if (options.HintFileName && options.HintFileName[0] != '\0') + { + hfile = fopen(options.HintFileName, "r"); + if (!hfile) + { + fprintf(stderr, "Error opening hint file %s\n", options.HintFileName); + fclose(ifile); + exit(1); + } + } + + options.OutputFileName = argv[argi++]; + ofile = fopen(options.OutputFileName, "w"); + + if (!ofile) + { + fprintf(stderr, "Error opening output file %s\n", options.OutputFileName); + fclose(ifile); + if (hfile) + { + fclose(hfile); + } + exit(1); + } + + if (options.IsConcrete) + { + cp = options.InputFileName; + i = strlen(cp); + classname = (char *)malloc(i+1); + while (i > 0 && + cp[i-1] != '/' && cp[i-1] != '\\' && cp[i-1] != ':') { i--; } + strcpy(classname, &cp[i]); + i = 0; + while (classname[i] != '\0' && classname[i] != '.') { i++; } + classname[i] = '\0'; + + vtkParse_SetClassProperty(classname, "concrete"); + } + + vtkParse_SetIgnoreBTX(0); + if (options.HierarchyFileName) + { + vtkParse_SetIgnoreBTX(1); + } + + data = vtkParse_ParseFile(options.InputFileName, ifile, stderr); + + if (!data) + { + fclose(ifile); + fclose(ofile); + if (hfile) + { + fclose(hfile); + } + exit(1); + } + + if (hfile) + { + vtkParse_ReadHints(data, hfile, stderr); + } + + if (options.IsConcrete && data->MainClass) + { + data->MainClass->IsAbstract = 0; + } + else if (options.IsAbstract && data->MainClass) + { + data->MainClass->IsAbstract = 1; + } + + vtkParseOutput(ofile, data); + + fclose(ofile); + + vtkParse_Free(data); + + return 0; +} diff --git a/src/ParaView/vtkParsePreprocess.c b/src/ParaView/vtkParsePreprocess.c new file mode 100644 index 00000000..5bed2aea --- /dev/null +++ b/src/ParaView/vtkParsePreprocess.c @@ -0,0 +1,2635 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkParsePreprocess.c + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright (c) 2010 David Gobbi. + + Contributed to the VisualizationToolkit by the author in June 2010 + under the terms of the Visualization Toolkit 2008 copyright. +-------------------------------------------------------------------------*/ + +#include "vtkParsePreprocess.h" +#include +#include +#include +#include +#include + +/** + This file handles preprocessor directives via a simple + recursive-descent parser that only evaluates integers. +*/ + +#define PREPROC_DEBUG 0 + +/** Preprocessor tokens. */ +enum _preproc_token_t +{ + TOK_ID = 258, + TOK_CHAR, + TOK_STRING, + TOK_NUMBER, + TOK_AND, + TOK_OR, + TOK_NE, + TOK_EQ, + TOK_GE, + TOK_LE, + TOK_LSHIFT, + TOK_RSHIFT, + TOK_DBLHASH, + TOK_ELLIPSIS, + TOK_OTHER +}; + +/** A struct for going through the input one token at a time. */ +typedef struct _preproc_tokenizer +{ + int tok; + size_t len; + const char *text; +} preproc_tokenizer; + +/** Extend dynamic arrays in a progression of powers of two. + * Whenever "n" reaches a power of two, then the array size is + * doubled so that "n" can be safely incremented. */ +static void *preproc_array_check( + void *arraymem, size_t size, int n) +{ + /* if empty, alloc for the first time */ + if (n == 0) + { + return malloc(size); + } + /* if count is power of two, reallocate with double size */ + else if ((n & (n-1)) == 0) + { + return realloc(arraymem, (n << 1)*size); + } + + /* no reallocation, just return the original array */ + return arraymem; +} + +/** Convert string to int. */ +static preproc_int_t string_to_preproc_int(const char *cp, int base) +{ +#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) + return _strtoi64(cp, NULL, base); +#else + return strtoll(cp, NULL, base); +#endif +} + +/** Convert string to unsigned int. */ +static preproc_uint_t string_to_preproc_uint(const char *cp, int base) +{ +#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) + return _strtoui64(cp, NULL, base); +#else + return strtoull(cp, NULL, base); +#endif +} + + +/** Skip over a comment. */ +static void preproc_skip_comment(const char **cpp) +{ + const char *cp = *cpp; + + if (cp[0] == '/') + { + if (cp[1] == '/') + { + cp += 2; + while (*cp != '\n' && *cp != '\0') + { + if (cp[0] == '\\') + { + if (cp[1] == '\n') { cp++; } + else if (cp[1] == '\r' && cp[2] == '\n') { cp += 2; } + } + cp++; + } + } + else if (cp[1] == '*') + { + cp += 2; + while (*cp != '\0') + { + if (cp[0] == '*' && cp[1] == '/') { cp += 2; break; } + cp++; + } + } + } + + *cpp = cp; +} + +/** Skip over whitespace, but not newlines unless preceeded by backlash. */ +static void preproc_skip_whitespace(const char **cpp) +{ + const char *cp = *cpp; + + for (;;) + { + while (*cp == ' ' || *cp == '\t' || *cp == '\r') { cp++; } + + if (cp[0] == '\\' && cp[1] == '\n') + { + cp += 2; + } + else if (cp[0] == '\\' && cp[1] == '\r' && cp[2] == '\n') + { + cp += 3; + } + else if (cp[0] == '/' && (cp[1] == '/' || cp[1] == '*')) + { + preproc_skip_comment(&cp); + } + else + { + break; + } + } + + *cpp = cp; +} + +/** Skip over string and char literals. */ +static void preproc_skip_quotes(const char **cpp) +{ + const char *cp = *cpp; + const char qc = *cp; + + if (*cp == '\'' || *cp == '\"') + { + cp++; + while (*cp != qc && *cp != '\n' && *cp != '\0') + { + if (cp[0] == '\\' && cp[1] == qc) { cp++; } + cp++; + } + } + if (*cp == qc) + { + cp++; + } + + *cpp = cp; +} + +/** Skip over a name. */ +static void preproc_skip_name(const char **cpp) +{ + const char *cp = *cpp; + + if ((*cp >= 'a' && *cp <= 'z') || + (*cp >= 'A' && *cp <= 'Z') || + (*cp == '_')) + { + cp++; + while ((*cp >= '0' && *cp <= '9') || + (*cp >= 'a' && *cp <= 'z') || + (*cp >= 'A' && *cp <= 'Z') || + (*cp == '_')) + { + cp++; + } + } + + *cpp = cp; +} + +/** Skip over a number. */ +static void preproc_skip_number(const char **cpp) +{ + const char *cp = *cpp; + + if ((cp[0] >= '0' && cp[0] <= '9') || + (cp[0] == '.' && (cp[1] >= '0' && cp[1] <= '9'))) + { + cp++; + while ((*cp >= '0' && *cp <= '9') || + (*cp >= 'a' && *cp <= 'z') || + (*cp >= 'A' && *cp <= 'Z') || + *cp == '_' || *cp == '.') + { + char c = *cp++; + if (c == 'e' || c == 'E' || + c == 'p' || c == 'P') + { + if (*cp == '-' || *cp == '+') { cp++; } + } + } + } + + *cpp = cp; +} + +/** Return the next preprocessor token, or '0' if none left. */ +static int preproc_next(preproc_tokenizer *tokens) +{ + const char *cp = tokens->text + tokens->len; + preproc_skip_whitespace(&cp); + tokens->text = cp; + + if (cp[0] == '_' || + (cp[0] >= 'a' && cp[0] <= 'z') || + (cp[0] >= 'A' && cp[0] <= 'Z')) + { + const char *ep = cp; + preproc_skip_name(&ep); + tokens->len = ep - cp; + tokens->tok = TOK_ID; + } + else if ((cp[0] >= '0' && cp[0] <= '9') || + (cp[0] == '.' && (cp[1] >= '0' && cp[1] <= '9'))) + { + const char *ep = cp; + preproc_skip_number(&ep); + tokens->len = ep - cp; + tokens->tok = TOK_NUMBER; + } + else if (cp[0] == '\'') + { + const char *ep = cp; + preproc_skip_quotes(&ep); + tokens->len = ep - cp; + tokens->tok = TOK_CHAR; + } + else if (cp[0] == '\"') + { + const char *ep = cp; + preproc_skip_quotes(&ep); + tokens->len = ep - cp; + tokens->tok = TOK_STRING; + } + else + { + switch (cp[0]) + { + case ':': + if (cp[1] == ':') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '.': + if (cp[1] == '.' && cp[2] == '.') + { tokens->len = 3; tokens->tok = TOK_ELLIPSIS; } + else if (cp[1] == '*') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '=': + if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_EQ; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '!': + if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_NE; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '<': + if (cp[1] == '<' && cp[2] == '=') + { tokens->len = 3; tokens->tok = TOK_OTHER; } + else if (cp[1] == '<') { tokens->len = 2; tokens->tok = TOK_RSHIFT; } + else if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_LE; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '>': + if (cp[1] == '>' && cp[2] == '=') + { tokens->len = 3; tokens->tok = TOK_OTHER; } + else if (cp[1] == '>') { tokens->len = 2; tokens->tok = TOK_LSHIFT; } + else if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_GE; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '&': + if (cp[1] == '&' && cp[2] == '=') + { tokens->len = 3; tokens->tok = TOK_OTHER; } + else if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else if (cp[1] == '&') { tokens->len = 2; tokens->tok = TOK_AND; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '|': + if (cp[1] == '|' && cp[2] == '=') + { tokens->len = 3; tokens->tok = TOK_OTHER; } + else if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else if (cp[1] == '|') { tokens->len = 2; tokens->tok = TOK_OR; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '^': case '*': case '/': case '%': + if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '+': + if (cp[1] == '+') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '-': + if (cp[1] == '>' && cp[2] == '*') + { tokens->len = 3; tokens->tok = TOK_OTHER; } + else if (cp[1] == '>') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else if (cp[1] == '-') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else if (cp[1] == '=') { tokens->len = 2; tokens->tok = TOK_OTHER; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '#': + if (cp[1] == '#') { tokens->len = 2; tokens->tok = TOK_DBLHASH; } + else { tokens->len = 1; tokens->tok = cp[0]; } + break; + case '\n': + case '\0': + { tokens->len = 0; tokens->tok = 0; } + break; + default: + { tokens->len = 1; tokens->tok = cp[0]; } + break; + } + } + + return tokens->tok; +} + +/** Initialize the tokenizer. */ +static void preproc_init(preproc_tokenizer *tokens, const char *text) +{ + tokens->tok = 0; + tokens->len = 0; + tokens->text = text; + preproc_next(tokens); +} + +/** Duplicate the first n bytes of a string. */ +static const char *preproc_strndup(const char *in, size_t n) +{ + char *res = NULL; + + res = (char *)malloc(n+1); + strncpy(res, in, n); + res[n] = '\0'; + + return res; +} + +/** Free a preprocessor macro struct. */ +static void preproc_free_macro(MacroInfo *info) +{ + free(info); +} + +/** Add a preprocessor macro to the PreprocessInfo. */ +static void preproc_add_macro( + PreprocessInfo *info, MacroInfo *macro) +{ + info->Macros = (MacroInfo **)preproc_array_check( + info->Macros, sizeof(MacroInfo *), info->NumberOfMacros); + info->Macros[info->NumberOfMacros++] = macro; +} + +/** A simple way to add a preprocessor macro definition. */ +static MacroInfo *preproc_add_macro_definition( + PreprocessInfo *info, const char *name, const char *definition) +{ + MacroInfo *macro = (MacroInfo *)malloc(sizeof(MacroInfo)); + vtkParsePreprocess_InitMacro(macro); + + if (name) + { + size_t n; + const char *cp = name; + preproc_skip_name(&cp); + n = cp - name; + macro->Name = preproc_strndup(name, n); + } + + if (definition) + { + size_t n; + const char *cp = definition; + preproc_tokenizer tokens; + preproc_init(&tokens, cp); + + do + { + cp = tokens.text + tokens.len; + } + while (preproc_next(&tokens)); + + n = cp - definition; + macro->Definition = preproc_strndup(definition, n); + } + + macro->IsExternal = info->IsExternal; + preproc_add_macro(info, macro); + + return macro; +} + +/** Find a preprocessor macro, return 0 if not found. */ +static int preproc_find_macro( + PreprocessInfo *info, const char *name, int *idx) +{ + int i, n; + size_t m; + const char *cp = name; + + preproc_skip_name(&cp); + m = cp - name; + + n = info->NumberOfMacros; + for (i = 0; i < n; i++) + { + if (strncmp(name, info->Macros[i]->Name, m) == 0 && + info->Macros[i]->Name[m] == '\0') + { + *idx = i; + return 1; + } + } + + *idx = 0; + return 0; +} + +/** Remove a preprocessor macro. Returns 1 if macro not found. */ +static int preproc_remove_macro( + PreprocessInfo *info, const char *name) +{ + int i, n; + + if (preproc_find_macro(info, name, &i)) + { + preproc_free_macro(info->Macros[i]); + n = info->NumberOfMacros-1; + for (; i < n; i++) + { + info->Macros[i] = info->Macros[i+1]; + } + info->NumberOfMacros = n; + return 1; + } + + return 0; +} + +/** Skip over parentheses, return nonzero if not closed. */ +static int preproc_skip_parentheses(preproc_tokenizer *tokens) +{ + int depth = 0; + + if (tokens->tok == '(') + { + depth = 1; + + while (depth > 0 && preproc_next(tokens)) + { + if (tokens->tok == '(') + { + depth++; + } + else if (tokens->tok == ')') + { + depth--; + } + } + } + + if (tokens->tok == ')') + { + preproc_next(tokens); + return VTK_PARSE_OK; + } + + return VTK_PARSE_SYNTAX_ERROR; +} + + +/** Evaluate a char literal to an integer value. */ +static int preproc_evaluate_char( + const char *cp, preproc_int_t *val, int *is_unsigned) +{ + if (cp[0] == '\'') + { + cp++; + if (*cp != '\\') + { + *val = *cp; + } + else if (*cp != '\'' && *cp != '\n' && *cp != '\0') + { + cp++; + if (*cp == 'a') { *val = '\a'; } + else if (*cp == 'b') { *val = '\b'; } + else if (*cp == 'f') { *val = '\f'; } + else if (*cp == 'n') { *val = '\n'; } + else if (*cp == 'r') { *val = '\r'; } + else if (*cp == 'b') { *val = '\b'; } + else if (*cp == 't') { *val = '\t'; } + else if (*cp == 'v') { *val = '\v'; } + else if (*cp == '\'') { *val = '\''; } + else if (*cp == '\"') { *val = '\"'; } + else if (*cp == '\\') { *val = '\\'; } + else if (*cp == '\?') { *val = '\?'; } + else if (*cp == '0') + { + *val = string_to_preproc_int(cp, 8); + while (*cp >= '0' && *cp <= '7') { cp++; } + } + else if (*cp == 'x') + { + cp++; + *val = string_to_preproc_int(cp, 16); + while ((*cp >= '0' && *cp <= '9') || + (*cp >= 'a' && *cp <= 'z') || + (*cp >= 'A' && *cp <= 'Z')) { cp++; } + } + } + if (*cp != '\'') + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + cp++; + *is_unsigned = 0; + return VTK_PARSE_OK; + } + +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; +} + +/* Evaluate an integer, ignoring any suffixes except 'u'. */ +static int preproc_evaluate_integer( + const char *cp, preproc_int_t *val, int *is_unsigned) +{ + const char *ep; + int base = 0; + ep = cp; + + if (cp[0] == '0' && (cp[1] == 'x' || cp[1] == 'X')) + { + cp += 2; + base = 16; + *is_unsigned = 1; + ep = cp; + while ((*ep >= '0' && *ep <= '9') || + (*ep >= 'a' && *ep <= 'f') || + (*ep >= 'A' && *ep <= 'F')) + { + ep++; + } + } + else if (cp[0] == '0' && (cp[1] >= '0' && cp[1] <= '9')) + { + cp += 1; + base = 8; + *is_unsigned = 1; + ep = cp; + while (*ep >= '0' && *ep <= '7') + { + ep++; + } + } + else + { + base = 10; + *is_unsigned = 0; + while (*ep >= '0' && *ep <= '9') + { + ep++; + } + } + + for (;;) + { + if (ep[0] == 'i' && ep[1] == '6' && ep[2] == '4') { ep += 3; } + else if (*ep == 'u') { *is_unsigned = 1; ep++; } + else if (*ep == 'l' || *ep == 'L') { ep++; } + else { break; } + } + + if (*is_unsigned) + { + *val = (preproc_int_t)string_to_preproc_uint(cp, base); + } + else + { + *val = string_to_preproc_int(cp, base); + } + + if (*ep == '.' || *ep == 'e' || *ep == 'E') + { + return VTK_PARSE_PREPROC_DOUBLE; + } + + return VTK_PARSE_OK; +} + +/* forward declaration */ +static int preproc_evaluate_expression( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned); + +/** Evaluate a single item in an expression. */ +static int preproc_evaluate_single( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + int result = VTK_PARSE_OK; + + if (tokens->tok == '(') + { + preproc_next(tokens); + result = preproc_evaluate_expression(info, tokens, val, is_unsigned); + if ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (tokens->tok == ')') + { + preproc_next(tokens); + return result; + } +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + return result; + } + else if (tokens->tok == TOK_ID) + { + if (strncmp("defined", tokens->text, tokens->len) == 0) + { + const char *name; + int paren = 0; + preproc_next(tokens); + + if (tokens->tok == '(') + { + paren = 1; + preproc_next(tokens); + } + if (tokens->tok != TOK_ID) + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + name = tokens->text; + preproc_next(tokens); + if (paren) + { + if (tokens->tok != ')') + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + preproc_next(tokens); + } + + /* do the name lookup */ + *is_unsigned = 0; + *val = (vtkParsePreprocess_GetMacro(info, name) != NULL); + + return result; + } + else + { + /* look up and evaluate the macro */ + const char *name = tokens->text; + MacroInfo *macro = vtkParsePreprocess_GetMacro(info, name); + preproc_next(tokens); + + if (macro == NULL) + { + *val = 0; + *is_unsigned = 0; + return VTK_PARSE_MACRO_UNDEFINED; + } + else if (macro->IsFunction) + { + /* expand function macros using the arguments */ + if (tokens->tok == '(') + { + const char *args = tokens->text; + *val = 0; + *is_unsigned = 0; + if (preproc_skip_parentheses(tokens) == VTK_PARSE_OK) + { + const char *expansion; + expansion = vtkParsePreprocess_ExpandMacro(macro, args); + if (expansion) + { + result = vtkParsePreprocess_EvaluateExpression( + info, expansion, val, is_unsigned); + vtkParsePreprocess_FreeExpandedMacro(expansion); + return result; + } +#if PREPROC_DEBUG + fprintf(stderr, "wrong number of macro args %d\n", __LINE__); +#endif + } +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + else + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + } + + return vtkParsePreprocess_EvaluateExpression( + info, macro->Definition, val, is_unsigned); + } + } + else if (tokens->tok == TOK_NUMBER) + { + result = preproc_evaluate_integer(tokens->text, val, is_unsigned); + if (tokens->text[tokens->len-1] == 'f' || + tokens->text[tokens->len-1] == 'F') + { + result = VTK_PARSE_PREPROC_FLOAT; + } + preproc_next(tokens); + return result; + } + else if (tokens->tok == TOK_CHAR) + { + result = preproc_evaluate_char(tokens->text, val, is_unsigned); + preproc_next(tokens); + return result; + } + else if (tokens->tok == TOK_STRING) + { + *val = 0; + *is_unsigned = 0; + preproc_next(tokens); + return VTK_PARSE_PREPROC_STRING; + } + +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d \"%*.*s\"\n", __LINE__, + (int)tokens->len, (int)tokens->len, tokens->text); +#endif + return VTK_PARSE_SYNTAX_ERROR; +} + +static int preproc_evaluate_unary( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + int op = tokens->tok; + int result = VTK_PARSE_OK; + + if (op != '+' && op != '-' && op != '~' && op != '!') + { + return preproc_evaluate_single(info, tokens, val, is_unsigned); + } + + preproc_next(tokens); + + result = preproc_evaluate_unary(info, tokens, val, is_unsigned); + if ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (op == '~') { *val = ~(*val); } + else if (op == '!') { *val = !(*val); *is_unsigned = 0; } + else if (op == '-') { *val = -(*val); } + return result; + } + + return result; +} + +static int preproc_evaluate_multiply( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + int op; + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_unary(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + op = tokens->tok; + if (op != '*' && op != '/' && op != '%') + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_unary(info, tokens, &rval, &rtype); + + *is_unsigned = (*is_unsigned || rtype); + + if (*is_unsigned) + { + if (op == '*') + { + *val = (preproc_int_t)((preproc_uint_t)*val * + (preproc_uint_t)rval); + } + else if (op == '/') + { + if (rval != 0) + { + *val = (preproc_int_t)((preproc_uint_t)*val / + (preproc_uint_t)rval); + } + else + { + *val = 2147483647; + } + } + else if (op == '%') + { + if (rval != 0) + { + *val = (preproc_int_t)((preproc_uint_t)*val % + (preproc_uint_t)rval); + } + else + { + *val = 2147483647; + } + } + } + else + { + if (op == '*') + { + *val = *val * rval; + } + else if (op == '/') + { + if (rval != 0) + { + *val = *val / rval; + } + else if (*val < 0) + { + *val = -2147483647; + } + else + { + *val = 2147483647; + } + } + else if (op == '%') + { + if (rval != 0) + { + *val = *val % rval; + } + else if (*val < 0) + { + *val = -2147483647; + } + else + { + *val = 2147483647; + } + } + } + } + + return result; +} + +static int preproc_evaluate_add( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + int op; + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_multiply(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + op = tokens->tok; + if (op != '+' && op != '-') + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_multiply(info, tokens, &rval, &rtype); + + *is_unsigned = (*is_unsigned || rtype); + + if (op == '+') + { + *val = *val + rval; + } + else if (op == '-') + { + *val = *val - rval; + } + } + + return result; +} + +static int preproc_evaluate_bitshift( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + int op; + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_add(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + op = tokens->tok; + + if (op != TOK_RSHIFT && op != TOK_LSHIFT) + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_add(info, tokens, &rval, &rtype); + + if (*is_unsigned) + { + if (op == TOK_RSHIFT) + { + *val = (preproc_int_t)((preproc_uint_t)*val << rval); + } + else if (op == TOK_LSHIFT) + { + *val = (preproc_int_t)((preproc_uint_t)*val >> rval); + } + } + else + { + if (op == TOK_RSHIFT) + { + *val = *val << rval; + } + else if (op == TOK_LSHIFT) + { + *val = *val >> rval; + } + } + } + + return result; +} + +static int preproc_evaluate_compare( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + int op; + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_bitshift(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + op = tokens->tok; + if (op != '<' && op != '>' && op != TOK_LE && op != TOK_GE) + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_bitshift(info, tokens, &rval, &rtype); + + *is_unsigned = (*is_unsigned || rtype); + + if (*is_unsigned) + { + if (op == TOK_LE) + { + *val = ((preproc_uint_t)*val <= (preproc_uint_t)rval); + } + else if (op == '<') + { + *val = ((preproc_uint_t)*val < (preproc_uint_t)rval); + } + else if (op == TOK_GE) + { + *val = ((preproc_uint_t)*val >= (preproc_uint_t)rval); + } + else if (op == '>') + { + *val = ((preproc_uint_t)*val > (preproc_uint_t)rval); + } + } + else + { + if (op == TOK_LE) + { + *val = (*val <= rval); + } + else if (op == '<') + { + *val = (*val < rval); + } + else if (op == TOK_GE) + { + *val = (*val >= rval); + } + else if (op == '>') + { + *val = (*val > rval); + } + } + *is_unsigned = 0; + } + + return result; +} + +static int preproc_evaluate_equal( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + int op; + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_compare(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + op = tokens->tok; + if (op != TOK_EQ && op != TOK_NE) + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_compare(info, tokens, &rval, &rtype); + + if (op == TOK_EQ) + { + *val = (*val == rval); + } + else if (op == TOK_NE) + { + *val = (*val != rval); + } + *is_unsigned = 0; + } + + return result; +} + +static int preproc_evaluate_and( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_equal(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (tokens->tok != '&') + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_equal(info, tokens, &rval, &rtype); + + *is_unsigned = (*is_unsigned || rtype); + *val = (*val & rval); + } + + return result; +} + +static int preproc_evaluate_xor( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_and(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (tokens->tok != '^') + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_and(info, tokens, &rval, &rtype); + + *is_unsigned = (*is_unsigned || rtype); + *val = (*val ^ rval); + } + + return result; +} + +static int preproc_evaluate_or( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_xor(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (tokens->tok != '|') + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_xor(info, tokens, &rval, &rtype); + + *is_unsigned = (*is_unsigned || rtype); + *val = (*val | rval); + } + + return result; +} + +static int preproc_evaluate_logic_and( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_or(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (tokens->tok != TOK_AND) + { + return result; + } + + preproc_next(tokens); + + if (*val == 0) + { + /* short circuit */ + while (tokens->tok != 0 && tokens->tok != ')' && + tokens->tok != ':' && tokens->tok != '?' && + tokens->tok != TOK_OR && tokens->tok != TOK_OTHER) + { + if (tokens->tok == '(') + { + if (preproc_skip_parentheses(tokens) != VTK_PARSE_OK) + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + result = VTK_PARSE_SYNTAX_ERROR; + } + } + else + { + preproc_next(tokens); + } + } + + *is_unsigned = 0; + + return result; + } + + result = preproc_evaluate_or(info, tokens, &rval, &rtype); + + *is_unsigned = 0; + *val = (rval != 0); + } + + return result; +} + +static int preproc_evaluate_logic_or( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_logic_and(info, tokens, val, is_unsigned); + while ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (tokens->tok != TOK_OR) + { + return result; + } + + preproc_next(tokens); + + if (*val != 0) + { + /* short circuit */ + while (tokens->tok != 0 && tokens->tok != ')' && + tokens->tok != ':' && tokens->tok != '?' && + tokens->tok != TOK_OTHER) + { + if (tokens->tok == '(') + { + if (preproc_skip_parentheses(tokens) != VTK_PARSE_OK) + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + result = VTK_PARSE_SYNTAX_ERROR; + } + } + else + { + preproc_next(tokens); + } + } + + *is_unsigned = 0; + + return result; + } + + result = preproc_evaluate_logic_and(info, tokens, &rval, &rtype); + + *is_unsigned = 0; + *val = (rval != 0); + } + + return result; +} + +/** Evaluate an arimetic *expression. */ +int preproc_evaluate_expression( + PreprocessInfo *info, preproc_tokenizer *tokens, + preproc_int_t *val, int *is_unsigned) +{ + preproc_int_t rval, sval; + int rtype, stype; + int result; + + result = preproc_evaluate_logic_or(info, tokens, val, is_unsigned); + if ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (tokens->tok != '?') + { + return result; + } + + preproc_next(tokens); + + result = preproc_evaluate_expression(info, tokens, &rval, &rtype); + if ((result & VTK_PARSE_FATAL_ERROR) != 0) + { + return result; + } + + if (tokens->tok != ':') + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + + preproc_next(tokens); + + result = preproc_evaluate_expression(info, tokens, &sval, &stype); + if ((result & VTK_PARSE_FATAL_ERROR) != 0) + { + return result; + } + + if (*val != 0) + { + *val = rval; + *is_unsigned = rtype; + } + else + { + *val = sval; + *is_unsigned = stype; + } + } + + return result; +} + +/** Evaluate a conditional *expression. + * Returns VTK_PARSE_OK if the expression is true, + * or VTK_PARSE_SKIP of the expression is false. */ +int preproc_evaluate_conditional( + PreprocessInfo *info, preproc_tokenizer *tokens) +{ + preproc_int_t rval; + int rtype; + int result; + + result = preproc_evaluate_expression(info, tokens, &rval, &rtype); + if ((result & VTK_PARSE_FATAL_ERROR) == 0) + { + if (tokens->tok != 0) + { + return VTK_PARSE_SYNTAX_ERROR; + } + return (rval == 0 ? VTK_PARSE_SKIP : VTK_PARSE_OK); + } + + return result; +} + +/** + * Handle any of the following directives: + * #if, #ifdef, #ifndef, #elif, #else, #endif + * A return value of VTK_PARSE_SKIP means that + * the following code block should be skipped. + */ +static int preproc_evaluate_if( + PreprocessInfo *info, preproc_tokenizer *tokens) +{ + int v1, v2; + int result = VTK_PARSE_OK; + + if (strncmp("if", tokens->text, tokens->len) == 0 || + strncmp("ifdef", tokens->text, tokens->len) == 0 || + strncmp("ifndef", tokens->text, tokens->len) == 0) + { + if (info->ConditionalDepth == 0) + { + if (strncmp("if", tokens->text, tokens->len) == 0) + { + preproc_next(tokens); + result = preproc_evaluate_conditional(info, tokens); + } + else + { + v1 = (strncmp("ifndef", tokens->text, tokens->len) != 0); + preproc_next(tokens); + if (tokens->tok != TOK_ID) + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + v2 = (vtkParsePreprocess_GetMacro(info, tokens->text) != 0); + preproc_next(tokens); + result = ( (v1 ^ v2) ? VTK_PARSE_SKIP : VTK_PARSE_OK); + } + + if (result != VTK_PARSE_SKIP) + { + /* mark as done, so that the "else" clause is skipped */ + info->ConditionalDone = 1; + } + else + { + /* mark as not done, so that "else" clause is not skipped */ + info->ConditionalDone = 0; + /* skip the "if" clause */ + info->ConditionalDepth = 1; + } + } + else + { + /* increase the skip depth */ + info->ConditionalDepth++; + } + } + else if (strncmp("elif", tokens->text, tokens->len) == 0 || + strncmp("else", tokens->text, tokens->len) == 0) + { + if (info->ConditionalDepth == 0) + { + /* preceeding clause was not skipped, so must skip this one */ + info->ConditionalDepth = 1; + } + else if (info->ConditionalDepth == 1 && + info->ConditionalDone == 0) + { + if (strncmp("elif", tokens->text, tokens->len) == 0) + { + preproc_next(tokens); + result = preproc_evaluate_conditional(info, tokens); + } + else + { + preproc_next(tokens); + } + if (result != VTK_PARSE_SKIP) + { + /* do not skip this clause */ + info->ConditionalDepth = 0; + /* make sure remaining else/elif clauses are skipped */ + info->ConditionalDone = 1; + } + } + } + else if (strncmp("endif", tokens->text, tokens->len) == 0) + { + preproc_next(tokens); + if (info->ConditionalDepth > 0) + { + /* decrease the skip depth */ + info->ConditionalDepth--; + } + if (info->ConditionalDepth == 0) + { + /* set "done" flag for the context that is being returned to */ + info->ConditionalDone = 1; + } + } + + return result; +} + +/** + * Handle the #define and #undef directives. + */ +static int preproc_evaluate_define( + PreprocessInfo *info, preproc_tokenizer *tokens) +{ + MacroInfo *macro; + int is_function; + const char *name; + size_t namelen; + const char *definition = ""; + int i; + int n = 0; + const char **args = NULL; + + if (strncmp("define", tokens->text, tokens->len) == 0) + { + preproc_next(tokens); + if (tokens->tok != TOK_ID) + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + + name = tokens->text; + namelen = tokens->len; + preproc_next(tokens); + + is_function = 0; + if (name[namelen] == '(') + { + is_function = 1; + preproc_next(tokens); + while (tokens->tok != 0 && tokens->tok != ')') + { + if (tokens->tok != TOK_ID && tokens->tok != TOK_ELLIPSIS) + { + if (args) { free((char **)args); } +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + + /* add to the arg list */ + args = (const char **)preproc_array_check( + (char **)args, sizeof(char *), n); + args[n++] = preproc_strndup(tokens->text, tokens->len); + + preproc_next(tokens); + if (tokens->tok == ',') + { + preproc_next(tokens); + } + else if (tokens->tok != ')') + { + if (args) { free((char **)args); } +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + } + preproc_next(tokens); + } + + if (tokens->tok) + { + definition = tokens->text; + } + if (preproc_find_macro(info, name, &i)) + { + if (args) { free((char **)args); } +#if PREPROC_DEBUG + fprintf(stderr, "macro redefined %d\n", __LINE__); +#endif + return VTK_PARSE_MACRO_REDEFINED; + } + + macro = preproc_add_macro_definition(info, name, definition); + macro->IsFunction = is_function; + macro->NumberOfArguments = n; + macro->Arguments = args; + return VTK_PARSE_OK; + } + else if (strncmp("undef", tokens->text, tokens->len) == 0) + { + preproc_next(tokens); + if (tokens->tok != TOK_ID) + { +#if PREPROC_DEBUG + fprintf(stderr, "syntax error %d\n", __LINE__); +#endif + return VTK_PARSE_SYNTAX_ERROR; + } + name = tokens->text; + preproc_remove_macro(info, name); + return VTK_PARSE_OK; + } + + return VTK_PARSE_OK; +} + +/** + * Add an include file to the list. Return 0 if it is already there. + */ +static int preproc_add_include_file(PreprocessInfo *info, const char *name) +{ + int i, n; + + n = info->NumberOfIncludeFiles; + for (i = 0; i < n; i++) + { + if (strcmp(info->IncludeFiles[i], name) == 0) + { + return 0; + } + } + + info->IncludeFiles = (const char **)preproc_array_check( + (char **)info->IncludeFiles, sizeof(char *), info->NumberOfIncludeFiles); + info->IncludeFiles[info->NumberOfIncludeFiles++] = name; + + return 1; +} + +/** + * Find an include file. If "cache_only" is set, then do a check to + * see if the file was previously found without going to the filesystem. + */ +const char *preproc_find_include_file( + PreprocessInfo *info, const char *filename, int system_first, + int cache_only) +{ + int i, n, ii, nn; + size_t j, m; + struct stat fs; + const char *directory; + char *output; + size_t outputsize = 16; + int count; + + /* allow filename to be terminated by quote or bracket */ + m = 0; + while (filename[m] != '\"' && filename[m] != '>' && + filename[m] != '\n' && filename[m] != '\0') { m++; } + + /* search file system for the file */ + output = (char *)malloc(outputsize); + + if (system_first != 0) + { + system_first = 1; + } + + if (cache_only != 0) + { + cache_only = 1; + } + + /* check for absolute path of form DRIVE: or /path/to/file */ + j = 0; + while (filename[j] == '_' || + (filename[j] >= '0' && filename[j] <= '9') || + (filename[j] >= 'a' && filename[j] <= 'z') || + (filename[j] >= 'Z' && filename[j] <= 'Z')) { j++; } + + if (filename[j] == ':' || filename[0] == '/' || filename[0] == '\\') + { + if (m+1 > outputsize) + { + outputsize += m+1; + output = (char *)realloc(output, outputsize); + } + strncpy(output, filename, m); + output[m] = '\0'; + + nn = info->NumberOfIncludeFiles; + for (ii = 0; ii < nn; ii++) + { + if (strcmp(output, info->IncludeFiles[ii]) == 0) + { + free(output); + return info->IncludeFiles[ii]; + } + } + + if (cache_only) + { + free(output); + return NULL; + } + + info->IncludeFiles = (const char **)preproc_array_check( + (char **)info->IncludeFiles, sizeof(char *), + info->NumberOfIncludeFiles); + info->IncludeFiles[info->NumberOfIncludeFiles++] = output; + + return output; + } + + /* Make sure the current filename is already added */ + if (info->FileName) + { + preproc_add_include_file(info, info->FileName); + } + + /* Check twice. First check the cache, then stat the files. */ + for (count = 0; count < (2-cache_only); count++) + { + n = info->NumberOfIncludeDirectories; + for (i = 0; i < (n+1-system_first); i++) + { + /* search the directory of the file being processed */ + if (i == 0 && system_first == 0) + { + if (info->FileName) + { + j = strlen(info->FileName); + while (j > 0) + { + if (info->FileName[j-1] == '/') { break; } + j--; + } + if (m+j+1 > outputsize) + { + outputsize += m+j+1; + output = (char *)realloc(output, outputsize); + } + if (j > 0) + { + strncpy(output, info->FileName, j); + } + strncpy(&output[j], filename, m); + output[j+m] = '\0'; + } + else + { + if (m+1 > outputsize) + { + outputsize += m+1; + output = (char *)realloc(output, outputsize); + } + strncpy(output, filename, m); + output[m] = '\0'; + } + } + /* check all the search paths */ + else + { + directory = info->IncludeDirectories[i-1+system_first]; + j = strlen(directory); + if (j + m + 2 > outputsize) + { + outputsize += j+m+2; + output = (char *)realloc(output, outputsize); + } + + strncpy(output, directory, j); + if (directory[j-1] != '/') { output[j++] = '/'; } + strncpy(&output[j], filename, m); + output[j+m] = '\0'; + } + + if (count == 0) + { + nn = info->NumberOfIncludeFiles; + for (ii = 0; ii < nn; ii++) + { + if (strcmp(output, info->IncludeFiles[ii]) == 0) + { + free(output); + return info->IncludeFiles[ii]; + } + } + } + else if (stat(output, &fs) == 0) + { + info->IncludeFiles = (const char **)preproc_array_check( + (char **)info->IncludeFiles, sizeof(char *), + info->NumberOfIncludeFiles); + info->IncludeFiles[info->NumberOfIncludeFiles++] = output; + + return output; + } + } + } + + free(output); + return NULL; +} + +/** + * Include a file. All macros defined in the included file + * will have their IsExternal flag set. + */ +static int preproc_include_file( + PreprocessInfo *info, const char *filename, int system_first) +{ + char *tbuf; + size_t tbuflen = 8192; + char *line; + size_t linelen = 80; + size_t i, j, n; + int in_comment = 0; + int in_quote = 0; + int result = VTK_PARSE_OK; + FILE *fp = NULL; + const char *path = NULL; + const char *save_filename; + int save_external; + + /* check to see if the file has aleady been included */ + path = preproc_find_include_file(info, filename, system_first, 1); + if (path != 0) + { +#if PREPROC_DEBUG + int k = 0; + while (filename[k] != '>' && filename[k] != '\"' && + filename[k] != '\n' && filename[k] != '\0') { k++; } + if (filename[k] == '>') + fprintf(stderr, "already loaded file <%*.*s>\n", k, k, filename); + else + fprintf(stderr, "already loaded file \"%*.*s\"\n", k, k, filename); +#endif + + return VTK_PARSE_OK; + } + /* go to the filesystem */ + path = preproc_find_include_file(info, filename, system_first, 0); + if (path == NULL) + { +#if PREPROC_DEBUG + int k = 0; + while (filename[k] != '>' && filename[k] != '\"' && + filename[k] != '\n' && filename[k] != '\0') { k++; } + if (filename[k] == '>') + fprintf(stderr, "couldn't find file <%*.*s>\n", k, k, filename); + else + fprintf(stderr, "couldn't find file \"%*.*s\"\n", k, k, filename); +#endif + return VTK_PARSE_FILE_NOT_FOUND; + } + +#if PREPROC_DEBUG + fprintf(stderr, "including file %s\n", path); +#endif + fp = fopen(path, "r"); + + if (fp == NULL) + { +#if PREPROC_DEBUG + fprintf(stderr, "couldn't open file %s\n", path); +#endif + return VTK_PARSE_FILE_OPEN_ERROR; + } + + save_external = info->IsExternal; + save_filename = info->FileName; + info->IsExternal = 1; + info->FileName = path; + + tbuf = (char *)malloc(tbuflen); + line = (char *)malloc(linelen); + + /* the buffer must hold a whole line for it to be processed */ + j = 0; + i = 0; + n = 0; + + do + { + if (i == n) + { + /* read the next chunk of the file */ + i = 0; + if (feof(fp)) + { + n = 0; + } + else + { + errno = 0; + i = 0; + while ((n = fread(tbuf, 1, tbuflen, fp)) == 0 && ferror(fp)) + { + if (errno != EINTR) + { + fclose(fp); + free(tbuf); + free(line); + info->IsExternal = save_external; + return VTK_PARSE_FILE_READ_ERROR; + } + errno = 0; + clearerr(fp); + } + } + } + + /* copy the characters until end of line is found */ + while (i < n) + { + /* expand line buffer as necessary */ + if (j+4 > linelen) + { + linelen *= 2; + line = (char *)realloc(line, linelen); + } + + if (in_comment) + { + if (tbuf[i] == '*' && tbuf[i+1] == '/') + { + line[j++] = tbuf[i++]; + line[j++] = tbuf[i++]; + in_comment = 0; + } + else + { + line[j++] = tbuf[i++]; + } + } + else if (in_quote) + { + if (tbuf[i] == '\"') + { + line[j++] = tbuf[i++]; + in_quote = 0; + } + else if (tbuf[i] == '\\' && tbuf[i] == '\"') + { + line[j++] = tbuf[i++]; + line[j++] = tbuf[i++]; + } + else + { + line[j++] = tbuf[i++]; + } + } + else if (tbuf[i] == '/' && tbuf[i] == '*') + { + line[j++] = tbuf[i++]; + line[j++] = tbuf[i++]; + in_comment = 1; + } + else if (tbuf[i] == '\"') + { + line[j++] = tbuf[i++]; + in_quote = 1; + } + else if (tbuf[i] == '\\' && tbuf[i+1] == '\n') + { + line[j++] = tbuf[i++]; + line[j++] = tbuf[i++]; + } + else if (tbuf[i] == '\\' && tbuf[i+1] == '\r' && tbuf[i+2] == '\n') + { + line[j++] = tbuf[i++]; + line[j++] = tbuf[i++]; + line[j++] = tbuf[i++]; + } + else if (tbuf[i] != '\n' && tbuf[i] != '\0') + { + line[j++] = tbuf[i++]; + } + else + { + line[j++] = tbuf[i++]; + break; + } + } + + if (i < n || n == 0) + { + const char *cp = line; + line[j] = '\0'; + j = 0; + preproc_skip_whitespace(&cp); + if (*cp == '#') + { + vtkParsePreprocess_HandleDirective(info, line); + } + } + } + while (n > 0); + + free(tbuf); + free(line); + fclose(fp); + + info->IsExternal = save_external; + info->FileName = save_filename; + + return result; +} + +/** + * Handle the #include directive. The header file will + * only go through the preprocessor. + */ +static int preproc_evaluate_include( + PreprocessInfo *info, preproc_tokenizer *tokens) +{ + const char *cp; + const char *filename; + + if (strncmp("include", tokens->text, tokens->len) == 0) + { + preproc_next(tokens); + + cp = tokens->text; + + if (tokens->tok == TOK_ID) + { + MacroInfo *macro; + macro = vtkParsePreprocess_GetMacro(info, cp); + if (macro && macro->Definition) + { + cp = macro->Definition; + } + else + { +#if PREPROC_DEBUG + fprintf(stderr, "couldn't find macro %*.*s.\n", + (int)tokens->len, (int)tokens->len, tokens->text); +#endif + return VTK_PARSE_MACRO_UNDEFINED; + } + } + + if (*cp == '\"') + { + filename = cp + 1; + preproc_skip_quotes(&cp); + if (cp <= filename + 1 || *(cp-1) != '\"') + { + return VTK_PARSE_SYNTAX_ERROR; + } + + return preproc_include_file(info, filename, 0); + } + else if (*cp == '<') + { + cp++; + filename = cp; + while (*cp != '>' && *cp != '\n' && *cp != '\0') { cp++; } + if (*cp != '>') + { + return VTK_PARSE_SYNTAX_ERROR; + } + + return preproc_include_file(info, filename, 1); + } + } + + return VTK_PARSE_OK; +} + +/** + * Handle any recognized directive. + * Unrecognized directives are ignored. + */ +int vtkParsePreprocess_HandleDirective( + PreprocessInfo *info, const char *directive) +{ + int result = VTK_PARSE_OK; + preproc_tokenizer tokens; + + preproc_init(&tokens, directive); + + if (tokens.tok != '#') + { + return VTK_PARSE_SYNTAX_ERROR; + } + + preproc_next(&tokens); + + if (tokens.tok == TOK_ID) + { + if (strncmp("ifdef", tokens.text, tokens.len) == 0 || + strncmp("ifndef", tokens.text, tokens.len) == 0 || + strncmp("if", tokens.text, tokens.len) == 0 || + strncmp("elif", tokens.text, tokens.len) == 0 || + strncmp("else", tokens.text, tokens.len) == 0 || + strncmp("endif", tokens.text, tokens.len) == 0) + { + result = preproc_evaluate_if(info, &tokens); + while (tokens.tok) { preproc_next(&tokens); } +#if PREPROC_DEBUG + { + size_t n = tokens.text - directive; + + if (result == VTK_PARSE_SKIP) + { + fprintf(stderr, "SKIP: "); + } + else if (result == VTK_PARSE_OK) + { + fprintf(stderr, "READ: "); + } + else + { + fprintf(stderr, "ERR%-2.2d ", result); + } + fprintf(stderr, "%*.*s\n", (int)n, (int)n, directive); + } +#endif + } + else if (info->ConditionalDepth == 0) + { + if (strncmp("define", tokens.text, tokens.len) == 0 || + strncmp("undef", tokens.text, tokens.len) == 0) + { + result = preproc_evaluate_define(info, &tokens); + } + else if (strncmp("include", tokens.text, tokens.len) == 0) + { + result = preproc_evaluate_include(info, &tokens); + } + } + } + + if (info->ConditionalDepth > 0) + { + return VTK_PARSE_SKIP; + } + + return result; +} + +/** + * Evaluate a preprocessor expression. + * If no errors occurred, the result will be VTK_PARSE_OK. + */ +int vtkParsePreprocess_EvaluateExpression( + PreprocessInfo *info, const char *text, + preproc_int_t *val, int *is_unsigned) +{ + preproc_tokenizer tokens; + preproc_init(&tokens, text); + + return preproc_evaluate_expression(info, &tokens, val, is_unsigned); +} + +/** Add a macro for defining a macro */ +#define PREPROC_MACRO_TO_STRING2(x) #x +#define PREPROC_MACRO_TO_STRING(x) PREPROC_MACRO_TO_STRING2(x) +#define PREPROC_ADD_MACRO(info, x) \ +preproc_add_macro_definition(info, #x, PREPROC_MACRO_TO_STRING2(x)) + +/** + * Add all standard preprocessory macros. Specify the platform. + */ +void vtkParsePreprocess_AddStandardMacros( + PreprocessInfo *info, int platform) +{ + int save_external = info->IsExternal; + info->IsExternal = 1; + + /* a special macro to indicate that this is the wrapper */ + preproc_add_macro_definition(info, "__WRAP__", "1"); + + /* language macros - assume that we are wrapping C++ code */ + preproc_add_macro_definition(info, "__cplusplus", "1"); + + /* stdc version macros */ +#ifdef __STDC__ + PREPROC_ADD_MACRO(info, __STDC__); +#endif +#ifdef __STDC_VERSION__ + PREPROC_ADD_MACRO(info, __STDC_VERSION__); +#endif +#ifdef __STDC_HOSTED__ + PREPROC_ADD_MACRO(info, __STDC_HOSTED__); +#endif + + if (platform == VTK_PARSE_NATIVE) + { +#ifdef WIN32 + PREPROC_ADD_MACRO(info, WIN32); +#endif +#ifdef _WIN32 + PREPROC_ADD_MACRO(info, _WIN32); +#endif +#ifdef _MSC_VER + PREPROC_ADD_MACRO(info, _MSC_VER); +#endif + +#ifdef __BORLAND__ + PREPROC_ADD_MACRO(info, __BORLAND__); +#endif + +#ifdef __CYGWIN__ + PREPROC_ADD_MACRO(info, __CYGWIN__); +#endif +#ifdef MINGW + PREPROC_ADD_MACRO(info, MINGW); +#endif +#ifdef __MINGW32__ + PREPROC_ADD_MACRO(info, __MINGW32__); +#endif + +#ifdef __linux__ + PREPROC_ADD_MACRO(info, __linux__); +#endif +#ifdef __LINUX__ + PREPROC_ADD_MACRO(info, __LINUX__); +#endif + +#ifdef __APPLE__ + PREPROC_ADD_MACRO(info, __APPLE__); +#endif +#ifdef __MACH__ + PREPROC_ADD_MACRO(info, __MACH__); +#endif +#ifdef __DARWIN__ + PREPROC_ADD_MACRO(info, __DARWIN__); +#endif + +#ifdef __GNUC__ + PREPROC_ADD_MACRO(info, __GNUC__); +#endif +#ifdef __LP64__ + PREPROC_ADD_MACRO(info, __LP64__); +#endif +#ifdef __BIG_ENDIAN__ + PREPROC_ADD_MACRO(info, __BIG_ENDIAN__); +#endif +#ifdef __LITTLE_ENDIAN__ + PREPROC_ADD_MACRO(info, __LITTLE_ENDIAN__); +#endif + } + + info->IsExternal = save_external; +} + +/** + * Add a preprocessor macro, including a definition. + */ +int vtkParsePreprocess_AddMacro( + PreprocessInfo *info, const char *name, const char *definition) +{ + int i; + MacroInfo *macro; + + if (preproc_find_macro(info, name, &i)) + { + return VTK_PARSE_MACRO_REDEFINED; + } + + macro = preproc_add_macro_definition(info, name, definition); + macro->IsExternal = 1; + + return VTK_PARSE_OK; +} + +/** + * Return a preprocessor macro struct, or NULL if not found. + */ +MacroInfo *vtkParsePreprocess_GetMacro( + PreprocessInfo *info, const char *name) +{ + int i = 0; + + if (preproc_find_macro(info, name, &i)) + { + return info->Macros[i]; + } + + return NULL; +} + +/** + * Remove a preprocessor macro. + */ +int vtkParsePreprocess_RemoveMacro( + PreprocessInfo *info, const char *name) +{ + if (preproc_remove_macro(info, name)) + { + return VTK_PARSE_OK; + } + + return VTK_PARSE_MACRO_UNDEFINED; +} + +/** + * Expand a function macro + */ +const char *vtkParsePreprocess_ExpandMacro( + MacroInfo *macro, const char *argstring) +{ + const char *cp = argstring; + int n = 0; + int j = 0; + const char **values = NULL; + const char *pp = NULL; + const char *dp = NULL; + char *rp = NULL; + size_t rs = 0; + size_t i = 0; + size_t l = 0; + size_t k = 0; + int stringify = 0; + int depth = 1; + int c; + + if (argstring == NULL || *cp != '(') + { + return NULL; + } + + /* break the string into individual argument values */ + values = (const char **)malloc(4*sizeof(const char **)); + + cp++; + values[n++] = cp; + while (depth > 0 && *cp != '\0') + { + while (*cp != '\0') + { + if (*cp == '\"' || *cp == '\'') + { + preproc_skip_quotes(&cp); + } + else if (cp[0] == '/' && (cp[1] == '*' || cp[1] == '/')) + { + preproc_skip_comment(&cp); + } + else if (*cp == '(') + { + cp++; + depth++; + } + else if (*cp == ')') + { + cp++; + if (--depth == 0) + { + break; + } + } + else if (*cp == ',') + { + cp++; + if (depth == 1) + { + break; + } + } + else if (*cp != '\0') + { + cp++; + } + } + if (n >= 4 && (n & (n-1)) == 0) + { + values = (const char **)realloc( + (char **)values, 2*n*sizeof(const char **)); + } + + values[n++] = cp; + } + --n; + + /* diagnostic: print out the values */ +#if PREPROC_DEBUG + for (j = 0; j < n; j++) + { + size_t m = values[j+1] - values[j] - 1; + fprintf(stderr, "arg %i: %*.*s\n", (int)j, (int)m, (int)m, values[j]); + } +#endif + + /* allow whitespace as "no argument" */ + if (macro->NumberOfArguments == 0 && n == 1) + { + cp = values[0]; + c = *cp; + while (c == ' ' || c == '\n' || c == '\t' || c == '\r') + { + c = *(++cp); + } + if (cp + 1 == values[1]) + { + n = 0; + } + } + + if (n != macro->NumberOfArguments) + { + free((char **)values); +#if PREPROC_DEBUG + fprintf(stderr, "wrong number of macro args to %s, %d != %d\n", + macro->Name, n, macro->NumberOfArguments); +#endif + return NULL; + } + + cp = macro->Definition; + dp = cp; + if (cp == NULL) + { + free((char **)values); + return NULL; + } + + rp = (char *)malloc(128); + rp[0] = '\0'; + rs = 128; + + while (*cp != '\0') + { + pp = cp; + stringify = 0; + /* skip all chars that aren't part of a name */ + while ((*cp < 'a' || *cp > 'z') && + (*cp < 'A' || *cp > 'Z') && + *cp != '_' && *cp != '\0') + { + if (*cp == '\'' || *cp == '\"') + { + preproc_skip_quotes(&cp); + dp = cp; + } + else if (*cp >= '0' && *cp <= '9') + { + preproc_skip_number(&cp); + dp = cp; + } + else if (*cp == '/' && (cp[1] == '/' || cp[1] == '*')) + { + preproc_skip_comment(&cp); + dp = cp; + } + else if (cp[0] == '#' && cp[1] == '#') + { + dp = cp; + while (dp > pp && (dp[-1] == ' ' || dp[-1] == '\t' || + dp[-1] == '\r' || dp[-1] == '\n')) + { + --dp; + } + cp += 2; + while (*cp == ' ' || *cp == '\t' || *cp == '\r' || *cp == '\n') + { + cp++; + } + break; + } + else if (*cp == '#') + { + stringify = 1; + dp = cp; + cp++; + while (*cp == ' ' || *cp == '\t' || *cp == '\r' || *cp == '\n') + { + cp++; + } + break; + } + else + { + cp++; + dp = cp; + } + } + l = dp - pp; + if (l > 0) + { + if (i + l + 1 >= rs) + { + rs += rs + i + l + 1; + rp = (char *)realloc(rp, rs); + } + strncpy(&rp[i], pp, l); + i += l; + rp[i] = '\0'; + } + + /* get the name */ + pp = cp; + preproc_skip_name(&cp); + l = cp - pp; + if (l > 0) + { + for (j = 0; j < n; j++) + { + /* check whether the name matches an argument */ + if (strncmp(pp, macro->Arguments[j], l) == 0 && + macro->Arguments[j][l] == '\0') + { + /* substitute the argument value */ + l = values[j+1] - values[j] - 1; + pp = values[j]; + /* remove leading whitespace from argument */ + c = *pp; + while (c == ' ' || c == '\n' || c == '\t' || c == '\r') + { + c = *(++pp); + l--; + } + /* remove trailing whitespace from argument */ + if (l > 0) + { + c = pp[l - 1]; + while (c == ' ' || c == '\n' || c == '\t' || c == '\r') + { + if (--l == 0) + { + break; + } + c = pp[l-1]; + } + } + break; + } + } + if (stringify) + { + /* compute number of chars that will be added */ + stringify = 2; + for (k = 0; k < l; k++) + { + c = pp[k]; + if (c == '\\' || c == '\"') + { + stringify++; + } + } + } + if (i + l + stringify + 1 >= rs) + { + rs += rs + i + l + 1; + rp = (char *)realloc(rp, rs); + } + if (stringify) + { + rp[i++] = '\"'; + for (k = 0; k < l; k++) + { + c = pp[k]; + if (c == '\\' || c == '\"') + { + rp[i++] = '\\'; + } + rp[i++] = c; + } + rp[i++] = '\"'; + } + else + { + strncpy(&rp[i], pp, l); + i += l; + } + rp[i] = '\0'; + } + } + + free((char **)values); + + return rp; +} + +/** + * Free an expanded function macro + */ +void vtkParsePreprocess_FreeExpandedMacro(const char *emacro) +{ + free((char *)emacro); +} + +/** + * Add an include directory. + */ +void vtkParsePreprocess_IncludeDirectory( + PreprocessInfo *info, const char *name) +{ + int i, n; + + n = info->NumberOfIncludeDirectories; + for (i = 0; i < n; i++) + { + if (strcmp(name, info->IncludeDirectories[i]) == 0) + { + return; + } + } + + info->IncludeDirectories = (const char **)preproc_array_check( + (char **)info->IncludeDirectories, sizeof(char *), + info->NumberOfIncludeDirectories); + info->IncludeDirectories[info->NumberOfIncludeDirectories++] = + preproc_strndup(name, strlen(name)); +} + +/** + * Find an include file in the path. If system_first is set, + * then the current directory is not searched. + */ +const char *vtkParsePreprocess_FindIncludeFile( + PreprocessInfo *info, const char *filename, int system_first, + int *already_loaded) +{ + const char *cp; + cp = preproc_find_include_file(info, filename, system_first, 1); + if (cp) + { + *already_loaded = 1; + } + + *already_loaded = 0; + return preproc_find_include_file(info, filename, system_first, 0); +} + +/** + * Initialize a preprocessor macro struct + */ +void vtkParsePreprocess_InitMacro(MacroInfo *macro) +{ + macro->Name = NULL; + macro->Definition = NULL; + macro->Comment = NULL; + macro->NumberOfArguments = 0; + macro->Arguments = NULL; + macro->IsFunction = 0; + macro->IsExternal = 0; +} + +/** + * Initialize a preprocessor struct + */ +void vtkParsePreprocess_InitPreprocess(PreprocessInfo *info) +{ + info->FileName = NULL; + info->NumberOfMacros = 0; + info->Macros = NULL; + info->NumberOfIncludeDirectories = 0; + info->IncludeDirectories = NULL; + info->NumberOfIncludeFiles = 0; + info->IncludeFiles = NULL; + info->IsExternal = 0; + info->ConditionalDepth = 0; + info->ConditionalDone = 0; +} diff --git a/src/ParaView/vtkParsePreprocess.h b/src/ParaView/vtkParsePreprocess.h new file mode 100644 index 00000000..c28bd241 --- /dev/null +++ b/src/ParaView/vtkParsePreprocess.h @@ -0,0 +1,225 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkParsePreprocess.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright (c) 2010 David Gobbi. + + Contributed to the VisualizationToolkit by the author in June 2010 + under the terms of the Visualization Toolkit 2008 copyright. +-------------------------------------------------------------------------*/ + +/** + This file provides subroutines to assist in preprocessing + C/C++ header files. It evaluates preprocessor directives + and stores a list of all preprocessor macros. + + The preprocessing is done in-line while the file is being + parsed. Macros that are defined in the file are stored but + are not automatically expanded. The parser can query the + macro definitions, expand them into plain text, or ask the + preprocessor to evaluate them and return an integer result. + + The typical usage of this preprocessor is that the main + parser will pass any lines that begin with '#' to the + vtkParsePreprocess_HandleDirective() function, which will + evaluate the line and provide a return code. The return + code will tell the main parser if a syntax error or macro + lookup error occurred, and will also let the parser know + if an #if or #else directive requires that the next block + of code be skipped. + + No checks are done for recursively-defined macros. If they + occur, the preprocessor will crash. +*/ + +#ifndef VTK_PARSE_PREPROCESS_H +#define VTK_PARSE_PREPROCESS_H + +/** + * The preprocessor int type. Use the compiler's longest int type. + */ +#if defined(_WIN32) && !defined(__MINGW32__) && !defined(__CYGWIN__) +typedef __int64 preproc_int_t; +typedef unsigned __int64 preproc_uint_t; +#else +typedef long long preproc_int_t; +typedef unsigned long long preproc_uint_t; +#endif + +/** + * Struct to describe a preprocessor symbol. + */ +typedef struct _MacroInfo +{ + const char *Name; + const char *Definition; + const char *Comment; /* unused */ + int NumberOfArguments; /* only if IsFunction == 1 */ + const char **Arguments; /* symbols for arguments */ + int IsFunction; /* this macro takes arguments */ + int IsExternal; /* this macro is from an included file */ +} MacroInfo; + +/** + * Contains all symbols defined thus far (including those defined + * in any included header files). + */ +typedef struct _PreprocessInfo +{ + const char *FileName; /* the file that is being parsed */ + int NumberOfMacros; + MacroInfo **Macros; + int NumberOfIncludeDirectories; + const char **IncludeDirectories; + int NumberOfIncludeFiles; /* all included files */ + const char **IncludeFiles; + int IsExternal; /* label all macros as "external" */ + int ConditionalDepth; /* internal state variable */ + int ConditionalDone; /* internal state variable */ +} PreprocessInfo; + +/** + * Platforms. Always choose native unless crosscompiling. + */ +enum _preproc_platform_t { + VTK_PARSE_NATIVE = 0, +}; + +/** + * Directive return values. + */ +enum _preproc_return_t { + VTK_PARSE_OK = 0, + VTK_PARSE_SKIP = 1, /* skip next block */ + VTK_PARSE_PREPROC_DOUBLE = 2, /* encountered a double */ + VTK_PARSE_PREPROC_FLOAT = 3, /* encountered a float */ + VTK_PARSE_PREPROC_STRING = 4, /* encountered a string */ + VTK_PARSE_MACRO_UNDEFINED = 5, /* macro lookup failed */ + VTK_PARSE_MACRO_REDEFINED = 6, /* attempt to redefine a macro */ + VTK_PARSE_FILE_NOT_FOUND = 7, /* include file not found */ + VTK_PARSE_FILE_OPEN_ERROR = 8, /* include file not readable */ + VTK_PARSE_FILE_READ_ERROR = 9, /* error during read */ + VTK_PARSE_MACRO_NUMARGS = 10, /* wrong number of args to func macro */ + VTK_PARSE_SYNTAX_ERROR = 11 /* any and all syntax errors */ +}; + +/** + * Bitfield for fatal errors. + */ +#define VTK_PARSE_FATAL_ERROR 0xF8 + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Handle a preprocessor directive. Return value VTK_PARSE_OK + * means that no errors occurred, while VTK_PARSE_SKIP means that + * a conditional directive was encountered and the next code + * block should be skipped. The preprocessor has an internal state + * machine that keeps track of conditional if/else/endif directives. + * All other return values indicate errors, and it is up to the + * parser to decide which errors are fatal. The preprocessor + * only considers syntax errors and I/O errors to be fatal. + */ +int vtkParsePreprocess_HandleDirective( + PreprocessInfo *info, const char *directive); + +/** + * Evaluate a preprocessor expression, providing an integer result + * in "val", and whether it is unsigned in "is_unsigned". A return + * value of VTK_PARSE_OK means that no errors occurred, while + * VTK_PREPROC_DOUBLE, VTK_PREPROC_FLOAT, and VTK_PREPROC_STRING + * indicate that the preprocessor encountered a non-integer value. + * Error return values are VTK_PARSE_MACRO_UNDEFINED and + * VTK_PARSE_SYNTAX_ERRORS. Undefined macros evaluate to zero. + */ +int vtkParsePreprocess_EvaluateExpression( + PreprocessInfo *info, const char *text, + preproc_int_t *val, int *is_unsigned); + +/** + * Add all standard preprocessor symbols. Use VTK_PARSE_NATIVE + * as the platform. In the future, other platform specifiers + * might be added to allow crosscompiling. + */ +void vtkParsePreprocess_AddStandardMacros( + PreprocessInfo *info, int platform); + +/** + * Add a preprocessor symbol, including a definition. Return + * values are VTK_PARSE_OK and VTK_PARSE_MACRO_REDEFINED. + */ +int vtkParsePreprocess_AddMacro( + PreprocessInfo *info, const char *name, const char *definition); + +/** + * Remove a preprocessor symbol. Return values are VTK_PARSE_OK + * and VTK_PARSE_MACRO_UNDEFINED. + */ +int vtkParsePreprocess_RemoveMacro( + PreprocessInfo *info, const char *name); + +/** + * Return a preprocessor symbol struct, or NULL if not found. + */ +MacroInfo *vtkParsePreprocess_GetMacro( + PreprocessInfo *info, const char *name); + +/** + * Expand a function macro, given arguments in parentheses. + * Returns a new string that was allocated with malloc, or + * NULL if the wrong number of arguments were given. + */ +const char *vtkParsePreprocess_ExpandMacro( + MacroInfo *macro, const char *argstring); + +/** + * Free an expanded macro. + */ +void vtkParsePreprocess_FreeExpandedMacro(const char *emacro); + +/** + * Add an include directory. The directories that were added + * first will be searched first. + */ +void vtkParsePreprocess_IncludeDirectory( + PreprocessInfo *info, const char *name); + +/** + * Find an include file in the path. If system_first is set, then + * the current directory is ignored unless it is explicitly in the + * path. A null return value indicates that the file was not found. + * If already_loaded is set, then the file was already loaded. This + * preprocessor never loads the same file twice. + */ +const char *vtkParsePreprocess_FindIncludeFile( + PreprocessInfo *info, const char *filename, int system_first, + int *already_loaded); + +/** + * Initialize a preprocessor symbol struct. + */ +void vtkParsePreprocess_InitMacro(MacroInfo *symbol); + +/** + * Initialize a preprocessor struct. + */ +void vtkParsePreprocess_InitPreprocess(PreprocessInfo *info); + +#ifdef __cplusplus +} /* extern "C" */ +#endif + +#endif diff --git a/src/ParaView/vtkWrap.c b/src/ParaView/vtkWrap.c new file mode 100644 index 00000000..f41042c4 --- /dev/null +++ b/src/ParaView/vtkWrap.c @@ -0,0 +1,973 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkWrap.c + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#include "vtkWrap.h" +#include "vtkParseInternal.h" +#include "vtkParseExtras.h" +#include +#include +#include + +/* -------------------------------------------------------------------- */ +/* Common types. */ + +int vtkWrap_IsVoid(ValueInfo *val) +{ + if (val == 0) + { + return 1; + } + + return ((val->Type & VTK_PARSE_UNQUALIFIED_TYPE) == VTK_PARSE_VOID); +} + +int vtkWrap_IsVoidFunction(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE); + return (t == VTK_PARSE_FUNCTION); +} + +int vtkWrap_IsVoidPointer(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_VOID && vtkWrap_IsPointer(val)); +} + +int vtkWrap_IsCharPointer(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_CHAR && vtkWrap_IsPointer(val)); +} + +int vtkWrap_IsVTKObject(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE); + return (t == VTK_PARSE_OBJECT_PTR && + val->Class[0] == 'v' && strncmp(val->Class, "vtk", 3) == 0); +} + +int vtkWrap_IsSpecialObject(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE); + return ((t == VTK_PARSE_OBJECT || + t == VTK_PARSE_OBJECT_REF) && + val->Class[0] == 'v' && strncmp(val->Class, "vtk", 3) == 0); +} + +int vtkWrap_IsQtObject(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + if (t == VTK_PARSE_QOBJECT && + val->Class[0] == 'Q' && isupper(val->Class[1])) + { + return 1; + } + return 0; +} + +int vtkWrap_IsQtEnum(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE); + if ((t == VTK_PARSE_QOBJECT || t == VTK_PARSE_QOBJECT_REF) && + val->Class[0] == 'Q' && strncmp("Qt::", val->Class, 4) == 0) + { + return 1; + } + return 0; +} + + +/* -------------------------------------------------------------------- */ +/* The base types, all are mutually exclusive. */ + +int vtkWrap_IsObject(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_OBJECT || + t == VTK_PARSE_QOBJECT); +} + +int vtkWrap_IsFunction(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_FUNCTION); +} + +int vtkWrap_IsStream(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_ISTREAM || + t == VTK_PARSE_OSTREAM); +} + +int vtkWrap_IsNumeric(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + + t = (t & ~VTK_PARSE_UNSIGNED); + switch (t) + { + case VTK_PARSE_FLOAT: + case VTK_PARSE_DOUBLE: + case VTK_PARSE_CHAR: + case VTK_PARSE_SHORT: + case VTK_PARSE_INT: + case VTK_PARSE_LONG: + case VTK_PARSE_ID_TYPE: + case VTK_PARSE_LONG_LONG: + case VTK_PARSE___INT64: + case VTK_PARSE_SIGNED_CHAR: + case VTK_PARSE_SSIZE_T: + case VTK_PARSE_BOOL: + return 1; + } + + return 0; +} + +int vtkWrap_IsString(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_STRING || + t == VTK_PARSE_UNICODE_STRING); +} + +/* -------------------------------------------------------------------- */ +/* Subcategories */ + +int vtkWrap_IsBool(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_BOOL); +} + +int vtkWrap_IsChar(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_CHAR); +} + +int vtkWrap_IsInteger(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + + if (t != VTK_PARSE_UNSIGNED_CHAR) + { + t = (t & ~VTK_PARSE_UNSIGNED); + } + switch (t) + { + case VTK_PARSE_SHORT: + case VTK_PARSE_INT: + case VTK_PARSE_LONG: + case VTK_PARSE_ID_TYPE: + case VTK_PARSE_LONG_LONG: + case VTK_PARSE___INT64: + case VTK_PARSE_UNSIGNED_CHAR: + case VTK_PARSE_SIGNED_CHAR: + case VTK_PARSE_SSIZE_T: + return 1; + } + + return 0; +} + +int vtkWrap_IsRealNumber(ValueInfo *val) +{ + unsigned int t = (val->Type & VTK_PARSE_BASE_TYPE); + return (t == VTK_PARSE_FLOAT || t == VTK_PARSE_DOUBLE); +} + +/* -------------------------------------------------------------------- */ +/* These are mutually exclusive, as well. */ + +int vtkWrap_IsScalar(ValueInfo *val) +{ + unsigned int i = (val->Type & VTK_PARSE_POINTER_MASK); + return (i == 0); +} + +int vtkWrap_IsPointer(ValueInfo *val) +{ + unsigned int i = (val->Type & VTK_PARSE_POINTER_MASK); + return (i == VTK_PARSE_POINTER && val->Count == 0 && + val->CountHint == 0 && val->NumberOfDimensions <= 1); +} + +int vtkWrap_IsArray(ValueInfo *val) +{ + unsigned int i = (val->Type & VTK_PARSE_POINTER_MASK); + return (i == VTK_PARSE_POINTER && val->NumberOfDimensions <= 1 && + (val->Count != 0 || val->CountHint != 0)); +} + +int vtkWrap_IsNArray(ValueInfo *val) +{ + int j = 0; + unsigned int i = (val->Type & VTK_PARSE_POINTER_MASK); + if (i != VTK_PARSE_ARRAY || val->NumberOfDimensions <= 1) + { + return 0; + } + for (j = 0; j < val->NumberOfDimensions; j++) + { + if (val->Dimensions[j] == NULL || val->Dimensions[j][0] == '\0') + { + return 0; + } + } + return 1; +} + + +/* -------------------------------------------------------------------- */ +/* Other type properties, not mutually exclusive. */ + +int vtkWrap_IsNonConstRef(ValueInfo *val) +{ + return ((val->Type & VTK_PARSE_REF) != 0 && + (val->Type & VTK_PARSE_CONST) == 0); +} + +int vtkWrap_IsConstRef(ValueInfo *val) +{ + return ((val->Type & VTK_PARSE_REF) != 0 && + (val->Type & VTK_PARSE_CONST) != 0); +} + +int vtkWrap_IsRef(ValueInfo *val) +{ + return ((val->Type & VTK_PARSE_REF) != 0); +} + +int vtkWrap_IsConst(ValueInfo *val) +{ + return ((val->Type & VTK_PARSE_CONST) != 0); +} + +/* -------------------------------------------------------------------- */ +/* Hints */ + +int vtkWrap_IsNewInstance(ValueInfo *val) +{ + return ((val->Type & VTK_PARSE_NEWINSTANCE) != 0); +} + +/* -------------------------------------------------------------------- */ +/* Constructor/Destructor checks */ + +int vtkWrap_IsConstructor(ClassInfo *c, FunctionInfo *f) + +{ + size_t i, m; + const char *cp = c->Name; + + if (cp && f->Name && !vtkWrap_IsDestructor(c, f)) + { + /* remove namespaces and template parameters from the name */ + m = vtkParse_UnscopedNameLength(cp); + while (cp[m] == ':' && cp[m+1] == ':') + { + cp += m + 2; + m = vtkParse_UnscopedNameLength(cp); + } + for (i = 0; i < m; i++) + { + if (cp[i] == '<') + { + break; + } + } + + return (i == strlen(f->Name) && strncmp(cp, f->Name, i) == 0); + } + + return 0; +} + +int vtkWrap_IsDestructor(ClassInfo *c, FunctionInfo *f) +{ + size_t i; + const char *cp; + + if (c->Name && f->Name) + { + cp = f->Signature; + for (i = 0; cp[i] != '\0' && cp[i] != '('; i++) + { + if (cp[i] == '~') + { + return 1; + } + } + } + + return 0; +} + +int vtkWrap_IsSetVectorMethod(FunctionInfo *f) +{ + if (f->Macro && strncmp(f->Macro, "vtkSetVector", 12) == 0) + { + return 1; + } + + return 0; +} + +int vtkWrap_IsGetVectorMethod(FunctionInfo *f) +{ + if (f->Macro && strncmp(f->Macro, "vtkGetVector", 12) == 0) + { + return 1; + } + + return 0; +} + +/* -------------------------------------------------------------------- */ +/* Argument counting */ + +int vtkWrap_CountWrappedArgs(FunctionInfo *f) +{ + int totalArgs = f->NumberOfArguments; + + if (totalArgs > 0 && + (f->Arguments[0]->Type & VTK_PARSE_BASE_TYPE) + == VTK_PARSE_FUNCTION) + { + totalArgs = 1; + } + else if (totalArgs == 1 && + (f->Arguments[0]->Type & VTK_PARSE_UNQUALIFIED_TYPE) + == VTK_PARSE_VOID) + { + totalArgs = 0; + } + + return totalArgs; +} + +int vtkWrap_CountRequiredArgs(FunctionInfo *f) +{ + int requiredArgs = 0; + int totalArgs; + int i; + + totalArgs = vtkWrap_CountWrappedArgs(f); + + for (i = 0; i < totalArgs; i++) + { + if (f->Arguments[i]->Value == NULL || + vtkWrap_IsArray(f->Arguments[i]) || + vtkWrap_IsNArray(f->Arguments[i])) + { + requiredArgs = i+1; + } + } + + return requiredArgs; +} + +/* -------------------------------------------------------------------- */ +/* Check whether the class is derived from vtkObjectBase. */ + +int vtkWrap_IsVTKObjectBaseType( + HierarchyInfo *hinfo, const char *classname) +{ + HierarchyEntry *entry; + + if (hinfo) + { + entry = vtkParseHierarchy_FindEntry(hinfo, classname); + if (entry) + { + if (vtkParseHierarchy_IsTypeOf(hinfo, entry, "vtkObjectBase")) + { + return 1; + } + return 0; + } + } + + /* fallback if no HierarchyInfo */ + if (strncmp("vtk", classname, 3) == 0) + { + return 1; + } + + return 0; +} + +/* -------------------------------------------------------------------- */ +/* Check if the WRAP_SPECIAL flag is set for the class. */ + +int vtkWrap_IsSpecialType( + HierarchyInfo *hinfo, const char *classname) +{ + HierarchyEntry *entry; + + if (hinfo) + { + entry = vtkParseHierarchy_FindEntry(hinfo, classname); + if (entry && vtkParseHierarchy_GetProperty(entry, "WRAP_SPECIAL")) + { + return 1; + } + return 0; + } + + /* fallback if no HierarchyInfo */ + if (strncmp("vtk", classname, 3) == 0) + { + return -1; + } + + return 0; +} + +/* -------------------------------------------------------------------- */ +/* Check if the class is derived from superclass */ + +int vtkWrap_IsTypeOf( + HierarchyInfo *hinfo, const char *classname, const char *superclass) +{ + HierarchyEntry *entry; + + if (strcmp(classname, superclass) == 0) + { + return 1; + } + + if (hinfo) + { + entry = vtkParseHierarchy_FindEntry(hinfo, classname); + if (entry && vtkParseHierarchy_IsTypeOf(hinfo, entry, superclass)) + { + return 1; + } + } + + return 0; +} + +/* -------------------------------------------------------------------- */ +/* Make a guess about whether a class is wrapped */ + +int vtkWrap_IsClassWrapped( + HierarchyInfo *hinfo, const char *classname) +{ + if (hinfo) + { + HierarchyEntry *entry; + entry = vtkParseHierarchy_FindEntry(hinfo, classname); + + if (entry) + { + if (!vtkParseHierarchy_GetProperty(entry, "WRAP_EXCLUDE") || + vtkParseHierarchy_GetProperty(entry, "WRAP_SPECIAL")) + { + return 1; + } + } + } + else if (strncmp("vtk", classname, 3) == 0) + { + return 1; + } + + return 0; +} + +/* -------------------------------------------------------------------- */ +/* Check whether the destructor is public */ +int vtkWrap_HasPublicDestructor(ClassInfo *data) +{ + FunctionInfo *func; + int i; + + for (i = 0; i < data->NumberOfFunctions; i++) + { + func = data->Functions[i]; + + if (vtkWrap_IsDestructor(data, func) && + func->Access != VTK_ACCESS_PUBLIC) + { + return 0; + } + } + + return 1; +} + +/* -------------------------------------------------------------------- */ +/* Check whether the copy constructor is public */ +int vtkWrap_HasPublicCopyConstructor(ClassInfo *data) +{ + FunctionInfo *func; + int i; + + for (i = 0; i < data->NumberOfFunctions; i++) + { + func = data->Functions[i]; + + if (vtkWrap_IsConstructor(data, func) && + func->NumberOfArguments == 1 && + func->Arguments[0]->Class && + strcmp(func->Arguments[0]->Class, data->Name) == 0 && + func->Access != VTK_ACCESS_PUBLIC) + { + return 0; + } + } + + return 1; +} + +/* -------------------------------------------------------------------- */ +/* This sets the CountHint for vtkDataArray methods where the + * tuple size is equal to GetNumberOfComponents. */ +void vtkWrap_FindCountHints( + ClassInfo *data, HierarchyInfo *hinfo) +{ + int i; + const char *countMethod; + const char *classname; + FunctionInfo *theFunc; + HierarchyEntry *entry; + size_t m; + char digit; + + /* add hints for array GetTuple methods */ + if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkDataArray")) + { + countMethod = "GetNumberOfComponents()"; + + for (i = 0; i < data->NumberOfFunctions; i++) + { + theFunc = data->Functions[i]; + + if ((strcmp(theFunc->Name, "GetTuple") == 0 || + strcmp(theFunc->Name, "GetTupleValue") == 0) && + theFunc->ReturnValue && theFunc->ReturnValue->Count == 0 && + theFunc->NumberOfArguments == 1 && + theFunc->Arguments[0]->Type == VTK_PARSE_ID_TYPE) + { + theFunc->ReturnValue->CountHint = countMethod; + } + else if ((strcmp(theFunc->Name, "SetTuple") == 0 || + strcmp(theFunc->Name, "SetTupleValue") == 0 || + strcmp(theFunc->Name, "GetTuple") == 0 || + strcmp(theFunc->Name, "GetTupleValue") == 0 || + strcmp(theFunc->Name, "InsertTuple") == 0 || + strcmp(theFunc->Name, "InsertTupleValue") == 0) && + theFunc->NumberOfArguments == 2 && + theFunc->Arguments[0]->Type == VTK_PARSE_ID_TYPE && + theFunc->Arguments[1]->Count == 0) + { + theFunc->Arguments[1]->CountHint = countMethod; + } + else if ((strcmp(theFunc->Name, "InsertNextTuple") == 0 || + strcmp(theFunc->Name, "InsertNextTupleValue") == 0) && + theFunc->NumberOfArguments == 1 && + theFunc->Arguments[0]->Count == 0) + { + theFunc->Arguments[0]->CountHint = countMethod; + } + } + } + + /* add hints for interpolator Interpolate methods */ + if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkAbstractImageInterpolator")) + { + countMethod = "GetNumberOfComponents()"; + + for (i = 0; i < data->NumberOfFunctions; i++) + { + theFunc = data->Functions[i]; + + if (strcmp(theFunc->Name, "Interpolate") == 0 && + theFunc->NumberOfArguments == 2 && + theFunc->Arguments[0]->Type == (VTK_PARSE_DOUBLE_PTR|VTK_PARSE_CONST) && + theFunc->Arguments[0]->Count == 3 && + theFunc->Arguments[1]->Type == VTK_PARSE_DOUBLE_PTR && + theFunc->Arguments[1]->Count == 0) + { + theFunc->Arguments[1]->CountHint = countMethod; + } + } + } + + for (i = 0; i < data->NumberOfFunctions; i++) + { + theFunc = data->Functions[i]; + + /* hints for constructors that take arrays */ + if (vtkWrap_IsConstructor(data, theFunc) && + theFunc->NumberOfArguments == 1 && + vtkWrap_IsPointer(theFunc->Arguments[0]) && + vtkWrap_IsNumeric(theFunc->Arguments[0]) && + theFunc->Arguments[0]->Count == 0 && + hinfo) + { + entry = vtkParseHierarchy_FindEntry(hinfo, data->Name); + if (entry && vtkParseHierarchy_IsTypeOfTemplated( + hinfo, entry, data->Name, "vtkTuple", &classname)) + { + /* attempt to get count from template parameter */ + if (classname) + { + m = strlen(classname); + if (m > 2 && classname[m - 1] == '>' && + isdigit(classname[m-2]) && (classname[m-3] == ' ' || + classname[m-3] == ',' || classname[m-3] == '<')) + { + digit = classname[m-2]; + theFunc->Arguments[0]->Count = digit - '0'; + vtkParse_AddStringToArray( + &theFunc->Arguments[0]->Dimensions, + &theFunc->Arguments[0]->NumberOfDimensions, + vtkParse_DuplicateString(&digit, 1)); + } + free((char *)classname); + } + } + } + + /* hints for operator[] index range */ + if (theFunc->IsOperator && theFunc->Name && + strcmp(theFunc->Name, "operator[]") == 0) + { + if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkTuple")) + { + theFunc->SizeHint = "GetSize()"; + } + else if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArrayCoordinates") || + vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArrayExtents") || + vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArraySort")) + { + theFunc->SizeHint = "GetDimensions()"; + } + else if (vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArrayExtentsList") || + vtkWrap_IsTypeOf(hinfo, data->Name, "vtkArrayWeights")) + { + theFunc->SizeHint = "GetCount()"; + } + } + } +} + +/* -------------------------------------------------------------------- */ +/* This sets the NewInstance hint for generator methods. */ +void vtkWrap_FindNewInstanceMethods( + ClassInfo *data, HierarchyInfo *hinfo) +{ + int i; + FunctionInfo *theFunc; + + for (i = 0; i < data->NumberOfFunctions; i++) + { + theFunc = data->Functions[i]; + if (theFunc->Name && theFunc->ReturnValue && + vtkWrap_IsVTKObject(theFunc->ReturnValue) && + vtkWrap_IsVTKObjectBaseType(hinfo, theFunc->ReturnValue->Class)) + { + if (strcmp(theFunc->Name, "NewInstance") == 0 || + strcmp(theFunc->Name, "CreateInstance") == 0 || + (strcmp(theFunc->Name, "CreateImageReader2") == 0 && + strcmp(data->Name, "vtkImageReader2Factory") == 0) || + (strcmp(theFunc->Name, "CreateDataArray") == 0 && + strcmp(data->Name, "vtkDataArray") == 0) || + (strcmp(theFunc->Name, "CreateArray") == 0 && + strcmp(data->Name, "vtkAbstractArray") == 0) || + (strcmp(theFunc->Name, "CreateArray") == 0 && + strcmp(data->Name, "vtkArray") == 0) || + (strcmp(theFunc->Name, "GetQueryInstance") == 0 && + strcmp(data->Name, "vtkSQLDatabase") == 0) || + (strcmp(theFunc->Name, "CreateFromURL") == 0 && + strcmp(data->Name, "vtkSQLDatabase") == 0) || + (strcmp(theFunc->Name, "MakeTransform") == 0 && + vtkWrap_IsTypeOf(hinfo, data->Name, "vtkAbstractTransform"))) + { + theFunc->ReturnValue->Type |= VTK_PARSE_NEWINSTANCE; + } + } + } +} + + +/* -------------------------------------------------------------------- */ +/* Expand all typedef types that are used in function arguments */ +void vtkWrap_ExpandTypedefs(ClassInfo *data, HierarchyInfo *hinfo) +{ + int i, j, n; + FunctionInfo *funcInfo; + const char *newclass; + + n = data->NumberOfSuperClasses; + for (i = 0; i < n; i++) + { + newclass = vtkParseHierarchy_ExpandTypedefsInName( + hinfo, data->SuperClasses[i], NULL); + if (newclass != data->SuperClasses[i]) + { + data->SuperClasses[i] = + vtkParse_DuplicateString(newclass, strlen(newclass)); + free((char *)newclass); + } + } + + n = data->NumberOfFunctions; + for (i = 0; i < n; i++) + { + funcInfo = data->Functions[i]; + if (funcInfo->Access == VTK_ACCESS_PUBLIC) + { + for (j = 0; j < funcInfo->NumberOfArguments; j++) + { + vtkParseHierarchy_ExpandTypedefsInValue( + hinfo, funcInfo->Arguments[j], data->Name); + } + if (funcInfo->ReturnValue) + { + vtkParseHierarchy_ExpandTypedefsInValue( + hinfo, funcInfo->ReturnValue, data->Name); + } + } + } +} + + +/* -------------------------------------------------------------------- */ +/* get the type name */ + +const char *vtkWrap_GetTypeName(ValueInfo *val) +{ + unsigned int aType = val->Type; + const char *aClass = val->Class; + + /* print the type itself */ + switch (aType & VTK_PARSE_BASE_TYPE) + { + case VTK_PARSE_FLOAT: return "float"; + case VTK_PARSE_DOUBLE: return "double"; + case VTK_PARSE_INT: return "int"; + case VTK_PARSE_SHORT: return "short"; + case VTK_PARSE_LONG: return "long"; + case VTK_PARSE_VOID: return "void "; + case VTK_PARSE_CHAR: return "char"; + case VTK_PARSE_UNSIGNED_INT: return "unsigned int"; + case VTK_PARSE_UNSIGNED_SHORT: return "unsigned short"; + case VTK_PARSE_UNSIGNED_LONG: return "unsigned long"; + case VTK_PARSE_UNSIGNED_CHAR: return "unsigned char"; + case VTK_PARSE_ID_TYPE: return "vtkIdType"; + case VTK_PARSE_LONG_LONG: return "long long"; + case VTK_PARSE___INT64: return "__int64"; + case VTK_PARSE_UNSIGNED_LONG_LONG: return "unsigned long long"; + case VTK_PARSE_UNSIGNED___INT64: return "unsigned __int64"; + case VTK_PARSE_SIGNED_CHAR: return "signed char"; + case VTK_PARSE_BOOL: return "bool"; + case VTK_PARSE_UNICODE_STRING: return "vtkUnicodeString"; + case VTK_PARSE_SSIZE_T: return "ssize_t"; + case VTK_PARSE_SIZE_T: return "size_t"; + } + + return aClass; +} + +/* -------------------------------------------------------------------- */ +/* variable declarations */ + +void vtkWrap_DeclareVariable( + FILE *fp, ValueInfo *val, const char *name, int i, int flags) +{ + unsigned int aType; + int j; + + if (val == NULL) + { + return; + } + + aType = (val->Type & VTK_PARSE_UNQUALIFIED_TYPE); + + /* do nothing for void */ + if (aType == VTK_PARSE_VOID || + (aType & VTK_PARSE_BASE_TYPE) == VTK_PARSE_FUNCTION) + { + return; + } + + /* add a couple spaces */ + fprintf(fp," "); + + /* for const * return types, prepend with const */ + if ((flags & VTK_WRAP_RETURN) != 0) + { + if ((val->Type & VTK_PARSE_CONST) != 0 && + (aType & VTK_PARSE_INDIRECT) != 0) + { + fprintf(fp,"const "); + } + } + /* do the same for "const char *" with initializer */ + else + { + if ((val->Type & VTK_PARSE_CONST) != 0 && + aType == VTK_PARSE_CHAR_PTR && + val->Value && + strcmp(val->Value, "0") != 0 && + strcmp(val->Value, "NULL") != 0) + { + fprintf(fp,"const "); + } + } + + /* print the type name */ + fprintf(fp, "%s ", vtkWrap_GetTypeName(val)); + + /* indirection */ + if ((flags & VTK_WRAP_RETURN) != 0) + { + /* ref and pointer return values are stored as pointers */ + if ((aType & VTK_PARSE_INDIRECT) == VTK_PARSE_POINTER || + (aType & VTK_PARSE_INDIRECT) == VTK_PARSE_REF) + { + fprintf(fp, "*"); + } + } + else + { + /* objects refs and pointers are always handled via pointers, + * other refs are passed by value */ + if (aType == VTK_PARSE_CHAR_PTR || + aType == VTK_PARSE_VOID_PTR || + aType == VTK_PARSE_OBJECT_PTR || + aType == VTK_PARSE_OBJECT_REF || + aType == VTK_PARSE_OBJECT || + vtkWrap_IsQtObject(val)) + { + fprintf(fp, "*"); + } + /* arrays of unknown size are handled via pointers */ + else if (val->CountHint) + { + fprintf(fp, "*"); + } + } + + /* the variable name */ + if (i >= 0) + { + fprintf(fp,"%s%i", name, i); + } + else + { + fprintf(fp,"%s", name); + } + + if ((flags & VTK_WRAP_ARG) != 0) + { + /* print the array decorators */ + if (((aType & VTK_PARSE_POINTER_MASK) != 0) && + aType != VTK_PARSE_CHAR_PTR && + aType != VTK_PARSE_VOID_PTR && + aType != VTK_PARSE_OBJECT_PTR && + !vtkWrap_IsQtObject(val) && + val->CountHint == NULL) + { + if (val->NumberOfDimensions == 1 && val->Count > 0) + { + fprintf(fp, "[%d]", val->Count); + } + else + { + for (j = 0; j < val->NumberOfDimensions; j++) + { + fprintf(fp, "[%s]", val->Dimensions[j]); + } + } + } + + /* add a default value */ + else if (val->Value) + { + fprintf(fp, " = %s", val->Value); + } + else if (aType == VTK_PARSE_CHAR_PTR || + aType == VTK_PARSE_VOID_PTR || + aType == VTK_PARSE_OBJECT_PTR || + aType == VTK_PARSE_OBJECT_REF || + aType == VTK_PARSE_OBJECT || + vtkWrap_IsQtObject(val)) + { + fprintf(fp, " = NULL"); + } + else if (val->CountHint) + { + fprintf(fp, " = NULL"); + } + else if (aType == VTK_PARSE_BOOL) + { + fprintf(fp, " = false"); + } + } + + /* finish off with a semicolon */ + if ((flags & VTK_WRAP_NOSEMI) == 0) + { + fprintf(fp, ";\n"); + } +} + +void vtkWrap_DeclareVariableSize( + FILE *fp, ValueInfo *val, const char *name, int i) +{ + char idx[32]; + int j; + + idx[0] = '\0'; + if (i >= 0) + { + sprintf(idx, "%d", i); + } + + if (val->NumberOfDimensions > 1) + { + fprintf(fp, + " static int %s%s[%d] = ", + name, idx, val->NumberOfDimensions); + + for (j = 0; j < val->NumberOfDimensions; j++) + { + fprintf(fp, "%c %s", ((j == 0) ? '{' : ','), val->Dimensions[j]); + } + + fprintf(fp, " };\n"); + } + else if (val->Count != 0 || val->CountHint) + { + fprintf(fp, + " %sint %s%s = %d;\n", + (val->CountHint ? "" : "const "), name, idx, + (val->CountHint ? 0 : val->Count)); + } + else if (val->NumberOfDimensions == 1) + { + fprintf(fp, + " const int %s%s = %s;\n", + name, idx, val->Dimensions[0]); + } +} diff --git a/src/ParaView/vtkWrap.h b/src/ParaView/vtkWrap.h new file mode 100644 index 00000000..7100e0b8 --- /dev/null +++ b/src/ParaView/vtkWrap.h @@ -0,0 +1,242 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkWrap.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +/** + * vtkWrap provides useful functions for generating wrapping code. +*/ + +#ifndef VTK_WRAP_H +#define VTK_WRAP_H + +#include "vtkParse.h" +#include "vtkParseHierarchy.h" + +/** + * For use with vtkWrap_DeclareVariable. + */ +/*@{*/ +#define VTK_WRAP_RETURN 1 +#define VTK_WRAP_ARG 2 +#define VTK_WRAP_NOSEMI 4 +/*@}*/ + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Check for common types. + */ +/*@{*/ +int vtkWrap_IsVoid(ValueInfo *val); +int vtkWrap_IsVoidFunction(ValueInfo *val); +int vtkWrap_IsVoidPointer(ValueInfo *val); +int vtkWrap_IsCharPointer(ValueInfo *val); +int vtkWrap_IsVTKObject(ValueInfo *val); +int vtkWrap_IsSpecialObject(ValueInfo *val); +int vtkWrap_IsQtObject(ValueInfo *val); +int vtkWrap_IsQtEnum(ValueInfo *val); +/*@}*/ + +/** + * The basic types, all are mutually exclusive. + * Note that enums are considered to be objects, + * bool and char are considered to be numeric. + */ +/*@{*/ +int vtkWrap_IsObject(ValueInfo *val); +int vtkWrap_IsFunction(ValueInfo *val); +int vtkWrap_IsStream(ValueInfo *val); +int vtkWrap_IsNumeric(ValueInfo *val); +int vtkWrap_IsString(ValueInfo *val); +/*@}*/ + +/** + * Subcategories of numeric types. In this categorization, + * bool and char are not considered to be integers. + */ +/*@{*/ +int vtkWrap_IsBool(ValueInfo *val); +int vtkWrap_IsChar(ValueInfo *val); +int vtkWrap_IsInteger(ValueInfo *val); +int vtkWrap_IsRealNumber(ValueInfo *val); +/*@}*/ + +/** + * Arrays and pointers. These are mutually exclusive. + * IsPointer() does not include pointers to pointers. + * IsArray() and IsNArray() do not include unsized arrays. + * Arrays of pointers are not included in any of these. + */ +/*@{*/ +int vtkWrap_IsScalar(ValueInfo *val); +int vtkWrap_IsPointer(ValueInfo *val); +int vtkWrap_IsArray(ValueInfo *val); +int vtkWrap_IsNArray(ValueInfo *val); +/*@}*/ + +/** + * Properties that can combine with other properties. + */ +/*@{*/ +int vtkWrap_IsNonConstRef(ValueInfo *val); +int vtkWrap_IsConstRef(ValueInfo *val); +int vtkWrap_IsRef(ValueInfo *val); +int vtkWrap_IsConst(ValueInfo *val); +/*@}*/ + +/** + * Hints. + * NewInstance objects must be freed by the caller. + */ +/*@{*/ +int vtkWrap_IsNewInstance(ValueInfo *val); +/*@}*/ + + +/** + * Check whether the class is derived from vtkObjectBase. + * If "hinfo" is NULL, this just checks that the class + * name starts with "vtk". + */ +int vtkWrap_IsVTKObjectBaseType( + HierarchyInfo *hinfo, const char *classname); + +/** + * Check if the WRAP_SPECIAL flag is set for the class. + * If "hinfo" is NULL, it defaults to just checking if + * the class starts with "vtk" and returns -1 if so. + */ +int vtkWrap_IsSpecialType( + HierarchyInfo *hinfo, const char *classname); + +/** + * Check if the class is derived from superclass. + * If "hinfo" is NULL, then only an exact match to the + * superclass will succeed. + */ +int vtkWrap_IsTypeOf( + HierarchyInfo *hinfo, const char *classname, const char *superclass); + +/** + * Check whether a class is wrapped. If "hinfo" is NULL, + * it just checks that the class starts with "vtk". + */ +int vtkWrap_IsClassWrapped( + HierarchyInfo *hinfo, const char *classname); + +/** + * Check whether the destructor is public + */ +int vtkWrap_HasPublicDestructor(ClassInfo *data); + +/** + * Check whether the copy constructor is public + */ +int vtkWrap_HasPublicCopyConstructor(ClassInfo *data); + +/** + * Expand all typedef types that are used in function arguments. + * This should be done before any wrapping is done, to make sure + * that the wrappers see the real types. + */ +void vtkWrap_ExpandTypedefs(ClassInfo *data, HierarchyInfo *hinfo); + +/** + * Apply any hints about array sizes, e.g. hint that the + * GetNumberOfComponents() method gives the tuple size. + */ +void vtkWrap_FindCountHints( + ClassInfo *data, HierarchyInfo *hinfo); + +/** + * Apply any hints about methods that return a new object instance, + * i.e. factory methods and the like. Reference counts must be + * handled differently for such returned objects. + */ +void vtkWrap_FindNewInstanceMethods( + ClassInfo *data, HierarchyInfo *hinfo); + +/** + * Get the name of a type. The name will not include "const". + */ +const char *vtkWrap_GetTypeName(ValueInfo *val); + +/** + * True if the method a constructor of the class. + */ +int vtkWrap_IsConstructor(ClassInfo *c, FunctionInfo *f); + +/** + * True if the method a destructor of the class. + */ +int vtkWrap_IsDestructor(ClassInfo *c, FunctionInfo *f); + +/** + * Check if a method is from a SetVector method. + */ +int vtkWrap_IsSetVectorMethod(FunctionInfo *f); + +/** + * Check if a method is from a GetVector method. + */ +int vtkWrap_IsGetVectorMethod(FunctionInfo *f); + +/** + * Count the number of args that are wrapped. + * This skips the "void *" argument that follows + * wrapped function pointer arguments. + */ +int vtkWrap_CountWrappedArgs(FunctionInfo *f); + +/** + * Count the number of args that are required. + * This counts to the last argument that does not + * have a default value. Array args are not allowed + * to have default values. + */ +int vtkWrap_CountRequiredArgs(FunctionInfo *f); + +/** + * Write a variable declaration to a file. + * Void is automatically ignored, and nothing is written for + * function pointers + * Set "idx" to -1 to avoid writing an idx. + * Set "flags" to VTK_WRAP_RETURN to write a return value, + * or to VTK_WRAP_ARG to write a temp argument variable. + * The following rules apply: + * - if VTK_WRAP_NOSEMI is set, then no semicolon/newline is printed + * - if VTK_WRAP_RETURN is set, then "&" becomes "*" + * - if VTK_WRAP_ARG is set, "&" becomes "*" only for object + * types, and is removed for all other types. + * - "const" is removed except for return values with "&" or "*". + */ +void vtkWrap_DeclareVariable( + FILE *fp, ValueInfo *v, const char *name, int idx, int flags); + +/** + * Write an "int" size variable for arrays, initialized to + * the array size if the size is greater than zero. + * For N-dimensional arrays, write a static array of ints. + */ +void vtkWrap_DeclareVariableSize( + FILE *fp, ValueInfo *v, const char *name, int idx); + + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/ParaView/vtkWrapHierarchy.c b/src/ParaView/vtkWrapHierarchy.c new file mode 100644 index 00000000..22b17004 --- /dev/null +++ b/src/ParaView/vtkWrapHierarchy.c @@ -0,0 +1,1015 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkWrapHierarchy.c + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ +/*------------------------------------------------------------------------- + Copyright (c) 2010 David Gobbi. + + Contributed to the VisualizationToolkit by the author in June 2010 + under the terms of the Visualization Toolkit 2008 copyright. +-------------------------------------------------------------------------*/ + +/** + The vtkWrapHierarchy program builds a text file that describes the + class hierarchy. + For each class, the output file will have a line in the following + format: + + classname [ : superclass ] ; header.h ; kit [; flags] + + For each enum type, + + enumname : enum ; header.h ; kit [; flags] + + For each typedef, + + name = [2][3]* const int ; header.h ; kit [; flags] + +*/ + +#include "vtkParse.h" +#include "vtkParseInternal.h" +#include "vtkParsePreprocess.h" +#include +#include +#include +#include +#ifdef _WIN32 +# include +#else +# include +#endif + +/** + * Helper to append a text line to an array of lines + */ +static char **append_unique_line(char **lines, char *line, size_t *np) +{ + size_t l, n; + + n = *np; + + /* check to make sure this line isn't a duplicate */ + for (l = 0; l < n; l++) + { + if (strcmp(line, lines[l]) == 0) + { + break; + } + } + if (l == n) + { + /* allocate more memory if n+1 is a power of two */ + if (((n+1) & n) == 0) + { + lines = (char **)realloc(lines, (n+1)*2*sizeof(char *)); + } + + lines[n] = (char *)malloc(strlen(line)+1); + strcpy(lines[n++], line); + lines[n] = NULL; + } + + *np = n; + return lines; +} + +/** + * Helper to append to a line, given the end marker + */ +static char *append_to_line( + char *line, const char *text, size_t *pos, size_t *maxlen) +{ + size_t n; + + n = strlen(text); + + if ((*pos) + n + 1 > (*maxlen)) + { + *maxlen = ((*pos) + n + 1 + 2*(*maxlen)); + line = (char *)realloc(line, (*maxlen)); + } + + strcpy(&line[*pos], text); + *pos = (*pos) + n; + + return line; +} + +/** + * Append scope to line + */ +static char *append_scope_to_line( + char *line, size_t *m, size_t *maxlen, const char *scope) +{ + if (scope && scope[0] != '\0') + { + line = append_to_line(line, scope, m, maxlen); + line = append_to_line(line, "::", m, maxlen); + } + + return line; +} + +/** + * Append template info + */ +static char *append_template_to_line( + char *line, size_t *m, size_t *maxlen, TemplateArgs *template_args) +{ + TemplateArg *arg; + int j; + + line = append_to_line(line, "<", m, maxlen); + + for (j = 0; j < template_args->NumberOfArguments; j++) + { + arg = template_args->Arguments[j]; + line = append_to_line(line, arg->Name, m, maxlen); + if (arg->Value && arg->Value[0] != '\n') + { + line = append_to_line(line, "=", m, maxlen); + line = append_to_line(line, arg->Value, m, maxlen); + } + if (j+1 < template_args->NumberOfArguments) + { + line = append_to_line(line, ",", m, maxlen); + } + } + + line = append_to_line(line, ">", m, maxlen); + + return line; +} + +/** + * Append class info + */ +static char *append_class_to_line( + char *line, size_t *m, size_t *maxlen, ClassInfo *class_info) +{ + int j; + + line = append_to_line(line, class_info->Name, m, maxlen); + + if (class_info->Template) + { + line = append_template_to_line(line, m, maxlen, class_info->Template); + } + + line = append_to_line(line, " ", m, maxlen); + + if (class_info->NumberOfSuperClasses) + { + line = append_to_line(line, ": ", m, maxlen); + } + + for (j = 0; j < class_info->NumberOfSuperClasses; j++) + { + line = append_to_line(line, class_info->SuperClasses[j], m, maxlen); + line = append_to_line(line, " ", m, maxlen); + if (j+1 < class_info->NumberOfSuperClasses) + { + line = append_to_line(line, ", ", m, maxlen); + } + } + + return line; +} + +/** + * Append enum info + */ +static char *append_enum_to_line( + char *line, size_t *m, size_t *maxlen, EnumInfo *enum_info) +{ + line = append_to_line(line, enum_info->Name, m, maxlen); + line = append_to_line(line, " : enum ", m, maxlen); + + return line; +} + +/** + * Append the trailer, i.e. the filename and flags + */ +static char *append_trailer( + char *line, size_t *m, size_t *maxlen, + const char *header_file, const char *module_name, const char *flags) +{ + line = append_to_line(line, "; ", m, maxlen); + line = append_to_line(line, header_file, m, maxlen); + + line = append_to_line(line, " ; ", m, maxlen); + line = append_to_line(line, module_name, m, maxlen); + + if (flags && flags[0] != '\0') + { + line = append_to_line(line, " ; ", m, maxlen); + line = append_to_line(line, flags, m, maxlen); + } + + return line; +} + +/** + * Append typedef info + */ +static char *append_typedef_to_line( + char *line, size_t *m, size_t *maxlen, ValueInfo *typedef_info) +{ + unsigned int type; + int ndims; + int dim; + + line = append_to_line(line, typedef_info->Name, m, maxlen); + line = append_to_line(line, " = ", m, maxlen); + + type = typedef_info->Type; + + if ((type & VTK_PARSE_REF) != 0) + { + line = append_to_line(line, "&", m, maxlen); + } + + ndims = typedef_info->NumberOfDimensions; + + for (dim = 0; dim < ndims; dim++) + { + line = append_to_line(line, "[", m, maxlen); + line = append_to_line(line, typedef_info->Dimensions[dim], + m, maxlen); + line = append_to_line(line, "]", m, maxlen); + } + + type = (type & VTK_PARSE_POINTER_MASK); + if (ndims > 0 && (type & VTK_PARSE_POINTER_LOWMASK) == VTK_PARSE_ARRAY) + { + type = ((type >> 2) & VTK_PARSE_POINTER_MASK); + } + else if (ndims == 1) + { + type = ((type >> 2) & VTK_PARSE_POINTER_MASK); + } + + /* pointers are printed after brackets, and are intentionally + * printed in reverse order as compared to C++ declarations */ + while (type) + { + unsigned int bits = (type & VTK_PARSE_POINTER_LOWMASK); + type = ((type >> 2) & VTK_PARSE_POINTER_MASK); + + if (bits == VTK_PARSE_POINTER) + { + line = append_to_line(line, "*", m, maxlen); + } + else if (bits == VTK_PARSE_CONST_POINTER) + { + line = append_to_line(line, "const*", m, maxlen); + } + else + { + line = append_to_line(line, "[]", m, maxlen); + } + } + + if (line[*m-1] != ' ') + { + line = append_to_line(line, " ", m, maxlen); + } + + if ((type & VTK_PARSE_CONST) != 0) + { + line = append_to_line(line, "const ", m, maxlen); + } + + line = append_to_line(line, typedef_info->Class, m, maxlen); + line = append_to_line(line, " ", m, maxlen); + + return line; +} + +/** + * Append all types in a class + */ +static char **append_class_contents( + char **lines, size_t *np, ClassInfo *data, + const char *scope, const char *header_file, const char *module_name) +{ + int i; + const char *tmpflags; + char *new_scope; + char *line; + size_t m, n, maxlen; + size_t scope_m, scope_maxlen; + + /* append the name to the scope */ + new_scope = 0; + n = 0; + m = 0; + if (scope) + { + n = strlen(scope); + } + if (data->Name) + { + m = strlen(data->Name); + } + if (m && (n || data->Template)) + { + scope_maxlen = n + m + 3; + scope_m = 0; + new_scope = (char *)malloc(scope_maxlen); + new_scope[0] = '\0'; + if (n) + { + new_scope = append_to_line(new_scope, scope, &scope_m, &scope_maxlen); + new_scope = append_to_line(new_scope, "::", &scope_m, &scope_maxlen); + } + new_scope = append_to_line(new_scope, data->Name, &scope_m, &scope_maxlen); + if (data->Template) + { + new_scope = append_template_to_line( + new_scope, &scope_m, &scope_maxlen, data->Template); + } + scope = new_scope; + } + else if (m) + { + scope = data->Name; + } + + /* start with a buffer of 15 chars and grow from there */ + maxlen = 15; + m = 0; + line = (char *)malloc(maxlen); + + /* add a line for each type that is found */ + for (i = 0; i < data->NumberOfItems; i++) + { + m = 0; + line[m] = '\0'; + + tmpflags = 0; + + if (data->Items[i].Type == VTK_CLASS_INFO || + data->Items[i].Type == VTK_STRUCT_INFO) + { + ClassInfo *class_info = + data->Classes[data->Items[i].Index]; + + line = append_scope_to_line(line, &m, &maxlen, scope); + line = append_class_to_line(line, &m, &maxlen, class_info); + tmpflags = "WRAP_EXCLUDE"; + } + else if (data->Items[i].Type == VTK_ENUM_INFO) + { + line = append_scope_to_line(line, &m, &maxlen, scope); + line = append_enum_to_line(line, &m, &maxlen, + data->Enums[data->Items[i].Index]); + } + else if (data->Items[i].Type == VTK_TYPEDEF_INFO) + { + line = append_scope_to_line(line, &m, &maxlen, scope); + line = append_typedef_to_line(line, &m, &maxlen, + data->Typedefs[data->Items[i].Index]); + } + else + { + /* unhandled file element */ + continue; + } + + /* append filename and flags */ + line = append_trailer( + line, &m, &maxlen, header_file, module_name, tmpflags); + + /* append the line to the file */ + lines = append_unique_line(lines, line, np); + + /* for classes, add all typed defined within the class */ + if ((data->Items[i].Type == VTK_CLASS_INFO || + data->Items[i].Type == VTK_STRUCT_INFO) && + data->Classes[data->Items[i].Index]->Name) + { + lines = append_class_contents(lines, np, + data->Classes[data->Items[i].Index], + scope, header_file, module_name); + } + } + + free(line); + + if (new_scope != 0) + { + free(new_scope); + } + + return lines; +} + + +/** + * Append all types in a namespace + */ +static char **append_namespace_contents( + char **lines, size_t *np, NamespaceInfo *data, ClassInfo *main_class, + const char *scope, const char *header_file, const char *module_name, + const char *flags) +{ + int i; + const char *tmpflags; + char *line; + char *new_scope; + size_t n, m, maxlen; + + /* append the name to the scope */ + new_scope = 0; + n = 0; + m = 0; + if (scope) + { + n = strlen(scope); + } + if (data->Name) + { + m = strlen(data->Name); + } + if (m && n) + { + new_scope = (char *)malloc(m + n + 3); + if (n) + { + strncpy(new_scope, scope, n); + new_scope[n++] = ':'; + new_scope[n++] = ':'; + } + strncpy(&new_scope[n], data->Name, m); + new_scope[n+m] = '\0'; + scope = new_scope; + } + else if (m) + { + scope = data->Name; + } + + /* start with a buffer of 15 chars and grow from there */ + maxlen = 15; + m = 0; + line = (char *)malloc(maxlen); + + /* add a line for each type that is found */ + for (i = 0; i < data->NumberOfItems; i++) + { + tmpflags = 0; + m = 0; + line[m] = '\0'; + + if (data->Items[i].Type == VTK_CLASS_INFO || + data->Items[i].Type == VTK_STRUCT_INFO) + { + ClassInfo *class_info = + data->Classes[data->Items[i].Index]; + + /* all but the main class in each file is excluded from wrapping */ + tmpflags = "WRAP_EXCLUDE"; + if (class_info == main_class) + { + tmpflags = flags; + } + + line = append_scope_to_line(line, &m, &maxlen, scope); + line = append_class_to_line(line, &m, &maxlen, class_info); + } + else if (data->Items[i].Type == VTK_ENUM_INFO) + { + line = append_scope_to_line(line, &m, &maxlen, scope); + line = append_enum_to_line(line, &m, &maxlen, + data->Enums[data->Items[i].Index]); + } + else if (data->Items[i].Type == VTK_TYPEDEF_INFO) + { + line = append_scope_to_line(line, &m, &maxlen, scope); + line = append_typedef_to_line(line, &m, &maxlen, + data->Typedefs[data->Items[i].Index]); + } + else + { + /* unhandled file element */ + continue; + } + + /* append filename and flags */ + line = append_trailer( + line, &m, &maxlen, header_file, module_name, tmpflags); + + /* append the line to the file */ + lines = append_unique_line(lines, line, np); + + /* for classes, add all typed defined within the class */ + if ((data->Items[i].Type == VTK_CLASS_INFO || + data->Items[i].Type == VTK_STRUCT_INFO) && + data->Classes[data->Items[i].Index]->Name) + { + lines = append_class_contents(lines, np, + data->Classes[data->Items[i].Index], + scope, header_file, module_name); + } + + /* for namespaces, add all types in the namespace */ + if (data->Items[i].Type == VTK_NAMESPACE_INFO && + data->Namespaces[data->Items[i].Index]->Name) + { + lines = append_namespace_contents(lines, np, + data->Namespaces[data->Items[i].Index], 0, + scope, header_file, module_name, "WRAP_EXCLUDE"); + } + } + + free(line); + + if (new_scope != 0) + { + free(new_scope); + } + + return lines; +} + +/** + * Read a header file with vtkParse.tab.c + * + * If "lines" is provided, the file contents + * will be appended to them. + */ +static char **vtkWrapHierarchy_ParseHeaderFile( + FILE *fp, const char *filename, const char *module_name, + const char *flags, char **lines) +{ + FileInfo *data; + const char *header_file; + size_t k, n; + + /* start with just a single output line and grow from there */ + if (lines == NULL) + { + lines = (char **)malloc(sizeof(char *)); + lines[0] = NULL; + } + + /* always ignore BTX markers when building hierarchy files */ + vtkParse_SetIgnoreBTX(1); + + /* the "concrete" flag doesn't matter, just set to zero */ + data = vtkParse_ParseFile(filename, fp, stderr); + + if (!data) + { + free(lines); + return 0; + } + + /* find the last line in "lines" */ + n = 0; + while (lines[n] != NULL) + { + n++; + } + + k = strlen(data->FileName) - 1; + while (k > 0 && data->FileName[k-1] != '/' && data->FileName[k-1] != '\\') + { + k--; + } + header_file = &data->FileName[k]; + + /* append the file contents to the output */ + lines = append_namespace_contents( + lines, &n, data->Contents, data->MainClass, 0, + header_file, module_name, flags); + + vtkParse_Free(data); + + return lines; +} + +/** + * Read a hierarchy file into "lines" without duplicating lines + */ +static char **vtkWrapHierarchy_ReadHierarchyFile(FILE *fp, char **lines) +{ + char *line; + size_t maxlen = 15; + size_t i, n; + + line = (char *)malloc(maxlen); + + if (lines == NULL) + { + lines = (char **)malloc(sizeof(char *)); + lines[0] = NULL; + } + + while (fgets(line, (int)maxlen, fp)) + { + n = strlen(line); + + /* if buffer not long enough, increase it */ + while (n == maxlen-1 && line[n-1] != '\n' && !feof(fp)) + { + maxlen *= 2; + line = (char *)realloc(line, maxlen); + if (!fgets(&line[n], (int)(maxlen-n), fp)) { break; } + n += strlen(&line[n]); + } + + while (n > 0 && isspace(line[n-1])) + { + n--; + } + line[n] = '\0'; + + if (line[0] == '\0') + { + continue; + } + + for (i = 0; lines[i] != NULL; i++) + { + if (strcmp(line, lines[i]) == 0) + { + break; + } + } + + if (lines[i] == NULL) + { + /* allocate more memory if n+1 is a power of two */ + if (((i+1) & i) == 0) + { + lines = (char **)realloc(lines, (i+1)*2*sizeof(char *)); + } + + lines[i] = (char *)malloc(n+1); + strcpy(lines[i], line); + lines[i+1] = NULL; + } + } + + free(line); + + if (!feof(fp)) + { + free(lines); + return 0; + } + + return lines; +} + +/** + * Compare a file to "lines", return 0 if they are different + */ +static int vtkWrapHierarchy_CompareHierarchyFile(FILE *fp, char *lines[]) +{ + unsigned char *matched; + char *line; + size_t maxlen = 15; + size_t i, n; + + line = (char *)malloc(maxlen); + + for (i = 0; lines[i] != NULL; i++) { ; }; + matched = (unsigned char *)malloc(i); + memset(matched, 0, i); + + while (fgets(line, (int)maxlen, fp)) + { + n = strlen(line); + + /* if buffer not long enough, increase it */ + while (n == maxlen-1 && line[n-1] != '\n' && !feof(fp)) + { + maxlen *= 2; + line = (char *)realloc(line, maxlen); + if (!fgets(&line[n], (int)(maxlen-n), fp)) { break; } + n += strlen(&line[n]); + } + + while (n > 0 && isspace(line[n-1])) + { + n--; + } + line[n] = '\0'; + + if (line[0] == '\0') + { + continue; + } + + for (i = 0; lines[i] != NULL; i++) + { + if (strcmp(line, lines[i]) == 0) + { + break; + } + } + + if (lines[i] == NULL) + { + free(matched); + return 0; + } + + matched[i] = 1; + } + + for (i = 0; lines[i] != NULL; i++) + { + if (matched[i] == 0) + { + free(matched); + return 0; + } + } + + free(line); + free(matched); + + if (!feof(fp)) + { + return 0; + } + + return 1; +} + +/** + * Write "lines" to a hierarchy file + */ +static int vtkWrapHierarchy_WriteHierarchyFile(FILE *fp, char *lines[]) +{ + size_t i; + + for (i = 0; lines[i] != NULL; i++) + { + if (fprintf(fp, "%s\n", lines[i]) < 0) + { + return 0; + } + } + + return 1; +} + +/** + * Try to parse a header file, print error and exit if fail + */ +static char **vtkWrapHierarchy_TryParseHeaderFile( + const char *file_name, const char *module_name, + const char *flags, char **lines) +{ + FILE *input_file; + + input_file = fopen(file_name, "r"); + + if (!input_file) + { + fprintf(stderr, "vtkWrapHierarchy: couldn't open file %s\n", + file_name); + exit(1); + } + + lines = vtkWrapHierarchy_ParseHeaderFile( + input_file, file_name, module_name, flags, lines); + + if (!lines) + { + fclose(input_file); + exit(1); + } + fclose(input_file); + + return lines; +} + +/** + * Try to read a file, print error and exit if fail + */ +static char **vtkWrapHierarchy_TryReadHierarchyFile( + const char *file_name, char **lines) +{ + FILE *input_file; + + input_file = fopen(file_name, "r"); + if (!input_file) + { + fprintf(stderr, "vtkWrapHierarchy: couldn't open file %s\n", + file_name); + exit(1); + } + + lines = vtkWrapHierarchy_ReadHierarchyFile(input_file, lines); + if (!lines) + { + fclose(input_file); + fprintf(stderr, "vtkWrapHierarchy: error reading file %s\n", + file_name); + exit(1); + } + fclose(input_file); + + return lines; +} + +/** + * Try to write a file, print error and exit if fail + */ +static int vtkWrapHierarchy_TryWriteHierarchyFile( + const char *file_name, char *lines[]) +{ + FILE *output_file; + int matched = 0; + + output_file = fopen(file_name, "r"); + if (output_file && vtkWrapHierarchy_CompareHierarchyFile(output_file, lines)) + { + matched = 1; + } + if (output_file) + { + fclose(output_file); + } + + if (!matched) + { + int tries = 1; + output_file = fopen(file_name, "w"); + while (!output_file && tries < 5) + { + /* There are two CMAKE_CUSTOM_COMMANDS for vtkWrapHierarchy, + * make sure they do not collide. */ + tries++; +#ifdef _WIN32 + Sleep(1000); +#else + sleep(1); +#endif + output_file = fopen(file_name, "r+"); + if (output_file && + vtkWrapHierarchy_CompareHierarchyFile(output_file, lines)) + { + /* if the contents match, no need to write it */ + fclose(output_file); + return 0; + } + if (output_file) + { + /* close and open in order to truncate the file */ + fclose(output_file); + output_file = fopen(file_name, "w"); + } + } + if (!output_file) + { + fprintf(stderr, "vtkWrapHierarchy: tried %i times to write %s\n", + tries, file_name); + exit(1); + } + if (!vtkWrapHierarchy_WriteHierarchyFile(output_file, lines)) + { + fclose(output_file); + fprintf(stderr, "vtkWrapHierarchy: error writing file %s\n", + file_name); + exit(1); + } + fclose(output_file); + } + + return 0; +} + +static int string_compare(const void *vp1, const void *vp2) +{ + return strcmp(*(const char **)vp1, *(const char **)vp2); +} + +int main(int argc, char *argv[]) +{ + int usage_error = 0; + char *output_filename = 0; + int i, argi; + size_t j, n; + char **lines = 0; + char **files = 0; + char *flags; + char *module_name; + char *option; + char *optionarg; + const char *optionargval; + + /* parse command-line options */ + for (argi = 1; argi < argc && argv[argi][0] == '-'; argi++) + { + if (strncmp(argv[argi], "-o", 2) == 0 || + strncmp(argv[argi], "-I", 2) == 0 || + strncmp(argv[argi], "-D", 2) == 0 || + strncmp(argv[argi], "-U", 2) == 0) + { + option = argv[argi]; + optionarg = &argv[argi][2]; + if (argv[argi][2] == '\0') + { + argi++; + if (argi >= argc || argv[argi][0] == '-') + { + usage_error = 1; + break; + } + optionarg = argv[argi]; + } + if (strncmp(option, "-o", 2) == 0) + { + output_filename = optionarg; + } + else if (strncmp(option, "-I", 2) == 0) + { + vtkParse_IncludeDirectory(optionarg); + } + else if (strncmp(option, "-D", 2) == 0) + { + optionargval = "1"; + j = 0; + while (optionarg[j] != '\0' && optionarg[j] != '=') { j++; } + if (optionarg[j] == '=') + { + optionargval = &optionarg[j+1]; + } + vtkParse_DefineMacro(optionarg, optionargval); + } + else if (strncmp(option, "-U", 2) == 0) + { + vtkParse_UndefineMacro(optionarg); + } + } + } + + if (usage_error || !output_filename || argc - argi < 1) + { + fprintf(stderr, + "Usage: %s -o output_file data_file [files_to_merge]\n", + argv[0]); + exit(1); + } + + /* read the data file */ + files = vtkWrapHierarchy_TryReadHierarchyFile(argv[argi++], files); + + /* read in all the prior files */ + while (argi < argc) + { + lines = vtkWrapHierarchy_TryReadHierarchyFile(argv[argi++], lines); + } + + /* merge the files listed in the data file */ + for (i = 0; files[i] != NULL; i++) + { + /* look for semicolon that marks the module name */ + module_name = files[i]; + while(*module_name != ';' && *module_name != '\0') { module_name++; }; + if (*module_name == ';') { *module_name++ = '\0'; } + + /* look for semicolon that marks start of flags */ + flags = module_name; + while(*flags != ';' && *flags != '\0') { flags++; }; + if (*flags == ';') { *flags++ = '\0'; } + + lines = vtkWrapHierarchy_TryParseHeaderFile( + files[i], module_name, flags, lines); + } + + /* sort the lines to ease lookups in the file */ + for (n = 0; lines[n]; n++) { ; }; + qsort(lines, n, sizeof(char *), &string_compare); + + /* write the file, if it has changed */ + vtkWrapHierarchy_TryWriteHierarchyFile(output_filename, lines); + + for (j = 0; j < n; j++) + { + free(lines[j]); + } + + free(files); + free(lines); + return 0; +} diff --git a/src/ParaView/vtkWrapText.c b/src/ParaView/vtkWrapText.c new file mode 100644 index 00000000..df65aba4 --- /dev/null +++ b/src/ParaView/vtkWrapText.c @@ -0,0 +1,988 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkWrapText.c + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +#include "vtkWrapText.h" +#include "vtkWrap.h" +#include +#include +#include +#include + +/* -------------------------------------------------------------------- */ +/* Convert special characters in a string into their escape codes + * so that the string can be quoted in a source file. The specified + * maxlen must be at least 32 chars, and should not be over 2047 since + * that is the maximum length of a string literal on some systems */ + +const char *vtkWrapText_QuoteString( + const char *comment, size_t maxlen) +{ + static char *result = 0; + static size_t oldmaxlen = 0; + size_t i, j, n; + + if (maxlen > oldmaxlen) + { + if (result) + { + free(result); + } + result = (char *)malloc((size_t)(maxlen+1)); + oldmaxlen = maxlen; + } + + if (comment == NULL) + { + return ""; + } + + j = 0; + + n = strlen(comment); + for (i = 0; i < n; i++) + { + if (comment[i] == '\"') + { + strcpy(&result[j],"\\\""); + j += 2; + } + else if (comment[i] == '\\') + { + strcpy(&result[j],"\\\\"); + j += 2; + } + else if (comment[i] == '\n') + { + strcpy(&result[j],"\\n"); + j += 2; + } + else if ((comment[i] & 0x80) != 0 || isprint(comment[i])) + { + // all characters in extended-ASCII set are printable. Some compilers (VS + // 2010, in debug mode) asserts when isprint() is passed a negative value. + // Hence, we simply skip the check. + result[j] = comment[i]; + j++; + } + else + { + sprintf(&result[j],"\\%3.3o",comment[i]); + j += 4; + } + if (j >= maxlen - 21) + { + sprintf(&result[j]," ...\\n [Truncated]\\n"); + j += (int)strlen(" ...\\n [Truncated]\\n"); + break; + } + } + result[j] = '\0'; + + return result; +} + +/* -------------------------------------------------------------------- */ +/* A simple string that grows as necessary. */ + +struct vtkWPString +{ + char *str; + size_t len; + size_t maxlen; +}; + +/* -- append ---------- */ +static void vtkWPString_Append( + struct vtkWPString *str, const char *text) +{ + size_t n = strlen(text); + + if (str->len + n + 1 > str->maxlen) + { + str->maxlen = (str->len + n + 1 + 2*str->maxlen); + str->str = (char *)realloc(str->str, str->maxlen); + } + + strncpy(&str->str[str->len], text, n); + str->len += n; + str->str[str->len] = '\0'; +} + +/* -- add a char ---------- */ +static void vtkWPString_PushChar( + struct vtkWPString *str, char c) +{ + if (str->len + 2 > str->maxlen) + { + str->maxlen = (str->len + 2 + 2*str->maxlen); + str->str = (char *)realloc(str->str, str->maxlen); + } + + str->str[str->len++] = c; + str->str[str->len] = '\0'; +} + +/* -- strip any of the given chars from the end ---------- */ +static void vtkWPString_Strip( + struct vtkWPString *str, const char *trailers) +{ + size_t k = str->len; + char *cp = str->str; + size_t j = 0; + size_t n; + + if (cp) + { + n = strlen(trailers); + + while (k > 0 && j < n) + { + for (j = 0; j < n; j++) + { + if (cp[k-1] == trailers[j]) + { + k--; + break; + } + } + } + + str->len = k; + str->str[k] = '\0'; + } +} + +/* -- Return the last char ---------- */ +static char vtkWPString_LastChar( + struct vtkWPString *str) +{ + if (str->str && str->len > 0) + { + return str->str[str->len-1]; + } + return '\0'; +} + +/* -- do a linebreak on a method declaration ---------- */ +static void vtkWPString_BreakSignatureLine( + struct vtkWPString *str, size_t *linestart, size_t indentation) +{ + size_t i = 0; + size_t m = 0; + size_t j = *linestart; + size_t l = str->len; + size_t k = str->len; + char *text = str->str; + char delim; + + if (!text) + { + return; + } + + while (l > j && text[l-1] != '\n' && text[l-1] != ',' && + text[l-1] != '(' && text[l-1] != ')') + { + /* treat each string as a unit */ + if (l > 4 && (text[l-1] == '\'' || text[l-1] == '\"')) + { + delim = text[l-1]; + l -= 2; + while (l > 3 && (text[l-1] != delim || text[l-3] == '\\')) + { + l--; + if (text[l-1] == '\\') + { + l--; + } + } + l -= 2; + } + else + { + l--; + } + } + + /* if none of these chars was found, split is impossible */ + if (text[l-1] != ',' && text[l-1] != '(' && + text[l-1] != ')' && text[l-1] != '\n') + { + j++; + } + + else + { + /* Append some chars to guarantee size */ + vtkWPString_PushChar(str, '\n'); + vtkWPString_PushChar(str, '\n'); + for (i = 0; i < indentation; i++) + { + vtkWPString_PushChar(str, ' '); + } + /* re-get the char pointer, it may have been reallocated */ + text = str->str; + + if (k > l) + { + m = 0; + while (m < indentation+2 && text[l+m] == ' ') + { + m++; + } + memmove(&text[l+indentation+2-m], &text[l], k-l); + k += indentation+2-m; + } + else + { + k += indentation+2; + } + text[l++] = '\\'; text[l++] = 'n'; + j = l; + for (i = 0; i < indentation; i++) + { + text[l++] = ' '; + } + } + + str->len = k; + + /* return the new line start position */ + *linestart = j; +} + +/* -- do a linebreak on regular text ---------- */ +static void vtkWPString_BreakCommentLine( + struct vtkWPString *str, size_t *linestart, size_t indent) +{ + size_t i = 0; + size_t j = *linestart; + size_t l = str->len; + char *text = str->str; + + if (!text) + { + return; + } + + /* try to break the line at a word */ + while (l > 0 && text[l-1] != ' ' && text[l-1] != '\n') + { + l--; + } + if (l > 0 && text[l-1] != '\n' && l-j > indent) + { + /* replace space with newline */ + text[l-1] = '\n'; + j = l; + + /* Append some chars to guarantee size */ + vtkWPString_PushChar(str, '\n'); + vtkWPString_PushChar(str, '\n'); + for (i = 0; i < indent; i++) + { + vtkWPString_PushChar(str, ' '); + } + /* re-get the char pointer, it may have been reallocated */ + text = str->str; + str->len -= indent+2; + + if (str->len > l && indent > 0) + { + memmove(&text[l+indent], &text[l], str->len-l); + memset(&text[l], ' ', indent); + str->len += indent; + } + } + else + { + /* long word, just split the word */ + vtkWPString_PushChar(str, '\n'); + j = str->len; + for (i = 0; i < indent; i++) + { + vtkWPString_PushChar(str, ' '); + } + } + + /* return the new line start position */ + *linestart = j; +} + +/* -------------------------------------------------------------------- */ +/* Format a signature to a 70 char linewidth and char limit */ +const char *vtkWrapText_FormatSignature( + const char *signature, size_t width, size_t maxlen) +{ + static struct vtkWPString staticString = { NULL, 0, 0 }; + struct vtkWPString *text; + size_t i, j, n; + const char *cp = signature; + char delim; + size_t lastSigStart = 0; + size_t sigCount = 0; + + text = &staticString; + text->len = 0; + + if (signature == 0) + { + return ""; + } + + i = 0; + j = 0; + + while (cp[i] != '\0') + { + while (text->len - j < width && cp[i] != '\n' && cp[i] != '\0') + { + /* escape quotes */ + if (cp[i] == '\"' || cp[i] == '\'') + { + delim = cp[i]; + vtkWPString_PushChar(text, '\\'); + vtkWPString_PushChar(text, cp[i++]); + while (cp[i] != delim && cp[i] != '\0') + { + if (cp[i] == '\\') + { + vtkWPString_PushChar(text, '\\'); + } + vtkWPString_PushChar(text, cp[i++]); + } + if (cp[i] == delim) + { + vtkWPString_PushChar(text, '\\'); + vtkWPString_PushChar(text, cp[i++]); + } + } + /* remove items that trail the closing parenthesis */ + else if (cp[i] == ')') + { + vtkWPString_PushChar(text, cp[i++]); + if (strncmp(&cp[i], " const", 6) == 0) + { + i += 6; + } + if (strncmp(&cp[i], " = 0", 4) == 0) + { + i += 4; + } + if (cp[i] == ';') + { + i++; + } + } + /* anything else */ + else + { + vtkWPString_PushChar(text, cp[i++]); + } + } + + /* break the line (try to break after a comma) */ + if (cp[i] != '\n' && cp[i] != '\0') + { + vtkWPString_BreakSignatureLine(text, &j, 4); + } + /* reached end of line: do next signature */ + else + { + vtkWPString_Strip(text, " \r\t"); + if (cp[i] != '\0') + { + sigCount++; + /* if sig count is even, check length against maxlen */ + if ((sigCount & 1) == 0) + { + n = strlen(text->str); + if (n >= maxlen) + { + break; + } + lastSigStart = n; + } + + i++; + vtkWPString_PushChar(text, '\\'); + vtkWPString_PushChar(text, 'n'); + } + /* mark the position of the start of the line */ + j = text->len; + } + } + + vtkWPString_Strip(text, " \r\t"); + + if (strlen(text->str) >= maxlen) + { + /* terminate before the current signature */ + text->str[lastSigStart] = '\0'; + } + + return text->str; +} + +/* -------------------------------------------------------------------- */ +/* Format a comment to a 70 char linewidth, in several steps: + * 1) remove html tags, convert

    and
    into breaks + * 2) remove doxygen tags like \em + * 3) remove extra whitespace (except paragraph breaks) + * 4) re-break the lines + */ + +const char *vtkWrapText_FormatComment( + const char *comment, size_t width) +{ + static struct vtkWPString staticString = { NULL, 0, 0 }; + struct vtkWPString *text; + const char *cp; + size_t i, j, l; + size_t indent = 0; + int nojoin = 0; + int start; + + text = &staticString; + text->len = 0; + + if (comment == 0) + { + return ""; + } + + i = 0; j = 0; l = 0; + start = 1; + cp = comment; + + /* skip any leading whitespace */ + while (cp[i] == '\n' || cp[i] == '\r' || + cp[i] == '\t' || cp[i] == ' ') + { + i++; + } + + while (cp[i] != '\0') + { + /* Add characters until the output line is complete */ + while (cp[i] != '\0' && text->len-j < width) + { + /* if the end of the line was found, see how next line begins */ + if (start) + { + /* eat the leading space */ + if (cp[i] == ' ') + { + i++; + } + + /* skip ahead to find any interesting first characters */ + l = i; + while (cp[l] == ' ' || cp[l] == '\t' || cp[l] == '\r') + { + l++; + } + + /* check for new section */ + if (cp[l] == '.' && strncmp(&cp[l], ".SECTION", 8) == 0) + { + vtkWPString_Strip(text, "\n"); + if (text->len > 0) + { + vtkWPString_PushChar(text, '\n'); + vtkWPString_PushChar(text, '\n'); + } + i = l+8; + while (cp[i] == '\r' || cp[i] == '\t' || cp[i] == ' ') + { + i++; + } + while (cp[i] != '\n' && cp[i] != '\0') + { + vtkWPString_PushChar(text, cp[i++]); + } + vtkWPString_Strip(text, " \t\r"); + + if (vtkWPString_LastChar(text) != ':') + { + vtkWPString_PushChar(text, ':'); + } + vtkWPString_PushChar(text, '\n'); + vtkWPString_PushChar(text, '\n'); + j = text->len; + indent = 0; + if (cp[i] == '\n') + { + i++; + } + start = 1; + continue; + } + + /* handle doxygen tags that appear at start of line */ + if (cp[l] == '\\' || cp[l] == '@') + { + if (strncmp(&cp[l+1], "brief", 5) == 0 || + strncmp(&cp[l+1], "short", 5) == 0 || + strncmp(&cp[l+1], "pre", 3) == 0 || + strncmp(&cp[l+1], "post", 4) == 0 || + strncmp(&cp[l+1], "param", 5) == 0 || + strncmp(&cp[l+1], "tparam", 6) == 0 || + strncmp(&cp[l+1], "cmdparam", 8) == 0 || + strncmp(&cp[l+1], "exception", 9) == 0 || + strncmp(&cp[l+1], "return", 6) == 0 || + strncmp(&cp[l+1], "li", 2) == 0) + { + nojoin = 2; + indent = 4; + if (text->len > 0 && vtkWPString_LastChar(text) != '\n') + { + vtkWPString_PushChar(text, '\n'); + } + j = text->len; + i = l; + } + } + + /* handle bullets and numbering */ + else if (cp[l] == '-' || cp[l] == '*' || cp[l] == '#' || + (cp[l] >= '0' && cp[l] <= '9' && + (cp[l+1] == ')' || cp[l+1] == '.') && cp[l+2] == ' ')) + { + indent = 0; + while (indent < 3 && cp[l+indent] != ' ') + { + indent++; + } + indent++; + if (text->len > 0 && vtkWPString_LastChar(text) != '\n') + { + vtkWPString_PushChar(text, '\n'); + } + j = text->len; + i = l; + } + + /* keep paragraph breaks */ + else if (cp[l] == '\n') + { + i = l+1; + vtkWPString_Strip(text, "\n"); + if (text->len > 0) + { + vtkWPString_PushChar(text, '\n'); + vtkWPString_PushChar(text, '\n'); + } + nojoin = 0; + indent = 0; + j = text->len; + start = 1; + continue; + } + + /* add newline if nojoin is not set */ + else if (nojoin || + (cp[i] == ' ' && !indent)) + { + if (nojoin == 2) + { + nojoin = 0; + indent = 0; + } + vtkWPString_PushChar(text, '\n'); + j = text->len; + } + + /* do line joining */ + else if (text->len > 0 && vtkWPString_LastChar(text) != '\n') + { + i = l; + vtkWPString_PushChar(text, ' '); + } + } + + /* handle quotes */ + if (cp[i] == '\"') + { + size_t q = i; + size_t r = text->len; + + /* try to keep the quote whole */ + vtkWPString_PushChar(text, cp[i++]); + while (cp[i] != '\"' && cp[i] != '\r' && + cp[i] != '\n' && cp[i] != '\0') + { + vtkWPString_PushChar(text, cp[i++]); + } + /* if line ended before quote did, then reset */ + if (cp[i] != '\"') + { + i = q; + text->len = r; + } + } + else if (cp[i] == '\'') + { + size_t q = i; + size_t r = text->len; + + /* try to keep the quote whole */ + vtkWPString_PushChar(text, cp[i++]); + while (cp[i] != '\'' && cp[i] != '\r' && + cp[i] != '\n' && cp[i] != '\0') + { + vtkWPString_PushChar(text, cp[i++]); + } + /* if line ended before quote did, then reset */ + if (cp[i] != '\'') + { + i = q; + text->len = r; + } + } + + /* handle simple html tags */ + else if (cp[i] == '<') + { + l = i+1; + if (cp[l] == '/') { l++; } + while ((cp[l] >= 'a' && cp[l] <= 'z') || + (cp[l] >= 'a' && cp[l] <= 'z')) { l++; } + if (cp[l] == '>') + { + if (cp[i+1] == 'p' || cp[i+1] == 'P' || + (cp[i+1] == 'b' && cp[i+2] == 'r') || + (cp[i+1] == 'B' && cp[i+2] == 'R')) + { + vtkWPString_Strip(text, " \n"); + vtkWPString_PushChar(text, '\n'); + vtkWPString_PushChar(text, '\n'); + j = text->len; + indent = 0; + } + i = l+1; + while (cp[i] == '\r' || cp[i] == '\t' || cp[i] == ' ') + { + i++; + } + } + } + else if (cp[i] == '\\' || cp[i] == '@') + { + /* handle simple doxygen tags */ + if (strncmp(&cp[i+1], "em ", 3) == 0) + { + i += 4; + } + else if (strncmp(&cp[i+1], "a ", 2) == 0 || + strncmp(&cp[i+1], "e ", 2) == 0 || + strncmp(&cp[i+1], "c ", 2) == 0 || + strncmp(&cp[i+1], "b ", 2) == 0 || + strncmp(&cp[i+1], "p ", 2) == 0 || + strncmp(&cp[i+1], "f$", 2) == 0 || + strncmp(&cp[i+1], "f[", 2) == 0 || + strncmp(&cp[i+1], "f]", 2) == 0) + { + if (i > 0 && cp[i-1] != ' ') + { + vtkWPString_PushChar(text, ' '); + } + if (cp[i+1] == 'f') + { + if (cp[i+2] == '$') + { + vtkWPString_PushChar(text, '$'); + } + else + { + vtkWPString_PushChar(text, '\\'); + vtkWPString_PushChar(text, cp[i+2]); + } + } + i += 3; + } + else if (cp[i+1] == '&' || cp[i+1] == '$' || cp[i+1] == '#' || + cp[i+1] == '<' || cp[i+1] == '>' || cp[i+1] == '%' || + cp[i+1] == '@' || cp[i+1] == '\\' || cp[i+1] == '\"') + { + i++; + } + else if (cp[i+1] == 'n') + { + vtkWPString_Strip(text, " \n"); + vtkWPString_PushChar(text, '\n'); + vtkWPString_PushChar(text, '\n'); + indent = 0; + i += 2; + j = text->len; + } + else if (strncmp(&cp[i+1], "code", 4) == 0) + { + nojoin = 1; + i += 5; + while (cp[i] == ' ' || cp[i] == '\r' || + cp[i] == '\t' || cp[i] == '\n') + { + i++; + } + } + else if (strncmp(&cp[i+1], "endcode", 7) == 0) + { + nojoin = 0; + i += 8; + l = i; + while (cp[l] == ' ' || cp[l] == '\t' || cp[l] == '\r') + { + l++; + } + if (cp[l] == '\n') + { + i = l; + vtkWPString_PushChar(text, '\n'); + j = text->len; + } + } + else if (strncmp(&cp[i+1], "verbatim", 8) == 0) + { + i += 9; + while (cp[i] != '\0' && ((cp[i] != '@' && cp[i] != '\\') || + strncmp(&cp[i+1], "endverbatim", 11) != 0)) + { + if (cp[i] != '\r') + { + vtkWPString_PushChar(text, cp[i]); + } + if (cp[i] == '\n') + { + j = text->len; + } + i++; + } + if (cp[i] != '\0') + { + i += 12; + } + } + } + + /* search for newline */ + start = 0; + l = i; + while (cp[l] == ' ' || cp[l] == '\t' || cp[l] == '\r') + { + l++; + } + if (cp[l] == '\n') + { + i = l+1; + start = 1; + } + + /* append */ + else if (cp[i] != '\0') + { + vtkWPString_PushChar(text, cp[i++]); + } + + } /* while (cp[i] != '\0' && text->len-j < width) */ + + if (cp[i] == '\0') + { + break; + } + + vtkWPString_BreakCommentLine(text, &j, indent); + } + + /* remove any trailing blank lines */ + vtkWPString_Strip(text, "\n"); + vtkWPString_PushChar(text, '\n'); + + return text->str; +} + +/* -------------------------------------------------------------------- */ +/* Create a signature for the python version of a method. */ + +static void vtkWrapText_PythonTypeSignature( + struct vtkWPString *result, const char *delims[2], ValueInfo *arg); + +static void vtkWrapText_PythonArraySignature( + struct vtkWPString *result, const char *classname, + const char *delims[2], int ndim, const char **dims); + +const char *vtkWrapText_PythonSignature( + FunctionInfo *currentFunction) +{ + /* string is intentionally not freed until the program exits */ + static struct vtkWPString staticString = { NULL, 0, 0 }; + struct vtkWPString *result; + ValueInfo *arg, *ret; + const char *parens[2] = { "(", ")" }; + const char *braces[2] = { "[", "]" }; + const char **delims; + int i, n; + + n = vtkWrap_CountWrappedArgs(currentFunction); + + result = &staticString; + result->len = 0; + + /* print out the name of the method */ + vtkWPString_Append(result, "V."); + vtkWPString_Append(result, currentFunction->Name); + + /* print the arg list */ + vtkWPString_Append(result, "("); + + for (i = 0; i < n; i++) + { + arg = currentFunction->Arguments[i]; + + if (i != 0) + { + vtkWPString_Append(result, ", "); + } + + delims = parens; + if (!vtkWrap_IsConst(arg) && + !vtkWrap_IsSetVectorMethod(currentFunction)) + { + delims = braces; + } + + vtkWrapText_PythonTypeSignature(result, delims, arg); + } + + vtkWPString_Append(result, ")"); + + /* if this is a void method, we are finished */ + /* otherwise, print "->" and the return type */ + ret = currentFunction->ReturnValue; + if (ret && (ret->Type & VTK_PARSE_UNQUALIFIED_TYPE) != VTK_PARSE_VOID) + { + vtkWPString_Append(result, " -> "); + + vtkWrapText_PythonTypeSignature(result, parens, ret); + } + + if (currentFunction->Signature) + { + vtkWPString_Append(result, "\nC++: "); + vtkWPString_Append(result, currentFunction->Signature); + } + + return result->str; +} + +static void vtkWrapText_PythonTypeSignature( + struct vtkWPString *result, const char *braces[2], ValueInfo *arg) +{ + char text[32]; + const char *dimension; + const char *classname = ""; + + if (vtkWrap_IsVoid(arg)) + { + classname = "void"; + } + else if (vtkWrap_IsObject(arg)) + { + classname = arg->Class; + } + else if (vtkWrap_IsFunction(arg)) + { + classname = "function"; + } + else if (vtkWrap_IsString(arg) || vtkWrap_IsCharPointer(arg)) + { + classname = "string"; + if ((arg->Type & VTK_PARSE_BASE_TYPE) == VTK_PARSE_UNICODE_STRING) + { + classname = "unicode"; + } + } + else if (vtkWrap_IsChar(arg)) + { + classname = "char"; + } + else if (vtkWrap_IsBool(arg)) + { + classname = "bool"; + } + else if (vtkWrap_IsRealNumber(arg)) + { + classname = "float"; + } + else if (vtkWrap_IsInteger(arg)) + { + classname = "int"; + } + + if (vtkWrap_IsArray(arg)) + { + if (arg->CountHint) + { + vtkWPString_Append(result, braces[0]); + vtkWPString_Append(result, classname); + vtkWPString_Append(result, ", ..."); + vtkWPString_Append(result, braces[1]); + } + else + { + sprintf(text, "%d", arg->Count); + dimension = text; + vtkWrapText_PythonArraySignature(result, classname, braces, + 1, &dimension); + } + } + else if (vtkWrap_IsNArray(arg)) + { + vtkWrapText_PythonArraySignature(result, classname, braces, + arg->NumberOfDimensions, arg->Dimensions); + } + else + { + vtkWPString_Append(result, classname); + } +} + +static void vtkWrapText_PythonArraySignature( + struct vtkWPString *result, const char *classname, + const char *braces[2], int ndim, const char **dims) +{ + int j, n; + + vtkWPString_Append(result, braces[0]); + n = (int)strtoul(dims[0], 0, 0); + if (ndim > 1) + { + for (j = 0; j < n; j++) + { + if (j != 0) { vtkWPString_Append(result, ", "); } + vtkWrapText_PythonArraySignature(result, classname, + braces, ndim-1, dims+1); + } + } + else + { + for (j = 0; j < n; j++) + { + if (j != 0) { vtkWPString_Append(result, ", "); } + vtkWPString_Append(result, classname); + } + } + vtkWPString_Append(result, braces[1]); +} diff --git a/src/ParaView/vtkWrapText.h b/src/ParaView/vtkWrapText.h new file mode 100644 index 00000000..bc3a7f15 --- /dev/null +++ b/src/ParaView/vtkWrapText.h @@ -0,0 +1,61 @@ +/*========================================================================= + + Program: Visualization Toolkit + Module: vtkWrapText.h + + Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen + All rights reserved. + See Copyright.txt or http://www.kitware.com/Copyright.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notice for more information. + +=========================================================================*/ + +/** + * vtkWrap provides useful functions for generating wrapping code. +*/ + +#ifndef VTK_WRAP_TEXT_H +#define VTK_WRAP_TEXT_H + +#include "vtkParse.h" +#include "vtkParseHierarchy.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Quote a string for inclusion in a C string literal. The "maxlen" + * should be set to a value between 32 and 2047. Values over 2047 + * will result in string literals too long for some compilers. If + * the string is truncated, a "..." will be appended. + */ +const char *vtkWrapText_QuoteString(const char *comment, size_t maxlen); + +/** + * Format a doxygen comment for plain text, and word-wrap at + * the specified width. A 70-char width is recommended. + */ +const char *vtkWrapText_FormatComment(const char *comment, size_t width); + +/** + * Format a method signature by applying word-wrap at the specified + * width and taking special care not to split any literals or names. + * A width of 70 chars is recommended. + */ +const char *vtkWrapText_FormatSignature( + const char *signature, size_t width, size_t maxlen); + +/** + * Produce a python signature for a method, for use in documentation. + */ +const char *vtkWrapText_PythonSignature(FunctionInfo *currentFunction); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/Plugins/CMakeLists.txt b/src/Plugins/CMakeLists.txt index fa4a18a7..d496de13 100755 --- a/src/Plugins/CMakeLists.txt +++ b/src/Plugins/CMakeLists.txt @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + PROJECT(SamplePlugins) CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5) IF(COMMAND CMAKE_POLICY) @@ -7,4 +26,14 @@ ENDIF(COMMAND CMAKE_POLICY) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) -SUBDIRS(Filter ToolBar View) +SUBDIRS( + #Filter + #ToolBar + MedReader + ParaMEDCorba + TableReader + NavigationMode + IntegrationPoints + ElevationSurface + ScaleVector +) diff --git a/src/Plugins/ElevationSurface/CMakeLists.txt b/src/Plugins/ElevationSurface/CMakeLists.txt new file mode 100644 index 00000000..f87dc201 --- /dev/null +++ b/src/Plugins/ElevationSurface/CMakeLists.txt @@ -0,0 +1,42 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +PROJECT(ElevationSurface) +cmake_minimum_required(VERSION 2.6) + +cmake_policy(SET CMP0003 NEW) + +FIND_PACKAGE(ParaView REQUIRED) +INCLUDE(${PARAVIEW_USE_FILE}) + +SET(SRCS + vtkElevationSurfaceFilter.cxx + ) + +ADD_PARAVIEW_PLUGIN(ElevationSurface "1.0" + SERVER_MANAGER_XML ElevationSurface.xml + GUI_RESOURCE_FILES ElevationSurfaceClient.xml + SERVER_MANAGER_SOURCES ${SRCS}) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION lib/paraview + LIBRARY DESTINATION lib/paraview + ARCHIVE DESTINATION lib/paraview + ) + diff --git a/src/Plugins/ElevationSurface/ElevationSurface.xml b/src/Plugins/ElevationSurface/ElevationSurface.xml new file mode 100644 index 00000000..2bfe615d --- /dev/null +++ b/src/Plugins/ElevationSurface/ElevationSurface.xml @@ -0,0 +1,93 @@ + + + + + + + "Create a point set with data at quadrature points." + + + + + + + + + + + + + + + + + + + Specifies the cell field used for the elevation surface. + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Plugins/ElevationSurface/ElevationSurfaceClient.xml b/src/Plugins/ElevationSurface/ElevationSurfaceClient.xml new file mode 100644 index 00000000..07204cbc --- /dev/null +++ b/src/Plugins/ElevationSurface/ElevationSurfaceClient.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.cxx b/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.cxx new file mode 100644 index 00000000..160b1909 --- /dev/null +++ b/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.cxx @@ -0,0 +1,363 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkElevationSurfaceFilter.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkObjectFactory.h" +#include "vtkElevationSurfaceFilter.h" +#include "vtkPolyData.h" +#include "vtkIdTypeArray.h" +#include "vtkPolyData.h" +#include "vtkUnstructuredGrid.h" +#include "vtkDemandDrivenPipeline.h" +#include "vtkStreamingDemandDrivenPipeline.h" +#include "vtkGenericCell.h" +#include "vtkSmartPointer.h" +#include "vtkPoints.h" +#include "vtkCellArray.h" +#include "vtkPointData.h" +#include "vtkCellData.h" +//#include "vtkDataSetSurfaceFilter.h" + +#include + +vtkCxxRevisionMacro(vtkElevationSurfaceFilter, "$Revision$"); +vtkStandardNewMacro(vtkElevationSurfaceFilter); + +vtkElevationSurfaceFilter::vtkElevationSurfaceFilter() +{ + this->SetNumberOfInputPorts(1); + this->SetNumberOfOutputPorts(1); + + this->ScaleFactor = 0.5; + this->Direction[0] = 0.0; + this->Direction[1] = 0.0; + this->Direction[2] = 1.0; + this->AutoDetectDirection = 1; +} + +vtkElevationSurfaceFilter::~vtkElevationSurfaceFilter() +{ +} + +//---------------------------------------------------------------------------- +int vtkElevationSurfaceFilter::ProcessRequest(vtkInformation* request, + vtkInformationVector** inputVector, + vtkInformationVector* outputVector) +{ + // generate the data + if(request->Has(vtkDemandDrivenPipeline::REQUEST_DATA())) + { + return this->RequestData(request, inputVector, outputVector); + } + + if(request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT())) + { + return this->RequestUpdateExtent(request, inputVector, outputVector); + } + + // execute information + if(request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION())) + { + return this->RequestInformation(request, inputVector, outputVector); + } + + return this->Superclass::ProcessRequest(request, inputVector, outputVector); +} + +//---------------------------------------------------------------------------- +int vtkElevationSurfaceFilter::FillOutputPortInformation( + int vtkNotUsed(port), vtkInformation* info) +{ + // now add our info + info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkUnstructuredGrid"); + return 1; +} + +//---------------------------------------------------------------------------- +int vtkElevationSurfaceFilter::FillInputPortInformation( + int vtkNotUsed(port), vtkInformation* info) +{ + info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPointSet"); + return 1; +} + +//---------------------------------------------------------------------------- +int vtkElevationSurfaceFilter::RequestUpdateExtent( + vtkInformation* vtkNotUsed(request), + vtkInformationVector** inputVector, + vtkInformationVector* vtkNotUsed(outputVector)) +{ + int numInputPorts = this->GetNumberOfInputPorts(); + for (int i=0; iGetNumberOfInputConnections(i); + for (int j=0; jGetInformationObject(j); + inputInfo->Set(vtkStreamingDemandDrivenPipeline::EXACT_EXTENT(), 1); + } + } + return 1; +} + +int vtkElevationSurfaceFilter::RequestInformation(vtkInformation *request, + vtkInformationVector **input, vtkInformationVector *output) +{ + return 1; +} + +int vtkElevationSurfaceFilter::RequestData(vtkInformation *request, + vtkInformationVector **input, vtkInformationVector *output) +{ + vtkPointSet *psIn = vtkPointSet::SafeDownCast( + input[0]->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + //vtkPolyData *psIn = vtkPolyData::SafeDownCast( + // input[0]->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + /*vtkSmartPointer surfaceFilter = vtkSmartPointer::New(); + surfaceFilter->SetInput(psIn); + vtkPolyData* psIn = vtkPolyData::SafeDownCast(surfaceFilter->GetOutput());*/ + + vtkUnstructuredGrid *usgOut = vtkUnstructuredGrid::SafeDownCast( + output->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkDataArray* array = this->GetInputArrayToProcess(0, input); + + if(psIn == NULL || array == NULL || usgOut == NULL + || array->GetNumberOfComponents() != 1) + { + vtkDebugMacro("vtkElevationSurfaceFilter no correctly configured"); + return 1; + } + + double dir[3]; + if(this->AutoDetectDirection) + { + this->ComputeDirection(psIn, dir); + } + else + { + dir[0] = this->Direction[0]; + dir[1] = this->Direction[1]; + dir[2] = this->Direction[2]; + } + + double len = dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]; + + if(len == 0) + { + dir[2] = 1; + len = 1.0; + } + + len = sqrt(len); + + dir[0] /= len; + dir[1] /= len; + dir[2] /= len; + + dir[0] *= this->GetScaleFactor(); + dir[1] *= this->GetScaleFactor(); + dir[2] *= this->GetScaleFactor(); + + usgOut->Allocate(psIn->GetNumberOfCells()); + + vtkSmartPointer newPts = vtkSmartPointer::New(); + usgOut->SetPoints(newPts); + + usgOut->GetPointData()->CopyAllocate(psIn->GetPointData(), + 2*psIn->GetNumberOfPoints()); + usgOut->GetCellData()->CopyAllocate(psIn->GetCellData(), + psIn->GetNumberOfCells()); + + vtkIdType ncell = psIn->GetNumberOfCells(); + vtkSmartPointer newIds = vtkSmartPointer::New(); + vtkSmartPointer polyhedronIds = vtkSmartPointer::New(); + vtkSmartPointer neighbors = vtkSmartPointer::New(); + for(vtkIdType cellId=0; cellId < ncell; cellId++) + { + vtkCell* cell = psIn->GetCell(cellId); + if(cell->GetCellDimension() != 2) + continue; + + unsigned char newCellType = VTK_EMPTY_CELL; + unsigned char oldCellType = cell->GetCellType(); + switch(oldCellType) + { + case VTK_TRIANGLE : + newCellType = VTK_WEDGE; + break; + case VTK_QUAD : + newCellType = VTK_HEXAHEDRON; + break; + case VTK_POLYGON : + newCellType = VTK_POLYHEDRON; + // default : add new cell types to extrude here + } + if(newCellType == VTK_EMPTY_CELL) + continue; + + double cellScalar = array->GetTuple1(cellId); + + vtkIdList* oldIds = cell->GetPointIds(); + int oldPtsNumber = oldIds->GetNumberOfIds(); + int newPtsNumber = oldPtsNumber * 2; + newIds->SetNumberOfIds(newPtsNumber); + double coords[VTK_CELL_SIZE*3]; + for(int ptid = 0; ptid < oldPtsNumber; ptid++) + { + psIn->GetPoint(oldIds->GetId(ptid), coords + 3*ptid); + } + for(int ptid = 0; ptid < oldPtsNumber; ptid++) + { + coords[(ptid+oldPtsNumber)*3+0] = coords[ptid*3+0] + cellScalar*dir[0]; + coords[(ptid+oldPtsNumber)*3+1] = coords[ptid*3+1] + cellScalar*dir[1]; + coords[(ptid+oldPtsNumber)*3+2] = coords[ptid*3+2] + cellScalar*dir[2]; + } + double minScalar; + bool minInitialized = false; + for(int ptid = 0; ptid < oldPtsNumber; ptid++) + { + neighbors->Initialize(); + psIn->GetPointCells(oldIds->GetId(ptid), neighbors); + for(int neiCellIt = 0; neiCellIt < neighbors->GetNumberOfIds(); neiCellIt++) + { + vtkIdType neigCellId = neighbors->GetId(neiCellIt); + if(neigCellId == cellId) + continue; + double neighborScalar = array->GetTuple1(neigCellId); + if(neighborScalar != 0.0) + { + if(!minInitialized) + minScalar = neighborScalar; + else + minScalar = (neighborScalar < minScalar ? neighborScalar : minScalar); + minInitialized = true; + } + } + if(!minInitialized) + minScalar = 0.0; + } + for(int ptid = 0; ptid < oldPtsNumber; ptid++) + { + if(cellScalar != 0) + { + coords[(ptid)*3+0] = coords[ptid*3+0] + minScalar*dir[0]; + coords[(ptid)*3+1] = coords[ptid*3+1] + minScalar*dir[1]; + coords[(ptid)*3+2] = coords[ptid*3+2] + minScalar*dir[2]; + } + else + { + coords[(ptid+oldPtsNumber)*3+0] = coords[ptid*3+0] + minScalar*dir[0]; + coords[(ptid+oldPtsNumber)*3+1] = coords[ptid*3+1] + minScalar*dir[1]; + coords[(ptid+oldPtsNumber)*3+2] = coords[ptid*3+2] + minScalar*dir[2]; + } + } + for(int ptid=0; ptidInsertNextPoint(coords + 3*ptid); + newIds->SetId(ptid, newId); + usgOut->GetPointData()->CopyData(psIn->GetPointData(), + oldIds->GetId(ptid % oldPtsNumber), + newIds->GetId(ptid)); + } + vtkIdType newCellId; + if(newCellType == VTK_POLYHEDRON) + { + polyhedronIds->Initialize(); + // in the polyhedron case, I will generate a quad for each edge + // of the input, and two capping faces + polyhedronIds->InsertNextId(2+oldPtsNumber); + // insert the bottom face + polyhedronIds->InsertNextId(oldPtsNumber); + for(int ptid = 0; ptid < oldPtsNumber; ptid++) + { + polyhedronIds->InsertNextId(newIds->GetId(ptid)); + } + // insert the top face + polyhedronIds->InsertNextId(oldPtsNumber); + for(int ptid = oldPtsNumber; ptid < 2*oldPtsNumber; ptid++) + { + polyhedronIds->InsertNextId(newIds->GetId(ptid)); + } + // insert the bording quads + for(int qid = 0; qid < oldPtsNumber; qid++) + { + polyhedronIds->InsertNextId(4); + polyhedronIds->InsertNextId(newIds->GetId(qid)); + polyhedronIds->InsertNextId(newIds->GetId(qid+oldPtsNumber)); + polyhedronIds->InsertNextId(newIds->GetId(qid+((oldPtsNumber+1)%oldPtsNumber))); + polyhedronIds->InsertNextId(newIds->GetId((qid+1)%oldPtsNumber)); + } + newIds->Initialize(); + for(int jj=0; jjGetNumberOfIds(); jj++) + { + newIds->InsertNextId(polyhedronIds->GetId(jj)); + } + } + newCellId = usgOut->InsertNextCell(newCellType, newIds); + usgOut->GetCellData()->CopyData(psIn->GetCellData(), + cellId, + newCellId); + } + + usgOut->GetFieldData()->ShallowCopy(psIn->GetFieldData()); + + usgOut->Squeeze(); + + return 1; +} + +void vtkElevationSurfaceFilter::ComputeDirection(vtkPointSet* psIn, double *outDir) +{ + double tmp[2][3] = {{0, 0, 0}, {0, 0, 0}}; + outDir[0] = outDir[1] = outDir[2] = 0; + + vtkPoints* pts = psIn->GetPoints(); + vtkSmartPointer cell = vtkSmartPointer::New(); + + for(vtkIdType cellId = 0; cellId < psIn->GetNumberOfCells(); cellId++) + { + psIn->GetCell(cellId, cell); + if(cell->GetCellDimension() != 2) + continue; + + vtkIdList* ptIds = cell->GetPointIds(); + for(int i=0; iGetNumberOfIds(); i++) + { + vtkIdType firstId = ptIds->GetId(i); + vtkIdType secondId = ptIds->GetId((i+1)%ptIds->GetNumberOfIds()); + pts->GetPoint(firstId, tmp[0]); + pts->GetPoint(secondId, tmp[1]); + outDir[0] += tmp[0][1]*tmp[1][2] - tmp[0][2]*tmp[1][1]; + outDir[1] += tmp[0][2]*tmp[1][0] - tmp[0][0]*tmp[1][2]; + outDir[2] += tmp[0][0]*tmp[1][1] - tmp[0][1]*tmp[1][0]; + } + } +} + +void vtkElevationSurfaceFilter::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + + os << indent << "ScaleFactor : " << this->ScaleFactor << endl; +} diff --git a/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h b/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h new file mode 100644 index 00000000..761b87f7 --- /dev/null +++ b/src/Plugins/ElevationSurface/vtkElevationSurfaceFilter.h @@ -0,0 +1,92 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _vtkElevationSurfaceFilter_h +#define _vtkElevationSurfaceFilter_h + +#include "vtkAlgorithm.h" + +class vtkPointSet; + +class VTK_EXPORT vtkElevationSurfaceFilter: public vtkAlgorithm +{ +public: + static vtkElevationSurfaceFilter *New(); + vtkTypeRevisionMacro(vtkElevationSurfaceFilter,vtkAlgorithm); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description : + // This is the factor applied to shrink the cell before extracting + // the Elevation points. + // A value of 0 shrinks the cells to their center, and a value of 1 + // do not shrink the cell at all. + // default value 0.5 + vtkSetMacro(ScaleFactor,double); + vtkGetMacro(ScaleFactor,double); + + // Description: + // Set the direction of the deformation + vtkSetVector3Macro(Direction, double); + vtkGetVector3Macro(Direction, double); + + // Description: + // If this flag is != 0, the filter will attempt detect automatically the + // direction of the normal of the input. + // The direction is given by the sum of the normals of all input polygons. + // If there is no input poly, or if the sum is 0, it will revert to the + // Direction ivar + vtkBooleanMacro(AutoDetectDirection, int); + vtkSetMacro(AutoDetectDirection, int); + vtkGetMacro(AutoDetectDirection, int); + +protected: + vtkElevationSurfaceFilter(); + ~vtkElevationSurfaceFilter(); + + int FillInputPortInformation(int , vtkInformation* ); + int FillOutputPortInformation(int , vtkInformation* ); + + int ProcessRequest(vtkInformation* , + vtkInformationVector** , + vtkInformationVector* ); + + + int RequestData(vtkInformation *, + vtkInformationVector **, + vtkInformationVector *); + + int RequestInformation(vtkInformation *, + vtkInformationVector **, + vtkInformationVector *); + + int RequestUpdateExtent(vtkInformation* , + vtkInformationVector**, + vtkInformationVector*); + + virtual void ComputeDirection(vtkPointSet*, double *outDir); + + double ScaleFactor; + double Direction[3]; + int AutoDetectDirection; + +private: + vtkElevationSurfaceFilter(const vtkElevationSurfaceFilter&); + void operator =(const vtkElevationSurfaceFilter&); +}; +#endif diff --git a/src/Plugins/Filter/CMakeLists.txt b/src/Plugins/Filter/CMakeLists.txt index a5f02a5c..aa64c302 100755 --- a/src/Plugins/Filter/CMakeLists.txt +++ b/src/Plugins/Filter/CMakeLists.txt @@ -1,3 +1,21 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# # create a paraview plugin containing server manager xml and the server # manager classes to build diff --git a/src/Plugins/Filter/vtkMySampleFilter.cxx b/src/Plugins/Filter/vtkMySampleFilter.cxx index f16d1c23..461239e0 100644 --- a/src/Plugins/Filter/vtkMySampleFilter.cxx +++ b/src/Plugins/Filter/vtkMySampleFilter.cxx @@ -1,3 +1,22 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + #include "vtkMySampleFilter.h" #include diff --git a/src/Plugins/Filter/vtkMySampleFilter.h b/src/Plugins/Filter/vtkMySampleFilter.h index 94af1e24..393a4bcb 100644 --- a/src/Plugins/Filter/vtkMySampleFilter.h +++ b/src/Plugins/Filter/vtkMySampleFilter.h @@ -1,3 +1,22 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + #ifndef __vtkMySampleFilter_h #define __vtkMySampleFilter_h diff --git a/src/Plugins/IntegrationPoints/CMakeLists.txt b/src/Plugins/IntegrationPoints/CMakeLists.txt new file mode 100644 index 00000000..7f7f8401 --- /dev/null +++ b/src/Plugins/IntegrationPoints/CMakeLists.txt @@ -0,0 +1,45 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +PROJECT(ELNOFilter) +cmake_minimum_required(VERSION 2.6) + +cmake_policy(SET CMP0003 NEW) + + +FIND_PACKAGE(ParaView REQUIRED) +INCLUDE(${PARAVIEW_USE_FILE}) + +SET(SRCS + vtkELNOFilter.cxx + vtkELNOMeshFilter.cxx + vtkELNOSurfaceFilter.cxx + ) + +ADD_PARAVIEW_PLUGIN(ELNOFilter "1.0" + SERVER_MANAGER_XML ELNOFilter.xml + GUI_RESOURCE_FILES ELNOFilterClient.xml + SERVER_MANAGER_SOURCES ${SRCS}) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION lib/paraview + LIBRARY DESTINATION lib/paraview + ARCHIVE DESTINATION lib/paraview + ) + diff --git a/src/Plugins/IntegrationPoints/ELNOFilter.xml b/src/Plugins/IntegrationPoints/ELNOFilter.xml new file mode 100644 index 00000000..4d2322c0 --- /dev/null +++ b/src/Plugins/IntegrationPoints/ELNOFilter.xml @@ -0,0 +1,281 @@ + + + + + + + "Create a point set with data at quadrature points." + + + + + + + + + + + + + + + + + + + Specifies the offset array from which we generate ELNO points. + + + + + + + + + + + + + + + + + + + + + + + "Create a point set with data at quadrature points." + + + + + + + + + + + + + + + + + + + Specifies the offset array from which we generate Gauss points. + + + + + + + + + + + + + + + + + + + "Create a Mesh with ELNO values mapped at each + vertex." + + + + + + + + + + + + + + + + + + + Specifies the offset array from which we generate ELNO points. + + + + + + + + + + + + + + + + + + + "Extract the surface of a dataset with ELNO values." + + + + + + + + + + + + + + + + + + + Specifies the offset array from which we generate ELNO points. + + + + + + + + + + + + + + + + + + diff --git a/src/Plugins/IntegrationPoints/ELNOFilterClient.xml b/src/Plugins/IntegrationPoints/ELNOFilterClient.xml new file mode 100644 index 00000000..1376440c --- /dev/null +++ b/src/Plugins/IntegrationPoints/ELNOFilterClient.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/src/Plugins/IntegrationPoints/vtkELNOFilter.cxx b/src/Plugins/IntegrationPoints/vtkELNOFilter.cxx new file mode 100644 index 00000000..d10ff1fe --- /dev/null +++ b/src/Plugins/IntegrationPoints/vtkELNOFilter.cxx @@ -0,0 +1,128 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkELNOFilter.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkObjectFactory.h" +#include "vtkPolyDataAlgorithm.h" +#include "vtkPolyData.h" +#include "vtkIdTypeArray.h" +#include "vtkInformationQuadratureSchemeDefinitionVectorKey.h" +#include "vtkQuadratureSchemeDefinition.h" +#include "vtkUnstructuredGrid.h" + +vtkCxxRevisionMacro(vtkELNOFilter, "$Revision$"); +vtkStandardNewMacro(vtkELNOFilter); + +vtkELNOFilter::vtkELNOFilter() +{ + this->ShrinkFactor = 0.5; +} + +vtkELNOFilter::~vtkELNOFilter() +{ +} + +int vtkELNOFilter::RequestData(vtkInformation *request, + vtkInformationVector **input, vtkInformationVector *output) +{ + vtkUnstructuredGrid *usgIn = vtkUnstructuredGrid::SafeDownCast( + input[0]->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkPolyData *pdOut = vtkPolyData::SafeDownCast( + output->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkDataArray* array = this->GetInputArrayToProcess(0, input); + vtkIdTypeArray* offsets = vtkIdTypeArray::SafeDownCast( + this->GetInputArrayToProcess(0, input)); + + if(usgIn == NULL || offsets == NULL || pdOut == NULL) + { + vtkDebugMacro("vtkELNOFilter no correctly configured : offsets = " << offsets); + return 1; + } + + vtkInformation *info = offsets->GetInformation(); + vtkInformationQuadratureSchemeDefinitionVectorKey *key = + vtkQuadratureSchemeDefinition::DICTIONARY(); + if(!key->Has(info)) + { + vtkDebugMacro("Dictionary is not present in array " << offsets->GetName() << " " << offsets << " Aborting." ); + return 1; + } + + int res = this->Superclass::RequestData(request, input, output); + if(res == 0) + { + return 0; + } + + int dictSize = key->Size(info); + vtkQuadratureSchemeDefinition **dict = + new vtkQuadratureSchemeDefinition *[dictSize]; + key->GetRange(info, dict, 0, 0, dictSize); + + vtkIdType ncell = usgIn->GetNumberOfCells(); + vtkPoints *points = pdOut->GetPoints(); + vtkIdType start = 0; + for(vtkIdType cellId = 0; cellId < ncell; cellId++) + { + vtkIdType offset = offsets->GetValue(cellId); + int cellType = usgIn->GetCellType(cellId); + // a simple check to see if a scheme really exists for this cell type. + // should not happen if the cell type has not been modified. + if(dict[cellType] == NULL) + continue; + int np = dict[cellType]->GetNumberOfQuadraturePoints(); + double center[3] = {0, 0, 0}; + for(int id = start; id < start + np; id++) + { + double *position = points->GetPoint(id); + center[0] += position[0]; + center[1] += position[1]; + center[2] += position[2]; + } + center[0] /= np; + center[1] /= np; + center[2] /= np; + for(int id = start; id < start + np; id++) + { + double *position = points->GetPoint(id); + double newpos[3]; + newpos[0] = position[0] * this->ShrinkFactor + center[0] * (1 + - this->ShrinkFactor); + newpos[1] = position[1] * this->ShrinkFactor + center[1] * (1 + - this->ShrinkFactor); + newpos[2] = position[2] * this->ShrinkFactor + center[2] * (1 + - this->ShrinkFactor); + points->SetPoint(id, newpos); + } + start += np; + } + + return 1; +} + +void vtkELNOFilter::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + + os << indent << "ShrinkFactor : " << this->ShrinkFactor << endl; +} diff --git a/src/Plugins/IntegrationPoints/vtkELNOFilter.h b/src/Plugins/IntegrationPoints/vtkELNOFilter.h new file mode 100644 index 00000000..a48959f4 --- /dev/null +++ b/src/Plugins/IntegrationPoints/vtkELNOFilter.h @@ -0,0 +1,54 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _vtkELNOFilter_h +#define _vtkELNOFilter_h + +#include "vtkQuadraturePointsGenerator.h" + +class VTK_EXPORT vtkELNOFilter: public vtkQuadraturePointsGenerator +{ +public: + static vtkELNOFilter *New(); + vtkTypeRevisionMacro(vtkELNOFilter,vtkQuadraturePointsGenerator); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description : + // This is the factor applied to shrink the cell before extracting + // the ELNO points. + // A value of 0 shrinks the cells to their center, and a value of 1 + // do not shrink the cell at all. + // default value 0.5 + vtkSetMacro(ShrinkFactor,double); + vtkGetMacro(ShrinkFactor,double); + +protected: + vtkELNOFilter(); + ~vtkELNOFilter(); + + int RequestData(vtkInformation *, vtkInformationVector **, + vtkInformationVector *); + + double ShrinkFactor; + +private: + vtkELNOFilter(const vtkELNOFilter&); + void operator =(const vtkELNOFilter&); +}; +#endif diff --git a/src/Plugins/IntegrationPoints/vtkELNOMeshFilter.cxx b/src/Plugins/IntegrationPoints/vtkELNOMeshFilter.cxx new file mode 100644 index 00000000..bd43bdff --- /dev/null +++ b/src/Plugins/IntegrationPoints/vtkELNOMeshFilter.cxx @@ -0,0 +1,203 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkELNOMeshFilter.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkObjectFactory.h" +#include "vtkPolyDataAlgorithm.h" +#include "vtkPolyData.h" +#include "vtkIdTypeArray.h" +#include "vtkInformationQuadratureSchemeDefinitionVectorKey.h" +#include "vtkQuadratureSchemeDefinition.h" +#include "vtkUnstructuredGrid.h" +#include "vtkShrinkFilter.h" +#include "vtkSmartPointer.h" +#include "vtkPointData.h" +#include "vtkCellData.h" +#include "vtkIdList.h" + +vtkCxxRevisionMacro(vtkELNOMeshFilter, "$Revision$") +; +vtkStandardNewMacro(vtkELNOMeshFilter) +; + +vtkELNOMeshFilter::vtkELNOMeshFilter() +{ +} + +vtkELNOMeshFilter::~vtkELNOMeshFilter() +{ +} + +int vtkELNOMeshFilter::RequestData(vtkInformation *request, + vtkInformationVector **input, vtkInformationVector *output) +{ + vtkUnstructuredGrid *usgIn = vtkUnstructuredGrid::SafeDownCast( + input[0]->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkUnstructuredGrid *usgOut = vtkUnstructuredGrid::SafeDownCast( + output->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkIdTypeArray* usg_offsets = vtkIdTypeArray::SafeDownCast( + this->GetInputArrayToProcess(0, input)); + + if(usgIn == NULL || usg_offsets == NULL || usgOut == NULL) + { + vtkDebugMacro("vtkELNOMeshFilter no correctly configured : offsets = " << usg_offsets); + return 1; + } + + vtkIdTypeArray* a = vtkIdTypeArray::SafeDownCast( + usgIn->GetCellData()->GetArray(usg_offsets->GetName())); + + vtkInformationVector *inArrayVec = + this->Information->Get(INPUT_ARRAYS_TO_PROCESS()); + + // first shrink the input + vtkUnstructuredGrid* usgInClone = usgIn->NewInstance(); + + usgInClone->ShallowCopy(usgIn); + + vtkSmartPointer shrink = + vtkSmartPointer::New(); + shrink->SetInput(usgInClone); + shrink->SetShrinkFactor(0.9999); + shrink->Update(); + vtkUnstructuredGrid* shrinked = shrink->GetOutput(); + + usgInClone->Delete(); + + usgOut->ShallowCopy(shrinked); + + vtkIdTypeArray* offsets = vtkIdTypeArray::SafeDownCast( + shrinked->GetCellData()->GetArray(usg_offsets->GetName())); + + // now copy ELNO data. Start by verifying if it is possible to + // shallow copy the array. + vtkInformation *info = offsets->GetInformation(); + vtkInformationQuadratureSchemeDefinitionVectorKey *key = + vtkQuadratureSchemeDefinition::DICTIONARY(); + if(!key->Has(info)) + { + vtkDebugMacro("Dictionary is not present in array " << offsets->GetName() << " " << offsets << " Aborting." ); + return 0; + } + int dictSize = key->Size(info); + vtkQuadratureSchemeDefinition **dict = + new vtkQuadratureSchemeDefinition *[dictSize]; + key->GetRange(info, dict, 0, 0, dictSize); + + vtkIdType nVerts = shrinked->GetNumberOfPoints(); + vtkIdType ncell = usgIn->GetNumberOfCells(); + // first loop through all cells to check if a shallow copy is possible + bool shallowok = true; + vtkIdType previous = 0; + + for(vtkIdType cellId = 0; cellId < ncell; cellId++) + { + vtkIdType offset = offsets->GetValue(cellId); + if(offset != previous) + { + shallowok = false; + break; + } + int cellType = usgIn->GetCellType(cellId); + + if(dict[cellType] == NULL) + { + previous = offset; + } + else + { + previous = offset + dict[cellType]->GetNumberOfQuadraturePoints(); + } + } + if(previous != nVerts) + { + shallowok = false; + } + + vtkFieldData* fielddata = usgIn->GetFieldData(); + for(int index = 0; index < fielddata->GetNumberOfArrays(); index++) + { + vtkDataArray* data = fielddata->GetArray(index); + if(data == NULL) + continue; + + vtkInformation* info = data->GetInformation(); + const char* arrayOffsetName = info->Get( + vtkQuadratureSchemeDefinition::QUADRATURE_OFFSET_ARRAY_NAME()); + + if(arrayOffsetName == NULL || + strcmp(arrayOffsetName, offsets->GetName()) != 0) + { + shrinked->GetFieldData()->AddArray(data); + continue; + } + + if(shallowok) + { + usgOut->GetPointData()->AddArray(data); + } + else + { + vtkDataArray* newArray = data->NewInstance(); + newArray->SetName(data->GetName()); + usgOut->GetPointData()->AddArray(newArray); + newArray->SetNumberOfComponents(data->GetNumberOfComponents()); + newArray->SetNumberOfTuples(usgOut->GetNumberOfPoints()); + newArray->CopyComponentNames(data); + newArray->Delete(); + vtkIdList *ids = vtkIdList::New(); + + for(vtkIdType cellId = 0; cellId < ncell; cellId++) + { + vtkIdType offset = offsets->GetValue(cellId); + int cellType = shrinked->GetCellType(cellId); + shrinked->GetCellPoints(cellId, ids); + for(int id = 0; id < dict[cellType]->GetNumberOfQuadraturePoints(); id++) + { + const double * w = dict[cellType]->GetShapeFunctionWeights(id); + int j; + for(j = 0; j < dict[cellType]->GetNumberOfNodes(); j++) + { + if(w[j] == 1.0) + break; + } + if(j == dict[cellType]->GetNumberOfNodes()) + { + j = id; + } + newArray->SetTuple(ids->GetId(id), offset + j, data); + } + } + ids->FastDelete(); + } + } + + delete[] dict; + + return 1; +} + +void vtkELNOMeshFilter::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/IntegrationPoints/vtkELNOMeshFilter.h b/src/Plugins/IntegrationPoints/vtkELNOMeshFilter.h new file mode 100644 index 00000000..0839c377 --- /dev/null +++ b/src/Plugins/IntegrationPoints/vtkELNOMeshFilter.h @@ -0,0 +1,43 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _vtkELNOMeshFilter_h +#define _vtkELNOMeshFilter_h + +#include "vtkUnstructuredGridAlgorithm.h" + +class VTK_EXPORT vtkELNOMeshFilter: public vtkUnstructuredGridAlgorithm +{ +public: + static vtkELNOMeshFilter *New(); + vtkTypeRevisionMacro(vtkELNOMeshFilter,vtkUnstructuredGridAlgorithm); + void PrintSelf(ostream& os, vtkIndent indent); + +protected: + vtkELNOMeshFilter(); + ~vtkELNOMeshFilter(); + + int RequestData(vtkInformation *, vtkInformationVector **, + vtkInformationVector *); + +private: + vtkELNOMeshFilter(const vtkELNOMeshFilter&); + void operator =(const vtkELNOMeshFilter&); +}; +#endif diff --git a/src/Plugins/IntegrationPoints/vtkELNOSurfaceFilter.cxx b/src/Plugins/IntegrationPoints/vtkELNOSurfaceFilter.cxx new file mode 100644 index 00000000..158d8369 --- /dev/null +++ b/src/Plugins/IntegrationPoints/vtkELNOSurfaceFilter.cxx @@ -0,0 +1,211 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkELNOSurfaceFilter.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkObjectFactory.h" +#include "vtkPolyDataAlgorithm.h" +#include "vtkPolyData.h" +#include "vtkIdTypeArray.h" +#include "vtkInformationQuadratureSchemeDefinitionVectorKey.h" +#include "vtkQuadratureSchemeDefinition.h" +#include "vtkUnstructuredGrid.h" +#include "vtkPVGeometryFilter.h" +#include "vtkShrinkFilter.h" +#include "vtkSmartPointer.h" +#include "vtkPointData.h" +#include "vtkCellData.h" +#include "vtkIdList.h" + +vtkCxxRevisionMacro(vtkELNOSurfaceFilter, "$Revision$") +; +vtkStandardNewMacro(vtkELNOSurfaceFilter) +; + +vtkELNOSurfaceFilter::vtkELNOSurfaceFilter() +{ +} + +vtkELNOSurfaceFilter::~vtkELNOSurfaceFilter() +{ +} + +int vtkELNOSurfaceFilter::RequestData(vtkInformation *request, + vtkInformationVector **input, vtkInformationVector *output) +{ + vtkUnstructuredGrid *usgIn=vtkUnstructuredGrid::SafeDownCast( + input[0]->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkUnstructuredGrid *usgOut=vtkUnstructuredGrid::SafeDownCast( + output->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkIdTypeArray* usg_offsets=vtkIdTypeArray::SafeDownCast( + this->GetInputArrayToProcess(0, input)); + + if(usgIn==NULL||usg_offsets==NULL||usgOut==NULL) + { + vtkDebugMacro("vtkELNOSurfaceFilter no correctly configured : offsets = " << usg_offsets); + return 1; + } + + // first shrink the input + vtkUnstructuredGrid* usgInClone=usgIn->NewInstance(); + + usgInClone->ShallowCopy(usgIn); + + vtkSmartPointer geomFilter=vtkSmartPointer< + vtkPVGeometryFilter>::New(); + geomFilter->SetInput(usgInClone); + geomFilter->SetPassThroughCellIds(1); + geomFilter->SetPassThroughPointIds(1); + geomFilter->SetUseOutline(0); + geomFilter->Update(); + + vtkPolyData* surface=vtkPolyData::SafeDownCast(geomFilter->GetOutput()); + vtkIdTypeArray* originalCellIds=vtkIdTypeArray::SafeDownCast( + surface->GetCellData()->GetArray("vtkOriginalCellIds")); + vtkIdTypeArray* originalPointIds=vtkIdTypeArray::SafeDownCast( + surface->GetPointData()->GetArray("vtkOriginalPointIds")); + + vtkSmartPointer shrink= + vtkSmartPointer::New(); + shrink->SetInput(surface); + shrink->SetShrinkFactor(0.9999); + shrink->Update(); + + vtkUnstructuredGrid* shrinked=shrink->GetOutput(); + + usgInClone->Delete(); + + usgOut->ShallowCopy(shrinked); + + vtkIdTypeArray* offsets=vtkIdTypeArray::SafeDownCast( + shrinked->GetCellData()->GetArray(usg_offsets->GetName())); + + // now copy ELNO data. Start by verifying if it is possible to + // shallow copy the array. + vtkInformation *info=offsets->GetInformation(); + vtkInformationQuadratureSchemeDefinitionVectorKey *key= + vtkQuadratureSchemeDefinition::DICTIONARY(); + if(!key->Has(info)) + { + vtkDebugMacro("Dictionary is not present in array " << offsets->GetName() + << " " << offsets << " Aborting." ); + return 0; + } + int dictSize=key->Size(info); + vtkQuadratureSchemeDefinition **dict= + new vtkQuadratureSchemeDefinition *[dictSize]; + key->GetRange(info, dict, 0, 0, dictSize); + + vtkIdType ncell=shrinked->GetNumberOfCells(); + + vtkFieldData* fielddata=usgIn->GetFieldData(); + vtkIdList *ids=vtkIdList::New(); + vtkIdList *surfaceIds=vtkIdList::New(); + vtkIdList *originalIds=vtkIdList::New(); + for(int index=0; indexGetNumberOfArrays(); index++) + { + vtkDataArray* data=fielddata->GetArray(index); + if(data==NULL) + continue; + + vtkInformation* info=data->GetInformation(); + const char* arrayOffsetName=info->Get( + vtkQuadratureSchemeDefinition::QUADRATURE_OFFSET_ARRAY_NAME()); + + if(arrayOffsetName == NULL || + strcmp(arrayOffsetName, offsets->GetName())!=0) + { + usgOut->GetFieldData()->AddArray(data); + + continue; + } + + vtkDataArray* newArray=data->NewInstance(); + newArray->SetName(data->GetName()); + usgOut->GetPointData()->AddArray(newArray); + newArray->SetNumberOfComponents(data->GetNumberOfComponents()); + newArray->SetNumberOfTuples(usgOut->GetNumberOfPoints()); + newArray->CopyComponentNames(data); + newArray->Delete(); + + for(vtkIdType cellId=0; cellIdGetValue(cellId); + + vtkIdType originalCellId=originalCellIds->GetValue(cellId); + int originalCellType=usgIn->GetCellType(originalCellId); + + shrinked->GetCellPoints(cellId, ids); + surface->GetCellPoints(cellId, surfaceIds); + + for(int id=0; idGetNumberOfIds(); id++) + { + vtkIdType surfaceId=surfaceIds->GetId(id); + vtkIdType shrinkedId=ids->GetId(id); + vtkIdType originalPointId = originalPointIds->GetValue(surfaceId); + + usgIn->GetCellPoints(originalCellId, originalIds); + int originalLocalId=-1; + for(int li=0; liGetNumberOfIds(); li++) + { + if(originalPointId==originalIds->GetId(li)) + { + originalLocalId=li; + break; + } + } + if(originalLocalId==-1) + { + originalLocalId=0; + vtkErrorMacro("cannot find original id"); + } + + const double * w=dict[originalCellType]->GetShapeFunctionWeights( + originalLocalId); + int j; + for(j=0; jGetNumberOfNodes(); j++) + { + if(w[j]==1.0) + break; + } + if(j==dict[originalCellType]->GetNumberOfNodes()) + { + vtkErrorMacro("cannot find elno weigth."); + j=id; + } + newArray->SetTuple(shrinkedId, offset+j, data); + } + } + } + + ids->FastDelete(); + surfaceIds->FastDelete(); + originalIds->FastDelete(); + delete[] dict; + + return 1; +} + +void vtkELNOSurfaceFilter::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/IntegrationPoints/vtkELNOSurfaceFilter.h b/src/Plugins/IntegrationPoints/vtkELNOSurfaceFilter.h new file mode 100644 index 00000000..263b71d3 --- /dev/null +++ b/src/Plugins/IntegrationPoints/vtkELNOSurfaceFilter.h @@ -0,0 +1,43 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _vtkELNOSurfaceFilter_h +#define _vtkELNOSurfaceFilter_h + +#include "vtkUnstructuredGridAlgorithm.h" + +class VTK_EXPORT vtkELNOSurfaceFilter: public vtkUnstructuredGridAlgorithm +{ +public: + static vtkELNOSurfaceFilter *New(); + vtkTypeRevisionMacro(vtkELNOSurfaceFilter,vtkUnstructuredGridAlgorithm); + void PrintSelf(ostream& os, vtkIndent indent); + +protected: + vtkELNOSurfaceFilter(); + ~vtkELNOSurfaceFilter(); + + int RequestData(vtkInformation *, vtkInformationVector **, + vtkInformationVector *); + +private: + vtkELNOSurfaceFilter(const vtkELNOSurfaceFilter&); + void operator =(const vtkELNOSurfaceFilter&); +}; +#endif diff --git a/src/Plugins/MedReader/CMake/CTestCustom.ctest.in b/src/Plugins/MedReader/CMake/CTestCustom.ctest.in new file mode 100644 index 00000000..f5254335 --- /dev/null +++ b/src/Plugins/MedReader/CMake/CTestCustom.ctest.in @@ -0,0 +1,103 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +SET(CTEST_CUSTOM_WARNING_MATCH + ${CTEST_CUSTOM_WARNING_MATCH} + "{standard input}:[0-9][0-9]*: Warning: " + ) + +# Removing this because it somehow matches normal build output lines +# on several platforms. Perhaps there is a bug in the custom match +# support. +# +# SET(CTEST_CUSTOM_ERROR_MATCH +# ${CTEST_CUSTOM_ERROR_MATCH} +# "\\", line [0-9]+, in " +# ) + +IF("@CMAKE_SYSTEM@" MATCHES "OSF") + SET(CTEST_CUSTOM_WARNING_EXCEPTION + ${CTEST_CUSTOM_WARNING_EXCEPTION} + "vtkKWApplication" + "vtkKWObject" + ) +ENDIF("@CMAKE_SYSTEM@" MATCHES "OSF") + +SET(CTEST_CUSTOM_WARNING_EXCEPTION + ${CTEST_CUSTOM_WARNING_EXCEPTION} + "Utilities/vtktiff/" + "xtree.[0-9]+. : warning C4702: unreachable code" + "warning LNK4221" + "variable .var_args[2]*. is used before its value is set" + "jobserver unavailable" + "warning: \\(Long double usage is reported only once for each file" + "warning: To disable this warning use" + "warning: .+ might be clobbered by .longjmp. or .vfork." + "(ranlib|libtool):.*file: .+ has no symbols" + "could not be inlined" + "ld: warning prebinding disabled because \\((__TEXT|__DATA|__LINKEDIT) segment \\(address = 0x[a-f0-9]+ size = 0x[a-f0-9]+\\) of (.*) overlaps with (__LINKEDIT|__TEXT|__DATA) segment \\(address = 0x[a-f0-9]+ size = 0x[a-f0-9]+\\) of (.*)" + "ld: warning prebinding disabled because dependent library: (.*).dylib is not prebound" + + # MPI uses c++ but may have been built with a different c++ compiler. + # It seems to work anyway so let's ignore it to make it easier to + # test more compilers. + "ld: warning: libstdc.*, needed by .*, may conflict with libstdc.*" + + # Does *anyone* have an STL implementation that compiles without warnings...? + "cc-1116 CC: WARNING File = /usr/include/CC/stl_alloc.h, Line = 175" + + # vtkfreetype needs to be updated to get rid of warnings that occur during + # 64-bit compiles... for now, mask them out of dashboard results: + "vtkfreetype.*warning C4" + "vtkfreetype.*warning: dereferencing type-punned pointer" + + # vtknetcdf occasionally has warnings for things that are not a problem. + "vtknetcdf.*warning: dereferencing type-punned pointer" + + # Some VTK dashboards include building bits of Qt which produce lots of + # the following warnings when built with the MS compilers. Qt guys should + # fix their code. Until they do, keep the Qt chatter off the VTK dashboard + # results: + "include.Qt(Core|Gui).*warning C4127: conditional expression is constant" + + # Specifically for HP compiler, mask out + "Utilities.(vtkjpeg|vtksqlite).*warning.*more strictly aligned type" + "Filtering.vtkImageMultiple(Input|InputOutput)Filter.cxx.*warning.*more strictly aligned type" + "IO.vtkJPEGReader.cxx.*warning.*more strictly aligned type" + ) + +IF(APPLE) +SET(CTEST_CUSTOM_WARNING_EXCEPTION + ${CTEST_CUSTOM_WARNING_EXCEPTION} + "warning -.: directory name .* does not exist" + "OpenTransport.*warning.*is deprecated" + + # Somebody will have to get rid of these calls eventually (bug 4001) to + # eliminate these warnings. For now, mask them out of dashboard results: + "vtkCarbonRenderWindow.cxx.*warning: .(New|Diff|Equal|Dispose)Rgn. is deprecated" + ) +ENDIF(APPLE) + +SET(CTEST_CUSTOM_COVERAGE_EXCLUDE + ${CTEST_CUSTOM_COVERAGE_EXCLUDE} + "vtk.*TCLInit.cxx" + "vtk[^\\.]+(Java|Python|Tcl).cxx" + "Utilities.kwsys" + "Utilities.vtksys" + ) diff --git a/src/Plugins/MedReader/CMake/FindMED.cmake b/src/Plugins/MedReader/CMake/FindMED.cmake new file mode 100644 index 00000000..531520c8 --- /dev/null +++ b/src/Plugins/MedReader/CMake/FindMED.cmake @@ -0,0 +1,96 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +# - Find MED library +# Find the MED includes and library +# This module defines +# MED3HOME, a directory where MED was installed. This directory is used to help find trhe other values. +# MED_INCLUDE_DIR, where to find med.h +# MED_INCLUDE_DIRS, where to find med.h file, concatenated with other include dirs from HDF5 and MPI (if parallel) +# MED_LIBRARIES, libraries to link against to use MED. (including HDF5 and MPI if parallel) +# MED_FOUND, If false, do not try to use MED. +# also defined, but not for general use are +# MED_LIBRARY, the med library. +# MEDC_LIBRARY, the medC library + +SET(MED3HOME $ENV{MED3HOME} CACHE PATH "Path to the med install dir") + +IF(NOT MED3HOME) + FIND_PROGRAM(MDUMP mdump) + IF(MDUMP) + SET(MED3HOME ${MDUMP}) + GET_FILENAME_COMPONENT(MED3HOME ${MED3HOME} PATH) + GET_FILENAME_COMPONENT(MED3HOME ${MED3HOME} PATH) + ENDIF(MDUMP) +ENDIF(NOT MED3HOME) + +FIND_PATH(MED_INCLUDE_DIR med.h + HINTS + ${MED3HOME}/include + PATHS + /usr/local/include + /usr/include +) + +FIND_LIBRARY(MED_LIBRARY med + HINTS + ${MED_INCLUDE_DIR}/../lib + ${MED3HOME}/lib + PATHS + /usr/local/lib + /usr/lib +) + +get_filename_component(MED_LIBRARY_DIR ${MED_LIBRARY} PATH) + +FIND_LIBRARY(MEDC_LIBRARY medC + HINTS + ${MED_LIBRARY_DIR} + ${MED3HOME}/lib + PATHS + /usr/local/lib + /usr/lib +) + +IF(MED_INCLUDE_DIR) + IF(MED_LIBRARY) + IF(MEDC_LIBRARY) + SET(MED_LIBRARIES ${MED_LIBRARY} ${MEDC_LIBRARY} ) + SET( MED_FOUND "YES" ) + ENDIF(MEDC_LIBRARY) + ENDIF(MED_LIBRARY) +ENDIF(MED_INCLUDE_DIR) + +IF(${MED_FOUND}) + IF(WINDOWS) + SET(MED_LIBRARIES ${MED_LIBRARIES} ${HDF5_LIBS}) + SET(MED_INCLUDE_DIRS ${MED_INCLUDE_DIR} ${HDF5_INCLUDE_DIR}) + ELSE(WINDOWS) + FIND_PACKAGE(HDF5 REQUIRED) + SET(MED_LIBRARIES ${MED_LIBRARIES} ${HDF5_LIBRARIES}) + SET(MED_INCLUDE_DIRS ${MED_INCLUDE_DIR} ${HDF5_INCLUDE_DIRS}) + IF(${HDF5_IS_PARALLEL}) + FIND_PACKAGE(MPI REQUIRED) + SET(MED_LIBRARIES ${MED_LIBRARIES} ${MPI_LIBRARY} ${MPI_EXTRA_LIBRARY}) + SET(MED_INCLUDE_DIRS ${MED_INCLUDE_DIRS} ${MPI_INCLUDE_PATH}) + ENDIF(${HDF5_IS_PARALLEL}) + ENDIF(WINDOWS) +ENDIF(${MED_FOUND}) + +SET(MED_INCLUDE_DIR ${MED_INCLUDE_DIRS}) diff --git a/src/Plugins/MedReader/CMakeLists.txt b/src/Plugins/MedReader/CMakeLists.txt new file mode 100644 index 00000000..3e535a3e --- /dev/null +++ b/src/Plugins/MedReader/CMakeLists.txt @@ -0,0 +1,83 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +project(MedReader) + +cmake_minimum_required(VERSION 2.8) + +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + +SET(MED_READER_MAJOR_VERSION 3) +SET(MED_READER_MINOR_VERSION 1) +SET(MED_READER_BUILD_VERSION 0) +SET(MED_READER_VERSION + "${MED_READER_MAJOR_VERSION}.${MED_READER_MINOR_VERSION}.${MED_READER_BUILD_VERSION}") + +# +# Load the ParaView/VTK packages +# +set(MedReader_BUILD_ParaView_Plugin ON CACHE BOOL "Build the ParaView plugin") + +if(MedReader_BUILD_ParaView_Plugin) + FIND_PACKAGE(ParaView REQUIRED) + if(NOT ParaView_FOUND) + MESSAGE(FATAL_ERROR "Please locate ParaView." ) + ENDIF(NOT ParaView_FOUND) + INCLUDE(${PARAVIEW_USE_FILE}) +else(MedReader_BUILD_ParaView_Plugin) + FIND_PACKAGE(VTK REQUIRED) + if(NOT VTK_FOUND) + MESSAGE(FATAL_ERROR "Please locate VTK." ) + ENDIF(NOT VTK_FOUND) + INCLUDE(${VTK_USE_FILE}) +endif(MedReader_BUILD_ParaView_Plugin) + + +# Standard CMake option for building libraries shared or static by default. +OPTION(BUILD_SHARED_LIBS + "Build with shared libraries." + ${VTK_BUILD_SHARED_LIBS}) +# +# Find dependant Library +# +SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH} ) +FIND_PACKAGE(MED REQUIRED) +include_directories(${MED_INCLUDE_DIRS}) + +# +# Build the vtkMedReader +# +add_subdirectory(IO) + +# +# Build the parallel vtkPMedReader +# +set(MedReader_BUILD_PARALLEL ${VTK_USE_PARALLEL} CACHE BOOL "Build the Med Reader with parallel support.") + +# +# Build the ParaView Plugin +# +if(MedReader_BUILD_ParaView_Plugin) + add_subdirectory(ParaViewPlugin) +endif(MedReader_BUILD_ParaView_Plugin) + + + diff --git a/src/Plugins/MedReader/IO/CMakeLists.txt b/src/Plugins/MedReader/IO/CMakeLists.txt new file mode 100644 index 00000000..14d4738f --- /dev/null +++ b/src/Plugins/MedReader/IO/CMakeLists.txt @@ -0,0 +1,131 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +#test if we have not yet included ParaView and/or VTK configuration files +IF(NOT VTK_FOUND) + FIND_PACKAGE(VTK REQUIRED) + INCLUDE(${VTK_USE_FILE}) +ENDIF(NOT VTK_FOUND) + +set(MedReader_CLASSES + vtkMedReader + vtkMedDriver + vtkMedDriver30 + vtkMedFactory + vtkMedFile + vtkMedMesh + vtkMedGrid + vtkMedRegularGrid + vtkMedPolarGrid + vtkMedCartesianGrid + vtkMedCurvilinearGrid + vtkMedUnstructuredGrid + vtkMedFamily + vtkMedGroup + vtkMedField + vtkMedEntityArray + vtkMedProfile + vtkMedLocalization + vtkMedFieldOverEntity + vtkMedFieldStep + vtkMedUtilities + #vtkMedString + vtkMedIntArrayInternal + vtkMedIntArray + vtkMedFamilyOnEntity + vtkMedInterpolation + vtkMedFraction + vtkMedFilter + vtkMedFieldOnProfile + vtkExtractGroup + vtkMedSelection + vtkMedLink + vtkMedFamilyOnEntityOnProfile + vtkMedConstantAttribute + vtkMedVariableAttribute + vtkMedStructElement + vtkGenerateStructElement +) + +set(MedReader_SRCS) +set(MedReader_HDRS) + +foreach(class ${MedReader_CLASSES}) + set(MedReader_SRCS ${MedReader_SRCS} ${class}.cxx) + set(MedReader_HDRS ${MedReader_HDRS} ${class}.h) +endforeach(class) + +set_source_files_properties( + vtkMedGrid + vtkMedRegularGrid + vtkMedUtilities + PROPERTIES ABSTRACT 1 +) + +set_source_files_properties( + vtkMedIntArrayInternal + vtkMedUtilities + PROPERTIES WRAP_EXCLUDE 1 +) + +add_library(vtkMedReader ${MedReader_SRCS}) + +set(VTK_LIBS vtkIO) +if(${HDF5_IS_PARALLEL}) + set(VTK_LIBS ${VTK_LIBS} vtkParallel) +endif(${HDF5_IS_PARALLEL}) + +# Introducing selection for parallel compilation +CONFIGURE_FILE( ${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ) + +add_definitions( -I${CMAKE_CURRENT_BINARY_DIR} ) + +target_link_libraries(vtkMedReader ${MED_LIBRARIES} ${VTK_LIBS} ${VTK_PARALLEL} ${vtkPVServerManager}) + +set(MedReader_BUILD_Testing ${VTK_BUILD_TESTING} CACHE BOOL "Build tests for the MedReader filter") + +if(MedReader_BUILD_Testing) + add_subdirectory(Testing) +endif(MedReader_BUILD_Testing) + +install( + TARGETS vtkMedReader + RUNTIME DESTINATION lib/salome + LIBRARY DESTINATION lib/salome + ARCHIVE DESTINATION lib/salome + ) + +install(FILES ${MedReader_HDRS} DESTINATION include) + +# ----------------------------------------------------------------------------- +# This make it easy for other projects to get the list of files etc. in this +# kit. +# ----------------------------------------------------------------------------- +# needed by vtkExportKit.cmake +include(${VTK_CMAKE_DIR}/vtkExportKit.cmake) +IF(NOT VTK_INSTALL_NO_DEVELOPMENT) + STRING(REGEX REPLACE "^/" "" VTK_INSTALL_PACKAGE_DIR_CM24 "${VTK_INSTALL_PACKAGE_DIR}") +ENDIF(NOT VTK_INSTALL_NO_DEVELOPMENT) + +vtk_export_kit2( + "MedReader_IO" + "MEDREADER_IO" + ${CMAKE_CURRENT_BINARY_DIR} + "${MedReader_SRCS}" +) diff --git a/src/Plugins/MedReader/IO/Testing/CMakeLists.txt b/src/Plugins/MedReader/IO/Testing/CMakeLists.txt new file mode 100644 index 00000000..c63046d7 --- /dev/null +++ b/src/Plugins/MedReader/IO/Testing/CMakeLists.txt @@ -0,0 +1,20 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +add_subdirectory(Cxx) \ No newline at end of file diff --git a/src/Plugins/MedReader/IO/Testing/Cxx/CMakeLists.txt b/src/Plugins/MedReader/IO/Testing/Cxx/CMakeLists.txt new file mode 100644 index 00000000..baf374d8 --- /dev/null +++ b/src/Plugins/MedReader/IO/Testing/Cxx/CMakeLists.txt @@ -0,0 +1,77 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +include_directories(../..) + +set(TestMedReader_SRCS + TestMedReader.cxx +) + +set(TestMedPolyhedron_SRCS + TestMedPolyhedron.cxx +) + +set(TestMedReadPolyhedron_SRCS + TestMedReadPolyhedron.cxx +) + +set(TestMedDescendingPolyhedron_SRCS + TestMedDescendingPolyhedron.cxx +) + +set(TestMedReadDescendingPolyhedron_SRCS + TestMedReadDescendingPolyhedron.cxx +) + +set(TestMedWriteOcta12_SRCS + TestMedWriteOcta12.cxx +) + +set(TestMedParallelRead_SRCS + TestMedParallelRead.cxx +) + +set(TestMedParallelWrite_SRCS + TestMedParallelWrite.cxx +) + +add_executable(TestMedReader ${TestMedReader_SRCS}) +add_executable(TestMedPolyhedron ${TestMedPolyhedron_SRCS}) +add_executable(TestMedReadPolyhedron ${TestMedReadPolyhedron_SRCS}) +add_executable(TestMedDescendingPolyhedron ${TestMedDescendingPolyhedron_SRCS}) +add_executable(TestMedReadDescendingPolyhedron ${TestMedReadDescendingPolyhedron_SRCS}) +add_executable(TestMedWriteOcta12 ${TestMedWriteOcta12_SRCS}) +add_executable(TestMedParallelRead ${TestMedParallelRead_SRCS}) +add_executable(TestMedParallelWrite ${TestMedParallelWrite_SRCS}) + +#set(VTK_LIBS vtkMedReader vtkRendering) +#if(${HDF5_IS_PARALLEL}) +# set(VTK_LIBS ${VTK_LIBS} vtkParallel) +#endif(${HDF5_IS_PARALLEL}) +SET(VTK_LIBS ${VTK_LIBRARIES} vtkMedReader) + +target_link_libraries(TestMedReader ${VTK_LIBS} ${MED_LIBRARIES}) +target_link_libraries(TestMedPolyhedron ${MED_LIBRARIES}) +target_link_libraries(TestMedReadPolyhedron ${MED_LIBRARIES}) +target_link_libraries(TestMedDescendingPolyhedron ${MED_LIBRARIES}) +target_link_libraries(TestMedReadDescendingPolyhedron ${MED_LIBRARIES}) +target_link_libraries(TestMedWriteOcta12 ${MED_LIBRARIES}) +target_link_libraries(TestMedParallelRead ${MED_LIBRARIES}) +target_link_libraries(TestMedParallelWrite ${MED_LIBRARIES}) + diff --git a/src/Plugins/MedReader/IO/Testing/Cxx/TestMedDescendingPolyhedron.cxx b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedDescendingPolyhedron.cxx new file mode 100644 index 00000000..0cacf1d6 --- /dev/null +++ b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedDescendingPolyhedron.cxx @@ -0,0 +1,189 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +/* + * TestMedDescendingPolyhedron.cxx + * + * Created on: 3 mars 2011 + * Author: alejandro + */ + +#include +#define MESGERR 1 +#include + +#include + +int main (int argc, char **argv) { + med_idt fid; + const char meshname[MED_NAME_SIZE+1] = "3D unstructured mesh"; + const med_int spacedim = 3; + const med_int meshdim = 3; + /* 12345678901234561234567890123456 */ + const char axisname[3*MED_SNAME_SIZE+1] = "x y z "; + const char unitname[3*MED_SNAME_SIZE+1] = "cm cm cm "; + const med_int nnodes = 12; + const med_float coordinates[3 * 12] = + { 1.618, 1., 0., + -1.618, 1., 0., + 1.618, -1., 0., + -1.618, -1., 0., + 1., 0., 1.618, + 1., 0., -1.618, + -1., 0., 1.618, + -1., 0., -1.618, + 0., 1.618, 1., + 0., -1.618, 1., + 0., 1.618, -1., + 0., -1.618, -1. }; + const med_int nodeIndexSize = 20; + const med_int nodeindex[20] = { + MED_TRIA3, MED_TRIA3, MED_TRIA3, MED_TRIA3, MED_TRIA3, + MED_TRIA3, MED_TRIA3, MED_TRIA3, MED_TRIA3, MED_TRIA3, + MED_TRIA3, MED_TRIA3, MED_TRIA3, MED_TRIA3, MED_TRIA3, + MED_TRIA3, MED_TRIA3, MED_TRIA3, MED_TRIA3, MED_TRIA3 }; + const med_int faceIndexSize = 2; + /* connectivity : 1 icosahedron */ + const med_int faceindex[2] = { 1, 21 }; + + const med_int connectivity[20] = { 1, 2, 3, 4, 5, 6, 7, 8, 9,10, + 11,12,13,14,15,16,17,18,19,20 }; + + const med_int ntria3 = 20; + const med_int triaConnectivity[60] = { 1, 9, 5, + 1, 6, 11, + 3, 5, 10, + 3, 12, 6, + 2, 7, 9, + 2, 11, 8, + 4, 10, 7, + 4, 8, 12, + 1, 11, 9, + 2, 9, 11, + 3, 10, 12, + 4, 10, 12, + 5, 3, 1, + 6, 1, 3, + 7, 2, 4, + 8, 4, 2, + 9, 7, 5, + 10, 5, 7, + 11, 6, 8, + 12, 8, 6 }; + + /* open MED file */ + fid = MEDfileOpen("UsesCase_MEDmesh_17.med", + MED_ACC_CREAT); + if (fid < 0) { + MESSAGE("ERROR : file creation ..."); + return -1; + } + + /* write a comment in the file */ + if (MEDfileCommentWr(fid, + "A 3D unstructured mesh : 1 icosahedron") < 0) { + MESSAGE("ERROR : write file description ..."); + return -1; + } + + /* mesh creation : a 3D unstructured mesh */ + if (MEDmeshCr(fid, + meshname, + spacedim, + meshdim, + MED_UNSTRUCTURED_MESH, + "A 3D mesh with 1 icosahedron in DESCENDING connectivity", + "", + MED_SORT_DTIT, + MED_CARTESIAN, + axisname, + unitname) < 0) { + MESSAGE("ERROR : mesh creation ..."); + return -1; + } + + /* nodes coordinates in a cartesian axis in full interlace mode + (X1,Y1, X2,Y2, X3,Y3, ...) with no iteration and computation step + */ + if (MEDmeshNodeCoordinateWr(fid, + meshname, + MED_NO_DT, + MED_NO_IT, + MED_UNDEF_DT, + MED_FULL_INTERLACE, + nnodes, + coordinates) < 0) { + MESSAGE("ERROR : nodes coordinates ..."); + return -1; + } + + // cells connectiviy is defined in nodal mode + // it is later in the polyhedron thet the connectivity is descending + if (MEDmeshElementConnectivityWr(fid, + meshname, + MED_NO_DT, + MED_NO_IT, + 0.0, + MED_DESCENDING_FACE, + MED_TRIA3, + MED_NODAL, + MED_FULL_INTERLACE, + ntria3, + triaConnectivity) < 0) { + MESSAGE("ERROR : triangular cells connectivity ..."); + return -1; + } + + // cells connectiviy is defined in descending mode + // 1 icosahedron + if (MEDmeshPolyhedronWr(fid, + meshname, + MED_NO_DT, + MED_NO_IT, + MED_UNDEF_DT, + MED_CELL, + MED_DESCENDING, + faceIndexSize, + faceindex, + nodeIndexSize, + nodeindex, + connectivity) < 0) { + MESSAGE("ERROR : polyhedron connectivity ..."); + return -1; + } + + /* create family 0 : by default, all mesh entities family number is 0 */ + if (MEDfamilyCr(fid, + meshname, + "", + 0, + 0, + "") < 0) { + MESSAGE("ERROR : quadrangular cells connectivity ..."); + return -1; + } + + /* close MED file */ + if (MEDfileClose(fid) < 0) { + MESSAGE("ERROR : close file ..."); + return -1; + } + + return 0; +} diff --git a/src/Plugins/MedReader/IO/Testing/Cxx/TestMedParallelRead.cxx b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedParallelRead.cxx new file mode 100644 index 00000000..0d264f78 --- /dev/null +++ b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedParallelRead.cxx @@ -0,0 +1,110 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +/* + * TestMedParallelRead.cxx + * + * Created on: 20 avr. 2011 + * Author: alejandro + */ + +#define MAX(a,b) ((a) > (b) ? (a) : (b)) + +#define MED_HAVE_MPI + +#include +#define MESGERR 1 +#include "med_utils.h" + +#include +#include +#include + +#if TIME_WITH_SYS_TIME +# include +# include +#else +# if HAVE_SYS_TIME_H +# include +# else +# include +# endif +#endif + +int main (int argc, char **argv) +{ + med_err _ret=0; + med_idt _fid; + + int mpi_size, mpi_rank; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + + med_int _nbofentitiesfiltered=0; + med_int *_filterarray=NULL; + + MPI_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + + med_size _nbblocksperproc = 0; + int _nbofentities = 0; + int _nbofvaluesperentity = 0; + int _nbofconstituentpervalue = 0; + + printf("mpi_size = %03d\n", mpi_size); + + if (mpi_rank == 0 ) { + + struct tm *_tm ; + time_t _tt=time(0); + _tm = localtime(&_tt); + + srandom((*_tm).tm_sec * (*_tm).tm_min ); + _nbblocksperproc = 1 + (int) (mpi_size * (random() / (RAND_MAX + 1.0))); + _nbofentities = 1 + (int) (1000.0 * (random() / (RAND_MAX + 1.0))); + _nbofvaluesperentity = 1 + (int) (11.0 * (random() / (RAND_MAX + 1.0))); + _nbofconstituentpervalue = 1 + (int) (7.0 * (random() / (RAND_MAX + 1.0))); + } + + MPI_Bcast(&_nbblocksperproc , 1, MPI_LONG, 0, MPI_COMM_WORLD); + MPI_Bcast(&_nbofentities , 1, MPI_LONG, 0, MPI_COMM_WORLD); + MPI_Bcast(&_nbofvaluesperentity , 1, MPI_LONG, 0, MPI_COMM_WORLD); + MPI_Bcast(&_nbofconstituentpervalue , 1, MPI_LONG, 0, MPI_COMM_WORLD); + + printf( "NENT-%03d_NVAL-%03d_NCST-%03d_NBL-%03llu\n",_nbofentities,_nbofvaluesperentity, + _nbofconstituentpervalue,_nbblocksperproc); + + char _filename [255]=""; + sprintf(_filename,"/home/alejandro/work/Data-test-Med/tmp/depl.resu.med"); + /* SSCRUTE(_filename); */ + + /* Ouverture du fichier en mode parallel */ + if ((_fid = MEDparFileOpen(_filename, MED_ACC_RDONLY ,comm, info)) < 0){ + MED_ERR_(_ret,MED_ERR_OPEN,MED_ERR_FILE,_filename); + } + + if ( MEDfileClose( _fid ) < 0) { + MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_FILE,""); _ret = -1; + } + + /* MPI_Finalize must be called AFTER MEDclose which may use MPI calls */ + MPI_Finalize(); + +} diff --git a/src/Plugins/MedReader/IO/Testing/Cxx/TestMedParallelWrite.cxx b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedParallelWrite.cxx new file mode 100644 index 00000000..aebc039f --- /dev/null +++ b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedParallelWrite.cxx @@ -0,0 +1,343 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +/* + * TestMedParallelWrite.cxx + * + * Created on: 11 mai 2011 + * Author: alejandro + */ + +#define MED_HAVE_MPI + +#include +#define MESGERR 1 +#include "med_utils.h" + +#include +#include +#include + +int main (int argc, char **argv) +{ + const char meshname[MED_NAME_SIZE+1] = "2D unstructured mesh"; + const med_int spacedim = 2; + const med_int meshdim = 2; + /* 12345678901234561234567890123456 */ + const char axisname[2*MED_SNAME_SIZE+1] = "x y "; + const char unitname[2*MED_SNAME_SIZE+1] = "cm cm "; + med_float coordinates[2222]; + const med_int nnodes = 1111; + + med_int* quadconnectivity; + const med_int nquad4 = 1000; + + med_err _ret=-1; + + int mpi_size, mpi_rank; + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Info info = MPI_INFO_NULL; + + MPI_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD, &mpi_size); + MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank); + + med_idt fid; + char filename[255]="UsesCase_MEDmesh_parallel.med"; + /* SSCRUTE(_filename); */ + + if (mpi_rank == 0 ) { + printf("mpi_size = %03d\n", mpi_size); + + /* Ouverture du fichier en mode non-parallel */ + if ((fid = MEDfileOpen(filename, MED_ACC_CREAT)) < 0){ + MED_ERR_(_ret, MED_ERR_OPEN,MED_ERR_FILE, filename); + } + + /* write a comment in the file */ + if (MEDfileCommentWr(fid,"A 2D unstructured mesh : 15 nodes, 12 cells") < 0) { + MESSAGE("ERROR : write file description ..."); + } + + /* mesh creation : a 2D unstructured mesh */ + if (MEDmeshCr(fid, meshname, spacedim, meshdim, MED_UNSTRUCTURED_MESH, + "A 2D unstructured mesh","",MED_SORT_DTIT,MED_CARTESIAN, axisname, unitname) < 0) { + MESSAGE("ERROR : mesh creation ..."); + } + + /* + * Building the coordinates of a rectangle of 101 points in the Y-axis, + * and 11 in the X-axis + */ + for (int j=0; j<11; j++ ) + for (int i=0; i<101; i++ ) + { + coordinates[j*202+i*2] = j+1; + coordinates[j*202+i*2+1] = i+1; + } + + /* nodes coordinates in a Cartesian axis in full interlace mode + (X1,Y1, X2,Y2, X3,Y3, ...) with no iteration and computation step + */ + if (MEDmeshNodeCoordinateWr(fid, meshname, MED_NO_DT, MED_NO_IT, 0.0, + MED_FULL_INTERLACE, nnodes, coordinates) < 0) { + MESSAGE("ERROR : nodes coordinates ..."); + } + + if ( MEDfileClose( fid ) < 0) { + MED_ERR_(_ret,MED_ERR_CLOSE,MED_ERR_FILE,"");; + } + + MPI_Barrier(comm); + } /* End of process ZERO */ + else + { + MPI_Barrier(comm); + } + + /* Ouverture du fichier en mode parallel */ + if ((fid = MEDparFileOpen(filename, MED_ACC_RDWR ,comm, info)) < 0){ + MED_ERR_(_ret, MED_ERR_OPEN,MED_ERR_FILE, filename); + } + + med_int nbofentity = nquad4; + med_int nbofvaluesperentity = 1; + med_int nbofconstituentpervalue = 4; + med_int constituentselect = MED_ALL_CONSTITUENT; + med_switch_mode switchmode = MED_FULL_INTERLACE; + med_storage_mode storagemode = MED_COMPACT_STMODE; + const char *const profilename = MED_NO_PROFILE; + + /* + * Calculating block sizes + */ + + int block_size = (100/mpi_size)*10; + med_size start = block_size * mpi_rank + 1; + med_size stride = block_size; + med_size count = 1; + med_size blocksize = block_size; + med_size lastblocksize = (100 % mpi_size)*10; + if ((mpi_size == mpi_rank+1) && (lastblocksize != 0)) + { + blocksize += lastblocksize; + stride += lastblocksize; + } + lastblocksize = 0; + + printf("%03d: block_size = %03d\n", mpi_rank, block_size); + printf("%03d: start = %03d\n", mpi_rank, start); + printf("%03d: stride = %03d\n", mpi_rank, stride); + printf("%03d: count = %03d\n", mpi_rank, count); + printf("%03d: blocksize = %03d\n", mpi_rank, blocksize); + printf("%03d: lastblocksize = %03d\n", mpi_rank, lastblocksize); + med_filter filter = MED_FILTER_INIT; + + if ( MEDfilterBlockOfEntityCr( fid, + nbofentity, + nbofvaluesperentity, + nbofconstituentpervalue, + constituentselect, + switchmode, + storagemode, + profilename, + start, + stride, + count, + blocksize, + lastblocksize, + &filter ) < 0 ) + { + MESSAGE("ERROR : filter creation ..."); + } + + // Attention: there is blocksize and block_size and it does not + // represent the same quantity, in case we are in the last + // block they are different, if not it is the same + quadconnectivity = new med_int[blocksize*4]; + int shift = mpi_rank*block_size; + printf("%03d: mpi_rank*block_size = %03d\n", mpi_rank, shift); + printf("%03d: block_size = %03d\n", mpi_rank, block_size); + int base = shift + shift / 101; + int c = 0; + for (int i=0; i block_size * l - 1) && (l < mpi_size)) + { + l++; + } + familynumbers[i] = -l; + } + + if (MEDmeshEntityFamilyNumberWr(fid, meshname, MED_NO_DT, MED_NO_IT, + MED_CELL, MED_QUAD4, nquad4, familynumbers) < 0) { + MESSAGE("ERROR : nodes family numbers ..."); + } + + /* Write a Profile */ + const char profileName[MED_NAME_SIZE+1] = "QUAD4_PROFILE"; + const med_int profilesize = 9; + med_int profilearray[9] = {1, 3, 5, 7, 9, 11, 13, 15, 17}; + if (MEDprofileWr(fid, profileName, profilesize, profilearray ) < 0) { + MESSAGE("ERROR : nodes family numbers ..."); + } + + /* write localization for integration points */ + const char localizationName[MED_NAME_SIZE+1] = "QUAD4_INTEGRATION_POINTS_4"; + const med_float elementcoordinate[6] = {0.0, 0.0, 1.0, 0.0, 0.0,1.0}; + const med_float iPointCoordinate[8] = {1.0/5, 1.0/5, 3.0/5, 1.0/5, 1.0/5, 3.0/5, 1.0/3, 1.0/3}; + const med_float weight[4] = {1.0/8, 1.0/8, 1.0/8, 1.0/8}; + med_int spacedim = 2; + med_int nipoint = 4; + if (MEDlocalizationWr(fid, localizationName, MED_QUAD4, spacedim, + elementcoordinate, MED_FULL_INTERLACE, + nipoint, iPointCoordinate, weight, + MED_NO_INTERPOLATION, MED_NO_MESH_SUPPORT) < 0) { + MESSAGE("ERROR : create family of integration points ..."); + } + + /* Writing a scalar Field on the Quads right here */ + const char fieldname[MED_NAME_SIZE+1] = "TEMPERATURE_FIELD"; + const med_int ncomponent = 1; + const char componentname[MED_SNAME_SIZE+1] = "TEMPERATURE"; + const char componentunit[MED_SNAME_SIZE+1] = "C"; + + if (MEDfieldCr(fid, fieldname, MED_FLOAT64, + ncomponent, componentname, componentunit,"", + meshname) < 0) { + MESSAGE("ERROR : create field"); + } + + /* write values at cell (QUADS) centers */ + med_float quad4values[nquad4]; + for (int i=0; i +#define MESGERR 1 +#include + +#include + +int main (int argc, char **argv) { + med_idt fid; + const char meshname[MED_NAME_SIZE+1] = "3D unstructured mesh"; + const med_int spacedim = 3; + const med_int meshdim = 3; + /* 12345678901234561234567890123456 */ + const char axisname[3*MED_SNAME_SIZE+1] = "x y z "; + const char unitname[3*MED_SNAME_SIZE+1] = "cm cm cm "; + const med_int nnodes = 12; + const med_float coordinates[3 * 12] = + { 1.618, 1., 0., + -1.618, 1., 0., + 1.618, -1., 0., + -1.618, -1., 0., + 1., 0., 1.618, + 1., 0., -1.618, + -1., 0., 1.618, + -1., 0., -1.618, + 0., 1.618, 1., + 0., -1.618, 1., + 0., 0, 0., +// 0., 1.618, -1., + 0., -1.618, -1. }; + const med_int faceIndexSize = 2; + const med_int faceindex[2] = {1,22}; + const med_int nodeIndexSize = 21; + /* connectivity : 1 icosahedron */ + const med_int nodeindex[21] = { 1, 4, 7,10,13,16,19,22,25,28, + 31,34,37,40,43,46,49,52,55,58,61 }; + const med_int connectivity[60] = { 1, 9, 5, + 1, 6, 11, + 3, 5, 10, + 3, 12, 6, + 2, 7, 9, + 2, 11, 8, + 4, 10, 7, + 4, 8, 12, + 1, 11, 9, + 2, 9, 11, + 3, 10, 12, + 4, 10, 12, + 5, 3, 1, + 6, 1, 3, + 7, 2, 4, + 8, 4, 2, + 9, 7, 5, + 10, 5, 7, + 11, 6, 8, + 12, 8, 6 }; + + /* open MED file */ + fid = MEDfileOpen("UsesCase_MEDmesh_15.med", + MED_ACC_CREAT); + if (fid < 0) { + MESSAGE("ERROR : file creation ..."); + return -1; + } + + /* write a comment in the file */ + if (MEDfileCommentWr(fid, + "A 3D unstructured mesh : 1 icosahedron") < 0) { + MESSAGE("ERROR : write file description ..."); + return -1; + } + + /* mesh creation : a 3D unstructured mesh */ + if (MEDmeshCr(fid, + meshname, + spacedim, + meshdim, + MED_UNSTRUCTURED_MESH, + "A 3D mesh with 1 icosahedron", + "", + MED_SORT_DTIT, + MED_CARTESIAN, + axisname, + unitname) < 0) { + MESSAGE("ERROR : mesh creation ..."); + return -1; + } + + /* nodes coordinates in a cartesian axis in full interlace mode + (X1,Y1, X2,Y2, X3,Y3, ...) with no iteration and computation step + */ + if (MEDmeshNodeCoordinateWr(fid, + meshname, + MED_NO_DT, + MED_NO_IT, + MED_UNDEF_DT, + MED_FULL_INTERLACE, + nnodes, + coordinates) < 0) { + MESSAGE("ERROR : nodes coordinates ..."); + return -1; + } + + /* cells connectiviy is defined in nodal mode */ + /* 1 icosahedron */ + if (MEDmeshPolyhedronWr(fid, + meshname, + MED_NO_DT, + MED_NO_IT, + MED_UNDEF_DT, + MED_CELL, + MED_NODAL, + faceIndexSize, + faceindex, + nodeIndexSize, + nodeindex, + connectivity) < 0) { + MESSAGE("ERROR : polyhedron connectivity ..."); + return -1; + } + + /* create family 0 : by default, all mesh entities family number is 0 */ + if (MEDfamilyCr(fid, + meshname, + "", + 0, + 0, + "") < 0) { + MESSAGE("ERROR : quadrangular cells connectivity ..."); + return -1; + } + + /* close MED file */ + if (MEDfileClose(fid) < 0) { + MESSAGE("ERROR : close file ..."); + return -1; + } + + return 0; +} diff --git a/src/Plugins/MedReader/IO/Testing/Cxx/TestMedReadDescendingPolyhedron.cxx b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedReadDescendingPolyhedron.cxx new file mode 100644 index 00000000..873ad469 --- /dev/null +++ b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedReadDescendingPolyhedron.cxx @@ -0,0 +1,234 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +/* + * TestMedReadDescendingPolyhedron.cxx + * + * Created on: 3 mars 2011 + * Author: alejandro + */ + +#include +#define MESGERR 1 +#include + +#include + +int main (int argc, char **argv) { + med_idt fid; + const char meshname[MED_NAME_SIZE+1] = "3D unstructured mesh"; + char meshdescription[MED_COMMENT_SIZE+1]; + med_int meshdim; + med_int spacedim; + med_sorting_type sortingtype; + med_int nstep; + med_mesh_type meshtype; + med_axis_type axistype; + char axisname[3*MED_SNAME_SIZE+1]; + char unitname[3*MED_SNAME_SIZE+1]; + char dtunit[MED_SNAME_SIZE+1]; + med_float *coordinates = NULL; + med_int nnodes = 0; + med_int npoly = 0; + med_int indexsize; + med_int faceIndexSize; + med_int *index = NULL; + med_int *faceindex = NULL; + med_int *connectivity = NULL; + med_int connectivitysize; + med_int *triaconnectivity = NULL; + med_int ntria3 = 0; + med_bool coordinatechangement; + med_bool geotransformation; + int i; + int k,ind1,ind2; + int j,jind1,jind2; + + /* open MED file with READ ONLY access mode */ + fid = MEDfileOpen("./UsesCase_MEDmesh_17.med",MED_ACC_RDONLY); + if (fid < 0) { + MESSAGE("ERROR : open file in READ ONLY ACCESS mode ..."); + return -1; + } + + /* + * ... we know that the MED file has only one mesh, + * a real code working would check ... + */ + + /* read mesh informations : mesh dimension, space dimension ... */ + if (MEDmeshInfoByName(fid, meshname, &spacedim, &meshdim, &meshtype, meshdescription, + dtunit, &sortingtype, &nstep, &axistype, axisname, unitname) < 0) { + MESSAGE("ERROR : mesh info ..."); + return -1; + } + + /* read how many nodes in the mesh */ + if ((nnodes = MEDmeshnEntity(fid, meshname, MED_NO_DT, MED_NO_IT, MED_NODE, MED_POINT1, + MED_COORDINATE, MED_NO_CMODE,&coordinatechangement, + &geotransformation)) < 0) { + MESSAGE("ERROR : number of nodes ..."); + return -1; + } + + /* read how many triangular cells in the mesh */ + if ((ntria3 = MEDmeshnEntity(fid, meshname, MED_NO_DT, MED_NO_IT, MED_DESCENDING_FACE,MED_TRIA3, + MED_CONNECTIVITY, MED_NODAL,&coordinatechangement, + &geotransformation)) < 0) { + MESSAGE("ERROR : number of MED_TRIA3 ..."); + return -1; + } + ISCRUTE(ntria3); + + /* read cells connectivity in the mesh */ + if ((triaconnectivity = (med_int *) malloc(sizeof(med_int)*ntria3*3)) == NULL) { + MESSAGE("ERROR : memory allocation ..."); + return -1; + } + if (MEDmeshElementConnectivityRd(fid, meshname, MED_NO_DT, MED_NO_IT, MED_DESCENDING_FACE, + MED_TRIA3, MED_NODAL, MED_FULL_INTERLACE, triaconnectivity) < 0) { + MESSAGE("ERROR : MED_TRIA3 connectivity ..."); + return -1; + } + for (i=0;i> MED_POLYHEDRON "IFORMAT" : \n",i+1); + printf("---- Face Index ----- : [ "); + ind1 = *(index+i)-1; + ind2 = *(index+i+1)-1; + for (k=ind1;k +#define MESGERR 1 +#include + +#include + +int main (int argc, char **argv) { + med_idt fid; + const char meshname[MED_NAME_SIZE+1] = "3D unstructured mesh"; + char meshdescription[MED_COMMENT_SIZE+1]; + med_int meshdim; + med_int spacedim; + med_sorting_type sortingtype; + med_int nstep; + med_mesh_type meshtype; + med_axis_type axistype; + char axisname[3*MED_SNAME_SIZE+1]; + char unitname[3*MED_SNAME_SIZE+1]; + char dtunit[MED_SNAME_SIZE+1]; + med_float *coordinates = NULL; + med_int nnodes = 0; + med_int npoly = 0; + med_int indexsize; + med_int faceIndexSize; + med_int *index = NULL; + med_int *faceindex = NULL; + med_int *connectivity = NULL; + med_int connectivitysize; + med_bool coordinatechangement; + med_bool geotransformation; + int i; + int k,ind1,ind2; + int j, jind1,jind2; + + /* open MED file with READ ONLY access mode */ + fid = MEDfileOpen("./UsesCase_MEDmesh_15.med",MED_ACC_RDONLY); + if (fid < 0) { + MESSAGE("ERROR : open file in READ ONLY ACCESS mode ..."); + return -1; + } + + /* + * ... we know that the MED file has only one mesh, + * a real code working would check ... + */ + + /* read mesh informations : mesh dimension, space dimension ... */ + if (MEDmeshInfoByName(fid, meshname, &spacedim, &meshdim, &meshtype, meshdescription, + dtunit, &sortingtype, &nstep, &axistype, axisname, unitname) < 0) { + MESSAGE("ERROR : mesh info ..."); + return -1; + } + + /* read how many nodes in the mesh */ + if ((nnodes = MEDmeshnEntity(fid, meshname, MED_NO_DT, MED_NO_IT, MED_NODE, MED_POINT1, + MED_COORDINATE, MED_NO_CMODE,&coordinatechangement, + &geotransformation)) < 0) { + MESSAGE("ERROR : number of nodes ..."); + return -1; + } + + /* + * ... we know that we only have MED_POLYHEDRON cells in the mesh, + * a real code working would check all MED geometry cell types ... + */ + + /* How many polygon in the mesh in nodal connectivity mode */ + /* For the polygons, we get the size of array index */ + if ((indexsize = MEDmeshnEntity(fid,meshname,MED_NO_DT,MED_NO_IT, + MED_CELL,MED_POLYHEDRON,MED_INDEX_FACE,MED_NODAL, + &coordinatechangement, + &geotransformation)) < 0) { + MESSAGE("ERROR : read number of polyedron ..."); + return -1; + } + npoly = indexsize-1; + ISCRUTE(npoly); + + if ((faceIndexSize = MEDmeshnEntity(fid,meshname,MED_NO_DT,MED_NO_IT, + MED_CELL,MED_POLYHEDRON,MED_INDEX_NODE,MED_NODAL, + &coordinatechangement, + &geotransformation)) < 0) { + MESSAGE("ERROR : read number of polyedron ..."); + return -1; + } + ISCRUTE(faceIndexSize); + + /* how many nodes for the polyhedron connectivity ? */ + if ((connectivitysize = MEDmeshnEntity(fid,meshname,MED_NO_DT,MED_NO_IT, + MED_CELL,MED_POLYHEDRON,MED_CONNECTIVITY,MED_NODAL, + &coordinatechangement, + &geotransformation)) < 0) { + MESSAGE("ERROR : read connevity size ..."); + return -1; + } + ISCRUTE(connectivitysize); + + /* read mesh nodes coordinates */ + if ((coordinates = (med_float*) malloc(sizeof(med_float)*nnodes*spacedim)) == NULL) { + MESSAGE("ERROR : memory allocation ..."); + return -1; + } + + if (MEDmeshNodeCoordinateRd(fid, meshname, MED_NO_DT, MED_NO_IT, MED_FULL_INTERLACE, + coordinates) < 0) { + MESSAGE("ERROR : nodes coordinates ..."); + return -1; + } + for (i=0;i> MED_POLYHEDRON "IFORMAT" : \n",i+1); + printf("---- Face Index ----- : [ "); + ind1 = *(index+i)-1; + ind2 = *(index+i+1)-1; + for (k=ind1;kSetFileName(argv[1]); + reader->Update(); + + vtkCompositePolyDataMapper *mapper = vtkCompositePolyDataMapper::New(); + mapper->SetInputConnection(reader->GetOutputPort()); + + vtkActor *actor = vtkActor::New(); + actor->SetMapper(mapper); + + vtkRenderer *renderer = vtkRenderer::New(); + renderer->AddActor(actor); + renderer->SetBackground(0.5, 0.5, 0.5); + + vtkRenderWindow *renWin = vtkRenderWindow::New(); + renWin->AddRenderer(renderer); + + vtkRenderWindowInteractor *interactor = vtkRenderWindowInteractor::New(); + interactor->SetRenderWindow(renWin); + + renWin->SetSize(400,400); + renWin->Render(); + interactor->Initialize(); + renderer->ResetCamera(); + renWin->Render(); + renderer->ResetCamera(); + + int retVal = vtkRegressionTestImageThreshold(renWin,18); + if( retVal == vtkRegressionTester::DO_INTERACTOR) + { + interactor->Start(); + } + + reader->Delete(); + mapper->Delete(); + actor->Delete(); + renderer->Delete(); + renWin->Delete(); + interactor->Delete(); + + return !retVal; +} diff --git a/src/Plugins/MedReader/IO/Testing/Cxx/TestMedWriteOcta12.cxx b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedWriteOcta12.cxx new file mode 100644 index 00000000..e06e4fe7 --- /dev/null +++ b/src/Plugins/MedReader/IO/Testing/Cxx/TestMedWriteOcta12.cxx @@ -0,0 +1,149 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +/* + * TestMedWriteOcta12.cxx + * + * Created on: 17 mars 2011 + * Author: alejandro + */ + +#include +#define MESGERR 1 +#include + +#include + +int main (int argc, char **argv) { + med_idt fid; + const char meshname[MED_NAME_SIZE+1] = "3D unstructured mesh"; + const med_int spacedim = 3; + const med_int meshdim = 3; + /* 12345678901234561234567890123456 */ + const char axisname[3*MED_SNAME_SIZE+1] = "x y z "; + const char unitname[3*MED_SNAME_SIZE+1] = "cm cm cm "; + const med_int nnodes = 20; + const med_float coordinates[3 * 20] = + { 0., 0., 1., + 1., 0., 1., + 1.5, 1., 1., + 1., 2., 1., + 0., 2., 1., + -0.5, 1., 1., + 0., 0., 0., + 1., 0., 0., + 1.5, 1., 0., + 1., 2., 0., + 0., 2., 0., + -0.5, 1., 0., + 2.5, 1., 1., + 3., 2., 1., + 2.5, 2.5, 1., + 1.5, 2.5, 1., + 2.5, 1., 0., + 3., 2., 0., + 2.5, 2.5, 0., + 1.5, 2.5, 0. }; + + const med_int nOcta = 2; + const med_int octa12Connectivity[12*2] = + { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 4, 3, 17, 18, 19, 20, 10, 9 }; + + /* open MED file */ + fid = MEDfileOpen("UsesCase_MEDmesh_19.med", + MED_ACC_CREAT); + if (fid < 0) { + MESSAGE("ERROR : file creation ..."); + return -1; + } + + /* write a comment in the file */ + if (MEDfileCommentWr(fid, + "A 3D unstructured mesh : 2 Hexagonal Prisms") < 0) { + MESSAGE("ERROR : write file description ..."); + return -1; + } + + /* mesh creation : a 3D unstructured mesh */ + if (MEDmeshCr(fid, + meshname, + spacedim, + meshdim, + MED_UNSTRUCTURED_MESH, + "A 3D mesh with 1 hexagonal in NODAL connectivity", + "", + MED_SORT_DTIT, + MED_CARTESIAN, + axisname, + unitname) < 0) { + MESSAGE("ERROR : mesh creation ..."); + return -1; + } + + /* nodes coordinates in a cartesian axis in full interlace mode + (X1,Y1, X2,Y2, X3,Y3, ...) with no iteration and computation step + */ + if (MEDmeshNodeCoordinateWr(fid, + meshname, + MED_NO_DT, + MED_NO_IT, + MED_UNDEF_DT, + MED_FULL_INTERLACE, + nnodes, + coordinates) < 0) { + MESSAGE("ERROR : nodes coordinates ..."); + return -1; + } + + // cells connectiviy is defined in nodal mode + if (MEDmeshElementConnectivityWr(fid, + meshname, + MED_NO_DT, + MED_NO_IT, + 0.0, + MED_CELL, + MED_OCTA12, + MED_NODAL, + MED_FULL_INTERLACE, + nOcta, + octa12Connectivity) < 0) { + MESSAGE("ERROR : triangular cells connectivity ..."); + return -1; + } + + /* create family 0 : by default, all mesh entities family number is 0 */ + if (MEDfamilyCr(fid, + meshname, + "", + 0, + 0, + "") < 0) { + MESSAGE("ERROR : quadrangular cells connectivity ..."); + return -1; + } + + /* close MED file */ + if (MEDfileClose(fid) < 0) { + MESSAGE("ERROR : close file ..."); + return -1; + } + + return 0; +} diff --git a/src/Plugins/MedReader/IO/config.h.cmake b/src/Plugins/MedReader/IO/config.h.cmake new file mode 100644 index 00000000..f11deae1 --- /dev/null +++ b/src/Plugins/MedReader/IO/config.h.cmake @@ -0,0 +1,25 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + + #ifndef __CONFIG_H__ + #define __CONFIG_H__ + + #cmakedefine MedReader_BUILD_PARALLEL + + #endif // __CONFIG_H__ \ No newline at end of file diff --git a/src/Plugins/MedReader/IO/vtkExtractGroup.cxx b/src/Plugins/MedReader/IO/vtkExtractGroup.cxx new file mode 100644 index 00000000..4b7d4338 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkExtractGroup.cxx @@ -0,0 +1,425 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkExtractGroup.h" + +#include "vtkObjectFactory.h" +#include "vtkMutableDirectedGraph.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkInformationVector.h" +#include "vtkInformation.h" +#include "vtkDataArraySelection.h" +#include "vtkMedUtilities.h" +#include "vtkTimeStamp.h" +#include "vtkInEdgeIterator.h" +#include "vtkMedReader.h" +#include "vtkInformationDataObjectKey.h" +#include "vtkExecutive.h" +#include "vtkVariantArray.h" +#include "vtkStringArray.h" +#include "vtkUnsignedCharArray.h" +#include "vtkDataSetAttributes.h" +#include "vtkDemandDrivenPipeline.h" +#include "vtkCompositeDataIterator.h" + +#include +#include + +vtkCxxRevisionMacro(vtkExtractGroup, "$Revision$"); +vtkStandardNewMacro(vtkExtractGroup); + +vtkCxxSetObjectMacro(vtkExtractGroup, SIL, vtkMutableDirectedGraph); + +vtkExtractGroup::vtkExtractGroup() +{ + this->SIL=NULL; + this->Entities=vtkDataArraySelection::New(); + this->Families=vtkDataArraySelection::New(); + this->Groups=vtkDataArraySelection::New(); + this->PruneOutput=0; +} + +vtkExtractGroup::~vtkExtractGroup() +{ + this->Entities->Delete(); + this->Families->Delete(); + this->Groups->Delete(); +} + +int vtkExtractGroup::ModifyRequest(vtkInformation* request, int when) +{ + request->Set(vtkDemandDrivenPipeline::REQUEST_REGENERATE_INFORMATION(), 1); + return this->Superclass::ModifyRequest(request, when); +} + +int vtkExtractGroup::RequestInformation(vtkInformation *request, + vtkInformationVector **inputVector, vtkInformationVector *outputVector) +{ + vtkInformation* outInfo=outputVector->GetInformationObject(0); + + vtkInformation* inputInfo=inputVector[0]->GetInformationObject(0); + + vtkMutableDirectedGraph* old_SIL=this->GetSIL(); + + if(inputInfo->Has(vtkDataObject::SIL())) + { + this->SetSIL(vtkMutableDirectedGraph::SafeDownCast(inputInfo->Get( + vtkDataObject::SIL()))); + } + else + { + vtkMutableDirectedGraph* sil=vtkMutableDirectedGraph::New(); + this->BuildDefaultSIL(sil); + this->SetSIL(sil); + sil->Delete(); + } + + if(this->GetSIL()!=old_SIL||this->GetSIL()->GetMTime()>this->SILTime) + { + this->ClearSelections(); + this->SILTime.Modified(); + outInfo->Set(vtkDataObject::SIL(), this->GetSIL()); + } + + return 1; +} + +vtkIdType vtkExtractGroup::FindVertex(const char* name) +{ + vtkStringArray* names=vtkStringArray::SafeDownCast( + this->GetSIL()->GetVertexData()->GetAbstractArray("Names")); + + return names->LookupValue(name); +} + +void vtkExtractGroup::ClearSelections() +{ + this->Families->RemoveAllArrays(); + this->Entities->RemoveAllArrays(); + this->Groups->RemoveAllArrays(); +} + +void vtkExtractGroup::BuildDefaultSIL(vtkMutableDirectedGraph* sil) +{ + sil->Initialize(); + + vtkSmartPointer childEdge= + vtkSmartPointer::New(); + childEdge->InsertNextValue(0); + + vtkSmartPointer crossEdge= + vtkSmartPointer::New(); + crossEdge->InsertNextValue(1); + + // CrossEdge is an edge linking hierarchies. + vtkUnsignedCharArray* crossEdgesArray=vtkUnsignedCharArray::New(); + crossEdgesArray->SetName("CrossEdges"); + sil->GetEdgeData()->AddArray(crossEdgesArray); + crossEdgesArray->Delete(); + vtkstd::deque names; + + // Now build the hierarchy. + vtkIdType rootId=sil->AddVertex(); + names.push_back("SIL"); + + // Add a global entry to encode global names for the families + vtkIdType globalFamilyRoot=sil->AddChild(rootId, childEdge); + names.push_back("Families"); + + // Add a global entry to encode global names for the families + vtkIdType globalGroupRoot=sil->AddChild(rootId, childEdge); + names.push_back("Groups"); + + // Add the groups subtree + vtkIdType groupsRoot=sil->AddChild(rootId, childEdge); + names.push_back("GroupTree"); + + // Add the attributes subtree + vtkIdType attributesRoot=sil->AddChild(rootId, childEdge); + names.push_back("Attributes"); + + // Add a global entry to encode names for the cell types + vtkIdType globalEntityRoot=sil->AddChild(rootId, childEdge); + names.push_back("Entity"); + + // Add the cell types subtree + vtkIdType entityTypesRoot=sil->AddChild(rootId, childEdge); + names.push_back("EntityTree"); + + // This array is used to assign names to nodes. + vtkStringArray* namesArray=vtkStringArray::New(); + namesArray->SetName("Names"); + namesArray->SetNumberOfTuples(sil->GetNumberOfVertices()); + sil->GetVertexData()->AddArray(namesArray); + namesArray->Delete(); + vtkstd::deque::iterator iter; + vtkIdType cc; + for(cc=0, iter=names.begin(); iter!=names.end(); ++iter, ++cc) + { + namesArray->SetValue(cc, (*iter).c_str()); + } + +} + +int vtkExtractGroup::RequestData(vtkInformation *request, + vtkInformationVector **inputVector, vtkInformationVector *outputVector) + +{ + vtkInformation* inputInfo=inputVector[0]->GetInformationObject(0); + vtkMultiBlockDataSet* inmb=vtkMultiBlockDataSet::SafeDownCast(inputInfo->Get( + vtkDataObject::DATA_OBJECT())); + + if(inmb==NULL) + return 0; + + vtkMultiBlockDataSet* outmb=this->GetOutput(); + + outmb->CopyStructure(inmb); + + vtkCompositeDataIterator* iterator = inmb->NewIterator(); + iterator->SetVisitOnlyLeaves(true); + iterator->InitTraversal(); + while(!iterator->IsDoneWithTraversal()) + { + vtkDataObject* indo = iterator->GetCurrentDataObject(); + if(indo == NULL) + continue; + + if(indo->GetFieldData()->HasArray("BLOCK_NAME")) + { + + vtkStringArray* path = vtkStringArray::SafeDownCast( + indo->GetFieldData()->GetAbstractArray("BLOCK_NAME")); + + if(this->IsBlockSelected(path)) + { + vtkMultiBlockDataSet* parent = vtkMedUtilities::GetParent(outmb, path); + int nb = parent->GetNumberOfBlocks(); + parent->SetNumberOfBlocks(nb+1); + vtkDataObject *outdo = indo->NewInstance(); + outdo->ShallowCopy(indo); + parent->SetBlock(nb, outdo); + outdo->Delete(); + } + } + iterator->GoToNextItem(); + } + + if(PruneOutput) + { + this->PruneEmptyBlocks(outmb); + } + return 1; +} + +void vtkExtractGroup::SetGroupStatus(const char* key, int flag) +{ + vtkIdType index=this->Groups->GetArrayIndex(key); + if(index==-1) + { + index = this->Groups->AddArray(key); + this->Modified(); + } + int status=this->Groups->GetArraySetting(index); + if(status!=flag) + { + if(flag) + { + this->Groups->EnableArray(key); + } + else + { + this->Groups->DisableArray(key); + } + this->Modified(); + } + this->GroupSelectionTime.Modified(); +} + +void vtkExtractGroup::PruneEmptyBlocks(vtkMultiBlockDataSet* mb) +{ + if(mb==NULL) + return; + vtkIdType nn=0; + while(nnGetNumberOfBlocks()) + { + bool remove=false; + vtkDataObject* dataObj=mb->GetBlock(nn); + if(dataObj==NULL) + { + remove=true; + } + else + { + vtkMultiBlockDataSet* child=vtkMultiBlockDataSet::SafeDownCast(dataObj); + if(child!=NULL) + { + this->PruneEmptyBlocks(child); + if(child->GetNumberOfBlocks()==0) + { + remove=true; + } + } + } + if(remove) + { + mb->RemoveBlock(nn); + } + else + { + nn++; + } + } +} + +int vtkExtractGroup::IsBlockSelected(vtkStringArray* path) +{ + const char* meshName = (path->GetNumberOfValues()>0? + path->GetValue(0) : NULL); + const char* cellOrPoint = (path->GetNumberOfValues()>1? + path->GetValue(1) : NULL); + const char* familyName = (path->GetNumberOfValues()>2? + path->GetValue(2) : NULL); + + if(!this->IsFamilySelected(meshName, cellOrPoint, familyName)) + { + return 0; + } + + bool isOnPoint = (strcmp(cellOrPoint, vtkMedUtilities::OnPointName)==0); + + const char* entityName = (isOnPoint || path->GetNumberOfValues()<=3 ? NULL : + path->GetValue(3)); + + if(isOnPoint) + return true; + + return IsEntitySelected(entityName); + +} + +int vtkExtractGroup::IsEntitySelected(const char* entityKey) +{ + return this->Entities->GetArraySetting(entityKey); +} + +int vtkExtractGroup::IsFamilySelected(const char* meshName, + const char* pointOrCellKey, const char* familyName) +{ + if(this->FamilySelectionTime <= this->GroupSelectionTime) + { + this->SelectFamiliesFromGroups(); + } + + int + pointOrCell= (strcmp(vtkMedUtilities::OnPointName, pointOrCellKey)==0? + vtkMedUtilities::OnPoint + : vtkMedUtilities::OnCell); + + std::string name= + vtkMedUtilities::FamilyKey(meshName, pointOrCell, familyName); + + return this->Families->GetArraySetting(name.c_str()); +} + +void vtkExtractGroup::SelectFamiliesFromGroups() +{ + this->Families->DisableAllArrays(); + vtkStringArray* names=vtkStringArray::SafeDownCast( + this->GetSIL()->GetVertexData()->GetAbstractArray("Names")); + + for(int index = 0; index < this->Groups->GetNumberOfArrays(); index++) + { + if(this->Groups->GetArraySetting(index) == 0) + continue; + + const char* name = this->Groups->GetArrayName(index); + vtkIdType silindex = this->FindVertex(name); + + vtkInEdgeIterator* it = vtkInEdgeIterator::New(); + + this->GetSIL()->GetInEdges(silindex, it); + while(it->HasNext()) + { + vtkIdType famId = it->Next().Source; + vtkStdString famName = names->GetValue(famId); + if(strncmp(famName, "FAMILY", 6)==0) + { + this->Families->EnableArray(famName.c_str()); + } + } + it->Delete(); + } + + this->FamilySelectionTime.Modified(); +} + +void vtkExtractGroup::SetEntityStatus(const char* key, int flag) +{ + vtkIdType index=this->Entities->GetArrayIndex(key); + if(index==-1) + { + index = this->Entities->AddArray(key); + this->Modified(); + } + int status=this->Entities->GetArraySetting(index); + if(status!=flag) + { + if(flag) + { + this->Entities->EnableArray(key); + } + else + { + this->Entities->DisableArray(key); + } + this->Modified(); + } +} + +void vtkExtractGroup::SetFamilyStatus(const char* key, int flag) +{ + vtkIdType index=this->Families->GetArrayIndex(key); + if(index==-1) + { + return; + } + int status=this->Families->GetArraySetting(index); + if(status!=flag) + { + if(flag) + { + this->Families->EnableArray(key); + } + else + { + this->Families->DisableArray(key); + } + } +} + +int vtkExtractGroup::GetSILUpdateStamp() +{ + return this->SILTime; +} + +void vtkExtractGroup::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkExtractGroup.h b/src/Plugins/MedReader/IO/vtkExtractGroup.h new file mode 100644 index 00000000..fb3f7332 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkExtractGroup.h @@ -0,0 +1,134 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef vtkExtractGroup_h__ +#define vtkExtractGroup_h__ + +#include "vtkMultiBlockDataSetAlgorithm.h" +class vtkMutableDirectedGraph; +class vtkInformation; +class vtkInformationVector; +class vtkDataArraySelection; +class vtkTimeStamp; +class vtkStringArray; + +class VTK_EXPORT vtkExtractGroup: public vtkMultiBlockDataSetAlgorithm +{ +public: + static vtkExtractGroup* New(); +vtkTypeRevisionMacro(vtkExtractGroup, vtkMultiBlockDataSetAlgorithm) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Every time the SIL is updated a this will return a different value. + virtual int GetSILUpdateStamp(); + + // Description: + // use this method to enable/disable cell types + // the key is encoded with the vtkMedUtilities::CellTypeKey method + // which returns a string + // CELL_TYPE/MED_ENTITE_MAILLAGE/MED_GEOMETRIE_ELEMENT + virtual void SetEntityStatus(const char* key, int flag); + + // Description: + // use this method to enable/disable a family support + // the key is formatted by the vtkMedUtilities::FamilyKey method which + // returns a string + // GROUP/MESH_NAME/OnPoint/FAMILY_NAME or GROUP/MESH_NAME/OnCell/FAMILY_NAME + virtual void SetGroupStatus(const char* key, int flag); + + // Description : + // If set to 1, this filter will prune the empty parts in the output. + // If not, then empty datasets will be kept + vtkSetMacro(PruneOutput, int); + vtkGetMacro(PruneOutput, int); + + int ModifyRequest(vtkInformation* request, int when); + +protected: + vtkExtractGroup(); + ~vtkExtractGroup(); + + int RequestInformation(vtkInformation *request, + vtkInformationVector **inputVector, vtkInformationVector *outputVector); + + int RequestData(vtkInformation *request, vtkInformationVector **inputVector, + vtkInformationVector *outputVector); + + // Description : + // returns 1 if this cell type is to be passed through + int IsEntitySelected(const char*); + + // Description : + // returns 1 if this family is to be passed through + int IsFamilySelected(const char* meshName, const char* cellOrPoint, + const char* familyName); + + // Description : + // removes empty blocks from the vtkMultiBlockDataSet. + void PruneEmptyBlocks(vtkMultiBlockDataSet* mb); + + // Description: + // This SIL stores the structure of the mesh/groups/cell types + // that can be selected. + virtual void SetSIL(vtkMutableDirectedGraph*); + vtkGetObjectMacro(SIL, vtkMutableDirectedGraph); + + virtual void BuildDefaultSIL(vtkMutableDirectedGraph*); + + // Description: + // use this method to enable/disable a family support + // the key is formatted by the vtkMedUtilities::FamilyKey method which + // returns a string + // FAMILY/MESH_NAME/OnPoint/FAMILY_NAME or MESH_NAME/OnCell/FAMILY_NAME + virtual void SetFamilyStatus(const char* key, int flag); + + // Description: + // Update the Family status from te group status. + // The family status is lazily updated when GetFamilyStatus is called. + virtual void SelectFamiliesFromGroups(); + + // Description: + // returns true if the block described by the given information + // is selected. + virtual int IsBlockSelected(vtkStringArray* path); + + virtual void ClearSelections(); + + virtual vtkIdType FindVertex(const char* name); + + vtkMutableDirectedGraph* SIL; + + // Support selection + vtkDataArraySelection* Entities; + vtkDataArraySelection* Families; + vtkDataArraySelection* Groups; + + vtkTimeStamp SILTime; + vtkTimeStamp FamilySelectionTime; + vtkTimeStamp GroupSelectionTime; + + int PruneOutput; + +private: + vtkExtractGroup(const vtkExtractGroup&); + void operator=(const vtkExtractGroup&); // Not implemented. +}; + +#endif diff --git a/src/Plugins/MedReader/IO/vtkGenerateStructElement.cxx b/src/Plugins/MedReader/IO/vtkGenerateStructElement.cxx new file mode 100644 index 00000000..a59c850b --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkGenerateStructElement.cxx @@ -0,0 +1,212 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkGenerateStructElement.h" + +#include "vtkObjectFactory.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkUnstructuredGrid.h" +#include "vtkCellData.h" +#include "vtkIdTypeArray.h" + +#include "vtkMedUtilities.h" +#include "vtkMedStructElement.h" +#include "vtkMedConstantAttribute.h" +#include "vtkMedVariableAttribute.h" + +class vtkGenerateStructElementCache +{ +public : + vtkGenerateStructElementCache(vtkMedStructElement* strelem, vtkUnstructuredGrid* ug) + { + for(int attid = 0; attid < strelem->GetNumberOfConstantAttribute(); attid++) + { + vtkMedConstantAttribute* att = strelem->GetConstantAttribute(attid); + this->cstAttribute[att->GetName()] = att; + } + + for(int attid = 0; attid < strelem->GetNumberOfVariableAttribute(); attid++) + { + vtkMedVariableAttribute* att = strelem->GetVariableAttribute(attid); + vtkDataArray* array = ug->GetFieldData()->GetArray(att->GetName()); + if(array != NULL) + this->varAttribute[att->GetName()] = array; + } + } + + bool HasParameter(const char* name) + { + return this->cstAttribute.find(name) != this->cstAttribute.end() + || this->varAttribute.find(name) != this->varAttribute.end(); + } + + double GetParameter1(const char* name, vtkIdType id) + { + if(this->cstAttribute.find(name) != this->cstAttribute.end()) + { + vtkMedConstantAttribute* att = this->cstAttribute[name]; + return att->GetValues()->GetVariantValue(0).ToDouble(); + } + if(this->varAttribute.find(name) != this->varAttribute.end()) + { + vtkDataArray* array = this->varAttribute[name]; + return array->GetTuple1(id); + } + return 0.0; + } + +protected : + std::map cstAttribute; + std::map varAttribute; +}; + +vtkCxxRevisionMacro(vtkGenerateStructElement, "$Revision$"); +vtkStandardNewMacro(vtkGenerateStructElement); + +vtkGenerateStructElement::vtkGenerateStructElement() +{ + +} + +vtkGenerateStructElement::~vtkGenerateStructElement() +{ + +} + +int vtkGenerateStructElement::RequestData(vtkInformation* request, + vtkInformationVector** inputVector, + vtkInformationVector* outputVector) +{ + vtkInformation* outInfo=outputVector->GetInformationObject(0); + + vtkInformation* inputInfo=inputVector[0]->GetInformationObject(0); + + vtkUnstructuredGrid* inug = vtkUnstructuredGrid::SafeDownCast( + inputInfo->Get(vtkDataObject::DATA_OBJECT())); + + vtkUnstructuredGrid* outug = vtkUnstructuredGrid::SafeDownCast( + outInfo->Get(vtkDataObject::DATA_OBJECT())); + outug->Initialize(); + + vtkMedStructElement* strelem = vtkMedStructElement::SafeDownCast( + inug->GetInformation()->Get(vtkMedUtilities::STRUCT_ELEMENT())); + + if(strelem == NULL) + { + vtkDebugMacro("vtkGenerateStructElement needs a vtkMedStructElement information"); + return 1; + } + + vtkIdTypeArray* strelemindex = vtkIdTypeArray::SafeDownCast( + inug->GetCellData()->GetArray("STRUCT_ELEMENT_INDEX")); + if(strelemindex == NULL) + { + vtkDebugMacro("vtkGenerateStructElement needs some information on the structural elements"); + return 1; + } + + // loop over input cells. + // struct elements support are a set cells of same type following each other. + vtkIdType medid = -1; + vtkGenerateStructElementCache cache(strelem, inug); + + std::string name = strelem->GetName(); + + if(name == MED_BALL_NAME) + { + // sanity check : is the diameter defined? + if(!cache.HasParameter(MED_BALL_DIAMETER)) + { + vtkErrorMacro("MED_BALL elements need a diameter"); + return 1; + } + for(vtkIdType cellId = 0; cellId < inug->GetNumberOfCells(); cellId++) + { + vtkIdType ballMedId = strelemindex->GetValue(2*cellId); + double balldiam = this->GetParameter1(MED_BALL_DIAMETER, ballMedId, cache); + + //TODO + //this->GenerateBall(inug, cellId, balldiam, outug); + } + } + else if(name == MED_PARTICLE_NAME) + { + bool hasLabel = cache.HasParameter(MED_PARTICLE_LABEL); + for(vtkIdType cellId = 0; cellId < inug->GetNumberOfCells(); cellId++) + { + if(hasLabel) + { + vtkIdType particleMedId = strelemindex->GetValue(2*cellId); + double particlelabel = this->GetParameter1(MED_PARTICLE_LABEL, particleMedId, cache); + + //TODO + // this->GenerateParticle(inug, cellId, particlelabel, outug); + } + else + { + //TODO + // this->GenerateParticle(inug, cellId, outug); + } + } + } + else if(name == MED_BEAM_NAME) + { + // sanity check : is the diameter defined? + if(!cache.HasParameter(MED_BEAM_THICKNESS)) + { + vtkErrorMacro("MED_BEAM elements need a thickness"); + return 1; + } + for(vtkIdType cellId = 0; cellId < inug->GetNumberOfCells(); cellId++) + { + vtkIdType cellmedid = strelemindex->GetValue(2*cellId); + if(cellmedid != medid) + { + // this means that a new beam begins + medid = cellmedid; + double thickness = this->GetParameter1(MED_BEAM_THICKNESS, medid, cache); + + //TODO : generate a beam. + // rem : a beam can span several segments. + + } + } + } + else + { + vtkErrorMacro("structural elements of type " << name << " are not supported"); + } + + return 1; +} + +double vtkGenerateStructElement::GetParameter1(const char* name, + vtkIdType medid, + vtkGenerateStructElementCache& cache) +{ +#ifdef WIN32 //rnv : Avoid compliation error in the VS under windows. + return 0; +#endif +} + +void vtkGenerateStructElement::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkGenerateStructElement.h b/src/Plugins/MedReader/IO/vtkGenerateStructElement.h new file mode 100644 index 00000000..2477cc9d --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkGenerateStructElement.h @@ -0,0 +1,58 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkGenerateStructElement_h__ +#define __vtkGenerateStructElement_h__ + +#include "vtkUnstructuredGridAlgorithm.h" + +class vtkMedStructElement; +class vtkGenerateStructElementCache; + +class VTK_EXPORT vtkGenerateStructElement : public vtkUnstructuredGridAlgorithm +{ +public: + static vtkGenerateStructElement* New(); + vtkTypeRevisionMacro(vtkGenerateStructElement, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + +protected : + vtkGenerateStructElement(); + virtual ~vtkGenerateStructElement(); + + // Description: + // This is called by the superclass. + // This is the method you should override. + virtual int RequestData(vtkInformation* request, + vtkInformationVector** inputVector, + vtkInformationVector* outputVector); + + //BTX + virtual double GetParameter1(const char*, + vtkIdType, + vtkGenerateStructElementCache&); + //ETX + +private : + vtkGenerateStructElement(const vtkGenerateStructElement&);// Not implemented. + void operator=(const vtkGenerateStructElement&); // Not implemented. + +}; + +#endif //__vtkGenerateStructElement_h__ diff --git a/src/Plugins/MedReader/IO/vtkMed.h b/src/Plugins/MedReader/IO/vtkMed.h new file mode 100644 index 00000000..d86f2e32 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMed.h @@ -0,0 +1,45 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMed_h__ +#define __vtkMed_h__ + +#include "hdf5.h" +#include "config.h" + +extern "C" +{ +#include "med.h" +#define MESGERR 1 +#include "med_utils.h" + +#ifdef MED_HAVE_MPI +#ifdef MedReader_BUILD_PARALLEL +#define MedReader_HAVE_PARALLEL_INFRASTRUCTURE +#endif +#endif + +//#define MED_HAVE_MPI 1 +//#include "mpi.h" +#ifdef MedReader_HAVE_PARALLEL_INFRASTRUCTURE +#include "mpi.h" +#endif +} + +#endif //__vtkMed_h__ diff --git a/src/Plugins/MedReader/IO/vtkMedCartesianGrid.cxx b/src/Plugins/MedReader/IO/vtkMedCartesianGrid.cxx new file mode 100644 index 00000000..83bed8dd --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedCartesianGrid.cxx @@ -0,0 +1,38 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedCartesianGrid.h" + +#include "vtkObjectFactory.h" + +vtkCxxRevisionMacro(vtkMedCartesianGrid, "$Revision$") +vtkStandardNewMacro(vtkMedCartesianGrid) + +vtkMedCartesianGrid::vtkMedCartesianGrid() +{ +} + +vtkMedCartesianGrid::~vtkMedCartesianGrid() +{ +} + +void vtkMedCartesianGrid::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedCartesianGrid.h b/src/Plugins/MedReader/IO/vtkMedCartesianGrid.h new file mode 100644 index 00000000..aec09f0e --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedCartesianGrid.h @@ -0,0 +1,42 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedCartesianGrid_h_ +#define __vtkMedCartesianGrid_h_ + +#include "vtkMedRegularGrid.h" + +class VTK_EXPORT vtkMedCartesianGrid : public vtkMedRegularGrid +{ +public : + static vtkMedCartesianGrid* New(); + vtkTypeRevisionMacro(vtkMedCartesianGrid, vtkMedRegularGrid); + void PrintSelf(ostream& os, vtkIndent indent); + +protected: + vtkMedCartesianGrid(); + virtual ~vtkMedCartesianGrid(); + +private: + vtkMedCartesianGrid(const vtkMedCartesianGrid&); // Not implemented. + void operator=(const vtkMedCartesianGrid&); // Not implemented. + +}; + +#endif //__vtkMedCartesianGrid_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedConstantAttribute.cxx b/src/Plugins/MedReader/IO/vtkMedConstantAttribute.cxx new file mode 100644 index 00000000..01c5d68e --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedConstantAttribute.cxx @@ -0,0 +1,66 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedConstantAttribute.h" + +#include "vtkObjectFactory.h" +#include "vtkMedUtilities.h" + +#include "vtkAbstractArray.h" +#include "vtkMedStructElement.h" +#include "vtkMedProfile.h" + +#include +#include +#include +using namespace std; + +vtkCxxRevisionMacro(vtkMedConstantAttribute, "$Revision$") +vtkStandardNewMacro(vtkMedConstantAttribute); + +vtkCxxSetObjectMacro(vtkMedConstantAttribute, Values, vtkAbstractArray); +vtkCxxSetObjectMacro(vtkMedConstantAttribute, ParentStructElement, vtkMedStructElement); +vtkCxxSetObjectMacro(vtkMedConstantAttribute, Profile, vtkMedProfile); + +vtkMedConstantAttribute::vtkMedConstantAttribute() +{ + this->Name = NULL; + this->AttributeType = MED_ATT_UNDEF; + this->NumberOfComponent = 0; + this->SupportEntityType = MED_UNDEF_ENTITY_TYPE; + this->ProfileName = NULL; + this->ProfileSize = 0; + this->Values = NULL; + this->ParentStructElement = NULL; + this->Profile = NULL; +} + +vtkMedConstantAttribute::~vtkMedConstantAttribute() +{ + this->SetName(NULL); + this->SetProfileName(NULL); + this->SetParentStructElement(NULL); + this->SetValues(NULL); + this->SetProfile(NULL); +} + +void vtkMedConstantAttribute::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedConstantAttribute.h b/src/Plugins/MedReader/IO/vtkMedConstantAttribute.h new file mode 100644 index 00000000..d93f1172 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedConstantAttribute.h @@ -0,0 +1,109 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedConstantAttribute_h_ +#define __vtkMedConstantAttribute_h_ + +#include "vtkObject.h" +#include "vtkMed.h" + +class vtkAbstractArray; +class vtkMedStructElement; +class vtkMedProfile; + +class VTK_EXPORT vtkMedConstantAttribute : public vtkObject +{ +public : + static vtkMedConstantAttribute* New(); + vtkTypeRevisionMacro(vtkMedConstantAttribute, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the name of this attribute + vtkSetStringMacro(Name); + vtkGetStringMacro(Name); + + // Description: + // The iterator in the med file of this constant attribute + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // The Geometry type this structural elements lies on. + vtkSetMacro(AttributeType, med_attribute_type); + vtkGetMacro(AttributeType, med_attribute_type); + + // Description: + // The dimension of this structural elements model + vtkSetMacro(NumberOfComponent, med_int); + vtkGetMacro(NumberOfComponent, med_int); + + // Description: + // MED_CELL if the support mesh has any cell, MED_NODE otherwise + vtkSetMacro(SupportEntityType, med_entity_type); + vtkGetMacro(SupportEntityType, med_entity_type); + + // Description: + // The name of the profile if any, MED_NO_PROFILE by default + vtkSetStringMacro(ProfileName); + vtkGetStringMacro(ProfileName); + + // Description: + // The Size of the profile if any + vtkSetMacro(ProfileSize, med_int); + vtkGetMacro(ProfileSize, med_int); + + // Description: + // This store the values of this attribute + virtual void SetValues(vtkAbstractArray*); + vtkGetObjectMacro(Values, vtkAbstractArray); + + // Description: + // This is the pointer to the actual profile used by this attribute + virtual void SetProfile(vtkMedProfile*); + vtkGetObjectMacro(Profile, vtkMedProfile); + + // Description: + // The Structural element on which lies this attribute + virtual void SetParentStructElement(vtkMedStructElement*); + vtkGetObjectMacro(ParentStructElement, vtkMedStructElement); + +protected: + vtkMedConstantAttribute(); + virtual ~vtkMedConstantAttribute(); + + char *Name; + med_int MedIterator; + med_attribute_type AttributeType; + med_int NumberOfComponent; + med_entity_type SupportEntityType; + char* ProfileName; + med_int ProfileSize; + vtkAbstractArray* Values; + vtkMedProfile* Profile; + + vtkMedStructElement * ParentStructElement; + +private: + vtkMedConstantAttribute(const vtkMedConstantAttribute&); // Not implemented. + void operator=(const vtkMedConstantAttribute&); // Not implemented. + +}; + +#endif //__vtkMedConstantAttribute_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedCurvilinearGrid.cxx b/src/Plugins/MedReader/IO/vtkMedCurvilinearGrid.cxx new file mode 100644 index 00000000..5379c312 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedCurvilinearGrid.cxx @@ -0,0 +1,172 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedCurvilinearGrid.h" + +#include "vtkMedMesh.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" +#include "vtkMedFamilyOnEntityOnProfile.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedEntityArray.h" +#include "vtkMedProfile.h" +#include "vtkMedFamily.h" + +#include "vtkObjectFactory.h" +#include "vtkDataArray.h" +#include "vtkStructuredGrid.h" + +vtkCxxSetObjectMacro(vtkMedCurvilinearGrid, Coordinates, vtkDataArray); + +vtkCxxRevisionMacro(vtkMedCurvilinearGrid, "$Revision$") +vtkStandardNewMacro(vtkMedCurvilinearGrid) + +vtkMedCurvilinearGrid::vtkMedCurvilinearGrid() +{ + this->Coordinates = NULL; + this->NumberOfPoints = 0; +} + +vtkMedCurvilinearGrid::~vtkMedCurvilinearGrid() +{ + this->SetCoordinates(NULL); +} + +void vtkMedCurvilinearGrid::SetDimension(int dim) +{ + this->AxisSize.resize(dim); +} + +int vtkMedCurvilinearGrid::GetDimension() +{ + return this->AxisSize.size(); +} + +void vtkMedCurvilinearGrid::SetAxisSize(int axis, med_int size) +{ + if(axis < 0) + return; + + if(axis >= this->AxisSize.size()) + this->AxisSize.resize(axis+1); + + this->AxisSize[axis] = size; +} + +med_int vtkMedCurvilinearGrid::GetAxisSize(int axis) +{ + if(axis < 0 || axis >= this->AxisSize.size()) + return 0; + + return this->AxisSize[axis]; +} + +void vtkMedCurvilinearGrid::LoadCoordinates() +{ + vtkMedDriver* driver = this->GetParentMesh()->GetParentFile()->GetMedDriver(); + driver->LoadCoordinates(this); +} + +int vtkMedCurvilinearGrid::IsCoordinatesLoaded() +{ + return this->Coordinates != NULL && this->Coordinates->GetNumberOfTuples() + == this->NumberOfPoints; +} + +double* vtkMedCurvilinearGrid::GetCoordTuple(med_int index) +{ + return this->Coordinates->GetTuple(index); +} + +vtkDataSet* vtkMedCurvilinearGrid::CreateVTKDataSet( + vtkMedFamilyOnEntityOnProfile* foep) +{ + vtkStructuredGrid* vtkgrid = vtkStructuredGrid::New(); + + vtkPoints* points = vtkPoints::New(); + vtkgrid->SetPoints(points); + points->Delete(); + + vtkgrid->SetDimensions(this->GetAxisSize(0), + this->GetAxisSize(1), + this->GetAxisSize(2)); + + this->LoadCoordinates(); + + if(this->GetDimension() == 3) + { + vtkgrid->GetPoints()->SetData(this->GetCoordinates()); + } + else + { + vtkDataArray* coords = vtkDataArray::SafeDownCast( + vtkAbstractArray::CreateArray(this->GetCoordinates()->GetDataType())); + coords->SetNumberOfComponents(3); + coords->SetNumberOfTuples(this->GetNumberOfPoints()); + vtkgrid->GetPoints()->SetData(coords); + coords->Delete(); + + med_int npts = this->GetNumberOfPoints(); + double coord[3] = {0, 0, 0}; + for(med_int id=0; idCoordinates->GetTuple(id); + for(int dim=0; dimGetDimension(); dim++) + { + coord[dim] = tuple[dim]; + } + coords->SetTuple(id, coord); + } + } + + if(foep->GetProfile() != NULL) + { + foep->GetProfile()->Load(); + vtkMedIntArray* pids = foep->GetProfile()->GetIds(); + med_int previd = -1; + for(med_int pid=0; pidGetNumberOfTuples(); pid++) + { + med_int id = pids->GetValue(pid) - 1; + for(med_int theid=previd+1; theidBlankCell(theid); + } + + previd = id; + } + } + + if(foep->GetFamilyOnEntity()->GetEntityArray()->GetNumberOfFamilyOnEntity() > 1) + { + med_int famid = foep->GetFamilyOnEntity()->GetFamily()->GetId(); + vtkMedEntityArray* ea = foep->GetFamilyOnEntity()->GetEntityArray(); + for(med_int id=0; idGetNumberOfCells(); id++) + { + if(ea->GetFamilyId(id) != famid) + vtkgrid->BlankCell(id); + } + } + + return vtkgrid; +} + +void vtkMedCurvilinearGrid::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedCurvilinearGrid.h b/src/Plugins/MedReader/IO/vtkMedCurvilinearGrid.h new file mode 100644 index 00000000..fc4f13d4 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedCurvilinearGrid.h @@ -0,0 +1,80 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedCurvilinearGrid_h_ +#define __vtkMedCurvilinearGrid_h_ + +#include "vtkMedGrid.h" +#include "vtkMed.h" + +class vtkDataArray; +#include + +class VTK_EXPORT vtkMedCurvilinearGrid : public vtkMedGrid +{ +public : + static vtkMedCurvilinearGrid* New(); + vtkTypeRevisionMacro(vtkMedCurvilinearGrid, vtkMedGrid) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // overloaded to allocate memory for the grid size + virtual void SetDimension(int); + virtual int GetDimension(); + + // Description: + // The number of nodes of this grid. This method do not + // perform any allocation. + vtkSetMacro(NumberOfPoints, med_int); + vtkGetMacro(NumberOfPoints, med_int); + + // Description: + // this array contains the coordinates of the points used by this grid. + virtual void SetCoordinates(vtkDataArray*); + vtkGetObjectMacro(Coordinates, vtkDataArray); + + // Description: + // Set/Get the size of each axis. + // Note that the number of points must match the product of the + // size of each axis. + virtual void SetAxisSize(int axis, med_int size); + virtual med_int GetAxisSize(int axis); + + virtual void LoadCoordinates(); + virtual int IsCoordinatesLoaded(); + + virtual double* GetCoordTuple(med_int index); + + virtual vtkDataSet* CreateVTKDataSet(vtkMedFamilyOnEntityOnProfile*); + +protected: + vtkMedCurvilinearGrid(); + virtual ~vtkMedCurvilinearGrid(); + + std::vector AxisSize; + med_int NumberOfPoints; + vtkDataArray* Coordinates; + +private: + vtkMedCurvilinearGrid(const vtkMedCurvilinearGrid&); // Not implemented. + void operator=(const vtkMedCurvilinearGrid&); // Not implemented. + +}; + +#endif //__vtkMedCurvilinearGrid_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedDriver.cxx b/src/Plugins/MedReader/IO/vtkMedDriver.cxx new file mode 100644 index 00000000..4566dcc3 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedDriver.cxx @@ -0,0 +1,466 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedDriver.h" + +#include "vtkObjectFactory.h" +#include "vtkStringArray.h" +#include "vtkDataArray.h" +#include "vtkIdTypeArray.h" +#include "vtkMath.h" + +#include "vtkMedFile.h" +#include "vtkMedCartesianGrid.h" +#include "vtkMedPolarGrid.h" +#include "vtkMedCurvilinearGrid.h" +#include "vtkMedUnstructuredGrid.h" +#include "vtkMedField.h" +#include "vtkMedMesh.h" +#include "vtkMedFamily.h" +#include "vtkMedUtilities.h" +#include "vtkMedEntityArray.h" +#include "vtkMedLocalization.h" +#include "vtkMedProfile.h" +#include "vtkMedFieldOverEntity.h" +#include "vtkMedFieldStep.h" +#include "vtkMedGroup.h" +#include "vtkMedIntArray.h" +#include "vtkMedLink.h" + +#ifdef MedReader_HAVE_PARALLEL_INFRASTRUCTURE +#include "vtkMultiProcessController.h" +#include "vtkMPIController.h" +#include +#include +#endif + +vtkCxxSetObjectMacro(vtkMedDriver, MedFile, vtkMedFile); + +vtkCxxRevisionMacro(vtkMedDriver, "$Revision$") +vtkStandardNewMacro(vtkMedDriver) + +vtkMedDriver::vtkMedDriver() +{ + this->MedFile = NULL; + this->OpenLevel = 0; + this->FileId = -1; +} + +vtkMedDriver::~vtkMedDriver() +{ + if (this->OpenLevel > 0) + { + vtkWarningMacro("The file has not be closed before destructor.") + this->OpenLevel = 1; + this->Close(); + } + this->SetMedFile(NULL); +} + +int vtkMedDriver::RestrictedOpen() +{ + int res = 0; + if (this->MedFile == NULL || this->MedFile->GetFileName() == NULL) + { + vtkDebugMacro("Error : FileName has not been set "); + return -1; + } + + if (this->OpenLevel <= 0) + { + + med_bool hdfok; + med_bool medok; + + med_err conforme = MEDfileCompatibility(this->MedFile->GetFileName(), + &hdfok, &medok); + if (!hdfok) + { + vtkErrorMacro("The file " << this->MedFile->GetFileName() + << " is not a HDF5 file, aborting."); + return -1; + } + + if (!medok) + { + vtkErrorMacro("The file " << this->MedFile->GetFileName() + << " has not been written with the" + << " same version as the one currently used to read it, this may lead" + << " to errors. Please use the medimport tool."); + return -1; + } + + if(conforme < 0) + { + vtkErrorMacro("The file " << this->MedFile->GetFileName() + << " is not compatible, please import it to the new version using medimport."); + return -1; + } + + this->FileId = MEDfileOpen(this->MedFile->GetFileName(), MED_ACC_RDONLY); + if (this->FileId < 0) + { + vtkDebugMacro("Error : unable to open file " + << this->MedFile->GetFileName()); + res = -2; + } + this->OpenLevel = 0; + + } // OpenLevel + this->OpenLevel++; + this->ParallelFileId = -1; + return res; +} + +int vtkMedDriver::Open() +{ + int res = 0; + if (this->MedFile == NULL || this->MedFile->GetFileName() == NULL) + { + vtkDebugMacro("Error : FileName has not been set "); + return -1; + } + + if (this->OpenLevel <= 0) + { + + med_bool hdfok; + med_bool medok; + + med_err conforme = MEDfileCompatibility(this->MedFile->GetFileName(), + &hdfok, &medok); + if (!hdfok) + { + vtkErrorMacro("The file " << this->MedFile->GetFileName() + << " is not a HDF5 file, aborting."); + return -1; + } + + if (!medok) + { + vtkErrorMacro("The file " << this->MedFile->GetFileName() + << " has not been written with the" + << " same version as the one currently used to read it, this may lead" + << " to errors. Please use the medimport tool."); + return -1; + } + + if(conforme < 0) + { + vtkErrorMacro("The file " << this->MedFile->GetFileName() + << " is not compatible, please import it to the new version using medimport."); + return -1; + } + + this->FileId = MEDfileOpen(this->MedFile->GetFileName(), MED_ACC_RDONLY); + if (this->FileId < 0) + { + vtkDebugMacro("Error : unable to open file " + << this->MedFile->GetFileName()); + res = -2; + } + this->OpenLevel = 0; + + this->ParallelFileId = -1; + +#ifdef MedReader_HAVE_PARALLEL_INFRASTRUCTURE + // the following code opens the file in parallel + vtkMultiProcessController* controller = + vtkMultiProcessController::GetGlobalController(); + int lpID = 0; + if (controller == NULL) + { + return -3; + } + else + { + lpID = controller->GetLocalProcessId(); + } + + vtkMPICommunicator* commu = vtkMPICommunicator::SafeDownCast( + controller->GetCommunicator() ); + if (commu == NULL) + { + //vtkErrorMacro("Communicator is NULL in Open"); + return -3; + } + MPI_Comm* mpi_com = NULL; + mpi_com = commu->GetMPIComm()->GetHandle(); + if (mpi_com == NULL) + { + vtkErrorMacro("MPI communicator is NULL in Open"); + return -3; + } + + if (controller->GetNumberOfProcesses() > 1) + { + int major, minor, release; + if (MEDfileNumVersionRd(this->FileId, &major, &minor, &release) < 0) + { + vtkErrorMacro("Impossible to read the version of this file"); + return -1; + } + + if (major >= 3) + { + this->ParallelFileId = MEDparFileOpen(this->MedFile->GetFileName(), + MED_ACC_RDONLY, + *mpi_com, + MPI_INFO_NULL); + } + else + { + vtkErrorMacro("Parallel access is not allowed in MED files prior to version 3"); + return -1; + } + } + + if (this->ParallelFileId < 0) + { + vtkDebugMacro("Error : unable to parallel-open file " + << this->MedFile->GetFileName()); + } +#endif + + } // OpenLevel + this->OpenLevel++; + return res; +} + +void vtkMedDriver::Close() +{ + this->OpenLevel--; + if (this->OpenLevel == 0) + { + if (MEDfileClose(this->FileId) < 0) + { + vtkErrorMacro("Error: unable to close the current file."); + } + this->FileId = -1; + + if (this->ParallelFileId != -1) + { + if (MEDfileClose(this->ParallelFileId) < 0) + { + vtkErrorMacro("Error: unable to parallel-close the current file."); + } + } + this->ParallelFileId = -1; + } +} + +bool vtkMedDriver::CanReadFile() +{ + bool canRead = (this->RestrictedOpen() >= 0); + this->Close(); + return canRead; +} + +void vtkMedDriver::ReadFileVersion(int* major, int* minor, int* release) +{ + FileRestrictedOpen open(this); + + med_int amajor, aminor, arelease; + if (MEDfileNumVersionRd(this->FileId, &amajor, &aminor, &arelease) < 0) + { + vtkErrorMacro("Impossible to read the version of this file"); + return; + } + *major = amajor; + *minor = aminor; + *release = arelease; +} + +void vtkMedDriver::ReadRegularGridInformation(vtkMedRegularGrid* grid) +{ + vtkErrorMacro("vtkMedDriver::ReadInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadCurvilinearGridInformation(vtkMedCurvilinearGrid* grid) +{ + vtkErrorMacro("vtkMedDriver::ReadInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadUnstructuredGridInformation(vtkMedUnstructuredGrid* grid) +{ + vtkErrorMacro("vtkMedDriver::ReadInformation not Implemented !"); + return; +} + +// Description: +// load all Information data associated with this standard grid. +void vtkMedDriver::ReadGridInformation(vtkMedGrid* grid) +{ + if(vtkMedRegularGrid::SafeDownCast(grid) != NULL) + { + this->ReadRegularGridInformation(vtkMedRegularGrid::SafeDownCast(grid)); + } + if(vtkMedCurvilinearGrid::SafeDownCast(grid) != NULL) + { + this->ReadCurvilinearGridInformation(vtkMedCurvilinearGrid::SafeDownCast(grid)); + } + if(vtkMedUnstructuredGrid::SafeDownCast(grid) != NULL) + { + this->ReadUnstructuredGridInformation(vtkMedUnstructuredGrid::SafeDownCast(grid)); + } +} + +void vtkMedDriver::ReadFamilyInformation(vtkMedMesh* mesh, vtkMedFamily* family) +{ + vtkErrorMacro("vtkMedDriver::ReadFamilyInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadFileInformation(vtkMedFile* file) +{ + vtkErrorMacro("vtkMedDriver::ReadFileInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadProfileInformation(vtkMedProfile* profile) +{ + vtkErrorMacro("vtkMedDriver::ReadProfileInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadFieldInformation(vtkMedField* field) +{ + vtkErrorMacro("vtkMedDriver::ReadFieldInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadFieldOverEntityInformation(vtkMedFieldOverEntity* fieldOverEntity) +{ + vtkErrorMacro("vtkMedDriver::ReadFieldOverEntityInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadMeshInformation(vtkMedMesh* mesh) +{ + vtkErrorMacro("vtkMedDriver::ReadMeshInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadLocalizationInformation(vtkMedLocalization* loc) +{ + vtkErrorMacro("vtkMedDriver::ReadLocalizationInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadInterpolationInformation(vtkMedInterpolation* interp) +{ + vtkErrorMacro("vtkMedDriver::ReadInterpolationInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadFieldStepInformation(vtkMedFieldStep* step, bool readAllEntityInfo) +{ + vtkErrorMacro("vtkMedDriver::ReadFieldStepInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadFieldOnProfileInformation(vtkMedFieldOnProfile* fop) +{ + vtkErrorMacro("vtkMedDriver::ReadFieldOnProfileInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadStructElementInformation( + vtkMedStructElement*) +{ + vtkErrorMacro("vtkMedDriver::ReadStructElementInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadSupportMeshInformation( + vtkMedMesh*) +{ + vtkErrorMacro("vtkMedDriver::ReadSupportMeshInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadConstantAttributeInformation(vtkMedConstantAttribute*) +{ + vtkErrorMacro("vtkMedDriver::ReadConstantAttributeInformation not Implemented !"); + return; +} + +void vtkMedDriver::ReadVariableAttributeInformation(vtkMedVariableAttribute*) +{ + vtkErrorMacro("vtkMedDriver::ReadVariableAttributeInformation not Implemented !"); + return; +} + +void vtkMedDriver::LoadPointGlobalIds(vtkMedGrid* grid) +{ + vtkErrorMacro("vtkMedDriver::LoadPointGlobalIds not Implemented !"); + return; +} + +void vtkMedDriver::LoadFamilyIds(vtkMedEntityArray* array) +{ + vtkErrorMacro("vtkMedDriver::LoadFamilyIds not Implemented !"); + return; +} + +void vtkMedDriver::LoadCoordinates(vtkMedGrid* grid) +{ + vtkErrorMacro("vtkMedDriver::LoadCoordinates not Implemented !"); + return; +} + +void vtkMedDriver::LoadProfile(vtkMedProfile* profile) +{ + vtkErrorMacro("vtkMedDriver::LoadProfile not Implemented !"); + return; +} + +void vtkMedDriver::LoadConnectivity(vtkMedEntityArray* array) +{ + vtkErrorMacro("vtkMedDriver::LoadConnectivity not Implemented !"); + return; +} + +void vtkMedDriver::LoadCellGlobalIds(vtkMedEntityArray* array) +{ + vtkErrorMacro("vtkMedDriver::LoadGlobalIds not Implemented !"); + return; +} + +void vtkMedDriver::LoadField(vtkMedFieldOnProfile* foe, med_storage_mode mode) +{ + vtkErrorMacro("vtkMedDriver::LoadFieldOnProfile not Implemented !"); + return; +} + +void vtkMedDriver::LoadVariableAttribute(vtkMedVariableAttribute*, + vtkMedEntityArray*) +{ + vtkErrorMacro("vtkMedDriver::LoadVariableAttribute not Implemented !"); + return; +} + +void vtkMedDriver::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, OpenLevel); + PRINT_IVAR(os, indent, FileId); +} diff --git a/src/Plugins/MedReader/IO/vtkMedDriver.h b/src/Plugins/MedReader/IO/vtkMedDriver.h new file mode 100644 index 00000000..a134f0fa --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedDriver.h @@ -0,0 +1,232 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedDriver_h_ +#define __vtkMedDriver_h_ + +#include "vtkObject.h" +#include "vtkMed.h" + +class vtkMedFile; +class vtkMedMesh; +class vtkMedField; +class vtkMedFamily; +class vtkMedPolarGrid; +class vtkMedRegularGrid; +class vtkMedCurvilinearGrid; +class vtkMedUnstructuredGrid; +class vtkMedLocalization; +class vtkMedProfile; +class vtkMedFieldOverEntity; +class vtkMedEntityArray; +class vtkMedFieldStep; +class vtkMedGrid; +class vtkMedInterpolation; +class vtkMedFieldOnProfile; +class vtkMedStructElement; +class vtkMedConstantAttribute; +class vtkMedVariableAttribute; + +class VTK_EXPORT vtkMedDriver: public vtkObject +{ +public: + static vtkMedDriver* New(); + vtkTypeRevisionMacro(vtkMedDriver, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Set/Get the med file that use this driver + virtual void SetMedFile(vtkMedFile*); + vtkGetObjectMacro(MedFile, vtkMedFile); + + // Description : + // This gives the File ID to read in parallel. + vtkGetMacro(ParallelFileId, med_idt); + + // Description: + // open the file for reading. Returns 0 on success, or error code. + virtual int RestrictedOpen(); + virtual int Open(); + virtual void Close(); + virtual bool CanReadFile(); + + // Description: + // Get the Version numbers from the file + virtual void ReadFileVersion(int* major, int* minor, int* release); + + // Description: + // load all meta data associated with this file. + virtual void ReadFileInformation(vtkMedFile*); + + // Description: + // load all meta data associated with this mesh. + virtual void ReadMeshInformation(vtkMedMesh*); + + // Description: + // load all meta data associated with this field. + virtual void ReadFieldInformation(vtkMedField*); + + // Description: + // load all meta data associated with this regular (Cartesian or polar) grid. + virtual void ReadRegularGridInformation(vtkMedRegularGrid*); + + // Description: + // load all meta data associated with this standard grid. + virtual void ReadCurvilinearGridInformation(vtkMedCurvilinearGrid*); + + // Description: + // load all meta data associated with this unstructured grid. + virtual void ReadUnstructuredGridInformation(vtkMedUnstructuredGrid*); + + // Description: + // load all meta data associated with this grid. + // (call one of the above method depending on the type of grid) + virtual void ReadGridInformation(vtkMedGrid*); + + // Description: + // load all meta data associated with this family. + virtual void ReadFamilyInformation(vtkMedMesh*, vtkMedFamily*); + + // Description: + // load all meta data associated with this family. + virtual void ReadProfileInformation(vtkMedProfile*); + + // Description: + // load information on a field and a given cell type at a given step + virtual void ReadFieldOverEntityInformation(vtkMedFieldOverEntity*); + + // Description: + // load information related to the given quadrature scheme definition + virtual void ReadLocalizationInformation(vtkMedLocalization*); + + // Description: + // load all information associated witht this field step + virtual void ReadFieldStepInformation(vtkMedFieldStep*, bool readAllEntityInfo); + + // Description: + // load all information related to this interpolation function + virtual void ReadInterpolationInformation(vtkMedInterpolation*); + + // Description: + // load all information related to this field on this profile + virtual void ReadFieldOnProfileInformation(vtkMedFieldOnProfile*); + + // Description: + // read all information related to the structural elements models + // in this file + virtual void ReadStructElementInformation(vtkMedStructElement*); + + // Description: + // read all information related to the support mesh + // in this file + virtual void ReadSupportMeshInformation(vtkMedMesh*); + + // Description: + // read all information related to the support mesh + // in this file + virtual void ReadConstantAttributeInformation(vtkMedConstantAttribute*); + + // Description: + // read all information related to the support mesh + // in this file + virtual void ReadVariableAttributeInformation(vtkMedVariableAttribute*); + + // Description: + // load the field on this profile + virtual void LoadField(vtkMedFieldOnProfile* fop, med_storage_mode mode); + + // Description: + // Load the indices of the profile + virtual void LoadProfile(vtkMedProfile* profile); + + // Description: + // Load the values of the given step +// void Load(vtkMedFieldOnProfile*); + + virtual void LoadFamilyIds(vtkMedEntityArray*); + + virtual void LoadCoordinates(vtkMedGrid*); + + virtual void LoadPointGlobalIds(vtkMedGrid*); + + //virtual void LoadPointFamilyIds(vtkMedGrid*); + + virtual void LoadConnectivity(vtkMedEntityArray*); + + virtual void LoadCellGlobalIds(vtkMedEntityArray*); + + virtual void LoadVariableAttribute(vtkMedVariableAttribute*, + vtkMedEntityArray*); + + //BTX + class FileOpen + { + public: + FileOpen(vtkMedDriver* driver) + { + this->Driver = driver; + this->Driver->Open(); + } + ~FileOpen() + { + this->Driver->Close(); + } + protected: + vtkMedDriver* Driver; + vtkMedFile* File; + }; + //ETX + + //BTX + class FileRestrictedOpen + { + public: + FileRestrictedOpen(vtkMedDriver* driver) + { + this->Driver = driver; + this->Driver->RestrictedOpen(); + } + ~FileRestrictedOpen() + { + this->Driver->Close(); + } + protected: + vtkMedDriver* Driver; + vtkMedFile* File; + }; + //ETX + +protected: + vtkMedDriver(); + ~vtkMedDriver(); + + // name of the file to read from + vtkMedFile * MedFile; + + int OpenLevel; + + med_idt FileId; + med_idt ParallelFileId; + +private: + vtkMedDriver(const vtkMedDriver&); // Not implemented. + void operator=(const vtkMedDriver&); // Not implemented. +}; + +#endif //__vtkMedDriver_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedDriver30.cxx b/src/Plugins/MedReader/IO/vtkMedDriver30.cxx new file mode 100644 index 00000000..601f896c --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedDriver30.cxx @@ -0,0 +1,2371 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedDriver30.h" + +#include "vtkObjectFactory.h" +#include "vtkStringArray.h" +#include "vtkDataArray.h" +#include "vtkIdTypeArray.h" +#include "vtkDoubleArray.h" +#include "vtkIntArray.h" +#include "vtkCharArray.h" + +#include "vtkMedFile.h" +#include "vtkMedCartesianGrid.h" +#include "vtkMedPolarGrid.h" +#include "vtkMedCurvilinearGrid.h" +#include "vtkMedUnstructuredGrid.h" +#include "vtkMedField.h" +#include "vtkMedMesh.h" +#include "vtkMedFamily.h" +#include "vtkMedUtilities.h" +#include "vtkMedEntityArray.h" +#include "vtkMedLocalization.h" +#include "vtkMedProfile.h" +#include "vtkMedFieldOverEntity.h" +#include "vtkMedFieldStep.h" +#include "vtkMedGroup.h" +#include "vtkMedIntArray.h" +#include "vtkMedInterpolation.h" +#include "vtkMedFieldOnProfile.h" +#include "vtkMedFraction.h" +#include "vtkMedLink.h" +#include "vtkMedStructElement.h" +#include "vtkMedConstantAttribute.h" +#include "vtkMedVariableAttribute.h" + +#include "vtkMultiProcessController.h" + +#include +#include +#include +using namespace std; + +vtkCxxRevisionMacro(vtkMedDriver30, "$Revision$") +vtkStandardNewMacro(vtkMedDriver30) + +vtkMedDriver30::vtkMedDriver30() : vtkMedDriver() +{ +} + +vtkMedDriver30::~vtkMedDriver30() +{ +} + +// Description: +// load all Information data associated with this cartesian grid. +void vtkMedDriver30::ReadRegularGridInformation(vtkMedRegularGrid* grid) +{ + FileOpen open(this); + + grid->SetDimension(grid->GetParentMesh()->GetNumberOfAxis()); + + for(int axis=0; axis < grid->GetDimension(); axis++) + { + med_int size; + med_bool coordinatechangement, geotransformation; + + if ((size = MEDmeshnEntity( + this->FileId, + grid->GetParentMesh()->GetName(), + grid->GetComputeStep().TimeIt, + grid->GetComputeStep().IterationIt, + MED_NODE, + MED_NONE, + (med_data_type)(MED_COORDINATE_AXIS1 + axis), + MED_NO_CMODE, + &coordinatechangement, + &geotransformation)) < 0) + { + vtkErrorMacro("ERROR : number of coordinates on X axis ..."); + } + + grid->SetAxisSize(axis, size); + } + + med_int ncell = 1; + if(grid->GetAxisSize(0) > 1) + ncell *= grid->GetAxisSize(0)-1; + if(grid->GetAxisSize(1) > 1) + ncell *= grid->GetAxisSize(1)-1; + if(grid->GetAxisSize(2) > 1) + ncell *= grid->GetAxisSize(2)-1; + + vtkMedEntity entity; + entity.EntityType = MED_CELL; + + switch(grid->GetDimension()) + { + case 0 : + entity.GeometryType = MED_POINT1; + break; + case 1 : + entity.GeometryType = MED_SEG2; + break; + case 2 : + entity.GeometryType = MED_QUAD4; + break; + case 3 : + entity.GeometryType = MED_HEXA8; + break; + default : + vtkErrorMacro("Unsupported dimension for curvilinear grid : " + << grid->GetDimension()); + return; + } + + vtkMedEntityArray* array = vtkMedEntityArray::New(); + array->SetParentGrid(grid); + array->SetNumberOfEntity(ncell); + array->SetEntity(entity); + array->SetConnectivity(MED_NODAL); + grid->AppendEntityArray(array); + array->Delete(); + // this triggers the creation of undefined families + this->LoadFamilyIds(array); + +} + +void vtkMedDriver30::LoadRegularGridCoordinates(vtkMedRegularGrid* grid) +{ + FileOpen open(this); + + for(int axis=0; axis < grid->GetParentMesh()->GetNumberOfAxis(); axis++) + { + + vtkDataArray* coords = vtkMedUtilities::NewCoordArray(); + grid->SetAxisCoordinate(axis, coords); + coords->Delete(); + + coords->SetNumberOfComponents(1); + coords->SetNumberOfTuples(grid->GetAxisSize(axis)); + + if (MEDmeshGridIndexCoordinateRd( + this->FileId, + grid->GetParentMesh()->GetName(), + grid->GetComputeStep().TimeIt, + grid->GetComputeStep().IterationIt, + axis+1, + (med_float*)coords->GetVoidPointer(0)) < 0) + { + vtkErrorMacro("ERROR : read axis " << axis << " coordinates ..."); + grid->SetAxisCoordinate(axis, NULL); + return; + } + } +} + +// Description: +// load all Information data associated with this standard grid. +void vtkMedDriver30::ReadCurvilinearGridInformation(vtkMedCurvilinearGrid* grid) +{ + FileOpen open(this); + + grid->SetDimension(grid->GetParentMesh()->GetNumberOfAxis()); + + med_int size; + med_bool coordinatechangement, geotransformation; + + if ((size = MEDmeshnEntity( + this->FileId, + grid->GetParentMesh()->GetName(), + grid->GetComputeStep().TimeIt, + grid->GetComputeStep().IterationIt, + MED_NODE, + MED_NONE, + MED_COORDINATE, + MED_NO_CMODE, + &coordinatechangement, + &geotransformation)) < 0) + { + vtkErrorMacro("ReadCurvilinearGridInformation MEDmeshnEntity"); + } + + grid->SetNumberOfPoints(size); + + med_int axissize[3]; + if(MEDmeshGridStructRd( + this->FileId, + grid->GetParentMesh()->GetName(), + grid->GetComputeStep().TimeIt, + grid->GetComputeStep().IterationIt, + axissize) < 0) + { + vtkErrorMacro("ReadCurvilinearGridInformation MEDmeshGridStructRd"); + } + grid->SetAxisSize(0, (axissize[0] <= 0 ? 1: axissize[0])); + grid->SetAxisSize(1, (axissize[1] <= 0 ? 1: axissize[1])); + grid->SetAxisSize(2, (axissize[2] <= 0 ? 1: axissize[2])); + + // A test to verify the number of points : total number of + // points should be equal to the product of each axis size + if(size != grid->GetAxisSize(0)*grid->GetAxisSize(1)*grid->GetAxisSize(2)) + { + vtkErrorMacro("The total number of points of a Curvilinear grid should " + << "be the product of each axis size!"); + } + + med_int ncell = 1; + if(grid->GetAxisSize(0) > 1) + ncell *= grid->GetAxisSize(0)-1; + if(grid->GetAxisSize(1) > 1) + ncell *= grid->GetAxisSize(1)-1; + if(grid->GetAxisSize(2) > 1) + ncell *= grid->GetAxisSize(2)-1; + + vtkMedEntity entity; + entity.EntityType = MED_CELL; + + switch(grid->GetDimension()) + { + case 0 : + entity.GeometryType = MED_POINT1; + break; + case 1 : + entity.GeometryType = MED_SEG2; + break; + case 2 : + entity.GeometryType = MED_QUAD4; + break; + case 3 : + entity.GeometryType = MED_HEXA8; + break; + default : + vtkErrorMacro("Unsupported dimension for curvilinear grid : " + << grid->GetDimension()); + return; + } + + vtkMedEntityArray* array = vtkMedEntityArray::New(); + array->SetParentGrid(grid); + array->SetNumberOfEntity(ncell); + array->SetEntity(entity); + array->SetConnectivity(MED_NODAL); + grid->AppendEntityArray(array); + array->Delete(); + // this triggers the creation of undefined families + this->LoadFamilyIds(array); + +} + +// Description : read the number of entity of all geometry type +// for a given entity type and a given connectivity mode +void vtkMedDriver30::ReadNumberOfEntity( + vtkMedUnstructuredGrid* grid, + med_entity_type entityType, + med_connectivity_mode connectivity) +{ + FileOpen open(this); + + med_bool changement, transformation; + + const char* meshName = grid->GetParentMesh()->GetName(); + + const vtkMedComputeStep& cs = grid->GetComputeStep(); + + med_int nentity = MEDmeshnEntity( + this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + entityType, + MED_GEO_ALL, + MED_UNDEF_DATATYPE , + connectivity, + &changement, + &transformation ); + + for(med_int geotypeit = 1; geotypeit <= nentity; geotypeit++) + { + // read cell informations + vtkMedEntity entity; + entity.EntityType = entityType; + + char geometryName[MED_NAME_SIZE+1] = ""; + + // this gives us the med_geometry_type + if( MEDmeshEntityInfo( FileId, meshName, + cs.TimeIt, + cs.IterationIt, + entityType, + geotypeit, + geometryName, + &entity.GeometryType) < 0) + { + vtkErrorMacro("MEDmeshEntityInfo"); + continue; + } + + entity.GeometryName = geometryName; + med_int ncell = 0; + + if(entity.GeometryType == MED_POLYGON) + { + // read the number of cells of this type + ncell = MEDmeshnEntity(this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + entity.EntityType, + entity.GeometryType, + MED_INDEX_NODE, + connectivity, + &changement, + &transformation ) - 1; + } + else if(entity.GeometryType == MED_POLYHEDRON) + { + // read the number of cells of this type + ncell = MEDmeshnEntity(this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + entity.EntityType, + entity.GeometryType, + MED_INDEX_FACE, + connectivity, + &changement, + &transformation ) - 1; + } + else + { + ncell = MEDmeshnEntity(this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + entity.EntityType, + entity.GeometryType, + MED_CONNECTIVITY, + connectivity, + &changement, + &transformation ); + } + + if(ncell > 0) + { + vtkMedEntityArray* array = vtkMedEntityArray::New(); + array->SetParentGrid(grid); + array->SetNumberOfEntity(ncell); + array->SetEntity(entity); + array->SetConnectivity(connectivity); + grid->AppendEntityArray(array); + array->Delete(); + // this triggers the creation of undefined families + this->LoadFamilyIds(array); + } + } +} + +// Description: +// load all Information data associated with this unstructured grid. +void vtkMedDriver30::ReadUnstructuredGridInformation( + vtkMedUnstructuredGrid* grid) +{ + FileOpen open(this); + + vtkMedMesh *mesh = grid->GetParentMesh(); + + const char *meshName = mesh->GetName(); + med_connectivity_mode connectivity; + + med_bool changement; + med_bool transformation; + med_int profilesize; + + char profilename[MED_NAME_SIZE+1]; + memset(profilename, '\0', MED_NAME_SIZE+1); + + vtkMedComputeStep cs = grid->GetComputeStep(); + + // first check if we have points + vtkIdType npoints = MEDmeshnEntityWithProfile( + this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + MED_NODE, + MED_NONE, + MED_COORDINATE, + MED_NODAL, + MED_COMPACT_PFLMODE, + profilename, + &profilesize, + &changement, + &transformation); + + if(npoints > 0) + { + grid->SetNumberOfPoints(npoints); + } + else + { + if(grid->GetPreviousGrid() == NULL) + { + vtkErrorMacro("No point and no previous grid"); + } + grid->SetUsePreviousCoordinates(true); + grid->SetNumberOfPoints(grid->GetPreviousGrid()->GetNumberOfPoints()); + return; + } + + this->ReadNumberOfEntity(grid, MED_CELL, MED_NODAL); + this->ReadNumberOfEntity(grid, MED_CELL, MED_DESCENDING); + this->ReadNumberOfEntity(grid, MED_DESCENDING_FACE, MED_NODAL); + this->ReadNumberOfEntity(grid, MED_DESCENDING_FACE, MED_DESCENDING); + this->ReadNumberOfEntity(grid, MED_DESCENDING_EDGE, MED_NODAL); + this->ReadNumberOfEntity(grid, MED_DESCENDING_EDGE, MED_DESCENDING); + this->ReadNumberOfEntity(grid, MED_STRUCT_ELEMENT, MED_NODAL); + this->ReadNumberOfEntity(grid, MED_STRUCT_ELEMENT, MED_DESCENDING); + + // create the point vtkMedEntityArray support + vtkMedEntity entity; + entity.EntityType = MED_NODE; + entity.GeometryType = MED_POINT1; + vtkMedEntityArray* pea = vtkMedEntityArray::New(); + pea->SetEntity(entity); + pea->SetParentGrid(grid); + pea->SetNumberOfEntity(grid->GetNumberOfPoints()); + grid->AppendEntityArray(pea); + pea->Delete(); + + this->LoadFamilyIds(pea); +} + +void vtkMedDriver30::ReadFamilyInformation(vtkMedMesh* mesh, vtkMedFamily* family) +{ + FileOpen open(this); + + med_int familyid; + med_int ngroup; + char* groupNames = NULL; + const char* meshName = mesh->GetName(); + + ngroup = MEDnFamilyGroup(FileId, meshName, family->GetMedIterator()); + + bool has_no_group = false; + if(ngroup <= 0) + { + if(ngroup < 0) + { + vtkErrorMacro("Error while reading the number of groups"); + } + ngroup = 1; + has_no_group = true; + } + + groupNames = new char[ngroup * MED_LNAME_SIZE + 1]; + memset(groupNames, '\0', ngroup * MED_LNAME_SIZE + 1); + + // special case for files written by med < 3, + // I have to use the 23 interface + if(mesh->GetParentFile()->GetVersionMajor() < 3) + { + med_int *attributenumber = NULL; + med_int *attributevalue = NULL; + char *attributedes = NULL; + + med_int nattr = MEDnFamily23Attribute( + this->FileId, + meshName, + family->GetMedIterator()); + + if(nattr < 0) + { + vtkErrorMacro("MEDnFamily23Attribute"); + } + + if(nattr > 0) + { + attributenumber = new med_int[nattr]; + attributevalue = new med_int[nattr]; + attributedes = new char[nattr*MED_COMMENT_SIZE+1]; + memset(attributedes, '\0', nattr*MED_COMMENT_SIZE+1); + } + + char familyName[MED_NAME_SIZE+1] = ""; + + if(MEDfamily23Info (this->FileId, + meshName, + family->GetMedIterator(), + familyName, + attributenumber, + attributevalue, + attributedes, + &familyid, + groupNames ) < 0) + { + vtkDebugMacro("MEDfamily23Info"); + } + + family->SetName(familyName); + + if(attributenumber != NULL) + delete[] attributenumber; + if(attributevalue != NULL) + delete[] attributevalue; + if(attributedes != NULL) + delete[] attributedes; + } + else + { + char familyName[MED_NAME_SIZE+1] = ""; + if(MEDfamilyInfo( this->FileId, + meshName, + family->GetMedIterator(), + familyName, + &familyid, + groupNames ) < 0) + { + vtkErrorMacro( + "vtkMedDriver30::ReadInformation(vtkMedFamily* family)" + << " cannot read family informations."); + return; + } + family->SetName(familyName); + } + + family->SetId(familyid); + + if( familyid == 0 ) { + family->SetPointOrCell( vtkMedUtilities::OnCell ); + mesh->AppendCellFamily( family ); + } else { + //rnv: improve algorithm to determine entity of the family: + // 1) Read Nb nodes + // 2) Read families of the nodes + // 3) If list of the families of the nodes contains familyid => vtkMedUtilities::OnPoint + // otherwise => vtkMedUtilities::OnCell + med_bool v1, v2; + med_int size = MEDmeshnEntity( + this->FileId, + meshName, + MED_NO_DT, + MED_NO_IT, + MED_NODE, + MED_NO_GEOTYPE, + MED_COORDINATE, + MED_NO_CMODE, + &v1, + &v2 ); + if( size < 0 ) { + vtkErrorMacro( "vtkMedDriver30::ReadInformation(vtkMedFamily* family)" + <<" cannot read nb Nodes" ); + return; + } + + vector n_fams; + n_fams.resize( size ); + + med_int ret_val = MEDmeshEntityFamilyNumberRd( this->FileId, + meshName, + MED_NO_DT, + MED_NO_IT, + MED_NODE, + MED_NO_GEOTYPE , + &n_fams[0] ); + // Remove ZERO FAMILY + remove( n_fams.begin(),n_fams.end(), 0 ); + + bool isOnPoints = ( ret_val >= 0) && (find( n_fams.begin(), n_fams.end(), familyid ) != n_fams.end() ); + if( isOnPoints ) { + family->SetPointOrCell(vtkMedUtilities::OnPoint); + mesh->AppendPointFamily(family); + } else { + family->SetPointOrCell(vtkMedUtilities::OnCell); + mesh->AppendCellFamily(family); + } + } + + family->AllocateNumberOfGroup(ngroup); + // if there where no group, set the name to the default value + if(has_no_group) + { + memcpy(groupNames, vtkMedUtilities::NoGroupName, + strlen(vtkMedUtilities::NoGroupName)); + } + + for(int index = 0; index < ngroup; index++) + { + char realGroupName[MED_LNAME_SIZE + 1]; + memset(realGroupName, '\0', MED_LNAME_SIZE + 1); + memcpy(realGroupName, groupNames + index * MED_LNAME_SIZE, + MED_LNAME_SIZE * sizeof(char)); + vtkMedGroup* group = mesh->GetOrCreateGroup(family->GetPointOrCell(), + realGroupName); + + family->SetGroup(index, group); + } + + delete[] groupNames; + + if(familyid == 0) + { + vtkMedFamily* famzero = vtkMedFamily::New(); + mesh->AppendPointFamily(famzero); + famzero->Delete(); + + famzero->SetName(family->GetName()); + famzero->SetMedIterator(family->GetMedIterator()); + famzero->SetId(family->GetId()); + famzero->SetPointOrCell(vtkMedUtilities::OnPoint); + famzero->AllocateNumberOfGroup(family->GetNumberOfGroup()); + for(int gid=0; gidGetNumberOfGroup(); gid++) + { + vtkMedGroup* group = mesh->GetOrCreateGroup( + vtkMedUtilities::OnPoint, + family->GetGroup(gid)->GetName()); + famzero->SetGroup(gid, group); + mesh->AppendPointGroup(group); + } + } +} + +void vtkMedDriver30::ReadLinkInformation(vtkMedLink* link) +{ + med_int size; + char linkMeshName[MED_NAME_SIZE+1] = ""; + if(MEDlinkInfo(this->FileId, + link->GetMedIterator(), + linkMeshName, + &size) < 0) + { + vtkErrorMacro("MEDlinkInfo"); + return; + } + link->SetMeshName(linkMeshName); + if(size <= 0) + return; + + char* path = new char[size + 1]; + memset(path, '\0', size+1); + if(MEDlinkRd(this->FileId, link->GetMeshName(), path) < 0) + { + vtkErrorMacro("MEDlinkRd"); + memset(path, '\0', size+1); + } + + link->SetLink(path); + + delete[] path; +} + +void vtkMedDriver30::ReadFileInformation(vtkMedFile* file) +{ + FileOpen open(this); + + char comment[MED_COMMENT_SIZE+1] = ""; + + MEDfileCommentRd(this->FileId, + comment); + + file->SetComment(comment); + + med_int major, minor, release; + MEDfileNumVersionRd(this->FileId, &major, &minor, &release); + file->SetVersionMajor(major); + file->SetVersionMinor(minor); + file->SetVersionRelease(release); + + int nlink = MEDnLink(this->FileId); + file->AllocateNumberOfLink(nlink); + for(int linkid=0; linkidGetLink(linkid); + link->SetMedIterator(linkid+1); + this->ReadLinkInformation(link); + } + + int nprof = MEDnProfile(FileId); + // Reading id s not possible in parallel if the file contains Profiles + vtkMultiProcessController* controller = vtkMultiProcessController::GetGlobalController(); + if (controller != NULL) + if ((nprof != 0) && (controller->GetNumberOfProcesses() > 1)) + { + vtkWarningMacro("ATTENTION: The MED Reader cannot read profiles when used in parallel"); + return; + } + file->AllocateNumberOfProfile(nprof); + for(int i = 0; i < nprof; i++) + { + vtkMedProfile* profile = file->GetProfile(i); + profile->SetMedIterator(i + 1); + profile->SetParentFile(file); + this->ReadProfileInformation(profile); + } + + int nloc = MEDnLocalization(this->FileId); + file->AllocateNumberOfLocalization(nloc); + for(int i = 0; i < nloc; i++) + { + vtkMedLocalization* loc = file->GetLocalization(i); + loc->SetMedIterator(i + 1); + loc->SetParentFile(file); + this->ReadLocalizationInformation(loc); + } + + int nsupportmesh = MEDnSupportMesh(this->FileId); + file->AllocateNumberOfSupportMesh(nsupportmesh); + for(int i = 0; i < nsupportmesh; i++) + { + vtkMedMesh* supportmesh = file->GetSupportMesh(i); + supportmesh->SetMedIterator(i + 1); + supportmesh->SetParentFile(file); + this->ReadSupportMeshInformation(supportmesh); + } + + int nmesh = MEDnMesh(this->FileId); + file->AllocateNumberOfMesh(nmesh); + for(int i = 0; i < nmesh; i++) + { + vtkMedMesh* mesh = file->GetMesh(i); + mesh->SetMedIterator(i + 1); + mesh->SetParentFile(file); + this->ReadMeshInformation(mesh); + } + + int nfields = MEDnField(this->FileId); + file->AllocateNumberOfField(nfields); + for(int i = 0; i < nfields; i++) + { + vtkMedField* field = file->GetField(i); + field->SetMedIterator(i + 1); + field->SetParentFile(file); + this->ReadFieldInformation(field); + field->ComputeFieldType(); + while(field->HasManyFieldTypes()) + { + vtkMedField* newfield = vtkMedField::New(); + int type = field->GetFirstType(); + newfield->ExtractFieldType(field, type); + file->AppendField(newfield); + newfield->Delete(); + } + } + + int nstruct = MEDnStructElement(this->FileId); + + file->AllocateNumberOfStructElement(nstruct); + for(int i = 0; i < nstruct; i++) + { + vtkMedStructElement* structelem = file->GetStructElement(i); + structelem->SetMedIterator(i+1); + structelem->SetParentFile(file); + this->ReadStructElementInformation(structelem); + } + +} + +void vtkMedDriver30::ReadStructElementInformation( + vtkMedStructElement* structelem) +{ + + FileOpen open(this); + + char modelname[MED_NAME_SIZE+1] = ""; + med_geometry_type mgeotype; + med_int modeldim; + char supportmeshname[MED_NAME_SIZE+1] = ""; + med_entity_type sentitytype; + med_int snbofnode; + med_int snbofcell; + med_geometry_type sgeotype; + med_int nbofconstantattribute; + med_bool anyprofile; + med_int nbofvariableattribute; + + if(MEDstructElementInfo (this->FileId, + structelem->GetMedIterator(), + modelname, + &mgeotype, + &modeldim, + supportmeshname, + &sentitytype, + &snbofnode, + &snbofcell, + &sgeotype, + &nbofconstantattribute, + &anyprofile, + &nbofvariableattribute) < 0) + { + vtkErrorMacro("Error in MEDstructElementInfo"); + return; + } + structelem->SetName(modelname); + structelem->SetGeometryType(mgeotype); + structelem->SetModelDimension(modeldim); + structelem->SetSupportMeshName(supportmeshname); + structelem->SetSupportEntityType(sentitytype); + structelem->SetSupportNumberOfNode(snbofnode); + structelem->SetSupportNumberOfCell(snbofcell); + structelem->SetSupportGeometryType(sgeotype); + structelem->AllocateNumberOfConstantAttribute(nbofconstantattribute); + structelem->AllocateNumberOfVariableAttribute(nbofvariableattribute); + structelem->SetAnyProfile(anyprofile); + + for(int attit = 0; attit < nbofconstantattribute; attit ++) + { + vtkMedConstantAttribute* constatt = structelem->GetConstantAttribute(attit); + constatt->SetMedIterator(attit+1); + constatt->SetParentStructElement(structelem); + this->ReadConstantAttributeInformation(constatt); + } + + for(int attit = 0; attit < nbofvariableattribute; attit ++) + { + vtkMedVariableAttribute* varatt = structelem->GetVariableAttribute(attit); + varatt->SetMedIterator(attit+1); + varatt->SetParentStructElement(structelem); + this->ReadVariableAttributeInformation(varatt); + } +} + +void vtkMedDriver30::ReadConstantAttributeInformation( + vtkMedConstantAttribute* constAttr) +{ + + FileOpen open(this); + + char constattname[MED_NAME_SIZE+1] = ""; + med_attribute_type constatttype; + med_int nbofcomponent; + med_entity_type sentitytype; + char profilename[MED_NAME_SIZE+1] = ""; + med_int profilesize; + + if(MEDstructElementConstAttInfo( + this->FileId, + constAttr->GetParentStructElement()->GetName(), + constAttr->GetMedIterator(), + constattname, + &constatttype, + &nbofcomponent, + &sentitytype, + profilename, + &profilesize) < 0) + { + vtkErrorMacro("MEDstructElementConstAttInfo error"); + return; + } + + constAttr->SetName(constattname); + constAttr->SetAttributeType(constatttype); + constAttr->SetNumberOfComponent(nbofcomponent); + constAttr->SetSupportEntityType(sentitytype); + constAttr->SetProfileName(profilename); + constAttr->SetProfileSize(profilesize); + + vtkAbstractArray* values = vtkMedUtilities::NewArray(constatttype); + if(values == NULL) + return; + constAttr->SetValues(values); + values->Delete(); + + values->SetNumberOfComponents(nbofcomponent); + vtkIdType ntuple = 0; + if((strcmp(profilename, MED_NO_PROFILE) != 0) && + (strcmp(profilename, "\0") != 0)) + { + ntuple = profilesize; + } + else if(constAttr->GetSupportEntityType() == MED_CELL) + { + ntuple = constAttr->GetParentStructElement()->GetSupportNumberOfCell(); + } + else + { + ntuple = constAttr->GetParentStructElement()->GetSupportNumberOfNode(); + } + values->SetNumberOfTuples(ntuple); + + void* ptr = NULL; + vtkSmartPointer buffer = vtkSmartPointer::New(); + if(constatttype != MED_ATT_NAME) + { + ptr = values->GetVoidPointer(0); + } + else + { + buffer->SetNumberOfValues(MED_NAME_SIZE*nbofcomponent*ntuple); + ptr = buffer->GetVoidPointer(0); + } + + if(MEDstructElementConstAttRd (this->FileId, + constAttr->GetParentStructElement()->GetName(), + constAttr->GetName(), ptr) < 0) + { + vtkErrorMacro("MEDstructElementConstAttRd"); + return; + } + + if(constatttype == MED_ATT_NAME) + { + char name[MED_NAME_SIZE+1] = ""; + char* nameptr = (char*) ptr; + vtkStringArray* names = vtkStringArray::SafeDownCast(values); + for(vtkIdType id = 0; id < nbofcomponent*ntuple; id++) + { + memset(name, '\0', MED_NAME_SIZE+1); + strncpy(name, nameptr + id * MED_NAME_SIZE, MED_NAME_SIZE); + names->SetValue(id, name); + } + } + + return; +} + +void vtkMedDriver30::ReadVariableAttributeInformation( + vtkMedVariableAttribute* varAttr) +{ + + FileOpen open(this); + + char varattname[MED_NAME_SIZE+1] = ""; + med_attribute_type varatttype; + med_int nbofcomponent; + + if(MEDstructElementVarAttInfo ( + this->FileId, + varAttr->GetParentStructElement()->GetName(), + varAttr->GetMedIterator(), + varattname, + &varatttype, + &nbofcomponent) < 0) + { + vtkErrorMacro("MEDstructElementVarAttInfo"); + return; + } + + varAttr->SetName(varattname); + varAttr->SetAttributeType(varatttype); + varAttr->SetNumberOfComponent(nbofcomponent); + + return; +} + +void vtkMedDriver30::ReadProfileInformation(vtkMedProfile* profile) +{ + FileOpen open(this); + + med_int nelem; + char profileName[MED_NAME_SIZE+1] = ""; + + if(MEDprofileInfo(this->FileId, + profile->GetMedIterator(), + profileName, + &nelem) < 0) + { + vtkErrorMacro("cannot read information on profile" + << profile->GetMedIterator()); + } + profile->SetName(profileName); + profile->SetNumberOfElement(nelem); +} + +void vtkMedDriver30::ReadFieldInformation(vtkMedField* field) +{ + FileOpen open(this); + + if (field->GetMedIterator() == 0) + return; + + int ncomp = MEDfieldnComponent(FileId, field->GetMedIterator()); + + if(ncomp < 0) + { + field->SetNumberOfComponent(-1); + vtkErrorMacro("cannot read the number of component of field " + << field->GetMedIterator()) + return; + } + + field->SetNumberOfComponent(ncomp); + + char* units = new char[MED_SNAME_SIZE * ncomp + 1]; + char* componentNames = new char[MED_SNAME_SIZE * ncomp + 1]; + memset(units, '\0', MED_SNAME_SIZE * ncomp + 1); + memset(componentNames, '\0', MED_SNAME_SIZE * ncomp + 1); + + //med_type_champ dataType; + med_field_type dataType; + med_int nstep; + med_bool localmesh; + + char name[MED_NAME_SIZE+1] = ""; + char meshName[MED_NAME_SIZE+1] = ""; + char unit[MED_SNAME_SIZE+1] = ""; + + if( MEDfieldInfo( FileId, + field->GetMedIterator(), + name, + meshName, + &localmesh, + &dataType, + componentNames, + units, + unit, + &nstep) < 0) + { + vtkErrorMacro("cannot read the informations on field " + << field->GetMedIterator()) + return; + } + + field->SetName(name); + field->SetMeshName(meshName); + field->SetTimeUnit(unit); + field->SetDataType(dataType); + field->SetLocal(localmesh); + + for(int comp = 0; comp < ncomp; comp++) + { + char unit[MED_NAME_SIZE + 1] = ""; + memcpy(unit, units + MED_SNAME_SIZE * comp, MED_SNAME_SIZE * sizeof(char)); + field->GetUnit()->SetValue(comp, unit); + + char compName[MED_SNAME_SIZE + 1] = ""; + memcpy(compName, componentNames + MED_SNAME_SIZE * comp, MED_SNAME_SIZE + * sizeof(char)); + field->GetComponentName()->SetValue(comp, compName); + } + + delete[] units; + delete[] componentNames; + + med_int ninterp = MEDfieldnInterp(FileId, field->GetName()); + if(ninterp < 0) + { + vtkErrorMacro("Error in MEDfieldnInterp"); + return; + } + + field->AllocateNumberOfInterpolation(ninterp); + + for(med_int interpit=0; interpitGetInterpolation(interpit); + interp->SetMedIterator(interpit + 1); + this->ReadInterpolationInformation(interp); + } + + vtkMedFieldStep* previousStep = NULL; + + for(med_int csit = 0; csit < nstep; csit++) + { + vtkMedFieldStep* step = vtkMedFieldStep::New(); + step->SetMedIterator(csit + 1); + step->SetParentField(field); + this->ReadFieldStepInformation(step, true); + field->AddFieldStep(step); + step->SetPreviousStep(previousStep); + previousStep = step; + step->Delete(); + } +} + +void vtkMedDriver30::ReadFieldStepInformation(vtkMedFieldStep* step, bool readAllEntityInfo) +{ + vtkMedComputeStep cs; + vtkMedComputeStep meshcs; + vtkMedField* field = step->GetParentField(); + + FileOpen open(this); + + if( MEDfieldComputingStepMeshInfo( + FileId, + field->GetName(), + step->GetMedIterator(), + &cs.TimeIt, + &cs.IterationIt, + &cs.TimeOrFrequency, + &meshcs.TimeIt, + &meshcs.IterationIt) < 0) + { + vtkErrorMacro("Error in MEDfieldComputingStepMeshInfo"); + return; + } + + step->SetComputeStep(cs); + step->SetMeshComputeStep(meshcs); + + if(!readAllEntityInfo || step->GetEntityInfoLoaded()) + return; + + step->SetEntityInfoLoaded(1); + + vtkMedFile* file = field->GetParentFile(); + vtkMedMesh* mesh = file->GetMesh(field->GetMeshName()); + + if(mesh == NULL) + return; + + std::set tmp_entities; + std::set entities; + mesh->GatherMedEntities(tmp_entities); + + std::set::iterator tmp_entity_it = tmp_entities.begin(); + while(tmp_entity_it != tmp_entities.end()) + { + vtkMedEntity entity = *tmp_entity_it; + tmp_entity_it++; + entities.insert(entity); + if(entity.EntityType == MED_CELL) + { + vtkMedEntity newEntity; + newEntity.EntityType = MED_NODE_ELEMENT; + newEntity.GeometryType = entity.GeometryType; + newEntity.GeometryName = entity.GeometryName; + entities.insert(newEntity); + } + } + + vtkMedEntity pointEntity; + pointEntity.EntityType = MED_NODE; + pointEntity.GeometryType = MED_NONE; + pointEntity.GeometryName = MED_NAME_BLANK; + entities.insert(pointEntity); + + std::set::iterator entity_it = entities.begin(); + while(entity_it != entities.end()) + { + vtkMedEntity entity = *entity_it; + entity_it++; + + med_int nvalues = 0; + med_int nprofile; + char profilename[MED_NAME_SIZE+1] = ""; + char localizationname[MED_NAME_SIZE+1] = ""; + + nprofile = MEDfieldnProfile( + this->FileId, + field->GetName(), + step->GetComputeStep().TimeIt, + step->GetComputeStep().IterationIt, + entity.EntityType, + entity.GeometryType, + profilename, + localizationname); + if(nprofile < 0) + { + vtkErrorMacro("MEDfieldnProfile"); + continue; + } + + bool hasprofile = (nprofile > 0); + if(!hasprofile) + { + nprofile = 1; + } + + med_int profilesize; + med_int nintegrationpoint; + + for(int pid=0; pidFileId, + field->GetName(), + step->GetComputeStep().TimeIt, + step->GetComputeStep().IterationIt, + entity.EntityType, + entity.GeometryType, + medid, + MED_COMPACT_PFLMODE, + profilename, + &profilesize, + localizationname, + &nintegrationpoint); + + if(nvalues < 0) + { + vtkErrorMacro("MEDfieldnValueWithProfile"); + continue; + } + else if(nvalues > 0) + { + // I have found a profile with values, stop the loop here + break; + } + } + + if(nvalues > 0) + { + vtkMedFieldOverEntity* fieldOverEntity = vtkMedFieldOverEntity::New(); + step->AppendFieldOverEntity(fieldOverEntity); + fieldOverEntity->Delete(); + + fieldOverEntity->SetParentStep(step); + fieldOverEntity->SetEntity(entity); + + this->ReadFieldOverEntityInformation(fieldOverEntity); + } + } +} + +void vtkMedDriver30::ReadFieldOverEntityInformation(vtkMedFieldOverEntity* fieldOverEntity) +{ + FileOpen open(this); + + vtkMedFieldStep* step = fieldOverEntity->GetParentStep(); + vtkMedField* field = step->GetParentField(); + vtkMedEntity entity = fieldOverEntity->GetEntity(); + + const char* fieldName = field->GetName(); + const vtkMedComputeStep& cs = step->GetComputeStep(); + + char profilename[MED_NAME_SIZE+1] = ""; + char localizationname[MED_NAME_SIZE+1] = ""; + + med_int nProfiles = MEDfieldnProfile( + this->FileId, + fieldName, + cs.TimeIt, + cs.IterationIt, + entity.EntityType, + entity.GeometryType, + profilename, + localizationname); + + if(nProfiles < 0) + { + vtkErrorMacro("MEDfieldnProfile"); + } + else if(nProfiles == 0) + { + fieldOverEntity->SetHasProfile(0); + nProfiles = 1; + } + else + { + fieldOverEntity->SetHasProfile(1); + } + fieldOverEntity->AllocateNumberOfFieldOnProfile(nProfiles); + for(int profit = 0; profit < nProfiles; profit++) + { + vtkMedFieldOnProfile* fop = fieldOverEntity->GetFieldOnProfile(profit); + med_int medid = (fieldOverEntity->GetHasProfile()? profit+1: -1); + fop->SetMedIterator(medid); + fop->SetParentFieldOverEntity(fieldOverEntity); + this->ReadFieldOnProfileInformation(fop); + } +} + +void vtkMedDriver30::ReadFieldOnProfileInformation(vtkMedFieldOnProfile* fop) +{ + vtkMedFieldOverEntity* fieldOverEntity = fop->GetParentFieldOverEntity(); + vtkMedFieldStep* step = fieldOverEntity->GetParentStep(); + vtkMedField* field = step->GetParentField(); + + const vtkMedComputeStep& cs = step->GetComputeStep(); + med_int profilesize; + med_int nbofintegrationpoint; + + char profileName[MED_NAME_SIZE+1] = ""; + char localizationName[MED_NAME_SIZE+1] = ""; + + med_int nvalue = MEDfieldnValueWithProfile(FileId, + field->GetName(), + cs.TimeIt, + cs.IterationIt, + fieldOverEntity->GetEntity().EntityType, + fieldOverEntity->GetEntity().GeometryType, + fop->GetMedIterator(), + MED_COMPACT_STMODE, + profileName, + &profilesize, + localizationName, + &nbofintegrationpoint); + + if(nvalue < 0) + { + vtkErrorMacro("Error while reading MEDfieldnValueWithProfile"); + } + + fop->SetProfileName(profileName); + fop->SetLocalizationName(localizationName); + fop->SetNumberOfValues(nvalue); + fop->SetNumberOfIntegrationPoint(nbofintegrationpoint); + fop->SetProfileSize(profilesize); +} + +void vtkMedDriver30::ReadMeshInformation(vtkMedMesh* mesh) +{ + FileOpen open(this); + + med_int mdim = 0; + med_int sdim = 0; + med_mesh_type meshtype; + + med_sorting_type sortingtype; + med_int nstep = 0; + med_axis_type axistype; + med_int naxis; + + if ( (naxis=MEDmeshnAxis(this->FileId, mesh->GetMedIterator())) <0 ) + { + vtkDebugMacro("Error reading mesh axis number"); + } + + if(naxis == 0) + naxis=MEDmeshnAxis(this->FileId, mesh->GetMedIterator()); + + char axisname[3*MED_SNAME_SIZE+1] = ""; + char axisunit[3*MED_SNAME_SIZE+1] = ""; + char name[MED_NAME_SIZE+1] = ""; + char description[MED_COMMENT_SIZE+1] = ""; + char timeUnit[MED_SNAME_SIZE+1] = ""; + + if( MEDmeshInfo( this->FileId, + mesh->GetMedIterator(), + name, + &sdim, + &mdim, + &meshtype, + description, + timeUnit, + &sortingtype, + &nstep, + &axistype, + axisname, + axisunit ) ) + { + vtkErrorMacro("Error reading mesh"); + } + + mesh->SetName(name); + mesh->SetDescription(description); + mesh->SetTimeUnit(timeUnit); + mesh->SetSpaceDimension(sdim); + mesh->SetMeshDimension(mdim); + mesh->SetMeshType(meshtype); + mesh->SetSortingType(sortingtype); + mesh->SetAxisType(axistype); + mesh->SetNumberOfAxis(naxis); + + for(int axis = 0; axis < naxis; axis++) + { + char theaxisname[MED_SNAME_SIZE+1] = ""; + char theaxisunit[MED_SNAME_SIZE+1] = ""; + strncpy(theaxisname, axisname + axis*MED_SNAME_SIZE, MED_SNAME_SIZE); + strncpy(theaxisunit, axisunit + axis*MED_SNAME_SIZE, MED_SNAME_SIZE); + mesh->GetAxisName()->SetValue(axis, theaxisname); + mesh->GetAxisUnit()->SetValue(axis, theaxisunit); + } + + char universalName[MED_LNAME_SIZE+1] = ""; + + if(MEDmeshUniversalNameRd(this->FileId, name, + universalName) < 0) + { + vtkDebugMacro("MEDmeshUniversalNameRd < 0"); + } + mesh->SetUniversalName(universalName); + + // read the Information data of all families. + // writing the family 0 is optional, + // but I need it, so add it if it is not here. + + med_int nfam = MEDnFamily(this->FileId, name); + + for(int index = 0; index < nfam; index++) + { + vtkMedFamily* family = vtkMedFamily::New(); + family->SetMedIterator(index + 1); + this->ReadFamilyInformation(mesh, family); + family->Delete(); + } + + // this creates a family 0 if none has been read + vtkMedFamily* familyZeroOnCell = mesh->GetOrCreateCellFamilyById(0); + vtkMedFamily* familyZeroOnPoint = mesh->GetOrCreatePointFamilyById(0); + + // Load Information regarding the grid type + if(meshtype == MED_STRUCTURED_MESH) + { + // Do it for structured data + med_grid_type mtg; + if(MEDmeshGridTypeRd(FileId, name, &mtg) < 0) + { + vtkErrorMacro("Error during structured grid Information loading."); + return; + } + mesh->SetStructuredGridType(mtg); + } + + vtkMedGrid* previousGrid = NULL; + for(int gid=1; gid <= nstep; gid++) + { + vtkMedComputeStep cs; + if(MEDmeshComputationStepInfo(FileId, + name, + gid, + &cs.TimeIt, + &cs.IterationIt, + &cs.TimeOrFrequency) < 0) + { + vtkErrorMacro("MEDmeshComputationStepInfo error"); + } + // Load Information regarding the grid type + vtkMedGrid* grid = NULL; + if(meshtype == MED_STRUCTURED_MESH) + { + switch(mesh->GetStructuredGridType()) + { + case MED_CARTESIAN_GRID: + grid = vtkMedCartesianGrid::New(); + break; + case MED_POLAR_GRID: + grid = vtkMedPolarGrid::New(); + break; + case MED_CURVILINEAR_GRID: + grid = vtkMedCurvilinearGrid::New(); + break; + default: + vtkErrorMacro("Unknown structured grid type " << mesh->GetStructuredGridType()); + return; + } + } + else //(mesh->GetType() == MED_STRUCTURED_MESH) + { + grid = vtkMedUnstructuredGrid::New(); + } + grid->SetParentMesh(mesh); + grid->SetComputeStep(cs); + this->ReadGridInformation(grid); + mesh->AddGridStep(grid); + grid->Delete(); + grid->SetPreviousGrid(previousGrid); + previousGrid = grid; + } +} + +void vtkMedDriver30::ReadLocalizationInformation(vtkMedLocalization* loc) +{ + FileOpen open(this); + + med_int ngp; + med_int spaceDimension; + med_geometry_type type_geo; + med_geometry_type sectiongeotype; + med_int nsectionmeshcell; + + char name[MED_NAME_SIZE+1] = ""; + char interpolationName[MED_NAME_SIZE+1] = ""; + char sectionName[MED_NAME_SIZE+1] = ""; + + if(MEDlocalizationInfo( + this->FileId, + loc->GetMedIterator(), + name, + &type_geo, + &spaceDimension, + &ngp, + interpolationName, + sectionName, + &nsectionmeshcell, + §iongeotype ) < 0) + { + vtkErrorMacro("Reading information on quadrature points definition : " + << loc->GetMedIterator()); + } + + loc->SetName(name); + loc->SetInterpolationName(interpolationName); + loc->SetSectionName(sectionName); + loc->SetNumberOfQuadraturePoint(ngp); + loc->SetGeometryType(type_geo); + loc->SetSpaceDimension(spaceDimension); + loc->SetNumberOfCellInSection(nsectionmeshcell); + loc->SetSectionGeometryType(sectiongeotype); + + med_float *localCoordinates = new med_float[loc->GetSizeOfPointLocalCoordinates()]; + med_float *pqLocalCoordinates = new med_float[loc->GetSizeOfQuadraturePointLocalCoordinates()]; + med_float *weights = new med_float[loc->GetSizeOfWeights()]; + + if(MEDlocalizationRd(FileId, + loc->GetName(), + MED_FULL_INTERLACE, + localCoordinates, + pqLocalCoordinates, + weights) < 0) + { + vtkErrorMacro("MEDlocalizationRd : " << loc->GetName()); + } + + vtkDoubleArray* lc = loc->GetPointLocalCoordinates(); + vtkDoubleArray *pqlc = loc->GetQuadraturePointLocalCoordinates(); + vtkDoubleArray *w = loc->GetWeights(); + + lc->SetNumberOfValues(loc->GetSizeOfPointLocalCoordinates()); + for(int i=0; iGetSizeOfPointLocalCoordinates(); i++) + { + lc->SetValue(i, localCoordinates[i]); + } + + pqlc->SetNumberOfValues(loc->GetSizeOfQuadraturePointLocalCoordinates()); + for(int i=0; iGetSizeOfQuadraturePointLocalCoordinates(); i++) + { + pqlc->SetValue(i, pqLocalCoordinates[i]); + } + + w->SetNumberOfValues(loc->GetSizeOfWeights()); + for(int i=0; iGetSizeOfWeights(); i++) + { + w->SetValue(i, weights[i]); + } +} + +void vtkMedDriver30::ReadInterpolationInformation(vtkMedInterpolation* interp) +{ + + med_geometry_type geotype; + med_bool cellnode; + med_int nbofbasisfunc; + med_int nbofvariable; + med_int maxdegree; + med_int nmaxcoef; + + char name[MED_NAME_SIZE+1] = ""; + + if(MEDinterpInfo (this->FileId, + interp->GetMedIterator(), + name, + &geotype, &cellnode, &nbofbasisfunc, + &nbofvariable, &maxdegree, &nmaxcoef) < 0) + { + vtkErrorMacro("MEDinterpInfo"); + return; + } + + interp->SetName(name); + interp->SetGeometryType(geotype); + interp->SetIsCellNode(cellnode); + interp->SetNumberOfVariable(nbofvariable); + interp->SetMaximumDegree(maxdegree); + interp->SetMaximumNumberOfCoefficient(nmaxcoef); + interp->AllocateNumberOfBasisFunction(nbofbasisfunc); + + for(int basisid=0; basisid < nbofbasisfunc; basisid++) + { + vtkMedFraction* func = interp->GetBasisFunction(basisid); + func->SetNumberOfVariable(nbofvariable); + + med_int ncoef = MEDinterpBaseFunctionCoefSize ( + this->FileId, + interp->GetName(), + basisid+1); + func->SetNumberOfCoefficients(ncoef); + + if(ncoef <= 0 || nbofvariable <= 0) + continue; + + med_int *power = new med_int[nbofvariable * ncoef]; + med_float *coefficient = new med_float[ncoef]; + + if(MEDinterpBaseFunctionRd ( + this->FileId, + interp->GetName(), + basisid+1, + &ncoef, + power, + coefficient) < 0) + { + vtkErrorMacro("MEDinterpBaseFunctionRd"); + continue; + } + vtkDoubleArray* coeffs = func->GetCoefficients(); + for(int cid=0; cid < ncoef; cid++) + { + coeffs->SetValue(cid, coefficient[cid]); + } + vtkIntArray* powers = func->GetPowers(); + for(int pid=0; pid < ncoef*nbofvariable; pid++) + { + powers->SetValue(pid, power[pid]); + } + + delete[] power; + delete[] coefficient; + } +} + +void vtkMedDriver30::ReadSupportMeshInformation( + vtkMedMesh* supportMesh) +{ + FileOpen open(this); + + char supportmeshname[MED_NAME_SIZE+1] = ""; + char description[MED_COMMENT_SIZE+1] = ""; + med_int spacedim; + med_int meshdim; + med_axis_type axistype; + char axisname[3*MED_SNAME_SIZE+1] = ""; + char axisunit[3*MED_SNAME_SIZE+1] = ""; + + if(MEDsupportMeshInfo (this->FileId, + supportMesh->GetMedIterator(), + supportmeshname, + &spacedim, + &meshdim, + description, + &axistype, + axisname, + axisunit) < 0) + { + vtkErrorMacro("MEDsupportMeshInfo"); + } + + supportMesh->SetName(supportmeshname); + supportMesh->SetDescription(description); + supportMesh->SetSpaceDimension(spacedim); + supportMesh->SetMeshDimension(meshdim); + supportMesh->SetAxisType(axistype); + for(int dim = 0; dim < 3; dim++) + { + char axisname_dim[MED_SNAME_SIZE+1] = ""; + char axisunit_dim[MED_SNAME_SIZE+1] = ""; + + strncpy(axisname_dim, axisname+dim*MED_SNAME_SIZE, MED_SNAME_SIZE); + strncpy(axisunit_dim, axisunit+dim*MED_SNAME_SIZE, MED_SNAME_SIZE); + + supportMesh->GetAxisName()->SetValue(dim, axisname_dim); + supportMesh->GetAxisUnit()->SetValue(dim, axisunit_dim); + } + + return; +} + +void vtkMedDriver30::LoadFamilyIds(vtkMedEntityArray* array) +{ + if(array->IsFamilyIdsLoaded()) + return; + + FileOpen open(this); + + vtkMedGrid* grid = array->GetParentGrid(); + + vtkMedComputeStep cs = grid->GetComputeStep(); + + // first, find if the family ids are implicit or explicit + med_bool changement, transformation; + + med_int nfamid = MEDmeshnEntity(this->FileId, + grid->GetParentMesh()->GetName(), + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + array->GetEntity().GeometryType, + MED_FAMILY_NUMBER, + MED_NO_CMODE, + &changement, + &transformation); + + if(nfamid == array->GetNumberOfEntity()) + { + + vtkMedIntArray* famIds = vtkMedIntArray::New(); + array->SetFamilyIds(famIds); + famIds->Delete(); + + famIds->SetNumberOfTuples(nfamid); + + if ( MEDmeshEntityFamilyNumberRd( + this->FileId, + grid->GetParentMesh()->GetName(), + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + array->GetEntity().GeometryType, + famIds->GetPointer(0) ) < 0) + { + vtkWarningMacro("Error loading the family ids of entity " + << array->GetEntity().EntityType + << " " << array->GetEntity().GeometryType + << " on mesh " << grid->GetParentMesh()->GetName()); + array->SetFamilyIds(NULL); + } + } + else + { + vtkDebugMacro("NumberOfEntity != Number of family ids"); + array->SetFamilyIds(NULL); + } + + array->ComputeFamilies(); +} + +void vtkMedDriver30::LoadPointGlobalIds(vtkMedGrid* grid) +{ + if(grid->IsPointGlobalIdsLoaded()) + return; + + FileOpen open(this); + + vtkMedIntArray* globalIds = vtkMedIntArray::New(); + grid->SetPointGlobalIds(globalIds); + globalIds->Delete(); + + globalIds->SetNumberOfTuples(grid->GetNumberOfPoints()); + + if( MEDmeshEntityNumberRd ( + this->FileId, + grid->GetParentMesh()->GetName(), + grid->GetComputeStep().TimeIt, + grid->GetComputeStep().IterationIt, + MED_NODE, + MED_NONE, + globalIds->GetPointer(0) ) < 0) + { + grid->SetPointGlobalIds(NULL); + } +} + +void vtkMedDriver30::LoadCoordinates(vtkMedGrid* grid) +{ + if(grid->IsCoordinatesLoaded()) + return; + + vtkMedRegularGrid* rgrid = vtkMedRegularGrid::SafeDownCast(grid); + if(rgrid != NULL) + { + this->LoadRegularGridCoordinates(rgrid); + return; + } + + vtkMedUnstructuredGrid* ugrid = vtkMedUnstructuredGrid::SafeDownCast(grid); + vtkMedCurvilinearGrid* cgrid = vtkMedCurvilinearGrid::SafeDownCast(grid); + if(ugrid == NULL && cgrid == NULL) + { + //TODO : deal with structured grids + vtkWarningMacro("this kind of grid is not yet supported"); + return; + } + + if(grid->GetUsePreviousCoordinates()) + { + vtkMedGrid* previousgrid = grid->GetPreviousGrid(); + if(previousgrid == NULL) + { + vtkErrorMacro("coordiantes have not changed, " + << "but there is no previous grid!"); + return; + } + + this->LoadCoordinates(previousgrid); + if(ugrid != NULL) + ugrid->SetCoordinates(vtkMedUnstructuredGrid::SafeDownCast(previousgrid) + ->GetCoordinates()); + if(cgrid != NULL) + cgrid->SetCoordinates(vtkMedCurvilinearGrid::SafeDownCast(previousgrid) + ->GetCoordinates()); + } + else + { + + FileOpen open(this); + + vtkDataArray* coords = vtkMedUtilities::NewCoordArray(); + if(ugrid != NULL) + ugrid->SetCoordinates(coords); + if(cgrid != NULL) + cgrid->SetCoordinates(coords); + coords->Delete(); + + vtkMedComputeStep cs = grid->GetComputeStep(); + + coords->SetNumberOfComponents(grid->GetParentMesh()->GetSpaceDimension()); + coords->SetNumberOfTuples(grid->GetNumberOfPoints()); + + if ( MEDmeshNodeCoordinateRd( this->FileId, + grid->GetParentMesh()->GetName(), + cs.TimeIt, + cs.IterationIt, + MED_FULL_INTERLACE, + (med_float*) coords->GetVoidPointer(0) ) < 0) + { + vtkErrorMacro("Load Coordinates for mesh " + << grid->GetParentMesh()->GetName()); + } + } +} + +void vtkMedDriver30::LoadProfile(vtkMedProfile* profile) +{ + if(!profile || profile->IsLoaded()) + return; + + FileOpen open(this); + + vtkMedIntArray* indices = vtkMedIntArray::New(); + profile->SetIds(indices); + indices->Delete(); + + indices->SetNumberOfTuples(profile->GetNumberOfElement()); + + char name[MED_NAME_SIZE+1] = ""; + + if( MEDprofileRd(this->FileId, + profile->GetName(), + indices->GetPointer(0) ) < 0) + { + vtkErrorMacro("Reading profile indices "); + } +} + +void vtkMedDriver30::LoadConnectivity(vtkMedEntityArray* array) +{ + if(array->IsConnectivityLoaded()) + return; + + FileOpen open(this); + + vtkMedGrid* grid = array->GetParentGrid(); + + grid = array->GetParentGrid(); + + const char* meshName = grid->GetParentMesh()->GetName(); + + vtkMedIntArray* conn = vtkMedIntArray::New(); + array->SetConnectivityArray(conn); + conn->Delete(); + + vtkMedComputeStep cs = grid->GetComputeStep(); + + med_bool change; + med_bool transformation; + + if(array->GetEntity().GeometryType == MED_POLYGON) + { + // first check if we have points + med_int connSize = MEDmeshnEntity( + this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + MED_POLYGON, + MED_CONNECTIVITY, + array->GetConnectivity(), + &change, + &transformation); + + if (connSize < 0) + { + vtkErrorMacro(<< "Error while reading polygons connectivity size." + << endl ); + return; + } + + conn->SetNumberOfTuples(connSize); + + // How many polygon in the mesh in nodal connectivity mode + // For the polygons, we get the size of array index + med_int indexsize; + if ((indexsize = MEDmeshnEntity(this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + MED_POLYGON, + MED_INDEX_NODE, + array->GetConnectivity(), + &change, + &transformation )) < 0) + { + vtkErrorMacro(<< "Error while reading polygons array index." << endl ); + return; + } + + vtkMedIntArray* index = vtkMedIntArray::New(); + array->SetFaceIndex(index); + index->Delete(); + + index->SetNumberOfTuples( indexsize ); + + if ( MEDmeshPolygonRd(this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + array->GetConnectivity(), + index->GetPointer(0), + conn->GetPointer(0) ) < 0) + { + vtkErrorMacro(<< "MEDmeshPolygonRd"); + return; + } + } + else if(array->GetEntity().GeometryType == MED_POLYHEDRON) + { + + vtkIdType connSize = MEDmeshnEntity(this->FileId, + meshName, + grid->GetComputeStep().TimeIt, + grid->GetComputeStep().IterationIt, + array->GetEntity().EntityType, + MED_POLYHEDRON, + MED_CONNECTIVITY, + array->GetConnectivity(), + &change, + &transformation); + if (connSize < 0) + { + vtkErrorMacro(<< "Error while reading polyhedrons connectivity size." + << endl ); + return; + } + + conn->SetNumberOfTuples(connSize); + + vtkMedIntArray* faceIndex = vtkMedIntArray::New(); + array->SetFaceIndex(faceIndex); + faceIndex->Delete(); + + vtkMedIntArray* nodeIndex = vtkMedIntArray::New(); + array->SetNodeIndex(nodeIndex); + nodeIndex->Delete(); + + vtkIdType np = array->GetNumberOfEntity() + 1; + faceIndex->SetNumberOfTuples(np); + + med_int nodeIndexSize; + + if ((nodeIndexSize = MEDmeshnEntity(this->FileId, + meshName, + grid->GetComputeStep().TimeIt, + grid->GetComputeStep().IterationIt, + array->GetEntity().EntityType, + MED_POLYHEDRON, + MED_INDEX_NODE, + array->GetConnectivity(), + &change, + &transformation )) < 0) + { + vtkErrorMacro(<< "Error while reading polygons array index." << endl ); + return; + } + + nodeIndex->SetNumberOfTuples(nodeIndexSize); + + if (MEDmeshPolyhedronRd(this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + array->GetConnectivity(), + faceIndex->GetPointer(0), + nodeIndex->GetPointer(0), + conn->GetPointer(0) ) < 0) + { + vtkErrorMacro("Error while reading connectivity of polyhedrons"); + return; + } + + } + else + { + bool doReadConnectivity = true; + if(array->GetConnectivity() == MED_NODAL) + { + if(array->GetEntity().EntityType == MED_STRUCT_ELEMENT) + { + if(array->GetStructElement() == NULL) + { + vtkErrorMacro("Entity type = MED_STRUCT_ELEMENT, but StructElement is not set!"); + return; + } + vtkIdType ntuple = array->GetNumberOfEntity() + * array->GetStructElement()->GetConnectivitySize(); + + conn->SetNumberOfTuples(ntuple); + // particles are special : connectivity is not stored in the med file + if(strcmp(array->GetStructElement()->GetName(), MED_PARTICLE_NAME) == 0 ) + { + for(vtkIdType cellId = 0; cellId < ntuple; cellId++) + { + conn->SetValue(cellId, cellId+1); + } + doReadConnectivity = false; + } + } + else + { + conn->SetNumberOfTuples(array->GetNumberOfEntity() + * vtkMedUtilities::GetNumberOfPoint( + array->GetEntity().GeometryType)); + } + } + else + { + conn->SetNumberOfTuples(array->GetNumberOfEntity() + * vtkMedUtilities::GetNumberOfSubEntity( + array->GetEntity().GeometryType)); + } + + if (this->ParallelFileId == -1) // also (array->GetFilter() == NULL) + { + if ( (MEDmeshElementConnectivityRd( + this->FileId, + meshName, + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + array->GetEntity().GeometryType, + array->GetConnectivity(), + MED_FULL_INTERLACE, + conn->GetPointer(0)) ) < 0) + { + vtkErrorMacro("Error while load connectivity of cells " + << array->GetEntity().GeometryType); + } + } + else + { + med_filter filter = MED_FILTER_INIT; + + int start; + int stride; + int count; + int blocksize; + int lastblocksize; + array->GetFilter()->GetFilterSizes(start, stride, count, + blocksize, lastblocksize ); + + med_int nbofconstituentpervalue = vtkMedUtilities::GetNumberOfNodes( + array->GetEntity().GeometryType); + + if ( MEDfilterBlockOfEntityCr( this->ParallelFileId, + array->GetNumberOfEntity(), + 1, // one is for mesh elements, more than 1 is for fields + nbofconstituentpervalue, + MED_ALL_CONSTITUENT, + MED_FULL_INTERLACE, + MED_COMPACT_STMODE, + MED_NO_PROFILE, + (med_size)start, + (med_size)stride, + (med_size)count, + (med_size)blocksize, + (med_size)lastblocksize, + &filter ) < 0 ) + { + vtkErrorMacro("Filter creation "); + } + + if ( (MEDmeshElementConnectivityAdvancedRd( + this->ParallelFileId, + meshName, + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + array->GetEntity().GeometryType, + array->GetConnectivity(), + &filter, + conn->GetPointer(0)) ) < 0) + { + vtkErrorMacro("Error while load connectivity of cells " + << array->GetEntity().GeometryType); + } + + if ( MEDfilterClose( &filter ) < 0) + { + vtkErrorMacro("ERROR : filter closing ..."); + } + + } + } +} + +void vtkMedDriver30::LoadCellGlobalIds(vtkMedEntityArray* array) +{ + if(array->IsGlobalIdsLoaded()) + return; + + FileOpen open(this); + + vtkMedIntArray* globalIds = vtkMedIntArray::New(); + array->SetGlobalIds(globalIds); + globalIds->Delete(); + + globalIds->SetNumberOfTuples(array->GetNumberOfEntity()); + + vtkMedGrid* grid = array->GetParentGrid(); + vtkMedComputeStep cs = grid->GetComputeStep(); + + if( MEDmeshEntityNumberRd ( + this->FileId, + grid->GetParentMesh()->GetName(), + cs.TimeIt, + cs.IterationIt, + array->GetEntity().EntityType, + array->GetEntity().GeometryType, + globalIds->GetPointer(0) ) < 0) + { + array->SetGlobalIds(NULL); + } +} + +void vtkMedDriver30::LoadField(vtkMedFieldOnProfile* fop, med_storage_mode mode) +{ + FileOpen open(this); + + vtkMedFieldOverEntity* fieldOverEntity = fop->GetParentFieldOverEntity(); + vtkMedFieldStep *step = fieldOverEntity->GetParentStep(); + vtkMedField* field = step->GetParentField(); + const vtkMedComputeStep& cs = step->GetComputeStep(); + + vtkDataArray* data = vtkMedUtilities::NewArray(field->GetDataType()); + fop->SetData(data); + data->Delete(); + + med_int size; + if(mode == MED_COMPACT_STMODE) + { + size = fop->GetNumberOfValues(); + } + else + { + med_int profilesize; + med_int nbofintegrationpoint; + char profileName[MED_NAME_SIZE+1] = ""; + char localizationName[MED_NAME_SIZE+1] = ""; + size = MEDfieldnValueWithProfile(this->FileId, + field->GetName(), + cs.TimeIt, + cs.IterationIt, + fieldOverEntity->GetEntity().EntityType, + fieldOverEntity->GetEntity().GeometryType, + fop->GetMedIterator(), + MED_GLOBAL_STMODE, + profileName, + &profilesize, + localizationName, + &nbofintegrationpoint); + } + + if(fop->GetNumberOfIntegrationPoint() > 1) + { + size *= fop->GetNumberOfIntegrationPoint(); + } + + data->SetNumberOfComponents(field->GetNumberOfComponent()); + data->SetNumberOfTuples(size); + if (this->ParallelFileId == -1) + { + if ( MEDfieldValueWithProfileRd( + this->FileId, + field->GetName(), + cs.TimeIt, + cs.IterationIt, + fieldOverEntity->GetEntity().EntityType, + fieldOverEntity->GetEntity().GeometryType, + mode, + fop->GetProfileName(), + MED_FULL_INTERLACE, + MED_ALL_CONSTITUENT, + (unsigned char*) data->GetVoidPointer(0) ) < 0) + { + vtkErrorMacro("Error on MEDfieldValueWithProfileRd"); + } + } + else + { + if (field->GetFieldType() == vtkMedField::CellField) + { + med_filter filter = MED_FILTER_INIT; + + int start; + int stride; + int count; + int blocksize; + int lastblocksize; + fop->GetFilter()->GetFilterSizes(start, stride, count, + blocksize, lastblocksize ); + + if ( MEDfilterBlockOfEntityCr( this->ParallelFileId, + fop->GetNumberOfValues(), + 1, // one is for mesh elements, more than 1 is for fields + field->GetNumberOfComponent(), + MED_ALL_CONSTITUENT, + MED_FULL_INTERLACE, + MED_COMPACT_STMODE, + MED_NO_PROFILE, + (med_size)start, + (med_size)stride, + (med_size)count, + (med_size)blocksize, + (med_size)lastblocksize, + &filter ) < 0 ) + { + vtkErrorMacro("Filter creation "); + } + + if ( MEDfieldValueAdvancedRd( + this->ParallelFileId, + field->GetName(), + cs.TimeIt, + cs.IterationIt, + fieldOverEntity->GetEntity().EntityType, + fieldOverEntity->GetEntity().GeometryType, + &filter, + (unsigned char*) data->GetVoidPointer(0) ) < 0) + { + vtkErrorMacro("Error on MEDfieldValueAdvancedRd"); + } + + if ( MEDfilterClose( &filter ) < 0) + { + vtkErrorMacro("ERROR : filter closing ..."); + } + } + else + {//TODO : option utilisateur pour desactiver ou non les champs avec profile en // + if ( MEDfieldValueWithProfileRd( + this->FileId, + field->GetName(), + cs.TimeIt, + cs.IterationIt, + fieldOverEntity->GetEntity().EntityType, + fieldOverEntity->GetEntity().GeometryType, + mode, + fop->GetProfileName(), + MED_FULL_INTERLACE, + MED_ALL_CONSTITUENT, + (unsigned char*) data->GetVoidPointer(0) ) < 0) + { + vtkErrorMacro("Error on MEDfieldValueWithProfileRd"); + } + } + } +} + +void vtkMedDriver30::LoadVariableAttribute(vtkMedVariableAttribute* varatt, + vtkMedEntityArray* array) +{ + FileOpen open(this); + + void *value = NULL; + + vtkAbstractArray* valuearray = array->GetVariableAttributeValue(varatt); + // first test if this is already loaded + if(valuearray != NULL && valuearray->GetNumberOfTuples() > 0) + return; + + if(valuearray == NULL) + { + valuearray = vtkMedUtilities::NewArray(varatt->GetAttributeType()); + array->SetVariableAttributeValues(varatt, valuearray); + valuearray->Delete(); + } + + valuearray->SetNumberOfComponents(varatt->GetNumberOfComponent()); + valuearray->SetNumberOfTuples(array->GetNumberOfEntity()); + valuearray->SetName(varatt->GetName()); + + vtkSmartPointer chararray = vtkSmartPointer::New(); + + if(varatt->GetAttributeType() != MED_ATT_NAME) + { + value = valuearray->GetVoidPointer(0); + } + else + { + chararray->SetNumberOfValues(varatt->GetNumberOfComponent() * + array->GetNumberOfEntity() * + MED_NAME_SIZE); + + value = chararray->GetVoidPointer(0); + } + + vtkMedComputeStep cs = array->GetParentGrid()->GetComputeStep(); + + if(MEDmeshStructElementVarAttRd( + this->FileId, + array->GetParentGrid()->GetParentMesh()->GetName(), + cs.TimeIt, + cs.IterationIt, + varatt->GetParentStructElement()->GetGeometryType(), + varatt->GetName(), + value) < 0) + { + + if(cs.IterationIt == MED_NO_IT && cs.TimeIt == MED_NO_DT && cs.TimeOrFrequency == MED_UNDEF_DT) + { + vtkErrorMacro("MEDmeshStructElementVarAttRd"); + return; + } + // try to see if I can reuse + // the variable attributes of the NO_DT, NO_IT compute step + vtkMedComputeStep nocs; + nocs.IterationIt = MED_NO_IT; + nocs.TimeIt = MED_NO_DT; + nocs.TimeOrFrequency = MED_UNDEF_DT; + vtkMedEntityArray* nocs_array = + array->GetParentGrid()->GetParentMesh()->GetGridStep(nocs)->GetEntityArray(array->GetEntity()); + if(nocs_array == NULL) + { + nocs_array = array->GetParentGrid()->GetParentMesh()->GetGridStep(0)->GetEntityArray(array->GetEntity()); + } + + if(nocs_array == NULL || nocs_array == array) + { + // try to force load the default compute step. + if(MEDmeshStructElementVarAttRd( + this->FileId, + array->GetParentGrid()->GetParentMesh()->GetName(), + nocs.TimeIt, + nocs.IterationIt, + varatt->GetParentStructElement()->GetGeometryType(), + varatt->GetName(), + value) < 0) + { + vtkErrorMacro("MEDmeshStructElementVarAttRd"); + return; + } + } + else + { + this->LoadVariableAttribute(varatt, nocs_array); + array->SetVariableAttributeValues(varatt, nocs_array->GetVariableAttributeValue(varatt)); + return; + } + } + + // If I am here, it means that I read the values + if(varatt->GetAttributeType() == MED_ATT_NAME) + { + char current_name[MED_NAME_SIZE+1] = ""; + vtkStringArray* sarray = vtkStringArray::SafeDownCast(valuearray); + for(vtkIdType id = 0; id < varatt->GetNumberOfComponent() * + array->GetNumberOfEntity(); id++) + { + memset(current_name, '\0', MED_NAME_SIZE+1); + strncpy(current_name, ((char*)value) + id*MED_NAME_SIZE, MED_NAME_SIZE); + sarray->SetValue(id, current_name); + } + } + + return; +} + +void vtkMedDriver30::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedDriver30.h b/src/Plugins/MedReader/IO/vtkMedDriver30.h new file mode 100644 index 00000000..d74b4ce9 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedDriver30.h @@ -0,0 +1,168 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedDriver30_h_ +#define __vtkMedDriver30_h_ + +#include "vtkObject.h" +#include "vtkMed.h" +#include "vtkMedDriver.h" + +class vtkMedFile; +class vtkMedMesh; +class vtkMedField; +class vtkMedFamily; +class vtkMedRegularGrid; +class vtkMedCurvilinearGrid; +class vtkMedUnstructuredGrid; +class vtkMedLocalization; +class vtkMedProfile; +class vtkMedFieldOverEntity; +class vtkMedEntityArray; +class vtkMedFieldStep; +class vtkMedLink; +class vtkMedStructElement; +class vtkMedConstantAttribute; +class vtkMedVariableAttribute; + +class VTK_EXPORT vtkMedDriver30: public vtkMedDriver +{ +public: + static vtkMedDriver30* New(); + vtkTypeRevisionMacro(vtkMedDriver30, vtkMedDriver) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // load all meta data associated with this file. + virtual void ReadFileInformation(vtkMedFile*); + + // Description: + // load all meta data associated with this mesh. + virtual void ReadMeshInformation(vtkMedMesh*); + + // Description: + // load all meta data associated with this field. + virtual void ReadFieldInformation(vtkMedField*); + + // Description: + // load all meta data associated with this regular (Cartesian or polar) grid. + virtual void ReadRegularGridInformation(vtkMedRegularGrid*); + + // Description: + // load all meta data associated with this standard grid. + virtual void ReadCurvilinearGridInformation(vtkMedCurvilinearGrid*); + + // Description: + // load all meta data associated with this unstructured grid. + virtual void ReadUnstructuredGridInformation(vtkMedUnstructuredGrid*); + + // Description: + // load all meta data associated with this family. + virtual void ReadFamilyInformation(vtkMedMesh*, vtkMedFamily*); + + // Description: + // load all meta data associated with this family. + virtual void ReadProfileInformation(vtkMedProfile*); + + // Description: + // load information on a field and a given cell type at a given step + virtual void ReadFieldOverEntityInformation(vtkMedFieldOverEntity*); + + // Description: + // load information related to the given quadrature scheme definition + virtual void ReadLocalizationInformation(vtkMedLocalization*); + + // Description: + // load all information associated witht this field step + virtual void ReadFieldStepInformation(vtkMedFieldStep*, bool readAllEntityInfo); + + // Description: + // load all information related to this interpolation function + virtual void ReadInterpolationInformation(vtkMedInterpolation*); + + // Description: + // load all information related to this field on this profile + virtual void ReadFieldOnProfileInformation(vtkMedFieldOnProfile*); + + // Description: + // load all information related to this field on this profile + virtual void ReadLinkInformation(vtkMedLink*); + + // Description: + // read all information related to the structural elements models + // in this file + virtual void ReadStructElementInformation(vtkMedStructElement*); + + // Description: + // read all information related to the support mesh + // in this file + virtual void ReadSupportMeshInformation(vtkMedMesh*); + + // Description: + // read all information related to the support mesh + // in this file + virtual void ReadConstantAttributeInformation(vtkMedConstantAttribute*); + + // Description: + // read all information related to the support mesh + // in this file + virtual void ReadVariableAttributeInformation(vtkMedVariableAttribute*); + + // Description: + // load the field on this profile + virtual void LoadField(vtkMedFieldOnProfile*, med_storage_mode mode); + + // Description: + // Load the indices of the profile + virtual void LoadProfile(vtkMedProfile* profile); + + // Description: + // Load the values of the given step +// void Load(vtkMedFieldOnProfile*); + + virtual void LoadFamilyIds(vtkMedEntityArray*); + + virtual void LoadCoordinates(vtkMedGrid*); + + virtual void LoadPointGlobalIds(vtkMedGrid*); + + //virtual void LoadFamilyIds(vtkMedGrid*); + + virtual void LoadConnectivity(vtkMedEntityArray*); + + virtual void LoadCellGlobalIds(vtkMedEntityArray*); + + virtual void LoadRegularGridCoordinates(vtkMedRegularGrid*); + + virtual void LoadVariableAttribute(vtkMedVariableAttribute*, + vtkMedEntityArray*); + +protected: + vtkMedDriver30(); + ~vtkMedDriver30(); + + void ReadNumberOfEntity(vtkMedUnstructuredGrid*, + med_entity_type, med_connectivity_mode); + +private: + vtkMedDriver30(const vtkMedDriver30&); // Not implemented. + void operator=(const vtkMedDriver30&); // Not implemented. +}; + +#endif //__vtkMedDriver30_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedEntityArray.cxx b/src/Plugins/MedReader/IO/vtkMedEntityArray.cxx new file mode 100644 index 00000000..931c0acf --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedEntityArray.cxx @@ -0,0 +1,531 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedEntityArray.h" + +#include "vtkObjectFactory.h" +#include "vtkMedIntArray.h" +#include "vtkMedUtilities.h" +#include "vtkMedFamily.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedMesh.h" +#include "vtkMedGrid.h" +#include "vtkMedUnstructuredGrid.h" +#include "vtkMedRegularGrid.h" +#include "vtkMedCurvilinearGrid.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" +#include "vtkMedStructElement.h" + +#include "vtkIdList.h" + +#include +using std::set; + +vtkCxxSetObjectVectorMacro(vtkMedEntityArray, FamilyOnEntity, vtkMedFamilyOnEntity); +vtkCxxGetObjectVectorMacro(vtkMedEntityArray, FamilyOnEntity, vtkMedFamilyOnEntity); +vtkCxxSetObjectMacro(vtkMedEntityArray,FamilyIds,vtkMedIntArray); +vtkCxxSetObjectMacro(vtkMedEntityArray,GlobalIds,vtkMedIntArray); +vtkCxxSetObjectMacro(vtkMedEntityArray,ConnectivityArray,vtkMedIntArray); +vtkCxxSetObjectMacro(vtkMedEntityArray,FaceIndex,vtkMedIntArray); +vtkCxxSetObjectMacro(vtkMedEntityArray,NodeIndex,vtkMedIntArray); + +vtkCxxSetObjectMacro(vtkMedEntityArray,ParentGrid,vtkMedGrid); +vtkCxxSetObjectMacro(vtkMedEntityArray,StructElement,vtkMedStructElement); + +vtkCxxRevisionMacro(vtkMedEntityArray, "$Revision$"); +vtkStandardNewMacro(vtkMedEntityArray); + +vtkMedEntityArray::vtkMedEntityArray() +{ + this->NumberOfEntity = 0; + this->Connectivity = MED_NODAL; + this->FamilyIds = NULL; + this->GlobalIds = NULL; + this->ConnectivityArray = NULL; + this->FaceIndex = NULL; + this->NodeIndex = NULL; + this->InitialGlobalId = 0; + this->FamilyOnEntity = new vtkObjectVector (); + this->FamilyIdStatus = vtkMedEntityArray::FAMILY_ID_NOT_LOADED; + this->ParentGrid = NULL; + this->StructElement = NULL; + //this->Filter = NULL; +} + +vtkMedEntityArray::~vtkMedEntityArray() +{ + this->SetFamilyIds(NULL); + this->SetGlobalIds(NULL); + this->SetConnectivityArray(NULL); + this->SetFaceIndex(NULL); + this->SetNodeIndex(NULL); + delete this->FamilyOnEntity; + this->SetParentGrid(NULL); + this->SetStructElement(NULL); + //this->SetFilter(NULL); +} + +void vtkMedEntityArray::Initialize() +{ + this->SetFamilyIds(NULL); + this->SetGlobalIds(NULL); + this->SetConnectivityArray(NULL); + this->SetFaceIndex(NULL); + this->SetNodeIndex(NULL); + this->FamilyOnEntity->clear(); + this->FamilyIdStatus = FAMILY_ID_NOT_LOADED; +} + +void vtkMedEntityArray::ComputeFamilies() +{ + this->FamilyOnEntity->clear(); + vtkMedMesh* mesh = this->ParentGrid->GetParentMesh(); + + if(this->FamilyIds == NULL) + { + vtkMedFamilyOnEntity* foe = vtkMedFamilyOnEntity::New(); + foe->SetParentGrid(this->ParentGrid); + this->AppendFamilyOnEntity(foe); + foe->Delete(); + if(this->GetEntity().EntityType != MED_NODE) + { + foe->SetFamily(mesh->GetOrCreateCellFamilyById(0)); + } + else + { + foe->SetFamily(mesh->GetOrCreatePointFamilyById(0)); + } + foe->SetEntityArray(this); + this->FamilyIdStatus = vtkMedEntityArray::FAMILY_ID_IMPLICIT; + return; + } + + this->FamilyIdStatus = vtkMedEntityArray::FAMILY_ID_EXPLICIT; + + set idset; + for (vtkIdType index = 0; index < this->FamilyIds->GetNumberOfTuples(); index++) + { + med_int id = this->FamilyIds->GetValue(index); + idset.insert(id); + } + + for (set::iterator it = idset.begin(); it != idset.end(); it++) + { + vtkMedFamilyOnEntity* foe = vtkMedFamilyOnEntity::New(); + foe->SetParentGrid(this->ParentGrid); + this->AppendFamilyOnEntity(foe); + foe->Delete(); + if(this->GetEntity().EntityType != MED_NODE) + { + foe->SetFamily(mesh->GetOrCreateCellFamilyById(*it)); + } + else + { + foe->SetFamily(mesh->GetOrCreatePointFamilyById(*it)); + } + foe->SetEntityArray(this); + } +} + +med_int vtkMedEntityArray::GetFamilyId(med_int id) +{ + if(this->FamilyIdStatus == FAMILY_ID_IMPLICIT) + return 0; + if(this->FamilyIdStatus == FAMILY_ID_NOT_LOADED) + { + vtkErrorMacro("You have to load family ids before asking for it!"); + } + return this->FamilyIds->GetValue(id); +} + +int vtkMedEntityArray::HasFamily(vtkMedFamily* family) +{ + for (int i = 0; i < this->FamilyOnEntity->size(); i++) + { + vtkMedFamilyOnEntity* foe = this->FamilyOnEntity->at(i); + if(foe->GetFamily() == family) + return 1; + } + return 0; +} + +int vtkMedEntityArray::IsConnectivityLoaded() +{ + // Entity Arrays representing something else than cells + // have no connectivity + + if(vtkMedUnstructuredGrid::SafeDownCast(this->GetParentGrid()) == NULL) + return 1; + + if( this->Entity.EntityType != MED_CELL && + this->Entity.EntityType != MED_DESCENDING_FACE && + this->Entity.EntityType != MED_DESCENDING_EDGE && + this->Entity.EntityType != MED_STRUCT_ELEMENT) + return 1; + + if(this->ConnectivityArray == NULL) + return 0; + + if(this->Connectivity == MED_NODAL && this->Entity.EntityType != MED_STRUCT_ELEMENT) + { + vtkIdType connSize = this->NumberOfEntity + * vtkMedUtilities::GetNumberOfPoint(this->Entity.GeometryType); + + return connSize == this->ConnectivityArray->GetNumberOfTuples(); + } + else if (this->Connectivity == MED_NODAL && this->Entity.EntityType == MED_STRUCT_ELEMENT) + { + if(this->StructElement == NULL) + return 1; + + vtkIdType connSize = this->NumberOfEntity + * this->StructElement->GetConnectivitySize(); + + return connSize == this->ConnectivityArray->GetNumberOfTuples(); + } + else + { + vtkIdType connSize = this->NumberOfEntity + * vtkMedUtilities::GetNumberOfSubEntity(this->Entity.GeometryType); + + return connSize == this->ConnectivityArray->GetNumberOfTuples(); + } +} + +int vtkMedEntityArray::IsFamilyIdsLoaded() +{ + return this->FamilyIdStatus != vtkMedEntityArray::FAMILY_ID_NOT_LOADED;; +} + +int vtkMedEntityArray::IsGlobalIdsLoaded() +{ + return this->GlobalIds != NULL && this->GlobalIds->GetNumberOfTuples() + == this->NumberOfEntity; +} + +void vtkMedEntityArray::GetCellVertices(vtkIdType index, vtkIdList* ids) +{ + ids->Initialize(); + + if(this->Entity.EntityType == MED_NODE) + { + ids->InsertNextId(index); + return; + } + + if( this->Entity.EntityType != MED_CELL && + this->Entity.EntityType != MED_DESCENDING_FACE && + this->Entity.EntityType != MED_DESCENDING_EDGE && + this->Entity.EntityType != MED_STRUCT_ELEMENT) + { + vtkErrorMacro("This reader is not compatible with those entities (yet)..."); + return; + } + + if(vtkMedUnstructuredGrid::SafeDownCast(this->ParentGrid) == NULL) + { + // this is a structured grid, connectivity is implicit... + + if(this->Entity.GeometryType == MED_POINT1) + { + // degenerate case if there is only one point + ids->InsertNextId(0); + return; + } + if(this->Entity.GeometryType == MED_SEG2) + { + // line + ids->InsertNextId(index); + ids->InsertNextId(index+1); + return; + } + vtkMedRegularGrid* vtkrgrid = vtkMedRegularGrid::SafeDownCast( + this->GetParentGrid()); + vtkMedCurvilinearGrid* vtkcgrid = vtkMedCurvilinearGrid::SafeDownCast( + this->GetParentGrid()); + vtkIdType xncell = 0; + vtkIdType yncell = 0; + vtkIdType zncell = 0; + vtkIdType xnpts = 1; + vtkIdType ynpts = 1; + vtkIdType znpts = 1; + if(vtkrgrid!=NULL) + { + xncell = vtkrgrid->GetAxisSize(0)-1; + yncell = vtkrgrid->GetAxisSize(1)-1; + zncell = vtkrgrid->GetAxisSize(2)-1; + xnpts = vtkrgrid->GetAxisSize(0); + ynpts = vtkrgrid->GetAxisSize(1); + znpts = vtkrgrid->GetAxisSize(2); + } + if(vtkcgrid != NULL) + { + xncell = vtkcgrid->GetAxisSize(0)-1; + yncell = vtkcgrid->GetAxisSize(1)-1; + zncell = vtkcgrid->GetAxisSize(2)-1; + xnpts = vtkcgrid->GetAxisSize(0); + ynpts = vtkcgrid->GetAxisSize(1); + znpts = vtkcgrid->GetAxisSize(2); + } + vtkIdType xindex = index % xncell; + if(xncell <= 0) + return; + + vtkIdType yindex = index / xncell; + + if(this->Entity.GeometryType == MED_QUAD4) + { + // plane + + ids->InsertNextId(xindex + yindex*xnpts); + ids->InsertNextId(xindex + 1 + yindex*xnpts); + ids->InsertNextId(xindex + yindex*xnpts); + ids->InsertNextId(xindex + 1 + (yindex + 1)*xnpts); + return; + } + + if(yncell <= 0) + return; + + vtkIdType zindex = index / (xncell*yncell); + + if(this->Entity.GeometryType == MED_HEXA8) + { + // volume + ids->InsertNextId(xindex + (yindex )*xnpts + (zindex )*xnpts*ynpts); + ids->InsertNextId(xindex+1 + (yindex )*xnpts + (zindex )*xnpts*ynpts); + ids->InsertNextId(xindex + (yindex+1)*xnpts + (zindex )*xnpts*ynpts); + ids->InsertNextId(xindex+1 + (yindex+1)*xnpts + (zindex )*xnpts*ynpts); + ids->InsertNextId(xindex + (yindex )*xnpts + (zindex+1)*xnpts*ynpts); + ids->InsertNextId(xindex+1 + (yindex )*xnpts + (zindex+1)*xnpts*ynpts); + ids->InsertNextId(xindex + (yindex+1)*xnpts + (zindex+1)*xnpts*ynpts); + ids->InsertNextId(xindex+1 + (yindex+1)*xnpts + (zindex+1)*xnpts*ynpts); + return; + } + return; + } + + this->LoadConnectivity(); + + if (this->GetEntity().GeometryType==MED_POLYHEDRON) + { + vtkMedIntArray* conn = this->GetConnectivityArray(); + vtkMedIntArray* faceIndex = this->GetFaceIndex(); + vtkMedIntArray* nodeIndex = this->GetNodeIndex(); + med_int start = faceIndex->GetValue(index)-1; + med_int end = faceIndex->GetValue(index+1)-1; + // the use of a set loses the order, but VTK do not support this order anyway. + if (this->GetConnectivity()==MED_NODAL) + { + for (int ff = start; ffGetValue(ff)-1; + med_int fend = nodeIndex->GetValue(ff+1)-1; + for (int pt = fstart; ptGetValue(pt)-1; + ids->InsertNextId(ptid); + } + } + } + else // MED_DESCENDING + { + vtkMedUnstructuredGrid* ugrid = + vtkMedUnstructuredGrid::SafeDownCast(this->ParentGrid); + if (!ugrid) + { + vtkErrorMacro( + "MED_DESCENDING connectivity is only supported on unstructured grids"); + return; + } + set pts; + vtkIdList* subIds = vtkIdList::New(); + for (int ff = start; ffGetValue(ff)-1; + vtkMedEntity entity; + entity.GeometryType = (med_geometry_type) NodeIndex->GetValue(ff); + entity.EntityType = MED_DESCENDING_FACE; + vtkMedEntityArray* subarray = ugrid->GetEntityArray(entity); + subarray->GetCellVertices(fid, subIds); + for (int id = 0; idGetNumberOfIds(); id++) + { + med_int ptid = subIds->GetId(id); + if(pts.find(ptid) == pts.end()) + { + ids->InsertNextId(ptid); + pts.insert(ptid); + } + } + } + subIds->Delete(); + } + }//end polyhedron + else if (this->GetEntity().GeometryType==MED_POLYGON) + { + vtkMedIntArray* conn = this->GetConnectivityArray(); + vtkMedIntArray* nids = this->GetFaceIndex(); + med_int start = nids->GetValue(index)-1; + med_int end = nids->GetValue(index+1)-1; + if (this->GetConnectivity()==MED_NODAL) + { + for (int pt = start; ptInsertNextId(conn->GetValue(pt)-1); + } + } + else // MED_DESCENDING + { + vtkIdList* subpts=vtkIdList::New(); + vtkMedUnstructuredGrid* ugrid = + vtkMedUnstructuredGrid::SafeDownCast(this->ParentGrid); + if (!ugrid) + { + vtkErrorMacro("MED_DESCENDING connectivity is only " + << "supported on unstructured grids"); + return; + } + set pts; + for (int sub = start; subGetValue(sub)-1; + vtkMedEntity subentity; + subentity.GeometryType = MED_SEG2; + subentity.EntityType = MED_DESCENDING_EDGE; + vtkMedEntityArray* subarray = ugrid->GetEntityArray(subentity); + subarray->GetCellVertices(subid, subpts); + for(int id=0; idGetNumberOfIds(); id++) + { + med_int ptid = subpts->GetId(id); + if(pts.find(ptid) != pts.end()) + { + pts.insert(ptid); + ids->InsertNextId(ptid); + } + } + } + subpts->Delete(); + } + }//end poygon + else if (this->GetConnectivity()==MED_NODAL || + vtkMedUtilities::GetDimension(this->GetEntity().GeometryType)<1) + { + int npts = 0; + if(this->GetEntity().EntityType == MED_STRUCT_ELEMENT) + { + if(this->StructElement != NULL) + { + npts = this->StructElement->GetConnectivitySize(); + } + } + else + { + npts = vtkMedUtilities::GetNumberOfPoint(this->GetEntity().GeometryType); + } + vtkMedIntArray* conn = this->GetConnectivityArray(); + for (int i = 0; iGetValue(npts*index+i)-1; + ids->InsertNextId(ptid); + } + }//end nodal case + else + { + vtkIdList* subpts=vtkIdList::New(); + int nsub=vtkMedUtilities::GetNumberOfSubEntity( + this->GetEntity().GeometryType); + vtkMedUnstructuredGrid* ugrid = + vtkMedUnstructuredGrid::SafeDownCast(this->ParentGrid); + if (!ugrid) + { + vtkErrorMacro( + "MED_DESCENDING connectivity is only supported on unstructured grids"); + return; + } + vtkMedIntArray* conn=this->GetConnectivityArray(); + ids->SetNumberOfIds(vtkMedUtilities::GetNumberOfPoint( + this->GetEntity().GeometryType)); + for (int sub = 0; subGetValue(nsub*index+sub)-1; + bool invert = false; + if(subid < 0) + { + subid = -subid; + invert = true; + } + + vtkMedEntity subentity; + subentity.GeometryType = vtkMedUtilities::GetSubGeometry( + this->GetEntity().GeometryType, sub); + subentity.EntityType = vtkMedUtilities::GetSubType( + this->GetEntity().EntityType); + vtkMedEntityArray* subarray = ugrid->GetEntityArray(subentity); + if(subarray == NULL) + { + subentity.EntityType = MED_CELL; + subarray = ugrid->GetEntityArray(subentity); + } + if(subarray == NULL) + { + vtkDebugMacro( << "Missing sub entity array " << subentity.GeometryType); + this->Valid = false; + break; + } + subarray->GetCellVertices(subid, subpts); + vtkMedUtilities::ProjectConnectivity(this->GetEntity().GeometryType, ids, subpts, + sub, invert); + } + subpts->Delete(); + } +} + +void vtkMedEntityArray::LoadConnectivity() +{ + if(this->IsConnectivityLoaded()) + return; + + this->GetParentGrid()->GetParentMesh()->GetParentFile()->GetMedDriver() + ->LoadConnectivity(this); +} + +void vtkMedEntityArray::SetVariableAttributeValues( + vtkMedVariableAttribute* varatt, vtkAbstractArray* value) +{ + this->VariableAttributeValue[varatt] = value; +} + +vtkAbstractArray* vtkMedEntityArray::GetVariableAttributeValue( + vtkMedVariableAttribute* varatt) +{ + if(this->VariableAttributeValue.find(varatt) + == this->VariableAttributeValue.end()) + return NULL; + + return this->VariableAttributeValue[varatt]; +} + +void vtkMedEntityArray::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, NumberOfEntity) + PRINT_IVAR(os, indent, Connectivity) + PRINT_IVAR(os, indent, InitialGlobalId) +} diff --git a/src/Plugins/MedReader/IO/vtkMedEntityArray.h b/src/Plugins/MedReader/IO/vtkMedEntityArray.h new file mode 100644 index 00000000..df8a079a --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedEntityArray.h @@ -0,0 +1,200 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedEntityArray_h_ +#define __vtkMedEntityArray_h_ + +#include "vtkObject.h" +#include "vtkMedSetGet.h" +#include "vtkMedUtilities.h" +#include "vtkMed.h" +#include "vtkMedFilter.h" + +class vtkMedIntArray; +class vtkFamilyIdSet; +class vtkMedFamily; +class vtkMedFamilyOnEntity; +class vtkMedMesh; +class vtkMedGrid; +class vtkIdList; +class vtkMedStructElement; +class vtkMedVariableAttribute; + +class VTK_EXPORT vtkMedEntityArray: public vtkObject +{ +public: + static vtkMedEntityArray* New(); + vtkTypeRevisionMacro(vtkMedEntityArray, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the number of cells of this entity type. + vtkSetMacro(NumberOfEntity, vtkIdType); + vtkGetMacro(NumberOfEntity, vtkIdType); + + // Description: + // the support of the cells : one of + void SetEntity(const vtkMedEntity& entity){this->Entity = entity;} + const vtkMedEntity& GetEntity(){return this->Entity;} + + // Description: + // This connectivity type of this entity : one of + // MED_NODAL, MED_DESCENDING, MED_NO_CMODE + vtkSetMacro(Connectivity, med_connectivity_mode); + vtkGetMacro(Connectivity, med_connectivity_mode); + + // Description: + // This array stores the family ids of each entity. + virtual void SetConnectivityArray(vtkMedIntArray*); + vtkGetObjectMacro(ConnectivityArray, vtkMedIntArray); + + // Description: + // This array stores the connectivity array for this entity. + virtual void SetFamilyIds(vtkMedIntArray*); + virtual med_int GetFamilyId(med_int id); + + // Description: + // This array stores the global Ids of the entities. + virtual void SetGlobalIds(vtkMedIntArray*); + vtkGetObjectMacro(GlobalIds, vtkMedIntArray); + + // Description: + // For polygons, this array stores the index of each edge described in + // the connectivity array + // For polyhedrons, this arrays stores the index of each face described + // in the NodeIndex array + virtual void SetFaceIndex(vtkMedIntArray*); + vtkGetObjectMacro(FaceIndex, vtkMedIntArray); + + // Description: + // For polyhedrons, this arrays can store either + // the index of each node of each face described in the Index1 array + // (node connectivity) or the type each face described in the Index1 + // array (hierarchical connectivity) + virtual void SetNodeIndex(vtkMedIntArray*); + vtkGetObjectMacro(NodeIndex, vtkMedIntArray); + + // Description: + // Arrays of entities are partitionned over families. + vtkSetObjectVectorMacro(FamilyOnEntity, vtkMedFamilyOnEntity); + vtkGetObjectVectorMacro(FamilyOnEntity, vtkMedFamilyOnEntity); + + // Description: + // For polyhedrons, this arrays can store either + // the index of each node of each face described in the Index1 array + // (node connectivity) or the type each face described in the Index1 + // array (hierarchical connectivity) + virtual void SetParentGrid(vtkMedGrid*); + vtkGetObjectMacro(ParentGrid, vtkMedGrid); + + // Description: + // Compute the list of families that are on this array + virtual void ComputeFamilies(); + + // Description: + // returns true if there are cells of the given family on this entity. + virtual int HasFamily(vtkMedFamily*); + + // Description: + // returns 1 if the connectivity array is set and matches the number of + // connectivity elements. + virtual int IsConnectivityLoaded(); + + // Description: + // returns 1 if the family ids is set and matches the number of entities. + virtual int IsFamilyIdsLoaded(); + + // Description: + // returns 1 if the global ids is set and matches the number of entities. + virtual int IsGlobalIdsLoaded(); + + // Description : + // This gives the global id of the first element of this array. + vtkSetMacro(InitialGlobalId, vtkIdType); + vtkGetMacro(InitialGlobalId, vtkIdType); + + // Description : + // resets all to default status, release memory + virtual void Initialize(); + + // Description: + // Get the indices of the vertices used by a given cell. + void GetCellVertices(vtkIdType, vtkIdList*); + + virtual void LoadConnectivity(); + + // Descritpion: + // This is a pointer to the StructElement object if any + // This pointer is set during the LinkMedInfo pass + virtual void SetStructElement(vtkMedStructElement*); + vtkGetObjectMacro(StructElement, vtkMedStructElement); + + void SetVariableAttributeValues(vtkMedVariableAttribute*, + vtkAbstractArray*); + vtkAbstractArray* GetVariableAttributeValue(vtkMedVariableAttribute*); + + // Description: + // Get/Set of the MED Filter for parallel reading. + void SetFilter(vtkMedFilter* filter){this->Filter = filter;} + vtkMedFilter* GetFilter(){return this->Filter;} + +protected: + vtkMedEntityArray(); + virtual ~vtkMedEntityArray(); + + vtkIdType NumberOfEntity; + vtkMedEntity Entity; + + vtkMedFilter* Filter; + + med_connectivity_mode Connectivity; + vtkIdType InitialGlobalId; + + vtkMedGrid* ParentGrid; + + vtkMedIntArray* FamilyIds; + vtkMedIntArray* GlobalIds; + vtkMedIntArray* ConnectivityArray; + vtkMedIntArray* FaceIndex; + vtkMedIntArray* NodeIndex; + + vtkMedStructElement* StructElement; + + int FamilyIdStatus; + enum{ + FAMILY_ID_NOT_LOADED, + FAMILY_ID_IMPLICIT, + FAMILY_ID_EXPLICIT + }; + + //BTX + vtkObjectVector* FamilyOnEntity; + + std::map > + VariableAttributeValue; + //ETX + + int Valid; + +private: + vtkMedEntityArray(const vtkMedEntityArray&); // Not implemented. + void operator=(const vtkMedEntityArray&); // Not implemented. +}; + +#endif //__vtkMedEntityArray_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFactory.cxx b/src/Plugins/MedReader/IO/vtkMedFactory.cxx new file mode 100644 index 00000000..d66ff49d --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFactory.cxx @@ -0,0 +1,45 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFactory.h" + +#include "vtkObjectFactory.h" + +#include "vtkMedDriver30.h" + +vtkCxxRevisionMacro(vtkMedFactory, "$Revision$") +vtkStandardNewMacro(vtkMedFactory) + +vtkMedFactory::vtkMedFactory() +{ +} + +vtkMedFactory::~vtkMedFactory() +{ +} + +vtkMedDriver* vtkMedFactory::NewMedDriver(int major, int minor, int release) +{ + return vtkMedDriver30::New(); +} + +void vtkMedFactory::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFactory.h b/src/Plugins/MedReader/IO/vtkMedFactory.h new file mode 100644 index 00000000..cfdf1dae --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFactory.h @@ -0,0 +1,44 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFactory_h_ +#define __vtkMedFactory_h_ + +#include "vtkObject.h" +class vtkMedDriver; + +class VTK_EXPORT vtkMedFactory: public vtkObject +{ +public: + static vtkMedFactory* New(); + vtkTypeRevisionMacro(vtkMedFactory, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + virtual vtkMedDriver* NewMedDriver(int major, int minor, int release); + +protected: + vtkMedFactory(); + virtual ~vtkMedFactory(); + +private: + vtkMedFactory(const vtkMedFactory&); // Not implemented. + void operator=(const vtkMedFactory&); // Not implemented. +}; + +#endif //__vtkMedFactory_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFamily.cxx b/src/Plugins/MedReader/IO/vtkMedFamily.cxx new file mode 100644 index 00000000..5cd940d1 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFamily.cxx @@ -0,0 +1,63 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFamily.h" + +#include "vtkObjectFactory.h" +#include "vtkSmartPointer.h" + +#include "vtkMedGroup.h" +#include "vtkMedUtilities.h" + +vtkCxxGetObjectVectorMacro(vtkMedFamily, Group, vtkMedGroup); +vtkCxxSetObjectVectorMacro(vtkMedFamily, Group, vtkMedGroup); + +vtkCxxRevisionMacro(vtkMedFamily, "$Revision$") +vtkStandardNewMacro(vtkMedFamily) + +vtkMedFamily::vtkMedFamily() +{ + this->Id = 0; + this->Name = NULL; + this->Group = new vtkObjectVector(); + this->MedIterator = -1; + this->PointOrCell = vtkMedUtilities::OnPoint; + + // by default, the family is part of the "NoGroup" fake group + this->AllocateNumberOfGroup(1); + vtkMedGroup* nogroup = this->GetGroup(0); + nogroup->SetName(vtkMedUtilities::NoGroupName); + + this->SetName("UNDEFINED_FAMILY"); +} + +vtkMedFamily::~vtkMedFamily() +{ + this->SetName(NULL); + delete this->Group; +} + +void vtkMedFamily::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, Id); + PRINT_IVAR(os, indent, MedIterator); + PRINT_IVAR(os, indent, PointOrCell); + PRINT_OBJECT_VECTOR(os, indent, Group); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFamily.h b/src/Plugins/MedReader/IO/vtkMedFamily.h new file mode 100644 index 00000000..81c3cb0e --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFamily.h @@ -0,0 +1,83 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFamily_h_ +#define __vtkMedFamily_h_ + +#include "vtkObject.h" +#include "vtkMedSetGet.h" +#include "vtkMed.h" + +class vtkMedMesh; +class vtkMedGroup; +class vtkMedString; + +class VTK_EXPORT vtkMedFamily: public vtkObject +{ +public: + static vtkMedFamily* New(); + vtkTypeRevisionMacro(vtkMedFamily, vtkObject); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Set the name of this family. + vtkSetStringMacro(Name); + vtkGetStringMacro(Name); + + // Description: + // The id of this family. + vtkGetMacro(Id, med_int); + vtkSetMacro(Id, med_int); + + // Description: + // Each family can be part of one or several groups. + // This give access to the group names. + vtkGetObjectVectorMacro(Group, vtkMedGroup); + vtkSetObjectVectorMacro(Group, vtkMedGroup); + + // Description: + // returns id this is a node or a cell centered family. + vtkSetMacro(PointOrCell, int); + vtkGetMacro(PointOrCell, int); + + // Description: + // the index of this field in the med file. + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + +protected: + vtkMedFamily(); + virtual ~vtkMedFamily(); + + med_int Id; + med_int MedIterator; + char* Name; + int PointOrCell; + + //BTX + vtkObjectVector* Group; + //ETX + +private: + vtkMedFamily(const vtkMedFamily&); // Not implemented. + void operator=(const vtkMedFamily&); // Not implemented. + +}; + +#endif //__vtkMedFamily_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFamilyOnEntity.cxx b/src/Plugins/MedReader/IO/vtkMedFamilyOnEntity.cxx new file mode 100644 index 00000000..6d72c4d9 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFamilyOnEntity.cxx @@ -0,0 +1,130 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFamilyOnEntity.h" + +#include "vtkObjectFactory.h" +#include "vtkMedUtilities.h" +#include "vtkMedFamily.h" +#include "vtkMedEntityArray.h" +#include "vtkMedMesh.h" +#include "vtkMedGrid.h" +#include "vtkMedFamilyOnEntityOnProfile.h" + +vtkCxxSetObjectMacro(vtkMedFamilyOnEntity, Family, vtkMedFamily); +vtkCxxSetObjectMacro(vtkMedFamilyOnEntity, EntityArray, vtkMedEntityArray); + +vtkCxxSetObjectMacro(vtkMedFamilyOnEntity, ParentGrid,vtkMedGrid); + +vtkCxxRevisionMacro(vtkMedFamilyOnEntity, "$Revision$"); +vtkStandardNewMacro(vtkMedFamilyOnEntity) + +vtkMedFamilyOnEntity::vtkMedFamilyOnEntity() +{ + this->Family = NULL; + this->EntityArray = NULL; + this->ParentGrid = NULL; +} + +vtkMedFamilyOnEntity::~vtkMedFamilyOnEntity() +{ + this->SetFamily(NULL); + this->SetEntityArray(NULL); + this->SetParentGrid(NULL); +} + +vtkMedEntity vtkMedFamilyOnEntity::GetEntity() +{ + if(this->EntityArray != NULL) + { + return this->EntityArray->GetEntity(); + } + + return vtkMedEntity(MED_NODE, MED_POINT1); +} + +int vtkMedFamilyOnEntity::GetPointOrCell() +{ + if(this->GetEntity().EntityType == MED_NODE) + return vtkMedUtilities::OnPoint; + return vtkMedUtilities::OnCell; +} + +int vtkMedFamilyOnEntity::GetVertexOnly() +{ + if(this->GetPointOrCell() == vtkMedUtilities::OnPoint || + this->EntityArray == NULL) + return true; + + vtkMedEntity entity = this->EntityArray->GetEntity(); + if(entity.EntityType == MED_POINT1 || entity.GeometryType == MED_NONE) + return true; + + if(entity.GeometryName == MED_BALL_NAME && entity.EntityType == MED_STRUCT_ELEMENT) + return true; + + if(entity.GeometryName == MED_PARTICLE_NAME && entity.EntityType == MED_STRUCT_ELEMENT) + return true; + + return false; +} + +void vtkMedFamilyOnEntity::AddFamilyOnEntityOnProfile( + vtkMedFamilyOnEntityOnProfile* foep) +{ + this->FamilyOnEntityOnProfile[foep->GetProfile()] = foep; +} + +int vtkMedFamilyOnEntity::GetNumberOfFamilyOnEntityOnProfile() +{ + return this->FamilyOnEntityOnProfile.size(); +} + +vtkMedFamilyOnEntityOnProfile* vtkMedFamilyOnEntity:: + GetFamilyOnEntityOnProfile(vtkMedProfile* profile) +{ + if(this->FamilyOnEntityOnProfile.find(profile) + != this->FamilyOnEntityOnProfile.end()) + return this->FamilyOnEntityOnProfile[profile]; + + return NULL; +} + +vtkMedFamilyOnEntityOnProfile* vtkMedFamilyOnEntity:: + GetFamilyOnEntityOnProfile(int index) +{ + if(index < 0 || index >= this->FamilyOnEntityOnProfile.size()) + return NULL; + + std::map >::iterator it = + this->FamilyOnEntityOnProfile.begin(); + + for(int ii=0; iisecond; +} + +void vtkMedFamilyOnEntity::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_OBJECT(os, indent, Family); + PRINT_OBJECT(os, indent, EntityArray); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFamilyOnEntity.h b/src/Plugins/MedReader/IO/vtkMedFamilyOnEntity.h new file mode 100644 index 00000000..10bf3176 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFamilyOnEntity.h @@ -0,0 +1,100 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFamilyOnEntity_h_ +#define __vtkMedFamilyOnEntity_h_ + +// Description : +// This class represents the intersection between a family and an entity. + +#include "vtkObject.h" +#include "vtkMed.h" +#include "vtkMedUtilities.h" + +class vtkMedEntityArray; +class vtkMedFamily; +class vtkMedGrid; +class vtkMedFamilyOnEntityOnProfile; +class vtkMedIntArray; + +class VTK_EXPORT vtkMedFamilyOnEntity : public vtkObject +{ +public : + static vtkMedFamilyOnEntity* New(); + vtkTypeRevisionMacro(vtkMedFamilyOnEntity, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the family of this family on entity. + virtual void SetFamily(vtkMedFamily*); + vtkGetObjectMacro(Family, vtkMedFamily); + + // Description: + // This is the entity array this family on entity is on. + virtual void SetEntityArray(vtkMedEntityArray*); + vtkGetObjectMacro(EntityArray, vtkMedEntityArray); + + // Description: + // This is the grid this family on entity is reffering to + virtual void SetParentGrid(vtkMedGrid*); + vtkGetObjectMacro(ParentGrid, vtkMedGrid); + + // Description : + // Returns vtkMedUtilities::OnPoint (0) or vtkMedUtilities::OnCell (1) + virtual int GetPointOrCell(); + + // Description : + // Returns true if the family is on points or if the entity is MED_POINT1 + // of if it is MED_BALL or MED_PARTICLE elements + virtual int GetVertexOnly(); + + // Description: + // returns the entity descriptor associated with this family on entity + virtual vtkMedEntity GetEntity(); + + // Description: + // Fields can use profile to be stored on a subset of entities. + // a priori, profiles and families are independent notions. + // In case there are profiles, we create the intersection of the profile and + // the FamilyOnEntity to be able to map the field on the geometry. + // BEFORE calling those function, you have to have assigned a profile + // to the vtkMedFamilyOnEntityOnProfile + void AddFamilyOnEntityOnProfile(vtkMedFamilyOnEntityOnProfile*); + int GetNumberOfFamilyOnEntityOnProfile(); + vtkMedFamilyOnEntityOnProfile* GetFamilyOnEntityOnProfile(vtkMedProfile*); + vtkMedFamilyOnEntityOnProfile* GetFamilyOnEntityOnProfile(int index); + +protected: + vtkMedFamilyOnEntity(); + virtual ~vtkMedFamilyOnEntity(); + + vtkMedFamily* Family; + vtkMedEntityArray* EntityArray; + vtkMedGrid* ParentGrid; + + std::map > + FamilyOnEntityOnProfile; + +private: + vtkMedFamilyOnEntity(const vtkMedFamilyOnEntity&); // Not implemented. + void operator=(const vtkMedFamilyOnEntity&); // Not implemented. + +}; + +#endif //__vtkMedFamilyOnEntity_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFamilyOnEntityOnProfile.cxx b/src/Plugins/MedReader/IO/vtkMedFamilyOnEntityOnProfile.cxx new file mode 100644 index 00000000..9666c4a7 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFamilyOnEntityOnProfile.cxx @@ -0,0 +1,591 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFamilyOnEntityOnProfile.h" + +#include "vtkObjectFactory.h" +#include "vtkMedUtilities.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedProfile.h" +#include "vtkMedEntityArray.h" +#include "vtkMedFamily.h" +#include "vtkMedField.h" +#include "vtkMedGrid.h" +#include "vtkMedMesh.h" +#include "vtkMedFieldOnProfile.h" +#include "vtkMedFieldOverEntity.h" +#include "vtkMedFieldStep.h" +#include "vtkMedFile.h" +#include "vtkMedGrid.h" +#include "vtkMedDriver.h" +#include "vtkMedUnstructuredGrid.h" +#include "vtkMedIntArray.h" + +#include "vtkBitArray.h" +#include "vtkIdList.h" + +#include "vtkMultiProcessController.h" + +vtkCxxSetObjectMacro(vtkMedFamilyOnEntityOnProfile,FamilyOnEntity, vtkMedFamilyOnEntity); +vtkCxxSetObjectMacro(vtkMedFamilyOnEntityOnProfile, Profile, vtkMedProfile); + +vtkCxxRevisionMacro(vtkMedFamilyOnEntityOnProfile, "$Revision$"); +vtkStandardNewMacro(vtkMedFamilyOnEntityOnProfile) + +vtkMedFamilyOnEntityOnProfile::vtkMedFamilyOnEntityOnProfile() +{ + this->FamilyOnEntity = NULL; + this->Profile = NULL; + this->IntersectionStatus = vtkMedFamilyOnEntityOnProfile::NotComputed; + this->UseAllPoints = false; + this->MatchComputed = false; + this->Valid = true; +} + +vtkMedFamilyOnEntityOnProfile::~vtkMedFamilyOnEntityOnProfile() +{ + this->SetFamilyOnEntity(NULL); + this->SetProfile(NULL); +} + +bool vtkMedFamilyOnEntityOnProfile::KeepPoint(med_int index) +{ + if(this->IntersectionStatus == NotComputed) + this->ComputeIntersection(NULL); + + if(this->UseAllPoints) + return true; + + if(this->MedToVTKPointIndexMap.find(index) + == this->MedToVTKPointIndexMap.end()) + return false; + + return true; +} + +bool vtkMedFamilyOnEntityOnProfile::KeepCell(med_int index) +{ + if(this->FamilyOnEntity->GetEntityArray()->GetFamilyId(index) + != this->FamilyOnEntity->GetFamily()->GetId()) + return false; + return true; +} + +int vtkMedFamilyOnEntityOnProfile::CanMapField(vtkMedFieldOnProfile* fop) +{ + // only point fields can be mapped on point supports. + if(this->GetFamilyOnEntity()->GetEntity().EntityType == MED_NODE && + fop->GetParentFieldOverEntity()->GetEntity().EntityType != MED_NODE) + return false; + + // if it is a cell-centered field, the geometry need to be the same + if(fop->GetParentFieldOverEntity()->GetEntity().EntityType != MED_NODE + && fop->GetParentFieldOverEntity()->GetEntity().GeometryType != + this->GetFamilyOnEntity()->GetEntity().GeometryType) + return false; + + int numProc = 1; + vtkMultiProcessController* controller = + vtkMultiProcessController::GetGlobalController(); + if (controller != NULL) + { + numProc = controller->GetNumberOfProcesses(); + } + + if ((this->GetValid() == 0) && numProc == 1) + return false; + + this->ComputeIntersection(fop); + + if(this->IntersectionStatus == vtkMedFamilyOnEntityOnProfile::NoIntersection) + return false; + + if(fop != NULL && + this->GetFamilyOnEntity()->GetEntity().EntityType != MED_NODE && + fop->GetParentFieldOverEntity()->GetEntity().EntityType == MED_NODE && + this->PointProfileMatch[fop->GetProfile()] == BadOrNoIntersection) + return false; + + return true; +} + +int vtkMedFamilyOnEntityOnProfile::CanShallowCopy(vtkMedFieldOnProfile *fop) +{ + if(fop == NULL) + { + bool shallow_on_points = this->CanShallowCopyPointField(NULL); + bool shallow_on_cells = this->CanShallowCopyCellField(NULL); + if(shallow_on_points && shallow_on_cells) + return true; + if(!shallow_on_points && !shallow_on_cells) + return false; + vtkErrorMacro("CanShallowCopy cannot answer : is it a point or a cell field?"); + return false; + } + + if(fop->GetParentFieldOverEntity()->GetParentStep()->GetParentField() + ->GetFieldType() == vtkMedField::PointField) + return this->CanShallowCopyPointField(fop); + else + return this->CanShallowCopyCellField(fop); +} + +void vtkMedFamilyOnEntityOnProfile::ComputeIntersection(vtkMedFieldOnProfile* fop) +{ + int nodeOrCellSupport=this->GetFamilyOnEntity()->GetPointOrCell(); + int fieldType; + if(fop) + { + fieldType = fop->GetParentFieldOverEntity()->GetParentStep()-> + GetParentField()->GetFieldType(); + } + else + { + fieldType = (nodeOrCellSupport==vtkMedUtilities::OnPoint?vtkMedField::PointField:vtkMedField::CellField); + } + // Cell fields cannot match point supports + if(fieldType != vtkMedField::PointField + && nodeOrCellSupport == vtkMedUtilities::OnPoint) + { + this->IntersectionStatus = vtkMedFamilyOnEntityOnProfile::NoIntersection; + this->UseAllPoints = false; + } + else if(fieldType != vtkMedField::PointField + && nodeOrCellSupport ==vtkMedUtilities::OnCell) + { + this->ComputeCellFamilyVsCellProfileMatch(); + } + else if(fieldType == vtkMedField::PointField + && nodeOrCellSupport ==vtkMedUtilities::OnPoint) + { + vtkMedProfile* profile = NULL; + if(fop != NULL) + { + profile = fop->GetProfile(); + } + // point fields must share the same profile as the point support. + this->ComputePointFamilyVsPointProfileMatch(); + + } + else if(fieldType == vtkMedField::PointField + && nodeOrCellSupport == vtkMedUtilities::OnCell) + { + vtkMedProfile* profile = NULL; + if(fop != NULL) + { + profile = fop->GetProfile(); + } + this->ComputeCellFamilyVsPointProfileMatch(profile); + } + + this->MatchComputed = true; +} + +int vtkMedFamilyOnEntityOnProfile::CanShallowCopyPointField(vtkMedFieldOnProfile* fop) +{ + vtkMedProfile* profile = (fop != NULL?fop->GetProfile(): NULL); + if(this->FamilyOnEntity->GetPointOrCell() == vtkMedUtilities::OnCell) + { + if(this->PointProfileMatch.find(profile) == this->PointProfileMatch.end()) + { + this->ComputeCellFamilyVsPointProfileMatch(profile); + } + int match = this->PointProfileMatch[profile]; + return match + == vtkMedFamilyOnEntityOnProfile::ProfileEqualsSupport; + } + else + { + // this is a point support. + // The only case when there is shallow copy is if there is at most 1 family + // and the profile is shared. + if(this->Profile == profile && + this->GetFamilyOnEntity()->GetEntityArray() + ->GetNumberOfFamilyOnEntity() <= 1) + { + return true; + } + else + { + return false; + } + } +} + +int vtkMedFamilyOnEntityOnProfile::CanShallowCopyCellField(vtkMedFieldOnProfile* fop) +{ + vtkMedProfile* profile = (fop != NULL?fop->GetProfile(): NULL); + // cell fields cannot be mapped to cell supports + if(this->FamilyOnEntity->GetPointOrCell() == vtkMedUtilities::OnPoint) + { + return false; + } + + // this is a cell support. + if(this->Profile != profile) + { + return false; + } + + // the only case I can shallow copy is if there is only one family + // defined on those cells. + if(this->Profile == NULL && + this->GetFamilyOnEntity()->GetEntityArray() + ->GetNumberOfFamilyOnEntity() <= 1) + return true; + + return false; +} + +void vtkMedFamilyOnEntityOnProfile::ComputeUsedPoints() +{ + this->MedToVTKPointIndexMap.clear(); + + //first test a few special cases where no heavy computing is necessary + vtkMedGrid* grid = this->FamilyOnEntity->GetParentGrid(); + if(this->Profile == NULL) + { + // If there is no profile, the entity is on points and there + // at most 1 point family, then all points are used. + if(this->FamilyOnEntity->GetPointOrCell() == vtkMedUtilities::OnPoint && + this->FamilyOnEntity->GetEntityArray()->GetNumberOfFamilyOnEntity() <= 1) + { + this->UseAllPoints = true; + return; + } + // if there is no profile, the grid is structured, the entity is on cell + // and there is at most 1 family on his entity, then all points are used + if(vtkMedUnstructuredGrid::SafeDownCast(grid) == NULL && + this->FamilyOnEntity->GetPointOrCell() == vtkMedUtilities::OnCell && + this->FamilyOnEntity->GetEntityArray()->GetNumberOfFamilyOnEntity() <= 1) + { + this->UseAllPoints = true; + return; + } + } + + vtkSmartPointer flag = vtkSmartPointer::New(); + flag->SetNumberOfTuples(grid->GetNumberOfPoints()); + + // initialize the array to false + for(vtkIdType pid = 0; pid < flag->GetNumberOfTuples(); pid++) + flag->SetValue(pid, false); + + // for each cell, flag the used points + if(this->Profile) + this->Profile->Load(); + + vtkMedIntArray* pids=(this->Profile!=NULL?this->Profile->GetIds():NULL); + + med_int famId = this->FamilyOnEntity->GetFamily()->GetId(); + vtkMedEntityArray* array = this->FamilyOnEntity->GetEntityArray(); + vtkSmartPointer ids = vtkSmartPointer::New(); + + array->LoadConnectivity(); + + vtkIdType pflsize = (pids != NULL ? pids->GetNumberOfTuples():array->GetNumberOfEntity()); + for(vtkIdType pindex=0; pindexGetValue(pindex)-1 : pindex); + med_int fid = array->GetFamilyId(pid); + if(famId==fid) + { + // this cell is of the family and on the profile. + // --> flag all vertices of this cell + array->GetCellVertices(pid, ids); + for(int id = 0; idGetNumberOfIds(); id++) + { + vtkIdType subid = ids->GetId(id); + if(subid < 0 || subid >= flag->GetNumberOfTuples()) + { + vtkDebugMacro("invalid sub id : " << subid); + this->SetValid(0); + break; + } + flag->SetValue(subid, 1); + } + } + } + + // now, the flag array contains all vertices used by this support + this->UseAllPoints = true; + for(vtkIdType pid = 0; pidGetNumberOfTuples(); pid++) + { + if(flag->GetValue(pid) == false) + { + this->UseAllPoints = false; + break; + } + } + + if(!this->UseAllPoints) + { + // If all points are not used, I compute the index mapping + vtkIdType vtk_index = 0; + + for(vtkIdType pid=0; pid < flag->GetNumberOfTuples(); pid++) + { + if(flag->GetValue(pid) == true) + { + this->MedToVTKPointIndexMap[pid] = vtk_index; + vtk_index++; + } + } + } +} + +void vtkMedFamilyOnEntityOnProfile::ComputeCellFamilyVsCellProfileMatch() +{ + if(this->MatchComputed) + return; + + // this computes the UseAllPoints flag. + this->ComputeUsedPoints(); + + if(this->Profile == NULL) + { + // If there is no profile, then the match is exact if and only + // if there is 1 cell family on this entity + if(this->FamilyOnEntity->GetEntityArray()->GetNumberOfFamilyOnEntity() == 1) + { + this->IntersectionStatus = + vtkMedFamilyOnEntityOnProfile::ProfileIncludedInFamily; + } + else + { + this->IntersectionStatus = + vtkMedFamilyOnEntityOnProfile::ProfileIntersectsFamily; + } + return; + } + + this->Profile->Load(); + vtkMedIntArray* pids=this->Profile->GetIds(); + + if(pids==NULL) + { + vtkErrorMacro("Could not load profile indices!"); + this->IntersectionStatus = vtkMedFamilyOnEntityOnProfile::NotComputed; + this->UseAllPoints = false; + return; + } + + med_int famId = this->GetFamilyOnEntity()->GetFamily()->GetId(); + vtkIdType pindex=0; + vtkMedEntityArray* array=this->FamilyOnEntity->GetEntityArray(); + bool profile_included = true; + bool profile_intersect = false; + for(int pindex=0; pindexGetNumberOfTuples(); pindex++) + { + med_int pid=pids->GetValue(pindex)-1; + med_int fid=array->GetFamilyId(pid); + if(famId==fid) + {// the current cell is on the familyand on the profile + // --> there is an overlap + profile_intersect = true; + } + else + { + // the cell is on the profile but not on the family --> no inclusion + profile_included=false; + } + } + + if(profile_included && profile_intersect) + this->IntersectionStatus = vtkMedFamilyOnEntityOnProfile::ProfileIncludedInFamily; + else if(profile_intersect) + this->IntersectionStatus = vtkMedFamilyOnEntityOnProfile::ProfileIntersectsFamily; + else + this->IntersectionStatus = vtkMedFamilyOnEntityOnProfile::NoIntersection; +} + +void vtkMedFamilyOnEntityOnProfile:: + ComputeCellFamilyVsPointProfileMatch(vtkMedProfile* profile) +{ + // first test if the cache is already set + if(this->PointProfileMatch.find(profile) != this->PointProfileMatch.end()) + return; + + // this will compute the cell match cache, as well as the UseAllPoints flag. + this->ComputeCellFamilyVsCellProfileMatch(); + + if(profile == NULL) + { + // If there is no profile, then the match is at least partial. + // It is exact if and only + // if the cell family uses all points + int match = (this->UseAllPoints? ProfileEqualsSupport : ProfileLargerThanSupport); + this->PointProfileMatch[profile] = + (this->UseAllPoints? ProfileEqualsSupport : ProfileLargerThanSupport); + return; + } + + // if profile is not NULL and I use all points --> BadOrNoIntersection + if(this->UseAllPoints) + { + this->PointProfileMatch[profile] = BadOrNoIntersection; + } + + profile->Load(); + + vtkMedIntArray* pids=profile->GetIds(); + + if(pids == NULL) + { + vtkErrorMacro("profile indices could not be loaded!"); + this->PointProfileMatch[profile] = BadOrNoIntersection; + return; + } + + med_int pindex = 0; + bool exact_match = true; + vtkIdType numberOfUsedPoints = pids->GetNumberOfTuples(); + for(med_int pindex=0; pindex < pids->GetNumberOfTuples(); pindex++) + { + med_int id = pids->GetValue(pindex); + if(this->MedToVTKPointIndexMap.find(id-1) == this->MedToVTKPointIndexMap.end()) + { + // The given point profile index is not used by this support. + // the superposition is at most partial. + exact_match = false; + numberOfUsedPoints--; + } + } + + // if this profile is smaller than the number of points, I can't match + // the profile to this support + if(numberOfUsedPoints < this->MedToVTKPointIndexMap.size()) + { + this->PointProfileMatch[profile] = BadOrNoIntersection; + } + else if(exact_match) + { + this->PointProfileMatch[profile] = ProfileEqualsSupport; + } + else + { + this->PointProfileMatch[profile] = ProfileLargerThanSupport; + } +} + +void vtkMedFamilyOnEntityOnProfile::ComputePointFamilyVsPointProfileMatch() +{ + if(this->MatchComputed) + return; + + this->ComputeUsedPoints(); + + if(this->Profile == NULL) + { + // If there is no profile, then the match is exact if there is at most + // 1 point family on the grid + if(this->FamilyOnEntity->GetParentGrid()->GetParentMesh() + ->GetNumberOfPointFamily() <= 1) + { + this->IntersectionStatus = ProfileIncludedInFamily; + } + } + + // there is a profile, we have to compute the match between the family and + // the profile + vtkMedFamilyOnEntity* foe = this->GetFamilyOnEntity(); + vtkMedEntityArray* pea = foe->GetEntityArray(); + vtkMedIntArray* pIds = NULL; + + if(this->Profile) + { + this->Profile->Load(); + pIds=this->Profile->GetIds(); + } + + if(pIds == NULL) + { + if(this->FamilyOnEntity->GetEntityArray()->GetNumberOfFamilyOnEntity() > 1) + { + this->IntersectionStatus = + vtkMedFamilyOnEntityOnProfile::ProfileIntersectsFamily; + } + else + { + this->IntersectionStatus = + vtkMedFamilyOnEntityOnProfile::ProfileIncludedInFamily; + } + return; + } + + bool profile_intersects=false; + bool profile_included=true; + med_int famId=this->FamilyOnEntity->GetFamily()->GetId(); + for(vtkIdType pindex=0; pindexGetNumberOfTuples(); pindex++) + { + med_int pid=pIds->GetValue(pindex)-1; + med_int fid = pea->GetFamilyId(pid); + // med_int fid=grid->GetPointFamilyId(pid); + if(fid==famId) + {// the family of the current point is the good one + profile_intersects=true; + } + else + { + // we are on the profile and not on the family --> + // no exact match, but the the profile might be larger than the family. + profile_included=false; + } + } + + if(!profile_intersects) + { + this->IntersectionStatus = + vtkMedFamilyOnEntityOnProfile::NoIntersection; + } + else if(profile_included) + { + this->IntersectionStatus = + vtkMedFamilyOnEntityOnProfile::ProfileIncludedInFamily; + } + else + { + this->IntersectionStatus = + vtkMedFamilyOnEntityOnProfile::ProfileIntersectsFamily; + } +} + +vtkIdType vtkMedFamilyOnEntityOnProfile::GetVTKPointIndex(vtkIdType medCIndex) +{ + if(this->IntersectionStatus == NotComputed) + this->ComputeIntersection(NULL); + + if(this->UseAllPoints) + return medCIndex; + + if(this->MedToVTKPointIndexMap.find(medCIndex) + == this->MedToVTKPointIndexMap.end()) + { + vtkDebugMacro("GetVTKPointIndex asked for " + << medCIndex << " which has not been mapped"); + return -1; + } + + return this->MedToVTKPointIndexMap[medCIndex]; +} + +void vtkMedFamilyOnEntityOnProfile::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFamilyOnEntityOnProfile.h b/src/Plugins/MedReader/IO/vtkMedFamilyOnEntityOnProfile.h new file mode 100644 index 00000000..4554128d --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFamilyOnEntityOnProfile.h @@ -0,0 +1,146 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFamilyOnEntityOnProfile_h_ +#define __vtkMedFamilyOnEntityOnProfile_h_ + +// Description : +// This class represents the intersection between a family and an entity and +// a cell profile. +// This is the smallest partition of the the support in a med file. +// +// Fields on points are mapped on cell supports if and only if they +// fully match the cell support. + +#include "vtkObject.h" +#include "vtkMed.h" +#include "vtkMedUtilities.h" + +class vtkMedFamilyOnEntity; +class vtkMedProfile; + +class vtkBitArray; + +class VTK_EXPORT vtkMedFamilyOnEntityOnProfile : public vtkObject +{ +public : + static vtkMedFamilyOnEntityOnProfile* New(); + vtkTypeRevisionMacro(vtkMedFamilyOnEntityOnProfile, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the family on entity of this support. + virtual void SetFamilyOnEntity(vtkMedFamilyOnEntity*); + vtkGetObjectMacro(FamilyOnEntity, vtkMedFamilyOnEntity); + + // Description: + // This is the profile of this support. + virtual void SetProfile(vtkMedProfile*); + vtkGetObjectMacro(Profile, vtkMedProfile); + + // Description: + // This flag informs on the intersection of the family on entity + // and the profile. + // The intersection can be : + // 0 --> not computed + // 1 --> exact superposition + // 2 --> partial superposition + // 3 --> no intersection. + enum eIntersectionState + {NotComputed = 0, + ProfileIncludedInFamily = 1, + ProfileIntersectsFamily = 2, + NoIntersection = 3}; + + vtkGetMacro(IntersectionStatus, eIntersectionState); + vtkGetMacro(UseAllPoints, bool); + + // Description: + // This method computes the IntersectionStatus and the UseAllPoints flags. + virtual void ComputeIntersection(vtkMedFieldOnProfile*); + + int CanShallowCopyCellField(vtkMedFieldOnProfile* fop); + int CanShallowCopyPointField(vtkMedFieldOnProfile* fop); + int CanShallowCopy(vtkMedFieldOnProfile* fop); + int CanMapField(vtkMedFieldOnProfile* fop); + + enum ePointProfileVsSupportMatch + { + Unknown = 0, + ProfileLargerThanSupport = 1, + ProfileEqualsSupport = 2, + BadOrNoIntersection = 3 + }; + + // Description: + // returns the index to use for this support on the vtk grid + // from the index stored on the med file -1 (starting to 0) + vtkIdType GetVTKPointIndex(vtkIdType medCIndex); + + // Description: + // returns if this point is used by this support. + bool KeepPoint(med_int index); + + // Description: + // returns if this cell is used by this support. (only look at the family, + // not at the profile) + bool KeepCell(med_int index); + + // Description: + // This flag is set to false when building the + // connectivity if it is not valid. + vtkGetMacro(Valid, int); + vtkSetMacro(Valid, int); + +protected: + vtkMedFamilyOnEntityOnProfile(); + virtual ~vtkMedFamilyOnEntityOnProfile(); + + // Description: + // Compute the UseAllPoints and IntersectionStatus ivars, depending + // on the type of field and the type of support. + virtual void ComputeCellFamilyVsCellProfileMatch(); + virtual void ComputePointFamilyVsPointProfileMatch(); + virtual void ComputeCellFamilyVsPointProfileMatch(vtkMedProfile*); + + // this method compute the UseAllPoints flag, and the MedToVTKPointIndexMap + // if the flag is set to false. + virtual void ComputeUsedPoints(); + + vtkMedFamilyOnEntity* FamilyOnEntity; + vtkMedProfile* Profile; + eIntersectionState IntersectionStatus; + bool UseAllPoints; + int FieldType; + med_geometry_type FieldGeometryType; + + std::map MedToVTKPointIndexMap; + + std::map PointProfileMatch; + + bool MatchComputed; + int Valid; + +private: + vtkMedFamilyOnEntityOnProfile(const vtkMedFamilyOnEntityOnProfile&); + // Not implemented. + void operator=(const vtkMedFamilyOnEntityOnProfile&); // Not implemented. +}; + +#endif //__vtkMedFamilyOnEntityOnProfile_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedField.cxx b/src/Plugins/MedReader/IO/vtkMedField.cxx new file mode 100644 index 00000000..0661aee6 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedField.cxx @@ -0,0 +1,326 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedField.h" + +#include "vtkObjectFactory.h" +#include "vtkSmartPointer.h" +#include "vtkStringArray.h" +#include "vtkMedFieldOverEntity.h" +#include "vtkMedFieldStep.h" +#include "vtkMedUtilities.h" +#include "vtkMedFieldOnProfile.h" +#include "vtkMedInterpolation.h" +#include "vtkMedFile.h" + +#include +#include +using namespace std; + +vtkCxxGetObjectVectorMacro(vtkMedField, Interpolation, vtkMedInterpolation); +vtkCxxSetObjectVectorMacro(vtkMedField, Interpolation, vtkMedInterpolation); + +vtkCxxSetObjectMacro(vtkMedField, ParentFile, vtkMedFile); + +vtkCxxRevisionMacro(vtkMedField, "$Revision$") +vtkStandardNewMacro(vtkMedField) + +vtkMedField::vtkMedField() +{ + this->NumberOfComponent = -1; + this->DataType = MED_FLOAT64; + this->Name = NULL; + this->MeshName = NULL; + this->TimeUnit = NULL; + this->FieldStep = new vtkMedComputeStepMap (); + this->Unit = vtkStringArray::New(); + this->ComponentName = vtkStringArray::New(); + this->Interpolation = new vtkObjectVector (); + this->MedIterator = -1; + this->FieldType = UnknownFieldType; + this->ParentFile = NULL; + this->Local = 1; +} + +vtkMedField::~vtkMedField() +{ + this->SetName(NULL); + this->SetMeshName(NULL); + this->SetTimeUnit(NULL); + delete this->FieldStep; + this->Unit->Delete(); + this->ComponentName->Delete(); +} + +void vtkMedField::ComputeFieldType() +{ + this->FieldType = UnknownFieldType; + + // look for the med_entity_type + // on which this field is. + for(int sid = 0; sid < this->GetNumberOfFieldStep(); sid++) + { + vtkMedFieldStep* step = this->GetFieldStep(sid); + + for(int eid = 0; eid < step->GetNumberOfFieldOverEntity(); eid++) + { + vtkMedFieldOverEntity* fieldOverEntity = step->GetFieldOverEntity(eid); + med_entity_type type = fieldOverEntity->GetEntity().EntityType; + + if (type == MED_NODE) + { + this->FieldType |= PointField; + } + else if(type == MED_NODE_ELEMENT ) + { + this->FieldType |= ElnoField; + } + else + { + for(int pid=0; pidGetNumberOfFieldOnProfile(); pid++) + { + vtkMedFieldOnProfile* fop = fieldOverEntity->GetFieldOnProfile(pid); + const char* locname = fop->GetLocalizationName(); + if(strcmp(locname, MED_GAUSS_ELNO) == 0 ) + { + this->FieldType = ElnoField; + } + else if(strcmp(locname, MED_NO_LOCALIZATION) != 0 ) + { + this->FieldType |= QuadratureField; + } + else + { + this->FieldType |= CellField; + } + } + } + } + } + + if(this->FieldType == UnknownFieldType) + this->FieldType = PointField; +} + +int vtkMedField::HasManyFieldTypes() +{ + int numberOfTypes = 0; + numberOfTypes += (this->FieldType & vtkMedField::PointField) != 0; + numberOfTypes += (this->FieldType & vtkMedField::CellField) != 0; + numberOfTypes += (this->FieldType & vtkMedField::QuadratureField) != 0; + numberOfTypes += (this->FieldType & vtkMedField::ElnoField) != 0; + + return numberOfTypes > 1; +} + +int vtkMedField::GetFirstType() +{ + if((this->FieldType & vtkMedField::PointField) != 0) + return vtkMedField::PointField; + + if((this->FieldType & vtkMedField::CellField) != 0) + return vtkMedField::CellField; + + if((this->FieldType & vtkMedField::QuadratureField) != 0) + return vtkMedField::QuadratureField; + + if((this->FieldType & vtkMedField::ElnoField) != 0) + return vtkMedField::ElnoField; +} + +void vtkMedField::ExtractFieldType(vtkMedField* otherfield, int type) +{ + this->SetName(otherfield->GetName()); + this->SetLocal(otherfield->GetLocal()); + this->SetMedIterator(otherfield->GetMedIterator()); + this->SetDataType(otherfield->GetDataType()); + this->SetMeshName(otherfield->GetMeshName()); + this->SetTimeUnit(otherfield->GetTimeUnit()); + this->SetParentFile(otherfield->GetParentFile()); + + this->SetNumberOfComponent(otherfield->GetNumberOfComponent()); + for(int i=0; i< this->GetNumberOfComponent(); i++) + { + this->GetComponentName()->SetValue(i, otherfield-> + GetComponentName()->GetValue(i)); + } + + this->AllocateNumberOfInterpolation(otherfield->GetNumberOfInterpolation()); + for(int i=0; iGetNumberOfInterpolation(); i++) + { + this->SetInterpolation(i, otherfield->GetInterpolation(i)); + } + + this->GetUnit()->SetNumberOfValues( + otherfield->GetUnit()->GetNumberOfValues()); + for(int i=0; iGetUnit()->GetNumberOfValues(); i++) + { + this->GetUnit()->SetValue(i, otherfield->GetUnit()->GetValue(i)); + } + + int nstep = otherfield->GetNumberOfFieldStep(); + map stepmap; + for(int stepid=0; stepidGetFieldStep(stepid); + vtkMedFieldStep* step = vtkMedFieldStep::New(); + step->SetComputeStep(otherstep->GetComputeStep()); + this->AddFieldStep(step); + step->Delete(); + + stepmap[otherstep] = step; + + vtkMedFieldStep* previousstep = NULL; + if(stepmap.find(otherstep->GetPreviousStep()) != stepmap.end()) + { + previousstep = stepmap[otherstep->GetPreviousStep()]; + } + step->SetPreviousStep(previousstep); + step->SetParentField(this); + step->SetMeshComputeStep(otherstep->GetMeshComputeStep()); + + for(int eid=0; eidGetNumberOfFieldOverEntity(); eid++) + { + vtkMedFieldOverEntity* fieldOverEntity = otherstep->GetFieldOverEntity(eid); + + if(type == vtkMedField::PointField) + { + if(fieldOverEntity->GetEntity().EntityType != MED_NODE) + { + continue; + } + step->AppendFieldOverEntity(fieldOverEntity); + otherstep->RemoveFieldOverEntity(fieldOverEntity); + fieldOverEntity->SetParentStep(step); + } + else if(type == vtkMedField::ElnoField) + { + if(fieldOverEntity->GetEntity().EntityType != MED_NODE_ELEMENT) + { + continue; + } + + step->AppendFieldOverEntity(fieldOverEntity); + otherstep->RemoveFieldOverEntity(fieldOverEntity); + eid--; + fieldOverEntity->SetParentStep(step); + } + else + { + if(fieldOverEntity->GetEntity().EntityType == MED_NODE) + { + continue; + } + vtkMedFieldOverEntity* newfoe = vtkMedFieldOverEntity::New(); + newfoe->SetEntity(fieldOverEntity->GetEntity()); + newfoe->SetHasProfile(fieldOverEntity->GetHasProfile()); + newfoe->SetParentStep(step); + step->AppendFieldOverEntity(newfoe); + newfoe->Delete(); + for(int pid=0; pidGetNumberOfFieldOnProfile(); pid++) + { + vtkMedFieldOnProfile* fop = fieldOverEntity->GetFieldOnProfile(pid); + const char* locname = fop->GetLocalizationName(); + if((type == vtkMedField::QuadratureField + && strcmp(locname, MED_NO_LOCALIZATION) != 0) || + (type == vtkMedField::CellField + && strcmp(locname, MED_NO_LOCALIZATION) == 0 )) + { + newfoe->AppendFieldOnProfile(fop); + fieldOverEntity->RemoveFieldOnProfile(fop); + pid--; + fop->SetParentFieldOverEntity(newfoe); + } + } + if(fieldOverEntity->GetNumberOfFieldOnProfile() == 0) + { + otherstep->RemoveFieldOverEntity(fieldOverEntity); + eid--; + } + } + } + } + + this->ComputeFieldType(); + otherfield->ComputeFieldType(); +} + +void vtkMedField::SetNumberOfComponent(int ncomp) +{ + if (this->NumberOfComponent == ncomp) + return; + + this->NumberOfComponent = ncomp; + this->GetUnit()->SetNumberOfValues(this->NumberOfComponent); + this->GetComponentName()->SetNumberOfValues(this->NumberOfComponent); + + this->Modified(); +} + +void vtkMedField::AddFieldStep(vtkMedFieldStep* step) +{ + this->FieldStep->AddObject(step->GetComputeStep(), step); +} + +void vtkMedField::ClearFieldStep() +{ + this->FieldStep->clear(); +} + +vtkMedFieldStep* vtkMedField::GetFieldStep(const vtkMedComputeStep& cs) +{ + return this->FieldStep->GetObject(cs); +} + +vtkMedFieldStep* vtkMedField::FindFieldStep(const vtkMedComputeStep& cs, + int strategy) +{ + return this->FieldStep->FindObject(cs, strategy); +} + +med_int vtkMedField::GetNumberOfFieldStep() +{ + return this->FieldStep->GetNumberOfObject(); +} + +vtkMedFieldStep* vtkMedField::GetFieldStep(med_int id) +{ + return this->FieldStep->GetObject(id); +} + +void vtkMedField::GatherFieldTimes(std::set& times) +{ + this->FieldStep->GatherTimes(times); +} + +void vtkMedField::GatherFieldIterations(med_float time, + std::set& iterations) +{ + this->FieldStep->GatherIterations(time, iterations); +} + +void vtkMedField::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, MedIterator); + PRINT_IVAR(os, indent, NumberOfComponent); + PRINT_IVAR(os, indent, FieldType); + PRINT_IVAR(os, indent, DataType); + PRINT_IVAR(os, indent, Local); +} diff --git a/src/Plugins/MedReader/IO/vtkMedField.h b/src/Plugins/MedReader/IO/vtkMedField.h new file mode 100644 index 00000000..70fd637c --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedField.h @@ -0,0 +1,176 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedField_h_ +#define __vtkMedField_h_ + +#include "vtkObject.h" +#include "vtkMedSetGet.h" +#include "vtkMed.h" + +#include "vtkSmartPointer.h" + +#include + +class vtkStringArray; + +class vtkMedInterpolation; +class vtkMedFieldOverEntity; +class vtkMedString; +class vtkMedFieldStep; +class vtkMedComputeStep; +template +class vtkMedComputeStepMap; +class vtkMedFile; + +class VTK_EXPORT vtkMedField: public vtkObject +{ +public: + static vtkMedField* New(); + vtkTypeRevisionMacro(vtkMedField, vtkObject); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // The number of component of this field + virtual void SetNumberOfComponent(int); + vtkGetMacro(NumberOfComponent, int); + + // Description: + // The type of data stored in this field + vtkSetMacro(DataType, med_field_type); + vtkGetMacro(DataType, med_field_type); + + // Description: + // The name of this field + vtkGetStringMacro(Name); + vtkSetStringMacro(Name); + + // Description: + // The name of this mesh this field is on + vtkGetStringMacro(MeshName); + vtkSetStringMacro(MeshName); + + // Description: + // The name of this mesh this field is on + vtkGetStringMacro(TimeUnit); + vtkSetStringMacro(TimeUnit); + + // Description: + // The units of each component of this field + vtkGetObjectMacro(Unit, vtkStringArray); + + // Description: + // The name of each component of this field + vtkGetObjectMacro(ComponentName, vtkStringArray); + + // Description: + // add a cell type as support to this field + void AddFieldStep(vtkMedFieldStep*); + void ClearFieldStep(); + vtkMedFieldStep* GetFieldStep(const vtkMedComputeStep&); + vtkMedFieldStep* FindFieldStep(const vtkMedComputeStep&, int); + med_int GetNumberOfFieldStep(); + vtkMedFieldStep* GetFieldStep(med_int); + void GatherFieldTimes(std::set&); + void GatherFieldIterations(med_float,std::set&); + + // Description: + // returns if the field is on point, cell, quadrature point or elno + //BTX + enum { + UnknownFieldType = 0x00, + PointField = 0x01, + CellField = 0x02, + QuadratureField = 0x04, + ElnoField = 0x08}; + //ETX + //Description: + // returns the type of field this is. The returned code is and OR between + // the different possible types. + vtkGetMacro(FieldType, int); + + // This computes the FieldType + // (currently, it does it by looking only at the first compute step) + virtual void ComputeFieldType(); + + // Description: + // This returns true if the FieldType is composed of several types + virtual int HasManyFieldTypes(); + + // Description: + // returns the first support type this field is on. + virtual int GetFirstType(); + + // Description: + // This methods extracts from the other field all the fields that are + // on the given support type and add them to the current field. + // It also updates the other FieldType ivar. + virtual void ExtractFieldType(vtkMedField* otherfield, int type); + + // Description: + // The index of this field in the med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // if the mesh is local or not. + vtkSetMacro(Local, med_int); + vtkGetMacro(Local, med_int); + + // Description: + // The interpolation functions associated with this field + vtkGetObjectVectorMacro(Interpolation, vtkMedInterpolation); + vtkSetObjectVectorMacro(Interpolation, vtkMedInterpolation); + + // Description: + // This stores the file this field is stored on. + virtual void SetParentFile(vtkMedFile*); + vtkGetObjectMacro(ParentFile, vtkMedFile); + +protected: + vtkMedField(); + virtual ~vtkMedField(); + + vtkSetMacro(FieldType, int); + + int NumberOfComponent; + med_field_type DataType; + med_int MedIterator; + med_int Local; + char* Name; + char* MeshName; + char* TimeUnit; + int FieldType; + vtkMedFile* ParentFile; + + //BTX + vtkMedComputeStepMap* FieldStep; + vtkObjectVector* Interpolation; + //ETX + + vtkStringArray* Unit; + vtkStringArray* ComponentName; + +private: + vtkMedField(const vtkMedField&); // Not implemented. + void operator=(const vtkMedField&); // Not implemented. + +}; + +#endif //__vtkMedField_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFieldOnProfile.cxx b/src/Plugins/MedReader/IO/vtkMedFieldOnProfile.cxx new file mode 100644 index 00000000..6befbd7e --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFieldOnProfile.cxx @@ -0,0 +1,88 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFieldOnProfile.h" + +#include "vtkObjectFactory.h" +#include "vtkDataArray.h" + +#include "vtkMedFieldOverEntity.h" +#include "vtkMedFieldStep.h" +#include "vtkMedField.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" +#include "vtkMedProfile.h" + +vtkCxxSetObjectMacro(vtkMedFieldOnProfile, Data, vtkDataArray); +vtkCxxSetObjectMacro(vtkMedFieldOnProfile, Profile, vtkMedProfile); +vtkCxxSetObjectMacro(vtkMedFieldOnProfile, ParentFieldOverEntity, vtkMedFieldOverEntity); + +vtkCxxRevisionMacro(vtkMedFieldOnProfile, "$Revision$") +vtkStandardNewMacro(vtkMedFieldOnProfile) + +vtkMedFieldOnProfile::vtkMedFieldOnProfile() +{ + this->MedIterator = -1; + this->ParentFieldOverEntity = NULL; + this->ProfileName = NULL; + this->ProfileSize = 0; + this->LocalizationName = NULL; + this->NumberOfIntegrationPoint = 0; + this->NumberOfValues = 0; + this->Data = NULL; + this->Profile = NULL; + this->SetProfileName(MED_NO_PROFILE); + this->SetLocalizationName(MED_NO_LOCALIZATION); +} + +vtkMedFieldOnProfile::~vtkMedFieldOnProfile() +{ + this->SetProfileName(NULL); + this->SetLocalizationName(NULL); + this->SetParentFieldOverEntity(NULL); + this->SetData(NULL); +} + +int vtkMedFieldOnProfile::GetHasProfile() +{ + cout << "Profile Name = " << this->ProfileName << endl; + return strcmp(this->ProfileName, MED_NO_PROFILE) != 0; +} + +int vtkMedFieldOnProfile::IsLoaded() +{ + return this->Data!=NULL + && this->Data->GetNumberOfTuples() == this->NumberOfValues; +} + +void vtkMedFieldOnProfile::Load(med_storage_mode mode) +{ + this->ParentFieldOverEntity->GetParentStep()->GetParentField() + ->GetParentFile()->GetMedDriver()->LoadField(this, mode); +} + +void vtkMedFieldOnProfile::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + + PRINT_IVAR(os, indent, MedIterator); + PRINT_IVAR(os, indent, ProfileSize); + PRINT_IVAR(os, indent, NumberOfIntegrationPoint); + PRINT_IVAR(os, indent, NumberOfValues); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFieldOnProfile.h b/src/Plugins/MedReader/IO/vtkMedFieldOnProfile.h new file mode 100644 index 00000000..fff4dcd9 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFieldOnProfile.h @@ -0,0 +1,126 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFieldOnProfile_h_ +#define __vtkMedFieldOnProfile_h_ + +#include "vtkObject.h" +#include "vtkMedSetGet.h" +#include "vtkMed.h" +#include"vtkMedFilter.h" + +class vtkMedFieldOverEntity; +class vtkMedString; +class vtkDataArray; +class vtkMedProfile; + +class VTK_EXPORT vtkMedFieldOnProfile: public vtkObject +{ +public: + static vtkMedFieldOnProfile* New(); + vtkTypeRevisionMacro(vtkMedFieldOnProfile, vtkObject); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the iterator that is used while reading fromt he med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // This is the FieldOverEntity this profile is on + virtual void SetParentFieldOverEntity(vtkMedFieldOverEntity*); + vtkGetObjectMacro(ParentFieldOverEntity, vtkMedFieldOverEntity); + + // Description: + // This is the name of the profile used by this field. + vtkGetStringMacro(ProfileName); + vtkSetStringMacro(ProfileName); + + // Description: + // This is the name of the localization used by this field on this profile. + vtkGetStringMacro(LocalizationName); + vtkSetStringMacro(LocalizationName); + + // Description: + // This stores the size of the profile. + vtkSetMacro(ProfileSize, med_int); + vtkGetMacro(ProfileSize, med_int); + + // Description: + // This stores the number of integration points for this localization. + vtkSetMacro(NumberOfIntegrationPoint, med_int); + vtkGetMacro(NumberOfIntegrationPoint, med_int); + + // Description: + // The number of values of this field on this mesh + vtkSetMacro(NumberOfValues, med_int); + vtkGetMacro(NumberOfValues, med_int); + + // Description: + // the Data that store the values read from file + virtual void SetData(vtkDataArray*); + vtkGetObjectMacro(Data, vtkDataArray); + + // Description: + // the Profile object associated witht he profile name. + virtual void SetProfile(vtkMedProfile*); + vtkGetObjectMacro(Profile, vtkMedProfile); + + // Description: + // returns true if the data has been loaded + int IsLoaded(); + + // Description: + // returns true if the profile name is not MED_NO_PROFILE + int GetHasProfile(); + + // Description: + // Load the actual data of this field + void Load(med_storage_mode mode); + + // Description: + // Get/Set of the MED Filter for parallel reading. + //void SetFilter(const med_filter& filter){this->Filter = filter;} + //med_filter GetFilter(){return this->Filter;} + void SetFilter(vtkMedFilter* filter){this->Filter = filter;} + vtkMedFilter* GetFilter(){return this->Filter;} +protected: + vtkMedFieldOnProfile(); + virtual ~vtkMedFieldOnProfile(); + + med_int MedIterator; + vtkMedFieldOverEntity *ParentFieldOverEntity; + char* ProfileName; + med_int ProfileSize; + char* LocalizationName; + med_int NumberOfIntegrationPoint; + med_int NumberOfValues; + vtkDataArray* Data; + vtkMedProfile* Profile; + + //med_filter Filter; + vtkMedFilter *Filter; + +private: + vtkMedFieldOnProfile(const vtkMedFieldOnProfile&); // Not implemented. + void operator=(const vtkMedFieldOnProfile&); // Not implemented. + +}; + +#endif //__vtkMedFieldOnProfile_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFieldOverEntity.cxx b/src/Plugins/MedReader/IO/vtkMedFieldOverEntity.cxx new file mode 100644 index 00000000..c3880d06 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFieldOverEntity.cxx @@ -0,0 +1,56 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFieldOverEntity.h" + +#include "vtkObjectFactory.h" +#include "vtkSmartPointer.h" + +#include "vtkMedUtilities.h" +#include "vtkMedMesh.h" +#include "vtkDataArray.h" +#include "vtkMedFieldOnProfile.h" +#include "vtkMedFieldStep.h" +#include "vtkMedField.h" + +vtkCxxGetObjectVectorMacro(vtkMedFieldOverEntity, FieldOnProfile, vtkMedFieldOnProfile); +vtkCxxSetObjectVectorMacro(vtkMedFieldOverEntity, FieldOnProfile, vtkMedFieldOnProfile); + +vtkCxxSetObjectMacro(vtkMedFieldOverEntity, ParentStep, vtkMedFieldStep); + +vtkCxxRevisionMacro(vtkMedFieldOverEntity, "$Revision$") +vtkStandardNewMacro(vtkMedFieldOverEntity) + +vtkMedFieldOverEntity::vtkMedFieldOverEntity() +{ + this->FieldOnProfile = new vtkObjectVector(); + this->HasProfile = false; + this->ParentStep = NULL; +} + +vtkMedFieldOverEntity::~vtkMedFieldOverEntity() +{ + delete this->FieldOnProfile; + this->SetParentStep(NULL); +} + +void vtkMedFieldOverEntity::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFieldOverEntity.h b/src/Plugins/MedReader/IO/vtkMedFieldOverEntity.h new file mode 100644 index 00000000..dc853728 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFieldOverEntity.h @@ -0,0 +1,81 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFieldOverEntity_h_ +#define __vtkMedFieldOverEntity_h_ + +#include "vtkObject.h" +#include "vtkMed.h" + +#include "vtkMedSetGet.h" +#include "vtkMedUtilities.h" + +class vtkMedFieldOnProfile; +class vtkMedFieldStep; + +class VTK_EXPORT vtkMedFieldOverEntity: public vtkObject +{ +public: + static vtkMedFieldOverEntity* New(); + vtkTypeRevisionMacro(vtkMedFieldOverEntity, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // the support of the cells : one of + void SetEntity(const vtkMedEntity& entity){this->Entity = entity;} + const vtkMedEntity& GetEntity(){return this->Entity;} + + // Description: + // This is the vtkMedFieldStep that owns this vtkMedFieldOverEntity + virtual void SetParentStep(vtkMedFieldStep*); + vtkGetObjectMacro(ParentStep, vtkMedFieldStep); + + // Description: + // This array store for each profile the field over this profile + vtkGetObjectVectorMacro(FieldOnProfile, vtkMedFieldOnProfile); + vtkSetObjectVectorMacro(FieldOnProfile, vtkMedFieldOnProfile); + + // Description: + // This flag is set during the information pass, and tells if + // there is a profile of not. + // Note that if there is no profile, a dummy vtkMedFieldOnProfile + // is created to store the actual data. + vtkGetMacro(HasProfile, int); + vtkSetMacro(HasProfile, int); + +protected: + vtkMedFieldOverEntity(); + virtual ~vtkMedFieldOverEntity(); + + vtkMedFieldStep* ParentStep; + + vtkMedEntity Entity; + + int HasProfile; + + //BTX + vtkObjectVector* FieldOnProfile; + //ETX + +private: + vtkMedFieldOverEntity(const vtkMedFieldOverEntity&); // Not implemented. + void operator=(const vtkMedFieldOverEntity&); // Not implemented. +}; + +#endif //__vtkMedFieldOverEntity_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFieldStep.cxx b/src/Plugins/MedReader/IO/vtkMedFieldStep.cxx new file mode 100644 index 00000000..32578332 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFieldStep.cxx @@ -0,0 +1,77 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFieldStep.h" + +#include "vtkObjectFactory.h" +#include "vtkSmartPointer.h" +#include "vtkMedUtilities.h" +#include "vtkMedFieldOverEntity.h" +#include "vtkMedField.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" + +vtkCxxGetObjectVectorMacro(vtkMedFieldStep, FieldOverEntity, vtkMedFieldOverEntity); +vtkCxxSetObjectVectorMacro(vtkMedFieldStep, FieldOverEntity, vtkMedFieldOverEntity); + +vtkCxxSetObjectMacro(vtkMedFieldStep, ParentField, vtkMedField); +vtkCxxSetObjectMacro(vtkMedFieldStep, PreviousStep, vtkMedFieldStep); + +vtkCxxRevisionMacro(vtkMedFieldStep, "$Revision$") +vtkStandardNewMacro(vtkMedFieldStep) + +vtkMedFieldStep::vtkMedFieldStep() +{ + this->FieldOverEntity = new vtkObjectVector(); + this->PreviousStep = NULL; + this->ParentField = NULL; + this->MedIterator = -1; + this->EntityInfoLoaded = 0; +} + +vtkMedFieldStep::~vtkMedFieldStep() +{ + delete this->FieldOverEntity; + this->SetPreviousStep(NULL); + this->SetParentField(NULL); +} + +vtkMedFieldOverEntity* vtkMedFieldStep::GetFieldOverEntity( + const vtkMedEntity& entity) +{ + for(int id=0; id < this->GetNumberOfFieldOverEntity(); id++) + { + vtkMedFieldOverEntity* fieldOverEntity = this->GetFieldOverEntity(id); + if(fieldOverEntity->GetEntity() == entity) + return fieldOverEntity; + } + return NULL; +} + +void vtkMedFieldStep::LoadInformation() +{ + this->GetParentField()->GetParentFile()->GetMedDriver()-> + ReadFieldStepInformation(this, true); +} + +void vtkMedFieldStep::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_OBJECT_VECTOR(os, indent, FieldOverEntity); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFieldStep.h b/src/Plugins/MedReader/IO/vtkMedFieldStep.h new file mode 100644 index 00000000..54b82155 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFieldStep.h @@ -0,0 +1,115 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFieldStep_h_ +#define __vtkMedFieldStep_h_ + +#include "vtkObject.h" +#include "vtkMedSetGet.h" +#include "vtkMed.h" +#include "vtkMedUtilities.h" + +class vtkMedString; +class vtkMedMesh; +class vtkDataArray; +class vtkMedFieldOverEntity; +class vtkMedField; + +class VTK_EXPORT vtkMedFieldStep: public vtkObject +{ +public: + static vtkMedFieldStep* New(); + vtkTypeRevisionMacro(vtkMedFieldStep, vtkObject); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This iterator is used when reading information from the med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // The compute step of this field + void SetComputeStep(const vtkMedComputeStep& cs) + { + this->ComputeStep = cs; + } + const vtkMedComputeStep& GetComputeStep() const + { + return this->ComputeStep; + } + + // Description: + // The compute step of the mesh supporting this field at this step + void SetMeshComputeStep(const vtkMedComputeStep& cs) + { + this->MeshComputeStep = cs; + } + const vtkMedComputeStep& GetMeshComputeStep() const + { + return this->MeshComputeStep; + } + + // Description: + // Set the number of steps of this field over these cells. + vtkGetObjectVectorMacro(FieldOverEntity, vtkMedFieldOverEntity); + vtkSetObjectVectorMacro(FieldOverEntity, vtkMedFieldOverEntity); + + // Description: + // returns the vtkMedFieldOverEntity for the given Type and Geometry; + virtual vtkMedFieldOverEntity* + GetFieldOverEntity(const vtkMedEntity&); + + // Description: + // The parent field is the one that owns this step + virtual void SetParentField(vtkMedField*); + vtkGetObjectMacro(ParentField, vtkMedField); + + // Description: + // The parent field is the one that owns this step + virtual void SetPreviousStep(vtkMedFieldStep*); + vtkGetObjectMacro(PreviousStep, vtkMedFieldStep); + + virtual void LoadInformation(); + + // Description: + // This flag is used to delay loading information on all entity as long as possible + vtkSetMacro(EntityInfoLoaded, med_int); + vtkGetMacro(EntityInfoLoaded, med_int); + +protected: + vtkMedFieldStep(); + virtual ~vtkMedFieldStep(); + + int EntityInfoLoaded; + med_int MedIterator; + vtkMedComputeStep ComputeStep; + vtkMedComputeStep MeshComputeStep; + vtkMedField* ParentField; + vtkMedFieldStep* PreviousStep; + + //BTX + vtkObjectVector* FieldOverEntity; + //ETX + +private: + vtkMedFieldStep(const vtkMedFieldStep&); // Not implemented. + void operator=(const vtkMedFieldStep&); // Not implemented. +}; + +#endif //__vtkMedFieldStep_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFile.cxx b/src/Plugins/MedReader/IO/vtkMedFile.cxx new file mode 100644 index 00000000..cf41b6dd --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFile.cxx @@ -0,0 +1,194 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFile.h" + +#include "vtkObjectFactory.h" +#include "vtkDataArraySelection.h" +#include "vtkSmartPointer.h" + +#include "vtkMedMesh.h" +#include "vtkMedField.h" +#include "vtkMedProfile.h" +#include "vtkMedLocalization.h" +#include "vtkMedUtilities.h" +#include "vtkMedLink.h" +#include "vtkMedDriver.h" +#include "vtkMedFactory.h" +#include "vtkMedStructElement.h" + +vtkCxxGetObjectVectorMacro(vtkMedFile, Mesh, vtkMedMesh); +vtkCxxSetObjectVectorMacro(vtkMedFile, Mesh, vtkMedMesh); + +vtkCxxGetObjectVectorMacro(vtkMedFile, Field, vtkMedField); +vtkCxxSetObjectVectorMacro(vtkMedFile, Field, vtkMedField); + +vtkCxxGetObjectVectorMacro(vtkMedFile, Profile, vtkMedProfile); +vtkCxxSetObjectVectorMacro(vtkMedFile, Profile, vtkMedProfile); + +vtkCxxGetObjectVectorMacro(vtkMedFile, Localization, vtkMedLocalization); +vtkCxxSetObjectVectorMacro(vtkMedFile, Localization, vtkMedLocalization); + +vtkCxxGetObjectVectorMacro(vtkMedFile, Link, vtkMedLink); +vtkCxxSetObjectVectorMacro(vtkMedFile, Link, vtkMedLink); + +vtkCxxGetObjectVectorMacro(vtkMedFile, StructElement, vtkMedStructElement); +vtkCxxSetObjectVectorMacro(vtkMedFile, StructElement, vtkMedStructElement); + +vtkCxxGetObjectVectorMacro(vtkMedFile, SupportMesh, vtkMedMesh); +vtkCxxSetObjectVectorMacro(vtkMedFile, SupportMesh, vtkMedMesh); + +vtkCxxSetObjectMacro(vtkMedFile, MedDriver, vtkMedDriver); + +vtkCxxRevisionMacro(vtkMedFile, "$Revision$") +vtkStandardNewMacro(vtkMedFile) + +vtkMedFile::vtkMedFile() +{ + this->Comment = NULL; + this->Mesh = new vtkObjectVector (); + this->Field = new vtkObjectVector (); + this->Profile = new vtkObjectVector (); + this->Localization = new vtkObjectVector (); + this->Link = new vtkObjectVector (); + this->StructElement = new vtkObjectVector(); + this->SupportMesh = new vtkObjectVector(); + this->FileName = NULL; + this->MedDriver = NULL; + this->VersionMajor = -1; + this->VersionMinor = -1; + this->VersionRelease = -1; +} + +vtkMedFile::~vtkMedFile() +{ + this->SetComment(NULL); + delete this->Mesh; + delete this->Field; + delete this->Profile; + delete this->Localization; + delete this->Link; + delete this->StructElement; + delete this->SupportMesh; + this->SetFileName(NULL); + this->SetMedDriver(NULL); +} + +int vtkMedFile::CreateDriver() +{ + int major, minor, release; + vtkMedDriver* driver=vtkMedDriver::New(); + driver->SetMedFile(this); + bool canRead=driver->CanReadFile(); + if(!canRead) + { + driver->Delete(); + this->SetMedDriver(NULL); + return 0; + } + driver->ReadFileVersion(&major, &minor, &release); + driver->Delete(); + vtkMedFactory* factory=vtkMedFactory::New(); + driver=factory->NewMedDriver(major, minor, release); + factory->Delete(); + this->SetMedDriver(driver); + if (driver) + { + driver->SetMedFile(this); + return 1; + } + return 0; +} + +void vtkMedFile::ReadInformation() +{ + if(this->MedDriver == NULL) + { + if(!this->CreateDriver()) + return; + } + + // at this point, we know that we have a valid driver. + this->MedDriver->ReadFileInformation(this); +} + +vtkMedMesh* vtkMedFile::GetMesh(const char* str) +{ + for (int m = 0; m < this->Mesh->size(); m++) + { + vtkMedMesh* mesh = this->Mesh->at(m); + if (strcmp(mesh->GetName(), str) == 0) + { + return mesh; + } + } + return NULL; +} + +vtkMedProfile* vtkMedFile::GetProfile(const char* str) +{ + for (int profId = 0; profId < this->Profile->size(); profId++) + { + vtkMedProfile* profile = this->Profile->at(profId); + if (strcmp(profile->GetName(), str) == 0) + { + return profile; + } + } + return NULL; + +} + +vtkMedLocalization* vtkMedFile::GetLocalization(const char* str) +{ + for (int quadId = 0; quadId < this->Localization->size(); quadId++) + { + vtkMedLocalization* loc = this->Localization->at(quadId); + if (strcmp(loc->GetName(), str) == 0) + { + return loc; + } + } + return NULL; +} + +vtkMedStructElement* vtkMedFile::GetStructElement(const vtkMedEntity& entity) +{ + if(entity.EntityType != MED_STRUCT_ELEMENT) + return NULL; + + for(int selemit = 0; selemit < this->GetNumberOfStructElement(); selemit++) + { + vtkMedStructElement* structelem = this->GetStructElement(selemit); + if(structelem->GetGeometryType() == entity.GeometryType) + return structelem; + } + return NULL; +} + +void vtkMedFile::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + + PRINT_OBJECT_VECTOR(os, indent, Mesh); + PRINT_OBJECT_VECTOR(os, indent, Field); + PRINT_OBJECT_VECTOR(os, indent, Profile); + PRINT_OBJECT_VECTOR(os, indent, Localization); + PRINT_OBJECT_VECTOR(os, indent, Link); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFile.h b/src/Plugins/MedReader/IO/vtkMedFile.h new file mode 100644 index 00000000..b1e6f3ee --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFile.h @@ -0,0 +1,141 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFile_h_ +#define __vtkMedFile_h_ + +#include "vtkObject.h" +#include "vtkMedSetGet.h" + +class vtkMedMesh; +class vtkMedField; +class vtkMedProfile; +class vtkMedLocalization; +class vtkMedLink; +class vtkMedDriver; +class vtkMedStructElement; +class vtkMedEntity; + +class VTK_EXPORT vtkMedFile: public vtkObject +{ +public: + static vtkMedFile* New(); + vtkTypeRevisionMacro(vtkMedFile, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Set the file name to read from + vtkSetStringMacro(FileName); + vtkGetStringMacro(FileName); + + // Description: + // This is the description of this file as stored in the med file. + vtkGetObjectMacro(MedDriver, vtkMedDriver); + + // Description: + // This method tries to create a new driver for this file. + // It returns 1 on success, 0 on failure. + virtual int CreateDriver(); + + // Description: + // read information from this file, and create the meta data structure + virtual void ReadInformation(); + + // Description: + // Container of the meshes. + vtkGetObjectVectorMacro(Mesh, vtkMedMesh); + vtkSetObjectVectorMacro(Mesh, vtkMedMesh); + virtual vtkMedMesh* GetMesh(const char*); + + // Description: + // Container of the fields. + vtkGetObjectVectorMacro(Field, vtkMedField); + vtkSetObjectVectorMacro(Field, vtkMedField); + + // Description: + // Container of the fields. + vtkGetObjectVectorMacro(Link, vtkMedLink); + vtkSetObjectVectorMacro(Link, vtkMedLink); + + // Description: + // Container of the profiles. + vtkGetObjectVectorMacro(Profile, vtkMedProfile); + vtkSetObjectVectorMacro(Profile, vtkMedProfile); + virtual vtkMedProfile* GetProfile(const char*); + + // Description: + // Container of the quadrature definitions. + vtkGetObjectVectorMacro(Localization, vtkMedLocalization); + vtkSetObjectVectorMacro(Localization, vtkMedLocalization); + virtual vtkMedLocalization* GetLocalization(const char*); + + // Description: + // This is the description of this file as stored in the med file. + vtkSetStringMacro(Comment); + vtkGetStringMacro(Comment); + + // Description: + // Those 3 numbers describe the version of med used to create this file. + vtkSetMacro(VersionMajor, int); + vtkGetMacro(VersionMajor, int); + vtkSetMacro(VersionMinor, int); + vtkGetMacro(VersionMinor, int); + vtkSetMacro(VersionRelease, int); + vtkGetMacro(VersionRelease, int); + + // Description: + // Get the structural elements models + vtkGetObjectVectorMacro(StructElement, vtkMedStructElement); + vtkSetObjectVectorMacro(StructElement, vtkMedStructElement); + vtkMedStructElement* GetStructElement(const vtkMedEntity&); + + // Description: + // Get the support mesh informations + vtkGetObjectVectorMacro(SupportMesh, vtkMedMesh); + vtkSetObjectVectorMacro(SupportMesh, vtkMedMesh); + +protected: + vtkMedFile(); + virtual ~vtkMedFile(); + + char * FileName; + vtkMedDriver* MedDriver; + virtual void SetMedDriver(vtkMedDriver*); + + int VersionMajor; + int VersionMinor; + int VersionRelease; + + char* Comment; + //BTX + vtkObjectVector* Mesh; + vtkObjectVector* Field; + vtkObjectVector* Profile; + vtkObjectVector* Localization; + vtkObjectVector* Link; + vtkObjectVector* StructElement; + vtkObjectVector* SupportMesh; + //ETX + +private: + vtkMedFile(const vtkMedFile&); // Not implemented. + void operator=(const vtkMedFile&); // Not implemented. +}; + +#endif //__vtkMedMetaData_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFilter.cxx b/src/Plugins/MedReader/IO/vtkMedFilter.cxx new file mode 100644 index 00000000..b5939661 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFilter.cxx @@ -0,0 +1,63 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFilter.h" + +#include "vtkObjectFactory.h" + +vtkCxxRevisionMacro(vtkMedFilter, "$Revision$") +vtkStandardNewMacro(vtkMedFilter) + +vtkMedFilter::vtkMedFilter() +{ + _start = 0; + _stride = 0; + _count = 0; + _blocksize = 0; + _lastblocksize = 0; +} + +vtkMedFilter::~vtkMedFilter() +{ +} + +void vtkMedFilter::SetFilterSizes( int start, int stride, + int count, int blocksize, int lastblocksize ) +{ + _start = start; + _stride = stride; + _count = count; + _blocksize = blocksize; + _lastblocksize = lastblocksize; +} + +void vtkMedFilter::GetFilterSizes( int& start, int& stride, + int& count, int& blocksize, int& lastblocksize ) +{ + start = _start; + stride = _stride; + count = _count; + blocksize = _blocksize; + lastblocksize = _lastblocksize; +} + +void vtkMedFilter::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFilter.h b/src/Plugins/MedReader/IO/vtkMedFilter.h new file mode 100644 index 00000000..4df3e754 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFilter.h @@ -0,0 +1,49 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFilter_h_ +#define __vtkMedFilter_h_ + +#include "vtkObject.h" +#include"vtkMed.h" + +class VTK_EXPORT vtkMedFilter : public vtkObject +{ +public: + static vtkMedFilter* New(); + vtkTypeRevisionMacro(vtkMedFilter, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + void SetFilterSizes( int , int , int , int , int ); + + void GetFilterSizes( int& , int& , int& , int& , int& ); + +protected : + vtkMedFilter(); + ~vtkMedFilter(); + + //med_filter Filter; + int _start; + int _stride; + int _count; + int _blocksize; + int _lastblocksize; +}; + +#endif //__vtkMedFilter_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedFraction.cxx b/src/Plugins/MedReader/IO/vtkMedFraction.cxx new file mode 100644 index 00000000..2680c6ee --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFraction.cxx @@ -0,0 +1,211 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedFraction.h" + +#include "vtkObjectFactory.h" + +#include "vtkIntArray.h" +#include "vtkDoubleArray.h" + +vtkCxxRevisionMacro(vtkMedFraction, "$Revision$") +vtkStandardNewMacro(vtkMedFraction) + +vtkMedFraction::vtkMedFraction() +{ + this->Coefficients = vtkDoubleArray::New(); + this->Powers = vtkIntArray::New(); + this->DenominatorCoefficients = vtkDoubleArray::New(); + this->DenominatorPowers = vtkIntArray::New(); + this->NumberOfVariable = 0; +} + +vtkMedFraction::~vtkMedFraction() +{ + this->Coefficients->Delete(); + this->Powers->Delete(); + this->DenominatorCoefficients->Delete(); + this->DenominatorPowers->Delete(); +} + +vtkIntArray* vtkMedFraction::GetPowers() +{ + return this->Powers; +} + +vtkDoubleArray* vtkMedFraction::GetCoefficients() +{ + return this->Coefficients; +} + +vtkIntArray* vtkMedFraction::GetDenominatorPowers() +{ + return this->DenominatorPowers; +} + +vtkDoubleArray* vtkMedFraction::GetDenominatorCoefficients() +{ + return this->DenominatorCoefficients; +} + +void vtkMedFraction::SetNumberOfCoefficients(int ncoeff) +{ + this->Powers->SetNumberOfTuples(ncoeff); + this->Coefficients->SetNumberOfTuples(ncoeff); + + int* powers = this->Powers->GetPointer(0); + memset(powers, 0, ncoeff*this->Powers->GetNumberOfComponents()*sizeof(int)); + + double* coeffs = this->Coefficients->GetPointer(0); + memset(powers, 0, ncoeff*sizeof(double)); +} + +void vtkMedFraction::SetNumberOfDenominatorCoefficients(int ncoeff) +{ + this->DenominatorPowers->SetNumberOfTuples(ncoeff); + this->DenominatorCoefficients->SetNumberOfTuples(ncoeff); + + int* powers = this->DenominatorPowers->GetPointer(0); + memset(powers, 0, + ncoeff*this->DenominatorPowers->GetNumberOfComponents()*sizeof(int)); + + double* coeffs = this->DenominatorCoefficients->GetPointer(0); + memset(powers, 0, ncoeff*sizeof(double)); +} + +void vtkMedFraction::SetNumberOfVariable(int nbofvariable) +{ + int nvar; + if(nbofvariable <= 0) + { + nvar = 1; + } + else + { + nvar = nbofvariable; + } + + this->Powers->SetNumberOfComponents(nvar); + this->DenominatorPowers->SetNumberOfComponents(nvar); + + // force an allocation + this->Powers->SetNumberOfTuples( + this->Powers->GetNumberOfTuples()); + int* powers = this->Powers->GetPointer(0); + memset(powers, 0, + nvar*this->Powers->GetNumberOfComponents()*sizeof(int)); + + this->DenominatorPowers->SetNumberOfTuples( + this->DenominatorPowers->GetNumberOfTuples()); + int* denom_powers = this->DenominatorPowers->GetPointer(0); + memset(denom_powers, 0, + nvar*this->DenominatorPowers->GetNumberOfComponents()*sizeof(int)); + + this->NumberOfVariable = nbofvariable; +} + +double vtkMedFraction::Evaluate(double* coord) +{ + if(this->Coefficients->GetNumberOfTuples() == 0) + { + return 0.0; + } + + if(this->NumberOfVariable == 0) + { + return this->Coefficients->GetValue(0); + } + + double res = 0.0; + for(int coeffid = 0; coeffid < + this->Coefficients->GetNumberOfTuples(); coeffid++) + { + double prod = this->Coefficients->GetValue(coeffid); + for(int varid=0; varidNumberOfVariable; varid++) + { + prod *= pow(coord[varid], + this->Powers->GetValue( + this->NumberOfVariable*coeffid+varid)); + } + res += prod; + } + + double denom_res = 0.0; + + if(this->DenominatorCoefficients->GetNumberOfTuples() == 0) + { + denom_res = 1.0; + } + else + { + for(int coeffid = 0; coeffid < + this->DenominatorCoefficients->GetNumberOfTuples(); coeffid++) + { + double prod = this->DenominatorCoefficients->GetValue(coeffid); + for(int varid=0; varidNumberOfVariable; varid++) + { + prod *= pow(coord[varid], + this->DenominatorPowers->GetValue( + this->NumberOfVariable*coeffid+varid)); + } + denom_res += prod; + } + } + + return res / denom_res; +} + +double vtkMedFraction::Evaluate1(double coord) +{ + if(this->NumberOfVariable != 1) + { + vtkErrorMacro("Evaluate1 can only be called if the NumberOfVariable is 1"); + } + + return this->Evaluate(&coord); +} + +double vtkMedFraction::Evaluate2(double x, double y) +{ + if(this->NumberOfVariable != 2) + { + vtkErrorMacro("Evaluate2 can only be called if the NumberOfVariable is 2"); + } + + double coord[2] = {x, y}; + + return this->Evaluate(coord); +} + +double vtkMedFraction::Evaluate3(double x, double y, double z) +{ + if(this->NumberOfVariable != 3) + { + vtkErrorMacro("Evaluate3 can only be called if the NumberOfVariable is 3"); + } + + double coord[3] = {x, y, z}; + + return this->Evaluate(coord); +} + +void vtkMedFraction::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedFraction.h b/src/Plugins/MedReader/IO/vtkMedFraction.h new file mode 100644 index 00000000..b594b094 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedFraction.h @@ -0,0 +1,94 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedFraction_h_ +#define __vtkMedFraction_h_ + +#include "vtkObject.h" + +class vtkIntArray; +class vtkDoubleArray; + +class VTK_EXPORT vtkMedFraction : public vtkObject +{ +public: + static vtkMedFraction* New(); + vtkTypeRevisionMacro(vtkMedFraction, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // the powers of this polynomial function + // the number of components of this array is equal to the maximum degree + // and the number of tuples to the numner of coefficients + virtual vtkIntArray* GetPowers(); + + // Description: + // The coefficients of this polynomial function + virtual vtkDoubleArray* GetCoefficients(); + + // Description: + // the powers of this polynomial function + // the number of components of this array is equal to the maximum degree + // and the number of tuples to the numner of coefficients + virtual vtkIntArray* GetDenominatorPowers(); + + // Description: + // The coefficients of this polynomial function + virtual vtkDoubleArray* GetDenominatorCoefficients(); + + // Description: + // This sets the number of coefficients in this polynom + void SetNumberOfCoefficients(int); + + // Description: + // This sets the number of coefficients in this polynom + void SetNumberOfDenominatorCoefficients(int); + + // Description: + // This sets the maximum degree of this polynom. + // This also allocates the array to store the powers of this + // polynom + void SetNumberOfVariable(int); + vtkGetMacro(NumberOfVariable, int); + + // Description: + // Evaluate the value of this function at this point. + virtual double Evaluate(double*); + virtual double Evaluate1(double); + virtual double Evaluate2(double, double); + virtual double Evaluate3(double, double, double); + +protected : + vtkMedFraction(); + ~vtkMedFraction(); + + vtkIntArray* Powers; + vtkDoubleArray* Coefficients; + + vtkIntArray* DenominatorPowers; + vtkDoubleArray* DenominatorCoefficients; + + int NumberOfVariable; + +private : + vtkMedFraction(const vtkMedFraction&); // Not implemented. + void operator=(const vtkMedFraction&); // Not implemented. +}; + +#endif //__vtkMedFraction_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedGrid.cxx b/src/Plugins/MedReader/IO/vtkMedGrid.cxx new file mode 100644 index 00000000..80baf774 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedGrid.cxx @@ -0,0 +1,98 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedGrid.h" + +#include "vtkObjectFactory.h" + +#include "vtkMedUtilities.h" +#include "vtkMedMesh.h" +#include "vtkMedIntArray.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedFamily.h" +#include "vtkMedEntityArray.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" + +#include +using std::set; + +vtkCxxGetObjectVectorMacro(vtkMedGrid, EntityArray, vtkMedEntityArray); +vtkCxxSetObjectVectorMacro(vtkMedGrid, EntityArray, vtkMedEntityArray); + +vtkCxxSetObjectMacro(vtkMedGrid, PointGlobalIds, vtkMedIntArray); +vtkCxxSetObjectMacro(vtkMedGrid, ParentMesh, vtkMedMesh); +vtkCxxSetObjectMacro(vtkMedGrid, PreviousGrid, vtkMedGrid); + +vtkCxxRevisionMacro(vtkMedGrid, "$Revision$") + +vtkMedGrid::vtkMedGrid() +{ + this->ParentMesh = NULL; + this->PointGlobalIds = NULL; + this->PreviousGrid = NULL; + + this->CoordinateSystem = MED_CARTESIAN; + this->EntityArray = new vtkObjectVector(); + this->UsePreviousCoordinates = false; +} + +vtkMedGrid::~vtkMedGrid() +{ + this->SetPointGlobalIds(NULL); + this->SetParentMesh(NULL); + delete this->EntityArray; +} + +int vtkMedGrid::IsPointGlobalIdsLoaded() +{ + return this->PointGlobalIds != NULL + && this->PointGlobalIds->GetNumberOfTuples() + == this->GetNumberOfPoints(); +} + +void vtkMedGrid::ClearMedSupports() +{ + this->SetPointGlobalIds(NULL); +} + +vtkMedEntityArray* vtkMedGrid::GetEntityArray(const vtkMedEntity& entity) +{ + for(int id = 0; id < this->EntityArray->size(); id++) + { + vtkMedEntityArray* array = this->EntityArray->at(id); + if(array->GetEntity() == entity) + return array; + } + return NULL; +} + +void vtkMedGrid::GatherMedEntities(std::set& entities) +{ + for(int id = 0; id < this->EntityArray->size(); id++) + { + vtkMedEntityArray* array = this->EntityArray->at(id); + entities.insert(array->GetEntity()); + } +} + +void vtkMedGrid::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedGrid.h b/src/Plugins/MedReader/IO/vtkMedGrid.h new file mode 100644 index 00000000..647b80ec --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedGrid.h @@ -0,0 +1,166 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedGrid_h_ +#define __vtkMedGrid_h_ + +#include "vtkObject.h" +#include "vtkMedSetGet.h" +#include "vtkMedUtilities.h" +#include "vtkMed.h" +#include "vtkMedIntArray.h" + +class vtkMedString; +class vtkMedFamilyOnEntity; +class vtkMedIntArray; + +class VTK_EXPORT vtkMedGrid : public vtkObject +{ +public : + vtkTypeRevisionMacro(vtkMedGrid, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This identifies the time and iteration of this grid + void SetComputeStep(vtkMedComputeStep cs) + { + this->ComputeStep = cs; + } + vtkMedComputeStep GetComputeStep() + { + return this->ComputeStep; + } + + // Description: + // returns the number of points. Each sub class has to implement this method. + virtual med_int GetNumberOfPoints() = 0; + + // Description: + // Initialize the global Ids of the first element of each MedEntityArray + virtual void InitializeCellGlobalIds(){;} + + // Description: + // this stores the array giving the family id for each point of this mesh. + //vtkGetObjectVectorMacro(PointFamilyData, vtkMedFamilyOnEntity); + //vtkSetObjectVectorMacro(PointFamilyData, vtkMedFamilyOnEntity); + //virtual vtkMedFamilyOnEntity* GetPointFamilyDataById(med_int id); + + // Description: + // Gather the families that are present on this mesh nodes + //virtual void ComputePointFamilies(); + + // Description: + // this array contains the global ids of the points used by the grid. + virtual void SetPointGlobalIds(vtkMedIntArray*); + vtkGetObjectMacro(PointGlobalIds, vtkMedIntArray); + + // Description: + // this array contains the family ids of the points used by the grid. + //virtual void SetPointFamilyIds(vtkMedIntArray*); + //vtkGetObjectMacro(PointFamilyIds, vtkMedIntArray); + + // Description: + // The mesh that use this grid + virtual void SetParentMesh(vtkMedMesh*); + vtkGetObjectMacro(ParentMesh, vtkMedMesh); + + // Description: + // The mesh that use this grid + virtual void SetPreviousGrid(vtkMedGrid*); + vtkGetObjectMacro(PreviousGrid, vtkMedGrid); + + // Description: + // returns 1 if the global Ids array is set, and the + // number of tuples matches the number of points + virtual int IsPointGlobalIdsLoaded(); + + // Description: + // clear the entity arrays storing the connectivity + virtual void ClearMedSupports(); + + // Description: + // This is the coordinate system the grid live in. + vtkSetMacro(CoordinateSystem, med_axis_type); + vtkGetMacro(CoordinateSystem, med_axis_type); + + // Description: + // This flag is set during the information loading, and tells if the + // coordinates of this grid at this step has changed from the previous step. + // if not, you should request the coordinates array from the previous grid + // instead of this one. + vtkSetMacro(UsePreviousCoordinates, bool); + vtkGetMacro(UsePreviousCoordinates, bool); + + // Description: + // Add a cell array to this unstructured grid. + // each cell array represents a different cell type. + vtkGetObjectVectorMacro(EntityArray, vtkMedEntityArray); + vtkSetObjectVectorMacro(EntityArray, vtkMedEntityArray); + + // Description: + // load the family ids using the driver + //void LoadPointFamilyIds(); + + virtual void LoadCoordinates() = 0; + virtual int IsCoordinatesLoaded() = 0; + + // Description: + // return the vtkMedEntityArray that match the Entity type, if any. + virtual vtkMedEntityArray* GetEntityArray(const vtkMedEntity&); + + virtual double* GetCoordTuple(med_int index) = 0; + + // Description: + // This will instanciate a new vtkDataSet object. + // The caller is responsible for deleting it. + virtual vtkDataSet* CreateVTKDataSet(vtkMedFamilyOnEntityOnProfile*) = 0; + + // Description: + // This utility method returns all vtkMedEntity types present in this grid + virtual void GatherMedEntities(std::set& entities); + +protected: + vtkMedGrid(); + virtual ~vtkMedGrid(); + + vtkMedComputeStep ComputeStep; + vtkMedIntArray* PointGlobalIds; + //vtkMedIntArray* PointFamilyIds; + + vtkMedMesh* ParentMesh; + + vtkMedGrid* PreviousGrid; + + //BTX + //vtkObjectVector* PointFamilyData; + //ETX + + bool UsePreviousCoordinates; + med_axis_type CoordinateSystem; + //BTX + vtkObjectVector* EntityArray; + //ETX + +private: + vtkMedGrid(const vtkMedGrid&); // Not implemented. + void operator=(const vtkMedGrid&); // Not implemented. + +}; + +#endif //__vtkMedGrid_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedGroup.cxx b/src/Plugins/MedReader/IO/vtkMedGroup.cxx new file mode 100644 index 00000000..a2a9ddf0 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedGroup.cxx @@ -0,0 +1,43 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedGroup.h" + +#include "vtkObjectFactory.h" + +#include "vtkMedUtilities.h" + +vtkCxxRevisionMacro(vtkMedGroup, "$Revision$") +vtkStandardNewMacro(vtkMedGroup) + +vtkMedGroup::vtkMedGroup() +{ + this->Name = NULL; + this->SetName(vtkMedUtilities::NoGroupName); +} + +vtkMedGroup::~vtkMedGroup() +{ + this->SetName(NULL); +} + +void vtkMedGroup::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedGroup.h b/src/Plugins/MedReader/IO/vtkMedGroup.h new file mode 100644 index 00000000..e5b37d09 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedGroup.h @@ -0,0 +1,57 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedGroup_h_ +#define __vtkMedGroup_h_ + +#include "vtkObject.h" + +class vtkMedString; + +class VTK_EXPORT vtkMedGroup : public vtkObject +{ +public : + static vtkMedGroup* New(); + vtkTypeRevisionMacro(vtkMedGroup, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the description of this file as stored in the med file. + vtkGetStringMacro(Name); + vtkSetStringMacro(Name); + + // Description: + // This ivar says if this group contains point or cell families + // This value is either vtkMedUtilities::OnPoint or vtkMedUtilities::OnCell +// vtkSetMacro(PointOrCell, int); +// vtkGetMacro(PointOrCell, int); + +protected: + vtkMedGroup(); + virtual ~vtkMedGroup(); + + char* Name; + +private: + vtkMedGroup(const vtkMedGroup&); // Not implemented. + void operator=(const vtkMedGroup&); // Not implemented. + +}; + +#endif //__vtkMedGroup_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedIntArray.cxx b/src/Plugins/MedReader/IO/vtkMedIntArray.cxx new file mode 100644 index 00000000..e196198c --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedIntArray.cxx @@ -0,0 +1,42 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedIntArray.h" + +#include "vtkObjectFactory.h" + +//---------------------------------------------------------------------------- +vtkCxxRevisionMacro(vtkMedIntArray, "$Revision$"); +vtkStandardNewMacro(vtkMedIntArray); + +//---------------------------------------------------------------------------- +vtkMedIntArray::vtkMedIntArray(vtkIdType numComp): Superclass(numComp) +{ +} + +//---------------------------------------------------------------------------- +vtkMedIntArray::~vtkMedIntArray() +{ +} + +//---------------------------------------------------------------------------- +void vtkMedIntArray::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os,indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedIntArray.h b/src/Plugins/MedReader/IO/vtkMedIntArray.h new file mode 100644 index 00000000..1926ff71 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedIntArray.h @@ -0,0 +1,68 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +// .NAME vtkMedIntArray - dynamic, self-adjusting array of med_int +// .SECTION Description +// vtkMedIntArray is an array of values of type med_int. +// It provides methods for insertion and retrieval of values and will +// automatically resize itself to hold new data. +// If the med_int type is the same as the vtkIdType, +// this class inherits from the +// vtkIdType array, allowing safe shallow copies. + +#ifndef __vtkMedIntArray_h +#define __vtkMedIntArray_h + +#include "vtkMedUtilities.h" +#include "vtkMed.h" + +#include "vtkMedIntArrayInternal.h" +#include "vtkIdTypeArray.h" +#include "vtkIntArray.h" + +//BTX +template struct med_int_vtkIdType_Traits : IsSameTraits +{ + typedef vtkMedIntArrayInternal Superclass; +}; + +template <> struct med_int_vtkIdType_Traits + : IsSameTraits +{ + typedef vtkIdTypeArray Superclass; +}; +typedef med_int_vtkIdType_Traits::Superclass + vtkMedIntArraySuperclass; +//ETX + +class VTK_EXPORT vtkMedIntArray +//BTX +: public vtkMedIntArraySuperclass +//ETX +{ +public : + static vtkMedIntArray* New(); + vtkTypeRevisionMacro(vtkMedIntArray,vtkMedIntArraySuperclass); + void PrintSelf(ostream& os, vtkIndent indent); +protected: + vtkMedIntArray(vtkIdType numComp=1); + ~vtkMedIntArray(); +}; + +#endif diff --git a/src/Plugins/MedReader/IO/vtkMedIntArrayInternal.cxx b/src/Plugins/MedReader/IO/vtkMedIntArrayInternal.cxx new file mode 100644 index 00000000..3fa107ce --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedIntArrayInternal.cxx @@ -0,0 +1,53 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +// Instantiate superclass first to give the template a DLL interface. +#include "vtkMed.h" + +#ifndef WIN32 +#include "vtkDataArrayTemplate.txx" +VTK_DATA_ARRAY_TEMPLATE_INSTANTIATE(med_int); + +#include "vtkArrayIteratorTemplate.txx" +VTK_ARRAY_ITERATOR_TEMPLATE_INSTANTIATE(med_int); +#endif + +#define __vtkMedIntArrayInternal_cxx +#include "vtkMedIntArrayInternal.h" + +#include "vtkObjectFactory.h" + +vtkCxxRevisionMacro(vtkMedIntArrayInternal, "$Revision$"); +vtkStandardNewMacro(vtkMedIntArrayInternal); + +//---------------------------------------------------------------------------- +vtkMedIntArrayInternal::vtkMedIntArrayInternal(vtkIdType numComp): RealSuperclass(numComp) +{ +} + +//---------------------------------------------------------------------------- +vtkMedIntArrayInternal::~vtkMedIntArrayInternal() +{ +} + +//---------------------------------------------------------------------------- +void vtkMedIntArrayInternal::PrintSelf(ostream& os, vtkIndent indent) +{ + this->RealSuperclass::PrintSelf(os,indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedIntArrayInternal.h b/src/Plugins/MedReader/IO/vtkMedIntArrayInternal.h new file mode 100644 index 00000000..b4026ba6 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedIntArrayInternal.h @@ -0,0 +1,145 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +// .NAME vtkMedIntArrayInternal - dynamic, self-adjusting array of med_int +// .SECTION Description +// vtkMedIntArray is an array of values of type med_int. +// It provides methods for insertion and retrieval of values and will +// automatically resize itself to hold new data. + +#ifndef __vtkMedIntArrayInternal_h +#define __vtkMedIntArrayInternal_h + +#include "vtkMed.h" + +// Tell the template header how to give our superclass a DLL interface. +#if !defined(__vtkMedIntArrayInternal_cxx) +# define VTK_DATA_ARRAY_TEMPLATE_TYPE med_int +#endif + +#include "vtkDataArray.h" +#include "vtkDataArrayTemplate.h" // Real Superclass + +// Fake the superclass for the wrappers. +#define vtkDataArray vtkDataArrayTemplate +class VTK_EXPORT vtkMedIntArrayInternal : public vtkDataArray +#undef vtkDataArray +{ +public: + static vtkMedIntArrayInternal* New(); + vtkTypeRevisionMacro(vtkMedIntArrayInternal,vtkDataArray); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Get the data type. + // This returns the + int GetDataType() + { if(sizeof(med_int) == sizeof(vtkIdType)) return VTK_ID_TYPE; + if(sizeof(med_int) == sizeof(int)) return VTK_INT; + if(sizeof(med_int) == sizeof(long)) return VTK_LONG; + return VTK_VOID; + } + + // Description: + // Copy the tuple value into a user-provided array. + void GetTupleValue(vtkIdType i, med_int* tuple) + { this->RealSuperclass::GetTupleValue(i, tuple); } + + // Description: + // Set the tuple value at the ith location in the array. + void SetTupleValue(vtkIdType i, const med_int* tuple) + { this->RealSuperclass::SetTupleValue(i, tuple); } + + // Description: + // Insert (memory allocation performed) the tuple into the ith location + // in the array. + void InsertTupleValue(vtkIdType i, const med_int* tuple) + { this->RealSuperclass::InsertTupleValue(i, tuple); } + + // Description: + // Insert (memory allocation performed) the tuple onto the end of the array. + vtkIdType InsertNextTupleValue(const med_int* tuple) + { return this->RealSuperclass::InsertNextTupleValue(tuple); } + + // Description: + // Get the data at a particular index. + med_int GetValue(vtkIdType id) + { return this->RealSuperclass::GetValue(id); } + + // Description: + // Set the data at a particular index. Does not do range checking. Make sure + // you use the method SetNumberOfValues() before inserting data. + void SetValue(vtkIdType id, med_int value) + { this->RealSuperclass::SetValue(id, value); } + + // Description: + // Specify the number of values for this object to hold. Does an + // allocation as well as setting the MaxId ivar. Used in conjunction with + // SetValue() method for fast insertion. + void SetNumberOfValues(vtkIdType number) + { this->RealSuperclass::SetNumberOfValues(number); } + + // Description: + // Insert data at a specified position in the array. + void InsertValue(vtkIdType id, med_int f) + { this->RealSuperclass::InsertValue(id, f); } + + // Description: + // Insert data at the end of the array. Return its location in the array. + vtkIdType InsertNextValue(med_int f) + { return this->RealSuperclass::InsertNextValue(f); } + + // Description: + // Get the address of a particular data index. Make sure data is allocated + // for the number of items requested. Set MaxId according to the number of + // data values requested. + med_int* WritePointer(vtkIdType id, vtkIdType number) + { return this->RealSuperclass::WritePointer(id, number); } + + // Description: + // Get the address of a particular data index. Performs no checks + // to verify that the memory has been allocated etc. + med_int* GetPointer(vtkIdType id) + { return this->RealSuperclass::GetPointer(id); } + + // Description: + // This method lets the user specify data to be held by the array. The + // array argument is a pointer to the data. size is the size of + // the array supplied by the user. Set save to 1 to keep the class + // from deleting the array when it cleans up or reallocates memory. + // The class uses the actual array provided; it does not copy the data + // from the suppled array. + void SetArray(med_int* array, vtkIdType size, int save) + { this->RealSuperclass::SetArray(array, size, save); } + void SetArray(med_int* array, vtkIdType size, int save, int deleteMethod) + { this->RealSuperclass::SetArray(array, size, save, deleteMethod); } + +protected: + vtkMedIntArrayInternal(vtkIdType numComp=1); + ~vtkMedIntArrayInternal(); + +private: + //BTX + typedef vtkDataArrayTemplate RealSuperclass; + //ETX + vtkMedIntArrayInternal(const vtkMedIntArrayInternal&); // Not implemented. + void operator=(const vtkMedIntArrayInternal&); // Not implemented. +}; + +#endif diff --git a/src/Plugins/MedReader/IO/vtkMedInterpolation.cxx b/src/Plugins/MedReader/IO/vtkMedInterpolation.cxx new file mode 100644 index 00000000..34b7693b --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedInterpolation.cxx @@ -0,0 +1,55 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedInterpolation.h" + +#include "vtkObjectFactory.h" + +#include "vtkMedUtilities.h" +#include "vtkMedFraction.h" + +vtkCxxRevisionMacro(vtkMedInterpolation, "$Revision$") +vtkStandardNewMacro(vtkMedInterpolation) + +vtkCxxGetObjectVectorMacro(vtkMedInterpolation, BasisFunction, + vtkMedFraction); +vtkCxxSetObjectVectorMacro(vtkMedInterpolation, BasisFunction, + vtkMedFraction); + +vtkMedInterpolation::vtkMedInterpolation() +{ + this->GeometryType = MED_UNDEF_GEOTYPE; + this->IsCellNode = 1; + this->MaximumNumberOfCoefficient = 0; + this->MaximumDegree = 0; + this->NumberOfVariable = 0; + this->Name = NULL; + this->BasisFunction = new vtkObjectVector(); +} + +vtkMedInterpolation::~vtkMedInterpolation() +{ + delete this->BasisFunction; + this->SetName(NULL); +} + +void vtkMedInterpolation::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedInterpolation.h b/src/Plugins/MedReader/IO/vtkMedInterpolation.h new file mode 100644 index 00000000..3eb4edca --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedInterpolation.h @@ -0,0 +1,92 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedInterpolation_h_ +#define __vtkMedInterpolation_h_ + +#include "vtkObject.h" +#include "vtkMed.h" +#include "vtkMedSetGet.h" + +class vtkMedString; +class vtkMedFraction; + +class VTK_EXPORT vtkMedInterpolation : public vtkObject +{ +public: + static vtkMedInterpolation* New(); + vtkTypeRevisionMacro(vtkMedInterpolation, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // name of the interpolation function + vtkGetStringMacro(Name); + vtkSetStringMacro(Name); + + // Description: + // This is the iterator that should be used to read this interpolation + // in the med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // Type geometrique des mailles + vtkSetMacro(GeometryType, med_geometry_type); + vtkGetMacro(GeometryType, med_geometry_type); + + // Description: + // 1 if the basis functions are relative to the vertices of the cell. + vtkSetMacro(IsCellNode, int); + vtkGetMacro(IsCellNode, int); + + // Description: + // Maximum degree of any coefficient of any basis function + vtkSetMacro(MaximumDegree, int); + vtkGetMacro(MaximumDegree, int); + + // Description: + // Maximum number of coefficients for any basis function + vtkSetMacro(MaximumNumberOfCoefficient, int); + vtkGetMacro(MaximumNumberOfCoefficient, int); + + // Description: + // Maximum number of coefficients for any basis function + vtkSetMacro(NumberOfVariable, int); + vtkGetMacro(NumberOfVariable, int); + + // Description: + // The basis functions + vtkGetObjectVectorMacro(BasisFunction, vtkMedFraction); + vtkSetObjectVectorMacro(BasisFunction, vtkMedFraction); + +protected : + vtkMedInterpolation(); + ~vtkMedInterpolation(); + + med_int MedIterator; + med_geometry_type GeometryType; + int IsCellNode; + int MaximumNumberOfCoefficient; + int MaximumDegree; + int NumberOfVariable; + char* Name; + vtkObjectVector* BasisFunction; +}; + +#endif //__vtkMedInterpolation_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedLink.cxx b/src/Plugins/MedReader/IO/vtkMedLink.cxx new file mode 100644 index 00000000..deaa5211 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedLink.cxx @@ -0,0 +1,99 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedLink.h" + +#include "vtkObjectFactory.h" + +#include "vtkMedUtilities.h" + +#include +using namespace std; + +vtkCxxRevisionMacro(vtkMedLink, "$Revision$") +vtkStandardNewMacro(vtkMedLink) + +vtkMedLink::vtkMedLink() +{ + this->MedIterator = -1; + this->MeshName = NULL; + this->Link = NULL; +} + +vtkMedLink::~vtkMedLink() +{ + this->SetMeshName(NULL); + this->SetLink(NULL); +} + +const char* vtkMedLink::GetFullLink(const char* originalFileName) +{ +#ifdef _WIN32 + static const char sep = '\\'; +#else + static const char sep = '/'; +#endif + + if(this->Link == NULL) + { + return NULL; + } + + // First test if the Link is a full path, then return it. + if(this->Link != NULL && this->Link[0] == sep) + { + return this->Link; + } + + string name = string(originalFileName); + size_t pos = name.find_last_of(sep); + if(pos == string::npos) + { + return this->Link; + } + + string clean_link = this->Link; + string to_remove = string(".") + sep; + int to_remove_size = to_remove.size(); + while(clean_link.substr(0, to_remove_size) == to_remove) + clean_link = clean_link.substr(to_remove_size, string::npos); + + string path = name.substr(0, pos+1); + this->FullLinkPath = path + clean_link; + return this->FullLinkPath.c_str(); +} + +void vtkMedLink::SetMountedIterator(med_class what, med_int mit) +{ + this->MountedIterator[what] = mit; +} + +med_int vtkMedLink::GetMountedIterator(med_class what) +{ + if(this->MountedIterator.find(what) == this->MountedIterator.end()) + return -1; + + return this->MountedIterator[what]; +} + +void vtkMedLink::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, MedIterator); +} diff --git a/src/Plugins/MedReader/IO/vtkMedLink.h b/src/Plugins/MedReader/IO/vtkMedLink.h new file mode 100644 index 00000000..1f143455 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedLink.h @@ -0,0 +1,87 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedLink_h_ +#define __vtkMedLink_h_ + +#include "vtkObject.h" +#include "vtkMed.h" + +#include +#include + +class vtkMedString; + +class VTK_EXPORT vtkMedLink: public vtkObject +{ +public: + static vtkMedLink* New(); + vtkTypeRevisionMacro(vtkMedLink, vtkObject); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // the index of this field in the med file. + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // Set the name of the mesh linked to. + vtkSetStringMacro(MeshName); + vtkGetStringMacro(MeshName); + + // Description: + // Set the name of the file this link points to. + vtkSetStringMacro(Link); + vtkGetStringMacro(Link); + + // Description: + // returns the full path to the linked file. + // If the Link is already a full path, it is returned. + // If the directory is a relative path, the returned path is the + // concatenation of the directory where the + // original file is in and the Link. + const char* GetFullLink(const char* originalFileName); + + // Description: + // this stores the iterator that should be used when unmounting this link + void SetMountedIterator(med_class, med_int); + med_int GetMountedIterator(med_class); + +protected: + vtkMedLink(); + virtual ~vtkMedLink(); + + med_int MedIterator; + char* MeshName; + char * Link; + + std::string FullLinkPath; + + // BTX + std::map Status; + std::map MountedIterator; + //ETX + +private: + vtkMedLink(const vtkMedLink&); // Not implemented. + void operator=(const vtkMedLink&); // Not implemented. + +}; + +#endif //__vtkMedLink_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedLocalization.cxx b/src/Plugins/MedReader/IO/vtkMedLocalization.cxx new file mode 100644 index 00000000..6fb2a95a --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedLocalization.cxx @@ -0,0 +1,701 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedLocalization.h" + +#include "vtkObjectFactory.h" +#include "vtkDoubleArray.h" +#include "vtkIntArray.h" +#include "vtkFunctionParser.h" + +#include "vtkMedUtilities.h" +#include "vtkMedSetGet.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" +#include "vtkMedInterpolation.h" +#include "vtkMedFraction.h" + +#include "med.h" + +// SEG2 +const static int SEG2_dim = 1; +const static int SEG2_nnode = 2; +static const int SEG2_aster2med[SEG2_nnode] = +{0, 1}; +static const char* SEG2_varnames[SEG2_dim] = {"x"}; +static const char* SEG2_functions[SEG2_nnode] = +{"1/2*(1-x)", + "1/2*(1+x)"}; + +// SEG3 +const static int SEG3_dim = 1; +const static int SEG3_nnode = 3; +static const int SEG3_aster2med[SEG3_nnode] = +{0, 1, 2}; +static const char* SEG3_varnames[SEG3_dim] = {"x"}; +static const char* SEG3_functions[SEG3_nnode] = +{"-1/2*(1-x)*x", + "1/2*(1+x)*x", + "(1+x)*(1-x)"}; + +// SEG4 +const static int SEG4_dim = 1; +const static int SEG4_nnode = 4; +static const int SEG4_aster2med[SEG4_nnode] = +{0, 1, 2, 3}; +static const char* SEG4_varnames[SEG4_dim] = {"x"}; +static const char* SEG4_functions[SEG4_nnode] = +{"16/9*(1-x)*(x+1/3)*(x-1/3)", +"-16/9*(1+x)*(1/3-x)*(x+1/3)", +"16/27*(x-1)*(x+1)*(x-1/3)", +"-16/27*(x-1)*(x+1)*(x+1/3)"}; + +// TRIA3 +const static int TRIA3_dim = 2; +const static int TRIA3_nnode = 3; +static const int TRIA3_aster2med[TRIA3_nnode] = +{0, 1, 2}; +static const char* TRIA3_varnames[TRIA3_dim] = {"x", "y"}; +static const char* TRIA3_functions[TRIA3_nnode] = +{"1-x-y", + "x", + "y"}; + +// TRIA6 +const static int TRIA6_dim = 2; +const static int TRIA6_nnode = 6; +static const int TRIA6_aster2med[TRIA6_nnode] = +{0, 1, 2, 3, 4, 5}; +static const char* TRIA6_varnames[TRIA6_dim] = {"x", "y"}; +static const char* TRIA6_functions[TRIA6_nnode] = +{"-(1-x-y)*(1-2*(1-x-y))", + "-x*(1-2*x)", + "-y*(1-2*y)", + "4*x*(1-x-y)", + "4*x*y", + "4*y*(1-x-y)"}; + +// TRIA7 +const static int TRIA7_dim = 2; +const static int TRIA7_nnode = 7; +static const int TRIA7_aster2med[TRIA7_nnode] = +{0, 1, 2, 3, 4, 5, 6}; +static const char* TRIA7_varnames[TRIA7_dim] = {"x", "y"}; +static const char* TRIA7_functions[TRIA7_nnode] = +{"1-3*(x+y)+2*(x*x+y*y)+7*x*y-3*x*y*(x+y)", + "x*(-1+2*x+3*y-3*y*(x+y))", + "y*(-1+2*x+3*y-3*x*(x+y))", + "4*x*(1-x-4*y+3*y*(x+y))", + "4*x*y*(-2+3*(x+y))", + "4*y*(1-4*x-y+3*x*(x+y))", + "27*x*y*(1-x-y)"}; + +// QUAD4 +const static int QUAD4_dim = 2; +const static int QUAD4_nnode = 4; +static const int QUAD4_aster2med[QUAD4_nnode] = +{0, 1, 2, 3}; +static const char* QUAD4_varnames[QUAD4_dim] = {"x", "y"}; +static const char* QUAD4_functions[QUAD4_nnode] = +{"(1-x)*(1-y)/4", + "(1+x)*(1-y)/4", + "(1+x)*(1+y)/4", + "(1-x)*(1+y)/4"}; + +// QUAD8 +const static int QUAD8_dim = 2; +const static int QUAD8_nnode = 8; +static const int QUAD8_aster2med[QUAD8_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7}; +static const char* QUAD8_varnames[QUAD8_dim] = {"x", "y"}; +static const char* QUAD8_functions[QUAD8_nnode] = +{"(1-x)*(1-y)*(-1-x-y)/4", + "(1+x)*(1-y)*(-1+x-y)/4", + "(1+x)*(1+y)*(-1+x+y)/4", + "(1-x)*(1+y)*(-1-x+y)/4", + "(1-x*x)*(1-y)/2", + "(1+x)*(1-y*y)/2", + "(1-x*x)*(1+y)/2", + "(1-x)*(1-y*y)/2"}; + +// QUAD9 +const static int QUAD9_dim = 2; +const static int QUAD9_nnode = 9; +static const int QUAD9_aster2med[QUAD9_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7, 8}; +static const char* QUAD9_varnames[QUAD9_dim] = {"x", "y"}; +static const char* QUAD9_functions[QUAD9_nnode] = +{"x*y*(x-1)*(y-1)/4", + "x*y*(x+1)*(y-1)/4", + "x*y*(x+1)*(y+1)/4", + "x*y*(x-1)*(y+1)/4", + "(1-x*x)*y*(y-1)/2", + "x*(x+1)*(1-y*y)/2", + "(1-x*x)*y*(y+1)/2", + "x*(x-1)*(1-y*y)/2", + "(1-x*x)*(1-y*y)"}; + +// PENTA6 +const static int PENTA6_dim = 3; +const static int PENTA6_nnode = 6; +static const int PENTA6_aster2med[PENTA6_nnode] = +{0, 1, 2, 3, 4, 5}; +static const char* PENTA6_varnames[PENTA6_dim] = {"x", "y", "z"}; +static const char* PENTA6_functions[PENTA6_nnode] = +{"1/2*y*(1-x)", + "1/2*z*(1-x)", + "1/2*(1-y-z)*(1-x)", + "1/2*y*(1+x)", + "1/2*z*(1+x)", + "1/2*(1-y-z)*(1+x)"}; + +// PENTA15 +const static int PENTA15_dim = 3; +const static int PENTA15_nnode = 15; +static const int PENTA15_aster2med[PENTA15_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 9, 10, 11}; +static const char* PENTA15_varnames[PENTA15_dim] = {"x", "y", "z"}; +static const char* PENTA15_functions[PENTA15_nnode] = +{"y*(1-x)*(2*y-2-x)/2", + "z*(1-x)*(2*z-2-x)/2", + "(x-1)*(1-y-z)*(x+2*y+2*z)/2", + "y*(1+x)*(2*y-2+x)/2", + "z*(1+x)*(2*z-2+x)/2", + "(-x-1)*(1-y-z)*(-x+2*y+2*z)/2", + "2*y*z*(1-x)", + "2*z*(1-y-z)*(1-x)", + "2*y*(1-y-z)*(1-x)", + "y*(1-x*x)", + "z*(1-x*x)", + "(1-y-z)*(1-x*x)", + "2*y*z*(1+x)", + "2*z*(1-y-z)*(1+x)", + "2*y*(1-y-z)*(1+x)"}; + +// PENTA18 +const static int PENTA18_dim = 3; +const static int PENTA18_nnode = 18; +const static int PENTA18_aster2med[PENTA18_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 13, 14, 9, 10, 11, 15, 16, 17}; +static const char* PENTA18_varnames[PENTA18_dim] = {"x", "y", "z"}; +static const char* PENTA18_functions[PENTA18_nnode] = +{"x*y*x−1*2*y−1/2", + "x*z*x−1*2*z−1/2", + "x*x−1*zy−1*2*z2*y−1/2", + "x*y*x1*2*y−1/2", + "x*z*x1*2*z−1/2", + "x*x1*zy−1*2*z2*y−1/2", + "2*x*y*z*x−1", + "−2*x*z*x−1*zy−1", + "−2*x*y*x−1*zy−1", + "y*1−x*x*2*y−1", + "z*1−x*x*2*z−1", + "1−x*x*zy−1*2*z2*y−1", + "2*x*y*z*x1", + "−2*x*z*x1*zy−1", + "−2*x*y*x1*zy−1", + "4*y*z*1−x*x", + "4*z*x−1*zy−1", + "4*y*x−1*zy−1"}; + +// HEXA8 +const static int HEXA8_dim = 3; +const static int HEXA8_nnode = 8; +static const int HEXA8_aster2med[HEXA8_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7}; +static const char* HEXA8_varnames[HEXA8_dim] = {"x", "y", "z"}; +static const char* HEXA8_functions[HEXA8_nnode] = +{"1/8*(1-x)*(1-y)*(1-z)", + "1/8*(1+x)*(1-y)*(1-z)", + "1/8*(1+x)*(1+y)*(1-z)", + "1/8*(1-x)*(1+y)*(1-z)", + "1/8*(1-x)*(1-y)*(1+z)", + "1/8*(1+x)*(1-y)*(1+z)", + "1/8*(1+x)*(1+y)*(1+z)", + "1/8*(1-x)*(1+y)*(1+z)" + }; + +// HEXA20 +const static int HEXA20_dim = 3; +const static int HEXA20_nnode = 20; +static const int HEXA20_aster2med[HEXA20_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 12, 13, 14, 15}; +static const char* HEXA20_varnames[HEXA20_dim] = {"x", "y", "z"}; +static const char* HEXA20_functions[HEXA20_nnode] = +{"1/8*(1-x)*(1-y)*(1-z)*(-2-x-y-z)", + "1/8*(1+x)*(1-y)*(1-z)*(-2+x-y-z)", + "1/8*(1+x)*(1+y)*(1-z)*(-2+x+y-z)", + "1/8*(1-x)*(1+y)*(1-z)*(-2-x+y-z)", + "1/8*(1-x)*(1-y)*(1+z)*(-2-x-y+z)", + "1/8*(1+x)*(1-y)*(1+z)*(-2+x-y+z)", + "1/8*(1+x)*(1+y)*(1+z)*(-2+x+y+z)", + "1/8*(1-x)*(1+y)*(1+z)*(-2-x+y+z)", + "1/4*(1-x*x)*(1-y)*(1-z)", + "1/4*(1-y*y)*(1+x)*(1-z)", + "1/4*(1-x*x)*(1+y)*(1-z)", + "1/4*(1-y*y)*(1-x)*(1-z)", + "1/4*(1-z*z)*(1-x)*(1-y)", + "1/4*(1-z*z)*(1+x)*(1-y)", + "1/4*(1-z*z)*(1+x)*(1+y)", + "1/4*(1-z*z)*(1-x)*(1+y)", + "1/4*(1-x*x)*(1-y)*(1+z)", + "1/4*(1-y*y)*(1+x)*(1+z)", + "1/4*(1-x*x)*(1+y)*(1+z)", + "1/4*(1-y*y)*(1-x)*(1+z)", + }; + +// HEXA27 +const static int HEXA27_dim = 3; +const static int HEXA27_nnode = 27; +static const int HEXA27_aster2med[HEXA27_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 16, 17, 18, 19, 12, 13, 14, 15, 20, 21, + 22, 23, 24, 25, 26}; +static const char* HEXA27_varnames[HEXA27_dim] = {"x", "y", "z"}; +static const char* HEXA27_functions[HEXA27_nnode] = +{"1/8*x*(x-1)*y*(y-1)*z*(z-1)", + "1/8*x*(x+1)*y*(y-1)*z*(z-1)", + "1/8*x*(x+1)*y*(y+1)*z*(z-1)", + "1/8*x*(x-1)*y*(y+1)*z*(z-1)", + "1/8*x*(x-1)*y*(y-1)*z*(z+1)", + "1/8*x*(x+1)*y*(y-1)*z*(z+1)", + "1/8*x*(x+1)*y*(y+1)*z*(z+1)", + "1/8*x*(x-1)*y*(y+1)*z*(z+1)", + "1/4*(1-x*x)*y*(y-1)*z*(z-1)", + "1/4*x*(x+1)*(1-y*y)*z*(z-1)", + "1/4*(1-x*x)*y*(y+1)*z*(z-1)", + "1/4*x*(x-1)*(1-y*y)*z*(z-1)", + "1/4*x*(x-1)*y*(y-1)*(1-z*z)", + "1/4*x*(x+1)*y*(y-1)*(1-z*z)", + "1/4*x*(x+1)*y*(y+1)*(1-z*z)", + "1/4*x*(x-1)*y*(y+1)*(1-z*z)", + "1/4*(1-x*x)*y*(y-1)*z*(z+1)", + "1/4*x*(x+1)*(1-y*y)*z*(z+1)", + "1/4*(1-x*x)*y*(y+1)*z*(z+1)", + "1/4*x*(x-1)*(1-y*y)*z*(z+1)", + "1/2*(1-x*x)*(1-y*y)*z*(z-1)", + "1/2*(1-x*x)*y*(y-1)*(1-z*z)", + "1/2*x*(x-1)*(1-y*y)*(1-z*z)", + "1/2*(1-x*x)*y*(y-1)*(1-z*z)", + "1/2*x*(x-1)*(1-y*y)*(1-z*z)", + "1/2*(1-x*x)*(1-y*y)*z*(z-1)", + "(1-x*x)*(1-y*y)*(1-z*z)" + }; + +// TETRA4 +const static int TETRA4_dim = 3; +const static int TETRA4_nnode = 4; +static const int TETRA4_aster2med[TETRA4_nnode] = +{0, 1, 2, 3}; +static const char* TETRA4_varnames[TETRA4_dim] = {"x", "y", "z"}; +static const char* TETRA4_functions[TETRA4_nnode] = +{ + "y", + "z", + "1-x-y-z", + "x" +}; + +// TETRA10 +const static int TETRA10_dim = 3; +const static int TETRA10_nnode = 10; +static const int TETRA10_aster2med[TETRA10_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; +static const char* TETRA10_varnames[TETRA10_dim] = {"x", "y", "z"}; +static const char* TETRA10_functions[TETRA10_nnode] = +{ + "y*(2*y-1)", + "z*(2*z-1)", + "(1-x-y-z)*(1-2*x-2*y-2*z)", + "x*(2*x-1)", + "4*y*z", + "4*z*(1-x-y-z)", + "4*y*(1-x-y-z)", + "4*x*y", + "4*x*z", + "4*x*(1-x-y-z)" +}; + +// PYRA5 +const static int PYRA5_dim = 3; +const static int PYRA5_nnode = 5; +static const int PYRA5_aster2med[PYRA5_nnode] = +{0, 1, 2, 3, 4}; +static const char* PYRA5_varnames[PYRA5_dim] = {"x", "y", "z"}; +static const char* PYRA5_functions[PYRA5_nnode] = +{ +"(-x+y+z-1)*(-x-y+z-1)/(4*(1-z))", +"(-x-y+z-1)*( x-y+z-1)/(4*(1-z))", +"( x-y+z-1)*( x+y+z-1)/(4*(1-z))", +"( x+y+z-1)*(-x+y+z-1)/(4*(1-z))", +"z" +}; + +// PYRA13 +const static int PYRA13_dim = 3; +const static int PYRA13_nnode = 13; +static const int PYRA13_aster2med[PYRA13_nnode] = +{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; +static const char* PYRA13_varnames[PYRA13_dim] = {"x", "y", "z"}; +static const char* PYRA13_functions[PYRA13_nnode] = +{ + "(-x+y+z-1)*(-x-y+z-1)*( x-1/2)/(2*(1-z))", + "(-x-y+z-1)*( x-y+z-1)*( y-1/2)/(2*(1-z))", + "( x-y+z-1)*( x+y+z-1)*(-x-1/2)/(2*(1-z))", + "( x+y+z-1)*(-x+y+z-1)*(-y-1/2)/(2*(1-z))", + "2*z*(z-1/2)", + "-(-x+y+z-1)*(-x-y+z-1)*( x-y+z-1)/(2*(1-z))", + "-(-x-y+z-1)*( x-y+z-1)*( x+y+z-1)/(2*(1-z))", + "-( x-y+z-1)*( x+y+z-1)*(-x+y+z-1)/(2*(1-z))", + "-( x+y+z-1)*(-x+y+z-1)*(-x-y+z-1)/(2*(1-z))", + "(-x+y+z-1)*(-x-y+z-1)*z/(1-z)", + "(-x-y+z-1)*( x-y+z-1)*z/(1-z)", + "( x-y+z-1)*( x+y+z-1)*z/(1-z)", + "( x+y+z-1)*(-x+y+z-1)*z/(1-z)" +}; + +vtkCxxSetObjectMacro(vtkMedLocalization, ParentFile, vtkMedFile); +vtkCxxSetObjectMacro(vtkMedLocalization, Interpolation, vtkMedInterpolation); + +vtkCxxRevisionMacro(vtkMedLocalization, "$Revision$") +vtkStandardNewMacro(vtkMedLocalization) + +vtkMedLocalization::vtkMedLocalization() +{ + this->GeometryType = MED_NONE; + this->NumberOfQuadraturePoint = 0; + this->Weights = vtkDoubleArray::New(); + this->PointLocalCoordinates = vtkDoubleArray::New(); + this->QuadraturePointLocalCoordinates = vtkDoubleArray::New(); + this->ShapeFunction = vtkDoubleArray::New(); + this->Name = NULL; + this->SectionName = NULL; + this->InterpolationName = NULL; + this->MedIterator = -1; + this->ParentFile = NULL; + this->SpaceDimension = 3; + this->NumberOfCellInSection = 0; + this->SectionGeometryType = MED_NONE; + this->Interpolation = NULL; + this->ShapeFunctionIsBuilt = 0; +} + +vtkMedLocalization::~vtkMedLocalization() +{ + this->SetName(NULL); + this->SetSectionName(NULL); + this->SetInterpolationName(NULL); + this->Weights->Delete(); + this->PointLocalCoordinates->Delete(); + this->QuadraturePointLocalCoordinates->Delete(); + this->ShapeFunction->Delete(); + this->SetInterpolation(NULL); + +} + +int vtkMedLocalization::GetSizeOfWeights() +{ + return this->NumberOfQuadraturePoint; +} + +int vtkMedLocalization::GetSizeOfPointLocalCoordinates() +{ + return vtkMedUtilities::GetNumberOfPoint(this->GeometryType) + * vtkMedUtilities::GetDimension(this->GeometryType); +} + +int vtkMedLocalization::GetSizeOfQuadraturePointLocalCoordinates() +{ + return this->NumberOfQuadraturePoint * vtkMedUtilities::GetDimension( + this->GeometryType); +} + +int vtkMedLocalization::GetSizeOfShapeFunction() +{ + return this->NumberOfQuadraturePoint * vtkMedUtilities::GetNumberOfPoint( + this->GeometryType); +} + +void vtkMedLocalization::BuildShapeFunction() +{ + if(this->ShapeFunctionIsBuilt) + return; + + if(this->Interpolation == NULL) + { + // If there is no interpolation given for this localization, + // I build the default aster shape function + + switch (this->GeometryType) + { + case MED_POINT1: + BuildPoint1(); + return; + case MED_SEG2: + BuildAsterShapeFunction(SEG2_dim, SEG2_nnode, + (const int *) SEG2_aster2med, + (const char**)SEG2_varnames, + (const char**)SEG2_functions); + break; + case MED_SEG3: + BuildAsterShapeFunction(SEG3_dim, SEG3_nnode, + (const int *) SEG3_aster2med, + (const char**)SEG3_varnames, + (const char**)SEG3_functions); + break; + case MED_SEG4: + BuildAsterShapeFunction(SEG4_dim, SEG4_nnode, + (const int *) SEG4_aster2med, + (const char**)SEG4_varnames, + (const char**)SEG4_functions); + break; + case MED_TRIA3: + BuildAsterShapeFunction(TRIA3_dim, TRIA3_nnode, + (const int *) TRIA3_aster2med, + (const char**)TRIA3_varnames, + (const char**)TRIA3_functions); + break; + case MED_TRIA6: + BuildAsterShapeFunction(TRIA6_dim, TRIA6_nnode, + (const int *) TRIA6_aster2med, + (const char**)TRIA6_varnames, + (const char**)TRIA6_functions); + break; + case MED_TRIA7: + BuildAsterShapeFunction(TRIA7_dim, TRIA7_nnode, + (const int *) TRIA7_aster2med, + (const char**)TRIA7_varnames, + (const char**)TRIA7_functions); + break; + case MED_QUAD4: + BuildAsterShapeFunction(QUAD4_dim, QUAD4_nnode, + (const int *) QUAD4_aster2med, + (const char**)QUAD4_varnames, + (const char**)QUAD4_functions); + break; + case MED_QUAD8: + BuildAsterShapeFunction(QUAD8_dim, QUAD8_nnode, + (const int *) QUAD8_aster2med, + (const char**)QUAD8_varnames, + (const char**)QUAD8_functions); + break; + case MED_QUAD9: + BuildAsterShapeFunction(QUAD9_dim, QUAD9_nnode, + (const int *) QUAD9_aster2med, + (const char**)QUAD9_varnames, + (const char**)QUAD9_functions); + break; + case MED_HEXA8: + BuildAsterShapeFunction(HEXA8_dim, HEXA8_nnode, + (const int *) HEXA8_aster2med, + (const char**)HEXA8_varnames, + (const char**)HEXA8_functions); + break; + case MED_HEXA20: + BuildAsterShapeFunction(HEXA20_dim, HEXA20_nnode, + (const int *) HEXA20_aster2med, + (const char**)HEXA20_varnames, + (const char**)HEXA20_functions); + break; + case MED_HEXA27: + BuildAsterShapeFunction(HEXA27_dim, HEXA27_nnode, + (const int *) HEXA27_aster2med, + (const char**)HEXA27_varnames, + (const char**)HEXA27_functions); + break; + case MED_TETRA4: + BuildAsterShapeFunction(TETRA4_dim, TETRA4_nnode, + (const int *) TETRA4_aster2med, + (const char**)TETRA4_varnames, + (const char**)TETRA4_functions); + break; + case MED_TETRA10: + BuildAsterShapeFunction(TETRA10_dim, TETRA10_nnode, + (const int *) TETRA10_aster2med, + (const char**)TETRA10_varnames, + (const char**)TETRA10_functions); + break; + case MED_PENTA6: + BuildAsterShapeFunction(PENTA6_dim, PENTA6_nnode, + (const int *) PENTA6_aster2med, + (const char**)PENTA6_varnames, + (const char**)PENTA6_functions); + break; + case MED_PENTA15: + BuildAsterShapeFunction(PENTA15_dim, PENTA15_nnode, + (const int *) PENTA15_aster2med, + (const char**)PENTA15_varnames, + (const char**)PENTA15_functions); + break; + case MED_PYRA5: + BuildAsterShapeFunction(PYRA5_dim, PYRA5_nnode, + (const int *) PYRA5_aster2med, + (const char**)PYRA5_varnames, + (const char**)PYRA5_functions); + break; + case MED_PYRA13: + BuildAsterShapeFunction(PYRA13_dim, PYRA13_nnode, + (const int *) PYRA13_aster2med, + (const char**)PYRA13_varnames, + (const char**)PYRA13_functions); + break; + default: + vtkErrorMacro("ERROR in vtkMedLocalization::BuildShapeFunction. " + << this->GeometryType + << " : Cell geometry not supported !!! "); + return; + } + } + else + { + this->BuildShapeFunctionFromInterpolation(); + } + this->ShapeFunctionIsBuilt = 1; +} + +void vtkMedLocalization::BuildShapeFunctionFromInterpolation() +{ + int nnodes = this->GeometryType % 100; + int dim = this->GeometryType / 100; + this->ShapeFunction->SetNumberOfValues(this->GetSizeOfShapeFunction()); + + int qpindex; + int nodeindex; + + vtkMedFraction* func; + + switch(dim) + { + case 0 : + this->ShapeFunction->SetValue(0, 1); + break; + default : + for(qpindex=0; qpindex < this->NumberOfQuadraturePoint; qpindex++ ) + { + double *coord = new double[dim]; + for(int dimid=0; dimidQuadraturePointLocalCoordinates + ->GetValue((qpindex * dim)+dimid); + } + + for(nodeindex=0; nodeindex < nnodes; nodeindex++) + { + func = this->Interpolation->GetBasisFunction(nodeindex); + this->ShapeFunction->SetValue( + qpindex*nnodes + nodeindex, func->Evaluate(coord)); + } + } + } +} + +void vtkMedLocalization::BuildAsterShapeFunction(int dim, + int nnodes, + const int* aster2med, + const char** varnames, + const char** functions) +{ + this->ShapeFunction->SetNumberOfValues( + this->NumberOfQuadraturePoint * nnodes); + + std::vector > parsers; + parsers.resize(nnodes); + for(int nodeindex=0; nodeindex < nnodes; nodeindex++) + { + parsers[nodeindex] = vtkSmartPointer::New(); + parsers[nodeindex]->SetFunction(functions[nodeindex]); + } + + for(int qpindex=0; qpindex < this->NumberOfQuadraturePoint; qpindex++ ) + { + + for(int nodeindex=0; nodeindex < nnodes; nodeindex++) + { + int mednodeindex = aster2med[nodeindex]; + vtkFunctionParser* parser = parsers[mednodeindex]; + for(int dimid=0; dimidQuadraturePointLocalCoordinates + ->GetValue((qpindex * dim)+dimid); + + parser->SetScalarVariableValue(varname, coord); + } + + double w = parser->GetScalarResult(); + + this->ShapeFunction->SetValue( + qpindex*nnodes + mednodeindex, w); + } + } +} + +void vtkMedLocalization::BuildPoint1() +{ + this->Weights->SetNumberOfValues(1); + this->ShapeFunction->SetNumberOfValues(1); + this->Weights->SetValue(0, 1); + this->ShapeFunction->SetValue(0, 1); +} + +void vtkMedLocalization::BuildCenter(med_geometry_type geometry) +{ + this->GeometryType = geometry; + this->NumberOfQuadraturePoint = 1; + int npts = vtkMedUtilities::GetNumberOfPoint(this->GeometryType); + this->ShapeFunction->SetNumberOfValues(npts); + this->Weights->SetNumberOfValues(1); + for (int i = 0; i < npts; i++) + { + this->ShapeFunction->SetValue(i, 1.0 / (double) npts); + } + this->Weights->SetValue(0, 1); + +} + +void vtkMedLocalization::BuildELNO(med_geometry_type geometry) +{ + this->GeometryType = geometry; + this->NumberOfQuadraturePoint = vtkMedUtilities::GetNumberOfPoint(geometry); + + int np2 = this->NumberOfQuadraturePoint * this->NumberOfQuadraturePoint; + this->ShapeFunction->SetNumberOfValues(np2); + this->Weights->SetNumberOfValues(this->NumberOfQuadraturePoint); + + for (int i = 0; i < np2; i++) + { + this->ShapeFunction->SetValue(i, 0); + } + for (int i = 0; i < this->NumberOfQuadraturePoint; i++) + { + this->ShapeFunction->SetValue(i + i * this->NumberOfQuadraturePoint, 1.0); + } + double w = 1.0 / (double) this->NumberOfQuadraturePoint; + for (int i = 0; i < this->NumberOfQuadraturePoint; i++) + { + this->Weights->SetValue(i, w); + } +} + +void vtkMedLocalization::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, GeometryType); + PRINT_IVAR(os, indent, NumberOfQuadraturePoint); + PRINT_IVAR(os, indent, MedIterator); +} diff --git a/src/Plugins/MedReader/IO/vtkMedLocalization.h b/src/Plugins/MedReader/IO/vtkMedLocalization.h new file mode 100644 index 00000000..7b88c5fa --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedLocalization.h @@ -0,0 +1,154 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedLocalization_h_ +#define __vtkMedLocalization_h_ + +#include "vtkObject.h" +#include "vtkMed.h" +#include "vtkSmartPointer.h" + +class vtkMedString; +class vtkMedFile; +class vtkDoubleArray; +class vtkMedInterpolation; + +class VTK_EXPORT vtkMedLocalization : public vtkObject +{ +public: + static vtkMedLocalization* New(); + vtkTypeRevisionMacro(vtkMedLocalization, vtkObject); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the name of this definition + vtkSetStringMacro(Name); + vtkGetStringMacro(Name); + + // Description: + // This is the name of this definition + vtkSetStringMacro(SectionName); + vtkGetStringMacro(SectionName); + + // Description: + // This is the name of this definition + vtkSetStringMacro(InterpolationName); + vtkGetStringMacro(InterpolationName); + + // Description: + // This is the type of cell geometry this definition is for. + vtkSetMacro(GeometryType, med_geometry_type); + vtkGetMacro(GeometryType, med_geometry_type); + + // Description: + // This is the number of quadrature points in this definition. + vtkSetMacro(NumberOfQuadraturePoint, int); + vtkGetMacro(NumberOfQuadraturePoint, int); + + // Description: + // The index of this field in the med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // The dimension of the space in which integration points are defined. + vtkSetMacro(SpaceDimension, med_int); + vtkGetMacro(SpaceDimension, med_int); + + // Description: + // The number of cell in a section for structural elements + vtkGetMacro(NumberOfCellInSection, med_int); + vtkSetMacro(NumberOfCellInSection, med_int); + + // Description: + // Type of cells that define the section, for structural elements. + vtkSetMacro(SectionGeometryType, med_geometry_type); + vtkGetMacro(SectionGeometryType, med_geometry_type); + + // Description: + // get the raw pointers to the internal arrays. + // Those arrays are allocated in SecureResources, + // and cleared in ClearResources + vtkGetObjectMacro(Weights, vtkDoubleArray); + vtkGetObjectMacro(PointLocalCoordinates, vtkDoubleArray); + vtkGetObjectMacro(QuadraturePointLocalCoordinates, vtkDoubleArray); + vtkGetObjectMacro(ShapeFunction, vtkDoubleArray); + + virtual int GetSizeOfWeights(); + virtual int GetSizeOfPointLocalCoordinates(); + virtual int GetSizeOfQuadraturePointLocalCoordinates(); + virtual int GetSizeOfShapeFunction(); + + virtual void BuildShapeFunction(); + virtual void BuildELNO(med_geometry_type geometry); + virtual void BuildCenter(med_geometry_type geometry); + + virtual void SetParentFile(vtkMedFile*); + vtkGetObjectMacro(ParentFile, vtkMedFile); + + // Description: + // The interpolation is the function that define how the interpolate + // value at integration points from values at reference points (usually nodes) + virtual void SetInterpolation(vtkMedInterpolation*); + vtkGetObjectMacro(Interpolation, vtkMedInterpolation); + +protected: + vtkMedLocalization(); + virtual ~vtkMedLocalization(); + + med_int MedIterator; + med_geometry_type GeometryType; + int NumberOfQuadraturePoint; + med_int SpaceDimension; + med_int NumberOfCellInSection; + med_geometry_type SectionGeometryType; + + vtkDoubleArray* Weights; + vtkDoubleArray* PointLocalCoordinates; + vtkDoubleArray* QuadraturePointLocalCoordinates; + vtkDoubleArray* ShapeFunction; + + char* Name; + char* SectionName; + char* InterpolationName; + + vtkMedFile* ParentFile; + + vtkMedInterpolation* Interpolation; + + int ShapeFunctionIsBuilt; + + virtual void BuildAsterShapeFunction(int dim, + int nnodes, + const int* med2aster, + const char** varnames, + const char** functions); + + virtual void BuildPoint1(); + + virtual void BuildShapeFunctionFromInterpolation(); + +private: + vtkMedLocalization(const vtkMedLocalization&); + // Not implemented. + void operator=(const vtkMedLocalization&); + // Not implemented. +}; + +#endif //__vtkMedQuadratureDefinition_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedMesh.cxx b/src/Plugins/MedReader/IO/vtkMedMesh.cxx new file mode 100644 index 00000000..d4257412 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedMesh.cxx @@ -0,0 +1,269 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedMesh.h" + +#include "vtkObjectFactory.h" +#include "vtkSmartPointer.h" +#include "vtkDataArray.h" + +#include "vtkMedFamily.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedGroup.h" +#include "vtkMedGrid.h" +#include "vtkMedUtilities.h" +#include "vtkMedIntArray.h" +#include "vtkMedFile.h" + +#include + +vtkCxxGetObjectVectorMacro(vtkMedMesh, CellFamily, vtkMedFamily); +vtkCxxSetObjectVectorMacro(vtkMedMesh, CellFamily, vtkMedFamily); +vtkCxxGetObjectVectorMacro(vtkMedMesh, PointFamily, vtkMedFamily); +vtkCxxSetObjectVectorMacro(vtkMedMesh, PointFamily, vtkMedFamily); + +vtkCxxGetObjectVectorMacro(vtkMedMesh, PointGroup, vtkMedGroup); +vtkCxxSetObjectVectorMacro(vtkMedMesh, PointGroup, vtkMedGroup); +vtkCxxGetObjectVectorMacro(vtkMedMesh, CellGroup, vtkMedGroup); +vtkCxxSetObjectVectorMacro(vtkMedMesh, CellGroup, vtkMedGroup); + +vtkCxxSetObjectMacro(vtkMedMesh, ParentFile, vtkMedFile); + +vtkCxxRevisionMacro(vtkMedMesh, "$Revision$") +vtkStandardNewMacro(vtkMedMesh) + +vtkMedMesh::vtkMedMesh() +{ + this->GridStep = new vtkMedComputeStepMap (); + this->Name = NULL; + this->UniversalName = NULL; + this->Description = NULL; + this->TimeUnit = NULL; + this->CellFamily = new vtkObjectVector (); + this->PointFamily = new vtkObjectVector (); + this->PointGroup = new vtkObjectVector (); + this->CellGroup = new vtkObjectVector (); + this->AxisName = vtkStringArray::New(); + this->AxisUnit = vtkStringArray::New(); + this->AxisName->SetNumberOfValues(3); + this->AxisUnit->SetNumberOfValues(3); + this->MedIterator = -1; + this->MeshType = MED_UNDEF_MESH_TYPE; + this->StructuredGridType = MED_UNDEF_GRID_TYPE; + this->ParentFile = NULL; + this->AxisType = MED_CARTESIAN; + this->SortingType = MED_SORT_DTIT; + this->MeshDimension = 3; + this->SpaceDimension = 3; + this->IsSupportMesh = 0; +} + +vtkMedMesh::~vtkMedMesh() +{ + this->SetName(NULL); + this->SetUniversalName(NULL); + this->SetDescription(NULL); + delete this->CellFamily; + delete this->PointFamily; + delete this->PointGroup; + delete this->CellGroup; + this->AxisName->Delete(); + this->AxisUnit->Delete(); + delete this->GridStep; +} + +vtkMedGroup* vtkMedMesh::GetOrCreateGroup(int pointOrCell, const char* name) +{ + if(pointOrCell == vtkMedUtilities::OnCell) + { + for(int g = 0; g < this->CellGroup->size(); g++) + { + vtkMedGroup* group = this->CellGroup->at(g); + if(group != NULL && strcmp(name, group->GetName()) == 0) + { + return group; + } + } + vtkMedGroup* group = vtkMedGroup::New(); + this->CellGroup->push_back(group); + //group->SetPointOrCell(vtkMedUtilities::OnCell); + group->SetName(name); + group->Delete(); + return group; + } + else + { + for(int g = 0; g < this->PointGroup->size(); g++) + { + vtkMedGroup* group = this->PointGroup->at(g); + if(group != NULL && strcmp(name, group->GetName()) == 0) + { + return group; + } + } + vtkMedGroup* group = vtkMedGroup::New(); + this->CellGroup->push_back(group); + //group->SetPointOrCell(vtkMedUtilities::OnPoint); + group->SetName(name); + group->Delete(); + return group; + } + return NULL; +} + +int vtkMedMesh::GetNumberOfFamily() +{ + return this->GetNumberOfCellFamily() + this->GetNumberOfPointFamily(); +} + +vtkMedFamily* vtkMedMesh::GetFamily(int index) +{ + if(index < 0) + return NULL; + if(index < this->GetNumberOfCellFamily()) + return this->GetCellFamily(index); + else if(index < GetNumberOfFamily()) + return this->GetPointFamily(index - this->GetNumberOfCellFamily()); + else return NULL; +} + +vtkMedFamily* vtkMedMesh::GetOrCreateCellFamilyById(med_int id) +{ + for(int i = 0; i < this->GetNumberOfCellFamily(); i++) + { + vtkMedFamily* family = this->GetCellFamily(i); + if(family->GetId() == id) + { + return family; + } + } + vtkMedFamily* family = vtkMedFamily::New(); + family->SetId(id); + vtkstd::ostringstream sstr; + sstr << "UNDEFINED_CELL_FAMILY_" << id; + family->SetName(sstr.str().c_str()); + family->SetPointOrCell(vtkMedUtilities::OnCell); + family->SetMedIterator(-1); + this->AppendCellFamily(family); + family->Delete(); + return family; +} + +void vtkMedMesh::SetNumberOfAxis(int naxis) +{ + this->AxisName->SetNumberOfValues(naxis); + this->AxisUnit->SetNumberOfValues(naxis); +} + +int vtkMedMesh::GetNumberOfAxis() +{ + return this->AxisName->GetNumberOfValues(); +} + +vtkMedFamily* vtkMedMesh::GetOrCreatePointFamilyById(med_int id) +{ + for(int i = 0; i < this->GetNumberOfPointFamily(); i++) + { + vtkMedFamily* family = this->GetPointFamily(i); + + if(family->GetId() == id) + return family; + } + vtkMedFamily* family = vtkMedFamily::New(); + family->SetId(id); + vtkstd::ostringstream sstr; + sstr << "UNDEFINED_POINT_FAMILY_" << id; + family->SetName(sstr.str().c_str()); + family->SetPointOrCell(vtkMedUtilities::OnPoint); + this->AppendPointFamily(family); + family->Delete(); + return family; +} + +void vtkMedMesh::AddGridStep(vtkMedGrid* grid) +{ + this->GridStep->AddObject(grid->GetComputeStep(), grid); +} + +void vtkMedMesh::ClearGridStep() +{ + this->GridStep->clear(); +} + +vtkMedGrid* vtkMedMesh::GetGridStep(const vtkMedComputeStep& cs) +{ + return this->GridStep->GetObject(cs); +} + +vtkMedGrid* vtkMedMesh::FindGridStep(const vtkMedComputeStep& cs, + int strategy) +{ + return this->GridStep->FindObject(cs, strategy); +} + +void vtkMedMesh::GatherGridTimes(std::set& timeset) +{ + this->GridStep->GatherTimes(timeset); +} + +void vtkMedMesh::GatherGridIterations(med_float time, + std::set& iterationset) +{ + this->GridStep->GatherIterations(time, iterationset); +} + +void vtkMedMesh::ClearMedSupports() +{ + med_int stepnb = this->GridStep->GetNumberOfObject(); + for(med_int stepid = 0; stepidGridStep->GetObject(stepid); + grid->ClearMedSupports(); + } +} + +med_int vtkMedMesh::GetNumberOfGridStep() +{ + return this->GridStep->GetNumberOfObject(); +} + +vtkMedGrid* vtkMedMesh::GetGridStep(med_int id) +{ + return this->GridStep->GetObject(id); +} + +void vtkMedMesh::GatherMedEntities(std::set& entities) +{ + vtkMedGrid* firstStep = this->GetGridStep(0); + if(firstStep == NULL) + return; + + firstStep->GatherMedEntities(entities); +} + +void vtkMedMesh::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, MedIterator); + PRINT_OBJECT_VECTOR(os, indent, CellFamily); + PRINT_OBJECT_VECTOR(os, indent, PointFamily); + PRINT_OBJECT_VECTOR(os, indent, PointGroup); + PRINT_OBJECT_VECTOR(os, indent, CellGroup); + +} diff --git a/src/Plugins/MedReader/IO/vtkMedMesh.h b/src/Plugins/MedReader/IO/vtkMedMesh.h new file mode 100644 index 00000000..872baab2 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedMesh.h @@ -0,0 +1,204 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedMesh_h_ +#define __vtkMedMesh_h_ + +#include "vtkObject.h" +#include "vtkMedSetGet.h" +#include "vtkMed.h" +#include "vtkMedUtilities.h" + +class vtkMedGrid; +class vtkMedFamily; +class vtkMedGroup; +class vtkMedString; +class vtkMedIntArray; +class vtkMedComputeStep; +class vtkMedFile; +class vtkStringArray; + +#include + +class VTK_EXPORT vtkMedMesh: public vtkObject +{ +public: + static vtkMedMesh* New(); + vtkTypeRevisionMacro(vtkMedMesh, vtkObject); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // The name of the mesh in the med file. + vtkGetStringMacro(Name); + vtkSetStringMacro(Name); + + // Description: + // The universal name of the mesh. + vtkGetStringMacro(UniversalName); + vtkSetStringMacro(UniversalName); + + // Description: + // The name of the mesh in the med file. + vtkGetStringMacro(Description); + vtkSetStringMacro(Description); + + // Description: + // The unit of the time steps. + vtkGetStringMacro(TimeUnit); + vtkSetStringMacro(TimeUnit); + + // Description: + // The dimension of the space this mesh lives in + vtkSetMacro(SpaceDimension, med_int); + vtkGetMacro(SpaceDimension, med_int); + + // Description: + // The dimension of this mesh + vtkSetMacro(MeshDimension, med_int); + vtkGetMacro(MeshDimension, med_int); + + // Description: + // The type of grid used by this mesh + vtkSetMacro(MeshType, med_mesh_type); + vtkGetMacro(MeshType, med_mesh_type); + + // Description: + // This stores how the compute steps should be iterated over + // either first by time or first by iteration + vtkSetMacro(SortingType, med_sorting_type); + vtkGetMacro(SortingType, med_sorting_type); + + // Description: + // This is the type of the axis + // MED_CARTESIAN, MED_CYLINDRICAL, MED_SPHERICAL or MED_UNDEF_AXIS_TYPE + vtkSetMacro(AxisType, med_axis_type); + vtkGetMacro(AxisType, med_axis_type); + + // Description: + // This is the type of the axis + // MED_CARTESIAN, MED_CYLINDRICAL, MED_SPHERICAL or MED_UNDEF_AXIS_TYPE + vtkSetMacro(StructuredGridType, med_grid_type); + vtkGetMacro(StructuredGridType, med_grid_type); + + // Description: + // a mesh can be modified over time, so this stores the + // different compute steps of a given mesh + void AddGridStep(vtkMedGrid*); + void ClearGridStep(); + vtkMedGrid* GetGridStep(const vtkMedComputeStep&); + vtkMedGrid* FindGridStep(const vtkMedComputeStep&, int); + med_int GetNumberOfGridStep(); + vtkMedGrid* GetGridStep(med_int); + void GatherGridTimes(std::set&); + void GatherGridIterations(med_float,std::set&); + + // Description: + // Container of the cell families in this mesh + vtkGetObjectVectorMacro(CellFamily, vtkMedFamily); + vtkSetObjectVectorMacro(CellFamily, vtkMedFamily); + virtual vtkMedFamily* GetOrCreateCellFamilyById(med_int); + + // Description: + // Get the Point Families + vtkGetObjectVectorMacro(PointFamily, vtkMedFamily); + vtkSetObjectVectorMacro(PointFamily, vtkMedFamily); + virtual vtkMedFamily* GetOrCreatePointFamilyById(med_int); + + int GetNumberOfFamily(); + vtkMedFamily* GetFamily(int); + + // Description: + // Container of the groups in this mesh + vtkGetObjectVectorMacro(PointGroup, vtkMedGroup); + vtkSetObjectVectorMacro(PointGroup, vtkMedGroup); + vtkGetObjectVectorMacro(CellGroup, vtkMedGroup); + vtkSetObjectVectorMacro(CellGroup, vtkMedGroup); + virtual vtkMedGroup* GetOrCreateGroup(int pointOrCell, const char*); + + // Description: + // this id is the id to use when reading the med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // This stores the name of each axis + vtkGetObjectMacro(AxisName, vtkStringArray); + + // Description: + // This stores the unit of each axis + vtkGetObjectMacro(AxisUnit, vtkStringArray); + + // Description: + // This sets the number of axis of this mesh, and also allocates + // the arrays to store the name and unit of each axis. + void SetNumberOfAxis(int); + int GetNumberOfAxis(); + + // Description: + // free the memory used by this mesh (coordinates, connectivity) + virtual void ClearMedSupports(); + + // Description: + // The name of the mesh in the med file. + virtual void SetParentFile(vtkMedFile*); + vtkGetObjectMacro(ParentFile, vtkMedFile); + + // Description: + // This helper method fills the std::set with all vtkMedEntity types used in the first grid step + // MED specifies that all types must be present in the first step for a varying mesh to be valid + virtual void GatherMedEntities(std::set& entities); + +protected: + vtkMedMesh(); + virtual ~vtkMedMesh(); + + char* Name; + char* UniversalName; + char* Description; + char* TimeUnit; + med_int MedIterator; + med_int SpaceDimension; + med_int MeshDimension; + med_mesh_type MeshType; + med_sorting_type SortingType; + med_axis_type AxisType; + med_grid_type StructuredGridType; + + vtkMedFile* ParentFile; + + vtkObjectVector* CellFamily; + vtkObjectVector* PointFamily; + + vtkObjectVector* PointGroup; + vtkObjectVector* CellGroup; + + vtkStringArray* AxisName; + vtkStringArray* AxisUnit; + + vtkMedComputeStepMap* GridStep; + + bool IsSupportMesh; + +private: + vtkMedMesh(const vtkMedMesh&); // Not implemented. + void operator=(const vtkMedMesh&); // Not implemented. + +}; + +#endif //__vtkMedMesh_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedPolarGrid.cxx b/src/Plugins/MedReader/IO/vtkMedPolarGrid.cxx new file mode 100644 index 00000000..e765c7b0 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedPolarGrid.cxx @@ -0,0 +1,38 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedPolarGrid.h" + +#include "vtkObjectFactory.h" + +vtkCxxRevisionMacro(vtkMedPolarGrid, "$Revision$") +vtkStandardNewMacro(vtkMedPolarGrid) + +vtkMedPolarGrid::vtkMedPolarGrid() +{ +} + +vtkMedPolarGrid::~vtkMedPolarGrid() +{ +} + +void vtkMedPolarGrid::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedPolarGrid.h b/src/Plugins/MedReader/IO/vtkMedPolarGrid.h new file mode 100644 index 00000000..13d63324 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedPolarGrid.h @@ -0,0 +1,42 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedPolarGrid_h_ +#define __vtkMedPolarGrid_h_ + +#include "vtkMedRegularGrid.h" + +class VTK_EXPORT vtkMedPolarGrid : public vtkMedRegularGrid +{ +public : + static vtkMedPolarGrid* New(); + vtkTypeRevisionMacro(vtkMedPolarGrid, vtkMedRegularGrid); + void PrintSelf(ostream& os, vtkIndent indent); + +protected: + vtkMedPolarGrid(); + virtual ~vtkMedPolarGrid(); + +private: + vtkMedPolarGrid(const vtkMedPolarGrid&); // Not implemented. + void operator=(const vtkMedPolarGrid&); // Not implemented. + +}; + +#endif //__vtkMedPolarGrid_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedProfile.cxx b/src/Plugins/MedReader/IO/vtkMedProfile.cxx new file mode 100644 index 00000000..2bccd4b4 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedProfile.cxx @@ -0,0 +1,69 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedProfile.h" + +#include "vtkObjectFactory.h" +#include "vtkMedIntArray.h" +#include "vtkMedSetGet.h" +#include "vtkMedUtilities.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" + +vtkCxxSetObjectMacro(vtkMedProfile,Ids,vtkMedIntArray); +vtkCxxSetObjectMacro(vtkMedProfile,ParentFile,vtkMedFile); + +vtkCxxRevisionMacro(vtkMedProfile, "$Revision$"); +vtkStandardNewMacro(vtkMedProfile); + +vtkMedProfile::vtkMedProfile() +{ + this->NumberOfElement = 0; + this->Ids = NULL; + this->Name = NULL; + this->MedIterator = -1; + this->GeometryType = MED_NO_GEOTYPE; + this->ParentFile = NULL; +} + +vtkMedProfile::~vtkMedProfile() +{ + this->SetName(NULL); + this->SetIds(NULL); +} + +int vtkMedProfile::IsLoaded() +{ + return this->Ids != NULL && this->Ids->GetNumberOfComponents() + == 1 && this->Ids->GetNumberOfTuples() == this->NumberOfElement + && this->NumberOfElement > 0; +} + +void vtkMedProfile::Load() +{ + this->ParentFile->GetMedDriver()->LoadProfile(this); +} + +void vtkMedProfile::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, NumberOfElement); + PRINT_IVAR(os, indent, MedIterator); + PRINT_OBJECT(os, indent, Ids); +} diff --git a/src/Plugins/MedReader/IO/vtkMedProfile.h b/src/Plugins/MedReader/IO/vtkMedProfile.h new file mode 100644 index 00000000..818c5996 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedProfile.h @@ -0,0 +1,87 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedProfile_h_ +#define __vtkMedProfile_h_ + +#include "vtkObject.h" +#include "vtkMed.h" + +class vtkMedIntArray; +class vtkMedString; +class vtkMedFile; + +class VTK_EXPORT vtkMedProfile : public vtkObject +{ +public : + static vtkMedProfile* New(); + vtkTypeRevisionMacro(vtkMedProfile, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the number of elements of this profile + vtkSetMacro(NumberOfElement, vtkIdType); + vtkGetMacro(NumberOfElement, vtkIdType); + + // Description: + // The name of the profile in the file + vtkGetStringMacro(Name); + vtkSetStringMacro(Name); + + // Description: + // Allocate and clear memory of this profil. + virtual void SetIds(vtkMedIntArray*); + vtkGetObjectMacro(Ids, vtkMedIntArray); + + // Description: + // return true if the index array is not null and the size match + virtual int IsLoaded(); + + // Description: + // The index of this field in the med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // Load the profile ids + void Load(); + + // Description: + // this is the file where this Profile is stored + virtual void SetParentFile(vtkMedFile*); + vtkGetObjectMacro(ParentFile, vtkMedFile); + +protected: + vtkMedProfile(); + virtual ~vtkMedProfile(); + + med_int MedIterator; + vtkIdType NumberOfElement; + vtkMedIntArray* Ids; + char* Name; + med_geometry_type GeometryType; + vtkMedFile* ParentFile; + +private: + vtkMedProfile(const vtkMedProfile&); // Not implemented. + void operator=(const vtkMedProfile&); // Not implemented. + +}; + +#endif //__vtkMedProfil_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedReader.cxx b/src/Plugins/MedReader/IO/vtkMedReader.cxx new file mode 100644 index 00000000..e2348f1a --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedReader.cxx @@ -0,0 +1,3146 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedReader.h" + +#include "vtkMedFile.h" +#include "vtkMedDriver.h" +#include "vtkMedUtilities.h" +#include "vtkMedFamily.h" +#include "vtkMedGroup.h" +#include "vtkMedMesh.h" +#include "vtkMedUnstructuredGrid.h" +#include "vtkMedCurvilinearGrid.h" +#include "vtkMedRegularGrid.h" +#include "vtkMedEntityArray.h" +#include "vtkMedField.h" +#include "vtkMedFieldStep.h" +#include "vtkMedFieldOverEntity.h" +#include "vtkMedProfile.h" +#include "vtkMedIntArray.h" +#include "vtkMedLocalization.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedFieldOnProfile.h" +#include "vtkMedSelection.h" +#include "vtkMedFamilyOnEntityOnProfile.h" +#include "vtkMedLink.h" +#include "vtkMedInterpolation.h" +#include "vtkMedStructElement.h" +#include "vtkMedConstantAttribute.h" + +#include "vtkObjectFactory.h" +#include "vtkMutableDirectedGraph.h" +#include "vtkStringArray.h" +#include "vtkDataSetAttributes.h" +#include "vtkUnsignedCharArray.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkSmartPointer.h" +#include "vtkVariantArray.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkExecutive.h" +#include "vtkStreamingDemandDrivenPipeline.h" +#include "vtkUnstructuredGrid.h" +#include "vtkMath.h" +#include "vtkPointData.h" +#include "vtkCellData.h" +#include "vtkFieldData.h" +#include "vtkInformationQuadratureSchemeDefinitionVectorKey.h" +#include "vtkQuadratureSchemeDefinition.h" +#include "vtkCellType.h" +#include "vtkCellArray.h" +#include "vtkDoubleArray.h" +#include "vtkConfigure.h" +#include "vtkMultiProcessController.h" +#include "vtkCommunicator.h" + +#include "vtkSMDoubleVectorProperty.h" +#include "vtkInformationDataObjectKey.h" + +#include +#include +#include +#include +#include +#include +#include +#include +using namespace std; + +struct VTKField +{ + vtkSmartPointer DataArray; + vtkSmartPointer Vectors; + vtkSmartPointer QuadratureIndexArray; +}; + +class vtkMedListOfFieldSteps : public std::list +{}; + +typedef int LocalizationKey; + +class vtkMedReader::vtkMedReaderInternal +{ +public: + int NumberOfPieces; + int CurrentPieceNumber; + int GhostLevel; + double UpdateTimeStep; + vtkTimeStamp FileNameMTime; + vtkTimeStamp MetaDataMTime; + vtkTimeStamp GroupSelectionMTime; + vtkTimeStamp FamilySelectionMTime; + int SILUpdateStamp; + int RealAnimationMode; + vtkMedSelection* Families; + + // this stores the aggregation of all compute steps from + // both meshes and fields. + std::map > GlobalComputeStep; + + // Store the vtkMutableDirectedGraph that represents links between family, groups and cell types + vtkMutableDirectedGraph* SIL; + + // this map is used to keep clean data sets in the cache, without any field. + // for each support, store the vtkDataSet + map > DataSetCache; + + // this is the current dataset for the given support. + map CurrentDataSet; + + // for each support, cache the VTK arrays that correspond to a given field at the given step. + map > FieldCache; + //map > FieldMatchCache; + + // This list keep tracks of all the currently selected supports + set UsedSupports; + + // this map keeps for each support, the quadrature offset array so that + // different fields on the same support can use + // the same offset array, provided they use the same gauss points definitions + map > > + QuadratureOffsetCache; + + map > QuadOffsetKey; + + std::map > MedFiles; + + vtkMedReaderInternal() + { + this->SIL=vtkMutableDirectedGraph::New(); + this->SILUpdateStamp=-1; + this->RealAnimationMode=vtkMedReader::PhysicalTime; + this->Families=vtkMedSelection::New(); + this->FamilySelectionMTime.Modified(); + this->GroupSelectionMTime.Modified(); + } + ~vtkMedReaderInternal() + { + this->SIL->Delete(); + this->Families->Delete(); + } + + void ClearSupportCache(vtkMedFamilyOnEntityOnProfile* foep) + { + //this->Med2VTKPointIndex.erase(foep); + this->QuadratureOffsetCache.erase(foep); + //this->FieldMatchCache.erase(foe); + this->FieldCache.erase(foep); + this->CurrentDataSet.erase(foep); + this->DataSetCache.erase(foep); + } + + vtkIdType GetChild(vtkIdType parent, const vtkStdString childName) + { + vtkStringArray* names=vtkStringArray::SafeDownCast( + this->SIL->GetVertexData()->GetArray("Names")); + if(names==NULL) + return -1; + vtkIdType nedges=this->SIL->GetOutDegree(parent); + for(vtkIdType id=0; idSIL->GetOutEdge(parent, id); + if(names->GetValue(edge.Target)==childName) + return edge.Target; + } + return -1; + } + + vtkIdType GetGroupId(const char* key) + { + vtkstd::string meshname, celltypename, groupname; + vtkMedUtilities::SplitGroupKey(key, meshname, celltypename, groupname); + vtkIdType root=GetChild(0, "SIL"); + if(root==-1) + return -1; + vtkIdType mesh=GetChild(root, meshname); + if(mesh==-1) + return -1; + vtkIdType type=GetChild(mesh, celltypename); + if(type==-1) + return -1; + return GetChild(type, groupname); + + } + +}; + +vtkCxxRevisionMacro(vtkMedReader, "$Revision$"); +vtkStandardNewMacro(vtkMedReader); + +vtkMedReader::vtkMedReader() +{ + this->FileName=NULL; + this->SetNumberOfInputPorts(0); + this->PointFields=vtkMedSelection::New(); + this->CellFields=vtkMedSelection::New(); + this->QuadratureFields=vtkMedSelection::New(); + this->ElnoFields=vtkMedSelection::New(); + this->Entities=vtkMedSelection::New(); + this->Groups=vtkMedSelection::New(); + this->Frequencies=vtkMedSelection::New(); + this->AnimationMode=Default; + this->TimeIndexForIterations=0; + this->CacheStrategy=CacheGeometry; + this->Internal=new vtkMedReaderInternal; + this->TimePrecision=0.00001; + this->AvailableTimes=vtkDoubleArray::New(); + this->GenerateVectors = 0; +} + +vtkMedReader::~vtkMedReader() +{ + this->SetFileName(NULL); + this->PointFields->Delete(); + this->CellFields->Delete(); + this->QuadratureFields->Delete(); + this->ElnoFields->Delete(); + this->Entities->Delete(); + this->Groups->Delete(); + this->Frequencies->Delete(); + delete this->Internal; + this->AvailableTimes->Delete(); +} + +int vtkMedReader::GetSILUpdateStamp() +{ + return this->Internal->SILUpdateStamp; +} + +void vtkMedReader::SetFileName(const char* fname) +{ + int modified=0; + if(fname==this->FileName) + return; + if(fname&&this->FileName&&!strcmp(fname, this->FileName)) + return; + modified=1; + if(this->FileName) + delete[] this->FileName; + if (fname) + { + size_t fnl=strlen(fname)+1; + char* dst=new char[fnl]; + const char* src=fname; + this->FileName=dst; + do + { + *dst++=*src++; + } + while (--fnl); + } + else + { + this->FileName=0; + } + if (modified) + { + this->Modified(); + this->Internal->MedFiles.clear(); + this->Internal->FileNameMTime.Modified(); + } +} + +int vtkMedReader::CanReadFile(const char* fname) +{ + // the factory give a driver only when it can read the file version, + // or it returns a NULL pointer. + vtkSmartPointer file=vtkSmartPointer::New(); + file->SetFileName(fname); + + if(!file->CreateDriver()) + return 0; + + return 1; +} + +int vtkMedReader::RequestInformation(vtkInformation *request, + vtkInformationVector **inputVector, vtkInformationVector *outputVector) +{ + vtkInformation* outInfo = outputVector->GetInformationObject(0); + outInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),-1); + + if(this->Internal->MetaDataMTime <= this->Internal->FileNameMTime) + { + this->ClearCaches(Initialize); + + vtkMedFile* file=vtkMedFile::New(); + file->SetFileName(this->FileName); + this->Internal->MedFiles[this->FileName] = file; + file->Delete(); + + std::list file_stack; + file_stack.push_back(file); + + // if the file cannot create a driver, this means that the filename is not + // valid, or that I do not know how to read this file. + while (file_stack.size() > 0) + { + vtkMedFile* file = file_stack.front(); + file_stack.pop_front(); + // This reads information from disk + file->ReadInformation(); + + // add all files linked to in the current file to the files to read. + for (int linkid=0; linkidGetNumberOfLink(); linkid++) + { + vtkMedLink* link = file->GetLink(linkid); + const char* filename = link->GetFullLink(file->GetFileName()); + if(this->Internal->MedFiles.find(filename) == this->Internal->MedFiles.end()) + { + vtkMedFile* newfile = vtkMedFile::New(); + newfile->SetFileName(filename); + this->Internal->MedFiles[filename] = newfile; + file_stack.push_back(newfile); + newfile->Delete(); + } + } + } + + // This computes some meta information, like which field use which + // support, but do not read large data from disk. + this->LinkMedInfo(); + + // This computes the initial global id of each cell type. + this->InitializeCellGlobalIds(); + + this->ClearSelections(); + + this->BuildSIL(this->Internal->SIL); + this->Internal->SILUpdateStamp++; + + this->GatherComputeSteps(); + + this->Internal->MetaDataMTime.Modified(); + } + + outInfo->Set(vtkDataObject::SIL(), this->Internal->SIL); + request->AppendUnique(vtkExecutive::KEYS_TO_COPY(), + vtkDataObject::SIL()); + request->AppendUnique(vtkExecutive::KEYS_TO_COPY(), + vtkMedUtilities::BLOCK_NAME()); + this->AdvertiseTime(outInfo); + return 1; +} + +int vtkMedReader::RequestData(vtkInformation *request, + vtkInformationVector **inputVector, vtkInformationVector *outputVector) +{ + if(this->FileName==NULL) + { + vtkWarningMacro( << "FileName must be set and meta data loaded"); + return 0; + } + + vtkInformation *info=outputVector->GetInformationObject(0); + + vtkMultiBlockDataSet *output=vtkMultiBlockDataSet::SafeDownCast(info->Get( + vtkDataObject::DATA_OBJECT())); + + if (info->Has(vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES())) + { + this->Internal->NumberOfPieces=info->Get( + vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_PIECES()); + } + else + { + vtkMultiProcessController* controller = + vtkMultiProcessController::GetGlobalController(); + if(controller) + { + this->Internal->NumberOfPieces=controller->GetNumberOfProcesses(); + } + else + { + this->Internal->NumberOfPieces = 1; + } + } + if (info->Has(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER())) + { + this->Internal->CurrentPieceNumber=info->Get( + vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()); + } + else + { + this->Internal->CurrentPieceNumber=0; + vtkMultiProcessController* controller = + vtkMultiProcessController::GetGlobalController(); + if(controller) + { + this->Internal->CurrentPieceNumber= controller->GetLocalProcessId(); + } + else + { + this->Internal->CurrentPieceNumber=0; + } + } + + if (info->Has( + vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS())) + { + this->Internal->GhostLevel=info->Get( + vtkStreamingDemandDrivenPipeline::UPDATE_NUMBER_OF_GHOST_LEVELS()); + } + else + { + this->Internal->GhostLevel=0; + } + + if (info->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())) + { + this->Internal->UpdateTimeStep=info->Get( + vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())[0]; + } + else + { + this->Internal->UpdateTimeStep=0; + } + + this->InitializeParallelRead(); + output->Initialize(); + + this->ChooseRealAnimationMode(); + + std::list openlist; + std::map >::iterator + fileit = this->Internal->MedFiles.begin(); + while(fileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fileit->second; + openlist.push_back(vtkMedDriver::FileOpen(file->GetMedDriver())); + fileit++; + } + + // clear the dataset cache of unneeded geometry + this->ClearCaches(StartRequest); + + // This call create the vtkMedSupports, but do not create the corresponding vtkDataSet; + this->CreateMedSupports(); + this->ClearCaches(AfterCreateMedSupports); + // This call creates the actual vtkDataSet that corresponds to each support + int supportId = 0; + int progress=0; + int maxprogress=2*this->Internal->UsedSupports.size(); + supportId = 0; + int it_counter = 0; + for(set::iterator it= + this->Internal->UsedSupports.begin(); it + !=this->Internal->UsedSupports.end(); it++) + { + ostringstream sstr; + vtkMedFamilyOnEntityOnProfile* foep = *it; + sstr<<"Support : "<GetFamilyOnEntity()->GetFamily()->GetName()); + this->SetProgressText(sstr.str().c_str()); + int doBuildSupportField = 1; + it_counter++; + this->BuildVTKSupport(foep, doBuildSupportField); + this->UpdateProgress((float) progress/((float) maxprogress-1)); + progress++; + supportId++; + } + + this->ClearCaches(EndBuildVTKSupports); + // This call maps the fields to the supports + for(set::iterator it= + this->Internal->UsedSupports.begin(); it + !=this->Internal->UsedSupports.end(); it++) + { + vtkMedFamilyOnEntityOnProfile* foep = *it; + if((foep->GetValid() == 0) && (this->Internal->NumberOfPieces == 1)) + continue; + ostringstream sstr; + sstr<<"Loading fields on "<GetFamilyOnEntity()->GetFamily()->GetName()); + this->SetProgressText(sstr.str().c_str()); + int doMapField = 1; + this->MapFieldsOnSupport(*it, doMapField); + this->UpdateProgress((float) progress/((float) maxprogress-1)); + progress++; + supportId++; + } + + // This call clean up caches (what is actually done depends of the CacheStrategy) + this->ClearCaches(EndRequest); + return 1; +} + +void vtkMedReader::InitializeCellGlobalIds() +{ + std::map >::iterator + fileit = this->Internal->MedFiles.begin(); + while(fileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fileit->second; + fileit++; + for(int m=0; mGetNumberOfMesh(); m++) + { + vtkMedMesh* mesh = file->GetMesh(m); + med_int nstep = mesh->GetNumberOfGridStep(); + for(med_int stepid=0; stepidGetGridStep(stepid); + grid->InitializeCellGlobalIds(); + } + } + } +} + +// Method to create the filters for the MED parallel read functions +// It is defined here as we have all information for initialization +void vtkMedReader::InitializeParallelRead() +{ + // If there is only one process for reading no need to enter here + if (this->Internal->NumberOfPieces <= 1) + { + return; + } + + // FIRST: Generate filters for the cells + + std::map >::iterator + meshfit = this->Internal->MedFiles.begin(); + while(meshfit != this->Internal->MedFiles.end()) + { + vtkMedFile* meshfile = meshfit->second; + meshfit++; + med_idt pFileID = meshfile->GetMedDriver()->GetParallelFileId(); + + for(int mid=0; midGetNumberOfMesh(); mid++) + { + vtkMedMesh* mesh = meshfile->GetMesh(mid); + for(int gid=0; gidGetNumberOfGridStep(); gid++) + { + vtkMedGrid* grid = mesh->GetGridStep(gid); + // read point family data and create EntityArrays + + for(int eid=0; eid < grid->GetNumberOfEntityArray(); eid++) + { + vtkMedEntityArray* array = grid->GetEntityArray(eid); + + // Next continue is to avoid to create filters for the + // points, at the moment we charge the points in all nodes + if (array->GetEntity().GeometryType == MED_POINT1) // !MED_NODE + continue; + + med_int nbofconstituentpervalue = vtkMedUtilities::GetNumberOfNodes( + array->GetEntity().GeometryType); + if (nbofconstituentpervalue == -1) + vtkErrorMacro("Still not implemented for MED_POLYGON and MED_POLYHEDRON"); // à gerer + + // Calculating block sizes + int nEntity = array->GetNumberOfEntity(); + int block_size = ( nEntity / this->Internal->NumberOfPieces ); + med_size start = block_size * this->Internal->CurrentPieceNumber + 1; + med_size stride = block_size; + med_size count = 1; + med_size blocksize = block_size; + med_size lastblocksize = (nEntity % this->Internal->NumberOfPieces); + if ((this->Internal->NumberOfPieces == + this->Internal->CurrentPieceNumber+1) && (lastblocksize != 0)) + { + blocksize += lastblocksize; + stride += lastblocksize; + } + lastblocksize = 0; + + vtkMedFilter *filter = vtkMedFilter::New(); + filter->SetFilterSizes( start, stride, count, blocksize, lastblocksize ); + array->SetFilter(filter); + }//entity array + }// grid step + }//mesh + }//mesh file + + // SECOND: Filters for the Fields + + std::map >::iterator + fieldfileit; + // link the FieldOnProfile with the profiles + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* fieldfile = fieldfileit->second; + fieldfileit++; + med_idt pFileID = fieldfile->GetMedDriver()->GetParallelFileId(); + + for(int fid=0; fidGetNumberOfField(); fid++) + { + vtkMedField* field = fieldfile->GetField(fid); + + if (field->GetFieldType() == vtkMedField::CellField) + { + for(int sid = 0; sid< field->GetNumberOfFieldStep(); sid++) + { + vtkMedFieldStep* step = field->GetFieldStep(sid); + + for(int foeid = 0; foeid < step->GetNumberOfFieldOverEntity(); foeid++) + // TODO : seul le premier pas de temps est dispo au debut + { + vtkMedFieldOverEntity* fieldOverEntity = step->GetFieldOverEntity(foeid); + + for(int fopid = 0; fopid < fieldOverEntity->GetNumberOfFieldOnProfile(); fopid++) + { + vtkMedFieldOnProfile* fop = fieldOverEntity->GetFieldOnProfile(fopid); + // Here implement the filters as before: + // 1- Modify vtkMedFieldOnProfile to contain a filter + // 2- Create the filters here only if they are on CELLs (use GetFieldType) + med_int nbofconstituentpervalue = field->GetNumberOfComponent(); + + int nVectors = fop->GetNumberOfValues(); + + int block_size = ( nVectors / this->Internal->NumberOfPieces ); + int start = block_size * this->Internal->CurrentPieceNumber + 1; + int stride = block_size; + int count = 1; + int blocksize = block_size; + int lastblocksize = (nVectors % this->Internal->NumberOfPieces); + if ((this->Internal->NumberOfPieces == + this->Internal->CurrentPieceNumber+1) && (lastblocksize != 0)) + { + blocksize += lastblocksize; + stride += lastblocksize; + } + lastblocksize = 0; + + vtkMedFilter *filter = vtkMedFilter::New(); + filter->SetFilterSizes( start, stride, count, blocksize, lastblocksize ); + fop->SetFilter(filter); + } + } + } + } // end IF + } + } + +} + +void vtkMedReader::LinkMedInfo() +{ + std::map >::iterator + fieldfileit; + // link the FieldOnProfile with the profiles + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* fieldfile = fieldfileit->second; + fieldfileit++; + + for(int fid=0; fidGetNumberOfField(); fid++) + { + vtkMedField* field = fieldfile->GetField(fid); + + for(int sid = 0; sid< field->GetNumberOfFieldStep(); sid++) + { + vtkMedFieldStep* step = field->GetFieldStep(sid); + + for(int foeid = 0; foeid < step->GetNumberOfFieldOverEntity(); foeid++) + { + vtkMedFieldOverEntity* fieldOverEntity = step->GetFieldOverEntity(foeid); + + for(int fopid = 0; fopid < fieldOverEntity->GetNumberOfFieldOnProfile(); fopid++) + { + vtkMedFieldOnProfile* fop = fieldOverEntity->GetFieldOnProfile(fopid); + + std::map >::iterator + profilefileit = this->Internal->MedFiles.begin(); + while(profilefileit != this->Internal->MedFiles.end() && fop->GetProfile() == NULL) + { + vtkMedFile* profilefile = profilefileit->second; + profilefileit++; + + for(int pid = 0; pid < profilefile->GetNumberOfProfile(); pid++) + { + vtkMedProfile *profile = profilefile->GetProfile(pid); + if(strcmp(profile->GetName(), fop->GetProfileName()) == 0) + { + fop->SetProfile(profile); + break; + } + } + } + } + } + } + } + } + + // first, add a familyOnEntityOnProfile to all FamilyOnEntity with a NULL + // profile. This is used if no field is mapped to this support. + std::map >::iterator + meshfit = this->Internal->MedFiles.begin(); + while(meshfit != this->Internal->MedFiles.end()) + { + vtkMedFile* meshfile = meshfit->second; + meshfit++; + + for(int mid=0; midGetNumberOfMesh(); mid++) + { + vtkMedMesh* mesh = meshfile->GetMesh(mid); + + for(int gid=0; gidGetNumberOfGridStep(); gid++) + { + vtkMedGrid* grid = mesh->GetGridStep(gid); + // read point family data and create EntityArrays + + for(int eid=0; eid < grid->GetNumberOfEntityArray(); eid++) + { + vtkMedEntityArray* array = grid->GetEntityArray(eid); + + for(int fid=0; fid < array->GetNumberOfFamilyOnEntity(); fid++) + { + vtkMedFamilyOnEntity* foe = array->GetFamilyOnEntity(fid); + if(foe->GetFamilyOnEntityOnProfile((vtkMedProfile*)NULL) == NULL) + { + vtkMedFamilyOnEntityOnProfile* foep = + vtkMedFamilyOnEntityOnProfile::New(); + foep->SetFamilyOnEntity(foe); + foep->SetProfile(NULL); + foe->AddFamilyOnEntityOnProfile(foep); + foep->Delete(); + } + }//family on entity + }//entity array + }// grid step + }//mesh + }//mesh file + + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* fieldfile = fieldfileit->second; + fieldfileit++; + + for(int fieldid=0; fieldid < fieldfile->GetNumberOfField(); fieldid++) + { + vtkMedField* field = fieldfile->GetField(fieldid); + + for(int fstepid=0; fstepid < field->GetNumberOfFieldStep(); fstepid++) + { + vtkMedFieldStep* step = field->GetFieldStep(fstepid); + + vtkMedComputeStep meshcs = step->GetMeshComputeStep(); + + for(int foeid=0; foeidGetNumberOfFieldOverEntity() ;foeid++) + { + vtkMedFieldOverEntity* fieldOverEntity = step->GetFieldOverEntity(foeid); + const vtkMedEntity& fieldentity = fieldOverEntity->GetEntity(); + + for (int fopid = 0; + fopid < fieldOverEntity->GetNumberOfFieldOnProfile(); fopid++) + { + vtkMedFieldOnProfile* fop = + fieldOverEntity->GetFieldOnProfile(fopid); + + std::map >::iterator + meshfileit = this->Internal->MedFiles.begin(); + while(meshfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* meshfile = meshfileit->second; + meshfileit++; + + if(field->GetLocal() == 1 && (meshfile != fieldfile)) + continue; + + for(int mid=0; midGetNumberOfMesh(); mid++) + { + vtkMedMesh* mesh = meshfile->GetMesh(mid); + + // the field must be on this mesh. + if(strcmp(mesh->GetName(), + field->GetMeshName()) != 0) + continue; + + vtkMedGrid* grid = mesh->GetGridStep(meshcs); + if(grid == NULL) + { + vtkErrorMacro("the field " << field->GetName() + << " at step iteration:" + << step->GetComputeStep().IterationIt + << " and time " + << step->GetComputeStep().TimeIt + << " uses mesh at step " + << meshcs.TimeIt << " " << meshcs.IterationIt + << "which does not exists!"); + continue; + } + + for(int eid=0; eid < grid->GetNumberOfEntityArray(); eid++) + { + vtkMedEntityArray* array = grid->GetEntityArray(eid); + + // if the support is on points, + // the field must also be on points + if(array->GetEntity().EntityType == MED_NODE && + fieldentity.EntityType != MED_NODE) + continue; + + if(array->GetEntity().EntityType != MED_NODE && + fieldentity.EntityType == MED_NODE) + continue; + + // for fields not on points, the geometry type + // of the support must match + if(array->GetEntity().EntityType != MED_NODE && + array->GetEntity().GeometryType != fieldentity.GeometryType) + continue; + + for(int fid = 0; fid < array->GetNumberOfFamilyOnEntity(); fid++) + { + vtkMedFamilyOnEntity* foe = array->GetFamilyOnEntity(fid); + if(foe->GetFamilyOnEntityOnProfile(fop->GetProfile()) == NULL) + { + vtkMedFamilyOnEntityOnProfile* foep = + vtkMedFamilyOnEntityOnProfile::New(); + foep->SetProfile(fop->GetProfile()); + foep->SetFamilyOnEntity(foe); + foe->AddFamilyOnEntityOnProfile(foep); + foep->Delete(); + } + // also add the family on entity with no profile. + if(foe->GetFamilyOnEntityOnProfile((vtkMedProfile*)NULL) == NULL) + { + vtkMedFamilyOnEntityOnProfile* foep = + vtkMedFamilyOnEntityOnProfile::New(); + foep->SetProfile(NULL); + foep->SetFamilyOnEntity(foe); + foe->AddFamilyOnEntityOnProfile(foep); + foep->Delete(); + } + }//familyOnEntity + }//entityArray + }//mesh + }//mesh file + }//field on profile + }//fieldOverEntity + }//fiedstep + }// fieldid + }//fieldfileit + + // Now, link localizations and interpolations + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* fieldfile = fieldfileit->second; + fieldfileit++; + + for(int locid = 0; locid < fieldfile->GetNumberOfLocalization(); locid++) + { + vtkMedLocalization* loc = fieldfile->GetLocalization(locid); + + for(int fid = 0; fid < fieldfile->GetNumberOfField() && + loc->GetInterpolation() == NULL; fid++) + { + vtkMedField* field = fieldfile->GetField(fid); + for(int interpid = 0; interpid < field->GetNumberOfInterpolation(); + interpid++) + { + vtkMedInterpolation* interp = field->GetInterpolation(interpid); + if(strcmp(loc->GetInterpolationName(), + interp->GetName()) == 0) + { + loc->SetInterpolation(interp); + break; + } + } + } + } + } + + // now that the interpolation is set, build the shape functions. + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* fieldfile = fieldfileit->second; + fieldfileit++; + + for(int locid = 0; locid < fieldfile->GetNumberOfLocalization(); locid++) + { + vtkMedLocalization* loc = fieldfile->GetLocalization(locid); + loc->BuildShapeFunction(); + } + } + + // set the supportmesh pointer in the structural element + std::map >::iterator + fileit = this->Internal->MedFiles.begin(); + while(fileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fileit->second; + fileit++; + + for(int structelemit = 0; + structelemit < file->GetNumberOfStructElement(); + structelemit++) + { + vtkMedStructElement* structElem = + file->GetStructElement(structelemit); + + for(int supportmeshit = 0; + supportmeshit < file->GetNumberOfSupportMesh(); + supportmeshit++) + { + vtkMedMesh* supportMesh = + file->GetSupportMesh(supportmeshit); + + if(strcmp(supportMesh->GetName(), structElem->GetName()) == 0 ) + { + structElem->SetSupportMesh(supportMesh); + break; + } + } + } + } + + // set the pointer to the profile used by the constant attributes + fileit = this->Internal->MedFiles.begin(); + while(fileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fileit->second; + fileit++; + + for(int structelemit = 0; + structelemit < file->GetNumberOfStructElement(); + structelemit++) + { + vtkMedStructElement* structElem = + file->GetStructElement(structelemit); + + for(int cstattit = 0; cstattit < structElem->GetNumberOfConstantAttribute(); cstattit++) + { + vtkMedConstantAttribute* cstatt = structElem->GetConstantAttribute(cstattit); + + for(int profit = 0; + profit < file->GetNumberOfProfile(); + profit++) + { + vtkMedProfile* profile = + file->GetProfile(profit); + + if(strcmp(profile->GetName(), cstatt->GetProfileName()) == 0 ) + { + cstatt->SetProfile(profile); + break; + } + } + } + } + } + + meshfit = this->Internal->MedFiles.begin(); + while(meshfit != this->Internal->MedFiles.end()) + { + vtkMedFile* meshfile = meshfit->second; + meshfit++; + + for(int mid=0; midGetNumberOfMesh(); mid++) + { + vtkMedMesh* mesh = meshfile->GetMesh(mid); + + for(int gid=0; gidGetNumberOfGridStep(); gid++) + { + vtkMedGrid* grid = mesh->GetGridStep(gid); + // read point family data and create EntityArrays + + for(int eid=0; eid < grid->GetNumberOfEntityArray(); eid++) + { + vtkMedEntityArray* array = grid->GetEntityArray(eid); + if(array->GetEntity().EntityType != MED_STRUCT_ELEMENT) + continue; + + for(int structelemit = 0; structelemit < meshfile->GetNumberOfStructElement(); structelemit++) + { + vtkMedStructElement* structelem = meshfile->GetStructElement(structelemit); + if(structelem->GetGeometryType() == array->GetEntity().GeometryType) + { + array->SetStructElement(structelem); + break; + } + } + } + } + } + } +} + +int vtkMedReader::GetFrequencyArrayStatus(const char* name) +{ + return this->Frequencies->GetKeyStatus(name); +} + +void vtkMedReader::SetFrequencyArrayStatus(const char* name, int status) +{ + if(this->Frequencies->GetKeyStatus(name) == status) + { + return; + } + + this->Frequencies->SetKeyStatus(name, status); + + this->Modified(); +} + +int vtkMedReader::GetNumberOfFrequencyArrays() +{ + return this->Frequencies->GetNumberOfKey(); +} + +const char* vtkMedReader::GetFrequencyArrayName(int index) +{ + return this->Frequencies->GetKey(index); +} + +struct compTimes +{ + bool operator()(pair i, pair j) + { + if(i.first!=j.first) + return (i.firstAvailableTimes->Initialize(); + this->AvailableTimes->SetNumberOfComponents(1); + + std::set newFrequencies; + + int tid = 0; + std::map >::iterator it = + this->Internal->GlobalComputeStep.begin(); + while(it != this->Internal->GlobalComputeStep.end()) + { + double time = it->first; + this->AvailableTimes->InsertNextValue(time); + string name = vtkMedUtilities::GetModeKey(tid, time, this->Internal->GlobalComputeStep.size()-1); + this->Frequencies->AddKey(name.c_str()); + newFrequencies.insert(name); + tid++; + it++; + } + + // now check if old frequencies have been removed + for(int f = 0; f < this->Frequencies->GetNumberOfKey(); f++) + { + const char* name = this->Frequencies->GetKey(f); + if(newFrequencies.find(name) == newFrequencies.end()) + { + this->Frequencies->RemoveKeyByIndex(f); + f--; + } + } + + return this->AvailableTimes; +} + +void vtkMedReader::ChooseRealAnimationMode() +{ + if(this->AnimationMode!=Default) + { + this->Internal->RealAnimationMode=this->AnimationMode; + return; + } + + // if there is exactly one physical time and more than one iteration + // set the animation mode to iteration, else default to physical time. + if (this->Internal->GlobalComputeStep.size() == 1 && + this->Internal->GlobalComputeStep[0].size() > 1) + { + this->Internal->RealAnimationMode=Iteration; + return; + } + + this->Internal->RealAnimationMode=PhysicalTime; +} + +int vtkMedReader::GetEntityStatus(const vtkMedEntity& entity) +{ + if (entity.EntityType==MED_NODE) + return 1; + if(entity.EntityType == MED_DESCENDING_FACE + || entity.EntityType == MED_DESCENDING_EDGE) + return 0; + + return this->Entities->GetKeyStatus(vtkMedUtilities::EntityKey(entity).c_str()); +} + +int vtkMedReader::GetFamilyStatus(vtkMedMesh* mesh, vtkMedFamily* family) +{ + if(!mesh||!family) + return 0; + + if(this->Internal->GroupSelectionMTime > this->Internal->FamilySelectionMTime) + { + this->SelectFamiliesFromGroups(); + } + + int status = this->Internal->Families->GetKeyStatus(vtkMedUtilities::FamilyKey( + mesh->GetName(), family->GetPointOrCell(), + family->GetName()).c_str()); + + return status; +} + +int vtkMedReader::IsMeshSelected(vtkMedMesh* mesh) +{ + for(int fam=0; famGetNumberOfPointFamily(); fam++) + { + if(this->GetFamilyStatus(mesh, mesh->GetPointFamily(fam))!=0) + return 1; + } + + for(int fam=0; famGetNumberOfCellFamily(); fam++) + { + if(this->GetFamilyStatus(mesh, mesh->GetCellFamily(fam))!=0) + return 1; + } + return 0; +} + +void vtkMedReader::GatherComputeSteps() +{ + this->Internal->GlobalComputeStep.clear(); + + std::map >::iterator + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fieldfileit->second; + fieldfileit++; + + // first loop over all fields to gather their compute steps + for(int fieldId=0; fieldIdGetNumberOfField(); fieldId++) + { + vtkMedField* field=file->GetField(fieldId); + + for(int stepId=0; stepIdGetNumberOfFieldStep(); stepId++) + { + vtkMedFieldStep* step=field->GetFieldStep(stepId); + const vtkMedComputeStep& cs = step->GetComputeStep(); + this->Internal->GlobalComputeStep[cs.TimeOrFrequency].insert(cs.IterationIt); + } + }//fields + + // then loop over all meshes to gather their grid steps too. + // for meshes, do not add the MED_UNDEF_DT time + for(int meshId=0; meshIdGetNumberOfMesh(); meshId++) + { + vtkMedMesh* mesh=file->GetMesh(meshId); + + for(int stepId=0; stepIdGetNumberOfGridStep(); stepId++) + { + vtkMedGrid* grid=mesh->GetGridStep(stepId); + const vtkMedComputeStep& cs = grid->GetComputeStep(); + if(cs.TimeOrFrequency != MED_UNDEF_DT || cs.TimeIt != MED_NO_DT) + { + this->Internal->GlobalComputeStep[cs.TimeOrFrequency].insert(cs.IterationIt); + } + } + }//mesh + } + if(this->Internal->GlobalComputeStep.size() == 0) + { + this->Internal->GlobalComputeStep[MED_UNDEF_DT].insert(MED_NO_IT); + } +} + +int vtkMedReader::IsFieldSelected(vtkMedField* field) +{ + return this->IsPointFieldSelected(field)||this->IsCellFieldSelected(field) + ||this->IsQuadratureFieldSelected(field) || this->IsElnoFieldSelected(field); +} + +int vtkMedReader::IsPointFieldSelected(vtkMedField* field) +{ + return field->GetFieldType()==vtkMedField::PointField + &&this->GetPointFieldArrayStatus(vtkMedUtilities::SimplifyName( + field->GetName()).c_str()); +} + +int vtkMedReader::IsCellFieldSelected(vtkMedField* field) +{ + return field->GetFieldType()==vtkMedField::CellField + &&this->GetCellFieldArrayStatus(vtkMedUtilities::SimplifyName( + field->GetName()).c_str()); +} + +vtkMedProfile* vtkMedReader::GetProfile(const char* pname) +{ + std::map >::iterator + fileit = this->Internal->MedFiles.begin(); + while(fileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fileit->second; + fileit++; + vtkMedProfile* profile = file->GetProfile(pname); + if(profile != NULL) + return profile; + } + return NULL; +} + +vtkMedLocalization* vtkMedReader::GetLocalization(const char* lname) +{ + std::map >::iterator + fileit = this->Internal->MedFiles.begin(); + while(fileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fileit->second; + fileit++; + vtkMedLocalization* loc = file->GetLocalization(lname); + if(loc != NULL) + return loc; + } + return NULL; + +} + +int vtkMedReader::GetLocalizationKey(vtkMedFieldOnProfile* fop) +{ + vtkMedLocalization* def=this->GetLocalization(fop->GetLocalizationName()); + + // This is not a quadrature field with explicit definition. + // There are two possible cases : either the intergration point is + // at the center of the cell + //1 quadrature point at the cell center + int nloc = 0; + std::map >::iterator + fileit = this->Internal->MedFiles.begin(); + while(fileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fileit->second; + fileit++; + + if(def && def->GetParentFile() == file) + return nloc + def->GetMedIterator() - 1; + + nloc += file->GetNumberOfLocalization(); + } + + // center of a cell + if(fop->GetNumberOfIntegrationPoint()==1) + return nloc + 1 + fop->GetParentFieldOverEntity()->GetEntity().GeometryType; + + // or it is an elno field (field stored on nodes of the cells, + // but with discontinuities at the vertices) + return -fop->GetParentFieldOverEntity()->GetEntity().GeometryType;//ELNO +} + +int vtkMedReader::IsQuadratureFieldSelected(vtkMedField* field) +{ + return field->GetFieldType()==vtkMedField::QuadratureField + &&this->GetQuadratureFieldArrayStatus(vtkMedUtilities::SimplifyName( + field->GetName()).c_str()); +} + +int vtkMedReader::IsElnoFieldSelected(vtkMedField* field) +{ + return field->GetFieldType()==vtkMedField::ElnoField + &&this->GetElnoFieldArrayStatus(vtkMedUtilities::SimplifyName( + field->GetName()).c_str()); +} + +// Description: +// Give the animation steps to the pipeline +void vtkMedReader::AdvertiseTime(vtkInformation* info) +{ + this->ChooseRealAnimationMode(); + + if(this->Internal->RealAnimationMode==PhysicalTime) + { + // I advertise the union of all times available + // in all selected fields and meshes + set timeset; + + std::map >::iterator + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fieldfileit->second; + fieldfileit++; + + // first loop over all fields to gather their compute steps + for(int fieldId=0; fieldIdGetNumberOfField(); fieldId++) + { + vtkMedField* field=file->GetField(fieldId); + + if(!this->IsFieldSelected(field)) + continue; + + field->GatherFieldTimes(timeset); + }//fields + + // then loop over all meshes to gather their grid steps too. + for(int meshId=0; meshIdGetNumberOfMesh(); meshId++) + { + vtkMedMesh* mesh=file->GetMesh(meshId); + + if(!this->IsMeshSelected(mesh)) + continue; + + mesh->GatherGridTimes(timeset); + }//meshes + } + + if(timeset.size() > 0) + { + // remove MED_UNDEF_DT if there are other time step + if(timeset.size() > 1) + timeset.erase(MED_UNDEF_DT); + + vector times; + set::iterator it = timeset.begin(); + while(it != timeset.end()) + { + times.push_back(*it); + it++; + } + sort(times.begin(), times.end()); + + info->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), ×[0], + times.size()); + double timeRange[2]; + timeRange[0]=times[0]; + timeRange[1]=times[times.size()-1]; + info->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(), &timeRange[0], + 2); + } + else + { + info->Remove(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); + info->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE()); + } + } + else if(this->Internal->RealAnimationMode==Iteration) + { + // I advertise the union of all iterations available at the given + // Time for all selected fields. + set iterationsets; + med_float time = MED_UNDEF_DT; + if(this->TimeIndexForIterations >= 0 && + this->TimeIndexForIterations < + this->AvailableTimes->GetNumberOfTuples()) + { + time = this->AvailableTimes-> + GetValue((vtkIdType)this->TimeIndexForIterations); + } + + std::map >::iterator + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fieldfileit->second; + fieldfileit++; + + for(int fieldId=0; fieldIdGetNumberOfField(); fieldId++) + { + vtkMedField* field=file->GetField(fieldId); + if(!this->IsFieldSelected(field)) + continue; + + field->GatherFieldIterations(time, iterationsets); + } + // then loop over all meshes to gather their grid steps too. + for(int meshId=0; meshIdGetNumberOfMesh(); meshId++) + { + vtkMedMesh* mesh=file->GetMesh(meshId); + + if(!this->IsMeshSelected(mesh)) + continue; + + mesh->GatherGridIterations(time, iterationsets); + }//meshes + } + + if(iterationsets.size()>0) + { + // remove MED_NO_IT if there are other available iterations. + if(iterationsets.size()>1) + iterationsets.erase(MED_NO_IT); + + vector iterations; + set::iterator it=iterationsets.begin(); + while(it!=iterationsets.end()) + { + iterations.push_back((double)*it); + it++; + } + sort(iterations.begin(), iterations.end()); + info->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &iterations[0], + iterations.size()); + double timeRange[2]; + timeRange[0]=iterations[0]; + timeRange[1]=iterations[iterations.size()-1]; + info->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(), &timeRange[0], + 2); + } + else + { + info->Remove(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); + info->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE()); + } + } + else + { + info->Remove(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); + info->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE()); + } +} + +vtkIdType vtkMedReader::GetFrequencyIndex(double freq) +{ + return this->AvailableTimes->LookupValue(freq); +} + +int vtkMedReader::RequestDataObject(vtkInformation* request, + vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) +{ + vtkInformation *info = outputVector->GetInformationObject(0); + if (vtkMultiBlockDataSet::SafeDownCast( + info->Get(vtkDataObject::DATA_OBJECT()))) + { + // The output is already created + return 1; + } + else + { + vtkMultiBlockDataSet* output=vtkMultiBlockDataSet::New(); + this->GetExecutive()->SetOutputData(0, output); + output->Delete(); + this->GetOutputPortInformation(0)->Set(vtkDataObject::DATA_EXTENT_TYPE(), + output->GetExtentType()); + } + return 1; +} + +void vtkMedReader::ClearSelections() +{ + this->PointFields->Initialize(); + this->CellFields->Initialize(); + this->QuadratureFields->Initialize(); + this->ElnoFields->Initialize(); + + std::map >::iterator + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fieldfileit->second; + fieldfileit++; + + for(int index=0; index < file->GetNumberOfField(); index++) + { + vtkMedField* field = file->GetField(index); + switch(field->GetFieldType()) + { + case vtkMedField::PointField : + this->PointFields->AddKey(vtkMedUtilities::SimplifyName( + field->GetName()).c_str()); + break; + case vtkMedField::CellField : + this->CellFields->AddKey(vtkMedUtilities::SimplifyName( + field->GetName()).c_str()); + break; + case vtkMedField::QuadratureField : + this->QuadratureFields->AddKey(vtkMedUtilities::SimplifyName( + field->GetName()).c_str()); + break; + case vtkMedField::ElnoField : + this->ElnoFields->AddKey(vtkMedUtilities::SimplifyName( + field->GetName()).c_str()); + break; + } + } + + this->Internal->Families->Initialize(); + this->Groups->Initialize(); + for(int meshIndex=0; meshIndex < file->GetNumberOfMesh(); meshIndex++) + { + vtkMedMesh* mesh = file->GetMesh(meshIndex); + for(int famIndex=0; famIndexGetNumberOfPointFamily(); famIndex++) + { + vtkMedFamily* fam=mesh->GetPointFamily(famIndex); + + int ng=fam->GetNumberOfGroup(); + for(int gindex=0; gindexGetGroup(gindex); + string gname=vtkMedUtilities::GroupKey(mesh->GetName(), + fam->GetPointOrCell(), group->GetName()); + + this->Groups->AddKey(gname.c_str()); + this->Groups->SetKeyStatus(gname.c_str(), 0); + } + } + for(int famIndex=0; famIndexGetNumberOfCellFamily(); famIndex++) + { + vtkMedFamily* fam=mesh->GetCellFamily(famIndex); + + int ng=fam->GetNumberOfGroup(); + for(int gindex=0; gindexGetGroup(gindex); + string gname=vtkMedUtilities::GroupKey(mesh->GetName(), + fam->GetPointOrCell(), group->GetName()); + + this->Groups->AddKey(gname.c_str()); + this->Groups->SetKeyStatus(gname.c_str(), 1); + } + } + } + this->Internal->GroupSelectionMTime.Modified(); + + for(int meshIndex=0; meshIndex< file->GetNumberOfMesh(); meshIndex++) + { + if(file->GetMesh(meshIndex)->GetNumberOfGridStep() == 0) + continue; + + vtkMedGrid* grid=file->GetMesh(meshIndex)->GetGridStep(0); + + for(int entityIndex=0; entityIndexGetNumberOfEntityArray(); + entityIndex++) + { + vtkMedEntityArray* array=grid->GetEntityArray(entityIndex); + string name=vtkMedUtilities::EntityKey(array->GetEntity()); + this->Entities->AddKey(name.c_str()); + } + } + } + this->Modified(); +} + +void vtkMedReader::SelectFamiliesFromGroups() +{ + this->Internal->Families->Initialize(); + + std::map >::iterator + meshfileit = this->Internal->MedFiles.begin(); + while(meshfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = meshfileit->second; + meshfileit++; + + for(int meshIndex=0; meshIndex < file->GetNumberOfMesh(); meshIndex++) + { + vtkMedMesh* mesh = file->GetMesh(meshIndex); + for(int famIndex=0; famIndexGetNumberOfFamily(); famIndex++) + { + vtkMedFamily* fam=mesh->GetFamily(famIndex); + string name=vtkMedUtilities::FamilyKey(mesh->GetName(), + fam->GetPointOrCell(), fam->GetName()); + + this->Internal->Families->SetKeyStatus(name.c_str(), 0); + + for(int gindex=0; gindexGetNumberOfGroup(); gindex++) + { + vtkMedGroup* group=fam->GetGroup(gindex); + string gname=vtkMedUtilities::GroupKey(mesh->GetName(), + fam->GetPointOrCell(), group->GetName()); + int state=this->Groups->GetKeyStatus(gname.c_str()); + + if(state) + { + this->SetFamilyStatus(name.c_str(), 1); + } + } + } + } + } + + this->Internal->FamilySelectionMTime.Modified(); +} + +int vtkMedReader::GetNumberOfPointFieldArrays() +{ + return this->PointFields->GetNumberOfKey(); +} + +const char* +vtkMedReader::GetPointFieldArrayName(int index) +{ + return this->PointFields->GetKey(index); +} + +int vtkMedReader::GetPointFieldArrayStatus(const char* name) +{ + return this->PointFields->GetKeyStatus(name); +} + +void vtkMedReader::SetPointFieldArrayStatus(const char* name, int status) +{ + if(this->PointFields->KeyExists(name)&&this->PointFields->GetKeyStatus( + name)==status) + return; + + this->PointFields->SetKeyStatus(name, status); + + this->Modified(); +} + +int vtkMedReader::GetNumberOfCellFieldArrays() +{ + return this->CellFields->GetNumberOfKey(); +} + +const char* +vtkMedReader::GetCellFieldArrayName(int index) +{ + return this->CellFields->GetKey(index); +} + +int vtkMedReader::GetCellFieldArrayStatus(const char* name) +{ + return this->CellFields->GetKeyStatus(name); +} + +void vtkMedReader::SetCellFieldArrayStatus(const char* name, int status) +{ + if(this->CellFields->KeyExists(name)&&this->CellFields->GetKeyStatus( + name)==status) + return; + + this->CellFields->SetKeyStatus(name, status); + + this->Modified(); +} + +int vtkMedReader::GetNumberOfQuadratureFieldArrays() +{ + return this->QuadratureFields->GetNumberOfKey(); +} + +const char* vtkMedReader::GetQuadratureFieldArrayName(int index) +{ + return this->QuadratureFields->GetKey(index); +} + +int vtkMedReader::GetQuadratureFieldArrayStatus(const char* name) +{ + return this->QuadratureFields->GetKeyStatus(name); +} + +void vtkMedReader::SetQuadratureFieldArrayStatus(const char* name, int status) +{ + if(this->QuadratureFields->KeyExists(name) + &&this->QuadratureFields->GetKeyStatus(name)==status) + return; + + this->QuadratureFields->SetKeyStatus(name, status); + + this->Modified(); +} + +int vtkMedReader::GetNumberOfElnoFieldArrays() +{ + return this->ElnoFields->GetNumberOfKey(); +} + +const char* vtkMedReader::GetElnoFieldArrayName(int index) +{ + return this->ElnoFields->GetKey(index); +} + +int vtkMedReader::GetElnoFieldArrayStatus(const char* name) +{ + return this->ElnoFields->GetKeyStatus(name); +} + +void vtkMedReader::SetElnoFieldArrayStatus(const char* name, int status) +{ + if(this->ElnoFields->KeyExists(name) + &&this->ElnoFields->GetKeyStatus(name)==status) + return; + + this->ElnoFields->SetKeyStatus(name, status); + + this->Modified(); +} + +void vtkMedReader::SetEntityStatus(const char* name, int status) +{ + if(this->Entities->KeyExists(name)&&this->Entities->GetKeyStatus(name) + ==status) + return; + + this->Entities->SetKeyStatus(name, status); + + this->Modified(); +} + +void vtkMedReader::SetFamilyStatus(const char* name, int status) +{ + if(this->Internal->Families->KeyExists(name) + &&this->Internal->Families->GetKeyStatus(name)==status) + return; + + this->Internal->Families->SetKeyStatus(name, status); +} + +void vtkMedReader::SetGroupStatus(const char* name, int status) +{ + + if(this->Groups->KeyExists(name)&&this->Groups->GetKeyStatus(name) + ==status) + return; + + this->Groups->SetKeyStatus(name, status); + + this->Modified(); + + this->Internal->GroupSelectionMTime.Modified(); +} + +int vtkMedReader::GetGroupStatus(const char* key) +{ + return this->Groups->GetKeyStatus(key); +} + +void vtkMedReader::AddQuadratureSchemeDefinition(vtkInformation* info, + vtkMedLocalization* loc) +{ + if(info==NULL||loc==NULL) + return; + + vtkInformationQuadratureSchemeDefinitionVectorKey *key= + vtkQuadratureSchemeDefinition::DICTIONARY(); + + vtkQuadratureSchemeDefinition* def=vtkQuadratureSchemeDefinition::New(); + int cellType=vtkMedUtilities::GetVTKCellType(loc->GetGeometryType()); + def->Initialize(cellType, vtkMedUtilities::GetNumberOfPoint( + loc->GetGeometryType()), loc->GetNumberOfQuadraturePoint(), + (double*)loc->GetShapeFunction()->GetVoidPointer(0), + (double*)loc->GetWeights()->GetVoidPointer(0)); + key->Set(info, def, cellType); + def->Delete(); + +} + +void vtkMedReader::LoadConnectivity(vtkMedEntityArray* array) +{ + vtkMedGrid* grid = array->GetParentGrid(); + array->LoadConnectivity(); + if (array->GetConnectivity()==MED_NODAL||vtkMedUtilities::GetDimension( + array->GetEntity().GeometryType)<2 + || grid->GetParentMesh()->GetMeshType() == MED_STRUCTURED_MESH) + return; + + vtkMedEntity subentity; + subentity.EntityType = vtkMedUtilities::GetSubType(array->GetEntity().EntityType); + + vtkMedUnstructuredGrid* ugrid = vtkMedUnstructuredGrid::SafeDownCast(grid); + if(ugrid == NULL) + return; + + for(int index=0; indexGetEntity().GeometryType); index++) + { + subentity.GeometryType = vtkMedUtilities::GetSubGeometry( + array->GetEntity().GeometryType, index); + vtkMedEntityArray* subarray=ugrid->GetEntityArray(subentity); + + if(subarray==NULL) + { + vtkErrorMacro("DESC connectivity used, but sub types do not exist in file."); + return; + } + subarray->LoadConnectivity(); + } +} + +vtkDataSet* vtkMedReader::CreateUnstructuredGridForPointSupport( + vtkMedFamilyOnEntityOnProfile* foep) +{ + vtkUnstructuredGrid* vtkgrid = vtkUnstructuredGrid::New(); + foep->ComputeIntersection(NULL); + vtkMedFamilyOnEntity* foe = foep->GetFamilyOnEntity(); + vtkMedGrid* medgrid=foe->GetParentGrid(); + vtkMedUnstructuredGrid* medugrid=vtkMedUnstructuredGrid::SafeDownCast( + medgrid); + vtkMedCurvilinearGrid* medcgrid=vtkMedCurvilinearGrid::SafeDownCast( + medgrid); + + medgrid->LoadCoordinates(); + + vtkIdType npts=medgrid->GetNumberOfPoints(); + + bool shallowCopy= (medugrid != NULL || medcgrid!=NULL); + if(medgrid->GetParentMesh()->GetSpaceDimension()!=3) + { + shallowCopy=false; + } + else + { + shallowCopy = foep->CanShallowCopyPointField(NULL); + } + + vtkDataArray* coords = NULL; + + if(medugrid != NULL) + coords = medugrid->GetCoordinates(); + if(medcgrid != NULL) + coords = medcgrid->GetCoordinates(); + + + vtkIdType numberOfPoints; + vtkPoints* points=vtkPoints::New(coords->GetDataType()); + vtkgrid->SetPoints(points); + points->Delete(); + + vtkIdTypeArray* pointGlobalIds=vtkIdTypeArray::New(); + pointGlobalIds->SetName("MED_POINT_ID"); + pointGlobalIds->SetNumberOfComponents(1); + vtkgrid->GetPointData()->SetGlobalIds(pointGlobalIds); + pointGlobalIds->Delete(); + + if (shallowCopy) + { + vtkgrid->GetPoints()->SetData(coords); + numberOfPoints=npts; + + pointGlobalIds->SetNumberOfTuples(numberOfPoints); + vtkIdType* ptr=pointGlobalIds->GetPointer(0); + for(int pid=0; pidGetNumberOfPoints(); index++) + { + if (!foep->KeepPoint(index)) + { + continue; + } + + double coord[3]={0.0, 0.0, 0.0}; + double * tuple=medgrid->GetCoordTuple(index); + for(int dim=0; dimGetParentMesh()->GetSpaceDimension()&&dim<3; dim++) + { + coord[dim]=tuple[dim]; + } + vtkgrid->GetPoints()->InsertPoint(currentIndex, coord); + pointGlobalIds->InsertNextValue(index+1); + currentIndex++; + } + vtkgrid->GetPoints()->Squeeze(); + pointGlobalIds->Squeeze(); + numberOfPoints=currentIndex; + } + + // now create the VTK_VERTEX cells + for(vtkIdType id=0; idInsertNextCell(VTK_VERTEX, 1, &id); + } + vtkgrid->Squeeze(); + + // in this particular case, the global ids of the cells is the same as the global ids of the points. + vtkgrid->GetCellData()->SetGlobalIds(vtkgrid->GetPointData()->GetGlobalIds()); + + return vtkgrid; +} + +vtkMedGrid* vtkMedReader::FindGridStep(vtkMedMesh* mesh) +{ + if(this->Internal->RealAnimationMode == vtkMedReader::PhysicalTime) + { + vtkMedComputeStep cs; + cs.TimeOrFrequency = this->Internal->UpdateTimeStep; + return mesh->FindGridStep(cs, vtkMedReader::PhysicalTime); + } + else if(this->Internal->RealAnimationMode == vtkMedReader::Modes) + { + vtkMedComputeStep cs; + cs.IterationIt = MED_NO_IT; + cs.TimeIt = MED_NO_DT; + cs.TimeOrFrequency = MED_NO_DT; + return mesh->FindGridStep(cs, vtkMedReader::Modes); + } + else // Iterations + { + vtkMedComputeStep cs; + // the time is set by choosing its index in the global + // array giving the available times : this->TimeIndexForIterations + cs.TimeOrFrequency = (med_int)this->AvailableTimes->GetValue( + (vtkIdType)this->TimeIndexForIterations); + // the iteration is asked by the pipeline + cs.IterationIt = (med_int)this->Internal->UpdateTimeStep; + return mesh->FindGridStep(cs, vtkMedReader::Iteration); + } + return NULL; +} + +void vtkMedReader::CreateMedSupports() +{ + this->Internal->UsedSupports.clear(); + + std::map >::iterator + meshfileit = this->Internal->MedFiles.begin(); + while(meshfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = meshfileit->second; + meshfileit++; + + for(int meshIndex=0; meshIndexGetNumberOfMesh(); meshIndex++) + { + vtkMedMesh* mesh = file->GetMesh(meshIndex); + vtkMedGrid* grid = this->FindGridStep(mesh); + if(grid == NULL) + continue; + + for(int entityIndex=0; entityIndexGetNumberOfEntityArray(); + entityIndex++) + { + vtkMedEntityArray* array=grid->GetEntityArray(entityIndex); + if(this->GetEntityStatus(array->GetEntity())==0) + { + continue; + } + + file->GetMedDriver()->LoadFamilyIds(array); + for(int foeIndex=0; foeIndexGetNumberOfFamilyOnEntity(); + foeIndex++) + { + vtkMedFamilyOnEntity* foe=array->GetFamilyOnEntity(foeIndex); + vtkMedFamily* family=foe->GetFamily(); + if(this->GetFamilyStatus(mesh, family)==0) + continue; + + // now, I look over all non-point fields to see which profiles + // have to be used on points. + bool selectedSupport = false; + + std::map >::iterator + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* fieldfile = fieldfileit->second; + fieldfileit++; + + for(int fieldId=0; fieldIdGetNumberOfField(); fieldId++) + { + vtkMedField* field=fieldfile->GetField(fieldId); + + if (!this->IsFieldSelected(field)) + continue; + + vtkMedListOfFieldSteps steps; + + this->GatherFieldSteps(field, steps); + + vtkMedListOfFieldSteps::iterator it=steps.begin(); + while(it!=steps.end()) + { + vtkMedFieldStep *step = *it; + step->LoadInformation(); + it++; + + for(int eid=0; eidGetNumberOfFieldOverEntity(); eid++) + { + vtkMedFieldOverEntity* fieldOverEntity = + step->GetFieldOverEntity(eid); + + for(int pid = 0; pid < fieldOverEntity->GetNumberOfFieldOnProfile(); pid++) + { + vtkMedFieldOnProfile* fop = + fieldOverEntity->GetFieldOnProfile(pid); + vtkMedProfile* prof = fop->GetProfile(); + vtkMedFamilyOnEntityOnProfile* foep = + foe->GetFamilyOnEntityOnProfile(prof); + if(foep != NULL) + { + this->Internal->UsedSupports.insert(foep); + selectedSupport = true; + } + } + } + } + } + } + // If no field use this family on entity, I nevertheless create the + // support, with an empty profile. + if(!selectedSupport) + { + vtkMedFamilyOnEntityOnProfile* foep = + foe->GetFamilyOnEntityOnProfile((vtkMedProfile*)NULL); + if(foep == NULL) + { + foep = vtkMedFamilyOnEntityOnProfile::New(); + foep->SetFamilyOnEntity(foe); + foep->SetProfile(NULL); + foe->AddFamilyOnEntityOnProfile(foep); + foep->Delete(); + } + this->Internal->UsedSupports.insert(foep); + } + } + } + } + } +} + +bool vtkMedReader::BuildVTKSupport( + vtkMedFamilyOnEntityOnProfile* foep, + int doBuildSupport) +{ + + vtkMedFamilyOnEntity* foe = foep->GetFamilyOnEntity(); + + int numProc = 1; + vtkMultiProcessController* controller = vtkMultiProcessController::GetGlobalController(); + if (controller != NULL) + { + numProc = controller->GetNumberOfProcesses(); + } + + if ((foep->GetValid() == 0) && numProc == 1) + { + return false; + } + + vtkMedGrid* grid=foe->GetParentGrid(); + + vtkMedEntityArray* array=foe->GetEntityArray(); + vtkMedMesh* mesh=grid->GetParentMesh(); + vtkSmartPointer path = vtkSmartPointer::New(); + string meshName=vtkMedUtilities::SimplifyName(mesh->GetName()); + path->InsertNextValue(meshName); + std::string finalName; + + if(foe->GetPointOrCell()==vtkMedUtilities::OnPoint) + { + path->InsertNextValue(vtkMedUtilities::OnPointName); + finalName=vtkMedUtilities::SimplifyName(foe->GetFamily()->GetName()); + } + else + { + path->InsertNextValue(vtkMedUtilities::OnCellName); + path->InsertNextValue(vtkMedUtilities::SimplifyName(foe->GetFamily()->GetName())); + finalName=vtkMedUtilities::EntityKey(array->GetEntity()); + } + + if(foep->GetProfile() != NULL) + { + path->InsertNextValue(finalName); + finalName = foep->GetProfile()->GetName(); + } + + ostringstream progressBarTxt; + for(int depth=0; depthGetNumberOfValues(); depth++) + { + progressBarTxt<GetValue(depth)<<" "; + } + progressBarTxt<Internal->DataSetCache.find(foep)!=this->Internal->DataSetCache.end()) + { + cachedDataSet = this->Internal->DataSetCache[foep]; + } + else + { + vtkDataSet* dataset = NULL; + if(doBuildSupport) + { + if(foe->GetPointOrCell()==vtkMedUtilities::OnPoint) + { + dataset = this->CreateUnstructuredGridForPointSupport(foep); + } + else + { + dataset = foep->GetFamilyOnEntity()->GetParentGrid()-> + CreateVTKDataSet(foep); + } + } + + if(dataset == NULL) + { + return false; + } + + this->Internal->DataSetCache[foep]=dataset; + cachedDataSet = dataset; + if(dataset != NULL) + dataset->Delete(); + } + + vtkMultiBlockDataSet* root=vtkMedUtilities::GetParent(this->GetOutput(), path); + int nb=root->GetNumberOfBlocks(); + + if(cachedDataSet != NULL) + { + vtkDataSet* realDataSet=cachedDataSet->NewInstance(); + root->SetBlock(nb, realDataSet); + realDataSet->Delete(); + + root->GetMetaData(nb)->Set(vtkCompositeDataSet::NAME(), finalName.c_str()); + realDataSet->ShallowCopy(cachedDataSet); + + this->Internal->DataSetCache[foep]=cachedDataSet; + this->Internal->CurrentDataSet[foep]=realDataSet; + + path->InsertNextValue(finalName); + path->SetName("BLOCK_NAME"); + realDataSet->GetFieldData()->AddArray(path); + realDataSet->GetInformation()->Remove(vtkMedUtilities::BLOCK_NAME()); + for(int depth=0; depthGetNumberOfValues(); depth++) + { + realDataSet->GetInformation()->Set(vtkMedUtilities::BLOCK_NAME(), + path->GetValue(depth), depth); + } + } +} + +void vtkMedReader::MapFieldOnSupport(vtkMedFieldOnProfile* fop, + vtkMedFamilyOnEntityOnProfile* foep, + int doCreateField) +{ + bool cached = false; + + if(this->Internal->FieldCache.find(foep) + !=this->Internal->FieldCache.end()) + { + map& fieldCache = + this->Internal->FieldCache[foep]; + if(fieldCache.find(fop)!=fieldCache.end()) + { + cached=true; + } + } + + if(!cached) + { + this->CreateVTKFieldOnSupport(fop, foep, doCreateField); + } + this->SetVTKFieldOnSupport(fop, foep); +} + +void vtkMedReader::MapFieldsOnSupport(vtkMedFamilyOnEntityOnProfile* foep, + int doCreateField) +{ + // now loop over all fields to map it to the created grids + std::map >::iterator + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fieldfileit->second; + fieldfileit++; + + for(int fieldId=0; fieldIdGetNumberOfField(); fieldId++) + { + vtkMedField* field=file->GetField(fieldId); + + if(strcmp(foep->GetFamilyOnEntity()-> + GetParentGrid()->GetParentMesh()->GetName(), + field->GetMeshName()) != 0) + continue; + + if(strcmp(foep->GetFamilyOnEntity()-> + GetParentGrid()->GetParentMesh()->GetName(), + field->GetMeshName()) != 0) + continue; + + if (!this->IsFieldSelected(field)) + continue; + + vtkMedListOfFieldSteps steps; + + this->GatherFieldSteps(field, steps); + + vtkMedListOfFieldSteps::iterator it=steps.begin(); + while(it!=steps.end()) + { + vtkMedFieldStep *step = *it; + step->LoadInformation(); + it++; + + for(int eid=0; eidGetNumberOfFieldOverEntity(); eid++) + { + vtkMedFieldOverEntity* fieldOverEntity = step->GetFieldOverEntity(eid); + for(int pid = 0; pid < fieldOverEntity->GetNumberOfFieldOnProfile(); pid++) + { + vtkMedFieldOnProfile* fop = fieldOverEntity->GetFieldOnProfile(pid); + if(foep->CanMapField(fop)) + { + this->MapFieldOnSupport(fop, foep, doCreateField); + } + } + } + } + } + } +} + +void vtkMedReader::GatherFieldSteps(vtkMedField* field, + vtkMedListOfFieldSteps& steps) +{ + if(this->Internal->RealAnimationMode == vtkMedReader::PhysicalTime) + { + vtkMedComputeStep cs; + cs.TimeOrFrequency = this->Internal->UpdateTimeStep; + vtkMedFieldStep* fs = + field->FindFieldStep(cs, vtkMedReader::PhysicalTime); + if(fs != NULL) + steps.push_back(fs); + } + else if(this->Internal->RealAnimationMode == vtkMedReader::Iteration) + { + vtkMedComputeStep cs; + cs.IterationIt = (med_int)this->Internal->UpdateTimeStep; + cs.TimeOrFrequency = (med_int)this->AvailableTimes->GetValue( + (vtkIdType)this->TimeIndexForIterations); + vtkMedFieldStep* fs = + field->FindFieldStep(cs, vtkMedReader::Iteration); + if(fs != NULL) + steps.push_back(fs); + } + else // modes + { + for(int modeid = 0; modeid < this->Frequencies->GetNumberOfKey(); modeid++) + { + if(this->Frequencies->GetKeyStatus( + this->Frequencies->GetKey(modeid)) == 0) + { + continue; + } + + vtkMedComputeStep cs; + cs.TimeOrFrequency = this->AvailableTimes->GetValue(modeid); + vtkMedFieldStep* fs = + field->FindFieldStep(cs, vtkMedReader::PhysicalTime); + if(fs != NULL) + steps.push_back(fs); + } + } +} + +void vtkMedReader::SetVTKFieldOnSupport(vtkMedFieldOnProfile* fop, + vtkMedFamilyOnEntityOnProfile* foep) +{ + vtkMedFamilyOnEntity* foe = foep->GetFamilyOnEntity(); + vtkMedFieldOverEntity* fieldOverEntity = fop->GetParentFieldOverEntity(); + vtkMedFieldStep* step = fieldOverEntity->GetParentStep(); + vtkMedField* field = step->GetParentField(); + + const vtkMedComputeStep& cs = step->GetComputeStep(); + + vtkDataSet* ds=this->Internal->CurrentDataSet[foep]; + if (ds == NULL) + { + // ds == NULL could arrive is some cases when working in parallel + vtkWarningMacro( "--- vtkMedReader::SetVTKFieldOnSupport: ds is NULL !!"); + return; + } + + VTKField& vtkfield=this->Internal->FieldCache[foep][fop]; + + std::string name=vtkMedUtilities::SimplifyName(field->GetName()); + std::string vectorname = name+"_Vector"; + if(this->AnimationMode==Modes) + { + double freq = cs.TimeOrFrequency; + int index = this->GetFrequencyIndex(freq); + name += string(" ") + vtkMedUtilities::GetModeKey(index, freq, + this->AvailableTimes->GetNumberOfTuples()-1); + vectorname += string(" ") + vtkMedUtilities::GetModeKey(index, freq, + this->AvailableTimes->GetNumberOfTuples()-1); + } + + vtkfield.DataArray->SetName(name.c_str()); + vtkfield.DataArray->Squeeze(); + if(vtkfield.Vectors != NULL) + { + vtkfield.Vectors->SetName(vectorname.c_str()); + vtkfield.Vectors->Squeeze(); + } + if(vtkfield.QuadratureIndexArray!=NULL) + { + vtkfield.QuadratureIndexArray->Squeeze(); + } + + if(foe->GetPointOrCell()==vtkMedUtilities::OnCell) + { + if(field->GetFieldType()==vtkMedField::PointField) + { + if(vtkfield.DataArray->GetNumberOfTuples()!=ds->GetNumberOfPoints()) + { + vtkDebugMacro("the data array " << vtkfield.DataArray->GetName() + << " do not have the good number of tuples"); + return; + } + ds->GetPointData()->AddArray(vtkfield.DataArray); + if(vtkfield.Vectors != NULL && this->GenerateVectors) + { + ds->GetPointData()->AddArray(vtkfield.Vectors); + ds->GetPointData()->SetActiveVectors(vtkfield.Vectors->GetName()); + } + switch (vtkfield.DataArray->GetNumberOfComponents()) + { + case 1: + ds->GetPointData()->SetActiveScalars(vtkfield.DataArray->GetName()); + break; + case 3: + ds->GetPointData()->SetActiveVectors(vtkfield.DataArray->GetName()); + break; + } + // if the data set is only composed of VTK_VERTEX cells, + // and no field called with the same name exist on cells, + // map this field to cells too + if(foe->GetVertexOnly()==1 && ds->GetCellData()->GetArray( + vtkfield.DataArray->GetName())==NULL) + { + ds->GetCellData()->AddArray(vtkfield.DataArray); + if(vtkfield.Vectors != NULL && this->GenerateVectors) + { + ds->GetCellData()->AddArray(vtkfield.Vectors); + ds->GetCellData()->SetActiveVectors(vtkfield.Vectors->GetName()); + } + switch (vtkfield.DataArray->GetNumberOfComponents()) + { + case 1: + ds->GetCellData()->SetActiveScalars(vtkfield.DataArray->GetName()); + break; + case 3: + ds->GetCellData()->SetActiveVectors(vtkfield.DataArray->GetName()); + break; + } + } + } + if(field->GetFieldType()==vtkMedField::CellField) + { + if((this->Internal->NumberOfPieces == 1) && vtkfield.DataArray->GetNumberOfTuples()!=ds->GetNumberOfCells() ) + { + vtkDebugMacro("the data array " << vtkfield.DataArray->GetName() + << " do not have the good number of tuples" + << " ncell=" << ds->GetNumberOfCells() + << " ntuple=" << vtkfield.DataArray->GetNumberOfTuples()); + return; + } + // In case we are in parallel and our process does not contain the data + if(ds->GetNumberOfCells()==0) + { + return; + } + ds->GetCellData()->AddArray(vtkfield.DataArray); + + if(vtkfield.Vectors != NULL && this->GenerateVectors) + { + ds->GetCellData()->AddArray(vtkfield.Vectors); + ds->GetCellData()->SetActiveVectors(vtkfield.Vectors->GetName()); + } + switch (vtkfield.DataArray->GetNumberOfComponents()) + { + case 1: + ds->GetCellData()->SetActiveScalars(vtkfield.DataArray->GetName()); + break; + case 3: + ds->GetCellData()->SetActiveVectors(vtkfield.DataArray->GetName()); + break; + } + // if the data set is only composed of VTK_VERTEX cells, + // and no field called with the same name exist on points, + // map this field to points too + if(foe->GetVertexOnly()==1 && ds->GetPointData()->GetArray( + vtkfield.DataArray->GetName())==NULL) + { + ds->GetPointData()->AddArray(vtkfield.DataArray); + if(vtkfield.Vectors != NULL && this->GenerateVectors) + { + ds->GetPointData()->AddArray(vtkfield.Vectors); + ds->GetPointData()->SetActiveVectors(vtkfield.Vectors->GetName()); + } + switch (vtkfield.DataArray->GetNumberOfComponents()) + { + case 1: + ds->GetPointData()->SetActiveScalars(vtkfield.DataArray->GetName()); + break; + case 3: + ds->GetPointData()->SetActiveVectors(vtkfield.DataArray->GetName()); + break; + } + } + } + if(field->GetFieldType()==vtkMedField::QuadratureField || + field->GetFieldType()==vtkMedField::ElnoField ) + { + vtkIdType ncells=ds->GetNumberOfCells(); + vtkIdType nid=vtkfield.QuadratureIndexArray->GetNumberOfTuples(); + vtkIdType nda=vtkfield.DataArray->GetNumberOfTuples(); + if((nid!=ncells) && (this->Internal->NumberOfPieces == 1)) + { + vtkDebugMacro( + "There should be as many quadrature index values as there are cells"); + return; + } + else + { + if (ncells == 0) + { + vtkfield.DataArray->SetNumberOfTuples( 0 ); + vtkfield.DataArray->Squeeze(); + } + if (nid>ncells) // PROBABLY NOT NECESSARY + { + vtkfield.QuadratureIndexArray->SetNumberOfTuples(ncells); + int nquad=fop->GetNumberOfIntegrationPoint(); + vtkfield.DataArray->SetNumberOfTuples( nquad * ds->GetNumberOfCells() ); + vtkfield.DataArray->Squeeze(); + } + ds->GetFieldData()->AddArray(vtkfield.DataArray); + ds->GetCellData()->AddArray(vtkfield.QuadratureIndexArray); + + nid=vtkfield.QuadratureIndexArray->GetNumberOfTuples(); + nda=vtkfield.DataArray->GetNumberOfTuples(); + + if(vtkfield.Vectors != NULL && this->GenerateVectors) + { + ds->GetFieldData()->AddArray(vtkfield.Vectors); + } + } + } + }//support OnCell + else + {//support OnPoint + if(vtkfield.DataArray->GetNumberOfTuples()!=ds->GetNumberOfPoints()) + { + vtkDebugMacro("the data array " << vtkfield.DataArray->GetName() << " do not have the good number of tuples"); + return; + } + ds->GetPointData()->AddArray(vtkfield.DataArray); + if(vtkfield.Vectors != NULL && this->GenerateVectors) + { + ds->GetPointData()->AddArray(vtkfield.Vectors); + ds->GetPointData()->SetActiveVectors(vtkfield.Vectors->GetName()); + } + switch (vtkfield.DataArray->GetNumberOfComponents()) + { + case 1: + ds->GetPointData()->SetActiveScalars(vtkfield.DataArray->GetName()); + break; + case 3: + ds->GetPointData()->SetActiveVectors(vtkfield.DataArray->GetName()); + break; + } + // all the VTK_VERTEX created cells have the same order than the points, + // I can safely map the point array to the cells in this particular case. + ds->GetCellData()->AddArray(vtkfield.DataArray); + if(vtkfield.Vectors != NULL && this->GenerateVectors) + { + ds->GetCellData()->AddArray(vtkfield.Vectors); + ds->GetCellData()->SetActiveVectors(vtkfield.Vectors->GetName()); + } + switch (vtkfield.DataArray->GetNumberOfComponents()) + { + case 1: + ds->GetCellData()->SetActiveScalars(vtkfield.DataArray->GetName()); + break; + case 3: + ds->GetCellData()->SetActiveVectors(vtkfield.DataArray->GetName()); + break; + } + } +} + +void vtkMedReader::InitializeQuadratureOffsets(vtkMedFieldOnProfile* fop, + vtkMedFamilyOnEntityOnProfile* foep) +{ + vtkMedFamilyOnEntity* foe = foep->GetFamilyOnEntity(); + + vtkMedFieldOverEntity* fieldOverEntity = fop->GetParentFieldOverEntity(); + vtkMedFieldStep* step = fieldOverEntity->GetParentStep(); + vtkMedField *field= step->GetParentField(); + + // then I compute the quadrature key if needed, and try to find the quadrature offsets. + if(this->Internal->QuadratureOffsetCache.find(foep) + ==this->Internal->QuadratureOffsetCache.end()) + this->Internal->QuadratureOffsetCache[foep]=map > (); + + map >& quadOffsets= + this->Internal->QuadratureOffsetCache[foep]; + + LocalizationKey quadkey=this->GetLocalizationKey(fop); + + if(quadOffsets.find(quadkey)!=quadOffsets.end()) + {// the quadrature offset array has already been created + return; + } + + vtkIdTypeArray* qoffsets=vtkIdTypeArray::New(); + quadOffsets[quadkey]=qoffsets; + qoffsets->Delete(); + + ostringstream sstr; + if(field->GetFieldType() == vtkMedField::ElnoField) + { + qoffsets->GetInformation()->Set(vtkMedUtilities::ELNO(), 1); + sstr<<"ELNO"; + } + else if(field->GetFieldType() == vtkMedField::QuadratureField) + { + qoffsets->GetInformation()->Set(vtkMedUtilities::ELGA(), 1); + sstr<<"ELGA"; + } + else + { + sstr<<"QuadraturePointOffset"; + } + + qoffsets->SetName(sstr.str().c_str()); + + vtkSmartPointer loc= + this->GetLocalization(fop->GetLocalizationName()); + + if(loc == NULL) + { + if(fop->GetNumberOfIntegrationPoint()==1) + {// cell-centered fields can be seen as quadrature fields with 1 + // quadrature point at the center + vtkMedLocalization* center=vtkMedLocalization::New(); + loc=center; + center->Delete(); + center->BuildCenter(fieldOverEntity->GetEntity().GeometryType); + } + else if(loc == NULL && field->GetFieldType() == vtkMedField::ElnoField) + {// ELNO fields have no vtkMedLocalization, + // I need to create a dummy one + vtkMedLocalization* elnodef=vtkMedLocalization::New(); + loc=elnodef; + elnodef->Delete(); + elnodef->BuildELNO(fieldOverEntity->GetEntity().GeometryType); + } + else + { + vtkErrorMacro("Cannot find localization of quadrature field " + << field->GetName()); + } + } + this->AddQuadratureSchemeDefinition(qoffsets->GetInformation(), loc); +} + +void vtkMedReader::CreateVTKFieldOnSupport(vtkMedFieldOnProfile* fop, + vtkMedFamilyOnEntityOnProfile* foep, int doCreateField) +{ + vtkMedFamilyOnEntity* foe = foep->GetFamilyOnEntity(); + vtkMedFieldOverEntity* fieldOverEntity = fop->GetParentFieldOverEntity(); + vtkMedFieldStep* step = fieldOverEntity->GetParentStep(); + vtkMedField* field = step->GetParentField(); + + if(vtkMedUnstructuredGrid::SafeDownCast( + foep->GetFamilyOnEntity()->GetParentGrid()) != NULL) + { + fop->Load(MED_COMPACT_STMODE); + } + else + { + fop->Load(MED_GLOBAL_STMODE); + } + + vtkMedIntArray* profids=NULL; + + vtkMedProfile* profile=fop->GetProfile(); + + if(profile) + { + profile->Load(); + profids=profile->GetIds(); + }//has profile + + VTKField& vtkfield=this->Internal->FieldCache[foep][fop]; + + bool shallowok = true; + + // for structured grid, the values are loaded globally, and cells which are + // not on the profile or not on the family are blanked out. + // shallow copy is therefore always possible + if(vtkMedUnstructuredGrid::SafeDownCast( + foep->GetFamilyOnEntity()->GetParentGrid()) != NULL) + { + shallowok = foep->CanShallowCopy(fop); + } + + if(shallowok) + { + vtkfield.DataArray = fop->GetData(); + } + else + { + vtkDataArray* data=vtkMedUtilities::NewArray(field->GetDataType()); + vtkfield.DataArray=data; + data->Delete(); + vtkfield.DataArray->SetNumberOfComponents(field->GetNumberOfComponent()); + } + + for(int comp=0; compGetNumberOfComponent(); comp++) + { + vtkfield.DataArray->SetComponentName(comp, vtkMedUtilities::SimplifyName( + field->GetComponentName()->GetValue(comp)).c_str()); + } + + bool createOffsets=false; + if(field->GetFieldType()==vtkMedField::QuadratureField || + field->GetFieldType()==vtkMedField::ElnoField ) + { + this->InitializeQuadratureOffsets(fop, foep); + + LocalizationKey quadKey = this->GetLocalizationKey(fop); + vtkfield.QuadratureIndexArray + =this->Internal->QuadratureOffsetCache[foep][quadKey]; + vtkDataSet* ds = this->Internal->CurrentDataSet[foep]; + + vtkfield.DataArray->GetInformation()->Set( + vtkQuadratureSchemeDefinition::QUADRATURE_OFFSET_ARRAY_NAME(), + vtkfield.QuadratureIndexArray->GetName()); + vtkfield.QuadratureIndexArray->GetInformation()->Set( + vtkAbstractArray::GUI_HIDE(), 1); + + if(vtkfield.QuadratureIndexArray->GetNumberOfTuples() + !=ds->GetNumberOfCells()) + { + vtkfield.QuadratureIndexArray->SetNumberOfTuples(0); + createOffsets=true; + } + } + + if(!doCreateField) + return; + + if(shallowok) + { + // build the quadrature offset array if needed + if(createOffsets) + { + vtkIdType noffsets; + int nquad=fop->GetNumberOfIntegrationPoint(); + noffsets=fop->GetData()->GetNumberOfTuples()/nquad; + + vtkDataSet* ds=this->Internal->CurrentDataSet[foep]; + if(noffsets!=ds->GetNumberOfCells()) + { + vtkErrorMacro( + "number of quadrature offsets (" << noffsets << ") must " + << "match the number of cells (" << ds->GetNumberOfCells() << ")!"); + } + + vtkfield.QuadratureIndexArray->SetNumberOfTuples(noffsets); + for(vtkIdType id=0; idSetValue(id, nquad*id); + } + } + + } + else if(foe->GetPointOrCell() == vtkMedUtilities::OnCell + && field->GetFieldType() != vtkMedField::PointField) + { + // Cell-centered field on cell support + int nquad = 1; + if (field->GetFieldType()==vtkMedField::QuadratureField || + field->GetFieldType()==vtkMedField::ElnoField) + { + nquad=fop->GetNumberOfIntegrationPoint(); + } + vtkMedIntArray* profids=NULL; + if (profile) + { + profids=profile->GetIds(); + } + vtkIdType maxIndex=fop->GetData()->GetNumberOfTuples(); + maxIndex/=nquad; + vtkIdType quadIndex = 0; + + for (vtkIdType id = 0; idGetValue(id)-1 : id); + if (!foep->KeepCell(realIndex)) + continue; + + if (field->GetFieldType()==vtkMedField::QuadratureField || + field->GetFieldType()==vtkMedField::ElnoField) + { + for (int q = 0; qInsertNextTuple(nquad*realIndex+q, + fop->GetData()); + } + if (createOffsets) + { + vtkfield.QuadratureIndexArray->InsertNextValue(quadIndex); + quadIndex+=nquad; + } + } + else + { + vtkfield.DataArray->InsertNextTuple(id, fop->GetData()); + } + }//copy all tuples + vtkfield.DataArray->Squeeze(); + vtkDataSet* ds = this->Internal->CurrentDataSet[foep]; + } + else if(foe->GetPointOrCell() == vtkMedUtilities::OnCell + && field->GetFieldType() == vtkMedField::PointField) + {// point field on cell support + vtkMedIntArray* profids=NULL; + + vtkMedProfile* profile=fop->GetProfile(); + + if(profile) + { + profile->Load(); + + profids=profile->GetIds(); + }//has profile + + vtkIdType maxId=fop->GetData()->GetNumberOfTuples(); + + for(vtkIdType id=0; idGetValue(id)-1; // -1 because med indices start at 1 + } + else + { + destIndex=id; + } + + if(!foep->KeepPoint(destIndex)) + continue; + // if I use the med2VTKIndex, then the index to insert + // this value is given by the map. + destIndex = foep->GetVTKPointIndex(destIndex); + vtkfield.DataArray->InsertTuple(destIndex, id, fop->GetData()); + } + vtkfield.DataArray->Squeeze(); + }// point field on cell support + else if(foe->GetPointOrCell() == vtkMedUtilities::OnPoint && + field->GetFieldType() == vtkMedField::PointField) + {//support OnPoint + + vtkIdType maxId = fop->GetData()->GetNumberOfTuples(); + + for(vtkIdType id=0; idGetValue(id)-1; // -1 because med indices start at 1 + } + + if(!foep->KeepPoint(realIndex)) + continue; + + vtkfield.DataArray->InsertNextTuple(fop->GetData()->GetTuple(id)); + } + vtkfield.DataArray->Squeeze(); + }// support on point + + // now generate the vector field if asked for + if(this->GenerateVectors) + { + int ncomp = vtkfield.DataArray->GetNumberOfComponents(); + if(ncomp > 1 && ncomp != 3) + { + vtkDataArray* vectors = vtkfield.DataArray->NewInstance(); + vectors->SetNumberOfComponents(3); + vectors->SetNumberOfTuples(vtkfield.DataArray->GetNumberOfTuples()); + vtkfield.Vectors = vectors; + vectors->Delete(); + + vectors->CopyInformation(vtkfield.DataArray->GetInformation()); + + if(ncomp < 3) + vectors->SetComponentName(2, "Z"); + else + vectors->SetComponentName(2, vtkfield.DataArray->GetComponentName(2)); + + vectors->SetComponentName(1, vtkfield.DataArray->GetComponentName(1)); + vectors->SetComponentName(0, vtkfield.DataArray->GetComponentName(0)); + + int tuplesize = (ncomp > 3? ncomp: 3); + double* tuple = new double[tuplesize]; + for(int tid=0; tidGetNumberOfTuples(); id++) + { + vtkfield.DataArray->GetTuple(id, tuple); + vectors->SetTuple(id, tuple); + } + } + } +} + +int vtkMedReader::HasMeshAnyCellSelectedFamily(vtkMedMesh* mesh) +{ + int nfam = mesh->GetNumberOfCellFamily(); + for (int famid = 0; famidGetFamily(famid); + if (fam->GetPointOrCell()!=vtkMedUtilities::OnCell||!this->GetFamilyStatus( + mesh, fam)) + continue; + return true; + } + return false; +} + +int vtkMedReader::HasMeshAnyPointSelectedFamily(vtkMedMesh* mesh) +{ + int nfam = mesh->GetNumberOfCellFamily(); + for (int famid = 0; famidGetFamily(famid); + if (fam->GetPointOrCell()!=vtkMedUtilities::OnPoint + ||!this->GetFamilyStatus(mesh, fam)) + continue; + return true; + } + return false; +} + +void vtkMedReader::BuildSIL(vtkMutableDirectedGraph* sil) +{ + if(sil==NULL) + return; + + sil->Initialize(); + + vtkSmartPointer childEdge= + vtkSmartPointer::New(); + childEdge->InsertNextValue(0); + + vtkSmartPointer crossEdge= + vtkSmartPointer::New(); + crossEdge->InsertNextValue(1); + + // CrossEdge is an edge linking hierarchies. + vtkUnsignedCharArray* crossEdgesArray=vtkUnsignedCharArray::New(); + crossEdgesArray->SetName("CrossEdges"); + sil->GetEdgeData()->AddArray(crossEdgesArray); + crossEdgesArray->Delete(); + vtkstd::deque names; + + // Now build the hierarchy. + vtkIdType rootId=sil->AddVertex(); + names.push_back("SIL"); + + // Add a global entry to encode global names for the families + vtkIdType globalFamilyRoot=sil->AddChild(rootId, childEdge); + names.push_back("Families"); + + // Add a global entry to encode global names for the families + vtkIdType globalGroupRoot=sil->AddChild(rootId, childEdge); + names.push_back("Groups"); + + // Add the groups subtree + vtkIdType groupsRoot=sil->AddChild(rootId, childEdge); + names.push_back("GroupTree"); + + // Add a global entry to encode names for the cell types + vtkIdType globalEntityRoot=sil->AddChild(rootId, childEdge); + names.push_back("Entity"); + + // Add the cell types subtree + vtkIdType entityTypesRoot=sil->AddChild(rootId, childEdge); + names.push_back("EntityTree"); + + // this is the map that keep added cell types + map entityMap; + map typeMap; + + std::map >::iterator + meshfileit = this->Internal->MedFiles.begin(); + while(meshfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = meshfileit->second; + meshfileit++; + + int numMeshes=file->GetNumberOfMesh(); + for(int meshIndex=0; meshIndexGetMesh(meshIndex); + vtkMedGrid* grid = this->FindGridStep(mesh); + + if(grid == NULL) + continue; + + // add all entities + for(int entityIndex=0; entityIndexGetNumberOfEntityArray(); entityIndex++) + { + vtkMedEntityArray* array=grid->GetEntityArray(entityIndex); + vtkMedEntity entity = array->GetEntity(); + + if(entityMap.find(entity)==entityMap.end()) + { + vtkIdType entityGlobalId=sil->AddChild(globalEntityRoot, childEdge); + names.push_back(vtkMedUtilities::EntityKey(entity)); + + vtkIdType typeId; + if(typeMap.find(entity.EntityType)==typeMap.end()) + { + typeId=sil->AddChild(entityTypesRoot, childEdge); + names.push_back(vtkMedUtilities::EntityName(entity.EntityType)); + typeMap[entity.EntityType]=typeId; + } + else + { + typeId=typeMap[entity.EntityType]; + } + vtkIdType entityId=sil->AddChild(typeId, childEdge); + names.push_back(entity.GeometryName); + + sil->AddEdge(entityId, entityGlobalId, crossEdge); + + entityMap[entity]=entityId; + } + } + + vtkIdType meshGroup = sil->AddChild(groupsRoot, childEdge); + names.push_back(vtkMedUtilities::SimplifyName(mesh->GetName())); + + // add the two OnPoint and OnCell entries, for groups and for families + vtkIdType meshCellGroups = sil->AddChild(meshGroup, childEdge); + names.push_back(vtkMedUtilities::OnCellName); + + vtkIdType meshPointGroups = sil->AddChild(meshGroup, childEdge); + names.push_back(vtkMedUtilities::OnPointName); + + // this maps will keep all added groups on nodes/cells of this mesh + map nodeGroupMap; + map cellGroupMap; + + // add all families + for(int famIndex=0; famIndexGetNumberOfFamily(); famIndex++) + { + vtkMedFamily* family=mesh->GetFamily(famIndex); + + vtkIdType globalFamilyId = sil->AddChild(globalFamilyRoot, childEdge); + names.push_back(vtkMedUtilities::FamilyKey(mesh->GetName(), + family->GetPointOrCell(), + family->GetName())); + + // family with Id 0 is both on cell and on points, so add it to both + map & groupMap=(family->GetPointOrCell() + ==vtkMedUtilities::OnPoint? nodeGroupMap: cellGroupMap); + + vtkIdType groupRootId = + (family->GetPointOrCell()==vtkMedUtilities::OnPoint? + meshPointGroups : meshCellGroups); + + // add all the groups of this family + for(vtkIdType groupIndex=0; groupIndexGetNumberOfGroup(); + groupIndex++) + { + vtkMedGroup* group=family->GetGroup(groupIndex); + + vtkIdType familyGroupId = sil->AddChild(globalFamilyId, childEdge); + names.push_back(vtkMedUtilities::FamilyKey( + mesh->GetName(), family->GetPointOrCell(), + family->GetName())); + + vtkIdType groupGlobalId; + if(groupMap.find(group->GetName())==groupMap.end()) + { + vtkIdType groupLocalId; + groupLocalId=sil->AddChild(groupRootId, childEdge); + names.push_back(vtkMedUtilities::SimplifyName(group->GetName())); + + groupGlobalId=sil->AddChild(globalGroupRoot, childEdge); + names.push_back(vtkMedUtilities::GroupKey( + mesh->GetName(), family->GetPointOrCell(), + group->GetName())); + groupMap[group->GetName()]=groupGlobalId; + + sil->AddEdge(groupLocalId, groupGlobalId, crossEdge); + } + vtkIdType groupId = groupMap[group->GetName()]; + sil->AddEdge(familyGroupId, groupId, childEdge); + + }//groupIndex + }//famIndex + }//meshIndex + }// file iterator + + // This array is used to assign names to nodes. + vtkStringArray* namesArray=vtkStringArray::New(); + namesArray->SetName("Names"); + namesArray->SetNumberOfTuples(sil->GetNumberOfVertices()); + sil->GetVertexData()->AddArray(namesArray); + namesArray->Delete(); + vtkstd::deque::iterator iter; + vtkIdType cc; + for(cc=0, iter=names.begin(); iter!=names.end(); ++iter, ++cc) + { + namesArray->SetValue(cc, (*iter).c_str()); + } +} + +void vtkMedReader::ClearMedSupports() +{ + this->Internal->DataSetCache.clear(); + //this->Internal->Med2VTKPointIndex.clear(); + + std::map >::iterator + meshfileit = this->Internal->MedFiles.begin(); + while(meshfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = meshfileit->second; + meshfileit++; + int numMeshes=file->GetNumberOfMesh(); + for(int meshIndex=0; meshIndexGetMesh(meshIndex); + mesh->ClearMedSupports(); + } + + int numProf = file->GetNumberOfProfile(); + for (int prof = 0; profGetProfile(prof); + if (profile->GetIds()!=NULL) + profile->GetIds()->Initialize(); + } + } +} + +void vtkMedReader::ClearMedFields() +{ + this->Internal->FieldCache.clear(); + this->Internal->QuadOffsetKey.clear(); + this->Internal->QuadratureOffsetCache.clear(); + + std::map >::iterator + fieldfileit = this->Internal->MedFiles.begin(); + while(fieldfileit != this->Internal->MedFiles.end()) + { + vtkMedFile* file = fieldfileit->second; + fieldfileit++; + + int numFields=file->GetNumberOfField(); + for(int ff=0; ffGetField(ff); + int nstep=field->GetNumberOfFieldStep(); + for(int sid=0; sidGetFieldStep(sid); + for(int id=0; idGetNumberOfFieldOverEntity(); id++) + { + vtkMedFieldOverEntity * fieldOverEntity=step->GetFieldOverEntity(id); + for(int pid = 0; pid < fieldOverEntity->GetNumberOfFieldOnProfile(); pid++) + { + vtkMedFieldOnProfile* fop = fieldOverEntity->GetFieldOnProfile(pid); + if(fop->GetData() != NULL) + fop->SetData(NULL); + } + } + } + } + } +} + +void vtkMedReader::ClearCaches(int when) +{ + switch(when) + { + case Initialize: + this->Internal->CurrentDataSet.clear(); + this->Internal->DataSetCache.clear(); + this->Internal->FieldCache.clear(); + this->Internal->UsedSupports.clear(); + this->Internal->QuadratureOffsetCache.clear(); + this->Internal->QuadOffsetKey.clear(); + //this->Internal->Med2VTKPointIndex.clear(); + break; + case StartRequest: + this->Internal->CurrentDataSet.clear(); + this->Internal->UsedSupports.clear(); + if(this->CacheStrategy==CacheNothing) + { + this->ClearMedSupports(); + this->ClearMedFields(); + } + else if(this->CacheStrategy==CacheGeometry) + { + this->ClearMedFields(); + } + break; + case AfterCreateMedSupports: + // TODO : clear the unused supports and associated cached datasets and fields + break; + case EndBuildVTKSupports: + break; + case EndRequest: + if(this->CacheStrategy==CacheNothing) + { + this->ClearMedSupports(); + this->ClearMedFields(); + } + else if(this->CacheStrategy==CacheGeometry && this->AnimationMode != Modes) + { + this->ClearMedFields(); + } + break; + } +} + +void vtkMedReader::PrintSelf(ostream& os, vtkIndent indent) +{ + PRINT_STRING(os, indent, FileName); + PRINT_IVAR(os, indent, AnimationMode); + PRINT_IVAR(os, indent, TimeIndexForIterations); + PRINT_OBJECT(os, indent, PointFields); + PRINT_OBJECT(os, indent, CellFields); + PRINT_OBJECT(os, indent, QuadratureFields); + PRINT_OBJECT(os, indent, ElnoFields); + PRINT_OBJECT(os, indent, Groups); + PRINT_OBJECT(os, indent, Entities); + PRINT_IVAR(os, indent, CacheStrategy); + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedReader.h b/src/Plugins/MedReader/IO/vtkMedReader.h new file mode 100644 index 00000000..a8998059 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedReader.h @@ -0,0 +1,393 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedReader_h_ +#define __vtkMedReader_h_ + +#include "vtkMultiBlockDataSetAlgorithm.h" +#include "vtkMedSetGet.h" +#include + +class vtkMedFile; +class vtkMedDriver; +class vtkMedSelection; +class vtkMedFieldOverEntity; +class vtkMedFieldStep; +class vtkMedField; +class vtkMedMesh; +class vtkMedFamily; +class vtkMedLocalization; +class vtkMedEntityArray; +class vtkMedFamilyOnEntity; +class vtkMedFamilyOnEntityOnProfile; +class vtkMedProfile; +class vtkMedComputeStep; +class vtkMedGrid; +class vtkMedFieldOnProfile; +class vtkMedListOfFieldSteps; +class vtkMedEntity; + +class vtkUnstructuredGrid; +class vtkUnsignedCharArray; +class vtkIdList; +class vtkDoubleArray; +class vtkFieldData; +class vtkInformationDataObjectKey; +class vtkMutableDirectedGraph; +class vtkDataSet; + +class VTK_EXPORT vtkMedReader: public vtkMultiBlockDataSetAlgorithm +{ +public: + static vtkMedReader* New(); + vtkTypeRevisionMacro(vtkMedReader, vtkMultiBlockDataSetAlgorithm); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Set the file name to read from + virtual void SetFileName(const char*); + vtkGetStringMacro(FileName) + + // Description: + // Is the given file a MED file? + virtual int CanReadFile(const char* fname); + + // Description: + // Get the file extensions for this format. + // Returns a string with a space separated list of extensions in + // the format .extension + virtual const char* + GetFileExtensions() + { + return ".med .rmed"; + } + + // Description: + // Return a descriptive name for the file format that might be + // useful in a GUI. + virtual const char* + GetDescriptiveName() + { + return "MED file (Modele d'Echange de Donnees)"; + } + + // Description: + // use these methods to enable/disable point arrays + virtual int GetPointFieldArrayStatus(const char* name); + virtual void SetPointFieldArrayStatus(const char* name, int status); + virtual int GetNumberOfPointFieldArrays(); + virtual const char* GetPointFieldArrayName(int); + + // Description: + // use these methods to enable/disable cell arrays + virtual int GetCellFieldArrayStatus(const char* name); + virtual void SetCellFieldArrayStatus(const char* name, int status); + virtual int GetNumberOfCellFieldArrays(); + virtual const char* GetCellFieldArrayName(int); + + // Description: + // use these methods to enable/disable quadrature arrays + virtual int GetQuadratureFieldArrayStatus(const char* name); + virtual void SetQuadratureFieldArrayStatus(const char* name, int status); + virtual int GetNumberOfQuadratureFieldArrays(); + virtual const char* GetQuadratureFieldArrayName(int); + + // Description: + // use these methods to enable/disable quadrature arrays + virtual int GetElnoFieldArrayStatus(const char* name); + virtual void SetElnoFieldArrayStatus(const char* name, int status); + virtual int GetNumberOfElnoFieldArrays(); + virtual const char* GetElnoFieldArrayName(int); + + // Description: + // use this method to enable/disable cell types + // the key is encoded with the vtkMedUtilities::EntityKey method + // which returns a string + // CELL_TYPE/MED_ENTITE_MAILLAGE/MED_GEOMETRIE_ELEMENT + virtual void SetEntityStatus(const char* key, int flag); + virtual int GetEntityStatus(const vtkMedEntity&); + + // Description: + // use this method to enable/disable a family support + // the key is formatted by the vtkMedUtilities::FamilyKey method which + // returns a string + // GROUP/MESH_NAME/OnPoint/FAMILY_NAME or MESH_NAME/OnCell/FAMILY_NAME + virtual void SetGroupStatus(const char* key, int flag); + virtual int GetGroupStatus(const char* key); + + // Description: + // the animation mode modify the way the reader answers time requests from + // the pipeline. + // Default (0) : this is PhysicalTime if there are times, or Iterations + // if there are only iterations + // PhysicalTime (1) : the reader aggregates all physical times available + // in the file. + // for a given time t, the reader will return for each field the + // ComputeStep with the highest time inferior + // to t, and with the highest iteration. + // Iteration (2) : you need to also set the TimeIndexForIterations field. + // In this case, the reader will understand + // time requests has a request to iterate over iterations for the given time. + // Modes (3) : the reader will output the selected fields at all selected + // frequencies, and will output a fake TimeRange of -PI/+PI. + // Use the *FrequencyArray* interface to select them. + //BTX + enum eAnimationMode + { + Default=0, PhysicalTime=1, Iteration=2, Modes=3 + }; + //ETX + vtkSetMacro(AnimationMode, int); + vtkGetMacro(AnimationMode, int); + + // Description: + // in med files, the ComputeSteps are defined by a + // pair . + // the TimeIndexForIterations ivar is used only if the TimeMode is + // Iteration. + // it fixes the PhysicalTime index when iterating over iterations : only + // iterations with the corresponding physical time will be iterated over. + // The index given here is an index into the AvailableTimes array + // that is returned be the GetAvailableTimes Method. + vtkSetMacro(TimeIndexForIterations, double); + vtkGetMacro(TimeIndexForIterations, double); + + // Description: + // use these methods to enable/disable a given frequency for modal analysis + virtual int GetFrequencyArrayStatus(const char* name); + virtual void SetFrequencyArrayStatus(const char* name, int status); + virtual int GetNumberOfFrequencyArrays(); + virtual const char* GetFrequencyArrayName(int); + + // Description: + // returns the available physical times. Use this to get the times when in + // iteration mode. + virtual vtkDoubleArray* GetAvailableTimes(); + + // Description: + // Build the graph used to pass information to the client on the supports + virtual void BuildSIL(vtkMutableDirectedGraph*); + + // Description: + // Every time the SIL is updated a this will return a different value. + virtual int GetSILUpdateStamp(); + + // Description: + // reset the selection arrays without having to rebuild the SIL. + virtual void ClearSelections(); + + // Description: + // The CacheStrategy indicates to the reader if it + // should cache some of the arrays. + //BTX + enum eCacheStrategy + { + CacheNothing, CacheGeometry, CacheGeometryAndFields + }; + //ETX + vtkSetMacro(CacheStrategy, int) + vtkGetMacro(CacheStrategy, int) + + // Description : + // release arrays read from MED (point coordinates, profile ids, family ids) + void ClearMedSupports(); + + // Description : + // release arrays read from MED (fields) + void ClearMedFields(); + + // Description: + // If this flag is set, the reader will output a vector field for each + // field in the file that has 2 or more components by extracting the + // first 3 compoenents + vtkSetMacro(GenerateVectors, int); + vtkGetMacro(GenerateVectors, int); + +protected: + vtkMedReader(); + virtual ~vtkMedReader(); + + // Description: + // This is called by the superclass. + virtual int RequestDataObject(vtkInformation*, vtkInformationVector**, + vtkInformationVector*); + + // Description: + // This is called by the superclass. + virtual int RequestInformation(vtkInformation*, vtkInformationVector**, + vtkInformationVector*); + + // Description: + // This is called by the superclass. + virtual int RequestData(vtkInformation*, vtkInformationVector**, + vtkInformationVector*); + + // Description: + // Gather all compute steps in the fields + virtual void GatherComputeSteps(); + + // Description: + // Give the animation steps to the pipeline + virtual void AdvertiseTime(vtkInformation*); + + // Description: + // returns 1 if at least one the families of this mesh is selected, + // 0 otherwise. + virtual int IsMeshSelected(vtkMedMesh*); + + // Description: + // returns if the field is selected. + virtual int IsFieldSelected(vtkMedField*); + virtual int IsPointFieldSelected(vtkMedField*); + virtual int IsCellFieldSelected(vtkMedField*); + virtual int IsQuadratureFieldSelected(vtkMedField*); + virtual int IsElnoFieldSelected(vtkMedField*); + + virtual void AddQuadratureSchemeDefinition(vtkInformation*, + vtkMedLocalization*); + + //BTX + enum + { + Initialize, + StartRequest, + AfterCreateMedSupports, + EndBuildVTKSupports, + EndRequest + }; + //ETX + virtual void ClearCaches(int when); + + virtual void CreateMedSupports(); + + virtual bool BuildVTKSupport(vtkMedFamilyOnEntityOnProfile*, + int doBuildSupport); + + virtual void MapFieldsOnSupport(vtkMedFamilyOnEntityOnProfile* foe, + int doMapField); + + virtual void CreateVTKFieldOnSupport(vtkMedFieldOnProfile*, + vtkMedFamilyOnEntityOnProfile*, + int doCreateField); + + virtual void MapFieldOnSupport(vtkMedFieldOnProfile*, + vtkMedFamilyOnEntityOnProfile*, + int doCreateField); + + // Description: + // Necessary call for the initialization of the filters used for the MED + // library in their parallel reads + virtual void InitializeParallelRead(); + + // Description: + // This method is called after all info from all med files are read. + // it links information coming from different files : + // for instance, it creates the vtkMedFamilyOnEntityOnProfile instances + // to link mesh and field. + virtual void LinkMedInfo(); + + virtual vtkMedProfile* GetProfile(const char*); + + virtual vtkMedLocalization* GetLocalization(const char*); + + virtual int GetLocalizationKey(vtkMedFieldOnProfile*); + + virtual void InitializeQuadratureOffsets(vtkMedFieldOnProfile*, + vtkMedFamilyOnEntityOnProfile*); + + virtual void SetVTKFieldOnSupport(vtkMedFieldOnProfile*, + vtkMedFamilyOnEntityOnProfile*); + + // Description: + // returns the current grid to use for this mesh. + vtkMedGrid* FindGridStep(vtkMedMesh* mesh); + + virtual void GatherFieldSteps(vtkMedField*, vtkMedListOfFieldSteps&); + + // Description: + // returns the index of the given frequency in the AvailableTimes array. + vtkIdType GetFrequencyIndex(double); + + virtual void ChooseRealAnimationMode(); + + // Description : + // Load the connectivity of this entities, and also those of the + // sub-entities in the case of non nodal connectivity. + virtual void LoadConnectivity(vtkMedEntityArray*); + + virtual void InitializeCellGlobalIds(); + + // Description : + // returns 1 if any point/cell family of this mesh is selected. + int HasMeshAnyCellSelectedFamily(vtkMedMesh*); + int HasMeshAnyPointSelectedFamily(vtkMedMesh*); + + // Description: + // use this method to enable/disable a family support + // the key is formatted by the vtkMedUtilities::FamilyKey method which + // returns a string + // FAMILY/MESH_NAME/OnPoint/FAMILY_NAME or MESH_NAME/OnCell/FAMILY_NAME + virtual void SetFamilyStatus(const char* key, int flag); + virtual int GetFamilyStatus(vtkMedMesh*, vtkMedFamily*); + + // Description: + // This is a helper function that is called when requesting a family status + // if a group status has been set after the last family status update. + virtual void SelectFamiliesFromGroups(); + + // Description: + // Instanciate a new vtkDataSet and initialize it to the points + // of this support. + vtkDataSet* CreateUnstructuredGridForPointSupport( + vtkMedFamilyOnEntityOnProfile* foep); + + // Field selections + vtkMedSelection* PointFields; + vtkMedSelection* CellFields; + vtkMedSelection* QuadratureFields; + vtkMedSelection* ElnoFields; + + // Support selection + vtkMedSelection* Entities; + vtkMedSelection* Groups; + + // name of the file to read from + char* FileName; + + // time management + int AnimationMode; + double TimeIndexForIterations; + vtkDoubleArray* AvailableTimes; + double TimePrecision; + vtkMedSelection* Frequencies; + + int CacheStrategy; + int GenerateVectors; + + //BTX + class vtkMedReaderInternal; + vtkMedReaderInternal* Internal; + //ETX + +private: + vtkMedReader(const vtkMedReader&); // Not implemented. + void operator=(const vtkMedReader&); // Not implemented. +}; + +#endif //__vtkMedReader_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedRegularGrid.cxx b/src/Plugins/MedReader/IO/vtkMedRegularGrid.cxx new file mode 100644 index 00000000..0f3aafe1 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedRegularGrid.cxx @@ -0,0 +1,217 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedRegularGrid.h" + +#include "vtkObjectFactory.h" +#include "vtkDataArray.h" +#include "vtkStructuredGrid.h" + +#include "vtkMedUtilities.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" +#include "vtkMedMesh.h" +#include "vtkMedFamilyOnEntityOnProfile.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedEntityArray.h" +#include "vtkMedProfile.h" +#include "vtkMedFamily.h" + +vtkCxxGetObjectVectorMacro(vtkMedRegularGrid, AxisCoordinate, vtkDataArray); +vtkCxxSetAbstractObjectVectorMacro(vtkMedRegularGrid, AxisCoordinate, vtkDataArray); + +vtkCxxRevisionMacro(vtkMedRegularGrid, "$Revision$") +vtkStandardNewMacro(vtkMedRegularGrid) + +vtkMedRegularGrid::vtkMedRegularGrid() +{ + this->AxisCoordinate = new vtkObjectVector(); +} + +vtkMedRegularGrid::~vtkMedRegularGrid() +{ + delete this->AxisCoordinate; +} + +void vtkMedRegularGrid::SetDimension(med_int dim) +{ + if(dim < 0) + dim = 0; + this->AxisSize.resize(dim); + this->SetNumberOfAxisCoordinate(dim); +} + +int vtkMedRegularGrid::GetDimension() +{ + return this->AxisSize.size(); +} + +void vtkMedRegularGrid::SetAxisSize(int axis, med_int size) +{ + if(axis < 0) + return; + + if(axis >= this->GetDimension()) + { + this->SetDimension(axis+1); + } + + this->AxisSize[axis] = size; +} + +med_int vtkMedRegularGrid::GetAxisSize(int dim) +{ + if(dim < 0 || dim >= this->AxisSize.size()) + return 0; + return this->AxisSize[dim]; +} + +med_int vtkMedRegularGrid::GetNumberOfPoints() +{ + med_int npts = 1; + for(int dim = 0; dim < this->AxisSize.size(); dim++) + { + npts *= this->AxisSize[dim]; + } + return npts; +} + +void vtkMedRegularGrid::LoadCoordinates() +{ + this->GetParentMesh()->GetParentFile()->GetMedDriver()->LoadCoordinates(this); +} + +int vtkMedRegularGrid::IsCoordinatesLoaded() +{ + bool res = this->GetDimension() == this->AxisSize.size() && + this->GetDimension() == this->AxisCoordinate->size(); + + if(!res) + return 0; + + med_int nloadedcoords = 1; + for(int axis=0; axis < this->GetDimension(); axis++) + { + vtkDataArray* axiscoords = this->GetAxisCoordinate(axis); + if(axiscoords != NULL) + nloadedcoords *= axiscoords->GetNumberOfTuples(); + else + nloadedcoords = 0; + } + return nloadedcoords == this->GetNumberOfPoints(); +} + +double* vtkMedRegularGrid::GetCoordTuple(med_int index) +{ + this->CoordTuple[0] = 0; + this->CoordTuple[1] = 0; + this->CoordTuple[2] = 0; + med_int prevmod = 1; + for(int axis=0; axis < this->GetDimension(); axis++) + { + med_int modulo = prevmod * this->AxisSize[axis]; + med_int axisindex = (index % modulo) / prevmod; + prevmod = modulo; + vtkDataArray* coords = this->GetAxisCoordinate(axis); + this->CoordTuple[axis] = coords-> + GetTuple1(axisindex); + } + + return this->CoordTuple; +} + +vtkDataSet* vtkMedRegularGrid::CreateVTKDataSet(vtkMedFamilyOnEntityOnProfile* foep) +{ + vtkStructuredGrid* vtkgrid = vtkStructuredGrid::New(); + + vtkPoints* points = vtkPoints::New(); + vtkgrid->SetPoints(points); + points->Delete(); + + vtkIdType dims[3] = {this->GetAxisSize(0), + this->GetAxisSize(1), + this->GetAxisSize(2)}; + + for(int dim=0; dim<3; dim++) + dims[dim] = (dims[dim] >= 1 ? dims[dim] : 1); + + vtkgrid->SetDimensions(dims[0], dims[1], dims[2]); + + this->LoadCoordinates(); + + if(this->GetAxisCoordinate(0) == NULL) + { + vtkgrid->Delete(); + return NULL; + } + + vtkDataArray* coords = vtkMedUtilities::NewCoordArray(); + coords->SetNumberOfComponents(3); + coords->SetNumberOfTuples(this->GetNumberOfPoints()); + vtkgrid->GetPoints()->SetData(coords); + coords->Delete(); + + med_int npts; + double coord[3] = {0, 0, 0}; + + npts = this->GetNumberOfPoints(); + for(med_int id=0; idGetCoordTuple(id); + for(int dim=0; dimGetDimension(); dim++) + { + coord[dim] = tuple[dim]; + } + coords->SetTuple(id, coord); + } + + if(foep->GetProfile() != NULL) + { + foep->GetProfile()->Load(); + vtkMedIntArray* pids = foep->GetProfile()->GetIds(); + med_int previd = -1; + for(med_int pid=0; pidGetNumberOfTuples(); pid++) + { + med_int id = pids->GetValue(pid) - 1; + for(med_int theid=previd+1; theidBlankCell(theid); + } + + previd = id; + } + } + + if(foep->GetFamilyOnEntity()->GetEntityArray()->GetNumberOfFamilyOnEntity() > 1) + { + med_int famid = foep->GetFamilyOnEntity()->GetFamily()->GetId(); + vtkMedEntityArray* ea = foep->GetFamilyOnEntity()->GetEntityArray(); + for(med_int id=0; idGetNumberOfCells(); id++) + { + if(ea->GetFamilyId(id) != famid) + vtkgrid->BlankCell(id); + } + } + return vtkgrid; +} + +void vtkMedRegularGrid::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedRegularGrid.h b/src/Plugins/MedReader/IO/vtkMedRegularGrid.h new file mode 100644 index 00000000..10732168 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedRegularGrid.h @@ -0,0 +1,84 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedRegularGrid_h_ +#define __vtkMedRegularGrid_h_ + +#include "vtkMedGrid.h" +#include "vtkMed.h" +#include "vtkMedSetGet.h" + +#include + +class vtkDataArray; + +class VTK_EXPORT vtkMedRegularGrid : public vtkMedGrid +{ +public : + static vtkMedRegularGrid* New(); + vtkTypeRevisionMacro(vtkMedRegularGrid, vtkMedGrid) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Container of the families in this mesh + vtkGetObjectVectorMacro(AxisCoordinate, vtkDataArray); + vtkSetAbstractObjectVectorMacro(AxisCoordinate, vtkDataArray); + + // Description: + // overloaded to set the number of coordinates arrays. + // Do not allocate each array. + virtual void SetDimension(med_int); + virtual int GetDimension(); + + // Description: + // the size of each dimension of the grid. + // SetDimension has to have been called before + virtual void SetAxisSize(int axis, med_int size); + virtual med_int GetAxisSize(int dim); + + // Description: + // returns the number of points of this grid. + virtual med_int GetNumberOfPoints(); + + virtual void LoadCoordinates(); + + virtual double* GetCoordTuple(med_int index); + + virtual int IsCoordinatesLoaded(); + + virtual vtkDataSet* CreateVTKDataSet(vtkMedFamilyOnEntityOnProfile*); + +protected: + vtkMedRegularGrid(); + virtual ~vtkMedRegularGrid(); + + double CoordTuple[3]; + + std::vector AxisSize; + //BTX + vtkObjectVector* AxisCoordinate; + //ETX + +private: + vtkMedRegularGrid(const vtkMedRegularGrid&); // Not implemented. + void operator=(const vtkMedRegularGrid&); // Not implemented. + +}; + +#endif //__vtkMedRegularGrid_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedSelection.cxx b/src/Plugins/MedReader/IO/vtkMedSelection.cxx new file mode 100644 index 00000000..9f70e9dc --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedSelection.cxx @@ -0,0 +1,118 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedSelection.h" + +#include "vtkObjectFactory.h" +#include "vtkStringArray.h" + +#include +#include +#include +using namespace std; + +class vtkMedSelectionInternals +{ +public : + map< string, bool > Status; + vector< string > Keys; +}; + +vtkCxxRevisionMacro(vtkMedSelection, "$Revision$") +vtkStandardNewMacro(vtkMedSelection) + +vtkMedSelection::vtkMedSelection() +{ + this->Internals = new vtkMedSelectionInternals(); +} + +vtkMedSelection::~vtkMedSelection() +{ + delete this->Internals; +} + +void vtkMedSelection::Initialize() +{ + this->Internals->Status.clear(); + this->Internals->Keys.clear(); +} + +void vtkMedSelection::AddKey(const char* key) +{ + if(this->Internals->Status.find(key) != this->Internals->Status.end()) + { + return ; + } + this->Internals->Keys.push_back(key); + this->Internals->Status[key] = 1; +} + +void vtkMedSelection::SetKeyStatus(const char* key, int status) +{ + if(this->Internals->Status.find(key) == this->Internals->Status.end()) + { + this->AddKey(key); + } + this->Internals->Status[key] = status; +} + +int vtkMedSelection::GetKeyStatus(const char* key) +{ + if(this->Internals->Status.find(key) == this->Internals->Status.end()) + { + return 0; + } + return this->Internals->Status[key]; +} + +const char* vtkMedSelection::GetKey(int index) +{ + if(index < 0 || index >= this->Internals->Keys.size()) + { + return NULL; + } + return this->Internals->Keys[index].c_str(); +} + +int vtkMedSelection::GetNumberOfKey() +{ + return this->Internals->Keys.size(); +} + +int vtkMedSelection::KeyExists(const char *key) +{ + return this->Internals->Status.find(key) + != this->Internals->Status.end(); +} + +void vtkMedSelection::RemoveKeyByIndex(int index) +{ + if(index < 0 || index >= this->Internals->Keys.size()) + { + return; + } + string name = this->Internals->Keys[index]; + this->Internals->Status.erase(name); + this->Internals->Keys.erase(this->Internals->Keys.begin() + index); +} + +void vtkMedSelection::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedSelection.h b/src/Plugins/MedReader/IO/vtkMedSelection.h new file mode 100644 index 00000000..a9f1418b --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedSelection.h @@ -0,0 +1,62 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedSelection_h_ +#define __vtkMedSelection_h_ + +#include "vtkObject.h" + +class vtkMedSelectionInternals; + +class VTK_EXPORT vtkMedSelection : public vtkObject +{ +public : + static vtkMedSelection* New(); + vtkTypeRevisionMacro(vtkMedSelection, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + virtual void Initialize(); + + virtual void AddKey(const char*); + + virtual void SetKeyStatus(const char* name, int status); + + virtual int GetKeyStatus(const char* name); + + virtual const char* GetKey(int index); + + virtual int GetNumberOfKey(); + + virtual int KeyExists(const char* name); + + virtual void RemoveKeyByIndex(int index); + +protected: + vtkMedSelection(); + virtual ~vtkMedSelection(); + + vtkMedSelectionInternals* Internals; + +private: + vtkMedSelection(const vtkMedSelection&); // Not implemented. + void operator=(const vtkMedSelection&); // Not implemented. + +}; + +#endif //__vtkMedSelection_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedSetGet.h b/src/Plugins/MedReader/IO/vtkMedSetGet.h new file mode 100644 index 00000000..6e3371e4 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedSetGet.h @@ -0,0 +1,136 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _vtkMedSetGet_h_ +#define _vtkMedSetGet_h_ + +//BTX +template class vtkObjectVector; +template class vtkList; +template class vtkMedComputeStepMap; + +#define vtkGetObjectVectorMacro(name, type)\ + virtual type* Get##name (int index);\ + virtual vtkIdType GetNumberOf##name (); + +#define vtkSetObjectVectorMacro(name, type)\ + virtual void AllocateNumberOf##name (vtkIdType size);\ + virtual void Set##name (vtkIdType index, type* obj);\ + virtual void Append##name (type* obj);\ + virtual void Remove##name (type* obj); + +#define vtkSetAbstractObjectVectorMacro(name, type)\ + virtual void SetNumberOf##name (vtkIdType size);\ + virtual void Set##name (vtkIdType index, type* obj);\ + virtual void Append##name (type* obj); + +#define vtkCxxGetObjectVectorMacro(class, name, type)\ + type* class::Get##name (int index)\ + {\ + if(index < 0 || index >= this->name->size())\ + return NULL;\ + return this->name->at(index);\ + }\ + vtkIdType class::GetNumberOf##name ()\ + {\ + return this->name->size();\ + } + +#define vtkCxxSetObjectVectorMacro(class, name, type)\ + void class::AllocateNumberOf##name (vtkIdType size)\ + {\ + if(this->name->size() == size)\ + return;\ + if(size <= 0 )\ + this->name->clear();\ + else\ + this->name->resize(size);\ + for(vtkIdType _ii=0; _iiname->size(); _ii++)\ + {\ + this->name->at(_ii) = vtkSmartPointer< type > ::New();\ + }\ + this->Modified();\ + }\ + void class::Set##name (vtkIdType index, type* obj)\ + {\ + if(index < 0 || index >= this->name->size())\ + {\ + vtkWarningMacro("has not been allocated before setting value" );\ + return;\ + }\ + if( this->name->at(index) == obj)\ + return;\ + this->name->at(index) = obj; \ + this->Modified();\ + }\ + void class::Append##name (type* obj)\ + {\ + this->name->resize(this->name->size()+1);\ + this->name->at(this->name->size()-1) = obj;\ + this->Modified();\ + }\ + void class::Remove##name (type* obj)\ + {\ + vtkIdType index=0;\ + for(index=0; index < this->name->size(); index++)\ + {\ + if(this->name->at(index) == obj) break;\ + }\ + if(index == this->name->size()) return;\ + for(vtkIdType id=index; id < this->name->size()-1; id++)\ + {\ + this->name->at(id) = this->name->at(id+1);\ + }\ + this->name->resize(this->name->size()-1);\ + this->Modified();\ + } + +#define vtkCxxSetAbstractObjectVectorMacro(class, name, type)\ + void class::SetNumberOf##name (vtkIdType size)\ + {\ + if(this->name->size() == size)\ + return;\ + if(size <= 0 )\ + this->name->clear();\ + else\ + this->name->resize(size);\ + this->Modified();\ + }\ + void class::Set##name (vtkIdType index, type* obj)\ + {\ + if(index < 0 || index >= this->name->size())\ + {\ + vtkWarningMacro("has not been allocated before setting value" );\ + return;\ + }\ + if( this->name->at(index) == obj)\ + return;\ + this->name->at(index) = obj; \ + this->Modified();\ + }\ + void class::Append##name (type* obj)\ + {\ + this->name->resize(this->name->size()+1);\ + this->name->at(this->name->size()-1) = obj;\ + this->Modified();\ + } + +//ETX + +#endif diff --git a/src/Plugins/MedReader/IO/vtkMedStructElement.cxx b/src/Plugins/MedReader/IO/vtkMedStructElement.cxx new file mode 100644 index 00000000..b9b7f638 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedStructElement.cxx @@ -0,0 +1,95 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedStructElement.h" + +#include "vtkObjectFactory.h" +#include "vtkMedUtilities.h" +#include "vtkMedVariableAttribute.h" +#include "vtkMedConstantAttribute.h" +#include "vtkMedFile.h" +#include "vtkMedMesh.h" + +#include +#include +#include +using namespace std; + +vtkCxxGetObjectVectorMacro(vtkMedStructElement, VariableAttribute, vtkMedVariableAttribute); +vtkCxxSetObjectVectorMacro(vtkMedStructElement, VariableAttribute, vtkMedVariableAttribute); +vtkCxxGetObjectVectorMacro(vtkMedStructElement, ConstantAttribute, vtkMedConstantAttribute); +vtkCxxSetObjectVectorMacro(vtkMedStructElement, ConstantAttribute, vtkMedConstantAttribute); + +vtkCxxSetObjectMacro(vtkMedStructElement, ParentFile, vtkMedFile); +vtkCxxSetObjectMacro(vtkMedStructElement, SupportMesh, vtkMedMesh); + +vtkCxxRevisionMacro(vtkMedStructElement, "$Revision$") +vtkStandardNewMacro(vtkMedStructElement) + +vtkMedStructElement::vtkMedStructElement() +{ + this->MedIterator = -1; + this->Name = NULL; + this->GeometryType = MED_UNDEF_GEOTYPE; + this->ModelDimension = 0; + this->SupportMeshName = NULL; + this->SupportMesh = NULL; + this->SupportEntityType = MED_UNDEF_ENTITY_TYPE; + this->SupportNumberOfNode = 0; + this->SupportNumberOfCell = 0; + this->SupportGeometryType = MED_UNDEF_GEOTYPE; + this->AnyProfile = MED_FALSE; + this->VariableAttribute = new vtkObjectVector(); + this->ConstantAttribute = new vtkObjectVector(); + this->ParentFile = NULL; +} + +vtkMedStructElement::~vtkMedStructElement() +{ + this->SetName(NULL); + this->SetSupportMeshName(NULL); + this->SetParentFile(NULL); + this->SetSupportMesh(NULL); + delete this->VariableAttribute; + delete this->ConstantAttribute; +} + +void vtkMedStructElement::LoadVariableAttributes(vtkMedEntityArray* array) +{ + for(int varattit = 0; varattit < this->GetNumberOfVariableAttribute(); varattit++) + { + vtkMedVariableAttribute* varatt = this->GetVariableAttribute(varattit); + varatt->Load(array); + } +} + +int vtkMedStructElement::GetConnectivitySize() +{ + if(strcmp(this->Name, MED_PARTICLE_NAME) == 0 + || this->SupportEntityType != MED_CELL) + return this->SupportNumberOfNode; + + return this->SupportNumberOfCell * + vtkMedUtilities::GetNumberOfPoint(this->SupportGeometryType); +} + +void vtkMedStructElement::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedStructElement.h b/src/Plugins/MedReader/IO/vtkMedStructElement.h new file mode 100644 index 00000000..05429435 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedStructElement.h @@ -0,0 +1,150 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedStructElement_h_ +#define __vtkMedStructElement_h_ + +#include "vtkObject.h" +#include "vtkMed.h" +#include "vtkMedSetGet.h" + +class vtkMedVariableAttribute; +class vtkMedConstantAttribute; +class vtkMedFile; +class vtkMedMesh; +class vtkMedEntityArray; + +class VTK_EXPORT vtkMedStructElement : public vtkObject +{ +public : + static vtkMedStructElement* New(); + vtkTypeRevisionMacro(vtkMedStructElement, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // The iterator to identify this struct element model in the med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // This is the name of this structural element model + vtkSetStringMacro(Name); + vtkGetStringMacro(Name); + + // Description: + // The Geometry type this structural elements lies on. + vtkSetMacro(GeometryType, med_geometry_type); + vtkGetMacro(GeometryType, med_geometry_type); + + // Description: + // The dimension of this structural elements model + vtkSetMacro(ModelDimension, med_int); + vtkGetMacro(ModelDimension, med_int); + + // Description: + // The name of the support mesh used by this structural element model + vtkSetStringMacro(SupportMeshName); + vtkGetStringMacro(SupportMeshName); + + // Description: + // This is the support mesh instance, corresponding to the above name. + virtual void SetSupportMesh(vtkMedMesh*); + vtkGetObjectMacro(SupportMesh, vtkMedMesh); + + // Description: + // The type of entity contained in the support mesh + vtkSetMacro(SupportEntityType, med_entity_type); + vtkGetMacro(SupportEntityType, med_entity_type); + + // Description: + // The number of nodes of the support mesh + vtkSetMacro(SupportNumberOfNode, med_int); + vtkGetMacro(SupportNumberOfNode, med_int); + + // Description: + // The number of cells in the support mesh. + vtkSetMacro(SupportNumberOfCell, med_int); + vtkGetMacro(SupportNumberOfCell, med_int); + + // Description: + // The geometry type of the cells in the support mesh + vtkSetMacro(SupportGeometryType, med_geometry_type); + vtkGetMacro(SupportGeometryType, med_geometry_type); + + // Description: + // This boolean is set to true if the attributes are given on a profile + vtkSetMacro(AnyProfile, med_bool); + vtkGetMacro(AnyProfile, med_bool); + + // Description: + // Get the Variable Attributes + vtkGetObjectVectorMacro(VariableAttribute, vtkMedVariableAttribute); + vtkSetObjectVectorMacro(VariableAttribute, vtkMedVariableAttribute); + + // Description: + // Get the Constant Attributes + vtkGetObjectVectorMacro(ConstantAttribute, vtkMedConstantAttribute); + vtkSetObjectVectorMacro(ConstantAttribute, vtkMedConstantAttribute); + + // Description: + // The file this structural element model is stored in. + virtual void SetParentFile(vtkMedFile*); + vtkGetObjectMacro(ParentFile, vtkMedFile); + + // Description: + // This method will use the driver to load the data for this compute step + // for all variable attributes from disk. + virtual void LoadVariableAttributes(vtkMedEntityArray*); + + // Description: + // returns the size of the connectivity for one structural element. + // for MED_PARTICLE elements, it returns the number of nodes + // if SupportEntityType == MED_CELL, it returns the number of cells in the + // support mesh * the number of node for each cell. + // else it returns the number of nodes in the support mesh. + virtual int GetConnectivitySize(); + +protected: + vtkMedStructElement(); + virtual ~vtkMedStructElement(); + + med_int MedIterator; + char *Name; + med_geometry_type GeometryType; + med_int ModelDimension; + char *SupportMeshName; + med_entity_type SupportEntityType; + med_int SupportNumberOfNode; + med_int SupportNumberOfCell; + med_geometry_type SupportGeometryType; + med_bool AnyProfile; + + vtkMedFile* ParentFile; + vtkMedMesh* SupportMesh; + + vtkObjectVector* VariableAttribute; + vtkObjectVector* ConstantAttribute; + +private: + vtkMedStructElement(const vtkMedStructElement&); // Not implemented. + void operator=(const vtkMedStructElement&); // Not implemented. + +}; + +#endif //__vtkMedStructElement_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedSupportMesh.cxx b/src/Plugins/MedReader/IO/vtkMedSupportMesh.cxx new file mode 100644 index 00000000..2ca5249b --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedSupportMesh.cxx @@ -0,0 +1,63 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedSupportMesh.h" + +#include "vtkObjectFactory.h" +#include "vtkMedUtilities.h" +#include "vtkMedFile.h" + +#include "vtkStringArray.h" + +#include +#include +#include +using namespace std; + +vtkCxxSetObjectMacro(vtkMedSupportMesh, ParentFile, vtkMedFile); + +vtkCxxRevisionMacro(vtkMedSupportMesh, "$Revision$") +vtkStandardNewMacro(vtkMedSupportMesh) + +vtkMedSupportMesh::vtkMedSupportMesh() +{ + this->MedIterator = -1; + this->Name = NULL; + this->ParentFile = NULL; + this->AxisName = vtkStringArray::New(); + this->AxisUnit = vtkStringArray::New(); + this->Description = NULL; + this->AxisType = MED_UNDEF_AXIS_TYPE; + this->SpaceDimension = 0; + this->MeshDimension = 0; +} + +vtkMedSupportMesh::~vtkMedSupportMesh() +{ + this->SetName(NULL); + this->SetDescription(NULL); + this->SetParentFile(NULL); + this->AxisName->Delete(); + this->AxisUnit->Delete(); +} + +void vtkMedSupportMesh::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedSupportMesh.h b/src/Plugins/MedReader/IO/vtkMedSupportMesh.h new file mode 100644 index 00000000..6280199d --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedSupportMesh.h @@ -0,0 +1,101 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedSupportMesh_h_ +#define __vtkMedSupportMesh_h_ + +#include "vtkObject.h" +#include "vtkMed.h" +#include "vtkMedSetGet.h" + +class vtkStringArray; +class vtkMedFile; + +class VTK_EXPORT vtkMedSupportMesh : public vtkObject +{ +public : + static vtkMedSupportMesh* New(); + vtkTypeRevisionMacro(vtkMedSupportMesh, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // The iterator to identify this struct element model in the med file + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // This is the name of this structural element model + vtkSetStringMacro(Name); + vtkGetStringMacro(Name); + + // Description: + // This is the dsecription of this structural element model + vtkSetStringMacro(Description); + vtkGetStringMacro(Description); + + // Description: + // The dimension of this support mesh lives in + vtkSetMacro(SpaceDimension, med_int); + vtkGetMacro(SpaceDimension, med_int); + + // Description: + // The dimension of this support mesh model + vtkSetMacro(MeshDimension, med_int); + vtkGetMacro(MeshDimension, med_int);; + + // Description: + // The dimension of this support mesh model + vtkSetMacro(AxisType, med_axis_type); + vtkGetMacro(AxisType, med_axis_type);; + + // Description: + // The file this support mesh is stored in. + virtual void SetParentFile(vtkMedFile*); + vtkGetObjectMacro(ParentFile, vtkMedFile); + + // Dsecription: + // This array stores the units of the axis + vtkGetObjectMacro(AxisName, vtkStringArray); + + // Description: + // This array store the units of thi support mesh for each axis + vtkGetObjectMacro(AxisUnit, vtkStringArray); + +protected: + vtkMedSupportMesh(); + virtual ~vtkMedSupportMesh(); + + med_int MedIterator; + med_int SpaceDimension; + med_int MeshDimension; + char *Name; + char *Description; + med_axis_type AxisType; + vtkStringArray *AxisName; + vtkStringArray *AxisUnit; + + vtkMedFile* ParentFile; + +private: + vtkMedSupportMesh(const vtkMedSupportMesh&); // Not implemented. + void operator=(const vtkMedSupportMesh&); // Not implemented. + +}; + +#endif //__vtkMedSupportMesh_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedUnstructuredGrid.cxx b/src/Plugins/MedReader/IO/vtkMedUnstructuredGrid.cxx new file mode 100644 index 00000000..ad186be2 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedUnstructuredGrid.cxx @@ -0,0 +1,365 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedUnstructuredGrid.h" + +#include "vtkObjectFactory.h" +#include "vtkSmartPointer.h" +#include "vtkDataArray.h" +#include "vtkUnstructuredGrid.h" +#include "vtkPointData.h" +#include "vtkCellData.h" +#include "vtkIdList.h" +#include "vtkCellType.h" +#include "vtkInformation.h" + +#include "vtkMedUtilities.h" +#include "vtkMedEntityArray.h" +#include "vtkMedMesh.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" +#include "vtkMedFamilyOnEntityOnProfile.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedProfile.h" +#include "vtkMedUtilities.h" +#include "vtkMedStructElement.h" +#include "vtkMedVariableAttribute.h" + +#include "vtkMultiProcessController.h" + +vtkCxxSetObjectMacro(vtkMedUnstructuredGrid,Coordinates,vtkDataArray); + +vtkCxxRevisionMacro(vtkMedUnstructuredGrid, "$Revision$") +vtkStandardNewMacro(vtkMedUnstructuredGrid) + +vtkMedUnstructuredGrid::vtkMedUnstructuredGrid() +{ + this->Coordinates = NULL; + this->NumberOfPoints = 0; +} + +vtkMedUnstructuredGrid::~vtkMedUnstructuredGrid() +{ + this->SetCoordinates(NULL); +} + +int vtkMedUnstructuredGrid::IsCoordinatesLoaded() +{ + return this->Coordinates != NULL && this->Coordinates->GetNumberOfTuples() + == this->NumberOfPoints; +} + +void vtkMedUnstructuredGrid::InitializeCellGlobalIds() +{ + vtkIdType ncells = 0; + + for(int id = 0; id < this->EntityArray->size(); id++) + { + vtkMedEntityArray* array = this->EntityArray->at(id); + + if(array == NULL) + continue; + + if(array->GetEntity().EntityType == MED_NODE) + continue; + + array->SetInitialGlobalId(ncells + 1); + ncells += array->GetNumberOfEntity(); + } +} + +void vtkMedUnstructuredGrid::ClearMedSupports() +{ + this->Superclass::ClearMedSupports(); + for(int id = 0; id < this->EntityArray->size(); id++) + { + vtkMedEntityArray* array = this->EntityArray->at(id); + array->Initialize(); + } +} + +void vtkMedUnstructuredGrid::LoadCoordinates() +{ + this->GetParentMesh()->GetParentFile()->GetMedDriver()->LoadCoordinates(this); +} + +double* vtkMedUnstructuredGrid::GetCoordTuple(med_int index) +{ + return this->Coordinates->GetTuple(index); +} + +vtkDataSet* vtkMedUnstructuredGrid::CreateVTKDataSet( + vtkMedFamilyOnEntityOnProfile* foep) +{ + vtkMultiProcessController* controller = + vtkMultiProcessController::GetGlobalController(); + + vtkMedFamilyOnEntity* foe = foep->GetFamilyOnEntity(); + vtkMedEntityArray* array = foe->GetEntityArray(); + if(foep->GetValid() == 0) + { + return NULL; + } + + vtkUnstructuredGrid* vtkugrid = vtkUnstructuredGrid::New(); + + // now we copy all the flagged nodes in the grid, shallow copy if possible + bool shallowCopyPoints=true; + + if(this->GetParentMesh()->GetSpaceDimension()!=3) + { + shallowCopyPoints=false; + } + + shallowCopyPoints = shallowCopyPoints && foep->CanShallowCopyPointField(NULL); + + foe->GetParentGrid()->LoadCoordinates(); + + vtkIdType numberOfPoints; + vtkPoints* points=vtkPoints::New(this->GetCoordinates()->GetDataType()); + vtkugrid->SetPoints(points); + points->Delete(); + + vtkIdTypeArray* pointGlobalIds=vtkIdTypeArray::New(); + pointGlobalIds->SetName("MED_POINT_ID"); + pointGlobalIds->SetNumberOfComponents(1); + vtkugrid->GetPointData()->SetGlobalIds(pointGlobalIds); + pointGlobalIds->Delete(); + + vtkIdTypeArray* cellGlobalIds=vtkIdTypeArray::New(); + cellGlobalIds->SetName("MED_CELL_ID"); + cellGlobalIds->SetNumberOfComponents(1); + vtkugrid->GetCellData()->SetGlobalIds(cellGlobalIds); + cellGlobalIds->Delete(); + + if (shallowCopyPoints) + { + vtkugrid->GetPoints()->SetDataType(this->GetCoordinates()->GetDataType()); + vtkugrid->GetPoints()->SetData(this->GetCoordinates()); + // add global ids + numberOfPoints=this->GetNumberOfPoints(); + pointGlobalIds->SetNumberOfTuples(numberOfPoints); + vtkIdType* ptr=pointGlobalIds->GetPointer(0); + for(int pid=0; pidGetNumberOfPoints(); index++) + { + if(!foep->KeepPoint(index)) + continue; + + double coord[3]={0.0, 0.0, 0.0}; + double * tuple=this->GetCoordinates()->GetTuple(index); + for(int dim=0; dimGetParentMesh()->GetSpaceDimension()&&dim<3; dim++) + { + coord[dim]=tuple[dim]; + } + vtkugrid->GetPoints()->InsertPoint(currentIndex, coord); + pointGlobalIds->InsertNextValue(index+1); + currentIndex++; + } + vtkugrid->GetPoints()->Squeeze(); + pointGlobalIds->Squeeze(); + numberOfPoints=currentIndex; + } + + vtkMedStructElement* structelem = NULL; + int vtkType = VTK_EMPTY_CELL; + int nsupportcell = 1; + vtkSmartPointer supportIndex = vtkSmartPointer::New(); + supportIndex->SetName("STRUCT_ELEMENT_INDEX"); + supportIndex->SetNumberOfComponents(2); + supportIndex->GetInformation()->Set(vtkMedUtilities::STRUCT_ELEMENT_INDEX(), 1); + supportIndex->GetInformation()->Set(vtkAbstractArray::GUI_HIDE(), 1); + supportIndex->SetComponentName(0, "GLOBAL_ID"); + supportIndex->SetComponentName(1, "LOCAL_ID"); + + if(array->GetEntity().EntityType == MED_STRUCT_ELEMENT) + { + structelem = array->GetStructElement(); + if(structelem == NULL) + { + foep->SetValid(0); + } + else + { + vtkType = vtkMedUtilities::GetVTKCellType( + structelem->GetSupportGeometryType()); + nsupportcell = structelem->GetSupportNumberOfCell(); + if(structelem->GetSupportEntityType() != MED_CELL + || strcmp(structelem->GetName(), MED_PARTICLE_NAME) == 0) + { + // Special case : the support connectivity is implicit + // (for particles) + // map this to points + vtkType = VTK_VERTEX; + nsupportcell = structelem->GetSupportNumberOfNode(); + } + + vtkugrid->GetInformation()->Set(vtkMedUtilities::STRUCT_ELEMENT(), structelem); + for(int varattid = 0; varattidGetNumberOfVariableAttribute(); varattid++) + { + vtkMedVariableAttribute* varatt = structelem->GetVariableAttribute(varattid); + varatt->Load(array); + vtkAbstractArray* values = array->GetVariableAttributeValue(varatt); + vtkugrid->GetFieldData()->AddArray(values); + } + vtkugrid->GetCellData()->AddArray(supportIndex); + } + } + else + { + vtkType = vtkMedUtilities::GetVTKCellType( + array->GetEntity().GeometryType); + } + + vtkSmartPointer pts = vtkSmartPointer::New(); + vtkSmartPointer vtkpts = vtkSmartPointer::New(); + vtkIdType intialGlobalId = array->GetInitialGlobalId(); + vtkMedIntArray* pids = (foep->GetProfile()!=NULL? + foep->GetProfile()->GetIds() : NULL); + vtkIdType maxId = (pids!=NULL? + pids->GetNumberOfTuples(): + array->GetNumberOfEntity()); + + int valid = foep->GetValid(); + if (controller != NULL) + if (controller->GetNumberOfProcesses() > 1) + valid = 1; + + for (vtkIdType pindex = 0; pindexGetValue(pindex)-1: + pindex); + + if (!foep->KeepCell(realIndex)) + continue; + + array->GetCellVertices(realIndex, pts); + + for(int sid = 0; sid < nsupportcell; sid++) + { + cellGlobalIds->InsertNextValue(intialGlobalId+pindex); + } + + // The supportIndex array has 2 component, the first to give the index + // of the med cell in the variable attributes array, the second to give + // the index of the cell in the n cells composing the structural element + if(array->GetEntity().EntityType == MED_STRUCT_ELEMENT) + { + for(int sid = 0; sid < nsupportcell; sid++) + { + supportIndex->InsertNextTuple2(pindex, sid); + } + } + + if (array->GetEntity().GeometryType==MED_POLYHEDRON) + { + if(vtkMedUtilities::FormatPolyhedronForVTK(foep, pindex, pts)) + { + vtkugrid->InsertNextCell(VTK_POLYHEDRON, pts); + } + else + { + foep->SetValid(0); + vtkugrid->Delete(); + return NULL; + } + } + else + { + vtkpts->Initialize(); + vtkpts->SetNumberOfIds(pts->GetNumberOfIds()); + + for(vtkIdType node=0; nodeGetNumberOfIds(); node++) + { + vtkIdType pid = pts->GetId(node); + vtkIdType ptid=foep->GetVTKPointIndex(pid); + if(ptid < 0 || ptid >= vtkugrid->GetNumberOfPoints()) + { + vtkDebugMacro("Index error, this cell" << + " is not on this profile"); +#ifndef MedReader_HAVE_PARALLEL_INFRASTRUCTURE + vtkugrid->Delete(); + foep->SetValid(0); + return NULL; +#else + return vtkugrid; +#endif + } + vtkpts->SetId(vtkMedUtilities::MedToVTKIndex(vtkType, node), ptid); + } + + // for strutural elements, insert nsupportcell instead of only one + if(nsupportcell > 1) + { + vtkIdType npts = vtkpts->GetNumberOfIds() / nsupportcell; + for(int sid=0; sid < nsupportcell; sid++) + { + vtkIdType* ptids = vtkpts->GetPointer(sid * npts); + vtkugrid->InsertNextCell(vtkType, npts, ptids); + } + } + else + { + vtkugrid->InsertNextCell(vtkType, vtkpts); + } + } + } + + if(vtkugrid->GetNumberOfCells() == vtkugrid->GetNumberOfPoints()) + { + for(int fieldId = 0; fieldId < vtkugrid->GetFieldData()->GetNumberOfArrays(); fieldId++) + { + vtkDataArray* fieldData = vtkugrid->GetFieldData()->GetArray(fieldId); + + if(fieldData->GetNumberOfTuples() == vtkugrid->GetNumberOfCells()) + { + vtkugrid->GetPointData()->AddArray(fieldData); + } + else + { + vtkDataArray* real_fieldData = fieldData->NewInstance(); + real_fieldData->SetName(fieldData->GetName()); + real_fieldData->SetNumberOfComponents(fieldData->GetNumberOfComponents()); + + for(vtkIdType cellId = 0; cellId < vtkugrid->GetNumberOfPoints(); cellId++) + { + vtkIdType supportId = static_cast(supportIndex->GetTuple2(cellId)[0]); + real_fieldData->InsertNextTuple(fieldData->GetTuple(supportId)); + } + + vtkugrid->GetPointData()->AddArray(real_fieldData); + real_fieldData->Delete(); + } + } + } + + return vtkugrid; +} + +void vtkMedUnstructuredGrid::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + PRINT_IVAR(os, indent, NumberOfPoints); +} diff --git a/src/Plugins/MedReader/IO/vtkMedUnstructuredGrid.h b/src/Plugins/MedReader/IO/vtkMedUnstructuredGrid.h new file mode 100644 index 00000000..5c5944a4 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedUnstructuredGrid.h @@ -0,0 +1,82 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedUnstructuredGrid_h_ +#define __vtkMedUnstructuredGrid_h_ + +#include "vtkMedGrid.h" +#include "vtkMedSetGet.h" +#include "vtkMed.h" + +class vtkDataArray; +class vtkMedEntityArray; +class vtkMedString; + +class VTK_EXPORT vtkMedUnstructuredGrid : public vtkMedGrid +{ +public : + static vtkMedUnstructuredGrid* New(); + vtkTypeRevisionMacro(vtkMedUnstructuredGrid, vtkMedGrid); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // this array contains the coordinates of the points used by this grid. + virtual void SetCoordinates(vtkDataArray*); + vtkGetObjectMacro(Coordinates, vtkDataArray); + + // Description: + // returns true if the Coordinate array is set and corresponds + // to the number of points + virtual int IsCoordinatesLoaded(); + + // Description: + // Initialize the global Ids of the first element of each MedEntityArray + virtual void InitializeCellGlobalIds(); + + // Description: + // Free the memory associated with this grid. + virtual void ClearMedSupports(); + + // Description: + // Set the number of points in the grid. + // no allocation is performed at this points, you have to allocate the Points + // array manually. + vtkSetMacro(NumberOfPoints, med_int); + vtkGetMacro(NumberOfPoints, med_int); + + virtual void LoadCoordinates(); + + virtual double* GetCoordTuple(med_int index); + + virtual vtkDataSet* CreateVTKDataSet(vtkMedFamilyOnEntityOnProfile*); + +protected: + vtkMedUnstructuredGrid(); + virtual ~vtkMedUnstructuredGrid(); + + vtkDataArray* Coordinates; + + med_int NumberOfPoints; + +private: + vtkMedUnstructuredGrid(const vtkMedUnstructuredGrid&); // Not implemented. + void operator=(const vtkMedUnstructuredGrid&); // Not implemented. +}; + +#endif //__vtkMedUnstructuredGrid_h_ diff --git a/src/Plugins/MedReader/IO/vtkMedUtilities.cxx b/src/Plugins/MedReader/IO/vtkMedUtilities.cxx new file mode 100644 index 00000000..9d9970ec --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedUtilities.cxx @@ -0,0 +1,890 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedUtilities.h" + +#include "vtkMedMesh.h" +#include "vtkMedFamily.h" +#include "vtkMedGroup.h" +#include "vtkMedFamilyOnEntityOnProfile.h" +#include "vtkMedFamilyOnEntity.h" +#include "vtkMedEntityArray.h" +#include "vtkMedIntArray.h" +#include "vtkMedGrid.h" + +#include "vtkObjectFactory.h" +#include "vtkInformation.h" +#include "vtkDoubleArray.h" +#include "vtkIntArray.h" +#include "vtkLongLongArray.h" +#include "vtkLongArray.h" +#include "vtkIdTypeArray.h" +#include "vtkCellType.h" +#include "vtkIdList.h" +#include "vtkMutableDirectedGraph.h" +#include "vtkStringArray.h" +#include "vtkDataSetAttributes.h" +#include "vtkOutEdgeIterator.h" +#include "vtkInformationIntegerKey.h" +#include "vtkInformationStringVectorKey.h" +#include "vtkInformationObjectBaseKey.h" + +#include +using namespace std; +char vtkMedUtilities::Separator='/'; + +const char* vtkMedUtilities::NoGroupName="No Group"; +const char* vtkMedUtilities::OnPointName="OnPoint"; +const char* vtkMedUtilities::OnCellName="OnCell"; + +const int MED_TRIA_CHILD_TO_PARENT_INDEX[3][3]= + {{0, 1, 3}, {1, 2, 4}, {2, 0, 5}}; + +const int MED_QUAD_CHILD_TO_PARENT_INDEX[4][3]= + {{0, 1, 4}, {1, 2, 5}, {2, 3, 6}, {3, 0, 7}}; + +const int MED_TETRA_CHILD_TO_PARENT_INDEX[4][6]= + {{0, 1, 2, 4, 5, 6}, + {0, 3, 1, 7, 8, 4}, + {1, 3, 2, 8, 9, 5}, + {2, 3, 0, 9, 7, 6}}; + +const int MED_HEXA_CHILD_TO_PARENT_INDEX[6][8]= + {{0, 1, 2, 3, 8, 9, 10, 11}, + {4, 7, 6, 5, 15, 14, 13, 12}, + {0, 4, 5, 1, 16, 12, 17, 8}, + {1, 5, 6, 2, 17, 13, 18, 9}, + {2, 6, 7, 3, 18, 14, 19, 10}, + {3, 7, 4, 0, 19, 15, 16, 11}}; + +const int MED_PYRA_CHILD_TO_PARENT_INDEX[5][8]= + {{0, 1, 2, 3, 5, 6, 7, 8}, + {0, 4, 1, -1, 9, 10, 5, -1}, + {1, 4, 2, -1, 10, 11, 6, -1}, + {2, 4, 3, -1, 11, 12, 7, -1}, + {3, 4, 0, -1, 12, 9, 8, -1}}; + +const int MED_PENTA_CHILD_TO_PARENT_INDEX[5][8]= + {{0, 1, 2, -1, 6, 7, 8, -1}, + {3, 5, 4, -1, 11, 10, 9, -1}, + {0, 3, 4, 1, 12, 9, 13, 6}, + {1, 4, 5, 2, 13, 10, 14, 7}, + {2, 5, 3, 0, 14, 11, 12, 8}}; + +vtkInformationKeyMacro(vtkMedUtilities, ELNO, Integer); +vtkInformationKeyMacro(vtkMedUtilities, ELGA, Integer); +vtkInformationKeyMacro(vtkMedUtilities, BLOCK_NAME, StringVector); +vtkInformationKeyMacro(vtkMedUtilities, STRUCT_ELEMENT, ObjectBase); +vtkInformationKeyMacro(vtkMedUtilities, STRUCT_ELEMENT_INDEX, Integer); + +vtkDataArray* vtkMedUtilities::NewCoordArray() +{ + return vtkMedUtilities::NewArray(MED_FLOAT64); +} + +vtkDataArray* vtkMedUtilities::NewArray(med_field_type type) +{ + switch(type) + { + case MED_FLOAT64: + if(sizeof(double)==8 && sizeof(med_float)==8) + return vtkDoubleArray::New(); + vtkGenericWarningMacro("double type do not match med_float, aborting") + return NULL; + case MED_INT32: + if(sizeof(vtkIdType)==4) + return vtkIdTypeArray::New(); + if(sizeof(int)==4) + return vtkIntArray::New(); + if(sizeof(long)==4) + return vtkLongArray::New(); + vtkGenericWarningMacro("No vtk type matches MED_INT32, aborting") + return NULL; + case MED_INT64: + if(sizeof(vtkIdType)==8) + return vtkIdTypeArray::New(); + if(sizeof(long)==8) + return vtkLongArray::New(); + if(sizeof(long long)==8) + return vtkLongLongArray::New(); + vtkGenericWarningMacro("No vtk type matches MED_INT64, aborting") + ; + return NULL; + case MED_INT: + if(sizeof(med_int)==4) + return vtkMedUtilities::NewArray(MED_INT32); + if(sizeof(med_int)==8) + return vtkMedUtilities::NewArray(MED_INT64); + vtkGenericWarningMacro("No vtk type matches MED_INT, aborting") + return NULL; + default: + vtkGenericWarningMacro("the array type is not known, aborting.") + return NULL; + } +} + +vtkAbstractArray* vtkMedUtilities::NewArray(med_attribute_type type) +{ + switch(type) + { + case MED_ATT_FLOAT64 : + if(sizeof(double) == sizeof(med_float)) + return vtkDoubleArray::New(); + vtkGenericWarningMacro("double type do not match med_float, aborting"); + return NULL; + case MED_ATT_INT : + if(sizeof(vtkIdType) == sizeof(med_int)) + return vtkIdTypeArray::New(); + if(sizeof(int) == sizeof(med_int)) + return vtkIntArray::New(); + if(sizeof(long) == sizeof(med_int)) + return vtkLongArray::New(); + if(sizeof(long long) == sizeof(med_int)) + return vtkLongLongArray::New(); + vtkGenericWarningMacro("med_int type does not match known VTK type, aborting"); + return NULL; + case MED_ATT_NAME : + return vtkStringArray::New(); + } + return NULL; +} + +const char* vtkMedUtilities::GeometryName(med_geometry_type geometry) +{ + switch(geometry) + { + case MED_POINT1: + return "MED_POINT1"; + case MED_SEG2: + return "MED_SEG2"; + case MED_SEG3: + return "MED_SEG3"; + case MED_SEG4: + return "MED_SEG4"; + case MED_TRIA3: + return "MED_TRIA3"; + case MED_QUAD4: + return "MED_QUAD4"; + case MED_TRIA6: + return "MED_TRIA6"; + case MED_TRIA7: + return "MED_TRIA7"; + case MED_QUAD8: + return "MED_QUAD8"; + case MED_QUAD9: + return "MED_QUAD9"; + case MED_TETRA4: + return "MED_TETRA4"; + case MED_PYRA5: + return "MED_PYRA5"; + case MED_PENTA6: + return "MED_PENTA6"; + case MED_HEXA8: + return "MED_HEXA8"; + case MED_TETRA10: + return "MED_TETRA10"; + case MED_OCTA12: + return "MED_OCTA12"; + case MED_PYRA13: + return "MED_PYRA13"; + case MED_PENTA15: + return "MED_PENTA15"; + case MED_HEXA20: + return "MED_HEXA20"; + case MED_HEXA27: + return "MED_HEXA27"; + case MED_POLYGON: + return "MED_POLYGON"; + case MED_POLYHEDRON: + return "MED_POLYHEDRON"; + case MED_NO_GEOTYPE: + return "MED_NO_GEOTYPE"; + default: + return "UNKNOWN_GEOMETRY"; + } +} + +const char* vtkMedUtilities::EntityName(med_entity_type type) +{ + switch(type) + { + case MED_CELL: + return "MED_CELL"; + case MED_DESCENDING_FACE: + return "MED_DESCENDING_FACE"; + case MED_DESCENDING_EDGE: + return "MED_DESCENDING_EDGE"; + case MED_NODE: + return "MED_NODE"; + case MED_NODE_ELEMENT: + return "MED_NODE_ELEMENT"; + case MED_STRUCT_ELEMENT: + return "MED_STRUCT_ELEMENT"; + case MED_UNDEF_ENTITY_TYPE: + return "MED_UNDEF_ENTITY_TYPE"; + default: + return "UNKNOWN_ENTITY_TYPE "; + } +} + +const char* vtkMedUtilities::ConnectivityName(med_connectivity_mode conn) +{ + switch(conn) + { + case MED_NODAL: + return "MED_NODAL"; + case MED_DESCENDING: + return "MED_DESCENDING"; + case MED_NO_CMODE: + return "MED_NO_CMODE"; + default: + return "UNKNOWN_CONNECTIVITY_MODE"; + } +} + +const std::string vtkMedUtilities::SimplifyName(const char* medName) +{ + ostringstream sstr; + bool underscore=false; + bool space=false; + int l=strlen(medName); + for(int cc=0; cc(27 * floor((double)node / 27)); +} + +int vtkMedUtilities::GetNumberOfNodes(med_geometry_type geometry) +{ + switch(geometry) + { + case MED_POINT1: + return 1; + case MED_SEG2: + return 2; + case MED_SEG3: + return 3; + case MED_SEG4: + return 4; + case MED_TRIA3: + return 3; + case MED_QUAD4: + return 4; + case MED_TRIA6: + return 6; + case MED_TRIA7: + return 7; + case MED_QUAD8: + return 8; + case MED_QUAD9: + return 9; + case MED_TETRA4: + return 4; + case MED_PYRA5: + return 5; + case MED_PENTA6: + return 5; + case MED_HEXA8: + return 8; + case MED_TETRA10: + return 10; + case MED_OCTA12: + return 12; + case MED_PYRA13: + return 13; + case MED_PENTA15: + return 15; + case MED_HEXA20: + return 20; + case MED_HEXA27: + return 27; + case MED_POLYGON: + return -1; + case MED_POLYHEDRON: + return -1; + case MED_NO_GEOTYPE: + return 0; + default: + vtkGenericWarningMacro("No vtk type matches " + << vtkMedUtilities::GeometryName(geometry) + << ", aborting"); + return -1; + } +} + +int vtkMedUtilities::GetNumberOfSubEntity(med_geometry_type geometry) +{ + switch(geometry) + { + case MED_POINT1: + return 0; + case MED_SEG2: + return 2; + case MED_SEG3: + return 3; + case MED_SEG4: + return 4; + case MED_TRIA3: + return 3; + case MED_QUAD4: + return 4; + case MED_TRIA6: + return 3; + case MED_TRIA7: + return 3; + case MED_QUAD8: + return 4; + case MED_QUAD9: + return 4; + case MED_TETRA4: + return 4; + case MED_PYRA5: + return 5; + case MED_PENTA6: + return 5; + case MED_HEXA8: + return 6; + case MED_TETRA10: + return 4; + case MED_OCTA12: + return 8; + case MED_PYRA13: + return 5; + case MED_PENTA15: + return 5; + case MED_HEXA20: + return 6; + case MED_HEXA27: + return 6; + case MED_POLYGON: + return -1; + case MED_POLYHEDRON: + return -1; + case MED_NO_GEOTYPE: + return 0; + default: + vtkGenericWarningMacro("No vtk type matches " + << geometry + << ", aborting"); + return -1; + } +} + +med_entity_type vtkMedUtilities::GetSubType(med_entity_type type) +{ + switch(type) + { + case MED_CELL: + return MED_DESCENDING_FACE; + case MED_DESCENDING_FACE: + return MED_DESCENDING_EDGE; + case MED_DESCENDING_EDGE: + return MED_NODE; + default: + return MED_NODE; + } +} + +med_geometry_type vtkMedUtilities::GetSubGeometry( + med_geometry_type geometry, int index) +{ + switch(geometry) + { + case MED_SEG2: + return MED_POINT1; + case MED_SEG3: + return MED_POINT1; + case MED_SEG4: + return MED_POINT1; + + case MED_TRIA3: + return MED_SEG2; + case MED_TRIA6: + return MED_SEG3; + case MED_TRIA7: + return MED_SEG3; + + case MED_QUAD4: + return MED_SEG2; + case MED_QUAD8: + return MED_SEG3; + case MED_QUAD9: + return MED_SEG3; + + case MED_TETRA4: + return MED_TRIA3; + case MED_TETRA10: + return MED_TRIA6; + + case MED_PYRA5: + { + if(index==0) + return MED_QUAD4; + return MED_TRIA3; + } + case MED_PYRA13: + { + if(index==0) + return MED_QUAD8; + else + return MED_TRIA6; + } + + case MED_PENTA6: + { + if(index==0||index==1) + return MED_TRIA3; + else + return MED_QUAD4; + } + case MED_PENTA15: + { + if(index==0||index==1) + return MED_TRIA6; + else + return MED_QUAD8; + } + + case MED_HEXA8: + return MED_QUAD4; + case MED_HEXA20: + return MED_QUAD8; + case MED_HEXA27: + return MED_QUAD9; + default: + return MED_NONE; + } +} + +int vtkMedUtilities::FormatPolyhedronForVTK( + vtkMedFamilyOnEntityOnProfile* foep, vtkIdType index, + vtkIdList* ids ) +{ + vtkMedEntityArray* array = foep->GetFamilyOnEntity()->GetEntityArray(); + vtkMedIntArray* conn = array->GetConnectivityArray(); + vtkMedIntArray* faceIndex = array->GetFaceIndex(); + vtkMedIntArray* nodeIndex = array->GetNodeIndex(); + med_int start = faceIndex->GetValue(index)-1; + med_int end = faceIndex->GetValue(index+1)-1; + + // The format for the Polyhedrons is: + //(numCellFaces, numFace0Pts, id1, id2, id3, numFace1Pts,id1, id2, id3, ...) + ids->Reset(); + + if (array->GetConnectivity()==MED_NODAL) + { + ids->InsertNextId(end-start); + for (int ff = start; ffGetValue(ff)-1; + med_int fend = nodeIndex->GetValue(ff+1)-1; + ids->InsertNextId(fend-fstart); + for (med_int pt = fstart; ptGetVTKPointIndex(conn->GetValue(pt)-1); + if(realIndex < 0) + { + vtkGenericWarningMacro("this polyhedron is not on this profile"); + foep->SetValid(0); + return 0; + } + ids->InsertNextId(realIndex); + } + } + } + + if (array->GetConnectivity()==MED_DESCENDING) + { + ids->InsertNextId(end-start); + vtkSmartPointer subIds = vtkSmartPointer::New(); + + for (int i = 0 ; iGetSize(); i++) + { + int numPoints = + vtkMedUtilities::GetNumberOfSubEntity(nodeIndex->GetValue(i)); + ids->InsertNextId(numPoints); + + vtkMedEntity entity; + entity.EntityType = MED_DESCENDING_FACE; + entity.GeometryType = nodeIndex->GetValue(i); + + vtkMedEntityArray* theFaces = + array->GetParentGrid()->GetEntityArray(entity); + + theFaces->GetCellVertices(conn->GetValue(i)-1, subIds); + + for (int j = 0 ; j< numPoints; j++) + { + vtkIdType realIndex = foep->GetVTKPointIndex(subIds->GetId(j)); + if(realIndex < 0) + { + vtkGenericWarningMacro("this polyhedron is not on this profile"); + return 0; + } + ids->InsertNextId(realIndex); + } + } + } + return 1; +} + +void vtkMedUtilities::SplitGroupKey(const char* name, vtkstd::string& mesh, + vtkstd::string& entity, vtkstd::string& group) +{ + vtkstd::string remain; + remain=name; + mesh="*"; + entity="*"; + group="*"; + vtkstd::string header="*"; + + if(remain=="*") + { + return; + } + vtkstd::string::size_type pos; + // First get the header, which must be "GROUP" + pos=remain.find_first_of(vtkMedUtilities::Separator); + header=remain.substr(0, pos); + remain=remain.substr(pos+1, remain.size()-pos-1); + + // then get the mesh name + pos=remain.find_first_of(vtkMedUtilities::Separator); + mesh=remain.substr(0, pos); + if(mesh=="*"||pos==remain.size()-1) + return; + remain=remain.substr(pos+1, remain.size()-pos-1); + + // then the entity name (OnPoint or OnCell) + pos=remain.find_first_of(vtkMedUtilities::Separator); + entity=remain.substr(0, pos); + if(entity=="*"||pos==remain.size()-1) + return; + + // then the group + group=remain.substr(pos+1, remain.size()-pos-1); +} + +int vtkMedUtilities::GetParentNodeIndex(med_geometry_type parentGeometry, + int subEntityIndex, int subEntityNodeIndex) +{ + switch(parentGeometry) + { + case MED_TRIA3: + case MED_TRIA6: + case MED_TRIA7: + return MED_TRIA_CHILD_TO_PARENT_INDEX[subEntityIndex][subEntityNodeIndex]; + case MED_QUAD4: + case MED_QUAD8: + case MED_QUAD9: + return MED_QUAD_CHILD_TO_PARENT_INDEX[subEntityIndex][subEntityNodeIndex]; + case MED_TETRA4: + case MED_TETRA10: + return MED_TETRA_CHILD_TO_PARENT_INDEX[subEntityIndex][subEntityNodeIndex]; + case MED_PYRA5: + case MED_PYRA13: + return MED_PYRA_CHILD_TO_PARENT_INDEX[subEntityIndex][subEntityNodeIndex]; + case MED_PENTA6: + case MED_PENTA15: + return MED_PENTA_CHILD_TO_PARENT_INDEX[subEntityIndex][subEntityNodeIndex]; + case MED_HEXA8: + case MED_HEXA20: + case MED_HEXA27: + return MED_HEXA_CHILD_TO_PARENT_INDEX[subEntityIndex][subEntityNodeIndex]; + } + return -1; +} + +void vtkMedUtilities::ProjectConnectivity(med_geometry_type parentGeometry, + vtkIdList* parentIds, vtkIdList* subEntityIds, int subEntityIndex, bool invert) +{ + for(int subEntityNodeIndex=0; subEntityNodeIndex + GetNumberOfIds(); subEntityNodeIndex++) + { + int realIndex = subEntityNodeIndex; + if(invert) + realIndex = subEntityIds->GetNumberOfIds() - subEntityNodeIndex - 1; + parentIds->SetId(GetParentNodeIndex(parentGeometry, subEntityIndex, + subEntityNodeIndex), subEntityIds->GetId(realIndex)); + } +} + +std::string vtkMedUtilities::GetModeKey(int index, double frequency, int maxindex) +{ + std::ostringstream key; + key<<"["; + if(maxindex > 0) + { + int maxdecim = (int)floor(log(1.0*maxindex)/log(10.0)); + int decim = 0; + if(index > 0) + { + decim = (int)floor(log(1.0*index)/log(10.0)); + } + for(int i=decim; i>index; + const string freq_string=k.substr(index_end+1, string::npos); + stringstream freqsstr; + freqsstr<>frequency; + return 1; +} + +vtkMultiBlockDataSet* vtkMedUtilities::GetParent(vtkMultiBlockDataSet* root, + vtkStringArray* path) +{ + vtkMultiBlockDataSet* output=root; + vtkMultiBlockDataSet* parent=output; + for(int depth = 0; depthGetNumberOfValues(); depth++) + { + vtkStdString parentName = path->GetValue(depth); + bool found=false; + for(int blockId=0; blockIdGetNumberOfBlocks(); blockId++) + { + vtkInformation* metaData=parent->GetMetaData(blockId); + if(metaData->Has(vtkCompositeDataSet::NAME())) + { + const char* blockName=metaData->Get(vtkCompositeDataSet::NAME()); + if(parentName==blockName && + vtkMultiBlockDataSet::SafeDownCast( + parent->GetBlock(blockId))!=NULL) + { + parent=vtkMultiBlockDataSet::SafeDownCast(parent->GetBlock(blockId)); + found=true; + break; + } + } + } + if (!found) + { + // If I am here, it means that I did not find any block with the good name, create one + int nb=parent->GetNumberOfBlocks(); + vtkMultiBlockDataSet* block=vtkMultiBlockDataSet::New(); + parent->SetBlock(nb, block); + block->Delete(); + parent->GetMetaData(nb)->Set(vtkCompositeDataSet::NAME(), + parentName.c_str()); + parent=block; + } + } + return parent; +} + +int vtkMedUtilities::SizeOf(med_attribute_type type) +{ + switch(type) + { + case MED_ATT_FLOAT64 : return sizeof(med_float); + case MED_ATT_INT : return sizeof(med_int); + case MED_ATT_NAME : return MED_NAME_SIZE * sizeof(char); + } + return 0; +} + +bool operator==(const vtkMedComputeStep& cs0, const vtkMedComputeStep& cs1) +{ + return cs0.IterationIt == cs1.IterationIt && cs0.TimeIt == cs1.TimeIt; +} + +bool operator!=(const vtkMedComputeStep& cs0, const vtkMedComputeStep& cs1) +{ + return cs0.IterationIt != cs1.IterationIt || cs0.TimeIt != cs1.TimeIt; +} + +bool operator<(const vtkMedComputeStep& cs0, const vtkMedComputeStep& cs1) +{ + if(cs0.IterationIt != cs1.IterationIt) + return cs0.IterationIt < cs1.IterationIt; + return cs0.TimeIt < cs1.TimeIt; +} + +bool operator==(const vtkMedEntity& e0, const vtkMedEntity& e1) +{ + return e0.EntityType == e1.EntityType && e0.GeometryType == e1.GeometryType; +} + +bool operator!=(const vtkMedEntity& e0, const vtkMedEntity& e1) +{ + return e0.EntityType != e1.EntityType || e0.GeometryType != e1.GeometryType; +} + +bool operator<(const vtkMedEntity& e0, const vtkMedEntity& e1) +{ + if(e0.EntityType != e1.EntityType) + return e0.EntityType < e1.EntityType; + return e0.GeometryType < e1.GeometryType; +} diff --git a/src/Plugins/MedReader/IO/vtkMedUtilities.h b/src/Plugins/MedReader/IO/vtkMedUtilities.h new file mode 100644 index 00000000..551635df --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedUtilities.h @@ -0,0 +1,468 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _vtkMedUtilities_h_ +#define _vtkMedUtilities_h_ + +#include "vtkObject.h" +#include "vtkSmartPointer.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkStringArray.h" +#include "vtkMedSetGet.h" +#include "vtkMed.h" +#include "vtkMedReader.h" + +#include +#include +#include +#include +#include +#include + +class vtkDataArray; +class vtkMedMesh; +class vtkMedFamily; +class vtkMedGroup; +class vtkIdList; +class vtkMutableDirectedGraph; +class vtkInformationIntegerKey; +class vtkInformationObjectBaseKey; + +//BTX +class vtkMedComputeStep +{ +public : + med_int IterationIt; + med_int TimeIt; + med_float TimeOrFrequency; + + vtkMedComputeStep() + { + this->IterationIt = MED_NO_IT; + this->TimeIt = MED_NO_DT; + this->TimeOrFrequency = MED_UNDEF_DT; + } +}; + +bool operator==(const vtkMedComputeStep& cs0, const vtkMedComputeStep& cs1); +bool operator!=(const vtkMedComputeStep& cs0, const vtkMedComputeStep& cs1); +bool operator<(const vtkMedComputeStep& cs0, const vtkMedComputeStep& cs1); + +class vtkMedEntity +{ +public : + + vtkMedEntity() : EntityType(MED_NODE), + GeometryType(MED_NONE) + { + } + + vtkMedEntity(med_entity_type type, med_geometry_type geometry) : + EntityType(type), + GeometryType(geometry) + { + } + + ~vtkMedEntity() + { + } + + vtkMedEntity(const vtkMedEntity& entity) : + EntityType(entity.EntityType), + GeometryType(entity.GeometryType) + { + this->GeometryName = entity.GeometryName; + } + + void operator=(const vtkMedEntity& entity) + { + this->EntityType = entity.EntityType; + this->GeometryType = entity.GeometryType; + this->GeometryName = entity.GeometryName; + } + + med_entity_type EntityType; + med_geometry_type GeometryType; + std::string GeometryName; +}; + +bool operator==(const vtkMedEntity& cs0, const vtkMedEntity& cs1); +bool operator!=(const vtkMedEntity& cs0, const vtkMedEntity& cs1); +bool operator<(const vtkMedEntity& cs0, const vtkMedEntity& cs1); +//ETX + +class VTK_EXPORT vtkMedUtilities +{ +public: + static vtkInformationIntegerKey* ELNO(); + static vtkInformationIntegerKey* ELGA(); + static vtkInformationStringVectorKey* BLOCK_NAME(); + static vtkInformationObjectBaseKey* STRUCT_ELEMENT(); + static vtkInformationIntegerKey* STRUCT_ELEMENT_INDEX(); + + // Description: + // return an array to store the coordinates of nodes. + // the type of the elements is the same as the one in the med file + static vtkDataArray* NewCoordArray(); + + // Description: + // returns an array to store data of a given type. + // the type corresponds to med types. + static vtkDataArray* NewArray(med_field_type type); + static vtkAbstractArray* NewArray(med_attribute_type type); + + //BTX + enum + { + OnPoint, OnCell + }; + //ETX + + //BTX + // Description: + // returns a name for the given med_geometry_type + static const char* GeometryName(med_geometry_type geometry); + + // Description: + // returns a name for the given med_geometry_type + static const char* EntityName(med_entity_type type); + + // Description: + // returns a name for the given med_connectivity_mode + static const char* ConnectivityName(med_connectivity_mode conn); + + static const std::string SimplifyName(const char* medName); + + static const std::string FamilyKey(const char* meshName, int pointOrCell, + const char* familyName); + static const std::string GroupKey(const char* meshName, int pointOrCell, + const char* groupName); + + static const std::string EntityKey(const vtkMedEntity&); + + static int GetNumberOfPoint(med_geometry_type geometry); + static int GetDimension(med_geometry_type geometry); + + // returns the VTK cell type (as described in the vtkCellType.h file) + // corresponding to the given med_geometry_type + static int GetVTKCellType(med_geometry_type geometry); + + // returns the number of sub entity : the number of faces for cells, + // the number of edges for faces, the number of nodes for edges + static int GetNumberOfSubEntity(med_geometry_type geometry); + + // returns the number of Nodes + static int GetNumberOfNodes(med_geometry_type geometry); + //ETX + + static med_entity_type GetSubType(med_entity_type type); + static med_geometry_type GetSubGeometry(med_geometry_type geometry, + int index); + + static int GetParentNodeIndex(med_geometry_type parentGeometry, + int subEntityIndex, int subEntityNodeIndex); + + // Description : + // Project the ids gathered in the sub entity to the parent entity. + // used for MED_DESC connectivity. + // Rem : no check is performed, and do not work for + // MED_POLYHEDRE and MED_POLYGON + static void ProjectConnectivity(med_geometry_type parentGeometry, + vtkIdList* parentIds, vtkIdList* subEntityIds, int subEntityIndex, + bool invert); + + static char Separator; + + static const char* NoGroupName; + static const char* OnCellName; + static const char* OnPointName; + + //BTX + static void SplitGroupKey(const char* name, vtkstd::string& mesh, + vtkstd::string& entity, vtkstd::string& group); + + static std::string GetModeKey(int index, double frequency, int maxindex); + static int GetModeFromKey(const char*, int& index, double& frequency); + + static int MedToVTKIndex(int vtktype, int node); + + static vtkMultiBlockDataSet* GetParent(vtkMultiBlockDataSet* root, + vtkStringArray* path); + + // Description: + // Format the id list so that it respects the VTK format for polyhedrons : + // numfaces, npts_face0, pt0, ... npts_face1, pt1 .... + static int FormatPolyhedronForVTK(vtkMedFamilyOnEntityOnProfile*, + vtkIdType, vtkIdList*); + + static int SizeOf(med_attribute_type type); + //ETX +}; + +//BTX + +template +class vtkObjectVector: public std::vector > +{ +}; + +template +class vtkMedComputeStepMap: public + std::map > > +{ +public : + void AddObject(const vtkMedComputeStep& cs, T* obj) + { + (*this)[cs.TimeIt][cs.IterationIt] = obj; + this->TimeIt[cs.TimeOrFrequency] = cs.TimeIt; + } + + T* GetObject(const vtkMedComputeStep& cs) + { + if(this->find(cs.TimeIt) == this->end()) + return NULL; + + std::map >& itmap = (*this)[cs.TimeIt]; + + if(itmap.find(cs.IterationIt) == itmap.end()) + return NULL; + + return itmap[cs.IterationIt]; + } + + med_int GetNumberOfObject() + { + med_int nb = 0; + typename vtkMedComputeStepMap::iterator it = this->begin(); + while(it != this->end()) + { + nb += it->second.size(); + it++; + } + return nb; + } + + T* GetObject(med_int id) + { + med_int nb = 0; + if(id < 0) + return NULL; + + typename vtkMedComputeStepMap::iterator it = this->begin(); + while(it != this->end()) + { + std::map >& itmap = it->second; + nb += itmap.size(); + if(id < nb) + { + typename std::map >::iterator iterationit = + itmap.begin(); + for(int ii=0; iisecond; + } + it++; + } + return NULL; + } + + T* FindObject(const vtkMedComputeStep& cs, int strategy) + { + // first test if the given compute step is present + T* obj = this->GetObject(cs); + if(obj != NULL) + return obj; + + if(this->size() == 0) + return NULL; + + // let us first find the iterator that corresponds to the given time + med_int timeit = this->FindTimeIterator(cs.TimeOrFrequency, cs.TimeIt); + + std::map >& itmap = + (*this)[timeit]; + + if(itmap.size() == 0) + return NULL; + + if(strategy == vtkMedReader::PhysicalTime + || strategy == vtkMedReader::Modes) + { + // in this strategies, we return the last iteration for each time. + return itmap.rbegin()->second; + } + else if(strategy == vtkMedReader::Iteration) + { + // in this case, we look for the real iteration + typename std::map >::iterator iterationit + = itmap.lower_bound(cs.IterationIt); + + // if this is not exactly the same step and if this is not the first + // step, rool back one step to choose the one just before the asked time. + if(iterationit->first != cs.IterationIt && iterationit != itmap.begin()) + iterationit--; + + // the time iterator asked for is higher than all times, + // let us pick the last one. + if(iterationit == itmap.end()) + iterationit--; + + return iterationit->second; + } + } + + void GatherTimes(std::set& times) + { + typename std::map::iterator it + = this->TimeIt.begin(); + while(it != this->TimeIt.end()) + { + times.insert(it->first); + it++; + } + } + + void GatherIterations(med_float time, std::set& iterations) + { + med_int timeit = this->FindTimeIterator(time, -1); + if(timeit == -1) + return; + + std::map >& itmap = + (*this)[timeit]; + + typename std::map >::iterator it = + itmap.begin(); + + while(it != itmap.end()) + { + iterations.insert(it->first); + it++; + } + } + +protected : + + med_int FindTimeIterator(med_float time, med_int defaultit) + { + if(this->TimeIt.size() == 0) + return defaultit; + + typename std::map::iterator it + = this->TimeIt.lower_bound(time); + + // if this is not exactly the same step and if this is not the first step, + // rool back one step to choose the one just before the asked time. + if(it->first != time && it != this->TimeIt.begin()) + it--; + + // if the time iterator asked for is higher than all times, + // let us pick the last one. + if(it == this->TimeIt.end()) + it--; + + return it->second; + } + + std::map TimeIt; +}; + +template +class vtkList: public std::list +{ +}; + +template +struct IsSameTraits +{ + static const bool IsSame() + { + return false; + } +}; + +template +struct IsSameTraits +{ + static const bool IsSame() + { + return true; + } +}; + +#define PRINT_IVAR(os, indent, name) \ + os << indent << #name << " : " << name << endl; + +#define PRINT_STRING(os, indent, name) \ + os << indent << #name << " : " << ( name ? name : "(void)") << endl; + +#define PRINT_OBJECT(os, indent, name) \ + os << indent << #name << " : " ;\ + if(name != NULL) \ + {\ + os << endl;\ + name->PrintSelf(os, indent.GetNextIndent());\ + }\ + else os << "(NULL)" << endl; + +#define PRINT_VECTOR(os, indent, name, size) \ +{\ + os << indent << #name << " : (";\ + for(vtkIdType _index = 0; _indexsize();\ + for(vtkIdType _index = 0; _index < _size; _index++)\ + {\ + os << indent << #name << _index << " : " << endl;\ + if(name->at(_index) != NULL)\ + name->at(_index)->PrintSelf(os, indent.GetNextIndent());\ + else\ + os << indent.GetNextIndent() << "(NULL)" << endl;\ + }\ +} + +#define PRINT_STRING_VECTOR(os, indent, name)\ +{\ + os << indent << #name << ": ";\ + for(int _comp = 0; _compname->size(); _comp++)\ + {\ + os << this->name->at(_comp)->GetString();\ + if(_comp < this->name->size()-1)\ + os << ", ";\ + }\ + os << endl;\ +} + +#define PRINT_MED_STRING(os, indent, name)\ + os << indent << #name << ": " << this->name->GetString() << endl; \ + +//ETX + +#endif diff --git a/src/Plugins/MedReader/IO/vtkMedVariableAttribute.cxx b/src/Plugins/MedReader/IO/vtkMedVariableAttribute.cxx new file mode 100644 index 00000000..cb0f7d52 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedVariableAttribute.cxx @@ -0,0 +1,60 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkMedVariableAttribute.h" + +#include "vtkObjectFactory.h" +#include "vtkMedUtilities.h" +#include "vtkMedStructElement.h" +#include "vtkMedFile.h" +#include "vtkMedDriver.h" + +#include +#include +#include +using namespace std; + +vtkCxxRevisionMacro(vtkMedVariableAttribute, "$Revision$") +vtkStandardNewMacro(vtkMedVariableAttribute); + +vtkCxxSetObjectMacro(vtkMedVariableAttribute, ParentStructElement, vtkMedStructElement); + +vtkMedVariableAttribute::vtkMedVariableAttribute() +{ + this->Name = NULL; + this->AttributeType = MED_ATT_UNDEF; + this->NumberOfComponent = 0; + this->ParentStructElement = NULL; +} + +vtkMedVariableAttribute::~vtkMedVariableAttribute() +{ + this->SetName(NULL); + this->SetParentStructElement(NULL); +} + +void vtkMedVariableAttribute::Load(vtkMedEntityArray* array) +{ + this->GetParentStructElement()->GetParentFile()->GetMedDriver()->LoadVariableAttribute(this, array); +} + +void vtkMedVariableAttribute::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/IO/vtkMedVariableAttribute.h b/src/Plugins/MedReader/IO/vtkMedVariableAttribute.h new file mode 100644 index 00000000..f3526757 --- /dev/null +++ b/src/Plugins/MedReader/IO/vtkMedVariableAttribute.h @@ -0,0 +1,83 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkMedVariableAttribute_h_ +#define __vtkMedVariableAttribute_h_ + +#include "vtkObject.h" +#include "vtkMed.h" +#include "vtkMedSetGet.h" + +class vtkAbstractArray; +class vtkMedStructElement; +class vtkMedEntityArray; + +class VTK_EXPORT vtkMedVariableAttribute : public vtkObject +{ +public : + static vtkMedVariableAttribute* New(); + vtkTypeRevisionMacro(vtkMedVariableAttribute, vtkObject) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // This is the name of this attribute + vtkSetStringMacro(Name); + vtkGetStringMacro(Name); + + // Description: + // The iterator in the med file of this constant attribute + vtkSetMacro(MedIterator, med_int); + vtkGetMacro(MedIterator, med_int); + + // Description: + // The Geometry type this structural elements lies on. + vtkSetMacro(AttributeType, med_attribute_type); + vtkGetMacro(AttributeType, med_attribute_type); + + // Description: + // The dimension of this structural elements model + vtkSetMacro(NumberOfComponent, med_int); + vtkGetMacro(NumberOfComponent, med_int); + + // Description: + // The Structural element on which lies this attribute + virtual void SetParentStructElement(vtkMedStructElement*); + vtkGetObjectMacro(ParentStructElement, vtkMedStructElement); + + // Description: + // Load the values associated with this attribute for the given entity array; + void Load(vtkMedEntityArray*); + +protected: + vtkMedVariableAttribute(); + virtual ~vtkMedVariableAttribute(); + + char *Name; + med_int MedIterator; + med_attribute_type AttributeType; + med_int NumberOfComponent; + + vtkMedStructElement* ParentStructElement; + +private: + vtkMedVariableAttribute(const vtkMedVariableAttribute&); // Not implemented. + void operator=(const vtkMedVariableAttribute&); // Not implemented. +}; + +#endif //__vtkMedVariableAttribute_h_ diff --git a/src/Plugins/MedReader/ParaViewPlugin/CMakeLists.txt b/src/Plugins/MedReader/ParaViewPlugin/CMakeLists.txt new file mode 100644 index 00000000..c03f2670 --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/CMakeLists.txt @@ -0,0 +1,110 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +set(MEDREADER_HDRS) +set(EXTRACTGROUP_HDRS) + +include(${MedReader_BINARY_DIR}/IO/vtkMedReader_IOKit.cmake) + +include_directories(${VTK_MEDREADER_IO_HEADER_DIR}) + +add_definitions( -I${CMAKE_CURRENT_BINARY_DIR}/../IO ) + +foreach(class ${VTK_MEDREADER_IO_CLASSES}) + set(MEDREADER_HDRS ${MEDREADER_HDRS} ${VTK_MEDREADER_IO_HEADER_DIR}/${class}.h) +endforeach(class) + +foreach(class ${VTK_MEDREADER_IO_CLASSES_ABSTRACT}) + set_source_files_properties(${VTK_MEDREADER_IO_HEADER_DIR}/${class}.h PROPERTIES ABSTRACT 1) +endforeach(class) + +foreach(class ${VTK_MEDREADER_IO_CLASSES_WRAP_EXCLUDE}) + set_source_files_properties(${VTK_MEDREADER_IO_HEADER_DIR}/${class}.h PROPERTIES WRAP_EXCLUDE 1) +endforeach(class) + +SET(SM_SRCS + vtkSMMedGroupSelectionDomain.cxx + ) + +IF(PARAVIEW_BUILD_QT_GUI) + + QT4_WRAP_UI(CLIENT_UI_SRCS + Resources/UI/MedReaderPanel.ui + Resources/UI/ExtractGroupPanel.ui + ) + + # create a plugin that implements an object panel for the reader + SET(CLIENT_SRCS + pqMedReaderPanel.cxx + pqExtractGroupPanel.cxx + ) + + QT4_WRAP_CPP(MOC_SRCS + pqMedReaderPanel.h + pqExtractGroupPanel.h + ) + + ADD_PARAVIEW_OBJECT_PANEL(MEDREADER_IFACES MEDREADER_IFACE_SRCS + CLASS_NAME pqMedReaderPanel + XML_NAME MedReader + XML_GROUP sources + ) + + ADD_PARAVIEW_OBJECT_PANEL(EXTRACTGROUP_IFACES EXTRACTGROUP_IFACE_SRCS + CLASS_NAME pqExtractGroupPanel + XML_NAME ExtractGroup + XML_GROUP filters + ) + + # create the med reader plugin itself + ADD_PARAVIEW_PLUGIN(MedReaderPlugin "4.0" + SERVER_MANAGER_SOURCES ${MEDREADER_HDRS} ${EXTRACTGROUP_HDRS} ${SM_SRCS} + SERVER_MANAGER_XML Resources/MedReaderServer.xml + GUI_INTERFACES ${MEDREADER_IFACES} ${EXTRACTGROUP_IFACES} + GUI_RESOURCES Resources/pqMedReader.qrc + GUI_SOURCES ${CLIENT_SRCS} + ${CLIENT_UI_SRCS} + ${MOC_SRCS} + ${MEDREADER_IFACE_SRCS} + ${EXTRACTGROUP_IFACE_SRCS} + ) + +ELSE(PARAVIEW_BUILD_QT_GUI) + + # create the med reader plugin itself + ADD_PARAVIEW_PLUGIN(MedReaderPlugin "4.0" + SERVER_MANAGER_SOURCES ${MEDREADER_HDRS} ${EXTRACTGROUP_HDRS} ${SM_SRCS} + SERVER_MANAGER_XML Resources/MedReaderServer.xml + ) + +ENDIF(PARAVIEW_BUILD_QT_GUI) + +TARGET_LINK_LIBRARIES(MedReaderPlugin vtkMedReader) + +# Install +INSTALL( + TARGETS MedReaderPlugin + RUNTIME DESTINATION lib/paraview + LIBRARY DESTINATION lib/paraview + ARCHIVE DESTINATION lib/paraview +) + + + + diff --git a/src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqCellData16.png b/src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqCellData16.png new file mode 100755 index 0000000000000000000000000000000000000000..8a6f2a6cc9a441e1fb4a1dfc63d8060ea93dab78 GIT binary patch literal 899 zcmV-}1AP36P)s~7#$$(SWFU8GbZ8({Xk{QrNlj4iWF>9@ z00P%ZL_t(|+MSWjYg}a%#((d7Z>BS8(j-HSPLkFnZ2}qSA_jF~l~ScP;zAIlxDprs z11<{P>dJ-d=+=!&Kv2YjNEM5%Np01(aYAj9*6GLGr0JcRoBQ?N`yLlpiyIMq;J|?g zeuwisiht;px~^3F+*;YOZj#B1V*}31eq=uxtmyN(74smH4U{e^#8xY$?|fs#1voaX z_tpATz2xxf=wNAKex^2cX#a4jH}%y0NFBYi-HCIPuZ zKkj@mJ6#*EADq&oj}B9vIigihg{0l0-2EMM_lh{_17%H25Tz3Bos_RHT$49HjmO+t zzZ^YMADMVzwt_zVJSxi}@W}72u=(o>GyNUPS`+{i$0*gFQCSkIsnyE~5V{v{(|G&f zEY3@(!Ed7c4Mbbip#>(YhjGg#BnqH^7;7zN{VZFJ@7WHu0A1IQ>DVL?Y^GG+h3iWw zf0Jl8q&>bs?_&p0<8#O#KM}4h5*kQz2vQV)TXL{@vTKR99d3RL-c^$87xrtn;i0nlrnc=zsi zj07#n!s5CWRz28>;D?)*puIz58#>8DfZW(oK7b3f;y8xj4idMy+7h;Q6_4x{>LbEV z1dPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2ipP? z3mzv)_CX>@2HRA^-&M@dak?_?!z0008@ zNklc$t2Flo%`{=E~bbJ7vc|| z)j6E!;W@%Tcz#sHQr&i@%hL82KLzg|8nNTE#jtpEm-BY0jlb41ONfdHMyFzUXTJ80 z0EdCsb19|{s+~T%C&|;#Oo#*_)T@N$dE9IB=;Q`n$_N12Cy8YC$)ig%{5XFZVAhI9 zNPjYUaN^*}(wneMmSl3c7!N%>sUm9rGpM?;!M#2oNLI6aLT?!{dw)31P2wlM!~vB8clhHMYiy^h=f+M%Ge zrtWp(M;!@jEh-=Vz(wGF3&<|jcsQ4mGj1TeyBrmDLo7==ZMU^z^Nzh#7O$d|_~))N zccH*;;0o}I+$%i;lmNANKwg>{=FKOv((5SWeE7YgVh=GIT@Fii`TXMr^CJI+M+W8C zYy0KaV}pe6jN{#xWS0LyW>b{2Juxl;Q~$Q`7p^{B=RlLJ#707*qoM6N<$g4EEj AasU7T literal 0 HcmV?d00001 diff --git a/src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqPointData16.png b/src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqPointData16.png new file mode 100755 index 0000000000000000000000000000000000000000..50367eaac86b22e10fc66fa54da0f5564b10ceab GIT binary patch literal 189 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G_YAk0{w5<>&kwORZ^T?FMZD&kda=VE{-7;w~`YiSVfrKm_GgITzNG8 z!2kc%t0X0WpikEJP(p0I!0IYBr&*G7q9xX>$(86cyR~>X$9l$svr}3a1LGE02)Hwf aGBD&WkYK!*@x=saDubu1pUXO@geCwL{x@v^ literal 0 HcmV?d00001 diff --git a/src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqQuadratureData16.png b/src/Plugins/MedReader/ParaViewPlugin/Resources/Icons/pqQuadratureData16.png new file mode 100755 index 0000000000000000000000000000000000000000..ff6e19953579565a611b3ada1ee1a96c73a53241 GIT binary patch literal 391 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85p<)L71^VC4M4MkiEpy*OmPyqc|5I>nqd0K+_o6JzX3_EKX0I zytlW-K%iA#+@DeJ0Bb_{AV5b zbY}U-%f*Zh3<1+r?`6uk^Bgvq-)s2d_dW)OkWg2Kl5>LUrz|g5pWmdTsdUD&c;AI6 zVTNF@s%k*lOUXP)`MBBg5zu#&XV450q#a-6$>wS$Ym;86#Jsb@J{Pvm20!(p5J*Z;y3$TWT#<}X6aA + + + + diff --git a/src/Plugins/MedReader/ParaViewPlugin/Resources/MedReaderServer.xml b/src/Plugins/MedReader/ParaViewPlugin/Resources/MedReaderServer.xml new file mode 100644 index 00000000..97a4e372 --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/Resources/MedReaderServer.xml @@ -0,0 +1,494 @@ + + + + + + + + This property specifies the file name for the MED reader. + + + + + + + + + + + + + + + This property lists which cell-centered arrays to read. + + + + + + + + + + + + + + + This property lists which point-centered arrays to read. + + + + + + + + + + + + + + + This property lists which integration-point-centered arrays to read. + + + + + + + + + + + + + + + This property lists which integration-point-centered arrays to read. + + + + + + + + + + + + + + + This property can be used to select the cell types to load. + Example : ['MED_CELL/MED_TRIA3'] + + + + + + + + + + + + + + + + Set the groups on cells to be loaded. + Example : SetGroups(['GROUP/MAILLAGE/OnCell/GROUP_NAME', + 'GROUP/MAILLAGE/OnPoints/GROUP_NAME']). + + + + + + + + + + + + Information property indicating the update stamp of the SIL. Every + time the SIL is rebuild, this + time stamp is changed. + + + + + + + + + + + + The animation modes defines how the animation controls of ParaView + browse the computing steps available in the med file. + Default : It is the same as "Times" if there is any time defined + in the med file. + It is the same as "Iteration" if there is no times but iterations. + Times : The reader advertise the availbale times in the med file. + If there are multiple iterations for a given time, + the reader will load the last one. + Iterations : You also have to specify the TimeIndexForIterations + parameter. The reader will then advertise iterations at the given + time index. + Modes : This mode is made for modal analysis post-processing : all + selected frequencies (use the FrequencyArrayStatus property) + are loaded so that the user can easily switch from + a frequency to another. + The reader reports no time but a time range of -PI/PI. + + + + + + + + + + + + + + Available timestep values. + + + + + + + + + + + + + + + This property lists which frequencies are in the med file for + modal analysis. + + + + + + + + + + + Set the strategy to cache data read from the disk. + 0 : Nothing. The reader tries to minimize the memory footprint, + but will read data very often from the disk. Choose this if your + dataset is large and memory is an issue. + 1 : Geometry. The reader will cache the geometry, but not field + values. A each time change, field values will be re-read from + disk. Good if your dataset fits in memory but not your time steps. + 2 : All (Default). The reader will keep all the geometry and fields + read from disk over time. Choose this if memory is not an issue. + + + + + + + If this flag is set, the reader will generate a vector field for + each field in the file that has 2 or more components. + If the field has 2 components, a third compoenent with the value + 0 will be added. + If the field has more than 3 components, the first 3 components will + be extracted. + + + + + + + + + + + + + + + + + + + This property specifies the input to the Level Scalars filter. + + + + + + + + + + + + + + + This property can be used to select the cell types to load. + Example : ['MED_MAILLE/MED_TRIA3'] + + + + + + + + + + + + + + + + + Set the groups on cells to be loaded. + Example : SetGroups(['GROUP/MAILLAGE/OnCell/GROUP_NAME', + 'GROUP/MAILLAGE/OnPoints/GROUP_NAME']). + + + + + + + + + + + + Information property indicating the update stamp of the SIL. Every + time the SIL is rebuild, this + time stamp is changed. + + + + + + + If set to true, this filter will prune the empty parts in the output. + If not, empty datasets will be kept. + + + + + + + + + + + + + + + + This property specifies the input to the Generate Structural Element filter. + + + + + + diff --git a/src/Plugins/MedReader/ParaViewPlugin/Resources/UI/ExtractGroupPanel.ui b/src/Plugins/MedReader/ParaViewPlugin/Resources/UI/ExtractGroupPanel.ui new file mode 100644 index 00000000..5913a23b --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/Resources/UI/ExtractGroupPanel.ui @@ -0,0 +1,141 @@ + + + ExtractGroupPanel + + + + 0 + 0 + 649 + 786 + + + + + 0 + 0 + + + + Form + + + + 9 + + + + + + 0 + 1 + + + + Supports + + + + 6 + + + 9 + + + + + true + + + 1 + + + + Group + + + + + + + 0 + 100 + + + + QAbstractItemView::ExtendedSelection + + + false + + + + + + + + Cell Type + + + + + + + 0 + 100 + + + + QAbstractItemView::ExtendedSelection + + + false + + + + + + + + + + + + + + Prune Output + + + true + + + + + + + + pqTreeView + QTreeView +

    pqTreeView.h
    + + + + + + + 10 + + + 10 + + + false + + + false + + + true + + + diff --git a/src/Plugins/MedReader/ParaViewPlugin/Resources/UI/MedReaderPanel.ui b/src/Plugins/MedReader/ParaViewPlugin/Resources/UI/MedReaderPanel.ui new file mode 100644 index 00000000..4faaa550 --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/Resources/UI/MedReaderPanel.ui @@ -0,0 +1,286 @@ + + + MedReaderPanel + + + + 0 + 0 + 649 + 839 + + + + + 0 + 0 + + + + Form + + + + 9 + + + + + + 0 + 1 + + + + Supports + + + + 6 + + + 9 + + + + + true + + + 1 + + + + Group + + + + + + + 0 + 100 + + + + QAbstractItemView::ExtendedSelection + + + false + + + + + + + + Cell Type + + + + + + + 0 + 100 + + + + QAbstractItemView::ExtendedSelection + + + false + + + + + + + + + + + + + + + 0 + 1 + + + + Fields + + + + 6 + + + 9 + + + + + + 0 + 100 + + + + false + + + + Variables + + + + + + + + Generate Vectors + + + + + + + + + + Qt::Vertical + + + + 0 + 40 + + + + + + + + Animation + + + + + + + + Animation Mode + + + + + + + + + + + + + + Time + + + + + + + + + + + + + 0 + 100 + + + + false + + + + Modes + + + + + + + + + + + Qt::Vertical + + + + 0 + 40 + + + + + + + + Cache + + + + + + + + Strategy + + + + + + + + + + + + + + + + pqTreeWidget + QTreeWidget +
    pqTreeWidget.h
    +
    + + pqTreeView + QTreeView +
    pqTreeView.h
    +
    +
    + + + + + 10 + + + 10 + + + false + + + false + + + true + + +
    diff --git a/src/Plugins/MedReader/ParaViewPlugin/Resources/pqMedReader.qrc b/src/Plugins/MedReader/ParaViewPlugin/Resources/pqMedReader.qrc new file mode 100644 index 00000000..bb1f914a --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/Resources/pqMedReader.qrc @@ -0,0 +1,9 @@ + + + Icons/pqCellData16.png + Icons/pqPointData16.png + Icons/pqQuadratureData16.png + MedReaderClient.xml + Icons/pqElnoData16.png + + diff --git a/src/Plugins/MedReader/ParaViewPlugin/pqExtractGroupPanel.cxx b/src/Plugins/MedReader/ParaViewPlugin/pqExtractGroupPanel.cxx new file mode 100644 index 00000000..095d9b5e --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/pqExtractGroupPanel.cxx @@ -0,0 +1,170 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "pqExtractGroupPanel.h" +#include "ui_ExtractGroupPanel.h" + +#include "vtkProcessModule.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkInformation.h" +#include "vtkIntArray.h" +#include "vtkSMDoubleVectorProperty.h" +#include "vtkSMIntVectorProperty.h" +#include "vtkSMStringVectorProperty.h" +#include "vtkSMProxy.h" +#include "vtkEventQtSlotConnect.h" +#include "vtkPVSILInformation.h" +#include "vtkGraph.h" +#include "vtkSMPropertyHelper.h" +#include "vtkStringArray.h" +#include "vtkDataSetAttributes.h" + +#include "vtkMedUtilities.h" + +#include "pqTreeWidget.h" +#include "pqTreeWidgetItemObject.h" +#include "pqSMAdaptor.h" +#include "pqProxy.h" +#include "pqPropertyManager.h" +#include "pqSILModel.h" +#include "pqProxySILModel.h" +#include "pqTreeViewSelectionHelper.h" +#include "pqTreeWidgetSelectionHelper.h" +#include "pqPropertyLinks.h" + +#include + +class pqExtractGroupPanel::pqUI : public QObject, public Ui::ExtractGroupPanel +{ +public: + pqUI(pqExtractGroupPanel* p) : + QObject(p) + { + this->VTKConnect = vtkSmartPointer::New(); + this->SILUpdateStamp = -1; + } + + ~pqUI() + { + } + + pqSILModel SILModel; + vtkSmartPointer VTKConnect; + pqPropertyLinks Links; + pqProxySILModel* entityModel; + pqProxySILModel* groupModel; + int SILUpdateStamp; +}; + +pqExtractGroupPanel::pqExtractGroupPanel(pqProxy* object_proxy, QWidget* p) : + Superclass(object_proxy, p) +{ + this->UI = new pqUI(this); + this->UI->setupUi(this); + + pqProxySILModel* proxyModel; + + // connect groups to groupsRoot + proxyModel = new pqProxySILModel("GroupTree", &this->UI->SILModel); + proxyModel->setSourceModel(&this->UI->SILModel); + this->UI->Groups->setModel(proxyModel); + this->UI->Groups->setHeaderHidden(true); + + this->UI->groupModel = new pqProxySILModel("Groups", &this->UI->SILModel); + this->UI->groupModel->setSourceModel(&this->UI->SILModel); + + // connect cell types to "EntityRoot" + proxyModel = new pqProxySILModel("EntityTree", &this->UI->SILModel); + proxyModel->setSourceModel(&this->UI->SILModel); + this->UI->Entity->setModel(proxyModel); + this->UI->Entity->setHeaderHidden(true); + + this->UI->entityModel = new pqProxySILModel("Entity", &this->UI->SILModel); + this->UI->entityModel->setSourceModel(&this->UI->SILModel); + + this->updateSIL(); + + this->UI->Groups->header()->setStretchLastSection(true); + this->UI->Entity->header()->setStretchLastSection(true); + + this->linkServerManagerProperties(); + + QList treeWidgets = this->findChildren (); + foreach (pqTreeWidget* tree, treeWidgets) + { + new pqTreeWidgetSelectionHelper(tree); + } + + QList treeViews = this->findChildren (); + foreach (pqTreeView* tree, treeViews) + { + new pqTreeViewSelectionHelper(tree); + } + + this->connect(this->UI->groupModel, SIGNAL(valuesChanged()), + this, SLOT(setModified())); + this->connect(this->UI->entityModel, SIGNAL(valuesChanged()), + this, SLOT(setModified())); + + this->UI->tabWidget->setCurrentIndex(0); + + this->UI->VTKConnect->Connect(this->proxy(), + vtkCommand::UpdateInformationEvent, this, SLOT(updateSIL())); + +} + +pqExtractGroupPanel::~pqExtractGroupPanel() +{ +} + +void pqExtractGroupPanel::linkServerManagerProperties() +{ + this->UI->Links.addPropertyLink(this->UI->groupModel, "values", + SIGNAL(valuesChanged()), this->proxy(), this->proxy()->GetProperty( + "Groups")); + + this->UI->Links.addPropertyLink(this->UI->entityModel, "values", + SIGNAL(valuesChanged()), this->proxy(), this->proxy()->GetProperty( + "Entity")); + + this->Superclass::linkServerManagerProperties(); + +} + +void pqExtractGroupPanel::updateSIL() +{ + + vtkSMProxy* reader = this->referenceProxy()->getProxy(); + reader->UpdatePropertyInformation(reader->GetProperty("SILUpdateStamp")); + + int stamp = vtkSMPropertyHelper(reader, "SILUpdateStamp").GetAsInt(); + if (stamp != this->UI->SILUpdateStamp) + { + this->UI->SILUpdateStamp = stamp; + vtkPVSILInformation* info = vtkPVSILInformation::New(); + reader->GatherInformation(info); + this->UI->SILModel.update(info->GetSIL()); + + this->UI->Groups->expandAll(); + this->UI->Entity->expandAll(); + + info->Delete(); + } + +} diff --git a/src/Plugins/MedReader/ParaViewPlugin/pqExtractGroupPanel.h b/src/Plugins/MedReader/ParaViewPlugin/pqExtractGroupPanel.h new file mode 100644 index 00000000..28b71ee0 --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/pqExtractGroupPanel.h @@ -0,0 +1,59 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _pqExtractGroupPanel_h +#define _pqExtractGroupPanel_h + +#include "pqNamedObjectPanel.h" + +#include +class pqTreeWidgetItemObject; + +class vtkSMProperty; + +class pqExtractGroupPanel: public pqNamedObjectPanel +{ +Q_OBJECT + typedef pqNamedObjectPanel Superclass; +public: + /// constructor + pqExtractGroupPanel(pqProxy* proxy, QWidget* p = NULL); + /// destructor + ~pqExtractGroupPanel(); + +public slots: + // accept changes made by this panel + //virtual void accept(); + // reset changes made by this panel + //virtual void reset(); + +protected slots: + + void updateSIL(); + +protected: + /// populate widgets with properties from the server manager + virtual void linkServerManagerProperties(); + + class pqUI; + pqUI* UI; +}; + +#endif + diff --git a/src/Plugins/MedReader/ParaViewPlugin/pqMedReaderPanel.cxx b/src/Plugins/MedReader/ParaViewPlugin/pqMedReaderPanel.cxx new file mode 100644 index 00000000..dfb159fc --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/pqMedReaderPanel.cxx @@ -0,0 +1,338 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "pqMedReaderPanel.h" +#include "ui_MedReaderPanel.h" + +#include "vtkProcessModule.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkInformation.h" +#include "vtkIntArray.h" +#include "vtkSMDoubleVectorProperty.h" +#include "vtkSMIntVectorProperty.h" +#include "vtkSMStringVectorProperty.h" +#include "vtkSMProxy.h" +#include "vtkEventQtSlotConnect.h" +#include "vtkPVSILInformation.h" +#include "vtkGraph.h" +#include "vtkSMPropertyHelper.h" +#include "vtkStringArray.h" +#include "vtkDataSetAttributes.h" +#include "vtkMedReader.h" + +#include "vtkMedUtilities.h" + +#include "pqTreeWidgetItemObject.h" +#include "pqSMAdaptor.h" +#include "pqProxy.h" +#include "pqPropertyManager.h" +#include "pqSILModel.h" +#include "pqProxySILModel.h" +#include "pqTreeViewSelectionHelper.h" +#include "pqTreeWidgetSelectionHelper.h" +#include "pqPropertyLinks.h" + +#include + +class pqMedReaderPanel::pqUI: public QObject, public Ui::MedReaderPanel +{ +public: + pqUI(pqMedReaderPanel* p) : + QObject(p) + { + this->VTKConnect = vtkSmartPointer::New(); + this->SILUpdateStamp = -1; + } + + ~pqUI() + { + } + + pqSILModel SILModel; + vtkSmartPointer VTKConnect; + pqPropertyLinks Links; + QMap TreeItemToPropMap; + pqProxySILModel* entityModel; + pqProxySILModel* groupModel; + int SILUpdateStamp; +}; + +pqMedReaderPanel::pqMedReaderPanel(pqProxy* object_proxy, QWidget* p) : + Superclass(object_proxy, p) +{ + this->UI = new pqUI(this); + this->UI->setupUi(this); + + pqProxySILModel* proxyModel; + + // connect groups to groupsRoot + proxyModel = new pqProxySILModel("GroupTree", &this->UI->SILModel); + proxyModel->setSourceModel(&this->UI->SILModel); + this->UI->Groups->setModel(proxyModel); + this->UI->Groups->setHeaderHidden(true); + + this->UI->groupModel = new pqProxySILModel("Groups", &this->UI->SILModel); + this->UI->groupModel->setSourceModel(&this->UI->SILModel); + + // connect cell types to "EntityRoot" + proxyModel = new pqProxySILModel("EntityTree", &this->UI->SILModel); + proxyModel->setSourceModel(&this->UI->SILModel); + this->UI->Entity->setModel(proxyModel); + this->UI->Entity->setHeaderHidden(true); + + this->UI->entityModel = new pqProxySILModel("Entity", &this->UI->SILModel); + this->UI->entityModel->setSourceModel(&this->UI->SILModel); + + this->updateSIL(); + + this->UI->Groups->header()->setStretchLastSection(true); + this->UI->Entity->header()->setStretchLastSection(true); + + this->linkServerManagerProperties(); + + QList treeWidgets = this->findChildren (); + foreach (pqTreeWidget* tree, treeWidgets) + { + new pqTreeWidgetSelectionHelper(tree); + } + + QList treeViews = this->findChildren (); + foreach (pqTreeView* tree, treeViews) + { + new pqTreeViewSelectionHelper(tree); + } + + this->connect(this->UI->groupModel, SIGNAL(valuesChanged()), + this, SLOT(setModified())); + this->connect(this->UI->entityModel, SIGNAL(valuesChanged()), + this, SLOT(setModified())); + this->connect(this->UI->TimeCombo, SIGNAL(currentIndexChanged(int)), + this, SLOT(setModified())); + this->connect(this->UI->GenerateVectors, SIGNAL(stateChanged(int)), + this, SLOT(setModified())); + + this->UI->tabWidget->setCurrentIndex(0); + + this->UI->VTKConnect->Connect(this->proxy(), + vtkCommand::UpdateInformationEvent, this, SLOT(updateSIL())); +} + +pqMedReaderPanel::~pqMedReaderPanel() +{ +} + +void pqMedReaderPanel::addSelectionsToTreeWidget(const QString& prop, + QTreeWidget* tree, PixmapType pix) +{ + vtkSMProperty* SMProperty = this->proxy()->GetProperty(prop.toAscii().data()); + QList SMPropertyDomain; + SMPropertyDomain = pqSMAdaptor::getSelectionPropertyDomain(SMProperty); + int j; + for(j = 0; j < SMPropertyDomain.size(); j++) + { + QString varName = SMPropertyDomain[j].toString(); + this->addSelectionToTreeWidget(varName, varName, tree, pix, prop, j); + } +} + +void pqMedReaderPanel::addSelectionToTreeWidget(const QString& name, + const QString& realName, QTreeWidget* tree, PixmapType pix, + const QString& prop, int propIdx) +{ + static QPixmap pixmaps[] = { + QPixmap(":/ParaViewResources/Icons/pqPointData16.png"), + QPixmap(":/ParaViewResources/Icons/pqCellData16.png"), + QPixmap(":/ParaViewResources/Icons/pqQuadratureData16.png"), + QPixmap(":/ParaViewResources/Icons/pqElnoData16.png") }; + + vtkSMProperty* SMProperty = this->proxy()->GetProperty(prop.toAscii().data()); + + if(!SMProperty || !tree) + { + return; + } + + QList strs; + strs.append(name); + pqTreeWidgetItemObject* item; + item = new pqTreeWidgetItemObject(tree, strs); + item->setData(0, Qt::ToolTipRole, name); + if(pix >= 0) + { + item->setData(0, Qt::DecorationRole, pixmaps[pix]); + } + item->setData(0, Qt::UserRole, QString("%1 %2").arg((int) pix).arg(realName)); + this->propertyManager()->registerLink(item, "checked", + SIGNAL(checkedStateChanged(bool)), this->proxy(), SMProperty, propIdx); + + this->UI->TreeItemToPropMap[item] = prop; +} + +void pqMedReaderPanel::linkServerManagerProperties() +{ + this->UI->Links.addPropertyLink(this->UI->groupModel, "values", + SIGNAL(valuesChanged()), this->proxy(), this->proxy()->GetProperty( + "Groups")); + + this->UI->Links.addPropertyLink(this->UI->entityModel, "values", + SIGNAL(valuesChanged()), this->proxy(), this->proxy()->GetProperty( + "Entity")); + + this->UI->Links.addPropertyLink(this->UI->GenerateVectors, "checked", + SIGNAL(toggled(bool)), this->proxy(), this->proxy()->GetProperty( + "GenerateVectors")); + + this->Superclass::linkServerManagerProperties(); + + // do the point variables + this->addSelectionsToTreeWidget("PointFieldsArrayStatus", + this->UI->Variables, PM_POINT); + // do the cell variables + this->addSelectionsToTreeWidget("CellFieldsArrayStatus", this->UI->Variables, + PM_CELL); + // do the quadrature variables + this->addSelectionsToTreeWidget("QuadratureFieldsArrayStatus", + this->UI->Variables, PM_QUADRATURE); + + // do the Elno variables + this->addSelectionsToTreeWidget("ElnoFieldsArrayStatus", + this->UI->Variables, PM_ELNO); + this->setupAnimationModeWidget(); +} + +void pqMedReaderPanel::setupAnimationModeWidget() +{ + this->UI->AnimationModeCombo->clear(); + QList modes = pqSMAdaptor::getEnumerationPropertyDomain( + this->proxy()->GetProperty("AnimationMode")); + for(int mode = 0; mode < modes.size(); mode++) + { + QString modeName = modes[mode].toString(); + this->UI->AnimationModeCombo->addItem(modeName); + } + + this->UI->Links.addPropertyLink(this->UI->AnimationModeCombo, "currentIndex", + SIGNAL(currentIndexChanged(int)), this->proxy(), + this->proxy()->GetProperty("AnimationMode")); + + this->connect(this->UI->AnimationModeCombo, + SIGNAL(currentIndexChanged(int)), this, SLOT(animationModeChanged(int))); + + this->UI->Links.addPropertyLink(this->UI->TimeCombo, "currentIndex", + SIGNAL(currentIndexChanged(int)), this->proxy(), + this->proxy()->GetProperty("TimeIndexForIterations")); + + this->addSelectionsToTreeWidget("FrequencyArrayStatus", + this->UI->Modes, PM_NONE); + + vtkSMPropertyHelper helper(this->proxy(), "AnimationMode"); + int mode = helper.GetAsInt(0); + this->animationModeChanged(mode); + this->updateAvailableTimes(); +} + +void pqMedReaderPanel::animationModeChanged(int mode) +{ + if(mode == vtkMedReader::Default || mode == vtkMedReader::PhysicalTime) + { + this->UI->TimeCombo->hide(); + this->UI->TimeLabel->hide(); + this->UI->Modes->hide(); + } + else if(mode == vtkMedReader::Iteration) + { + this->UI->TimeCombo->show(); + this->UI->TimeLabel->show(); + this->UI->Modes->hide(); + } + else // vtkMedReader::Modes + { + this->UI->TimeCombo->hide(); + this->UI->TimeLabel->hide(); + this->UI->Modes->show(); + } + vtkSMPropertyHelper(this->proxy(), "AnimationMode").Set(mode); + this->proxy()->UpdateVTKObjects(); + this->setModified(); +} + +void pqMedReaderPanel::updateAvailableTimes() +{ + vtkSMDoubleVectorProperty* prop = vtkSMDoubleVectorProperty::SafeDownCast( + this->proxy()->GetProperty("AvailableTimes")); + + this->proxy()->UpdatePropertyInformation(prop); + + //prop->GetInformationHelper()->UpdateProperty( + // vtkProcessModuleConnectionManager::GetRootServerConnectionID(), + // vtkProcessModule::DATA_SERVER, + // this->proxy()->GetID(), + // prop); + + this->UI->TimeCombo->clear(); + double *aux = prop->GetElements(); + + for(int tid = 0; tid < prop->GetNumberOfElements(); tid++) + { + this->UI->TimeCombo->addItem( QString::number(aux[tid]) ); + } + +} + +void pqMedReaderPanel::updateSIL() +{ + vtkSMProxy* reader = this->referenceProxy()->getProxy(); + reader->UpdatePropertyInformation(reader->GetProperty("SILUpdateStamp")); + + int stamp = vtkSMPropertyHelper(reader, "SILUpdateStamp").GetAsInt(); + if (stamp != this->UI->SILUpdateStamp) + { + this->UI->SILUpdateStamp = stamp; + vtkPVSILInformation* info = vtkPVSILInformation::New(); + reader->GatherInformation(info); + this->UI->SILModel.update(info->GetSIL()); + + this->UI->Groups->expandAll(); + this->UI->Entity->expandAll(); + + info->Delete(); + } + + /* + this->proxy()->UpdatePropertyInformation( + this->proxy()->GetProperty("SILUpdateStamp")); + + int stamp = vtkSMPropertyHelper(this->proxy(), "SILUpdateStamp").GetAsInt(); + if(stamp != this->UI->SILUpdateStamp) + { + this->UI->SILUpdateStamp = stamp; + + vtkProcessModule* pm = vtkProcessModule::GetProcessModule(); + vtkPVSILInformation* info = vtkPVSILInformation::New(); + pm->GatherInformation(this->proxy()->GetConnectionID(), + vtkProcessModule::DATA_SERVER, info, this->proxy()->GetID()); + + this->UI->SILModel.update(info->GetSIL()); + + this->UI->Groups->expandAll(); + this->UI->Entity->expandAll(); + + info->Delete(); + }*/ +} diff --git a/src/Plugins/MedReader/ParaViewPlugin/pqMedReaderPanel.h b/src/Plugins/MedReader/ParaViewPlugin/pqMedReaderPanel.h new file mode 100644 index 00000000..71ba4787 --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/pqMedReaderPanel.h @@ -0,0 +1,74 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _pqMedReaderPanel_h +#define _pqMedReaderPanel_h + +#include "pqNamedObjectPanel.h" + +#include +class pqTreeWidgetItemObject; + +class vtkSMProperty; + +class pqMedReaderPanel: public pqNamedObjectPanel +{ +Q_OBJECT + typedef pqNamedObjectPanel Superclass; +public: + /// constructor + pqMedReaderPanel(pqProxy* proxy, QWidget* p = NULL); + /// destructor + ~pqMedReaderPanel(); + +protected slots: + void animationModeChanged(int mode); + + // void timeComboChanged(int timeStep); + + void updateSIL(); + +protected: + /// populate widgets with properties from the server manager + virtual void linkServerManagerProperties(); + + enum PixmapType + { + PM_NONE = -1, + PM_POINT, + PM_CELL, + PM_QUADRATURE, + PM_ELNO + }; + + void addSelectionsToTreeWidget(const QString& prop, + QTreeWidget* tree, PixmapType pix); + + void addSelectionToTreeWidget(const QString& name, + const QString& realName, QTreeWidget* tree, PixmapType pix, + const QString& prop, int propIdx); + + void setupAnimationModeWidget(); + void updateAvailableTimes(); + + class pqUI; + pqUI* UI; +}; + +#endif diff --git a/src/Plugins/MedReader/ParaViewPlugin/vtkSMMedGroupSelectionDomain.cxx b/src/Plugins/MedReader/ParaViewPlugin/vtkSMMedGroupSelectionDomain.cxx new file mode 100644 index 00000000..3d12af52 --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/vtkSMMedGroupSelectionDomain.cxx @@ -0,0 +1,78 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkSMMedGroupSelectionDomain.h" + +#include "vtkObjectFactory.h" +#include "vtkSMStringVectorProperty.h" +#include "vtkStringList.h" + +#include +using std::string; + +vtkStandardNewMacro(vtkSMMedGroupSelectionDomain); + +vtkSMMedGroupSelectionDomain::vtkSMMedGroupSelectionDomain() +{ +} + +vtkSMMedGroupSelectionDomain::~vtkSMMedGroupSelectionDomain() +{ +} + +int vtkSMMedGroupSelectionDomain::SetDefaultValues(vtkSMProperty* prop) +{ + vtkSMStringVectorProperty* svp = vtkSMStringVectorProperty::SafeDownCast(prop); + if(!svp || this->GetNumberOfRequiredProperties() == 0) + { + return this->Superclass::SetDefaultValues(prop); + } + + // info property has default values + vtkSMStringVectorProperty* isvp = vtkSMStringVectorProperty::SafeDownCast( + prop->GetInformationProperty()); + if (isvp) + { + vtkStringList* proplist = vtkStringList::New(); + svp->SetNumberOfElements(0); + svp->SetNumberOfElementsPerCommand(2); + for(int id=0; idGetNumberOfElements(); id++) + { + string elem = isvp->GetElement(id); + proplist->AddString(elem.c_str()); + if(elem.find("/OnCell/") != string::npos) + { + proplist->AddString("1"); + } + else + { + proplist->AddString("0"); + } + } + svp->SetElements(proplist); + proplist->Delete(); + } + + return 1; +} + +void vtkSMMedGroupSelectionDomain::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); +} diff --git a/src/Plugins/MedReader/ParaViewPlugin/vtkSMMedGroupSelectionDomain.h b/src/Plugins/MedReader/ParaViewPlugin/vtkSMMedGroupSelectionDomain.h new file mode 100644 index 00000000..569902f3 --- /dev/null +++ b/src/Plugins/MedReader/ParaViewPlugin/vtkSMMedGroupSelectionDomain.h @@ -0,0 +1,49 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +// .NAME vtkSMMedGroupSelectionDompain - domain used to +// select groups from med files. +// .SECTION Description +// This property overrides the SetDefaultValues to select only cell groups + +#ifndef __vtkSMMedGroupSelectionDomain_h +#define __vtkSMMedGroupSelectionDomain_h + +#include "vtkSMSILDomain.h" + +class VTK_EXPORT vtkSMMedGroupSelectionDomain : public vtkSMSILDomain +{ +public: + static vtkSMMedGroupSelectionDomain* New(); + vtkTypeMacro(vtkSMMedGroupSelectionDomain, vtkSMSILDomain); + void PrintSelf(ostream& os, vtkIndent indent); + + virtual int SetDefaultValues(vtkSMProperty*); + +protected: + vtkSMMedGroupSelectionDomain(); + ~vtkSMMedGroupSelectionDomain(); + +private: + vtkSMMedGroupSelectionDomain(const vtkSMMedGroupSelectionDomain&); + // Not implemented + void operator=(const vtkSMMedGroupSelectionDomain&); // Not implemented +}; + +#endif diff --git a/src/Plugins/NavigationMode/CMakeLists.txt b/src/Plugins/NavigationMode/CMakeLists.txt new file mode 100644 index 00000000..b8240b53 --- /dev/null +++ b/src/Plugins/NavigationMode/CMakeLists.txt @@ -0,0 +1,58 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +# NavigationMode plugin. +# This is auto-start plugin providing navigation +# mode in 3D viewer in Post-Pro style. + +CMAKE_MINIMUM_REQUIRED(VERSION 2.4) +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + +project(NavigationMode) + +# Find ParaView +FIND_PACKAGE(ParaView REQUIRED) +if(NOT ParaView_FOUND) + MESSAGE(FATAL_ERROR "Please locate ParaView." ) +ENDIF(NOT ParaView_FOUND) +INCLUDE(${PARAVIEW_USE_FILE}) + +# Standard CMake option for building libraries shared or static by default. +OPTION(BUILD_SHARED_LIBS + "Build with shared libraries." + ${VTK_BUILD_SHARED_LIBS}) + +QT4_WRAP_CPP(MOC_SRCS pqSetModeStarter.h) + +ADD_PARAVIEW_AUTO_START(IFACES IFACE_SRCS CLASS_NAME pqSetModeStarter + STARTUP onStartup) + +ADD_PARAVIEW_PLUGIN(NavigationMode "1.0" + GUI_INTERFACES ${IFACES} + SOURCES pqSetModeStarter.cxx ${MOC_SRCS} ${RCS_SRCS} ${IFACE_SRCS}) + +# Install +INSTALL( + TARGETS NavigationMode + RUNTIME DESTINATION lib/paraview + LIBRARY DESTINATION lib/paraview + ARCHIVE DESTINATION lib/paraview +) \ No newline at end of file diff --git a/src/Plugins/NavigationMode/pqSetModeStarter.cxx b/src/Plugins/NavigationMode/pqSetModeStarter.cxx new file mode 100644 index 00000000..f7aa1375 --- /dev/null +++ b/src/Plugins/NavigationMode/pqSetModeStarter.cxx @@ -0,0 +1,107 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "pqSetModeStarter.h" + +#include + +#include +#include +#include + + +//----------------------------------------------------------------------------- +pqSetModeStarter::pqSetModeStarter(QObject* p/*=0*/) + : QObject(p) +{ +} + +//----------------------------------------------------------------------------- +pqSetModeStarter::~pqSetModeStarter() +{ +} + + +//----------------------------------------------------------------------------- +void pqSetModeStarter::onStartup() +{ + this->setStandardMode(); +} + +//----------------------------------------------------------------------------- +void pqSetModeStarter::setStandardMode() +{ + pqSettings* settings = pqApplicationCore::instance()->settings(); + settings->beginGroup("renderModule"); + if (!settings->contains("InteractorStyle/CameraManipulators")) { + // Set Post-Pro-like settings + QStringList strs; + pqRenderView::ManipulatorType manips[9]; + const pqRenderView::ManipulatorType* default3DManips = pqRenderView::getDefaultManipulatorTypes(); + + // Copy default settings, make changes for Ctrl+MB and MB modes + for(int i=0; i<9; i++) + { + manips[i] = default3DManips[i]; + + // Ctrl+MB + if (manips[i].Shift == 0 && manips[i].Control == 1) { + if (manips[i].Mouse == 1) + manips[i].Name = QByteArray("Zoom"); + else if (manips[i].Mouse == 2) + manips[i].Name = QByteArray("Pan"); + else if (manips[i].Mouse == 3) + manips[i].Name = QByteArray("Rotate"); + } + + // MB only + if (manips[i].Shift == 0 && manips[i].Control == 0) { + if (manips[i].Mouse == 1) + manips[i].Name = QByteArray("Rotate"); + else if (manips[i].Mouse == 2) + manips[i].Name = QByteArray("Pan"); + else if (manips[i].Mouse == 3) + manips[i].Name = QByteArray("Zoom"); + } + } + + // Save settings + for(int i=0; i<9; i++) + { + strs << QString("Manipulator%1Mouse%2Shift%3Control%4Name%5") + .arg(i+1) + .arg(manips[i].Mouse) + .arg(manips[i].Shift) + .arg(manips[i].Control) + .arg(QString(manips[i].Name)); + } + + settings->setValue("InteractorStyle/CameraManipulators", strs); + } + settings->endGroup(); + + // Loop through render views and apply the settings + QList views = + pqApplicationCore::instance()->getServerManagerModel()-> + findItems(); + + foreach(pqRenderViewBase* view, views) { + view->restoreSettings(true); + } +} diff --git a/src/Plugins/NavigationMode/pqSetModeStarter.h b/src/Plugins/NavigationMode/pqSetModeStarter.h new file mode 100644 index 00000000..768cf6d8 --- /dev/null +++ b/src/Plugins/NavigationMode/pqSetModeStarter.h @@ -0,0 +1,49 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __pqSetModeStarter_h +#define __pqSetModeStarter_h + +#include + +class pqSetModeStarter : public QObject +{ + Q_OBJECT + typedef QObject Superclass; +public: + pqSetModeStarter(QObject* p=0); + ~pqSetModeStarter(); + + // Callback for startup. + void onStartup(); + + // Callback for shutdown. + void shutdown() {} + +private: + void setStandardMode(); + +private: + pqSetModeStarter(const pqSetModeStarter&); // Not implemented. + void operator=(const pqSetModeStarter&); // Not implemented. +}; + +#endif + + diff --git a/src/Plugins/ParaMEDCorba/CMakeLists.txt b/src/Plugins/ParaMEDCorba/CMakeLists.txt new file mode 100644 index 00000000..77bc1149 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/CMakeLists.txt @@ -0,0 +1,92 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +PROJECT( ParaMEDCorba ) + + CMAKE_MINIMUM_REQUIRED( VERSION 2.6 ) + ## !!! This definition corrupts wrapping process + #SET( LIBRARY_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin CACHE INTERNAL "Single place for output" ) + #SET( EXECUTABLE_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin CACHE INTERNAL "Single place for output" ) + MARK_AS_ADVANCED( + LIBRARY_OUTPUT_PATH + EXECUTABLE_OUTPUT_PATH + ) + + FIND_PACKAGE( ParaView REQUIRED ) + + IF( ParaView_FOUND ) + + INCLUDE( ${PARAVIEW_USE_FILE} ) + + SET( PARACORBAPLUG_SRCS + ${ParaMEDCorba_SOURCE_DIR}/vtkParaMEDCorbaSource.cxx + ) + + ADD_LIBRARY (ParaMEDMEM2VTK SHARED VTKMEDCouplingMeshClient.cxx VTKMEDCouplingUMeshClient.cxx VTKMEDCouplingCMeshClient.cxx + VTKMEDCouplingFieldClient.cxx VTKParaMEDFieldClient.cxx VTKMEDCouplingMultiFieldsClient.cxx ) + + ADD_PARAVIEW_PLUGIN( ParaMEDCorbaPlugin "1.0" + SERVER_MANAGER_XML ParaMEDCorbaServerManager.xml + GUI_RESOURCE_FILES + ParaMEDCorbaUserInterfaceSources.xml + SERVER_MANAGER_SOURCES ${PARACORBAPLUG_SRCS} ) + + SET(flags) + FOREACH(f ${CORBA_INCLUDES} ${CORBA_CXXFLAGS}) + SET(flags "${flags} ${f}") + ENDFOREACH(f ${CORBA_INCLUDES} ${CORBA_CXXFLAGS}) + + INCLUDE_DIRECTORIES(${MED_ROOT_DIR}/include/salome ${KERNEL_ROOT_DIR}/include/salome) + SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "${flags}") + SET_TARGET_PROPERTIES(ParaMEDCorbaPlugin PROPERTIES COMPILE_FLAGS "${flags}") + + TARGET_LINK_LIBRARIES(ParaMEDMEM2VTK + vtkCommon + vtkFiltering + vtkGraphics + vtkClientServer + pqCore + ${CORBA_LIBS} + ${SalomeIDLMED} + ${SalomeIDLKernel} + ${QT_LIBS} + ${CORBA_LIBS} + ) + TARGET_LINK_LIBRARIES(ParaMEDCorbaPlugin + ParaMEDMEM2VTK + ) + + INSTALL(TARGETS ParaMEDCorbaPlugin DESTINATION lib/paraview) + + INSTALL(TARGETS ParaMEDMEM2VTK DESTINATION lib/salome) + + ADD_EXECUTABLE( testParaMEDCorba + ${ParaMEDCorba_SOURCE_DIR}/testParaMEDCorba.cxx + ) + # SET_TARGET_PROPERTIES(testCorbaPlugin PROPERTIES COMPILE_FLAGS "${flags}") + + TARGET_LINK_LIBRARIES( testParaMEDCorba + ParaMEDCorbaPlugin + ) + + INSTALL(FILES ParaMEDCorbaServerManager.xml DESTINATION share) + + + ENDIF( ParaView_FOUND ) + diff --git a/src/Plugins/ParaMEDCorba/ParaMEDCorbaServerManager.xml b/src/Plugins/ParaMEDCorba/ParaMEDCorbaServerManager.xml new file mode 100644 index 00000000..e2c51aeb --- /dev/null +++ b/src/Plugins/ParaMEDCorba/ParaMEDCorbaServerManager.xml @@ -0,0 +1,67 @@ + + + + + + + Source of a remote ParaMED Corba reference. + + + + This property specifies the IOR of a ParaFIELD MED in memory. + + + + + + This property specifies the buffering policy. + 0 means no buffering, that is to say Corba fetching is done + every times needed to get field at a time step. Remote Corba + object is NOT Released. + 10 means full buffering, that is to say a full Corba fetching + is performed on begin and remote Corba object is + released. But memory consumtion could be huge. + Between 0,and 10 a partial buffering is done. + + + + + + + Available timestep values. + + + + + + + Available time range. + + + + + + + + + + diff --git a/src/Plugins/ParaMEDCorba/ParaMEDCorbaUserInterfaceSources.xml b/src/Plugins/ParaMEDCorba/ParaMEDCorbaUserInterfaceSources.xml new file mode 100644 index 00000000..8b4992c8 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/ParaMEDCorbaUserInterfaceSources.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/Plugins/ParaMEDCorba/ParaMEDMEM2VTK_defines.hxx b/src/Plugins/ParaMEDCorba/ParaMEDMEM2VTK_defines.hxx new file mode 100755 index 00000000..47b46b82 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/ParaMEDMEM2VTK_defines.hxx @@ -0,0 +1,33 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __ParaMEDMEM2VTK_defines_h__ +#define __ParaMEDMEM2VTK_defines_h__ + +#ifdef WIN32 +# if defined ParaMEDMEM2VTK_EXPORTS +# define ParaMEDMEM2VTK_EXPORT __declspec( dllexport ) +# else +# define ParaMEDMEM2VTK_EXPORT __declspec( dllimport ) +# endif +#else +# define ParaMEDMEM2VTK_EXPORT +#endif + +#endif // __ParaMEDMEM2VTK_defines_h__ diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingCMeshClient.cxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingCMeshClient.cxx new file mode 100644 index 00000000..d9f78864 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingCMeshClient.cxx @@ -0,0 +1,85 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "VTKMEDCouplingCMeshClient.hxx" + +#include "vtkErrorCode.h" +#include "vtkDoubleArray.h" +#include "vtkRectilinearGrid.h" + +#include +#include + +void ParaMEDMEM2VTK::FillMEDCouplingCMeshInstanceFrom(SALOME_MED::MEDCouplingCMeshCorbaInterface_ptr meshPtr, vtkRectilinearGrid *ret) +{ + meshPtr->Register(); + SALOME_TYPES::ListOfDouble *tinyD; + SALOME_TYPES::ListOfLong *tinyI; + SALOME_TYPES::ListOfString *tinyS; + meshPtr->getTinyInfo(tinyD,tinyI,tinyS); + int sizePerAxe[3]; + sizePerAxe[0]=(*tinyI)[0]; + sizePerAxe[1]=(*tinyI)[1]; + sizePerAxe[2]=(*tinyI)[2]; + ret->SetDimensions(sizePerAxe[0],sizePerAxe[1],sizePerAxe[2]); + delete tinyI; + delete tinyS; + SALOME_TYPES::ListOfDouble *bigD; + meshPtr->getSerialisationData(tinyI,bigD); + delete tinyI; + int offset=0; + vtkDoubleArray *da=0; + if(sizePerAxe[0]>0) + { + da=vtkDoubleArray::New(); + da->SetNumberOfTuples(sizePerAxe[0]); + da->SetNumberOfComponents(1); + double *pt=da->GetPointer(0); + for(int i=0;iSetXCoordinates(da); + da->Delete(); + offset+=sizePerAxe[0]; + } + if(sizePerAxe[1]>0) + { + da=vtkDoubleArray::New(); + da->SetNumberOfTuples(sizePerAxe[1]); + da->SetNumberOfComponents(1); + double *pt=da->GetPointer(0); + for(int i=0;iSetYCoordinates(da); + da->Delete(); + offset+=sizePerAxe[1]; + } + if(sizePerAxe[2]>0) + { + da=vtkDoubleArray::New(); + da->SetNumberOfTuples(sizePerAxe[2]); + da->SetNumberOfComponents(1); + double *pt=da->GetPointer(0); + for(int i=0;iSetZCoordinates(da); + da->Delete(); + } + delete bigD; + meshPtr->UnRegister(); +} diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingCMeshClient.hxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingCMeshClient.hxx new file mode 100644 index 00000000..fbd65f52 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingCMeshClient.hxx @@ -0,0 +1,32 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __VTKMEDCOUPLINGCMESHCLIENT_HXX__ +#define __VTKMEDCOUPLINGCMESHCLIENT_HXX__ + +#include "ParaMEDCouplingCorbaServant.hh" + +class vtkRectilinearGrid; + +namespace ParaMEDMEM2VTK +{ + void FillMEDCouplingCMeshInstanceFrom(SALOME_MED::MEDCouplingCMeshCorbaInterface_ptr meshPtr, vtkRectilinearGrid *ret); +} + +#endif diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingFieldClient.cxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingFieldClient.cxx new file mode 100644 index 00000000..3afc2c2a --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingFieldClient.cxx @@ -0,0 +1,212 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "VTKMEDCouplingFieldClient.hxx" +#include "VTKMEDCouplingMeshClient.hxx" + +#include "vtkErrorCode.h" +#include "vtkCellData.h" +#include "vtkPointData.h" +#include "vtkDoubleArray.h" +#include "vtkUnstructuredGrid.h" + +#include +#include + +std::vector ParaMEDMEM2VTK::FillMEDCouplingFieldDoubleInstanceFrom(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, vtkDataSet *ret) +{ + fieldPtr->Register(); + // + SALOME_MED::MEDCouplingMeshCorbaInterface_var meshPtr=fieldPtr->getMesh(); + ParaMEDMEM2VTK::FillMEDCouplingMeshInstanceFrom(meshPtr,ret); + meshPtr->UnRegister(); + // + std::vector ret2=FillMEDCouplingFieldDoublePartOnly(fieldPtr,ret); + fieldPtr->UnRegister(); + // + return ret2; +} + +std::vector ParaMEDMEM2VTK::FillMEDCouplingFieldDoublePartOnly(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, vtkDataSet *ret) +{ + std::vector ret2; + // + SALOME_TYPES::ListOfLong *tinyL; + SALOME_TYPES::ListOfDouble *tinyD; + SALOME_TYPES::ListOfString *tinyS; + fieldPtr->getTinyInfo(tinyL,tinyD,tinyS); + // + int typeOfField=(*tinyL)[0];// 0:ON_CELLS, 1:ON_NODES, 2:ON_GAUSS_PT, 3:ON_GAUSS_NE + int timeDiscr=(*tinyL)[1]; + int nbOfTuples=(*tinyL)[3]; + int nbOfComponents=(*tinyL)[4]; + std::vector comps(nbOfComponents); + for(int i=0;iSetName(name.c_str()); + var0->SetNumberOfComponents(nbOfComponents); + var0->SetNumberOfTuples(nbOfTuples); + for(int i=0;iSetComponentName(i,comps[i].c_str()); + var0Ptr=var0->GetPointer(0); + if(timeDiscr==7) + { + var1->SetNumberOfComponents(nbOfComponents); + var1->SetNumberOfTuples(nbOfTuples); + var1Ptr=var1->GetPointer(0); + std::ostringstream oss; oss << name << "_end_array"; + var1->SetName(oss.str().c_str()); + } + // + SALOME_TYPES::ListOfLong *bigDataI; + SALOME_TYPES::ListOfDouble2 *bigArr; + fieldPtr->getSerialisationData(bigDataI,bigArr); + delete bigDataI;//for the moment gauss points are not dealt + SALOME_TYPES::ListOfDouble& oneArr=(*bigArr)[0]; + int nbVals=oneArr.length(); + for(int i=0;iGetCellData()->AddArray(var0); + if(timeDiscr==7) + ret->GetCellData()->AddArray(var1); + break; + case 1://ON_NODES + ret->GetPointData()->AddArray(var0); + if(timeDiscr==7) + ret->GetCellData()->AddArray(var1); + break; + default: + vtkErrorWithObjectMacro(ret,"Not implemented yet for gauss fields and gauss on elements fields !"); + } + var0->Delete(); + if(timeDiscr==7) + var1->Delete(); + // + return ret2; +} + +vtkDataSet *ParaMEDMEM2VTK::BuildFullyFilledFromMEDCouplingFieldDoubleInstance(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, + std::vector& times) +{ + fieldPtr->Register(); + SALOME_MED::MEDCouplingMeshCorbaInterface_var meshPtr=fieldPtr->getMesh(); + bool dummy;//VTK bug + vtkDataSet *ret=ParaMEDMEM2VTK::BuildFromMEDCouplingMeshInstance(meshPtr,dummy);//VTK bug + meshPtr->UnRegister(); + // + std::vector ret2=FillMEDCouplingFieldDoublePartOnly(fieldPtr,ret); + times=ret2; + // + fieldPtr->UnRegister(); + return ret; +} + +vtkDoubleArray *ParaMEDMEM2VTK::BuildFromMEDCouplingFieldDoubleArr(SALOME_MED::DataArrayDoubleCorbaInterface_ptr dadPtr) +{ + vtkDoubleArray *ret=vtkDoubleArray::New(); + // + SALOME_TYPES::ListOfLong *tinyL=0; + SALOME_TYPES::ListOfDouble *bigD=0; + SALOME_TYPES::ListOfString *tinyS=0; + // + dadPtr->getTinyInfo(tinyL,tinyS); + int nbOfTuples=(*tinyL)[0]; + int nbOfCompo=(*tinyL)[1]; + std::string name((*tinyS)[0]); + std::vector comps(nbOfCompo); + for(int i=0;iSetName(name.c_str()); + ret->SetNumberOfComponents(nbOfCompo); + ret->SetNumberOfTuples(nbOfTuples); + for(int i=0;iSetComponentName(i,comps[i].c_str()); + else + { + std::ostringstream oss; oss << "Comp" << i; + ret->SetComponentName(i,oss.str().c_str()); + } + } + int nbElems=nbOfCompo*nbOfTuples; + double *pt=ret->GetPointer(0); + dadPtr->getSerialisationData(bigD); + for(int i=0;i + +class vtkDataSet; +class vtkDoubleArray; + +namespace ParaMEDMEM2VTK +{ + std::vector FillMEDCouplingFieldDoubleInstanceFrom(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, vtkDataSet *ret); + std::vector FillMEDCouplingFieldDoublePartOnly(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, vtkDataSet *ret); + ParaMEDMEM2VTK_EXPORT vtkDataSet *BuildFullyFilledFromMEDCouplingFieldDoubleInstance(SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, + std::vector& times); + ParaMEDMEM2VTK_EXPORT vtkDoubleArray *BuildFromMEDCouplingFieldDoubleArr(SALOME_MED::DataArrayDoubleCorbaInterface_ptr dadPtr); +} + +#endif diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingMeshClient.cxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingMeshClient.cxx new file mode 100644 index 00000000..2d53a14e --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingMeshClient.cxx @@ -0,0 +1,80 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "VTKMEDCouplingMeshClient.hxx" +#include "VTKMEDCouplingUMeshClient.hxx" +#include "VTKMEDCouplingCMeshClient.hxx" + +#include "vtkErrorCode.h" +#include "vtkUnstructuredGrid.h" +#include "vtkRectilinearGrid.h" + +#include +#include + +//vtkErrorMacro("Cannot call Start() twice before calling Finish()."); +void ParaMEDMEM2VTK::FillMEDCouplingMeshInstanceFrom(SALOME_MED::MEDCouplingMeshCorbaInterface_ptr meshPtr, vtkDataSet *ret) +{ + SALOME_MED::MEDCouplingUMeshCorbaInterface_var umeshPtr=SALOME_MED::MEDCouplingUMeshCorbaInterface::_narrow(meshPtr); + if(!CORBA::is_nil(umeshPtr)) + { + vtkUnstructuredGrid *ret1=vtkUnstructuredGrid::SafeDownCast(ret); + if(!ret1) + { + vtkErrorWithObjectMacro(ret,"Internal error in ParaMEDCorba plugin : mismatch between VTK type and CORBA type UMesh !"); + return ; + } + bool dummy;//VTK bug + ParaMEDMEM2VTK::FillMEDCouplingUMeshInstanceFrom(umeshPtr,ret1,dummy);//VTK bug + return ; + } + SALOME_MED::MEDCouplingCMeshCorbaInterface_var cmeshPtr=SALOME_MED::MEDCouplingCMeshCorbaInterface::_narrow(meshPtr); + if(!CORBA::is_nil(cmeshPtr)) + { + vtkRectilinearGrid *ret1=vtkRectilinearGrid::SafeDownCast(ret); + if(!ret1) + { + vtkErrorWithObjectMacro(ret,"Internal error in ParaMEDCorba plugin : mismatch between VTK type and CORBA type CMesh !"); + return ; + } + ParaMEDMEM2VTK::FillMEDCouplingCMeshInstanceFrom(cmeshPtr,ret1); + return ; + } + vtkErrorWithObjectMacro(ret,"Error : CORBA mesh type ! Mesh type not managed !"); +} + +vtkDataSet *ParaMEDMEM2VTK::BuildFromMEDCouplingMeshInstance(SALOME_MED::MEDCouplingMeshCorbaInterface_ptr meshPtr, bool& isPolyh) +{ + SALOME_MED::MEDCouplingUMeshCorbaInterface_var umeshPtr=SALOME_MED::MEDCouplingUMeshCorbaInterface::_narrow(meshPtr); + if(!CORBA::is_nil(umeshPtr)) + { + vtkUnstructuredGrid *ret1=vtkUnstructuredGrid::New(); + ParaMEDMEM2VTK::FillMEDCouplingUMeshInstanceFrom(umeshPtr,ret1,isPolyh); + return ret1; + } + SALOME_MED::MEDCouplingCMeshCorbaInterface_var cmeshPtr=SALOME_MED::MEDCouplingCMeshCorbaInterface::_narrow(meshPtr); + if(!CORBA::is_nil(cmeshPtr)) + { + vtkRectilinearGrid *ret1=vtkRectilinearGrid::New(); + ParaMEDMEM2VTK::FillMEDCouplingCMeshInstanceFrom(cmeshPtr,ret1); + return ret1; + } + vtkOutputWindowDisplayErrorText("Error : CORBA mesh type ! Mesh type not managed #2 !"); + return 0; +} diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingMeshClient.hxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingMeshClient.hxx new file mode 100644 index 00000000..5c96af50 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingMeshClient.hxx @@ -0,0 +1,34 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __VTKMEDCOUPLINGMESHCLIENT_HXX__ +#define __VTKMEDCOUPLINGMESHCLIENT_HXX__ + +#include "ParaMEDMEM2VTK_defines.hxx" +#include "ParaMEDCouplingCorbaServant.hh" + +class vtkDataSet; + +namespace ParaMEDMEM2VTK +{ + void FillMEDCouplingMeshInstanceFrom(SALOME_MED::MEDCouplingMeshCorbaInterface_ptr meshPtr, vtkDataSet *ret); + ParaMEDMEM2VTK_EXPORT vtkDataSet *BuildFromMEDCouplingMeshInstance(SALOME_MED::MEDCouplingMeshCorbaInterface_ptr meshPtr, bool& isPolyh);//isPolyh bug VTK +} + +#endif diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingMultiFieldsClient.cxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingMultiFieldsClient.cxx new file mode 100644 index 00000000..f1eb2295 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingMultiFieldsClient.cxx @@ -0,0 +1,337 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +// To access to vtkUnstructuredGrid::Faces and FaceLocations +#define protected public + +#include "VTKMEDCouplingMultiFieldsClient.hxx" +#include "VTKMEDCouplingMeshClient.hxx" +#include "VTKMEDCouplingFieldClient.hxx" + +#include "vtkUnstructuredGrid.h" +#include "vtkRectilinearGrid.h" +#include "vtkDoubleArray.h" +#include "vtkErrorCode.h" +#include "vtkCellData.h" +#include "vtkIdTypeArray.h" +#include "vtkPointData.h" + +#include +#include +#include +#include + +const double ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::EPS_TIME=1e-7; + +ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::MEDCouplingMultiFieldsFetcher(int bufferingPolicy, + SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_ptr mfieldsPtr):_effective_pol(bufferingPolicy),_mfields_ptr_released(false) +{ + _mfields_ptr=SALOME_MED::MEDCouplingMultiFieldsCorbaInterface::_duplicate(mfieldsPtr); + _mfields_ptr->Register(); +} + +ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::~MEDCouplingMultiFieldsFetcher() +{ + for(std::vector::iterator it=_meshes.begin();it!=_meshes.end();it++) + { + if(*it) + (*it)->Delete(); + } + for(std::vector::iterator it2=_arrays.begin();it2!=_arrays.end();it2++) + { + if(*it2) + (*it2)->Delete(); + } + if(!_mfields_ptr_released) + _mfields_ptr->UnRegister(); +} + +std::vector ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::getTimeStepsForPV() +{ + retrievesMainTinyInfo(); + int nbOfFields=_mesh_id_per_field.size(); + // + _time_label_per_field.resize(nbOfFields); + SALOME_MED::MEDCouplingFieldOverTimeCorbaInterface_var fotPtr=SALOME_MED::MEDCouplingFieldOverTimeCorbaInterface::_narrow(_mfields_ptr); + if(CORBA::is_nil(fotPtr)) + { + for(CORBA::Long i=0;i=10) + { + fetchAll(); + return ; + } + if(_effective_pol>=1 && _effective_pol<=9) + { + fetchMeshes(); + return ; + } +} + +vtkDataSet *ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::buildDataSetOnTime(double time) +{ + int fieldId=getPosGivenTimeLabel(time); + if(fieldId<0) + return 0; + fetchDataIfNeeded(fieldId); + int meshId=_mesh_id_per_field[fieldId]; + vtkDataSet *ret0=_meshes[meshId]; + std::string clsName=ret0->GetClassName(); + if(clsName=="vtkUnstructuredGrid") + { + vtkUnstructuredGrid *ret1=vtkUnstructuredGrid::New(); + ret1->DeepCopy(ret0); + if(_is_meshes_polyhedron[meshId])//bug VTK polyhedron + {//bug VTK polyhedron part + ret1->Faces->UnRegister(ret1); + ret1->Faces=vtkIdTypeArray::New(); + ret1->Faces->DeepCopy(((vtkUnstructuredGrid *)ret0)->GetFaces()); + ret1->Faces->Register(ret1); + ret1->Faces->Delete(); + ret1->FaceLocations->UnRegister(ret1); + ret1->FaceLocations=vtkIdTypeArray::New(); + ret1->FaceLocations->DeepCopy(((vtkUnstructuredGrid *)ret0)->GetFaceLocations()); + ret1->FaceLocations->Register(ret1); + ret1->FaceLocations->Delete(); + }//end bug VTK polyhedron part + appendFieldValueOnAlreadyFetchedData(ret1,fieldId); + applyBufferingPolicy(); + return ret1; + } + if(clsName=="vtkRectilinearGrid") + { + vtkRectilinearGrid *ret1=vtkRectilinearGrid::New(); + ret1->DeepCopy(ret0); + appendFieldValueOnAlreadyFetchedData(ret1,fieldId); + applyBufferingPolicy(); + return ret1; + } + return 0; +} + +void ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::retrievesMainTinyInfo() +{ + SALOME_TYPES::ListOfLong *tinyL=0; + SALOME_TYPES::ListOfDouble *tinyD=0; + SALOME_TYPES::ListOfString *tinyS=0; + // + CORBA::Long nbOfArrays; + CORBA::Long nbOfFields; + CORBA::Long nbOfMeshes=_mfields_ptr->getMainTinyInfo(tinyL,tinyD,nbOfArrays,nbOfFields); + int sz=(*tinyL)[0];//nbOfFields + //int sz2=(*tinyL)[1];//sigma(nbOfArraysPerField) + _time_discr_per_field.resize(sz);//4 : NO_TIME 5:ONE_TIME 6:LINEAR_TIME 7:CONST_ON_TIME_INTERVAL + _mesh_id_per_field.resize(sz); + _array_ids_per_field.resize(sz); + _time_def_per_field.resize(sz); + int offsetTime=0; + int offsetArrays=0; + for(int i=0;igetTinyInfo(i,tinyL,tinyD,tinyS); + _info_per_field[i]._type=(*tinyL)[0]; + _info_per_field[i]._name=(*tinyS)[0]; + delete tinyL; + delete tinyD; + delete tinyS; + } +} + +void ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::fetchAll() +{ + fetchMeshes(); + int nbOfArrays=_arrays.size(); + for(int i=0;igetArray(i); + if(_arrays[i]) + _arrays[i]->Delete(); + _arrays[i]=ParaMEDMEM2VTK::BuildFromMEDCouplingFieldDoubleArr(daPtr); + daPtr->UnRegister(); + } + unregisterRemoteServantIfAllFetched(); +} + +/*! + * Fetches meshes without regarding if already fetched + */ +void ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::fetchMeshes() +{ + int nbOfMeshes=_meshes.size(); + for(int i=0;igetMeshWithId(i); + if(_meshes[i]) + _meshes[i]->Delete(); + bool polyh=false;//bug VTK + _meshes[i]=ParaMEDMEM2VTK::BuildFromMEDCouplingMeshInstance(mPtr,polyh);//bug VTK + _is_meshes_polyhedron[i]=polyh;//bug VTK + mPtr->UnRegister(); + } + unregisterRemoteServantIfAllFetched(); +} + +/*! + * For a field with id 'fieldId' this method CORBA fetch, if needed, basic data. + * 'fieldId' should be correct no check of that is done ! + */ +void ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::fetchDataIfNeeded(int fieldId) +{ + std::vector arrayIds=_array_ids_per_field[fieldId]; + int meshId=_mesh_id_per_field[fieldId]; + if(!_meshes[meshId]) + { + SALOME_MED::MEDCouplingMeshCorbaInterface_var mPtr=_mfields_ptr->getMeshWithId(meshId); + bool polyh=false;//bug VTK + _meshes[meshId]=ParaMEDMEM2VTK::BuildFromMEDCouplingMeshInstance(mPtr,polyh);//bug VTK + _is_meshes_polyhedron[meshId]=polyh;//bug VTK + mPtr->UnRegister(); + } + for(std::vector::const_iterator it=arrayIds.begin();it!=arrayIds.end();it++) + { + if(!_arrays[*it]) + { + SALOME_MED::DataArrayDoubleCorbaInterface_var daPtr=_mfields_ptr->getArray(*it); + _arrays[*it]=ParaMEDMEM2VTK::BuildFromMEDCouplingFieldDoubleArr(daPtr); + daPtr->UnRegister(); + } + } + unregisterRemoteServantIfAllFetched(); +} + +void ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::unregisterRemoteServantIfAllFetched() +{ + for(std::vector::iterator it=_meshes.begin();it!=_meshes.end();it++) + { + if((*it)==0) + return ; + } + for(std::vector::iterator it2=_arrays.begin();it2!=_arrays.end();it2++) + { + if((*it2)==0) + return ; + } + if(!_mfields_ptr_released) + { + _mfields_ptr_released=true; + _mfields_ptr->UnRegister(); + } +} + +void ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::applyBufferingPolicy() +{ + if(_effective_pol==0) + {// + for(std::vector::iterator it=_meshes.begin();it!=_meshes.end();it++) + { + if(*it) + { + (*it)->Delete(); + *it=0; + } + } + for(std::vector::iterator it2=_arrays.begin();it2!=_arrays.end();it2++) + { + if(*it2) + { + (*it2)->Delete(); + *it2=0; + } + } + } + //else nothing to do let the plugin bufferize +} + +void ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::appendFieldValueOnAlreadyFetchedData(vtkDataSet *ds, int fieldId) +{ + const TinyInfoOnField& info=_info_per_field[fieldId]; + vtkDoubleArray *arr=_arrays[_array_ids_per_field[fieldId].front()]; + arr->SetName(info._name.c_str()); + if(info._type==0)//ON_CELLS + { + ds->GetCellData()->AddArray(arr); + return ; + } + if(info._type==1)//ON_NODES + { + ds->GetPointData()->AddArray(arr); + return ; + } +} + +int ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher::getPosGivenTimeLabel(double t) +{ + int nbOfFields=_time_label_per_field.size(); + for(int i=0;i::iterator it=std::find_if(_time_label_per_field.begin(),_time_label_per_field.end(), + std::bind2nd(std::greater(),t)); + if(it!=_time_label_per_field.end() && it!=_time_label_per_field.end()) + return std::distance(_time_label_per_field.begin(),it); + // + std::ostringstream oss; + oss << "Unexisting time : " << t << " Not in "; + std::copy(_time_label_per_field.begin(),_time_label_per_field.end(),std::ostream_iterator(oss," ")); + oss << " !"; + vtkOutputWindowDisplayErrorText(oss.str().c_str()); + return -1; +} diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingMultiFieldsClient.hxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingMultiFieldsClient.hxx new file mode 100644 index 00000000..85ea1b00 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingMultiFieldsClient.hxx @@ -0,0 +1,88 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __VTKMEDCOUPLINGMULTIFIELDSCLIENT_HXX__ +#define __VTKMEDCOUPLINGMULTIFIELDSCLIENT_HXX__ + +#include "ParaMEDMEM2VTK_defines.hxx" +#include "ParaMEDCouplingCorbaServant.hh" + +#include +#include + +class vtkDataSet; +class vtkDoubleArray; + +namespace ParaMEDMEM2VTK +{ + /*! + * Stores all info on field without consideration of time + */ + class TinyInfoOnField + { + public: + int _type;//ON_CELLS = 0, ON_NODES = 1, ON_GAUSS_PT = 2, ON_GAUSS_NE = 3 + std::string _name; + }; + + class ParaMEDMEM2VTK_EXPORT MEDCouplingMultiFieldsFetcher + { + public: + MEDCouplingMultiFieldsFetcher(int bufferingPolicy, SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_ptr mfieldsPtr); + ~MEDCouplingMultiFieldsFetcher(); + std::vector getTimeStepsForPV(); + void fetchRegardingPolicy(); + vtkDataSet *buildDataSetOnTime(double time); + private: + void appendFieldValueOnAlreadyFetchedData(vtkDataSet *ds, int fieldId); + int getPosGivenTimeLabel(double t); + private://CORBA Fetching + void retrievesMainTinyInfo(); + void fetchAll(); + void fetchMeshes(); + void fetchDataIfNeeded(int fieldId); + void unregisterRemoteServantIfAllFetched(); + void applyBufferingPolicy(); + private: + int _effective_pol; + SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_var _mfields_ptr; + bool _mfields_ptr_released; + private: + std::vector _info_per_field; + std::vector _time_label_per_field; + std::vector _time_discr_per_field; + std::vector _mesh_id_per_field; + std::vector< std::vector > _array_ids_per_field; + std::vector< std::vector > _time_def_per_field; + private: + int _field_id_previous; + int _arr_pos_previous; + double _time_field_id_previous; + int _arr_id_previous; + int _mesh_id_previous; + private: + std::vector _meshes; + std::vector _is_meshes_polyhedron;//to correct bug of polyhedrons in VTK on DeepCopy. BUG id :0011860 + std::vector _arrays; + private: + static const double EPS_TIME; + }; +} + +#endif diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.cxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.cxx new file mode 100644 index 00000000..c2fb69bf --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.cxx @@ -0,0 +1,129 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "VTKMEDCouplingUMeshClient.hxx" + +#include "vtkPoints.h" +#include "vtkCellArray.h" +#include "vtkDoubleArray.h" +#include "vtkSmartPointer.h" +#include "vtkUnstructuredGrid.h" + +#include +#include +#include +#include + +static const int ParaMEDMEM2VTKTypeTraducer[32]={1,3,21,5,9,7,22,-1,23,-1,-1,-1,-1,-1,10,14,13,-1,12,-1,24,-1,16,27,-1,26,-1,-1,-1,-1,25,42}; + +void ParaMEDMEM2VTK::FillMEDCouplingUMeshInstanceFrom(SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr meshPtr, vtkUnstructuredGrid *ret, bool& isPolyh) +{ + meshPtr->Register(); + // + SALOME_TYPES::ListOfDouble *tinyD; + SALOME_TYPES::ListOfLong *tinyI; + SALOME_TYPES::ListOfString *tinyS; + meshPtr->getTinyInfo(tinyD,tinyI,tinyS); + // + int spaceDim=(*tinyI)[1]; + int nbOfNodes=(*tinyI)[2]; + int meshDim=(*tinyI)[5]; + int nbOfCells=(*tinyI)[6]; + int meshLength=(*tinyI)[7]; + std::string name((*tinyS)[0]); + //std::vector compoNames(spaceDim); + //for(int i=0;iInitialize(); + ret->Allocate(nbOfCells); + vtkPoints *points=vtkPoints::New(); + vtkDoubleArray *da=vtkDoubleArray::New(); + da->SetNumberOfComponents(3); + da->SetNumberOfTuples(nbOfNodes); + double *pts=da->GetPointer(0); + // + SALOME_TYPES::ListOfLong *a1Corba; + SALOME_TYPES::ListOfDouble *a2Corba; + meshPtr->getSerialisationData(a1Corba,a2Corba); + if(spaceDim==3) + { + int myLgth=a2Corba->length(); + for(int i=0;iInsertNextCell(vtkType,nbOfNodeInCurCell,tmp); + else + {//polyhedron + isPolyh=true; + std::set s(tmp,tmp+nbOfNodeInCurCell); + vtkSmartPointer faces=vtkSmartPointer::New(); + int nbOfFaces=std::count(tmp,tmp+nbOfNodeInCurCell,-1)+1; + vtkIdType *work=tmp; + for(int i=0;iInsertNextCell(nbOfNodesInFace,work); + work=work2+1; + } + s.erase(-1); + std::vector v(s.begin(),s.end()); + ret->InsertNextCell(VTK_POLYHEDRON,v.size(),&v[0],nbOfFaces,faces->GetPointer()); + } + } + delete [] tmp; + // + delete a1Corba; + delete a2Corba; + // + ret->SetPoints(points); + points->Delete(); + points->SetData(da); + da->Delete(); + // + meshPtr->UnRegister(); +} diff --git a/src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.hxx b/src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.hxx new file mode 100644 index 00000000..12d572f7 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKMEDCouplingUMeshClient.hxx @@ -0,0 +1,32 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __VTKMEDCOUPLINGUMESHCLIENT_HXX__ +#define __VTKMEDCOUPLINGUMESHCLIENT_HXX__ + +#include "ParaMEDCouplingCorbaServant.hh" + +class vtkUnstructuredGrid; + +namespace ParaMEDMEM2VTK +{ + void FillMEDCouplingUMeshInstanceFrom(SALOME_MED::MEDCouplingUMeshCorbaInterface_ptr meshPtr, vtkUnstructuredGrid *ret, bool& isPolyh);//isPolyh bug VTK +} + +#endif diff --git a/src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.cxx b/src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.cxx new file mode 100644 index 00000000..dd58e36f --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.cxx @@ -0,0 +1,56 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "VTKParaMEDFieldClient.hxx" +#include "VTKMEDCouplingFieldClient.hxx" + +#include "vtkDataSet.h" +#include "vtkUnstructuredGrid.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkMultiBlockDataGroupFilter.h" +#include "vtkCompositeDataToUnstructuredGridFilter.h" + +std::vector ParaMEDMEM2VTK::FillMEDCouplingParaFieldDoubleInstanceFrom(SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, int begin, int end, + vtkMultiBlockDataSet *ret) +{ + std::vector ret2; + int nbOfParts=end-begin; + Engines::IORTab *allSlices=fieldPtr->tior(); + vtkMultiBlockDataGroupFilter *tmp=vtkMultiBlockDataGroupFilter::New(); + for(int i=0;i times; + vtkDataSet *part=ParaMEDMEM2VTK::BuildFullyFilledFromMEDCouplingFieldDoubleInstance(fieldCorba,times); + tmp->AddInputConnection(part->GetProducerPort()); + part->Delete(); + } + vtkCompositeDataToUnstructuredGridFilter *tmp2=vtkCompositeDataToUnstructuredGridFilter::New(); + tmp2->AddInputConnection(tmp->GetOutput()->GetProducerPort()); + tmp2->Update(); + // + vtkUnstructuredGrid *ret3=tmp2->GetOutput(); + ret->SetBlock(0,ret3); + // + tmp->Delete(); + tmp2->Delete(); + delete allSlices; + return ret2; +} diff --git a/src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.hxx b/src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.hxx new file mode 100644 index 00000000..995f627f --- /dev/null +++ b/src/Plugins/ParaMEDCorba/VTKParaMEDFieldClient.hxx @@ -0,0 +1,36 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __VTKPARAMEDFIELDCLIENT_HXX__ +#define __VTKPARAMEDFIELDCLIENT_HXX__ + +#include "ParaMEDMEM2VTK_defines.hxx" +#include "ParaMEDCouplingCorbaServant.hh" + +#include + +class vtkMultiBlockDataSet; + +namespace ParaMEDMEM2VTK +{ + ParaMEDMEM2VTK_EXPORT std::vector FillMEDCouplingParaFieldDoubleInstanceFrom(SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface_ptr fieldPtr, int begin, int end, + vtkMultiBlockDataSet *ret); +} + +#endif diff --git a/src/Plugins/ParaMEDCorba/testParaMEDCorba.cxx b/src/Plugins/ParaMEDCorba/testParaMEDCorba.cxx new file mode 100644 index 00000000..31be279e --- /dev/null +++ b/src/Plugins/ParaMEDCorba/testParaMEDCorba.cxx @@ -0,0 +1,35 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkUnstructuredGrid.h" +#include "vtkParaMEDCorbaSource.h" + +int main( int argc, char* argv[] ) +{ + const char* fname = argc > 1 ? argv[1] : "data.iorp"; + + vtkParaMEDCorbaSource* efr = vtkParaMEDCorbaSource::New(); + //efr->SetFileName( (char *)fname ); + efr->Update(); + // + vtkDataObject* ef = efr->GetOutputDataObject(0); + // + efr->Delete(); + return 0; +} diff --git a/src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.cxx b/src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.cxx new file mode 100644 index 00000000..3ed90734 --- /dev/null +++ b/src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.cxx @@ -0,0 +1,273 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkParaMEDCorbaSource.h" + +#include "vtkPoints.h" +#include "vtkIntArray.h" +#include "vtkCellData.h" +#include "vtkCellTypes.h" +#include "vtkCharArray.h" +#include "vtkPointData.h" +#include "vtkDoubleArray.h" +#include "vtkMultiBlockDataSet.h" +#include "vtkUnstructuredGrid.h" +// +#include "vtkStreamingDemandDrivenPipeline.h" +#include "vtkGenericAttributeCollection.h" +#include "vtkInformationVector.h" +#include "vtkObjectFactory.h" +#include "vtkInformation.h" +// +#include "vtkstd/string" +#include "vtksys/ios/fstream" +#include "vtkstd/algorithm" + +#include "VTKMEDCouplingMeshClient.hxx" +#include "VTKMEDCouplingFieldClient.hxx" +#include "VTKMEDCouplingMultiFieldsClient.hxx" +#include "VTKParaMEDFieldClient.hxx" + +//Work with IOR. +#include "ParaMEDCouplingCorbaServant.hh" +// + +vtkStandardNewMacro(vtkParaMEDCorbaSource); +vtkCxxRevisionMacro(vtkParaMEDCorbaSource,"$Revision$"); + +void *vtkParaMEDCorbaSource::Orb=0; + +vtkParaMEDCorbaSource::vtkParaMEDCorbaSource():mfieldsFetcher(0) +{ + this->MyDataSet=0; + if(!Orb) + { + CORBA::ORB_var *OrbC=new CORBA::ORB_var; + int argc=0; + *OrbC=CORBA::ORB_init(argc,0); + this->Orb=OrbC; + } + this->SetNumberOfInputPorts(0); + this->SetNumberOfOutputPorts(1); +} + +vtkParaMEDCorbaSource::~vtkParaMEDCorbaSource() +{ + delete mfieldsFetcher; +} + +const char *vtkParaMEDCorbaSource::GetIORCorba() +{ + return &IOR[0]; +} + +void vtkParaMEDCorbaSource::SetIORCorba(char *ior) +{ + if(!ior) + return; + if(ior[0]=='\0') + return; + int length=strlen(ior); + IOR.resize(length+1); + vtkstd::copy(ior,ior+length+1,&IOR[0]); + this->Modified(); +} + +void vtkParaMEDCorbaSource::SetBufferingPolicy(int pol) +{ + BufferingPolicy=pol; +} + +int vtkParaMEDCorbaSource::GetBufferingPolicy() +{ + return BufferingPolicy; +} + + //int vtkParaMEDCorbaSource::RequestUpdateExtent( vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo ) + //{ + //return this->Superclass::RequestUpdateExtent(request,inInfo,outInfo); + + /*vtkParaMEDCorbaDataSet* output = vtkParaMEDCorbaDataSet::SafeDownCast( info->Get( vtkDataObject::DATA_OBJECT() ) ); + if ( ! output ) + { + output = vtkParaMEDCorbaDataSet::New(); + output->SetPipelineInformation( info ); + output->Delete(); + this->GetOutputPortInformation( 0 )->Set( vtkDataObject::DATA_EXTENT_TYPE(), output->GetExtentType() ); + }*/ + + // return 1; + //} + +int vtkParaMEDCorbaSource::ProcessRequest(vtkInformation* request, + vtkInformationVector** inputVector, + vtkInformationVector* outputVector) +{ + // generate the data + if(request->Has(vtkDemandDrivenPipeline::REQUEST_DATA())) + { + return this->RequestData(request, inputVector, outputVector); + } + if(request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION())) + { + return this->RequestInformation(request, inputVector, outputVector); + } + return this->Superclass::ProcessRequest(request, inputVector, outputVector); +} + +int vtkParaMEDCorbaSource::FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info) +{ + info->Set(vtkDataObject::DATA_TYPE_NAME(), "vtkMultiBlockDataSet"); + return 1; +} + +int vtkParaMEDCorbaSource::RequestInformation(vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo) +{ + vtkInformation* myInfo=outInfo->GetInformationObject(0); + //myInfo->Set(vtkDataObject::DATA_TYPE_NAME(),"vtkUnstructuredGrid"); + if(!IOR.empty()) + { + //myInfo->Remove(vtkDataObject::DATA_TYPE_NAME()); + //myInfo->Remove(PORT_REQUIREMENTS_FILLED()); + //myInfo->Set(vtkDataObject::DATA_TYPE_NAME(),"vtkUnstructuredGrid"); + //myInfo->Set(PORT_REQUIREMENTS_FILLED(),1); + //vtkUnstructuredGrid *tony=vtkUnstructuredGrid::New(); + //tony->SetInformation(myInfo); + //myInfo->Set(vtkDataObject::DATA_OBJECT(),tony); + // + CORBA::ORB_var *OrbC=(CORBA::ORB_var *)this->Orb; + CORBA::Object_var obj=(*OrbC)->string_to_object(&IOR[0]); + // + Engines::MPIObject_ptr objPara=Engines::MPIObject::_narrow(obj); + if(CORBA::is_nil(objPara)) + {//sequential + this->TotalNumberOfPieces=1; + SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_var multiPtr=SALOME_MED::MEDCouplingMultiFieldsCorbaInterface::_narrow(obj); + if(!CORBA::is_nil(multiPtr)) + {//Request for multiFields + delete mfieldsFetcher; + mfieldsFetcher=new ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher(BufferingPolicy,multiPtr); + std::vector tsteps=mfieldsFetcher->getTimeStepsForPV(); + double timeRange[2]; + timeRange[0]=tsteps.front(); + timeRange[1]=tsteps.back(); + myInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),&tsteps[0],tsteps.size()); + myInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(),timeRange,2); + } + } + else + { + Engines::IORTab *iorTab=objPara->tior(); + this->TotalNumberOfPieces=iorTab->length(); + delete iorTab; + CORBA::release(objPara); + } + myInfo->Set(vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES(),this->TotalNumberOfPieces); + } + return 1; +} + +int vtkParaMEDCorbaSource::RequestData(vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outputVector) +{ + vtkInformation *outInfo=outputVector->GetInformationObject(0); + // + this->UpdatePiece = this->GetOutputDataObject(0)->GetUpdatePiece();//emulation vtkUnstructuredGrid::GetUpdateExtent(int&,int&,int&) + this->NumberOfPieces = this->GetOutputDataObject(0)->GetUpdateNumberOfPieces();//emulation vtkUnstructuredGrid::GetUpdateExtent(int&,int&,int&) + this->GhostLevel = this->GetOutputDataObject(0)->GetUpdateGhostLevel();//emulation vtkUnstructuredGrid::GetUpdateExtent(int&,int&,int&) + this->StartPiece=((this->UpdatePiece*this->TotalNumberOfPieces)/this->NumberOfPieces); + this->EndPiece=(((this->UpdatePiece+1)*this->TotalNumberOfPieces)/this->NumberOfPieces); + vtkMultiBlockDataSet *ret0=vtkMultiBlockDataSet::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); + double *reqTS = 0; + if(outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS())) + reqTS = outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEPS()); + //Client request on ORB. + CORBA::ORB_var *OrbC=(CORBA::ORB_var *)this->Orb; + CORBA::Object_var obj=(*OrbC)->string_to_object(&IOR[0]); + // + Engines::MPIObject_var objPara=Engines::MPIObject::_narrow(obj); + if(CORBA::is_nil(objPara)) + {//sequential + SALOME_MED::MEDCouplingMeshCorbaInterface_var meshPtr=SALOME_MED::MEDCouplingMeshCorbaInterface::_narrow(obj); + if(!CORBA::is_nil(meshPtr)) + { + bool dummy;//bug VTK + vtkDataSet *ret=ParaMEDMEM2VTK::BuildFromMEDCouplingMeshInstance(meshPtr,dummy);//bug VTK + if(!ret) + return 0; + ret0->SetBlock(0,ret); + ret->Delete(); + return 1; + } + SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_var fieldPtr=SALOME_MED::MEDCouplingFieldDoubleCorbaInterface::_narrow(obj); + if(!CORBA::is_nil(fieldPtr)) + { + std::vector ret2; + vtkDataSet *ret=ParaMEDMEM2VTK::BuildFullyFilledFromMEDCouplingFieldDoubleInstance(fieldPtr,ret2); + if(!ret) + { + vtkErrorMacro("On single field CORBA fetching an error occurs !"); + return 0; + } + ret0->SetBlock(0,ret); + ret->Delete(); + // + double timeRange[2]; + timeRange[0]=ret2[0]; + timeRange[1]=ret2[0]; + outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(),&ret2[0],1); + outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(),timeRange,2); + ret0->GetInformation()->Set(vtkDataObject::DATA_TIME_STEPS(), &ret2[0], 1); + return 1; + } + SALOME_MED::MEDCouplingMultiFieldsCorbaInterface_var multiPtr=SALOME_MED::MEDCouplingMultiFieldsCorbaInterface::_narrow(obj); + if(!CORBA::is_nil(multiPtr)) + { + vtkDataSet *ret=mfieldsFetcher->buildDataSetOnTime(reqTS[0]); + if(!ret) + { + vtkErrorMacro("On multi fields CORBA fetching an error occurs !"); + return 0; + } + ret0->SetBlock(0,ret); + ret->Delete(); + ret0->GetInformation()->Set(vtkDataObject::DATA_TIME_STEPS(),reqTS, 1); + return 1; + } + vtkErrorMacro("Unrecognized sequential CORBA reference !"); + return 0; + } + else + { + SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface_var paraFieldCorba=SALOME_MED::ParaMEDCouplingFieldDoubleCorbaInterface::_narrow(obj); + if(!CORBA::is_nil(paraFieldCorba)) + { + ParaMEDMEM2VTK::FillMEDCouplingParaFieldDoubleInstanceFrom(paraFieldCorba,this->StartPiece,this->EndPiece,ret0); + return 1; + } + vtkErrorMacro("Unrecognized parallel CORBA reference !"); + return 0; + } +} + +void vtkParaMEDCorbaSource::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf( os, indent ); + os << "Data: " << this->MyDataSet << "\n"; +} + diff --git a/src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.h b/src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.h new file mode 100644 index 00000000..d4646c6b --- /dev/null +++ b/src/Plugins/ParaMEDCorba/vtkParaMEDCorbaSource.h @@ -0,0 +1,81 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + + +#ifndef __vtkParaMEDCorbaSource_h +#define __vtkParaMEDCorbaSource_h + +#include "ParaMEDMEM2VTK_defines.hxx" +#include "vtkUnstructuredGridAlgorithm.h" +#include + +class vtkDoubleArray; +class vtkUnstructuredGrid; + +namespace ParaMEDMEM2VTK +{ + class MEDCouplingMultiFieldsFetcher; +} + +class vtkParaMEDCorbaSource : public vtkAlgorithm // +{ +public: + vtkTypeRevisionMacro(vtkParaMEDCorbaSource, vtkAlgorithm); + ParaMEDMEM2VTK_EXPORT static vtkParaMEDCorbaSource* New(); + virtual void PrintSelf( ostream& os, vtkIndent indent ); + const char *GetIORCorba(); + void SetIORCorba(char *ior); + void SetBufferingPolicy(int pol); + int GetBufferingPolicy(); +protected: + vtkParaMEDCorbaSource(); + virtual ~vtkParaMEDCorbaSource(); + int FillOutputPortInformation(int vtkNotUsed(port), vtkInformation* info); + int ProcessRequest(vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector); + //virtual int RequestUpdateExtent( vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo ); + virtual int RequestInformation( vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo ); + virtual int RequestData( vtkInformation* request, vtkInformationVector** inInfo, vtkInformationVector* outInfo ); + //BTX + int TotalNumberOfPieces; + int NumberOfPieces; + int UpdatePiece; + int GhostLevel; + int StartPiece; + int EndPiece; + int BufferingPolicy; + vtkUnstructuredGrid *MyDataSet; + vtkstd::vector IOR; + ParaMEDMEM2VTK::MEDCouplingMultiFieldsFetcher *mfieldsFetcher; + //not clean but to avoid to include CORBA.h in this *.h + static void *Orb; + //ETX + private: + /*void traduceMedMeshToUnstructuredDataset(vtkUnstructuredGrid *ret, int nbOfCells, int nbOfNodes, + int nbOfTypes, const int *types, const int *nbOfEltsPerTypes, const int *nodalConnectivity, + const double *coords, int spaceDim); + vtkDoubleArray *buildDataArrayFromMedCoords(const double *coords, int nbOfNodes, int spaceDim); + void reorganizeCellConnectivity(int vtkType, int nbOfNodes, const int *medConn, int *vtkConn); + int transformMedGeomEltType2VtkType(int typeMed, int *nbOfNodesPerCell);*/ + // + vtkParaMEDCorbaSource( const vtkParaMEDCorbaSource& ); // Not implemented. + void operator = ( const vtkParaMEDCorbaSource& ); // Not implemented. +}; + +#endif // __vtkParaMEDCorbaSource_h + diff --git a/src/Plugins/ScaleVector/CMakeLists.txt b/src/Plugins/ScaleVector/CMakeLists.txt new file mode 100644 index 00000000..1124c45a --- /dev/null +++ b/src/Plugins/ScaleVector/CMakeLists.txt @@ -0,0 +1,42 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +PROJECT(ScaleVector) +cmake_minimum_required(VERSION 2.6) + +cmake_policy(SET CMP0003 NEW) + +FIND_PACKAGE(ParaView REQUIRED) +INCLUDE(${PARAVIEW_USE_FILE}) + +SET(SRCS + vtkScaleVectorFilter.cxx + ) + +ADD_PARAVIEW_PLUGIN(ScaleVector "1.0" + SERVER_MANAGER_XML ScaleVector.xml + GUI_RESOURCE_FILES ScaleVectorClient.xml + SERVER_MANAGER_SOURCES ${SRCS}) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION lib/paraview + LIBRARY DESTINATION lib/paraview + ARCHIVE DESTINATION lib/paraview + ) + diff --git a/src/Plugins/ScaleVector/ScaleVector.xml b/src/Plugins/ScaleVector/ScaleVector.xml new file mode 100644 index 00000000..3ec3519e --- /dev/null +++ b/src/Plugins/ScaleVector/ScaleVector.xml @@ -0,0 +1,77 @@ + + + + + + + "Multiply a vector by a scale factor." + + + + + + + + + + + + + + + + + + + Specifies the cell field used for the elevation surface. + + + + + + + + + + + + + + + + + diff --git a/src/Plugins/ScaleVector/ScaleVectorClient.xml b/src/Plugins/ScaleVector/ScaleVectorClient.xml new file mode 100644 index 00000000..526ecbde --- /dev/null +++ b/src/Plugins/ScaleVector/ScaleVectorClient.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/Plugins/ScaleVector/vtkScaleVectorFilter.cxx b/src/Plugins/ScaleVector/vtkScaleVectorFilter.cxx new file mode 100644 index 00000000..266b9bb9 --- /dev/null +++ b/src/Plugins/ScaleVector/vtkScaleVectorFilter.cxx @@ -0,0 +1,170 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkScaleVectorFilter.h" +#include "vtkInformation.h" +#include "vtkInformationVector.h" +#include "vtkObjectFactory.h" +#include "vtkCellArray.h" +#include "vtkPointData.h" +#include "vtkDataSet.h" + +#include + +using namespace std; + +vtkCxxRevisionMacro(vtkScaleVectorFilter, "$Revision$"); +vtkStandardNewMacro(vtkScaleVectorFilter); + +vtkScaleVectorFilter::vtkScaleVectorFilter() +{ + this->ScaleFactor = 0.5; +} + +vtkScaleVectorFilter::~vtkScaleVectorFilter() +{ +} + +//---------------------------------------------------------------------------- +int vtkScaleVectorFilter::FillInputPortInformation( + int vtkNotUsed(port), vtkInformation* info) +{ + // now add our info + info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkDataSet"); + return 1; +} + + +int vtkScaleVectorFilter::RequestData(vtkInformation *vtkNotUsed(request), + vtkInformationVector **input, vtkInformationVector *output) +{ + vtkDataSet *dsIn = vtkDataSet::SafeDownCast( + input[0]->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkDataSet *dsOut = vtkDataSet::SafeDownCast( + output->GetInformationObject(0)->Get(vtkDataObject::DATA_OBJECT())); + + vtkDataArray* array = this->GetInputArrayToProcess(0, input); + + if(dsIn == NULL || array == NULL || dsOut == NULL + || array->GetNumberOfComponents() != 3 || + this->GetInputArrayAssociation(0, input) != vtkDataObject::FIELD_ASSOCIATION_POINTS) + { + vtkDebugMacro("vtkScaleVectorFilter no correctly configured"); + return 1; + } + + dsOut->ShallowCopy(dsIn); + + vtkPointData* inPD = dsIn->GetPointData(); + vtkPointData* outPD = dsOut->GetPointData(); + + outPD->RemoveArray(array->GetName()); + + vtkDataArray* outArray = array->NewInstance(); + outArray->SetName(array->GetName()); + + string name = array->GetName(); + size_t pos1 = name.find_last_of("["); + if(pos1 != string::npos) + { + string name1 = name.substr(0, pos1); + size_t noblankpos = name1.find_last_not_of(" "); + name1 = name1.substr(0, noblankpos+1); + + outArray->SetName(name1.c_str()); + + for(int arrayId = 0; arrayId < inPD->GetNumberOfArrays(); arrayId++) + { + vtkDataArray* thearray = inPD->GetArray(arrayId); + if(thearray == NULL) + continue; + + if(strncmp(name1.c_str(), thearray->GetName(), name1.size()) == 0) + { + outPD->RemoveArray(thearray->GetName()); + } + } + } + + outPD->AddArray(outArray); + outArray->Delete(); + + outArray->SetNumberOfComponents(array->GetNumberOfComponents()); + outArray->SetNumberOfTuples(array->GetNumberOfTuples()); + + if(array->HasAComponentName()) + { + outArray->CopyComponentNames(array); + } + + if(array->HasInformation()) + { + outArray->CopyInformation(array->GetInformation()); + } + + for(vtkIdType id=0; id < outArray->GetNumberOfTuples(); id++) + { + double tuple[3]; + array->GetTuple(id, tuple); + tuple[0] *= this->ScaleFactor; + tuple[1] *= this->ScaleFactor; + tuple[2] *= this->ScaleFactor; + outArray->SetTuple(id, tuple); + } + // fix the range keys to match the full range, so that the + // gui automatically sets the range. + double range[2]; + vtkInformation* info = outArray->GetInformation(); + + array->GetRange(range, -1); + range[0] = 0; + info->Set(vtkDataArray::L2_NORM_RANGE(), range, 2); + + if(!outArray->GetInformation()->Has(vtkDataArray::PER_COMPONENT())) + { + vtkInformationVector* infoVec = vtkInformationVector::New(); + info->Set( vtkDataArray::PER_COMPONENT(), infoVec ); + infoVec->FastDelete(); + } + vtkInformationVector* per_comp = info->Get(vtkDataArray::PER_COMPONENT()); + per_comp->SetNumberOfInformationObjects(outArray->GetNumberOfComponents()); + for(int comp = 0; comp < outArray->GetNumberOfComponents(); comp++) + { + array->GetRange(range, comp); + range[0] = fabs(range[0]); + range[1] = fabs(range[1]); + double r = (range[0] > range[1] ? range[0] : range[1]); + range[0] = -r; + range[1] = r; + per_comp->GetInformationObject(comp)->Set( + vtkDataArray::COMPONENT_RANGE(), range, 2 ); + } + + outPD->SetActiveVectors(outArray->GetName()); + + return 1; +} + +void vtkScaleVectorFilter::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + + os << indent << "ScaleFactor : " << this->ScaleFactor << endl; +} diff --git a/src/Plugins/ScaleVector/vtkScaleVectorFilter.h b/src/Plugins/ScaleVector/vtkScaleVectorFilter.h new file mode 100644 index 00000000..dea186c8 --- /dev/null +++ b/src/Plugins/ScaleVector/vtkScaleVectorFilter.h @@ -0,0 +1,54 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _vtkScaleVectorFilter_h +#define _vtkScaleVectorFilter_h + +#include "vtkPassInputTypeAlgorithm.h" + +class VTK_EXPORT vtkScaleVectorFilter: public vtkPassInputTypeAlgorithm +{ +public: + static vtkScaleVectorFilter *New(); + vtkTypeRevisionMacro(vtkScaleVectorFilter,vtkPassInputTypeAlgorithm); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description : + // This is the factor applied to the vector field. + vtkSetClampMacro(ScaleFactor,double, -1, 1); + vtkGetMacro(ScaleFactor,double); + +protected: + vtkScaleVectorFilter(); + ~vtkScaleVectorFilter(); + + int RequestData(vtkInformation *, + vtkInformationVector **, + vtkInformationVector *); + + int FillInputPortInformation(int port, + vtkInformation* info); + + double ScaleFactor; + +private: + vtkScaleVectorFilter(const vtkScaleVectorFilter&); + void operator =(const vtkScaleVectorFilter&); +}; +#endif diff --git a/src/Plugins/TableReader/CMakeLists.txt b/src/Plugins/TableReader/CMakeLists.txt new file mode 100644 index 00000000..96e5c160 --- /dev/null +++ b/src/Plugins/TableReader/CMakeLists.txt @@ -0,0 +1,47 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +# TableReader plugin consists of two parts: +# 1. Table reader - reads tables in Post-Pro specific format +# 2. "Table To 3D" filter - creates 3D representation of a table + +cmake_minimum_required(VERSION 2.4) +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + +project(TableReader) + +# Find ParaView +FIND_PACKAGE(ParaView REQUIRED) +if(NOT ParaView_FOUND) + MESSAGE(FATAL_ERROR "Please locate ParaView." ) +ENDIF(NOT ParaView_FOUND) +INCLUDE(${PARAVIEW_USE_FILE}) + +# Standard CMake option for building libraries shared or static by default. +OPTION(BUILD_SHARED_LIBS + "Build with shared libraries." + ${VTK_BUILD_SHARED_LIBS}) + +# Add subdirectories +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Reader ${CMAKE_CURRENT_SOURCE_DIR}/TableTo3DFilter) +ADD_SUBDIRECTORY(Reader) +ADD_SUBDIRECTORY(TableTo3DFilter) +ADD_SUBDIRECTORY(ParaViewPlugin) \ No newline at end of file diff --git a/src/Plugins/TableReader/ParaViewPlugin/CMakeLists.txt b/src/Plugins/TableReader/ParaViewPlugin/CMakeLists.txt new file mode 100644 index 00000000..22d7dc2c --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/CMakeLists.txt @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF(PARAVIEW_BUILD_QT_GUI) + + # Custom object panel for the reader and + # custom display panel for line chart view + QT4_WRAP_UI(CLIENT_UI_SRCS + Resources/UI/TableReaderPanel.ui + Resources/UI/CustomXYChartDisplayPanel.ui + ) + + QT4_WRAP_CPP(MOC_SRCS + pqTableReaderPanel.h + pqTableTo3DPanel.h + pqCustomChartDisplayPanelImplementation.h + pqCustomXYChartDisplayPanel.h + pqCustomPlotSettingsModel.h + ) + + SET(CLIENT_SRCS + pqTableReaderPanel.cxx + pqTableTo3DPanel.cxx + pqCustomChartDisplayPanelImplementation.cxx + pqCustomXYChartDisplayPanel.cxx + pqCustomPlotSettingsModel.cxx + ) + + ADD_PARAVIEW_OBJECT_PANEL( + TABLEREADER_IFACES TABLEREADER_IFACE_SRCS + CLASS_NAME pqTableReaderPanel + XML_NAME TableReader + XML_GROUP sources) + + ADD_PARAVIEW_OBJECT_PANEL( + TABLETO3D_IFACES TABLETO3D_IFACE_SRCS + CLASS_NAME pqTableTo3DPanel + XML_NAME TableTo3D + XML_GROUP filters) + + # define the server-side and the client-side parts + # of the table reader plugin + ADD_PARAVIEW_PLUGIN(TableReaderPlugin "1.0" + SOURCES ../Reader/TableParser.cxx + SERVER_MANAGER_SOURCES ../Reader/vtkVisuTableReader.cxx ../TableTo3DFilter/vtkTableTo3D.cxx + SERVER_MANAGER_XML Resources/TableReaderServer.xml Resources/TableTo3DServer.xml + GUI_INTERFACES ${TABLEREADER_IFACES} ${TABLETO3D_IFACES} pqCustomChartDisplayPanel + GUI_SOURCES ${CLIENT_SRCS} + ${CLIENT_UI_SRCS} + ${TABLEREADER_IFACE_SRCS} + ${TABLETO3D_IFACE_SRCS} + ${MOC_SRCS} + GUI_RESOURCES Resources/TableReader.qrc Resources/TableTo3D.qrc) + +ELSE(PARAVIEW_BUILD_QT_GUI) + + # define the server-side part of the table reader plugin + ADD_PARAVIEW_PLUGIN(TableReaderPlugin "1.0" + SOURCES TableParser.cxx + SERVER_MANAGER_SOURCES vtkVisuTableReader.cxx vtkTableTo3D.cxx + SERVER_MANAGER_XML Resources/TableReaderServer.xml Resources/TableTo3DServer.xml) + +ENDIF(PARAVIEW_BUILD_QT_GUI) + +TARGET_LINK_LIBRARIES(TableReaderPlugin vtkVisuTableReader vtkTableTo3D) + +# Install +INSTALL( + TARGETS TableReaderPlugin + RUNTIME DESTINATION lib/paraview + LIBRARY DESTINATION lib/paraview + ARCHIVE DESTINATION lib/paraview +) \ No newline at end of file diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReader.qrc b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReader.qrc new file mode 100644 index 00000000..1ee5f3af --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReader.qrc @@ -0,0 +1,5 @@ + + + TableReaderClient.xml + + diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReaderClient.xml b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReaderClient.xml new file mode 100644 index 00000000..33f4cf03 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReaderClient.xml @@ -0,0 +1,6 @@ + + + + diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReaderServer.xml b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReaderServer.xml new file mode 100644 index 00000000..896674ed --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableReaderServer.xml @@ -0,0 +1,80 @@ + + + + + + + + This property specifies the file name for the table reader. + + + + + + + When set to true, the reader will detect numeric columns and create + vtkDoubleArray or vtkIntArray for those instead of vtkStringArray. + + + + + + + When set to true, the reader will interpret the first string as + column titles. + + + + + + This property defines string to be used to separate table values. + + + + + + This property defines the number of table to read. + + + + + + + Names of available tables. + + + + + + + + + + diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3D.qrc b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3D.qrc new file mode 100644 index 00000000..4ccb88c6 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3D.qrc @@ -0,0 +1,5 @@ + + + TableTo3DClient.xml + + diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3DClient.xml b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3DClient.xml new file mode 100644 index 00000000..c6547e7e --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3DClient.xml @@ -0,0 +1,3 @@ + + + diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3DServer.xml b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3DServer.xml new file mode 100644 index 00000000..a167b4b1 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/TableTo3DServer.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + This property specifies the input.. + + + + + + + Specify value to scale displacement. + + + + + + + When set to true, the filter will compute optimus scale factor, + the value entered by user will be ignored. + + + + + + + + + + This property determines type of presentation: surface of contour. + + + + + + + Specify number of contours for contour presentation type. + + + + + + diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/CustomLineChartDisplayPanel.ui b/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/CustomLineChartDisplayPanel.ui new file mode 100644 index 00000000..0bfe9f6a --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/CustomLineChartDisplayPanel.ui @@ -0,0 +1,335 @@ + + + CustomLineChartDisplayPanel + + + + 0 + 0 + 301 + 534 + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'DejaVu Sans'; font-size:9pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';">Toggle visibility of this display's series.</p></body></html> + + + Use this option to show/hide all the line series in the chart. + + + Show Line Series in Chart + + + + + + + X Axis Data + + + + + + Select this option to use the indexes of the y-axis array for the x-axis points. + + + Use Array Index From Y Axis Data + + + true + + + false + + + + + + + Select this option to use a data array to define the x-axis points. + + + Use Data Array + + + false + + + + + + + false + + + Choose the name of the x-axis data array. + + + + + + + + + + + 0 + 0 + + + + Line Series + + + + 6 + + + 6 + + + + + Select the chart axes for the line series. + + + + Bottom-Left + + + + + Bottom-Right + + + + + Top-Left + + + + + Top-Right + + + + + + + + Select the line style for the series. + + + + None + + + + + Solid + + + + + Dash + + + + + Dot + + + + + Dash Dot + + + + + Dash Dot Dot + + + + + + + + Chart Axes + + + + + + + Line Style + + + + + + + Enter the thickness for the line. + + + 1 + + + 10 + + + 1 + + + + + + + Line Thickness + + + + + + + Press this button to choose a new color for the line. + + + Choose Color... + + + + + + + Line Color + + + + + + + Use this option to show/hide the line series in the chart. + + + Enable Line Series + + + + + + + + 0 + 0 + + + + This displays the list of line series. You can use the list to edit the series options. + + + QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + false + + + + + + + Marker Style + + + + + + + + None + + + + + Cross + + + + + Plus + + + + + Square + + + + + Circle + + + + + Diamond + + + + + + + + + + + + pqColorChooserButton + QPushButton +
    pqColorChooserButton.h
    + 1 +
    + + pqTreeView + QTreeView +
    pqTreeView.h
    +
    +
    + + ViewData + SeriesList + SeriesEnabled + ColorButton + Thickness + StyleList + + + + UseDataArray + toggled(bool) + XAxisArray + setEnabled(bool) + + + 80 + 363 + + + 209 + 363 + + + + +
    diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/CustomXYChartDisplayPanel.ui b/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/CustomXYChartDisplayPanel.ui new file mode 100644 index 00000000..b7b2da5c --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/CustomXYChartDisplayPanel.ui @@ -0,0 +1,319 @@ + + + CustomXYChartDisplayPanel + + + + 0 + 0 + 307 + 566 + + + + Form + + + + + + X Axis Data + + + + + + Select this option to use the indexes of the y-axis array for the x-axis points. + + + Use Array Index From Y Axis Data + + + true + + + false + + + + + + + Select this option to use a data array to define the x-axis points. + + + Use Data Array + + + false + + + + + + + false + + + Choose the name of the x-axis data array. + + + + + + + + + + + 0 + 0 + + + + Line Series + + + + + + + 0 + 0 + + + + This displays the list of line series. You can use the list to edit the series options. + + + QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked + + + QAbstractItemView::ExtendedSelection + + + QAbstractItemView::SelectRows + + + false + + + + + + + Auto Select Items With The Same Units + + + + + + + Ignore Units + + + + + + + Line Color + + + + + + + Press this button to choose a new color for the line. + + + Choose Color... + + + + + + + Line Thickness + + + + + + + Enter the thickness for the line. + + + 1 + + + 10 + + + 1 + + + + + + + Line Style + + + + + + + Select the line style for the series. + + + + None + + + + + Solid + + + + + Dash + + + + + Dot + + + + + Dash Dot + + + + + Dash Dot Dot + + + + + + + + Marker Style + + + + + + + + None + + + + + Cross + + + + + Plus + + + + + Square + + + + + Circle + + + + + Diamond + + + + + + + + Chart Axes + + + + + + + Select the chart axes for the line series. + + + + Bottom-Left + + + + + Bottom-Right + + + + + Top-Left + + + + + Top-Right + + + + + + + + + + + Generate Axes Titles + + + + + + + + pqColorChooserButton + QPushButton +
    pqColorChooserButton.h
    + 1 +
    + + pqTreeView + QTreeView +
    pqTreeView.h
    +
    +
    + + + + UseDataArray + toggled(bool) + XAxisArray + setEnabled(bool) + + + 104 + 362 + + + 178 + 361 + + + + +
    diff --git a/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/TableReaderPanel.ui b/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/TableReaderPanel.ui new file mode 100644 index 00000000..691aeb6a --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/Resources/UI/TableReaderPanel.ui @@ -0,0 +1,103 @@ + + + TableReaderPanel + + + + 0 + 0 + 366 + 657 + + + + + 0 + 0 + + + + Form + + + + 9 + + + + + Import Options + + + + + + Detect Numeric Columns + + + + + + + Interpret First String As Column Titles + + + + + + + Value Delimiter + + + + + + + + + + Table + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 10 + + + 10 + + + false + + + false + + + true + + + diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqCustomChartDisplayPanelImplementation.cxx b/src/Plugins/TableReader/ParaViewPlugin/pqCustomChartDisplayPanelImplementation.cxx new file mode 100755 index 00000000..b36b6471 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqCustomChartDisplayPanelImplementation.cxx @@ -0,0 +1,79 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "pqCustomChartDisplayPanelImplementation.h" +#include "pqCustomXYChartDisplayPanel.h" + +#include "vtkSMProxy.h" + +#include "pqDataRepresentation.h" +#include "pqPipelineSource.h" + + +pqCustomChartDisplayPanelImplementation::pqCustomChartDisplayPanelImplementation(QObject* p): +QObject(p) + { + } + +bool pqCustomChartDisplayPanelImplementation::canCreatePanel(pqRepresentation* repr) const +{ + if(!repr || !repr->getProxy() || + (repr->getProxy()->GetXMLName() != QString("XYChartRepresentation"))) + { + return false; + } + + pqDataRepresentation* dataRepr = qobject_cast(repr); + if(dataRepr) + { + pqPipelineSource* input = dataRepr->getInput(); + QString name = input->getProxy()->GetXMLName(); + if (name == "TableReader") + { + return true; + } + } + + return false; +} + +pqDisplayPanel* pqCustomChartDisplayPanelImplementation::createPanel(pqRepresentation* repr, QWidget* p) +{ + if(!repr || !repr->getProxy() || + (repr->getProxy()->GetXMLName() != QString("XYChartRepresentation"))) + { + return NULL; + } + + pqDataRepresentation* dataRepr = qobject_cast(repr); + if(dataRepr) + { + pqPipelineSource* input = dataRepr->getInput(); + QString name=input->getProxy()->GetXMLName(); + + if (name == "TableReader") + { + return new pqCustomXYChartDisplayPanel(repr, p); + } + } + + return NULL; +} + + diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqCustomChartDisplayPanelImplementation.h b/src/Plugins/TableReader/ParaViewPlugin/pqCustomChartDisplayPanelImplementation.h new file mode 100755 index 00000000..8e2f8c56 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqCustomChartDisplayPanelImplementation.h @@ -0,0 +1,51 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _pqCustomChartDisplayPanelImplementation_h +#define _pqCustomChartDisplayPanelImplementation_h + +#include "pqDisplayPanelInterface.h" + +#include + +class QWidget; + +class pqCustomChartDisplayPanelImplementation : public QObject, + public pqDisplayPanelInterface +{ + Q_OBJECT + Q_INTERFACES(pqDisplayPanelInterface) + + public: + // Constructor + pqCustomChartDisplayPanelImplementation(){} + pqCustomChartDisplayPanelImplementation(QObject* p); + + // Destructor + virtual ~pqCustomChartDisplayPanelImplementation(){} + + // Returns true if this panel can be created for the given the proxy. + virtual bool canCreatePanel(pqRepresentation* proxy) const; + + // Creates a panel for the given proxy + virtual pqDisplayPanel* createPanel(pqRepresentation* proxy, QWidget* p); +}; + +#endif + diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqCustomPlotSettingsModel.cxx b/src/Plugins/TableReader/ParaViewPlugin/pqCustomPlotSettingsModel.cxx new file mode 100644 index 00000000..f6af9f5d --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqCustomPlotSettingsModel.cxx @@ -0,0 +1,218 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "pqCustomPlotSettingsModel.h" + +#include "vtkSMChartRepresentationProxy.h" +#include "pqDataRepresentation.h" +#include "vtkWeakPointer.h" +#include "vtkSMPropertyHelper.h" + +#include + + +class pqCustomPlotSettingsModel::pqImplementation +{ +public: + pqImplementation() + { + } + + vtkWeakPointer RepresentationProxy; + QPointer Representation; +}; + +pqCustomPlotSettingsModel::pqCustomPlotSettingsModel(QObject* parentObject) : + Superclass(parentObject), Implementation(new pqImplementation()) +{ +} + +pqCustomPlotSettingsModel::~pqCustomPlotSettingsModel() +{ + delete this->Implementation; +} + +//----------------------------------------------------------------------------- +void pqCustomPlotSettingsModel::setRepresentation(pqDataRepresentation* rep) +{ + Superclass::setRepresentation(rep); + + if (!rep || rep == this->Implementation->Representation) + { + return; + } + + if (this->Implementation->Representation) + { + QObject::disconnect(this->Implementation->Representation, 0, this, 0); + } + + this->Implementation->RepresentationProxy = + vtkSMChartRepresentationProxy::SafeDownCast(rep->getProxy()); + this->Implementation->Representation = rep; +} + +//----------------------------------------------------------------------------- +pqDataRepresentation* pqCustomPlotSettingsModel::representation() const +{ + return this->Implementation->Representation; +} + +//----------------------------------------------------------------------------- +bool pqCustomPlotSettingsModel::setData(const QModelIndex &idx, const QVariant &value, + int role) +{ + bool result = false; + if (idx.isValid() && idx.model() == this) + { + if (idx.column() == 1 && (role == Qt::DisplayRole || role == Qt::EditRole)) + { + QString name = value.toString(); + if (!name.isEmpty()) + { + this->setSeriesLabel(idx.row(), name); + } + } + else if(idx.column() == 0 && role == Qt::CheckStateRole) + { + result = true; + int checkstate = value.toInt(); + this->setSeriesEnabled(idx.row(), checkstate == Qt::Checked); + } + } + return result; +} + +//----------------------------------------------------------------------------- +void pqCustomPlotSettingsModel::setSeriesEnabled(int row, bool enabled) +{ + if (row >= 0 && row < this->rowCount(QModelIndex())) + { + int minRow = row; + int maxRow = row; + + if (enabled && !(this->IgnoreUnitsModeOn)) + { + QString unit = getUnit(QString(this->getSeriesName(row))); + + for (int i = 0; i < rowCount(QModelIndex()); i++) + { + if (i == row) + { + continue; + } + + bool rowChanged = false; + QString seriesName = QString(this->getSeriesName(i)); + QString seriesUnit = getUnit(seriesName); + + if ((seriesUnit != unit) && getSeriesEnabled(i)) + { + vtkSMPropertyHelper(this->Implementation->RepresentationProxy, + "SeriesVisibility").SetStatus(this->getSeriesName(i), 0); + rowChanged = true; + } + + if (!seriesUnit.isEmpty() && this->AutoSelectModeOn && + (seriesUnit == unit) && !getSeriesEnabled(i)) + { + vtkSMPropertyHelper(this->Implementation->RepresentationProxy, + "SeriesVisibility").SetStatus(this->getSeriesName(i), 1); + rowChanged = true; + } + + if (rowChanged) + { + if (i < minRow) + { + minRow = i; + } + else if (i > maxRow) + { + maxRow = i; + } + } + } + } + + vtkSMPropertyHelper(this->Implementation->RepresentationProxy, + "SeriesVisibility").SetStatus(this->getSeriesName(row), enabled ? 1 : 0); + this->Implementation->RepresentationProxy->UpdateVTKObjects(); + + this->setSeriesColor(row, this->getSeriesColor(row)); + QModelIndex topLeft = this->createIndex(minRow, 0); + QModelIndex bottomRight = this->createIndex(maxRow, 0); + emit this->dataChanged(topLeft, bottomRight); + emit this->redrawChart(); + this->updateCheckState(0, Qt::Horizontal); + } +} + +//----------------------------------------------------------------------------- +void pqCustomPlotSettingsModel::SetIgnoreUnitsModeOn(bool enabled) +{ + this->IgnoreUnitsModeOn = enabled; + + if (this->IgnoreUnitsModeOn) + { + this->setCheckable(0, Qt::Horizontal, true); + this->setCheckState(0, Qt::Horizontal, Qt::Unchecked); + } + else + { + this->setCheckState(0, Qt::Horizontal, Qt::Unchecked); + this->setCheckable(0, Qt::Horizontal, false); + } +} + +//----------------------------------------------------------------------------- +void pqCustomPlotSettingsModel::SetAutoSelectModeOn(bool enabled) +{ + this->AutoSelectModeOn = enabled; + if (enabled && !this->IgnoreUnitsModeOn) + { + for (int i = 0; i < rowCount(QModelIndex()); i++) + { + if (getSeriesEnabled(i)) + { + setSeriesEnabled(i, true); + break; + } + } + } +} + +//----------------------------------------------------------------------------- +QString pqCustomPlotSettingsModel::getUnit(const QString& seriesName) +{ + QString unit(""); + + int index1 = seriesName.lastIndexOf("]"); + if (index1 == seriesName.size() - 1) + { + int index2 = seriesName.lastIndexOf(" ["); + if (index2 > 0) + { + int start = index2 + 2; + unit = seriesName.mid(index2 + 2, index1 - start); + } + } + + return unit; +} diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqCustomPlotSettingsModel.h b/src/Plugins/TableReader/ParaViewPlugin/pqCustomPlotSettingsModel.h new file mode 100644 index 00000000..7cbee305 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqCustomPlotSettingsModel.h @@ -0,0 +1,68 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __pqCustomPlotSettingsModel_h +#define __pqCustomPlotSettingsModel_h + +#include "pqPlotSettingsModel.h" + +class pqDataRepresentation; + +class pqCustomPlotSettingsModel : public pqPlotSettingsModel +{ + typedef pqPlotSettingsModel Superclass; + + Q_OBJECT + +public: + pqCustomPlotSettingsModel(QObject* parent = 0); + ~pqCustomPlotSettingsModel(); + + void setRepresentation(pqDataRepresentation* rep); + pqDataRepresentation* representation() const; + + /// \brief Sets the data for the given model index. + /// \param index The model index. + /// \param value The new data for the given role. + /// \param role The role to set data for. + /// \return True if the data was changed successfully. + virtual bool setData(const QModelIndex &index, const QVariant &value, + int role=Qt::EditRole); + + void SetIgnoreUnitsModeOn(bool enabled); + void SetAutoSelectModeOn(bool enabled); + +public slots: + + // Description: + // API to enable series. + void setSeriesEnabled(int row, bool enabled); + +private: + QString getUnit(const QString& seriesName); + +private: + class pqImplementation; + pqImplementation* Implementation; + + bool IgnoreUnitsModeOn; + bool AutoSelectModeOn; +}; + +#endif diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqCustomXYChartDisplayPanel.cxx b/src/Plugins/TableReader/ParaViewPlugin/pqCustomXYChartDisplayPanel.cxx new file mode 100644 index 00000000..56ea75d4 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqCustomXYChartDisplayPanel.cxx @@ -0,0 +1,511 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "pqCustomXYChartDisplayPanel.h" +#include "ui_CustomXYChartDisplayPanel.h" + +#include "vtkEventQtSlotConnect.h" +#include "vtkSMChartRepresentationProxy.h" +#include "vtkSMPropertyHelper.h" +#include "vtkDataArray.h" +#include "vtkDataObject.h" +#include "vtkSMArraySelectionDomain.h" +#include "vtkSMIntVectorProperty.h" +#include "vtkSMProxy.h" +#include "vtkSmartPointer.h" +#include "vtkTable.h" +#include "vtkChart.h" +#include "vtkWeakPointer.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "pqDataInformationModel.h" +#include "pqComboBoxDomain.h" +#include "pqPropertyLinks.h" +#include "pqSignalAdaptorCompositeTreeWidget.h" +#include "pqSignalAdaptors.h" +#include "pqSMAdaptor.h" +#include "pqXYChartView.h" +#include "pqDataRepresentation.h" +#include "pqCustomPlotSettingsModel.h" + +#include + +//----------------------------------------------------------------------------- +class pqCustomXYChartDisplayPanel::pqInternal : public Ui::CustomXYChartDisplayPanel +{ +public: + pqInternal() + { + this->SettingsModel = 0; + this->XAxisArrayDomain = 0; + this->XAxisArrayAdaptor = 0; + + this->VTKConnect = vtkSmartPointer::New(); + } + + ~pqInternal() + { + delete this->SettingsModel; + delete this->XAxisArrayDomain; + delete this->XAxisArrayAdaptor; + } + + vtkWeakPointer ChartRepresentation; + pqCustomPlotSettingsModel* SettingsModel; + pqComboBoxDomain* XAxisArrayDomain; + pqSignalAdaptorComboBox* XAxisArrayAdaptor; + pqPropertyLinks Links; + + vtkSmartPointer VTKConnect; + + bool InChange; +}; + +//----------------------------------------------------------------------------- +pqCustomXYChartDisplayPanel::pqCustomXYChartDisplayPanel( + pqRepresentation* display,QWidget* p) +: pqDisplayPanel(display, p) +{ + this->Internal = new pqCustomXYChartDisplayPanel::pqInternal(); + this->Internal->setupUi(this); + + this->Internal->SettingsModel = new pqCustomPlotSettingsModel(this); + this->Internal->SeriesList->setModel(this->Internal->SettingsModel); + + this->Internal->XAxisArrayAdaptor = new pqSignalAdaptorComboBox( + this->Internal->XAxisArray); + + QObject::connect( + this->Internal->SeriesList, SIGNAL(activated(const QModelIndex &)), + this, SLOT(activateItem(const QModelIndex &))); + QItemSelectionModel *model = this->Internal->SeriesList->selectionModel(); + QObject::connect(model, + SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), + this, SLOT(updateOptionsWidgets())); + QObject::connect(model, + SIGNAL(currentChanged(const QModelIndex &, const QModelIndex &)), + this, SLOT(updateOptionsWidgets())); + QObject::connect(this->Internal->SettingsModel, SIGNAL(modelReset()), + this, SLOT(updateOptionsWidgets())); + QObject::connect(this->Internal->SettingsModel, SIGNAL(redrawChart()), + this, SLOT(updateAllViews())); + QObject::connect(this->Internal->XAxisArray, SIGNAL(currentIndexChanged(int)), + this, SLOT(updateAllViews())); + + QObject::connect(this->Internal->UseArrayIndex, SIGNAL(toggled(bool)), + this, SLOT(useArrayIndexToggled(bool))); + QObject::connect(this->Internal->UseDataArray, SIGNAL(toggled(bool)), + this, SLOT(useDataArrayToggled(bool))); + + QObject::connect( + this->Internal->ColorButton, SIGNAL(chosenColorChanged(const QColor &)), + this, SLOT(setCurrentSeriesColor(const QColor &))); + QObject::connect(this->Internal->Thickness, SIGNAL(valueChanged(int)), + this, SLOT(setCurrentSeriesThickness(int))); + QObject::connect(this->Internal->StyleList, SIGNAL(currentIndexChanged(int)), + this, SLOT(setCurrentSeriesStyle(int))); + QObject::connect(this->Internal->AxisList, SIGNAL(currentIndexChanged(int)), + this, SLOT(setCurrentSeriesAxes(int))); + QObject::connect(this->Internal->MarkerStyleList, SIGNAL(currentIndexChanged(int)), + this, SLOT(setCurrentSeriesMarkerStyle(int))); + + QObject::connect( + this->Internal->AutoSelect, SIGNAL(toggled(bool)), + this, SLOT(autoSelectToggled(bool))); + + QObject::connect( + this->Internal->IgnoreUnits, SIGNAL(toggled(bool)), + this, SLOT(ignoreUnitsToggled(bool))); + + QObject::connect( + this->Internal->GenerateAxesTitles, SIGNAL(toggled(bool)), + this, SLOT(updateViewOptions())); + QObject::connect(this->Internal->SettingsModel, SIGNAL(redrawChart()), + this, SLOT(updateViewOptions())); + + resetUnitsControls(); + + this->setDisplay(display); + + QObject::connect(&this->Internal->Links, SIGNAL(qtWidgetChanged()), + this, SLOT(reloadSeries()), Qt::QueuedConnection); + QObject::connect(&this->Internal->Links, SIGNAL(qtWidgetChanged()), + this->Internal->SettingsModel, SLOT(reload())); +} + +//----------------------------------------------------------------------------- +pqCustomXYChartDisplayPanel::~pqCustomXYChartDisplayPanel() +{ + delete this->Internal; +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::reloadSeries() +{ + updateViewOptions(); + + this->updateAllViews(); + this->updateOptionsWidgets(); +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::setDisplay(pqRepresentation* disp) +{ + this->setEnabled(false); + + vtkSMChartRepresentationProxy* proxy = + vtkSMChartRepresentationProxy::SafeDownCast(disp->getProxy()); + this->Internal->ChartRepresentation = proxy; + if (!this->Internal->ChartRepresentation) + { + qWarning() << "pqCustomXYChartDisplayPanel given a representation proxy " + "that is not an XYChartRepresentation. Cannot edit."; + return; + } + + // this is essential to ensure that when you undo-redo, the representation is + // indeed update-to-date, thus ensuring correct domains etc. + proxy->UpdatePipeline(); + + // The model for the plot settings + this->Internal->SettingsModel->setRepresentation( + qobject_cast(disp)); + + // Connect to the new properties.pqComboBoxDomain will ensure that + // when ever the domain changes the widget is updated as well. + this->Internal->XAxisArrayDomain = new pqComboBoxDomain( + this->Internal->XAxisArray, proxy->GetProperty("XArrayName")); + this->Internal->Links.addPropertyLink(this->Internal->XAxisArrayAdaptor, + "currentText", SIGNAL(currentTextChanged(const QString&)), + proxy, proxy->GetProperty("XArrayName")); + + // Link to set whether the index is used for the x axis + this->Internal->Links.addPropertyLink( + this->Internal->UseArrayIndex, "checked", + SIGNAL(toggled(bool)), + proxy, proxy->GetProperty("UseIndexForXAxis")); + + // Proxy changed + this->Internal->VTKConnect->Connect(proxy->GetProperty("SeriesNamesInfo"), + vtkCommand::PropertyModifiedEvent, this, SLOT(resetUnitsControls())); + + this->changeDialog(disp); + + this->setEnabled(true); + + this->reloadSeries(); +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::changeDialog(pqRepresentation* disp) +{ + vtkSMChartRepresentationProxy* proxy = + vtkSMChartRepresentationProxy::SafeDownCast(disp->getProxy()); + bool visible = true; + if (QString("Bar") == vtkSMPropertyHelper(proxy,"ChartType").GetAsString()) + { + visible = false; + } + + this->Internal->Thickness->setVisible(visible); + this->Internal->ThicknessLabel->setVisible(visible); + this->Internal->StyleList->setVisible(visible); + this->Internal->StyleListLabel->setVisible(visible); + this->Internal->MarkerStyleList->setVisible(visible); + this->Internal->MarkerStyleListLabel->setVisible(visible); + this->Internal->AxisList->setVisible(false); + this->Internal->AxisListLabel->setVisible(false); +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::activateItem(const QModelIndex &index) +{ + if(!this->Internal->ChartRepresentation + || !index.isValid() || index.column() != 1) + { + // We are interested in clicks on the color swab alone. + return; + } + + // Get current color + QColor color = this->Internal->SettingsModel->getSeriesColor(index.row()); + + // Show color selector dialog to get a new color + color = QColorDialog::getColor(color, this); + if (color.isValid()) + { + // Set the new color + this->Internal->SettingsModel->setSeriesColor(index.row(), color); + this->Internal->ColorButton->blockSignals(true); + this->Internal->ColorButton->setChosenColor(color); + this->Internal->ColorButton->blockSignals(false); + this->updateAllViews(); + } +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::updateOptionsWidgets() +{ + QItemSelectionModel *model = this->Internal->SeriesList->selectionModel(); + if(model) + { + // Show the options for the current item. + QModelIndex current = model->currentIndex(); + QModelIndexList indexes = model->selectedIndexes(); + if((!current.isValid() || !model->isSelected(current)) && + indexes.size() > 0) + { + current = indexes.last(); + } + + this->Internal->ColorButton->blockSignals(true); + this->Internal->Thickness->blockSignals(true); + this->Internal->StyleList->blockSignals(true); + this->Internal->MarkerStyleList->blockSignals(true); + this->Internal->AxisList->blockSignals(true); + if (current.isValid()) + { + int seriesIndex = current.row(); + QColor color = this->Internal->SettingsModel->getSeriesColor(seriesIndex); + this->Internal->ColorButton->setChosenColor(color); + this->Internal->Thickness->setValue( + this->Internal->SettingsModel->getSeriesThickness(seriesIndex)); + this->Internal->StyleList->setCurrentIndex( + this->Internal->SettingsModel->getSeriesStyle(seriesIndex)); + this->Internal->MarkerStyleList->setCurrentIndex( + this->Internal->SettingsModel->getSeriesMarkerStyle(seriesIndex)); + this->Internal->AxisList->setCurrentIndex( + this->Internal->SettingsModel->getSeriesAxisCorner(seriesIndex)); + } + else + { + this->Internal->ColorButton->setChosenColor(Qt::white); + this->Internal->Thickness->setValue(1); + this->Internal->StyleList->setCurrentIndex(0); + this->Internal->MarkerStyleList->setCurrentIndex(0); + this->Internal->AxisList->setCurrentIndex(0); + } + + this->Internal->ColorButton->blockSignals(false); + this->Internal->Thickness->blockSignals(false); + this->Internal->StyleList->blockSignals(false); + this->Internal->MarkerStyleList->blockSignals(false); + this->Internal->AxisList->blockSignals(false); + + // Disable the widgets if nothing is selected or current. + bool hasItems = indexes.size() > 0; + this->Internal->ColorButton->setEnabled(hasItems); + this->Internal->Thickness->setEnabled(hasItems); + this->Internal->StyleList->setEnabled(hasItems); + this->Internal->MarkerStyleList->setEnabled(hasItems); + this->Internal->AxisList->setEnabled(hasItems); + } +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::setCurrentSeriesColor(const QColor &color) +{ + QItemSelectionModel *model = this->Internal->SeriesList->selectionModel(); + if(model) + { + this->Internal->InChange = true; + QModelIndexList indexes = model->selectedIndexes(); + QModelIndexList::Iterator iter = indexes.begin(); + for( ; iter != indexes.end(); ++iter) + { + this->Internal->SettingsModel->setSeriesColor(iter->row(), color); + } + this->Internal->InChange = false; + } +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::setCurrentSeriesThickness(int thickness) +{ + QItemSelectionModel *model = this->Internal->SeriesList->selectionModel(); + if (model) + { + this->Internal->InChange = true; + QModelIndexList indexes = model->selectedIndexes(); + QModelIndexList::Iterator iter = indexes.begin(); + for( ; iter != indexes.end(); ++iter) + { + this->Internal->SettingsModel->setSeriesThickness(iter->row(), thickness); + } + this->Internal->InChange = false; + } +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::setCurrentSeriesStyle(int style) +{ + QItemSelectionModel *model = this->Internal->SeriesList->selectionModel(); + if (model) + { + this->Internal->InChange = true; + QModelIndexList indexes = model->selectedIndexes(); + QModelIndexList::Iterator iter = indexes.begin(); + for( ; iter != indexes.end(); ++iter) + { + this->Internal->SettingsModel->setSeriesStyle(iter->row(), style); + } + this->Internal->InChange = false; + } +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::setCurrentSeriesMarkerStyle(int style) +{ + QItemSelectionModel *model = this->Internal->SeriesList->selectionModel(); + if (model) + { + this->Internal->InChange = true; + QModelIndexList indexes = model->selectedIndexes(); + QModelIndexList::Iterator iter = indexes.begin(); + for( ; iter != indexes.end(); ++iter) + { + this->Internal->SettingsModel->setSeriesMarkerStyle(iter->row(), style); + } + this->Internal->InChange = false; + } +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::setCurrentSeriesAxes(int) +{ + +} + +//----------------------------------------------------------------------------- +Qt::CheckState pqCustomXYChartDisplayPanel::getEnabledState() const +{ + Qt::CheckState enabledState = Qt::Unchecked; + + return enabledState; +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::useArrayIndexToggled(bool toggle) +{ + this->Internal->UseDataArray->setChecked(!toggle); +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::useDataArrayToggled(bool toggle) +{ + this->Internal->UseArrayIndex->setChecked(!toggle); + this->updateAllViews(); +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::autoSelectToggled(bool checked) +{ + this->Internal->SettingsModel->SetAutoSelectModeOn(checked); +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::ignoreUnitsToggled(bool checked) +{ + this->Internal->AutoSelect->setEnabled(!checked); + this->Internal->SettingsModel->SetIgnoreUnitsModeOn(checked); + this->Internal->SettingsModel->SetAutoSelectModeOn(!checked && + this->Internal->AutoSelect->isChecked()); +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::resetUnitsControls() +{ + this->Internal->IgnoreUnits->setCheckState(Qt::Checked); + this->Internal->AutoSelect->setCheckState(Qt::Unchecked); +} + +//----------------------------------------------------------------------------- +void pqCustomXYChartDisplayPanel::updateViewOptions() +{ + pqRepresentation* disp = this->getRepresentation(); + if (!disp || !this->Internal->ChartRepresentation) + { + return; + } + + pqXYChartView* view = qobject_cast(disp->getView()); + if (view && view->getProxy()) + { + vtkSMProxy* proxy = view->getProxy(); + + QList values = + pqSMAdaptor::getMultipleElementProperty(proxy->GetProperty("AxisTitle")); + if (values.size() < 2) + { + return; + } + + if (!this->Internal->GenerateAxesTitles->isChecked()) + { + values.insert(0, QVariant("")); + values.insert(1, QVariant("")); + } + else + { + // Set X axis title + int useIndexForXAxis = vtkSMPropertyHelper( + this->Internal->ChartRepresentation, "UseIndexForXAxis").GetAsInt(); + + QString xTitle(""); + if (!useIndexForXAxis) + { + xTitle = vtkSMPropertyHelper(this->Internal->ChartRepresentation, "XArrayName") + .GetAsString(); + } + + // Set Y axis title + int nbRows = this->Internal->SettingsModel->rowCount(QModelIndex()); + int nbEnabled = 0; + int row = 0; + for (int i = 0; i < nbRows && nbEnabled < 2; i++) + { + if (this->Internal->SettingsModel->getSeriesEnabled(i)) + { + nbEnabled++; + row = i; + } + } + + QString yTitle(""); + if (nbEnabled == 1) + { + yTitle = this->Internal->SettingsModel->getSeriesName(row); + } + values.insert(0, QVariant(yTitle)); + values.insert(1, QVariant(xTitle)); + } + + pqSMAdaptor::setMultipleElementProperty(proxy->GetProperty("AxisTitle"), values); + + view->getProxy()->UpdateVTKObjects(); + view->render(); + } +} diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqCustomXYChartDisplayPanel.h b/src/Plugins/TableReader/ParaViewPlugin/pqCustomXYChartDisplayPanel.h new file mode 100644 index 00000000..7f7307f2 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqCustomXYChartDisplayPanel.h @@ -0,0 +1,91 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __pqCustomXYChartDisplayPanel_h +#define __pqCustomXYChartDisplayPanel_h + +#include "pqDisplayPanel.h" + +class pqRepresentation; +class pqDataInformationModel; +class QModelIndex; + +/// Editor widget for XY chart displays. +class pqCustomXYChartDisplayPanel : public pqDisplayPanel +{ + Q_OBJECT +public: + pqCustomXYChartDisplayPanel(pqRepresentation* display, QWidget* parent=0); + virtual ~pqCustomXYChartDisplayPanel(); + +public slots: + /// Reloads the series list from the display. + void reloadSeries(); + +protected slots: + /// Slot to listen to clicks for changing color. + void activateItem(const QModelIndex &index); + + void updateOptionsWidgets(); + + void setCurrentSeriesColor(const QColor &color); + + void setCurrentSeriesThickness(int thickness); + + void setCurrentSeriesStyle(int listIndex); + + void setCurrentSeriesAxes(int listIndex); + + void setCurrentSeriesMarkerStyle(int listIndex); + + void useArrayIndexToggled(bool); + + void useDataArrayToggled(bool); + + /// Unit controls + void autoSelectToggled(bool checked); + void ignoreUnitsToggled(bool checked); + + /// Reset state of the controls relative to units + void resetUnitsControls(); + + /// Update view options + void updateViewOptions(); + +private: + pqCustomXYChartDisplayPanel(const pqCustomXYChartDisplayPanel&); // Not implemented. + void operator=(const pqCustomXYChartDisplayPanel&); // Not implemented. + + /// Set the display whose properties this editor is editing. + /// This call will raise an error if the display is not + /// an XYChartRepresentation proxy. + void setDisplay(pqRepresentation* display); + + /// Disable/enable elements of the dialog based on the chart type. + void changeDialog(pqRepresentation* display); + + Qt::CheckState getEnabledState() const; + + class pqInternal; + pqInternal* Internal; + + pqDataInformationModel* Model; +}; + +#endif diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqTableReaderPanel.cxx b/src/Plugins/TableReader/ParaViewPlugin/pqTableReaderPanel.cxx new file mode 100644 index 00000000..f1a90910 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqTableReaderPanel.cxx @@ -0,0 +1,112 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "pqTableReaderPanel.h" + +#include "vtkSMProxy.h" +#include "vtkSMStringVectorProperty.h" +#include "vtkProcessModule.h" + +#include "pqPropertyLinks.h" + +#include +#include + + +class pqTableReaderPanel::pqUI: public QObject, public Ui::TableReaderPanel +{ +public: + pqUI(pqTableReaderPanel* p) : QObject(p) + { + } + + ~pqUI() + { + } + + pqPropertyLinks Links; +}; + + +pqTableReaderPanel::pqTableReaderPanel(pqProxy* proxy, QWidget* p) : + Superclass(proxy, p) +{ + this->UI = new pqUI(this); + this->UI->setupUi(this); + + this->linkServerManagerProperties(); + this->updateAvailableTables(false); + + this->connect(this->UI->ValueDelimiter, SIGNAL(textChanged(const QString&)), + this, SLOT(onDelimiterChanged(const QString&))); + this->connect(this->UI->TableNames, SIGNAL(currentIndexChanged(int)), + this, SLOT(onCurrentTableChanged(int))); +} + +pqTableReaderPanel::~pqTableReaderPanel() +{ +} + +void pqTableReaderPanel::onCurrentTableChanged(int currentTableIndex) +{ + this->setModified(); +} + +void pqTableReaderPanel::onDelimiterChanged(const QString& value) +{ + this->updateAvailableTables(true); +} + +void pqTableReaderPanel::linkServerManagerProperties() +{ + this->UI->Links.addPropertyLink(this->UI->TableNames, "currentIndex", + SIGNAL(currentIndexChanged(int)), this->proxy(), + this->proxy()->GetProperty("TableNumber")); + + // To hook up the rest widgets + this->Superclass::linkServerManagerProperties(); +} + +void pqTableReaderPanel::updateAvailableTables(const bool keepCurrent) +{ + vtkSMStringVectorProperty* prop = vtkSMStringVectorProperty::SafeDownCast( + this->proxy()->GetProperty("AvailableTables")); + + int currentIndex = this->UI->TableNames->currentIndex(); + QString currentText = this->UI->TableNames->currentText(); + + this->UI->TableNames->clear(); + + for(int id = 0; id < prop->GetNumberOfElements(); id++) + { + QString text(prop->GetElement(id)); + if (text.isEmpty()) + { + text = QString("Table:%1").arg(id); + } + this->UI->TableNames->addItem(text); + } + + if (keepCurrent && + currentIndex < this->UI->TableNames->maxCount() && + currentText == this->UI->TableNames->itemText(currentIndex)) + { + this->UI->TableNames->setCurrentIndex(currentIndex); + } +} diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqTableReaderPanel.h b/src/Plugins/TableReader/ParaViewPlugin/pqTableReaderPanel.h new file mode 100644 index 00000000..de443ebb --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqTableReaderPanel.h @@ -0,0 +1,56 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _pqTableReaderPanel_h +#define _pqTableReaderPanel_h + +#include "ui_TableReaderPanel.h" + +#include "pqNamedObjectPanel.h" + +class QSpinBox; + +class pqTableReaderPanel: public pqNamedObjectPanel +{ +Q_OBJECT + typedef pqNamedObjectPanel Superclass; +public: + // Constructor + pqTableReaderPanel(pqProxy* proxy, QWidget* p = NULL); + + // Destructor + ~pqTableReaderPanel(); + +protected slots: + void onDelimiterChanged(const QString& value); + void onCurrentTableChanged(int currentTableIndex); + +protected: + // Populate widgets with properties from the server manager + virtual void linkServerManagerProperties(); + + // Update the list with available table names + void updateAvailableTables(const bool keepCurrent); + + class pqUI; + pqUI* UI; +}; + +#endif + diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqTableTo3DPanel.cxx b/src/Plugins/TableReader/ParaViewPlugin/pqTableTo3DPanel.cxx new file mode 100644 index 00000000..5d0ec748 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqTableTo3DPanel.cxx @@ -0,0 +1,69 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "pqTableTo3DPanel.h" + +#include +#include +#include + +pqTableTo3DPanel::pqTableTo3DPanel(pqProxy* proxy, QWidget* p) : + Superclass(proxy, p) +{ + QLineEdit* scaleFactor = this->findChild("ScaleFactor"); + QCheckBox* useOptimusScale = this->findChild("UseOptimusScale"); + QComboBox* presentationType = this->findChild("PresentationType"); + QWidget* numberContours = this->findChild("NumberOfContours"); + + if (scaleFactor && useOptimusScale) + { + this->connect(useOptimusScale, SIGNAL(toggled(bool)), + this, SLOT(onScaleModeChanged(bool))); + onScaleModeChanged(useOptimusScale->isChecked()); + } + + if (presentationType && numberContours) + { + this->connect(presentationType, SIGNAL(currentIndexChanged(const QString &)), + this, SLOT(onPrsTypeChanged(const QString &))); + onPrsTypeChanged(presentationType->currentText()); + } +} + +pqTableTo3DPanel::~pqTableTo3DPanel() +{ +} + +void pqTableTo3DPanel::onScaleModeChanged(bool checked) +{ + QLineEdit* scaleFactor = this->findChild("ScaleFactor"); + if (scaleFactor) + { + scaleFactor->setEnabled(!checked); + } +} + +void pqTableTo3DPanel::onPrsTypeChanged(const QString& type) +{ + QWidget* numberContours = this->findChild("NumberOfContours"); + if (numberContours) + { + numberContours->setEnabled(type == "Contour"); + } +} diff --git a/src/Plugins/TableReader/ParaViewPlugin/pqTableTo3DPanel.h b/src/Plugins/TableReader/ParaViewPlugin/pqTableTo3DPanel.h new file mode 100644 index 00000000..523891a7 --- /dev/null +++ b/src/Plugins/TableReader/ParaViewPlugin/pqTableTo3DPanel.h @@ -0,0 +1,42 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef _pqTableTo3DPanel_h +#define _pqTableTo3DPanel_h + +#include "pqAutoGeneratedObjectPanel.h" + +class pqTableTo3DPanel: public pqAutoGeneratedObjectPanel +{ +Q_OBJECT + typedef pqAutoGeneratedObjectPanel Superclass; +public: + // Constructor + pqTableTo3DPanel(pqProxy* proxy, QWidget* p); + + /// Destructor + ~pqTableTo3DPanel(); + +protected slots: + void onScaleModeChanged(bool checked); + void onPrsTypeChanged(const QString& type); + +}; + +#endif diff --git a/src/Plugins/TableReader/Reader/CMakeLists.txt b/src/Plugins/TableReader/Reader/CMakeLists.txt new file mode 100644 index 00000000..89b5c527 --- /dev/null +++ b/src/Plugins/TableReader/Reader/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +SET(READER_SRCS + TableParser.cxx + vtkVisuTableReader.cxx + ) + +ADD_LIBRARY(vtkVisuTableReader ${READER_SRCS}) + +TARGET_LINK_LIBRARIES(vtkVisuTableReader ${VTK_LIBS} ${vtkInfovis} ${QT_LIBS}) + +INSTALL( + TARGETS vtkVisuTableReader + RUNTIME DESTINATION lib/salome + LIBRARY DESTINATION lib/salome + ARCHIVE DESTINATION lib/salome + ) diff --git a/src/Plugins/TableReader/Reader/TableParser.cxx b/src/Plugins/TableReader/Reader/TableParser.cxx new file mode 100644 index 00000000..035d144d --- /dev/null +++ b/src/Plugins/TableReader/Reader/TableParser.cxx @@ -0,0 +1,261 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "TableParser.h" + +#include +#include + +// STL includes +#include +#include +#include + +using namespace std; + +int getLine(std::ifstream& streamIn, QString& str) +{ + char tmp; + std::ostringstream streamOut; + + while (streamIn.get(tmp)) { + streamOut< GetTableNames(const char* fname, const char* separator, + const bool firstStringAsTitles) +{ + Table2D table; + std::vector tableTitles; + + int nb = 0; + table = GetTable(fname, separator, nb, firstStringAsTitles); + while (table.Check()) { + tableTitles.push_back(table.myTitle); + table = GetTable(fname, separator, ++nb, firstStringAsTitles); + } + + return tableTitles; +} + +Table2D GetTable(const char* fname, const char* separator, const int tableNb, + const bool firstStringAsTitles) +{ + std::ifstream streamIn(fname); + + if(!streamIn.good()) + { + throw std::runtime_error("Unable to open input Post-Pro table file."); + } + + QString tmp; + int count = 0; + do { + // Find beginning of table (tables are separated by empty lines) + while (getLine(streamIn, tmp) && tmp.trimmed() == ""); + + Table2D table2D; + + bool isFirst = true; + while (!streamIn.eof() && tmp.trimmed() != "") + { + QString data = tmp.trimmed(); + QString cmt = ""; + QString keyword = ""; + + // Split string to data and comment (comment starts from '#' symbol) + int index = tmp.indexOf("#"); + if (index >= 0) + { + data = tmp.left(index).trimmed(); + cmt = tmp.mid(index+1).trimmed(); + } + + // If comment is not empty, try to get keyword from it (separated by ':' symbol) + if (!cmt.isEmpty()) + { + int index1 = cmt.indexOf(":"); + + if (index1 >= 0) + { + QString tmpstr = cmt.left(index1).trimmed(); + if (tmpstr == QString("TITLE") || + tmpstr == QString("COLUMN_TITLES") || + tmpstr == QString("COLUMN_UNITS") || + tmpstr == QString("COMMENT")) + { + keyword = tmpstr; + cmt = cmt.mid(index1+1).trimmed(); + } + } + } + + // If data is empty, process only comment + if (data.isEmpty()) + { + // If keyword is found, try to process it + // elsewise it is a simple comment, just ignore it + if (!keyword.isEmpty()) + { + if (keyword == QString( "TITLE" )) + { + QString title = cmt; + if (table2D.myTitle != "") { + title = QString(table2D.myTitle.c_str()) + QString(" ") + title; + } + table2D.myTitle = title.toLatin1().constData(); + } + else if (keyword == QString("COLUMN_TITLES")) + { + // Comment may contain column headers + QStringList strList = cmt.split("|", QString::SkipEmptyParts); + + for ( int i = 0; i < strList.count(); i++ ) + { + QString tmpstr = strList[i].trimmed(); + table2D.myColumnTitles.push_back(tmpstr.toLatin1().constData()); + } + } + else if (keyword == QString("COLUMN_UNITS")) + { + // Comment may contain column units + QStringList strList = cmt.split( " ", QString::SkipEmptyParts ); + + for (int i = 0; i < strList.count(); i++) + { + QString tmpstr = strList[i].trimmed(); + table2D.myColumnUnits.push_back(tmpstr.toLatin1().constData()); + } + } + else if (keyword == QString("COMMENT")) + { + // Keyword 'COMMENT' processing can be here, + // currently it is ignored + } + } + else { + // Simple comment processing can be here, + // currently it is ignored + } + } + // If data is not empty, try to process it + else { + Table2D::Row row; + + QString datar1 = data.replace(QRegExp("\t"), " "); + QStringList valList = datar1.split(separator, QString::SkipEmptyParts); + if(table2D.myColumnTitles.size() == 0 && isFirst && firstStringAsTitles) + { + for ( int i = 0; i < valList.count(); i++ ) + { + QString tmpstr = valList[i].trimmed(); + table2D.myColumnTitles.push_back(tmpstr.toLatin1().constData()); + } + } + else + { + if (!cmt.isEmpty()) + { + row.myTitle = cmt.toLatin1().constData(); + } + + for (int i = 0; i < valList.count(); i++) + { + if (valList[i].trimmed() != "") + { + Table2D::Value val = valList[i].trimmed().toLatin1().constData(); + row.myValues.push_back(val); + } + } + + if(row.myValues.size() > 0) + { + table2D.myRows.push_back(row); + } + } + + isFirst = false; + } + getLine(streamIn, tmp); + } + + + if(table2D.Check()) + { + if (count == tableNb) + { + if (QString::fromStdString(table2D.myTitle).isEmpty()) + { + table2D.myTitle = QString("Table:%1").arg(tableNb).toStdString(); + } + return table2D; + } + count++; + } + + } while (!streamIn.eof()); + + streamIn.close(); + + // Return empty table + Table2D emptyTable; + return emptyTable; +} diff --git a/src/Plugins/TableReader/Reader/TableParser.h b/src/Plugins/TableReader/Reader/TableParser.h new file mode 100644 index 00000000..9239a2fc --- /dev/null +++ b/src/Plugins/TableReader/Reader/TableParser.h @@ -0,0 +1,53 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __TableParser_h_ +#define __TableParser_h_ + +#include +#include + +struct Table2D +{ + typedef std::string Value; + typedef std::vector Values; + + struct Row + { + std::string myTitle; + std::string myUnit; + Values myValues; + }; + + std::string myTitle; + std::vector myColumnUnits; + std::vector myColumnTitles; + + typedef std::vector Rows; + Rows myRows; + + bool Check(); +}; + +std::vector GetTableNames(const char* fname, const char* separator, + const bool firstStringAsTitles); +Table2D GetTable(const char* fname, const char* separator, const int tableNb, + const bool firstStringAsTitles); + +#endif //__TableParser_h_ diff --git a/src/Plugins/TableReader/Reader/vtkVisuTableReader.cxx b/src/Plugins/TableReader/Reader/vtkVisuTableReader.cxx new file mode 100644 index 00000000..cd20f03f --- /dev/null +++ b/src/Plugins/TableReader/Reader/vtkVisuTableReader.cxx @@ -0,0 +1,204 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkVisuTableReader.h" +#include "TableParser.h" + +#include "vtkObjectFactory.h" +#include "vtkTable.h" +#include "vtkInformationVector.h" +#include "vtkInformation.h" +#include "vtkStreamingDemandDrivenPipeline.h" +#include "vtkVariantArray.h" +#include "vtkStringArray.h" +#include "vtkStringToNumeric.h" + +#include +#include + +#include // STL include +#include // STL include +using namespace std; + +vtkCxxRevisionMacro(vtkVisuTableReader, "$Revision$"); +vtkStandardNewMacro(vtkVisuTableReader); + +vtkVisuTableReader::vtkVisuTableReader(): + FileName(0) +{ + this->SetNumberOfInputPorts(0); + this->SetNumberOfOutputPorts(1); + + this->FileName = NULL; + + this->DetectNumericColumns = true; + this->FirstStringAsTitles = false; + + this->TableNumber = 0; + + this->ValueDelimiter = 0; + this->SetValueDelimiter(" "); + + this->AvailableTables = vtkStringArray::New(); +} + +vtkVisuTableReader::~vtkVisuTableReader() +{ + this->SetFileName(0); + this->SetValueDelimiter(0); + this->AvailableTables->Delete(); +} + +int vtkVisuTableReader::CanReadFile(const char* fname) +{ + return 1; +} + +void vtkVisuTableReader::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + os << indent << "FileName: " + << (this->FileName ? this->FileName : "(none)") << endl; + os << indent << "DetectNumericColumns: " + << (this->DetectNumericColumns? "true" : "false") << endl; + os << indent << "ValueDelimiter: " + << (this->ValueDelimiter ? this->ValueDelimiter : "(none)") << endl; + os << indent << "TableNumber: " << this->TableNumber<< endl; +} + +int vtkVisuTableReader::RequestData(vtkInformation*, + vtkInformationVector**, + vtkInformationVector* outputVector) +{ + vtkTable* const output_table = vtkTable::GetData(outputVector); + + try + { + vtkInformation* const outInfo = outputVector->GetInformationObject(0); + if(outInfo->Has(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()) && + outInfo->Get(vtkStreamingDemandDrivenPipeline::UPDATE_PIECE_NUMBER()) > 0) + { + return 1; + } + + // If the filename is not defined + if(!this->FileName || this->TableNumber < 0) + { + return 1; + } + + // Read table with the given number from the file + Table2D table = GetTable(this->FileName, this->ValueDelimiter, + this->TableNumber, this->FirstStringAsTitles); + + // Set table name + output_table->GetInformation()->Set(vtkDataObject::FIELD_NAME(), + table.myTitle.c_str()); + + int nbRows = table.myRows.size(); + int nbCols = table.myRows[0].myValues.size(); + + for (int col=0; col < nbCols; col++) + { + vtkStringArray* newCol = vtkStringArray::New(); + newCol->SetNumberOfValues(nbRows); + + // Set value + for (int row=0; row < nbRows; row++) + { + newCol->SetValue(row, table.myRows[row].myValues[col].c_str()); + } + + // Set title + bool hasUnit = !table.myColumnUnits[col].empty(); + + if (table.myColumnTitles[col].empty()) + { + vtkstd::stringstream buffer; + if (hasUnit) + { + buffer << col <<" [" << table.myColumnUnits[col].c_str() << "]"; + } + else + { + buffer << col; + } + newCol->SetName(buffer.str().c_str()); + } + else + { + if (hasUnit) + { + vtkstd::stringstream buffer; + buffer << table.myColumnTitles[col].c_str() + <<" [" << table.myColumnUnits[col].c_str() << "]"; + newCol->SetName(buffer.str().c_str()); + } + else + { + newCol->SetName(table.myColumnTitles[col].c_str()); + } + } + + output_table->AddColumn(newCol); + newCol->Delete(); + } + + // Detect numeric columns if needed + if (this->DetectNumericColumns) + { + vtkStringToNumeric* convertor = vtkStringToNumeric::New(); + vtkTable* clone = output_table->NewInstance(); + clone->ShallowCopy(output_table); + convertor->SetInput(clone); + convertor->Update(); + clone->Delete(); + output_table->ShallowCopy(convertor->GetOutputDataObject(0)); + convertor->Delete(); + } + } + catch(vtkstd::exception& e) + { + vtkErrorMacro(<< "caught exception: " << e.what() << endl); + output_table->Initialize(); + } + catch(...) + { + vtkErrorMacro(<< "caught unknown exception." << endl); + output_table->Initialize(); + } + + return 1; +} + +vtkStringArray* vtkVisuTableReader::GetAvailableTables() +{ + this->AvailableTables->Initialize(); + + vector titles = + GetTableNames(this->FileName, this->ValueDelimiter, + this->FirstStringAsTitles); + + for(int i = 0; i < titles.size(); i++) + { + this->AvailableTables->InsertNextValue(titles[i].c_str()); + } + + return this->AvailableTables; +} diff --git a/src/Plugins/TableReader/Reader/vtkVisuTableReader.h b/src/Plugins/TableReader/Reader/vtkVisuTableReader.h new file mode 100644 index 00000000..8a7ff2bd --- /dev/null +++ b/src/Plugins/TableReader/Reader/vtkVisuTableReader.h @@ -0,0 +1,103 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkVisuTableReader_h_ +#define __vtkVisuTableReader_h_ + +#include "vtkTableAlgorithm.h" + +class vtkStringArray; + +class VTK_EXPORT vtkVisuTableReader: public vtkTableAlgorithm +{ +public: + static vtkVisuTableReader* New(); + vtkTypeRevisionMacro(vtkVisuTableReader, vtkTableAlgorithm) + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Specifies the name of the file + vtkGetStringMacro(FileName); + vtkSetStringMacro(FileName); + + // Description: + // When set to true, the reader will detect numeric columns and create + // vtkDoubleArray or vtkIntArray for those instead of vtkStringArray. + vtkSetMacro(DetectNumericColumns, bool); + vtkGetMacro(DetectNumericColumns, bool); + vtkBooleanMacro(DetectNumericColumns, bool); + + // Description: + // When set to true, the reader will interpret the first string as + // column titles. + vtkSetMacro(FirstStringAsTitles, bool); + vtkGetMacro(FirstStringAsTitles, bool); + vtkBooleanMacro(FirstStringAsTitles, bool); + + // Description: + // Specifies the number of the table + vtkSetMacro(TableNumber, int); + vtkGetMacro(TableNumber, int); + + // Description: + // Specifies string that will be used to separate values + vtkSetStringMacro(ValueDelimiter); + vtkGetStringMacro(ValueDelimiter); + + // Description: + // Determine whether the given file can be read + virtual int CanReadFile(const char* fname); + + // Description: + // Returns the available table names. + virtual vtkStringArray* GetAvailableTables(); + +protected: + vtkVisuTableReader(); + ~vtkVisuTableReader(); + + // Description: + // This is called by the superclass. + virtual int RequestData(vtkInformation*, vtkInformationVector**, + vtkInformationVector*); + + // name of the file to read from + char* FileName; + + // defines whether to detect numeric columns + bool DetectNumericColumns; + + // defines whether to treat first string as column titles + bool FirstStringAsTitles; + + // number of the table to read + int TableNumber; + + // string that will be used to separate values + char* ValueDelimiter; + + // Available table names + vtkStringArray* AvailableTables; + +private: + vtkVisuTableReader(const vtkVisuTableReader&); // Not implemented. + void operator=(const vtkVisuTableReader&); // Not implemented. +}; + +#endif //__vtkVisuTableReader_h_ diff --git a/src/Plugins/TableReader/TableTo3DFilter/CMakeLists.txt b/src/Plugins/TableReader/TableTo3DFilter/CMakeLists.txt new file mode 100644 index 00000000..899677e0 --- /dev/null +++ b/src/Plugins/TableReader/TableTo3DFilter/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +SET(TABLETO3D_SRCS + vtkTableTo3D.cxx + ) + +ADD_LIBRARY(vtkTableTo3D ${TABLETO3D_SRCS}) + +TARGET_LINK_LIBRARIES(vtkTableTo3D ${VTK_LIBS}) + +INSTALL( + TARGETS vtkTableTo3D + RUNTIME DESTINATION lib/salome + LIBRARY DESTINATION lib/salome + ARCHIVE DESTINATION lib/salome + ) diff --git a/src/Plugins/TableReader/TableTo3DFilter/vtkTableTo3D.cxx b/src/Plugins/TableReader/TableTo3DFilter/vtkTableTo3D.cxx new file mode 100644 index 00000000..574b289c --- /dev/null +++ b/src/Plugins/TableReader/TableTo3DFilter/vtkTableTo3D.cxx @@ -0,0 +1,214 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#include "vtkTableTo3D.h" + +#include "vtkSmartPointer.h" +#include "vtkDoubleArray.h" +#include "vtkVariantArray.h" +#include "vtkObjectFactory.h" +#include "vtkPointData.h" +#include "vtkPoints.h" +#include "vtkPolyData.h" +#include "vtkTable.h" +#include "vtkInformation.h" +#include "vtkStructuredGrid.h" +#include "vtkStructuredGridGeometryFilter.h" +#include "vtkWarpScalar.h" +#include "vtkContourFilter.h" + +vtkStandardNewMacro(vtkTableTo3D); +vtkCxxRevisionMacro(vtkTableTo3D, "$Revision$"); + + +vtkTableTo3D::vtkTableTo3D() +{ + this->ScaleFactor = 1.0; + this->UseOptimusScale = true; + this->PresentationType = TABLETO3D_SURFACE; + this->NumberOfContours = 32; +} + +vtkTableTo3D::~vtkTableTo3D() +{ +} + +int vtkTableTo3D::FillInputPortInformation( + int vtkNotUsed(port), vtkInformation* info) +{ + info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkTable"); + return 1; +} + +int vtkTableTo3D::RequestData(vtkInformation* vtkNotUsed(request), + vtkInformationVector** inputVector, vtkInformationVector* outputVector) +{ + vtkTable* input = vtkTable::GetData(inputVector[0], 0); + vtkPolyData* output = vtkPolyData::GetData(outputVector, 0); + + if (input->GetNumberOfRows() == 0 ||input->GetNumberOfColumns() < 2) + { + return 1; + } + + vtkIdType xSize = input->GetNumberOfRows(); + vtkIdType ySize = input->GetNumberOfColumns() - 1; + vtkIdType nbPoints = xSize * ySize; + + vtkDataArray* xAxis = vtkDataArray::SafeDownCast(input->GetColumn(0)); + if (!xAxis) + { + vtkErrorMacro("The first column is not numeric."); + return 1; + } + + double xRange = xAxis->GetTuple1(xSize - 1) - xAxis->GetTuple1(0); + double yDelta = xRange / ySize; + + vtkSmartPointer yAxis = + vtkSmartPointer::New(); + yAxis->SetNumberOfValues(ySize); + for (vtkIdType i = 0; i < ySize; i++ ) + { + yAxis->SetValue(i, i*yDelta); + } + + vtkSmartPointer points = + vtkSmartPointer::New(); + points->SetNumberOfPoints(nbPoints); + + vtkSmartPointer pointsIdMapper = + vtkSmartPointer::New(); + pointsIdMapper->SetName("POINTS_ID_MAPPER"); + pointsIdMapper->SetNumberOfComponents(2); + pointsIdMapper->SetNumberOfTuples(nbPoints); + int *pointsIdMapperPtr = pointsIdMapper->GetPointer(0); + + for (vtkIdType i = 0, pntId = 0; i < ySize; i++) + { + for (vtkIdType j = 0; j < xSize; j++, pntId++) + { + points->SetPoint(pntId, xAxis->GetTuple1(j), + yAxis->GetValue(i), + 0.0); + + *pointsIdMapperPtr++ = pntId; + *pointsIdMapperPtr++ = 0; + } + } + + vtkSmartPointer scalars = + vtkSmartPointer::New(); + scalars->SetNumberOfComponents(1); + scalars->SetNumberOfTuples(nbPoints); + double *scalarsPtr = scalars->GetPointer(0); + for (vtkIdType i = 0; i < ySize; i++) + { + vtkDataArray* col = + vtkDataArray::SafeDownCast(input->GetColumn(i + 1)); + + if (!col) + { + vtkErrorMacro("Column "<< i <<"is not numeric."); + return 1; + } + + for ( vtkIdType j = 0; j < xSize; j++ ) + { + double value = col->GetTuple1(j); + *scalarsPtr++ = value; + } + } + + vtkSmartPointer structuredGrid = + vtkSmartPointer::New(); + structuredGrid->SetPoints(points); + + structuredGrid->SetDimensions(xSize, ySize, 1); + + // structuredGrid->GetPointData()->AddArray(pointsIdMapper); + if (input->GetInformation()->Has(vtkDataObject::FIELD_NAME())) + { + scalars->SetName(input->GetInformation()->Get(vtkDataObject::FIELD_NAME())); + } + else + { + scalars->SetName("Table"); + } + structuredGrid->GetPointData()->SetScalars(scalars); + + vtkSmartPointer geomFilter = + vtkSmartPointer::New(); + geomFilter->SetInput(structuredGrid); + geomFilter->Update(); + + vtkSmartPointer warpScalar = + vtkSmartPointer::New(); + + double scaleFactor = this->ScaleFactor; + if (this->UseOptimusScale) + { + double range[2]; + geomFilter->GetOutput()->GetScalarRange(range); + double length = geomFilter->GetOutput()->GetLength(); + if (range[1] > 0) + { + scaleFactor = length / range[1] * 0.3; + } + else + { + scaleFactor = 0; + } + } + + if (this->PresentationType == TABLETO3D_SURFACE) + { + warpScalar->SetInput(geomFilter->GetOutput()); + warpScalar->SetScaleFactor(scaleFactor); + } + else + { + vtkSmartPointer contourFilter = + vtkSmartPointer::New(); + contourFilter->SetInput(geomFilter->GetOutput()); + contourFilter->GenerateValues(this->NumberOfContours, + geomFilter->GetOutput()->GetScalarRange()); + warpScalar->SetInput(contourFilter->GetOutput()); + warpScalar->SetScaleFactor(scaleFactor); + } + + warpScalar->Update(); + output->ShallowCopy(warpScalar->GetPolyDataOutput()); + + return 1; +} + +//---------------------------------------------------------------------------- +void vtkTableTo3D::PrintSelf(ostream& os, vtkIndent indent) +{ + this->Superclass::PrintSelf(os, indent); + + os << indent << "ScaleFactor: " << this->ScaleFactor << endl; + os << indent << "UseOptimusScale: " + << (this->UseOptimusScale? "true" : "false") << endl; + os << indent << "PresentationType: " + << ((this->PresentationType == TABLETO3D_SURFACE)? "Surface" : "Contour") + << endl; + os << indent << "NumberOfContours: " << this->NumberOfContours << endl; +} diff --git a/src/Plugins/TableReader/TableTo3DFilter/vtkTableTo3D.h b/src/Plugins/TableReader/TableTo3DFilter/vtkTableTo3D.h new file mode 100644 index 00000000..c1d74283 --- /dev/null +++ b/src/Plugins/TableReader/TableTo3DFilter/vtkTableTo3D.h @@ -0,0 +1,81 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// + +#ifndef __vtkTableTo3D_h +#define __vtkTableTo3D_h + +#include "vtkPolyDataAlgorithm.h" + +#define TABLETO3D_SURFACE 0 +#define TABLETO3D_CONTOUR 1 + +class VTK_EXPORT vtkTableTo3D : public vtkPolyDataAlgorithm +{ +public: + static vtkTableTo3D* New(); + vtkTypeRevisionMacro(vtkTableTo3D, vtkPolyDataAlgorithm); + void PrintSelf(ostream& os, vtkIndent indent); + + // Description: + // Specify value to scale diplacement. + vtkSetMacro(ScaleFactor, double); + vtkGetMacro(ScaleFactor, double); + + // Description: + // When set to true, the filter will compute optimus scale factor, + // the value of ScaleFactor variable will be ignored. + vtkSetMacro(UseOptimusScale, bool); + vtkGetMacro(UseOptimusScale, bool); + vtkBooleanMacro(UseOptimusScale, bool); + + // Description: + // Specify type of presentation: surface of contour. + vtkSetClampMacro(PresentationType, int, + TABLETO3D_SURFACE, TABLETO3D_CONTOUR); + vtkGetMacro(PresentationType, int); + + // Description: + // Specify number of contours for contour presentation type. + vtkSetMacro(NumberOfContours, int); + vtkGetMacro(NumberOfContours, int); + +protected: + vtkTableTo3D(); + ~vtkTableTo3D(); + + // Description: + // Overridden to specify that input must be a vtkTable. + virtual int FillInputPortInformation(int port, vtkInformation* info); + + // Description: + // Convert input vtkTable to vtkPolyData. + virtual int RequestData(vtkInformation* request, + vtkInformationVector** inputVector, vtkInformationVector* outputVector); + + double ScaleFactor; + bool UseOptimusScale; + int PresentationType; + int NumberOfContours; + +private: + vtkTableTo3D(const vtkTableTo3D&); // Not implemented. + void operator=(const vtkTableTo3D&); // Not implemented. +}; + +#endif diff --git a/src/Plugins/ToolBar/CMakeLists.txt b/src/Plugins/ToolBar/CMakeLists.txt index 795ec067..b377c532 100755 --- a/src/Plugins/ToolBar/CMakeLists.txt +++ b/src/Plugins/ToolBar/CMakeLists.txt @@ -1,3 +1,21 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# # create a plugin that implements a sample toolbar action diff --git a/src/Plugins/ToolBar/MyToolBarActions.cxx b/src/Plugins/ToolBar/MyToolBarActions.cxx index c5077d8c..91630dec 100755 --- a/src/Plugins/ToolBar/MyToolBarActions.cxx +++ b/src/Plugins/ToolBar/MyToolBarActions.cxx @@ -1,4 +1,21 @@ - +// Copyright (C) 2010-2012 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. +// +// 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 +// #include "MyToolBarActions.h" diff --git a/src/Plugins/ToolBar/MyToolBarActions.h b/src/Plugins/ToolBar/MyToolBarActions.h index 97ad0aa4..a12dcddc 100755 --- a/src/Plugins/ToolBar/MyToolBarActions.h +++ b/src/Plugins/ToolBar/MyToolBarActions.h @@ -1,3 +1,21 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// #include diff --git a/src/Plugins/View/CMakeLists.txt b/src/Plugins/View/CMakeLists.txt index 1b43a3af..6036de91 100755 --- a/src/Plugins/View/CMakeLists.txt +++ b/src/Plugins/View/CMakeLists.txt @@ -1,3 +1,21 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# # create a plugin with a custom view that shows up in ParaView's multi-view # manager. this plugin also contains a custom display panel @@ -30,16 +48,21 @@ ADD_PARAVIEW_VIEW_OPTIONS(OPTIONS_IFACE OPTIONS_IFACE_SRCS VIEW_TYPE MyView ACTIVE_VIEW_OPTIONS MyViewActiveOptions) # create a GUI side plugin with the GUI side code -ADD_PARAVIEW_PLUGIN(GUISampleView "1.0" GUI_INTERFACES ${IFACES} ${OPTIONS_IFACE} - GUI_SOURCES MyView.cxx MyDisplay.cxx MyViewActiveOptions.cxx MyViewOptions.cxx - ${MOC_SRCS} ${IFACE_SRCS} ${OPTIONS_IFACE_SRCS}) +#ADD_PARAVIEW_PLUGIN(GUISampleView "1.0" GUI_INTERFACES ${IFACES} ${OPTIONS_IFACE} +# GUI_SOURCES MyView.cxx MyDisplay.cxx MyViewActiveOptions.cxx MyViewOptions.cxx +# ${MOC_SRCS} ${IFACE_SRCS} ${OPTIONS_IFACE_SRCS}) # create a server side plugin with the server side code -ADD_PARAVIEW_PLUGIN(SMSampleView "1.0" SERVER_MANAGER_XML MyViewSM.xml) +#ADD_PARAVIEW_PLUGIN(SMSampleView "1.0" SERVER_MANAGER_XML MyViewSM.xml) + ADD_PARAVIEW_PLUGIN(GUISampleView "1.0" + SERVER_MANAGER_XML MyViewSM.xml + GUI_INTERFACES ${IFACES} ${OPTIONS_IFACE} + GUI_SOURCES MyView.cxx MyDisplay.cxx MyViewActiveOptions.cxx MyViewOptions.cxx + ${MOC_SRCS} ${IFACE_SRCS} ${OPTIONS_IFACE_SRCS} ) # one could combine the two plugins into one if desired INSTALL( - TARGETS GUISampleView SMSampleView + TARGETS GUISampleView DESTINATION lib/paraview ) diff --git a/src/Plugins/View/MyDisplay.cxx b/src/Plugins/View/MyDisplay.cxx index cded766a..51d350d6 100755 --- a/src/Plugins/View/MyDisplay.cxx +++ b/src/Plugins/View/MyDisplay.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// #include "MyDisplay.h" diff --git a/src/Plugins/View/MyDisplay.h b/src/Plugins/View/MyDisplay.h index 309c674a..6faaf25d 100755 --- a/src/Plugins/View/MyDisplay.h +++ b/src/Plugins/View/MyDisplay.h @@ -1,3 +1,21 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// #ifndef MyDisplay_h #define MyDisplay_h diff --git a/src/Plugins/View/MyView.cxx b/src/Plugins/View/MyView.cxx index 5f284ad8..bb083fa1 100755 --- a/src/Plugins/View/MyView.cxx +++ b/src/Plugins/View/MyView.cxx @@ -1,3 +1,21 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// #include "MyView.h" diff --git a/src/Plugins/View/MyView.h b/src/Plugins/View/MyView.h index c9a8865c..a726287c 100755 --- a/src/Plugins/View/MyView.h +++ b/src/Plugins/View/MyView.h @@ -1,3 +1,21 @@ +// Copyright (C) 2010-2012 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. +// +// 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 +// #ifndef _MyView_h #define _MyView_h diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 00000000..c4f47186 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,21 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +SUBDIRS(VisuPrs) + diff --git a/test/VisuPrs/2D_viewer/A0.py b/test/VisuPrs/2D_viewer/A0.py new file mode 100755 index 00000000..3d8b6173 --- /dev/null +++ b/test/VisuPrs/2D_viewer/A0.py @@ -0,0 +1,75 @@ +# Copyright (C) 2010-2012 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. +# +# 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/2D_viewer/A0 case + +import paravistest + +from pvsimple import CreateXYPlotView, Delete + +# Create view +aXYPlot = CreateXYPlotView() +# Delete view +Delete(aXYPlot) +# Create view again +aXYPlot = CreateXYPlotView() + +# Set title +print "Default chart title ...", aXYPlot.ChartTitle +aXYPlot.ChartTitle = ' ' +aXYPlot.ChartTitle = 'title of XY plot' +print "Chart title for xyplot ...", aXYPlot.ChartTitle + +# Show left and bottom axis +aXYPlot.ShowAxis = [1, 1, 0, 0] + +# Show grids +aXYPlot.ShowAxisGrid = [1, 1, 0, 0] + +# Set axis range for left and bottom axis +aXYPlot.AxisBehavior = [1, 1, 0, 0] + +aMinX = 0 +aMaxX = 100 +aMinY = 0 +aMaxY = 10 +aXYPlot.AxisRange = [aMinX, aMaxX, aMinY, aMaxY, 0.0, 1.0, 0.0, 1.0] + +# Set horizontal scaling for left and bottom axis +print "Default logarithmic scaling ...", aXYPlot.AxisLogScale +# Set logarithmic scaling +aXYPlot.AxisLogScale = [1, 1, 0, 0] +print "Logarithmic scaling ...", aXYPlot.AxisLogScale +# Set linear scaling +aXYPlot.AxisLogScale = [0, 0, 0, 0] +print "Linear scaling ...", aXYPlot.AxisLogScale + +# Axis titles +print "Default title of the left axis ...", aXYPlot.AxisTitle[0] +aXYPlot.AxisTitle[0] = ' ' +aXYPlot.AxisTitle[0] ="Xtitle of XY plot" +print "Title of the left axis ...", aXYPlot.AxisTitle[0] +print "Default title of the bottom axis ...", aXYPlot.AxisTitle[1] +aXYPlot.AxisTitle[1] = ' ' +aXYPlot.AxisTitle[1] = "Ytitle of XY plot" +print "Title of the bottom axis ...", aXYPlot.AxisTitle[1] + +# Show/hide legend +aXYPlot.ShowLegend = 1 +aXYPlot.ShowLegend = 0 diff --git a/test/VisuPrs/2D_viewer/A1.py b/test/VisuPrs/2D_viewer/A1.py new file mode 100755 index 00000000..17fc4c80 --- /dev/null +++ b/test/VisuPrs/2D_viewer/A1.py @@ -0,0 +1,55 @@ +# Copyright (C) 2010-2012 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. +# +# 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/2D_viewer/A1 case + +from paravistest import test_values +from pvsimple import CreateXYPlotView + +# Create view +aXYPlot = CreateXYPlotView() + +# Set range +axisRange = aXYPlot.AxisRange +# Left axis range +axisRange[0:2] = [200., 800.] +Ranges = aXYPlot.AxisRange +Etvalue = [200, 800, axisRange[2], axisRange[3], + axisRange[4], axisRange[5], axisRange[6], axisRange[7] ] +error = test_values(Ranges, Etvalue) +# Bottom axis range +aXYPlot.AxisRange[2:4] = [350.,750.] +Ranges = aXYPlot.AxisRange +Etvalue = [200, 800, 350, 750, + axisRange[4], axisRange[5], axisRange[6], axisRange[7]] +error = error + test_values(Ranges, Etvalue) +# Left and bottom axis range +aXYPlot.AxisRange[0:4] = [1350.,2750.,240.,2230.] +Ranges=aXYPlot.AxisRange +Etvalue=[1350.,2750.,240.,2230., + axisRange[4], axisRange[5], axisRange[6], axisRange[7]] +error = error + test_values(Ranges, Etvalue) +# Left, bottom, right and top axis range +aXYPlot.AxisRange = [0, 200, 100, 450, 0, 200, 100, 450] +Ranges = aXYPlot.AxisRange +Etvalue = [0, 200, 100, 450, 0, 200, 100, 450] +error = error + test_values(Ranges, Etvalue) + +if error > 0: + raise RuntimeError, "There is(are) some error(s) was(were) found... For more info see ERRORs above..." diff --git a/test/VisuPrs/2D_viewer/CMakeLists.txt b/test/VisuPrs/2D_viewer/CMakeLists.txt new file mode 100644 index 00000000..2bc72967 --- /dev/null +++ b/test/VisuPrs/2D_viewer/CMakeLists.txt @@ -0,0 +1,27 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + ) + ADD_TEST(2DVIEWER_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/3D_viewer/A1.py b/test/VisuPrs/3D_viewer/A1.py new file mode 100644 index 00000000..f645d874 --- /dev/null +++ b/test/VisuPrs/3D_viewer/A1.py @@ -0,0 +1,108 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A1 case +# Create 3D Viewer and test set view properties for Plot 3D presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A1") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +#import file +my_paravis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +file_name = datadir + "fra.med" +print " --------------------------------- " +print "file ", file_name +print " --------------------------------- " + +my_paravis.ImportFile(file_name) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME,\ +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 + +field_name = 'VITESSE' + +# Get view +my_view = GetRenderView() + +print "\nCreating plot3d.......", +plot3d = Plot3DOnField(proxy, EntityType.CELL, field_name, 1) +if plot3d is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(plot3d, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + if reprCode == RepresentationType.VOLUME: + is_good = call_and_check(plot3d, "Representation", repr, 0) + if is_good: + msg = "VOLUME representation must be not available for Plot 3D" + raise RuntimeError(msg) + else: + call_and_check(plot3d, "Representation", repr, 1) + + for sha in shadings: + setShaded(my_view, sha) + call_and_check(plot3d, "Shading", sha, 1) + Render(my_view) + + for opa in opacities: + call_and_check(plot3d, "Opacity", opa, 1, compare_prec) + + for lwi in linewidths: + call_and_check(plot3d, "LineWidth", lwi, 1, compare_prec) + time.sleep(1) + + # save picture in file + # Construct image file name + pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_any_" + \ + str(sha) + "_" + str(opa) + "_" + str(lwi) + "." + pictureext + # Show and record the presentation + process_prs_for_test(plot3d, my_view, pic_name) diff --git a/test/VisuPrs/3D_viewer/A2.py b/test/VisuPrs/3D_viewer/A2.py new file mode 100644 index 00000000..bc3c7f23 --- /dev/null +++ b/test/VisuPrs/3D_viewer/A2.py @@ -0,0 +1,106 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A2 case +# Create 3D Viewer and test set view properties for Vectors presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A2") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +#import file +my_paravis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +file_name = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file_name +print " --------------------------------- " + +my_paravis.ImportFile(file_name) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME,\ +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 + +field_name = 'vectoriel_field' + +print "\nCreating Vectors.......", +vectors = VectorsOnField(proxy, EntityType.CELL, field_name, 1, + is_colored=True, glyph_type="Cone") +if vectors is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(vectors, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + if reprCode == RepresentationType.VOLUME: + is_good = call_and_check(vectors, "Representation", repr, 0) + if is_good: + msg = "VOLUME representation must be not available for Vectors" + raise RuntimeError(msg) + else: + call_and_check(vectors, "Representation", repr, 1) + + for sha in shadings: + call_and_check(vectors, "Shading", sha, 1) + setShaded(my_view, sha) + Render(my_view) + time.sleep(1) + + # save picture in file + # Construct image file name + pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_any_" + \ + str(sha) + "." + pictureext + # Show and record the presentation + process_prs_for_test(vectors, my_view, pic_name) + +for opa in opacities: + call_and_check(vectors, "Opacity", opa, 1, compare_prec) + +for lwi in linewidths: + call_and_check(vectors, "LineWidth", lwi, 1, compare_prec) diff --git a/test/VisuPrs/3D_viewer/A3.py b/test/VisuPrs/3D_viewer/A3.py new file mode 100644 index 00000000..f6b9eb76 --- /dev/null +++ b/test/VisuPrs/3D_viewer/A3.py @@ -0,0 +1,114 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A3 case +# Create 3D Viewer and test set view properties for Stream Lines presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A3") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +#import file +my_paravis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +file_name = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file_name +print " --------------------------------- " + +my_paravis.ImportFile(file_name) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME,\ +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 + +field_name = 'vectoriel_field' + +print "\nCreating stream_lines......." +stream_lines = StreamLinesOnField(proxy, EntityType.CELL, +field_name, 1, is_colored=True) +stream_tracer = stream_lines.Input +print "stream_tracer:", stream_tracer +stream_tracer.Input = None +stream_tracer.InitialStepLength = 0.00940275 +stream_tracer.MaximumStreamlineLength = 140.373 +stream_tracer.MaximumStepLength = 0.5319 +stream_tracer.MinimumStepLength = 0.5319 +stream_tracer.UpdatePipeline() + +if stream_lines is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(stream_lines, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + if reprCode == RepresentationType.VOLUME: + is_good = call_and_check(stream_lines, "Representation", repr, 0) + if is_good: + msg = "VOLUME representation must be not available for streamlines" + raise RuntimeError(msg) + else: + call_and_check(stream_lines, "Representation", repr, 1) + + for sha in shadings: + setShaded(my_view, sha) + call_and_check(stream_lines, "Shading", sha, 1) + Render(my_view) + time.sleep(1) + + for lwi in linewidths: + call_and_check(stream_lines, "LineWidth", lwi, 1, compare_prec) + # save picture in file + # Construct image file name + pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_any_" + \ + str(sha) + "_" + str(lwi) + "." + pictureext + # Show and record the presentation + process_prs_for_test(stream_lines, my_view, pic_name) + +for opa in opacities: + call_and_check(stream_lines, "Opacity", opa, 1, compare_prec) diff --git a/test/VisuPrs/3D_viewer/A4.py b/test/VisuPrs/3D_viewer/A4.py new file mode 100644 index 00000000..c21350a2 --- /dev/null +++ b/test/VisuPrs/3D_viewer/A4.py @@ -0,0 +1,105 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A4 case +# Create 3D Viewer and test set view properties for Iso Surface presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A4") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep +#import file +my_paravis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +file_name = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file_name +print " --------------------------------- " + +my_paravis.ImportFile(file_name) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME,\ +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 + +field_name = 'Head' + +print "\nCreating iso surface.......", +iso_surf = IsoSurfacesOnField(proxy, EntityType.CELL, field_name, 1) +if iso_surf is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(iso_surf, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + if reprCode == RepresentationType.VOLUME: + is_good = call_and_check(iso_surf, "Representation", repr, 0) + if is_good: + msg = "VOLUME representation must be not available for Iso Surface" + raise RuntimeError(msg) + else: + call_and_check(iso_surf, "Representation", repr, 1) + + for sha in shadings: + setShaded(my_view, sha) + call_and_check(iso_surf, "Shading", sha, 1) + Render(my_view) + + for opa in opacities: + call_and_check(iso_surf, "Opacity", opa, 1, compare_prec) + + for lwi in linewidths: + call_and_check(iso_surf, "LineWidth", lwi, 1, compare_prec) + time.sleep(1) + + # save picture in file + # Construct image file name + pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_any_" + \ + str(sha) + "_" + str(opa) + "_" + str(lwi) + "." + pictureext + + # Show and record the presentation + process_prs_for_test(iso_surf, my_view, pic_name) diff --git a/test/VisuPrs/3D_viewer/A5.py b/test/VisuPrs/3D_viewer/A5.py new file mode 100644 index 00000000..030d2d4e --- /dev/null +++ b/test/VisuPrs/3D_viewer/A5.py @@ -0,0 +1,129 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A5 case +# Create 3D Viewer and test set view properties for Deformed Shape presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A5") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +#import file +myParavis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +file_name = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file_name +print " --------------------------------- " + +myParavis.ImportFile(file_name) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME,\ +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 +shrink_filter = None +shrinked_ds = None + +field_name = 'fieldcelldouble' + +print "\nCreating deformed shape.......", +ds = DeformedShapeOnField(proxy, EntityType.CELL, +field_name, 1, scale_factor=0.5, is_colored=True) +if ds is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(ds, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + call_and_check(ds, "Representation", repr, 1) + for shr in shrinks: + if shr > 0 and reprCode != RepresentationType.POINTS: + if shrinked_ds is None: + ds.Visibility = 1 + shrink_filter = Shrink(ds.Input) + shrink_filter.ShrinkFactor = 0.8 + shrink_filter.UpdatePipeline() + shrinked_ds = GetRepresentation(shrink_filter) + shrinked_ds.ColorAttributeType = ds.ColorAttributeType + shrinked_ds.ColorArrayName = ds.ColorArrayName + shrinked_ds.LookupTable = ds.LookupTable + ds.Visibility = 0 + shrinked_ds.Representation = ds.Representation + shape_to_show = shrinked_ds + else: + if shrinked_ds is not None: + shrinked_ds.Visibility = 0 + shape_to_show = ds + shape_to_show.Visibility = 1 + Render(my_view) + + for sha in shadings: + setShaded(my_view, sha) + call_and_check(shape_to_show, "Shading", sha, 1) + Render(my_view) + + for opa in opacities: + call_and_check(shape_to_show, "Opacity", opa, 1, compare_prec) + + for lwi in linewidths: + call_and_check(shape_to_show, "LineWidth", lwi, 1, + compare_prec) + + time.sleep(1) + # save picture in file + # Construct image file name + pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_" + str(shr) + "_" + \ + str(sha) + "_" + str(opa) + "_" + str(lwi) + "." + pictureext + # Show and record the presentation + WriteImage(pic_name, view=my_view, Magnification=1) + pass + pass + pass + pass + pass diff --git a/test/VisuPrs/3D_viewer/A6.py b/test/VisuPrs/3D_viewer/A6.py new file mode 100644 index 00000000..752b8a01 --- /dev/null +++ b/test/VisuPrs/3D_viewer/A6.py @@ -0,0 +1,130 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A6 case +# Create 3D Viewer and test set view properties for Scalar Map on +# Deformed Shape presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A6") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +#import file +my_paravis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +file_name = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file_name +print " --------------------------------- " + +my_paravis.ImportFile(file_name) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME, +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 +shrink_filter = None +shr_sm_on_ds = None + +field_name = 'fieldcelldouble' + +print "\nCreating scalar map on deformed shape.......", +sm_on_ds = DeformedShapeAndScalarMapOnField(proxy, EntityType.CELL, +field_name, 1, scale_factor=0.2) +if sm_on_ds is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(sm_on_ds, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + call_and_check(sm_on_ds, "Representation", repr, 1) + for shr in shrinks: + if shr > 0 and reprCode != RepresentationType.POINTS: + if shr_sm_on_ds is None: + sm_on_ds.Visibility = 1 + shrink_filter = Shrink(sm_on_ds.Input) + shrink_filter.ShrinkFactor = 0.8 + shrink_filter.UpdatePipeline() + shr_sm_on_ds = GetRepresentation(shrink_filter) + shr_sm_on_ds.ColorArrayName = sm_on_ds.ColorArrayName + shr_sm_on_ds.LookupTable = sm_on_ds.LookupTable + shr_sm_on_ds.ColorAttributeType = sm_on_ds.ColorAttributeType + sm_on_ds.Visibility = 0 + shr_sm_on_ds.Representation = sm_on_ds.Representation + shape_to_show = shr_sm_on_ds + else: + if shr_sm_on_ds is not None: + shr_sm_on_ds.Visibility = 0 + shape_to_show = sm_on_ds + shape_to_show.Visibility = 1 + Render(my_view) + + for sha in shadings: + setShaded(my_view, sha) + call_and_check(shape_to_show, "Shading", sha, 1) + Render(my_view) + + for opa in opacities: + call_and_check(shape_to_show, "Opacity", opa, 1, compare_prec) + + for lwi in linewidths: + call_and_check(shape_to_show, "LineWidth", lwi, 1, + compare_prec) + + time.sleep(1) + # save picture in file + # Construct image file name + pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_" + str(shr) + "_" + \ + str(sha) + "_" + str(opa) + "_" + str(lwi) + "." + pictureext + # Show and record the presentation + WriteImage(pic_name, view=my_view, Magnification=1) + pass + pass + pass + pass + pass diff --git a/test/VisuPrs/3D_viewer/A7.py b/test/VisuPrs/3D_viewer/A7.py new file mode 100644 index 00000000..c1653cbb --- /dev/null +++ b/test/VisuPrs/3D_viewer/A7.py @@ -0,0 +1,106 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A7 case +# Create 3D Viewer and test set view properties for CutPlanes presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A7") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep +#import file +my_paravis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +file_name = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file_name +print " --------------------------------- " + +my_paravis.ImportFile(file_name) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME,\ +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 + +field_name = 'scalar_field' + +print "\nCreating cut planes.......", +cut_planes = CutPlanesOnField(proxy, EntityType.CELL, field_name, 1, +nb_planes=10, orientation=Orientation.YZ, displacement=0.5) +if cut_planes is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(cut_planes, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + if reprCode == RepresentationType.VOLUME: + is_good = call_and_check(cut_planes, "Representation", repr, 0) + if is_good: + msg = "VOLUME representation must be not available for Iso Surface" + raise RuntimeError(msg) + else: + call_and_check(cut_planes, "Representation", repr, 1) + + for sha in shadings: + setShaded(my_view, sha) + call_and_check(cut_planes, "Shading", sha, 1) + Render(my_view) + + for opa in opacities: + call_and_check(cut_planes, "Opacity", opa, 1, compare_prec) + + for lwi in linewidths: + call_and_check(cut_planes, "LineWidth", lwi, 1, + compare_prec) + time.sleep(1) + + # save picture in file + # Construct image file name + pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_any_" + \ + str(sha) + "_" + str(opa) + "_" + str(lwi) + "." + pictureext + # Show and record the presentation + process_prs_for_test(cut_planes, my_view, pic_name) diff --git a/test/VisuPrs/3D_viewer/A8.py b/test/VisuPrs/3D_viewer/A8.py new file mode 100644 index 00000000..0a24bd53 --- /dev/null +++ b/test/VisuPrs/3D_viewer/A8.py @@ -0,0 +1,110 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A8 case +# Create 3D Viewer and test set view properties for Cut Lines presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A8") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep +#import file +my_paravis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +file_name = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file_name +print " --------------------------------- " + +my_paravis.ImportFile(file_name) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME,\ +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 + +field_name = 'scalar_field' + +print "\nCreating cut lines.......", +cut_lines = CutLinesOnField(proxy, EntityType.CELL, field_name, 1, + nb_lines=10, + orientation1=Orientation.ZX, + orientation2=Orientation.XY, + displacement1=0.5, displacement2=0.5) +if cut_lines is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(cut_lines, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + if reprCode == RepresentationType.VOLUME: + is_good = call_and_check(cut_lines, "Representation", repr, 0) + if is_good: + msg = "VOLUME representation must be not available for Iso Surface" + raise RuntimeError(msg) + else: + call_and_check(cut_lines, "Representation", repr, 1) + + for sha in shadings: + setShaded(my_view, sha) + call_and_check(cut_lines, "Shading", sha, 1) + Render(my_view) + + for opa in opacities: + call_and_check(cut_lines, "Opacity", opa, 1, compare_prec) + + for lwi in linewidths: + call_and_check(cut_lines, "LineWidth", lwi, 1, + compare_prec) + + time.sleep(1) + + # save picture in file + # Construct image file name + pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_any_" + \ + str(sha) + "_" + str(opa) + "_" + str(lwi) + "." + pictureext + # Show and record the presentation + process_prs_for_test(cut_lines, my_view, pic_name) diff --git a/test/VisuPrs/3D_viewer/A9.py b/test/VisuPrs/3D_viewer/A9.py new file mode 100644 index 00000000..0f410cab --- /dev/null +++ b/test/VisuPrs/3D_viewer/A9.py @@ -0,0 +1,288 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/A9 case +# Create 3D Viewer and test set view properties for Deformed Shape presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + + +def check_value(prs, property_name, value, do_raise=1, compare_toler=-1.0): + # compare just set value and the one got from presentation + really_set_value = prs.GetPropertyValue(property_name) + is_equal = 1 + if compare_toler > 0: + is_equal = (fabs(really_set_value - value) < compare_toler) + else: + is_equal = (really_set_value == value) + if not is_equal: + msg = str(really_set_value) + " has been set instead" + if do_raise: + raise RuntimeError(msg) + else: + print (msg) + + return (not is_equal) + + +def check_all_params(prs, pres_type, shad, opac, lwid): + err = check_value(prs, "Representation", pres_type, 0, -1.0) + err = err + check_value(prs, "Shading", shad, 0, -1.0) + err = err + check_value(prs, "Opacity", opac, 0, compare_prec) + err = err + check_value(prs, "LineWidth", lwid, 0, compare_prec) + return err + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/A9") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +#import file +myParavis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +theFileName = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +field_name = 'fieldcelldouble' + +print "\nCreating scalar_map.......", +scalar_map = ScalarMapOnField(proxy, EntityType.CELL, field_name, 1) +if scalar_map is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(scalar_map, my_view) +reset_view(my_view) +Render(my_view) + +compare_prec = 0.00001 + +print "\nChange Presentation Parameters..." +# Group 1 (SHADED) + +print "\nCheck in SURFACE:" + +call_and_check(scalar_map, "Representation", +RepresentationType.get_name(RepresentationType.SURFACE)) +shrink_filter = Shrink(scalar_map.Input) +shrink_filter.ShrinkFactor = 0.8 +shrink_filter.UpdatePipeline() +shrinked_scalar_map = GetRepresentation(shrink_filter) +shrinked_scalar_map.ColorAttributeType = EntityType.get_pvtype(EntityType.CELL) +shrinked_scalar_map.ColorArrayName = field_name +shrinked_scalar_map.Representation = scalar_map.Representation +lookup_table = scalar_map.LookupTable +shrinked_scalar_map.LookupTable = lookup_table +scalar_map.Visibility = 0 +shrinked_scalar_map.Visibility = 1 +Render(my_view) + +shape_to_show = shrinked_scalar_map +setShaded(my_view, 1) +call_and_check(shape_to_show, "Shading", 1) +Render(my_view) +call_and_check(shape_to_show, "Opacity", 0.8, 1, compare_prec) +call_and_check(shape_to_show, "LineWidth", 5.0, 1, compare_prec) + +time.sleep(1) + +# save picture in file +# Construct image file name +pic_name = picturedir + "params_SURFACE_1." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + + +call_and_check(shape_to_show, "Representation", +RepresentationType.get_name(RepresentationType.WIREFRAME)) +call_and_check(shape_to_show, "Representation", +RepresentationType.get_name(RepresentationType.SURFACE)) + +time.sleep(1) +picture_name = picturedir + "params_SURFACE_2." + pictureext + +# save picture in file +# Construct image file name +pic_name = picturedir + "params_SURFACE_2." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + +err = check_all_params(shape_to_show, +RepresentationType.get_name(RepresentationType.SURFACE), 1, 0.8, 5.0) + +##call_and_check(scalar_map, "Shrinked", 0, "Shrinked") +##call_and_check(scalar_map, "Shrinked", 1, "Shrinked") + +time.sleep(1) + +# save picture in file +# Construct image file name +pic_name = picturedir + "params_SURFACE_3." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + +err = err + check_all_params(shape_to_show, +RepresentationType.get_name(RepresentationType.SURFACE), 1, 0.8, 5.0) + +call_and_check(shape_to_show, "Shading", 0) +call_and_check(shape_to_show, "Shading", 1) + +time.sleep(1) + +# save picture in file +# Construct image file name +pic_name = picturedir + "params_SURFACE_4." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + +err = err + check_all_params(shape_to_show, +RepresentationType.get_name(RepresentationType.SURFACE), 1, 0.8, 5.0) + +call_and_check(shape_to_show, "Opacity", 1.0, 1, compare_prec) +call_and_check(shape_to_show, "Opacity", 0.8, 1, compare_prec) + +time.sleep(1) + +# save picture in file +# Construct image file name +pic_name = picturedir + "params_SURFACE_5." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + +err = err + check_all_params(shape_to_show, +RepresentationType.get_name(RepresentationType.SURFACE), 1, 0.8, 5.0) + +# Reset +##call_and_check(shape_to_show, "Shrinked", 0, "Shrinked") +setShaded(my_view, 0) +call_and_check(shape_to_show, "Shading", 0,) +Render(my_view) +call_and_check(shape_to_show, "Opacity", 1.0, 1, compare_prec) +call_and_check(shape_to_show, "LineWidth", 1.0, 1, compare_prec) + +# Group 2 (WIREFRAME) +hide_all(my_view) +print "\nCheck in WIREFRAME:" +scalar_map.Visibility = 1 +call_and_check(scalar_map, "Representation", +RepresentationType.get_name(RepresentationType.WIREFRAME), "Representation") +shrink_filter = Shrink(scalar_map.Input) +shrink_filter.ShrinkFactor = 0.8 +shrink_filter.UpdatePipeline() +shrinked_scalar_map = GetRepresentation(shrink_filter) +shrinked_scalar_map.ColorAttributeType = EntityType.get_pvtype(EntityType.CELL) +shrinked_scalar_map.ColorArrayName = field_name +shrinked_scalar_map.Representation = scalar_map.Representation +lookup_table = scalar_map.LookupTable +shrinked_scalar_map.LookupTable = lookup_table +scalar_map.Visibility = 0 +shrinked_scalar_map.Visibility = 1 +shape_to_show = shrinked_scalar_map + +setShaded(my_view, 1) +call_and_check(shape_to_show, "Shading", 1) +Render(my_view) +call_and_check(shape_to_show, "Opacity", 0.8, 1, compare_prec) +call_and_check(shape_to_show, "LineWidth", 5.0, 1, compare_prec) + +time.sleep(1) + +# save picture in file +# Construct image file name +pic_name = picturedir + "params_WIREFRAME_1." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + + +call_and_check(shape_to_show, "Representation", +RepresentationType.get_name(RepresentationType.SURFACE)) +call_and_check(shape_to_show, "Representation", +RepresentationType.get_name(RepresentationType.WIREFRAME)) + +time.sleep(1) +# save picture in file +# Construct image file name +pic_name = picturedir + "params_WIREFRAME_2." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + +err = err + check_all_params(shape_to_show, +RepresentationType.get_name(RepresentationType.WIREFRAME), 1, 0.8, 5.0) + +##call_and_check(shape_to_show, "Shrinked", 0) +##call_and_check(shape_to_show, "Shrinked", 1) + +time.sleep(1) +# save picture in file +# Construct image file name +pic_name = picturedir + "params_WIREFRAME_3." + pictureext +# Show and record the presentation +process_prs_for_test(shrinked_scalar_map, my_view, pic_name) + +err = err + check_all_params(shape_to_show, +RepresentationType.get_name(RepresentationType.WIREFRAME), 1, 0.8, 5.0) + +call_and_check(shape_to_show, "Shading", 0) +call_and_check(shape_to_show, "Shading", 1) + +time.sleep(1) +# save picture in file +# Construct image file name +pic_name = picturedir + "params_WIREFRAME_4." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + +err = err + check_all_params(shape_to_show, +RepresentationType.get_name(RepresentationType.WIREFRAME), 1, 0.8, 5.0) + +call_and_check(shape_to_show, "Opacity", 1.0, 1, compare_prec) +call_and_check(shape_to_show, "Opacity", 0.8, 1, compare_prec) + +time.sleep(1) +# save picture in file +# Construct image file name +pic_name = picturedir + "params_WIREFRAME_5." + pictureext +# Show and record the presentation +process_prs_for_test(shape_to_show, my_view, pic_name) + +err = err + check_all_params(shape_to_show, +RepresentationType.get_name(RepresentationType.WIREFRAME), 1, 0.8, 5.0) + +if err: + raise RuntimeError("Presentation parameters are not stable") diff --git a/test/VisuPrs/3D_viewer/B0.py b/test/VisuPrs/3D_viewer/B0.py new file mode 100644 index 00000000..e7adc123 --- /dev/null +++ b/test/VisuPrs/3D_viewer/B0.py @@ -0,0 +1,133 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/B0 case +# Create 3D Viewer and test set view properties for Scalar Map presentation +# Author: POLYANSKIKH VERA +from paravistest import * +from presentations import * +from pvsimple import * +import sys +import paravis +import time + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/B0") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +#import file +myParavis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +theFileName = datadir + "fra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError("Error: can't import file.") +else: + print "OK" + +represents = [RepresentationType.POINTS, RepresentationType.WIREFRAME,\ +RepresentationType.SURFACE, RepresentationType.VOLUME] +shrinks = [0, 1] +shadings = [0, 1] +opacities = [1.0, 0.5, 0.0] +linewidths = [1.0, 3.0, 10.0] +compare_prec = 0.00001 +shrink_filter = None +shrinked_sm = None + +field_name = 'VITESSE' + +print "\nCreating scalar map.......", +scalar_map = ScalarMapOnField(proxy, EntityType.CELL, field_name, 1) +if scalar_map is None: + raise RuntimeError("Error!!! Presentation wasn't created...") + +display_only(scalar_map, my_view) +reset_view(my_view) +Render(my_view) + +print "\nChange Presentation Parameters..." + + +for reprCode in represents: + repr = RepresentationType.get_name(reprCode) + call_and_check(scalar_map, "Representation", repr, 1) + for shr in shrinks: + if shr > 0 and reprCode != RepresentationType.POINTS: + if shrinked_sm is None: + scalar_map.Visibility = 1 + shrink_filter = Shrink(scalar_map.Input) + shrinked_sm = GetRepresentation(shrink_filter) + shrink_filter.ShrinkFactor = 0.8 + shrink_filter.UpdatePipeline() + shrinked_sm.ColorAttributeType = scalar_map.ColorAttributeType + shrinked_sm.ColorArrayName = scalar_map.ColorArrayName + lookup_table = scalar_map.LookupTable + shrinked_sm.LookupTable = lookup_table + + scalar_map.Visibility = 0 + shrinked_sm.Representation = scalar_map.Representation + shrinked_sm.Visibility = 1 + shape_to_show = shrinked_sm + else: + if shrinked_sm is not None: + shrinked_sm.Visibility = 0 + scalar_map.Visibility = 1 + shape_to_show = scalar_map + Render(my_view) + + for sha in shadings: + setShaded(my_view, sha) + call_and_check(shape_to_show, "Shading", sha, 1) + Render(my_view) + + for opa in opacities: + call_and_check(shape_to_show, "Opacity", opa, 1, compare_prec) + + for lwi in linewidths: + call_and_check(shape_to_show, "LineWidth", lwi, 1, + compare_prec) + + time.sleep(1) + # save picture in file + # Construct image file name + opa = str(opa).replace('.', '') + lwi = str(lwi).replace('.', '') + pic_name = picturedir + "params_" + repr + "_" + str(shr) + "_" + \ + str(sha) + "_" + str(opa) + "_" + str(lwi) + "." + pictureext + # Show and record the presentation + WriteImage(pic_name, view=my_view, Magnification=1) + pass + pass + pass + pass + pass diff --git a/test/VisuPrs/3D_viewer/B2.py b/test/VisuPrs/3D_viewer/B2.py new file mode 100644 index 00000000..376c25b9 --- /dev/null +++ b/test/VisuPrs/3D_viewer/B2.py @@ -0,0 +1,62 @@ +# Copyright (C) 2010-2012 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. +# +# 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/3D_viewer/B2 case +# Create 3D Viewer and test set view properties for CutPlanes presentation +# Author: POLYANSKIKH VERA +import sys +import time + +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "3D_viewer/B2") + +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +#import file +myParavis = paravis.myParavis + +# Get view +my_view = GetRenderView() +reset_view(my_view) +Render(my_view) + +# Split +a_view_r = CreateRenderView() +Delete(a_view_r) + +# Split +a_view_l = CreateRenderView() +Delete(a_view_l) + +# Split +a_view_t = CreateRenderView() +Delete(a_view_t) + +# Split +a_view_b = CreateRenderView() +reset_view(a_view_b) +Render(a_view_b) diff --git a/test/VisuPrs/3D_viewer/CMakeLists.txt b/test/VisuPrs/3D_viewer/CMakeLists.txt new file mode 100755 index 00000000..f1d6c37f --- /dev/null +++ b/test/VisuPrs/3D_viewer/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B2 + ) + ADD_TEST(3DVIEWER_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(3DVIEWER_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/Animation/A0.py b/test/VisuPrs/Animation/A0.py new file mode 100755 index 00000000..25647858 --- /dev/null +++ b/test/VisuPrs/Animation/A0.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/A0 case +#%Create animation for Scalar Map for 'vitesse' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/A0") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Scalar Map creation +prs= ScalarMapOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"A0_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 40 # correspond to set the speed of animation in VISU +scene.GoToFirst() +scene.Loop = 1 +print "Animation.................................", +scene.Play() diff --git a/test/VisuPrs/Animation/A2.py b/test/VisuPrs/Animation/A2.py new file mode 100755 index 00000000..ebd5c2e3 --- /dev/null +++ b/test/VisuPrs/Animation/A2.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/A2 case +#%Create animation for Scalar Map for 'pression' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/A2") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Scalar Map creation +prs= ScalarMapOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"A2_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/A4.py b/test/VisuPrs/Animation/A4.py new file mode 100644 index 00000000..bc13fa7e --- /dev/null +++ b/test/VisuPrs/Animation/A4.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/A4 case +#%Create animation for Cut Lines for 'pression' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/A4") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Cut Lines creation +prs= CutLinesOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"A4_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/A7.py b/test/VisuPrs/Animation/A7.py new file mode 100644 index 00000000..8f19bcb8 --- /dev/null +++ b/test/VisuPrs/Animation/A7.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/A7 case +#%Create animation for Cut Lines for 'pression' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/A7") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Cut Lines creation +prs= CutLinesOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"A7_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/A8.py b/test/VisuPrs/Animation/A8.py new file mode 100644 index 00000000..a20c6d38 --- /dev/null +++ b/test/VisuPrs/Animation/A8.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/A8 case +#%Create animation for Cut Lines for 'pression' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/A8") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Cut Lines creation +prs= CutLinesOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"A8_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/B2.py b/test/VisuPrs/Animation/B2.py new file mode 100644 index 00000000..5e25603a --- /dev/null +++ b/test/VisuPrs/Animation/B2.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/B2 case +#%Create animation for Cut Planes for 'pression' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/B2") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Cut Planes creation +prs= CutPlanesOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"B2_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/B5.py b/test/VisuPrs/Animation/B5.py new file mode 100644 index 00000000..04392b95 --- /dev/null +++ b/test/VisuPrs/Animation/B5.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/B5 case +#%Create animation for Cut Planes for 'pression' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/B5") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Cut Planes creation +prs= CutPlanesOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"B5_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/B6.py b/test/VisuPrs/Animation/B6.py new file mode 100644 index 00000000..ed411a55 --- /dev/null +++ b/test/VisuPrs/Animation/B6.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/B6 case +#%Create animation for Cut Planes for 'pression' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/B6") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Cut Planes creation +prs= CutPlanesOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"B6_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/C0.py b/test/VisuPrs/Animation/C0.py new file mode 100644 index 00000000..e562d40a --- /dev/null +++ b/test/VisuPrs/Animation/C0.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/C0 case +#%Create animation for Deformed Shape for 'vitesse' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/C0") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Deformed Shape creation +prs= DeformedShapeOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"C0_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/C1.py b/test/VisuPrs/Animation/C1.py new file mode 100644 index 00000000..9eb0e05c --- /dev/null +++ b/test/VisuPrs/Animation/C1.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/C1 case +#%Create animation for Deformed Shape for 'vitesse' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/C1") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Deformed Shape creation +prs= DeformedShapeOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"C1_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/C3.py b/test/VisuPrs/Animation/C3.py new file mode 100644 index 00000000..837950a3 --- /dev/null +++ b/test/VisuPrs/Animation/C3.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/C3 case +#%Create animation for Deformed Shape for 'vitesse' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/C3") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Deformed Shape creation +prs= DeformedShapeOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"C3_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/C8.py b/test/VisuPrs/Animation/C8.py new file mode 100644 index 00000000..00c53e4b --- /dev/null +++ b/test/VisuPrs/Animation/C8.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/C8 case +#%Create animation for Gauss Points for 'pression' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/C8") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Gauss Points creation +prs= GaussPointsOnField(aProxy,EntityType.CELL,'pression' , 1 , theMultiplier=0.01) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"C8_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/CMakeLists.txt b/test/VisuPrs/Animation/CMakeLists.txt new file mode 100755 index 00000000..ae79d51f --- /dev/null +++ b/test/VisuPrs/Animation/CMakeLists.txt @@ -0,0 +1,55 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + 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 + ) + ADD_TEST(ANIMATION_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(ANIMATION_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/Animation/D1.py b/test/VisuPrs/Animation/D1.py new file mode 100644 index 00000000..d7e40b56 --- /dev/null +++ b/test/VisuPrs/Animation/D1.py @@ -0,0 +1,90 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/D1 case +#%Create animation for Gauss Points for 'pression' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/D1") + +theFileName = datadir + "TimeStamps.med" + +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Gauss Points creation +prs= GaussPointsOnField(aProxy,EntityType.CELL,'pression' , 2, theMultiplier=0.01) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"D1_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/D2.py b/test/VisuPrs/Animation/D2.py new file mode 100644 index 00000000..e67b6bdf --- /dev/null +++ b/test/VisuPrs/Animation/D2.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/D2 case +#%Create animation for Gauss Points for 'pression' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/D2") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Gauss Points creation +prs= GaussPointsOnField(aProxy,EntityType.CELL,'pression' , 2, theMultiplier=0.01) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"D2_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/D6.py b/test/VisuPrs/Animation/D6.py new file mode 100644 index 00000000..d42fd5f0 --- /dev/null +++ b/test/VisuPrs/Animation/D6.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/D6 case +#%Create animation for Iso Surfaces for 'pression' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/D6") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Iso Surfaces creation +prs= IsoSurfacesOnField(aProxy,EntityType.CELL,'pression', 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"D6_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/D9.py b/test/VisuPrs/Animation/D9.py new file mode 100644 index 00000000..fe38a9c0 --- /dev/null +++ b/test/VisuPrs/Animation/D9.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/D9 case +#%Create animation for Iso Surfaces for 'pression' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/D9") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Iso Surfaces creation +prs= IsoSurfacesOnField(aProxy,EntityType.CELL,'pression', 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"D9_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/E0.py b/test/VisuPrs/Animation/E0.py new file mode 100644 index 00000000..df1e669a --- /dev/null +++ b/test/VisuPrs/Animation/E0.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/E0 case +#%Create animation for Iso Surfaces for 'pression' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/E0") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Iso Surfaces creation +prs= IsoSurfacesOnField(aProxy,EntityType.CELL,'pression', 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"E0_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/E4.py b/test/VisuPrs/Animation/E4.py new file mode 100644 index 00000000..03a3accd --- /dev/null +++ b/test/VisuPrs/Animation/E4.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/E4 case +# Create animation for Plot 3D for 'pression' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +# import file +myParavis = paravis.myParavis + +# for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/E4") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Plot 3D creation +prs= Plot3DOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"E4_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/E7.py b/test/VisuPrs/Animation/E7.py new file mode 100644 index 00000000..cd5f23d1 --- /dev/null +++ b/test/VisuPrs/Animation/E7.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/E7 case +#%Create animation for Plot 3D for 'pression' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/E7") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Plot 3D creation +prs= Plot3DOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"E7_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/E8.py b/test/VisuPrs/Animation/E8.py new file mode 100644 index 00000000..0f59149a --- /dev/null +++ b/test/VisuPrs/Animation/E8.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/E8 case +# Create animation for Plot 3D for 'pression' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +# import file +myParavis = paravis.myParavis + +# for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/E8") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Plot 3D creation +prs= Plot3DOnField(aProxy,EntityType.CELL,'pression' , 2) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.PointArrays.DeselectAll() +aProxy.CellArrays.DeselectAll() +aProxy.CellArrays = ['pression'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"E8_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/F2.py b/test/VisuPrs/Animation/F2.py new file mode 100644 index 00000000..ad355427 --- /dev/null +++ b/test/VisuPrs/Animation/F2.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/F2 case +#%Create animation for Scalar Map on Deformed Shape for 'vitesse' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/F2") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Scalar Map on Deformed Shape creation +prs= DeformedShapeAndScalarMapOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"F2_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/F5.py b/test/VisuPrs/Animation/F5.py new file mode 100644 index 00000000..5e1c1cf3 --- /dev/null +++ b/test/VisuPrs/Animation/F5.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/F5 case +#%Create animation for Scalar Map on Deformed Shape for 'vitesse' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/F5") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Scalar Map on Deformed Shape creation +prs= DeformedShapeAndScalarMapOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"F5_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/F6.py b/test/VisuPrs/Animation/F6.py new file mode 100644 index 00000000..cf7c72bb --- /dev/null +++ b/test/VisuPrs/Animation/F6.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/F6 case +#%Create animation for Scalar Map on Deformed Shape for 'vitesse' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/F6") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Scalar Map on Deformed Shape creation +prs= DeformedShapeAndScalarMapOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"F6_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/G0.py b/test/VisuPrs/Animation/G0.py new file mode 100644 index 00000000..70c54260 --- /dev/null +++ b/test/VisuPrs/Animation/G0.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/G0 case +#%Create animation for Stream Lines for 'vitesse' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/G0") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Stream Lines creation +prs= StreamLinesOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"G0_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/G3.py b/test/VisuPrs/Animation/G3.py new file mode 100644 index 00000000..bdf27aef --- /dev/null +++ b/test/VisuPrs/Animation/G3.py @@ -0,0 +1,90 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/G3 case +#%Create animation for Stream Lines for 'vitesse' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/G3") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) + +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Stream Lines creation +prs= StreamLinesOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"G3_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/G4.py b/test/VisuPrs/Animation/G4.py new file mode 100644 index 00000000..70204254 --- /dev/null +++ b/test/VisuPrs/Animation/G4.py @@ -0,0 +1,90 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/G4case +#%Create animation for Stream Lines for 'vitesse' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/G3") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) + +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Stream Lines creation +prs= StreamLinesOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"G3_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/G8.py b/test/VisuPrs/Animation/G8.py new file mode 100644 index 00000000..3bdced6d --- /dev/null +++ b/test/VisuPrs/Animation/G8.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/G8 case +#%Create animation for Vectors for 'vitesse' field of the the given MED file and dumps picture files in JPEG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/G8") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Vectors creation +prs= VectorsOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "jpeg" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"G8_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/H1.py b/test/VisuPrs/Animation/H1.py new file mode 100644 index 00000000..696643c4 --- /dev/null +++ b/test/VisuPrs/Animation/H1.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/H1 case +#%Create animation for Vectors for 'vitesse' field of the the given MED file and dumps picture files in PNG format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/H1") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Vectors creation +prs= VectorsOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "png" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"H1_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/Animation/H2.py b/test/VisuPrs/Animation/H2.py new file mode 100644 index 00000000..62343271 --- /dev/null +++ b/test/VisuPrs/Animation/H2.py @@ -0,0 +1,89 @@ +# Copyright (C) 2010-2012 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. +# +# 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/animation/H2 case +#%Create animation for Vectors for 'vitesse' field of the the given MED file and dumps picture files in TIFF format % + +import sys +import os +from paravistest import * +from presentations import * +from pvsimple import * +import paravis + +#import file +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Animation/H2") + +theFileName = datadir + "TimeStamps.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +print "Creating a Viewer.........................", +aView = GetRenderView() +reset_view(aView) +Render(aView) + +if aView is None : print "Error" +else : print "OK" + +# Vectors creation +prs= VectorsOnField(aProxy,EntityType.NODE,'vitesse' , 1) +prs.Visibility=1 +aView.ResetCamera() +print "Creating an Animation.....................", +my_format = "tiff" +print "Current format to save snapshots: ",my_format +# Add path separator to the end of picture path if necessery +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# Select only the current field: +aProxy.CellArrays.DeselectAll() +aProxy.PointArrays.DeselectAll() +aProxy.PointArrays = ['vitesse'] + +# Animation creation and saving into set of files into picturedir +scene = AnimateReader(aProxy,aView,picturedir+"H2_dom."+my_format) +nb_frames = len(scene.TimeKeeper.TimestepValues) + +pics = os.listdir(picturedir) +if len(pics) != nb_frames: + print "FAILED!!! Number of made pictures is equal to ", len(pics), " instead of ", nb_frames + +for pic in pics: + os.remove(picturedir+pic) + +# Prepare animation performance +scene.PlayMode = 1 # set RealTime mode for animation performance +# set period +scene.Duration = 30 # correspond to set the speed of animation in VISU +scene.GoToFirst() +print "Animation.................................", +scene.Play() +scene.GoToFirst() diff --git a/test/VisuPrs/CMakeLists.txt b/test/VisuPrs/CMakeLists.txt new file mode 100644 index 00000000..bfb7a985 --- /dev/null +++ b/test/VisuPrs/CMakeLists.txt @@ -0,0 +1,37 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +SUBDIRS(Util + 2D_viewer + 3D_viewer + ScalarMap + DeformedShape + ScalarMap_On_DeformedShape + CutPlanes + CutLines + Vectors + Plot3D + IsoSurfaces + MeshPresentation + Animation + GaussPoints + StreamLines + SWIG_scripts + Tables) + diff --git a/test/VisuPrs/CutLines/A0.py b/test/VisuPrs/CutLines/A0.py new file mode 100644 index 00000000..fc11043a --- /dev/null +++ b/test/VisuPrs/CutLines/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A1.py b/test/VisuPrs/CutLines/A1.py new file mode 100644 index 00000000..30e57fe4 --- /dev/null +++ b/test/VisuPrs/CutLines/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A2.py b/test/VisuPrs/CutLines/A2.py new file mode 100755 index 00000000..bec8fdc0 --- /dev/null +++ b/test/VisuPrs/CutLines/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A3.py b/test/VisuPrs/CutLines/A3.py new file mode 100755 index 00000000..52dfd4ee --- /dev/null +++ b/test/VisuPrs/CutLines/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A4.py b/test/VisuPrs/CutLines/A4.py new file mode 100644 index 00000000..86e90bf3 --- /dev/null +++ b/test/VisuPrs/CutLines/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A5.py b/test/VisuPrs/CutLines/A5.py new file mode 100644 index 00000000..74d642dd --- /dev/null +++ b/test/VisuPrs/CutLines/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A6.py b/test/VisuPrs/CutLines/A6.py new file mode 100644 index 00000000..dca5c366 --- /dev/null +++ b/test/VisuPrs/CutLines/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A7.py b/test/VisuPrs/CutLines/A7.py new file mode 100644 index 00000000..e7f19685 --- /dev/null +++ b/test/VisuPrs/CutLines/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A8.py b/test/VisuPrs/CutLines/A8.py new file mode 100644 index 00000000..96d97e24 --- /dev/null +++ b/test/VisuPrs/CutLines/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/A9.py b/test/VisuPrs/CutLines/A9.py new file mode 100644 index 00000000..96423690 --- /dev/null +++ b/test/VisuPrs/CutLines/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/B0.py b/test/VisuPrs/CutLines/B0.py new file mode 100644 index 00000000..77743625 --- /dev/null +++ b/test/VisuPrs/CutLines/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/B1.py b/test/VisuPrs/CutLines/B1.py new file mode 100644 index 00000000..276d05c5 --- /dev/null +++ b/test/VisuPrs/CutLines/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/B2.py b/test/VisuPrs/CutLines/B2.py new file mode 100644 index 00000000..02767373 --- /dev/null +++ b/test/VisuPrs/CutLines/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/CMakeLists.txt b/test/VisuPrs/CutLines/CMakeLists.txt new file mode 100644 index 00000000..367f6fca --- /dev/null +++ b/test/VisuPrs/CutLines/CMakeLists.txt @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + B3 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + G0 + G1 + G2 + ) + ADD_TEST(CUTLINES_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(CUTLINES_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/CutLines/E0.py b/test/VisuPrs/CutLines/E0.py new file mode 100644 index 00000000..df2f0140 --- /dev/null +++ b/test/VisuPrs/CutLines/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E1.py b/test/VisuPrs/CutLines/E1.py new file mode 100644 index 00000000..dfbe7545 --- /dev/null +++ b/test/VisuPrs/CutLines/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E2.py b/test/VisuPrs/CutLines/E2.py new file mode 100644 index 00000000..9a76c4f8 --- /dev/null +++ b/test/VisuPrs/CutLines/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E3.py b/test/VisuPrs/CutLines/E3.py new file mode 100644 index 00000000..e33d0b0d --- /dev/null +++ b/test/VisuPrs/CutLines/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E4.py b/test/VisuPrs/CutLines/E4.py new file mode 100644 index 00000000..3640f527 --- /dev/null +++ b/test/VisuPrs/CutLines/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E5.py b/test/VisuPrs/CutLines/E5.py new file mode 100644 index 00000000..003fcbf9 --- /dev/null +++ b/test/VisuPrs/CutLines/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E6.py b/test/VisuPrs/CutLines/E6.py new file mode 100644 index 00000000..5ff7ea3e --- /dev/null +++ b/test/VisuPrs/CutLines/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E7.py b/test/VisuPrs/CutLines/E7.py new file mode 100644 index 00000000..f566d2ca --- /dev/null +++ b/test/VisuPrs/CutLines/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E8.py b/test/VisuPrs/CutLines/E8.py new file mode 100644 index 00000000..d76a1a34 --- /dev/null +++ b/test/VisuPrs/CutLines/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/E9.py b/test/VisuPrs/CutLines/E9.py new file mode 100644 index 00000000..9d0dcf60 --- /dev/null +++ b/test/VisuPrs/CutLines/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F0.py b/test/VisuPrs/CutLines/F0.py new file mode 100644 index 00000000..a889d294 --- /dev/null +++ b/test/VisuPrs/CutLines/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F1.py b/test/VisuPrs/CutLines/F1.py new file mode 100644 index 00000000..f5a018a7 --- /dev/null +++ b/test/VisuPrs/CutLines/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F2.py b/test/VisuPrs/CutLines/F2.py new file mode 100644 index 00000000..cef1162a --- /dev/null +++ b/test/VisuPrs/CutLines/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F3.py b/test/VisuPrs/CutLines/F3.py new file mode 100644 index 00000000..8557953a --- /dev/null +++ b/test/VisuPrs/CutLines/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F4.py b/test/VisuPrs/CutLines/F4.py new file mode 100644 index 00000000..080411f9 --- /dev/null +++ b/test/VisuPrs/CutLines/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F5.py b/test/VisuPrs/CutLines/F5.py new file mode 100644 index 00000000..00e5d90a --- /dev/null +++ b/test/VisuPrs/CutLines/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F6.py b/test/VisuPrs/CutLines/F6.py new file mode 100644 index 00000000..d6aa8805 --- /dev/null +++ b/test/VisuPrs/CutLines/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F7.py b/test/VisuPrs/CutLines/F7.py new file mode 100644 index 00000000..b7c7bdc5 --- /dev/null +++ b/test/VisuPrs/CutLines/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F8.py b/test/VisuPrs/CutLines/F8.py new file mode 100755 index 00000000..b936a28c --- /dev/null +++ b/test/VisuPrs/CutLines/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F8") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/F9.py b/test/VisuPrs/CutLines/F9.py new file mode 100644 index 00000000..ba4777ec --- /dev/null +++ b/test/VisuPrs/CutLines/F9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/F9") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/G0.py b/test/VisuPrs/CutLines/G0.py new file mode 100644 index 00000000..f64c17c6 --- /dev/null +++ b/test/VisuPrs/CutLines/G0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/G0") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/G1.py b/test/VisuPrs/CutLines/G1.py new file mode 100644 index 00000000..c7c6cb89 --- /dev/null +++ b/test/VisuPrs/CutLines/G1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutLines/G1") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTLINES], picturedir, pictureext) diff --git a/test/VisuPrs/CutLines/G2.py b/test/VisuPrs/CutLines/G2.py new file mode 100644 index 00000000..1a681a5d --- /dev/null +++ b/test/VisuPrs/CutLines/G2.py @@ -0,0 +1,82 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G2 case +# Create Cut lines for field of the the given MED file for 10 timestamps% + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "CutLines/G2") + +theFileName = datadir + "Bug829_resu_mode.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +"""Build presentations of the given types for all fields of the given file.""" +#print "Import %s..." % theFileName.split('/')[-1], +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" +# Get viewScalarMap +aView = GetRenderView() + +# Create required presentations for the proxy +# CreatePrsForProxy(aProxy, aView, thePrsTypeList, thePictureDir, thePictureExt, theIsAutoDelete) +aFieldNames = aProxy.PointArrays.GetData() +aNbOnNodes = len(aFieldNames) +aFieldNames.extend(aProxy.CellArrays.GetData()) +aTimeStamps = aProxy.TimestepValues.GetData() +aFieldEntity = EntityType.NODE +aFieldName = "MODES_DEPL" + +#create Cut Lines presentations for 10 timestamps +for i in range(1,11): + hide_all(aView, True) + aPrs = CutLinesOnField(aProxy, aFieldEntity,aFieldName , i) + if aPrs is None: + raise RuntimeError, "Presentation is None!!!" + #display only current scalar map + aPrs.Visibility=1 + reset_view(aView) + Render(aView) + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + prs_type = PrsTypeEnum.CUTLINES + + # Get name of presentation type + prs_name = PrsTypeEnum.get_name(prs_type) + f_prs_type = prs_name.replace(' ', '').upper() + # Construct image file name + pic_name = picturedir + aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext + + # Show and record the presentation + process_prs_for_test(aPrs, aView, pic_name) + + diff --git a/test/VisuPrs/CutPlanes/A0.py b/test/VisuPrs/CutPlanes/A0.py new file mode 100644 index 00000000..dd373736 --- /dev/null +++ b/test/VisuPrs/CutPlanes/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A1.py b/test/VisuPrs/CutPlanes/A1.py new file mode 100644 index 00000000..e10c702c --- /dev/null +++ b/test/VisuPrs/CutPlanes/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A2.py b/test/VisuPrs/CutPlanes/A2.py new file mode 100755 index 00000000..8d870cec --- /dev/null +++ b/test/VisuPrs/CutPlanes/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A3.py b/test/VisuPrs/CutPlanes/A3.py new file mode 100755 index 00000000..b2068bd0 --- /dev/null +++ b/test/VisuPrs/CutPlanes/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A4.py b/test/VisuPrs/CutPlanes/A4.py new file mode 100644 index 00000000..bca94568 --- /dev/null +++ b/test/VisuPrs/CutPlanes/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A5.py b/test/VisuPrs/CutPlanes/A5.py new file mode 100644 index 00000000..fb5005e9 --- /dev/null +++ b/test/VisuPrs/CutPlanes/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A6.py b/test/VisuPrs/CutPlanes/A6.py new file mode 100644 index 00000000..513c6fb9 --- /dev/null +++ b/test/VisuPrs/CutPlanes/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A7.py b/test/VisuPrs/CutPlanes/A7.py new file mode 100644 index 00000000..2a1cb635 --- /dev/null +++ b/test/VisuPrs/CutPlanes/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A8.py b/test/VisuPrs/CutPlanes/A8.py new file mode 100644 index 00000000..76f0b5ad --- /dev/null +++ b/test/VisuPrs/CutPlanes/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/A9.py b/test/VisuPrs/CutPlanes/A9.py new file mode 100644 index 00000000..8d180eb4 --- /dev/null +++ b/test/VisuPrs/CutPlanes/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/B0.py b/test/VisuPrs/CutPlanes/B0.py new file mode 100644 index 00000000..520efe35 --- /dev/null +++ b/test/VisuPrs/CutPlanes/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/B1.py b/test/VisuPrs/CutPlanes/B1.py new file mode 100644 index 00000000..54f4335d --- /dev/null +++ b/test/VisuPrs/CutPlanes/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/B2.py b/test/VisuPrs/CutPlanes/B2.py new file mode 100644 index 00000000..bef70305 --- /dev/null +++ b/test/VisuPrs/CutPlanes/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/B3.py b/test/VisuPrs/CutPlanes/B3.py new file mode 100644 index 00000000..b701166b --- /dev/null +++ b/test/VisuPrs/CutPlanes/B3.py @@ -0,0 +1,55 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B3 case + +from paravistest import datadir +from presentations import CutPlanesOnField, EntityType +import paravis +import pvsimple + +my_paravis = paravis.myParavis + +#====================Stage1: Importing MED file==================== +print "**** Stage1: Importing MED file" + +print 'Import "ResOK_0000.med"...............', + +file_path = datadir + "ResOK_0000.med" +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +#====================Stage2: Creating CutPlanes==================== +print "*****Stage2: Creating CutPlanes" + +print "Creating Cut Planes.......", + +node_entity = EntityType.NODE +field_name = 'vitesse' +cutplanes = CutPlanesOnField(med_reader, node_entity, field_name, 1) + +if cutplanes is None: + print "FAILED" +else: + print "OK" diff --git a/test/VisuPrs/CutPlanes/CMakeLists.txt b/test/VisuPrs/CutPlanes/CMakeLists.txt new file mode 100644 index 00000000..7edb069a --- /dev/null +++ b/test/VisuPrs/CutPlanes/CMakeLists.txt @@ -0,0 +1,63 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + B3 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + G0 + G1 + G2 + ) + ADD_TEST(CUTPLANES_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(CUTPLANES_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/CutPlanes/E0.py b/test/VisuPrs/CutPlanes/E0.py new file mode 100644 index 00000000..9fdc539e --- /dev/null +++ b/test/VisuPrs/CutPlanes/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E1.py b/test/VisuPrs/CutPlanes/E1.py new file mode 100644 index 00000000..64750577 --- /dev/null +++ b/test/VisuPrs/CutPlanes/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E2.py b/test/VisuPrs/CutPlanes/E2.py new file mode 100644 index 00000000..88387ce1 --- /dev/null +++ b/test/VisuPrs/CutPlanes/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E3.py b/test/VisuPrs/CutPlanes/E3.py new file mode 100644 index 00000000..6b8b8a0a --- /dev/null +++ b/test/VisuPrs/CutPlanes/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E4.py b/test/VisuPrs/CutPlanes/E4.py new file mode 100644 index 00000000..213ff0d3 --- /dev/null +++ b/test/VisuPrs/CutPlanes/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E5.py b/test/VisuPrs/CutPlanes/E5.py new file mode 100644 index 00000000..645ad5f4 --- /dev/null +++ b/test/VisuPrs/CutPlanes/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E6.py b/test/VisuPrs/CutPlanes/E6.py new file mode 100644 index 00000000..f7453957 --- /dev/null +++ b/test/VisuPrs/CutPlanes/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E7.py b/test/VisuPrs/CutPlanes/E7.py new file mode 100644 index 00000000..115977c4 --- /dev/null +++ b/test/VisuPrs/CutPlanes/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E8.py b/test/VisuPrs/CutPlanes/E8.py new file mode 100644 index 00000000..738d3749 --- /dev/null +++ b/test/VisuPrs/CutPlanes/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/E9.py b/test/VisuPrs/CutPlanes/E9.py new file mode 100644 index 00000000..04c14244 --- /dev/null +++ b/test/VisuPrs/CutPlanes/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F0.py b/test/VisuPrs/CutPlanes/F0.py new file mode 100644 index 00000000..22b378c8 --- /dev/null +++ b/test/VisuPrs/CutPlanes/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F1.py b/test/VisuPrs/CutPlanes/F1.py new file mode 100644 index 00000000..e8410d7e --- /dev/null +++ b/test/VisuPrs/CutPlanes/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F2.py b/test/VisuPrs/CutPlanes/F2.py new file mode 100644 index 00000000..b39bff12 --- /dev/null +++ b/test/VisuPrs/CutPlanes/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F3.py b/test/VisuPrs/CutPlanes/F3.py new file mode 100644 index 00000000..0f2f35c9 --- /dev/null +++ b/test/VisuPrs/CutPlanes/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F4.py b/test/VisuPrs/CutPlanes/F4.py new file mode 100644 index 00000000..c7efd909 --- /dev/null +++ b/test/VisuPrs/CutPlanes/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F5.py b/test/VisuPrs/CutPlanes/F5.py new file mode 100644 index 00000000..f3bc2326 --- /dev/null +++ b/test/VisuPrs/CutPlanes/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F6.py b/test/VisuPrs/CutPlanes/F6.py new file mode 100644 index 00000000..8ce2da00 --- /dev/null +++ b/test/VisuPrs/CutPlanes/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F7.py b/test/VisuPrs/CutPlanes/F7.py new file mode 100755 index 00000000..587a2b83 --- /dev/null +++ b/test/VisuPrs/CutPlanes/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F8.py b/test/VisuPrs/CutPlanes/F8.py new file mode 100644 index 00000000..988afa8e --- /dev/null +++ b/test/VisuPrs/CutPlanes/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F8") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/F9.py b/test/VisuPrs/CutPlanes/F9.py new file mode 100644 index 00000000..e1ec2a2e --- /dev/null +++ b/test/VisuPrs/CutPlanes/F9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/F9") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/G0.py b/test/VisuPrs/CutPlanes/G0.py new file mode 100644 index 00000000..e2a7f894 --- /dev/null +++ b/test/VisuPrs/CutPlanes/G0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/G0") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/G1.py b/test/VisuPrs/CutPlanes/G1.py new file mode 100644 index 00000000..72138ff1 --- /dev/null +++ b/test/VisuPrs/CutPlanes/G1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"CutPlanes/G1") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.CUTPLANES], picturedir, pictureext) diff --git a/test/VisuPrs/CutPlanes/G2.py b/test/VisuPrs/CutPlanes/G2.py new file mode 100644 index 00000000..00af83be --- /dev/null +++ b/test/VisuPrs/CutPlanes/G2.py @@ -0,0 +1,82 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G2 case +# Create Cut planes for field of the the given MED file for 10 timestamps% + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "CutPlanes/G2") + +theFileName = datadir + "Bug829_resu_mode.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +"""Build presentations of the given types for all fields of the given file.""" +#print "Import %s..." % theFileName.split('/')[-1], +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" +# Get viewScalarMap +aView = GetRenderView() + +# Create required presentations for the proxy +# CreatePrsForProxy(aProxy, aView, thePrsTypeList, thePictureDir, thePictureExt, theIsAutoDelete) +aFieldNames = aProxy.PointArrays.GetData() +aNbOnNodes = len(aFieldNames) +aFieldNames.extend(aProxy.CellArrays.GetData()) +aTimeStamps = aProxy.TimestepValues.GetData() +aFieldEntity = EntityType.NODE +aFieldName = "MODES_DEPL" + +#create Cut Planes presentations for 10 timestamps +for i in range(1,11): + hide_all(aView, True) + aPrs = CutPlanesOnField(aProxy, aFieldEntity,aFieldName , i) + if aPrs is None: + raise RuntimeError, "Presentation is None!!!" + #display only current scalar map + aPrs.Visibility=1 + reset_view(aView) + Render(aView) + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + prs_type = PrsTypeEnum.CUTPLANES + + # Get name of presentation type + prs_name = PrsTypeEnum.get_name(prs_type) + f_prs_type = prs_name.replace(' ', '').upper() + # Construct image file name + pic_name = picturedir + aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext + + # Show and record the presentation + process_prs_for_test(aPrs, aView, pic_name) + + diff --git a/test/VisuPrs/DeformedShape/A0.py b/test/VisuPrs/DeformedShape/A0.py new file mode 100644 index 00000000..c8ee8161 --- /dev/null +++ b/test/VisuPrs/DeformedShape/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A1.py b/test/VisuPrs/DeformedShape/A1.py new file mode 100644 index 00000000..85bfdf09 --- /dev/null +++ b/test/VisuPrs/DeformedShape/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A2.py b/test/VisuPrs/DeformedShape/A2.py new file mode 100755 index 00000000..7e560392 --- /dev/null +++ b/test/VisuPrs/DeformedShape/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A3.py b/test/VisuPrs/DeformedShape/A3.py new file mode 100755 index 00000000..287ed102 --- /dev/null +++ b/test/VisuPrs/DeformedShape/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A4.py b/test/VisuPrs/DeformedShape/A4.py new file mode 100755 index 00000000..fa54b110 --- /dev/null +++ b/test/VisuPrs/DeformedShape/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A5.py b/test/VisuPrs/DeformedShape/A5.py new file mode 100644 index 00000000..408a21d5 --- /dev/null +++ b/test/VisuPrs/DeformedShape/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A6.py b/test/VisuPrs/DeformedShape/A6.py new file mode 100755 index 00000000..b74869e1 --- /dev/null +++ b/test/VisuPrs/DeformedShape/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A7.py b/test/VisuPrs/DeformedShape/A7.py new file mode 100644 index 00000000..46faef40 --- /dev/null +++ b/test/VisuPrs/DeformedShape/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A8.py b/test/VisuPrs/DeformedShape/A8.py new file mode 100644 index 00000000..f874716b --- /dev/null +++ b/test/VisuPrs/DeformedShape/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/A9.py b/test/VisuPrs/DeformedShape/A9.py new file mode 100644 index 00000000..580667ca --- /dev/null +++ b/test/VisuPrs/DeformedShape/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/B0.py b/test/VisuPrs/DeformedShape/B0.py new file mode 100644 index 00000000..74006bf9 --- /dev/null +++ b/test/VisuPrs/DeformedShape/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/B1.py b/test/VisuPrs/DeformedShape/B1.py new file mode 100644 index 00000000..dbd7c9c5 --- /dev/null +++ b/test/VisuPrs/DeformedShape/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/B2.py b/test/VisuPrs/DeformedShape/B2.py new file mode 100644 index 00000000..6463063b --- /dev/null +++ b/test/VisuPrs/DeformedShape/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/B3.py b/test/VisuPrs/DeformedShape/B3.py new file mode 100755 index 00000000..d4f856fb --- /dev/null +++ b/test/VisuPrs/DeformedShape/B3.py @@ -0,0 +1,111 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B3 case + +from paravistest import datadir +from presentations import DeformedShapeOnField, EntityType +import paravis +import pvsimple + + +my_paravis = paravis.myParavis + +#====================Stage1: Import from MED file in ParaVis============ +print "**** Stage1: Import from MED file in ParaVis" + +print 'Import "Tria3.med"....................', + +file_path = datadir + "Tria3.med" +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +#====================Stage2: Creating Deformed Shape==================== +print "**** Stage2: Creating Deformed Shape" + +print "Creating Deformed Shape...............", + +cell_entity = EntityType.CELL +field_name = 'vectoriel_field' +defshape = DeformedShapeOnField(med_reader, cell_entity, field_name, 1) +pvsimple.ResetCamera() + +if defshape is None: + print "FAILED" +else: + print "OK" + +#====================Stage3: Scale of Deformed Shape==================== +print "**** Stage3: Scale of Deformed Shape" + +warp_vector = pvsimple.GetActiveSource() +print "Default scale: ", warp_vector.ScaleFactor + +print "Set positive scale of Deformed Shape" +scale = 1 +warp_vector.ScaleFactor = scale + +pvsimple.Render() +print "Scale: ", warp_vector.ScaleFactor + +print "Set negative scale of Deformed Shape" +scale = -1 +warp_vector.ScaleFactor = scale + +pvsimple.Render() +print "Scale: ", warp_vector.ScaleFactor + +print "Set zero scale of Deformed Shape" +scale = 0 +warp_vector.ScaleFactor = scale + +pvsimple.Render() +print "Scale: ", warp_vector.ScaleFactor + +#====================Stage4: Coloring method of Deformed Shape=========== +print "**** Stage4: Coloring of Deformed Shape" + +color_array = defshape.ColorArrayName +if color_array: + print "Default shape is colored by array: ", color_array +else: + print "Default shape is colored by solid color: ", defshape.AmbientColor + +print "Set colored by array mode .... ", +defshape.ColorArrayName = field_name +pvsimple.Render() + +if defshape.ColorArrayName == field_name: + print "OK" +else: + print "FAILED" + +print "Set colored by solid color mode .... ", +defshape.ColorArrayName = '' +pvsimple.Render() + +if defshape.ColorArrayName: + print "FAILED" +else: + print "OK" diff --git a/test/VisuPrs/DeformedShape/B4.py b/test/VisuPrs/DeformedShape/B4.py new file mode 100644 index 00000000..d8e9ead0 --- /dev/null +++ b/test/VisuPrs/DeformedShape/B4.py @@ -0,0 +1,102 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B4 case + +from paravistest import datadir +from presentations import DeformedShapeOnField, EntityType +import paravis +import pvsimple + + +my_paravis = paravis.myParavis + +#====================Stage1: Import from MED file in ParaVis============ +print "**** Stage1: Import from MED file in ParaVis" + +print 'Import "Hexa8.med"....................', + +file_path = datadir + "Hexa8.med" +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +#====================Stage2: Creating Deformed Shape==================== +print "**** Stage2: Creating Deformed Shape" + +print "Creating Deformed Shape...............", + +cell_entity = EntityType.CELL +field_name = 'vectoriel_field' +defshape = DeformedShapeOnField(med_reader, cell_entity, field_name, 1) +pvsimple.ResetCamera() + +if defshape is None: + print "FAILED" +else: + print "OK" + +#====================Stage3: Color of Deformed Shape==================== +print "**** Stage3: Color of Deformed Shape" + +# Step1 +print "Getting the current color of Deformed Shape in RGB ... ", +color = defshape.AmbientColor +print color + +# Step2 +print "Set the positive color in RGB" +color = [0.3, 0.3, 0.3] +defshape.AmbientColor = color +pvsimple.Render() + +color = defshape.AmbientColor +print "Color: ", color + +# Step3 +print "Set the negative R and positive GB" +color = [-0.3, 0.3, 0.3] +defshape.AmbientColor = color +pvsimple.Render() + +color = defshape.AmbientColor +print "Color: ", color + +# Step4 +print "Set the negative R and positive GB" +color = [0.3, -0.3, 0.3] +defshape.AmbientColor = color +pvsimple.Render() + +color = defshape.AmbientColor +print "Color: ", color + +# Step5 +print "Set the negative B and positive RG" +print "Set the negative R and positive GB" +color = [0.3, 0.3, -0.3] +defshape.AmbientColor = color +pvsimple.Render() + +color = defshape.AmbientColor +print "Color: ", color diff --git a/test/VisuPrs/DeformedShape/CMakeLists.txt b/test/VisuPrs/DeformedShape/CMakeLists.txt new file mode 100644 index 00000000..a064d534 --- /dev/null +++ b/test/VisuPrs/DeformedShape/CMakeLists.txt @@ -0,0 +1,61 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + 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 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + ) + ADD_TEST(DEFORMEDSHAPE_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(DEFORMEDSHAPE_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/DeformedShape/E0.py b/test/VisuPrs/DeformedShape/E0.py new file mode 100644 index 00000000..8acd6843 --- /dev/null +++ b/test/VisuPrs/DeformedShape/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E1.py b/test/VisuPrs/DeformedShape/E1.py new file mode 100644 index 00000000..8163b6f0 --- /dev/null +++ b/test/VisuPrs/DeformedShape/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E2.py b/test/VisuPrs/DeformedShape/E2.py new file mode 100644 index 00000000..a61a31da --- /dev/null +++ b/test/VisuPrs/DeformedShape/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E3.py b/test/VisuPrs/DeformedShape/E3.py new file mode 100755 index 00000000..d1aac7ce --- /dev/null +++ b/test/VisuPrs/DeformedShape/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E4.py b/test/VisuPrs/DeformedShape/E4.py new file mode 100644 index 00000000..459775a2 --- /dev/null +++ b/test/VisuPrs/DeformedShape/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E5.py b/test/VisuPrs/DeformedShape/E5.py new file mode 100644 index 00000000..a315a766 --- /dev/null +++ b/test/VisuPrs/DeformedShape/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E6.py b/test/VisuPrs/DeformedShape/E6.py new file mode 100644 index 00000000..6929c360 --- /dev/null +++ b/test/VisuPrs/DeformedShape/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E7.py b/test/VisuPrs/DeformedShape/E7.py new file mode 100644 index 00000000..82598377 --- /dev/null +++ b/test/VisuPrs/DeformedShape/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E8.py b/test/VisuPrs/DeformedShape/E8.py new file mode 100644 index 00000000..e05b5ac2 --- /dev/null +++ b/test/VisuPrs/DeformedShape/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/E9.py b/test/VisuPrs/DeformedShape/E9.py new file mode 100644 index 00000000..a4729d4e --- /dev/null +++ b/test/VisuPrs/DeformedShape/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F0.py b/test/VisuPrs/DeformedShape/F0.py new file mode 100755 index 00000000..470606d1 --- /dev/null +++ b/test/VisuPrs/DeformedShape/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F1.py b/test/VisuPrs/DeformedShape/F1.py new file mode 100644 index 00000000..04321fff --- /dev/null +++ b/test/VisuPrs/DeformedShape/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F2.py b/test/VisuPrs/DeformedShape/F2.py new file mode 100644 index 00000000..89e84149 --- /dev/null +++ b/test/VisuPrs/DeformedShape/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F3.py b/test/VisuPrs/DeformedShape/F3.py new file mode 100644 index 00000000..f49fb0dc --- /dev/null +++ b/test/VisuPrs/DeformedShape/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F4.py b/test/VisuPrs/DeformedShape/F4.py new file mode 100644 index 00000000..ef95fd44 --- /dev/null +++ b/test/VisuPrs/DeformedShape/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F5.py b/test/VisuPrs/DeformedShape/F5.py new file mode 100644 index 00000000..34d5eb7c --- /dev/null +++ b/test/VisuPrs/DeformedShape/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F6.py b/test/VisuPrs/DeformedShape/F6.py new file mode 100644 index 00000000..4e65cebb --- /dev/null +++ b/test/VisuPrs/DeformedShape/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F7.py b/test/VisuPrs/DeformedShape/F7.py new file mode 100755 index 00000000..0de103f2 --- /dev/null +++ b/test/VisuPrs/DeformedShape/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F8.py b/test/VisuPrs/DeformedShape/F8.py new file mode 100644 index 00000000..8ad6d2de --- /dev/null +++ b/test/VisuPrs/DeformedShape/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"DeformedShape/F8") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPE], picturedir, pictureext) diff --git a/test/VisuPrs/DeformedShape/F9.py b/test/VisuPrs/DeformedShape/F9.py new file mode 100644 index 00000000..7c6fc4e1 --- /dev/null +++ b/test/VisuPrs/DeformedShape/F9.py @@ -0,0 +1,86 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 case +# Create Deformed Shape for field of the the given MED file for 10 timestamps% + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis + +picturedir = get_picture_dir(sys.argv[1], "DeformedShape/F9") + +theFileName = datadir + "Bug829_resu_mode.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +"""Build presentations of the given types for all fields of the given file.""" +#print "Import %s..." % theFileName.split('/')[-1], +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" +# Get view +aView = GetRenderView() + +# Create required presentations for the proxy +# CreatePrsForProxy(aProxy, aView, thePrsTypeList, thePictureDir, thePictureExt, theIsAutoDelete) +aFieldNames = aProxy.PointArrays.GetData() +aNbOnNodes = len(aFieldNames) +aFieldNames.extend(aProxy.CellArrays.GetData()) +aTimeStamps = aProxy.TimestepValues.GetData() +aFieldEntity = EntityType.NODE +aFieldName = "MODES_DEPL" + +#Creation of a set of non-colored and then colored Deformed Shapes, based on time stamps of MODES_DEP field +for colored in [False,True]: + colored_str = "_non-colored" + if colored: + colored_str = "_colored" + for i in range(1,11): + hide_all(aView, True) + aPrs = DeformedShapeOnField(aProxy, aFieldEntity, aFieldName, i, is_colored=colored) + if aPrs is None: + raise RuntimeError, "Presentation is None!!!" + # display only current deformed shape + #display_only(aView,aPrs) + aPrs.Visibility =1 + + reset_view(aView) + Render(aView) + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + prs_type = PrsTypeEnum.DEFORMEDSHAPE + + # Get name of presentation type + prs_name = PrsTypeEnum.get_name(prs_type) + f_prs_type = prs_name.replace(' ', '').upper() + # Construct image file name + pic_name = picturedir + aFieldName+colored_str + "_" + str(i) + "_" + f_prs_type + "." + pictureext + + # Show and record the presentation + process_prs_for_test(aPrs, aView, pic_name) diff --git a/test/VisuPrs/GaussPoints/A0.py b/test/VisuPrs/GaussPoints/A0.py new file mode 100644 index 00000000..ef08a966 --- /dev/null +++ b/test/VisuPrs/GaussPoints/A0.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A0") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "hexa_28320_ELEM.med" +field_name = "pression_elem_dom_pb1" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/A1.py b/test/VisuPrs/GaussPoints/A1.py new file mode 100644 index 00000000..3903ee49 --- /dev/null +++ b/test/VisuPrs/GaussPoints/A1.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A1") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "pointe.med" +field_name = "fieldcelldouble" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/A2.py b/test/VisuPrs/GaussPoints/A2.py new file mode 100644 index 00000000..82fb7ba4 --- /dev/null +++ b/test/VisuPrs/GaussPoints/A2.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A2") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "Fields_group3D.med" +field_name = "scalar_field" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/A3.py b/test/VisuPrs/GaussPoints/A3.py new file mode 100644 index 00000000..8471553a --- /dev/null +++ b/test/VisuPrs/GaussPoints/A3.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A3") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "Hexa8.med" +field_name = "scalar_field" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/A4.py b/test/VisuPrs/GaussPoints/A4.py new file mode 100644 index 00000000..8a5e3c49 --- /dev/null +++ b/test/VisuPrs/GaussPoints/A4.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A4") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "Penta6.med" +field_name = "scalar_field" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/A5.py b/test/VisuPrs/GaussPoints/A5.py new file mode 100644 index 00000000..073ca8e3 --- /dev/null +++ b/test/VisuPrs/GaussPoints/A5.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A5") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "Tetra4.med" +field_name = "scalar_field" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/A6.py b/test/VisuPrs/GaussPoints/A6.py new file mode 100644 index 00000000..871d9b98 --- /dev/null +++ b/test/VisuPrs/GaussPoints/A6.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A6") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "Tria3.med" +field_name = "scalar_field" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/A7.py b/test/VisuPrs/GaussPoints/A7.py new file mode 100644 index 00000000..7e6d92e6 --- /dev/null +++ b/test/VisuPrs/GaussPoints/A7.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A7") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "Quad4.med" +field_name = "scalar_field" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/A9.py b/test/VisuPrs/GaussPoints/A9.py new file mode 100644 index 00000000..597965b1 --- /dev/null +++ b/test/VisuPrs/GaussPoints/A9.py @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/A9") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "carre_en_quad4_seg2_fields.med" +field_name = "AREA" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B0.py b/test/VisuPrs/GaussPoints/B0.py new file mode 100644 index 00000000..98c0b75a --- /dev/null +++ b/test/VisuPrs/GaussPoints/B0.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B0") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "cube_hexa8_quad4.med" +field_name = "fieldcelldouble" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B1.py b/test/VisuPrs/GaussPoints/B1.py new file mode 100644 index 00000000..f6282068 --- /dev/null +++ b/test/VisuPrs/GaussPoints/B1.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B1") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "test_55_solid_concentr_dom.med" +field_name = "RN_precipite_restr" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B2.py b/test/VisuPrs/GaussPoints/B2.py new file mode 100644 index 00000000..062e8ab2 --- /dev/null +++ b/test/VisuPrs/GaussPoints/B2.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B2") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "H_COUPLEX1.med" +field_name = "Head" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B3.py b/test/VisuPrs/GaussPoints/B3.py new file mode 100644 index 00000000..ec592cf4 --- /dev/null +++ b/test/VisuPrs/GaussPoints/B3.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B3 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B3") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "cas2_2d_couplage_chess_castem.med" +field_name = "pH" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B4.py b/test/VisuPrs/GaussPoints/B4.py new file mode 100644 index 00000000..5a9c659f --- /dev/null +++ b/test/VisuPrs/GaussPoints/B4.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B4 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B4") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "champc.med" +field_name = "Am241_restriction" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B5.py b/test/VisuPrs/GaussPoints/B5.py new file mode 100644 index 00000000..0054210a --- /dev/null +++ b/test/VisuPrs/GaussPoints/B5.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B5 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B5") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "hydro_sea_alv.med" +field_name = "Head" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B6.py b/test/VisuPrs/GaussPoints/B6.py new file mode 100644 index 00000000..41dbb12c --- /dev/null +++ b/test/VisuPrs/GaussPoints/B6.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B6 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B6") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "toto.med" +field_name = "erreur" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B7.py b/test/VisuPrs/GaussPoints/B7.py new file mode 100644 index 00000000..3869ef5c --- /dev/null +++ b/test/VisuPrs/GaussPoints/B7.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B7 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B7") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "couplex_alain.med" +field_name = "Conc._I129" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B8.py b/test/VisuPrs/GaussPoints/B8.py new file mode 100644 index 00000000..bea3680e --- /dev/null +++ b/test/VisuPrs/GaussPoints/B8.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B8 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B8") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "KCOUPLEX1.med" +field_name = "Head" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/B9.py b/test/VisuPrs/GaussPoints/B9.py new file mode 100644 index 00000000..115250ee --- /dev/null +++ b/test/VisuPrs/GaussPoints/B9.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B9 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/B9") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "test_hydro.med" +field_name = "Head" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/C0.py b/test/VisuPrs/GaussPoints/C0.py new file mode 100644 index 00000000..da1f38bf --- /dev/null +++ b/test/VisuPrs/GaussPoints/C0.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/C0 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/C0") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "ml.med" +field_name = "head_restriction" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/C1.py b/test/VisuPrs/GaussPoints/C1.py new file mode 100644 index 00000000..78a874f2 --- /dev/null +++ b/test/VisuPrs/GaussPoints/C1.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/C1 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/C1") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "T_COUPLEX1.med" +field_name = "Conc._I129" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/C2.py b/test/VisuPrs/GaussPoints/C2.py new file mode 100644 index 00000000..de855445 --- /dev/null +++ b/test/VisuPrs/GaussPoints/C2.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/C2 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/C2") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "test_hydro_darcy4_out.med" +field_name = "DarcyVelocity" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/C3.py b/test/VisuPrs/GaussPoints/C3.py new file mode 100644 index 00000000..a14dd3ec --- /dev/null +++ b/test/VisuPrs/GaussPoints/C3.py @@ -0,0 +1,57 @@ +# Copyright (C) 2010-2012 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. +# +# 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/C3 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/C3") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "UO2_250ans.med" +field_name = "Concentration_O2(aq)_mol_per_l" +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) +if prs is None: + raise RuntimeError, "Created presentation is None!!!" + +# 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/C4.py b/test/VisuPrs/GaussPoints/C4.py new file mode 100644 index 00000000..46ebb230 --- /dev/null +++ b/test/VisuPrs/GaussPoints/C4.py @@ -0,0 +1,58 @@ +# Copyright (C) 2010-2012 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. +# +# 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/C4 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/C4") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.3.med" +field_names = ["REMEUN_ERRE_ELGA_NORE", "REMEZEROERRE_ELGA_NORE"] +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +view = pvsimple.GetRenderView() +time = get_time(med_reader, timestamp_nb) + +for field_name in field_names: + prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) + if prs is None: + raise RuntimeError, "Created presentation is None!!!" + + # Display presentation and get snapshot + pic_name = picturedir + field_name + "_" + str(time) + "_GAUSSPOINTS." + pictureext + process_prs_for_test(prs, view, pic_name) diff --git a/test/VisuPrs/GaussPoints/C5.py b/test/VisuPrs/GaussPoints/C5.py new file mode 100644 index 00000000..d0eb775b --- /dev/null +++ b/test/VisuPrs/GaussPoints/C5.py @@ -0,0 +1,61 @@ +# Copyright (C) 2010-2012 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. +# +# 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "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 + +paravis.myParavis.ImportFile(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/C6.py b/test/VisuPrs/GaussPoints/C6.py new file mode 100644 index 00000000..0c966679 --- /dev/null +++ b/test/VisuPrs/GaussPoints/C6.py @@ -0,0 +1,58 @@ +# Copyright (C) 2010-2012 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. +# +# 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/C4 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/C6") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.1.med" +field_names = ["REMEUN_ERRE_ELGA_NORE", "REMEZEROERRE_ELGA_NORE"] +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +view = pvsimple.GetRenderView() +time = get_time(med_reader, timestamp_nb) + +for field_name in field_names: + prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) + if prs is None: + raise RuntimeError, "Created presentation is None!!!" + + # Display presentation and get snapshot + pic_name = picturedir + field_name + "_" + str(time) + "_GAUSSPOINTS." + pictureext + process_prs_for_test(prs, view, pic_name) diff --git a/test/VisuPrs/GaussPoints/C7.py b/test/VisuPrs/GaussPoints/C7.py new file mode 100644 index 00000000..234f24ec --- /dev/null +++ b/test/VisuPrs/GaussPoints/C7.py @@ -0,0 +1,58 @@ +# Copyright (C) 2010-2012 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. +# +# 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/C4 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 paravis +import pvsimple + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "GaussPoints/C7") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +# MED file +file_name = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.2.med" +field_names = ["REMEUN_ERRE_ELGA_NORE", "REMEZEROERRE_ELGA_NORE"] +timestamp_nb = 1 + +paravis.myParavis.ImportFile(file_name) +med_reader = pvsimple.GetActiveSource() +if med_reader is None: + raise RuntimeError("File wasn't imported!!!") + +# Create Gauss Points presentation +view = pvsimple.GetRenderView() +time = get_time(med_reader, timestamp_nb) + +for field_name in field_names: + prs = GaussPointsOnField(med_reader, EntityType.CELL, field_name, timestamp_nb) + if prs is None: + raise RuntimeError, "Created presentation is None!!!" + + # Display presentation and get snapshot + 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 new file mode 100644 index 00000000..c2c47daf --- /dev/null +++ b/test/VisuPrs/GaussPoints/CMakeLists.txt @@ -0,0 +1,53 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A9 + B0 + B1 + B2 + B3 + B4 + B5 + B6 + B7 + B8 + B9 + C0 + C1 + C2 + C3 + C4 + C5 + C6 + C7 + ) + ADD_TEST(GAUSSPOINTS_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(GAUSSPOINTS_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) \ No newline at end of file diff --git a/test/VisuPrs/IsoSurfaces/A0.py b/test/VisuPrs/IsoSurfaces/A0.py new file mode 100644 index 00000000..aa01e7a8 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A1.py b/test/VisuPrs/IsoSurfaces/A1.py new file mode 100755 index 00000000..644927ca --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A2.py b/test/VisuPrs/IsoSurfaces/A2.py new file mode 100755 index 00000000..b9a5db50 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A3.py b/test/VisuPrs/IsoSurfaces/A3.py new file mode 100755 index 00000000..610fc185 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A4.py b/test/VisuPrs/IsoSurfaces/A4.py new file mode 100755 index 00000000..530dce60 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A5.py b/test/VisuPrs/IsoSurfaces/A5.py new file mode 100755 index 00000000..04ba2cc5 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A6.py b/test/VisuPrs/IsoSurfaces/A6.py new file mode 100644 index 00000000..7116ba95 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A7.py b/test/VisuPrs/IsoSurfaces/A7.py new file mode 100755 index 00000000..74522f66 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A8.py b/test/VisuPrs/IsoSurfaces/A8.py new file mode 100755 index 00000000..c8401c8d --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/A9.py b/test/VisuPrs/IsoSurfaces/A9.py new file mode 100755 index 00000000..b7b19336 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/B0.py b/test/VisuPrs/IsoSurfaces/B0.py new file mode 100755 index 00000000..92ef0636 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/B1.py b/test/VisuPrs/IsoSurfaces/B1.py new file mode 100644 index 00000000..e26024c8 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/B2.py b/test/VisuPrs/IsoSurfaces/B2.py new file mode 100755 index 00000000..3f045b17 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/CMakeLists.txt b/test/VisuPrs/IsoSurfaces/CMakeLists.txt new file mode 100755 index 00000000..e8d266bd --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/CMakeLists.txt @@ -0,0 +1,62 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + G0 + G1 + G2 + ) + ADD_TEST(ISOSURFACES_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(ISOSURFACES_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/IsoSurfaces/E0.py b/test/VisuPrs/IsoSurfaces/E0.py new file mode 100755 index 00000000..001d7c67 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E1.py b/test/VisuPrs/IsoSurfaces/E1.py new file mode 100755 index 00000000..8f5b18a2 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E2.py b/test/VisuPrs/IsoSurfaces/E2.py new file mode 100755 index 00000000..a55cf7b6 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E3.py b/test/VisuPrs/IsoSurfaces/E3.py new file mode 100644 index 00000000..e2327158 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E4.py b/test/VisuPrs/IsoSurfaces/E4.py new file mode 100755 index 00000000..50a1266b --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E5.py b/test/VisuPrs/IsoSurfaces/E5.py new file mode 100755 index 00000000..4ad1bd13 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E6.py b/test/VisuPrs/IsoSurfaces/E6.py new file mode 100755 index 00000000..e6ba1732 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E7.py b/test/VisuPrs/IsoSurfaces/E7.py new file mode 100755 index 00000000..f4bbc061 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E8.py b/test/VisuPrs/IsoSurfaces/E8.py new file mode 100755 index 00000000..848cba60 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/E9.py b/test/VisuPrs/IsoSurfaces/E9.py new file mode 100644 index 00000000..5e22c3b4 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F0.py b/test/VisuPrs/IsoSurfaces/F0.py new file mode 100644 index 00000000..49a88130 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F1.py b/test/VisuPrs/IsoSurfaces/F1.py new file mode 100755 index 00000000..f112b17a --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F2.py b/test/VisuPrs/IsoSurfaces/F2.py new file mode 100755 index 00000000..0fa73792 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F3.py b/test/VisuPrs/IsoSurfaces/F3.py new file mode 100755 index 00000000..dc231dea --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F4.py b/test/VisuPrs/IsoSurfaces/F4.py new file mode 100755 index 00000000..eb2992fe --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F5.py b/test/VisuPrs/IsoSurfaces/F5.py new file mode 100755 index 00000000..0558db63 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F6.py b/test/VisuPrs/IsoSurfaces/F6.py new file mode 100755 index 00000000..7e58eb99 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F7.py b/test/VisuPrs/IsoSurfaces/F7.py new file mode 100644 index 00000000..67507a22 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F8.py b/test/VisuPrs/IsoSurfaces/F8.py new file mode 100755 index 00000000..70e8918f --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F8") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/F9.py b/test/VisuPrs/IsoSurfaces/F9.py new file mode 100644 index 00000000..60dcf900 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/F9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/F9") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/G0.py b/test/VisuPrs/IsoSurfaces/G0.py new file mode 100644 index 00000000..e97b3f8b --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/G0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/G0") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/G1.py b/test/VisuPrs/IsoSurfaces/G1.py new file mode 100755 index 00000000..0dcb8254 --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/G1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"IsoSurfaces/G1") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.ISOSURFACES], picturedir, pictureext) diff --git a/test/VisuPrs/IsoSurfaces/G2.py b/test/VisuPrs/IsoSurfaces/G2.py new file mode 100644 index 00000000..640a624a --- /dev/null +++ b/test/VisuPrs/IsoSurfaces/G2.py @@ -0,0 +1,82 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G2 case +# Create Iso surfaces for field of the the given MED file for 10 timestamps% + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "IsoSurfaces/G2") + +theFileName = datadir + "Bug829_resu_mode.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +"""Build presentations of the given types for all fields of the given file.""" +#print "Import %s..." % theFileName.split('/')[-1], +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" +# Get viewScalarMap +aView = GetRenderView() + +# Create required presentations for the proxy +# CreatePrsForProxy(aProxy, aView, thePrsTypeList, thePictureDir, thePictureExt, theIsAutoDelete) +aFieldNames = aProxy.PointArrays.GetData() +aNbOnNodes = len(aFieldNames) +aFieldNames.extend(aProxy.CellArrays.GetData()) +aTimeStamps = aProxy.TimestepValues.GetData() +aFieldEntity = EntityType.NODE +aFieldName = "MODES_DEPL" + +#create Iso Surfaces presentations for 10 timestamps +for i in range(1,11): + hide_all(aView, True) + aPrs = IsoSurfacesOnField(aProxy, aFieldEntity,aFieldName , i) + if aPrs is None: + raise RuntimeError, "Presentation is None!!!" + #display only current scalar map + aPrs.Visibility=1 + reset_view(aView) + Render(aView) + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + prs_type = PrsTypeEnum.ISOSURFACES + + # Get name of presentation type + prs_name = PrsTypeEnum.get_name(prs_type) + f_prs_type = prs_name.replace(' ', '').upper() + # Construct image file name + pic_name = picturedir + aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext + + # Show and record the presentation + process_prs_for_test(aPrs, aView, pic_name) + + diff --git a/test/VisuPrs/MeshPresentation/A0.py b/test/VisuPrs/MeshPresentation/A0.py new file mode 100644 index 00000000..18c9dc6b --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A1.py b/test/VisuPrs/MeshPresentation/A1.py new file mode 100644 index 00000000..e8a71ed2 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A2.py b/test/VisuPrs/MeshPresentation/A2.py new file mode 100644 index 00000000..58c380db --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A3.py b/test/VisuPrs/MeshPresentation/A3.py new file mode 100644 index 00000000..527a2690 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A4.py b/test/VisuPrs/MeshPresentation/A4.py new file mode 100644 index 00000000..5f4e156a --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A5.py b/test/VisuPrs/MeshPresentation/A5.py new file mode 100644 index 00000000..8e02792f --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A6.py b/test/VisuPrs/MeshPresentation/A6.py new file mode 100644 index 00000000..476822be --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A7.py b/test/VisuPrs/MeshPresentation/A7.py new file mode 100644 index 00000000..6a1a9502 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A8.py b/test/VisuPrs/MeshPresentation/A8.py new file mode 100644 index 00000000..c0c385f8 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/A9.py b/test/VisuPrs/MeshPresentation/A9.py new file mode 100644 index 00000000..5f423656 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/B0.py b/test/VisuPrs/MeshPresentation/B0.py new file mode 100644 index 00000000..4d6c09ec --- /dev/null +++ b/test/VisuPrs/MeshPresentation/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/B1.py b/test/VisuPrs/MeshPresentation/B1.py new file mode 100644 index 00000000..6115f140 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/B2.py b/test/VisuPrs/MeshPresentation/B2.py new file mode 100644 index 00000000..06352811 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/CMakeLists.txt b/test/VisuPrs/MeshPresentation/CMakeLists.txt new file mode 100644 index 00000000..1c8920c9 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/CMakeLists.txt @@ -0,0 +1,121 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + 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 + ) + ADD_TEST(MESH_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(MESH_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) + + + + + + + + + + + diff --git a/test/VisuPrs/MeshPresentation/E0.py b/test/VisuPrs/MeshPresentation/E0.py new file mode 100644 index 00000000..f5a0d71d --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E1.py b/test/VisuPrs/MeshPresentation/E1.py new file mode 100644 index 00000000..ffcf4c06 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E2.py b/test/VisuPrs/MeshPresentation/E2.py new file mode 100644 index 00000000..28b2cd93 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E3.py b/test/VisuPrs/MeshPresentation/E3.py new file mode 100644 index 00000000..0b59bf25 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E4.py b/test/VisuPrs/MeshPresentation/E4.py new file mode 100644 index 00000000..0ccebbeb --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E5.py b/test/VisuPrs/MeshPresentation/E5.py new file mode 100644 index 00000000..14eb7370 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E6.py b/test/VisuPrs/MeshPresentation/E6.py new file mode 100644 index 00000000..9ff51703 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E7.py b/test/VisuPrs/MeshPresentation/E7.py new file mode 100644 index 00000000..b364f202 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E8.py b/test/VisuPrs/MeshPresentation/E8.py new file mode 100644 index 00000000..4908176a --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/E9.py b/test/VisuPrs/MeshPresentation/E9.py new file mode 100644 index 00000000..fd1f89c8 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F0.py b/test/VisuPrs/MeshPresentation/F0.py new file mode 100644 index 00000000..39cac222 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F1.py b/test/VisuPrs/MeshPresentation/F1.py new file mode 100644 index 00000000..0cccc658 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F2.py b/test/VisuPrs/MeshPresentation/F2.py new file mode 100644 index 00000000..907c4836 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F3.py b/test/VisuPrs/MeshPresentation/F3.py new file mode 100644 index 00000000..242c93a3 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F4.py b/test/VisuPrs/MeshPresentation/F4.py new file mode 100644 index 00000000..10b8c71a --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F5.py b/test/VisuPrs/MeshPresentation/F5.py new file mode 100644 index 00000000..7f816349 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F6.py b/test/VisuPrs/MeshPresentation/F6.py new file mode 100644 index 00000000..cbdf11d7 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F7.py b/test/VisuPrs/MeshPresentation/F7.py new file mode 100644 index 00000000..2af29b81 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F8.py b/test/VisuPrs/MeshPresentation/F8.py new file mode 100644 index 00000000..233b6559 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F8") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/F9.py b/test/VisuPrs/MeshPresentation/F9.py new file mode 100644 index 00000000..36a15924 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/F9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/F9") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/G0.py b/test/VisuPrs/MeshPresentation/G0.py new file mode 100644 index 00000000..f4904282 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/G0") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/G1.py b/test/VisuPrs/MeshPresentation/G1.py new file mode 100644 index 00000000..2247ec19 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"MeshPresentation/G1") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.MESH], picturedir, pictureext) diff --git a/test/VisuPrs/MeshPresentation/G3.py b/test/VisuPrs/MeshPresentation/G3.py new file mode 100644 index 00000000..c802ba3d --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G3.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G3 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/G3") + +theFileName = datadir + "Box1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Box1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name, entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) diff --git a/test/VisuPrs/MeshPresentation/G4.py b/test/VisuPrs/MeshPresentation/G4.py new file mode 100644 index 00000000..ef1934e9 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G4.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G4 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/G4") + +theFileName = datadir + "Box1Moderate.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Box1Moderate" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/G5.py b/test/VisuPrs/MeshPresentation/G5.py new file mode 100644 index 00000000..cf480733 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G5.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G5 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/G5") + +theFileName = datadir + "Box2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Box2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/G6.py b/test/VisuPrs/MeshPresentation/G6.py new file mode 100644 index 00000000..94dd4015 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G6.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G6 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/G6") + +theFileName = datadir + "Box2Moderate.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Box2Moderate" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/G7.py b/test/VisuPrs/MeshPresentation/G7.py new file mode 100644 index 00000000..00d8224d --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G7.py @@ -0,0 +1,69 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G7 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/G7") + +theFileName = datadir + "Box3.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Box3" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) diff --git a/test/VisuPrs/MeshPresentation/G8.py b/test/VisuPrs/MeshPresentation/G8.py new file mode 100644 index 00000000..87d3aaef --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G8.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G8 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/G8") + +theFileName = datadir + "BoxEvenSmaller1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "BoxEvenSmaller1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/G9.py b/test/VisuPrs/MeshPresentation/G9.py new file mode 100644 index 00000000..f2ea31ed --- /dev/null +++ b/test/VisuPrs/MeshPresentation/G9.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G9 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/G9") + +theFileName = datadir + "BoxHexa1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "BoxHexa1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H0.py b/test/VisuPrs/MeshPresentation/H0.py new file mode 100644 index 00000000..f271f8b9 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H0.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H0 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H0") + +theFileName = datadir + "BoxHexa2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "BoxHexa2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H1.py b/test/VisuPrs/MeshPresentation/H1.py new file mode 100644 index 00000000..d2fd65c5 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H1.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H1 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H1") + +theFileName = datadir + "BoxModSmall1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "BoxModSmall1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H2.py b/test/VisuPrs/MeshPresentation/H2.py new file mode 100644 index 00000000..517b76ee --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H2.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H2 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H2") + +theFileName = datadir + "BoxModSmall2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "BoxModSmall2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H3.py b/test/VisuPrs/MeshPresentation/H3.py new file mode 100644 index 00000000..7398747e --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H3.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H3 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H3") + +theFileName = datadir + "BoxTetra2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "BoxTetra2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H4.py b/test/VisuPrs/MeshPresentation/H4.py new file mode 100644 index 00000000..e9ccfad9 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H4.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H4 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H4") + +theFileName = datadir + "ComplexIncludedTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "ComplexIncludedTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H5.py b/test/VisuPrs/MeshPresentation/H5.py new file mode 100644 index 00000000..49c67cf1 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H5.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H5 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H5") + +theFileName = datadir + "ComplexIncludingTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "ComplexIncludingTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H6.py b/test/VisuPrs/MeshPresentation/H6.py new file mode 100644 index 00000000..70f11482 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H6.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H6 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H6") + +theFileName = datadir + "CornerTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "CornerTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H7.py b/test/VisuPrs/MeshPresentation/H7.py new file mode 100644 index 00000000..fe31b08b --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H7.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H7 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H7") + +theFileName = datadir + "DegenEdgeXY.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "DegenEdgeXY" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H8.py b/test/VisuPrs/MeshPresentation/H8.py new file mode 100644 index 00000000..9188120b --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H8.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H8 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H8") + +theFileName = datadir + "DegenFaceXYZ.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "DegenFaceXYZ" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/H9.py b/test/VisuPrs/MeshPresentation/H9.py new file mode 100644 index 00000000..a9e17246 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/H9.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/H9 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/H9") + +theFileName = datadir + "DegenTranslatedInPlane.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "DegenTranslatedInPlane" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I0.py b/test/VisuPrs/MeshPresentation/I0.py new file mode 100644 index 00000000..5cf8d574 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I0.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I0 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I0") + +theFileName = datadir + "TinyBox.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "TinyBox" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I1.py b/test/VisuPrs/MeshPresentation/I1.py new file mode 100644 index 00000000..4806a517 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I1.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I1 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I1") + +theFileName = datadir + "TrickyTetra1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "TrickyTetra1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I2.py b/test/VisuPrs/MeshPresentation/I2.py new file mode 100644 index 00000000..bed99671 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I2.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I2 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I2") + +theFileName = datadir + "UnitTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "UnitTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I3.py b/test/VisuPrs/MeshPresentation/I3.py new file mode 100644 index 00000000..189a7845 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I3.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I3 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I3") + +theFileName = datadir + "UnitTetraDegenT.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "UnitTetraDegenT" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I4.py b/test/VisuPrs/MeshPresentation/I4.py new file mode 100644 index 00000000..59d8b1ba --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I4.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I4 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I4") + +theFileName = datadir + "square1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Mesh_2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I5.py b/test/VisuPrs/MeshPresentation/I5.py new file mode 100644 index 00000000..50ffac98 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I5.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I5 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I5") + +theFileName = datadir + "square1_split1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Mesh_2_1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I6.py b/test/VisuPrs/MeshPresentation/I6.py new file mode 100644 index 00000000..810baacd --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I6.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I6 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I6") + +theFileName = datadir + "square1_split2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Mesh_2_2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I7.py b/test/VisuPrs/MeshPresentation/I7.py new file mode 100644 index 00000000..28695257 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I7.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I7 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I7") + +theFileName = datadir + "square1_split3.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Mesh_2_3" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I8.py b/test/VisuPrs/MeshPresentation/I8.py new file mode 100644 index 00000000..9d5ff35c --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I8.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I8 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I8") + +theFileName = datadir + "square2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Mesh_3" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/I9.py b/test/VisuPrs/MeshPresentation/I9.py new file mode 100644 index 00000000..2bce1119 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/I9.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/I9 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/I9") + +theFileName = datadir + "square2_split1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Mesh_3_1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J0.py b/test/VisuPrs/MeshPresentation/J0.py new file mode 100644 index 00000000..ac85864c --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J0.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J0 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J0") + +theFileName = datadir + "DividedGenTetra1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "DividedGenTetra1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J1.py b/test/VisuPrs/MeshPresentation/J1.py new file mode 100644 index 00000000..bf2cb068 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J1.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J1 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J1") + +theFileName = datadir + "DividedGenTetra2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "DividedGenTetra2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J2.py b/test/VisuPrs/MeshPresentation/J2.py new file mode 100644 index 00000000..f7268f69 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J2.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J2 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J2") + +theFileName = datadir + "DividedUnitTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "DividedUnitTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J3.py b/test/VisuPrs/MeshPresentation/J3.py new file mode 100644 index 00000000..ec7e5460 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J3.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J3 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J3") + +theFileName = datadir + "DividedUnitTetraSimpler.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "DividedUnitTetraSimpler" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J4.py b/test/VisuPrs/MeshPresentation/J4.py new file mode 100644 index 00000000..4d70811b --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J4.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J4 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J4") + +theFileName = datadir + "GenTetra1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "GenTetra1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J5.py b/test/VisuPrs/MeshPresentation/J5.py new file mode 100644 index 00000000..747744fe --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J5.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J5 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J5") + +theFileName = datadir + "GenTetra2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "GenTetra2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J6.py b/test/VisuPrs/MeshPresentation/J6.py new file mode 100644 index 00000000..9a8d4646 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J6.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J6 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J6") + +theFileName = datadir + "GeneralTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "GeneralTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J7.py b/test/VisuPrs/MeshPresentation/J7.py new file mode 100644 index 00000000..48e0fc39 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J7.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J7 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J7") + +theFileName = datadir + "HalfstripOnly.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "HalfstripOnly" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J8.py b/test/VisuPrs/MeshPresentation/J8.py new file mode 100644 index 00000000..f4821787 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J8.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J8 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J8") + +theFileName = datadir + "HalfstripOnly2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "HalfstripOnly2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/J9.py b/test/VisuPrs/MeshPresentation/J9.py new file mode 100644 index 00000000..f773529e --- /dev/null +++ b/test/VisuPrs/MeshPresentation/J9.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/J9 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/J9") + +theFileName = datadir + "LargeInconsistentTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "LargeInconsistent" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K0.py b/test/VisuPrs/MeshPresentation/K0.py new file mode 100644 index 00000000..25b79ebf --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K0.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K0 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K0") + +theFileName = datadir + "LargeUnitTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "LargeUnitTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K1.py b/test/VisuPrs/MeshPresentation/K1.py new file mode 100644 index 00000000..e93bfd55 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K1.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K1 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K1") + +theFileName = datadir + "MovedHexaBox1.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "MovedHexaBox1" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K2.py b/test/VisuPrs/MeshPresentation/K2.py new file mode 100644 index 00000000..cfbb2538 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K2.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K2 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K2") + +theFileName = datadir + "MovedHexaBox2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "MovedHexaBox2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K3.py b/test/VisuPrs/MeshPresentation/K3.py new file mode 100644 index 00000000..5becca27 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K3.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K3 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K3") + +theFileName = datadir + "NudgedDividedUnitTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "NudgedDividedUnitTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K4.py b/test/VisuPrs/MeshPresentation/K4.py new file mode 100644 index 00000000..fb854863 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K4.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K4 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K4") + +theFileName = datadir + "NudgedDividedUnitTetraSimpler.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "NudgedDividedUnitTetraSimpler" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K5.py b/test/VisuPrs/MeshPresentation/K5.py new file mode 100644 index 00000000..b4349fd8 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K5.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K5 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K5") + +theFileName = datadir + "NudgedSimpler.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "NudgedSimpler" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K6.py b/test/VisuPrs/MeshPresentation/K6.py new file mode 100644 index 00000000..b098551d --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K6.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K6 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K6") + +theFileName = datadir + "NudgedTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "NudgedTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K7.py b/test/VisuPrs/MeshPresentation/K7.py new file mode 100644 index 00000000..1f984fbf --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K7.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K7 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K7") + +theFileName = datadir + "SimpleHalfstripOnly.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "SimpleHalfstripOnly" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K8.py b/test/VisuPrs/MeshPresentation/K8.py new file mode 100644 index 00000000..afc8bf7b --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K8.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K8 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K8") + +theFileName = datadir + "SimpleIncludedTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "SimpleIncludedTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/K9.py b/test/VisuPrs/MeshPresentation/K9.py new file mode 100644 index 00000000..5a0f76ca --- /dev/null +++ b/test/VisuPrs/MeshPresentation/K9.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/K9 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/K9") + +theFileName = datadir + "SimpleIncludingTetra.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "SimpleIncludingTetra" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/L0.py b/test/VisuPrs/MeshPresentation/L0.py new file mode 100644 index 00000000..a3459bc5 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/L0.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/L0 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/L0") + +theFileName = datadir + "square2_split2.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "Mesh_3_2" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/MeshPresentation/L1.py b/test/VisuPrs/MeshPresentation/L1.py new file mode 100644 index 00000000..08e382c8 --- /dev/null +++ b/test/VisuPrs/MeshPresentation/L1.py @@ -0,0 +1,72 @@ +# Copyright (C) 2010-2012 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. +# +# 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/L0 case +# Create mesh presentation for nodes and cells of the the given MED file + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis +picturedir = get_picture_dir(sys.argv[1], "MeshPresentation/L1") + +theFileName = datadir + "Bug829_resu_mode.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" + +aView = GetRenderView() + +#%Creation of the mesh presentation% +mesh_name = "MAIL" + +#^Presentation on "onNodes" and '"onCells" family^ +entity_types = [EntityType.NODE,EntityType.CELL] +for entity_type in entity_types: + entity_name = EntityType.get_name(entity_type) + mesh = MeshOnEntity(aProxy, mesh_name ,entity_type) + if mesh is None: + msg = "ERROR!!!Presentation of mesh on '"+entity_name+"' family wasn't created..." + raise RuntimeError, msg + mesh.Visibility=1 + reset_view(aView) + Render() + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + entity_name = EntityType.get_name(entity_type) + # Construct image file name + pic_name = picturedir + mesh_name + "_" + entity_name + "." + pictureext + + process_prs_for_test(mesh, aView, pic_name) + + + diff --git a/test/VisuPrs/Plot3D/A0.py b/test/VisuPrs/Plot3D/A0.py new file mode 100644 index 00000000..97076f4b --- /dev/null +++ b/test/VisuPrs/Plot3D/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A1.py b/test/VisuPrs/Plot3D/A1.py new file mode 100755 index 00000000..fffc6d85 --- /dev/null +++ b/test/VisuPrs/Plot3D/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A2.py b/test/VisuPrs/Plot3D/A2.py new file mode 100755 index 00000000..8b6228c5 --- /dev/null +++ b/test/VisuPrs/Plot3D/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A3.py b/test/VisuPrs/Plot3D/A3.py new file mode 100755 index 00000000..701fa6cc --- /dev/null +++ b/test/VisuPrs/Plot3D/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A4.py b/test/VisuPrs/Plot3D/A4.py new file mode 100755 index 00000000..378b2c36 --- /dev/null +++ b/test/VisuPrs/Plot3D/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A5.py b/test/VisuPrs/Plot3D/A5.py new file mode 100755 index 00000000..94d390cc --- /dev/null +++ b/test/VisuPrs/Plot3D/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A6.py b/test/VisuPrs/Plot3D/A6.py new file mode 100644 index 00000000..61a028a2 --- /dev/null +++ b/test/VisuPrs/Plot3D/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A7.py b/test/VisuPrs/Plot3D/A7.py new file mode 100755 index 00000000..27ff2b2a --- /dev/null +++ b/test/VisuPrs/Plot3D/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A8.py b/test/VisuPrs/Plot3D/A8.py new file mode 100755 index 00000000..0ea794d2 --- /dev/null +++ b/test/VisuPrs/Plot3D/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/A9.py b/test/VisuPrs/Plot3D/A9.py new file mode 100755 index 00000000..8a7a5f36 --- /dev/null +++ b/test/VisuPrs/Plot3D/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/B0.py b/test/VisuPrs/Plot3D/B0.py new file mode 100755 index 00000000..07eac92c --- /dev/null +++ b/test/VisuPrs/Plot3D/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/B1.py b/test/VisuPrs/Plot3D/B1.py new file mode 100755 index 00000000..1d7993a8 --- /dev/null +++ b/test/VisuPrs/Plot3D/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/B2.py b/test/VisuPrs/Plot3D/B2.py new file mode 100755 index 00000000..575b2620 --- /dev/null +++ b/test/VisuPrs/Plot3D/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/CMakeLists.txt b/test/VisuPrs/Plot3D/CMakeLists.txt new file mode 100755 index 00000000..40c6803d --- /dev/null +++ b/test/VisuPrs/Plot3D/CMakeLists.txt @@ -0,0 +1,62 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + G0 + G1 + G2 + ) + ADD_TEST(PLOT3D_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(PLOT3D_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/Plot3D/E0.py b/test/VisuPrs/Plot3D/E0.py new file mode 100755 index 00000000..70f64823 --- /dev/null +++ b/test/VisuPrs/Plot3D/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E1.py b/test/VisuPrs/Plot3D/E1.py new file mode 100755 index 00000000..60880bec --- /dev/null +++ b/test/VisuPrs/Plot3D/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E2.py b/test/VisuPrs/Plot3D/E2.py new file mode 100755 index 00000000..b8803ce6 --- /dev/null +++ b/test/VisuPrs/Plot3D/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E3.py b/test/VisuPrs/Plot3D/E3.py new file mode 100644 index 00000000..7afa6efa --- /dev/null +++ b/test/VisuPrs/Plot3D/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E4.py b/test/VisuPrs/Plot3D/E4.py new file mode 100755 index 00000000..06a23fbf --- /dev/null +++ b/test/VisuPrs/Plot3D/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E5.py b/test/VisuPrs/Plot3D/E5.py new file mode 100755 index 00000000..4da84505 --- /dev/null +++ b/test/VisuPrs/Plot3D/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E6.py b/test/VisuPrs/Plot3D/E6.py new file mode 100755 index 00000000..26f5ccd9 --- /dev/null +++ b/test/VisuPrs/Plot3D/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E7.py b/test/VisuPrs/Plot3D/E7.py new file mode 100755 index 00000000..b284ca2e --- /dev/null +++ b/test/VisuPrs/Plot3D/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E8.py b/test/VisuPrs/Plot3D/E8.py new file mode 100755 index 00000000..b268bc74 --- /dev/null +++ b/test/VisuPrs/Plot3D/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/E9.py b/test/VisuPrs/Plot3D/E9.py new file mode 100755 index 00000000..40bfb9bc --- /dev/null +++ b/test/VisuPrs/Plot3D/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F0.py b/test/VisuPrs/Plot3D/F0.py new file mode 100644 index 00000000..30c625c0 --- /dev/null +++ b/test/VisuPrs/Plot3D/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F1.py b/test/VisuPrs/Plot3D/F1.py new file mode 100755 index 00000000..e52c97a8 --- /dev/null +++ b/test/VisuPrs/Plot3D/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F2.py b/test/VisuPrs/Plot3D/F2.py new file mode 100755 index 00000000..22d7be41 --- /dev/null +++ b/test/VisuPrs/Plot3D/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F3.py b/test/VisuPrs/Plot3D/F3.py new file mode 100755 index 00000000..b4f3fef6 --- /dev/null +++ b/test/VisuPrs/Plot3D/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F4.py b/test/VisuPrs/Plot3D/F4.py new file mode 100755 index 00000000..4ecc75d3 --- /dev/null +++ b/test/VisuPrs/Plot3D/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F5.py b/test/VisuPrs/Plot3D/F5.py new file mode 100755 index 00000000..99970127 --- /dev/null +++ b/test/VisuPrs/Plot3D/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F6.py b/test/VisuPrs/Plot3D/F6.py new file mode 100755 index 00000000..1053f4df --- /dev/null +++ b/test/VisuPrs/Plot3D/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F7.py b/test/VisuPrs/Plot3D/F7.py new file mode 100644 index 00000000..ca745104 --- /dev/null +++ b/test/VisuPrs/Plot3D/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F8.py b/test/VisuPrs/Plot3D/F8.py new file mode 100755 index 00000000..4787e08a --- /dev/null +++ b/test/VisuPrs/Plot3D/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F8") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/F9.py b/test/VisuPrs/Plot3D/F9.py new file mode 100644 index 00000000..29369263 --- /dev/null +++ b/test/VisuPrs/Plot3D/F9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/F9") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/G0.py b/test/VisuPrs/Plot3D/G0.py new file mode 100644 index 00000000..d414ab99 --- /dev/null +++ b/test/VisuPrs/Plot3D/G0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/G0") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/G1.py b/test/VisuPrs/Plot3D/G1.py new file mode 100755 index 00000000..ec07e5f2 --- /dev/null +++ b/test/VisuPrs/Plot3D/G1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Plot3D/G1") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.PLOT3D], picturedir, pictureext) diff --git a/test/VisuPrs/Plot3D/G2.py b/test/VisuPrs/Plot3D/G2.py new file mode 100755 index 00000000..373d5787 --- /dev/null +++ b/test/VisuPrs/Plot3D/G2.py @@ -0,0 +1,81 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G2 case +# Create Plot 3D for field of the the given MED file for 10 timestamps% + +import sys +from paravistest import datadir, pictureext, get_picture_dir +from presentations import * +from pvsimple import * +import paravis + +# Create presentations +myParavis = paravis.myParavis + +picturedir = get_picture_dir(sys.argv[1], "Plot3D/G2") + +theFileName = datadir + "Bug829_resu_mode.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + + +#print "Import %s..." % theFileName.split('/')[-1], +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" +# Get viewScalarMap +aView = GetRenderView() + +aFieldNames = aProxy.PointArrays.GetData() +aNbOnNodes = len(aFieldNames) +aFieldNames.extend(aProxy.CellArrays.GetData()) +aTimeStamps = aProxy.TimestepValues.GetData() +aFieldEntity = EntityType.NODE +aFieldName = "MODES_DEPL" + +#create Plot 3D presentations for 10 timestamps +for i in range(1,11): + hide_all(aView, True) + aPrs = Plot3DOnField(aProxy, aFieldEntity,aFieldName , i) + if aPrs is None: + raise RuntimeError, "Presentation is None!!!" + #display only current scalar map + aPrs.Visibility=1 + reset_view(aView) + Render(aView) + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + prs_type = PrsTypeEnum.PLOT3D + + # Get name of presentation type + prs_name = PrsTypeEnum.get_name(prs_type) + f_prs_type = prs_name.replace(' ', '').upper() + # Construct image file name + pic_name = picturedir + aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext + + # Show and record the presentation + process_prs_for_test(aPrs, aView, pic_name) + + diff --git a/test/VisuPrs/SWIG_scripts/A1.py b/test/VisuPrs/SWIG_scripts/A1.py new file mode 100644 index 00000000..ce0389ec --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/A1.py @@ -0,0 +1,215 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/A1 case + +from paravistest import datadir +from presentations import * +import paravis +import pvsimple + + +my_paravis = paravis.myParavis + +#====================Stage1: Importing MED file==================== + +print "**** Stage1: Importing MED file" + +print 'Import "ResOK_0000.med"...............', +file_path = datadir + "ResOK_0000.med" +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +cell_entity = EntityType.CELL +node_entity = EntityType.NODE + +#====================Stage2: Displaying vector field=============== + +print "**** Stage3: Displaying vector field" + +print 'Get view...................', +view = pvsimple.GetRenderView() +if view is None: + print "FAILED" +else: + reset_view(view) + print "OK" + +print "Creating Scalar Map.......", +scalarmap = ScalarMapOnField(med_reader, node_entity, 'vitesse', 1) +if scalarmap is None: + print "FAILED" +else: + bar = get_bar() + bar.Orientation = 'Horizontal' + bar.Position = [0.1, 0.1] + bar.Position2 = [0.1, 0.25] + bar.AspectRatio = 3 + + display_only(scalarmap, view) + print "OK" + +view.ResetCamera() + +print "Creating Stream Lines.....", +streamlines = StreamLinesOnField(med_reader, node_entity, 'vitesse', 1) +if streamlines is None: + print "FAILED" +else: + display_only(streamlines, view) + print "OK" + +print "Creating Vectors..........", +vectors = VectorsOnField(med_reader, node_entity, 'vitesse', 1) +if vectors is None: + print "FAILED" +else: + display_only(vectors, view) + print "OK" + +print "Creating Iso Surfaces.....", +isosurfaces = IsoSurfacesOnField(med_reader, node_entity, 'vitesse', 1) +if isosurfaces is None: + print "FAILED" +else: + display_only(isosurfaces, view) + print "OK" + +print "Creating Cut Planes.......", +cutplanes = CutPlanesOnField(med_reader, node_entity, 'vitesse', 1, + nb_planes=30, orientation=Orientation.YZ) +if cutplanes is None: + print "FAILED" +else: + display_only(cutplanes, view) + print "OK" + +print "Creating Scalar Map On Deformed Shape.......", +scalarmapondefshape = DeformedShapeAndScalarMapOnField(med_reader, + node_entity, + 'vitesse', 2, + None, + cell_entity, + 'pression') +if scalarmapondefshape is None: + print "FAILED" +else: + display_only(scalarmapondefshape, view) + print "OK" + +#====================Stage3: Another Med file import==================== + +print 'Import "Fields_group3D.med"...............', +file_path = datadir + "Fields_group3D.med" +my_paravis.ImportFile(file_path) +med_reader1 = pvsimple.GetActiveSource() + +if med_reader1 is None: + print "FAILED" +else: + print "OK" + +#====================Stage4: Displaying scalar field==================== + +print "**** Stage4: Displaying scalar field" + +print "Creating Scalar Map.......", +scalarmap1 = ScalarMapOnField(med_reader1, cell_entity, 'scalar_field', 1) +if scalarmap1 is None: + print "FAILED" +else: + display_only(scalarmap1, view) + print "OK" + +view.ResetCamera() + +print "Creating Iso Surfaces.....", +isosurfaces1 = IsoSurfacesOnField(med_reader1, cell_entity, 'scalar_field', 1) +if isosurfaces1 is None: + print "FAILED" +else: + display_only(isosurfaces1, view) + print "OK" + +print "Creating Cut Planes.......", +cutplanes1 = CutPlanesOnField(med_reader1, cell_entity, 'scalar_field', 1, + orientation=Orientation.YZ) +if cutplanes1 is None: + print "FAILED" +else: + print "OK" + +slice_filter = pvsimple.GetActiveSource() +slice_filter.SliceType.Normal = [1.0, 0.0, 0.0] +display_only(cutplanes1, view) + +print "Creating Scalar Map On Deformed Shape.......", +scalarmapondefshape1 = DeformedShapeAndScalarMapOnField(med_reader1, + cell_entity, + 'vectoriel_field', 1) +if scalarmapondefshape1 is None: + print "FAILED" +else: + display_only(scalarmapondefshape1, view) + print "OK" + +#====================Stage5: Object browser popup==================== + +print "**** Stage5: Object browser popup" + +print "Creating mesh.............", + +mesh_name = 'mailles_MED' +mesh = MeshOnEntity(med_reader1, mesh_name, cell_entity) +if mesh is None: + print "FAILED" +else: + display_only(mesh, view) + print "OK" + +print "Changing type of presentation of mesh:" +mesh.Representation = 'Wireframe' +pvsimple.Render() +prs_type = mesh.Representation +print "Presentation type..", prs_type + +mesh.Representation = 'Points' +pvsimple.Render() +prs_type = mesh.Representation +print "Presentation type..", prs_type + +mesh.Representation = 'Surface' +pvsimple.Render() +prs_type = mesh.Representation +print "Presentation type..", prs_type + +shrink = pvsimple.Shrink(med_reader1) +mesh_shrinked = pvsimple.GetRepresentation(shrink) +display_only(mesh_shrinked, view) + +print "Changing color of mesh....", +color = [0, 0, 1] +mesh.DiffuseColor = color +display_only(mesh, view) +print "OK" diff --git a/test/VisuPrs/SWIG_scripts/A3.py b/test/VisuPrs/SWIG_scripts/A3.py new file mode 100644 index 00000000..9c7e10af --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/A3.py @@ -0,0 +1,70 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/A3 case + +from paravistest import datadir +from presentations import * +import paravis +import pvsimple + + +my_paravis = paravis.myParavis + +print 'Importing "TimeStamps.med"...............', +file_path = datadir + "TimeStamps.med" +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +print "Creating Cut Lines........................", +med_field = "vitesse" +cutlines = CutLinesOnField(med_reader, EntityType.NODE, med_field, 1, + nb_lines=20, + orientation1=Orientation.XY, + orientation2=Orientation.ZX) +if cutlines is None: + print "FAILED" +else: + print "OK" + +print "Getting a viewer.........................", +view = pvsimple.GetRenderView() +if view is None: + print "FAILED" +else: + reset_view(view) + print "OK" + +cutlines.Visibility = 1 +view.ResetCamera() +pvsimple.Render() + +print "Creating an Animation.....................", +scalarmap = ScalarMapOnField(med_reader, EntityType.NODE, med_field, 2) + +scene = pvsimple.AnimateReader(med_reader, view) +if scene is None: + print "FAILED" +else: + print "OK" diff --git a/test/VisuPrs/SWIG_scripts/A4.py b/test/VisuPrs/SWIG_scripts/A4.py new file mode 100644 index 00000000..4332c78d --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/A4.py @@ -0,0 +1,267 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/A4 case + +import math +import random +from time import sleep + +from paravistest import datadir +from presentations import * +import paravis +import pvsimple + + +DELAY = 0.25 + +my_paravis = paravis.myParavis + +# Get view +view = pvsimple.GetRenderView() +sleep(DELAY) + +# Destroy the view +pvsimple.Delete(view) + + +# Create view and set background +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [0, 0.3, 1] +view.Background = color +pvsimple.Render() + +# Import MED file +med_file = datadir + "pointe.med" +field_name = "fieldnodedouble" +entity = EntityType.NODE +timestamp = 1 + +my_paravis.ImportFile(med_file) +med_reader = pvsimple.GetActiveSource() + + +# Create scalar map +scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp) +print "ScalarMapOnField(...)" +pvsimple.Show(scalarmap.Input) + +# Set view properties +print "view.CameraFocalPoint = [0, 0, 0]" +view.CameraFocalPoint = [0, 0, 0] +print "view.CameraParallelScale = 2" +view.CameraParallelScale = 2 +print "pvsimple.ResetCamera(view)" +pvsimple.ResetCamera(view) + +# Play with scalar bar +bar = get_bar() +lt = bar.LookupTable + +range_min = lt.RGBPoints[0] +range_max = lt.RGBPoints[4] +delta = (range_max - range_min) / 2.0 +nb_colors = lt.NumberOfTableValues +nb_colors = 64 +lt.Discretize = 1 +for i in xrange(2, nb_colors): + lt.NumberOfTableValues = nb_colors + x = range_min + delta * i / nb_colors + y = range_max - delta * i / nb_colors + lt.RGBPoints[0] = x + lt.RGBPoints[4] = y + pvsimple.Render(view) + sleep(DELAY / 4.0) + +lt.RGBPoints[0] = range_min +lt.RGBPoints[4] = range_max + +print "pvsimple.ResetCamera(view)" +pvsimple.Render(view) +sleep(DELAY) + +# Destroy the view +print "Destroy the view with Scalar Map" +pvsimple.Delete(view) + + +# Create another view for cut planes +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [0, 0.7, 0] +view.Background = color +pvsimple.Render(view) + +displacement = 0.5 +orient = Orientation.YZ +cutplanes = CutPlanesOnField(med_reader, entity, field_name, timestamp, + orientation=orient, + displacement=displacement) +print "CutPlanesOnField(...)" + +display_only(cutplanes, view) +print "display_only(cutplanes, view)" + +cam_pos = view.CameraPosition +cam_pos[0] = cam_pos[0] + 10 +print "Set view.CameraPosition" +cutplanes.Scale[0] = 3 +cutplanes.Scale[1] = 10 +pvsimple.Render(view) +sleep(DELAY) + +pvsimple.ResetCamera(view) + +slice_filter = cutplanes.Input +offset_vals = slice_filter.SliceOffsetValues +nb_planes = len(offset_vals) +nb_planes = 30 +bounds = get_bounds(med_reader) +for i in xrange(nb_planes, 1, -1): + x = math.pi / 2.0 * (nb_planes - i) / nb_planes + y = math.pi / 2.0 * (nb_planes - i) / nb_planes + normal = get_normal_by_orientation(orient, x, y) + slice_filter.SliceType.Normal = normal + pos = get_positions(i, normal, bounds, displacement) + slice_filter.SliceOffsetValues = pos + pvsimple.Render(view) + sleep(DELAY) + +nb_planes = 10 +normal = [0, 1, 0] +slice_filter.SliceType.Normal = normal +for i in xrange(1, nb_planes): + pos = get_positions(i, normal, bounds, displacement) + slice_filter.SliceOffsetValues = pos + pvsimple.Render(view) + sleep(DELAY) + +slice_filter.SliceType.Normal = [0, 0, 1] +slice_filter.UpdatePipeline() +print "pvsimple.ResetCamera(view)" +pvsimple.ResetCamera(view) +sleep(DELAY) + +# Destroy the view +print "Destroy the view with Cut Planes" +pvsimple.Delete(view) + + +# Create one more view for isosurfaces +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [1, 0.7, 0] +view.Background = color +pvsimple.Render(view) +sleep(DELAY) + +isosurf = IsoSurfacesOnField(med_reader, entity, field_name, timestamp) +print "IsoSurfacesOnField(...)" +display_only(isosurf, view) +pvsimple.ResetCamera(view) +print "display_only(isosurf, view)" +sleep(DELAY) + +contour = isosurf.Input +nb_surfaces = len(contour.Isosurfaces) +nb_surfaces = 32 +scalar_range = get_data_range(med_reader, entity, field_name, cut_off=True) +for i in xrange(2, nb_surfaces): + contours = get_contours(scalar_range, i) + contour.Isosurfaces = contours + pvsimple.Render(view) + sleep(DELAY) + +contour.Isosurfaces = get_contours(scalar_range, 10) +contour.UpdatePipeline() +print "pvsimple.ResetCamera(view)" +pvsimple.ResetCamera(view) +sleep(DELAY) + +# Destroy the view +print "Destroy the view with Iso Surfaces" +pvsimple.Delete(view) + + +# Create one more view for cut lines +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [0.7, 0.7, 0.7] +view.Background = color +pvsimple.Render(view) +sleep(DELAY) + +cutlines, curves = CutLinesOnField(med_reader, entity, field_name, timestamp, + orientation1=Orientation.ZX, + orientation2=Orientation.YZ, + generate_curves=True) +print "CutLinesOnField(...)" +display_only(cutlines, view) +pvsimple.ResetCamera(view) +print "display_only(cutlines, view)" +sleep(DELAY) + +xy_view = pvsimple.CreateXYPlotView() +print "pvsimple.CreateXYPlotView()" +index = 0 +for curve in curves: + xyrep = pvsimple.Show(curve, xy_view) + xyrep.AttributeType = 'Point Data' + xyrep.UseIndexForXAxis = 0 + xyrep.XArrayName = 'arc_length' + pvsimple.Render(xy_view) + set_visible_lines(xyrep, [field_name]) + xyrep.SeriesLabel = [field_name, 'Y' + str(index)] + r = str(random.random()) + g = str(random.random()) + b = str(random.random()) + xyrep.SeriesColor = [field_name, r, g, b] + index += 1 + +pvsimple.Render(xy_view) +sleep(DELAY) + +# Destroy two views +#print "Destroy two views: with Cut Lines and the curves" +#pvsimple.Delete(view) +#pvsimple.Delete(xy_view) + +# Create one more view for animation +view = pvsimple.CreateRenderView() +reset_view(view) + +med_file = datadir + "TimeStamps.med" +field_name = "vitesse" +entity = EntityType.NODE +timestamp = 2 + +my_paravis.ImportFile(med_file) +med_reader = pvsimple.GetActiveSource() + +isosurf = IsoSurfacesOnField(med_reader, entity, field_name, timestamp) +print "IsoSurfacesOnField(...)" +pvsimple.ResetCamera(view) + +print "Start Animation" +pvsimple.AnimateReader(med_reader, view) diff --git a/test/VisuPrs/SWIG_scripts/A5.py b/test/VisuPrs/SWIG_scripts/A5.py new file mode 100644 index 00000000..19adc541 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/A5.py @@ -0,0 +1,82 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/A5 case +# Create table and display it as curves + +from paravistest import tablesdir +import paravis +import pvsimple + + +# Define script for table creation +script = """ +import math + + +# Get table output +table = self.GetTableOutput() + +nb_rows = 10 +nb_cols = 200 + +# Create first column +col1 = vtk.vtkDoubleArray() +col1.SetName('Frequency') +for i in xrange(0, nb_rows): + col1.InsertNextValue(i * 10 + 1) +table.AddColumn(col1) + +# Create the rest columns +for i in xrange(1, nb_cols + 1): + col = vtk.vtkDoubleArray() + col.SetName('Power ' + str(i)) + + # Fill the next column + for j in xrange(0, nb_rows): + if j % 2 == 1: + col.InsertNextValue(math.log10(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + else: + col.InsertNextValue(math.sin(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + + table.AddColumn(col) +""" + +# Creating programmable source (table) +ps = pvsimple.ProgrammableSource() +ps.OutputDataSetType = 'vtkTable' +ps.Script = script +pvsimple.RenameSource("Very useful data", ps) +ps.UpdatePipeline() + +# Display curves +cur_view = pvsimple.GetRenderView() +if cur_view: + pvsimple.Delete(cur_view) +xy_view = pvsimple.CreateXYPlotView() +xy_view.ChartTitle = 'Very useful data' +xy_view.AxisTitle = ['[ Wt ]', 'Frequency [ Hz ]'] + +xy_rep = pvsimple.Show(ps) +xy_rep.AttributeType = 'Row Data' +xy_rep.UseIndexForXAxis = 0 +xy_rep.XArrayName = 'Frequency' +xy_rep.SeriesVisibility = ['Frequency', '0'] + +pvsimple.Render() diff --git a/test/VisuPrs/SWIG_scripts/A6.py b/test/VisuPrs/SWIG_scripts/A6.py new file mode 100644 index 00000000..c780ead1 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/A6.py @@ -0,0 +1,51 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/A6 case +# Import a table from file and show it in 2D viewer + +from paravistest import tablesdir +from presentations import * +import paravis +import pvsimple + + +# Import table from CSV file +file_path = tablesdir + "sinus.csv" +sinus_csv = pvsimple.CSVReader(FileName=file_path) + +# Import settings +sinus_csv.DetectNumericColumns = 1 +sinus_csv.UseStringDelimiter = 1 +sinus_csv.FieldDelimiterCharacters = ' ' +sinus_csv.HaveHeaders = 1 + +# Display curve +cur_view = pvsimple.GetRenderView() +if cur_view: + pvsimple.Delete(cur_view) +xy_view = pvsimple.CreateXYPlotView() + +xy_rep = pvsimple.Show(sinus_csv) +xy_rep.AttributeType = 'Row Data' +xy_rep.UseIndexForXAxis = 0 +xy_rep.XArrayName = 'x' +xy_rep.SeriesVisibility = ['x', '0'] + +pvsimple.Render() diff --git a/test/VisuPrs/SWIG_scripts/A7.py b/test/VisuPrs/SWIG_scripts/A7.py new file mode 100644 index 00000000..1184992b --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/A7.py @@ -0,0 +1,172 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/A7 case + +import time + +from paravistest import datadir +from presentations import * +import paravis +import pvsimple + + +my_paravis = paravis.myParavis +view = pvsimple.GetRenderView() +reset_view(view) +delay = 1 + + +def after_set(error_string, prop_name, old_value, new_value): + print prop_name, ": old_value = ", old_value, "new_value = ", new_value + if error_string == "": + time.sleep(delay) + else: + print prop_name, " error = ", error_string + pass + pass + + +def change_representation(prs, repres, opacity, linew): + if prs is None: + print "FAILED" + return + else: + print "OK" + + display_only(prs, view) + view.ResetCamera() + + time.sleep(delay) + + old_prs_type = prs.Representation + if old_prs_type != repres: + err_str = '' + try: + prs.Representation = repres + except: + err_str = "Error" + after_set(err_str, "Representation", old_prs_type, repres) + pass + + old_opacity = prs.Opacity + if old_opacity != opacity: + err_str = '' + try: + prs.Opacity = opacity # double value [0, 1] + except: + err_str = "Error" + after_set(err_str, "Opacity", old_opacity, opacity) + pass + + old_linew = prs.LineWidth + if old_linew != linew: + err_str = '' + try: + prs.LineWidth = linew # double value, recommended round [1, 10] + except: + err_str = "Error" + after_set(err_str, "LineWidth", old_linew, linew) + pass + + print "" + pass + + +# ResOK_0000.med + +print 'Import "ResOK_0000.med"...............', +file_path = datadir + "ResOK_0000.med" +field_name = 'vitesse' +node_entity = EntityType.NODE + +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +print "Creating Scalar Map.......", +scmap = ScalarMapOnField(med_reader, node_entity, field_name, 1) +change_representation(scmap, 'Surface With Edges', 0.3, 5) + +print "Creating Stream Lines.......", +slines = StreamLinesOnField(med_reader, node_entity, field_name, 1) +change_representation(slines, 'Wireframe', 0.5, 3) + +print "Creating Vectors..........", +vec = VectorsOnField(med_reader, node_entity, field_name, 1) +change_representation(vec, 'Wireframe', 0.7, 2) + +print "Creating Iso Surfaces.....", +iso = IsoSurfacesOnField(med_reader, node_entity, field_name, 1) +change_representation(iso, 'Surface', 0.4, 8) + +print "Creating Cut Planes.......", +clines = CutPlanesOnField(med_reader, node_entity, field_name, 1) +change_representation(clines, 'Points', 0.6, 4) + + +# fra.med + +print 'Import "fra.med"...............', +file_path = datadir + "fra.med" +field_name = 'VITESSE' + +pvsimple.SetActiveSource(None) +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +print "Creating Scalar Map.......", +scmap = ScalarMapOnField(med_reader, node_entity, field_name, 1) +change_representation(scmap, 'Wireframe', 0.5, 3) + +print "Creating Iso Surfaces.....", +iso = IsoSurfacesOnField(med_reader, node_entity, field_name, 1) +change_representation(iso, 'Wireframe', 0.5, 3) + +print "Creating Cut Planes.......", +cplanes = CutPlanesOnField(med_reader, node_entity, field_name, 1) +change_representation(cplanes, 'Surface', 0.5, 3) + +print "Creating Scalar Map On Deformed Shape.......", +defmap = DeformedShapeAndScalarMapOnField(med_reader, node_entity, + field_name, 1) +change_representation(defmap, 'Surface', 0.5, 3) + +print "Creating Deformed Shape.......", +defshape = DeformedShapeOnField(med_reader, node_entity, field_name, 1) +defshape.ColorArrayName = field_name +change_representation(defshape, 'Wireframe', 0.5, 3) + +print "Creating Cut Lines.......", +clines = CutLinesOnField(med_reader, node_entity, field_name, 1) +change_representation(clines, 'Wireframe', 0.5, 3) + +print "Creating Plot 3D.......", +plot3d = Plot3DOnField(med_reader, node_entity, field_name, 1) +change_representation(plot3d, 'Surface', 0.5, 3) +change_representation(plot3d, 'Outline', 0.8, 2) diff --git a/test/VisuPrs/SWIG_scripts/A8.py b/test/VisuPrs/SWIG_scripts/A8.py new file mode 100644 index 00000000..ca57f12d --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/A8.py @@ -0,0 +1,65 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/A8 case +# Create table + +import paraview.simple as pv +import paraview.servermanager as sm + + +# Define script for table creation +script = """ +import math + + +# Get table output +table = self.GetTableOutput() + +nb_rows = 10 +nb_cols = 200 + +# Create first column +col1 = vtk.vtkDoubleArray() +col1.SetName('Frequency') +for i in xrange(0, nb_rows): + col1.InsertNextValue(i * 10 + 1) +table.AddColumn(col1) + +# Create the rest columns +for i in xrange(1, nb_cols + 1): + col = vtk.vtkDoubleArray() + col.SetName('Power ' + str(i)) + + # Fill the next column + for j in xrange(0, nb_rows): + if j % 2 == 1: + col.InsertNextValue(math.log10(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + else: + col.InsertNextValue(math.sin(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + + table.AddColumn(col) +""" + +# Creating programmable source (table) +ps = pv.ProgrammableSource() +ps.OutputDataSetType = 'vtkTable' +ps.Script = script +pv.RenameSource("Very useful data", ps) +ps.UpdatePipeline() diff --git a/test/VisuPrs/SWIG_scripts/A9.py b/test/VisuPrs/SWIG_scripts/A9.py new file mode 100644 index 00000000..19504e69 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/A9.py @@ -0,0 +1,280 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/A9 case +# Import MED file; create Scalar Map, Cut Planes, Cut Lines, +# Cut Segment, Iso Surfaces, Animation; display curves. + +import math +import random +from time import sleep + +from presentations import * + + +# Delay +DELAY = 0.25 + +# MED files and table directories +samples_dir = os.getenv("DATA_DIR") +datadir = None +tablesdir = None +if samples_dir is not None: + samples_dir = os.path.normpath(samples_dir) + datadir = samples_dir + "/MedFiles/" + tablesdir = samples_dir + "/Tables/" + +# Get view +view = pv.GetRenderView() +sleep(DELAY) + +# Destroy the view +pv.Delete(view) + + +# Create view and set background +view = pv.CreateRenderView() +reset_view(view) + +color = [0, 0.3, 1] +view.Background = color +pv.Render() + +# Load MED reader plugin +pv_root_dir = os.getenv("PARAVIS_ROOT_DIR") +pv.LoadPlugin(pv_root_dir + "/lib/paraview/libMedReaderPlugin.so") + +# Import MED file +med_file = datadir + "pointe.med" +field_name = "fieldnodedouble" +entity = EntityType.NODE +timestamp = 1 + +med_reader = pv.MEDReader(FileName=med_file) +med_reader.UpdatePipeline() + +# Create scalar map +scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp) +pv.Show(scalarmap.Input) + +# Set view properties +print "view.CameraFocalPoint = [0, 0, 0]" +view.CameraFocalPoint = [0, 0, 0] +print "view.CameraParallelScale = 2" +view.CameraParallelScale = 2 +print "pv.ResetCamera(view)" +pv.ResetCamera(view) + +# Play with scalar bar +bar = get_bar() +lt = bar.LookupTable + +range_min = lt.RGBPoints[0] +range_max = lt.RGBPoints[4] +delta = (range_max - range_min) / 2.0 +nb_colors = lt.NumberOfTableValues +nb_colors = 64 +lt.Discretize = 1 +for i in xrange(2, nb_colors): + lt.NumberOfTableValues = nb_colors + x = range_min + delta * i / nb_colors + y = range_max - delta * i / nb_colors + lt.RGBPoints[0] = x + lt.RGBPoints[4] = y + pv.Render(view) + sleep(DELAY / 4.0) + +lt.RGBPoints[0] = range_min +lt.RGBPoints[4] = range_max + +print "pv.ResetCamera(view)" +pv.ResetCamera(view) + +# Create another view for cut planes +view = pv.CreateRenderView() +reset_view(view) + +color = [0, 0.7, 0] +view.Background = color +pv.Render(view) + +displacement = 0.5 +orient = Orientation.YZ +cutplanes = CutPlanesOnField(med_reader, entity, field_name, timestamp, + orientation=orient, + displacement=displacement) +print "CutPlanesOnField(...)" + +display_only(cutplanes, view) +print "display_only(cutplanes, view)" + +cam_pos = view.CameraPosition +cam_pos[0] = cam_pos[0] + 10 +print "Set view.CameraPosition" +cutplanes.Scale[0] = 3 +cutplanes.Scale[1] = 10 +pv.Render(view) +sleep(DELAY) + +pv.ResetCamera(view) + +slice_filter = cutplanes.Input +offset_vals = slice_filter.SliceOffsetValues +nb_planes = len(offset_vals) +nb_planes = 30 +bounds = get_bounds(med_reader) +for i in xrange(nb_planes, 1, -1): + x = math.pi / 2.0 * (nb_planes - i) / nb_planes + y = math.pi / 2.0 * (nb_planes - i) / nb_planes + normal = get_normal_by_orientation(orient, x, y) + slice_filter.SliceType.Normal = normal + pos = get_positions(i, normal, bounds, displacement) + slice_filter.SliceOffsetValues = pos + pv.Render(view) + sleep(DELAY) + +nb_planes = 10 +normal = [0, 1, 0] +slice_filter.SliceType.Normal = normal +for i in xrange(1, nb_planes): + pos = get_positions(i, normal, bounds, displacement) + slice_filter.SliceOffsetValues = pos + pv.Render(view) + sleep(DELAY) + +slice_filter.SliceType.Normal = [0, 0, 1] +slice_filter.UpdatePipeline() +print "pv.ResetCamera(view)" +pv.ResetCamera(view) + +# Create one more view for iso surfaces +view = pv.CreateRenderView() +reset_view(view) + +color = [1, 0.7, 0] +view.Background = color +pv.Render(view) +sleep(DELAY) + +isosurf = IsoSurfacesOnField(med_reader, entity, field_name, timestamp) +display_only(isosurf, view) +pv.ResetCamera(view) +print "display_only(isosurf, view)" +sleep(DELAY) + +contour = isosurf.Input +nb_surfaces = len(contour.Isosurfaces) +nb_surfaces = 32 +scalar_range = get_data_range(med_reader, entity, field_name, cut_off=True) +for i in xrange(2, nb_surfaces): + contours = get_contours(scalar_range, i) + contour.Isosurfaces = contours + pv.Render(view) + sleep(DELAY) + +contour.Isosurfaces = get_contours(scalar_range, 10) +contour.UpdatePipeline() +print "pv.ResetCamera(view)" +pv.ResetCamera(view) + +# Create one more view for cut lines +view = pv.CreateRenderView() +reset_view(view) + +color = [0.7, 0.7, 0.7] +view.Background = color +pv.Render(view) +sleep(DELAY) + +cutlines, curves = CutLinesOnField(med_reader, entity, field_name, timestamp, + orientation1=Orientation.ZX, + orientation2=Orientation.YZ, + generate_curves=True) +print "CutLinesOnField(...)" +display_only(cutlines, view) +pv.ResetCamera(view) +print "display_only(cutlines, view)" +sleep(DELAY) + +xy_view = pv.CreateXYPlotView() +print "pv.CreateXYPlotView()" +index = 0 +for curve in curves: + xyrep = pv.Show(curve, xy_view) + xyrep.AttributeType = 'Point Data' + xyrep.UseIndexForXAxis = 0 + xyrep.XArrayName = 'arc_length' + pv.Render(xy_view) + set_visible_lines(xyrep, [field_name]) + xyrep.SeriesLabel = [field_name, 'Y' + str(index)] + r = str(random.random()) + g = str(random.random()) + b = str(random.random()) + xyrep.SeriesColor = [field_name, r, g, b] + index += 1 + +pv.Render(xy_view) +sleep(DELAY) + +# Create one more view for cut segment +view = pv.CreateRenderView() +reset_view(view) + +color = [0.0, 0.7, 0.3] +view.Background = color +pv.Render(view) +sleep(DELAY) + +point1 = [0.0, -1.0, 2.5] +point2 = [0.0, 1.0, 2.5] +cutsegment = CutSegmentOnField(med_reader, entity, field_name, timestamp, + point1, point2) +print "CutSegmentOnField(...)" +display_only(cutsegment, view) +pv.ResetCamera(view) +print "display_only(cutsegment, view)" +sleep(DELAY) + +xy_view = pv.CreateXYPlotView() +curve = pv.Show(cutsegment.Input, xy_view) +curve.AttributeType = 'Point Data' +curve.UseIndexForXAxis = 0 +curve.XArrayName = 'arc_length' +set_visible_lines(xyrep, [field_name]) + +pv.Render(xy_view) +sleep(DELAY) + + +# Create one more view for animation +view = pv.CreateRenderView() +reset_view(view) + +med_file = datadir + "TimeStamps.med" +field_name = "vitesse" +entity = EntityType.NODE +timestamp = 2 + +med_reader = pv.MEDReader(FileName=med_file) + +isosurf = IsoSurfacesOnField(med_reader, entity, field_name, timestamp) +pv.ResetCamera(view) + +print "Start Animation" +pv.AnimateReader(med_reader, view) diff --git a/test/VisuPrs/SWIG_scripts/B0.py b/test/VisuPrs/SWIG_scripts/B0.py new file mode 100644 index 00000000..9c7ff57e --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/B0.py @@ -0,0 +1,66 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/B0 case +# Create table + +from paravistest import tablesdir +import paravis +import pvsimple + + +# Define script for table creation +script = """ +import math + + +# Get table output +table = self.GetTableOutput() + +nb_rows = 10 +nb_cols = 200 + +# Create first column +col1 = vtk.vtkDoubleArray() +col1.SetName('Frequency') +for i in xrange(0, nb_rows): + col1.InsertNextValue(i * 10 + 1) +table.AddColumn(col1) + +# Create the rest columns +for i in xrange(1, nb_cols + 1): + col = vtk.vtkDoubleArray() + col.SetName('Power ' + str(i)) + + # Fill the next column + for j in xrange(0, nb_rows): + if j % 2 == 1: + col.InsertNextValue(math.log10(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + else: + col.InsertNextValue(math.sin(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + + table.AddColumn(col) +""" + +# Creating programmable source (table) +ps = pvsimple.ProgrammableSource() +ps.OutputDataSetType = 'vtkTable' +ps.Script = script +pvsimple.RenameSource("Very useful data", ps) +ps.UpdatePipeline() diff --git a/test/VisuPrs/SWIG_scripts/B1.py b/test/VisuPrs/SWIG_scripts/B1.py new file mode 100644 index 00000000..f8c5ff20 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/B1.py @@ -0,0 +1,299 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/B1 case + +import math +import random +from time import sleep + +from paravistest import datadir +from presentations import * +import paravis +import pvsimple + + +DELAY = 0.25 + +my_paravis = paravis.myParavis + +# Get view +view = pvsimple.GetRenderView() +sleep(DELAY) + +# Destroy the view +pvsimple.Delete(view) + + +# Create view and set background +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [0, 0.3, 1] +view.Background = color +pvsimple.Render() + +# Import MED file +med_file = datadir + "pointe.med" +field_name = "fieldnodedouble" +entity = EntityType.NODE +timestamp = 1 + +my_paravis.ImportFile(med_file) +med_reader = pvsimple.GetActiveSource() + + +# Create scalar map +scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp) +print "ScalarMapOnField(...)" +pvsimple.Show(scalarmap.Input) + +# Set view properties +print "view.CameraFocalPoint = [0, 0, 0]" +view.CameraFocalPoint = [0, 0, 0] +print "view.CameraParallelScale = 2" +view.CameraParallelScale = 2 +print "pvsimple.ResetCamera(view)" +pvsimple.ResetCamera(view) + +# Play with scalar bar +bar = get_bar() +lt = bar.LookupTable + +range_min = lt.RGBPoints[0] +range_max = lt.RGBPoints[4] +delta = (range_max - range_min) / 2.0 +nb_colors = lt.NumberOfTableValues +nb_colors = 64 +lt.Discretize = 1 +for i in xrange(2, nb_colors): + lt.NumberOfTableValues = nb_colors + x = range_min + delta * i / nb_colors + y = range_max - delta * i / nb_colors + lt.RGBPoints[0] = x + lt.RGBPoints[4] = y + pvsimple.Render(view) + sleep(DELAY / 4.0) + +lt.RGBPoints[0] = range_min +lt.RGBPoints[4] = range_max + +print "pvsimple.ResetCamera(view)" +pvsimple.Render(view) +sleep(DELAY) + +# Destroy the view +print "Destroy the view with Scalar Map" +pvsimple.Delete(view) + + +# Create another view for cut planes +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [0, 0.7, 0] +view.Background = color +pvsimple.Render(view) + +displacement = 0.5 +orient = Orientation.YZ +cutplanes = CutPlanesOnField(med_reader, entity, field_name, timestamp, + orientation=orient, + displacement=displacement) +print "CutPlanesOnField(...)" + +display_only(cutplanes, view) +print "display_only(cutplanes, view)" + +cam_pos = view.CameraPosition +cam_pos[0] = cam_pos[0] + 10 +print "Set view.CameraPosition" +cutplanes.Scale[0] = 3 +cutplanes.Scale[1] = 10 +pvsimple.Render(view) +sleep(DELAY) + +pvsimple.ResetCamera(view) + +slice_filter = cutplanes.Input +offset_vals = slice_filter.SliceOffsetValues +nb_planes = len(offset_vals) +nb_planes = 30 +bounds = get_bounds(med_reader) +for i in xrange(nb_planes, 1, -1): + x = math.pi / 2.0 * (nb_planes - i) / nb_planes + y = math.pi / 2.0 * (nb_planes - i) / nb_planes + normal = get_normal_by_orientation(orient, x, y) + slice_filter.SliceType.Normal = normal + pos = get_positions(i, normal, bounds, displacement) + slice_filter.SliceOffsetValues = pos + pvsimple.Render(view) + sleep(DELAY) + +nb_planes = 10 +normal = [0, 1, 0] +slice_filter.SliceType.Normal = normal +for i in xrange(1, nb_planes): + pos = get_positions(i, normal, bounds, displacement) + slice_filter.SliceOffsetValues = pos + pvsimple.Render(view) + sleep(DELAY) + +slice_filter.SliceType.Normal = [0, 0, 1] +slice_filter.UpdatePipeline() +print "pvsimple.ResetCamera(view)" +pvsimple.ResetCamera(view) +sleep(DELAY) + +# Destroy the view +print "Destroy the view with Cut Planes" +pvsimple.Delete(view) + + +# Create one more view for isosurfaces +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [1, 0.7, 0] +view.Background = color +pvsimple.Render(view) +sleep(DELAY) + +isosurf = IsoSurfacesOnField(med_reader, entity, field_name, timestamp) +print "IsoSurfacesOnField(...)" +display_only(isosurf, view) +pvsimple.ResetCamera(view) +print "display_only(isosurf, view)" +sleep(DELAY) + +contour = isosurf.Input +nb_surfaces = len(contour.Isosurfaces) +nb_surfaces = 32 +scalar_range = get_data_range(med_reader, entity, field_name, cut_off=True) +for i in xrange(2, nb_surfaces): + contours = get_contours(scalar_range, i) + contour.Isosurfaces = contours + pvsimple.Render(view) + sleep(DELAY) + +contour.Isosurfaces = get_contours(scalar_range, 10) +contour.UpdatePipeline() +print "pvsimple.ResetCamera(view)" +pvsimple.ResetCamera(view) +sleep(DELAY) + +# Destroy the view +print "Destroy the view with Iso Surfaces" +pvsimple.Delete(view) + + +# Create one more view for cut lines +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [0.7, 0.7, 0.7] +view.Background = color +pvsimple.Render(view) +sleep(DELAY) + +cutlines, curves = CutLinesOnField(med_reader, entity, field_name, timestamp, + orientation1=Orientation.ZX, + orientation2=Orientation.YZ, + generate_curves=True) +print "CutLinesOnField(...)" +display_only(cutlines, view) +pvsimple.ResetCamera(view) +print "display_only(cutlines, view)" +sleep(DELAY) + +xy_view = pvsimple.CreateXYPlotView() +print "pvsimple.CreateXYPlotView()" +index = 0 +for curve in curves: + xyrep = pvsimple.Show(curve, xy_view) + xyrep.AttributeType = 'Point Data' + xyrep.UseIndexForXAxis = 0 + xyrep.XArrayName = 'arc_length' + pvsimple.Render(xy_view) + set_visible_lines(xyrep, [field_name]) + xyrep.SeriesLabel = [field_name, 'Y' + str(index)] + r = str(random.random()) + g = str(random.random()) + b = str(random.random()) + xyrep.SeriesColor = [field_name, r, g, b] + index += 1 + +pvsimple.Render(xy_view) +sleep(DELAY) + +# Destroy two views +#print "Destroy two views: with Cut Lines and the curves" +#pvsimple.Delete(view) +#pvsimple.Delete(xy_view) + + +# Create one more view for cut segment +view = pvsimple.CreateRenderView() +reset_view(view) + +color = [0.0, 0.7, 0.3] +view.Background = color +pvsimple.Render(view) +sleep(DELAY) + +point1 = [0.0, -1.0, 2.5] +point2 = [0.0, 1.0, 2.5] +cutsegment = CutSegmentOnField(med_reader, entity, field_name, timestamp, + point1, point2) + +print "CutSegmentOnField(...)" +display_only(cutsegment, view) +pvsimple.ResetCamera(view) +print "display_only(cutsegment, view)" +sleep(DELAY) + +xy_view = pvsimple.CreateXYPlotView() +curve = pvsimple.Show(cutsegment.Input, xy_view) +curve.AttributeType = 'Point Data' +curve.UseIndexForXAxis = 0 +curve.XArrayName = 'arc_length' +set_visible_lines(curve, [field_name]) + +pvsimple.Render(xy_view) +sleep(DELAY) + + +# Create one more view for animation +view = pvsimple.CreateRenderView() +reset_view(view) + +med_file = datadir + "TimeStamps.med" +field_name = "vitesse" +entity = EntityType.NODE +timestamp = 2 + +my_paravis.ImportFile(med_file) +med_reader = pvsimple.GetActiveSource() + +isosurf = IsoSurfacesOnField(med_reader, entity, field_name, timestamp) +print "IsoSurfacesOnField(...)" +pvsimple.ResetCamera(view) + +print "Start Animation" +pvsimple.AnimateReader(med_reader, view) diff --git a/test/VisuPrs/SWIG_scripts/B5.py b/test/VisuPrs/SWIG_scripts/B5.py new file mode 100644 index 00000000..f4323cf2 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/B5.py @@ -0,0 +1,175 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/B5 case + +from time import sleep + +from paravistest import datadir, tablesdir +from presentations import * +import paravis +import pvsimple + + +DELAY = 2 + +my_paravis = paravis.myParavis + +# Step 1 +print 'Importing "pointe.med"...............', +file_path = datadir + "pointe.med" +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +field_name = "fieldnodedouble" +entity = EntityType.NODE +timestamp = 1 + + +# Step 2 +view1 = pvsimple.GetRenderView() +print "view1 = pvsimple.GetRenderView()" + +sleep(DELAY) + +pvsimple.Delete(view1) +print "pvsimple.Delete(view1)" + + +# Step 3 +view2 = pvsimple.CreateRenderView() +print "view2 = pvsimple.CreateRenderView()" + +color = [0.0, 0.3, 1.0] +view2.Background = color +print "view2.Background =", str(color) +pvsimple.Render(view2) + +scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp) +print "ScalarMapOnField(...)" +scalarmap.Visibility = 1 +pvsimple.Render(view2) + +view2.CameraFocalPoint = [0, 0, 0] +print "view2.CameraFocalPoint = [0, 0, 0]" +view2.CameraParallelScale = 2 +print "view2.CameraParallelScale = 2" +pvsimple.Render(view2) + +view2.ResetCamera() +print "view2.ResetCamera()" +pvsimple.Render(view2) + +sleep(DELAY) + + +# Step 4 +view3 = pvsimple.CreateRenderView() +print "view3 = pvsimple.CreateRenderView()" + +color = [0.0, 0.7, 0.0] +view3.Background = color +print "view3.Background = ", str(color) +pvsimple.Render(view3) + +cutplanes = CutPlanesOnField(med_reader, entity, field_name, timestamp, + orientation=Orientation.XY) +print "CutPlanesOnField(...)" + +display_only(cutplanes, view3) +print "display_only(cutplanes, view3)" + +point = view3.CameraFocalPoint +point[0] = point[0] + 10 +view3.CameraFocalPoint = point +print "view3.CameraFocalPoint = ", str(point) + +view3.ResetCamera() +print "view3.ResetCamera()" +pvsimple.Render(view3) +print "pvsimple.Render(view3)" + +sleep(DELAY) + + +# Step 5 +view4 = pvsimple.CreateRenderView() +print "view4 = pvsimple.CreateRenderView()" + +color = [1.0, 0.7, 0.0] +view4.Background = color +print "view5.Background = ", str(color) +pvsimple.Render(view4) + +isosurfaces = IsoSurfacesOnField(med_reader, entity, field_name, timestamp) +print "isosurfaces = IsoSurfacesOnField(...)" + +display_only(isosurfaces, view4) +print "display_only(isosurfaces, view4)" +view4.ResetCamera() +print "view4.ResetCamera()" + +pvsimple.Render(view4) +print "pvsimple.Render(view4)" + +sleep(DELAY) + + +# Step 6 +view5 = pvsimple.CreateRenderView() +print "view5 = pvsimple.CreateRenderView()" + +color = [0.7, 0.7, 0.7] +view5.Background = color +print "view5.Background =", str(color) +pvsimple.Render(view5) + +cutlines = CutLinesOnField(med_reader, entity, field_name, timestamp, + orientation1=Orientation.ZX, + orientation2=Orientation.YZ) +print "cutlines = CutLinesOnField(...)" + +display_only(cutlines, view5) +print "display_only(cutlines, view5)" +pvsimple.ResetCamera(view5) +print "pvsimple.ResetCamera(view5)" + +sleep(DELAY) + + +# Step 7 +file_path = tablesdir + "sinus.csv" +sinus_csv = pvsimple.CSVReader(FileName=file_path) +sinus_csv.FieldDelimiterCharacters = ' ' + +view6 = pvsimple.CreateXYPlotView() +print "view6 = pvsimple.CreateXYPlotView()" + +xy_rep = pvsimple.Show(sinus_csv) +xy_rep.AttributeType = 'Row Data' +xy_rep.UseIndexForXAxis = 0 +xy_rep.XArrayName = 'x' +xy_rep.SeriesVisibility = ['x', '0'] + +sleep(DELAY) diff --git a/test/VisuPrs/SWIG_scripts/B6.py b/test/VisuPrs/SWIG_scripts/B6.py new file mode 100644 index 00000000..b9a58928 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/B6.py @@ -0,0 +1,151 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/B6 case +# Create table of integer, create table of real, create curves + +from paravistest import tablesdir +import paravis +import pvsimple + + +# Define script for table of integer creation +script_ti = """ +def add_column(table, name, lst): + col = vtk.vtkIntArray() + col.SetName(name) + for item in lst: + col.InsertNextValue(item) + table.AddColumn(col) + +# Get table output +table = self.GetTableOutput() + +# Add columns +lst = [1,2,3,4,5,6,7,8,9,10] +add_column(table, 'FR', lst) + +lst = [110,120,130,140,150,160,170,180,190,200] +add_column(table, 'SR', lst) + +lst = [-1,272,0,0,-642,10000,13,578,-578,99] +add_column(table, 'TR', lst) +""" + +# Define script for table of real creation +script_tr = """ +import math + + +# Get table output +table = self.GetTableOutput() + +# Create first column +col1 = vtk.vtkDoubleArray() +col1.SetName('Row 0') +for i in xrange(0, 21): + col1.InsertNextValue(i * 10 + 1) +table.AddColumn(col1) + +# Create the rest columns +for i in range(1, 11): + col = vtk.vtkDoubleArray() + col.SetName('Row ' + str(i)) + + # Fill the next column + col.InsertNextValue(1) + for j in range(1, 21): + if j % 2 == 1: + col.InsertNextValue(math.log10(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + else: + col.InsertNextValue(math.sin(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + + table.AddColumn(col) +""" + +# Creating programmable source for the table of integer +ps_ti = pvsimple.ProgrammableSource() +ps_ti.OutputDataSetType = 'vtkTable' +ps_ti.Script = script_ti +pvsimple.RenameSource("TEST table of integer", ps_ti) +ps_ti.UpdatePipeline() + +# Creating programmable source for the table of real +ps_tr = pvsimple.ProgrammableSource() +ps_tr.OutputDataSetType = 'vtkTable' +ps_tr.Script = script_tr +pvsimple.RenameSource("TEST table of real", ps_tr) +ps_tr.UpdatePipeline() + +# Replace the current view with chart line one +cur_view = pvsimple.GetRenderView() +if cur_view: + pvsimple.Delete(cur_view) + +xy_view1 = pvsimple.CreateXYPlotView() +xy_view1.ChartTitle = 'TEST table of real' +xy_view1.AxisTitle = ['[ Wt ]', 'Row 0 [ Hz ]'] + +# Display curves for the table of real +tr_rep = pvsimple.Show(ps_tr) +tr_rep.AttributeType = 'Row Data' +tr_rep.UseIndexForXAxis = 0 +tr_rep.XArrayName = 'Row 0' +tr_rep.SeriesVisibility = ['Row 0', '0', 'Row 4', '0', \ +'Row 6', '0', 'Row 8', '0', 'Row 9', '0'] + +# Set 'Square' marker style for 'Row 5' line +tr_rep.SeriesMarkerStyle = ['Row 5', '3'] +# Set 'Dash' line style for 'Row 5' line +tr_rep.SeriesLineStyle = ['Row 5', '2'] +# Set color for 'Row 5' line +tr_rep.SeriesColor = ['Row 5', '0', '0.7', '0.3'] +# Set 'Diamond' marker style for 'Row 10' line +tr_rep.SeriesMarkerStyle = ['Row 10', '5'] +# Set 'Dot' line style for 'Row 10' line +tr_rep.SeriesLineStyle = ['Row 10', '3'] +# Set color for 'Row 10' line +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 ]'] + +# Display curves for the table of integer +ti_rep = pvsimple.Show(ps_ti, xy_view2) +ti_rep.AttributeType = 'Row Data' +ti_rep.UseIndexForXAxis = 0 +ti_rep.XArrayName = 'FR' +ti_rep.SeriesVisibility = ['SR', '0'] + +# Change legend label for "FR" line +ti_rep.SeriesLabel = ["FR", "FREQ"] + +# Set 'Square' marker style for 'FR' line +ti_rep.SeriesMarkerStyle = ['FR', '3'] +# Set 'Dash' line style for 'FR' line +ti_rep.SeriesLineStyle = ['FR', '2'] +# Set color for 'FR' line +ti_rep.SeriesColor = ['FR', '0', '0.7', '0.3'] + + +# Update views +pvsimple.Render(xy_view1) +pvsimple.Render(xy_view2) diff --git a/test/VisuPrs/SWIG_scripts/B7.py b/test/VisuPrs/SWIG_scripts/B7.py new file mode 100644 index 00000000..788bc78c --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/B7.py @@ -0,0 +1,124 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/B7 case +# Import a table from file and show it in 2D viewer + +from paravistest import tablesdir +from presentations import * +import paravis +import pvsimple + + +# Import table from CSV file +file_path = tablesdir + "table_test.csv" +table_csv = pvsimple.CSVReader(FileName=file_path) + +# Set space as separator +table_csv.FieldDelimiterCharacters = ';' + +# Display curve +cur_view = pvsimple.GetRenderView() +if cur_view: + pvsimple.Delete(cur_view) +xy_view = pvsimple.CreateXYPlotView() + +xy_rep = pvsimple.Show(table_csv) +xy_rep.AttributeType = 'Row Data' +xy_rep.UseIndexForXAxis = 0 +xy_rep.XArrayName = 'X' +xy_rep.SeriesVisibility = ['X', '0'] + +# Set view properties +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" +pvsimple.Render(xy_view) + +xy_view.ShowLegend = 0 +pvsimple.Render(xy_view) + +xy_view.ShowAxis = [0, 0, 0, 0] +pvsimple.Render(xy_view) +xy_view.ShowAxis = [1, 0, 0, 0] +pvsimple.Render(xy_view) +xy_view.ShowAxis[1] = 1 +pvsimple.Render(xy_view) + +# Set logarithmic scaling +xy_view.AxisLogScale[0] = 1 +pvsimple.Render(xy_view) +xy_view.AxisLogScale[1] = 1 +pvsimple.Render(xy_view) + +# Set representation properties + +# Show/hide curves +xy_rep.SeriesVisibility = ['Y0', '0', 'Y1', '0', + 'Y2', '0', 'Y3', '0'] +pvsimple.Render(xy_view) +xy_rep.SeriesVisibility = ['Y0', '1'] +pvsimple.Render(xy_view) +xy_rep.SeriesVisibility = ['Y1', '1'] +pvsimple.Render(xy_view) +xy_rep.SeriesVisibility = ['Y2', '1'] +pvsimple.Render(xy_view) + +xy_rep.SeriesVisibility = ['Y3', '1'] +xy_rep.SeriesVisibility = ['Y3', '0'] +xy_rep.SeriesVisibility = ['Y3', '1'] +pvsimple.Render(xy_view) + +# Line style +xy_rep.SeriesLineStyle = ['Y0', '5'] +pvsimple.Render(xy_view) +xy_rep.SeriesLineStyle = ['Y1', '4'] +pvsimple.Render(xy_view) +xy_rep.SeriesLineStyle = ['Y2', '3'] +pvsimple.Render(xy_view) +xy_rep.SeriesLineStyle = ['Y3', '2'] +pvsimple.Render(xy_view) + +# Line thickness +values = (2, 4, 6, 8, 10, 1) +for val in values: + xy_rep.SeriesLineThickness = ['Y3', str(val)] + pvsimple.Render(xy_view) + +xy_rep.SeriesLineStyle = ['Y3', '0'] +pvsimple.Render(xy_view) + +# Marker type +xy_rep.SeriesMarkerStyle = ['Y3', '5'] +pvsimple.Render(xy_view) +xy_rep.SeriesMarkerStyle = ['Y2', '4'] +pvsimple.Render(xy_view) +xy_rep.SeriesMarkerStyle = ['Y1', '3'] +pvsimple.Render(xy_view) +xy_rep.SeriesMarkerStyle = ['Y0', '8'] +pvsimple.Render(xy_view) + +# Marker size +for val in values: + xy_rep.SeriesLineThickness = ['Y3', str(val)] + pvsimple.Render(xy_view) diff --git a/test/VisuPrs/SWIG_scripts/B8.py b/test/VisuPrs/SWIG_scripts/B8.py new file mode 100644 index 00000000..39614895 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/B8.py @@ -0,0 +1,23 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/B8 case + +import paravistest +import paravis diff --git a/test/VisuPrs/SWIG_scripts/B9.py b/test/VisuPrs/SWIG_scripts/B9.py new file mode 100644 index 00000000..929b0d1b --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/B9.py @@ -0,0 +1,58 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/B9 case + +from paravistest import datadir +from presentations import EntityType, ScalarMapOnField, CutPlanesOnField +import paravis +import pvsimple + + +my_paravis = paravis.myParavis + +# Get view +view1 = pvsimple.GetRenderView() + +# Import MED file +med_file = datadir + "pointe.med" +field_name = "fieldnodedouble" +entity = EntityType.NODE +timestamp = 1 + +my_paravis.ImportFile(med_file) +med_reader = pvsimple.GetActiveSource() + +# Create presentations +scalarmap = ScalarMapOnField(med_reader, entity, field_name, timestamp) +pvsimple.ResetCamera(view1) + +view2 = pvsimple.CreateRenderView() +cutlines = CutPlanesOnField(med_reader, entity, field_name, timestamp) +pvsimple.ResetCamera(view2) + +# Delete +source = cutlines.Input +pvsimple.Delete(source) +pvsimple.Delete(med_reader) + +# Clear views from scalar bar and update views +for rview in pvsimple.GetRenderViews(): + rview.Representations.Clear() + pvsimple.Render(rview) diff --git a/test/VisuPrs/SWIG_scripts/C3.py b/test/VisuPrs/SWIG_scripts/C3.py new file mode 100644 index 00000000..8c0b97d7 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/C3.py @@ -0,0 +1,100 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/C3 case +# Create table and display curves + +import paraview.simple as pv +import paraview.servermanager as sm + + +# Define script for table creation +script = """ +import math + + +# Get table output +table = self.GetTableOutput() + +nb_rows = 10 +nb_cols = 200 + +# Create first column +col1 = vtk.vtkDoubleArray() +col1.SetName('Frequency') +for i in xrange(0, nb_rows): + col1.InsertNextValue(i * 10 + 1) +table.AddColumn(col1) + +# Create the rest columns +for i in xrange(1, nb_cols + 1): + col = vtk.vtkDoubleArray() + col.SetName('Power ' + str(i)) + + # Fill the next column + for j in xrange(0, nb_rows): + if j % 2 == 1: + col.InsertNextValue(math.log10(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + else: + col.InsertNextValue(math.sin(j * 30 * math.pi / 180) * 20 + i * 15 + j * 5) + + table.AddColumn(col) +""" + +# Creating programmable source (table) +ps = pv.ProgrammableSource() +ps.OutputDataSetType = 'vtkTable' +ps.Script = script +pv.RenameSource("Very useful data", ps) +ps.UpdatePipeline() + +# Display table +# TODO: no possibility to create spreadsheet view + +# Display curves +xy_view = pv.CreateXYPlotView() +xy_view.ChartTitle = 'Very useful data' +xy_view.AxisTitle = ['[ Wt ]', 'Frequency [ Hz ]'] + +xy_rep = pv.Show(ps) +xy_rep.AttributeType = 'Row Data' +xy_rep.UseIndexForXAxis = 0 +xy_rep.XArrayName = 'Frequency' +xy_rep.SeriesVisibility = ['Frequency', '0'] +pv.Render(xy_view) + +# Hide legend +xy_view.ShowLegend = 0 +pv.Render(xy_view) + +# Set logarithmic scaling for X axis +xy_view.AxisLogScale[1] = 1 +pv.Render(xy_view) + +# Set linear scaling for X axis +xy_view.AxisLogScale[1] = 0 +pv.Render(xy_view) + +# Set logarithmic scaling for X axis +xy_view.AxisLogScale[0] = 1 +pv.Render(xy_view) + +# Show legend +xy_view.ShowLegend = 1 +pv.Render(xy_view) diff --git a/test/VisuPrs/SWIG_scripts/C7.py b/test/VisuPrs/SWIG_scripts/C7.py new file mode 100755 index 00000000..dad7ef3d --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/C7.py @@ -0,0 +1,120 @@ +# Copyright (C) 2010-2012 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. +# +# 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/SWIG_scripts/C7 case +# Import a table in Post-Pro specific format from file; +# create 3D representation of the table and show it in 3D viewer + +import sys + +from paravistest import tablesdir, get_picture_dir, pictureext +from presentations import * +import paravis +import pvsimple + + +# Import table from file +print 'Import file with tables....', +file_path = tablesdir + "table_test.xls" +table_reader = pvsimple.TableReader(FileName=file_path) +if table_reader is None: + print "FAILED" +else: + print "OK" + +# Get default settings of the reader +available_tables = table_reader.GetPropertyValue("AvailableTables") +is_detect_num = table_reader.DetectNumericColumns +first_str_as_title = table_reader.FirstStringAsTitles +delimiter = table_reader.ValueDelimiter +table_nb = table_reader.TableNumber + +print "Default reader settings:" +print "Available tables: ", available_tables +print "Detect Numeric Columns: ", is_detect_num +print "Interpret First String As Column Titles: ", first_str_as_title +print "Value Delimiter: '%s'" % delimiter +print "Table Number: ", table_nb + + +# Create 3D representation of the table with the +# help of "Table To 3D" filter, +# in Post-Pro this representation is known as "Pointmap3d" +table_to_3d = pvsimple.TableTo3D(table_reader) + +print 'Create "Table To 3D" filter....', +if table_to_3d is None: + print "FAILED" +else: + print "OK" + +print "Default 'Table To 3D' filter settings:" +print "Scale Factor: ", table_to_3d.ScaleFactor +print "Use Optimus Scale: ", table_to_3d.UseOptimusScale +print "Presentation Type: ", table_to_3d.PresentationType +print "Number Of Contours: ", table_to_3d.NumberOfContours + + +# Show table 3D representation + +# Get 3D view +print 'Get 3D view...................', +view = pvsimple.GetRenderView() +if view is None: + print "FAILED" +else: + reset_view(view) + print "OK" + +pointmap3d = pvsimple.GetRepresentation(table_to_3d) + +table_name = available_tables +if type(available_tables) == list: + table_name = available_tables[table_nb] + +vector_mode = 'Magnitude' +nb_components = 1 +entity = EntityType.NODE + +# Get lookup table +lookup_table = get_lookup_table(table_name, nb_components, vector_mode) +lookup_table.LockScalarRange = 0 + +# Set properties +pointmap3d.ColorAttributeType = EntityType.get_pvtype(entity) +pointmap3d.ColorArrayName = table_name +pointmap3d.LookupTable = lookup_table + +# Add scalar bar +add_scalar_bar(table_name, nb_components, vector_mode, + lookup_table, "") + +# Reset view +reset_view(view=view) + + +# Write image + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "SWIG_scripts/C7") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +file_name = picturedir + "pointmap3d." + pictureext +pvsimple.WriteImage(file_name, view=view, Magnification=1) diff --git a/test/VisuPrs/SWIG_scripts/CMakeLists.txt b/test/VisuPrs/SWIG_scripts/CMakeLists.txt new file mode 100644 index 00000000..2a86c470 --- /dev/null +++ b/test/VisuPrs/SWIG_scripts/CMakeLists.txt @@ -0,0 +1,43 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A1 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B5 + B6 + B7 + B8 + B9 + C3 + C7 + ) + ADD_TEST(SWIGSCRIPTS_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(SWIGSCRIPTS_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/ScalarMap/A0.py b/test/VisuPrs/ScalarMap/A0.py new file mode 100755 index 00000000..5e4cc73f --- /dev/null +++ b/test/VisuPrs/ScalarMap/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A1.py b/test/VisuPrs/ScalarMap/A1.py new file mode 100644 index 00000000..c17f92fa --- /dev/null +++ b/test/VisuPrs/ScalarMap/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A2.py b/test/VisuPrs/ScalarMap/A2.py new file mode 100755 index 00000000..7a3526a0 --- /dev/null +++ b/test/VisuPrs/ScalarMap/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A3.py b/test/VisuPrs/ScalarMap/A3.py new file mode 100755 index 00000000..c3a69c21 --- /dev/null +++ b/test/VisuPrs/ScalarMap/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A4.py b/test/VisuPrs/ScalarMap/A4.py new file mode 100755 index 00000000..c17e01f3 --- /dev/null +++ b/test/VisuPrs/ScalarMap/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A5.py b/test/VisuPrs/ScalarMap/A5.py new file mode 100644 index 00000000..b9845ed1 --- /dev/null +++ b/test/VisuPrs/ScalarMap/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A6.py b/test/VisuPrs/ScalarMap/A6.py new file mode 100755 index 00000000..fb7f73e1 --- /dev/null +++ b/test/VisuPrs/ScalarMap/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A7.py b/test/VisuPrs/ScalarMap/A7.py new file mode 100644 index 00000000..ff8459fc --- /dev/null +++ b/test/VisuPrs/ScalarMap/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A8.py b/test/VisuPrs/ScalarMap/A8.py new file mode 100644 index 00000000..4292aa0c --- /dev/null +++ b/test/VisuPrs/ScalarMap/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/A9.py b/test/VisuPrs/ScalarMap/A9.py new file mode 100644 index 00000000..f233c335 --- /dev/null +++ b/test/VisuPrs/ScalarMap/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/B0.py b/test/VisuPrs/ScalarMap/B0.py new file mode 100644 index 00000000..8ae5e663 --- /dev/null +++ b/test/VisuPrs/ScalarMap/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/B1.py b/test/VisuPrs/ScalarMap/B1.py new file mode 100644 index 00000000..a8eb84cb --- /dev/null +++ b/test/VisuPrs/ScalarMap/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/B2.py b/test/VisuPrs/ScalarMap/B2.py new file mode 100644 index 00000000..e3417059 --- /dev/null +++ b/test/VisuPrs/ScalarMap/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/CMakeLists.txt b/test/VisuPrs/ScalarMap/CMakeLists.txt new file mode 100644 index 00000000..453222bc --- /dev/null +++ b/test/VisuPrs/ScalarMap/CMakeLists.txt @@ -0,0 +1,62 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + G0 + G1 + G2 + ) + ADD_TEST(SCALARMAP_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(SCALARMAP_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) \ No newline at end of file diff --git a/test/VisuPrs/ScalarMap/E0.py b/test/VisuPrs/ScalarMap/E0.py new file mode 100644 index 00000000..ec515d26 --- /dev/null +++ b/test/VisuPrs/ScalarMap/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E1.py b/test/VisuPrs/ScalarMap/E1.py new file mode 100644 index 00000000..12b31305 --- /dev/null +++ b/test/VisuPrs/ScalarMap/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E2.py b/test/VisuPrs/ScalarMap/E2.py new file mode 100644 index 00000000..ce05cf90 --- /dev/null +++ b/test/VisuPrs/ScalarMap/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E3.py b/test/VisuPrs/ScalarMap/E3.py new file mode 100755 index 00000000..2a2c9e9b --- /dev/null +++ b/test/VisuPrs/ScalarMap/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E4.py b/test/VisuPrs/ScalarMap/E4.py new file mode 100644 index 00000000..0c8d3e88 --- /dev/null +++ b/test/VisuPrs/ScalarMap/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E5.py b/test/VisuPrs/ScalarMap/E5.py new file mode 100644 index 00000000..c08dd20a --- /dev/null +++ b/test/VisuPrs/ScalarMap/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E6.py b/test/VisuPrs/ScalarMap/E6.py new file mode 100644 index 00000000..1ca55264 --- /dev/null +++ b/test/VisuPrs/ScalarMap/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E7.py b/test/VisuPrs/ScalarMap/E7.py new file mode 100644 index 00000000..4866611a --- /dev/null +++ b/test/VisuPrs/ScalarMap/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E8.py b/test/VisuPrs/ScalarMap/E8.py new file mode 100644 index 00000000..b4b808bb --- /dev/null +++ b/test/VisuPrs/ScalarMap/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/E9.py b/test/VisuPrs/ScalarMap/E9.py new file mode 100644 index 00000000..458f04a1 --- /dev/null +++ b/test/VisuPrs/ScalarMap/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F0.py b/test/VisuPrs/ScalarMap/F0.py new file mode 100755 index 00000000..e7adff96 --- /dev/null +++ b/test/VisuPrs/ScalarMap/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F1.py b/test/VisuPrs/ScalarMap/F1.py new file mode 100644 index 00000000..e1542994 --- /dev/null +++ b/test/VisuPrs/ScalarMap/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F2.py b/test/VisuPrs/ScalarMap/F2.py new file mode 100644 index 00000000..2952878d --- /dev/null +++ b/test/VisuPrs/ScalarMap/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F3.py b/test/VisuPrs/ScalarMap/F3.py new file mode 100644 index 00000000..8c4f1004 --- /dev/null +++ b/test/VisuPrs/ScalarMap/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F4.py b/test/VisuPrs/ScalarMap/F4.py new file mode 100644 index 00000000..48ebce68 --- /dev/null +++ b/test/VisuPrs/ScalarMap/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F5.py b/test/VisuPrs/ScalarMap/F5.py new file mode 100644 index 00000000..70d58b01 --- /dev/null +++ b/test/VisuPrs/ScalarMap/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F6.py b/test/VisuPrs/ScalarMap/F6.py new file mode 100644 index 00000000..d6719de7 --- /dev/null +++ b/test/VisuPrs/ScalarMap/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F7.py b/test/VisuPrs/ScalarMap/F7.py new file mode 100644 index 00000000..234f0541 --- /dev/null +++ b/test/VisuPrs/ScalarMap/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F8.py b/test/VisuPrs/ScalarMap/F8.py new file mode 100644 index 00000000..842d4ef0 --- /dev/null +++ b/test/VisuPrs/ScalarMap/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F8") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/F9.py b/test/VisuPrs/ScalarMap/F9.py new file mode 100644 index 00000000..e5e73e0a --- /dev/null +++ b/test/VisuPrs/ScalarMap/F9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/F9") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/G0.py b/test/VisuPrs/ScalarMap/G0.py new file mode 100644 index 00000000..f238a461 --- /dev/null +++ b/test/VisuPrs/ScalarMap/G0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/G0") + +file = datadir + "homard_ASTER_OSF_MEDV2.1.5_1_v2.3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/G1.py b/test/VisuPrs/ScalarMap/G1.py new file mode 100644 index 00000000..1d8eddc0 --- /dev/null +++ b/test/VisuPrs/ScalarMap/G1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap/G1") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.SCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap/G2.py b/test/VisuPrs/ScalarMap/G2.py new file mode 100644 index 00000000..0d33abf3 --- /dev/null +++ b/test/VisuPrs/ScalarMap/G2.py @@ -0,0 +1,90 @@ +# Copyright (C) 2010-2012 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. +# +# 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/G2 case +# Create Scalar Map for field of the the given MED file for 10 timestamps% + +import sys +import os +from paravistest import datadir, pictureext, get_picture_dir +import paravis +from pvsimple import GetActiveSource, GetRenderView, Render +from presentations import ScalarMapOnField, hide_all, EntityType, PrsTypeEnum,reset_view,process_prs_for_test + + +# Create presentations +myParavis = paravis.myParavis + +picturedir = get_picture_dir(sys.argv[1], "ScalarMap/G2") + +theFileName = datadir + "Bug829_resu_mode.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +"""Build presentations of the given types for all fields of the given file.""" +#print "Import %s..." % theFileName.split('/')[-1], +result = myParavis.ImportFile(theFileName) +proxy = GetActiveSource() +if proxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" +# Get view +aView = GetRenderView() + + +field_names = proxy.PointArrays.GetData() +aTimeStamps = proxy.TimestepValues.GetData() +aFieldEntity = EntityType.NODE +aFieldName = "MODES_DEPL" +#create list to store picture files sizes +sizes=[] +#create Scalar Map presentations for 10 timestamps +for i in range(1,11): + hide_all(aView, True) + aPrs = ScalarMapOnField(proxy, aFieldEntity,aFieldName , i) + if aPrs is None: + raise RuntimeError, "Presentation is None!!!" + #display only current scalar map + aPrs.Visibility=1 + reset_view(aView) + Render(aView) + + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + prs_type = PrsTypeEnum.SCALARMAP + + # Get name of presentation type + prs_name = PrsTypeEnum.get_name(prs_type) + f_prs_type = prs_name.replace(' ', '').upper() + # Construct image file name + pic_name = picturedir + aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext + + # Show and record the presentation + process_prs_for_test(aPrs, aView, pic_name) + sizes.append(os.path.getsize(pic_name)) + +# check sizes of pictures +if abs(max(sizes)-min(sizes)) > 0.01*max(sizes): + print "WARNING!!! Pictures have different sizes!!!"; + for i in range(1,11): + picture_name = "time_stamp_"+str(i)+"."+pictureext + print "Picture: "+picture_name+"; size: "+str(sizes[i-1]) + raise RuntimeError diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A0.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A0.py new file mode 100644 index 00000000..89136010 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A1.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A1.py new file mode 100755 index 00000000..4088094f --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A2.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A2.py new file mode 100755 index 00000000..cebf0747 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A3.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A3.py new file mode 100755 index 00000000..ffce6d25 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A4.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A4.py new file mode 100755 index 00000000..9058ed7e --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A5.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A5.py new file mode 100755 index 00000000..ce1fd088 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A6.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A6.py new file mode 100755 index 00000000..b1b57392 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A7.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A7.py new file mode 100755 index 00000000..ccc783eb --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A8.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A8.py new file mode 100755 index 00000000..c35dcb74 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/A9.py b/test/VisuPrs/ScalarMap_On_DeformedShape/A9.py new file mode 100755 index 00000000..ccd19e99 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/B0.py b/test/VisuPrs/ScalarMap_On_DeformedShape/B0.py new file mode 100755 index 00000000..fdd8d70a --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/B1.py b/test/VisuPrs/ScalarMap_On_DeformedShape/B1.py new file mode 100755 index 00000000..849f37ae --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/B2.py b/test/VisuPrs/ScalarMap_On_DeformedShape/B2.py new file mode 100755 index 00000000..2f135ac8 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/B3.py b/test/VisuPrs/ScalarMap_On_DeformedShape/B3.py new file mode 100644 index 00000000..21c83beb --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/B3.py @@ -0,0 +1,241 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B3 case + +from paravistest import datadir +from presentations import * +import paravis +import pvsimple + +my_paravis = paravis.myParavis + +#====================Stage1: Import MED file========================= +print 'Importing "fra.med"...................', +medFile = datadir + "fra.med" +my_paravis.ImportFile(medFile) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +view = pvsimple.GetRenderView() +reset_view(view) + +#=============Stage2: Create Scalar Map On Deformed Shape============= +field_name = "VITESSE" +node_entity = EntityType.NODE +timestamp = 1 + +print "Creating Scalar Map On Deformed Shape...................", +smondefshape1 = DeformedShapeAndScalarMapOnField(med_reader, node_entity, + field_name, 1) + +if smondefshape1 is None: + print "FAILED" +else: + display_only(smondefshape1, view) + pvsimple.ResetCamera(view) + print "OK" + +#=============Stage3: Create with 'Y' vector mode======================== +hide_all(view) +smondefshape2 = DeformedShapeAndScalarMapOnField(med_reader, + node_entity, + field_name, 1, + vector_mode='Y') + +print "Creating Scalar Map On Deformed Shape with 'Y' scalar mode.....", +if smondefshape2 is None: + print "FAILED" +else: + print "OK" + +#=============Stage4: scaling of Scalar Map On Deformed Shape============ +bar = get_bar() +lt = bar.LookupTable + +print "Changing scaling mode:" +lt.UseLogScale = 0 +print "Log scaling ....", lt.UseLogScale +pvsimple.Render(view) + +lt.UseLogScale = 1 +print "Log scaling ....", lt.UseLogScale +pvsimple.Render() + +#=============Stage5: range of Scalar Map On Deformed Shape============== +print "Changing scalar range:" +range_min = 12 +range_max = 120 +lt.RGBPoints[0] = range_min +lt.RGBPoints[4] = range_max +print "min = " + str(lt.RGBPoints[0]) + "; max = " + str(lt.RGBPoints[4]) +pvsimple.Render(view) + +range_min = 120 +range_max = 120 +lt.RGBPoints[0] = range_min +lt.RGBPoints[4] = range_max +print "min = " + str(lt.RGBPoints[0]) + "; max = " + str(lt.RGBPoints[4]) +pvsimple.Render(view) + +range_min = 120 +range_max = 15 +lt.RGBPoints[0] = range_min +lt.RGBPoints[4] = range_max +print "min = " + str(lt.RGBPoints[0]) + "; max = " + str(lt.RGBPoints[4]) +pvsimple.Render(view) + +#=============Stage6: bar orientation of Scalar Map On Deformed Shape== +print "Changing bar orientation:" +print "Default orientation: ", bar.Orientation + +print "Set horizontal bar orientation" +bar.Orientation = 'Horizontal' +print "Bar orientation: ", bar.Orientation +pvsimple.Render(view) + +print "Set vertical bar orientation" +bar.Orientation = 'Vertical' +print "Bar orientation: ", bar.Orientation +pvsimple.Render(view) + +#=============Stage7: bar position of Scalar Map On Deformed Shape ==== +print "Changing bar position:" +print "Default position: ", bar.Position + +print "Set position X,Y positive" +x_pos = 200 +y_pos = 100 +bar.Position = [x_pos, y_pos] +print "Bar position [X,Y]: ", bar.Position +pvsimple.Render(view) + +print "Set position X negative ,Y positive" +x_pos = -100 +y_pos = 150 +bar.Position = [x_pos, y_pos] +print "Bar position [X,Y]: ", bar.Position +pvsimple.Render(view) + +print "Set position X positive, Y negative" +x_pos = 100 +y_pos = -100 +bar.Position = [x_pos, y_pos] +print "Bar position [X,Y]: ", bar.Position +pvsimple.Render(view) + +print "Set position X = 0.1, Y = 0.01" +x_pos = 0.1 +y_pos = 0.01 +bar.Position = [x_pos, y_pos] +print "Bar position [X,Y]: ", bar.Position +pvsimple.Render(view) + +#============Stage8: bar size of Scalar Map On Deformed Shape=========== +print "Changing bar size:" +print "Default [width, height]: ", bar.Position2 + +print "Set height = height*1.2" +height = bar.Position2[1] * 1.2 +bar.Position2[1] = height +print "Bar [width, height]: ", bar.Position2 +pvsimple.Render(view) + +print "Set width = width*2" +width = bar.Position2[0] * 2 +bar.Position2[0] = width +print "Bar [width, height]: ", bar.Position2 +pvsimple.Render(view) + +#=============Stage9: nb of colors of Scalar Map On Deformed Shape====== +print "Changing number of colors:" +print "Default number of colors: ", lt.NumberOfTableValues +lt.Discretize = 1 + +print "Set negative number of colors" +num = -128 +lt.NumberOfTableValues = num +print "Number of colors: ", lt.NumberOfTableValues +pvsimple.Render(view) + +print "Set zero number of colors" +num = 0 +lt.NumberOfTableValues = num +print "Number of colors: ", lt.NumberOfTableValues +pvsimple.Render(view) + +print "Set positive number of colors" +num = 256 +lt.NumberOfTableValues = num +print "Number of colors: ", lt.NumberOfTableValues +pvsimple.Render(view) + +#=============Stage10: nb of labels of Scalar Map On Deformed Shape===== +print "Changing number of labels:" +print "Default number of labels: ", bar.NumberOfLabels + +print "Set negative number of labels" +num = -128 +bar.NumberOfLabels = num +print "Number of labels: ", bar.NumberOfLabels +pvsimple.Render(view) + +print "Set zero number of labels" +num = 0 +bar.NumberOfLabels = num +print "Number of labels: ", bar.NumberOfLabels +pvsimple.Render(view) + +print "Set positive number of labels" +num = 256 +bar.NumberOfLabels = num +print "Number of labels: ", bar.NumberOfLabels +pvsimple.Render(view) + +#=============Stage11: bar title of Scalar Map On Deformed Shape========= +print "Changing bar title:" +print "Default bar title: ", bar.Title + +print "Set not null title" +title = "Scalar Bar Title" +bar.Title = title +print 'Bar title: "' + bar.Title + '"' +pvsimple.Render(view) + +print "Set title from spaces" +title = ' ' +bar.Title = title +print 'Bar title: "' + bar.Title + '"' +pvsimple.Render(view) + +#============Stage12: scale factor of ScalarMap On Deformed Shape ===== +print "Changing scale factor:" +warp_vector = smondefshape2.Input + +print 'Default scale: ', warp_vector.ScaleFactor + +scale = 0.8 +warp_vector.ScaleFactor = scale +warp_vector.UpdatePipeline() +print "Scale: ", warp_vector.ScaleFactor +pvsimple.Render(view) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt b/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt new file mode 100644 index 00000000..43ec9347 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/CMakeLists.txt @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + B3 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + ) + ADD_TEST(DEFORMEDSHAPESCALARMAP_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(DEFORMEDSHAPESCALARMAP_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E0.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E0.py new file mode 100755 index 00000000..6a433170 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E1.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E1.py new file mode 100755 index 00000000..56b80587 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E2.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E2.py new file mode 100755 index 00000000..a3e30f12 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E3.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E3.py new file mode 100755 index 00000000..89b0bd52 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E4.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E4.py new file mode 100755 index 00000000..5b11cd64 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E5.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E5.py new file mode 100755 index 00000000..fbf7e2df --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E6.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E6.py new file mode 100755 index 00000000..3b08df27 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E7.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E7.py new file mode 100755 index 00000000..afdc0627 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E8.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E8.py new file mode 100755 index 00000000..52228473 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/E9.py b/test/VisuPrs/ScalarMap_On_DeformedShape/E9.py new file mode 100755 index 00000000..37d9dcb9 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F0.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F0.py new file mode 100755 index 00000000..b6da2bae --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F1.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F1.py new file mode 100755 index 00000000..d98a15d1 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F2.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F2.py new file mode 100755 index 00000000..1a4024a6 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F3.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F3.py new file mode 100755 index 00000000..70e9420d --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F4.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F4.py new file mode 100755 index 00000000..fdc9c517 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F5.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F5.py new file mode 100755 index 00000000..09ee18c7 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F6.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F6.py new file mode 100755 index 00000000..4eab14fb --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py new file mode 100755 index 00000000..80f9a300 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/ScalarMap_On_DeformedShape/F8.py b/test/VisuPrs/ScalarMap_On_DeformedShape/F8.py new file mode 100755 index 00000000..96604d97 --- /dev/null +++ b/test/VisuPrs/ScalarMap_On_DeformedShape/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"ScalarMap_On_DeformedShape/F8") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.DEFORMEDSHAPESCALARMAP], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A0.py b/test/VisuPrs/StreamLines/A0.py new file mode 100644 index 00000000..713e4bea --- /dev/null +++ b/test/VisuPrs/StreamLines/A0.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A0") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A1.py b/test/VisuPrs/StreamLines/A1.py new file mode 100644 index 00000000..e6b68c7f --- /dev/null +++ b/test/VisuPrs/StreamLines/A1.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A1") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A2.py b/test/VisuPrs/StreamLines/A2.py new file mode 100644 index 00000000..39f687a2 --- /dev/null +++ b/test/VisuPrs/StreamLines/A2.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A2") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A3.py b/test/VisuPrs/StreamLines/A3.py new file mode 100644 index 00000000..2b9023e5 --- /dev/null +++ b/test/VisuPrs/StreamLines/A3.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A3") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A4.py b/test/VisuPrs/StreamLines/A4.py new file mode 100644 index 00000000..4bd577b5 --- /dev/null +++ b/test/VisuPrs/StreamLines/A4.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A4") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A5.py b/test/VisuPrs/StreamLines/A5.py new file mode 100644 index 00000000..e57ec3e7 --- /dev/null +++ b/test/VisuPrs/StreamLines/A5.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A5") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A6.py b/test/VisuPrs/StreamLines/A6.py new file mode 100644 index 00000000..147e1775 --- /dev/null +++ b/test/VisuPrs/StreamLines/A6.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A6") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A7.py b/test/VisuPrs/StreamLines/A7.py new file mode 100644 index 00000000..ab4641ff --- /dev/null +++ b/test/VisuPrs/StreamLines/A7.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A7") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A8.py b/test/VisuPrs/StreamLines/A8.py new file mode 100644 index 00000000..62541795 --- /dev/null +++ b/test/VisuPrs/StreamLines/A8.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A8") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/A9.py b/test/VisuPrs/StreamLines/A9.py new file mode 100644 index 00000000..fe7c2c19 --- /dev/null +++ b/test/VisuPrs/StreamLines/A9.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/A9") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/B0.py b/test/VisuPrs/StreamLines/B0.py new file mode 100644 index 00000000..091765c2 --- /dev/null +++ b/test/VisuPrs/StreamLines/B0.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/B0") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/B1.py b/test/VisuPrs/StreamLines/B1.py new file mode 100644 index 00000000..4b683313 --- /dev/null +++ b/test/VisuPrs/StreamLines/B1.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/B1") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/B2.py b/test/VisuPrs/StreamLines/B2.py new file mode 100644 index 00000000..e51fd43d --- /dev/null +++ b/test/VisuPrs/StreamLines/B2.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/B2") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/CMakeLists.txt b/test/VisuPrs/StreamLines/CMakeLists.txt new file mode 100644 index 00000000..a440cf19 --- /dev/null +++ b/test/VisuPrs/StreamLines/CMakeLists.txt @@ -0,0 +1,59 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + ) + ADD_TEST(STREAMLINES_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(STREAMLINES_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) \ No newline at end of file diff --git a/test/VisuPrs/StreamLines/E0.py b/test/VisuPrs/StreamLines/E0.py new file mode 100644 index 00000000..d9bf7b41 --- /dev/null +++ b/test/VisuPrs/StreamLines/E0.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E0") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E1.py b/test/VisuPrs/StreamLines/E1.py new file mode 100644 index 00000000..04f11df0 --- /dev/null +++ b/test/VisuPrs/StreamLines/E1.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E1") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E2.py b/test/VisuPrs/StreamLines/E2.py new file mode 100644 index 00000000..5a603693 --- /dev/null +++ b/test/VisuPrs/StreamLines/E2.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E2") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E3.py b/test/VisuPrs/StreamLines/E3.py new file mode 100644 index 00000000..f600219d --- /dev/null +++ b/test/VisuPrs/StreamLines/E3.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E3") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E4.py b/test/VisuPrs/StreamLines/E4.py new file mode 100644 index 00000000..8e93ea8a --- /dev/null +++ b/test/VisuPrs/StreamLines/E4.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E4") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E5.py b/test/VisuPrs/StreamLines/E5.py new file mode 100644 index 00000000..b5c37777 --- /dev/null +++ b/test/VisuPrs/StreamLines/E5.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E5") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E6.py b/test/VisuPrs/StreamLines/E6.py new file mode 100644 index 00000000..8b17e3b0 --- /dev/null +++ b/test/VisuPrs/StreamLines/E6.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E6") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E7.py b/test/VisuPrs/StreamLines/E7.py new file mode 100644 index 00000000..674b453a --- /dev/null +++ b/test/VisuPrs/StreamLines/E7.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E7") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E8.py b/test/VisuPrs/StreamLines/E8.py new file mode 100644 index 00000000..6abf24b1 --- /dev/null +++ b/test/VisuPrs/StreamLines/E8.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E8") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/E9.py b/test/VisuPrs/StreamLines/E9.py new file mode 100644 index 00000000..4857b5ca --- /dev/null +++ b/test/VisuPrs/StreamLines/E9.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/E9") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F0.py b/test/VisuPrs/StreamLines/F0.py new file mode 100644 index 00000000..797fd878 --- /dev/null +++ b/test/VisuPrs/StreamLines/F0.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F0") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F1.py b/test/VisuPrs/StreamLines/F1.py new file mode 100644 index 00000000..f1cc0d51 --- /dev/null +++ b/test/VisuPrs/StreamLines/F1.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F1") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F2.py b/test/VisuPrs/StreamLines/F2.py new file mode 100644 index 00000000..515aca4a --- /dev/null +++ b/test/VisuPrs/StreamLines/F2.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F2") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F3.py b/test/VisuPrs/StreamLines/F3.py new file mode 100644 index 00000000..9f566403 --- /dev/null +++ b/test/VisuPrs/StreamLines/F3.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F3") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F4.py b/test/VisuPrs/StreamLines/F4.py new file mode 100644 index 00000000..3a4641fd --- /dev/null +++ b/test/VisuPrs/StreamLines/F4.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F4") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F5.py b/test/VisuPrs/StreamLines/F5.py new file mode 100644 index 00000000..a807f0d2 --- /dev/null +++ b/test/VisuPrs/StreamLines/F5.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F5") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F6.py b/test/VisuPrs/StreamLines/F6.py new file mode 100644 index 00000000..239304b6 --- /dev/null +++ b/test/VisuPrs/StreamLines/F6.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F6") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F7.py b/test/VisuPrs/StreamLines/F7.py new file mode 100644 index 00000000..47588116 --- /dev/null +++ b/test/VisuPrs/StreamLines/F7.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F7") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F8.py b/test/VisuPrs/StreamLines/F8.py new file mode 100644 index 00000000..de4229bd --- /dev/null +++ b/test/VisuPrs/StreamLines/F8.py @@ -0,0 +1,41 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F8") + +# Create presentations +myParavis = paravis.myParavis + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "\nCreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.STREAMLINES], picturedir, pictureext) diff --git a/test/VisuPrs/StreamLines/F9.py b/test/VisuPrs/StreamLines/F9.py new file mode 100644 index 00000000..debdd2c6 --- /dev/null +++ b/test/VisuPrs/StreamLines/F9.py @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 case + +import sys + +from paravistest import datadir, pictureext, get_picture_dir +from presentations import StreamLinesOnField, EntityType, \ + reset_view, process_prs_for_test +import paravis +import pvsimple + + +my_paravis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "StreamLines/F9") + +# Import of the "Bug829_resu_mode.med" file +file_path = datadir + "Bug829_resu_mode.med" + +my_paravis.ImportFile(file_path) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + raise RuntimeError("Bug829_resu_mode.med was not imported!!!") + +# Get view +view = pvsimple.GetRenderView() + +# Create a set of Stream Lines, based on time stamps of "MODES_DEPL" field +print "BREAKPOINT_1" + +for i in range(1, 11): + prs = StreamLinesOnField(med_reader, EntityType.NODE, "MODES_DEPL", i) + if prs is None: + raise RuntimeError("Presentation on timestamp {0} is None!!!". + format(i)) + + picture_path = picturedir + "/" + "time_stamp_" + str(i) + "." + pictureext + process_prs_for_test(prs, view, picture_path) + +print "BREAKPOINT_2" diff --git a/test/VisuPrs/Tables/A0.py b/test/VisuPrs/Tables/A0.py new file mode 100755 index 00000000..85a3c8e6 --- /dev/null +++ b/test/VisuPrs/Tables/A0.py @@ -0,0 +1,78 @@ +# Copyright (C) 2010-2012 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. +# +# 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/tables/A0 case +# Import table in Post-Pro specific format from the file; +# choose 'sinus' table; create curve. + +import sys + +from paravistest import tablesdir, get_picture_dir, pictureext +from presentations import * +import paravis +import pvsimple + + +# Import table from file +print 'Import tables_test.xls ....', +file_path = tablesdir + "tables_test.xls" +table_reader = pvsimple.TableReader(FileName=file_path) +if table_reader is None: + print "FAILED" +else: + print "OK" + +# Get available tables +print 'Get available tables .....' +available_tables = table_reader.GetPropertyValue("AvailableTables") +if (available_tables is None) or (len(available_tables) == 0): + print "FAILED" +else: + print available_tables + +# Choose 'sinus' table +table_reader.TableNumber = available_tables.GetData().index('sinus') +table_reader.UpdatePipeline() + +# Create curves +cur_view = pvsimple.GetRenderView() +if cur_view: + pvsimple.Delete(cur_view) +xy_view = pvsimple.CreateXYPlotView() + +# xy_rep = pvsimple.Show(table_reader) +xy_rep = pvsimple.Show(table_reader) +xy_rep.AttributeType = 'Row Data' +xy_rep.UseIndexForXAxis = 0 +x_array = xy_rep.GetPropertyValue("SeriesNamesInfo")[0] +xy_rep.XArrayName = x_array +xy_rep.SeriesVisibility = [x_array, '0'] +pvsimple.Render(xy_view) + +# Write image + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Tables/A0") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +file_name = picturedir + "sinus." + pictureext +pvsimple.WriteImage(file_name, view=xy_view, Magnification=1) + + diff --git a/test/VisuPrs/Tables/A2.py b/test/VisuPrs/Tables/A2.py new file mode 100755 index 00000000..85a541a9 --- /dev/null +++ b/test/VisuPrs/Tables/A2.py @@ -0,0 +1,77 @@ +# Copyright (C) 2010-2012 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. +# +# 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/tables/A2 case +# Import table in Post-Pro specific format from the file; +# create curves. + +import sys + +from paravistest import tablesdir, get_picture_dir, pictureext +from presentations import * +import paravis +import pvsimple + +# Import table from file +print 'Import flux.tab.txt ....', +file_path = tablesdir + "flux.tab.txt" +table_reader = pvsimple.TableReader(FileName=file_path) +if table_reader is None: + print "FAILED" +else: + print "OK" + +# Get available tables +print 'Get available tables .....' +available_tables = table_reader.GetPropertyValue("AvailableTables") +if (available_tables is None) or (len(available_tables) == 0): + print "FAILED" +else: + print available_tables + +# Create curves +cur_view = pvsimple.GetRenderView() +if cur_view: + pvsimple.Delete(cur_view) +xy_view = pvsimple.CreateXYPlotView() + +xy_rep = pvsimple.Show(table_reader) +xy_rep.AttributeType = 'Row Data' +xy_rep.UseIndexForXAxis = 0 +x_array = xy_rep.GetPropertyValue("SeriesNamesInfo")[0] +xy_rep.XArrayName = x_array +xy_rep.SeriesVisibility = [x_array, '0'] + +xy_rep.Visibility = 0 +pvsimple.Render(xy_view) +xy_rep.Visibility = 1 +pvsimple.Render(xy_view) + +# Write image + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1], "Tables/A2") +if not picturedir.endswith(os.sep): + picturedir += os.sep + +file_name = picturedir + "flux_tab." + pictureext +pvsimple.WriteImage(file_name, view=xy_view, Magnification=1) + + + diff --git a/test/VisuPrs/Tables/CMakeLists.txt b/test/VisuPrs/Tables/CMakeLists.txt new file mode 100644 index 00000000..8a1ecb44 --- /dev/null +++ b/test/VisuPrs/Tables/CMakeLists.txt @@ -0,0 +1,28 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A2 + ) + ADD_TEST(TABLES_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(TABLES_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/Util/CMakeLists.txt b/test/VisuPrs/Util/CMakeLists.txt new file mode 100644 index 00000000..d3247b1f --- /dev/null +++ b/test/VisuPrs/Util/CMakeLists.txt @@ -0,0 +1,33 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +SET(dist_testscript_DATA + paravistest.py + ) + +FOREACH(f ${dist_testscript_DATA}) + INSTALL(FILES ${f} DESTINATION bin/salome) + + INSTALL(CODE "SET(PYTHON_FILE ${f})") + INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})") + INSTALL(CODE "SET(DEST bin/salome)") + INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})") + INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake) + +ENDFOREACH(f ${dist_testscript_DATA}) diff --git a/test/VisuPrs/Util/paravistest.py b/test/VisuPrs/Util/paravistest.py new file mode 100755 index 00000000..c59d281f --- /dev/null +++ b/test/VisuPrs/Util/paravistest.py @@ -0,0 +1,204 @@ +# Copyright (C) 2010-2012 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. +# +# 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 module provides auxiliary classes, functions and variables for testing. +""" + +#from __future__ import print_function + +from math import fabs +import os +from datetime import date + +import salome + + +# Auxiliary variables + +# Data directory +samples_dir = os.getenv("DATA_DIR") +datadir = None +tablesdir = None +if samples_dir is not None: + samples_dir = os.path.normpath(samples_dir) + datadir = samples_dir + "/MedFiles/" + tablesdir = samples_dir + "/Tables/" + +# Graphica files extension +pictureext = os.getenv("PIC_EXT") +if pictureext == None: + pictureext = "png" + + +# Auxiliary classes +class RepresentationType: + """ + Types of representation. + """ + OUTLINE = 0 + POINTS = 1 + WIREFRAME = 2 + SURFACE = 3 + SURFACEEDGES = 4 + VOLUME = 5 + POINTSPRITE = 6 + + _type2name = {OUTLINE: 'Outline', + POINTS: 'Points', + WIREFRAME: 'Wireframe', + SURFACE: 'Surface', + SURFACEEDGES: 'Surface With Edges', + VOLUME: 'Volume', + POINTSPRITE: 'Point Sprite'} + + @classmethod + def get_name(cls, type): + """Return paraview representation type by the primitive type.""" + return cls._type2name[type] + + +class SalomeSession(object): + def __init__(self): + import runSalome + import sys + sys.argv += ["--killall"] + sys.argv += ["--show-desktop=1"] + sys.argv += ["--splash=0"] + sys.argv += ["--modules=MED,VISU,PARAVIS"] + clt, d = runSalome.main() + port = d['port'] + self.port = port + return + + def __del__(self): + #os.system('killSalomeWithPort.py {0}'.format(self.port)) + #os.system('killSalomeWithPort.py ' + self.port) + import killSalomeWithPort + killSalomeWithPort.killMyPort(self.port) + return + pass + + +# Auxiliary functions +def test_values(value, et_value, check_error=0): + """Test values.""" + error = 0 + length = len(value) + et_length = len(et_value) + if (length != et_length): + err_msg = "ERROR!!! There is different number of created " + str(length) + " and etalon " + str(et_length) + " values!!!" + print err_msg + error = error + 1 + else: + for i in range(et_length): + if abs(et_value[i]) > 1: + max_val = abs(0.001 * et_value[i]) + if abs(et_value[i] - value[i]) > max_val: + err_msg = "ERROR!!! Got value " + str(value[i]) + " is not equal to etalon value " + str(ret_value[i]) + "!!!" + print err_msg + error = error + 1 + else: + max_val = 0.001 + if abs(et_value[i] - value[i]) > max_val: + err_msg = "ERROR!!! Got value " + value[i] + " is not equal to etalon value " + et_value[i] + "!!!" + error = error + 1 + if check_error and error > 0: + err_msg = ("There is(are) some error(s) was(were) found... " + "For more info see ERRORs above...") + raise RuntimeError(err_msg) + return error + + +def get_picture_dir(pic_dir, subdir): + res_dir = pic_dir + if not res_dir: + res_dir = "/tmp/pic" + + # Add current date and subdirectory for the case to the directory path + cur_date = date.today().strftime("%d%m%Y") + res_dir += "/test_" + cur_date + "/" + subdir + # Create the directory if doesn't exist + res_dir = os.path.normpath(res_dir) + if not os.path.exists(res_dir): + os.makedirs(res_dir) + else: + # Clean the directory + for root, dirs, files in os.walk(res_dir): + for f in files: + os.remove(os.path.join(root, f)) + + return res_dir + + +def call_and_check(prs, property_name, value, do_raise=1, compare_toler=-1.0): + """Utility function for 3D viewer test for common check of different + types of presentation parameters set""" + try: + prs.SetPropertyWithName(property_name, value) + except ValueError: + error_string = (str(value) + "value of " + property_name + " is not available for this type of presentations") + else: + error_string = None + is_good = (error_string is None) + if not is_good: + if do_raise: + raise RuntimeError(error_string) + else: + print error_string + else: + # compare just set value and the one got from presentation + really_set_value = prs.GetPropertyValue(property_name) + is_equal = 1 + if compare_toler > 0: + is_equal = (fabs(really_set_value - value) < compare_toler) + else: + is_equal = (really_set_value == value) + if not is_equal: + msg = str(really_set_value) + " has been set instead" + if do_raise: + raise RuntimeError(msg) + else: + print msg + is_good = False + + return is_good + + +def setShaded(view, shading): + """Utility function to set shaded mode in view""" + if shading == 0: + view.LightDiffuseColor = [1, 1, 1] + if shading == 1: + view.LightDiffuseColor = [0, 0, 0] + + +# Run Salome +salome_session = SalomeSession() +salome.salome_init() + +# Create new study +print "Creating new study...", +aStudy = salome.myStudyManager.NewStudy("Study1") +if aStudy is None: + raise RuntimeError("FAILED") +else: + print "OK" + +salome.myStudy = aStudy diff --git a/test/VisuPrs/Vectors/A0.py b/test/VisuPrs/Vectors/A0.py new file mode 100644 index 00000000..c3eabd99 --- /dev/null +++ b/test/VisuPrs/Vectors/A0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A0") + +file = datadir + "fra.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A1.py b/test/VisuPrs/Vectors/A1.py new file mode 100755 index 00000000..5d42be80 --- /dev/null +++ b/test/VisuPrs/Vectors/A1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A1") + +file = datadir + "hexa_28320_ELEM.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A2.py b/test/VisuPrs/Vectors/A2.py new file mode 100644 index 00000000..16f05696 --- /dev/null +++ b/test/VisuPrs/Vectors/A2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A2") + +file = datadir + "pointe.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A3.py b/test/VisuPrs/Vectors/A3.py new file mode 100755 index 00000000..99665c5e --- /dev/null +++ b/test/VisuPrs/Vectors/A3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A3") + +file = datadir + "Fields_group3D.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A4.py b/test/VisuPrs/Vectors/A4.py new file mode 100755 index 00000000..ccb12afe --- /dev/null +++ b/test/VisuPrs/Vectors/A4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A4") + +file = datadir + "Hexa8.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A5.py b/test/VisuPrs/Vectors/A5.py new file mode 100755 index 00000000..5dbf434f --- /dev/null +++ b/test/VisuPrs/Vectors/A5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A5") + +file = datadir + "Penta6.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A6.py b/test/VisuPrs/Vectors/A6.py new file mode 100644 index 00000000..248d8eec --- /dev/null +++ b/test/VisuPrs/Vectors/A6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A6") + +file = datadir + "clo.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A7.py b/test/VisuPrs/Vectors/A7.py new file mode 100755 index 00000000..1d8c0f40 --- /dev/null +++ b/test/VisuPrs/Vectors/A7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A7") + +file = datadir + "Tetra4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A8.py b/test/VisuPrs/Vectors/A8.py new file mode 100755 index 00000000..f013d6f1 --- /dev/null +++ b/test/VisuPrs/Vectors/A8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A8") + +file = datadir + "Tria3.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/A9.py b/test/VisuPrs/Vectors/A9.py new file mode 100755 index 00000000..bb3aaef5 --- /dev/null +++ b/test/VisuPrs/Vectors/A9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/A9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/A9") + +file = datadir + "Quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/B0.py b/test/VisuPrs/Vectors/B0.py new file mode 100755 index 00000000..b2eba7a6 --- /dev/null +++ b/test/VisuPrs/Vectors/B0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/B0") + +file = datadir + "carre_en_quad4_seg2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/B1.py b/test/VisuPrs/Vectors/B1.py new file mode 100755 index 00000000..b8adb40b --- /dev/null +++ b/test/VisuPrs/Vectors/B1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/B1") + +file = datadir + "carre_en_quad4_seg2_fields.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/B2.py b/test/VisuPrs/Vectors/B2.py new file mode 100755 index 00000000..457913b7 --- /dev/null +++ b/test/VisuPrs/Vectors/B2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/B2") + +file = datadir + "cube_hexa8_quad4.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/B3.py b/test/VisuPrs/Vectors/B3.py new file mode 100644 index 00000000..9e7d5e7f --- /dev/null +++ b/test/VisuPrs/Vectors/B3.py @@ -0,0 +1,128 @@ +# Copyright (C) 2010-2012 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. +# +# 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/B3 case + +import sys + +from paravistest import datadir +from presentations import VectorsOnField, EntityType +import paravis +import pvsimple + +my_paravis = paravis.myParavis + +#====================Stage1: Importing MED file==================== + +print "**** Stage1: Importing MED file" + +print 'Import "ResOK_0000.med"...............', +medFile = datadir + "ResOK_0000.med" +my_paravis.ImportFile(medFile) +med_reader = pvsimple.GetActiveSource() + +if med_reader is None: + print "FAILED" +else: + print "OK" + +cell_entity = EntityType.CELL +node_entity = EntityType.NODE + +#====================Stage2: Creation of Vectors==================== + +print "Creating Vectors..........", +vectors = VectorsOnField(med_reader, node_entity, 'vitesse', 1) + +if vectors is None: + print "FAILED" +else: + print "OK" + +#====================Stage3: Change properties====================== +glyph = vectors.Input + +print "Default LineWidth : ", vectors.LineWidth +print "Default GlyphType : ", glyph.GlyphType +print "Default subtype : ", glyph.GlyphType.GlyphType +print "Default GlyphPos : ", glyph.GlyphType.Center + +print "Changing value of line width" +width = -10 +vectors.LineWidth = width +print "Negative value -10 : ", vectors.LineWidth +pvsimple.Render() + +width = 10 +vectors.LineWidth = width +print "Positive value 10 : ", vectors.LineWidth +pvsimple.Render() + +width = 0 +vectors.LineWidth = width +print "Zero value 0 : ", vectors.LineWidth +pvsimple.Render() + +width = 2 +vectors.LineWidth = width +print "Positive value 2 : ", vectors.LineWidth +pvsimple.Render() + +print "Changing glyph type" +gtype = "Arrow" +glyph.GlyphType = gtype +print "Arrow type : ", glyph.GlyphType +pvsimple.Render() + +gtype = "Cone" +glyph.GlyphType = gtype +glyph.GlyphType.Resolution = 3 +glyph.GlyphType.Height = 4 +print "Cone type: " + str(glyph.GlyphType) + ", resolution: " + str(glyph.GlyphType.Resolution) +pvsimple.Render() + +glyph.GlyphType.Resolution = 6 +print "Cone type: " + str(glyph.GlyphType) + ", resolution: " + str(glyph.GlyphType.Resolution) +pvsimple.Render() + +gtype = "Line" +glyph.GlyphType = gtype +print "Line Type : ", glyph.GlyphType +pvsimple.Render() + +gtype = "2D Glyph" +glyph.GlyphType = gtype +glyph.GlyphType.GlyphType = "Arrow" +pvsimple.Render() + +print "Changing glyph position" +pos = [0.0, 0.0, 0.0] +glyph.GlyphType.Center = pos +print "Center position : ", glyph.GlyphType.Center +pvsimple.Render() + +pos = [0.5, 0.0, 0.0] +glyph.GlyphType.Center = pos +print "Tail position : ", glyph.GlyphType.Center +pvsimple.Render() + +pos = [-0.5, 0.0, 0.0] +glyph.GlyphType.Center = pos +print "Head position : ", glyph.GlyphType.Center +pvsimple.Render() diff --git a/test/VisuPrs/Vectors/CMakeLists.txt b/test/VisuPrs/Vectors/CMakeLists.txt new file mode 100644 index 00000000..9fd9cdc3 --- /dev/null +++ b/test/VisuPrs/Vectors/CMakeLists.txt @@ -0,0 +1,60 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + +IF (PYTHON_EXECUTABLE) + FOREACH ( tfile + A0 + A1 + A2 + A3 + A4 + A5 + A6 + A7 + A8 + A9 + B0 + B1 + B2 + B3 + E0 + E1 + E2 + E3 + E4 + E5 + E6 + E7 + E8 + E9 + F0 + F1 + F2 + F3 + F4 + F5 + F6 + F7 + F8 + F9 + ) + ADD_TEST(VECTORS_${tfile} ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/${tfile}.py ${PARAVIS_TEST_OUTPUT_DIR}) + SET_TESTS_PROPERTIES(VECTORS_${tfile} PROPERTIES FAIL_REGULAR_EXPRESSION "FAILED") + ENDFOREACH( tfile ) +ENDIF (PYTHON_EXECUTABLE) diff --git a/test/VisuPrs/Vectors/E0.py b/test/VisuPrs/Vectors/E0.py new file mode 100755 index 00000000..111b284f --- /dev/null +++ b/test/VisuPrs/Vectors/E0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E0") + +file = datadir + "test_55_solid_concentr_dom.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E1.py b/test/VisuPrs/Vectors/E1.py new file mode 100755 index 00000000..c6ce5aec --- /dev/null +++ b/test/VisuPrs/Vectors/E1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E1") + +file = datadir + "H_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E2.py b/test/VisuPrs/Vectors/E2.py new file mode 100755 index 00000000..a1b0f0f4 --- /dev/null +++ b/test/VisuPrs/Vectors/E2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E2") + +file = datadir + "cas2_2d_couplage_chess_castem.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E3.py b/test/VisuPrs/Vectors/E3.py new file mode 100644 index 00000000..41b7d2eb --- /dev/null +++ b/test/VisuPrs/Vectors/E3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E3") + +file = datadir + "hydro_d10.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E4.py b/test/VisuPrs/Vectors/E4.py new file mode 100755 index 00000000..48740511 --- /dev/null +++ b/test/VisuPrs/Vectors/E4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E4") + +file = datadir + "champc.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E5.py b/test/VisuPrs/Vectors/E5.py new file mode 100755 index 00000000..370c24cb --- /dev/null +++ b/test/VisuPrs/Vectors/E5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E5") + +file = datadir + "hydro_sea_alv.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E6.py b/test/VisuPrs/Vectors/E6.py new file mode 100755 index 00000000..f333fde0 --- /dev/null +++ b/test/VisuPrs/Vectors/E6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E6") + +file = datadir + "toto.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E7.py b/test/VisuPrs/Vectors/E7.py new file mode 100755 index 00000000..4dbc73a9 --- /dev/null +++ b/test/VisuPrs/Vectors/E7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E7 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E7") + +file = datadir + "couplex_alain.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E8.py b/test/VisuPrs/Vectors/E8.py new file mode 100755 index 00000000..21d72758 --- /dev/null +++ b/test/VisuPrs/Vectors/E8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E8") + +file = datadir + "KCOUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/E9.py b/test/VisuPrs/Vectors/E9.py new file mode 100755 index 00000000..2126a2cd --- /dev/null +++ b/test/VisuPrs/Vectors/E9.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/E9 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/E9") + +file = datadir + "test_hydro.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F0.py b/test/VisuPrs/Vectors/F0.py new file mode 100644 index 00000000..87db6bf6 --- /dev/null +++ b/test/VisuPrs/Vectors/F0.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F0 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F0") + +file = datadir + "gro5couches.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F1.py b/test/VisuPrs/Vectors/F1.py new file mode 100755 index 00000000..f8c5dfc0 --- /dev/null +++ b/test/VisuPrs/Vectors/F1.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F1 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F1") + +file = datadir + "ml.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F2.py b/test/VisuPrs/Vectors/F2.py new file mode 100755 index 00000000..d6b9c22e --- /dev/null +++ b/test/VisuPrs/Vectors/F2.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F2 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F2") + +file = datadir + "T_COUPLEX1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F3.py b/test/VisuPrs/Vectors/F3.py new file mode 100755 index 00000000..f0cc6ccb --- /dev/null +++ b/test/VisuPrs/Vectors/F3.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F3 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F3") + +file = datadir + "test_hydro_darcy4_out.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F4.py b/test/VisuPrs/Vectors/F4.py new file mode 100755 index 00000000..61de3f8f --- /dev/null +++ b/test/VisuPrs/Vectors/F4.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F4 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F4") + +file = datadir + "UO2_250ans.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F5.py b/test/VisuPrs/Vectors/F5.py new file mode 100755 index 00000000..d4361a4e --- /dev/null +++ b/test/VisuPrs/Vectors/F5.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F5 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F5") + +file = datadir + "maill.1.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F6.py b/test/VisuPrs/Vectors/F6.py new file mode 100755 index 00000000..4e5742ed --- /dev/null +++ b/test/VisuPrs/Vectors/F6.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F6 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F6") + +file = datadir + "maill.0.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F7.py b/test/VisuPrs/Vectors/F7.py new file mode 100644 index 00000000..0c00630f --- /dev/null +++ b/test/VisuPrs/Vectors/F7.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F7") + +file = datadir + "occ4050.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F8.py b/test/VisuPrs/Vectors/F8.py new file mode 100755 index 00000000..bb1c0f96 --- /dev/null +++ b/test/VisuPrs/Vectors/F8.py @@ -0,0 +1,39 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F8 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 +import paravis + +# Create presentations +myParavis = paravis.myParavis + +# Directory for saving snapshots +picturedir = get_picture_dir(sys.argv[1],"Vectors/F8") + +file = datadir + "maill.2.med" +print " --------------------------------- " +print "file ", file +print " --------------------------------- " +print "CreatePrsForFile..." +CreatePrsForFile(myParavis, file, [PrsTypeEnum.VECTORS], picturedir, pictureext) diff --git a/test/VisuPrs/Vectors/F9.py b/test/VisuPrs/Vectors/F9.py new file mode 100644 index 00000000..d452f31d --- /dev/null +++ b/test/VisuPrs/Vectors/F9.py @@ -0,0 +1,85 @@ +# Copyright (C) 2010-2012 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. +# +# 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/F9 case +# Create Vectors for field of the the given MED file for 10 timestamps% + +import sys +from paravistest import datadir, pictureext, get_picture_dir +import paravis +from pvsimple import GetActiveSource, GetRenderView, Render +from presentations import VectorsOnField, hide_all,EntityType,PrsTypeEnum,reset_view,process_prs_for_test + +# Create presentations +myParavis = paravis.myParavis + +picturedir = get_picture_dir(sys.argv[1], "Vectors/F9") + +theFileName = datadir + "Bug829_resu_mode.med" +print " --------------------------------- " +print "file ", theFileName +print " --------------------------------- " + +"""Build presentations of the given types for all fields of the given file.""" +#print "Import %s..." % theFileName.split('/')[-1], +result = myParavis.ImportFile(theFileName) +aProxy = GetActiveSource() +if aProxy is None: + raise RuntimeError, "Error: can't import file." +else: print "OK" +# Get view +aView = GetRenderView() + +# Create required presentations for the proxy +# CreatePrsForProxy(aProxy, aView, thePrsTypeList, thePictureDir, thePictureExt, theIsAutoDelete) +aFieldNames = aProxy.PointArrays.GetData() +aNbOnNodes = len(aFieldNames) +aFieldNames.extend(aProxy.CellArrays.GetData()) +aTimeStamps = aProxy.TimestepValues.GetData() +aFieldEntity = EntityType.NODE +aFieldName = "MODES_DEPL" + +#Creation of a set of non-colored and then colored Vectors presentations, based on time stamps of MODES_DEP field +for colored in [False,True]: + colored_str = "_non-colored" + if colored: + colored_str = "_colored" + for i in range(1,11): + hide_all(aView, True) + aPrs = VectorsOnField(aProxy, aFieldEntity, aFieldName, i, is_colored=colored) + if aPrs is None: + raise RuntimeError, "Presentation is None!!!" + # display only current deformed shape + #display_only(aView,aPrs) + aPrs.Visibility =1 + reset_view(aView) + Render(aView) + # Add path separator to the end of picture path if necessery + if not picturedir.endswith(os.sep): + picturedir += os.sep + prs_type = PrsTypeEnum.VECTORS + + # Get name of presentation type + prs_name = PrsTypeEnum.get_name(prs_type) + f_prs_type = prs_name.replace(' ', '').upper() + # Construct image file name + pic_name = picturedir + aFieldName+colored_str + "_" + str(i) + "_" + f_prs_type + "." + pictureext + # Show and record the presentation + process_prs_for_test(aPrs, aView, pic_name) + diff --git a/test/demo0.py b/test/demo0.py index 0237e78f..5ce0dd2f 100755 --- a/test/demo0.py +++ b/test/demo0.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 module can be used to run a simple rendering benchmark test. This test renders a sphere with various rendering settings and reports the rendering rate achieved in triangles/sec. """ @@ -53,29 +72,29 @@ def run(filesour, impth, nframes): results = [] # Start with these defaults - v.UseImmediateMode = 0 - v.UseTriangleStrips = 0 + #v.UseImmediateMode = 0 + #v.UseTriangleStrips = 0 # Test different configurations title = 'display lists, no triangle strips, solid color' - v.UseImmediateMode = 0 - v.UseTriangleStrips = 0 + #v.UseImmediateMode = 0 + #v.UseTriangleStrips = 0 results.append(render(ss, v, title, nframes)) WriteImage(filename = (impth + "demo0_1.png"), view=v, Magnification=2) title = 'display lists, triangle strips, solid color' - v.UseTriangleStrips = 1 + #v.UseTriangleStrips = 1 results.append(render(ss, v, title, nframes)) #WriteImage(filename = (impth + "demo0_2.png"), view=v, Magnification=2) title = 'no display lists, no triangle strips, solid color' - v.UseImmediateMode = 1 - v.UseTriangleStrips = 0 + #v.UseImmediateMode = 1 + #v.UseTriangleStrips = 0 results.append(render(ss, v, title, nframes)) #WriteImage(filename = (impth + "demo0_3.png"), view=v, Magnification=2) title = 'no display lists, triangle strips, solid color' - v.UseTriangleStrips = 1 + #v.UseTriangleStrips = 1 results.append(render(ss, v, title, nframes)) #WriteImage(filename = (impth + "demo0_4.png"), view=v, Magnification=2) @@ -89,25 +108,25 @@ def run(filesour, impth, nframes): lt.VectorComponent = 0 title = 'display lists, no triangle strips, color by array' - v.UseImmediateMode = 0 - v.UseTriangleStrips = 0 + #v.UseImmediateMode = 0 + #v.UseTriangleStrips = 0 results.append(render(ss, v, title, nframes)) #WriteImage(filename = (impth + "demo0_5.png"), view=v, Magnification=2) title = 'display lists, triangle strips, color by array' - v.UseTriangleStrips = 1 + #v.UseTriangleStrips = 1 results.append(render(ss, v, title, nframes)) - v.UseImmediateMode = 1 + #v.UseImmediateMode = 1 #WriteImage(filename = (impth + "demo0_6.png"), view=v, Magnification=2) title = 'no display lists, no triangle strips, color by array' - v.UseImmediateMode = 1 - v.UseTriangleStrips = 0 + #v.UseOCImmediateMode = 1 + #v.UseTriangleStrips = 0 results.append(render(ss, v, title, nframes)) #WriteImage(filename = (impth + "demo0_7.png"), view=v, Magnification=2) title = 'no display lists, triangle strips, color by array' - v.UseTriangleStrips = 1 + #v.UseTriangleStrips = 1 results.append(render(ss, v, title, nframes)) WriteImage(filename = (impth + "demo0_8.png"), view=v, Magnification=2) diff --git a/test/demo1.py b/test/demo1.py index e7d66325..59a4cfdc 100755 --- a/test/demo1.py +++ b/test/demo1.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo10.py b/test/demo10.py index 2c1cbd40..aae2400d 100755 --- a/test/demo10.py +++ b/test/demo10.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo11.py b/test/demo11.py index dd052432..60d8ffb7 100755 --- a/test/demo11.py +++ b/test/demo11.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo12.py b/test/demo12.py index b6533be0..2e125055 100755 --- a/test/demo12.py +++ b/test/demo12.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo2.py b/test/demo2.py index 2c591fcf..43d264b4 100755 --- a/test/demo2.py +++ b/test/demo2.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo3.py b/test/demo3.py index 344652f0..c1e582ca 100755 --- a/test/demo3.py +++ b/test/demo3.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo4.py b/test/demo4.py index 4b8d6506..65737250 100755 --- a/test/demo4.py +++ b/test/demo4.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo5.py b/test/demo5.py index 89db63be..8f5b820e 100755 --- a/test/demo5.py +++ b/test/demo5.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo6.py b/test/demo6.py index ebd3b9f6..f4ab5297 100755 --- a/test/demo6.py +++ b/test/demo6.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo7.py b/test/demo7.py index c13d89d2..d5dcb241 100755 --- a/test/demo7.py +++ b/test/demo7.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo8.py b/test/demo8.py index 507f7235..c4f85a89 100755 --- a/test/demo8.py +++ b/test/demo8.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo9.py b/test/demo9.py index e8a60c79..7951beb9 100755 --- a/test/demo9.py +++ b/test/demo9.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + if not ('servermanager' in dir()): from pvsimple import * diff --git a/test/demo_14_med.py b/test/demo_14_med.py index f9ff0141..bc74f83b 100755 --- a/test/demo_14_med.py +++ b/test/demo_14_med.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + """ MEDReader test script. Before launching the script necessary MED files has to be placed into ${TESTDIR}/MedData directory diff --git a/test/demo_15_med.py b/test/demo_15_med.py index 3dc4bac6..066e310b 100755 --- a/test/demo_15_med.py +++ b/test/demo_15_med.py @@ -1,3 +1,22 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + # ATTENTION. This script is prepared for the future not for current moment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! diff --git a/wrapfiles.cmake b/wrapfiles.cmake index 1d8e276e..a5aabc1a 100644 --- a/wrapfiles.cmake +++ b/wrapfiles.cmake @@ -1,5 +1,24 @@ +# Copyright (C) 2010-2012 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. +# +# 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 +# + ADD_CUSTOM_COMMAND( - OUTPUT wrapfiles.txt + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/wrapfiles.txt COMMAND pvpython ${CMAKE_SOURCE_DIR}/getwrapclasses.py DEPENDS ${CMAKE_SOURCE_DIR}/getwrapclasses.py ${PARAVIEW_PYTHON_EXECUTABLE} ) -- 2.39.2