From f1519c7ef36cf42aaef99bad0aa5ba3d7d562c31 Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 2 Oct 2013 13:13:33 +0000 Subject: [PATCH] Merge from BR_V7_main_Field branch (02/09/2013) --- CMakeLists.txt | 6 +- adm_local/cmake_files/FindGEOM.cmake | 87 +- .../cmake_files/SalomeGEOMConfig.cmake.in | 26 +- doc/salome/gui/GEOM/images/exportxao_dlg.png | Bin 0 -> 9423 bytes .../gui/GEOM/input/creating_adv_obj.doc | 1 - doc/salome/gui/GEOM/input/export_xao.doc | 21 + doc/salome/gui/GEOM/input/import_xao.doc | 8 + doc/salome/gui/GEOM/input/index.doc | 10 +- .../GEOM/input/tui_importexport_geom_objs.doc | 18 + doc/salome/gui/GEOM/input/xao_format.doc | 10 + idl/GEOM_Gen.idl | 25 + idl/GEOM_Superv.idl | 5 + resources/CMakeLists.txt | 1 + resources/GEOMCatalog.xml.in | 116 ++- resources/exportxao.png | Bin 0 -> 608 bytes resources/importxao.png | Bin 0 -> 544 bytes src/CMakeLists.txt | 5 +- src/GEOMBase/GEOMBase_Helper.cxx | 44 +- src/GEOMBase/GEOMBase_Helper.h | 1 + src/GEOMGUI/GEOM_images.ts | 21 + src/GEOMGUI/GEOM_msg_en.ts | 102 +++ src/GEOMGUI/GEOM_msg_fr.ts | 102 +++ src/GEOMGUI/GeometryGUI.cxx | 16 + src/GEOMGUI/GeometryGUI_Operations.h | 3 + src/GEOMImpl/CMakeLists.txt | 21 +- src/GEOMImpl/GEOMImpl_Gen.cxx | 6 + src/GEOMImpl/GEOMImpl_IImportExportXAO.hxx | 41 + src/GEOMImpl/GEOMImpl_IInsertOperations.cxx | 418 +++++++++ src/GEOMImpl/GEOMImpl_IInsertOperations.hxx | 50 +- src/GEOMImpl/GEOMImpl_Types.hxx | 6 + src/GEOMImpl/GEOMImpl_XAODriver.cxx | 128 +++ src/GEOMImpl/GEOMImpl_XAODriver.hxx | 147 ++++ src/GEOMImpl/GUID.txt | 3 + src/GEOM_I/CMakeLists.txt | 5 +- src/GEOM_I/GEOM_IInsertOperations_i.cc | 116 +++ src/GEOM_I/GEOM_IInsertOperations_i.hh | 14 +- src/GEOM_I_Superv/GEOM_Superv_i.cc | 24 + src/GEOM_I_Superv/GEOM_Superv_i.hh | 9 + src/GEOM_SWIG/geomBuilder.py | 30 + src/ImportExportGUI/CMakeLists.txt | 91 ++ src/ImportExportGUI/ImportExportGUI.cxx | 98 +++ src/ImportExportGUI/ImportExportGUI.h | 41 + .../ImportExportGUI_ExportXAODlg.cxx | 383 +++++++++ .../ImportExportGUI_ExportXAODlg.h | 76 ++ .../ImportExportGUI_ImportXAODlg.cxx | 266 ++++++ .../ImportExportGUI_ImportXAODlg.h | 66 ++ src/XAO/CMakeLists.txt | 97 +++ src/XAO/XAO_BooleanField.cxx | 61 ++ src/XAO/XAO_BooleanField.hxx | 77 ++ src/XAO/XAO_BooleanStep.cxx | 148 ++++ src/XAO/XAO_BooleanStep.hxx | 114 +++ src/XAO/XAO_BrepGeometry.cxx | 401 +++++++++ src/XAO/XAO_BrepGeometry.hxx | 318 +++++++ src/XAO/XAO_DoubleField.cxx | 60 ++ src/XAO/XAO_DoubleField.hxx | 76 ++ src/XAO/XAO_DoubleStep.cxx | 148 ++++ src/XAO/XAO_DoubleStep.hxx | 114 +++ src/XAO/XAO_Exception.hxx | 67 ++ src/XAO/XAO_Field.cxx | 138 +++ src/XAO/XAO_Field.hxx | 213 +++++ src/XAO/XAO_GeometricElement.cxx | 131 +++ src/XAO/XAO_GeometricElement.hxx | 213 +++++ src/XAO/XAO_Geometry.cxx | 195 +++++ src/XAO/XAO_Geometry.hxx | 168 ++++ src/XAO/XAO_Group.cxx | 61 ++ src/XAO/XAO_Group.hxx | 157 ++++ src/XAO/XAO_IntegerField.cxx | 60 ++ src/XAO/XAO_IntegerField.hxx | 76 ++ src/XAO/XAO_IntegerStep.cxx | 148 ++++ src/XAO/XAO_IntegerStep.hxx | 114 +++ src/XAO/XAO_Step.cxx | 79 ++ src/XAO/XAO_Step.hxx | 152 ++++ src/XAO/XAO_StringField.cxx | 60 ++ src/XAO/XAO_StringField.hxx | 76 ++ src/XAO/XAO_StringStep.cxx | 147 ++++ src/XAO/XAO_StringStep.hxx | 115 +++ src/XAO/XAO_Xao.cxx | 294 +++++++ src/XAO/XAO_Xao.hxx | 254 ++++++ src/XAO/XAO_XaoExporter.cxx | 626 ++++++++++++++ src/XAO/XAO_XaoExporter.hxx | 109 +++ src/XAO/XAO_XaoUtils.cxx | 165 ++++ src/XAO/XAO_XaoUtils.hxx | 200 +++++ src/XAO/tests/BrepGeometryTest.cxx | 305 +++++++ src/XAO/tests/BrepGeometryTest.hxx | 45 + src/XAO/tests/CMakeLists.txt | 62 ++ src/XAO/tests/FieldTest.cxx | 480 +++++++++++ src/XAO/tests/FieldTest.hxx | 55 ++ src/XAO/tests/GeometryTest.cxx | 142 +++ src/XAO/tests/GeometryTest.hxx | 30 + src/XAO/tests/GroupTest.cxx | 58 ++ src/XAO/tests/GroupTest.hxx | 25 + src/XAO/tests/ImportExportTest.cxx | 187 ++++ src/XAO/tests/ImportExportTest.hxx | 35 + src/XAO/tests/MainTest.hxx | 161 ++++ src/XAO/tests/TestUtils.hxx | 36 + src/XAO/tests/XAOTests.cxx | 17 + src/XAO/tests/XaoTest.cxx | 103 +++ src/XAO/tests/XaoTest.hxx | 27 + src/XAO/tests/XaoUtilsTest.cxx | 88 ++ src/XAO/tests/XaoUtilsTest.hxx | 33 + src/XAO/tests/coverage_report.sh | 65 ++ src/XAO/tests/data/Box_1.brep | 366 ++++++++ src/XAO/tests/data/Box_2.brep | 716 ++++++++++++++++ src/XAO/tests/data/Cut_2.brep | 806 ++++++++++++++++++ src/XAO/tests/data/test.xao | 345 ++++++++ src/XAO_Swig/CMakeLists.txt | 68 ++ src/XAO_Swig/xao.i | 72 ++ 107 files changed, 12500 insertions(+), 126 deletions(-) create mode 100644 doc/salome/gui/GEOM/images/exportxao_dlg.png delete mode 100644 doc/salome/gui/GEOM/input/creating_adv_obj.doc create mode 100644 doc/salome/gui/GEOM/input/export_xao.doc create mode 100644 doc/salome/gui/GEOM/input/import_xao.doc create mode 100644 doc/salome/gui/GEOM/input/tui_importexport_geom_objs.doc create mode 100644 doc/salome/gui/GEOM/input/xao_format.doc create mode 100644 resources/exportxao.png create mode 100644 resources/importxao.png create mode 100644 src/GEOMImpl/GEOMImpl_IImportExportXAO.hxx create mode 100644 src/GEOMImpl/GEOMImpl_XAODriver.cxx create mode 100644 src/GEOMImpl/GEOMImpl_XAODriver.hxx create mode 100644 src/ImportExportGUI/CMakeLists.txt create mode 100644 src/ImportExportGUI/ImportExportGUI.cxx create mode 100644 src/ImportExportGUI/ImportExportGUI.h create mode 100644 src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx create mode 100644 src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h create mode 100644 src/ImportExportGUI/ImportExportGUI_ImportXAODlg.cxx create mode 100644 src/ImportExportGUI/ImportExportGUI_ImportXAODlg.h create mode 100644 src/XAO/CMakeLists.txt create mode 100644 src/XAO/XAO_BooleanField.cxx create mode 100644 src/XAO/XAO_BooleanField.hxx create mode 100644 src/XAO/XAO_BooleanStep.cxx create mode 100644 src/XAO/XAO_BooleanStep.hxx create mode 100644 src/XAO/XAO_BrepGeometry.cxx create mode 100644 src/XAO/XAO_BrepGeometry.hxx create mode 100644 src/XAO/XAO_DoubleField.cxx create mode 100644 src/XAO/XAO_DoubleField.hxx create mode 100644 src/XAO/XAO_DoubleStep.cxx create mode 100644 src/XAO/XAO_DoubleStep.hxx create mode 100644 src/XAO/XAO_Exception.hxx create mode 100644 src/XAO/XAO_Field.cxx create mode 100644 src/XAO/XAO_Field.hxx create mode 100644 src/XAO/XAO_GeometricElement.cxx create mode 100644 src/XAO/XAO_GeometricElement.hxx create mode 100644 src/XAO/XAO_Geometry.cxx create mode 100644 src/XAO/XAO_Geometry.hxx create mode 100644 src/XAO/XAO_Group.cxx create mode 100644 src/XAO/XAO_Group.hxx create mode 100644 src/XAO/XAO_IntegerField.cxx create mode 100644 src/XAO/XAO_IntegerField.hxx create mode 100644 src/XAO/XAO_IntegerStep.cxx create mode 100644 src/XAO/XAO_IntegerStep.hxx create mode 100644 src/XAO/XAO_Step.cxx create mode 100644 src/XAO/XAO_Step.hxx create mode 100644 src/XAO/XAO_StringField.cxx create mode 100644 src/XAO/XAO_StringField.hxx create mode 100644 src/XAO/XAO_StringStep.cxx create mode 100644 src/XAO/XAO_StringStep.hxx create mode 100644 src/XAO/XAO_Xao.cxx create mode 100644 src/XAO/XAO_Xao.hxx create mode 100644 src/XAO/XAO_XaoExporter.cxx create mode 100644 src/XAO/XAO_XaoExporter.hxx create mode 100644 src/XAO/XAO_XaoUtils.cxx create mode 100644 src/XAO/XAO_XaoUtils.hxx create mode 100644 src/XAO/tests/BrepGeometryTest.cxx create mode 100644 src/XAO/tests/BrepGeometryTest.hxx create mode 100644 src/XAO/tests/CMakeLists.txt create mode 100644 src/XAO/tests/FieldTest.cxx create mode 100644 src/XAO/tests/FieldTest.hxx create mode 100644 src/XAO/tests/GeometryTest.cxx create mode 100644 src/XAO/tests/GeometryTest.hxx create mode 100644 src/XAO/tests/GroupTest.cxx create mode 100644 src/XAO/tests/GroupTest.hxx create mode 100644 src/XAO/tests/ImportExportTest.cxx create mode 100644 src/XAO/tests/ImportExportTest.hxx create mode 100644 src/XAO/tests/MainTest.hxx create mode 100644 src/XAO/tests/TestUtils.hxx create mode 100644 src/XAO/tests/XAOTests.cxx create mode 100644 src/XAO/tests/XaoTest.cxx create mode 100644 src/XAO/tests/XaoTest.hxx create mode 100644 src/XAO/tests/XaoUtilsTest.cxx create mode 100644 src/XAO/tests/XaoUtilsTest.hxx create mode 100755 src/XAO/tests/coverage_report.sh create mode 100644 src/XAO/tests/data/Box_1.brep create mode 100644 src/XAO/tests/data/Box_2.brep create mode 100644 src/XAO/tests/data/Cut_2.brep create mode 100644 src/XAO/tests/data/test.xao create mode 100644 src/XAO_Swig/CMakeLists.txt create mode 100644 src/XAO_Swig/xao.i diff --git a/CMakeLists.txt b/CMakeLists.txt index a3ca7d944..2721960e4 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -85,7 +85,7 @@ FIND_PACKAGE(SalomeSWIG REQUIRED) FIND_PACKAGE(SalomeBoost REQUIRED) FIND_PACKAGE(SalomeOmniORB REQUIRED) FIND_PACKAGE(SalomeOmniORBPy REQUIRED) -#FIND_PACKAGE(SalomeLibXml2 REQUIRED) +FIND_PACKAGE(SalomeLibXml2 REQUIRED) FIND_PACKAGE(SalomeHDF5 REQUIRED COMPONENTS C) # Other KERNEL optionals: @@ -229,13 +229,13 @@ INCLUDE(CMakePackageConfigHelpers) SET(_${PROJECT_NAME}_exposed_targets GEOMArchimede BREPExport BREPImport BlockFix GEOMbasic GEOMAlgo GEOMClient GEOMImpl GEOMUtils GEOMEngine GEOM_SupervEngine IGESExport IGESImport GEOMSketcher - SalomeIDLGEOM STEPExport STEPImport STLExport ShHealOper + SalomeIDLGEOM STEPExport STEPImport STLExport ShHealOper XAO AdvancedEngine ) IF(SALOME_BUILD_GUI) LIST(APPEND _${PROJECT_NAME}_exposed_targets AdvancedGUI BasicGUI BlocksGUI BooleanGUI BuildGUI DisplayGUI DlgRef EntityGUI GEOMBase GEOMFiltersSelection GEOM GEOMToolsGUI GenerationGUI GroupGUI Material MeasureGUI GEOMObject - OCC2VTK VTKExport OperationGUI PrimitiveGUI RepairGUI TransformationGUI + OCC2VTK VTKExport OperationGUI PrimitiveGUI RepairGUI TransformationGUI ImportExportGUI ) ENDIF(SALOME_BUILD_GUI) diff --git a/adm_local/cmake_files/FindGEOM.cmake b/adm_local/cmake_files/FindGEOM.cmake index 92d3f5a99..1aa77280a 100644 --- a/adm_local/cmake_files/FindGEOM.cmake +++ b/adm_local/cmake_files/FindGEOM.cmake @@ -17,45 +17,52 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -SET(GEOM_CXXFLAGS -I${GEOM_ROOT_DIR}/include/salome) +SET(GEOM_CXXFLAGS -I${GEOM_ROOT_DIR}/include/salome) # to be removed +SET(GEOM_INCLUDE_DIRS ${GEOM_ROOT_DIR}/include/salome) -FIND_LIBRARY(AdvancedEngine AdvancedEngine ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(AdvancedGUI AdvancedGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(BasicGUI BasicGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(BlocksGUI BlocksGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(BooleanGUI BooleanGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(BREPExport BREPExport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(BREPImport BREPImport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(BuildGUI BuildGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(DisplayGUI DisplayGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(DlgRef DlgRef ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(EntityGUI EntityGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GenerationGUI GenerationGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMAlgo GEOMAlgo ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMArchimede GEOMArchimede ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMBase GEOMBase ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMbasic GEOMbasic ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMClient GEOMClient ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMEngine GEOMEngine ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMFiltersSelection GEOMFiltersSelection ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMimpl GEOMimpl ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMObject GEOMObject ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMSketcher GEOMSketcher ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOM GEOM ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMArchimede GEOMArchimede ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BREPExport BREPExport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BREPImport BREPImport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BlockFix BlockFix ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMbasic GEOMbasic ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMAlgo GEOMAlgo ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMClient GEOMClient ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMimpl GEOMimpl ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMUtils GEOMUtils ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMEngine GEOMEngine ${GEOM_ROOT_DIR}/lib/salome) FIND_LIBRARY(GEOM_SupervEngine GEOM_SupervEngine ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GEOMToolsGUI GEOMToolsGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(GroupGUI GroupGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(IGESExport IGESExport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(IGESImport IGESImport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(MeasureGUI MeasureGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(OCC2VTK OCC2VTK ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(OperationGUI OperationGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(PrimitiveGUI PrimitiveGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(RepairGUI RepairGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(SalomeIDLGEOM SalomeIDLGEOM ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(ShHealOper ShHealOper ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(STEPExport STEPExport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(STEPImport STEPImport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(STLExport STLExport ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(TransformationGUI TransformationGUI ${GEOM_ROOT_DIR}/lib/salome) -FIND_LIBRARY(VTKExport VTKExport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_IGESExport IGESExport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_IGESImport IGESImport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMSketcher GEOMSketcher ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_SalomeIDLGEOM SalomeIDLGEOM ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_STEPExport STEPExport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_STEPImport STEPImport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_STLExport STLExport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_ShHealOper ShHealOper ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_XAO XAO ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_AdvancedEngine AdvancedEngine ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_AdvancedGUI AdvancedGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BasicGUI BasicGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BlocksGUI BlocksGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BooleanGUI BooleanGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_BuildGUI BuildGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_DisplayGUI DisplayGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_DlgRef DlgRef ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_EntityGUI EntityGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMBase GEOMBase ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMFiltersSelection GEOMFiltersSelection ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOM GEOM ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMToolsGUI GEOMToolsGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GenerationGUI GenerationGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GroupGUI GroupGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_Material Material ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_MeasureGUI MeasureGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMObject GEOMObject ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_OCC2VTK OCC2VTK ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_VTKExport VTKExport ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_OperationGUI OperationGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_PrimitiveGUI PrimitiveGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_RepairGUI RepairGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_TransformationGUI TransformationGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_ImportExportGUI ImportExportGUI ${GEOM_ROOT_DIR}/lib/salome) +FIND_LIBRARY(GEOM_GEOMShapeRec GEOMShapeRec ${GEOM_ROOT_DIR}/lib/salome) \ No newline at end of file diff --git a/adm_local/cmake_files/SalomeGEOMConfig.cmake.in b/adm_local/cmake_files/SalomeGEOMConfig.cmake.in index cfd626050..c70cc27c6 100644 --- a/adm_local/cmake_files/SalomeGEOMConfig.cmake.in +++ b/adm_local/cmake_files/SalomeGEOMConfig.cmake.in @@ -126,10 +126,30 @@ SET(GEOM_STEPExport STEPExport) SET(GEOM_STEPImport STEPImport) SET(GEOM_STLExport STLExport) SET(GEOM_ShHealOper ShHealOper) -SET(GEOM_VTKExport VTKExport) +SET(GEOM_XAO XAO) +SET(GEOM_AdvancedEngine AdvancedEngine) +SET(GEOM_AdvancedGUI AdvancedGUI) +SET(GEOM_BasicGUI BasicGUI) +SET(GEOM_BlocksGUI BlocksGUI) +SET(GEOM_BooleanGUI BooleanGUI) +SET(GEOM_BuildGUI BuildGUI) +SET(GEOM_DisplayGUI DisplayGUI) SET(GEOM_DlgRef DlgRef) -SET(GEOM_GEOM GEOM) +SET(GEOM_EntityGUI EntityGUI) SET(GEOM_GEOMBase GEOMBase) +SET(GEOM_GEOMFiltersSelection GEOMFiltersSelection) +SET(GEOM_GEOM GEOM) +SET(GEOM_GEOMToolsGUI GEOMToolsGUI) +SET(GEOM_GenerationGUI GenerationGUI) +SET(GEOM_GroupGUI GroupGUI) +SET(GEOM_Material Material) +SET(GEOM_MeasureGUI MeasureGUI) +SET(GEOM_GEOMObject GEOMObject) SET(GEOM_OCC2VTK OCC2VTK) +SET(GEOM_VTKExport VTKExport) +SET(GEOM_OperationGUI OperationGUI) +SET(GEOM_PrimitiveGUI PrimitiveGUI) +SET(GEOM_RepairGUI RepairGUI) +SET(GEOM_TransformationGUI TransformationGUI) +SET(GEOM_ImportExportGUI ImportExportGUI) SET(GEOM_GEOMShapeRec GEOMShapeRec) - diff --git a/doc/salome/gui/GEOM/images/exportxao_dlg.png b/doc/salome/gui/GEOM/images/exportxao_dlg.png new file mode 100644 index 0000000000000000000000000000000000000000..a7171c748f9dd15e590580136760a2fe9116901a GIT binary patch literal 9423 zcmb_?cU%)&xAuT?umRFUL_wp1fS`hu&<_M`5V~|wX+kKG(7OdCA|gaYAPFc!3?)&J z7D^Nl2vwwa5eOx82)*3lJ?Gqe?)$#y+VuR3XWu`L+D_~f-<_I36PqOPk<-;kykBH0Ki$b+gRcyIfcMM zcJFI?+U)&%1r7m{J6JaiI3(z;ZSJk*>F)06;SFecIo|embU5kf;(hnzm1}wiX7@P- z0N^BW4fd;vf6sJ(2vTSzWNdzx_2jm>7g1%KD}0sw~^6qFV87$;A{LLoQl5QN@}N-#^jjBTeJD*3M&G6L-8O z_Z&mKV~>W>8J4({`{RJ+?Nu5>&R5{k)x*}Tvz^F`>f0YSdfBIbJ{hEIF-V@qzq8)ux24?=z}23jUF$L^|GFouJcdh zJe|{TT&WT!Yo%&r=i8U;&)>DTSNuUXDn1J_H7&myf5E^;PDV{n?F)|EXTHZDK3cFW zN?7!!-7b4pu9)2Dq-rXcl!2x{zQ(&r}wby`cO?iJ}lpbGI=+0I7~x1*zdC?vZR zdgn7_qkZIJdu}P=%9M^ZPp%g%JGIx(Z@_|oXopTO+UwT|g{oK>mUJ0?nwIObtbt#n_?#>*P1%3%)tl8Ml2*JH}rqa8vN z&p}Sl6TL<4bz2RD8XT5%MH!0$$&-lh6H7}|rGc%UE}6XGjg^G3P|4{;=|I)nBbZ27 z#g}YQ2VMCr=e+JVO{E_z=-NA?7~1&Hi(Yts!Nk`dy#{u?nVf7}khs_QWLY^Y-i4^z zzD-Rpk5GFpcg1m$sKHf#K~B@C+J?T(hAWkiY27AzA1LxBHoQyvx{b)ApG})=1p7Y* zJe-ukQN3(nzHS4lQPPmf&OYS#^Ob=I(RoRcq6ecEhlezjMjF>y^C{#|nS0CYwW~-? zl1=dkpL!|x6Zoa2e2uLmzDj*gT3Y^ETITUJV$RjP*SG~wq#U}b@Pu`{fP-5PQ?)eJ zFjX2rYP+*OIrk{itvvmbfsLt|P?By2?A=F_4h+15?Rm+T#~yBHKBgqSb6NiCP4_yF zZ}&X&ZM18ZP|yc~%+oA}Cu4I)+*|`QC*483=4DtuZ>{ErMm%cnnOQHCrMNV~n`V|Hf;9mQ& z@P4b!b{<{pud;owT~h;=>vGLD=1Km1k89a&`zJT0I%^0`IAx)foCP)^C)qbGL-j-J zuk;)CWfw~oM%Hdt{M206Nx19f8mNLd81)YPXpbmqW+d8~s{~C<)|4ggPGWwn>VjFr zGDCWD+=a42Y<>K*VuCW9RSOH;-;*fw*-3s5D)&O}^if1*^YYf3x%J-V7dKr^qY;T; zzkXWJ|EM;_yc;MVwAOQ1G}$GSOM9{+G{qMxED(!JR*1|1HBam%lfEYjx%#v~FAc#T z&ikW=YX)B_$X^=0?1(^Bi9v+*Hj1RZvm*VM+}>xNm6JUdWB1hdc)e52k$lP|ho5^E zA`9U*zg8+tuCe0(-XP05bGSrUL@+A3n%(1g`sCZ^k*lS))aH^8@5e?SB^mKbIqPt@ ze2T%hSFO8=VwhdHgGm_y3;5GgLdRSY4=5x;YhtFv;PXZ)=LQ# zHTJ46%kC$wYv_fX%XL}kp(WCWYBR#xJNlZMA~sx-8c&^=+wgREITBmk7JSj5%pFzF zPNg{EQ%~^-CtiL3AhMz9!h0Pj+f~%VtlTc~+>;KC!W8i~FupU1ugHh+o$% z)SlnAx!eEkTi@LLw=dr!B$H|j8l{qIWbv;l@-pR!u~+LoNzu_v`}vqF{F+}T`%`)( zAfZ%!m`)AvWOz(8e5xo%_4uKwnJx*+>Xw?#8F{67TBxZ9m$)4D@F9~zcQ@B;a=W$& z1^JbNw^GRWSHZV!R?LmVZg!IObv^E8Q}cc7WuQVtjv$pJ5`%h_@|xCnG_)_kD#%9h z(a$vY~wjD(e>#9B0h$!Am3?MpTVFQ&JNXb2f3b zKZAXZy*CLBa7$hsU(8Qj{B`zQ?a%SK_7#SZ=l%$xu6iUi%ru^wS=ZNFlrC<>d*GdH z;&`pUC?@*(Gf$8H55)X{KzT>&VL{<&cGm5y?u~bpWR-+dut|nv+FtTL^IqBM#i#h@ zKs2*0{5P) zb9JlSs@HQqpv<*}vOQmlp>{s`ngOyN z0f2$EtSnLG*Wo3%^4qGZaTT;mG*I-UwLefJT@f{uD}jUn(g($KWC37?0lkz2rX4nl zEhtu?=sdP`2@3!o2MJft@a$)&#|2xQ0d7gLRdS#mBx0|Aa|Y*d4($a_f|GXJBi?_s za3m|R+f0tzeLSWVJdT7;CybTPA7^I=vWJlr|M{N?a`|#sg0LiE%WL)9?S=h72SQOh zt)CH4`Znn6ozvalUEF za>+8ts>G5d?L}BMmWHMC#H#zxaDk%FeT*NtPI5`gaMAgaU6#{t>EVe`2=x*z=*Y@7 zBpaP^*0E=6Gj1`zOz6IQJ}ED-gZB30d-uFL)Sy49VMcpzxYsx|zu=QJRL=^LYW$&{ZtaJPM%xt<`9en~<2W>OLb~I8r6>f~SzR`N3cn7!@ai{X*&qv1i0&g2L zw#5&x4T(IXmP<*+)dg<4Y1QM|%#MIXa?Iq7M8qpMG5z5%uT_2gMl~v8$^g(1#+|@v zIX`)N1P(VMn!ryrU+%EOIoai^J)!Ks1Da>reH!Yg@IKOrZCJe57kg}HQGEkNg0g6c z=Um3p>2$9HkClDhr7Ts^)!ba$sGR;T`19k;`Ph9b*9+CDJ=*lnOE@3ud@`M-Iz zW$Zw+`UOZCJKl`CJ^CCsIaZy=j-OSXlNz=Full6>u!cQ4<*e9D*cMk1m&%2nD^$k1 zS#t_+tmkZ3chC>3pDi1M{?`O>o%;car{qX?;$;ehR8lGe4c#n?^q!urQ%)J!(Z4|a zZgv4H5KG3ZuS}m%)_%9cOn^E3h)(dw0pa*o8O#K!WJX2|(>zwPv%Mh_JojaA^SdYA zhE0!S23>16)3xT_`T_qPT(1-kXf(U5HP9UR7IX(uKdkn6mO5CQ8rcUz7C_11W{4|8 zW7?g?E_(n8y?fhwC6n@kw6-4bDS*LXbYMPyej)+PeI-JGg!TQMjIz6BaaaeQ*!A^w zO(p$+;L#2D(ieci{iny_Q0S*Phd?^Jd-K3fL)iL8kbf+Y`kik&33CtU;^mcFUTzCJ zA|P<^T88>2)lcCuBX3=7MxfJYqP)yrajniiC18oVHS*oFA^4 zrS63C8xl?G`kZ^HVPW`#@ZO$uRGvd_F|#|n$~oU+I;F6%?<-?3@Tm2=vc7^`lEP~J z5N7NNYP;!X^Ysm>?;o|!_>57pVT{26nj{-IEmujOOLgf*Et7-WpQtzthAo=>+II3z5R{it!OXYeb6 z15`|3IAp11Vc_%3%*<)B@KD4r8j3k$iMo$*yXgIo09dGV%HuC;=lA-^p@HTfJy5uk z=u8#fx0f~4F7VXoWkdHO`9$4UjL_1+(Mk8h{)~kD*|43B81?NUpGu)*Aubi~TO;dN zFY+CF{NSayaYkvyLaV;Idr0A>ptaG2l&vji96o1(-T2^yi9|Y12_?>hhE?1zcIb1N z?0D57vmFKpqbX>1R;v4FPj8P^PXW$R?$&lM zd0|JLaI5H4tnOK!{o75~U}utPucpK>wBVUHgT-TcRNJ};CHErIgsQ5l%0lhwn6H87 zJ9=eQ#ROH<{AbHnUO8DLD|nJJ7t}ZUQsB)EJF85plKfmuy2XrrjH**F%GJ%a4aS(5 z5IlO+AU@MA^c_BMl6axC++0-*>O=pYZmy!HDiE!W3-z{XUYrWtfqIQx^=3vO7$W|2 zA9q%xE5nx52UqiE%XezR?kx|7ZS4fp2gHKa?DoGJXm58c8QQaF4~4YCu{1#;)zPm+ zfYJ%&bAi2nLW}w~Ha2+Y;Z{__oq1ztX>NGS=_}8zEgX~OJ$HuHw`xwS9}69wC2hyd zV%1l#h^4GGlXsfJRv8zzm&2$b&7Rg4A@HHL&cRNkPJS5Q;{EK zPR_}1+(cYHVj7?MgMPcLY-5>ZyAh;THcKOy`!|Qg=$)abwZz)lY<^uDVXm2Yxs7bb zN2#mNFSqcx4fEQCR=Ajx3kiigcf&mW$QdpvMaR<_+IAd^kcCfVm!7yA7e0ssXA8o1 zLjC#=ztOB+wXh44%}et2oejU5+{yU z=^ar2HrU%AG}U#9+pugwVKBJWzr>8GEuK|-smE+0H%{JEIgi8!ahyF7}Y9F_8aN>R#DN{ zo#$*8)Dkf+GA^LkW}{HuOKA-%obC<8n^>6^AhIN)U&!9n@%ixV%D}Hcf+W3DK=581 z<}zG0vx5E5jf>fZfzemUrD1Coy~zbLIh>E=8W(3Sgc?4GI09#4+w8>n7D&@C^(FO_ zHXAL|&JhNkauj~yx*>uEtoh&t+@miQ3eo}sj#>93>qvLtSe1aEpU1*V-0SgIhcl9T zs!eS=76RdAs%4pD-b>>xAUbSsZx0OE_M)SO(Z=w;>`j|QR`#FSr}lyv;&ZlW&@*58 zQrgEng8p`8!SfjoDdqlUj&TJNl)3cus-ItBq~ckOF^vEF>5q@UP1@|0u`8*Y@V}JJ zZep$2J#Yn2kag(2oqK}E4dHGz9R#_#VMPmDzVMLRu?6LJx2g%@+FTb1UB`qWQO)A| zepSo1d*nvrR$wESUpvp`%pJD$a%@1vq2|#Tk@t~Euew91GUEWjct+OP8OTXRj(}^!&aH4>~jL#rOhfEOpTL==Qh3{6eplvEAwd%xz;Pg?UH7N9{rgh zbcf6a{eOb)E@bvI<-=Sma~c6*F9KGFp5%05e~ICemy??p=hEOlq2hmWhkvH&dDELb zEqL=Uzw-#BWO3xxj6UdJA@pF#O1$5C=zNsjr)j91yqxP>=F-xkLxht0>zOE=$aOT6*Oc&Rq_v{^mQSdqzGVV;;~2#qt8dk74r z7!W;&4~RtZ!?lGv5D52rBD(r*rY--0H^(kzP>BI%GTDWmgXIgt9UBV?)TztaoxQES zVV|glC4~->X)Yiaww~Bq_kDY7!^Tew1_!*f9&LC=9**6$h}UW?AJ_7_tM5j=O91U`CTG=*{;c$D zvyA@s4Ccl%_LpCN2@F!7Q5VDsp{~@NLnJxjz7uU59YgDUtNEqbG@wlE(=`rm9iEZ> z!UVg7DNJ|MYm9BjRY@c|ev_%awP))s`g+Fw`}aW@z&}{UrQ{$b*fqewiYh)Fold`;d_Su{M&BQ{2*;d(uNhot=CAns$!vG!@)yjVodsBNz zE1>%8yYJ^OCDU$BaU+M5jP=Qr&Nj_z1n{4p<)mD#TYp z23LJ(^_uW#MY*DpDuw(ip&^sF+hv8J+pjENNXXo zAq$NU2S?h$h;2c6#gevc)~Jqq!RQCGH4VkY($$Knsa+Cc{isC>Knih{0RK~tx%y6% zdg^Un8V1J(APp72KDGzxV3!3D{{5CY*FRsZ(JemiQP%P5<}x3UdhR#cdEcD{cwy&! z#rafNa@7Z65b*vD9r`D7zf16c&ojfBO=f-c9+2mHT|VNt^Y%_+bA)D7WI=~KV{bt` zFy!6poVEu0S*jT^yvp98hRrr~*v!NmiJUP_cW1Bfdtm50`Lsp5lES!}$Thopg`D5{ z^%7SF5$2o`t9rxtgBx!YhL-_(;ihgjDst;X^rhzkhv8XXa3!D2XTt4u%C6zPiYMM4 zU;Nzj2;&3uFzp?CrXBF;NR7&^IllQ|NtNh^hy0Qj5W=~RG)Ix;l%m=k z3bex3$a@4rRRxi#LR#=&=Nf;T0%<)Z^+IV>Il6XC(M$=6P==+JpBGoBWY~@8;kiw)w|mkX#~44J4SO zlK1!vCK-U9{wz536v-1?`2;FtcyD2oxW{>~;%RGcI0Ui)A#>dN=7Yn9KQ*eF<@uS! z`(JnDbI)T8iF#}ErBjgCk$0hu7Wa)vT)=0Wp?8c6cYDGvgk_1GkU@A zD>nCu11nH5!E5*ul~_YG*7gE`>wIt>^81(lxtdD1f$+Kmgk;K|ir|Blbr>}KD3I+} z-i}ZbOIffxko)+lajBG`I#lX~5$Jr~W3cVIv-TM;(C#UXJCeX>-0I_ffQH2i_Bv`0 zYa#Tr>eJN|4Z!YOt^efVCJsp%-LDcZDT6U1p|;&32biR`gJGoC`plXpZuRhr-mU42 z#5$G5o&tJXl#Kp|k!L`-%pt;AUdgamKQnGq@lMiT4IzV4*68 zXs#ZI^LxoYU>-1TDxD-^d(XKAdDa(2vjPSMLoc1LN`*PXMf=?z*1u*0enCHaPX66)elO_!jY@yqp}(=qU#s+oad-Pa1pSL$d|CeLPW~^{ z{(E-_mm8J5sRb4z<&WDxVa0NXTUAVad!sdVJzSO*X{I>8pZmu%;Ate{w@Sd@7)ay! z|MLUnz?vtv9P)oJN=ROp1UY_pyktv0HA}{i=u>I9Ut)QVUMlUQhz1$DN`-i#3Ydgn zu~jv?U()9Cr@tL#1e*$f-br{+nan{p*FH#aldm5*FYPO?SlW%OK*#I}u3-Jg;r=Nj zq<`MfNvvWd3#X?%7Rg$|_hZh<4fs+F0DCX)ehX09se;X&n!h7b_1oM>tp^-s`yLoM z{Bi2aG%a-NhCoC@SBGSJ`f?rX7o4mEHeB=h{hJc0n#zZ@l}h`OnWXjr z_x`T4g&`+!O=l_ePg9-t`8Ce&y@Lhryxbiv+fB!q zant04)&L(ebh_{3BFICP{iZIfm!N9kX~8p_#VYYSd6_3r$sKIn1;khQ){KBV4A-pU z24*!`C%v_2pe;knGeKI5X3LiP@=0M3yq(9>fBTn&KHp()=`Yn3%GgVq!{a7SP&R6O z>V=`p%SL7aD3ZRMQ!k_7f$u*j6aiMGhP%O^-u9+EDOYKGG+1FOkV+QwwJbCWt&nKU z0$vvF8HzLZaSwviUyD1Sp7DQB?UsaKef!I^UaaJA@{aIq(6P;B1R zCU7mgcv4mDwCt|De!KFL(!#HPVQZvICDRXl2a9{}2Cv{s4hCo0_$qdDE@bjwEa)^B zN&6r=WKw6wg0xbMr<>UHBE2Z|kxx*50eHd6mGZ?VWu1U#ylVAjI{F~FFJx@SZy=y% zLZ@Lg-^G0z=Qm(@P=;K*-u}Al^(}B3H2NsB109unBjL?UGOIyuWv?n>G6~xW=a4Rj zvX%3`GHjl}2#hWdl&w_Jc;RM~ZTBG%x{I4+bOjnC1`c;lSpEc$o^>~(5(#FG1o6dB zPT4Un6$2$JmYu${{Xsc-Bf8nHuL{8xKofkJ@_ROVk4Cgy=V)&I5toeFakx-}Tz4SP z<)ly@tx(O*Gqive6MexLdPYO^d%?ve)#&bMT0`F0%Y>;0>F%U_HiASDm% zHpS_=c`=Mh+%)NFCAq_ZZZz9#obI$ppP0IAK&F)m6 z0Tn6lkb)bHR)(HYl7n5?E$dp&G1Jc!#nMHQ-q8?S0fbmluwBj<0cv@`lpdq1AfE0l zIk#sc)8hh}wQhCJsWM@O(_ms~udld<;v3jd)sC>V(q9Io`7|{Z2!3D1=E+Iqep6MFtJ4*(=zE~bBiJ{WoolZn52MrBGI2=DzHs0Q)= zv!&z`BT7kGsT(ZI3q%;ZDZU!(6$OBE(vO+{@`CD5pdFsSJTEc?GSVqdAUvu^$ literal 0 HcmV?d00001 diff --git a/doc/salome/gui/GEOM/input/creating_adv_obj.doc b/doc/salome/gui/GEOM/input/creating_adv_obj.doc deleted file mode 100644 index 5b5b91306..000000000 --- a/doc/salome/gui/GEOM/input/creating_adv_obj.doc +++ /dev/null @@ -1 +0,0 @@ -
  • \subpage create_smoothingsurface_page
  • diff --git a/doc/salome/gui/GEOM/input/export_xao.doc b/doc/salome/gui/GEOM/input/export_xao.doc new file mode 100644 index 000000000..5d1748f66 --- /dev/null +++ b/doc/salome/gui/GEOM/input/export_xao.doc @@ -0,0 +1,21 @@ +/*! + +\page export_xao_page Export XAO + +To export a shape in the \b XAO format, in the Main Menu select New Entity -> +Import / Export -> Export XAO + +Specify the parameters of the Export XAO dialog box and press "Apply" or "Apply & Close" button. + + +TUI Command: geompy.MakeExportXAO(Shape, FileName, Groups, Fields) + +Arguments: +- \b Shape - The shape to export +- \b FileName - The name of the file to create +- \b Groups - The list of groups to export +- \b Fields - The list of fields to export + +\image html exportxao_dlg.png + +*/ diff --git a/doc/salome/gui/GEOM/input/import_xao.doc b/doc/salome/gui/GEOM/input/import_xao.doc new file mode 100644 index 000000000..58ddfd11e --- /dev/null +++ b/doc/salome/gui/GEOM/input/import_xao.doc @@ -0,0 +1,8 @@ +/*! + +\page import_xao_page Import XAO + +To import a shape in the \b XAO format, in the Main Menu select New Entity -> +Import / Export -> Import XAO + +*/ diff --git a/doc/salome/gui/GEOM/input/index.doc b/doc/salome/gui/GEOM/input/index.doc index db275aa4a..af0fc6f51 100644 --- a/doc/salome/gui/GEOM/input/index.doc +++ b/doc/salome/gui/GEOM/input/index.doc @@ -4,18 +4,18 @@ \image html geomscreen.png -\b Geometry module of SALOME is destined for: +\b Geometry module of SALOME is destined for: - \subpage import_export_geom_obj_page "import and export of geometrical models" in IGES, BREP and STEP formats; - \subpage create_geom_obj_page "construction of geometrical objects" - using a wide range of functions; + using a wide range of functions; - \subpage view_geom_obj_page "viewing geometrical objects" in the OCC - viewer; + viewer; - \subpage transform_geom_obj_page "transformation of geometrical objects" using various algorithms; - \subpage repairing_operations_page "optimization of geometrical objects"; - viewing \subpage geometrical_obj_prop_page "geometrical object properties" - and other information about geometrical objects using + and other information about geometrical objects using \subpage using_measurement_tools_page "measurement tools"; - \subpage pictures_page "designing shapes from pictures"; - easily setting parameters via the variables predefined in @@ -24,6 +24,8 @@ The possibility to classify the created geometrical objects by moving it into early created container (folder) is detailed on \subpage arranging_study_objects_page section. +XAO format describing a shape with its topology, groups and fields is detailed on \subpage xao_format_page section. + Geometry module preferences are described in the \subpage geometry_preferences_page section of SALOME Geometry Help. diff --git a/doc/salome/gui/GEOM/input/tui_importexport_geom_objs.doc b/doc/salome/gui/GEOM/input/tui_importexport_geom_objs.doc new file mode 100644 index 000000000..5a02d6460 --- /dev/null +++ b/doc/salome/gui/GEOM/input/tui_importexport_geom_objs.doc @@ -0,0 +1,18 @@ +\anchor tui_creation_exportxao +

    Creation of ExportXAO

    + +\code +import geompy +import salome +gg = salome.ImportComponentGUI("GEOM") + +# create ExportXAO object +exportxao = geompy.MakeExportXAO([value], [value], [value], [value]) + +# add object in the study +id_exportxao = geompy.addToStudy(exportxao,"ExportXAO") + +# display exportxao +gg.createAndDisplayGO(id_exportxao) +\endcode + diff --git a/doc/salome/gui/GEOM/input/xao_format.doc b/doc/salome/gui/GEOM/input/xao_format.doc new file mode 100644 index 000000000..b5c60a92d --- /dev/null +++ b/doc/salome/gui/GEOM/input/xao_format.doc @@ -0,0 +1,10 @@ +/*! + +\page xao_format_page The XAO format + +XAO is a file format which describes a shape with its topology, groups and fields. + +- \subpage export_xao_page "Export" +- \subpage import_xao_page "Import" + +*/ diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 211d7c358..8984f724d 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -3703,6 +3703,31 @@ module GEOM * \return list of all texture IDs avaiable for the current study */ ListOfLong GetAllTextures(); + + /*! + * Export a shape to XAO format + * \param shape The shape to export + * \param groups The list of groups to export + * \param fields The list of fields to export + * \param author The author of the export + * \param fileName The name of the file to export + * \return boolean indicating if export was successful. + */ + boolean ExportXAO(in GEOM_Object shape, + in ListOfGO groups, in ListOfGO fields, + in string author, in string fileName); + + /*! + * Import a shape from XAO format + * \param fileName The name of the file to import + * \param shape The imported shape + * \param subShapes The list of imported subShapes + * \param groups The list of imported groups + * \param fields The list of imported fields + * \return boolean indicating if import was successful. + */ + boolean ImportXAO(in string fileName, out GEOM_Object shape, + out ListOfGO subShapes, out ListOfGO groups, out ListOfGO fields); }; // # GEOM_IKindOfShape: diff --git a/idl/GEOM_Superv.idl b/idl/GEOM_Superv.idl index 29bcea81b..0e7e85ca3 100644 --- a/idl/GEOM_Superv.idl +++ b/idl/GEOM_Superv.idl @@ -262,6 +262,11 @@ module GEOM out string_array thePatterns) ; void ExportTranslators (out string_array theFormats, out string_array thePatterns) ; + boolean ExportXAO(in GEOM_Object shape, + in ListOfGO groups, in ListOfGO fields, + in string author, in string fileName); + boolean ImportXAO(in string fileName, out GEOM_Object shape, + out ListOfGO subShapes, out ListOfGO groups, out ListOfGO fields); //-----------------------------------------------------------// // TransformOperations // diff --git a/resources/CMakeLists.txt b/resources/CMakeLists.txt index d6b0e279b..274162faa 100755 --- a/resources/CMakeLists.txt +++ b/resources/CMakeLists.txt @@ -261,6 +261,7 @@ SET( _res_files dlg_pipetshapefilletrf.png dividedcylinder.png dividedcylinder_r_h.png smoothingsurface.png smoothingsurface_lpoints.png tree_smoothingsurface.png + exportxao.png importxao.png ##@@ insert new functions before this line @@ do not remove this line @@## ) INSTALL(FILES ${_res_files} DESTINATION ${SALOME_GEOM_INSTALL_RES_DATA}) diff --git a/resources/GEOMCatalog.xml.in b/resources/GEOMCatalog.xml.in index 00803d946..4ce7fe077 100644 --- a/resources/GEOMCatalog.xml.in +++ b/resources/GEOMCatalog.xml.in @@ -54,6 +54,7 @@ + @@ -73,7 +74,7 @@ Geometry component 1 ModuleGeom.png - 1 + 1 @@ -594,44 +595,44 @@ - - GetDumpName - - - unknown - 0 - - - theStudyEntry - string - unknown - - - - - return - string - unknown - - - - - - GetAllDumpNames - - - unknown - 0 - - - - return - string_array - unknown - - - - + + GetDumpName + + + unknown + 0 + + + theStudyEntry + string + unknown + + + + + return + string + unknown + + + + + + GetAllDumpNames + + + unknown + 0 + + + + return + string_array + unknown + + + + hostname = localhost @@ -5301,6 +5302,43 @@ + + MakeExportXAO + + + unknown + 0 + + + theFileName + string + The name of the exported file + + + theExportingShape + GEOM_Object + Shape to export + + + thelGroups + GEOM_List + List of groups to export + + + thelFields + GEOM_List + List of fields to export + + + + + return + bool + Result object + + + + diff --git a/resources/exportxao.png b/resources/exportxao.png new file mode 100644 index 0000000000000000000000000000000000000000..25e5b3d1fe525373a1cef581bc8040a15e65c81c GIT binary patch literal 608 zcmV-m0-ybfP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*h< z4FMjjIUC^s000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0005INklbF~anmhdbS^?Gq)l6B72ASKARnV3 zLj2eSaqtf?Sp-Qtx2q19E@^UKhunL6a+}5`1bpCd&imeTpYxpeIWJSuI3hBzp+tm; zkr04drKFto>i2yGJOHtocGLW zPmC*dDjFAOIJx(Jzv$O-VttP{9@b^sCuOx99|8e-flpiK_3LX8ZQO}ryLKs!EE_Qr zDW}L8(^Q&Tm((^d?J>tyn73Vi_g9fU2#y<_OiEX)Re;vB86RT9SIB zLASD60wP0P{w(2BFg^B>Y5OYE1?K9EnuYOz^}%2+jm!C?2S5n z5Mar=gUqsE#(;1LMkUG4agnpvJQ9&g8=+Dv1U&p7m*+RRc(J@f?x4)6M%K5>bL-?5 uKO=zgPnUavQfdqsZ&T*2;k|ZBH{1eKDtVjD=!j7O0000Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*h< z4_CX>@2HM@dakSAh-}0004dNklP!s$QdC%aDNE@oNaYnSAHXK8QSHf6!ibHN(=~i;K<_Sk z%)i6!%O*`7CdZc%qJb1Wsu3`1x3iwlQi!xz>OJJ6UWGBB33t^)Y_gTq8`$2!53mry zU2mj{tG*y_B1`2NuC7}x^@2(P%}*{m&Jb|TBq^>e_}M=`;%ozVpJ(w7Ja+r(noFU3 ix49YSRdfLw|5D$|BzaMqKbZ#r0000 1 ) { - if (aName.isEmpty()) - aName = getPrefix(obj); - if (nbObjs <= 30) { - // Try to find a unique name - aName = GEOMBase::GetDefaultName(aName, extractPrefix()); - } else { - // Don't check name uniqueness in case of numerous objects - aName = aName + "_" + QString::number(aNumber++); - } - } else { - // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName() - if ( aName.isEmpty() ) - aName = GEOMBase::GetDefaultName( getPrefix( obj ) ); + QString aName = getObjectName(obj); + if (aName.isEmpty()) { + aName = getNewObjectName(currObj); + if ( nbObjs > 1 ) { + if (aName.isEmpty()) + aName = getPrefix(obj); + if (nbObjs <= 30) { + // Try to find a unique name + aName = GEOMBase::GetDefaultName(aName, extractPrefix()); + } else { + // Don't check name uniqueness in case of numerous objects + aName = aName + "_" + QString::number(aNumber++); + } + } else { + // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName() + if ( aName.isEmpty() ) + aName = GEOMBase::GetDefaultName( getPrefix( obj ) ); + } } anEntryList << addInStudy( obj, aName.toLatin1().constData() ); // updateView=false @@ -978,13 +981,22 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::getFather( GEOM::GEOM_Object_ptr theObj ) return GEOM::GEOM_Object::_nil(); } +//================================================================ +// Function : getObjectName +// Purpose : Redefine this method to return proper name for the given object +//================================================================ +QString GEOMBase_Helper::getObjectName(GEOM::GEOM_Object_ptr object) const +{ + return QString(); +} + //================================================================ // Function : getNewObjectName // Purpose : Redefine this method to return proper name for a new object //================================================================ QString GEOMBase_Helper::getNewObjectName (int) const { - return QString::null; + return QString(); } //================================================================ diff --git a/src/GEOMBase/GEOMBase_Helper.h b/src/GEOMBase/GEOMBase_Helper.h index ab5249e1e..6b8fe6e04 100755 --- a/src/GEOMBase/GEOMBase_Helper.h +++ b/src/GEOMBase/GEOMBase_Helper.h @@ -164,6 +164,7 @@ protected: // as a top-level object. virtual QString getNewObjectName (int CurrObj = -1) const; + virtual QString getObjectName(GEOM::GEOM_Object_ptr object) const; virtual bool extractPrefix() const; virtual void addSubshapesToStudy(); diff --git a/src/GEOMGUI/GEOM_images.ts b/src/GEOMGUI/GEOM_images.ts index 824d4e03a..19abbc79f 100644 --- a/src/GEOMGUI/GEOM_images.ts +++ b/src/GEOMGUI/GEOM_images.ts @@ -1227,5 +1227,26 @@ ICON_DLG_SCALE_ALONG_AXES scale_along_axes.png + + ICON_DLG_EXPORTXAO + exportxao.png + + + ICO_EXPORTXAO + exportxao.png + + + ICON_DLG_IMPORTXAO + importxao.png + + + ICO_IMPORTXAO + importxao.png + + + ICON_OBJBROWSER_IMPORTEXPORT_204 + tree_exportxao.png + + diff --git a/src/GEOMGUI/GEOM_msg_en.ts b/src/GEOMGUI/GEOM_msg_en.ts index c11b96858..454082125 100644 --- a/src/GEOMGUI/GEOM_msg_en.ts +++ b/src/GEOMGUI/GEOM_msg_en.ts @@ -4881,6 +4881,50 @@ Ignoring units will cause model scaling (as dimensions are supposed to be specif GEOM_SELECT_IMAGE Select image... + + MEN_IMPORTEXPORT + Import / Export + + + TOP_EXPORTXAO + Export to XAO + + + MEN_EXPORTXAO + Export XAO + + + STB_EXPORTXAO + Export shape to XAO format + + + TOP_IMPORTXAO + Import from XAO + + + MEN_IMPORTXAO + Import XAO + + + STB_IMPORTXAO + Import shape from XAO format + + + GEOM_IMPORTEXPORT_204 + Export XAO + + + GEOM_SELECT_EXPORT_XAO + Export to XAO + + + XAO_FILES + XAO files (*.xao) + + + TOOLS_IMPORTEXPORT + Import / Export + BasicGUI_CurveDlg @@ -5768,4 +5812,62 @@ Do you want to create new material? (No info available) + + ImportExportGUI_ExportXAODlg + + GEOM_EXPORTXAO_TITLE + Export XAO + + + GEOM_EXPORTXAO + Export XAO + + + GEOM_EXPORTXAO_EXPORTINGSHAPE + Shape + + + GEOM_EXPORTXAO_FILENAME + File Name + + + GEOM_EXPORTXAO_AUTHOR + Author + + + GEOM_EXPORTXAO_LGROUPS + Groups + + + GEOM_EXPORTXAO_LFIELDS + Fields + + + + ImportExportGUI_ImportXAODlg + + GEOM_IMPORTXAO_TITLE + Import XAO + + + GEOM_IMPORTXAO + Import XAO + + + GEOM_IMPORTXAO_IMPORTINGSHAPE + Shape + + + GEOM_IMPORTXAO_FILENAME + File Name + + + GEOM_IMPORTXAO_LGROUPS + Groups + + + GEOM_IMPORTXAO_LFIELDS + Fields + + diff --git a/src/GEOMGUI/GEOM_msg_fr.ts b/src/GEOMGUI/GEOM_msg_fr.ts index 11bde0082..f013178ac 100644 --- a/src/GEOMGUI/GEOM_msg_fr.ts +++ b/src/GEOMGUI/GEOM_msg_fr.ts @@ -4895,6 +4895,50 @@ le paramètre '%1' aux préférences du module Géométrie.GEOM_SELECT_IMAGE Sélectionner une image... + + MEN_IMPORTEXPORT + Import / Export + + + TOP_EXPORTXAO + Export XAO + + + MEN_EXPORTXAO + Export XAO + + + STB_EXPORTXAO + Exporter une forme au format XAO + + + TOP_IMPORTXAO + Import XAO + + + MEN_IMPORTXAO + Import XAO + + + STB_IMPORTXAO + Importer une forme au format XAO + + + GEOM_IMPORTEXPORT_204 + Export XAO + + + GEOM_SELECT_EXPORT_XAO + Export XAO + + + XAO_FILES + Fichiers XAO (*.xao) + + + TOOLS_IMPORTEXPORT + Import / Export + BasicGUI_CurveDlg @@ -5782,6 +5826,64 @@ Voulez-vous en créer un nouveau ? Information + + ImportExportGUI_ExportXAODlg + + GEOM_EXPORTXAO_TITLE + Export XAO + + + GEOM_EXPORTXAO + Export XAO + + + GEOM_EXPORTXAO_EXPORTINGSHAPE + Objet + + + GEOM_EXPORTXAO_FILENAME + Fichier + + + GEOM_EXPORTXAO_AUTHOR + Auteur + + + GEOM_EXPORTXAO_LGROUPS + Groupes + + + GEOM_EXPORTXAO_LFIELDS + Champs + + + + ImportExportGUI_ImportXAODlg + + GEOM_IMPORTXAO_TITLE + Import XAO + + + GEOM_IMPORTXAO + Import XAO + + + GEOM_IMPORTXAO_IMPORTINGSHAPE + Objet + + + GEOM_IMPORTXAO_FILENAME + Fichier + + + GEOM_IMPORTXAO_LGROUPS + Groupes + + + GEOM_IMPORTXAO_LFIELDS + Champs + + diff --git a/src/GEOMGUI/GeometryGUI.cxx b/src/GEOMGUI/GeometryGUI.cxx index 6efdf1648..c447d1434 100644 --- a/src/GEOMGUI/GeometryGUI.cxx +++ b/src/GEOMGUI/GeometryGUI.cxx @@ -641,6 +641,10 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam ) case GEOMOp::OpExplodeBlock: // MENU BLOCKS - EXPLODE ON BLOCKS libName = "BlocksGUI"; break; + case GEOMOp::OpExportXAO: // MENU NEW ENTITY - IMPORTEXPORT - EXPORTXAO + case GEOMOp::OpImportXAO: // MENU NEW ENTITY - IMPORTEXPORT - IMPORTXAO + libName = "ImportExportGUI"; + break; //case GEOMOp::OpAdvancedNoOp: // NO OPERATION (advanced operations base) //case GEOMOp::OpPipeTShape: // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE //case GEOMOp::OpPipeTShapeGroups: // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE GROUPS @@ -1052,6 +1056,10 @@ void GeometryGUI::initialize( CAM_Application* app ) createGeomAction( GEOMOp::OpDecrNbIsos, "", "", 0, false, "Geometry:Decrease number of isolines"); + // Import/Export XAO + createGeomAction( GEOMOp::OpExportXAO, "EXPORTXAO" ); + createGeomAction( GEOMOp::OpImportXAO, "IMPORTXAO" ); + //createGeomAction( GEOMOp::OpPipeTShape, "PIPETSHAPE" ); //createGeomAction( GEOMOp::OpDividedDisk, "DIVIDEDDISK" ); //createGeomAction( GEOMOp::OpDividedCylinder, "DIVIDEDCYLINDER" ); @@ -1105,6 +1113,10 @@ void GeometryGUI::initialize( CAM_Application* app ) createMenu( GEOMOp::OpPipePath, genId, -1 ); #endif + int impexpId = createMenu( tr( "MEN_IMPORTEXPORT" ), newEntId, -1 ); + createMenu( GEOMOp::OpExportXAO, impexpId, -1 ); + createMenu( GEOMOp::OpImportXAO, impexpId, -1 ); + //int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 ); //createMenu( GEOMOp::OpSmoothingSurface, advId, -1 ); //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@// @@ -1380,6 +1392,10 @@ void GeometryGUI::initialize( CAM_Application* app ) createTool( GEOMOp::OpFeatureDetect, picturesTbId ); #endif + int impexpTbId = createTool( tr( "TOOL_IMPORTEXPORT" ) ); + createTool( GEOMOp::OpExportXAO, impexpTbId ); + createTool( GEOMOp::OpImportXAO, impexpTbId ); + //int advancedTbId = createTool( tr( "TOOL_ADVANCED" ) ); //createTool( GEOMOp::OpSmoothingSurface, advancedTbId ); //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@ do not remove this line @@// diff --git a/src/GEOMGUI/GeometryGUI_Operations.h b/src/GEOMGUI/GeometryGUI_Operations.h index 86963a94b..bb1b4292b 100644 --- a/src/GEOMGUI/GeometryGUI_Operations.h +++ b/src/GEOMGUI/GeometryGUI_Operations.h @@ -193,6 +193,9 @@ namespace GEOMOp { OpQuadFace = 6102, // MENU BLOCKS - QUADRANGLE FACE OpPropagate = 6103, // MENU BLOCKS - PROPAGATE OpExplodeBlock = 6104, // MENU BLOCKS - EXPLODE ON BLOCKS + // ImportExport ----------------//-------------------------------- + OpExportXAO = 6200, // MENU NEW ENTITY - IMPORTEXPORT - EXPORTXAO + OpImportXAO = 6201, // MENU NEW ENTITY - IMPORTEXPORT - IMPORTXAO // AdvancedGUI -----------------//-------------------------------- OpAdvancedNoOp = 10000, // NO OPERATION (advanced operations base) //OpPipeTShape = 10001, // MENU NEW ENTITY - ADVANCED - PIPE TSHAPE diff --git a/src/GEOMImpl/CMakeLists.txt b/src/GEOMImpl/CMakeLists.txt index 4f028766f..e048cf955 100755 --- a/src/GEOMImpl/CMakeLists.txt +++ b/src/GEOMImpl/CMakeLists.txt @@ -25,19 +25,22 @@ INCLUDE_DIRECTORIES( ${PTHREAD_INCLUDE_DIR} ${KERNEL_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS} + ${LIBXML2_INCLUDE_DIR} ${PROJECT_SOURCE_DIR}/src/ShHealOper - ${PROJECT_SOURCE_DIR}/src/GEOM - ${PROJECT_SOURCE_DIR}/src/BlockFix - ${PROJECT_SOURCE_DIR}/src/GEOMAlgo - ${PROJECT_SOURCE_DIR}/src/GEOMUtils - ${PROJECT_SOURCE_DIR}/src/SKETCHER - ${PROJECT_SOURCE_DIR}/src/ARCHIMEDE + ${PROJECT_SOURCE_DIR}/src/GEOM + ${PROJECT_SOURCE_DIR}/src/BlockFix + ${PROJECT_SOURCE_DIR}/src/GEOMAlgo + ${PROJECT_SOURCE_DIR}/src/GEOMUtils + ${PROJECT_SOURCE_DIR}/src/SKETCHER + ${PROJECT_SOURCE_DIR}/src/ARCHIMEDE + ${PROJECT_SOURCE_DIR}/src/XAO ${CMAKE_CURRENT_SOURCE_DIR} ) # additional preprocessor / compiler flags ADD_DEFINITIONS( ${CAS_DEFINITIONS} + ${LIBXML2_DEFINITIONS} ${PYTHON_DEFINITIONS} ) @@ -46,7 +49,8 @@ SET(_link_LIBRARIES ${CAS_TKFeat} ${CAS_TKFillet} ${PYTHON_LIBRARIES} - ShHealOper GEOMbasic BlockFix GEOMAlgo GEOMUtils GEOMSketcher GEOMArchimede + ${LIBXML2_LIBRARIES} + ShHealOper GEOMbasic BlockFix GEOMAlgo GEOMUtils GEOMSketcher GEOMArchimede XAO ${KERNEL_SALOMELocalTrace} ) @@ -168,6 +172,8 @@ SET(GEOMImpl_HEADERS GEOMImpl_GlueDriver.hxx GEOMImpl_Types.hxx GEOM_GEOMImpl.hxx + GEOMImpl_IImportExportXAO.hxx + GEOMImpl_XAODriver.hxx ) # --- sources --- @@ -236,6 +242,7 @@ SET(GEOMImpl_SOURCES GEOMImpl_FillingDriver.cxx GEOMImpl_GlueDriver.cxx GEOMImpl_FieldDriver.cxx + GEOMImpl_XAODriver.cxx ) # --- rules --- diff --git a/src/GEOMImpl/GEOMImpl_Gen.cxx b/src/GEOMImpl/GEOMImpl_Gen.cxx index 515ffa9fb..cf903776a 100644 --- a/src/GEOMImpl/GEOMImpl_Gen.cxx +++ b/src/GEOMImpl/GEOMImpl_Gen.cxx @@ -83,6 +83,7 @@ #include #include #include +#include //============================================================================= /*! @@ -167,6 +168,11 @@ GEOMImpl_Gen::GEOMImpl_Gen() // Field TFunction_DriverTable::Get()->AddDriver(GEOMImpl_FieldDriver::GetID(), new GEOMImpl_FieldDriver()); + // XAO operations + TFunction_DriverTable::Get()->AddDriver(GEOMImpl_XAODriver::GetID(), new GEOMImpl_XAODriver()); + + /*@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@*/ + SetEngine(this); } diff --git a/src/GEOMImpl/GEOMImpl_IImportExportXAO.hxx b/src/GEOMImpl/GEOMImpl_IImportExportXAO.hxx new file mode 100644 index 000000000..a5047037e --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_IImportExportXAO.hxx @@ -0,0 +1,41 @@ +// Copyright (C) 2013 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. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 _GEOMImpl_IImportExportXAO_HXX_ +#define _GEOMImpl_IImportExportXAO_HXX_ + +#include "GEOM_Function.hxx" + +#define IMPORTEXPORTXAO_ARG_DATA 1 + +class GEOMImpl_IImportExportXAO +{ +public: + GEOMImpl_IImportExportXAO(Handle(GEOM_Function) theFunction): _func(theFunction) {} + + void SetData(const TCollection_AsciiString& data) { _func->SetString(IMPORTEXPORTXAO_ARG_DATA, data); } + const TCollection_AsciiString GetData() { return _func->GetString(IMPORTEXPORTXAO_ARG_DATA); } + +private: + Handle(GEOM_Function) _func; +}; + +#endif // _GEOMImpl_IExportXAO_HXX_ diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx index 39ca36f16..311e43eb1 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.cxx @@ -30,9 +30,21 @@ #include #include #include +#include "GEOMImpl_IShapesOperations.hxx" +#include "GEOMImpl_IGroupOperations.hxx" +#include "GEOMImpl_XAODriver.hxx" +#include "GEOMImpl_IImportExportXAO.hxx" #include #include +#include "GEOM_ISubShape.hxx" + +#include +#include +#include +#include +#include +#include #include @@ -44,6 +56,7 @@ #include #include #include +#include #include #include @@ -70,6 +83,8 @@ GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, i : GEOM_IOperations(theEngine, theDocID) { MESSAGE("GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations"); + myShapesOperations = new GEOMImpl_IShapesOperations(GetEngine(), GetDocID()); + myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID()); } //============================================================================= @@ -80,6 +95,8 @@ GEOMImpl_IInsertOperations::GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, i GEOMImpl_IInsertOperations::~GEOMImpl_IInsertOperations() { MESSAGE("GEOMImpl_IInsertOperations::~GEOMImpl_IInsertOperations"); + delete myShapesOperations; + delete myGroupOperations; } //============================================================================= @@ -755,3 +772,404 @@ std::list GEOMImpl_IInsertOperations::GetAllTextures() SetErrorCode(OK); return id_list; } + +TopAbs_ShapeEnum getGroupDimension(XAO::Group* group) +{ + XAO::Dimension dim = group->getDimension(); + TopAbs_ShapeEnum rdim; + switch ( dim ) + { + case XAO::VERTEX: + rdim = TopAbs_VERTEX; break; + case XAO::EDGE: + rdim = TopAbs_EDGE; break; + case XAO::FACE: + rdim = TopAbs_FACE; break; + case XAO::SOLID: + rdim = TopAbs_SOLID; break; + default: + rdim = TopAbs_COMPOUND; break; + } + return rdim; +} + +XAO::Dimension shapeEnumToDimension(const TopAbs_ShapeEnum& shape) +{ + XAO::Dimension dim; + switch( shape ) { + case TopAbs_VERTEX: + dim = XAO::VERTEX; break; + case TopAbs_EDGE: + dim = XAO::EDGE; break; + case TopAbs_FACE: + dim = XAO::FACE; break; + case TopAbs_SOLID: + dim = XAO::SOLID; break; + default: + throw SALOME_Exception("Bad type"); // TODO + } + return dim; +} + +void GEOMImpl_IInsertOperations::exportGroups(std::list groupList, XAO::Xao* xaoObject, XAO::BrepGeometry* geometry) +{ + // add the groups + std::list::iterator groupIterator = groupList.begin(); + while (groupIterator != groupList.end()) + { + Handle(GEOM_Object) currGroup = (*groupIterator++); + Handle(TColStd_HArray1OfInteger) groupIds = myGroupOperations->GetObjects(currGroup); + + TopAbs_ShapeEnum shapeGroup = myGroupOperations->GetType(currGroup); + XAO::Dimension dim = shapeEnumToDimension(shapeGroup); + XAO::Group* group = xaoObject->addGroup(dim, currGroup->GetName().ToCString()); + + switch (shapeGroup) + { + case TopAbs_VERTEX: + for (int i = 1; i <= groupIds->Length(); i++) + { + std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i)); + int index = geometry->getVertexIndexByReference(ref); + group->add(index); + } + break; + case TopAbs_EDGE: + for (int i = 1; i <= groupIds->Length(); i++) + { + std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i)); + int index = geometry->getEdgeIndexByReference(ref); + group->add(index); + } + break; + case TopAbs_FACE: + for (int i = 1; i <= groupIds->Length(); i++) + { + std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i)); + int index = geometry->getFaceIndexByReference(ref); + group->add(index); + } + break; + case TopAbs_SOLID: + for (int i = 1; i <= groupIds->Length(); i++) + { + std::string ref = XAO::XaoUtils::intToString(groupIds->Value(i)); + int index = geometry->getSolidIndexByReference(ref); + group->add(index); + } + break; + } + } +} + +void GEOMImpl_IInsertOperations::exportFields(std::list fieldList, XAO::Xao* xaoObject, XAO::BrepGeometry* geometry) +{ + // TODO +} + +void GEOMImpl_IInsertOperations::exportSubshapes(const Handle(GEOM_Object)& shape, XAO::BrepGeometry* geometry) +{ + Handle(TColStd_HSequenceOfTransient) subObjects = myShapesOperations->GetExistingSubObjects(shape, false); + int nbSubObjects = subObjects->Length(); + // set the names of the sub shapes + for (int i = 1; i <= nbSubObjects; i++) + { + Handle(Standard_Transient) transientSubObject = subObjects->Value(i); + if (transientSubObject.IsNull()) + continue; + + Handle(GEOM_Object) subObject = Handle(GEOM_Object)::DownCast(transientSubObject); + if (subObject->GetType() != GEOM_GROUP) + { + int subIndex = myShapesOperations->GetSubShapeIndex(shape, subObject); + switch (subObject->GetValue().ShapeType()) + { + case TopAbs_VERTEX: + geometry->changeVertexName(subIndex, subObject->GetName().ToCString()); + break; + case TopAbs_EDGE: + geometry->changeEdgeName(subIndex, subObject->GetName().ToCString()); + break; + case TopAbs_FACE: + geometry->changeFaceName(subIndex, subObject->GetName().ToCString()); + break; + case TopAbs_SOLID: + geometry->changeSolidName(subIndex, subObject->GetName().ToCString()); + break; + } + } + } +} + +//============================================================================= +/*! + * Export a shape to XAO format + * \param shape The shape to export + * \param groups The list of groups to export + * \param fields The list of fields to export + * \param fileName The name of the file to exported + * \return boolean indicating if export was succeful. + */ +//============================================================================= +bool GEOMImpl_IInsertOperations::ExportXAO(Handle(GEOM_Object) shape, + std::list groupList, + std::list fieldList, + const char* author, + const char* fileName) +{ + SetErrorCode(KO); + + if (shape.IsNull()) return false; + + // add a new shape function with parameters + Handle(GEOM_Function) lastFunction = shape->GetLastFunction(); + if (lastFunction.IsNull()) return false; + + // add a new result object + Handle(GEOM_Object) result = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT); + + // add an Export function + Handle(GEOM_Function) exportFunction = result->AddFunction(GEOMImpl_XAODriver::GetID(), IMPORTEXPORT_EXPORTXAO); + if (exportFunction.IsNull()) return false; + if (exportFunction->GetDriverGUID() != GEOMImpl_XAODriver::GetID()) return false; + + // create the XAO object + XAO::Xao* xaoObject = new XAO::Xao(); + xaoObject->setAuthor(author); + + // add the geometry + XAO::BrepGeometry* geometry = (XAO::BrepGeometry*)XAO::Geometry::createGeometry(XAO::BREP); + TopoDS_Shape topoShape = shape->GetValue(); + exportFunction->SetValue(topoShape); + XAO::BrepGeometry* brep = (XAO::BrepGeometry*)geometry; + brep->setTopoDS_Shape(topoShape); + + geometry->setName(shape->GetName().ToCString()); + exportSubshapes(shape, geometry); + xaoObject->setGeometry(geometry); + + exportGroups(groupList, xaoObject, geometry); + exportFields(fieldList, xaoObject, geometry); + + // export the XAO to the file + xaoObject->exportXAO(fileName); + + // make a Python command + GEOM::TPythonDump pd(exportFunction); + pd << "exported = geompy.ExportXAO(" << shape; + + // list of groups + pd << ", ["; + if (groupList.size() > 0) + { + std::list::iterator itGroup = groupList.begin(); + pd << (*itGroup++); + while (itGroup != groupList.end()) + { + pd << ", " << (*itGroup++); + } + } + + // list of fields + pd << "], ["; + if (fieldList.size() > 0) + { + std::list::iterator itField = fieldList.begin(); + pd << (*itField++); + while (itField != fieldList.end()) + { + pd << ", " << (*itField++); + } + } + pd << "], "; + pd << author << ", \"" << fileName << "\")"; + + SetErrorCode(OK); + delete xaoObject; + + return true; +} + +void GEOMImpl_IInsertOperations::importSubShapes(XAO::Geometry* xaoGeometry, + Handle(GEOM_Function) function, int shapeType, int dim, + Handle(TColStd_HSequenceOfTransient)& subShapeList) +{ + Handle(GEOM_Object) subShape; + Handle(GEOM_Function) aFunction; + Handle(TColStd_HArray1OfInteger) anArray; + + XAO::GeometricElementList::iterator elementIterator = xaoGeometry->begin((XAO::Dimension)dim); + for (; elementIterator != xaoGeometry->end((XAO::Dimension)dim); elementIterator++) + { + XAO::GeometricElement element = elementIterator->second; + if (!element.hasName()) + continue; + + std::string name = element.getName(); + std::string ref = element.getReference(); + int iref = XAO::XaoUtils::stringToInt(ref); + + anArray = new TColStd_HArray1OfInteger(1, 1); + anArray->SetValue(1, iref); + + subShape = GetEngine()->AddObject(GetDocID(), GEOM_SUBSHAPE); + Handle(GEOM_Function) aFunction = subShape->AddFunction(GEOM_Object::GetSubShapeID(), 1); + if (aFunction.IsNull()) + return; + + subShape->SetName(name.c_str()); + subShape->SetType(shapeType); + + GEOM_ISubShape aSSI(aFunction); + aSSI.SetMainShape(function); + aSSI.SetIndices(anArray); + + //aFunction->SetValue(aValue); + subShapeList->Append(subShape); + + // Put this subshape in the list of sub-shapes of theMainShape + function->AddSubShapeReference(aFunction); + } +} + +//============================================================================= +/*! + * Import a shape from XAO format + * \param fileName The name of the file to import + * \param shape The imported shape + * \param subShapes The list of imported groups + * \param groups The list of imported groups + * \param fields The list of imported fields + * \return boolean indicating if import was succeful. + */ +//============================================================================= +bool GEOMImpl_IInsertOperations::ImportXAO(const char* fileName, + Handle(GEOM_Object)& shape, + Handle(TColStd_HSequenceOfTransient)& subShapes, + Handle(TColStd_HSequenceOfTransient)& groups, + Handle(TColStd_HSequenceOfTransient)& fields) +{ + SetErrorCode(KO); + + if (fileName == NULL || groups.IsNull() || fields.IsNull()) + return false; + + // Read the XAO + XAO::Xao* xaoObject = new XAO::Xao(); + try + { + xaoObject->importXAO(fileName); + } + catch (XAO::XAO_Exception& exc) + { + delete xaoObject; + SetErrorCode(exc.what()); + return false; + } + + XAO::Geometry* xaoGeometry = xaoObject->getGeometry(); + if (xaoGeometry == NULL) + { + delete xaoObject; + SetErrorCode("Cannot import XAO: geometry format not supported."); + return false; + } + + // create the shape + shape = GetEngine()->AddObject(GetDocID(), GEOM_IMPORT); + Handle(GEOM_Function) function = shape->AddFunction(GEOMImpl_XAODriver::GetID(), IMPORTEXPORT_EXPORTXAO); + if (function.IsNull()) return false; + if (function->GetDriverGUID() != GEOMImpl_XAODriver::GetID()) return false; + + // set the geometry + if (xaoGeometry->getFormat() == XAO::BREP) + { + XAO::BrepGeometry* brep = (XAO::BrepGeometry*)xaoGeometry; + TopoDS_Shape geomShape = brep->getTopoDS_Shape(); + function->SetValue(geomShape); + shape->SetName(xaoGeometry->getName().c_str()); + } + else + { + delete xaoObject; + SetErrorCode("Cannot import XAO: geometry format not supported."); + return false; + } + + // create sub shapes with names + importSubShapes(xaoGeometry, function, GEOM_POINT, XAO::VERTEX, subShapes); + importSubShapes(xaoGeometry, function, GEOM_EDGE, XAO::EDGE, subShapes); + importSubShapes(xaoGeometry, function, GEOM_FACE, XAO::FACE, subShapes); + importSubShapes(xaoGeometry, function, GEOM_SOLID, XAO::SOLID, subShapes); + + // create groups + int nbGroups = xaoObject->countGroups(); + for (int i = 0; i < nbGroups; ++i) + { + XAO::Group* xaoGroup = xaoObject->getGroup(i); + + // build an array with the indexes of the sub shapes + int nbElt = xaoGroup->count(); + Handle(TColStd_HArray1OfInteger) array = new TColStd_HArray1OfInteger(1, nbElt); + int j = 0; + for (std::set::iterator it = xaoGroup->begin(); it != xaoGroup->end(); ++it) + { + int index = (*it); + std::string ref = xaoGeometry->getElementReference(xaoGroup->getDimension(), index); + array->SetValue(++j, XAO::XaoUtils::stringToInt(ref)); + } + + // create the group with the array of sub shapes indexes + Handle(GEOM_Object) group = GetEngine()->AddSubShape(shape, array); + group->SetType(GEOM_GROUP); + group->SetName(xaoGroup->getName().c_str()); + + // Set a sub-shape type + TDF_Label freeLabel = group->GetFreeLabel(); + TDataStd_Integer::Set(freeLabel, (Standard_Integer) getGroupDimension(xaoGroup)); + groups->Append(group); + + function = group->GetLastFunction(); + } + + // TODO: create the fields + + // make a Python command + GEOM::TPythonDump pd(function); + pd << "(imported, " << shape << ", "; + + // list of sub shapes + pd << "["; + int nbSubshapes = subShapes->Length(); + std::cout << "Nb SubShapes = " << nbSubshapes << std::endl; + if (nbSubshapes > 0) + { + for (int i = 1; i <= nbSubshapes; i++) + { + Handle(GEOM_Object) obj = Handle(GEOM_Object)::DownCast(subShapes->Value(i)); + pd << obj << ((i < nbSubshapes) ? ", " : ""); + } + } + pd << "], ["; + + // list of groups + if (nbGroups > 0) + { + for (int i = 1; i <= nbGroups; i++) + { + Handle(GEOM_Object) obj = Handle(GEOM_Object)::DownCast(groups->Value(i)); + pd << obj << ((i < nbGroups) ? ", " : ""); + } + } + + pd << "], ["; + + // list of fields + pd << "]"; + pd << ") = geompy.ImportXAO(\"" << fileName << "\")"; + + delete xaoObject; + SetErrorCode(OK); + + return true; +} diff --git a/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx b/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx index 2b75ab840..d5b7befbf 100644 --- a/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx +++ b/src/GEOMImpl/GEOMImpl_IInsertOperations.hxx @@ -38,12 +38,21 @@ #include +class GEOMImpl_IShapesOperations; +class GEOMImpl_IGroupOperations; + #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1 class Handle_TColStd_HArray1OfByte; #else class Handle_TDataStd_HArray1OfByte; #endif +namespace XAO { + class Geometry; + class BrepGeometry; + class Xao; +} + class GEOMImpl_IInsertOperations : public GEOM_IOperations { public: Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID); @@ -51,10 +60,10 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations { Standard_EXPORT Handle(GEOM_Object) MakeCopy (Handle(GEOM_Object) theOriginal); - + Standard_EXPORT Handle(GEOM_Object) Import (const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatType); - + Standard_EXPORT TCollection_AsciiString ReadValue (const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatType, const TCollection_AsciiString& theParameterName); @@ -62,21 +71,21 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations { Standard_EXPORT void Export (const Handle(GEOM_Object) theOriginal, const TCollection_AsciiString& theFileName, const TCollection_AsciiString& theFormatType); - + Standard_EXPORT Standard_Boolean ImportTranslators (Handle(TColStd_HSequenceOfAsciiString)& theFormats, Handle(TColStd_HSequenceOfAsciiString)& thePatterns); - + Standard_EXPORT Standard_Boolean ExportTranslators (Handle(TColStd_HSequenceOfAsciiString)& theFormats, Handle(TColStd_HSequenceOfAsciiString)& thePatterns); - + Standard_EXPORT Standard_Boolean IsSupported (const Standard_Boolean isImport, const TCollection_AsciiString& theFormat, Handle(TCollection_HAsciiString)& theLibName); - + Standard_EXPORT Handle(GEOM_Object) RestoreShape (std::istringstream& theStream); - + Standard_EXPORT int LoadTexture(const TCollection_AsciiString& theTextureFile); - + Standard_EXPORT int AddTexture(int theWidth, int theHeight, #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1 const Handle(TColStd_HArray1OfByte)& theTexture); @@ -89,16 +98,39 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations { #else Standard_EXPORT Handle(TDataStd_HArray1OfByte) GetTexture(int theTextureId, #endif - int& theWidth, int& theHeight); + int& theWidth, int& theHeight); Standard_EXPORT std::list GetAllTextures(); + + Standard_EXPORT bool ExportXAO(Handle(GEOM_Object) shape, + std::list groupList, + std::list fieldList, + const char* author, + const char* fileName); + + Standard_EXPORT bool ImportXAO(const char* fileName, + Handle(GEOM_Object)& shape, + Handle(TColStd_HSequenceOfTransient)& subShapes, + Handle(TColStd_HSequenceOfTransient)& groups, + Handle(TColStd_HSequenceOfTransient)& fields); private: Standard_Boolean InitResMgr (); + void importSubShapes(XAO::Geometry* xaoGeometry, Handle(GEOM_Function) function, + int shapeType, int dim, + Handle(TColStd_HSequenceOfTransient)& subshapeList); + void exportSubshapes(const Handle(GEOM_Object)& shape, XAO::BrepGeometry* geometry); + void exportFields(std::list fieldList, XAO::Xao* xaoObject, + XAO::BrepGeometry* geometry); + void exportGroups(std::list groupList, XAO::Xao* xaoObject, + XAO::BrepGeometry* geometry); + private: Handle(Resource_Manager) myResMgr; Handle(Resource_Manager) myResMgrUser; + GEOMImpl_IShapesOperations* myShapesOperations; + GEOMImpl_IGroupOperations* myGroupOperations; }; #endif diff --git a/src/GEOMImpl/GEOMImpl_Types.hxx b/src/GEOMImpl/GEOMImpl_Types.hxx index 554c86401..e03c94d15 100755 --- a/src/GEOMImpl/GEOMImpl_Types.hxx +++ b/src/GEOMImpl/GEOMImpl_Types.hxx @@ -109,6 +109,8 @@ #define GEOM_FIELD 52 // == GEOM_FIELD_OBJTYPE constant #define GEOM_FIELD_STEP 53 // == GEOM_FIELD_STEP_OBJTYPE constant +#define GEOM_EXPORTXAO 54 + //GEOM_Function types #define COPY_WITH_REF 1 @@ -355,5 +357,9 @@ #define MARKER_SHAPE 2 #define MARKER_PNT2VEC 3 +// import/export XAO +#define IMPORTEXPORT_EXPORTXAO 1 +#define IMPORTEXPORT_IMPORTXAO 2 + // Advanced functions (base = 200) #define ADVANCED_BASE 200 // NO OPERATION (advanced operations base) diff --git a/src/GEOMImpl/GEOMImpl_XAODriver.cxx b/src/GEOMImpl/GEOMImpl_XAODriver.cxx new file mode 100644 index 000000000..2047e66d5 --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_XAODriver.cxx @@ -0,0 +1,128 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 + +#include +#include +#include +#include + +#include +#include + +#include "XAO_Xao.hxx" +#include "XAO_Geometry.hxx" +#include "XAO_Group.hxx" +#include "XAO_XaoUtils.hxx" +//@@ include required header files here @@// + +//======================================================================= +//function : GetID +//purpose : +//======================================================================= +const Standard_GUID& GEOMImpl_XAODriver::GetID() +{ + static Standard_GUID aGUID("FF1BBB71-5D14-4df2-980B-3A668264EA16"); + return aGUID; +} + +//======================================================================= +//function : GEOMImpl_XAODriver +//purpose : +//======================================================================= +GEOMImpl_XAODriver::GEOMImpl_XAODriver() +{ +} + +//======================================================================= +//function : Execute +//purpose : +//======================================================================= +Standard_Integer GEOMImpl_XAODriver::Execute(TFunction_Logbook& log) const +{ + if (Label().IsNull()) return 0; + Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label()); + + GEOMImpl_IImportExportXAO iexao(function); + TCollection_AsciiString xao = iexao.GetData(); + + TopoDS_Shape shape; + + Standard_Integer functionType = function->GetType(); + if (functionType == IMPORTEXPORT_EXPORTXAO) + { + } + else if (functionType == IMPORTEXPORT_IMPORTXAO) + { + } + else + { + // other construction modes here + } + + if (shape.IsNull()) return 0; + + function->SetValue(shape); + + log.SetTouched(Label()); + + return 1; +} + +//======================================================================= +//function : GEOMImpl_XAODriver_Type_ +//purpose : +//======================================================================= +Standard_EXPORT Handle_Standard_Type& GEOMImpl_XAODriver_Type_() +{ + static Handle_Standard_Type aType1 = STANDARD_TYPE(TFunction_Driver); + if (aType1.IsNull()) aType1 = STANDARD_TYPE(TFunction_Driver); + static Handle_Standard_Type aType2 = STANDARD_TYPE(MMgt_TShared); + if (aType2.IsNull()) aType2 = STANDARD_TYPE(MMgt_TShared); + static Handle_Standard_Type aType3 = STANDARD_TYPE(Standard_Transient); + if (aType3.IsNull()) aType3 = STANDARD_TYPE(Standard_Transient); + + static Handle_Standard_Transient _Ancestors[] = { aType1, aType2, aType3, NULL }; + static Handle_Standard_Type _aType = new Standard_Type("GEOMImpl_XAODriver", + sizeof(GEOMImpl_XAODriver), + 1, + (Standard_Address) _Ancestors, + (Standard_Address) NULL); + return _aType; +} + +//======================================================================= +//function : DownCast +//purpose : +//======================================================================= +const Handle(GEOMImpl_XAODriver) Handle(GEOMImpl_XAODriver)::DownCast( + const Handle(Standard_Transient)& AnObject) +{ + Handle(GEOMImpl_XAODriver) _anOtherObject; + + if (!AnObject.IsNull()) + { + if (AnObject->IsKind(STANDARD_TYPE(GEOMImpl_XAODriver))) + { + _anOtherObject = Handle(GEOMImpl_XAODriver)((Handle(GEOMImpl_XAODriver)&) AnObject); + } + } + + return _anOtherObject; +} diff --git a/src/GEOMImpl/GEOMImpl_XAODriver.hxx b/src/GEOMImpl/GEOMImpl_XAODriver.hxx new file mode 100644 index 000000000..b094b4a8c --- /dev/null +++ b/src/GEOMImpl/GEOMImpl_XAODriver.hxx @@ -0,0 +1,147 @@ +// Copyright (C) 2013 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. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 _GEOMImpl_XAODriver_HXX +#define _GEOMImpl_XAODriver_HXX + +#include + +class Handle_Standard_Type; +class GEOMImpl_XAODriver; + +Standard_EXPORT Handle_Standard_Type& STANDARD_TYPE(GEOMImpl_XAODriver); + +class Handle(GEOMImpl_XAODriver): public Handle(TFunction_Driver) +{ +public: + inline void* operator new(size_t, void* anAddress) + { + return anAddress; + } + inline void* operator new(size_t size) + { + return Standard::Allocate(size); + } + inline void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&) anAddress); + } + + Handle(GEOMImpl_XAODriver) () : + Handle(TFunction_Driver)() + { + } + Handle(GEOMImpl_XAODriver) (const Handle(GEOMImpl_XAODriver)& aHandle) : + Handle(TFunction_Driver)(aHandle) + { + } + + Handle(GEOMImpl_XAODriver) (const GEOMImpl_XAODriver* anItem) : + Handle(TFunction_Driver)((TFunction_Driver *) anItem) + { + } + + Handle(GEOMImpl_XAODriver)& operator=(const Handle(GEOMImpl_XAODriver)& aHandle) + { + Assign(aHandle.Access()); + return *this; + } + + Handle(GEOMImpl_XAODriver)& operator=(const GEOMImpl_XAODriver* anItem) + { + Assign((Standard_Transient *) anItem); + return *this; + } + + GEOMImpl_XAODriver* operator->() + { + return (GEOMImpl_XAODriver *) ControlAccess(); + } + + GEOMImpl_XAODriver* operator->() const + { + return (GEOMImpl_XAODriver *) ControlAccess(); + } + + Standard_EXPORT + ~Handle(GEOMImpl_XAODriver)() + { + } + + Standard_EXPORT + static const Handle(GEOMImpl_XAODriver) DownCast(const Handle(Standard_Transient)& AnObject); +}; + +class GEOMImpl_XAODriver: public TFunction_Driver +{ +public: + inline void* operator new(size_t, void* anAddress) + { + return anAddress; + } + inline void* operator new(size_t size) + { + return Standard::Allocate(size); + } + inline void operator delete(void *anAddress) + { + if (anAddress) Standard::Free((Standard_Address&) anAddress); + } + + // Methods PUBLIC + // + Standard_EXPORT + GEOMImpl_XAODriver(); + Standard_EXPORT + virtual Standard_Integer Execute(TFunction_Logbook& log) const; + Standard_EXPORT + virtual void Validate(TFunction_Logbook&) const + { + } + Standard_EXPORT + Standard_Boolean MustExecute(const TFunction_Logbook&) const + { + return Standard_True; + } + Standard_EXPORT + static const Standard_GUID& GetID(); + Standard_EXPORT + ~GEOMImpl_XAODriver() + { + } + + // Type management + // + Standard_EXPORT + friend Handle_Standard_Type& GEOMImpl_ExportXAODriver_Type_(); + Standard_EXPORT + const Handle(Standard_Type)& DynamicType() const + { + return STANDARD_TYPE(GEOMImpl_XAODriver); + } + Standard_EXPORT + Standard_Boolean IsKind(const Handle(Standard_Type)& AType) const + { + return (STANDARD_TYPE(GEOMImpl_XAODriver) == AType || TFunction_Driver::IsKind(AType)); + } +}; + +#endif // _GEOMImpl_XAODriver_HXX diff --git a/src/GEOMImpl/GUID.txt b/src/GEOMImpl/GUID.txt index f150f7127..34a83e707 100755 --- a/src/GEOMImpl/GUID.txt +++ b/src/GEOMImpl/GUID.txt @@ -71,5 +71,8 @@ FF1BBB69-5D14-4df2-980B-3A668264EA16 // Modify the Location FF1BBB70-5D14-4df2-980B-3A668264EA16 // Projection +FF1BBB71-5D14-4df2-980B-3A668264EA16 // Export XAO + 1C3A0F3F-729D-4E83-8232-78E74FC5637C // Pipe T-Shape + 1C3A0F30-729D-4E83-8232-78E74FC5637C // Smoothing Surface diff --git a/src/GEOM_I/CMakeLists.txt b/src/GEOM_I/CMakeLists.txt index d3ebabcc2..e70634e89 100755 --- a/src/GEOM_I/CMakeLists.txt +++ b/src/GEOM_I/CMakeLists.txt @@ -24,10 +24,12 @@ INCLUDE_DIRECTORIES( ${OMNIORB_INCLUDE_DIR} ${PTHREAD_INCLUDE_DIR} ${CAS_INCLUDE_DIRS} + ${LIBXML2_INCLUDE_DIR} ${KERNEL_INCLUDE_DIRS} ${PROJECT_SOURCE_DIR}/src/GEOMImpl ${PROJECT_SOURCE_DIR}/src/GEOM ${PROJECT_SOURCE_DIR}/src/GEOMAlgo + ${PROJECT_SOURCE_DIR}/src/XAO ${PROJECT_BINARY_DIR}/idl ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_BINARY_DIR} @@ -36,6 +38,7 @@ INCLUDE_DIRECTORIES( # additional preprocessor / compiler flags ADD_DEFINITIONS( ${CAS_DEFINITIONS} + ${LIBXML2_DEFINITIONS} ${OMNIORB_DEFINITIONS} ) @@ -102,4 +105,4 @@ ADD_LIBRARY(GEOMEngine ${GEOMEngine_SOURCES}) TARGET_LINK_LIBRARIES(GEOMEngine ${_link_LIBRARIES}) INSTALL(TARGETS GEOMEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) -INSTALL(FILES ${GEOMEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) \ No newline at end of file +INSTALL(FILES ${GEOMEngine_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/GEOM_I/GEOM_IInsertOperations_i.cc b/src/GEOM_I/GEOM_IInsertOperations_i.cc index af72b8764..6e68699cd 100644 --- a/src/GEOM_I/GEOM_IInsertOperations_i.cc +++ b/src/GEOM_I/GEOM_IInsertOperations_i.cc @@ -360,3 +360,119 @@ GEOM::ListOfLong* GEOM_IInsertOperations_i::GetAllTextures() anIDs[i] = *anIt; return anIDs._retn(); } + +//============================================================================= +/*! + * Export a shape to XAO format + * \param shape The shape to export + * \param groups The list of groups to export + * \param fields The list of fields to export + * \param author The author of the export + * \param fileName The name of the exported file + * \return boolean indicating if export was succeful. + */ +//============================================================================= +CORBA::Boolean GEOM_IInsertOperations_i::ExportXAO(GEOM::GEOM_Object_ptr shape, + const GEOM::ListOfGO& groups, const GEOM::ListOfGO& fields, + const char* author, const char* fileName) +{ + bool isGood = false; + // Set a not done flag + GetOperations()->SetNotDone(); + + // Get the reference shape + Handle(GEOM_Object) reference = GetObjectImpl(shape); + + // Get the reference groups + int ind = 0; + std::list groupsObj; + for (; ind < groups.length(); ind++) + { + Handle(GEOM_Object) gobj = GetObjectImpl(groups[ind]); + if (gobj.IsNull()) return false; + groupsObj.push_back(gobj); + } + + // Get the reference fields + ind = 0; + std::list fieldsObj; + for (; ind < fields.length(); ind++) + { + Handle(GEOM_Object) fobj = GetObjectImpl(fields[ind]); + if (fobj.IsNull()) return false; + fieldsObj.push_back(fobj); + } + + if (!reference.IsNull()) + { + // Export XAO + isGood = GetOperations()->ExportXAO(reference, groupsObj, fieldsObj, author, fileName); + } + + return isGood; +} + +//============================================================================= +/*! + * Import a shape from XAO format + * \param fileName The name of the file to import + * \param shape The imported shape + * \param subShapes The list of imported subShapes + * \param groups The list of imported groups + * \param fields The list of imported fields + * \return boolean indicating if import was succeful. + */ +//============================================================================= +CORBA::Boolean GEOM_IInsertOperations_i::ImportXAO(const char* fileName, + GEOM::GEOM_Object_out shape, + GEOM::ListOfGO_out subShapes, + GEOM::ListOfGO_out groups, + GEOM::ListOfGO_out fields) +{ + GEOM::GEOM_Object_var vshape; + shape = vshape._retn(); + + subShapes = new GEOM::ListOfGO; + groups = new GEOM::ListOfGO; + fields = new GEOM::ListOfGO; + + // Set a not done flag + GetOperations()->SetNotDone(); + + Handle(TColStd_HSequenceOfTransient) importedSubShapes = new TColStd_HSequenceOfTransient(); + Handle(TColStd_HSequenceOfTransient) importedGroups = new TColStd_HSequenceOfTransient(); + Handle(TColStd_HSequenceOfTransient) importedFields = new TColStd_HSequenceOfTransient(); + Handle(GEOM_Object) hshape; + bool res = GetOperations()->ImportXAO(fileName, hshape, importedSubShapes, importedGroups, importedFields); + + if (!GetOperations()->IsDone() || !res) + return false; + + // parse fields + int n = importedSubShapes->Length(); + subShapes->length(n); + for (int i = 1; i <= n; i++) + { + (*subShapes)[i - 1] = GetObject(Handle(GEOM_Object)::DownCast(importedSubShapes->Value(i))); + } + + // parse groups + n = importedGroups->Length(); + groups->length(n); + for (int i = 1; i <= n; i++) + { + (*groups)[i - 1] = GetObject(Handle(GEOM_Object)::DownCast(importedGroups->Value(i))); + } + + // parse fields + n = importedFields->Length(); + fields->length(n); + for (int i = 1; i <= n; i++) + { + (*fields)[i - 1] = GetObject(Handle(GEOM_Object)::DownCast(importedFields->Value(i))); + } + + shape = GetObject(hshape); + + return res; +} diff --git a/src/GEOM_I/GEOM_IInsertOperations_i.hh b/src/GEOM_I/GEOM_IInsertOperations_i.hh index 68e0f2e28..aca7a55f7 100644 --- a/src/GEOM_I/GEOM_IInsertOperations_i.hh +++ b/src/GEOM_I/GEOM_IInsertOperations_i.hh @@ -72,7 +72,19 @@ class GEOM_I_EXPORT GEOM_IInsertOperations_i : CORBA::Long& theHeight); GEOM::ListOfLong* GetAllTextures(); - + + CORBA::Boolean ExportXAO (GEOM::GEOM_Object_ptr shape, + const GEOM::ListOfGO& groups, + const GEOM::ListOfGO& fields, + const char* author, + const char* fileName); + + CORBA::Boolean ImportXAO (const char* fileName, + GEOM::GEOM_Object_out shape, + GEOM::ListOfGO_out subShapes, + GEOM::ListOfGO_out groups, + GEOM::ListOfGO_out fields); + ::GEOMImpl_IInsertOperations* GetOperations() { return (::GEOMImpl_IInsertOperations*)GetImpl(); } }; diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.cc b/src/GEOM_I_Superv/GEOM_Superv_i.cc index 556910df6..33b95bef2 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.cc +++ b/src/GEOM_I_Superv/GEOM_Superv_i.cc @@ -3288,6 +3288,30 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::GetObjects (GEOM::GEOM_Object_ptr theGroup) return aListPtr->_this(); } +//============================================================================= +// ExportXAO +//============================================================================= +CORBA::Boolean GEOM_Superv_i::ExportXAO (GEOM::GEOM_Object_ptr shape, + const GEOM::ListOfGO& groups, const GEOM::ListOfGO& fields, + const char* author, const char* fileName) +{ + beginService( " GEOM_Superv_i::ExportXAO" ); + MESSAGE("GEOM_Superv_i::ExportXAO"); + getInsOp(); + CORBA::Boolean isGood = myInsOp->ExportXAO(shape, groups, fields, author, fileName); + endService( " GEOM_Superv_i::ExportXAO" ); + return isGood; +} + +//============================================================================= +// ImportXAO +//============================================================================= +CORBA::Boolean GEOM_Superv_i::ImportXAO (const char* fileName, GEOM::GEOM_Object_out shape, + GEOM::ListOfGO_out subShapes, GEOM::ListOfGO_out groups, GEOM::ListOfGO_out fields) +{ + return false; +} + //=============================== Advanced Operations ============================= //============================================================================= // MakePipeTShape diff --git a/src/GEOM_I_Superv/GEOM_Superv_i.hh b/src/GEOM_I_Superv/GEOM_Superv_i.hh index 32ab561ce..ee8657090 100644 --- a/src/GEOM_I_Superv/GEOM_Superv_i.hh +++ b/src/GEOM_I_Superv/GEOM_Superv_i.hh @@ -682,6 +682,15 @@ public: GEOM::GEOM_Object_ptr GetMainShape (GEOM::GEOM_Object_ptr theGroup); GEOM::GEOM_List_ptr GetObjects (GEOM::GEOM_Object_ptr theGroup); + //-----------------------------------------------------------// + // ImportExport Operations // + //-----------------------------------------------------------// + CORBA::Boolean ExportXAO(GEOM::GEOM_Object_ptr shape, + const GEOM::ListOfGO& groups, const GEOM::ListOfGO& fields, + const char* author, const char* fileName); + CORBA::Boolean ImportXAO(const char* fileName, GEOM::GEOM_Object_out shape, + GEOM::ListOfGO_out subShapes, GEOM::ListOfGO_out groups, GEOM::ListOfGO_out fields); + //-----------------------------------------------------------// // Advanced Operations // //-----------------------------------------------------------// diff --git a/src/GEOM_SWIG/geomBuilder.py b/src/GEOM_SWIG/geomBuilder.py index 91e86c3cb..c4f9c9673 100644 --- a/src/GEOM_SWIG/geomBuilder.py +++ b/src/GEOM_SWIG/geomBuilder.py @@ -12288,6 +12288,36 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen): RaiseIfFailed("MakeSmoothingSurface", self.AdvOp) return anObj + ## Export a shape to XAO format + # @param shape The shape to export + # @param groups The list of groups to export + # @param fields The list of fields to export + # @param author The author of the export + # @param fileName The name of the file to export + # @return boolean + # + # @ref tui_exportxao "Example" + def ExportXAO(self, shape, groups, fields, author, fileName): + res = self.InsertOp.ExportXAO(shape, groups, fields, author, fileName) + RaiseIfFailed("ExportXAO", self.InsertOp) + return res + + ## Import a shape from XAO format + # @param shape Shape to export + # @param fileName The name of the file to import + # @return tuple (res, shape, subShapes, groups, fields) + # res Flag indicating if the import was successful + # shape The imported shape + # subShapes The list of imported subShapes + # groups The list of imported groups + # fields The list of imported fields + # + # @ref tui_importxao "Example" + def ImportXAO(self, fileName): + res = self.InsertOp.ImportXAO(fileName) + RaiseIfFailed("ImportXAO", self.InsertOp) + return res + #@@ insert new functions before this line @@ do not remove this line @@# # end of l4_advanced diff --git a/src/ImportExportGUI/CMakeLists.txt b/src/ImportExportGUI/CMakeLists.txt new file mode 100644 index 000000000..2ffcf72f0 --- /dev/null +++ b/src/ImportExportGUI/CMakeLists.txt @@ -0,0 +1,91 @@ +# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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(UseQt4Ext) +INCLUDE(${QT_USE_FILE}) + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${QT_INCLUDE_DIRS} + ${PTHREAD_INCLUDE_DIR} + ${VTK_INCLUDE_DIRS} + ${OMNIORB_INCLUDE_DIR} + ${CAS_INCLUDE_DIRS} + ${KERNEL_INCLUDE_DIRS} + ${GUI_INCLUDE_DIRS} + ${PROJECT_BINARY_DIR}/idl + ${PROJECT_BINARY_DIR} + ${PROJECT_SOURCE_DIR}/src/OBJECT + ${PROJECT_SOURCE_DIR}/src/GEOMClient + ${PROJECT_SOURCE_DIR}/src/GEOMImpl + ${PROJECT_SOURCE_DIR}/src/GEOMGUI + ${PROJECT_SOURCE_DIR}/src/GEOMBase + ${PROJECT_SOURCE_DIR}/src/DlgRef + ${PROJECT_BINARY_DIR}/src/DlgRef + ) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${CAS_DEFINITIONS} + ${OMNIORB_DEFINITIONS} + ${QT_DEFINITIONS} + ) + +# libraries to link to +SET(_link_LIBRARIES + GEOMObject + GEOMClient + GEOMImpl + GEOMBase + GEOM + DlgRef + ) + +# --- headers --- + +# header files / no moc processing +SET(ImportExportGUI_HEADERS + ImportExportGUI.h + ) + +# header files / to be processed by moc +SET(_moc_HEADERS + ImportExportGUI_ExportXAODlg.h + ImportExportGUI_ImportXAODlg.h + ) + +# --- sources --- + +# sources / moc wrappings +QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS}) + +SET(ImportExportGUI_SOURCES + ImportExportGUI.cxx + ImportExportGUI_ExportXAODlg.cxx + ImportExportGUI_ImportXAODlg.cxx + ${_moc_SOURCES} + ) + +# --- rules --- + +ADD_LIBRARY(ImportExportGUI ${ImportExportGUI_SOURCES}) +TARGET_LINK_LIBRARIES(ImportExportGUI ${_link_LIBRARIES}) +INSTALL(TARGETS ImportExportGUI EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) diff --git a/src/ImportExportGUI/ImportExportGUI.cxx b/src/ImportExportGUI/ImportExportGUI.cxx new file mode 100644 index 000000000..a011e8a64 --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI.cxx @@ -0,0 +1,98 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 +#include + +#include "GeometryGUI.h" +#include "GeometryGUI_Operations.h" + +#include +#include +#include +#include +#include + +#include "ImportExportGUI_ExportXAODlg.h" +#include "ImportExportGUI_ImportXAODlg.h" +#include "ImportExportGUI.h" +//@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@// + + +//======================================================================= +// function : ImportExportGUI() +// purpose : Constructor +//======================================================================= +ImportExportGUI::ImportExportGUI(GeometryGUI* parent) : + GEOMGUI(parent) +{ +} + +//======================================================================= +// function : ~ImportExportGUI +// purpose : Destructor +//======================================================================= +ImportExportGUI::~ImportExportGUI() +{ +} + +//======================================================================= +// function : OnGUIEvent() +// purpose : +//======================================================================= +bool ImportExportGUI::OnGUIEvent(int commandId, SUIT_Desktop* parent) +{ + SalomeApp_Application* app = getGeometryGUI()->getApp(); + if (!app) return false; + + getGeometryGUI()->EmitSignalDeactivateDialog(); + + QDialog* dialog = NULL; + switch (commandId) + { + case GEOMOp::OpExportXAO: + dialog = new ImportExportGUI_ExportXAODlg(getGeometryGUI(), parent); + break; + case GEOMOp::OpImportXAO: + dialog = new ImportExportGUI_ImportXAODlg(getGeometryGUI(), parent); + break; + //@@ insert new functions before this line @@ do not remove this line @@ do not remove this line @@// + default: + app->putInfo(tr("GEOM_PRP_COMMAND").arg(commandId)); + break; + } + + if (dialog != NULL) + dialog->show(); + + return true; +} + +//===================================================================================== +// EXPORTED METHODS +//===================================================================================== +extern "C" +{ +#ifdef WIN32 + __declspec( dllexport ) +#endif + GEOMGUI* GetLibGUI(GeometryGUI* parent) + { + return new ImportExportGUI(parent); + } +} diff --git a/src/ImportExportGUI/ImportExportGUI.h b/src/ImportExportGUI/ImportExportGUI.h new file mode 100644 index 000000000..a2165bd9d --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI.h @@ -0,0 +1,41 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : ImportExportGUI.h +// Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +// +#ifndef IMPORTEXPORTGUI_H +#define IMPORTEXPORTGUI_H + +#include "GEOMGUI.h" + +//================================================================================= +// class : ImportExportGUI +// purpose : +//================================================================================= +class ImportExportGUI: public GEOMGUI +{ +public: + ImportExportGUI(GeometryGUI* parent); + ~ImportExportGUI(); + + bool OnGUIEvent(int commandId, SUIT_Desktop* parent); +}; + +#endif // IMPORTEXPORTGUI_H diff --git a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx new file mode 100644 index 000000000..93651b27c --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.cxx @@ -0,0 +1,383 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +//#include + +// OCCT Includes +#include +#include +#include +#include +#include + +#include +#include "ImportExportGUI_ExportXAODlg.h" +//#include "ImportExportGUI_Widgets.h" + +//================================================================================= +// Constructor +//================================================================================= +ImportExportGUI_ExportXAODlg::ImportExportGUI_ExportXAODlg(GeometryGUI* geometryGUI, QWidget* parent) +: + GEOMBase_Skeleton(geometryGUI, parent, false) +{ + m_mainObj = GEOM::GEOM_Object::_nil(); + + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + QPixmap imageOp(resMgr->loadPixmap("GEOM", tr("ICON_DLG_EXPORTXAO"))); + QPixmap iconSelect(resMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setWindowTitle(tr("GEOM_EXPORTXAO_TITLE")); + + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle(tr("GEOM_EXPORTXAO_TITLE")); + mainFrame()->RadioButton1->setIcon(imageOp); + mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton3->close(); + + // hide name + mainFrame()->GroupBoxName->hide(); + + //**************************** + // Selection Group box + QGroupBox* gbxExport = new QGroupBox(parent); + + QGridLayout* gridLayoutExport = new QGridLayout(gbxExport); +#ifndef Q_OS_MAC + gridLayoutExport->setSpacing(6); + gridLayoutExport->setContentsMargins(9, 9, 9, 9); +#endif + gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport")); + + // Line 0 + QLabel* lblShape = new QLabel(tr("GEOM_EXPORTXAO_EXPORTINGSHAPE"), gbxExport); + btnShapeSelect = new QPushButton(gbxExport); + btnShapeSelect->setIcon(iconSelect); + ledShape = new QLineEdit(gbxExport); + ledShape->setMinimumSize(QSize(100, 0)); + + int line = 0, col = 0; + gridLayoutExport->addWidget(lblShape, line, col++, 1, 1); + gridLayoutExport->addWidget(btnShapeSelect, line, col++, 1, 1); + gridLayoutExport->addWidget(ledShape, line, col++, 1, 1); + + // Line 1 + QLabel* lblFileName = new QLabel(tr("GEOM_EXPORTXAO_FILENAME"), gbxExport); + btnFileSelect = new QPushButton(gbxExport); + ledFileName = new QLineEdit(gbxExport); + btnFileSelect->setText("..."); + + line++; col = 0; + gridLayoutExport->addWidget(lblFileName, line, col++, 1, 1); + gridLayoutExport->addWidget(btnFileSelect, line, col++, 1, 1); + gridLayoutExport->addWidget(ledFileName, line, col++, 1, 1); + + // Line 2 + QLabel* lblAuthor = new QLabel(tr("GEOM_EXPORTXAO_AUTHOR"), gbxExport); + ledAuthor = new QLineEdit(gbxExport); + + line++; col = 0; + gridLayoutExport->addWidget(lblAuthor, line, col++, 2, 1); + col++; // span + gridLayoutExport->addWidget(ledAuthor, line, col++, 1, 1); + + //**************************** + // Filter Group box + QGroupBox* gbxFilter = new QGroupBox(parent); + + QGridLayout* gridLayoutFilter = new QGridLayout(gbxFilter); +#ifndef Q_OS_MAC + gridLayoutFilter->setSpacing(6); + gridLayoutFilter->setContentsMargins(9, 9, 9, 9); +#endif + gridLayoutFilter->setObjectName(QString::fromUtf8("gbxFilter")); + + // Line 0 + QLabel* lblGroups = new QLabel(tr("GEOM_EXPORTXAO_LGROUPS"), gbxFilter); + QLabel* lblFields = new QLabel(tr("GEOM_EXPORTXAO_LFIELDS"), gbxFilter); + + line = 0, col = 0; + gridLayoutFilter->addWidget(lblGroups, line, col++, 1, 1); + gridLayoutFilter->addWidget(lblFields, line, col++, 1, 1); + + // Line 1 + lstGroups = new QListWidget(gbxFilter); + lstGroups->setSelectionMode(QAbstractItemView::ExtendedSelection); + lstFields = new QListWidget(gbxFilter); + lstFields ->setSelectionMode(QAbstractItemView::ExtendedSelection); + + line++; col = 0; + gridLayoutFilter->addWidget(lstGroups, line, col++, 1, 1); + gridLayoutFilter->addWidget(lstFields, line, col++, 1, 1); + + //**************************** + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); + layout->setMargin(0); + layout->setSpacing(6); + layout->addWidget(gbxExport); + layout->addWidget(gbxFilter); + + // set help + setHelpFileName("create_exportxao_page.html"); + + Init(); +} + +//================================================================================= +// Destructor +//================================================================================= +ImportExportGUI_ExportXAODlg::~ImportExportGUI_ExportXAODlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::Init() +{ + // Get setting of step value from file configuration + m_groups.clear(); + m_fields.clear(); + + // Signal/slot connections + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect(btnShapeSelect, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); + connect(((SalomeApp_Application*) (SUIT_Session::session()->activeApplication()))->selectionMgr(), + SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())); + + connect(btnFileSelect, SIGNAL(clicked()), this, SLOT(btnFileSelectClicked())); + + + initName(tr("GEOM_EXPORTXAO")); + SelectionIntoArgument(); +} + +//================================================================================= +// function : processObject() +// purpose : Fill dialog fields in accordance with myObj +//================================================================================= +void ImportExportGUI_ExportXAODlg::processObject() +{ + lstGroups->clear(); + lstFields->clear(); + m_groups.clear(); + m_fields.clear(); + + if (m_mainObj->_is_nil()) + { + ledShape->setText(""); + } + else + { + ledShape->setText(GEOMBase::GetName(m_mainObj)); + GEOM::GEOM_IShapesOperations_var shapeOp = getGeomEngine()->GetIShapesOperations(getStudyId()); + + // add groups names + GEOM::ListOfGO_var groups = shapeOp->GetExistingSubObjects(m_mainObj, true); + for (int i = 0, n = groups->length(); i < n; i++) + { + QListWidgetItem* item = new QListWidgetItem(); + item->setData(Qt::UserRole, QVariant(i)); + item->setText(GEOMBase::GetName(groups[i])); + lstGroups->addItem(item); + m_groups.append(GEOM::GeomObjPtr(groups[i].in())); + } + lstGroups->sortItems(Qt::AscendingOrder); + + // TODO: add fields + } +} + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::ClickOnOk() +{ + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool ImportExportGUI_ExportXAODlg::ClickOnApply() +{ + if (!onAccept()) + return false; + + initName(); + + return true; +} + +//================================================================================= +// function : SelectionIntoArgument() +// purpose : Called when selection as changed or other case +//================================================================================= +void ImportExportGUI_ExportXAODlg::SelectionIntoArgument() +{ + m_mainObj = GEOM::GEOM_Object::_nil(); + + LightApp_SelectionMgr* selMgr = myGeomGUI->getApp()->selectionMgr(); + SALOME_ListIO selList; + selMgr->selectedObjects(selList); + + if (selList.Extent() == 1) + { + m_mainObj = GEOMBase::ConvertIOinGEOMObject(selList.First()); + } + + processObject(); +} + +//================================================================================= +// function : SetEditCurrentArgument() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::SetEditCurrentArgument() +{ + ledShape->setFocus(); + myEditCurrentArgument = ledShape; + SelectionIntoArgument(); +} + +//================================================================================= +// function : btnFileSelectClicked() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::btnFileSelectClicked() +{ + QString selFile = QFileDialog::getSaveFileName(this, tr("GEOM_SELECT_EXPORT_XAO"), + QString(), tr("XAO_FILES")); + if (!selFile.isEmpty()) + { + ledFileName->setText(selFile); + } +} + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); +} + +//================================================================================= +// function : enterEvent [REDEFINED] +// purpose : +//================================================================================= +void ImportExportGUI_ExportXAODlg::enterEvent(QEvent*) +{ + if (!mainFrame()->GroupConstructors->isEnabled()) + ActivateThisDialog(); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr ImportExportGUI_ExportXAODlg::createOperation() +{ + return getGeomEngine()->GetIInsertOperations(getStudyId()); +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool ImportExportGUI_ExportXAODlg::isValid(QString& msg) +{ + // check shape + if (ledShape->text().isEmpty()) + return false; + + // check file name + if (ledFileName->text().isEmpty()) + return false; + + return true; +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool ImportExportGUI_ExportXAODlg::execute(ObjectList& objects) +{ + bool res = false; + + QString author = ledAuthor->text(); + QString fileName = ledFileName->text(); + + // get selected groups + QList selGroups = lstGroups->selectedItems(); + GEOM::ListOfGO_var groups = new GEOM::ListOfGO(); + groups->length(selGroups.count()); + int i = 0; + for (QList::iterator it = selGroups.begin(); it != selGroups.end(); ++it) + { + QListWidgetItem* item = (*it); + int index = item->data(Qt::UserRole).toInt(); + groups[i++] = m_groups[index].copy(); + } + + // get selected fields + QList selFields = lstFields->selectedItems(); + GEOM::ListOfGO_var fields = new GEOM::ListOfGO(); + fields->length(m_fields.count()); + for (QList::iterator it = selFields.begin(); it != selFields.end(); ++it) + { + QListWidgetItem* item = (*it); + int index = item->data(Qt::UserRole).toInt(); + fields[i++] = m_fields[index].copy(); + } + + // call engine function + GEOM::GEOM_IInsertOperations_var ieOp = GEOM::GEOM_IInsertOperations::_narrow(getOperation()); + res = ieOp->ExportXAO(m_mainObj, groups, fields, + author.toStdString().c_str(), + fileName.toStdString().c_str()); + + return res; +} diff --git a/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h new file mode 100644 index 000000000..acc4737cd --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_ExportXAODlg.h @@ -0,0 +1,76 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 IMPORTEXPORTGUI_EXPORTXAODLG_H +#define IMPORTEXPORTGUI_EXPORTXAODLG_H + +#include +#include + +class QLineEdit; +class QButtonGroup; +class QListWidget; + +//class ImportExportGUI_1Sel1LineEdit2ListWidget; + +//================================================================================= +// class : ImportExportGUI_ExportXAODlg +// purpose : +//================================================================================= +class ImportExportGUI_ExportXAODlg: public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + ImportExportGUI_ExportXAODlg(GeometryGUI*, QWidget* = 0); + ~ImportExportGUI_ExportXAODlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid(QString&); + virtual bool execute(ObjectList&); + +private: + void Init(); + void enterEvent(QEvent*); + void processObject(); + +private: + GEOM::GEOM_Object_var m_mainObj; + QList m_groups; + QList m_fields; + QLineEdit* ledShape; + QLineEdit* ledFileName; + QLineEdit* ledAuthor; + QListWidget* lstGroups; + QListWidget* lstFields; + QPushButton* btnShapeSelect; + QPushButton* btnFileSelect; + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void ActivateThisDialog(); + void LineEditReturnPressed(); + void SelectionIntoArgument(); + void SetEditCurrentArgument(); + void btnFileSelectClicked(); +}; + +#endif // IMPORTEXPORTGUI_EXPORTXAODLG_H diff --git a/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.cxx b/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.cxx new file mode 100644 index 000000000..fe2200947 --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.cxx @@ -0,0 +1,266 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +// OCCT Includes +#include +#include +#include +#include +#include + +#include +#include "ImportExportGUI_ImportXAODlg.h" + +//================================================================================= +// Constructor +//================================================================================= +ImportExportGUI_ImportXAODlg::ImportExportGUI_ImportXAODlg(GeometryGUI* geometryGUI, QWidget* parent) +: + GEOMBase_Skeleton(geometryGUI, parent, false) +{ + SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); + QPixmap imageOp(resMgr->loadPixmap("GEOM", tr("ICON_DLG_IMPORTXAO"))); + QPixmap iconSelect(resMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + + setWindowTitle(tr("GEOM_IMPORTXAO_TITLE")); + + /***************************************************************/ + mainFrame()->GroupConstructors->setTitle(tr("GEOM_IMPORTXAO_TITLE")); + mainFrame()->RadioButton1->setIcon(imageOp); + mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton2->close(); + mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose); + mainFrame()->RadioButton3->close(); + + // hide name + mainFrame()->GroupBoxName->hide(); + + //**************************** + // Selection Group box + QGroupBox* gbxExport = new QGroupBox(parent); + + QGridLayout* gridLayoutExport = new QGridLayout(gbxExport); +#ifndef Q_OS_MAC + gridLayoutExport->setSpacing(6); + gridLayoutExport->setContentsMargins(9, 9, 9, 9); +#endif + gridLayoutExport->setObjectName(QString::fromUtf8("gridLayoutExport")); + + int line = 0, col = 0; + QLabel* lblFileName = new QLabel(tr("GEOM_IMPORTXAO_FILENAME"), gbxExport); + btnFileSelect = new QPushButton(gbxExport); + ledFileName = new QLineEdit(gbxExport); + btnFileSelect->setText("..."); + + line++; col = 0; + gridLayoutExport->addWidget(lblFileName, line, col++, 1, 1); + gridLayoutExport->addWidget(btnFileSelect, line, col++, 1, 1); + gridLayoutExport->addWidget(ledFileName, line, col++, 1, 1); + + //**************************** + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); + layout->setMargin(0); + layout->setSpacing(6); + layout->addWidget(gbxExport); + + // set help + setHelpFileName("create_importxao_page.html"); + + Init(); +} + +//================================================================================= +// Destructor +//================================================================================= +ImportExportGUI_ImportXAODlg::~ImportExportGUI_ImportXAODlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +//================================================================================= +// function : Init() +// purpose : +//================================================================================= +void ImportExportGUI_ImportXAODlg::Init() +{ + // Signal/slot connections + connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); + connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); + + connect(btnFileSelect, SIGNAL(clicked()), this, SLOT(btnFileSelectClicked())); + + initName(tr("GEOM_IMPORTXAO")); + //SelectionIntoArgument(); +} + +//================================================================================= +// function : ClickOnOk() +// purpose : +//================================================================================= +void ImportExportGUI_ImportXAODlg::ClickOnOk() +{ + if (ClickOnApply()) + ClickOnCancel(); +} + +//================================================================================= +// function : ClickOnApply() +// purpose : +//================================================================================= +bool ImportExportGUI_ImportXAODlg::ClickOnApply() +{ + if (!onAccept()) + return false; + + initName(); + + return true; +} + +//================================================================================= +// function : btnFileSelectClicked() +// purpose : +//================================================================================= +void ImportExportGUI_ImportXAODlg::btnFileSelectClicked() +{ + QString selFile = QFileDialog::getOpenFileName(this, tr("GEOM_SELECT_EXPORT_XAO"), + QString(), tr("XAO_FILES")); + if (!selFile.isEmpty()) + { + ledFileName->setText(selFile); + } +} + +//================================================================================= +// function : ActivateThisDialog() +// purpose : +//================================================================================= +void ImportExportGUI_ImportXAODlg::ActivateThisDialog() +{ + GEOMBase_Skeleton::ActivateThisDialog(); +} + +//================================================================================= +// function : enterEvent [REDEFINED] +// purpose : +//================================================================================= +void ImportExportGUI_ImportXAODlg::enterEvent(QEvent*) +{ + if (!mainFrame()->GroupConstructors->isEnabled()) + ActivateThisDialog(); +} + +//================================================================================= +// function : createOperation +// purpose : +//================================================================================= +GEOM::GEOM_IOperations_ptr ImportExportGUI_ImportXAODlg::createOperation() +{ + return getGeomEngine()->GetIInsertOperations(getStudyId()); +} + +//================================================================================= +// function : isValid +// purpose : +//================================================================================= +bool ImportExportGUI_ImportXAODlg::isValid(QString& msg) +{ + // check file name + if (ledFileName->text().isEmpty()) + return false; + + return true; +} + +//================================================================================= +// function : execute +// purpose : +//================================================================================= +bool ImportExportGUI_ImportXAODlg::execute(ObjectList& objects) +{ + bool res = false; + + QString fileName = ledFileName->text(); + GEOM::GEOM_Object_var shape; + GEOM::ListOfGO_var groups, fields, subShapes; + + GEOM::GEOM_IInsertOperations_var ieOp = GEOM::GEOM_IInsertOperations::_narrow(getOperation()); + res = ieOp->ImportXAO(fileName.toStdString().c_str(), shape, subShapes, groups, fields); + + if (!shape->_is_nil()) + { + m_mainShape = shape; + objects.push_back(shape._retn()); + } + else + { + m_mainShape = NULL; + } + + for (int i = 0; i < subShapes->length(); i++) + { + objects.push_back(GEOM::GEOM_Object::_duplicate(subShapes[i])); + } + for (int i = 0; i < groups->length(); i++) + { + objects.push_back(GEOM::GEOM_Object::_duplicate(groups[i])); + } + for (int i = 0; i < fields->length(); i++) + { + objects.push_back(GEOM::GEOM_Object::_duplicate(fields[i])); + } + + return res; +} + +GEOM::GEOM_Object_ptr ImportExportGUI_ImportXAODlg::getFather(GEOM::GEOM_Object_ptr object) +{ + GEOM::GEOM_Object_var fatherObj; + if (object->GetType() != GEOM_IMPORT && m_mainShape != NULL) + { + //GEOM::GEOM_IGroupOperations_var groupOper = getGeomEngine()->GetIGroupOperations(getStudyId()); + //fatherObj = groupOper->GetMainShape(object); + fatherObj = m_mainShape; + } + return fatherObj._retn(); +} + +QString ImportExportGUI_ImportXAODlg::getObjectName(GEOM::GEOM_Object_ptr object) const +{ + if (object->_is_nil()) + return QString::null; + return object->GetName(); +} + diff --git a/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.h b/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.h new file mode 100644 index 000000000..085c7bd90 --- /dev/null +++ b/src/ImportExportGUI/ImportExportGUI_ImportXAODlg.h @@ -0,0 +1,66 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 IMPORTEXPORTGUI_IMPORTXAODLG_H +#define IMPORTEXPORTGUI_IMPORTXAODLG_H + +#include +#include + +class QLineEdit; +class QButtonGroup; +class QListWidget; + +//================================================================================= +// class : ImportExportGUI_ImportXAODlg +// purpose : +//================================================================================= +class ImportExportGUI_ImportXAODlg: public GEOMBase_Skeleton +{ + Q_OBJECT + +public: + ImportExportGUI_ImportXAODlg(GeometryGUI*, QWidget* = 0); + ~ImportExportGUI_ImportXAODlg(); + +protected: + // redefined from GEOMBase_Helper + virtual GEOM::GEOM_IOperations_ptr createOperation(); + virtual bool isValid(QString&); + virtual bool execute(ObjectList&); + virtual GEOM::GEOM_Object_ptr getFather(GEOM::GEOM_Object_ptr object); + virtual QString getObjectName(GEOM::GEOM_Object_ptr object) const; + +private: + void Init(); + void enterEvent(QEvent*); + +private: + QLineEdit* ledFileName; + QPushButton* btnFileSelect; + GEOM::GEOM_Object_var m_mainShape; + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void ActivateThisDialog(); + void LineEditReturnPressed(); + void btnFileSelectClicked(); +}; + +#endif // IMPORTEXPORTGUI_EXPORTXAODLG_H diff --git a/src/XAO/CMakeLists.txt b/src/XAO/CMakeLists.txt new file mode 100644 index 000000000..b0ab3a4cd --- /dev/null +++ b/src/XAO/CMakeLists.txt @@ -0,0 +1,97 @@ +# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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(SALOME_BUILD_TESTS) + ADD_SUBDIRECTORY(tests) +ENDIF(SALOME_BUILD_TESTS) + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${PTHREAD_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${CAS_INCLUDE_DIRS} + ) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${LIBXML2_DEFINITIONS} + ${CAS_DEFINITIONS} + ) + +# libraries to link to +SET(_link_LIBRARIES + ${PTHREAD_LIBRARIES} + ${LIBXML2_LIBRARIES} + ${CAS_TKBRep} ${CAS_TKTopAlgo} + ) + +# --- headers --- + +SET(XAO_HEADERS + XAO_BooleanField.hxx + XAO_BooleanStep.hxx + XAO_BrepGeometry.hxx + XAO_DoubleField.hxx + XAO_DoubleStep.hxx + XAO_Exception.hxx + XAO_Field.hxx + XAO_GeometricElement.hxx + XAO_Geometry.hxx + XAO_Group.hxx + XAO_IntegerField.hxx + XAO_IntegerStep.hxx + XAO_Step.hxx + XAO_StringField.hxx + XAO_StringStep.hxx + XAO_Xao.hxx + XAO_XaoExporter.hxx + XAO_XaoUtils.hxx + ) + +# --- sources --- + +SET(XAO_SOURCES + XAO_BooleanField.cxx + XAO_BooleanStep.cxx + XAO_BrepGeometry.cxx + XAO_DoubleField.cxx + XAO_DoubleStep.cxx + XAO_Field.cxx + XAO_GeometricElement.cxx + XAO_Geometry.cxx + XAO_Group.cxx + XAO_IntegerField.cxx + XAO_IntegerStep.cxx + XAO_Step.cxx + XAO_StringField.cxx + XAO_StringStep.cxx + XAO_Xao.cxx + XAO_XaoExporter.cxx + XAO_XaoUtils.cxx + ) + +# --- rules --- + +ADD_LIBRARY(XAO ${XAO_SOURCES}) +TARGET_LINK_LIBRARIES(XAO ${_link_LIBRARIES}) +INSTALL(TARGETS XAO EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${XAO_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) diff --git a/src/XAO/XAO_BooleanField.cxx b/src/XAO/XAO_BooleanField.cxx new file mode 100644 index 000000000..c0d1532c9 --- /dev/null +++ b/src/XAO/XAO_BooleanField.cxx @@ -0,0 +1,61 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_BooleanField.hxx" +#include "XAO_BooleanStep.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +BooleanField::BooleanField(const XAO::Dimension& dimension, + const int& nbElements, const int& nbComponents, const std::string& name) + : Field(dimension, nbElements, nbComponents, name) +{ +} + +Step* BooleanField::addNewStep(const int& step) +throw (XAO_Exception) +{ + return addStep(step, 0); +} + +BooleanStep* BooleanField::addStep(const int& step) +throw (XAO_Exception) +{ + return addStep(step, 0); +} + +BooleanStep* BooleanField::addStep(const int& step, const int& stamp) +throw (XAO_Exception) +{ + if (hasStep(step)) + throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists."); + + BooleanStep* bstep = new BooleanStep(step, stamp, m_nbElements, m_nbComponents); + m_steps.push_back(bstep); + return bstep; +} + +BooleanStep* BooleanField::getStep(const int& index) +throw (XAO_Exception) +{ + checkStepIndex(index); + return (BooleanStep*)m_steps[index]; +} diff --git a/src/XAO/XAO_BooleanField.hxx b/src/XAO/XAO_BooleanField.hxx new file mode 100644 index 000000000..9860c4643 --- /dev/null +++ b/src/XAO/XAO_BooleanField.hxx @@ -0,0 +1,77 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_BOOLEANFIELD_HXX__ +#define __XAO_BOOLEANFIELD_HXX__ + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Field.hxx" +#include "XAO_BooleanStep.hxx" + +namespace XAO +{ + /** + * @class BooleanField + * Represents a field with boolean values. + */ + class BooleanField : public Field + { + public: + /** + * Constructor. + * @param dimension the dimension of the field. + * @param nbElements the number of elements. + * @param nbComponents the number of components. + * @param name the name of the field. + */ + BooleanField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name); + + virtual const XAO::Type getType() { return XAO::BOOLEAN; } + + virtual Step* addNewStep(const int& step) throw (XAO_Exception); + + /** + * Adds a new step. + * @param step the number of the step. + * @return the newly created step. + */ + BooleanStep* addStep(const int& step) throw (XAO_Exception); + + /** + * Adds a new step. + * @param step the number of the step. + * @param stamp the stamp of the step. + * @return the newly created step. + */ + BooleanStep* addStep(const int& step, const int& stamp) + throw (XAO_Exception); + + /** + * Gets the step of given index. + * @param index the index. + * @return the step for the given index. + */ + BooleanStep* getStep(const int& index) throw (XAO_Exception); + }; +} + +#endif /* __XAO_BOOLEANFIELD_HXX__ */ diff --git a/src/XAO/XAO_BooleanStep.cxx b/src/XAO/XAO_BooleanStep.cxx new file mode 100644 index 000000000..7a0d81ade --- /dev/null +++ b/src/XAO/XAO_BooleanStep.cxx @@ -0,0 +1,148 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_BooleanStep.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +BooleanStep::BooleanStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents) +{ + m_nbElements = nbElements; + m_nbComponents = nbComponents; + m_step = step; + m_stamp = stamp; + + m_values.reserve(m_nbElements); + for (int i = 0; i < m_nbElements; ++i) + { + std::vector row; + row.reserve(m_nbComponents); + for (int j = 0; j < m_nbComponents; ++j) + row.push_back(false); + m_values.push_back(row); + } +} + +std::vector BooleanStep::getValues() +{ + std::vector result; + result.reserve(m_nbElements * m_nbComponents); + + std::vector< std::vector >::iterator it; + for (it = m_values.begin(); it != m_values.end(); ++it) + { + std::vector eltValues = *it; + result.insert(result.end(), eltValues.begin(), eltValues.end()); + } + + return result; +} + +std::vector BooleanStep::getElement(const int& element) +throw (XAO_Exception) +{ + checkElementIndex(element); + + std::vector result(m_values[element]); + return result; +} + +std::vector BooleanStep::getComponent(const int& component) +throw (XAO_Exception) +{ + checkComponentIndex(component); + + std::vector result; + result.reserve(m_nbElements); + + std::vector< std::vector >::iterator it; + for (it = m_values.begin(); it != m_values.end(); ++it) + { + std::vector eltValues = *it; + result.push_back(eltValues[component]); + } + + return result; +} + +const bool BooleanStep::getValue(const int& element, const int& component) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkComponentIndex(component); + + return m_values[element][component]; +} + +const std::string BooleanStep::getStringValue(const int& element, const int& component) +throw (XAO_Exception) +{ + return XaoUtils::booleanToString(getValue(element, component)); +} + +void BooleanStep::setValues(const std::vector& values) +throw (XAO_Exception) +{ + checkNbValues((int)values.size()); + + for (int i = 0; i < m_nbElements; ++i) + { + for (int j = 0; j < m_nbComponents; ++j) + { + m_values[i][j] = values[i * m_nbComponents + j]; + } + } +} + +void BooleanStep::setElement(const int& element, const std::vector& elements) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkNbComponents(elements.size()); + + for (int i = 0; i < m_nbComponents; ++i) + m_values[element][i] = elements[i]; +} + +void BooleanStep::setComponent(const int& component, const std::vector& components) +throw (XAO_Exception) +{ + checkComponentIndex(component); + checkNbElements(components.size()); + + for (int i = 0; i < m_nbElements; ++i) + m_values[i][component] = components[i]; +} + +void BooleanStep::setValue(const int& element, const int& component, const bool& value) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkComponentIndex(component); + + m_values[element][component] = value; +} + +void BooleanStep::setStringValue(const int& element, const int& component, const std::string& value) +throw (XAO_Exception) +{ + setValue(element, component, XaoUtils::stringToBoolean(value)); +} diff --git a/src/XAO/XAO_BooleanStep.hxx b/src/XAO/XAO_BooleanStep.hxx new file mode 100644 index 000000000..9986a069a --- /dev/null +++ b/src/XAO/XAO_BooleanStep.hxx @@ -0,0 +1,114 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_BOOLEANSTEP_HXX__ +#define __XAO_BOOLEANSTEP_HXX__ + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Step.hxx" + +namespace XAO +{ + /** + * @class BooleanStep + * Step with boolean values. + */ + class BooleanStep : public Step + { + public: + /** + * Constructor. + * @param step the step number. + * @param stamp the stamp of the step. + * @param nbElements the number elements of the geometry. + * @param nbComponents the number of components of the field. + */ + BooleanStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents); + + virtual const XAO::Type getType() { return XAO::BOOLEAN; } + + /** + * Gets all the values in a vector by elements and by components. + * @return a vector containing all the values. + */ + std::vector getValues(); + + /** + * Gets all the values for an element. + * @param element the index of the element to get. + * @return a vector containing all the values for the given element. + */ + std::vector getElement(const int& element) throw (XAO_Exception); + + /** + * Gets all the values for a component. + * @param component the index of the component to get. + * @return a vector containing all the values for the given component. + */ + std::vector getComponent(const int& component) throw (XAO_Exception); + + /** + * Gets a value for an element and a component. + * @param element the index of the element. + * @param component the index of the component. + * @return the value. + */ + const bool getValue(const int& element, const int& component) throw (XAO_Exception); + + /** + * Sets all the values from a list. + * @param values the list of values to set. + */ + void setValues(const std::vector& values) throw (XAO_Exception); + + /** + * Sets the values for an element. + * @param element the index of the element to set. + * @param elements the values to set. + */ + void setElement(const int& element, const std::vector& elements) throw (XAO_Exception); + + /** + * Sets the values for a component. + * @param component the index of the component to set. + * @param components the values to set. + */ + void setComponent(const int& component, const std::vector& components) throw (XAO_Exception); + + /** + * Sets the value for an element and a component. + * @param element the index of the element. + * @param component the index of the component. + * @param value the value. + */ + void setValue(const int& element, const int& component, const bool& value) throw (XAO_Exception); + + virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception); + virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + + private: + std::vector< std::vector > m_values; + }; +} + + +#endif /* __XAO_BOOLEANSTEP_HXX__ */ diff --git a/src/XAO/XAO_BrepGeometry.cxx b/src/XAO/XAO_BrepGeometry.cxx new file mode 100644 index 000000000..042f935f9 --- /dev/null +++ b/src/XAO/XAO_BrepGeometry.cxx @@ -0,0 +1,401 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "XAO_BrepGeometry.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +BrepGeometry::BrepGeometry() : Geometry("") +{ +} + +BrepGeometry::BrepGeometry(const std::string& name) : Geometry(name) +{ +} + +const std::string BrepGeometry::getShapeString() +{ + std::ostringstream streamShape; + BRepTools::Write(m_shape, streamShape); + std::string data = streamShape.str(); + char* res = new char[data.size()]; + strcpy(res, data.c_str()); + return res; +} + +void BrepGeometry::setShapeString(const std::string& shape) +{ + std::istringstream streamBrep(shape.c_str()); + BRep_Builder builder; + BRepTools::Read(m_shape, streamBrep, builder); + + initIds(); +} + +TopoDS_Shape BrepGeometry::getTopoDS_Shape() +{ + return m_shape; +} + +void BrepGeometry::setTopoDS_Shape(const TopoDS_Shape& shape) +{ + m_shape = shape; + initIds(); +} + +void BrepGeometry::initIds() +{ + // intialization of Ids + initListIds(TopAbs_VERTEX, m_vertices); + initListIds(TopAbs_EDGE, m_edges); + initListIds(TopAbs_FACE, m_faces); + initListIds(TopAbs_SOLID, m_solids); +} + +void BrepGeometry::initListIds(const TopAbs_ShapeEnum& shapeType, GeometricElementList& eltList) +{ + TopTools_MapOfShape mapShape; + TopTools_ListOfShape listShape; + + int nbElt = 0; + TopExp_Explorer exp(m_shape, shapeType); + for (; exp.More(); exp.Next()) + { + if (mapShape.Add(exp.Current())) + { + listShape.Append(exp.Current()); + nbElt++; + } + } + + if (listShape.IsEmpty()) + return; + + TopTools_IndexedMapOfShape indices; + TopExp::MapShapes(m_shape, indices); + + eltList.setSize(nbElt); + TopTools_ListIteratorOfListOfShape itSub(listShape); + for (int index = 0; itSub.More(); itSub.Next(), ++index) + { + TopoDS_Shape value = itSub.Value(); + int ref = indices.FindIndex(value); + eltList.setReference(index, XaoUtils::intToString(ref)); + } +} + +TopoDS_Shape BrepGeometry::getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, const int& shapeIndex) +throw (XAO_Exception) +{ + TopTools_MapOfShape mapShape; + TopTools_ListOfShape listShape; + + TopExp_Explorer exp(mainShape, shapeType); + for (; exp.More(); exp.Next()) + { + if (mapShape.Add(exp.Current())) + listShape.Append(exp.Current()); + } + + if (!listShape.IsEmpty()) + { + TopTools_ListIteratorOfListOfShape itSub(listShape); + for (int index = 0; itSub.More(); itSub.Next(), ++index) + { + if (shapeIndex == index) + { + TopoDS_Shape value = itSub.Value(); + return value; + } + } + } + + throw XAO_Exception(MsgBuilder() << "Shape with reference [" << shapeIndex << "] not found."); +} + +// ----------------------------- +const int BrepGeometry::countGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType) +{ + int res = 0; + TopExp_Explorer exp(shape, shapeType); + for (; exp.More(); exp.Next()) + res++; + + return res; +} + +std::vector BrepGeometry::getGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType, const XAO::Dimension& dim) +{ + std::vector indexList; + + TopTools_MapOfShape mapShape; + TopTools_ListOfShape listShape; + + TopExp_Explorer exp(shape, shapeType); + for (; exp.More(); exp.Next()) + { + if (mapShape.Add(exp.Current())) + listShape.Append(exp.Current()); + } + + if (!listShape.IsEmpty()) + { + // use the shape of the geometry for the indices + TopTools_IndexedMapOfShape indices; + TopExp::MapShapes(m_shape, indices); + + TopTools_ListIteratorOfListOfShape itSub(listShape); + for (int index = 0; itSub.More(); itSub.Next(), ++index) + { + TopoDS_Shape value = itSub.Value(); + int id = indices.FindIndex(value); + indexList.push_back(findElement(dim, id)); + } + } + + return indexList; +} + +void BrepGeometry::getEdgeVertices(const int& edgeIndex, int& vertexA, int& vertexB) +{ + TopoDS_Shape edge = getSubShape(m_shape, TopAbs_EDGE, edgeIndex); + std::vector vertices = getGeometricalElements(edge, TopAbs_VERTEX, XAO::VERTEX); + assert(vertices.size() == 2); + + vertexA = vertices[0]; + vertexB = vertices[1]; +} + +const int BrepGeometry::countFaceWires(const int& faceIndex) +{ + TopoDS_Shape face = getSubShape(m_shape, TopAbs_FACE, faceIndex); + return countGeometricalElements(face, TopAbs_WIRE); +} + +std::vector BrepGeometry::getFaceEdges(const int& faceIndex, const int& wireIndex) +{ + // get the face + TopoDS_Shape face = getSubShape(m_shape, TopAbs_FACE, faceIndex); + // get the wire + TopoDS_Shape wire = getSubShape(face, TopAbs_WIRE, wireIndex); + return getGeometricalElements(wire, TopAbs_EDGE, XAO::EDGE); +} + +const int BrepGeometry::countSolidShells(const int& solidIndex) +{ + TopoDS_Shape solid = getSubShape(m_shape, TopAbs_SOLID, solidIndex); + return countGeometricalElements(solid, TopAbs_SHELL); +} + +std::vector BrepGeometry::getSolidFaces(const int& solidIndex, const int& shellIndex) +{ + TopoDS_Shape solid = getSubShape(m_shape, TopAbs_SOLID, solidIndex); + TopoDS_Shape shell = getSubShape(solid, TopAbs_SHELL, shellIndex); + return getGeometricalElements(shell, TopAbs_FACE, XAO::FACE); +} + +void BrepGeometry::getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord) +throw (XAO_Exception) +{ + xCoord = 0.; + yCoord = 0.; + zCoord = 0.; + + TopoDS_Shape vertex = getSubShape(m_shape, TopAbs_VERTEX, vertexIndex); + if (vertex.ShapeType() != TopAbs_VERTEX) + throw XAO_Exception(MsgBuilder() << "Shape " << vertexIndex<< " is not a point."); + + TopoDS_Vertex point = TopoDS::Vertex(vertex); + if (!point.IsNull()) + { + gp_Pnt aPnt = BRep_Tool::Pnt(point); + xCoord = aPnt.X(); + yCoord = aPnt.Y(); + zCoord = aPnt.Z(); + } +} + +// ----------------------------- +const double BrepGeometry::getEdgeLength(const int& edgeIndex) +{ + TopoDS_Shape edge = getSubShape(m_shape, TopAbs_EDGE, edgeIndex); + GProp_GProps system; + BRepGProp::LinearProperties(edge, system); + return system.Mass(); +} + +const double BrepGeometry::getFaceArea(const int& faceIndex) +{ + TopoDS_Shape face = getSubShape(m_shape, TopAbs_FACE, faceIndex); + GProp_GProps system; + BRepGProp::SurfaceProperties(face, system); + return system.Mass(); +} + +const double BrepGeometry::getSolidVolume(const int& solidIndex) +{ + TopoDS_Shape solid = getSubShape(m_shape, TopAbs_SOLID, solidIndex); + GProp_GProps system; + BRepGProp::VolumeProperties(solid, system); + return system.Mass(); +} + +// ----------------------------- +const int BrepGeometry::getVertexID(const int& index) +{ + return XaoUtils::stringToInt(getVertexReference(index)); +} + +const int BrepGeometry::getEdgeID(const int& index) +{ + return XaoUtils::stringToInt(getEdgeReference(index)); +} + +const int BrepGeometry::getFaceID(const int& index) +{ + return XaoUtils::stringToInt(getFaceReference(index)); +} + +const int BrepGeometry::getSolidID(const int& index) +{ + return XaoUtils::stringToInt(getSolidReference(index)); +} + +// ----------------------------- +void BrepGeometry::setVertexID(const int& index, const int& id) +{ + setVertexReference(index, XaoUtils::intToString(id)); +} + +void BrepGeometry::setEdgeID(const int& index, const int& id) +{ + setEdgeReference(index, XaoUtils::intToString(id)); +} + +void BrepGeometry::setFaceID(const int& index, const int& id) +{ + setEdgeReference(index, XaoUtils::intToString(id)); +} + +void BrepGeometry::setSolidID(const int& index, const int& id) +{ + setEdgeReference(index, XaoUtils::intToString(id)); +} + +// ----------------------------- +const int BrepGeometry::findElement(const XAO::Dimension& dim, const int& id) +throw (XAO_Exception) +{ + if (dim == XAO::VERTEX) + return findVertex(id); + if (dim == XAO::EDGE) + return findEdge(id); + if (dim == XAO::FACE) + return findFace(id); + if (dim == XAO::SOLID) + return findSolid(id); + + throw XAO_Exception(MsgBuilder() << "Unknown Dimension: " << dim); +} + +const int BrepGeometry::findVertex(const int& id) +{ + return getVertexIndexByReference(XaoUtils::intToString(id)); +} + +const int BrepGeometry::findEdge(const int& id) +{ + return getEdgeIndexByReference(XaoUtils::intToString(id)); +} + +const int BrepGeometry::findFace(const int& id) +{ + return getFaceIndexByReference(XaoUtils::intToString(id)); +} + +const int BrepGeometry::findSolid(const int& id) +{ + return getSolidIndexByReference(XaoUtils::intToString(id)); +} + +// ----------------------------- +const std::string BrepGeometry::findVertexName(const int& id) +{ + return getVertexName(findVertex(id)); +} + +const std::string BrepGeometry::findEdgeName(const int& id) +{ + return getEdgeName(findEdge(id)); +} + +const std::string BrepGeometry::findFaceName(const int& id) +{ + return getFaceName(findFace(id)); +} + +const std::string BrepGeometry::findSolidName(const int& id) +{ + return getSolidName(findSolid(id)); +} + +// ----------------------------- +void BrepGeometry::changeVertexName(const int& id, const std::string& name) +throw (XAO_Exception) +{ + setVertexName(findVertex(id), name); +} + +void BrepGeometry::changeEdgeName(const int& id, const std::string& name) +throw (XAO_Exception) +{ + setEdgeName(findEdge(id), name); +} + +void BrepGeometry::changeFaceName(const int& id, const std::string& name) +throw (XAO_Exception) +{ + setFaceName(findFace(id), name); +} + +void BrepGeometry::changeSolidName(const int& id, const std::string& name) +throw (XAO_Exception) +{ + setSolidName(findSolid(id), name); +} diff --git a/src/XAO/XAO_BrepGeometry.hxx b/src/XAO/XAO_BrepGeometry.hxx new file mode 100644 index 000000000..a457b3a77 --- /dev/null +++ b/src/XAO/XAO_BrepGeometry.hxx @@ -0,0 +1,318 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_BREPGEOMETRY_HXX__ +#define __XAO_BREPGEOMETRY_HXX__ + +#include +#include + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Geometry.hxx" + +namespace XAO +{ + /** + * @class BrepGeometry + * Representation of a BRep Geometry. + */ + class BrepGeometry : public Geometry + { + public: + /** + * Default Constructor. + */ + BrepGeometry(); + + /** + * Constructor. + * @param name the name of the geometry. + */ + BrepGeometry(const std::string& name); + + virtual ~BrepGeometry() {} + + /** + * Gets the format of the geometry. + * @return the format of the geometry. + */ + virtual const XAO::Format getFormat() { return XAO::BREP; } + + /** + * Gets the shape as a string. + * @return the shape as a string. + */ + virtual const std::string getShapeString(); + + /** + * Sets the shape from a string. + * @param shape the shape as a string. + */ + virtual void setShapeString(const std::string& shape); + +#ifdef SWIG + %pythoncode %{ + def setShape(self, shape): + if shape is not None and 'GetShapeStream' in dir(shape): + self.setShapeString(shape.GetShapeStream()) + else: + raise XAO_Exception("Cannot set shape") + %} +#endif + + /** + * Gets the shape as a TopoDS_Shape. + * @return the TopoDS_Shape. + */ + TopoDS_Shape getTopoDS_Shape(); + + /** + * Sets the shape from a TopoDS_Shape. + * @param shape the TopoDS_Shape to set. + */ + void setTopoDS_Shape(const TopoDS_Shape& shape); + + /** + * Gives the two extrimities of an edge. + * @param edgeIndex the index of the edge. + * @param vertexA + * @param vertexB + */ + void getEdgeVertices(const int& edgeIndex, int& vertexA, int& vertexB); + + /** + * Gets the number of wires of a face (including holes). + * @param faceIndex the index of the face. + * @return the number of wires. + */ + const int countFaceWires(const int& faceIndex); + + /** + * Gets the indices of the wires of the face. + * @param faceIndex the index of the face. + * @param wireIndex the index of the wire. + * @return the list of wires for the given face. + */ + std::vector getFaceEdges(const int& faceIndex, const int& wireIndex); + + /** + * Gets the number of shells of a solid (including cavities). + * @param solidIndex the index of the solid. + * @return the number of shells. + */ + const int countSolidShells(const int& solidIndex); + + /** + * Gets the indices of the shells of the solids. + * @param solidIndex the index of the solid. + * @param shellIndex the index of the shell (for the given solid). + * @return the list of shells for the given solid. + */ + std::vector getSolidFaces(const int& solidIndex, const int& shellIndex); + + /** + * Gets the coordinates of a vertex. + * @param vertexIndex the index of the vertex. + * @param xCoord the X coordinate. + * @param yCoord the Y coordinate. + * @param zCoord the Z coordinate. + */ + void getVertexXYZ(const int& vertexIndex, double& xCoord, double& yCoord, double& zCoord) + throw (XAO_Exception); + + /** + * Gets the length of an edge. + * @param index the index of the edge. + * @return the length of the edge. + */ + const double getEdgeLength(const int& index); + + /** + * Gets the are of a face. + * @param index the index of a face. + * @return the area of the face. + */ + const double getFaceArea(const int& index); + + /** + * Gets the volume of a solid. + * @param index the index of the solid. + * @return the volume of the solid. + */ + const double getSolidVolume(const int& index); + + /** + * Gets the ID of a vertex. + * @param index the index of the vertex. + * @return the ID of the vertex. + */ + const int getVertexID(const int& index); + + /** + * Gets the ID of an edge. + * @param index the index of the edge. + * @return the ID of the edge. + */ + const int getEdgeID(const int& index); + + /** + * Gets the ID of a face. + * @param index the index of the face. + * @return the ID of the face. + */ + const int getFaceID(const int& index); + + /** + * Gets the ID of a solid. + * @param index the index of the solid. + * @return the ID of the solid. + */ + const int getSolidID(const int& index); + + /** + * Sets the ID of a vertex. + * @param index the index of the vertex to set. + * @param id the id to set. + */ + void setVertexID(const int& index, const int& id); + + /** + * Sets the ID of an edge. + * @param index the index of the edge to set. + * @param id the id to set. + */ + void setEdgeID(const int& index, const int& id); + + /** + * Sets the ID of a face. + * @param index the index of the face to set. + * @param id the id to set. + */ + void setFaceID(const int& index, const int& id); + + /** + * Sets the ID of a solid. + * @param index the index of the solid to set. + * @param id the id to set. + */ + void setSolidID(const int& index, const int& id); + + /** + * Finds a vertex with its ID. + * @param id the ID of the vertex. + * @return the index of the vertex. + */ + const int findVertex(const int& id); + + /** + * Finds an edge with its ID. + * @param id the ID of the edge. + * @return the index of the edge. + */ + const int findEdge(const int& id); + + /** + * Finds a face with its ID. + * @param id the ID of the face. + * @return the index of the face. + */ + const int findFace(const int& id); + + /** + * Finds a solid with its ID. + * @param id the ID of the solid. + * @return th index of the solid. + */ + const int findSolid(const int& id); + + /** + * Finds the name of a vertex with its ID. + * @param id the ID of the vertex. + * @return the name of the vertex. + */ + const std::string findVertexName(const int& id); + + /** + * Finds the name of an edge with its ID. + * @param id the ID of the edge. + * @return the name of the edge. + */ + const std::string findEdgeName(const int& id); + + /** + * Finds the name of a face with its ID. + * @param id the ID of the face. + * @return the name of the face. + */ + const std::string findFaceName(const int& id); + + /** + * Finds the name of a solid with its ID. + * @param id the ID of the solid. + * @return the name of the solid. + */ + const std::string findSolidName(const int& id); + + /** + * Changes the name of a vertex. + * @param id the ID of the vertex. + * @param name the name to set. + */ + void changeVertexName(const int& id, const std::string& name) throw (XAO_Exception); + + /** + * Changes the name of an edge. + * @param id the ID of the edge + * @param name the name to set. + */ + void changeEdgeName(const int& id, const std::string& name) throw (XAO_Exception); + + /** + * Changes the name of a face. + * @param id the ID of the face. + * @param name the name to set. + */ + void changeFaceName(const int& id, const std::string& name) throw (XAO_Exception); + + /** + * Changes the name of a solid. + * @param id the ID of the solid. + * @param name the name to set. + */ + void changeSolidName(const int& id, const std::string& name) throw (XAO_Exception); + + private: + void initIds(); + void initListIds(const TopAbs_ShapeEnum& shapeType, GeometricElementList& eltList); + TopoDS_Shape getSubShape(const TopoDS_Shape& mainShape, const TopAbs_ShapeEnum& shapeType, const int& shapeIndex) + throw (XAO_Exception); + const int countGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType); + std::vector getGeometricalElements(const TopoDS_Shape& shape, const TopAbs_ShapeEnum& shapeType, const XAO::Dimension& dim); + const int findElement(const XAO::Dimension& dim, const int& id) + throw (XAO_Exception); + + private: + TopoDS_Shape m_shape; + }; +} + +#endif // __XAO_BREPGEOMETRY_HXX__ diff --git a/src/XAO/XAO_DoubleField.cxx b/src/XAO/XAO_DoubleField.cxx new file mode 100644 index 000000000..b07ebabca --- /dev/null +++ b/src/XAO/XAO_DoubleField.cxx @@ -0,0 +1,60 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_DoubleField.hxx" +#include "XAO_DoubleStep.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +DoubleField::DoubleField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name) + : Field(dimension, nbElements, nbComponents, name) +{ +} + +Step* DoubleField::addNewStep(const int& step) +throw (XAO_Exception) +{ + return addStep(step, 0); +} + +DoubleStep* DoubleField::addStep(const int& step) +throw (XAO_Exception) +{ + return addStep(step, 0); +} + +DoubleStep* DoubleField::addStep(const int& step, const int& stamp) +throw (XAO_Exception) +{ + if (hasStep(step)) + throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists."); + + DoubleStep* bstep = new DoubleStep(step, stamp, m_nbElements, m_nbComponents); + m_steps.push_back(bstep); + return bstep; +} + +DoubleStep* DoubleField::getStep(const int& index) +throw (XAO_Exception) +{ + checkStepIndex(index); + return (DoubleStep*)m_steps[index]; +} diff --git a/src/XAO/XAO_DoubleField.hxx b/src/XAO/XAO_DoubleField.hxx new file mode 100644 index 000000000..040a503b7 --- /dev/null +++ b/src/XAO/XAO_DoubleField.hxx @@ -0,0 +1,76 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_DOUBLEFIELD_HXX__ +#define __XAO_DOUBLEFIELD_HXX__ + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Field.hxx" +#include "XAO_DoubleStep.hxx" + +namespace XAO +{ + /** + * @class DoubleField + * Represents a field with double values. + */ + class DoubleField : public Field + { + public: + /** + * Constructor. + * @param dimension the dimension of the field. + * @param nbElements the number of elements. + * @param nbComponents the number of components. + * @param name the name of the field. + */ + DoubleField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name); + + virtual const XAO::Type getType() { return XAO::DOUBLE; } + + virtual Step* addNewStep(const int& step) throw (XAO_Exception); + + /** + * Adds a new step. + * @param step the number of the step. + * @return the newly created step. + */ + DoubleStep* addStep(const int& step) throw (XAO_Exception); + + /** + * Adds a new step. + * @param step the number of the step. + * @param stamp the stamp of the step. + * @return the newly created step. + */ + DoubleStep* addStep(const int& step, const int& stamp) throw (XAO_Exception); + + /** + * Gets the step of given index. + * @param index the index. + * @return the step for the given index. + */ + DoubleStep* getStep(const int& index) throw (XAO_Exception); + }; +} + +#endif /* __XAO_DOUBLEFIELD_HXX__ */ diff --git a/src/XAO/XAO_DoubleStep.cxx b/src/XAO/XAO_DoubleStep.cxx new file mode 100644 index 000000000..aa5aa3cd3 --- /dev/null +++ b/src/XAO/XAO_DoubleStep.cxx @@ -0,0 +1,148 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_DoubleStep.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +DoubleStep::DoubleStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents) +{ + m_nbElements = nbElements; + m_nbComponents = nbComponents; + m_step = step; + m_stamp = stamp; + + m_values.reserve(m_nbElements); + for (int i = 0; i < m_nbElements; ++i) + { + std::vector row; + row.reserve(m_nbComponents); + for (int j = 0; j < m_nbComponents; ++j) + row.push_back(0); + m_values.push_back(row); + } +} + +std::vector DoubleStep::getValues() +{ + std::vector result; + result.reserve(m_nbElements * m_nbComponents); + + std::vector< std::vector >::iterator it; + for (it = m_values.begin(); it != m_values.end(); ++it) + { + std::vector eltValues = *it; + result.insert(result.end(), eltValues.begin(), eltValues.end()); + } + + return result; +} + +std::vector DoubleStep::getElement(const int& element) +throw (XAO_Exception) +{ + checkElementIndex(element); + + std::vector result(m_values[element]); + return result; +} + +std::vector DoubleStep::getComponent(const int& component) +throw (XAO_Exception) +{ + checkComponentIndex(component); + + std::vector result; + result.reserve(m_nbElements); + + std::vector< std::vector >::iterator it; + for (it = m_values.begin(); it != m_values.end(); ++it) + { + std::vector eltValues = *it; + result.push_back(eltValues[component]); + } + + return result; +} + +const double DoubleStep::getValue(const int& element, const int& component) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkComponentIndex(component); + + return m_values[element][component]; +} + +const std::string DoubleStep::getStringValue(const int& element, const int& component) +throw (XAO_Exception) +{ + return XaoUtils::doubleToString(getValue(element, component)); +} + +void DoubleStep::setValues(const std::vector& values) +throw (XAO_Exception) +{ + checkNbValues(values.size()); + + for (int i = 0; i < m_nbElements; ++i) + { + for (int j = 0; j < m_nbComponents; ++j) + { + m_values[i][j] = values[i * m_nbComponents + j]; + } + } +} + +void DoubleStep::setElement(const int& element, const std::vector& elements) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkNbComponents(elements.size()); + + for (int i = 0; i < m_nbComponents; ++i) + m_values[element][i] = elements[i]; +} + +void DoubleStep::setComponent(const int& component, const std::vector& components) +throw (XAO_Exception) +{ + checkElementIndex(component); + checkNbElements(components.size()); + + for (int i = 0; i < m_nbElements; ++i) + m_values[i][component] = components[i]; +} + +void DoubleStep::setValue(const int& element, const int& component, const double& value) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkComponentIndex(component); + + m_values[element][component] = value; +} + +void DoubleStep::setStringValue(const int& element, const int& component, const std::string& value) +throw (XAO_Exception) +{ + setValue(element, component, XaoUtils::stringToDouble(value)); +} diff --git a/src/XAO/XAO_DoubleStep.hxx b/src/XAO/XAO_DoubleStep.hxx new file mode 100644 index 000000000..5f4f3e34a --- /dev/null +++ b/src/XAO/XAO_DoubleStep.hxx @@ -0,0 +1,114 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_DOUBLESTEP_HXX__ +#define __XAO_DOUBLESTEP_HXX__ + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Step.hxx" + +namespace XAO +{ + /** + * @class DoubleStep + * Step with double values. + */ + class DoubleStep : public Step + { + public: + /** + * Constructor. + * @param step the step number. + * @param stamp the stamp of the step. + * @param nbElements the number elements of the geometry. + * @param nbComponents the number of components of the field. + */ + DoubleStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents); + + virtual const XAO::Type getType() { return XAO::DOUBLE; } + + /** + * Gets all the values of the step as a list. + * @return a vector containing all the values of the step. + */ + std::vector getValues(); + + /** + * Gets all the values for a given element. + * @param element the index of the element. + * @return a vector containing all the values for the given element. + */ + std::vector getElement(const int& element) throw (XAO_Exception); + + /** + * Gets all the values for a given component. + * @param component the index of the component. + * @return a vector containing all the values for the given component. + */ + std::vector getComponent(const int& component) throw (XAO_Exception); + + /** + * Gets the value for an element and a component. + * @param element the index of the element. + * @param component the index of the component. + * @return the value for the given element and component. + */ + const double getValue(const int& element, const int& component) throw (XAO_Exception); + + /** + * Sets all the values from a list. + * @param values the list of values to set. + */ + void setValues(const std::vector& values) throw (XAO_Exception); + + /** + * Sets the values for an element. + * @param element the index of the element to set. + * @param elements the values to set. + */ + void setElement(const int& element, const std::vector& elements) throw (XAO_Exception); + + /** + * Sets the values for a component. + * @param component the index of the component to set. + * @param components the values to set. + */ + void setComponent(const int& component, const std::vector& components) throw (XAO_Exception); + + /** + * Sets the value for an element and a component. + * @param element the index of the element. + * @param component the index of the component. + * @param value the value. + */ + void setValue(const int& element, const int& component, const double& value) throw (XAO_Exception); + + virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception); + virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + + private: + std::vector< std::vector > m_values; + }; +} + + +#endif /* __XAO_DOUBLESTEP_HXX__ */ diff --git a/src/XAO/XAO_Exception.hxx b/src/XAO/XAO_Exception.hxx new file mode 100644 index 000000000..dce64a967 --- /dev/null +++ b/src/XAO/XAO_Exception.hxx @@ -0,0 +1,67 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_EXCEPTION_HXX__ +#define __XAO_EXCEPTION_HXX__ + +namespace XAO +{ + /** + * \class XAO_Exception + * Exception for XAO operations. + */ + class XAO_Exception : public std::exception + { + public: + /** + * Default constructor. + * @param message the exception message. + */ + XAO_Exception(const char* message) : m_message(message) + { + } + + virtual ~XAO_Exception() throw() {}; + + /** + * Returns the error message. + * @return the error message. + */ + virtual const char* what() const throw () + { + return m_message; + } + +#ifdef SWIG + %extend + { + std::string __str__() const + { + return std::string(self->what()); + } + } +#endif + + private: + const char* m_message; + }; +} + +#endif /* __XAO_EXCEPTION_HXX__ */ diff --git a/src/XAO/XAO_Field.cxx b/src/XAO/XAO_Field.cxx new file mode 100644 index 000000000..51d73616c --- /dev/null +++ b/src/XAO/XAO_Field.cxx @@ -0,0 +1,138 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include +#include + +#include "XAO_Xao.hxx" +#include "XAO_Field.hxx" +#include "XAO_BooleanField.hxx" +#include "XAO_IntegerField.hxx" +#include "XAO_DoubleField.hxx" +#include "XAO_StringField.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +// ------------------------------------------------------- + +Field::Field(const XAO::Dimension& dimension, + const int& nbElements, const int& nbComponents, const std::string& name) + : m_name(name), m_dimension(dimension), m_nbElements(nbElements), m_nbComponents(nbComponents) +{ + m_components.reserve(nbComponents); + for (int i = 0; i < nbComponents; ++i) + m_components.push_back(""); +} + +Field::~Field() +{ + for (int i = 0; i < m_steps.size(); ++i) + delete m_steps[i]; +} + +Field* Field::createField(const XAO::Type& type, const XAO::Dimension& dimension, + const int& nbElements, const int& nbComponents, const std::string& name) +throw (XAO_Exception) +{ + if (type == XAO::BOOLEAN) + return new BooleanField(dimension, nbElements, nbComponents, name); + if (type == XAO::INTEGER) + return new IntegerField(dimension, nbElements, nbComponents, name); + if (type == XAO::DOUBLE) + return new DoubleField(dimension, nbElements, nbComponents, name); + if (type == XAO::STRING) + return new StringField(dimension, nbElements, nbComponents, name); + + throw XAO_Exception(MsgBuilder() << "Bad Type: " << type); +} + +const std::string Field::getComponentName(const int& index) +throw (XAO_Exception) +{ + checkComponent(index); + return m_components[index]; +} + +void Field::setComponentName(const int& index, const std::string& name) +throw (XAO_Exception) +{ + checkComponent(index); + m_components[index] = name; +} + +void Field::setComponentsNames(const std::vector& names) +throw (XAO_Exception) +{ + for (int i = 0; i < names.size(); ++i) + { + if (i < m_nbComponents) + m_components[i] = names[i]; + } +} + +bool Field::removeStep(Step* step) +{ + std::vector::iterator it = m_steps.begin(); + for (; it != m_steps.end(); ++it) + { + Step* current = *it; + if (step == current) + { + m_steps.erase(it); + return true; + } + } + + return false; +} + +bool Field::hasStep(const int& step) +{ + std::vector::iterator it = m_steps.begin(); + for (; it != m_steps.end(); ++it) + { + Step* current = *it; + if (current->getStep() == step) + return true; + } + + return false; +} + +void Field::checkComponent(const int& component) +throw (XAO_Exception) +{ + if (component < m_nbComponents && component >= 0) + return; + + throw XAO_Exception(MsgBuilder() << "Step index is out of range [0, " + << m_nbComponents-1 << "]: " << component); +} + +void Field::checkStepIndex(const int& step) +throw (XAO_Exception) +{ + if (step < m_steps.size() && step >= 0) + return; + + throw XAO_Exception(MsgBuilder() << "Step index is out of range [0, " + << m_steps.size()-1 << "]: " << step); +} diff --git a/src/XAO/XAO_Field.hxx b/src/XAO/XAO_Field.hxx new file mode 100644 index 000000000..e1931d587 --- /dev/null +++ b/src/XAO/XAO_Field.hxx @@ -0,0 +1,213 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_FIELD_HXX__ +#define __XAO_FIELD_HXX__ + +#include +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Step.hxx" + +namespace XAO +{ + typedef std::vector::iterator stepIterator; + + /** + * @class Field + * A geometrical Field. + */ + class Field + { + protected: + /** + * Constructor. + * @param dimension the dimension ot the field. + * @param nbElements the number of elements. + * @param nbComponents the number of components. + * @param name the name of the field. + */ + Field(const XAO::Dimension& dimension, + const int& nbElements, const int& nbComponents, const std::string& name); + + public: + /** + /** + * Creates a Field of the given type. + * @param type the type of the field to create. + * @param dimension the dimension. + * @param nbElements the number of geometrical elements. + * @param nbComponents the number of components. + * @name the name of the field. + * @return the created field. + */ + static Field* createField(const XAO::Type& type, const XAO::Dimension& dimension, + const int& nbElements, const int& nbComponents, + const std::string& name = std::string("")) + throw (XAO_Exception); + + /** + * Destructor. + */ + virtual ~Field(); + + /** + * Gets the Type of the field. + * @return the Type of the field. + */ + virtual const XAO::Type getType() = 0; + + /** + * Gets the name of the Field. + * @return the name of the Field. + */ + const std::string getName() const + { + return m_name; + } + + /** + * Sets the name of the Field. + * @param name the name to set. + */ + void setName(const std::string& name) + { + m_name = name; + } + + /** + * Gets the Dimension of the Field. + * @return the Dimension of the Field. + */ + const XAO::Dimension getDimension() const + { + return m_dimension; + } + + /** + * Gets the number of elements of each step. + * @return the number of elements of each step. + */ + const int countElements() const + { + return m_nbElements; + } + + /** + * Gets the number of components. + * @return the number of components. + */ + const int countComponents() const + { + return m_nbComponents; + } + + /** + * Gets the number of values for each step. + * @return the number of values for each step. + */ + const int countValues() const + { + return m_nbElements * m_nbComponents; + } + + /** + * Gets the number of the steps. + * @return the number of steps. + */ + const int countSteps() const { return m_steps.size(); } + + /** + * Gets the name of a component. + * @param index the index of the component to get. + * @return the name of the component for the given index. + */ + const std::string getComponentName(const int& index) throw (XAO_Exception); + + /** + * Sets the name of a component. + * @param componentIndex the index of the component to set. + * @param name the name to set. + */ + void setComponentName(const int& componentIndex, const std::string& name) throw (XAO_Exception); + + /** + * Sets the name of the components. + * @param names the names to set. + */ + void setComponentsNames(const std::vector& names) throw (XAO_Exception); + + /** + * Adds a new step of the same type than the field. + * @param number the numer of the step. + * @return the new create step. + */ + virtual Step* addNewStep(const int& number) throw (XAO_Exception) = 0; + + /** + * Remove a step. + * @param step the step to remove. + * @return true if the step has been removed, false otherwise. + */ + bool removeStep(Step* step); + + /** + * Verifies if the field has a step with the given step number. + * @param step the step number. + * @return true if the field has a step for the given number. + */ + bool hasStep(const int& step); + + /** + * Returns the first step. + * @return an iterator on the first step. + */ + stepIterator begin() { return m_steps.begin(); } + + /** + * Returns the last step. + * @return an iterator on the last step. + */ + stepIterator end() { return m_steps.end(); } + + protected: + void checkComponent(const int& component) throw (XAO_Exception); + void checkStepIndex(const int& step) throw (XAO_Exception); + + protected: + /** The name of the Field. */ + std::string m_name; + /** The dimension of the Field. */ + XAO::Dimension m_dimension; + + /** The number of components. */ + int m_nbComponents; + /** The components of the field. */ + std::vector m_components; + /** The number of elements. */ + int m_nbElements; + + /** The list of steps. */ + std::vector m_steps; + }; +} + +#endif diff --git a/src/XAO/XAO_GeometricElement.cxx b/src/XAO/XAO_GeometricElement.cxx new file mode 100644 index 000000000..4e3de3096 --- /dev/null +++ b/src/XAO/XAO_GeometricElement.cxx @@ -0,0 +1,131 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_GeometricElement.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + + +GeometricElement::GeometricElement() +{ + m_name = ""; + m_reference = ""; +} + +GeometricElement::GeometricElement(const std::string& name, const std::string& reference) +{ + m_name = name; + m_reference = reference; +} + +GeometricElement::~GeometricElement() +{ +} + +const bool GeometricElement::hasName() +{ + return !m_name.empty(); +} + +GeometricElementList::GeometricElementList() +{ + setSize(0); +} + +GeometricElementList::GeometricElementList(const int& count) +{ + setSize(count); +} + +void GeometricElementList::setSize(const int& nb) +{ + m_count = nb; + m_elements.clear(); + for (int i = 0; i < nb; ++i) + { + m_elements[i] = GeometricElement(); + } +} + +void GeometricElementList::checkElementIndex(const int& index) const +throw (XAO_Exception) +{ + if (m_count >= 0 && index < m_count) + return; + + throw XAO_Exception(MsgBuilder() << "Index of element is out of range [0, " + << m_count-1 << "]: " << index); +} + +void GeometricElementList::setElement(const int& index, const std::string& name, const std::string& reference) +throw (XAO_Exception) +{ + checkElementIndex(index); + m_elements[index].setName(name); + m_elements[index].setReference(reference); +} + +const std::string GeometricElementList::getName(const int& index) +throw (XAO_Exception) +{ + checkElementIndex(index); + return m_elements[index].getName(); +} + +void GeometricElementList::setName(const int& index, const std::string& name) +throw (XAO_Exception) +{ + checkElementIndex(index); + m_elements[index].setName(name); +} + +const bool GeometricElementList::hasName(const int& index) +throw (XAO_Exception) +{ + checkElementIndex(index); + return m_elements[index].hasName(); +} + +const std::string GeometricElementList::getReference(const int& index) +throw (XAO_Exception) +{ + checkElementIndex(index); + return m_elements[index].getReference(); +} + +void GeometricElementList::setReference(const int& index, const std::string& name) +throw (XAO_Exception) +{ + checkElementIndex(index); + m_elements[index].setReference(name); +} + +const int GeometricElementList::getIndexByReference(const std::string& ref) +throw (XAO_Exception) +{ + for (int index = 0; index < m_count; ++index) + { + if (ref == m_elements[index].getReference()) + return index; + } + + throw XAO_Exception(MsgBuilder() << "Reference not found: " << ref); +} diff --git a/src/XAO/XAO_GeometricElement.hxx b/src/XAO/XAO_GeometricElement.hxx new file mode 100644 index 000000000..f0496479e --- /dev/null +++ b/src/XAO/XAO_GeometricElement.hxx @@ -0,0 +1,213 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_GEOMETRICELEMENT_HXX__ +#define __XAO_GEOMETRICELEMENT_HXX__ + +#include +#include +#include "XAO_Exception.hxx" + +namespace XAO +{ + /** + * \class GeometricElement + * Generic class to manipulate a topologic element (vertex, edge, face or solid). + */ + class GeometricElement + { + public: + /** + * Default constructor. + */ + GeometricElement(); + /** + * Constructor with name and reference. + * \param name the name of the element. + * \param reference the reference of the element. + */ + GeometricElement(const std::string& name, const std::string& reference); + /** + * Destructor. + */ + virtual ~GeometricElement(); + + /** + * Gets the name of the element. + * \return the name. + */ + const std::string getName() + { + return m_name; + } + /** + * Sets the name of the element + * \param name the name to set. + */ + void setName(const std::string& name) + { + m_name = name; + } + + /** + * Checks if the element has a name. + * @return true if the element has a name, false otherwise. + */ + const bool hasName(); + + /** + * Gets the reference of the element. + * \return the reference. + */ + const std::string getReference() + { + return m_reference; + } + /** + * Sets the reference of the element. + * \param reference the reference to set. + */ + void setReference(const std::string& reference) + { + m_reference = reference; + } + + private: + /** The name of the element. */ + std::string m_name; + /** The reference of the element. */ + std::string m_reference; + }; + + /** + * \class GeometricElementList + * Generic class to manipulate a list of topologic element. + */ + class GeometricElementList + { + public: + /** + * Default constructor. + */ + GeometricElementList(); + + /** + * Constructor with size. + * \param nb the size to set. + */ + GeometricElementList(const int& nb); + + /** + * Destructor. + */ + virtual ~GeometricElementList() {} + + /** + * Gets the size of the list. + * \return the size of the list. + */ + const int getSize() const { return m_count; } + + /** + * Sets the size of the list. + * \param nb the size to set. + * \warning the list will be cleared. + */ + void setSize(const int& nb); + + /** + * Sets the name and the reference of an element. + * \param index the index of the element to set. + * \param name the name to set. + * \param reference the reference to set. + * \throw XAO_Exception if index is bigger than the size of the list. + */ + void setElement(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); + /** + * Gets the name of an element. + * \param index the index of the element to set. + * \return the name of the element with the given index. + * \throw XAO_Exception if index is bigger than the size of the list. + */ + const std::string getName(const int& index) throw (XAO_Exception); + /** + * Sets the name of an element. + * \param index the index of the element. + * \param name the name to set. + * \throw XAO_Exception if index is bigger than the size of the list. + */ + void setName(const int& index, const std::string& name) throw (XAO_Exception); + + /** + * Checks if an element has a name. + * @param index the index of the element. + * @return true if the element has a name, false otherwise. + */ + const bool hasName(const int& index) throw (XAO_Exception); + + /** + * Gets the reference of an element. + * \param index the index of the element. + * \return the reference of the element. + * \throw XAO_Exception if index is bigger than the size of the list. + */ + const std::string getReference(const int& index) throw (XAO_Exception); + /** + * Sets the reference of an element. + * \param index the index of the element to set. + * \param reference the reference to set. + * \throw XAO_Exception if index is bigger than the size of the list. + */ + void setReference(const int& index, const std::string& reference) throw (XAO_Exception); + + /** + * Gets the index of an element using its reference. + * \param reference the searched reference. + * \return the index of the element or -1 if no element found. + */ + const int getIndexByReference(const std::string& reference) throw (XAO_Exception); + + /** + * Iterator on the element of the list. + */ + typedef std::map::iterator iterator; + + /** + * Gets an iterator on the first element. + * @return an iterator on the first element. + */ + iterator begin() { return m_elements.begin(); } + + /** + * Gets an iterator on the last element. + * @return an iterator on the last element. + */ + iterator end() { return m_elements.end(); } + + private: + void checkElementIndex(const int& index) const throw (XAO_Exception); + + private: + int m_count; + std::map m_elements; + }; +} + +#endif /* __XAO_GEOMETRICELEMENT_HXX__ */ diff --git a/src/XAO/XAO_Geometry.cxx b/src/XAO/XAO_Geometry.cxx new file mode 100644 index 000000000..b774b31af --- /dev/null +++ b/src/XAO/XAO_Geometry.cxx @@ -0,0 +1,195 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Nathalie Gore (OpenCascade) + +#include "XAO_XaoUtils.hxx" +#include "XAO_Geometry.hxx" +#include "XAO_BrepGeometry.hxx" + +using namespace XAO; + +Geometry::Geometry(const std::string& name) + : m_name(name) +{ + m_readOnly = false; +} + +Geometry* Geometry::createGeometry(const XAO::Format& format) +throw (XAO_Exception) +{ + return createGeometry(format, ""); +} + +Geometry* Geometry::createGeometry(const XAO::Format& format, const std::string& name) +throw (XAO_Exception) +{ + if (format == XAO::BREP) + return new BrepGeometry(name); + + throw XAO_Exception(MsgBuilder() << "Geometry format not supported: " << format); +} + +Geometry::~Geometry() +{ +} + +void Geometry::checkReadOnly() +throw (XAO_Exception) +{ + if (m_readOnly) + throw XAO_Exception("Geometry is read only."); +} + +const int Geometry::countElements(const XAO::Dimension& dim) const +throw (XAO_Exception) +{ + if (dim == XAO::VERTEX) + return countVertices(); + if (dim == XAO::EDGE) + return countEdges(); + if (dim == XAO::FACE) + return countFaces(); + if (dim == XAO::SOLID) + return countSolids(); + + throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim); +} + +const std::string Geometry::getElementReference(const XAO::Dimension& dim, const int& index) +throw (XAO_Exception) +{ + if (dim == XAO::VERTEX) + return getVertexReference(index); + if (dim == XAO::EDGE) + return getEdgeReference(index); + if (dim == XAO::FACE) + return getFaceReference(index); + if (dim == XAO::SOLID) + return getSolidReference(index); + + throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim); +} + +const int Geometry::getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference) +throw (XAO_Exception) +{ + if (dim == XAO::VERTEX) + return getVertexIndexByReference(reference); + if (dim == XAO::EDGE) + return getEdgeIndexByReference(reference); + if (dim == XAO::FACE) + return getFaceIndexByReference(reference); + if (dim == XAO::SOLID) + return getSolidIndexByReference(reference); + + throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim); +} + +GeometricElementList::iterator Geometry::begin(const XAO::Dimension& dim) +throw (XAO_Exception) +{ + if (dim == XAO::VERTEX) + return m_vertices.begin(); + if (dim == XAO::EDGE) + return m_edges.begin(); + if (dim == XAO::FACE) + return m_faces.begin(); + if (dim == XAO::SOLID) + return m_solids.begin(); + + throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim); +} + +GeometricElementList::iterator Geometry::end(const XAO::Dimension& dim) +throw (XAO_Exception) +{ + if (dim == XAO::VERTEX) + return m_vertices.end(); + if (dim == XAO::EDGE) + return m_edges.end(); + if (dim == XAO::FACE) + return m_faces.end(); + if (dim == XAO::SOLID) + return m_solids.end(); + + throw XAO_Exception(MsgBuilder() << "Unknown dimension:" << dim); +} + +void Geometry::setCountVertices(const int& nb) throw (XAO_Exception) +{ + checkReadOnly(); + m_vertices.setSize(nb); +} +void Geometry::setCountEdges(const int& nb) throw (XAO_Exception) +{ + checkReadOnly(); + m_edges.setSize(nb); +} +void Geometry::setCountFaces(const int& nb) throw (XAO_Exception) +{ + checkReadOnly(); + m_faces.setSize(nb); +} +void Geometry::setCountSolids(const int& nb) throw (XAO_Exception) +{ + checkReadOnly(); + m_solids.setSize(nb); +} + +void Geometry::setVertexReference(const int& index, const std::string& reference) throw (XAO_Exception) +{ + checkReadOnly(); + m_vertices.setReference(index, reference); +} +void Geometry::setEdgeReference(const int& index, const std::string& reference) throw (XAO_Exception) +{ + checkReadOnly(); + m_edges.setReference(index, reference); +} +void Geometry::setFaceReference(const int& index, const std::string& reference) throw (XAO_Exception) +{ + checkReadOnly(); + m_faces.setReference(index, reference); +} +void Geometry::setSolidReference(const int& index, const std::string& reference) throw (XAO_Exception) +{ + checkReadOnly(); + m_solids.setReference(index, reference); +} + +void Geometry::setVertex(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception) +{ + checkReadOnly(); + m_vertices.setElement(index, name, reference); +} +void Geometry::setEdge(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception) +{ + checkReadOnly(); + m_edges.setElement(index, name, reference); +} +void Geometry::setFace(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception) +{ + checkReadOnly(); + m_faces.setElement(index, name, reference); +} +void Geometry::setSolid(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception) +{ + checkReadOnly(); + m_solids.setElement(index, name, reference); +} diff --git a/src/XAO/XAO_Geometry.hxx b/src/XAO/XAO_Geometry.hxx new file mode 100644 index 000000000..12ca3101a --- /dev/null +++ b/src/XAO/XAO_Geometry.hxx @@ -0,0 +1,168 @@ +// 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 +// +// Author : Nathalie Gore (OpenCascade) + +#ifndef __XAO_GEOMETRY_HXX__ +#define __XAO_GEOMETRY_HXX__ + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Exception.hxx" +#include "XAO_GeometricElement.hxx" + +namespace XAO +{ + /** + * @class Geometry + * Base class for geometries. + */ + class Geometry + { + protected: + /** + * Constructor. + * @param name the name of the Geometry. + */ + Geometry(const std::string& name); + + public: + + /** + * Creates a geometry. + * @param format the format of the geometry. + * @return the created geometry. + */ + static Geometry* createGeometry(const XAO::Format& format) throw (XAO_Exception); + + /** + * Constructor. + * Creates a geometry. + * @name name the name of the geometry. + * @return the created geometry. + */ + static Geometry* createGeometry(const XAO::Format& format, const std::string& name) + throw (XAO_Exception); + + /** Destructor. */ + virtual ~Geometry(); + + /** + * Gets the name of the geometry. + * @return the name of the geometry. + */ + const std::string getName() + { + return m_name; + } + /** + * Sets the name of the geometry. + * @param name the name to set. + */ + void setName(const std::string& name) + { + m_name = name; + } + + /** + * Gets the format of the geometry. + * @return the format of the geometry. + */ + virtual const XAO::Format getFormat() = 0; + + virtual const std::string getShapeString() = 0; + virtual void setShapeString(const std::string& shape) = 0; + + const int countElements(const XAO::Dimension& dim) const throw (XAO_Exception); + const int countVertices() const { return m_vertices.getSize(); } + const int countEdges() const { return m_edges.getSize(); } + const int countFaces() const { return m_faces.getSize(); } + const int countSolids() const { return m_solids.getSize(); } + + void setCountVertices(const int& nb) throw (XAO_Exception); + void setCountEdges(const int& nb) throw (XAO_Exception); + void setCountFaces(const int& nb) throw (XAO_Exception); + void setCountSolids(const int& nb) throw (XAO_Exception); + + const std::string getVertexName(const int& index) throw (XAO_Exception) { return m_vertices.getName(index); } + const std::string getEdgeName(const int& index) throw (XAO_Exception) { return m_edges.getName(index); } + const std::string getFaceName(const int& index) throw (XAO_Exception) { return m_faces.getName(index); } + const std::string getSolidName(const int& index) throw (XAO_Exception) { return m_solids.getName(index); } + + void setVertexName(const int& index, const std::string& name) throw (XAO_Exception) { m_vertices.setName(index, name); } + void setEdgeName(const int& index, const std::string& name) throw (XAO_Exception) { m_edges.setName(index, name); } + void setFaceName(const int& index, const std::string& name) throw (XAO_Exception) { m_faces.setName(index, name); } + void setSolidName(const int& index, const std::string& name) throw (XAO_Exception) { m_solids.setName(index, name); } + + const bool hasVertexName(const int& index) throw (XAO_Exception) { return m_vertices.hasName(index); } + const bool hasEdgeName(const int& index) throw (XAO_Exception) { return m_edges.hasName(index); } + const bool hasFaceName(const int& index) throw (XAO_Exception) { return m_faces.hasName(index); } + const bool hasSolidName(const int& index) throw (XAO_Exception) { return m_solids.hasName(index); } + + const std::string getVertexReference(const int& index) throw (XAO_Exception) { return m_vertices.getReference(index); } + const std::string getEdgeReference(const int& index) throw (XAO_Exception) { return m_edges.getReference(index); } + const std::string getFaceReference(const int& index) throw (XAO_Exception) { return m_faces.getReference(index); } + const std::string getSolidReference(const int& index) throw (XAO_Exception) { return m_solids.getReference(index); } + const std::string getElementReference(const XAO::Dimension& dim, const int& index) throw (XAO_Exception); + + void setVertexReference(const int& index, const std::string& reference) throw (XAO_Exception); + void setEdgeReference(const int& index, const std::string& reference) throw (XAO_Exception); + void setFaceReference(const int& index, const std::string& reference) throw (XAO_Exception); + void setSolidReference(const int& index, const std::string& reference) throw (XAO_Exception); + + void setVertex(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); + void setEdge(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); + void setFace(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); + void setSolid(const int& index, const std::string& name, const std::string& reference) throw (XAO_Exception); + + const int getVertexIndexByReference(const std::string& reference) { return m_vertices.getIndexByReference(reference); } + const int getEdgeIndexByReference(const std::string& reference) { return m_edges.getIndexByReference(reference); } + const int getFaceIndexByReference(const std::string& reference) { return m_faces.getIndexByReference(reference); } + const int getSolidIndexByReference(const std::string& reference) { return m_solids.getIndexByReference(reference); } + const int getElementIndexByReference(const XAO::Dimension& dim, const std::string& reference) throw (XAO_Exception); + + GeometricElementList::iterator begin(const XAO::Dimension& dim) throw (XAO_Exception); + GeometricElementList::iterator end(const XAO::Dimension& dim) throw (XAO_Exception); + + /** + * Verifies if the geometry is read only. + * @return true if the geometry is read only. + */ + bool isReadOnly() { return m_readOnly; } + + /** + * Sets the geometry read only. + */ + void setReadOnly() { m_readOnly = true; } + + protected: + void checkReadOnly() throw (XAO_Exception); + + protected: + std::string m_name; + GeometricElementList m_vertices; + GeometricElementList m_edges; + GeometricElementList m_faces; + GeometricElementList m_solids; + bool m_readOnly; + + }; +} + +#endif diff --git a/src/XAO/XAO_Group.cxx b/src/XAO/XAO_Group.cxx new file mode 100644 index 000000000..50bdb272e --- /dev/null +++ b/src/XAO/XAO_Group.cxx @@ -0,0 +1,61 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Nathalie Gore (OpenCascade), Frederic Pons (OpenCascade) + +#include "XAO_XaoUtils.hxx" +#include "XAO_Group.hxx" + +using namespace XAO; + + +Group::Group(const XAO::Dimension& dim, const int& nbElements, const std::string& name) +throw (XAO_Exception) +{ + if (dim == XAO::WHOLE) + throw XAO_Exception("Dimension WHOLE is not valid for group."); + + m_name = name; + m_dimension = dim; + m_count = 0; + m_nbElements = nbElements; +} + +Group::~Group() +{ +} + +void Group::checkIndex(const int& element) +throw (XAO_Exception) +{ + if (element < m_elements.size() && element >= 0) + return; + + throw XAO_Exception(MsgBuilder() << "Index of element is out of range [0, " + << m_elements.size()-1 << "]: " << element); +} + +void Group::add(const int& value) +{ + m_elements.insert(value); +} + +void Group::remove(const int& value) +{ + m_elements.erase(value); +} diff --git a/src/XAO/XAO_Group.hxx b/src/XAO/XAO_Group.hxx new file mode 100644 index 000000000..de46a7dc0 --- /dev/null +++ b/src/XAO/XAO_Group.hxx @@ -0,0 +1,157 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Nathalie Gore (OpenCascade), Frederic Pons (OpenCascade) + +#ifndef __XAO_GROUP_HXX__ +#define __XAO_GROUP_HXX__ + +#include +#include + +#include "XAO_XaoUtils.hxx" + +namespace XAO +{ + /** + * \class Group + * Class to represent a Geometrical Group. + */ + class Group + { + public: + /** + * Constructor. + * @param dim the dimension of the group. + * @param nbElements the number of geometrical elements for the dimension in the geometry. + * @param name the name of the group. + */ + Group(const XAO::Dimension& dim, const int& nbElements, const std::string& name = std::string("")) + throw (XAO_Exception); + + /** + * Destructor. + */ + virtual ~Group(); + + /** + * Gets the name of the group. + * \return the name of the group. + */ + const std::string getName() + { + return m_name; + } + /** + * Sets the name of the group. + * \param name the name to set. + */ + void setName(const std::string& name) + { + m_name = name; + } + + /** + * Gets the dimension of the group. + * \return the dimension of the group. + */ + const XAO::Dimension getDimension() + { + return m_dimension; + } + + /** + * Gets the numbers of elements in the geometry of the same type than the group. + * \return the number of elements in the associated geometry. + */ + const int getNbElements() + { + return m_nbElements; + } + + /** + * Gets the number of elements in the group. + * \return the number of elements. + */ + const int count() const + { + return m_elements.size(); + } + + /** + * Gets the reference of an element. + * \param index the index of the element. + * \return the reference of the element. + * \note use begin() and end() if you need to iterate. + */ + const int get(const int& index) + { + checkIndex(index); + std::set::iterator it = m_elements.begin(); + std::advance(it, index); + return (*it); + } + + /** + * Adds an element to the group. + * \param value the index of the element to add. + */ + void add(const int& value); + + /** + * Removes an element from the group. + * \param value the index of the element to remove. + */ + void remove(const int& value); + + /** + * Gets an iterator on the first element in the group. + * @return an iterator on the first element. + */ + std::set::iterator begin() { return m_elements.begin(); } + + /** + * Gets an iterator on the last element in the group. + * @return an iterator on the last element. + */ + std::set::iterator end() { return m_elements.end(); } + + private: + /** + * Ensures that the given element is valid. + * @param element + * @throw XAO_Exception if element is bigger than the number of elements. + */ + void checkIndex(const int& element) + throw (XAO_Exception); + + private: + /** The name of the group. */ + std::string m_name; + /** The number of elements in the associated geometry. */ + int m_nbElements; + /** The dimension of the group. */ + XAO::Dimension m_dimension; + /** The number of elements in the group. */ + int m_count; + /** The elements of the group. */ + std::set m_elements; + }; +} + +#endif diff --git a/src/XAO/XAO_IntegerField.cxx b/src/XAO/XAO_IntegerField.cxx new file mode 100644 index 000000000..2fc46ff5d --- /dev/null +++ b/src/XAO/XAO_IntegerField.cxx @@ -0,0 +1,60 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_IntegerField.hxx" +#include "XAO_IntegerStep.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +IntegerField::IntegerField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name) + : Field(dimension, nbElements, nbComponents, name) +{ +} + +Step* IntegerField::addNewStep(const int& step) +throw (XAO_Exception) +{ + return addStep(step, 0); +} + +IntegerStep* IntegerField::addStep(const int& step) +throw (XAO_Exception) +{ + return addStep(step, 0); +} + +IntegerStep* IntegerField::addStep(const int& step, const int& stamp) +throw (XAO_Exception) +{ + if (hasStep(step)) + throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists."); + + IntegerStep* bstep = new IntegerStep(step, stamp, m_nbElements, m_nbComponents); + m_steps.push_back(bstep); + return bstep; +} + +IntegerStep* IntegerField::getStep(const int& index) +throw (XAO_Exception) +{ + checkStepIndex(index); + return (IntegerStep*)m_steps[index]; +} diff --git a/src/XAO/XAO_IntegerField.hxx b/src/XAO/XAO_IntegerField.hxx new file mode 100644 index 000000000..9e33cb364 --- /dev/null +++ b/src/XAO/XAO_IntegerField.hxx @@ -0,0 +1,76 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_INTEGERFIELD_HXX__ +#define __XAO_INTEGERFIELD_HXX__ + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Field.hxx" +#include "XAO_IntegerStep.hxx" + +namespace XAO +{ + /** + * @class IntegerField + * Represents a field with integer values. + */ + class IntegerField : public Field + { + public: + /** + * Constructor. + * @param dimension the dimension of the field. + * @param nbElements the number of elements. + * @param nbComponents the number of components. + * @param name the name of the field. + */ + IntegerField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name); + + virtual const XAO::Type getType() { return XAO::INTEGER; } + + virtual Step* addNewStep(const int& step) throw (XAO_Exception); + + /** + * Adds a new step. + * @param step the number of the step. + * @return the newly created step. + */ + IntegerStep* addStep(const int& step) throw (XAO_Exception); + + /** + * Adds a new step. + * @param step the number of the step. + * @param stamp the stamp of the step. + * @return the newly created step. + */ + IntegerStep* addStep(const int& step, const int& stamp) throw (XAO_Exception); + + /** + * Gets the step of given index. + * @param index the index of the step. + * @return the step for the given index. + */ + IntegerStep* getStep(const int& index) throw (XAO_Exception); + }; +} + +#endif /* __XAO_INTEGERFIELD_HXX__ */ diff --git a/src/XAO/XAO_IntegerStep.cxx b/src/XAO/XAO_IntegerStep.cxx new file mode 100644 index 000000000..89d2b7983 --- /dev/null +++ b/src/XAO/XAO_IntegerStep.cxx @@ -0,0 +1,148 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_IntegerStep.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +IntegerStep::IntegerStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents) +{ + m_nbElements = nbElements; + m_nbComponents = nbComponents; + m_step = step; + m_stamp = stamp; + + m_values.reserve(m_nbElements); + for (int i = 0; i < m_nbElements; ++i) + { + std::vector row; + row.reserve(m_nbComponents); + for (int j = 0; j < m_nbComponents; ++j) + row.push_back(0); + m_values.push_back(row); + } +} + +std::vector IntegerStep::getValues() +{ + std::vector result; + result.reserve(m_nbElements * m_nbComponents); + + std::vector< std::vector >::iterator it; + for (it = m_values.begin(); it != m_values.end(); ++it) + { + std::vector eltValues = *it; + result.insert(result.end(), eltValues.begin(), eltValues.end()); + } + + return result; +} + +std::vector IntegerStep::getElement(const int& element) +throw (XAO_Exception) +{ + checkElementIndex(element); + + std::vector result(m_values[element]); + return result; +} + +std::vector IntegerStep::getComponent(const int& component) +throw (XAO_Exception) +{ + checkComponentIndex(component); + + std::vector result; + result.reserve(m_nbElements); + + std::vector< std::vector >::iterator it; + for (it = m_values.begin(); it != m_values.end(); ++it) + { + std::vector eltValues = *it; + result.push_back(eltValues[component]); + } + + return result; +} + +const int IntegerStep::getValue(const int& element, const int& component) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkComponentIndex(component); + + return m_values[element][component]; +} + +const std::string IntegerStep::getStringValue(const int& element, const int& component) +throw (XAO_Exception) +{ + return XaoUtils::intToString(getValue(element, component)); +} + +void IntegerStep::setValues(const std::vector& values) +throw (XAO_Exception) +{ + checkNbValues(values.size()); + + for (int i = 0; i < m_nbElements; ++i) + { + for (int j = 0; j < m_nbComponents; ++j) + { + m_values[i][j] = values[i * m_nbComponents + j]; + } + } +} + +void IntegerStep::setElement(const int& element, const std::vector& elements) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkNbComponents(elements.size()); + + for (int i = 0; i < m_nbComponents; ++i) + m_values[element][i] = elements[i]; +} + +void IntegerStep::setComponent(const int& component, const std::vector& components) +throw (XAO_Exception) +{ + checkElementIndex(component); + checkNbElements(components.size()); + + for (int i = 0; i < m_nbElements; ++i) + m_values[i][component] = components[i]; +} + +void IntegerStep::setValue(const int& element, const int& component, const int& value) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkComponentIndex(component); + + m_values[element][component] = value; +} + +void IntegerStep::setStringValue(const int& element, const int& component, const std::string& value) +throw (XAO_Exception) +{ + setValue(element, component, XaoUtils::stringToInt(value)); +} diff --git a/src/XAO/XAO_IntegerStep.hxx b/src/XAO/XAO_IntegerStep.hxx new file mode 100644 index 000000000..09673466a --- /dev/null +++ b/src/XAO/XAO_IntegerStep.hxx @@ -0,0 +1,114 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_INTEGERSTEP_HXX__ +#define __XAO_INTEGERSTEP_HXX__ + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Step.hxx" + +namespace XAO +{ + /** + * @class IntegerStep + * Step with integer values. + */ + class IntegerStep : public Step + { + public: + /** + * Constructor. + * @param step the step number. + * @param stamp the stamp of the step. + * @param nbElements the number elements of the geometry. + * @param nbComponents the number of components of the field. + */ + IntegerStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents); + + virtual const XAO::Type getType() { return XAO::INTEGER; } + + /** + * Gets all the values of the step as a list. + * @return a vector containing all the values of the step. + */ + std::vector getValues(); + + /** + * Gets all the values for a given element. + * @param element the index of the element. + * @return a vector containing all the values for the given element. + */ + std::vector getElement(const int& element) throw (XAO_Exception); + + /** + * Gets all the values for a given component. + * @param component the index of the component. + * @return a vector containing all the values for the given component. + */ + std::vector getComponent(const int& component) throw (XAO_Exception); + + /** + * Gets the value for an element and a component. + * @param element the index of the element. + * @param component the index of the component. + * @return the value for the given element and component. + */ + const int getValue(const int& element, const int& component) throw (XAO_Exception); + + /** + * Sets all the values from a list. + * @param values the list of values to set. + */ + void setValues(const std::vector& values) throw (XAO_Exception); + + /** + * Sets the values for an element. + * @param element the index of the element to set. + * @param elements the values to set. + */ + void setElement(const int& element, const std::vector& elements) throw (XAO_Exception); + + /** + * Sets the values for a component. + * @param component the index of the component to set. + * @param components the values to set. + */ + void setComponent(const int& component, const std::vector& components) throw (XAO_Exception); + + /** + * Sets the value for an element and a component. + * @param element the index of the element. + * @param component the index of the component. + * @param value the value. + */ + void setValue(const int& element, const int& component, const int& value) throw (XAO_Exception); + + virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception); + virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + + private: + std::vector< std::vector > m_values; + }; +} + + +#endif /* __XAO_INTEGERSTEP_HXX__ */ diff --git a/src/XAO/XAO_Step.cxx b/src/XAO/XAO_Step.cxx new file mode 100644 index 000000000..26d8a4d06 --- /dev/null +++ b/src/XAO/XAO_Step.cxx @@ -0,0 +1,79 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_Xao.hxx" +#include "XAO_XaoUtils.hxx" +#include "XAO_Step.hxx" +#include "XAO_BooleanStep.hxx" +#include "XAO_IntegerStep.hxx" +#include "XAO_DoubleStep.hxx" +#include "XAO_StringStep.hxx" + +using namespace XAO; + +void Step::checkElementIndex(const int& element) +throw (XAO_Exception) +{ + if (element < m_nbElements && element >= 0) + return; + + throw XAO_Exception(MsgBuilder() << "Element index is out of range [0, " + << m_nbElements-1 << "]: " << element); +} + +void Step::checkComponentIndex(const int& component) +throw (XAO_Exception) +{ + if (component < m_nbComponents && component >= 0) + return; + + throw XAO_Exception(MsgBuilder() << "Component index is out of range [0, " + << m_nbComponents-1 << "]: " << component); +} + +void Step::checkNbElements(const int& nbElements) +throw (XAO_Exception) +{ + if (nbElements == m_nbElements) + return; + + throw XAO_Exception(MsgBuilder() << "Invalid number of elements: " << nbElements + << ", expected " << m_nbElements); +} + +void Step::checkNbComponents(const int& nbComponents) +throw (XAO_Exception) +{ + if (nbComponents == m_nbComponents) + return; + + throw XAO_Exception(MsgBuilder() << "Invalid number of components: " << nbComponents + << ", expected " << m_nbComponents); +} + +void Step::checkNbValues(const int& nbValues) +throw (XAO_Exception) +{ + if (nbValues == m_nbElements * m_nbComponents) + return; + + throw XAO_Exception(MsgBuilder() << "Invalid number of values:" << nbValues + << ", expected " << m_nbElements * m_nbComponents); +} diff --git a/src/XAO/XAO_Step.hxx b/src/XAO/XAO_Step.hxx new file mode 100644 index 000000000..6c61020c9 --- /dev/null +++ b/src/XAO/XAO_Step.hxx @@ -0,0 +1,152 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_STEP_HXX__ +#define __XAO_STEP_HXX__ + +#include "XAO_XaoUtils.hxx" + +namespace XAO +{ + /** + * @class Step + * Base class for steps. + */ + class Step + { + protected: + /** Default constructor. */ + Step() {} + + public: + /** + * Destructor. + */ + virtual ~Step() {} + + /** + * Gets the type of the step. + * @return + */ + virtual const XAO::Type getType() = 0; + + /** + * Gets the step index. + * @return the index of the step. + */ + const int getStep() { return m_step; } + + /** + * Sets the number of the step. + * @param step the index to set. + */ + void setStep(const int& step) { m_step = step; } + + /** + * Gets the stamp of the index. + * @return the stamp of the index. + */ + const int getStamp() { return m_stamp; } + + /** + * Sets the stamp of the index. + * @param stamp the stamp to set. + */ + void setStamp(const int& stamp) { m_stamp = stamp; } + + /** + * Gets the number of components of the step. + * @return the number of components. + */ + const int countComponents() { return m_nbComponents; } + + /** + * Gets the number of elements for the step. + * @return the number of elements. + */ + const int countElements() { return m_nbElements; } + + /** + * Gets the number of values for the step. + * @return the number of values. + */ + const int countValues() { return m_nbElements * m_nbComponents; } + + /** + * Gets a value as a string. + * @param element the index of the element. + * @param component the index of the component. + * @return the value as a string. + */ + virtual const std::string getStringValue(const int& element, const int& component) = 0; + + /** + * Sets a value as a string + * @param element the index of the element. + * @param component the index of the component. + * @param value the string value. + * @throw XAO_Exception if the value is not valid. + */ + virtual void setStringValue(const int& element, const int& component, const std::string& value) = 0; + + protected: + /** + * Checks that given element index is in the range of element indexes. + * @param element the index to check. + */ + void checkElementIndex(const int& element) throw (XAO_Exception); + /** + * Checks that given component index is in the range of component indexes. + * @param component the index to check. + */ + void checkComponentIndex(const int& component)throw (XAO_Exception); + + /** + * Checks that the given number of elements is correct. + * @param nbElements the number of elements to check. + */ + void checkNbElements(const int& nbElements)throw (XAO_Exception); + + /** + * Checks that the given number of components is correct. + * @param nbComponents the number of components to check. + */ + void checkNbComponents(const int& nbComponents)throw (XAO_Exception); + + /** + * checks that the given number of values is correct. + * @param nbValues the number of values to check. + */ + void checkNbValues(const int& nbValues)throw (XAO_Exception); + + protected: + /** the index of the step. */ + int m_step; + /** The stamp of the step. */ + int m_stamp; + /** The number of components. */ + int m_nbComponents; + /** The number of elements. */ + int m_nbElements; + }; +} + + +#endif /* __XAO_STEP_HXX__ */ diff --git a/src/XAO/XAO_StringField.cxx b/src/XAO/XAO_StringField.cxx new file mode 100644 index 000000000..b7b5aba6a --- /dev/null +++ b/src/XAO/XAO_StringField.cxx @@ -0,0 +1,60 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_StringField.hxx" +#include "XAO_StringStep.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + +StringField::StringField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name) + : Field(dimension, nbElements, nbComponents, name) +{ +} + +Step* StringField::addNewStep(const int& step) +throw (XAO_Exception) +{ + return addStep(step, 0); +} + +StringStep* StringField::addStep(const int& step) +throw (XAO_Exception) +{ + return addStep(step, 0); +} + +StringStep* StringField::addStep(const int& step, const int& stamp) +throw (XAO_Exception) +{ + if (hasStep(step)) + throw XAO_Exception(MsgBuilder() << "Step with number " << step << " already exists."); + + StringStep* bstep = new StringStep(step, stamp, m_nbElements, m_nbComponents); + m_steps.push_back(bstep); + return bstep; +} + +StringStep* StringField::getStep(const int& index) +throw (XAO_Exception) +{ + checkStepIndex(index); + return (StringStep*)m_steps[index]; +} diff --git a/src/XAO/XAO_StringField.hxx b/src/XAO/XAO_StringField.hxx new file mode 100644 index 000000000..b9adb690e --- /dev/null +++ b/src/XAO/XAO_StringField.hxx @@ -0,0 +1,76 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_STRINGFIELD_HXX__ +#define __XAO_STRINGFIELD_HXX__ + +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Field.hxx" +#include "XAO_StringStep.hxx" + +namespace XAO +{ + /** + * @class StringField + * Represents a field with string values. + */ + class StringField : public Field + { + public: + /** + * Constructor. + * @param dimension the dimension of the field. + * @param nbElements the number of elements. + * @param nbComponents the number of components. + * @param name the name of the field. + */ + StringField(const XAO::Dimension& dimension, const int& nbElements, const int& nbComponents, const std::string& name); + + virtual const XAO::Type getType() { return XAO::STRING; } + + virtual Step* addNewStep(const int& step) throw (XAO_Exception); + + /** + * Adds a new step. + * @param step the number of the step. + * @return the newly created step. + */ + StringStep* addStep(const int& step) throw (XAO_Exception); + + /** + * Adds a new step. + * @param step the number of the step. + * @param stamp the stamp of the step. + * @return the newly created step. + */ + StringStep* addStep(const int& step, const int& stamp) throw (XAO_Exception); + + /** + * Gets the step of given index. + * @param index the index of the step. + * @return the step for the given index. + */ + StringStep* getStep(const int& index) throw (XAO_Exception); + }; +} + +#endif /* __XAO_STRINGFIELD_HXX__ */ diff --git a/src/XAO/XAO_StringStep.cxx b/src/XAO/XAO_StringStep.cxx new file mode 100644 index 000000000..b04da1568 --- /dev/null +++ b/src/XAO/XAO_StringStep.cxx @@ -0,0 +1,147 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "XAO_StringStep.hxx" + +using namespace XAO; + +StringStep::StringStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents) +{ + m_nbElements = nbElements; + m_nbComponents = nbComponents; + m_step = step; + m_stamp = stamp; + + m_values.reserve(m_nbElements); + for (int i = 0; i < m_nbElements; ++i) + { + std::vector row; + row.reserve(m_nbComponents); + for (int j = 0; j < m_nbComponents; ++j) + row.push_back(""); + m_values.push_back(row); + } +} + +std::vector StringStep::getValues() +{ + std::vector result; + result.reserve(m_nbElements * m_nbComponents); + + std::vector< std::vector >::iterator it; + for (it = m_values.begin(); it != m_values.end(); ++it) + { + std::vector eltValues = *it; + result.insert(result.end(), eltValues.begin(), eltValues.end()); + } + + return result; +} + +std::vector StringStep::getElement(const int& element) +throw (XAO_Exception) +{ + checkElementIndex(element); + + std::vector result(m_values[element]); + return result; +} + +std::vector StringStep::getComponent(const int& component) +throw (XAO_Exception) +{ + checkComponentIndex(component); + + std::vector result; + result.reserve(m_nbElements); + + std::vector< std::vector >::iterator it; + for (it = m_values.begin(); it != m_values.end(); ++it) + { + std::vector eltValues = *it; + result.push_back(eltValues[component]); + } + + return result; +} + +const std::string StringStep::getValue(const int& element, const int& component) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkComponentIndex(component); + + return m_values[element][component]; +} + +const std::string StringStep::getStringValue(const int& element, const int& component) +throw (XAO_Exception) +{ + return getValue(element, component); +} + +void StringStep::setValues(const std::vector& values) +throw (XAO_Exception) +{ + checkNbValues(values.size()); + + for (int i = 0; i < m_nbElements; ++i) + { + for (int j = 0; j < m_nbComponents; ++j) + { + m_values[i][j] = values[i * m_nbComponents + j]; + } + } +} + +void StringStep::setElement(const int& element, const std::vector& elements) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkNbComponents(elements.size()); + + for (int i = 0; i < m_nbComponents; ++i) + m_values[element][i] = elements[i]; +} + +void StringStep::setComponent(const int& component, const std::vector& components) +throw (XAO_Exception) +{ + checkElementIndex(component); + checkNbElements(components.size()); + + for (int i = 0; i < m_nbElements; ++i) + m_values[i][component] = components[i]; +} + +void StringStep::setValue(const int& element, const int& component, const std::string& value) +throw (XAO_Exception) +{ + checkElementIndex(element); + checkComponentIndex(component); + + m_values[element][component] = value; +} + +void StringStep::setStringValue(const int& element, const int& component, const std::string& value) +throw (XAO_Exception) +{ + setValue(element, component, value); +} diff --git a/src/XAO/XAO_StringStep.hxx b/src/XAO/XAO_StringStep.hxx new file mode 100644 index 000000000..b0eb2f615 --- /dev/null +++ b/src/XAO/XAO_StringStep.hxx @@ -0,0 +1,115 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_STRINGSTEP_HXX__ +#define __XAO_STRINGSTEP_HXX__ + +#include +#include + +#include "XAO_XaoUtils.hxx" +#include "XAO_Step.hxx" + +namespace XAO +{ + /** + * @class StringStep + * Step with strings values. + */ + class StringStep : public Step + { + public: + /** + * Constructor. + * @param step the step number. + * @param stamp the stamp of the step. + * @param nbElements the number elements of the geometry. + * @param nbComponents the number of components of the field. + */ + StringStep(const int& step, const int& stamp, const int& nbElements, const int& nbComponents); + + virtual const XAO::Type getType() { return XAO::STRING; } + + /** + * Gets all the values of the step as a list. + * @return a vector containing all the values of the step. + */ + std::vector getValues(); + + /** + * Gets all the values for a given element. + * @param element the index of the element. + * @return a vector containing all the values for the given element. + */ + std::vector getElement(const int& element) throw (XAO_Exception); + + /** + * Gets all the values for a given component. + * @param component the index of the component. + * @return a vector containing all the values for the given component. + */ + std::vector getComponent(const int& component) throw (XAO_Exception); + + /** + * Gets the value for an element and a component. + * @param element the index of the element. + * @param component the index of the component. + * @return the value for the given element and component. + */ + const std::string getValue(const int& element, const int& component) throw (XAO_Exception); + + /** + * Sets all the values from a list. + * @param values the list of values to set. + */ + void setValues(const std::vector& values) throw (XAO_Exception); + + /** + * Sets the values for an element. + * @param element the index of the element to set. + * @param elements the values to set. + */ + void setElement(const int& element, const std::vector& elements) throw (XAO_Exception); + + /** + * Sets the values for a component. + * @param component the index of the component to set. + * @param components the values to set. + */ + void setComponent(const int& component, const std::vector& components) throw (XAO_Exception); + + /** + * Sets the value for an element and a component. + * @param element the index of the element. + * @param component the index of the component. + * @param value the value. + */ + void setValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + + virtual const std::string getStringValue(const int& element, const int& component) throw (XAO_Exception); + virtual void setStringValue(const int& element, const int& component, const std::string& value) throw (XAO_Exception); + + private: + std::vector< std::vector > m_values; + }; +} + + +#endif /* __XAO_STRINGSTEP_HXX__ */ diff --git a/src/XAO/XAO_Xao.cxx b/src/XAO/XAO_Xao.cxx new file mode 100644 index 000000000..2bd64a357 --- /dev/null +++ b/src/XAO/XAO_Xao.cxx @@ -0,0 +1,294 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Nathalie Gore (OpenCascade), Frederic Pons (OpenCascade) + +#include +#include "XAO_XaoUtils.hxx" +#include "XAO_Xao.hxx" +#include "XAO_Geometry.hxx" +#include "XAO_Group.hxx" +#include "XAO_Field.hxx" +#include "XAO_IntegerField.hxx" +#include "XAO_BooleanField.hxx" +#include "XAO_DoubleField.hxx" +#include "XAO_StringField.hxx" +#include "XAO_XaoExporter.hxx" + +using namespace XAO; + +const xmlChar* C_XAO_VERSION = (xmlChar*)"1.0"; + +Xao::Xao() +{ + m_author = ""; + m_version = (char*)C_XAO_VERSION; + m_geometry = NULL; +} + +Xao::Xao(const std::string& author, const std::string& version) +{ + m_author = author; + m_version = version; + m_geometry = NULL; +} + +Xao::~Xao() +{ + if (m_geometry != NULL) + { + delete m_geometry; + m_geometry = NULL; + } + + for (std::list::iterator it = m_groups.begin(); it != m_groups.end(); ++it) + { + delete (*it); + } + + for (std::list::iterator it = m_fields.begin(); it != m_fields.end(); ++it) + { + delete (*it); + } +} + +const int Xao::countGroups() const +{ + return m_groups.size(); +} + +Group* Xao::getGroup(const int& index) +throw (XAO_Exception) +{ + checkGroupIndex(index); + + int i = 0; + for (std::list::iterator it = m_groups.begin(); it != m_groups.end(); ++it, ++i) + { + if (i == index) + return (*it); + } + + return NULL; +} + +Group* Xao::addGroup(const XAO::Dimension& dim, const std::string& name) +throw (XAO_Exception) +{ + checkGeometry(); + checkGroupDimension(dim); + + Group* group = new Group(dim, m_geometry->countElements(dim), name); + m_groups.push_back(group); + return group; +} + +bool Xao::removeGroup(Group* group) +{ + int nb = countGroups(); + m_groups.remove(group); + + bool res = (nb-1 == countGroups()); + if (res) + { + delete group; + group = NULL; + } + + return res; +} + +const int Xao::countFields() const +{ + return m_fields.size(); +} + +const XAO::Type Xao::getFieldType(const int& index) +throw (XAO_Exception) +{ + return getField(index)->getType(); +} + +Field* Xao::getField(const int& index) +throw (XAO_Exception) +{ + checkFieldIndex(index); + + int i = 0; + for (std::list::iterator it = m_fields.begin(); it != m_fields.end(); ++it, ++i) + { + if (i == index) + return (*it); + } + + throw XAO_Exception("Field not found."); +} + +BooleanField* Xao::getBooleanField(const int& index) +throw (XAO_Exception) +{ + Field* field = getField(index); + if (field->getType() != XAO::BOOLEAN) + throw XAO_Exception(MsgBuilder() << "Field " << index << " is not a boolean field."); + return (BooleanField*)field; +} + +DoubleField* Xao::getDoubleField(const int& index) +throw (XAO_Exception) +{ + Field* field = getField(index); + if (field->getType() != XAO::DOUBLE) + throw XAO_Exception(MsgBuilder() << "Field " << index << " is not a double field."); + return (DoubleField*)field; +} + +IntegerField* Xao::getIntegerField(const int& index) +throw (XAO_Exception) +{ + Field* field = getField(index); + if (field->getType() != XAO::INTEGER) + throw XAO_Exception(MsgBuilder() << "Field " << index << " is not an integer field."); + return (IntegerField*)field; +} + +StringField* Xao::getStringField(const int& index) +throw (XAO_Exception) +{ + Field* field = getField(index); + if (field->getType() != XAO::STRING) + throw XAO_Exception(MsgBuilder() << "Field " << index << " is not a string field."); + return (StringField*)field; +} + +Field* Xao::addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents, const std::string& name) +throw (XAO_Exception) +{ + checkGeometry(); + int nbElts = m_geometry->countElements(dim); + Field* field = Field::createField(type, dim, nbElts, nbComponents, name); + m_fields.push_back(field); + return field; +} + +IntegerField* Xao::addIntegerField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name) +throw (XAO_Exception) +{ + checkGeometry(); + int nbElts = m_geometry->countElements(dim); + IntegerField* field = new IntegerField(dim, nbElts, nbComponents, name); + m_fields.push_back(field); + return field; +} +BooleanField* Xao::addBooleanField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name) +throw (XAO_Exception) +{ + checkGeometry(); + int nbElts = m_geometry->countElements(dim); + BooleanField* field = new BooleanField(dim, nbElts, nbComponents, name); + m_fields.push_back(field); + return field; +} +DoubleField* Xao::addDoubleField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name) +throw (XAO_Exception) +{ + checkGeometry(); + int nbElts = m_geometry->countElements(dim); + DoubleField* field = new DoubleField(dim, nbElts, nbComponents, name); + m_fields.push_back(field); + return field; +} +StringField* Xao::addStringField(const XAO::Dimension& dim, const int& nbComponents, const std::string& name) +throw (XAO_Exception) +{ + checkGeometry(); + int nbElts = m_geometry->countElements(dim); + StringField* field = new StringField(dim, nbElts, nbComponents, name); + m_fields.push_back(field); + return field; +} + + + +bool Xao::removeField(Field* field) +{ + int nb = countFields(); + m_fields.remove(field); + + bool res = (nb-1 == countFields()); + if (res) + { + delete field; + field = NULL; + } + + return res; +} + +const bool Xao::exportXAO(const std::string& fileName) +{ + return XaoExporter::saveToFile(this, fileName); +} + +const std::string Xao::getXML() +{ + return XaoExporter::saveToXml(this); +} + +const bool Xao::importXAO(const std::string& fileName) +{ + return XaoExporter::readFromFile(fileName, this); +} + +const bool Xao::setXML(const std::string& xml) +{ + return XaoExporter::setXML(xml, this); +} + +void Xao::checkGeometry() const +throw(XAO_Exception) +{ + if (m_geometry == NULL) + throw XAO_Exception("Geometry is null"); +} + +void Xao::checkGroupIndex(const int& index) const +throw(XAO_Exception) +{ + if (index >= 0 && index < countGroups()) + return; + + throw XAO_Exception(MsgBuilder() << "Group index is out of range [0, " + << countGroups()-1 << "]: " << index); +} + +void Xao::checkFieldIndex(const int& index) const +throw(XAO_Exception) +{ + if (index >= 0 && index < countFields()) + return; + + throw XAO_Exception(MsgBuilder() << "Field index is out of range [0, " + << countFields()-1 << "]: " << index); +} + +void Xao::checkGroupDimension(const XAO::Dimension& dim) const +throw(XAO_Exception) +{ + if (dim == XAO::WHOLE) + throw XAO_Exception(MsgBuilder() << "Invalid dimension for group: " << dim); +} diff --git a/src/XAO/XAO_Xao.hxx b/src/XAO/XAO_Xao.hxx new file mode 100644 index 000000000..451d327cb --- /dev/null +++ b/src/XAO/XAO_Xao.hxx @@ -0,0 +1,254 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Nathalie Gore (OpenCascade), Frederic Pons (OpenCascade) + +#ifndef __XAO_XAO_HXX__ +#define __XAO_XAO_HXX__ + +#include +#include +#include "XAO_Exception.hxx" +#include "XAO_XaoUtils.hxx" +#include "XAO_Geometry.hxx" + +namespace XAO +{ + class Group; + class Field; + class IntegerField; + class DoubleField; + class BooleanField; + class StringField; + + /** + * @class Xao + * The Xao class describes the XAO format. + */ + class Xao + { + public: + /** + * Default constructor. + */ + Xao(); + /** + * Constructor with author and version. + * \param author the author of the file. + * \param version the version of the XAO format. + */ + Xao(const std::string& author, const std::string& version); + /** + * Destructor. + */ + virtual ~Xao(); + + /** + * Gets the author of the file. + * \return the author of the file. + */ + const std::string getAuthor() const + { + return m_author; + } + /** + * Sets the author of the file. + * \param author the author to set. + */ + void setAuthor(const std::string& author) + { + m_author = author; + } + + /** + * Gets the version of the file. + * \return the version of the file. + */ + const std::string getVersion() const + { + return m_version; + } + /** + * Sets the version of the file. + * \param version the version to set. + */ + void setVersion(const std::string& version) + { + m_version = version; + } + + // + // Geometry + // + + /** + * Gets the geometry. + * \return the geometry. + */ + Geometry* getGeometry() const + { + return m_geometry; + } + /** + * Sets the geometry. + * \param geometry the geometry to set. + */ + void setGeometry(Geometry* geometry) throw (XAO_Exception) + { + if (m_geometry != NULL) + throw XAO_Exception("Geometry already set."); + m_geometry = geometry; + m_geometry->setReadOnly(); + } + + // + // Groups + // + + /** + * Gets the number of groups. + * \return the number of groups. + */ + const int countGroups() const; + /** + * Gets a group. + * \param index the index of the wanted group. + * \return the group. + */ + Group* getGroup(const int& index) throw (XAO_Exception); + /** + * Adds a group. + * \param dim the dimension of the group. + * \param name the name of the group. + * \return the created group. + */ + Group* addGroup(const XAO::Dimension& dim, const std::string& name = std::string("")) throw (XAO_Exception); + /** + * Removes a group. + * \param group the group to remove. + * \return true if the group has been removed, false otherwise. + */ + bool removeGroup(Group* group); + + // + // Fields + // + + /** + * Gets the number of fields. + * \return the number of fields. + */ + const int countFields() const; + + /** + * Gets the type of a field. + * \param index the index of the wanted field. + * \return the type of the field. + */ + const XAO::Type getFieldType(const int& index) throw (XAO_Exception); + + /** + * Gets a field. + * \param index the index of the wanted field. + * \return the field. + */ + Field* getField(const int& index) throw (XAO_Exception); + + BooleanField* getBooleanField(const int& index) throw (XAO_Exception); + DoubleField* getDoubleField(const int& index) throw (XAO_Exception); + IntegerField* getIntegerField(const int& index) throw (XAO_Exception); + StringField* getStringField(const int& index) throw (XAO_Exception); + + /** + * Adds a field. + * \param type the type of the field. + * \param dim the dimension of the field. + * \param nbComponents the number of components in the field. + * \param name the name of the field. + * \return the created field. + */ + Field* addField(const XAO::Type& type, const XAO::Dimension& dim, const int& nbComponents, + const std::string& name = std::string("")) + throw (XAO_Exception); + + BooleanField* addBooleanField(const XAO::Dimension& dim, const int& nbComponents, + const std::string& name = std::string("")) throw (XAO_Exception); + IntegerField* addIntegerField(const XAO::Dimension& dim, const int& nbComponents, + const std::string& name = std::string("")) throw (XAO_Exception); + DoubleField* addDoubleField(const XAO::Dimension& dim, const int& nbComponents, + const std::string& name = std::string("")) throw (XAO_Exception); + StringField* addStringField(const XAO::Dimension& dim, const int& nbComponents, + const std::string& name = std::string("")) throw (XAO_Exception); + + /** + * Removes a field. + * \param field the field to remove. + * \return true if the field has been removed, false otherwise. + */ + bool removeField(Field* field); + + // + // Import / Export + // + /** + * Exports this XAO object to a file. + * \param fileName the name of the file to create. + * \return true is the export is successful. + */ + const bool exportXAO(const std::string& fileName); + /** + * Gets the XML corresponding to this XAO. + * \return the XML as a string. + */ + const std::string getXML(); + + /** + * Imports an XAO file into this object. + * \param fileName the name of the file to import. + * \return true if the import is successful. + */ + const bool importXAO(const std::string& fileName); + /** + * Sets an XML describing an XAO format to this object. + * \param xml the XML to set. + * \return true if the import is successful. + */ + const bool setXML(const std::string& xml); + + private: + void checkGeometry() const throw (XAO_Exception); + void checkGroupIndex(const int& index) const throw (XAO_Exception); + void checkFieldIndex(const int& index) const throw (XAO_Exception); + void checkGroupDimension(const XAO::Dimension& dim) const throw (XAO_Exception); + + private: + /** The author of the file. */ + std::string m_author; + /** The version of the file. */ + std::string m_version; + /** The geometry. */ + Geometry* m_geometry; + /** The list of groups. */ + std::list m_groups; + /** The list of fields. */ + std::list m_fields; + }; + +} + +#endif diff --git a/src/XAO/XAO_XaoExporter.cxx b/src/XAO/XAO_XaoExporter.cxx new file mode 100644 index 000000000..414f118ce --- /dev/null +++ b/src/XAO/XAO_XaoExporter.cxx @@ -0,0 +1,626 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include + +#include "XAO_XaoExporter.hxx" +#include "XAO_Xao.hxx" +#include "XAO_Geometry.hxx" +#include "XAO_Group.hxx" +#include "XAO_Field.hxx" +#include "XAO_Step.hxx" +#include "XAO_XaoUtils.hxx" + +namespace XAO +{ + const xmlChar* C_TAG_XAO = (xmlChar*)"XAO"; + const xmlChar* C_ATTR_XAO_AUTHOR = (xmlChar*)"author"; + const xmlChar* C_ATTR_XAO_VERSION = (xmlChar*)"version"; + + const xmlChar* C_TAG_GEOMETRY = (xmlChar*)"geometry"; + const xmlChar* C_ATTR_GEOMETRY_NAME = (xmlChar*)"name"; + + const xmlChar* C_TAG_SHAPE = (xmlChar*)"shape"; + const xmlChar* C_ATTR_SHAPE_FORMAT = (xmlChar*)"format"; + + const xmlChar* C_TAG_TOPOLOGY = (xmlChar*)"topology"; + const xmlChar* C_TAG_VERTICES = (xmlChar*)"vertices"; + const xmlChar* C_TAG_VERTEX = (xmlChar*)"vertex"; + const xmlChar* C_TAG_EDGES = (xmlChar*)"edges"; + const xmlChar* C_TAG_EDGE = (xmlChar*)"edge"; + const xmlChar* C_TAG_FACES = (xmlChar*)"faces"; + const xmlChar* C_TAG_FACE = (xmlChar*)"face"; + const xmlChar* C_TAG_SOLIDS = (xmlChar*)"solids"; + const xmlChar* C_TAG_SOLID = (xmlChar*)"solid"; + const xmlChar* C_ATTR_COUNT = (xmlChar*)"count"; + const xmlChar* C_ATTR_ELT_INDEX = (xmlChar*)"index"; + const xmlChar* C_ATTR_ELT_NAME = (xmlChar*)"name"; + const xmlChar* C_ATTR_ELT_REFERENCE = (xmlChar*)"reference"; + + const xmlChar* C_TAG_GROUPS = (xmlChar*)"groups"; + const xmlChar* C_TAG_GROUP = (xmlChar*)"group"; + const xmlChar* C_ATTR_GROUP_NAME = (xmlChar*)"name"; + const xmlChar* C_ATTR_GROUP_DIM = (xmlChar*)"dimension"; + + const xmlChar* C_TAG_ELEMENT = (xmlChar*)"element"; + const xmlChar* C_ATTR_ELEMENT_INDEX = (xmlChar*)"index"; + const xmlChar* C_TAG_VALUE = (xmlChar*)"value"; + const xmlChar* C_ATTR_VALUE_COMPONENT = (xmlChar*)"component"; + + const xmlChar* C_TAG_FIELDS = (xmlChar*)"fields"; + const xmlChar* C_TAG_FIELD = (xmlChar*)"field"; + const xmlChar* C_ATTR_FIELD_NAME = (xmlChar*)"name"; + const xmlChar* C_ATTR_FIELD_TYPE = (xmlChar*)"type"; + const xmlChar* C_ATTR_FIELD_DIMENSION = (xmlChar*)"dimension"; + const xmlChar* C_TAG_COMPONENTS = (xmlChar*)"components"; + const xmlChar* C_TAG_COMPONENT = (xmlChar*)"component"; + const xmlChar* C_ATTR_COMPONENT_COLUMN = (xmlChar*)"column"; + const xmlChar* C_ATTR_COMPONENT_NAME = (xmlChar*)"name"; + + const xmlChar* C_TAG_STEPS = (xmlChar*)"steps"; + const xmlChar* C_TAG_STEP = (xmlChar*)"step"; + const xmlChar* C_ATTR_STEP_NUMBER = (xmlChar*)"number"; + const xmlChar* C_ATTR_STEP_STAMP = (xmlChar*)"stamp"; +} + +using namespace XAO; + +std::string XaoExporter::readStringProp(xmlNodePtr node, const xmlChar* attribute, + const bool& required, const std::string& defaultValue, + const std::string& exception /*= std::string() */) +{ + xmlChar* strAttr = xmlGetProp(node, attribute); + if (strAttr == NULL) + { + if (required) + { + if (exception.size() > 0) + throw XAO_Exception(exception.c_str()); + + throw XAO_Exception(MsgBuilder() << "Line " << node->line << ": " + << "Property " << (char*)attribute << " is required."); + } + + return defaultValue; + } + + std::string res = (char*)strAttr; + xmlFree(strAttr); + return res; +} + +int XaoExporter::readIntegerProp(xmlNodePtr node, const xmlChar* attribute, + const bool& required, const int& defaultValue, + const std::string& exception /*= std::string() */) +{ + xmlChar* strAttr = xmlGetProp(node, attribute); + if (strAttr == NULL) + { + if (required) + { + if (exception.size() > 0) + throw XAO_Exception(exception.c_str()); + + throw XAO_Exception(MsgBuilder() << "Line " << node->line << ": " + << "Property " << (char*)attribute << " is required."); + } + + return defaultValue; + } + + int res = XaoUtils::stringToInt((char*)strAttr); + xmlFree(strAttr); + return res; +} + +const bool XaoExporter::saveToFile(Xao* xaoObject, const std::string& fileName) +throw (XAO_Exception) +{ + xmlDocPtr doc = exportXMLDoc(xaoObject); + xmlSaveFormatFileEnc(fileName.c_str(), doc, "UTF-8", 1); // format = 1 for node indentation + xmlFreeDoc(doc); + + return true; +} + +const std::string XaoExporter::saveToXml(Xao* xaoObject) +throw (XAO_Exception) +{ + xmlDocPtr doc = exportXMLDoc(xaoObject); + + xmlChar *xmlbuff; + int buffersize; + xmlDocDumpFormatMemory(doc, &xmlbuff, &buffersize, 1); // format = 1 for node indentation + xmlFreeDoc(doc); + xmlCleanupGlobals(); + + return (char*)xmlbuff; +} + +xmlDocPtr XaoExporter::exportXMLDoc(Xao* xaoObject) +{ + // Creating the Xml document + xmlDocPtr masterDocument = xmlNewDoc(BAD_CAST "1.0"); + xmlNodePtr xao = xmlNewNode(0, C_TAG_XAO); + xmlDocSetRootElement(masterDocument, xao); + + xmlNewProp(xao, C_ATTR_XAO_VERSION, BAD_CAST xaoObject->getVersion().c_str()); + xmlNewProp(xao, C_ATTR_XAO_AUTHOR, BAD_CAST xaoObject->getAuthor().c_str()); + + if (xaoObject->getGeometry() != NULL) + { + exportGeometry(xaoObject->getGeometry(), masterDocument, xao); + } + + exportGroups(xaoObject, xao); + exportFields(xaoObject, xao); + + return masterDocument; +} + +void XaoExporter::exportGeometricElements(Geometry* xaoGeometry, + xmlNodePtr topology, XAO::Dimension dim, const xmlChar* colTag, const xmlChar* eltTag) +{ + xmlNodePtr vertices = xmlNewChild(topology, 0, colTag, 0); + xmlNewProp(vertices, C_ATTR_COUNT, BAD_CAST XaoUtils::intToString(xaoGeometry->countElements(dim)).c_str()); + GeometricElementList::iterator it = xaoGeometry->begin(dim); + for (; it != xaoGeometry->end(dim); it++) + { + int index = it->first; + GeometricElement elt = it->second; + xmlNodePtr vertex = xmlNewChild(vertices, 0, eltTag, 0); + xmlNewProp(vertex, C_ATTR_ELT_INDEX, BAD_CAST XaoUtils::intToString(index).c_str()); + xmlNewProp(vertex, C_ATTR_ELT_NAME, BAD_CAST elt.getName().c_str()); + xmlNewProp(vertex, C_ATTR_ELT_REFERENCE, BAD_CAST elt.getReference().c_str()); + } +} + +void XaoExporter::exportGeometry(Geometry* xaoGeometry, xmlDocPtr doc, xmlNodePtr xao) +{ + // Geometric part + xmlNodePtr geometry = xmlNewChild(xao, 0, C_TAG_GEOMETRY, 0); + xmlNewProp(geometry, C_ATTR_GEOMETRY_NAME, BAD_CAST xaoGeometry->getName().c_str()); + + xmlNodePtr shape = xmlNewChild(geometry, 0, C_TAG_SHAPE, 0); + xmlNewProp(shape, C_ATTR_SHAPE_FORMAT, BAD_CAST XaoUtils::shapeFormatToString(xaoGeometry->getFormat()).c_str()); + std::string txtShape = xaoGeometry->getShapeString(); + xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), txtShape.size()); + xmlAddChild(shape, cdata); + + xmlNodePtr topology = xmlNewChild(geometry, 0, C_TAG_TOPOLOGY, 0); + + exportGeometricElements(xaoGeometry, topology, XAO::VERTEX, C_TAG_VERTICES, C_TAG_VERTEX); + exportGeometricElements(xaoGeometry, topology, XAO::EDGE, C_TAG_EDGES, C_TAG_EDGE); + exportGeometricElements(xaoGeometry, topology, XAO::FACE, C_TAG_FACES, C_TAG_FACE); + exportGeometricElements(xaoGeometry, topology, XAO::SOLID, C_TAG_SOLIDS, C_TAG_SOLID); +} + +void XaoExporter::exportGroups(Xao* xaoObject, xmlNodePtr xao) +{ + xmlNodePtr groups = xmlNewChild(xao, 0, C_TAG_GROUPS, 0); + xmlNewProp(groups, C_ATTR_COUNT, BAD_CAST XaoUtils::intToString(xaoObject->countGroups()).c_str()); + + for (int i = 0; i < xaoObject->countGroups(); i++) + { + //Group* grp = (*it); + Group* grp = xaoObject->getGroup(i); + xmlNodePtr group = xmlNewChild(groups, 0, C_TAG_GROUP, 0); + xmlNewProp(group, C_ATTR_GROUP_NAME, BAD_CAST grp->getName().c_str()); + xmlNewProp(group, C_ATTR_GROUP_DIM, BAD_CAST XaoUtils::dimensionToString(grp->getDimension()).c_str()); + xmlNewProp(group, C_ATTR_COUNT, BAD_CAST XaoUtils::intToString(grp->count()).c_str()); + + for (std::set::iterator it = grp->begin(); it != grp->end(); ++it) + { + int grpElt = (*it); + xmlNodePtr elt = xmlNewChild(group, 0, C_TAG_ELEMENT, 0); + xmlNewProp(elt, C_ATTR_ELEMENT_INDEX, BAD_CAST XaoUtils::intToString(grpElt).c_str()); + } + } +} + +void XaoExporter::exportFields(Xao* xaoObject, xmlNodePtr xao) +{ + xmlNodePtr fields = xmlNewChild(xao, 0, C_TAG_FIELDS, 0); + xmlNewProp(fields, C_ATTR_COUNT, BAD_CAST XaoUtils::intToString(xaoObject->countFields()).c_str()); + + for (int i = 0; i < xaoObject->countFields(); i++) + { + Field* field = xaoObject->getField(i); + xmlNodePtr nodeField = xmlNewChild(fields, 0, C_TAG_FIELD, 0); + xmlNewProp(nodeField, C_ATTR_FIELD_NAME, BAD_CAST field->getName().c_str()); + xmlNewProp(nodeField, C_ATTR_FIELD_TYPE, BAD_CAST XaoUtils::fieldTypeToString(field->getType()).c_str()); + xmlNewProp(nodeField, C_ATTR_FIELD_DIMENSION, BAD_CAST XaoUtils::dimensionToString(field->getDimension()).c_str()); + + int nbComponents = field->countComponents(); + xmlNodePtr components = xmlNewChild(nodeField, 0, C_TAG_COMPONENTS, 0); + xmlNewProp(components, C_ATTR_COUNT, BAD_CAST XaoUtils::intToString(nbComponents).c_str()); + + for (int j = 0; j < nbComponents; j++) + { + xmlNodePtr nodeComponent = xmlNewChild(components, 0, C_TAG_COMPONENT, 0); + xmlNewProp(nodeComponent, C_ATTR_COMPONENT_COLUMN, BAD_CAST XaoUtils::intToString(j).c_str()); + xmlNewProp(nodeComponent, C_ATTR_COMPONENT_NAME, BAD_CAST field->getComponentName(j).c_str()); + } + + int nbSteps = field->countSteps(); + xmlNodePtr nodeSteps = xmlNewChild(nodeField, 0, C_TAG_STEPS, 0); + xmlNewProp(nodeSteps, C_ATTR_COUNT, BAD_CAST XaoUtils::intToString(nbSteps).c_str()); + for (stepIterator itStep = field->begin(); itStep != field->end(); itStep++) + { + Step* step = *itStep; + exportStep(step, field, nodeSteps); + } + } +} + +void XaoExporter::exportStep(Step* step, Field* field, xmlNodePtr nodeSteps) +{ + xmlNodePtr nodeStep = xmlNewChild(nodeSteps, 0, C_TAG_STEP, 0); + xmlNewProp(nodeStep, C_ATTR_STEP_NUMBER, BAD_CAST XaoUtils::intToString(step->getStep()).c_str()); + if (step->getStamp() >= 0) + { + xmlNewProp(nodeStep, C_ATTR_STEP_STAMP, BAD_CAST XaoUtils::intToString(step->getStamp()).c_str()); + } + + for(int i = 0; i < step->countElements(); ++i) + { + xmlNodePtr nodeElt = xmlNewChild(nodeStep, 0, C_TAG_ELEMENT, 0); + xmlNewProp(nodeElt, C_ATTR_ELEMENT_INDEX, BAD_CAST XaoUtils::intToString(i).c_str()); + + for (int j = 0; j < step->countComponents(); ++j) + { + std::string content = step->getStringValue(i, j); + xmlNodePtr nodeValue = xmlNewChild(nodeElt, NULL, C_TAG_VALUE, BAD_CAST content.c_str()); + xmlNewProp(nodeValue, C_ATTR_VALUE_COMPONENT, BAD_CAST XaoUtils::intToString(j).c_str()); + } + } +} + +const bool XaoExporter::readFromFile(const std::string& fileName, Xao* xaoObject) +throw (XAO_Exception) +{ + // parse the file and get the DOM + int options = XML_PARSE_HUGE || XML_PARSE_NOCDATA; + xmlDocPtr doc = xmlReadFile(fileName.c_str(), NULL, options); + if (doc == NULL) + { + throw XAO_Exception("Cannot read XAO file"); + } + + parseXMLDoc(doc, xaoObject); + return true; +} + +const bool XaoExporter::setXML(const std::string& xml, Xao* xaoObject) +throw (XAO_Exception) +{ + int options = XML_PARSE_HUGE || XML_PARSE_NOCDATA; + xmlDocPtr doc = xmlReadDoc(BAD_CAST xml.c_str(), "", NULL, options); + if (doc == NULL) + { + throw XAO_Exception("Cannot read XAO stream"); + } + + parseXMLDoc(doc, xaoObject); + return true; +} + +void XaoExporter::parseXMLDoc(xmlDocPtr doc, Xao* xaoObject) +{ + // Get the root element node + xmlNodePtr root = xmlDocGetRootElement(doc); + if (xmlStrcmp(root->name , C_TAG_XAO) != 0) + throw XAO_Exception("Cannot read XAO file: invalid format XAO node not found"); + + parseXaoNode(doc, root, xaoObject); + + xmlFreeDoc(doc); // free document + xmlCleanupParser(); // free globals +} + +void XaoExporter::parseXaoNode(xmlDocPtr doc, xmlNodePtr xaoNode, Xao* xaoObject) +{ + std::string version = readStringProp(xaoNode, C_ATTR_XAO_VERSION, false, ""); + if (version != "") + xaoObject->setAuthor(version); + + std::string author = readStringProp(xaoNode, C_ATTR_XAO_AUTHOR, false, ""); + xaoObject->setAuthor(author); + + for (xmlNodePtr node = xaoNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_GEOMETRY) == 0) + parseGeometryNode(doc, node, xaoObject); + else if (xmlStrcmp(node->name, C_TAG_GROUPS) == 0) + parseGroupsNode(node, xaoObject); + else if (xmlStrcmp(node->name, C_TAG_FIELDS) == 0) + parseFieldsNode(node, xaoObject); + } +} + +void XaoExporter::parseGeometryNode(xmlDocPtr doc, xmlNodePtr geometryNode, Xao* xaoObject) +{ + // get the shape and topo nodes + xmlNodePtr shapeNode = NULL; + xmlNodePtr topoNode = NULL; + for (xmlNodePtr node = geometryNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_SHAPE) == 0) + shapeNode = node; + else if (xmlStrcmp(node->name, C_TAG_TOPOLOGY) == 0) + topoNode = node; + } + + std::string name = readStringProp(geometryNode, C_ATTR_GEOMETRY_NAME, false, ""); + std::string strFormat = readStringProp(shapeNode, C_ATTR_SHAPE_FORMAT, true, ""); + XAO::Format shapeFormat = XaoUtils::stringToShapeFormat(strFormat); + Geometry* geometry = Geometry::createGeometry(shapeFormat, name); + + parseShapeNode(doc, shapeNode, geometry); + parseTopologyNode(topoNode, geometry); + + xaoObject->setGeometry(geometry); +} + +void XaoExporter::parseShapeNode(xmlDocPtr doc, xmlNodePtr shapeNode, Geometry* geometry) +{ + if (geometry->getFormat() == XAO::BREP) + { + xmlChar* data = xmlNodeGetContent(shapeNode->children); + if (data == NULL) + throw XAO_Exception("Missing BREP"); + geometry->setShapeString((char*)data); + xmlFree(data); + } + else + { + throw XAO_Exception(MsgBuilder() << "Shape format not supported: " + << XaoUtils::shapeFormatToString(geometry->getFormat())); + } +} + +void XaoExporter::parseTopologyNode(xmlNodePtr topologyNode, Geometry* geometry) +{ + for (xmlNodePtr node = topologyNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_VERTICES) == 0) + parseVerticesNode(node, geometry); + else if (xmlStrcmp(node->name, C_TAG_EDGES) == 0) + parseEdgesNode(node, geometry); + else if (xmlStrcmp(node->name, C_TAG_FACES) == 0) + parseFacesNode(node, geometry); + else if (xmlStrcmp(node->name, C_TAG_SOLIDS) == 0) + parseSolidsNode(node, geometry); + } +} + +void XaoExporter::parseVerticesNode(xmlNodePtr verticesNode, Geometry* geometry) +{ + int count = readIntegerProp(verticesNode, C_ATTR_COUNT, true, -1); + geometry->setCountVertices(count); + + for (xmlNodePtr node = verticesNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_VERTEX) == 0) + { + int index = readIntegerProp(node, C_ATTR_ELT_INDEX, true, -1); + std::string name = readStringProp(node, C_ATTR_ELT_NAME, false, ""); + std::string reference = readStringProp(node, C_ATTR_ELT_REFERENCE, true, ""); + + geometry->setVertex(index, name, reference); + } + } +} + +void XaoExporter::parseEdgesNode(xmlNodePtr edgesNode, Geometry* geometry) +{ + int count = readIntegerProp(edgesNode, C_ATTR_COUNT, true, -1); + geometry->setCountEdges(count); + + for (xmlNodePtr node = edgesNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_EDGE) == 0) + { + int index = readIntegerProp(node, C_ATTR_ELT_INDEX, true, -1); + std::string name = readStringProp(node, C_ATTR_ELT_NAME, false, ""); + std::string reference = readStringProp(node, C_ATTR_ELT_REFERENCE, true, ""); + + geometry->setEdge(index, name, reference); + } + } +} + +void XaoExporter::parseFacesNode(xmlNodePtr facesNode, Geometry* geometry) +{ + int count = readIntegerProp(facesNode, C_ATTR_COUNT, true, -1); + geometry->setCountFaces(count); + + for (xmlNodePtr node = facesNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_FACE) == 0) + { + int index = readIntegerProp(node, C_ATTR_ELT_INDEX, true, -1); + std::string name = readStringProp(node, C_ATTR_ELT_NAME, false, ""); + std::string reference = readStringProp(node, C_ATTR_ELT_REFERENCE, true, ""); + + geometry->setFace(index, name, reference); + } + } +} + +void XaoExporter::parseSolidsNode(xmlNodePtr solidsNode, Geometry* geometry) +{ + int count = readIntegerProp(solidsNode, C_ATTR_COUNT, true, -1); + geometry->setCountSolids(count); + + for (xmlNodePtr node = solidsNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_SOLID) == 0) + { + int index = readIntegerProp(node, C_ATTR_ELT_INDEX, true, -1); + std::string name = readStringProp(node, C_ATTR_ELT_NAME, false, ""); + std::string reference = readStringProp(node, C_ATTR_ELT_REFERENCE, true, ""); + + geometry->setSolid(index, name, reference); + } + } +} + +void XaoExporter::parseGroupsNode(xmlNodePtr groupsNode, Xao* xaoObject) +{ + for (xmlNodePtr node = groupsNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_GROUP) == 0) + { + parseGroupNode(node, xaoObject); + } + } +} + +void XaoExporter::parseGroupNode(xmlNodePtr groupNode, Xao* xaoObject) +{ + std::string strDimension = readStringProp(groupNode, C_ATTR_GROUP_DIM, true, ""); + XAO::Dimension dim = XaoUtils::stringToDimension(strDimension); + Group* group = xaoObject->addGroup(dim); + + std::string name = readStringProp(groupNode, C_ATTR_GROUP_NAME, false, ""); + group->setName(name); + + for (xmlNodePtr node = groupNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_ELEMENT) == 0) + { + int index = readIntegerProp(node, C_ATTR_ELEMENT_INDEX, true, -1); + group->add(index); + } + } +} + +void XaoExporter::parseFieldsNode(xmlNodePtr fieldsNode, Xao* xaoObject) +{ + for (xmlNodePtr node = fieldsNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_FIELD) == 0) + { + parseFieldNode(node, xaoObject); + } + } +} + +void XaoExporter::parseFieldNode(xmlNodePtr fieldNode, Xao* xaoObject) +{ + std::string strDimension = readStringProp(fieldNode, C_ATTR_FIELD_DIMENSION, true, ""); + XAO::Dimension dim = XaoUtils::stringToDimension(strDimension); + + std::string strType = readStringProp(fieldNode, C_ATTR_FIELD_TYPE, true, ""); + XAO::Type type = XaoUtils::stringToFieldType(strType); + + // we need to get the number of components first to create the field + xmlNodePtr componentsNode = NULL; + xmlNodePtr stepsNode = NULL; + + for (xmlNodePtr node = fieldNode->children; node; node = node->next) + { + if (xmlStrcmp(node->name, C_TAG_COMPONENTS) == 0) + componentsNode = node; + else if (xmlStrcmp(node->name, C_TAG_STEPS) == 0) + stepsNode = node; + } + + // ensure that the components node is defined + if (componentsNode == NULL) + { + throw XAO_Exception(MsgBuilder() << "Line " << fieldNode->line << ": " + << "No components defined for field."); + } + + // create the field + int nbComponents = readIntegerProp(componentsNode, C_ATTR_COUNT, true, -1); + Field* field = xaoObject->addField(type, dim, nbComponents); + + // parse the components + for (xmlNodePtr compNode = componentsNode->children; compNode; compNode = compNode->next) + { + std::string compName= readStringProp(compNode, C_ATTR_COMPONENT_NAME, false, ""); + if (compName.size() > 0) + { + int col = readIntegerProp(compNode, C_ATTR_COMPONENT_COLUMN, true, -1); + field->setComponentName(col, compName); + } + } + + // set the name + std::string name = readStringProp(fieldNode, C_ATTR_FIELD_NAME, false, ""); + if (name.size() > 0) field->setName(name); + + // read the steps + if (stepsNode != 0) + { + for (xmlNodePtr stepNode = stepsNode->children; stepNode; stepNode = stepNode->next) + { + if (xmlStrcmp(stepNode->name, C_TAG_STEP) == 0) + { + parseStepNode(stepNode, field); + } + } + } +} + +void XaoExporter::parseStepNode(xmlNodePtr stepNode, Field* field) +{ + int stepNumber = readIntegerProp(stepNode, C_ATTR_STEP_NUMBER, true, -1); + Step* step = field->addNewStep(stepNumber); + + int stepStamp = readIntegerProp(stepNode, C_ATTR_STEP_STAMP, false, -1); + if (stepStamp != -1) + { + step->setStamp(stepStamp); + } + + for (xmlNodePtr eltNode = stepNode->children; eltNode; eltNode = eltNode->next) + { + if (xmlStrcmp(eltNode->name, C_TAG_ELEMENT) == 0) + { + parseStepElementNode(eltNode, step); + } + } +} + +void XaoExporter::parseStepElementNode(xmlNodePtr eltNode, Step* step) +{ + int index = readIntegerProp(eltNode, C_ATTR_ELT_INDEX, true, -1); + + for (xmlNodePtr valNode = eltNode->children; valNode; valNode = valNode->next) + { + if (xmlStrcmp(valNode->name, C_TAG_VALUE) == 0) + { + int component = readIntegerProp(valNode, C_ATTR_VALUE_COMPONENT, true, -1); + xmlChar* data = xmlNodeGetContent(valNode->children); + + if (data == NULL) + { + throw XAO_Exception(MsgBuilder() << "Line " << valNode->line << ": no content for value."); + } + + std::string value = (char*)data; + step->setStringValue(index, component, value); + } + } +} diff --git a/src/XAO/XAO_XaoExporter.hxx b/src/XAO/XAO_XaoExporter.hxx new file mode 100644 index 000000000..6929b22b8 --- /dev/null +++ b/src/XAO/XAO_XaoExporter.hxx @@ -0,0 +1,109 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_XAOEXPORTER_HXX__ +#define __XAO_XAOEXPORTER_HXX__ + +#include + +#include "XAO_Xao.hxx" +#include "XAO_Geometry.hxx" +#include "XAO_Group.hxx" +#include "XAO_Field.hxx" + +namespace XAO +{ + /** + * @class XaoExporter + * Util class for import/export XAO. + */ + class XaoExporter + { + public: + /** + * Saves the XAO object to a file. + * @param xaoObject the object to export. + * @param fileName the path of the file to create. + * @return true if the export was successful, false otherwise. + */ + static const bool saveToFile(Xao* xaoObject, const std::string& fileName) + throw (XAO_Exception); + + /** + * Saves the XAO object to a XML string. + * @param xaoObject the object to export. + * @return the XML string. + */ + static const std::string saveToXml(Xao* xaoObject) + throw (XAO_Exception); + + /** + * Reads a XAO object from a file. + * @param fileName the path of the file to read. + * @param xaoObject the XAO object. + * @return true if the XAO object was read successful, false otherwise. + */ + static const bool readFromFile(const std::string& fileName, Xao* xaoObject) + throw (XAO_Exception); + + /** + * Reads a XAO object from an XML string. + * @param xml the XML string. + * @param xaoObject the XAO object. + * @return true if the XAO object was read successful, false otherwise. + */ + static const bool setXML(const std::string& xml, Xao* xaoObject) + throw (XAO_Exception); + + private: + static xmlDocPtr exportXMLDoc(Xao* xaoObject); + static void exportGeometry(Geometry* xaoGeometry, xmlDocPtr doc, xmlNodePtr xao); + static void exportGeometricElements(Geometry* xaoGeometry, xmlNodePtr topology, + XAO::Dimension dim, const xmlChar* colTag, const xmlChar* eltTag); + static void exportGroups(Xao* xaoObject, xmlNodePtr xao); + static void exportFields(Xao* xaoObject, xmlNodePtr xao); + static void exportStep(Step* step, Field* field, xmlNodePtr nodeSteps); + + static void parseXMLDoc(xmlDocPtr doc, Xao* xaoObject); + static void parseXaoNode(xmlDocPtr doc, xmlNodePtr xaoNode, Xao* xaoObject); + static void parseGeometryNode(xmlDocPtr doc, xmlNodePtr geometryNode, Xao* xaoObject); + static void parseShapeNode(xmlDocPtr doc, xmlNodePtr shapeNode, Geometry* geometry); + static void parseTopologyNode(xmlNodePtr topologyNode, Geometry* geometry); + static void parseVerticesNode(xmlNodePtr verticesNode, Geometry* geometry); + static void parseEdgesNode(xmlNodePtr edgesNode, Geometry* geometry); + static void parseFacesNode(xmlNodePtr facesNode, Geometry* geometry); + static void parseSolidsNode(xmlNodePtr solidsNode, Geometry* geometry); + static void parseGroupsNode(xmlNodePtr groupsNode, Xao* xaoObject); + static void parseGroupNode(xmlNodePtr groupNode, Xao* xaoObject); + + static void parseFieldsNode(xmlNodePtr fieldsNode, Xao* xaoObject); + static void parseFieldNode(xmlNodePtr fieldNode, Xao* xaoObject); + static void parseStepNode(xmlNodePtr stepNode, Field* field); + static void parseStepElementNode(xmlNodePtr eltNode, Step* step); + + static std::string readStringProp(xmlNodePtr node, const xmlChar* attribute, + const bool& required, const std::string& defaultValue, const std::string& exception = std::string("")); + static int readIntegerProp(xmlNodePtr node, const xmlChar* attribute, + const bool& required, const int& defaultValue, const std::string& exception = std::string("")); + }; +} + + +#endif /* __XAO_XAOEXPORTER_HXX__ */ diff --git a/src/XAO/XAO_XaoUtils.cxx b/src/XAO/XAO_XaoUtils.cxx new file mode 100644 index 000000000..206f5ed0c --- /dev/null +++ b/src/XAO/XAO_XaoUtils.cxx @@ -0,0 +1,165 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include + +#include "XAO_Xao.hxx" +#include "XAO_XaoUtils.hxx" + +using namespace XAO; + + +const std::string XaoUtils::intToString(const int& value) +{ + std::ostringstream str; + str << value; + return str.str(); +} + +const int XaoUtils::stringToInt(const std::string& value) +throw(XAO_Exception) +{ + int res; + std::istringstream convert(value); + if ( !(convert >> res) ) + throw XAO_Exception(MsgBuilder() << "Cannot convert '" << value << "' to integer."); + return res; +} + +const std::string XaoUtils::doubleToString(const double& value) +{ + std::ostringstream str; + str << value; + return str.str(); +} + +const double XaoUtils::stringToDouble(const std::string& value) +throw(XAO_Exception) +{ + double res; + std::istringstream convert(value); + if ( !(convert >> res) ) + throw XAO_Exception(MsgBuilder() << "Cannot convert '" << value << "' to double."); + return res; +} + +const std::string XaoUtils::booleanToString(const bool& value) +{ + if (value) + return "true"; + return "false"; +} + +const bool XaoUtils::stringToBoolean(const std::string& value) +throw(XAO_Exception) +{ + if (value == "true" || value == "1") + return true; + if (value == "false" || value == "0") + return false; + + throw XAO_Exception(MsgBuilder() << "Invalid boolean value: " << value); +} + +const std::string XaoUtils::dimensionToString(const XAO::Dimension& dimension) +throw(XAO_Exception) +{ + if (dimension == XAO::VERTEX) + return "vertex"; + if (dimension == XAO::EDGE) + return "edge"; + if (dimension == XAO::FACE) + return "face"; + if (dimension == XAO::SOLID) + return "solid"; + if (dimension == XAO::WHOLE) + return "whole"; + + throw XAO_Exception(MsgBuilder() << "Bad dimension: " << dimension); +} + +const XAO::Dimension XaoUtils::stringToDimension(const std::string& dimension) +throw(XAO_Exception) +{ + if (dimension == "vertex") + return XAO::VERTEX; + if (dimension == "edge") + return XAO::EDGE; + if (dimension == "face") + return XAO::FACE; + if (dimension == "solid") + return XAO::SOLID; + if (dimension == "whole") + return XAO::WHOLE; + + throw XAO_Exception(MsgBuilder() << "Bad dimension: " << dimension); +} + +const std::string XaoUtils::fieldTypeToString(const XAO::Type& type) +throw(XAO_Exception) +{ + if (type ==XAO:: BOOLEAN) + return "boolean"; + if (type == XAO::INTEGER) + return "integer"; + if (type == XAO::DOUBLE) + return "double"; + if (type == XAO::STRING) + return "string"; + + throw XAO_Exception(MsgBuilder() << "Bad type: " << type); +} + +const XAO::Type XaoUtils::stringToFieldType(const std::string& type) +throw(XAO_Exception) +{ + if (type == "boolean") + return XAO::BOOLEAN; + if (type == "integer") + return XAO::INTEGER; + if (type == "double") + return XAO::DOUBLE; + if (type == "string") + return XAO::STRING; + + throw XAO_Exception(MsgBuilder() << "Bad type: " << type); +} + +const std::string XaoUtils::shapeFormatToString(const XAO::Format& format) +throw(XAO_Exception) +{ + if (format == XAO::BREP) + return "BREP"; + if (format == XAO::STEP) + return "STEP"; + + throw XAO_Exception(MsgBuilder() << "Bad format: " << format); +} + +const XAO::Format XaoUtils::stringToShapeFormat(const std::string& format) +throw(XAO_Exception) +{ + if (format == "BREP") + return XAO::BREP; + if (format == "STEP") + return XAO::STEP; + + throw XAO_Exception(MsgBuilder() << "Bad format: " << format); +} diff --git a/src/XAO/XAO_XaoUtils.hxx b/src/XAO/XAO_XaoUtils.hxx new file mode 100644 index 000000000..cc82e0d2d --- /dev/null +++ b/src/XAO/XAO_XaoUtils.hxx @@ -0,0 +1,200 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAO_UTILS_HXX__ +#define __XAO_UTILS_HXX__ + +#include +#include +#include + +#include "XAO_Exception.hxx" + + +namespace XAO +{ + /** + * @enum Format + */ + enum Format + { + BREP, + STEP + }; + + /** + * @enum Dimension + */ + enum Dimension + { + VERTEX = 0,//!< VERTEX + EDGE = 1, //!< EDGE + FACE = 2, //!< FACE + SOLID = 3, //!< SOLID + WHOLE = -1 //!< WHOLE + }; + + /** + * @enum Type + */ + enum Type + { + BOOLEAN = 0,//!< BOOLEAN + INTEGER = 1,//!< INTEGER + DOUBLE = 2, //!< DOUBLE + STRING = 3 //!< STRING + }; + + /** + * \class XaoUtils + * Utilities class to convert types. + */ + class XaoUtils + { + public: + /** + * Converts an integer into a string. + * \param value the integer to convert. + * \return the string. + */ + static const std::string intToString(const int& value); + + /** + * Converts a string into an integer. + * \param value the string to convert. + * \return the integer value. + * \throw XAO_Exception if value cannot be converted to string. + */ + static const int stringToInt(const std::string& value) throw(XAO_Exception); + + /** + * Converts a double into a string. + * \param value the double to convert. + * \return the string. + */ + static const std::string doubleToString(const double& value); + /** + * Converts a string into a double. + * \param value the string to convert. + * \return the double value. + * \throw XAO_Exception if value cannot be converted to string. + */ + static const double stringToDouble(const std::string& value) throw(XAO_Exception); + + /** + * Converts a boolean into a string. + * \param value the boolean to convert. + * \return the string. + */ + static const std::string booleanToString(const bool& value); + /** + * Converts a string into a boolean. + * \param value the string to convert. + * \return the boolean value. + * \throw XAO_Exception if value cannot be converted to boolean. + * \note accepted values are "true", "1", "false", "0". + */ + static const bool stringToBoolean(const std::string& value) throw(XAO_Exception); + + /** + * Converts a Dimension to string. + * \param dimension the Dimension to convert. + * \return the dimension as a string. + * \throw XAO_Exception + */ + static const std::string dimensionToString(const XAO::Dimension& dimension) throw(XAO_Exception); + + /** + * Converts a string into a Dimension. + * \param dimension the dimension as a string. + * \return the converted Dimension. + * \throw XAO_Exception if dimension cannot be converted. + */ + static const XAO::Dimension stringToDimension(const std::string& dimension) throw(XAO_Exception); + + /** + * Converts a Type to string. + * \param type the Type to convert. + * \return the Type as a string. + * \throw XAO_Exception + */ + static const std::string fieldTypeToString(const XAO::Type& type) throw(XAO_Exception); + + /** + * Converts a string into a Type. + * \param type the Type as a string. + * \return the converted Type. + * \throw XAO_Exception if type cannot be converted. + */ + static const XAO::Type stringToFieldType(const std::string& type) throw(XAO_Exception); + + /** + * Converts a Format to string. + * \param format the Format to convert. + * \return the Format as a string. + * \throw XAO_Exception + */ + static const std::string shapeFormatToString(const XAO::Format& format) throw(XAO_Exception); + + /** + * Converts a string into a Format. + * \param format the Format as a string. + * \return the converted Format. + * \throw XAO_Exception if format cannot be converted. + */ + static const XAO::Format stringToShapeFormat(const std::string& format) throw(XAO_Exception); + }; + + /** + * @class MsgBuilder + * MsgBuilder can be use to easily create messages. + */ + class MsgBuilder + { + public: + /** Constructor. */ + MsgBuilder() {}; + /** Destructor. */ + ~MsgBuilder() {}; + +#ifndef SWIG + /** Stream operator. */ + template + MsgBuilder& operator <<(const T& t) + { + m_stream << t; + return *this; + } + + /** + * Conversion operator to char*. + */ + operator const char*() const { return m_stream.str().c_str(); } +#endif + + private : + std::stringstream m_stream; + }; + +} + + + +#endif /* __XAO_UTILS_HXX__ */ diff --git a/src/XAO/tests/BrepGeometryTest.cxx b/src/XAO/tests/BrepGeometryTest.cxx new file mode 100644 index 000000000..069b64d31 --- /dev/null +++ b/src/XAO/tests/BrepGeometryTest.cxx @@ -0,0 +1,305 @@ +#include + +#include "TestUtils.hxx" +#include "BrepGeometryTest.hxx" +#include "../XAO_XaoUtils.hxx" +#include "../XAO_Xao.hxx" +#include "../XAO_BrepGeometry.hxx" + +using namespace XAO; + +void BrepGeometryTest::setUp() +{ +} + +void BrepGeometryTest::tearDown() +{ +} + +void BrepGeometryTest::cleanUp() +{ +} + +void readBrep(Geometry* geom, const std::string& fileName) +{ + char* txt = TestUtils::readTextFile(TestUtils::getTestFilePath(fileName)); + geom->setShapeString(txt); +} + +void BrepGeometryTest::testGetIDs() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_1.brep"); + + CPPUNIT_ASSERT_EQUAL(8, geom->countElements(XAO::VERTEX)); + CPPUNIT_ASSERT_EQUAL(8, geom->countVertices()); + int vertices[8] = { 6,7,9,11,16,17,19,21 }; + for (int i = 0; i < 8; ++i) + CPPUNIT_ASSERT_EQUAL(vertices[i], geom->getVertexID(i)); + + CPPUNIT_ASSERT_EQUAL(12, geom->countElements(XAO::EDGE)); + CPPUNIT_ASSERT_EQUAL(12, geom->countEdges()); + int edges[12] = { 5,8,10,12,15,18,20,22,25,26,29,30 }; + for (int i = 0; i < 12; ++i) + CPPUNIT_ASSERT_EQUAL(edges[i], geom->getEdgeID(i)); + + CPPUNIT_ASSERT_EQUAL(6, geom->countElements(XAO::FACE)); + CPPUNIT_ASSERT_EQUAL(6, geom->countFaces()); + int faces[6] = { 3,13,23,27,31,33 }; + for (int i = 0; i < 6; ++i) + CPPUNIT_ASSERT_EQUAL(faces[i], geom->getFaceID(i)); + + CPPUNIT_ASSERT_EQUAL(1, geom->countElements(XAO::SOLID)); + CPPUNIT_ASSERT_EQUAL(1, geom->countSolids()); + CPPUNIT_ASSERT_EQUAL(1, geom->getSolidID(0)); + + delete geom; +} + +void BrepGeometryTest::testGetReferences() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_1.brep"); + + // vertex of index 1 has id = 7 + CPPUNIT_ASSERT_EQUAL(std::string("7"), geom->getElementReference(XAO::VERTEX, 1)); + CPPUNIT_ASSERT_EQUAL(std::string("7"), geom->getVertexReference(1)); + CPPUNIT_ASSERT_EQUAL(7, geom->getVertexID(1)); + CPPUNIT_ASSERT_EQUAL(1, geom->getElementIndexByReference(XAO::VERTEX, "7")); + CPPUNIT_ASSERT_EQUAL(1, geom->findVertex(7)); + + // edge of index 1 has id = 8 + CPPUNIT_ASSERT_EQUAL(std::string("8"), geom->getElementReference(XAO::EDGE, 1)); + CPPUNIT_ASSERT_EQUAL(std::string("8"), geom->getEdgeReference(1)); + CPPUNIT_ASSERT_EQUAL(8, geom->getEdgeID(1)); + CPPUNIT_ASSERT_EQUAL(1, geom->getElementIndexByReference(XAO::EDGE, "8")); + CPPUNIT_ASSERT_EQUAL(1, geom->findEdge(8)); + + // face of index 1 has id = 13 + CPPUNIT_ASSERT_EQUAL(std::string("13"), geom->getElementReference(XAO::FACE, 1)); + CPPUNIT_ASSERT_EQUAL(std::string("13"), geom->getFaceReference(1)); + CPPUNIT_ASSERT_EQUAL(13, geom->getFaceID(1)); + CPPUNIT_ASSERT_EQUAL(1, geom->getElementIndexByReference(XAO::FACE, "13")); + CPPUNIT_ASSERT_EQUAL(1, geom->findFace(13)); + + // solid of index 0 has id = 1 + CPPUNIT_ASSERT_EQUAL(std::string("1"), geom->getElementReference(XAO::SOLID, 0)); + CPPUNIT_ASSERT_EQUAL(std::string("1"), geom->getSolidReference(0)); + CPPUNIT_ASSERT_EQUAL(1, geom->getSolidID(0)); + CPPUNIT_ASSERT_EQUAL(0, geom->getElementIndexByReference(XAO::SOLID, "1")); + CPPUNIT_ASSERT_EQUAL(0, geom->findSolid(1)); + + delete geom; +} + +void BrepGeometryTest::testGetNames() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_1.brep"); + + int id; + + // vertex of index 1 has id = 7 + id = 7; + CPPUNIT_ASSERT_EQUAL(std::string(""), geom->findVertexName(id)); + geom->changeVertexName(id, std::string("va")); + CPPUNIT_ASSERT_EQUAL(std::string("va"), geom->findVertexName(id)); + CPPUNIT_ASSERT_THROW(geom->changeVertexName(100, "a"), XAO_Exception); + CPPUNIT_ASSERT_THROW(geom->findVertexName(100), XAO_Exception); + + // edge of index 1 has id = 8 + id = 8; + CPPUNIT_ASSERT_EQUAL(std::string(""), geom->findEdgeName(id)); + geom->changeEdgeName(id, std::string("ea")); + CPPUNIT_ASSERT_EQUAL(std::string("ea"), geom->findEdgeName(id)); + CPPUNIT_ASSERT_THROW(geom->changeEdgeName(100, "a"), XAO_Exception); + CPPUNIT_ASSERT_THROW(geom->findEdgeName(100), XAO_Exception); + + // face of index 1 has id = 13 + id = 13; + CPPUNIT_ASSERT_EQUAL(std::string(""), geom->findFaceName(id)); + geom->changeFaceName(id, std::string("fa")); + CPPUNIT_ASSERT_EQUAL(std::string("fa"), geom->findFaceName(id)); + CPPUNIT_ASSERT_THROW(geom->changeFaceName(100, "a"), XAO_Exception); + CPPUNIT_ASSERT_THROW(geom->findFaceName(100), XAO_Exception); + + // solid of index 0 has id = 1 + id = 1; + CPPUNIT_ASSERT_EQUAL(std::string(""), geom->findSolidName(id)); + geom->changeSolidName(id, std::string("sa")); + CPPUNIT_ASSERT_EQUAL(std::string("sa"), geom->findSolidName(id)); + CPPUNIT_ASSERT_THROW(geom->changeSolidName(100, "a"), XAO_Exception); + CPPUNIT_ASSERT_THROW(geom->findSolidName(100), XAO_Exception); + + delete geom; +} + +void BrepGeometryTest::testGetEdgeVertices() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_2.brep"); + + // edge of index 23, id = #63 + // vertex are 47 (#12), 59 (#15) + int v1, v2; + geom->getEdgeVertices(23, v1, v2); + CPPUNIT_ASSERT_EQUAL(12, v1); + CPPUNIT_ASSERT_EQUAL(15, v2); + + delete geom; +} + +void printVector(std::vector& v) +{ + std::cout << "# "; + for (int i = 0; i < v.size(); i++) + std::cout << v[i] << ", "; + std::cout << std::endl; +} + +void BrepGeometryTest::testGetFaceEdges() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_2.brep"); + + CPPUNIT_ASSERT_EQUAL(2, geom->countFaceWires(1)); // face 13 + CPPUNIT_ASSERT_EQUAL(1, geom->countFaceWires(2)); // face 29 + + // wire 0 of face 1 (#13) => edge 4 (#15), 5 (#17), 0 (#5), 6 (#19) + std::vector edges = geom->getFaceEdges(1, 0); + CPPUNIT_ASSERT_EQUAL(4, (int)edges.size()); + int ids1[4] = { 4,5,0,6 }; + for (int i = 0; i < 4; ++i) + CPPUNIT_ASSERT_EQUAL(ids1[i], edges[i]); + + // wire 1 of face 13 => edge 7 (#21) ,8 (#24), 9 (#26), 10 (#28) + edges = geom->getFaceEdges(1, 1); + CPPUNIT_ASSERT_EQUAL(4, (int)edges.size()); + int ids2[4] = { 7,8,9,10 }; + for (int i = 0; i < 4; ++i) + CPPUNIT_ASSERT_EQUAL(ids2[i], edges[i]); + + delete geom; +} + +void BrepGeometryTest::testSolidFaces() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Cut_2.brep"); + + CPPUNIT_ASSERT_EQUAL(5, geom->countSolidShells(0)); + + std::vector faces = geom->getSolidFaces(0, 0); + CPPUNIT_ASSERT_EQUAL(6, (int)faces.size()); + int ids[6] = { 0, 1, 2, 3, 4, 5 }; + for (int i = 0; i < 6; ++i) + CPPUNIT_ASSERT_EQUAL(ids[i], faces[i]); + + faces = geom->getSolidFaces(0, 1); + CPPUNIT_ASSERT_EQUAL(6, (int)faces.size()); + int ids2[6] = { 6, 7, 8, 9, 10, 11 }; + for (int i = 0; i < 6; ++i) + CPPUNIT_ASSERT_EQUAL(ids2[i], faces[i]); + + delete geom; +} + +void BrepGeometryTest::testGetVertex() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_2.brep"); + + double x, y, z; + geom->getVertexXYZ(15, x, y, z); + CPPUNIT_ASSERT_DOUBLES_EQUAL(60., x, 1e-6); + CPPUNIT_ASSERT_DOUBLES_EQUAL(80., y, 1e-6); + CPPUNIT_ASSERT_DOUBLES_EQUAL(60., z, 1e-6); + + delete geom; +} + +void BrepGeometryTest::testGetEdgeLength() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_2.brep"); + + // edges 0 (#5), 7 (#21) + CPPUNIT_ASSERT_DOUBLES_EQUAL(200., geom->getEdgeLength(0), 0); + CPPUNIT_ASSERT_DOUBLES_EQUAL(80., geom->getEdgeLength(7), 0); + + delete geom; +} + +void BrepGeometryTest::testGetFaceArea() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_2.brep"); + + // faces 0 (#3), 1 (#13) + CPPUNIT_ASSERT_DOUBLES_EQUAL(40000., geom->getFaceArea(0), 1e-9); + CPPUNIT_ASSERT_DOUBLES_EQUAL(33600., geom->getFaceArea(1), 1e-9); + + delete geom; +} + +void BrepGeometryTest::testGetSolidVolume() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_2.brep"); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(7488000., geom->getSolidVolume(0), 1e-9); + + delete geom; +} + +void BrepGeometryTest::testParse() +{ + BrepGeometry* geom = new BrepGeometry("box"); + readBrep(geom, "Box_2.brep"); + std::cout << std::endl; + + for (int solidIndex = 0; solidIndex < geom->countSolids(); ++solidIndex) + { + std::cout << "Solid #" << solidIndex << " : " << geom->getSolidReference(solidIndex) << std::endl; + int nbShells = geom->countSolidShells(solidIndex); + for (int shellIndex = 0; shellIndex < nbShells; ++shellIndex) + { + std::cout << " Shell #" << shellIndex << std::endl; + std::vector faces = geom->getSolidFaces(solidIndex, shellIndex); + for (int indf = 0; indf < faces.size(); ++indf) + { + int faceIndex = faces[indf]; + std::cout << " Face #" << geom->getFaceReference(faceIndex) << std::endl; + + int nbWires = geom->countFaceWires(faceIndex); + for (int wireIndex = 0; wireIndex < nbWires; ++wireIndex) + { + std::cout << " Wire #" << wireIndex << std::endl; + std::vector edges = geom->getFaceEdges(faceIndex, wireIndex); + for (int inde = 0; inde < edges.size(); ++inde) + { + int edgeIndex = edges[inde]; + std::cout << " Edge #" << geom->getEdgeReference(edgeIndex) << " : "; + + int va = 0, vb = 0; + geom->getEdgeVertices(edgeIndex, va, vb); + int vaRef = geom->getVertexID(va); + int vbRef = geom->getVertexID(vb); + double ax, ay, az, bx, by, bz; + geom->getVertexXYZ(va, ax, ay, az); + geom->getVertexXYZ(vb, bx, by, bz); + + std::cout << vaRef << " (" << ax << ", " << ay << ", " << az << ")"; + std::cout << " - "; + std::cout << vbRef << " (" << bx << ", " << by << ", " << bz << ")"; + std::cout << std::endl; + } + } + + + } + } + } + + delete geom; +} diff --git a/src/XAO/tests/BrepGeometryTest.hxx b/src/XAO/tests/BrepGeometryTest.hxx new file mode 100644 index 000000000..427c7db8d --- /dev/null +++ b/src/XAO/tests/BrepGeometryTest.hxx @@ -0,0 +1,45 @@ +#ifndef __XAO_BREPGEOMETRY_TEST_HXX__ +#define __XAO_BREPGEOMETRY_TEST_HXX__ + +#include + +namespace XAO +{ + class BrepGeometryTest: public CppUnit::TestFixture + { + CPPUNIT_TEST_SUITE(BrepGeometryTest); + CPPUNIT_TEST(testGetIDs); + CPPUNIT_TEST(testGetReferences); + CPPUNIT_TEST(testGetNames); + CPPUNIT_TEST(testGetEdgeVertices); + CPPUNIT_TEST(testGetFaceEdges); + CPPUNIT_TEST(testSolidFaces); + CPPUNIT_TEST(testGetVertex); + CPPUNIT_TEST(testGetEdgeLength); + CPPUNIT_TEST(testGetFaceArea); + CPPUNIT_TEST(testGetSolidVolume); + CPPUNIT_TEST(testParse); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void cleanUp(); + + void testGetIDs(); + void testGetReferences(); + void testGetNames(); + void testGetEdgeVertices(); + void testGetFaceEdges(); + void testSolidFaces(); + + void testGetVertex(); + void testGetEdgeLength(); + void testGetFaceArea(); + void testGetSolidVolume(); + + void testParse(); + }; +} + +#endif // __XAO_BREPGEOMETRY_TEST_HXX__ diff --git a/src/XAO/tests/CMakeLists.txt b/src/XAO/tests/CMakeLists.txt new file mode 100644 index 000000000..f20d7e26d --- /dev/null +++ b/src/XAO/tests/CMakeLists.txt @@ -0,0 +1,62 @@ +# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${PTHREAD_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${CAS_INCLUDE_DIRS} + ${CPPUNIT_INCLUDE_DIRS} + ) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${LIBXML2_DEFINITIONS} + ${CAS_DEFINITIONS} + ${CPPUNIT_DEFINITIONS} + ) + +# libraries to link to +SET(_link_LIBRARIES + ${CPPUNIT_LIBRARIES} + XAO + ) + +# --- sources --- + +SET(TestXAO_SOURCES + BrepGeometryTest.cxx + FieldTest.cxx + GeometryTest.cxx + GroupTest.cxx + ImportExportTest.cxx + XAOTests.cxx + XaoTest.cxx + XaoUtilsTest.cxx + ) + +# --- rules --- + +ADD_EXECUTABLE(TestXAO ${TestXAO_SOURCES}) +TARGET_LINK_LIBRARIES(TestXAO ${_link_LIBRARIES}) +ADD_TEST(TestXAO TestXAO) + +INSTALL(TARGETS TestXAO DESTINATION ${SALOME_INSTALL_BINS}) diff --git a/src/XAO/tests/FieldTest.cxx b/src/XAO/tests/FieldTest.cxx new file mode 100644 index 000000000..d4e3dd313 --- /dev/null +++ b/src/XAO/tests/FieldTest.cxx @@ -0,0 +1,480 @@ +#include + +#include "FieldTest.hxx" +#include "../XAO_Xao.hxx" +#include "../XAO_XaoUtils.hxx" +#include "../XAO_Field.hxx" +#include "../XAO_Step.hxx" +#include "../XAO_BooleanField.hxx" +#include "../XAO_IntegerField.hxx" +#include "../XAO_DoubleField.hxx" +#include "../XAO_StringField.hxx" + +using namespace XAO; + + +void FieldTest::setUp() +{ +} + +void FieldTest::tearDown() +{ +} + +void FieldTest::cleanUp() +{ +} + +Field* FieldTest::testField(XAO::Type type) +{ + Field* f = Field::createField(type, XAO::FACE, 10, 3); + + CPPUNIT_ASSERT_EQUAL(0, (int)f->getName().size()); + CPPUNIT_ASSERT_EQUAL(type, f->getType()); + CPPUNIT_ASSERT_EQUAL(XAO::FACE, f->getDimension()); + CPPUNIT_ASSERT_EQUAL(3, f->countComponents()); + CPPUNIT_ASSERT_EQUAL(10, f->countElements()); + CPPUNIT_ASSERT_EQUAL(30, f->countValues()); + + f->setName("field1"); + CPPUNIT_ASSERT_EQUAL(std::string("field1"), f->getName()); + + CPPUNIT_ASSERT_EQUAL(0, (int)f->getComponentName(0).size()); + f->setComponentName(0, "x"); + f->setComponentName(1, "y"); + f->setComponentName(2, "z"); + CPPUNIT_ASSERT_EQUAL(3, f->countComponents()); + CPPUNIT_ASSERT_EQUAL(std::string("x"), f->getComponentName(0)); + CPPUNIT_ASSERT_EQUAL(std::string("y"), f->getComponentName(1)); + CPPUNIT_ASSERT_EQUAL(std::string("z"), f->getComponentName(2)); + CPPUNIT_ASSERT_THROW(f->setComponentName(3, "a"), XAO_Exception); + CPPUNIT_ASSERT_THROW(f->getComponentName(3), XAO_Exception); + + CPPUNIT_ASSERT_EQUAL(0, f->countSteps()); + Step* step = f->addNewStep(0); + CPPUNIT_ASSERT_EQUAL(type, step->getType()); + CPPUNIT_ASSERT_EQUAL(1, f->countSteps()); + step = f->addNewStep(1); + step = f->addNewStep(2); + CPPUNIT_ASSERT_EQUAL(3, f->countSteps()); + CPPUNIT_ASSERT_THROW(f->addNewStep(2), XAO_Exception); // step already exists + + CPPUNIT_ASSERT_EQUAL(true, f->removeStep(step)); + CPPUNIT_ASSERT_EQUAL(2, f->countSteps()); + CPPUNIT_ASSERT_EQUAL(false, f->removeStep(step)); // remove same + CPPUNIT_ASSERT_EQUAL(2, f->countSteps()); + + return f; +} + +void FieldTest::testBooleanField() +{ + BooleanField* f = (BooleanField*)testField(XAO::BOOLEAN); + + BooleanStep* step = f->getStep(0); + CPPUNIT_ASSERT_EQUAL(XAO::BOOLEAN, step->getType()); + CPPUNIT_ASSERT_MESSAGE("step is NULL", step != NULL); + CPPUNIT_ASSERT_THROW(f->getStep(2), XAO_Exception); + + step = f->addStep(10); + CPPUNIT_ASSERT_EQUAL(XAO::BOOLEAN, step->getType()); + CPPUNIT_ASSERT_EQUAL(3, f->countSteps()); + CPPUNIT_ASSERT_THROW(f->addStep(10), XAO_Exception); // step already exists +} + +void FieldTest::testIntegerField() +{ + IntegerField* f = (IntegerField*)testField(XAO::INTEGER); + + IntegerStep* step = f->getStep(0); + CPPUNIT_ASSERT_EQUAL(XAO::INTEGER, step->getType()); + CPPUNIT_ASSERT_MESSAGE("step is NULL", step != NULL); + CPPUNIT_ASSERT_THROW(f->getStep(2), XAO_Exception); + + step = f->addStep(10); + CPPUNIT_ASSERT_EQUAL(XAO::INTEGER, step->getType()); + CPPUNIT_ASSERT_EQUAL(3, f->countSteps()); + CPPUNIT_ASSERT_THROW(f->addStep(10), XAO_Exception); // step already exists +} +void FieldTest::testDoubleField() +{ + DoubleField* f = (DoubleField*)testField(XAO::DOUBLE); + + DoubleStep* step = f->getStep(0); + CPPUNIT_ASSERT_EQUAL(XAO::DOUBLE, step->getType()); + CPPUNIT_ASSERT_MESSAGE("step is NULL", step != NULL); + CPPUNIT_ASSERT_THROW(f->getStep(2), XAO_Exception); + + step = f->addStep(10); + CPPUNIT_ASSERT_EQUAL(XAO::DOUBLE, step->getType()); + CPPUNIT_ASSERT_EQUAL(3, f->countSteps()); + CPPUNIT_ASSERT_THROW(f->addStep(10), XAO_Exception); // step already exists +} +void FieldTest::testStringField() +{ + StringField* f = (StringField*)testField(XAO::STRING); + + StringStep* step = f->getStep(0); + CPPUNIT_ASSERT_EQUAL(XAO::STRING, step->getType()); + CPPUNIT_ASSERT_MESSAGE("step is NULL", step != NULL); + CPPUNIT_ASSERT_THROW(f->getStep(2), XAO_Exception); + + step = f->addStep(10); + CPPUNIT_ASSERT_EQUAL(XAO::STRING, step->getType()); + CPPUNIT_ASSERT_EQUAL(3, f->countSteps()); + CPPUNIT_ASSERT_THROW(f->addStep(10), XAO_Exception); // step already exists +} + +void FieldTest::testStep(XAO::Type type, Step* step) +{ + CPPUNIT_ASSERT_EQUAL(type, step->getType()); + + CPPUNIT_ASSERT_EQUAL(0, step->getStep()); + step->setStep(10); + CPPUNIT_ASSERT_EQUAL(10, step->getStep()); + + CPPUNIT_ASSERT_EQUAL(0, step->getStamp()); + step->setStamp(100); + CPPUNIT_ASSERT_EQUAL(100, step->getStamp()); + + CPPUNIT_ASSERT_EQUAL(5, step->countElements()); + CPPUNIT_ASSERT_EQUAL(3, step->countComponents()); + CPPUNIT_ASSERT_EQUAL(15, step->countValues()); +} + +void FieldTest::testBooleanStep() +{ + Step* step = new BooleanStep(0, 0, 5, 3); + testStep(XAO::BOOLEAN, step); +} +void FieldTest::testIntegerStep() +{ + Step* step = new IntegerStep(0, 0, 5, 3); + testStep(XAO::INTEGER, step); +} +void FieldTest::testDoubleStep() +{ + Step* step = new DoubleStep(0, 0, 5, 3); + testStep(XAO::DOUBLE, step); +} +void FieldTest::testStringStep() +{ + Step* step = new StringStep(0, 0, 5, 3); + testStep(XAO::STRING, step); +} + +void FieldTest::testBooleanStepValues() +{ + int nbComponents = 3; // > 1 + int nbElements = 5; // > 1 + + BooleanStep* step = new BooleanStep(0, 0, nbElements, nbComponents); + for (int i = 0; i < step->countElements(); ++i) + { + for (int j = 0; j < step->countComponents(); ++j) + { + step->setValue(i, j, j % 2 == 0); + } + } + + CPPUNIT_ASSERT_EQUAL(true, step->getValue(1, 2)); + CPPUNIT_ASSERT_EQUAL(std::string("true"), step->getStringValue(1, 2)); + CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), XAO_Exception); + CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), XAO_Exception); + + // get all values + std::vector values; + values = step->getValues(); + CPPUNIT_ASSERT_EQUAL(nbElements*nbComponents, (int)values.size()); + for (int i = 0; i < nbElements; ++i) + { + for (int j = 0; j < nbComponents; ++j) + CPPUNIT_ASSERT((j % 2 == 0) == values[i*nbComponents+j]); + } + + // get one element + values = step->getElement(2); + CPPUNIT_ASSERT_THROW(step->getElement(nbElements), XAO_Exception); + CPPUNIT_ASSERT_EQUAL(nbComponents, (int)values.size()); + for (int i = 0; i < nbComponents; ++i) + CPPUNIT_ASSERT((i % 2 == 0) == values[i]); + + // get one component + values = step->getComponent(1); + CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), XAO_Exception); + CPPUNIT_ASSERT_EQUAL(nbElements, (int)values.size()); + for (int i = 0; i < nbElements; ++i) + CPPUNIT_ASSERT(false == values[i]); + + // set one element + std::vector newEltValues; + // only one value + newEltValues.push_back(true); + CPPUNIT_ASSERT_THROW(step->setElement(2, newEltValues), XAO_Exception); + // all values + for (int i = 1; i < nbComponents; ++i) + newEltValues.push_back(true); + step->setElement(2, newEltValues); + + // set one component + std::vector newCompValues; + // only one value + newCompValues.push_back(true); + CPPUNIT_ASSERT_THROW(step->setComponent(1, newCompValues), XAO_Exception); + // all values + for (int i = 1; i < nbElements; ++i) + newCompValues.push_back(true); + step->setComponent(1, newCompValues); + + // set string value + step->setStringValue(0, 0, "true"); + CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), XAO_Exception); + + // set all values + std::vector allValues; + // only one value + allValues.push_back(true); + CPPUNIT_ASSERT_THROW(step->setValues(allValues), XAO_Exception); + // all values + for (int i = 1; i < nbElements*nbComponents; ++i) + allValues.push_back(true); + step->setValues(allValues); +} + +void FieldTest::testIntegerStepValues() +{ + int nbComponents = 3; + int nbElements = 5; + + IntegerStep* step = new IntegerStep(0, 0, nbElements, nbComponents); + for (int i = 0; i < step->countElements(); ++i) + { + for (int j = 0; j < step->countComponents(); ++j) + step->setValue(i, j, i*10 + j); + } + + CPPUNIT_ASSERT_EQUAL(12, step->getValue(1, 2)); + CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), XAO_Exception); + CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), XAO_Exception); + + // get all values + std::vector values; + values = step->getValues(); + CPPUNIT_ASSERT_EQUAL(nbElements*nbComponents, (int)values.size()); + for (int i = 0; i < nbElements; ++i) + { + for (int j = 0; j < nbComponents; ++j) + CPPUNIT_ASSERT_EQUAL(10*i+j, values[i*nbComponents+j]); + } + + // get one element + values = step->getElement(2); + CPPUNIT_ASSERT_THROW(step->getElement(nbElements), XAO_Exception); + CPPUNIT_ASSERT_EQUAL(nbComponents, (int)values.size()); + for (int i = 0; i < nbComponents; ++i) + CPPUNIT_ASSERT_EQUAL(20+i, values[i]); + + // get one component + values = step->getComponent(1); + CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), XAO_Exception); + CPPUNIT_ASSERT_EQUAL(nbElements, (int)values.size()); + for (int i = 0; i < nbElements; ++i) + CPPUNIT_ASSERT_EQUAL(10*i+1, values[i]); + + // set one element + std::vector newEltValues; + newEltValues.push_back(1); + CPPUNIT_ASSERT_THROW(step->setElement(2, newEltValues), XAO_Exception); + for (int i = 1; i < nbComponents; ++i) + newEltValues.push_back(1); + step->setElement(2, newEltValues); + + // set one component + std::vector newCompValues; + newCompValues.push_back(100); + CPPUNIT_ASSERT_THROW(step->setComponent(1, newCompValues), XAO_Exception); + for (int i = 1; i < nbElements; ++i) + newCompValues.push_back(100); + step->setComponent(1, newCompValues); + + // set string value + step->setStringValue(0, 0, "0"); + CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), XAO_Exception); + + // set all values + std::vector allValues; + // only one value + allValues.push_back(11); + CPPUNIT_ASSERT_THROW(step->setValues(allValues), XAO_Exception); + // all values + for (int i = 1; i < nbElements*nbComponents; ++i) + allValues.push_back(11); + step->setValues(allValues); +} + +void FieldTest::testDoubleStepValues() +{ + int nbComponents = 3; + int nbElements = 5; + + DoubleStep* step = new DoubleStep(0, 0, nbElements, nbComponents); + for (int i = 0; i < step->countElements(); ++i) + { + for (int j = 0; j < step->countComponents(); ++j) + step->setValue(i, j, i*10 + j*0.1); + } + + CPPUNIT_ASSERT_EQUAL(10.2, step->getValue(1, 2)); + CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), XAO_Exception); + CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), XAO_Exception); + + // get all values + std::vector values; + values = step->getValues(); + CPPUNIT_ASSERT_EQUAL(nbElements*nbComponents, (int)values.size()); + for (int i = 0; i < nbElements; ++i) + { + for (int j = 0; j < nbComponents; ++j) + CPPUNIT_ASSERT_EQUAL(10*i+j*0.1, values[i*nbComponents+j]); + } + + // get one element + values = step->getElement(2); + CPPUNIT_ASSERT_THROW(step->getElement(nbElements), XAO_Exception); + CPPUNIT_ASSERT_EQUAL(nbComponents, (int)values.size()); + for (int i = 0; i < nbComponents; ++i) + CPPUNIT_ASSERT_EQUAL(20+i*0.1, values[i]); + + // get one component + values = step->getComponent(1); + CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), XAO_Exception); + CPPUNIT_ASSERT_EQUAL(nbElements, (int)values.size()); + for (int i = 0; i < nbElements; ++i) + CPPUNIT_ASSERT_EQUAL(10*i+0.1, values[i]); + + // set one element + std::vector newEltValues; + newEltValues.push_back(1.); + CPPUNIT_ASSERT_THROW(step->setElement(2, newEltValues), XAO_Exception); + for (int i = 1; i < nbComponents; ++i) + newEltValues.push_back(1.); + step->setElement(2, newEltValues); + + // set one component + std::vector newCompValues; + newCompValues.push_back(100.0); + CPPUNIT_ASSERT_THROW(step->setComponent(1, newCompValues), XAO_Exception); + for (int i = 1; i < nbElements; ++i) + newCompValues.push_back(100.0); + step->setComponent(1, newCompValues); + + // set string value + step->setStringValue(0, 0, "0.2"); + CPPUNIT_ASSERT_THROW(step->setStringValue(0, 0, "aa"), XAO_Exception); + + std::vector allValues; + // only one value + allValues.push_back(1.1); + CPPUNIT_ASSERT_THROW(step->setValues(allValues), XAO_Exception); + // all values + for (int i = 1; i < nbElements*nbComponents; ++i) + allValues.push_back(1.1); + step->setValues(allValues);} + +void FieldTest::testStringStepValues() +{ + int nbComponents = 3; + int nbElements = 5; + + StringStep* step = new StringStep(0, 0, nbElements, nbComponents); + for (int i = 0; i < step->countElements(); ++i) + { + for (int j = 0; j < step->countComponents(); ++j) + step->setValue(i, j, XaoUtils::intToString(i*10 + j)); + } + + CPPUNIT_ASSERT_EQUAL(std::string("12"), step->getValue(1, 2)); + CPPUNIT_ASSERT_THROW(step->getValue(nbElements, 2), XAO_Exception); + CPPUNIT_ASSERT_THROW(step->getValue(1, nbComponents), XAO_Exception); + + // get all values + std::vector values; + values = step->getValues(); + CPPUNIT_ASSERT_EQUAL(nbElements*nbComponents, (int)values.size()); + for (int i = 0; i < nbElements; ++i) + { + for (int j = 0; j < nbComponents; ++j) + CPPUNIT_ASSERT_EQUAL(XaoUtils::intToString(10*i+j), values[i*nbComponents+j]); + } + + // get one element + values = step->getElement(2); + CPPUNIT_ASSERT_THROW(step->getElement(nbElements), XAO_Exception); + CPPUNIT_ASSERT_EQUAL(nbComponents, (int)values.size()); + for (int i = 0; i < nbComponents; ++i) + CPPUNIT_ASSERT_EQUAL(XaoUtils::intToString(20+i), values[i]); + + // get one component + values = step->getComponent(1); + CPPUNIT_ASSERT_THROW(step->getComponent(nbComponents), XAO_Exception); + CPPUNIT_ASSERT_EQUAL(nbElements, (int)values.size()); + for (int i = 0; i < nbElements; ++i) + CPPUNIT_ASSERT_EQUAL(XaoUtils::intToString(10*i+1), values[i]); + + // set one element + std::vector newEltValues; + newEltValues.push_back("1"); + CPPUNIT_ASSERT_THROW(step->setElement(2, newEltValues), XAO_Exception); + for (int i = 1; i < nbComponents; ++i) + newEltValues.push_back("1"); + step->setElement(2, newEltValues); + + // set one component + std::vector newCompValues; + newCompValues.push_back("100"); + CPPUNIT_ASSERT_THROW(step->setComponent(1, newCompValues), XAO_Exception); + for (int i = 1; i < nbElements; ++i) + newCompValues.push_back("100"); + step->setComponent(1, newCompValues); + + // set string value + step->setStringValue(0, 0, "0"); + + std::vector allValues; + // only one value + allValues.push_back("abc"); + CPPUNIT_ASSERT_THROW(step->setValues(allValues), XAO_Exception); + // all values + for (int i = 1; i < nbElements*nbComponents; ++i) + allValues.push_back("abc"); + step->setValues(allValues); +} + +void FieldTest::testSetComponents() +{ + // field with 3 components + Field* f = Field::createField(XAO::INTEGER, XAO::FACE, 6, 3); + CPPUNIT_ASSERT_EQUAL(std::string(""), f->getComponentName(0)); + CPPUNIT_ASSERT_EQUAL(std::string(""), f->getComponentName(1)); + CPPUNIT_ASSERT_EQUAL(std::string(""), f->getComponentName(2)); + + std::vector names; + names.push_back("vx"); + f->setComponentsNames(names); + CPPUNIT_ASSERT_EQUAL(std::string("vx"), f->getComponentName(0)); + CPPUNIT_ASSERT_EQUAL(std::string(""), f->getComponentName(1)); + CPPUNIT_ASSERT_EQUAL(std::string(""), f->getComponentName(2)); + + names.push_back("vy"); + f->setComponentsNames(names); + CPPUNIT_ASSERT_EQUAL(std::string("vx"), f->getComponentName(0)); + CPPUNIT_ASSERT_EQUAL(std::string("vy"), f->getComponentName(1)); + CPPUNIT_ASSERT_EQUAL(std::string(""), f->getComponentName(2)); + + names.push_back("vz"); + names.push_back("t"); + f->setComponentsNames(names); + CPPUNIT_ASSERT_EQUAL(std::string("vx"), f->getComponentName(0)); + CPPUNIT_ASSERT_EQUAL(std::string("vy"), f->getComponentName(1)); + CPPUNIT_ASSERT_EQUAL(std::string("vz"), f->getComponentName(2)); +} diff --git a/src/XAO/tests/FieldTest.hxx b/src/XAO/tests/FieldTest.hxx new file mode 100644 index 000000000..35e766576 --- /dev/null +++ b/src/XAO/tests/FieldTest.hxx @@ -0,0 +1,55 @@ +#ifndef __XAO_FIELD_TEST_HXX__ +#define __XAO_FIELD_TEST_HXX__ + +#include + +#include "../XAO_Xao.hxx" +#include "../XAO_Field.hxx" +#include "../XAO_Step.hxx" + +namespace XAO +{ + class FieldTest: public CppUnit::TestFixture + { + CPPUNIT_TEST_SUITE(FieldTest); + CPPUNIT_TEST(testBooleanField); + CPPUNIT_TEST(testDoubleField); + CPPUNIT_TEST(testIntegerField); + CPPUNIT_TEST(testStringField); + CPPUNIT_TEST(testBooleanStep); + CPPUNIT_TEST(testIntegerStep); + CPPUNIT_TEST(testDoubleStep); + CPPUNIT_TEST(testStringStep); + CPPUNIT_TEST(testBooleanStepValues); + CPPUNIT_TEST(testIntegerStepValues); + CPPUNIT_TEST(testDoubleStepValues); + CPPUNIT_TEST(testStringStepValues); + CPPUNIT_TEST(testSetComponents); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void cleanUp(); + + Field* testField(XAO::Type type); + void testBooleanField(); + void testIntegerField(); + void testDoubleField(); + void testStringField(); + + void testStep(XAO::Type type, Step* step); + void testBooleanStep(); + void testIntegerStep(); + void testDoubleStep(); + void testStringStep(); + + void testBooleanStepValues(); + void testIntegerStepValues(); + void testDoubleStepValues(); + void testStringStepValues(); + void testSetComponents(); + }; +} + +#endif // __XAO_FIELD_TEST_HXX__ diff --git a/src/XAO/tests/GeometryTest.cxx b/src/XAO/tests/GeometryTest.cxx new file mode 100644 index 000000000..aa68e353b --- /dev/null +++ b/src/XAO/tests/GeometryTest.cxx @@ -0,0 +1,142 @@ +#include + +#include "TestUtils.hxx" +#include "GeometryTest.hxx" +#include "../XAO_XaoUtils.hxx" +#include "../XAO_Geometry.hxx" +#include "../XAO_GeometricElement.hxx" + +using namespace XAO; + +void GeometryTest::setUp() +{ +} + +void GeometryTest::tearDown() +{ +} + +void GeometryTest::cleanUp() +{ +} + +void GeometryTest::testGeometryElement() +{ + GeometricElement elt; + CPPUNIT_ASSERT_EQUAL(false, elt.hasName()); + CPPUNIT_ASSERT_EQUAL(std::string(""), elt.getName()); + CPPUNIT_ASSERT_EQUAL(std::string(""), elt.getReference()); + + elt.setName("test"); + CPPUNIT_ASSERT_EQUAL(true, elt.hasName()); + CPPUNIT_ASSERT_EQUAL(std::string("test"), elt.getName()); + + elt.setReference("abc"); + CPPUNIT_ASSERT_EQUAL(std::string("abc"), elt.getReference()); + + GeometricElement elt2("aa", "bb"); + CPPUNIT_ASSERT_EQUAL(std::string("aa"), elt2.getName()); + CPPUNIT_ASSERT_EQUAL(std::string("bb"), elt2.getReference()); +} + +void GeometryTest::testGeometryElementList() +{ + GeometricElementList lst; + CPPUNIT_ASSERT_EQUAL(0, lst.getSize()); + lst.setSize(10); + CPPUNIT_ASSERT_EQUAL(10, lst.getSize()); + + GeometricElementList otherLst(15); + CPPUNIT_ASSERT_EQUAL(15, otherLst.getSize()); + CPPUNIT_ASSERT_EQUAL(std::string(""), otherLst.getName(0)); + CPPUNIT_ASSERT_EQUAL(std::string(""), otherLst.getReference(0)); + + CPPUNIT_ASSERT_THROW(otherLst.getName(20), XAO_Exception); + CPPUNIT_ASSERT_THROW(otherLst.getReference(20), XAO_Exception); + CPPUNIT_ASSERT_THROW(otherLst.hasName(20), XAO_Exception); + + otherLst.setName(0, "aa"); + CPPUNIT_ASSERT_EQUAL(std::string("aa"), otherLst.getName(0)); + CPPUNIT_ASSERT_THROW(otherLst.setName(20, "aa"), XAO_Exception); + otherLst.setReference(0, "bb"); + CPPUNIT_ASSERT_EQUAL(std::string("bb"), otherLst.getReference(0)); + CPPUNIT_ASSERT_THROW(otherLst.setReference(20, "aa"), XAO_Exception); + + otherLst.setSize(10); + CPPUNIT_ASSERT_EQUAL(std::string(""), otherLst.getName(0)); + CPPUNIT_ASSERT_EQUAL(std::string(""), otherLst.getReference(0)); + CPPUNIT_ASSERT_EQUAL(false, otherLst.hasName(0)); + + otherLst.setElement(3, "name", "ref"); + CPPUNIT_ASSERT_EQUAL(std::string("name"), otherLst.getName(3)); + CPPUNIT_ASSERT_EQUAL(std::string("ref"), otherLst.getReference(3)); + CPPUNIT_ASSERT_EQUAL(true, otherLst.hasName(3)); + CPPUNIT_ASSERT_THROW(otherLst.setElement(30, "name", "ref"), XAO_Exception); + + // ---- create elements "name i", "Ri" + for (int i = 0; i < otherLst.getSize(); ++i) + { + std::ostringstream name; + name << "name " << i; + std::ostringstream ref; + ref << "R" << i; + + otherLst.setElement(i, name.str(), ref.str()); + } + + CPPUNIT_ASSERT_EQUAL(8, otherLst.getIndexByReference("R8")); + CPPUNIT_ASSERT_THROW(otherLst.getIndexByReference("ZZ"), XAO_Exception); + + GeometricElementList::iterator first = otherLst.begin(); + GeometricElement firstElt = first->second; + CPPUNIT_ASSERT_EQUAL(std::string("R0"), firstElt.getReference()); +} + +void GeometryTest::testGeometry() +{ + Geometry* geom = Geometry::createGeometry(XAO::BREP, "cube"); + + CPPUNIT_ASSERT_EQUAL(std::string("cube"), geom->getName()); + CPPUNIT_ASSERT_EQUAL(XAO::BREP, geom->getFormat()); + + geom->setName("sphere"); + CPPUNIT_ASSERT_EQUAL(std::string("sphere"), geom->getName()); + + delete geom; +} + +void GeometryTest::testGeometryErrors() +{ + CPPUNIT_ASSERT_THROW(Geometry::createGeometry(XAO::STEP), XAO_Exception); +} + +void GeometryTest::testSetElement() +{ + Geometry* geom = Geometry::createGeometry(XAO::BREP, "cube"); + + CPPUNIT_ASSERT_THROW(geom->setVertexName(0, "aa"), XAO_Exception); + + char* txt = TestUtils::readTextFile(TestUtils::getTestFilePath("Box_1.brep")); + geom->setShapeString(txt); + + CPPUNIT_ASSERT_EQUAL(false, geom->hasVertexName(0)); + geom->setVertexName(0, "va"); + CPPUNIT_ASSERT_EQUAL(true, geom->hasVertexName(0)); + CPPUNIT_ASSERT_EQUAL(std::string("va"), geom->getVertexName(0)); + CPPUNIT_ASSERT_THROW(geom->getVertexName(100), XAO_Exception); + CPPUNIT_ASSERT_THROW(geom->hasVertexName(100), XAO_Exception); + + geom->setEdgeName(0, "ea"); + CPPUNIT_ASSERT_EQUAL(std::string("ea"), geom->getEdgeName(0)); + CPPUNIT_ASSERT_THROW(geom->getEdgeName(100), XAO_Exception); + + geom->setFaceName(0, "fa"); + CPPUNIT_ASSERT_EQUAL(std::string("fa"), geom->getFaceName(0)); + CPPUNIT_ASSERT_THROW(geom->getFaceName(100), XAO_Exception); + + geom->setSolidName(0, "sa"); + CPPUNIT_ASSERT_EQUAL(std::string("sa"), geom->getSolidName(0)); + CPPUNIT_ASSERT_THROW(geom->getSolidName(100), XAO_Exception); + + delete geom; +} diff --git a/src/XAO/tests/GeometryTest.hxx b/src/XAO/tests/GeometryTest.hxx new file mode 100644 index 000000000..63ad244ff --- /dev/null +++ b/src/XAO/tests/GeometryTest.hxx @@ -0,0 +1,30 @@ +#ifndef __XAO_GEOMETRY_TEST_HXX__ +#define __XAO_GEOMETRY_TEST_HXX__ + +#include + +namespace XAO +{ + class GeometryTest: public CppUnit::TestFixture + { + CPPUNIT_TEST_SUITE(GeometryTest); + CPPUNIT_TEST(testGeometryElement); + CPPUNIT_TEST(testGeometryElementList); + CPPUNIT_TEST(testGeometry); + CPPUNIT_TEST(testGeometryErrors); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void cleanUp(); + + void testGeometryElement(); + void testGeometryElementList(); + void testGeometry(); + void testGeometryErrors(); + void testSetElement(); + }; +} + +#endif // __XAO_GEOMETRY_TEST_HXX__ diff --git a/src/XAO/tests/GroupTest.cxx b/src/XAO/tests/GroupTest.cxx new file mode 100644 index 000000000..60d4dc4d7 --- /dev/null +++ b/src/XAO/tests/GroupTest.cxx @@ -0,0 +1,58 @@ +#include + +#include "TestUtils.hxx" +#include "GroupTest.hxx" +#include "../XAO_XaoUtils.hxx" +#include "../XAO_Xao.hxx" +#include "../XAO_Group.hxx" + +using namespace XAO; + +void GroupTest::setUp() +{ +} + +void GroupTest::tearDown() +{ +} + +void GroupTest::cleanUp() +{ +} + +void GroupTest::testGroup() +{ + Group* group = new Group(XAO::FACE, 20); + + CPPUNIT_ASSERT_EQUAL(XAO::FACE, group->getDimension()); + CPPUNIT_ASSERT_EQUAL(20, group->getNbElements()); + + CPPUNIT_ASSERT_EQUAL(std::string(""), group->getName()); + group->setName("the Group"); + CPPUNIT_ASSERT_EQUAL(std::string("the Group"), group->getName()); + + CPPUNIT_ASSERT_EQUAL(0, group->count()); + group->add(10); + CPPUNIT_ASSERT_EQUAL(1, group->count()); + group->add(12); + CPPUNIT_ASSERT_EQUAL(2, group->count()); + group->add(12); + CPPUNIT_ASSERT_EQUAL(2, group->count()); + + CPPUNIT_ASSERT_EQUAL(10, group->get(0)); + CPPUNIT_ASSERT_EQUAL(12, group->get(1)); + CPPUNIT_ASSERT_THROW(group->get(2), XAO_Exception); + + group->remove(15); + CPPUNIT_ASSERT_EQUAL(2, group->count()); + group->remove(10); + CPPUNIT_ASSERT_EQUAL(1, group->count()); + CPPUNIT_ASSERT_EQUAL(12, group->get(0)); + + delete group; +} + +void GroupTest::testGroupErrors() +{ + CPPUNIT_ASSERT_THROW(new Group(XAO::WHOLE, 20), XAO_Exception); +} diff --git a/src/XAO/tests/GroupTest.hxx b/src/XAO/tests/GroupTest.hxx new file mode 100644 index 000000000..ad54e0773 --- /dev/null +++ b/src/XAO/tests/GroupTest.hxx @@ -0,0 +1,25 @@ +#ifndef __XAO_GROUP_TEST_HXX__ +#define __XAO_GROUP_TEST_HXX__ + +#include + +namespace XAO +{ + class GroupTest: public CppUnit::TestFixture + { + CPPUNIT_TEST_SUITE(GroupTest); + CPPUNIT_TEST(testGroup); + CPPUNIT_TEST(testGroupErrors); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void cleanUp(); + + void testGroup(); + void testGroupErrors(); + }; +} + +#endif // __XAO_GROUP_TEST_HXX__ diff --git a/src/XAO/tests/ImportExportTest.cxx b/src/XAO/tests/ImportExportTest.cxx new file mode 100644 index 000000000..3a7945af5 --- /dev/null +++ b/src/XAO/tests/ImportExportTest.cxx @@ -0,0 +1,187 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#include "TestUtils.hxx" +#include "ImportExportTest.hxx" +#include "../XAO_XaoUtils.hxx" +#include "../XAO_Geometry.hxx" +#include "../XAO_Group.hxx" +#include "../XAO_Field.hxx" +#include "../XAO_IntegerField.hxx" +#include "../XAO_IntegerStep.hxx" + +using namespace XAO; + + +void ImportExportTest::setUp() +{ +} + +void ImportExportTest::tearDown() +{ +} + +void ImportExportTest::cleanUp() +{ +} + +void ImportExportTest::testExportNoGeometry() +{ + Xao xao("me", "1.0"); + + bool res = xao.exportXAO("empty.xao"); + CPPUNIT_ASSERT(res); +} + +void ImportExportTest::testExportGeometry() +{ + Xao xao("me", "1.0"); + Geometry* geom = Geometry::createGeometry(XAO::BREP); + geom->setName("mygeom"); + CPPUNIT_ASSERT_EQUAL(false, geom->isReadOnly()); + + // add elements + geom->setCountVertices(4); + geom->setVertex(0, "v1", "1"); + geom->setVertex(1, "", "2"); + geom->setVertex(2, "v3", "3"); + geom->setVertex(3, "", "4"); + + geom->setCountEdges(3); + geom->setEdge(0, "e1", "5"); + geom->setEdge(1, "", "6"); + geom->setEdge(2, "e3", "7"); + + geom->setCountFaces(2); + geom->setFace(0, "f1", "8"); + geom->setFace(1, "", "9"); + + geom->setCountSolids(1); + geom->setSolid(0, "s1", "10"); + + xao.setGeometry(geom); + CPPUNIT_ASSERT_EQUAL(true, geom->isReadOnly()); + + // groups + Group* group = xao.addGroup(XAO::SOLID); + group->setName("boite1"); + group->add(0); + + group = xao.addGroup(XAO::FACE); + group->setName("faces"); + group->add(0); + group->add(1); + + // fields + IntegerField* field = (IntegerField*)xao.addField(XAO::INTEGER, XAO::FACE, 2, "color"); + for (int stepIndex = 0; stepIndex < 10; ++stepIndex) + { + IntegerStep* istep = field->addStep(stepIndex, 100*stepIndex); + for (int eltIndex = 0; eltIndex < istep->countElements(); ++eltIndex) + { + for (int compIndex = 0; compIndex < istep->countComponents(); ++compIndex) + { + istep->setValue(eltIndex, compIndex, istep->getStamp() + eltIndex*10 + compIndex); + } + } + } + + bool res = xao.exportXAO("mygeom.xao"); + CPPUNIT_ASSERT(res); + + std::string xml = xao.getXML(); + //CPPUNIT_ASSERT_EQUAL(strlen(xml) == 1007); +} + +void ImportExportTest::testGeometryError() +{ + Geometry* geom = Geometry::createGeometry(XAO::BREP); + geom->setName("mygeom"); + geom->setCountVertices(2); + CPPUNIT_ASSERT_THROW(geom->setVertex(3, "v4", "4"), XAO_Exception); + delete geom; +} + +void ImportExportTest::testImportXao() +{ + Xao xao; + xao.importXAO(TestUtils::getTestFilePath("test.xao")); + checkImport(xao); +} + +void ImportExportTest::testImportXaoFromText() +{ + char* txt = TestUtils::readTextFile(TestUtils::getTestFilePath("test.xao")); + + Xao xao; + xao.setXML(txt); + checkImport(xao); +} + +void ImportExportTest::checkImport(Xao& xao) +{ + CPPUNIT_ASSERT_EQUAL(std::string("me"), xao.getAuthor()); + CPPUNIT_ASSERT_EQUAL(std::string("1.0"), xao.getVersion()); + + Geometry* geom = xao.getGeometry(); + CPPUNIT_ASSERT(geom != NULL); + CPPUNIT_ASSERT_EQUAL(std::string("mygeom"), geom->getName()); + + CPPUNIT_ASSERT_EQUAL(4, geom->countVertices()); + CPPUNIT_ASSERT_EQUAL(std::string("v1"), geom->getVertexName(0)); + CPPUNIT_ASSERT_EQUAL(std::string("1"), geom->getVertexReference(0)); + CPPUNIT_ASSERT_EQUAL(std::string(""), geom->getVertexName(1)); + CPPUNIT_ASSERT_EQUAL(std::string("2"), geom->getVertexReference(1)); + CPPUNIT_ASSERT_EQUAL(std::string("v3"), geom->getVertexName(2)); + CPPUNIT_ASSERT_EQUAL(std::string("3"), geom->getVertexReference(2)); + CPPUNIT_ASSERT_EQUAL(std::string(""), geom->getVertexName(3)); + CPPUNIT_ASSERT_EQUAL(std::string("4"), geom->getVertexReference(3)); + + CPPUNIT_ASSERT_EQUAL(3, geom->countEdges()); + CPPUNIT_ASSERT_EQUAL(std::string("e1"), geom->getEdgeName(0)); + CPPUNIT_ASSERT_EQUAL(std::string("5"), geom->getEdgeReference(0)); + CPPUNIT_ASSERT_EQUAL(std::string(""), geom->getEdgeName(1)); + CPPUNIT_ASSERT_EQUAL(std::string("6"), geom->getEdgeReference(1)); + CPPUNIT_ASSERT_EQUAL(std::string("e3"), geom->getEdgeName(2)); + CPPUNIT_ASSERT_EQUAL(std::string("7"), geom->getEdgeReference(2)); + + CPPUNIT_ASSERT_EQUAL(2, geom->countFaces()); + CPPUNIT_ASSERT_EQUAL(std::string("f1"), geom->getFaceName(0)); + CPPUNIT_ASSERT_EQUAL(std::string("8"), geom->getFaceReference(0)); + CPPUNIT_ASSERT_EQUAL(std::string(""), geom->getFaceName(1)); + CPPUNIT_ASSERT_EQUAL(std::string("9"), geom->getFaceReference(1)); + + CPPUNIT_ASSERT_EQUAL(1, geom->countSolids()); + CPPUNIT_ASSERT_EQUAL(std::string("s1"), geom->getSolidName(0)); + CPPUNIT_ASSERT_EQUAL(std::string("10"), geom->getSolidReference(0)); + + CPPUNIT_ASSERT_EQUAL(2, xao.countGroups()); + Group* group = xao.getGroup(0); + CPPUNIT_ASSERT_EQUAL(1, group->count()); + CPPUNIT_ASSERT_EQUAL(std::string("boite_1"), group->getName()); + CPPUNIT_ASSERT_EQUAL(XAO::SOLID, group->getDimension()); + CPPUNIT_ASSERT_EQUAL(0, group->get(0)); + group = xao.getGroup(1); + CPPUNIT_ASSERT_EQUAL(2, group->count()); + CPPUNIT_ASSERT_EQUAL(std::string(""), group->getName()); + CPPUNIT_ASSERT_EQUAL(XAO::FACE, group->getDimension()); + CPPUNIT_ASSERT_EQUAL(0, group->get(0)); + CPPUNIT_ASSERT_EQUAL(1, group->get(1)); +} diff --git a/src/XAO/tests/ImportExportTest.hxx b/src/XAO/tests/ImportExportTest.hxx new file mode 100644 index 000000000..2756b2ea8 --- /dev/null +++ b/src/XAO/tests/ImportExportTest.hxx @@ -0,0 +1,35 @@ +#ifndef __XAO_IMPORT_TEST_HXX__ +#define __XAO_IMPORT_TEST_HXX__ + +#include + +#include "../XAO_Xao.hxx" + +namespace XAO +{ + class ImportExportTest: public CppUnit::TestFixture + { + CPPUNIT_TEST_SUITE(ImportExportTest); + CPPUNIT_TEST(testExportNoGeometry); + CPPUNIT_TEST(testExportGeometry); + CPPUNIT_TEST(testGeometryError); + CPPUNIT_TEST(testImportXao); + CPPUNIT_TEST(testImportXaoFromText); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void cleanUp(); + + void testExportNoGeometry(); + void testExportGeometry(); + void testGeometryError(); + void testImportXao(); + void testImportXaoFromText(); + + void checkImport(Xao& xao); + }; +} + +#endif // __XAO_IMPORT_TEST_HXX__ diff --git a/src/XAO/tests/MainTest.hxx b/src/XAO/tests/MainTest.hxx new file mode 100644 index 000000000..e28f688f9 --- /dev/null +++ b/src/XAO/tests/MainTest.hxx @@ -0,0 +1,161 @@ +// Copyright (C) 2013 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 : Frederic Pons (OpenCascade) + +#ifndef __XAOMAINTEST_HXX__ +#define __XAOMAINTEST_HXX__ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +struct Arguments +{ +public: + bool List; + bool Err; + std::string Test; +}; + +Arguments parseArguments(int argc, char* argv[]) +{ + Arguments res; + res.List = false; + res.Err = false; + res.Test = ""; + + if (argc > 1) + { + int i = 0; + while (++i < argc) // skip 0 + { + if (strcmp(argv[i], "-l") == 0 || strcmp(argv[i], "--list") == 0) + { + res.List = true; + } + else if (strcmp(argv[i], "-e") == 0 || strcmp(argv[i], "--err") == 0) + { + res.Err = true; + } + else if (strcmp(argv[i], "-t") == 0 || strcmp(argv[i], "--test") == 0) + { + if (i+1 < argc) + res.Test = argv[++i]; + } + } + } + + return res; +} + +void listTests(CPPUNIT_NS::Test* test) +{ + if (!test) return; + std::cout << test->getName() << std::endl; + for (int i = 0; i < test->getChildTestCount(); ++i) + { + listTests(test->getChildTestAt(i)); + } +} + +// ============================================================================ +/*! + * Main program source for Unit Tests with cppunit package does not depend + * on actual tests, so we use the same for all partial unit tests. + */ +// ============================================================================ +int main(int argc, char* argv[]) +{ + Arguments args = parseArguments(argc, argv); + + // --- Create the event manager and test controller + CPPUNIT_NS::TestResult controller; + + // --- Add a listener that colllects test result + CPPUNIT_NS::TestResultCollector result; + controller.addListener(&result); + + // --- Add a listener that print dots as test run. +#ifdef WIN32 + CPPUNIT_NS::TextTestProgressListener progress; +#else + CPPUNIT_NS::BriefTestProgressListener progress; +#endif + controller.addListener(&progress); + + // --- Get the top level suite from the registry + + CPPUNIT_NS::Test *suite = + CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest(); + + // --- Adds the test to the list of test to run + + // list tests and exit + if (args.List) + { + listTests(suite); + return 0; + } + + if (!args.Test.empty()) + { + // find test by name + // an exception is raised if not found + suite = suite->findTest(args.Test); + } + + CPPUNIT_NS::TestRunner runner; + runner.addTest(suite); + runner.run(controller); + + // --- Print test in a compiler compatible format. + + if (args.Err) + { + CPPUNIT_NS::CompilerOutputter outputter(&result, std::cerr); + outputter.write(); + } + else + { + std::ofstream testFile; + testFile.open("UnitTestsResult", std::ios::out | std::ios::trunc); + CPPUNIT_NS::CompilerOutputter outputter(&result, testFile); + outputter.write(); + testFile.close(); + } + + // --- Run the tests. + + bool wasSucessful = result.wasSuccessful(); + + // --- Return error code 1 if the one of test failed. + + return wasSucessful ? 0 : 1; +} + +#endif diff --git a/src/XAO/tests/TestUtils.hxx b/src/XAO/tests/TestUtils.hxx new file mode 100644 index 000000000..f754db107 --- /dev/null +++ b/src/XAO/tests/TestUtils.hxx @@ -0,0 +1,36 @@ +#ifndef __XAO_TESTUTILS_HXX__ +#define __XAO_TESTUTILS_HXX__ + +#include +#include + +namespace XAO +{ + class TestUtils + { + public: + static std::string getTestFilePath(const std::string& fileName) + { + std::string dataDir = getenv("GEOM_SRC_DIR"); + dataDir += "/src/XAO/tests/data/" + fileName; + return dataDir; + } + + static char* readTextFile(const std::string& filePath) + { + std::ifstream rstr; + int length; + rstr.open(filePath.c_str()); + rstr.seekg(0, rstr.end); // go to the end + length = rstr.tellg(); // report location (this is the length) + rstr.seekg(0, rstr.beg); // go back to the beginning + char* txt = new char[length]; // allocate memory for a buffer of appropriate dimension + rstr.read(txt, length); // read the whole file into the buffer + rstr.close(); + + return txt; + } + }; +} + +#endif /* __XAO_TESTUTILS_HXX__ */ diff --git a/src/XAO/tests/XAOTests.cxx b/src/XAO/tests/XAOTests.cxx new file mode 100644 index 000000000..baef3d19d --- /dev/null +++ b/src/XAO/tests/XAOTests.cxx @@ -0,0 +1,17 @@ +#include "XaoUtilsTest.hxx" +#include "GroupTest.hxx" +#include "FieldTest.hxx" +#include "GeometryTest.hxx" +#include "ImportExportTest.hxx" +#include "BrepGeometryTest.hxx" +#include "XaoTest.hxx" + +CPPUNIT_TEST_SUITE_REGISTRATION(XAO::XaoUtilsTest); +CPPUNIT_TEST_SUITE_REGISTRATION(XAO::GroupTest); +CPPUNIT_TEST_SUITE_REGISTRATION(XAO::FieldTest); +CPPUNIT_TEST_SUITE_REGISTRATION(XAO::GeometryTest); +CPPUNIT_TEST_SUITE_REGISTRATION(XAO::ImportExportTest); +CPPUNIT_TEST_SUITE_REGISTRATION(XAO::BrepGeometryTest); +CPPUNIT_TEST_SUITE_REGISTRATION(XAO::XaoTest); + +#include "MainTest.hxx" diff --git a/src/XAO/tests/XaoTest.cxx b/src/XAO/tests/XaoTest.cxx new file mode 100644 index 000000000..cb96cac27 --- /dev/null +++ b/src/XAO/tests/XaoTest.cxx @@ -0,0 +1,103 @@ +#include + +#include "TestUtils.hxx" +#include "XaoTest.hxx" +#include "../XAO_XaoUtils.hxx" +#include "../XAO_Xao.hxx" +#include "../XAO_BrepGeometry.hxx" +#include "../XAO_Group.hxx" +#include "../XAO_Field.hxx" + +using namespace XAO; + +void XaoTest::setUp() +{ +} + +void XaoTest::tearDown() +{ +} + +void XaoTest::cleanUp() +{ +} + +void XaoTest::testGroups() +{ + Xao obj; + CPPUNIT_ASSERT_THROW(obj.addGroup(XAO::FACE), XAO_Exception); + + BrepGeometry* geom = new BrepGeometry("test"); + obj.setGeometry(geom); + Group* gr = obj.addGroup(XAO::FACE); + CPPUNIT_ASSERT_EQUAL(XAO::FACE, gr->getDimension()); + CPPUNIT_ASSERT_EQUAL(1, obj.countGroups()); + Group* gr2 = obj.addGroup(XAO::FACE); + gr2->setName("AA"); + + Group* agr = obj.getGroup(0); + CPPUNIT_ASSERT(gr == agr); + CPPUNIT_ASSERT_THROW(obj.getGroup(10), XAO_Exception); + + CPPUNIT_ASSERT_EQUAL(true, obj.removeGroup(gr2)); + CPPUNIT_ASSERT_EQUAL(1, obj.countGroups()); + + // remove other group + Group* gr3 = new Group(XAO::FACE, 3); + CPPUNIT_ASSERT_EQUAL(false, obj.removeGroup(gr3)); + delete gr3; +} + +void XaoTest::testFields() +{ + Xao obj; + CPPUNIT_ASSERT_THROW(obj.addField(XAO::INTEGER, XAO::FACE, 3), XAO_Exception); + + BrepGeometry* geom = new BrepGeometry("test"); + obj.setGeometry(geom); + Field* fi = obj.addField(XAO::INTEGER, XAO::FACE, 3); + CPPUNIT_ASSERT_EQUAL(1, obj.countFields()); + CPPUNIT_ASSERT_EQUAL(XAO::INTEGER, fi->getType()); + CPPUNIT_ASSERT_EQUAL(XAO::FACE, fi->getDimension()); + CPPUNIT_ASSERT_EQUAL(3, fi->countComponents()); + + Field* fb = obj.addField(XAO::BOOLEAN, XAO::FACE, 3); + Field* fd = obj.addField(XAO::DOUBLE, XAO::FACE, 3); + Field* fs = obj.addField(XAO::STRING, XAO::FACE, 3); + CPPUNIT_ASSERT_EQUAL(4, obj.countFields()); + CPPUNIT_ASSERT_THROW(obj.getField(10), XAO_Exception); + + CPPUNIT_ASSERT_EQUAL(true, obj.removeField(fb)); + CPPUNIT_ASSERT_EQUAL(3, obj.countFields()); + + + Field* ff = Field::createField(XAO::INTEGER, XAO::FACE, 3, 3); + CPPUNIT_ASSERT_EQUAL(false, obj.removeField(ff)); + delete ff; +} + +void XaoTest::testFieldsTypes() +{ + Xao obj; + BrepGeometry* geom = new BrepGeometry("test"); + obj.setGeometry(geom); + + IntegerField* fi = obj.addIntegerField(XAO::FACE, 3); + BooleanField* fb = obj.addBooleanField(XAO::FACE, 3); + DoubleField* fd = obj.addDoubleField(XAO::FACE, 3); + StringField* fs = obj.addStringField(XAO::FACE, 3); + + IntegerField* gfi = obj.getIntegerField(0); + CPPUNIT_ASSERT(gfi == fi); + BooleanField* gfb = obj.getBooleanField(1); + CPPUNIT_ASSERT(gfb == fb); + DoubleField* gfd = obj.getDoubleField(2); + CPPUNIT_ASSERT(gfd == fd); + StringField* gfs = obj.getStringField(3); + CPPUNIT_ASSERT(gfs == fs); + + CPPUNIT_ASSERT_THROW(obj.getIntegerField(1), XAO_Exception); + CPPUNIT_ASSERT_THROW(obj.getBooleanField(0), XAO_Exception); + CPPUNIT_ASSERT_THROW(obj.getDoubleField(0), XAO_Exception); + CPPUNIT_ASSERT_THROW(obj.getStringField(0), XAO_Exception); +} diff --git a/src/XAO/tests/XaoTest.hxx b/src/XAO/tests/XaoTest.hxx new file mode 100644 index 000000000..35516750e --- /dev/null +++ b/src/XAO/tests/XaoTest.hxx @@ -0,0 +1,27 @@ +#ifndef __XAO_XAO_TEST_HXX__ +#define __XAO_XAO_TEST_HXX__ + +#include + +namespace XAO +{ + class XaoTest: public CppUnit::TestFixture + { + CPPUNIT_TEST_SUITE(XaoTest); + CPPUNIT_TEST(testGroups); + CPPUNIT_TEST(testFields); + CPPUNIT_TEST(testFieldsTypes); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void cleanUp(); + + void testGroups(); + void testFields(); + void testFieldsTypes(); + }; +} + +#endif // __XAO_GROUP_TEST_HXX__ diff --git a/src/XAO/tests/XaoUtilsTest.cxx b/src/XAO/tests/XaoUtilsTest.cxx new file mode 100644 index 000000000..22358fa92 --- /dev/null +++ b/src/XAO/tests/XaoUtilsTest.cxx @@ -0,0 +1,88 @@ +#include "XaoUtilsTest.hxx" +#include "../XAO_Xao.hxx" +#include "../XAO_XaoUtils.hxx" + +using namespace XAO; + + +void XaoUtilsTest::setUp() +{ +} + +void XaoUtilsTest::tearDown() +{ +} + +void XaoUtilsTest::cleanUp() +{ +} + +void XaoUtilsTest::testBoolean() +{ + CPPUNIT_ASSERT_EQUAL(std::string("true"), XaoUtils::booleanToString(true)); + CPPUNIT_ASSERT_EQUAL(std::string("false"), XaoUtils::booleanToString(false)); + + CPPUNIT_ASSERT_EQUAL(true, XaoUtils::stringToBoolean("true")); + CPPUNIT_ASSERT_EQUAL(true, XaoUtils::stringToBoolean("1")); + CPPUNIT_ASSERT_EQUAL(false, XaoUtils::stringToBoolean("false")); + CPPUNIT_ASSERT_EQUAL(false, XaoUtils::stringToBoolean("0")); + CPPUNIT_ASSERT_THROW(XaoUtils::stringToBoolean("abc"), XAO_Exception); +} + +void XaoUtilsTest::testInteger() +{ + CPPUNIT_ASSERT_EQUAL(std::string("0"), XaoUtils::intToString(0)); + CPPUNIT_ASSERT_EQUAL(std::string("123"), XaoUtils::intToString(123)); + + CPPUNIT_ASSERT_EQUAL(123, XaoUtils::stringToInt("123")); + CPPUNIT_ASSERT_THROW(XaoUtils::stringToInt("abc"), XAO_Exception); +} + +void XaoUtilsTest::testDouble() +{ + CPPUNIT_ASSERT_EQUAL(std::string("0"), XaoUtils::doubleToString(0)); + CPPUNIT_ASSERT_EQUAL(std::string("12.3"), XaoUtils::doubleToString(12.3)); + + CPPUNIT_ASSERT_DOUBLES_EQUAL(0.123, XaoUtils::stringToDouble("0.123"), 1e-3); + CPPUNIT_ASSERT_THROW(XaoUtils::stringToDouble("abc"), XAO_Exception); +} + +void XaoUtilsTest::testDimension() +{ + CPPUNIT_ASSERT_EQUAL(std::string("vertex"), XaoUtils::dimensionToString(XAO::VERTEX)); + CPPUNIT_ASSERT_EQUAL(std::string("edge"), XaoUtils::dimensionToString(XAO::EDGE)); + CPPUNIT_ASSERT_EQUAL(std::string("face"), XaoUtils::dimensionToString(XAO::FACE)); + CPPUNIT_ASSERT_EQUAL(std::string("solid"), XaoUtils::dimensionToString(XAO::SOLID)); + CPPUNIT_ASSERT_EQUAL(std::string("whole"), XaoUtils::dimensionToString(XAO::WHOLE)); + + CPPUNIT_ASSERT_EQUAL(XAO::VERTEX, XaoUtils::stringToDimension("vertex")); + CPPUNIT_ASSERT_EQUAL(XAO::EDGE, XaoUtils::stringToDimension("edge")); + CPPUNIT_ASSERT_EQUAL(XAO::FACE, XaoUtils::stringToDimension("face")); + CPPUNIT_ASSERT_EQUAL(XAO::SOLID, XaoUtils::stringToDimension("solid")); + CPPUNIT_ASSERT_EQUAL(XAO::WHOLE, XaoUtils::stringToDimension("whole")); + CPPUNIT_ASSERT_THROW(XaoUtils::stringToDimension("zz"), XAO_Exception); +} + +void XaoUtilsTest::testType() +{ + CPPUNIT_ASSERT_EQUAL(std::string("boolean"), XaoUtils::fieldTypeToString(XAO::BOOLEAN)); + CPPUNIT_ASSERT_EQUAL(std::string("integer"), XaoUtils::fieldTypeToString(XAO::INTEGER)); + CPPUNIT_ASSERT_EQUAL(std::string("double"), XaoUtils::fieldTypeToString(XAO::DOUBLE)); + CPPUNIT_ASSERT_EQUAL(std::string("string"), XaoUtils::fieldTypeToString(XAO::STRING)); + + CPPUNIT_ASSERT_EQUAL(XAO::BOOLEAN, XaoUtils::stringToFieldType("boolean")); + CPPUNIT_ASSERT_EQUAL(XAO::INTEGER, XaoUtils::stringToFieldType("integer")); + CPPUNIT_ASSERT_EQUAL(XAO::DOUBLE, XaoUtils::stringToFieldType("double")); + CPPUNIT_ASSERT_EQUAL(XAO::STRING, XaoUtils::stringToFieldType("string")); + CPPUNIT_ASSERT_THROW(XaoUtils::stringToFieldType("zz"), XAO_Exception); +} + +void XaoUtilsTest::testFormat() +{ + CPPUNIT_ASSERT_EQUAL(std::string("BREP"), XaoUtils::shapeFormatToString(XAO::BREP)); + CPPUNIT_ASSERT_EQUAL(std::string("STEP"), XaoUtils::shapeFormatToString(XAO::STEP)); + + CPPUNIT_ASSERT_EQUAL(XAO::BREP, XaoUtils::stringToShapeFormat("BREP")); + CPPUNIT_ASSERT_EQUAL(XAO::STEP, XaoUtils::stringToShapeFormat("STEP")); + CPPUNIT_ASSERT_THROW(XaoUtils::stringToShapeFormat("zz"), XAO_Exception); +} diff --git a/src/XAO/tests/XaoUtilsTest.hxx b/src/XAO/tests/XaoUtilsTest.hxx new file mode 100644 index 000000000..28860d80d --- /dev/null +++ b/src/XAO/tests/XaoUtilsTest.hxx @@ -0,0 +1,33 @@ +#ifndef __XAO_UTILS_TEST_HXX__ +#define __XAO_UTILS_TEST_HXX__ + +#include + +namespace XAO +{ + class XaoUtilsTest: public CppUnit::TestFixture + { + CPPUNIT_TEST_SUITE(XaoUtilsTest); + CPPUNIT_TEST(testBoolean); + CPPUNIT_TEST(testInteger); + CPPUNIT_TEST(testDouble); + CPPUNIT_TEST(testDimension); + CPPUNIT_TEST(testType); + CPPUNIT_TEST(testFormat); + CPPUNIT_TEST_SUITE_END(); + + public: + void setUp(); + void tearDown(); + void cleanUp(); + + void testBoolean(); + void testInteger(); + void testDouble(); + void testDimension(); + void testType(); + void testFormat(); + }; +} + +#endif // __XAO_FIELD_TEST_HXX__ diff --git a/src/XAO/tests/coverage_report.sh b/src/XAO/tests/coverage_report.sh new file mode 100755 index 000000000..4bec866da --- /dev/null +++ b/src/XAO/tests/coverage_report.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +# This script can be used to generate the code coverage report. +# Important: the library needs to be compiled in debug mode and with coverage option +# add to configure options: +# CXXFLAGS="-fprofile-arcs -ftest-coverage" +# CFLAGS="-fprofile-arcs -ftest-coverage" + +# to run the script: +# > cd BUILD/GEOM/src/XAO +# > make +# > cd tests +# > make +# > cp ../.libs/*.gcno . +# > ./TestXAO +# > cp ../.libs/*.gcda . +# > ./coverage_report XAO + +QUIET=--quiet +# report directory +REPORT_PATH=report +# browser to open the report +BROWSER=firefox +# name for the info file +TITLE=$1 + +# initialize +if [[ $TITLE == "--reset" ]] +then + lcov --base-directory . --directory . --zerocounters -q + echo "Reset counters" + exit 0 +fi + + +if [ -z $TITLE ] +then + echo $TITLE "name is required" + exit 1 +fi + +INFO_FILE=${TITLE}.info +if [ -f $INFO_FILE ] +then + rm -f $INFO_FILE +fi + +# collecte des données +lcov --directory . --capture --output-file $INFO_FILE + +# suppression des symboles externes +lcov --remove $INFO_FILE "/usr*" -o $INFO_FILE $QUIET +# prerequisites +lcov --remove $INFO_FILE "/home2/*" -o $INFO_FILE $QUIET + +# suppression des tests +lcov --remove $INFO_FILE "*/tests/*" -o $INFO_FILE $QUIET + +# génération du rapport +genhtml --output-directory $REPORT_PATH --title $TITLE --num-spaces 4 $INFO_FILE + +if [ ! -z $BROWSER ] +then + $BROWSER $REPORT_PATH/index.html & +fi \ No newline at end of file diff --git a/src/XAO/tests/data/Box_1.brep b/src/XAO/tests/data/Box_1.brep new file mode 100644 index 000000000..1ebae6393 --- /dev/null +++ b/src/XAO/tests/data/Box_1.brep @@ -0,0 +1,366 @@ +DBRep_DrawableShape + +CASCADE Topology V1, (c) Matra-Datavision +Locations 0 +Curve2ds 24 +1 0 0 1 0 +1 0 0 1 0 +1 200 0 0 -1 +1 0 0 0 1 +1 0 -200 1 0 +1 0 0 1 0 +1 0 0 0 -1 +1 0 0 0 1 +1 0 0 1 0 +1 0 200 1 0 +1 200 0 0 -1 +1 200 0 0 1 +1 0 -200 1 0 +1 0 200 1 0 +1 0 0 0 -1 +1 200 0 0 1 +1 0 0 0 1 +1 0 0 1 0 +1 200 0 0 1 +1 0 0 1 0 +1 0 0 0 1 +1 0 200 1 0 +1 200 0 0 1 +1 0 200 1 0 +Curves 12 +1 0 0 0 0 0 1 +1 0 0 200 -0 1 0 +1 0 200 0 0 0 1 +1 0 0 0 -0 1 0 +1 200 0 0 0 0 1 +1 200 0 200 0 1 0 +1 200 200 0 0 0 1 +1 200 0 0 -0 1 0 +1 0 0 0 1 0 -0 +1 0 0 200 1 0 -0 +1 0 200 0 1 0 -0 +1 0 200 200 1 0 -0 +Polygon3D 0 +PolygonOnTriangulations 24 +2 1 2 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +Surfaces 6 +1 0 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 0 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 200 0 0 1 1 0 -0 -0 1 0 +1 0 200 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 0 0 0 1 1 0 -0 -0 1 0 +1 200 0 0 1 0 -0 0 0 1 0 -1 0 +Triangulations 6 +4 2 1 0 +0 0 0 0 0 200 0 200 200 0 200 0 0 0 200 0 200 -200 0 -200 2 4 3 2 1 4 +4 2 1 0 +0 0 0 200 0 0 200 0 200 0 0 200 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +0 0 200 0 200 200 200 200 200 200 0 200 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +0 200 0 200 200 0 200 200 200 0 200 200 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +0 0 0 0 200 0 200 200 0 200 0 0 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +200 0 0 200 0 200 200 200 200 200 200 0 0 0 200 0 200 -200 0 -200 2 4 3 2 1 4 + +TShapes 34 +Ve +1e-07 +0 0 200 +0 0 + +0101101 +* +Ve +1e-07 +0 0 0 +0 0 + +0101101 +* +Ed + 1e-07 1 1 0 +1 1 0 0 200 +2 1 1 0 0 200 +2 2 2 0 0 200 +6 1 1 0 +6 2 2 0 +0 + +0101000 +-34 0 +33 0 * +Ve +1e-07 +0 200 200 +0 0 + +0101101 +* +Ed + 1e-07 1 1 0 +1 2 0 0 200 +2 3 1 0 0 200 +2 4 3 0 0 200 +6 3 1 0 +6 4 3 0 +0 + +0101000 +-31 0 +34 0 * +Ve +1e-07 +0 200 0 +0 0 + +0101101 +* +Ed + 1e-07 1 1 0 +1 3 0 0 200 +2 5 1 0 0 200 +2 6 4 0 0 200 +6 5 1 0 +6 6 4 0 +0 + +0101000 +-31 0 +29 0 * +Ed + 1e-07 1 1 0 +1 4 0 0 200 +2 7 1 0 0 200 +2 8 5 0 0 200 +6 7 1 0 +6 8 5 0 +0 + +0101000 +-29 0 +33 0 * +Wi + +0101000 +-32 0 -30 0 +28 0 +27 0 * +Fa +0 1e-07 1 0 +2 1 +0101000 ++26 0 * +Ve +1e-07 +200 0 200 +0 0 + +0101101 +* +Ve +1e-07 +200 0 0 +0 0 + +0101101 +* +Ed + 1e-07 1 1 0 +1 5 0 0 200 +2 9 6 0 0 200 +2 10 2 0 0 200 +6 9 6 0 +6 10 2 0 +0 + +0101000 +-24 0 +23 0 * +Ve +1e-07 +200 200 200 +0 0 + +0101101 +* +Ed + 1e-07 1 1 0 +1 6 0 0 200 +2 11 6 0 0 200 +2 12 3 0 0 200 +6 11 6 0 +6 12 3 0 +0 + +0101000 +-21 0 +24 0 * +Ve +1e-07 +200 200 0 +0 0 + +0101101 +* +Ed + 1e-07 1 1 0 +1 7 0 0 200 +2 13 6 0 0 200 +2 14 4 0 0 200 +6 13 6 0 +6 14 4 0 +0 + +0101000 +-21 0 +19 0 * +Ed + 1e-07 1 1 0 +1 8 0 0 200 +2 15 6 0 0 200 +2 16 5 0 0 200 +6 15 6 0 +6 16 5 0 +0 + +0101000 +-19 0 +23 0 * +Wi + +0101000 +-22 0 -20 0 +18 0 +17 0 * +Fa +0 1e-07 6 0 +2 6 +0101000 ++16 0 * +Ed + 1e-07 1 1 0 +1 9 0 0 200 +2 17 2 0 0 200 +2 18 5 0 0 200 +6 17 2 0 +6 18 5 0 +0 + +0101000 +-23 0 +33 0 * +Ed + 1e-07 1 1 0 +1 10 0 0 200 +2 19 2 0 0 200 +2 20 3 0 0 200 +6 19 2 0 +6 20 3 0 +0 + +0101000 +-24 0 +34 0 * +Wi + +0101000 +-14 0 -22 0 +13 0 +32 0 * +Fa +0 1e-07 2 0 +2 2 +0101000 ++12 0 * +Ed + 1e-07 1 1 0 +1 11 0 0 200 +2 21 4 0 0 200 +2 22 5 0 0 200 +6 21 4 0 +6 22 5 0 +0 + +0101000 +-19 0 +29 0 * +Ed + 1e-07 1 1 0 +1 12 0 0 200 +2 23 4 0 0 200 +2 24 3 0 0 200 +6 23 4 0 +6 24 3 0 +0 + +0101000 +-21 0 +31 0 * +Wi + +0101000 +-10 0 -18 0 +9 0 +28 0 * +Fa +0 1e-07 4 0 +2 4 +0101000 ++8 0 * +Wi + +0101000 +-27 0 -10 0 +17 0 +14 0 * +Fa +0 1e-07 5 0 +2 5 +0101000 ++6 0 * +Wi + +0101000 +-30 0 -9 0 +20 0 +13 0 * +Fa +0 1e-07 3 0 +2 3 +0101000 ++4 0 * +Sh + +0101100 +-25 0 +15 0 -11 0 +7 0 -5 0 +3 0 * +So + +1100000 ++2 0 * + ++1 0 \ No newline at end of file diff --git a/src/XAO/tests/data/Box_2.brep b/src/XAO/tests/data/Box_2.brep new file mode 100644 index 000000000..f7efd3c6e --- /dev/null +++ b/src/XAO/tests/data/Box_2.brep @@ -0,0 +1,716 @@ +DBRep_DrawableShape + +CASCADE Topology V1, (c) Matra-Datavision +Locations 2 +1 + 1 0 0 60 + 0 1 0 -20 + 0 0 1 60 +2 1 -1 0 +Curve2ds 48 +1 0 0 1 0 +1 0 0 1 0 +1 200 0 0 -1 +1 0 0 0 1 +1 0 -200 1 0 +1 0 0 1 0 +1 0 0 0 -1 +1 0 0 0 1 +1 0 0 0 1 +1 0 0 1 0 +1 0 0 1 0 +1 0 200 1 0 +1 200 0 0 1 +1 0 0 1 0 +8 30 110 +1 140 30 0 1 +8 30 110 +1 -30 20 1 0 +8 -110 -30 +1 30 140 -1 0 +8 -110 -30 +1 -30 -20 -1 -0 +8 30 110 +1 60 30 0 1 +8 30 110 +1 -30 20 1 0 +8 -110 -30 +1 30 60 -1 0 +8 -110 -30 +1 -30 -20 -1 -0 +1 200 0 0 1 +1 0 200 1 0 +1 200 0 0 -1 +1 200 0 0 1 +1 0 0 0 1 +1 0 200 1 0 +1 0 -200 1 0 +1 0 200 1 0 +1 0 0 0 -1 +1 200 0 0 1 +1 80 0 0 -1 +1 0 0 0 1 +1 80 0 0 1 +1 0 100 1 0 +1 80 0 0 -1 +1 80 0 0 1 +1 0 -100 1 0 +1 0 80 1 0 +1 0 0 0 -1 +1 80 0 0 1 +1 0 0 0 -1 +1 0 0 0 1 +1 0 0 0 1 +1 0 100 1 0 +1 0 -100 1 0 +1 0 0 1 0 +Curves 24 +1 0 0 0 0 0 1 +1 0 0 200 -0 1 0 +1 0 200 0 0 0 1 +1 0 0 0 -0 1 0 +1 0 0 0 1 0 -0 +1 200 0 0 0 0 1 +1 0 0 200 1 0 -0 +1 30 0 140 1 0 -0 +1 140 0 30 -0 0 -1 +1 30 0 60 1 0 -0 +1 60 0 30 -0 0 -1 +1 0 200 200 1 0 -0 +1 200 0 200 0 1 0 +1 0 200 0 1 0 -0 +1 200 200 0 0 0 1 +1 200 0 0 -0 1 0 +1 0 0 80 -0 1 0 +1 0 100 80 1 0 -0 +1 80 0 80 0 1 0 +1 80 100 0 0 0 1 +1 80 0 0 -0 1 0 +1 0 0 0 -0 1 0 +1 0 100 0 1 0 -0 +1 0 100 0 0 0 1 +Polygon3D 0 +PolygonOnTriangulations 48 +2 1 2 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 5 6 +p 0.8000000008 1 30 110 +2 1 4 +p 0.8000000008 1 30 110 +2 6 7 +p 0.8000000008 1 -110 -30 +2 1 4 +p 0.8000000008 1 -110 -30 +2 8 7 +p 0.8000000008 1 30 110 +2 1 4 +p 0.8000000008 1 30 110 +2 5 8 +p 0.8000000008 1 -110 -30 +2 1 4 +p 0.8000000008 1 -110 -30 +2 2 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 20 100 +2 1 2 +p 0.8000000008 1 20 100 +2 2 3 +p 0.8000000008 1 0 80 +2 4 3 +p 0.8000000008 1 0 80 +2 4 3 +p 0.8000000008 1 20 100 +2 1 2 +p 0.8000000008 1 20 100 +2 3 2 +p 0.8000000008 1 0 80 +2 2 3 +p 0.8000000008 1 0 80 +2 4 3 +p 0.8000000008 1 20 100 +2 4 3 +p 0.8000000008 1 20 100 +2 1 2 +p 0.8000000008 1 20 100 +2 4 3 +p 0.8000000008 1 20 100 +2 2 3 +p 0.8000000008 1 0 80 +2 1 2 +p 0.8000000008 1 0 80 +2 3 2 +p 0.8000000008 1 0 80 +2 1 4 +p 0.8000000008 1 0 80 +Surfaces 11 +1 0 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 0 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 200 0 0 1 1 0 -0 -0 1 0 +1 0 200 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 0 0 0 1 1 0 -0 -0 1 0 +1 200 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 0 80 0 0 1 1 0 -0 -0 1 0 +1 80 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 0 0 0 0 1 1 0 -0 -0 1 0 +1 0 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 100 0 -0 1 0 0 0 1 1 0 -0 +Triangulations 11 +4 2 1 0 +0 0 0 0 0 200 0 200 200 0 200 0 0 0 200 0 200 -200 0 -200 2 4 3 2 1 4 +8 8 1 0 +0 0 0 200 0 0 200 0 200 0 0 200 60 0 140 140 0 140 140 0 60 60 0 60 0 0 0 200 200 200 200 0 140 60 140 140 60 140 60 60 4 5 8 4 8 1 2 8 7 2 1 8 3 6 5 3 7 6 3 2 7 3 5 4 +4 2 1 0 +0 0 200 0 200 200 200 200 200 200 0 200 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +0 200 0 200 200 0 200 200 200 0 200 200 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +0 0 0 0 200 0 200 200 0 200 0 0 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +200 0 0 200 0 200 200 200 200 200 200 0 0 0 200 0 200 -200 0 -200 2 4 3 2 1 4 +4 2 1 0 +60 0 140 60 80 140 140 80 140 140 0 140 0 20 0 100 80 100 80 20 3 2 1 3 1 4 +4 2 1 0 +140 0 140 140 80 140 140 80 60 140 0 60 80 -20 80 -100 0 -100 0 -20 1 3 2 1 4 3 +4 2 1 0 +60 0 60 60 80 60 140 80 60 140 0 60 0 20 0 100 80 100 80 20 3 2 1 3 1 4 +4 2 1 0 +60 0 140 60 80 140 60 80 60 60 0 60 80 -20 80 -100 0 -100 0 -20 1 3 2 1 4 3 +4 2 1 0 +0 100 0 80 100 0 80 100 80 0 100 80 0 0 0 80 80 80 80 0 3 2 1 3 1 4 + +TShapes 65 +Ve +1.0001000025e-07 +0 0 200 +0 0 + +0101101 +* +Ve +1.0001000025e-07 +0 0 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 1 0 0 200 +2 1 1 0 0 200 +2 2 2 0 0 200 +6 1 1 0 +6 2 2 0 +0 + +0101000 +-65 0 +64 0 * +Ve +1.0001000025e-07 +0 200 200 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 2 0 0 200 +2 3 1 0 0 200 +2 4 3 0 0 200 +6 3 1 0 +6 4 3 0 +0 + +0101000 +-62 0 +65 0 * +Ve +1.0001000025e-07 +0 200 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 3 0 0 200 +2 5 1 0 0 200 +2 6 4 0 0 200 +6 5 1 0 +6 6 4 0 +0 + +0101000 +-62 0 +60 0 * +Ed + 1.0001000025e-07 1 1 0 +1 4 0 0 200 +2 7 1 0 0 200 +2 8 5 0 0 200 +6 7 1 0 +6 8 5 0 +0 + +0101000 +-60 0 +64 0 * +Wi + +0101000 +-63 0 -61 0 +59 0 +58 0 * +Fa +0 1e-07 1 0 +2 1 +0101000 ++57 0 * +Ve +1.0001000025e-07 +200 0 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 5 0 0 200 +2 9 2 0 0 200 +2 10 5 0 0 200 +6 9 2 0 +6 10 5 0 +0 + +0101000 +-55 0 +64 0 * +Ve +1.0001000025e-07 +200 0 200 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 6 0 0 200 +2 11 6 0 0 200 +2 12 2 0 0 200 +6 11 2 0 +6 12 6 0 +0 + +0101000 +-53 0 +55 0 * +Ed + 1.0001000025e-07 1 1 0 +1 7 0 0 200 +2 13 2 0 0 200 +2 14 3 0 0 200 +6 13 2 0 +6 14 3 0 +0 + +0101000 +-53 0 +65 0 * +Wi + +0101000 +-54 0 -52 0 +63 0 +51 0 * +Ve +1.0001000025e-07 +60 0 140 +0 0 + +0101101 +* +Ve +1.0001000025e-07 +140 0 140 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 8 0 30 110 +2 15 2 0 30 110 +2 16 7 1 30 110 +6 15 2 0 +6 16 7 0 +0 + +0101000 ++49 0 -48 0 * +Ve +1.0001000025e-07 +140 0 60 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 9 0 -110 -30 +2 17 2 0 -110 -30 +2 18 8 1 -110 -30 +6 17 2 0 +6 18 8 0 +0 + +0101000 ++48 0 -46 0 * +Ve +1.0001000025e-07 +60 0 60 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 10 0 30 110 +2 19 2 0 30 110 +2 20 9 1 30 110 +6 19 2 0 +6 20 9 0 +0 + +0101000 ++44 0 -46 0 * +Ed + 1.0001000025e-07 1 1 0 +1 11 0 -110 -30 +2 21 2 0 -110 -30 +2 22 10 1 -110 -30 +6 21 2 0 +6 22 10 0 +0 + +0101000 ++49 0 -44 0 * +Wi + +0101000 +-47 0 -45 0 +43 0 +42 0 * +Fa +0 1e-07 2 0 +2 2 +0101000 ++50 0 +41 0 * +Ve +1.0001000025e-07 +200 200 200 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 12 0 0 200 +2 23 4 0 0 200 +2 24 3 0 0 200 +6 23 3 0 +6 24 4 0 +0 + +0101000 +-39 0 +62 0 * +Ed + 1.0001000025e-07 1 1 0 +1 13 0 0 200 +2 25 6 0 0 200 +2 26 3 0 0 200 +6 25 3 0 +6 26 6 0 +0 + +0101000 +-39 0 +53 0 * +Wi + +0101000 +-61 0 -38 0 +37 0 +51 0 * +Fa +0 1e-07 3 0 +2 3 +0101000 ++36 0 * +Ve +1.0001000025e-07 +200 200 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 14 0 0 200 +2 27 4 0 0 200 +2 28 5 0 0 200 +6 27 4 0 +6 28 5 0 +0 + +0101000 +-34 0 +60 0 * +Ed + 1.0001000025e-07 1 1 0 +1 15 0 0 200 +2 29 6 0 0 200 +2 30 4 0 0 200 +6 29 4 0 +6 30 6 0 +0 + +0101000 +-39 0 +34 0 * +Wi + +0101000 +-33 0 -32 0 +38 0 +59 0 * +Fa +0 1e-07 4 0 +2 4 +0101000 ++31 0 * +Ed + 1.0001000025e-07 1 1 0 +1 16 0 0 200 +2 31 6 0 0 200 +2 32 5 0 0 200 +6 31 5 0 +6 32 6 0 +0 + +0101000 +-34 0 +55 0 * +Wi + +0101000 +-58 0 -33 0 +29 0 +54 0 * +Fa +0 1e-07 5 0 +2 5 +0101000 ++28 0 * +Wi + +0101000 +-52 0 -37 0 +32 0 +29 0 * +Fa +0 1e-07 6 0 +2 6 +0101000 ++26 0 * +Ve +1.0001000025e-07 +0 100 80 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 17 0 20 100 +2 33 10 0 20 100 +2 34 7 0 20 100 +6 33 7 2 +6 34 10 2 +0 + +0101000 ++49 2 -24 0 * +Ve +1.0001000025e-07 +80 100 80 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 18 0 0 80 +2 35 11 0 0 80 +2 36 7 0 0 80 +6 35 7 2 +6 36 11 0 +0 + +0101000 +-22 0 +24 0 * +Ed + 1.0001000025e-07 1 1 0 +1 19 0 20 100 +2 37 8 0 20 100 +2 38 7 0 20 100 +6 37 7 2 +6 38 8 2 +0 + +0101000 ++48 2 -22 0 * +Wi + +0101000 +-23 1 -21 1 +20 1 +47 0 * +Fa +0 1e-07 7 1 +2 7 +0101000 ++19 0 * +Ve +1.0001000025e-07 +80 100 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 20 0 0 80 +2 39 8 0 0 80 +2 40 11 0 0 80 +6 39 8 2 +6 40 11 0 +0 + +0101000 +-22 0 +17 0 * +Ed + 1.0001000025e-07 1 1 0 +1 21 0 20 100 +2 41 8 0 20 100 +2 42 9 0 20 100 +6 41 8 2 +6 42 9 2 +0 + +0101000 ++46 2 -17 0 * +Wi + +0101000 +-20 1 +16 1 +15 1 +45 0 * +Fa +0 1e-07 8 1 +2 8 +0101000 ++14 0 * +Ve +1.0001000025e-07 +0 100 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 22 0 20 100 +2 43 10 0 20 100 +2 44 9 0 20 100 +6 43 9 2 +6 44 10 2 +0 + +0101000 ++44 2 -12 0 * +Ed + 1.0001000025e-07 1 1 0 +1 23 0 0 80 +2 45 11 0 0 80 +2 46 9 0 0 80 +6 45 9 2 +6 46 11 0 +0 + +0101000 +-17 0 +12 0 * +Wi + +0101000 +-11 1 -10 1 +15 1 +43 0 * +Fa +0 1e-07 9 1 +2 9 +0101000 ++9 0 * +Ed + 1.0001000025e-07 1 1 0 +1 24 0 0 80 +2 47 10 0 0 80 +2 48 11 0 0 80 +6 47 10 2 +6 48 11 0 +0 + +0101000 +-24 0 +12 0 * +Wi + +0101000 +-23 1 +7 1 +11 1 +42 0 * +Fa +0 1e-07 10 1 +2 10 +0101000 ++6 0 * +Wi + +0101000 +-10 0 -16 0 +21 0 +7 0 * +Fa +0 1e-07 11 0 +2 11 +0101000 ++4 0 * +Sh + +0101100 +-56 0 -40 0 +35 0 +30 0 -27 0 +25 0 -18 0 -13 0 +8 0 +5 0 +-3 1 * +So + +0100000 ++2 0 * + ++1 0 \ No newline at end of file diff --git a/src/XAO/tests/data/Cut_2.brep b/src/XAO/tests/data/Cut_2.brep new file mode 100644 index 000000000..caa95055d --- /dev/null +++ b/src/XAO/tests/data/Cut_2.brep @@ -0,0 +1,806 @@ +DBRep_DrawableShape + +CASCADE Topology V1, (c) Matra-Datavision +Locations 4 +1 + 1 0 0 60 + 0 1 0 60 + 0 0 1 60 +1 + 1 0 0 30 + 0 1 0 30 + 0 0 1 30 +1 + 1 0 0 30 + 0 1 0 130 + 0 0 1 30 +1 + 1 0 0 170 + 0 1 0 130 + 0 0 1 30 +Curve2ds 52 +1 0 0 1 0 +1 0 0 1 0 +1 200 0 0 -1 +1 0 0 0 1 +1 0 -200 1 0 +1 0 0 1 0 +1 0 0 0 -1 +1 0 0 0 1 +1 0 0 0 1 +1 0 0 1 0 +1 0 0 1 0 +1 0 200 1 0 +1 200 0 0 1 +1 0 0 1 0 +1 200 0 0 1 +1 0 200 1 0 +1 200 0 0 -1 +1 200 0 0 1 +1 0 0 0 1 +1 0 200 1 0 +1 0 -200 1 0 +1 0 200 1 0 +1 0 0 0 -1 +1 200 0 0 1 +1 0 0 1 0 +1 0 0 1 0 +1 80 0 0 -1 +1 0 0 0 1 +1 0 -80 1 0 +1 0 0 1 0 +1 0 0 0 -1 +1 0 0 0 1 +1 0 0 0 1 +1 0 0 1 0 +1 0 0 1 0 +1 0 80 1 0 +1 80 0 0 1 +1 0 0 1 0 +1 80 0 0 1 +1 0 80 1 0 +1 80 0 0 -1 +1 80 0 0 1 +1 0 0 0 1 +1 0 80 1 0 +1 0 -80 1 0 +1 0 80 1 0 +1 0 0 0 -1 +1 80 0 0 1 +1 0 1.5707963267948966 1 0 +1 6.2831853071795862 -6.2831853071795862 0 1 +1 0 -6.2831853071795862 0 1 +1 0 -1.5707963267948966 1 0 +Curves 25 +1 0 0 0 0 0 1 +1 0 0 200 -0 1 0 +1 0 200 0 0 0 1 +1 0 0 0 -0 1 0 +1 0 0 0 1 0 -0 +1 200 0 0 0 0 1 +1 0 0 200 1 0 -0 +1 0 200 200 1 0 -0 +1 200 0 200 0 1 0 +1 0 200 0 1 0 -0 +1 200 200 0 0 0 1 +1 200 0 0 -0 1 0 +1 0 0 0 0 0 1 +1 0 0 80 -0 1 0 +1 0 80 0 0 0 1 +1 0 0 0 -0 1 0 +1 0 0 0 1 0 -0 +1 80 0 0 0 0 1 +1 0 0 80 1 0 -0 +1 0 80 80 1 0 -0 +1 80 0 80 0 1 0 +1 0 80 0 1 0 -0 +1 80 80 0 0 0 1 +1 80 0 0 -0 1 0 +2 0 0 0 -2.4492127076447545e-16 -1 0 1 -2.4492127076447545e-16 0 0 0 1 20 +Polygon3D 0 +PolygonOnTriangulations 52 +2 1 2 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 1 2 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 2 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 4 3 +p 0.8000000008 1 0 200 +2 1 4 +p 0.8000000008 1 0 200 +2 1 2 +p 0.3200000008 1 0 80 +2 1 4 +p 0.3200000008 1 0 80 +2 2 3 +p 0.3200000008 1 0 80 +2 1 2 +p 0.3200000008 1 0 80 +2 4 3 +p 0.3200000008 1 0 80 +2 1 4 +p 0.3200000008 1 0 80 +2 1 4 +p 0.3200000008 1 0 80 +2 1 2 +p 0.3200000008 1 0 80 +2 1 2 +p 0.3200000008 1 0 80 +2 1 4 +p 0.3200000008 1 0 80 +2 2 3 +p 0.3200000008 1 0 80 +2 1 2 +p 0.3200000008 1 0 80 +2 4 3 +p 0.3200000008 1 0 80 +2 1 4 +p 0.3200000008 1 0 80 +2 2 3 +p 0.3200000008 1 0 80 +2 4 3 +p 0.3200000008 1 0 80 +2 4 3 +p 0.3200000008 1 0 80 +2 2 3 +p 0.3200000008 1 0 80 +2 1 2 +p 0.3200000008 1 0 80 +2 2 3 +p 0.3200000008 1 0 80 +2 2 3 +p 0.3200000008 1 0 80 +2 4 3 +p 0.3200000008 1 0 80 +2 4 3 +p 0.3200000008 1 0 80 +2 1 4 +p 0.3200000008 1 0 80 +2 1 2 +p 0.1600000008 1 0 6.28318530717959 +19 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 2 +p 0.1600000008 1 4.71238898038469 4.88692190558412 5.06145483078356 5.23598775598299 5.41052068118242 5.58505360638185 5.75958653158129 5.93411945678072 6.10865238198015 6.28318530717958 6.45771823237902 6.63225115757845 6.80678408277788 6.98131700797732 7.15584993317675 7.33038285837618 7.50491578357561 7.67944870877505 7.85398163397448 +19 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 1 +p 0.1600000008 1 4.71238898038469 4.88692190558412 5.06145483078356 5.23598775598299 5.41052068118242 5.58505360638185 5.75958653158129 5.93411945678072 6.10865238198015 6.28318530717958 6.45771823237902 6.63225115757845 6.80678408277788 6.98131700797732 7.15584993317675 7.33038285837618 7.50491578357561 7.67944870877505 7.85398163397448 +2 21 3 +p 0.1600000008 1 0 6.28318530717959 +Surfaces 13 +1 0 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 0 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 200 0 0 1 1 0 -0 -0 1 0 +1 0 200 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 0 0 0 1 1 0 -0 -0 1 0 +1 200 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 0 0 1 0 -0 0 0 1 0 -1 0 +1 0 0 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 80 0 0 1 1 0 -0 -0 1 0 +1 0 80 0 -0 1 0 0 0 1 1 0 -0 +1 0 0 0 0 0 1 1 0 -0 -0 1 0 +1 80 0 0 1 0 -0 0 0 1 0 -1 0 +4 0 0 0 0 0 1 1 0 -0 -0 1 0 20 +Triangulations 13 +4 2 1 0 +0 0 0 0 0 200 0 200 200 0 200 0 0 0 200 0 200 -200 0 -200 2 4 3 2 1 4 +4 2 1 0 +0 0 0 200 0 0 200 0 200 0 0 200 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +0 0 200 0 200 200 200 200 200 200 0 200 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +0 200 0 200 200 0 200 200 200 0 200 200 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +0 0 0 0 200 0 200 200 0 200 0 0 0 0 0 200 200 200 200 0 3 2 1 3 1 4 +4 2 1 0 +200 0 0 200 0 200 200 200 200 200 200 0 0 0 200 0 200 -200 0 -200 2 4 3 2 1 4 +4 2 1 0 +0 0 0 0 0 80 0 80 80 0 80 0 0 0 80 0 80 -80 0 -80 2 4 3 2 1 4 +4 2 1 0 +0 0 0 80 0 0 80 0 80 0 0 80 0 0 0 80 80 80 80 0 3 2 1 3 1 4 +4 2 1 0 +0 0 80 0 80 80 80 80 80 80 0 80 0 0 0 80 80 80 80 0 3 2 1 3 1 4 +4 2 1 0 +0 80 0 80 80 0 80 80 80 0 80 80 0 0 0 80 80 80 80 0 3 2 1 3 1 4 +4 2 1 0 +0 0 0 0 80 0 80 80 0 80 0 0 0 0 0 80 80 80 80 0 3 2 1 3 1 4 +4 2 1 0 +80 0 0 80 0 80 80 80 80 80 80 0 0 0 80 0 80 -80 0 -80 2 4 3 2 1 4 +1269 2498 1 0.142077388474023 +0 0 20 0 0 20 0 0 -20 3.47296355333859 0 -19.6961550602442 6.84040286651336 0 -18.7938524157182 10 0 -17.3205080756888 12.8557521937308 0 -15.3208888623796 15.3208888623795 0 -12.8557521937308 17.3205080756888 0 -10 18.7938524157182 0 -6.8404028665134 19.6961550602442 0 -3.47296355333864 20 0 -3.90798504668055e-14 19.6961550602442 0 3.47296355333857 18.7938524157182 0 6.84040286651333 17.3205080756888 0 9.99999999999996 15.3208888623796 0 12.8557521937307 12.8557521937308 0 15.3208888623795 10.0000000000001 0 17.3205080756887 6.84040286651344 0 18.7938524157181 3.47296355333867 0 19.6961550602442 0 0 -20 3.47296355333859 0 -19.6961550602442 6.84040286651336 0 -18.7938524157182 10 0 -17.3205080756888 12.8557521937308 0 -15.3208888623796 15.3208888623795 0 -12.8557521937308 17.3205080756888 0 -10 18.7938524157182 0 -6.8404028665134 19.6961550602442 0 -3.47296355333864 20 0 -3.90798504668055e-14 19.6961550602442 0 3.47296355333857 18.7938524157182 0 6.84040286651333 17.3205080756888 0 9.99999999999996 15.3208888623796 0 12.8557521937307 12.8557521937308 0 15.3208888623795 10.0000000000001 0 17.3205080756887 6.84040286651344 0 18.7938524157181 3.47296355333867 0 19.6961550602442 -3.79596373592631 -3.51931506953338 19.3185165257814 -5.81582773240365 -3.60100807597109 18.7938524157182 -4.12226369414893 -5.4587593290148 18.7938524157182 -1.16774797156393 -8.37131069412672 18.126155740733 -1.87196510174769 -6.57927488664542 18.7938524157182 -3.47891673963849 -7.70322116918339 18.126155740733 -2.8173255684143 -9.59492973614496 17.3205080756888 0.631152750561256 -6.81122291381389 18.7938524157182 0 -10 17.3205080756888 11.4746154349567 -8.26638981780154 14.142135623731 9.50518847306819 -10.4714560635783 14.142135623731 11.3856392797916 -10.2516756544407 12.8557521937308 13.2682789633788 -7.66044443118976 12.8557521937308 9.62266869283167 -8.52494056839173 15.3208888623796 11.3832032442434 -5.97436593847924 15.3208888623796 5.16300462641956 -10.2439911441994 16.3830408857798 5.40640817455596 -8.41253532831182 17.3205080756888 2.81732556841428 -9.59492973614498 17.3205080756888 4.55871255450469 -12.0203371130769 15.3208888623796 7.30289961397014 -10.5800766393674 15.3208888623796 -2.65069489984651 -4.44620465015275 19.3185165257814 1.58799963384621 -8.30185131314674 18.126155740733 3.04902992656878 -6.12327754418271 18.7938524157182 7.65407558581094 -8.54465319726663 16.3830408857798 7.55749574354257 -6.54860733945286 17.3205080756888 3.08642209815429 -7.8687023513866 18.126155740733 9.47653141601432 -6.46462092130388 16.3830408857798 9.09631995354516 -4.15415013001888 17.3205080756888 -0.347590236203445 -5.16469750041648 19.3185165257814 5.45419786899274 -6.45710489837101 18.126155740733 5.05511871573512 -4.60834961195749 18.7938524157182 10.8337169012376 -3.77180983596793 16.3830408857798 12.4821873993599 -3.07658287615895 15.3208888623796 1.54158568793127 -4.94150106848898 19.3185165257814 0.4942542464224 -3.43761379196555 19.6961550602442 7.05244120481311 -4.65892166872834 18.126155740733 6.37848571096166 -2.47103852889067 18.7938524157182 2.87132236645479 -4.30702067687267 19.3185165257814 8.17648051001299 -2.14187873888081 18.126155740733 9.89821441880932 -1.42314838273288 17.3205080756888 0.491092204954242 -1.67250645553062 19.9238939618349 0 -1.74311485495315 19.9238939618349 4.51158325826313 -2.53782106281589 19.3185165257814 2.27430746150455 -2.62469072718351 19.6961550602442 1.31735830968145 -1.14149747326556 19.9238939618349 0.942399040100867 -1.46640152985987 19.9238939618349 5.12369280819249 -0.736675810916239 19.3185165257814 3.33228412704761 -0.978446901699186 19.6961550602442 1.72537245909382 -0.248071108674424 19.9238939618349 1.58559304364314 -0.724116080134138 19.9238939618349 0.852450953192402 0.185439354108723 -19.9809644316372 1.58559304364314 0.724116080134138 -19.9238939618349 1.72537245909382 0.248071108674424 -19.9238939618349 0.817383459932188 0.304868268404846 -19.9809644316372 0.765676396567017 0.418090943923744 -19.9809644316372 1.31735830968142 1.14149747326556 -19.9238939618349 0.698382369796121 0.522802493499057 -19.9809644316372 0.616871291944648 0.616871291944648 -19.9809644316372 0.942399040100867 1.46640152985987 -19.9238939618349 2.84022944170539 1.99864267974249 -19.6961550602442 3.33228412704764 0.978446901699186 -19.6961550602442 2.27430746150455 2.62469072718352 -19.6961550602442 4.51158325826316 2.53782106281591 -19.3185165257814 0.912284573607479 2.44592959811686 -19.8288972274762 0.491092204954242 1.67250645553062 -19.9238939618349 0.4942542464224 3.43761379196556 -19.6961550602442 2.10640970963124 3.78172985918366 -19.5259201423987 1.54158568793127 4.94150106848898 -19.3185165257814 2.87132236645479 4.30702067687267 -19.3185165257814 10.5955713020053 1.79170768709096 -16.8678289162577 9.89821441880932 1.42314838273285 -17.3205080756888 9.09631995354519 4.15415013001888 -17.3205080756888 10.8337169012376 3.7718098359679 -16.3830408857798 12.0048014678786 2.03000805326354 -15.8670668058247 12.4821873993599 3.07658287615891 -15.3208888623796 -0.554906756870054 2.55086519309944 -19.8288972274762 0 1.74311485495315 -19.9238939618349 -1.25109090723774 2.29120192999511 -19.8288972274762 -1.44272119966524 3.1591187668169 -19.6961550602442 -0.58144828910477 1.00709797870343 -19.9661631654254 -1.06172804718017 4.19656718598679 -19.5259201423987 -2.65069489984651 4.44620465015277 -19.3185165257814 -0.347590236203445 5.16469750041648 -19.3185165257814 -1.87196510174769 6.57927488664544 -18.7938524157182 12.2649504895489 5.66920108475469 -14.7455467362025 11.3832032442434 5.9743659384792 -15.3208888623796 11.4746154349567 8.26638981780152 -14.1421356237309 -1.84591911282516 1.84591911282513 -19.8288972274762 -0.616871291944648 0.616871291944648 -19.9809644316372 -2.92164285864004 1.87762585447049 -19.6961550602442 -3.79596373592631 3.51931506953338 -19.3185165257814 13.061993761449 5.42073048360339 -14.1421356237309 -2.53556700510691 3.50846726581327 -19.5259201423987 13.1518330294278 6.66786596412842 -13.5118041523132 13.2682789633788 7.66044443118977 -12.8557521937308 14.5710311879999 4.73441502740513 -12.8557521937308 3.52628264813382 11.6533909942543 -15.8670668058247 1.5495896916174 12.7620192859221 -15.3208888623796 4.55871255450475 12.0203371130769 -15.3208888623796 5.16300462641959 10.2439911441994 -16.3830408857798 4.32872726117355 12.5715367983921 -14.9405014248199 6.92256871208107 12.3319926381147 -14.1421356237309 7.30289961397017 10.5800766393674 -15.3208888623796 12.2594171017763 10.0732567397629 -12.1752285801744 11.3856392797916 10.2516756544407 -12.8557521937308 9.00539252531871 12.3948594585949 -12.8557521937308 10.7874241034615 12.3302680375242 -11.4715287270209 4.20124747160969 12.8420547862389 -14.7455467362025 13.0527247905418 9.90103046190191 -11.4715287270209 -4.25170811547062 0.813277746843823 -19.5259201423987 -3.47296355333862 0 -19.6961550602442 -5.15429937369251 0.477616173789357 -19.3185165257814 -4.81095400713309 1.91040330411209 -19.3185165257814 3.91634851781347 13.5890475857221 -14.1421356237309 5.20106686268997 13.7978278014824 -13.5118041523132 3.18539190820832 14.9860906818458 -12.8557521937308 6.23156690482168 13.996328427274 -12.8557521937308 12.7741080007605 11.0157077454445 -10.7459921669365 10.046880386587 14.1088693557497 -10 12.5354412516497 11.9525190912393 -10 14.5709386091042 9.36417364478666 -10 -3.52628264813382 11.6533909942543 -15.8670668058247 -5.16300462641959 10.2439911441994 -16.3830408857798 -4.55871255450472 12.0203371130769 -15.3208888623796 -1.5495896916174 12.7620192859221 -15.3208888623796 -7.1487161413684 4.50980438520688 -18.126155740733 -5.81582773240365 3.60100807597109 -18.7938524157182 -8.05819323213368 2.55107818309969 -18.126155740733 -9.09631995354519 4.15415013001888 -17.3205080756888 -5.7725716668468 6.17413106548685 -18.126155740733 -7.49624781663553 5.39360560306164 -17.7402166635644 -7.55749574354257 6.54860733945284 -17.3205080756888 -4.25170811547062 -0.813277746843823 -19.5259201423987 -4.81095400713309 -1.91040330411209 -19.3185165257814 -5.15429937369251 -0.477616173789357 -19.3185165257814 -2.92164285864004 -1.87762585447049 -19.6961550602442 -4.32872726117355 12.5715367983921 -14.9405014248199 -7.30289961397017 10.5800766393674 -15.3208888623796 -6.92256871208107 12.3319926381147 -14.1421356237309 -4.20124747160969 12.8420547862389 -14.7455467362025 2.59398768458934 15.6535950156091 -12.1752285801744 0 15.3208888623795 -12.8557521937308 5.28461330423653 15.5073173337563 -11.4715287270209 -3.91634851781347 13.5890475857221 -14.1421356237309 -1.84591911282513 -1.84591911282516 -19.8288972274762 -3.79596373592631 -3.51931506953338 -19.3185165257814 2.04818150837974 16.2545064881671 -11.4715287270209 3.15282874783972 16.5705559120669 -10.7459921669365 4.08346454640682 16.8322701171957 -10 7.19519908746153 15.7552883214428 -10 0.824142957281879 17.3008898148611 -10 -5.20106686268997 13.7978278014824 -13.5118041523132 -6.23156690482168 13.996328427274 -12.8557521937308 -3.18539190820832 14.9860906818459 -12.8557521937308 -2.53556700510691 -3.50846726581327 -19.5259201423987 -2.65069489984651 -4.44620465015275 -19.3185165257814 -1.44272119966524 -3.15911876681692 -19.6961550602442 -1.25109090723774 -2.29120192999513 -19.8288972274762 1.72233735598036 17.6564107706635 -9.23497226470068 2.5226733029229 17.9497532390846 -8.45236523481399 -0.788599466010936 18.1089931475915 -8.45236523481399 -0.554906756870054 -2.55086519309945 -19.8288972274762 0 -1.74311485495315 -19.9238939618349 0.4942542464224 -3.43761379196555 -19.6961550602442 -12.2649504895489 5.66920108475469 -14.7455467362025 -11.4746154349567 8.26638981780152 -14.1421356237309 -11.3832032442434 5.97436593847922 -15.3208888623796 -12.4821873993599 3.07658287615891 -15.3208888623796 -12.0048014678786 2.03000805326357 -15.8670668058247 -12.8557521937308 0 -15.3208888623796 -10.8337169012376 3.7718098359679 -16.3830408857798 -7.1487161413684 -4.50980438520686 -18.126155740733 -9.09631995354519 -4.15415013001886 -17.3205080756888 -8.05819323213368 -2.55107818309969 -18.126155740733 -5.81582773240365 -3.60100807597109 -18.7938524157182 -5.7725716668468 -6.17413106548683 -18.126155740733 1.66883222252557 18.402074753961 -7.65366864730179 0.843183000263821 18.7749282569032 -6.84040286651337 4.18202559218275 18.3226512975094 -6.84040286651337 -3.32181515980469 17.4264405807469 -9.23497226470068 -2.46496530560279 17.1442102775886 -10 -5.66498329993848 16.3678943120799 -10 -13.061993761449 5.42073048360339 -14.1421356237309 -1.06172804718017 -4.19656718598678 -19.5259201423987 -1.87196510174772 -6.57927488664542 -18.7938524157182 -0.347590236203445 -5.16469750041649 -19.3185165257814 -13.1518330294278 6.66786596412845 -13.5118041523132 -13.2682789633788 7.66044443118977 -12.8557521937308 -14.5710311879999 4.73441502740513 -12.8557521937308 -7.49624781663553 -5.39360560306163 -17.7402166635644 -7.5574957435426 -6.54860733945284 -17.3205080756888 -4.13752340520642 17.6476180264838 -8.45236523481399 -12.0048014678787 -2.03000805326354 -15.8670668058247 -12.4821873993599 -3.07658287615889 -15.3208888623796 -10.8337169012376 -3.77180983596789 -16.3830408857798 -3.28693763617878 18.1828874828279 -7.65366864730179 -5.80761978623158 17.8740158062582 -6.84040286651337 -2.52276018705689 18.6237635740576 -6.84040286651337 0.912284573607479 -2.44592959811686 -19.8288972274762 0.942399040100867 -1.46640152985987 -19.9238939618349 2.27430746150455 -2.62469072718351 -19.6961550602442 0.491092204954242 -1.67250645553062 -19.9238939618349 -14.8534047863656 5.58033827584623 -12.1752285801744 -15.2369594301404 1.60146896867906 -12.8557521937308 -16.072037407698 3.1770492962321 -11.4715287270209 0.616871291944648 -0.616871291944648 -19.9809644316372 1.31735830968145 -1.14149747326556 -19.9238939618349 -15.1009062989215 6.35347602626516 -11.4715287270209 0.698382369796121 -0.522802493499057 -19.9809644316372 -12.2649504895489 -5.66920108475466 -14.7455467362025 -11.3832032442434 -5.9743659384792 -15.3208888623796 -11.4746154349567 -8.26638981780151 -14.1421356237309 -15.9269367486002 5.55484816662238 -10.7459921669365 -16.6189057980565 4.87975102595641 -10 -15.3950815663861 7.93671617007439 -10 -17.2420794740486 1.6464189656931 -10 2.10640970963124 -3.78172985918366 -19.5259201423987 1.54158568793127 -4.94150106848899 -19.3185165257814 2.87132236645479 -4.30702067687268 -19.3185165257814 -13.061993761449 -5.42073048360336 -14.1421356237309 0.765676396567017 -0.418090943923744 -19.9809644316372 1.58559304364314 -0.724116080134138 -19.9238939618349 0.817383459932188 -0.304868268404846 -19.9809644316372 1.72537245909382 -0.248071108674424 -19.9238939618349 -13.1518330294278 -6.66786596412842 -13.5118041523132 -13.2682789633788 -7.66044443118976 -12.8557521937308 -14.5710311879999 -4.73441502740512 -12.8557521937308 2.84022944170539 -1.99864267974249 -19.6961550602442 4.51158325826313 -2.53782106281591 -19.3185165257814 3.33228412704764 -0.978446901699186 -19.6961550602442 0.852450953192402 -0.185439354108723 -19.9809644316372 -14.8534047863656 -5.58033827584623 -12.1752285801744 -15.2369594301404 -1.60146896867903 -12.8557521937308 -16.072037407698 -3.17704929623211 -11.4715287270209 -3.52628264813384 -11.6533909942543 -15.8670668058247 -1.54958969161743 -12.7620192859221 -15.3208888623796 -4.55871255450475 -12.0203371130769 -15.3208888623796 -5.16300462641959 -10.2439911441994 -16.3830408857798 -15.1009062989215 -6.35347602626514 -11.4715287270209 -15.9269367486002 -5.55484816662238 -10.7459921669365 -16.6189057980565 -4.87975102595645 -10 -17.2420794740486 -1.64641896569313 -10 -15.395081566386 -7.9367161700744 -10 -4.32872726117358 -12.5715367983921 -14.9405014248199 -6.92256871208107 -12.3319926381147 -14.1421356237309 -7.3028996139702 -10.5800766393674 -15.3208888623796 -4.20124747160972 -12.8420547862389 -14.7455467362025 -3.91634851781347 -13.5890475857221 -14.1421356237309 -5.20106686268997 -13.7978278014824 -13.5118041523132 -3.18539190820832 -14.9860906818459 -12.8557521937308 -6.23156690482168 -13.996328427274 -12.8557521937308 3.52628264813379 -11.6533909942543 -15.8670668058247 4.55871255450469 -12.0203371130769 -15.3208888623796 1.54958969161737 -12.7620192859221 -15.3208888623796 5.16300462641956 -10.2439911441994 -16.3830408857798 12.7741080007605 11.0157077454445 10.7459921669365 10.046880386587 14.1088693557497 10 10.7874241034615 12.3302680375242 11.4715287270209 12.5354412516497 11.9525190912393 10 14.5709386091042 9.36417364478666 10 13.0527247905418 9.90103046190191 11.4715287270209 4.32872726117353 -12.5715367983921 -14.9405014248199 7.30289961397014 -10.5800766393674 -15.3208888623796 6.92256871208104 -12.3319926381148 -14.1421356237309 4.20124747160969 -12.8420547862389 -14.7455467362025 3.91634851781345 -13.5890475857221 -14.1421356237309 12.2594171017763 10.0732567397629 12.1752285801744 11.3856392797916 10.2516756544407 12.8557521937308 13.2682789633788 7.66044443118977 12.8557521937308 9.00539252531871 12.3948594585949 12.8557521937308 18.7181938911956 1.68466794217809 -6.84040286651337 1.66883222252557 18.402074753961 7.6536686473018 4.18202559218275 18.3226512975094 6.84040286651338 0.843183000263821 18.7749282569032 6.84040286651338 13.1518330294278 6.66786596412842 13.5118041523132 14.5710311879999 4.73441502740513 12.8557521937308 11.4746154349567 8.26638981780152 14.142135623731 2.5226733029229 17.9497532390846 8.452365234814 -0.788599466010936 18.1089931475915 8.45236523481399 13.061993761449 5.42073048360339 14.142135623731 5.20106686268994 -13.7978278014824 -13.5118041523132 6.23156690482168 -13.996328427274 -12.8557521937308 3.18539190820832 -14.9860906818459 -12.8557521937308 2.59398768458934 -15.6535950156091 -12.1752285801744 5.28461330423656 -15.5073173337563 -11.4715287270209 0 -15.3208888623796 -12.8557521937308 1.72233735598036 17.6564107706635 9.23497226470069 0.824142957281879 17.3008898148611 10 4.08346454640682 16.8322701171957 10 12.0048014678787 2.03000805326354 15.8670668058247 12.4821873993599 3.07658287615891 15.3208888623796 10.8337169012376 3.7718098359679 16.3830408857798 12.2649504895489 5.66920108475469 14.7455467362025 11.3832032442434 5.9743659384792 15.3208888623796 -3.28693763617878 18.1828874828279 7.6536686473018 -2.52276018705689 18.6237635740576 6.84040286651338 -5.80761978623158 17.8740158062582 6.84040286651338 2.04818150837974 -16.2545064881671 -11.4715287270209 -3.32181515980466 -17.4264405807469 -9.23497226470068 -5.66498329993846 -16.3678943120799 -10 -2.46496530560276 -17.1442102775886 -10 3.15282874783972 16.5705559120669 10.7459921669365 7.19519908746153 15.7552883214428 10 5.28461330423653 15.5073173337563 11.4715287270209 10.5955713020053 -1.79170768709099 -16.8678289162577 10.8337169012376 -3.77180983596793 -16.3830408857798 9.09631995354519 -4.15415013001888 -17.3205080756888 9.89821441880932 -1.42314838273288 -17.3205080756888 -4.13752340520642 17.6476180264838 8.452365234814 -4.13752340520642 -17.6476180264838 -8.45236523481399 -0.788599466010908 -18.1089931475915 -8.45236523481399 10.5955713020054 1.79170768709096 16.8678289162577 9.09631995354519 4.15415013001888 17.3205080756888 9.89821441880932 1.42314838273285 17.3205080756888 3.15282874783975 -16.5705559120669 -10.7459921669365 7.19519908746156 -15.7552883214428 -10 4.08346454640684 -16.8322701171957 -10 0.824142957281907 -17.3008898148611 -10 -3.32181515980469 17.4264405807469 9.23497226470069 -5.66498329993848 16.3678943120799 10 -2.46496530560279 17.1442102775886 10 2.04818150837974 16.2545064881671 11.4715287270209 -3.28693763617878 -18.1828874828279 -7.65366864730179 -2.52276018705689 -18.6237635740576 -6.84040286651337 -5.80761978623158 -17.8740158062582 -6.84040286651337 12.2649504895489 -5.6692010847547 -14.7455467362025 11.4746154349567 -8.26638981780154 -14.1421356237309 11.3832032442434 -5.97436593847925 -15.3208888623796 12.4821873993599 -3.07658287615895 -15.3208888623796 12.0048014678786 -2.03000805326357 -15.8670668058247 1.72233735598039 -17.6564107706635 -9.23497226470068 2.59398768458934 15.6535950156091 12.1752285801744 0 15.3208888623795 12.8557521937308 3.18539190820832 14.9860906818458 12.8557521937308 6.23156690482168 13.996328427274 12.8557521937308 19.3969262078591 3.42020143325669 -3.4729635533386 18.1165757381514 4.9998572127233 -6.84040286651337 5.20106686268997 13.7978278014824 13.5118041523132 6.92256871208107 12.3319926381147 14.142135623731 13.061993761449 -5.42073048360339 -14.1421356237309 2.52267330292293 -17.9497532390846 -8.45236523481399 13.1518330294278 -6.66786596412844 -13.5118041523132 14.5710311879999 -4.73441502740512 -12.8557521937308 13.2682789633788 -7.66044443118976 -12.8557521937308 1.66883222252557 -18.402074753961 -7.65366864730179 4.18202559218275 -18.3226512975094 -6.84040286651337 0.843183000263821 -18.7749282569032 -6.84040286651337 12.2594171017763 -10.0732567397629 -12.1752285801744 11.3856392797916 -10.2516756544407 -12.8557521937308 9.00539252531871 -12.3948594585949 -12.8557521937308 10.7874241034615 -12.3302680375242 -11.4715287270209 3.91634851781347 13.5890475857221 14.142135623731 4.20124747160969 12.8420547862389 14.7455467362025 4.32872726117355 12.5715367983921 14.9405014248199 4.55871255450472 12.0203371130769 15.3208888623796 7.30289961397017 10.5800766393674 15.3208888623796 18.5083315679665 6.73648177666931 -3.4729635533386 16.9326759345147 8.15434695855535 -6.84040286651337 1.5495896916174 12.7620192859221 15.3208888623796 13.0527247905418 -9.90103046190188 -11.4715287270209 12.7741080007605 -11.0157077454445 -10.7459921669365 14.5709386091042 -9.36417364478662 -10 12.5354412516498 -11.9525190912392 -10 10.046880386587 -14.1088693557497 -10 3.52628264813382 11.6533909942542 15.8670668058247 5.16300462641959 10.2439911441994 16.3830408857798 -5.20106686268997 13.7978278014824 13.5118041523132 -3.18539190820832 14.9860906818458 12.8557521937308 -6.23156690482168 13.996328427274 12.8557521937308 -6.92256871208107 12.3319926381147 14.142135623731 -3.91634851781347 13.5890475857221 14.142135623731 -4.20124747160969 12.8420547862389 14.7455467362025 -1.5495896916174 12.7620192859221 15.3208888623796 -4.32872726117355 12.5715367983921 14.9405014248199 -7.30289961397017 10.5800766393674 15.3208888623796 -4.55871255450472 12.0203371130769 15.3208888623796 -15.9269367486002 5.55484816662238 10.7459921669365 -16.6189057980565 4.87975102595641 10 -17.2420794740486 1.6464189656931 10 -15.3950815663861 7.93671617007439 10 17.0573706390489 9.84807753012208 -3.4729635533386 -16.072037407698 3.1770492962321 11.4715287270209 -15.1009062989215 6.35347602626516 11.4715287270209 15.2045459940907 11.0467492837204 -6.84040286651337 -3.52628264813382 11.6533909942542 15.8670668058247 -5.16300462641956 10.2439911441994 16.3830408857798 -14.8534047863656 5.58033827584623 12.1752285801744 -14.5710311879999 4.73441502740513 12.8557521937308 -13.2682789633788 7.66044443118977 12.8557521937308 -15.2369594301404 1.60146896867906 12.8557521937308 0.852450953192402 0.185439354108723 19.9809644316372 1.72537245909382 0.248071108674424 19.9238939618349 2.84022944170539 1.99864267974249 19.6961550602442 4.51158325826313 2.53782106281588 19.3185165257814 2.27430746150455 2.62469072718349 19.6961550602442 1.58559304364314 0.724116080134138 19.9238939618349 3.33228412704761 0.978446901699186 19.6961550602442 1.31735830968142 1.14149747326556 19.9238939618349 19.9279497708505 1.69611848951018 3.5527136788005e-15 -13.1518330294278 6.66786596412845 13.5118041523132 -11.4746154349567 8.26638981780152 14.142135623731 0.817383459932188 0.304868268404846 19.9809644316372 0.765676396567017 0.418090943923744 19.9809644316372 -13.061993761449 5.42073048360339 14.142135623731 2.10640970963124 3.78172985918366 19.5259201423987 1.54158568793127 4.94150106848898 19.3185165257814 0.4942542464224 3.43761379196553 19.6961550602442 2.87132236645479 4.30702067687267 19.3185165257814 -15.9269367486002 -5.55484816662238 10.7459921669365 -17.2420794740485 -1.64641896569313 10 -16.6189057980565 -4.87975102595645 10 -16.072037407698 -3.17704929623211 11.4715287270209 -15.395081566386 -7.9367161700744 10 -12.2649504895489 5.66920108475469 14.7455467362025 -12.4821873993599 3.07658287615891 15.3208888623796 -11.3832032442434 5.97436593847922 15.3208888623796 0.698382369796121 0.522802493499057 19.9809644316372 15.0881301347098 12.6604444311898 -3.4729635533386 12.9877294350744 13.5840999976111 -6.84040286651337 -15.1009062989215 -6.35347602626516 11.4715287270209 19.35465893867 5.03956122770251 3.5527136788005e-15 0.616871291944648 0.616871291944648 19.9809644316372 0.942399040100867 1.46640152985987 19.9238939618349 -14.8534047863656 -5.58033827584623 12.1752285801744 -14.5710311879999 -4.73441502740512 12.8557521937308 -15.2369594301404 -1.60146896867903 12.8557521937308 -13.2682789633788 -7.66044443118976 12.8557521937308 0.912284573607479 2.44592959811686 19.8288972274762 0.491092204954242 1.67250645553062 19.9238939618349 -3.28693763617878 -18.1828874828279 7.6536686473018 -5.80761978623158 -17.8740158062582 6.84040286651338 -2.52276018705689 -18.6237635740576 6.84040286651338 -12.0048014678786 2.03000805326357 15.8670668058247 -10.8337169012376 3.7718098359679 16.3830408857798 -12.8557521937308 0 15.3208888623796 -4.13752340520642 -17.6476180264838 8.452365234814 -0.788599466010908 -18.1089931475915 8.45236523481399 -7.4962478166355 5.39360560306164 17.7402166635644 -7.55749574354257 6.54860733945284 17.3205080756888 -9.09631995354519 4.15415013001888 17.3205080756888 -5.7725716668468 6.17413106548685 18.126155740733 -13.1518330294278 -6.66786596412842 13.5118041523132 -11.4746154349567 -8.26638981780151 14.142135623731 12.6604444311898 15.0881301347098 -3.4729635533386 10.3534765656754 15.6848465605439 -6.84040286651337 -1.06172804718017 4.19656718598677 19.5259201423987 -2.65069489984651 4.44620465015274 19.3185165257814 -1.44272119966524 3.1591187668169 19.6961550602442 -0.347590236203445 5.16469750041648 19.3185165257814 -1.87196510174769 6.57927488664541 18.7938524157182 -13.061993761449 -5.42073048360335 14.142135623731 -3.32181515980466 -17.4264405807469 9.23497226470069 -2.46496530560276 -17.1442102775886 10 -5.66498329993846 -16.3678943120799 10 1.66883222252557 -18.402074753961 7.6536686473018 0.843183000263821 -18.7749282569032 6.84040286651338 4.18202559218273 -18.3226512975094 6.84040286651338 18.2245698077627 8.23802496487986 3.5527136788005e-15 -7.1487161413684 4.50980438520685 18.126155740733 -8.05819323213368 2.55107818309969 18.126155740733 -5.81582773240365 3.60100807597109 18.7938524157182 -12.0048014678786 -2.03000805326354 15.8670668058247 -12.4821873993599 -3.07658287615889 15.3208888623796 -10.8337169012376 -3.77180983596789 16.3830408857798 -12.2649504895489 -5.66920108475466 14.7455467362025 -11.3832032442434 -5.9743659384792 15.3208888623796 -0.554906756870054 2.55086519309944 19.8288972274762 0 1.74311485495315 19.9238939618349 2.52267330292293 -17.9497532390846 8.452365234814 1.72233735598039 -17.6564107706635 9.23497226470069 4.08346454640684 -16.8322701171957 10 0.824142957281907 -17.300889814861 10 -2.53556700510691 3.50846726581327 19.5259201423987 -3.79596373592631 3.51931506953338 19.3185165257814 -1.25109090723774 2.29120192999511 19.8288972274762 -5.20106686268997 -13.7978278014824 13.5118041523132 -6.23156690482168 -13.996328427274 12.8557521937308 -3.18539190820832 -14.9860906818459 12.8557521937308 -6.92256871208107 -12.3319926381147 14.142135623731 9.84807753012208 17.0573706390489 -3.4729635533386 7.38645444058682 17.281469249486 -6.84040286651337 3.15282874783975 -16.5705559120669 10.7459921669365 7.19519908746156 -15.7552883214428 10 16.5701929848769 11.1994957227519 3.5527136788005e-15 5.28461330423656 -15.5073173337563 11.4715287270209 -0.58144828910477 1.00709797870343 19.9661631654254 2.04818150837974 -16.2545064881671 11.4715287270209 -1.84591911282516 1.84591911282513 19.8288972274762 -2.92164285864004 1.87762585447047 19.6961550602442 -3.9163485178135 -13.5890475857221 14.142135623731 6.73648177666931 18.5083315679665 -3.4729635533386 2.59398768458934 -15.6535950156091 12.1752285801744 6.23156690482168 -13.996328427274 12.8557521937308 3.18539190820832 -14.9860906818459 12.8557521937308 0 -15.3208888623796 12.8557521937308 -4.20124747160972 -12.8420547862389 14.7455467362025 19.3969262078591 3.42020143325669 3.47296355333861 -4.32872726117358 -12.5715367983921 14.9405014248199 -7.3028996139702 -10.5800766393674 15.3208888623796 -4.55871255450475 -12.0203371130769 15.3208888623796 -1.54958969161743 -12.7620192859221 15.3208888623796 -0.616871291944648 0.616871291944648 19.9809644316372 -4.25170811547062 0.813277746843823 19.5259201423987 -4.81095400713306 1.91040330411209 19.3185165257814 -5.15429937369251 0.477616173789357 19.3185165257814 -3.47296355333862 0 19.6961550602442 -7.49624781663553 -5.39360560306163 17.7402166635644 -7.55749574354257 -6.54860733945284 17.3205080756888 -5.7725716668468 -6.17413106548683 18.126155740733 -9.09631995354519 -4.15415013001885 17.3205080756888 -7.1487161413684 -4.50980438520685 18.126155740733 -8.05819323213368 -2.55107818309969 18.126155740733 -3.52628264813384 -11.6533909942542 15.8670668058247 -5.16300462641959 -10.2439911441994 16.3830408857798 12.7741080007605 -11.0157077454445 10.7459921669365 12.5354412516497 -11.9525190912392 10 14.5709386091042 -9.36417364478662 10 10.046880386587 -14.1088693557497 10 10.7874241034615 -12.3302680375242 11.4715287270209 14.4391218790905 13.8387773795509 3.5527136788005e-15 5.20106686268994 -13.7978278014824 13.5118041523132 6.92256871208104 -12.3319926381148 14.142135623731 3.91634851781347 -13.5890475857221 14.142135623731 -4.25170811547062 -0.813277746843823 19.5259201423987 -5.15429937369251 -0.477616173789357 19.3185165257814 -4.81095400713306 -1.91040330411209 19.3185165257814 -2.92164285864004 -1.87762585447049 19.6961550602442 13.0527247905418 -9.90103046190188 11.4715287270209 4.20124747160966 -12.8420547862389 14.7455467362025 1.54958969161737 -12.7620192859221 15.3208888623796 3.42020143325669 19.3969262078591 -3.4729635533386 12.2594171017763 -10.0732567397629 12.1752285801744 9.00539252531871 -12.3948594585949 12.8557521937308 18.5083315679665 6.73648177666931 3.47296355333861 4.32872726117353 -12.5715367983921 14.9405014248199 3.52628264813379 -11.6533909942543 15.8670668058247 13.1518330294278 -6.66786596412844 13.5118041523132 14.5710311879999 -4.73441502740512 12.8557521937308 11.8926635260857 16.0799426073388 3.5527136788005e-15 -2.53556700510691 -3.50846726581327 19.5259201423987 -1.44272119966524 -3.15911876681692 19.6961550602442 13.061993761449 -5.42073048360339 14.142135623731 -1.84591911282513 -1.84591911282516 19.8288972274762 12.2649504895489 -5.6692010847547 14.7455467362025 -1.06172804718017 -4.19656718598678 19.5259201423987 -1.25109090723774 -2.29120192999513 19.8288972274762 -0.554906756870054 -2.55086519309945 19.8288972274762 12.0048014678787 -2.03000805326357 15.8670668058247 0 19.6961550602442 -3.4729635533386 10.5955713020054 -1.79170768709099 16.8678289162577 2.10640970963124 -3.78172985918366 19.5259201423987 17.0573706390489 9.84807753012208 3.47296355333861 0.912284573607479 -2.44592959811686 19.8288972274762 2.84022944170536 -1.99864267974249 19.6961550602442 0.616871291944648 -0.616871291944648 19.9809644316372 9.00407489635347 17.8585171629914 3.5527136788005e-15 0.698382369796121 -0.522802493499057 19.9809644316372 0.765676396567017 -0.418090943923744 19.9809644316372 0.817383459932188 -0.304868268404846 19.9809644316372 18.7181938911956 1.68466794217809 6.84040286651338 0.852450953192402 -0.185439354108723 19.9809644316372 0.403086515750346 0.166963901633522 -19.9952405415982 0.166963901633522 0.403086515750346 -19.9952405415982 0.50057387962417 1.20849224915838 -19.9571784647721 -3.42020143325669 19.3969262078591 -3.4729635533386 0.132832468952387 1.00896277234861 -19.9740919608178 0 0.872387747306732 -19.9809644316372 12.9991514920694 2.79347054059684 -14.9405014248199 15.0881301347098 12.6604444311898 3.47296355333861 13.2512931227051 2.64047003895456 -14.7455467362025 13.947662107169 2.33724661605098 -14.142135623731 15.2369594301404 1.60146896867903 -12.8557521937308 14.2906206106603 3.63446159860058 -13.5118041523132 5.85645542553101 19.123334694785 3.5527136788005e-15 -1.20849224915838 0.50057387962417 -19.9571784647721 1.6266086701863 10.991699493757 -16.6293922460509 2.8173255684143 9.59492973614496 -17.3205080756888 0 10 -17.3205080756888 14.062617597822 7.3489179691932 -12.1752285801744 -2.50477928615589 0.735469557378622 -19.8288972274762 18.1165757381514 4.9998572127233 6.84040286651338 -1.74311485495315 0 -19.9238939618349 14.7665125035067 7.09606490591196 -11.4715287270209 -1.6266086701863 10.991699493757 -16.6293922460509 -2.8173255684143 9.59492973614496 -17.3205080756888 14.6810109754047 8.30611636615984 -10.7459921669365 16.0798042810154 6.43738256469501 -10 -2.50477928615589 -0.735469557378622 -19.8288972274762 -2.01159754888394 -0.833230986784201 -19.8811267644464 -6.73648177666931 18.5083315679665 -3.4729635533386 -8.9058177069513 16.5497824636564 -6.84040286651337 2.06198506870533 14.6006632084288 -13.5118041523132 12.6604444311898 15.0881301347098 3.47296355333861 2.54035639493759 19.8380087051775 3.5527136788005e-15 -1.23256833432438 -1.23256833432438 -19.9238939618349 -2.06198506870533 14.6006632084288 -13.5118041523132 -0.666959147261736 15.8530430680166 -12.1752285801744 -0.50057387962417 -1.20849224915838 -19.9571784647721 -0.616871291944648 -0.616871291944648 -19.9809644316372 -0.166963901633522 -0.403086515750346 -19.9952405415982 16.9326759345147 8.15434695855535 6.84040286651338 -1.23788377633036 16.3362074062933 -11.4715287270209 4.97098275646971 17.0295219458765 -9.23497226470068 -0.147197707818208 16.8671866410185 -10.7459921669365 -0.833230986784201 -2.01159754888396 -19.8811267644464 5.77034213074995 17.1831508644777 -8.45236523481399 -9.84807753012208 17.0573706390489 -3.4729635533386 -11.7177753188384 14.6936254954663 -6.84040286651337 0 -0.581694374862224 -19.991539001644 9.84807753012208 17.0573706390489 3.47296355333861 4.96011503378116 17.7993992901156 -7.65366864730179 -0.807962798211804 17.7218081297286 -9.23497226470068 -0.848824063922962 19.9819793240936 3.5527136788005e-15 -11.1105562496361 -0.137307503997221 -16.6293922460509 -9.89821441880932 1.42314838273285 -17.3205080756888 -9.89821441880932 -1.42314838273285 -17.3205080756888 -12.1752285801744 0 -15.8670668058247 -12.9991514920694 2.79347054059687 -14.9405014248199 -0.816441698702448 18.4595443928048 -7.6536686473018 15.2045459940907 11.0467492837204 6.84040286651338 -13.2512931227051 2.64047003895459 -14.7455467362025 -6.5298615710629 16.4947323449932 -9.23497226470068 -8.6602540378444 15 -10 0.50057387962417 -1.20849224915838 -19.9571784647721 -13.3956584505603 8.50412509882335 -12.1752285801744 -11.3856392797916 10.2516756544407 -12.8557521937308 -12.6604444311898 15.0881301347098 -3.4729635533386 -14.1531139905604 12.3652033138966 -6.84040286651337 -13.947662107169 2.33724661605098 -14.1421356237309 -14.2906206106603 3.63446159860058 -13.5118041523132 6.73648177666931 18.5083315679665 3.47296355333861 -7.32249308035412 16.5812730821694 -8.45236523481399 -13.5286287271763 9.24014250038135 -11.4715287270209 -6.5435072456996 17.2801582505134 -7.65366864730179 -12.9991514920694 -2.79347054059684 -14.9405014248199 -4.21358539991451 19.5511047789537 3.5527136788005e-15 -13.2512931227051 -2.64047003895456 -14.7455467362025 -14.5338132675864 8.56107027485868 -10.7459921669365 -13.6148389754126 10.7068277128936 -10 -13.947662107169 -2.33724661605095 -14.1421356237309 -14.2906206106603 -3.63446159860057 -13.5118041523132 12.9877294350744 13.5840999976111 6.84040286651338 0.403086515750346 -0.166963901633522 -19.9952405415982 -1.62660867018633 -10.991699493757 -16.6293922460509 -2.8173255684143 -9.59492973614498 -17.3205080756888 0 -10 -17.3205080756888 -13.3956584505603 -8.50412509882335 -12.1752285801744 -11.3856392797916 -10.2516756544407 -12.8557521937308 -13.5286287271763 -9.24014250038134 -11.4715287270209 1.62660867018627 -10.991699493757 -16.6293922460509 2.81732556841428 -9.59492973614498 -17.3205080756888 -15.0881301347098 12.6604444311898 -3.4729635533386 -16.1335599334048 9.6393533236951 -6.84040286651337 -14.5338132675864 -8.56107027485868 -10.7459921669365 -13.6148389754126 -10.7068277128936 -10 14.6810109754046 8.30611636615984 10.7459921669365 16.0798042810154 6.43738256469501 10 3.42020143325669 19.3969262078591 3.47296355333861 -7.45712955560617 18.5577805459302 3.5527136788005e-15 14.7665125035066 7.09606490591196 11.4715287270209 -2.06198506870533 -14.6006632084289 -13.5118041523132 14.062617597822 7.3489179691932 12.1752285801744 4.96011503378116 17.7993992901156 7.6536686473018 7.38645444058679 17.281469249486 6.84040286651338 14.2906206106603 3.63446159860058 13.5118041523132 15.2369594301404 1.60146896867903 12.8557521937308 13.947662107169 2.33724661605098 14.1421356237309 10.3534765656754 15.6848465605439 6.84040286651338 5.77034213074995 17.1831508644777 8.452365234814 2.06198506870533 -14.6006632084289 -13.5118041523132 13.2512931227051 2.64047003895459 14.7455467362025 -0.666959147261736 -15.8530430680166 -12.1752285801744 4.97098275646971 17.0295219458765 9.23497226470069 -17.0573706390489 9.84807753012211 -3.4729635533386 -17.5954599852522 6.6036865863837 -6.84040286651337 12.9991514920695 2.79347054059687 14.9405014248199 -0.816441698702448 18.4595443928048 7.6536686473018 0 19.6961550602442 3.47296355333861 -1.23788377633034 -16.3362074062933 -11.4715287270209 -10.4861456711446 17.0305827546662 3.5527136788005e-15 -6.5298615710629 -16.4947323449932 -9.23497226470068 -8.66025403784437 -15 -10 -7.32249308035409 -16.5812730821694 -8.45236523481399 -0.147197707818208 -16.8671866410185 -10.7459921669365 -0.807962798211804 17.7218081297286 9.23497226470069 -6.5435072456996 17.2801582505134 7.6536686473018 -8.9058177069513 16.5497824636564 6.84040286651338 -6.5435072456996 -17.2801582505134 -7.65366864730179 -8.9058177069513 -16.5497824636564 -6.84040286651337 -0.807962798211776 -17.7218081297286 -9.23497226470068 -0.147197707818208 16.8671866410185 10.7459921669365 -7.32249308035412 16.5812730821694 8.452365234814 -6.5298615710629 16.4947323449932 9.23497226470069 -8.66025403784437 15 10 -1.23788377633036 16.3362074062933 11.4715287270209 -0.816441698702448 -18.4595443928048 -7.6536686473018 -18.5083315679665 6.73648177666934 -3.4729635533386 -18.4918274755809 3.35577192865449 -6.84040286651337 12.9991514920694 -2.79347054059689 -14.9405014248199 -3.42020143325669 19.3969262078591 3.47296355333861 4.97098275646974 -17.0295219458765 -9.23497226470068 -0.666959147261736 15.8530430680166 12.1752285801744 13.2512931227051 -2.64047003895458 -14.7455467362025 2.06198506870533 14.6006632084288 13.5118041523132 -13.2134944678016 15.0134461050545 3.5527136788005e-15 5.77034213074998 -17.1831508644777 -8.45236523481399 13.947662107169 -2.33724661605095 -14.142135623731 15.2369594301404 -1.60146896867903 -12.8557521937308 14.2906206106603 -3.63446159860058 -13.5118041523132 4.96011503378116 -17.7993992901156 -7.65366864730179 7.38645444058679 -17.281469249486 -6.84040286651337 14.062617597822 -7.34891796919318 -12.1752285801744 -2.06198506870533 14.6006632084288 13.5118041523132 14.7665125035067 -7.0960649059119 -11.4715287270209 14.6810109754047 -8.3061163661598 -10.7459921669365 16.0798042810154 -6.43738256469497 -10 -14.5338132675864 8.56107027485868 10.7459921669365 -13.6148389754126 10.7068277128936 10 1.6266086701863 10.991699493757 16.6293922460509 0 10 17.3205080756888 2.8173255684143 9.59492973614496 17.3205080756888 -19.3969262078591 3.42020143325672 -3.4729635533386 -18.7938524157182 0 -6.84040286651337 -6.73648177666931 18.5083315679665 3.47296355333861 -13.5286287271763 9.24014250038135 11.4715287270209 -13.3956584505603 8.50412509882335 12.1752285801744 -11.3856392797916 10.2516756544407 12.8557521937308 -1.6266086701863 10.991699493757 16.6293922460509 -2.8173255684143 9.59492973614496 17.3205080756888 0.403086515750346 0.166963901633522 19.9952405415982 -14.2906206106603 3.63446159860061 13.5118041523132 -15.5607150863688 12.5643999459129 3.5527136788005e-15 -13.947662107169 2.33724661605098 14.142135623731 -14.5338132675864 -8.56107027485868 10.7459921669365 -13.6148389754126 -10.7068277128936 10 -13.2512931227051 2.64047003895459 14.7455467362025 -12.9991514920694 2.79347054059687 14.9405014248199 -6.5435072456996 -17.2801582505134 7.6536686473018 -8.9058177069513 -16.5497824636564 6.84040286651338 -13.5286287271763 -9.24014250038135 11.4715287270209 -19.6961550602442 2.8421709430404e-14 -3.4729635533386 -7.32249308035409 -16.5812730821694 8.452365234814 -14.2906206106603 -3.63446159860057 13.5118041523132 -9.84807753012208 17.0573706390489 3.47296355333861 -13.947662107169 -2.33724661605095 14.142135623731 -13.3956584505603 -8.50412509882335 12.1752285801744 -11.3856392797916 -10.2516756544407 12.8557521937308 0.50057387962417 1.20849224915838 19.9571784647721 -6.5298615710629 -16.4947323449932 9.23497226470069 -8.66025403784437 -15 10 -13.2512931227051 -2.64047003895456 14.7455467362025 -17.4602822632237 9.7538988762727 3.5527136788005e-15 0.166963901633522 0.403086515750346 19.9952405415982 -0.816441698702448 -18.4595443928048 7.6536686473018 -12.9991514920694 -2.79347054059683 14.9405014248199 -12.1752285801744 0 15.8670668058247 0.132832468952387 1.00896277234861 19.9740919608178 -11.1105562496361 -0.137307503997221 16.6293922460509 -9.89821441880932 -1.42314838273285 17.3205080756888 -9.89821441880932 1.42314838273285 17.3205080756888 -0.807962798211776 -17.7218081297286 9.23497226470069 -19.3969262078591 -3.42020143325665 -3.4729635533386 4.96011503378116 -17.7993992901156 7.6536686473018 7.38645444058679 -17.281469249486 6.84040286651338 -18.4918274755809 -3.35577192865449 -6.84040286651337 0 0.872387747306732 19.9809644316372 -12.6604444311898 15.0881301347098 3.47296355333861 5.77034213074998 -17.1831508644777 8.452365234814 -18.8575489092217 6.66279589484117 3.5527136788005e-15 -0.147197707818208 -16.8671866410185 10.7459921669365 4.97098275646974 -17.0295219458765 9.23497226470069 -1.23788377633034 -16.3362074062933 11.4715287270209 -0.666959147261736 -15.8530430680166 12.1752285801744 -2.06198506870535 -14.6006632084288 13.5118041523132 2.06198506870533 -14.6006632084289 13.5118041523132 -2.50477928615589 0.735469557378622 19.8288972274762 -1.74311485495315 0 19.9238939618349 -1.20849224915838 0.50057387962417 19.9571784647721 14.6810109754047 -8.3061163661598 10.7459921669365 16.0798042810154 -6.43738256469497 10 -1.62660867018633 -10.9916994937569 16.6293922460509 14.7665125035067 -7.0960649059119 11.4715287270209 -2.50477928615589 -0.735469557378622 19.8288972274762 -18.5083315679665 -6.73648177666927 -3.4729635533386 -17.5954599852522 -6.60368658638369 -6.84040286651337 14.062617597822 -7.34891796919318 12.1752285801744 1.62660867018627 -10.991699493757 16.6293922460509 -15.0881301347098 12.6604444311898 3.47296355333861 -2.01159754888394 -0.833230986784201 19.8811267644464 -19.7123182069542 3.38001640643699 3.5527136788005e-15 14.2906206106603 -3.63446159860058 13.5118041523132 15.2369594301404 -1.601468968679 12.8557521937308 -1.23256833432438 -1.23256833432438 19.9238939618349 13.947662107169 -2.33724661605095 14.1421356237309 13.2512931227051 -2.64047003895458 14.7455467362025 12.9991514920695 -2.79347054059689 14.9405014248199 -0.833230986784201 -2.01159754888396 19.8811267644464 -0.50057387962417 -1.20849224915838 19.9571784647721 -0.616871291944648 -0.616871291944648 19.9809644316372 -0.166963901633522 -0.403086515750346 19.9952405415982 0 -0.581694374862224 19.991539001644 0.50057387962417 -1.20849224915838 19.9571784647721 -17.0573706390489 -9.84807753012204 -3.4729635533386 0.403086515750346 -0.166963901633522 19.9952405415982 -16.1335599334048 -9.63935332369509 -6.84040286651337 -0.0752847540450432 0.280966527131369 -19.9978846385421 -20 2.8421709430404e-14 3.5527136788005e-15 -17.0573706390489 9.84807753012208 3.47296355333861 -0.121204218664445 0.181394932112568 -19.998810100003 -0.403086515750346 0.166963901633522 -19.9952405415982 15.0379369370855 4.4703050035458 -12.4047098253652 15.2650611592961 4.3291704544236 -12.1752285801744 15.8830294556309 4.01664088221654 -11.4715287270209 17.0075039306893 3.27792770627863 -10 -0.872387747306732 0 -19.9809644316372 16.0158666413124 5.29298290908238 -10.7459921669365 0.156544549090512 12.0004037847879 -15.9989313020026 -1.0693404155015 -0.212705033582154 -19.9702595787953 -1.20849224915838 -0.50057387962417 -19.9571784647721 -0.641807896397836 -0.127663528075459 -19.9892917495273 -11.7177753188384 14.6936254954663 6.84040286651338 0.134615647294737 13.8296059652629 -14.4472792411951 -19.7123182069542 -3.38001640643697 3.5527136788005e-15 8.05627829129304 15.8054315778928 -9.23497226470068 -15.0881301347098 -12.6604444311897 -3.4729635533386 8.82883010699408 15.8306437291458 -8.45236523481399 -14.1531139905604 -12.3652033138966 -6.84040286651337 -3.6475707728074 15.2583879097973 -12.4047098253652 -18.5083315679665 6.73648177666934 3.47296355333861 -3.88335898880419 15.3845159814854 -12.1752285801744 8.09878779050322 16.6081604207602 -7.65366864730179 -4.4630016859368 15.7634274387412 -11.4715287270209 -11.1454934717064 1.81393704835929 -16.5071986616973 -3.42407565959397 16.5166388295414 -10.7459921669365 -11.3903661642781 10.7880829062515 -12.4047098253652 -9.00539252531871 12.3948594585949 -12.8557521937308 -11.3817021704919 11.0553455270617 -12.1752285801744 -11.4200277696941 11.7467865565247 -11.4715287270209 0.121204218664445 -0.181394932112568 -19.998810100003 -14.1531139905604 12.3652033138966 6.84040286651338 -9.49730729182352 14.9838727128498 -9.23497226470068 -11.3425206307508 13.0899666058013 -10 -12.5917909817184 11.2236559204591 -10.7459921669365 -14.142135623731 2.8421709430404e-14 -14.1421356237309 -18.8575489092217 -6.66279589484112 3.5527136788005e-15 0.205681773086354 -0.205681773086354 -19.9978846385422 -12.6604444311898 -15.0881301347098 -3.4729635533386 -11.7177753188384 -14.6936254954663 -6.84040286651337 -10.2500193641052 14.949736618843 -8.45236523481399 -9.57165219224422 15.8052152958451 -7.65366864730179 -19.3969262078591 3.42020143325672 3.47296355333861 -14.7386188054525 -0.451956034469532 -13.5118041523132 -11.3903661642781 -10.7880829062515 -12.4047098253652 -9.00539252531871 -12.3948594585949 -12.8557521937308 -0.15654454909054 -12.0004037847879 -15.9989313020026 -11.3817021704919 -11.0553455270617 -12.1752285801744 16.0158666413124 5.29298290908238 10.7459921669365 17.0075039306893 3.27792770627863 10 15.8830294556309 4.01664088221654 11.4715287270209 -17.4602822632238 -9.75389887627267 3.5527136788005e-15 -11.4200277696941 -11.7467865565247 -11.4715287270209 -12.5917909817184 -11.2236559204591 -10.7459921669365 -11.3425206307508 -13.0899666058013 -10 -16.1335599334048 9.6393533236951 6.84040286651338 15.2650611592961 4.3291704544236 12.1752285801744 -0.134615647294765 -13.8296059652629 -14.4472792411951 -9.84807753012211 -17.0573706390488 -3.4729635533386 8.09878779050322 16.6081604207602 7.6536686473018 15.0379369370855 4.4703050035458 12.4047098253652 -19.6961550602442 2.8421709430404e-14 3.47296355333861 8.82883010699408 15.8306437291458 8.452365234814 -3.6475707728074 -15.2583879097973 -12.4047098253652 -3.88335898880419 -15.3845159814854 -12.1752285801744 8.05627829129304 15.8054315778928 9.23497226470069 -4.4630016859368 -15.7634274387412 -11.4715287270209 -9.49730729182349 -14.9838727128498 -9.23497226470068 -10.2500193641052 -14.949736618843 -8.45236523481399 -15.5607150863688 -12.5643999459128 3.5527136788005e-15 -3.42407565959397 -16.5166388295414 -10.7459921669365 -9.57165219224419 -15.8052152958451 -7.65366864730179 -17.5954599852522 6.6036865863837 6.84040286651338 -9.57165219224419 15.8052152958451 7.6536686473018 -3.42407565959397 16.5166388295414 10.7459921669365 -6.73648177666934 -18.5083315679665 -3.4729635533386 -10.2500193641052 14.949736618843 8.452365234814 -19.3969262078591 -3.42020143325665 3.47296355333861 -9.49730729182352 14.9838727128498 9.23497226470069 -11.3425206307508 13.0899666058013 10 -4.4630016859368 15.7634274387412 11.4715287270209 8.05627829129304 -15.8054315778928 -9.23497226470068 -3.88335898880419 15.3845159814854 12.1752285801744 -3.6475707728074 15.2583879097973 12.4047098253652 8.82883010699408 -15.8306437291458 -8.45236523481399 15.0379369370855 -4.47030500354576 -12.4047098253652 8.09878779050322 -16.6081604207602 -7.65366864730179 10.3534765656754 -15.6848465605439 -6.84040286651337 0.134615647294737 13.8296059652629 14.4472792411951 -13.2134944678016 -15.0134461050545 3.5527136788005e-15 15.2650611592961 -4.32917045442356 -12.1752285801744 -12.5917909817184 11.2236559204591 10.7459921669365 -18.4918274755809 3.35577192865449 6.84040286651338 -11.4200277696941 11.7467865565247 11.4715287270209 15.883029455631 -4.01664088221649 -11.4715287270209 -3.42020143325675 -19.3969262078591 -3.4729635533386 17.0075039306893 -3.27792770627858 -10 16.0158666413124 -5.29298290908233 -10.7459921669365 -18.5083315679665 -6.73648177666927 3.47296355333861 -11.3817021704919 11.0553455270617 12.1752285801744 0.156544549090512 12.0004037847879 15.9989313020026 -11.3903661642781 10.7880829062515 12.4047098253652 -9.00539252531871 12.3948594585949 12.8557521937308 -9.57165219224419 -15.8052152958451 7.6536686473018 -11.7177753188384 -14.6936254954663 6.84040286651338 -14.7386188054525 -0.451956034469532 13.5118041523132 -10.2500193641052 -14.949736618843 8.452365234814 -14.142135623731 2.8421709430404e-14 14.142135623731 -12.5917909817184 -11.2236559204591 10.7459921669365 -11.3425206307508 -13.0899666058013 10 -9.49730729182349 -14.9838727128498 9.23497226470069 -11.4200277696941 -11.7467865565247 11.4715287270209 -11.3817021704919 -11.0553455270617 12.1752285801744 -11.1454934717064 1.81393704835929 16.5071986616973 -10.4861456711447 -17.0305827546662 3.5527136788005e-15 -11.3903661642781 -10.7880829062515 12.4047098253652 -9.00539252531871 -12.3948594585949 12.8557521937308 -5.6843418860808e-14 -19.6961550602442 -3.4729635533386 -3.42407565959397 -16.5166388295414 10.7459921669365 -4.4630016859368 -15.7634274387412 11.4715287270209 -17.0573706390489 -9.84807753012204 3.47296355333861 8.09878779050322 -16.6081604207602 7.6536686473018 10.3534765656754 -15.6848465605439 6.84040286651338 -18.7938524157182 0 6.84040286651338 -3.88335898880419 -15.3845159814853 12.1752285801744 -3.6475707728074 -15.2583879097973 12.4047098253652 -0.0752847540450432 0.280966527131369 19.9978846385421 8.82883010699408 -15.8306437291458 8.452365234814 8.05627829129304 -15.8054315778928 9.23497226470069 -0.121204218664445 0.181394932112568 19.998810100003 -0.134615647294765 -13.8296059652629 14.4472792411951 -0.403086515750346 0.166963901633522 19.9952405415982 -7.4571295556062 -18.5577805459302 3.5527136788005e-15 0.156544549090512 -12.0004037847879 15.9989313020026 16.0158666413124 -5.29298290908233 10.7459921669365 17.0075039306893 -3.27792770627858 10 3.42020143325664 -19.3969262078591 -3.4729635533386 -0.872387747306732 0 19.9809644316372 -15.0881301347098 -12.6604444311897 3.47296355333861 15.883029455631 -4.01664088221649 11.4715287270209 -18.4918274755809 -3.35577192865449 6.84040286651338 -1.0693404155015 -0.212705033582154 19.9702595787953 15.2650611592961 -4.32917045442356 12.1752285801744 15.0379369370855 -4.47030500354579 12.4047098253652 -1.20849224915838 -0.50057387962417 19.9571784647721 -0.641807896397836 -0.127663528075459 19.9892917495273 0.121204218664445 -0.181394932112568 19.998810100003 0.205681773086354 -0.205681773086354 19.9978846385422 -0.325658908331775 -0.0320746028973531 -19.9973227581912 -4.21358539991454 -19.5511047789537 3.5527136788005e-15 2.21802627117884 13.4907276903187 -14.5972814539567 -0.181394932112568 -0.121204218664445 -19.998810100003 6.73648177666925 -18.5083315679665 -3.4729635533386 10.862368536244 14.0258417591611 -9.23497226470068 11.588669667495 13.9377278375993 -8.45236523481399 -12.6604444311898 -15.0881301347098 3.47296355333861 10.9731151509249 14.8664757128868 -7.65366864730179 -7.53148057699039 14.1646548443877 -11.9431718340557 -17.5954599852522 -6.60368658638369 6.84040286651338 -8.93793165750989 12.8932754501783 -12.4047098253652 -8.89476982577185 13.1395159259024 -12.1752285801744 -8.19152044288992 14.1881295983245 -11.4715287270209 -8.35487811412935 14.4710733847173 -10.9901795614161 -12.1275239217121 12.9475268216949 -9.23497226470068 -0.848824063922962 -19.9819793240936 3.5527136788005e-15 -12.8254101877891 12.808839738722 -8.45236523481399 -12.2789582043401 13.8075537896247 -7.65366864730179 9.84807753012203 -17.0573706390489 -3.4729635533386 -2.21802627117884 -13.4907276903187 -14.5972814539567 -9.84807753012211 -17.0573706390488 3.47296355333861 -8.93793165750989 -12.8932754501783 -12.4047098253652 10.9731151509249 14.8664757128868 7.6536686473018 -8.89476982577185 -13.1395159259024 -12.1752285801744 11.588669667495 13.9377278375993 8.452365234814 -16.1335599334048 -9.63935332369509 6.84040286651338 -7.53148057699039 -14.1646548443877 -11.9431718340557 -8.19152044288992 -14.1881295983245 -11.4715287270209 10.862368536244 14.0258417591611 9.23497226470069 -8.35487811412935 -14.4710733847173 -10.9901795614161 -12.1275239217121 -12.947526821695 -9.23497226470068 -12.8254101877891 -12.808839738722 -8.45236523481399 -12.2789582043401 -13.8075537896247 -7.65366864730179 2.54035639493759 -19.8380087051775 3.5527136788005e-15 -12.2789582043401 13.8075537896247 7.6536686473018 12.6604444311897 -15.0881301347098 -3.4729635533386 12.9877294350744 -13.5840999976111 -6.84040286651337 -12.8254101877891 12.808839738722 8.452365234814 -6.73648177666934 -18.5083315679665 3.47296355333861 -12.1275239217121 12.9475268216949 9.23497226470069 -8.35487811412935 14.4710733847173 10.9901795614161 -14.1531139905604 -12.3652033138966 6.84040286651338 2.21802627117884 13.4907276903187 14.5972814539567 10.862368536244 -14.0258417591611 -9.23497226470068 -8.19152044288992 14.1881295983245 11.4715287270209 -7.53148057699036 14.1646548443877 11.9431718340557 11.588669667495 -13.9377278375993 -8.45236523481399 -8.89476982577185 13.1395159259024 12.1752285801744 10.9731151509249 -14.8664757128868 -7.65366864730179 5.85645542553101 -19.123334694785 3.5527136788005e-15 -8.93793165750989 12.8932754501783 12.4047098253652 -12.2789582043401 -13.8075537896247 7.6536686473018 15.0881301347097 -12.6604444311898 -3.4729635533386 -12.8254101877891 -12.808839738722 8.452365234814 -12.1275239217121 -12.947526821695 9.23497226470069 15.2045459940907 -11.0467492837204 -6.84040286651337 -3.42020143325675 -19.3969262078591 3.47296355333861 -8.35487811412935 -14.4710733847173 10.9901795614161 -8.1915204428899 -14.1881295983245 11.4715287270209 -8.89476982577185 -13.1395159259024 12.1752285801744 -8.93793165750989 -12.8932754501783 12.4047098253652 -7.53148057699036 -14.1646548443877 11.9431718340557 18.7181938911956 -1.68466794217809 -6.84040286651337 10.9731151509249 -14.8664757128868 7.6536686473018 9.00407489635347 -17.8585171629914 3.5527136788005e-15 12.9877294350744 -13.5840999976111 6.84040286651338 11.588669667495 -13.9377278375993 8.452365234814 10.862368536244 -14.0258417591611 9.23497226470069 -2.21802627117884 -13.4907276903187 14.5972814539567 17.0573706390488 -9.84807753012215 -3.4729635533386 16.9326759345147 -8.15434695855535 -6.84040286651337 -0.325658908331775 -0.0320746028973531 19.9973227581912 -5.6843418860808e-14 -19.6961550602442 3.47296355333861 -0.181394932112568 -0.121204218664445 19.998810100003 13.2881662464031 11.7532942223942 -9.23497226470068 13.9539934998964 11.5690789323159 -8.45236523481399 13.4852679678468 12.6320585841214 -7.65366864730179 -14.3306594216769 10.4569349146924 -9.23497226470068 -14.9625176413621 10.231353173908 -8.45236523481399 11.8926635260858 -16.0799426073388 3.5527136788005e-15 -14.5783809642894 11.3530685146067 -7.65366864730179 13.4852679678468 12.6320585841214 7.6536686473018 13.9539934998964 11.5690789323159 8.452365234814 18.5083315679665 -6.73648177666938 -3.4729635533386 18.1165757381514 -4.9998572127233 -6.84040286651337 13.2881662464031 11.7532942223942 9.23497226470069 3.42020143325664 -19.3969262078591 3.47296355333861 -14.3306594216768 -10.4569349146925 -9.23497226470068 -14.9625176413621 -10.231353173908 -8.45236523481399 14.4391218790905 -13.8387773795509 3.5527136788005e-15 -14.5783809642894 -11.3530685146067 -7.65366864730179 -14.5783809642894 11.3530685146067 7.6536686473018 -14.9625176413621 10.231353173908 8.452365234814 -14.3306594216768 10.4569349146924 9.23497226470069 13.2881662464031 -11.7532942223941 -9.23497226470068 13.9539934998965 -11.5690789323159 -8.45236523481399 13.4852679678468 -12.6320585841214 -7.65366864730179 -14.5783809642894 -11.3530685146067 7.6536686473018 19.3969262078591 -3.42020143325678 -3.4729635533386 -14.9625176413621 -10.231353173908 8.452365234814 6.73648177666925 -18.5083315679665 3.47296355333861 -14.3306594216768 -10.4569349146924 9.23497226470069 13.4852679678468 -12.6320585841214 7.6536686473018 15.2045459940907 -11.0467492837204 6.84040286651338 13.9539934998965 -11.5690789323159 8.452365234814 16.5701929848769 -11.1994957227519 3.5527136788005e-15 13.2881662464031 -11.7532942223941 9.23497226470069 15.2476484444911 9.06777283479346 -9.23497226470068 9.84807753012203 -17.0573706390489 3.47296355333861 15.8435562919747 8.80563716946921 -8.45236523481399 -15.8223666051344 7.71715690049692 -9.49200739495281 -16.0301474792238 7.59931964484619 -9.23497226470068 -16.5889821009418 7.30501162161573 -8.45236523481399 15.8435562919747 8.80563716946921 8.452365234814 15.2476484444911 9.06777283479346 9.23497226470069 -15.8223666051344 -7.71715690049695 -9.49200739495281 18.2245698077627 -8.23802496487981 3.5527136788005e-15 -16.0301474792238 -7.59931964484622 -9.23497226470068 -16.5889821009418 -7.30501162161576 -8.45236523481399 -16.5889821009418 7.30501162161573 8.452365234814 12.6604444311897 -15.0881301347098 3.47296355333861 -16.0301474792238 7.59931964484619 9.23497226470069 -15.8223666051344 7.71715690049692 9.49200739495281 15.2476484444911 -9.06777283479342 -9.23497226470068 15.8435562919747 -8.80563716946919 -8.45236523481399 -16.5889821009418 -7.30501162161576 8.452365234814 -16.0301474792238 -7.59931964484622 9.23497226470069 -15.8223666051344 -7.71715690049693 9.49200739495281 19.35465893867 -5.03956122770245 3.5527136788005e-15 15.8435562919747 -8.80563716946919 8.452365234814 15.0881301347097 -12.6604444311898 3.47296355333861 16.9326759345147 -8.15434695855535 6.84040286651338 15.2476484444911 -9.06777283479342 9.23497226470069 16.4787065834619 6.19306264705364 -9.49200739495281 16.6717368732784 6.06370158388239 -9.23497226470068 17.1927258313788 5.74175064108044 -8.45236523481399 -16.9885898893352 4.6140664479546 -9.49200739495281 -17.1665508430596 4.47490999047551 -9.23497226470068 19.9279497708505 -1.69611848951013 3.5527136788005e-15 -17.649486749986 4.12954469637691 -8.45236523481399 17.1927258313788 5.74175064108044 8.452365234814 16.6717368732784 6.06370158388239 9.23497226470069 16.4787065834619 6.19306264705364 9.49200739495281 -16.9885898893351 -4.61406644795463 -9.49200739495281 17.0573706390488 -9.84807753012215 3.47296355333861 -17.1665508430596 -4.47490999047552 -9.23497226470068 -17.649486749986 -4.12954469637694 -8.45236523481399 -17.649486749986 4.12954469637691 8.452365234814 -17.1665508430596 4.47490999047551 9.23497226470069 -16.9885898893351 4.6140664479546 9.49200739495281 16.4787065834619 -6.19306264705359 -9.49200739495281 18.5083315679664 -6.73648177666938 3.47296355333861 16.6717368732784 -6.06370158388236 -9.23497226470068 17.1927258313788 -5.74175064108042 -8.45236523481399 -17.649486749986 -4.12954469637694 8.452365234814 -17.1665508430596 -4.47490999047552 9.23497226470069 -16.9885898893351 -4.61406644795463 9.49200739495281 17.1927258313788 -5.74175064108043 8.452365234814 18.1165757381514 -4.9998572127233 6.84040286651338 16.6717368732784 -6.06370158388236 9.23497226470069 19.3969262078591 -3.42020143325678 3.47296355333861 16.4787065834619 -6.19306264705359 9.49200739495281 17.3475566490428 2.99400633306158 -9.49200739495281 17.5103384100008 2.84663591585937 -9.23497226470069 17.9554261985706 2.48197340134689 -8.452365234814 17.9554261985706 2.48197340134689 8.45236523481397 17.5103384100008 2.84663591585937 9.23497226470066 17.3475566490428 2.99400633306158 9.4920073949528 -17.8636546832801 0.567062339677648 -8.97598360400924 -17.552388446326 -1.34738837884379 -9.49200739495281 -17.700032114014 -1.19337774115331 -9.23497226470068 -18.126155740733 0 -8.45236523481399 -18.3643221376055 0 -7.92159532078313 -18.3643221376055 0 7.92159532078314 -18.126155740733 0 8.452365234814 -17.8636546832801 0.567062339677648 8.97598360400925 17.3475566490428 -2.99400633306155 -9.49200739495281 -17.700032114014 -1.19337774115331 9.23497226470069 17.5103384100008 -2.84663591585935 -9.23497226470069 -17.552388446326 -1.34738837884379 9.49200739495281 17.9554261985706 -2.48197340134688 -8.452365234814 17.9554261985706 -2.48197340134688 8.45236523481397 18.7181938911956 -1.68466794217809 6.84040286651338 17.5103384100008 -2.84663591585938 9.23497226470066 17.3475566490428 -2.99400633306156 9.4920073949528 5.12369280819246 0.736675810916239 -19.3185165257814 6.37848571096168 2.47103852889066 -18.7938524157182 5.05511871573515 4.60834961195749 -18.7938524157182 8.17648051001302 2.14187873888079 -18.126155740733 3.04902992656878 6.12327754418271 -18.7938524157182 7.05244120481311 4.65892166872834 -18.126155740733 7.55749574354257 6.54860733945284 -17.3205080756888 0.631152750561256 6.81122291381388 -18.7938524157182 5.45419786899276 6.457104898371 -18.126155740733 5.40640817455596 8.4125353283118 -17.3205080756888 9.47653141601435 6.46462092130386 -16.3830408857798 9.62266869283172 8.52494056839168 -15.3208888623796 3.08642209815429 7.86870235138659 -18.126155740733 7.65407558581097 8.54465319726663 -16.3830408857798 1.58799963384621 8.30185131314676 -18.126155740733 -4.1222636941489 5.45875932901481 -18.7938524157182 -1.1677479715639 8.37131069412672 -18.126155740733 9.50518847306819 10.4714560635783 -14.1421356237309 -3.47891673963849 7.70322116918339 -18.126155740733 -5.40640817455596 8.4125353283118 -17.3205080756888 -6.72393200878329 1.25692072839291 -18.7938524157182 -6.72393200878329 -1.25692072839291 -18.7938524157182 8.1238925594713 14.2269602637844 -11.4715287270209 -7.65407558581097 8.54465319726663 -16.3830408857798 -9.6226686928317 8.52494056839171 -15.3208888623796 -9.47653141601435 6.46462092130386 -16.3830408857798 -8.45050156548723 0.177486209014063 -18.126155740733 -9.50518847306819 10.4714560635783 -14.1421356237309 -4.12226369414893 -5.45875932901481 -18.7938524157182 -5.40640817455599 -8.4125353283118 -17.3205080756888 0.631152750561256 -6.81122291381389 -18.7938524157182 -9.47653141601435 -6.46462092130383 -16.3830408857798 -9.62266869283172 -8.52494056839168 -15.3208888623796 -3.47891673963849 -7.70322116918339 -18.126155740733 3.04902992656878 -6.12327754418273 -18.7938524157182 -7.65407558581097 -8.54465319726661 -16.3830408857798 -1.16774797156393 -8.37131069412672 -18.126155740733 -16.3828552868047 -0.0779827977746663 -11.4715287270209 5.05511871573515 -4.60834961195749 -18.7938524157182 1.58799963384621 -8.30185131314676 -18.126155740733 -9.50518847306822 -10.4714560635783 -14.1421356237309 3.08642209815429 -7.8687023513866 -18.126155740733 5.40640817455596 -8.41253532831182 -17.3205080756888 6.37848571096168 -2.47103852889069 -18.7938524157182 5.45419786899276 -6.45710489837103 -18.126155740733 7.55749574354257 -6.54860733945286 -17.3205080756888 5.12369280819246 -0.736675810916239 -19.3185165257814 7.05244120481311 -4.65892166872834 -18.126155740733 7.65407558581094 -8.54465319726664 -16.3830408857798 9.62266869283167 -8.52494056839173 -15.3208888623796 8.17648051001299 -2.14187873888081 -18.126155740733 9.47653141601432 -6.46462092130388 -16.3830408857798 8.1238925594713 14.2269602637844 11.4715287270209 9.6226686928317 8.52494056839168 15.3208888623796 9.50518847306819 -10.4714560635783 -14.1421356237309 9.50518847306819 10.4714560635783 14.142135623731 8.25896272733343 -14.1489774660097 -11.4715287270209 9.47653141601435 6.46462092130386 16.3830408857798 7.55749574354257 6.54860733945284 17.3205080756888 8.17648051001299 2.14187873888079 18.126155740733 6.37848571096168 2.47103852889066 18.7938524157182 7.65407558581097 8.54465319726663 16.3830408857798 5.40640817455596 8.4125353283118 17.3205080756888 7.05244120481311 4.65892166872834 18.126155740733 5.05511871573515 4.60834961195749 18.7938524157182 5.12369280819249 0.736675810916239 19.3185165257814 5.45419786899276 6.457104898371 18.126155740733 3.04902992656878 6.12327754418271 18.7938524157182 3.08642209815429 7.86870235138659 18.126155740733 -9.50518847306819 10.4714560635783 14.142135623731 -9.6226686928317 8.52494056839168 15.3208888623796 1.58799963384621 8.30185131314676 18.126155740733 0.631152750561256 6.81122291381388 18.7938524157182 -5.40640817455596 8.4125353283118 17.3205080756888 -16.3828552868047 -0.0779827977746663 11.4715287270209 -1.1677479715639 8.37131069412672 18.126155740733 -7.65407558581097 8.54465319726663 16.3830408857798 -3.47891673963846 7.70322116918339 18.126155740733 -4.1222636941489 5.45875932901481 18.7938524157182 -9.47653141601435 6.46462092130386 16.3830408857798 -9.62266869283172 -8.52494056839167 15.3208888623796 -6.72393200878329 1.25692072839291 18.7938524157182 -9.50518847306822 -10.4714560635783 14.142135623731 -8.45050156548723 -0.177486209014063 18.126155740733 -6.72393200878329 -1.25692072839291 18.7938524157182 -9.47653141601435 -6.46462092130383 16.3830408857798 -7.65407558581097 -8.54465319726661 16.3830408857798 -5.40640817455599 -8.4125353283118 17.3205080756888 8.25896272733343 -14.1489774660097 11.4715287270209 0 1.5707963267949 6.28318530717959 1.5707963267949 6.28318530717959 -1.5707963267949 6.28318530717959 -1.39626340159546 6.28318530717959 -1.22173047639603 6.28318530717959 -1.0471975511966 6.28318530717959 -0.872664625997166 6.28318530717959 -0.698131700797733 6.28318530717959 -0.5235987755983 6.28318530717959 -0.349065850398867 6.28318530717959 -0.174532925199435 6.28318530717959 -1.77635683940025e-15 6.28318530717959 0.174532925199431 6.28318530717959 0.349065850398864 6.28318530717959 0.523598775598296 6.28318530717959 0.698131700797729 6.28318530717959 0.872664625997162 6.28318530717959 1.04719755119659 6.28318530717959 1.22173047639603 6.28318530717959 1.39626340159546 0 -1.5707963267949 0 -1.39626340159546 0 -1.22173047639603 0 -1.0471975511966 0 -0.872664625997166 0 -0.698131700797733 0 -0.5235987755983 0 -0.349065850398867 0 -0.174532925199435 0 -1.77635683940025e-15 0 0.174532925199431 0 0.349065850398864 0 0.523598775598296 0 0.698131700797729 0 0.872664625997162 0 1.04719755119659 0 1.22173047639603 0 1.39626340159546 3.88919090537988 1.30899693899575 3.69599135716446 1.22173047639603 4.06559049288091 1.22173047639603 4.57378930449102 1.13446401379631 4.43518962859735 1.22173047639603 4.28818997234649 1.13446401379631 4.42678964824016 1.0471975511966 4.8047887643138 1.22173047639603 4.71238898038469 1.0471975511966 5.65889445935084 0.785398163397448 5.44945494911152 0.785398163397448 5.55014702134197 0.698131700797732 5.75958653158129 0.698131700797732 5.5582023871204 0.872664625997165 5.79986336047346 0.872664625997165 5.17923404254401 0.959931088596881 5.28358764467374 1.0471975511966 4.99798831252922 1.0471975511966 5.07488044041428 0.872664625997165 5.31654141376734 0.872664625997165 4.1747902375244 1.30899693899575 4.90138853842151 1.13446401379631 5.17438790003025 1.22173047639603 5.4428641952928 0.959931088596881 5.56918697681827 1.0471975511966 5.08618810627973 1.13446401379631 5.68452516864586 0.959931088596881 5.8547863089628 1.0471975511966 4.64518913752715 1.30899693899575 5.41378734021022 1.13446401379631 5.54398703574669 1.22173047639603 5.94815532139466 0.959931088596881 6.04152433382652 0.872664625997165 5.0147882732436 1.30899693899575 4.85518864645695 1.39626340159546 5.69938667235474 1.13446401379631 5.91358617146314 1.22173047639603 5.30038760538813 1.30899693899575 6.02698590628523 1.13446401379631 6.14038564110732 1.0471975511966 4.99798831252922 1.48352986419518 4.71238898038469 1.48352986419518 5.77078650539087 1.30899693899575 5.42638731074601 1.39626340159546 5.56918697681827 1.48352986419518 5.28358764467374 1.48352986419518 6.14038564110732 1.30899693899575 5.99758597503506 1.39626340159546 6.14038564110732 1.48352986419518 5.8547863089628 1.48352986419518 0.214199499108395 -1.52716309549504 0.42839899821679 -1.48352986419518 0.142799666072263 -1.48352986419518 0.356999165180658 -1.52716309549504 0.499798831252922 -1.52716309549504 0.713998330361317 -1.48352986419518 0.642598497325185 -1.52716309549504 0.785398163397448 -1.52716309549504 0.999597662505843 -1.48352986419518 0.613198566075013 -1.39626340159546 0.285599332144527 -1.39626340159546 0.85679799643358 -1.39626340159546 0.51239880178871 -1.30899693899575 1.21379716161424 -1.43989663289532 1.28519699465037 -1.48352986419518 1.42799666072263 -1.39626340159546 1.06259751518478 -1.35263017029561 1.26839703393599 -1.30899693899575 0.982797701791459 -1.30899693899575 0.167514992892463 -1.00356431989674 0.142799666072263 -1.0471975511966 0.42839899821679 -1.0471975511966 0.335029985784925 -0.959931088596881 0.167514992892463 -0.916297857297023 0.241660973353061 -0.872664625997165 1.78499582590329 -1.43989663289532 1.5707963267949 -1.48352986419518 2.07059515804782 -1.43989663289532 1.99919532501169 -1.39626340159546 2.0943951023932 -1.51261868506175 1.81859574733206 -1.35263017029561 2.10839506965518 -1.30899693899575 1.63799616965243 -1.30899693899575 1.84799567858223 -1.22173047639603 0.432975910590901 -0.829031394697306 0.483321946706122 -0.872664625997165 0.624290847828741 -0.785398163397448 2.35619449019235 -1.43989663289532 2.35619449019235 -1.52716309549504 2.57039398930074 -1.39626340159546 2.39399440179971 -1.30899693899575 0.39337036218026 -0.785398163397448 2.1965948634057 -1.35263017029561 0.46922505659386 -0.74176493209759 0.523598775598299 -0.698131700797732 0.314159265358979 -0.698131700797732 1.27695855237697 -0.916297857297023 1.44996584011837 -0.872664625997165 1.2083048667653 -0.872664625997165 1.10395126463557 -0.959931088596881 1.23918376891597 -0.843575805130592 1.05928059986425 -0.785398163397448 0.966643893412244 -0.872664625997165 0.687818391581402 -0.654498469497873 0.733038285837618 -0.698131700797732 0.942477796076938 -0.698131700797732 0.852038007564504 -0.610865238198015 1.25462321999131 -0.829031394697306 0.648945149150619 -0.610865238198015 2.95259309555297 -1.35263017029561 3.14159265358979 -1.39626340159546 3.04919286966068 -1.30899693899575 2.76359353751615 -1.30899693899575 1.29020108551273 -0.785398163397448 1.21031870820991 -0.74176493209759 1.36135681655558 -0.698131700797732 1.15191730631626 -0.698131700797732 0.711618335926779 -0.567232006898157 0.951997773815089 -0.523598775598299 0.761598219052071 -0.523598775598299 0.571198664289053 -0.523598775598299 1.86463410121282 -0.916297857297023 2.03764138895422 -0.959931088596881 1.93328778682449 -0.872664625997165 1.69162681347143 -0.872664625997165 2.57879396965793 -1.13446401379631 2.58719395001512 -1.22173047639603 2.83499337055229 -1.13446401379631 2.713193655373 -1.0471975511966 2.32259456876358 -1.13446401379631 2.51789411206829 -1.09083078249646 2.42759432322848 -1.0471975511966 3.33059221162661 -1.35263017029561 3.51959176966343 -1.30899693899575 3.2339924375189 -1.30899693899575 3.71279131787885 -1.39626340159546 1.90240888467382 -0.843575805130592 2.17494876017755 -0.872664625997165 2.08231205372554 -0.785398163397448 1.88696943359848 -0.829031394697306 1.40657671081179 -0.654498469497873 1.5707963267949 -0.698131700797732 1.24235709482869 -0.610865238198015 1.85139156807706 -0.785398163397448 3.92699081698724 -1.43989663289532 3.88919090537988 -1.30899693899575 1.44544995324258 -0.610865238198015 1.38277676646642 -0.567232006898157 1.33279688334112 -0.523598775598299 1.14239732857811 -0.523598775598299 1.52319643810414 -0.523598775598299 1.93127394537988 -0.74176493209759 1.98967534727354 -0.698131700797732 1.78023583703422 -0.698131700797732 4.08659044377389 -1.35263017029561 4.1747902375244 -1.30899693899575 4.2839899821679 -1.39626340159546 4.21259014913177 -1.43989663289532 1.47355655418378 -0.479965544298441 1.43116998663535 -0.436332312998582 1.61431622502644 -0.436332312998582 4.4981894812763 -1.43989663289532 4.71238898038469 -1.48352986419518 4.85518864645695 -1.39626340159546 2.70861674299889 -0.829031394697306 2.51730180576105 -0.785398163397448 2.65827070688367 -0.872664625997165 2.89993168023673 -0.872664625997165 2.97407766069733 -0.916297857297023 3.14159265358979 -0.872664625997165 2.80656266780487 -0.959931088596881 3.70439133752165 -1.13446401379631 3.56999165180658 -1.0471975511966 3.4481919366273 -1.13446401379631 3.69599135716446 -1.22173047639603 3.96059073841601 -1.13446401379631 1.48035653828246 -0.392699081698724 1.52591643174361 -0.349065850398866 1.34639685153848 -0.349065850398866 1.75915588632831 -0.479965544298441 1.71359599286716 -0.523598775598299 1.90399554763018 -0.523598775598299 2.74822229140953 -0.785398163397448 4.46458955984753 -1.35263017029561 4.43518962859735 -1.22173047639603 4.64518913752715 -1.30899693899575 2.67236759699593 -0.74176493209759 2.61799387799149 -0.698131700797732 2.82743338823081 -0.698131700797732 3.7652911951113 -1.09083078249646 3.85559098395111 -1.0471975511966 1.8010891216035 -0.436332312998582 3.30910764648225 -0.916297857297023 3.38325362694285 -0.872664625997165 3.47662263937472 -0.959931088596881 1.74963590859016 -0.392699081698724 1.88495559215388 -0.349065850398866 1.70543601194874 -0.349065850398866 5.06938814556535 -1.43989663289532 5.28358764467374 -1.48352986419518 5.42638731074601 -1.39626340159546 4.99798831252922 -1.48352986419518 2.7822134939746 -0.654498469497873 3.03687289847013 -0.698131700797732 2.9464331099577 -0.610865238198015 5.49778714378214 -1.52716309549504 5.56918697681827 -1.48352986419518 2.74334025154381 -0.610865238198015 5.6405868098544 -1.52716309549504 3.57456856418069 -0.829031394697306 3.62491460029591 -0.872664625997165 3.76588350141853 -0.785398163397448 2.80601343831997 -0.567232006898157 2.85599332144527 -0.523598775598299 2.66559376668225 -0.523598775598299 3.04639287620829 -0.523598775598299 5.2205877919948 -1.35263017029561 5.0147882732436 -1.30899693899575 5.30038760538813 -1.30899693899575 3.53496301577005 -0.785398163397448 5.78338647592667 -1.52716309549504 5.8547863089628 -1.48352986419518 5.92618614199893 -1.52716309549504 6.14038564110732 -1.48352986419518 3.61081771018365 -0.74176493209759 3.66519142918809 -0.698131700797732 3.45575191894877 -0.698131700797732 5.66998674110457 -1.39626340159546 5.77078650539087 -1.30899693899575 5.99758597503506 -1.39626340159546 6.06898580807119 -1.52716309549504 3.50097181320499 -0.654498469497873 3.24631240870945 -0.698131700797732 3.33675219722189 -0.610865238198015 4.41855120596676 -0.916297857297023 4.59155849370816 -0.872664625997165 4.3498975203551 -0.872664625997165 4.24554391822537 -0.959931088596881 3.53984505563577 -0.610865238198015 3.47717186885961 -0.567232006898157 3.42719198573432 -0.523598775598299 3.2367924309713 -0.523598775598299 3.61759154049734 -0.523598775598299 4.38077642250577 -0.843575805130592 4.20087325345404 -0.785398163397448 4.10823654700204 -0.872664625997165 4.3962158735811 -0.829031394697306 4.43179373910252 -0.785398163397448 4.35191136179971 -0.74176493209759 4.50294947014537 -0.698131700797732 4.29350995990605 -0.698131700797732 5.00622675480261 -0.916297857297023 5.07488044041428 -0.872664625997165 4.83321946706122 -0.872664625997165 5.17923404254401 -0.959931088596881 0.711618335926779 0.567232006898157 0.951997773815089 0.523598775598299 0.852038007564504 0.610865238198016 0.761598219052071 0.523598775598299 0.571198664289053 0.523598775598299 0.648945149150619 0.610865238198016 5.04400153826361 -0.843575805130592 5.31654141376734 -0.872664625997165 5.22390470731533 -0.785398163397448 5.02856208718828 -0.829031394697306 4.99298422166685 -0.785398163397448 0.687818391581402 0.654498469497874 0.733038285837618 0.698131700797732 0.523598775598299 0.698131700797732 0.942477796076938 0.698131700797732 0.0897597901025655 -0.349065850398866 1.48035653828246 0.392699081698724 1.34639685153848 0.349065850398866 1.52591643174361 0.349065850398866 0.46922505659386 0.74176493209759 0.314159265358979 0.698131700797732 0.624290847828741 0.785398163397448 1.43116998663535 0.436332312998583 1.61431622502644 0.436332312998583 0.39337036218026 0.785398163397448 5.07286659896967 -0.74176493209759 5.13126800086333 -0.698131700797732 4.92182849062401 -0.698131700797732 4.87660859636779 -0.654498469497873 5.0408282123509 -0.610865238198015 4.71238898038469 -0.698131700797732 1.47355655418378 0.479965544298441 1.52319643810414 0.523598775598299 1.33279688334112 0.523598775598299 0.167514992892463 0.916297857297022 0.241660973353061 0.872664625997165 0.335029985784925 0.959931088596881 0.432975910590901 0.829031394697306 0.483321946706122 0.872664625997165 1.74963590859016 0.392699081698724 1.70543601194874 0.349065850398866 1.88495559215388 0.349065850398866 4.83773535393701 -0.610865238198015 4.52402942085128 -0.479965544298441 4.37918975954941 -0.523598775598299 4.56958931431243 -0.523598775598299 1.38277676646642 0.567232006898157 1.14239732857811 0.523598775598299 1.24235709482869 0.610865238198016 6.11567031428712 -1.00356431989674 5.94815532139466 -0.959931088596881 5.8547863089628 -1.0471975511966 6.14038564110732 -1.0471975511966 1.8010891216035 0.436332312998583 4.48209618557609 -0.436332312998582 4.66886908215314 -0.436332312998582 0.167514992892463 1.00356431989674 0.42839899821679 1.0471975511966 0.142799666072263 1.0471975511966 4.90040854071317 -0.567232006898157 5.14078797860148 -0.523598775598299 4.95038842383846 -0.523598775598299 4.75998886907545 -0.523598775598299 1.75915588632831 0.479965544298441 1.90399554763018 0.523598775598299 1.71359599286716 0.523598775598299 1.44544995324258 0.610865238198016 4.53354939858943 -0.392699081698724 4.57774929523084 -0.349065850398866 4.39822971502571 -0.349065850398866 5.85020939658868 -0.829031394697306 5.65889445935084 -0.785398163397448 5.79986336047346 -0.872664625997165 6.04152433382652 -0.872664625997165 6.11567031428712 -0.916297857297023 4.8096287529958 -0.479965544298441 1.40657671081179 0.654498469497874 1.5707963267949 0.698131700797732 1.36135681655558 0.698131700797732 1.15191730631626 0.698131700797732 0.174532925199433 -0.174532925199433 0.269279370307697 -0.349065850398866 1.21031870820991 0.74176493209759 1.05928059986425 0.785398163397448 5.88981494499933 -0.785398163397448 4.85201532054424 -0.436332312998582 5.81396025058573 -0.74176493209759 5.96902604182061 -0.698131700797732 5.75958653158129 -0.698131700797732 4.80282876889712 -0.392699081698724 4.9367884556411 -0.349065850398866 4.75726887543597 -0.349065850398866 5.59536691559819 -0.654498469497873 5.55014702134197 -0.698131700797732 5.34070751110265 -0.698131700797732 5.43114729961508 -0.610865238198015 1.29020108551273 0.785398163397448 1.25462321999131 0.829031394697306 1.23918376891597 0.843575805130593 1.2083048667653 0.872664625997165 0.966643893412244 0.872664625997165 0.349065850398866 -0.174532925199433 0.448798950512828 -0.349065850398866 1.44996584011837 0.872664625997165 5.63424015802897 -0.610865238198015 5.57156697125281 -0.567232006898157 5.71198664289054 -0.523598775598299 5.52158708812752 -0.523598775598299 5.3311875333645 -0.523598775598299 1.27695855237697 0.916297857297023 1.10395126463557 0.959931088596881 1.93127394537988 0.74176493209759 1.78023583703422 0.698131700797732 1.98967534727354 0.698131700797732 2.08231205372554 0.785398163397448 1.85139156807706 0.785398163397448 1.88696943359848 0.829031394697306 1.69162681347143 0.872664625997165 1.90240888467382 0.843575805130593 2.17494876017755 0.872664625997165 1.93328778682449 0.872664625997165 2.80601343831997 0.567232006898157 2.85599332144527 0.523598775598299 3.04639287620829 0.523598775598299 2.66559376668225 0.523598775598299 0.523598775598299 -0.174532925199433 2.9464331099577 0.610865238198016 2.74334025154381 0.610865238198016 0.628318530717959 -0.349065850398866 1.86463410121282 0.916297857297023 2.03764138895422 0.959931088596881 2.7822134939746 0.654498469497874 2.82743338823081 0.698131700797732 2.61799387799149 0.698131700797732 3.03687289847013 0.698131700797732 0.214199499108395 1.52716309549504 0.142799666072263 1.48352986419518 0.613198566075013 1.39626340159546 0.51239880178871 1.30899693899575 0.85679799643358 1.39626340159546 0.42839899821679 1.48352986419518 0.285599332144527 1.39626340159546 0.713998330361317 1.48352986419518 0.0849079095564809 2.22044604925031e-16 2.67236759699593 0.74176493209759 2.51730180576105 0.785398163397448 0.356999165180658 1.52716309549504 0.499798831252922 1.52716309549504 2.74822229140953 0.785398163397448 1.06259751518478 1.35263017029561 1.26839703393599 1.30899693899575 1.42799666072263 1.39626340159546 0.982797701791459 1.30899693899575 3.47717186885961 0.567232006898157 3.2367924309713 0.523598775598299 3.42719198573432 0.523598775598299 3.33675219722189 0.610865238198016 3.61759154049734 0.523598775598299 2.70861674299889 0.829031394697306 2.89993168023673 0.872664625997165 2.65827070688367 0.872664625997165 0.642598497325185 1.52716309549504 0.698131700797732 -0.174532925199433 0.80783811092309 -0.349065850398866 3.53984505563577 0.610865238198016 0.254723728669443 2.22044604925031e-16 0.785398163397448 1.52716309549504 0.999597662505843 1.48352986419518 3.50097181320499 0.654498469497874 3.45575191894877 0.698131700797732 3.24631240870945 0.698131700797732 3.66519142918809 0.698131700797732 1.21379716161424 1.43989663289532 1.28519699465037 1.48352986419518 4.53354939858943 0.392699081698724 4.39822971502571 0.349065850398866 4.57774929523084 0.349065850398866 2.97407766069733 0.916297857297023 2.80656266780487 0.959931088596881 3.14159265358979 0.872664625997165 4.48209618557609 0.436332312998583 4.66886908215314 0.436332312998583 2.51789411206829 1.09083078249646 2.42759432322848 1.0471975511966 2.713193655373 1.0471975511966 2.32259456876358 1.13446401379631 3.61081771018365 0.74176493209759 3.76588350141853 0.785398163397448 0.872664625997165 -0.174532925199433 0.987357691128221 -0.349065850398866 1.81859574733206 1.35263017029561 2.10839506965518 1.30899693899575 1.99919532501169 1.39626340159546 1.63799616965243 1.30899693899575 1.84799567858223 1.22173047639603 3.53496301577005 0.785398163397448 4.52402942085128 0.479965544298441 4.56958931431243 0.523598775598299 4.37918975954941 0.523598775598299 4.80282876889712 0.392699081698724 4.75726887543597 0.349065850398866 4.9367884556411 0.349065850398866 0.424539547782404 2.22044604925031e-16 2.57879396965793 1.13446401379631 2.83499337055229 1.13446401379631 2.58719395001512 1.22173047639603 3.30910764648225 0.916297857297023 3.38325362694285 0.872664625997165 3.47662263937472 0.959931088596881 3.57456856418069 0.829031394697306 3.62491460029591 0.872664625997165 1.78499582590329 1.43989663289532 1.5707963267949 1.48352986419518 4.85201532054424 0.436332312998583 4.8096287529958 0.479965544298441 4.95038842383846 0.523598775598299 4.75998886907545 0.523598775598299 2.1965948634057 1.35263017029561 2.39399440179971 1.30899693899575 2.07059515804782 1.43989663289532 4.35191136179971 0.74176493209759 4.29350995990605 0.698131700797732 4.50294947014537 0.698131700797732 4.20087325345404 0.785398163397448 1.0471975511966 -0.174532925199433 1.16687727133335 -0.349065850398866 4.90040854071317 0.567232006898157 5.14078797860148 0.523598775598299 0.594355366895366 2.22044604925031e-16 5.0408282123509 0.610865238198016 2.0943951023932 1.51261868506175 4.83773535393701 0.610865238198016 2.35619449019235 1.43989663289532 2.57039398930074 1.39626340159546 4.43179373910252 0.785398163397448 1.22173047639603 -0.174532925199433 4.87660859636779 0.654498469497874 5.13126800086333 0.698131700797732 4.92182849062401 0.698131700797732 4.71238898038469 0.698131700797732 4.3962158735811 0.829031394697306 0.174532925199433 0.174532925199433 4.38077642250577 0.843575805130593 4.10823654700204 0.872664625997165 4.3498975203551 0.872664625997165 4.59155849370816 0.872664625997165 2.35619449019235 1.52716309549504 2.95259309555297 1.35263017029561 2.76359353751615 1.30899693899575 3.04919286966068 1.30899693899575 3.14159265358979 1.39626340159546 3.7652911951113 1.09083078249646 3.85559098395111 1.0471975511966 3.96059073841601 1.13446401379631 3.56999165180658 1.0471975511966 3.70439133752165 1.13446401379631 3.4481919366273 1.13446401379631 4.41855120596676 0.916297857297023 4.24554391822537 0.959931088596881 5.57156697125281 0.567232006898157 5.52158708812752 0.523598775598299 5.71198664289054 0.523598775598299 5.3311875333645 0.523598775598299 5.43114729961508 0.610865238198016 0.764171186008328 2.22044604925031e-16 5.07286659896967 0.74176493209759 5.22390470731533 0.785398163397448 4.99298422166685 0.785398163397448 3.33059221162661 1.35263017029561 3.2339924375189 1.30899693899575 3.51959176966343 1.30899693899575 3.71279131787885 1.39626340159546 5.63424015802897 0.610865238198016 5.02856208718828 0.829031394697306 4.83321946706122 0.872664625997165 1.39626340159546 -0.174532925199433 5.59536691559819 0.654498469497874 5.34070751110265 0.698131700797732 0.349065850398866 0.174532925199433 5.04400153826361 0.843575805130593 5.00622675480261 0.916297857297023 5.81396025058573 0.74176493209759 5.96902604182061 0.698131700797732 0.93398700512129 2.22044604925031e-16 4.08659044377389 1.35263017029561 4.2839899821679 1.39626340159546 5.88981494499933 0.785398163397448 3.92699081698724 1.43989663289532 5.85020939658868 0.829031394697306 4.46458955984753 1.35263017029561 4.21259014913177 1.43989663289532 4.4981894812763 1.43989663289532 6.11567031428712 0.916297857297022 1.5707963267949 -0.174532925199433 6.11567031428712 1.00356431989674 5.2205877919948 1.35263017029561 0.523598775598299 0.174532925199433 5.06938814556535 1.43989663289532 5.66998674110457 1.39626340159546 5.49778714378214 1.52716309549504 1.10380282423425 2.22044604925031e-16 5.6405868098544 1.52716309549504 5.78338647592667 1.52716309549504 5.92618614199893 1.52716309549504 0.0897597901025655 0.349065850398866 6.06898580807119 1.52716309549504 0.392699081698724 -1.54897971114497 1.17809724509617 -1.54897971114497 1.17809724509617 -1.50534647984511 1.74532925199433 -0.174532925199433 1.43989663289532 -1.5198908902784 1.5707963267949 -1.52716309549504 0.211677111844441 -0.843575805130593 0.698131700797732 0.174532925199433 0.19668518109013 -0.829031394697307 0.166030039099973 -0.785398163397449 0.10471975511966 -0.698131700797732 0.24904505864996 -0.74176493209759 1.27361864334721 2.22044604925031e-16 2.74889357189107 -1.50534647984511 1.42387743958593 -0.98174770424681 1.28519699465037 -1.0471975511966 1.5707963267949 -1.0471975511966 0.481552207254799 -0.654498469497873 2.85599332144527 -1.43989663289532 0.269279370307697 0.349065850398866 3.14159265358979 -1.48352986419518 0.447967841345211 -0.610865238198015 1.71771521400386 -0.98174770424681 1.85639565893942 -1.0471975511966 0.514872129338327 -0.567232006898157 0.380799109526035 -0.523598775598299 3.42719198573432 -1.43989663289532 3.53429173528852 -1.46171324854525 1.91986217719376 -0.174532925199433 2.06447517235901 -0.349065850398866 1.43049870615381 -0.74176493209759 0.872664625997165 0.174532925199433 1.44343446246017 2.22044604925031e-16 3.92699081698724 -1.48352986419518 1.71109394743598 -0.74176493209759 1.6128428951384 -0.654498469497873 4.31968989868597 -1.50534647984511 3.92699081698724 -1.52716309549504 4.31968989868597 -1.54897971114497 0.448798950512828 0.349065850398866 1.64642726104798 -0.610865238198015 1.28678365760673 -0.479965544298441 1.57952297305487 -0.567232006898157 4.31968989868597 -1.46171324854525 1.24681486218227 -0.436332312998582 2.0943951023932 -0.174532925199433 2.24399475256414 -0.349065850398866 4.71238898038469 -1.54170750592832 1.0471975511966 0.174532925199433 1.29902362898435 -0.392699081698724 1.61635622025605 -0.479965544298441 1.61325028157314 2.22044604925031e-16 3.15395031699989 -0.98174770424681 2.99879298751753 -1.0471975511966 3.28439231966206 -1.0471975511966 3.14159265358979 -0.916297857297023 2.92991554174535 -0.843575805130592 1.61499622343631 -0.392699081698724 0.628318530717959 0.349065850398866 2.94490747249966 -0.829031394697306 1.94774211199835 -0.479965544298441 2.0943951023932 -0.523598775598299 5.10508806208341 -1.50534647984511 2.57594730964799 -0.654498469497873 2.40855436775217 -0.698131700797732 2.26892802759263 -0.174532925199433 2.42351433276927 -0.349065850398866 2.97556261448982 -0.785398163397448 2.89254759493983 -0.74176493209759 1.22173047639603 0.174532925199433 1.98665313211857 -0.436332312998582 2.54236294373841 -0.610865238198015 1.93278214698125 -0.392699081698724 3.35326976543423 -0.843575805130592 1.7830661006861 2.22044604925031e-16 3.33827783467992 -0.829031394697306 2.60926723173152 -0.567232006898157 2.47519421191923 -0.523598775598299 3.30762269268977 -0.785398163397448 3.39063771223975 -0.74176493209759 0.80783811092309 0.349065850398866 5.89048622548086 -1.54897971114497 4.56547009317572 -0.98174770424681 4.42678964824016 -1.0471975511966 4.71238898038469 -1.0471975511966 3.70723799753159 -0.654498469497873 3.87463093942741 -0.698131700797732 3.74082236344118 -0.610865238198015 4.85930786759365 -0.98174770424681 4.99798831252922 -1.0471975511966 2.44346095279206 -0.174532925199433 2.6030339129744 -0.349065850398866 3.67391807544806 -0.567232006898157 3.80799109526036 -0.523598775598299 0.514872129338327 0.567232006898157 0.380799109526035 0.523598775598299 1.39626340159546 0.174532925199433 1.95288191979906 2.22044604925031e-16 0.447967841345211 0.610865238198016 4.57209135974361 -0.74176493209759 0.481552207254799 0.654498469497874 1.29902362898435 0.392699081698724 1.16687727133335 0.349065850398866 0.24904505864996 0.74176493209759 0.10471975511966 0.698131700797732 0.166030039099973 0.785398163397447 0.987357691128221 0.349065850398866 1.24681486218227 0.436332312998583 4.85268660102577 -0.74176493209759 0.19668518109013 0.829031394697305 4.67034241204119 -0.654498469497873 1.28678365760673 0.479965544298441 2.61799387799149 -0.174532925199433 2.78255349317953 -0.349065850398866 0.211677111844441 0.843575805130592 1.61499622343631 0.392699081698724 1.5707963267949 0.174532925199433 4.6367580461316 -0.610865238198015 2.12269773891202 2.22044604925031e-16 4.33544319518124 -0.479965544298441 4.18879020478639 -0.523598775598299 4.29653217506102 -0.436332312998582 4.70366233412472 -0.567232006898157 1.61635622025605 0.479965544298441 1.93278214698125 0.392699081698724 2.06447517235901 0.349065850398866 4.35040316019833 -0.392699081698724 4.21871013482058 -0.349065850398866 4.66682908692354 -0.479965544298441 1.57952297305487 0.567232006898157 1.98665313211857 0.436332312998583 1.94774211199835 0.479965544298441 2.0943951023932 0.523598775598299 1.64642726104798 0.610865238198016 4.66818908374328 -0.392699081698724 2.79252680319093 -0.174532925199433 2.96207307338466 -0.349065850398866 6.07150819533514 -0.843575805130593 1.74532925199433 0.174532925199433 4.99640164957286 -0.479965544298441 1.6128428951384 0.654498469497874 6.08650012608946 -0.829031394697307 1.43049870615381 0.74176493209759 2.29251355802498 2.22044604925031e-16 5.03637044499732 -0.436332312998582 6.11715526807961 -0.785398163397449 6.17846555205993 -0.698131700797732 6.03414024852963 -0.74176493209759 4.98416167819524 -0.392699081698724 5.11630803584623 -0.349065850398866 5.80163309992479 -0.654498469497873 1.71109394743598 0.74176493209759 5.83521746583438 -0.610865238198015 5.76831317784126 -0.567232006898157 5.90238619765355 -0.523598775598299 2.60926723173152 0.567232006898157 2.47519421191923 0.523598775598299 1.42387743958593 0.981747704246811 1.5707963267949 1.0471975511966 1.28519699465037 1.0471975511966 2.96705972839036 -0.174532925199433 3.14159265358979 -0.349065850398866 1.91986217719376 0.174532925199433 2.54236294373841 0.610865238198016 2.57594730964799 0.654498469497874 2.40855436775217 0.698131700797732 1.71771521400386 0.981747704246811 1.85639565893942 1.0471975511966 0.392699081698724 1.54897971114497 2.89254759493983 0.74176493209759 2.46232937713794 2.22044604925031e-16 2.97556261448982 0.785398163397448 3.67391807544806 0.567232006898157 3.80799109526036 0.523598775598299 2.94490747249966 0.829031394697306 2.92991554174535 0.843575805130593 4.35040316019833 0.392699081698724 4.21871013482058 0.349065850398866 3.74082236344118 0.610865238198016 3.14159265358979 -0.174532925199433 4.29653217506102 0.436332312998583 3.39063771223975 0.74176493209759 2.0943951023932 0.174532925199433 3.30762269268977 0.785398163397448 3.70723799753159 0.654498469497874 3.87463093942741 0.698131700797732 1.17809724509617 1.50534647984511 4.33544319518124 0.479965544298441 4.18879020478639 0.523598775598299 3.33827783467992 0.829031394697306 2.63214519625091 2.22044604925031e-16 1.17809724509617 1.54897971114497 4.66818908374328 0.392699081698724 3.35326976543423 0.843575805130593 3.14159265358979 0.916297857297023 1.43989663289532 1.5198908902784 3.15395031699989 0.981747704246811 3.28439231966206 1.0471975511966 2.99879298751753 1.0471975511966 4.66682908692354 0.479965544298441 3.31612557878922 -0.174532925199433 4.98416167819524 0.392699081698724 5.11630803584623 0.349065850398866 3.32111223379492 -0.349065850398866 1.5707963267949 1.52716309549504 2.26892802759263 0.174532925199433 5.03637044499732 0.436332312998583 2.80196101536387 2.22044604925031e-16 4.70366233412472 0.567232006898157 4.99640164957286 0.479965544298441 4.6367580461316 0.610865238198016 4.67034241204119 0.654498469497874 4.57209135974361 0.74176493209759 4.85268660102577 0.74176493209759 2.85599332144527 1.43989663289532 3.14159265358979 1.48352986419518 2.74889357189107 1.50534647984511 5.76831317784126 0.567232006898157 5.90238619765355 0.523598775598299 4.56547009317572 0.981747704246811 5.83521746583438 0.610865238198016 3.42719198573432 1.43989663289532 3.49065850398866 -0.174532925199433 3.50063181400006 -0.349065850398866 5.80163309992479 0.654498469497874 4.85930786759365 0.981747704246811 2.44346095279206 0.174532925199433 3.53429173528852 1.46171324854525 2.97177683447683 2.22044604925031e-16 6.03414024852963 0.74176493209759 6.17846555205993 0.698131700797732 3.92699081698724 1.48352986419518 6.11715526807961 0.785398163397447 6.08650012608946 0.829031394697305 6.07150819533514 0.843575805130592 4.31968989868597 1.46171324854525 4.31968989868597 1.50534647984511 3.92699081698724 1.52716309549504 4.31968989868597 1.54897971114497 4.71238898038469 1.54170750592832 5.10508806208341 1.50534647984511 3.66519142918809 -0.174532925199433 5.89048622548086 1.54897971114497 3.68015139420519 -0.349065850398866 1.83259571459405 -1.55625191636161 3.14159265358979 2.22044604925031e-16 2.61799387799149 0.174532925199433 2.15984494934298 -1.55988801896993 2.74889357189107 -1.54897971114497 0.288948953941283 -0.66904287993116 0.276343798232435 -0.654498469497873 0.247695717075963 -0.610865238198015 0.190399554763018 -0.523598775598299 3.14159265358979 -1.52716309549504 0.319183698054115 -0.567232006898157 1.55775212652868 -0.927206165121987 3.33794219443916 -1.51625478767007 3.53429173528852 -1.50534647984511 3.33794219443916 -1.53807140332 2.24399475256414 0.349065850398866 1.56106275981262 -0.807214779047377 3.31140847270275 2.22044604925031e-16 1.09940631799868 -0.479965544298441 3.83972435438752 -0.174532925199433 1.06205677570853 -0.436332312998582 3.85967097441032 -0.349065850398866 1.80544614845191 -0.66904287993116 2.79252680319093 0.174532925199433 1.81805130416076 -0.654498469497873 1.11708627665524 -0.392699081698724 1.84669938531723 -0.610865238198015 2.98025649240238 -0.970839396421846 1.77521140433908 -0.567232006898157 2.38334405633448 -0.66904287993116 2.19911485751286 -0.698131700797732 2.37073890062563 -0.654498469497873 2.34209081946916 -0.610865238198015 5.30143760293278 -1.55988801896993 2.42351433276927 0.349065850398866 2.13572389463739 -0.479965544298441 2.28479465715621 -0.523598775598299 2.41357880044731 -0.567232006898157 3.14159265358979 -0.785398163397448 3.48122429181572 2.22044604925031e-16 5.49778714378214 -1.55625191636161 4.01425727958696 -0.174532925199433 4.03919055461545 -0.349065850398866 2.17181418061297 -0.436332312998582 2.11532394234135 -0.392699081698724 2.96705972839036 0.174532925199433 3.17224779557995 -0.74176493209759 3.89984125084511 -0.66904287993116 4.08407044966673 -0.698131700797732 4.69934478011847 -0.927206165121987 3.91244640655396 -0.654498469497873 0.319183698054115 0.567232006898157 0.190399554763018 0.523598775598299 0.247695717075963 0.610865238198016 3.65104011092868 2.22044604925031e-16 3.94109448771043 -0.610865238198015 3.86960650673228 -0.567232006898157 3.99839065002337 -0.523598775598299 2.6030339129744 0.349065850398866 0.276343798232435 0.654498469497874 4.70265541340241 -0.807214779047377 4.18879020478639 -0.174532925199433 1.11708627665524 0.392699081698724 0.288948953941283 0.66904287993116 3.14159265358979 0.174532925199433 1.06205677570853 0.436332312998583 4.47773915872768 -0.66904287993116 4.46513400301883 -0.654498469497873 1.09940631799868 0.479965544298441 4.43648592186235 -0.610865238198015 4.1474614125422 -0.479965544298441 4.11137112656661 -0.436332312998582 3.82085593004164 2.22044604925031e-16 4.50797390284051 -0.567232006898157 4.16786136483823 -0.392699081698724 2.78255349317953 0.349065850398866 2.11532394234135 0.392699081698724 1.77521140433908 0.567232006898157 4.36332312998582 -0.174532925199433 2.17181418061297 0.436332312998583 3.31612557878922 0.174532925199433 2.13572389463739 0.479965544298441 2.28479465715621 0.523598775598299 1.84669938531723 0.610865238198016 5.18377898918091 -0.479965544298441 1.81805130416076 0.654498469497874 1.80544614845191 0.66904287993116 5.22112853147106 -0.436332312998582 5.99423635323831 -0.66904287993116 5.16609903052434 -0.392699081698724 5.29582761605137 -0.349065850398866 1.56106275981262 0.807214779047378 3.9906717491546 2.22044604925031e-16 6.00684150894715 -0.654498469497873 2.41357880044731 0.567232006898157 2.96207307338466 0.349065850398866 2.34209081946916 0.610865238198016 6.03548959010363 -0.610865238198015 4.53785605518525 -0.174532925199433 6.09278575241657 -0.523598775598299 5.96400160912548 -0.567232006898157 3.49065850398866 0.174532925199433 2.37073890062563 0.654498469497874 1.55775212652868 0.927206165121988 2.38334405633448 0.66904287993116 2.19911485751286 0.698131700797732 4.16786136483823 0.392699081698724 4.03919055461545 0.349065850398866 3.17224779557995 0.74176493209759 4.11137112656661 0.436332312998583 3.14159265358979 0.785398163397448 3.86960650673228 0.567232006898157 3.99839065002337 0.523598775598299 4.1474614125422 0.479965544298441 3.94109448771043 0.610865238198016 3.91244640655396 0.654498469497874 2.98025649240238 0.970839396421846 4.16048756826756 2.22044604925031e-16 3.89984125084511 0.66904287993116 4.08407044966673 0.698131700797732 4.71238898038469 -0.174532925199433 4.50797390284051 0.567232006898157 4.43648592186235 0.610865238198016 3.66519142918809 0.174532925199433 5.16609903052434 0.392699081698724 5.29582761605137 0.349065850398866 3.14159265358979 0.349065850398866 4.46513400301883 0.654498469497874 4.47773915872767 0.66904287993116 1.83259571459405 1.55625191636161 5.22112853147106 0.436332312998583 5.18377898918091 0.479965544298441 2.15984494934298 1.55988801896993 4.70265541340241 0.807214779047378 2.74889357189107 1.54897971114497 4.33030338738052 2.22044604925031e-16 4.7254331806509 0.927206165121988 5.96400160912548 0.567232006898157 6.09278575241657 0.523598775598299 4.88692190558412 -0.174532925199433 3.14159265358979 1.52716309549504 3.83972435438752 0.174532925199433 6.03548959010363 0.610865238198016 3.32111223379492 0.349065850398866 3.33794219443916 1.51625478767007 6.00684150894715 0.654498469497874 5.9942363532383 0.66904287993116 3.53429173528852 1.50534647984511 3.33794219443916 1.53807140332 5.30143760293278 1.55988801896993 5.49778714378214 1.55625191636161 3.23976742401447 -1.55443386505745 4.50011920649349 2.22044604925031e-16 1.40784298990196 -0.818123086872342 3.73064127613788 -1.55988801896993 5.06145483078355 -0.174532925199433 0.911827497380299 -0.479965544298441 0.877164368561229 -0.436332312998582 4.01425727958696 0.174532925199433 0.934947443315808 -0.392699081698724 2.05948851735331 -0.639954059064587 3.50063181400006 0.349065850398866 2.17696034141852 -0.66904287993116 2.16588308337135 -0.654498469497873 2.0943951023932 -0.610865238198015 2.0943951023932 -0.581776417331443 2.3235041962661 -0.479965544298441 4.66993502560645 2.22044604925031e-16 2.35684090843382 -0.436332312998582 2.29766425669112 -0.392699081698724 5.23598775598298 -0.174532925199433 4.54943564349176 -0.818123086872342 4.18879020478639 0.174532925199433 4.10622496576107 -0.66904287993116 0.934947443315808 0.392699081698724 4.11730222380824 -0.654498469497873 0.877164368561229 0.436332312998583 3.68015139420519 0.349065850398866 4.22369678982628 -0.639954059064587 4.18879020478639 -0.610865238198015 0.911827497380299 0.479965544298441 4.18879020478639 -0.581776417331443 3.95968111091349 -0.479965544298441 3.92634439874576 -0.436332312998582 3.98552105048847 -0.392699081698724 4.83975084471941 2.22044604925031e-16 2.29766425669112 0.392699081698724 5.41052068118242 -0.174532925199433 5.4753471962565 -0.349065850398866 2.35684090843382 0.436332312998583 4.36332312998582 0.174532925199433 2.3235041962661 0.479965544298441 2.0943951023932 0.581776417331443 3.85967097441032 0.349065850398866 1.40784298990196 0.818123086872342 5.37135780979929 -0.479965544298441 2.0943951023932 0.610865238198016 2.05948851735331 0.639954059064588 5.40602093861836 -0.436332312998582 2.16588308337135 0.654498469497874 5.34823786386378 -0.392699081698724 5.00956666383237 2.22044604925031e-16 2.17696034141852 0.66904287993116 3.98552105048847 0.392699081698724 5.58505360638185 -0.174532925199433 3.92634439874576 0.436332312998583 3.95968111091349 0.479965544298441 5.65486677646163 -0.349065850398866 4.53785605518525 0.174532925199433 4.18879020478639 0.581776417331443 4.18879020478639 0.610865238198016 4.11730222380824 0.654498469497874 4.10622496576107 0.66904287993116 4.22369678982628 0.639954059064588 6.19342551707702 -0.349065850398866 5.34823786386378 0.392699081698724 5.17938248294534 2.22044604925031e-16 5.4753471962565 0.349065850398866 5.40602093861836 0.436332312998583 5.37135780979929 0.479965544298441 4.54943564349176 0.818123086872342 5.75958653158128 -0.174532925199433 5.83438635666676 -0.349065850398866 3.23976742401447 1.55443386505745 4.71238898038469 0.174532925199433 3.73064127613788 1.55988801896993 0.724181516425141 -0.479965544298441 0.69222718785608 -0.436332312998582 0.752741449639594 -0.392699081698724 2.51121733755804 -0.479965544298441 2.54182286269682 -0.436332312998582 5.3491983020583 2.22044604925031e-16 2.47993741070411 -0.392699081698724 0.752741449639594 0.392699081698724 0.69222718785608 0.436332312998583 5.93411945678072 -0.174532925199433 6.01390593687189 -0.349065850398866 0.724181516425141 0.479965544298441 4.88692190558412 0.174532925199433 3.77196796962155 -0.479965544298441 3.74136244448276 -0.436332312998582 5.51901412117126 2.22044604925031e-16 3.80324789647547 -0.392699081698724 2.47993741070411 0.392699081698724 2.54182286269682 0.436332312998583 2.51121733755804 0.479965544298441 5.55900379075445 -0.479965544298441 5.59095811932351 -0.436332312998582 5.53044385753999 -0.392699081698724 3.80324789647547 0.392699081698724 6.10865238198015 -0.174532925199433 3.74136244448276 0.436332312998583 5.06145483078355 0.174532925199433 3.77196796962155 0.479965544298441 5.53044385753999 0.392699081698724 5.65486677646163 0.349065850398866 5.59095811932351 0.436332312998583 5.68882994028422 2.22044604925031e-16 5.55900379075445 0.479965544298441 0.536513148691058 -0.479965544298441 5.23598775598298 0.174532925199433 0.507275082631648 -0.436332312998582 2.68780331694145 -0.494509954731727 2.69890809207105 -0.479965544298441 2.72678989244054 -0.436332312998582 0.507275082631648 0.436332312998583 0.536513148691058 0.479965544298441 3.59538199023814 -0.494509954731727 5.85864575939718 2.22044604925031e-16 3.58427721510854 -0.479965544298441 3.55639541473905 -0.436332312998582 2.72678989244054 0.436332312998583 5.41052068118242 0.174532925199433 2.69890809207105 0.479965544298441 2.68780331694145 0.494509954731727 5.74667215848853 -0.479965544298441 5.77591022454794 -0.436332312998582 3.55639541473905 0.436332312998583 3.58427721510854 0.479965544298441 3.59538199023814 0.494509954731727 6.02846157851015 2.22044604925031e-16 5.77591022454794 0.436332312998583 5.58505360638185 0.174532925199433 5.83438635666676 0.349065850398866 5.74667215848853 0.479965544298441 0.359491248973567 -0.494509954731727 0.348837318697333 -0.479965544298441 0.322318002567454 -0.436332312998582 2.87639203003136 -0.494509954731727 2.88659138432441 -0.479965544298441 6.19827739762311 2.22044604925031e-16 2.9117519473445 -0.436332312998582 0.322318002567454 0.436332312998583 0.348837318697333 0.479965544298441 0.359491248973567 0.494509954731727 3.40679327714822 -0.494509954731727 5.75958653158128 0.174532925199433 3.39659392285517 -0.479965544298441 3.37143335983509 -0.436332312998582 2.9117519473445 0.436332312998583 2.88659138432441 0.479965544298441 2.87639203003136 0.494509954731727 5.92369405820602 -0.494509954731727 5.93411945678072 0.174532925199433 5.93434798848226 -0.479965544298441 5.96086730461213 -0.436332312998582 3.37143335983509 0.436332312998583 3.39659392285517 0.479965544298441 3.40679327714822 0.494509954731727 5.96086730461213 0.436332312998583 6.01390593687189 0.349065850398866 5.93434798848226 0.479965544298441 6.10865238198015 0.174532925199433 5.92369405820602 0.494509954731727 0.170905852443491 -0.494509954731727 0.161159001283727 -0.479965544298441 0.13735926422334 -0.436332312998583 0.13735926422334 0.436332312998582 0.161159001283727 0.47996554429844 0.170905852443491 0.494509954731726 3.10985939446262 -0.465421133865154 3.21820622233823 -0.494509954731727 3.20891311802169 -0.479965544298441 3.14159265358979 -0.436332312998582 3.14159265358979 -0.40724349213201 3.14159265358979 0.40724349213201 3.14159265358979 0.436332312998583 3.10985939446262 0.465421133865155 6.1122794547361 -0.494509954731727 3.20891311802169 0.479965544298441 6.12202630589586 -0.479965544298441 3.21820622233823 0.494509954731727 6.14582604295625 -0.436332312998583 6.14582604295625 0.436332312998582 6.19342551707702 0.349065850398866 6.12202630589586 0.47996554429844 6.1122794547361 0.494509954731726 0.142799666072263 -1.30899693899575 0.369599135716446 -1.22173047639603 0.739198271432893 -1.22173047639603 0.256199400894355 -1.13446401379631 1.10879740714934 -1.22173047639603 0.583798634824841 -1.13446401379631 0.713998330361317 -1.0471975511966 1.47839654286579 -1.22173047639603 0.869397966969368 -1.13446401379631 0.999597662505843 -1.0471975511966 0.598660138533719 -0.959931088596881 0.724982920059183 -0.872664625997165 1.19699720089985 -1.13446401379631 0.84032111188678 -0.959931088596881 1.38179676875808 -1.13446401379631 2.21759481429868 -1.22173047639603 1.70939600268856 -1.13446401379631 0.83373035806806 -0.785398163397448 1.99499533483309 -1.13446401379631 2.14199499108395 -1.0471975511966 2.95679308573157 -1.22173047639603 3.32639222144802 -1.22173047639603 1.05195754006567 -0.610865238198015 2.30127154170301 -0.959931088596881 2.41660973353061 -0.872664625997165 2.54293251505607 -0.959931088596881 3.12059270269681 -1.13446401379631 2.30786229552173 -0.785398163397448 4.06559049288091 -1.22173047639603 4.14119031609564 -1.0471975511966 4.8047887643138 -1.22173047639603 3.74025279212351 -0.959931088596881 3.86657557364897 -0.872664625997165 4.28818997234649 -1.13446401379631 5.17438790003025 -1.22173047639603 3.98191376547657 -0.959931088596881 4.57378930449102 -1.13446401379631 3.14635264245887 -0.610865238198015 5.54398703574669 -1.22173047639603 4.90138853842151 -1.13446401379631 3.97532301165785 -0.785398163397448 5.08618810627973 -1.13446401379631 5.28358764467374 -1.0471975511966 5.91358617146314 -1.22173047639603 5.41378734021022 -1.13446401379631 5.56918697681827 -1.0471975511966 6.14038564110732 -1.30899693899575 5.69938667235474 -1.13446401379631 5.4428641952928 -0.959931088596881 5.5582023871204 -0.872664625997165 6.02698590628523 -1.13446401379631 5.68452516864586 -0.959931088596881 1.05195754006567 0.610865238198016 0.724982920059183 0.872664625997165 5.44945494911152 -0.785398163397448 0.83373035806806 0.785398163397448 5.24074774485207 -0.610865238198015 0.598660138533719 0.959931088596881 0.713998330361317 1.0471975511966 0.256199400894355 1.13446401379631 0.369599135716446 1.22173047639603 0.84032111188678 0.959931088596881 0.999597662505843 1.0471975511966 0.583798634824841 1.13446401379631 0.739198271432893 1.22173047639603 0.142799666072263 1.30899693899575 0.869397966969368 1.13446401379631 1.10879740714934 1.22173047639603 1.19699720089985 1.13446401379631 2.30786229552173 0.785398163397448 2.41660973353061 0.872664625997165 1.38179676875808 1.13446401379631 1.47839654286579 1.22173047639603 2.14199499108395 1.0471975511966 3.14635264245887 0.610865238198016 1.70939600268856 1.13446401379631 2.30127154170301 0.959931088596881 1.99499533483309 1.13446401379631 2.21759481429868 1.22173047639603 2.54293251505607 0.959931088596881 3.86657557364897 0.872664625997165 2.95679308573157 1.22173047639603 3.97532301165785 0.785398163397448 3.16259260448277 1.13446401379631 3.32639222144802 1.22173047639603 3.74025279212351 0.959931088596881 3.98191376547657 0.959931088596881 4.14119031609564 1.0471975511966 5.24074774485207 0.610865238198016 39 40 41 42 43 44 42 44 45 42 46 43 42 45 47 48 49 50 48 50 51 48 52 49 48 53 52 54 55 56 54 57 58 59 41 43 59 39 41 60 46 42 60 47 56 60 42 47 60 61 46 62 58 52 62 54 58 62 55 54 62 63 55 64 56 55 64 61 60 64 60 56 65 52 53 65 62 52 65 63 62 65 66 63 67 43 46 68 64 55 68 55 63 68 61 64 68 69 61 70 53 71 70 65 53 70 66 65 72 46 61 72 67 46 72 73 67 74 63 66 74 69 68 74 68 63 74 75 69 76 61 69 76 72 61 77 19 75 77 18 19 77 74 66 77 78 18 77 66 78 77 75 74 79 80 73 81 76 69 81 82 76 81 69 75 83 84 82 85 20 86 85 81 75 85 75 19 85 86 81 85 19 20 87 86 20 87 88 86 87 20 2 89 90 91 89 91 21 92 90 89 93 94 90 93 90 92 95 94 93 96 97 94 96 94 95 98 90 94 98 99 90 98 100 101 98 101 99 98 94 100 102 103 104 102 100 97 105 106 107 105 107 100 105 104 106 105 102 104 105 100 102 108 25 24 108 109 110 108 24 109 108 110 111 112 111 113 112 113 25 112 108 111 112 25 108 114 104 115 116 117 114 116 114 118 119 117 120 119 104 114 119 121 104 119 114 117 119 120 122 119 122 121 123 113 124 123 124 125 126 116 118 126 118 127 126 128 129 130 123 125 131 120 117 131 117 116 131 129 120 131 116 126 131 126 129 132 130 125 132 133 134 132 125 133 135 136 137 135 137 138 139 140 141 139 141 137 139 137 136 142 143 144 142 133 143 142 144 145 146 140 139 147 142 145 148 149 150 148 151 128 148 150 151 152 140 146 153 154 155 153 155 140 153 140 152 156 157 158 156 145 157 156 147 145 156 158 159 160 161 162 160 162 163 164 165 166 164 166 167 164 168 165 169 167 170 169 164 167 169 168 164 169 170 168 171 172 173 171 174 172 171 173 149 175 163 162 175 176 177 175 162 176 178 175 177 178 163 175 179 155 154 179 154 180 179 181 155 182 178 177 182 163 178 183 184 174 185 181 179 186 181 185 186 187 188 186 189 187 186 188 181 190 177 191 190 182 177 190 191 192 193 194 184 193 195 194 193 196 195 193 183 196 193 184 183 197 187 189 198 197 199 200 201 202 203 204 205 203 205 206 207 208 206 207 206 209 210 211 212 210 212 213 210 213 214 215 216 217 215 198 199 218 219 220 221 204 203 222 200 202 222 194 195 222 223 194 222 202 224 222 224 223 222 195 200 225 226 204 225 204 221 225 227 226 228 229 211 228 214 229 228 210 214 228 211 210 230 199 218 231 232 208 231 233 232 234 235 236 234 199 230 237 238 239 237 202 240 241 242 243 241 227 242 241 226 227 244 245 238 246 241 243 247 245 244 248 249 250 248 232 249 251 246 243 251 252 253 251 254 252 251 243 254 255 256 202 255 237 239 255 202 237 255 257 256 255 239 257 258 248 250 259 245 247 259 260 245 261 262 260 261 260 259 263 250 264 263 258 250 263 264 265 266 267 239 266 268 267 266 239 245 266 260 268 266 245 260 269 262 261 269 3 262 270 271 265 270 272 271 270 265 264 273 274 275 273 275 276 277 272 270 278 279 280 278 272 277 278 280 272 278 281 279 282 283 284 282 275 274 282 284 275 285 283 282 286 283 285 287 288 289 287 289 283 287 283 286 290 291 292 290 293 291 294 295 296 294 297 295 294 298 297 299 294 296 300 292 291 300 301 302 300 291 301 303 292 300 303 300 302 304 303 302 304 292 303 305 306 307 305 308 306 309 29 28 305 296 308 305 299 296 310 311 312 313 314 307 313 307 315 316 310 317 318 313 315 319 320 321 319 304 302 319 302 320 322 321 320 322 320 323 322 324 321 325 326 327 325 316 317 328 36 35 328 329 330 328 35 329 331 318 315 331 315 332 331 332 329 333 334 335 336 322 323 337 338 339 340 327 326 340 341 327 340 342 341 343 6 7 343 344 345 343 345 346 343 346 6 347 317 333 348 337 349 350 328 330 350 351 352 350 330 351 350 352 36 350 36 328 353 323 354 353 354 355 353 336 323 353 355 356 357 317 347 357 358 359 360 342 340 361 348 349 361 362 363 364 365 366 364 366 367 368 7 367 368 344 343 368 343 7 368 367 344 369 356 355 370 371 372 370 342 360 370 373 342 370 372 373 374 29 309 374 309 375 376 377 373 376 373 372 378 365 364 379 349 369 380 365 378 380 381 382 380 382 365 383 384 385 383 349 379 386 387 382 386 388 387 386 389 388 390 377 376 391 377 390 392 393 394 392 394 377 392 377 391 395 375 396 392 397 393 395 374 375 398 389 386 399 400 401 399 402 389 399 401 402 399 389 398 403 404 393 403 393 397 405 406 407 405 407 408 409 405 408 410 411 409 410 409 408 412 411 410 412 410 408 412 413 414 412 408 413 412 414 411 415 416 417 415 418 416 419 395 396 415 417 420 421 415 420 419 396 422 423 411 414 423 414 424 425 421 420 425 426 427 425 420 428 425 428 426 429 1 430 431 432 433 431 434 435 431 436 434 431 433 436 431 435 432 437 29 374 438 427 426 437 30 29 438 439 427 437 31 30 440 429 430 440 430 434 441 434 436 441 440 434 442 439 438 443 444 445 443 433 446 443 446 444 447 448 449 447 450 448 447 449 451 452 453 454 452 439 442 452 454 439 455 441 436 456 422 457 458 450 447 456 419 422 459 437 374 460 455 436 459 374 395 460 436 461 462 463 464 462 464 450 462 450 458 462 465 463 466 443 445 466 445 467 466 433 443 466 461 433 468 469 470 471 472 453 471 453 473 474 468 475 476 477 478 476 479 477 480 465 481 482 457 483 480 463 465 484 485 486 484 487 488 484 488 485 482 456 457 484 445 487 489 480 481 490 474 475 490 491 492 493 494 495 496 395 419 497 478 498 497 499 479 497 498 499 496 459 395 497 476 478 497 479 476 500 501 502 500 473 501 503 489 481 503 504 501 503 481 504 505 484 486 505 506 445 505 445 484 507 475 493 508 475 507 508 509 510 511 486 485 511 485 512 513 486 511 513 505 486 514 515 516 514 517 515 518 483 519 518 482 483 520 509 521 522 496 419 520 510 509 520 521 523 522 419 456 524 505 513 525 520 523 526 512 527 526 513 511 526 524 513 526 511 512 528 517 514 529 518 519 530 525 523 530 523 531 529 519 217 530 532 533 530 531 532 534 517 528 535 31 437 536 517 534 535 437 459 536 537 517 536 538 537 536 539 538 540 524 526 541 527 542 541 543 544 541 542 543 545 546 547 545 548 546 549 547 40 549 40 550 549 550 548 549 545 547 549 548 545 551 552 538 551 538 539 553 554 555 553 556 554 553 557 556 558 456 482 559 531 560 559 532 531 561 559 560 558 522 456 562 544 563 562 563 564 562 564 565 566 557 553 567 561 560 567 568 561 569 217 216 569 529 217 570 50 571 570 51 50 570 557 566 570 571 557 572 459 496 573 560 58 572 535 459 573 58 57 573 567 560 573 568 567 573 57 568 574 57 54 574 568 57 575 51 576 575 48 51 577 558 482 578 39 59 577 482 518 578 59 579 580 48 575 581 565 39 581 39 578 582 53 48 582 71 53 582 48 580 583 59 43 583 579 59 583 43 67 583 67 73 584 578 579 584 581 578 585 583 73 585 73 80 585 579 583 586 17 18 586 71 17 586 70 71 587 569 216 588 70 586 588 18 78 588 586 18 588 66 70 588 78 66 587 216 236 589 76 82 589 72 76 590 496 522 589 73 72 590 572 496 591 589 82 591 73 589 591 82 84 591 79 73 592 82 81 592 81 86 592 86 88 592 83 82 592 88 83 593 84 83 594 518 529 594 577 518 595 593 83 596 83 88 596 595 83 597 596 88 597 88 87 598 32 31 599 87 2 599 597 87 598 31 535 600 92 89 600 89 21 600 93 92 600 95 93 600 96 95 601 97 96 601 96 600 601 600 21 602 103 102 602 601 103 602 102 97 603 236 235 602 97 601 604 115 103 604 103 601 603 587 236 605 115 604 605 604 601 606 113 123 606 25 113 607 590 522 607 522 558 608 606 123 608 25 606 608 123 130 609 26 25 609 610 26 609 25 608 609 608 130 611 134 610 611 130 132 611 610 609 611 609 130 611 132 134 612 529 569 613 126 127 612 594 529 613 128 126 614 615 616 614 138 615 614 135 138 617 134 133 617 142 147 617 133 142 618 148 128 619 535 572 618 149 148 618 613 620 618 128 613 618 620 149 619 598 535 621 617 147 622 623 161 622 614 616 622 616 623 622 161 160 624 156 159 624 147 156 624 159 625 624 621 147 626 174 171 626 171 149 626 149 620 627 174 626 628 235 629 628 603 235 630 153 152 630 154 153 631 607 558 630 180 154 631 558 577 632 612 569 633 183 174 632 569 587 633 196 183 633 174 627 634 182 190 634 190 192 634 192 180 634 180 630 635 185 179 635 179 180 635 180 192 636 196 633 636 633 637 636 637 638 639 572 590 636 201 200 639 619 572 640 185 635 641 188 187 641 197 198 641 187 197 642 185 640 642 189 186 642 186 185 642 219 189 643 196 636 643 636 200 643 195 196 643 200 195 644 641 198 645 629 646 647 636 638 647 201 636 645 628 629 648 631 577 647 240 201 648 577 594 649 215 217 649 644 198 649 198 215 649 217 519 650 218 199 650 199 197 650 197 189 650 219 218 651 587 603 650 189 219 652 233 231 651 632 587 652 653 654 652 654 233 655 208 207 655 231 208 655 652 231 656 206 208 656 203 206 657 216 215 657 215 199 657 199 234 657 236 216 657 234 236 658 639 590 659 203 656 659 656 208 658 590 607 659 221 203 660 230 218 660 220 661 660 218 220 662 237 240 662 238 237 662 240 647 663 226 241 663 664 226 665 645 646 663 241 246 665 646 666 667 221 659 668 667 242 668 221 667 668 242 227 669 594 612 668 225 221 668 227 225 669 648 594 670 230 660 671 663 246 672 234 230 672 629 235 672 235 234 672 230 670 673 232 248 674 651 603 674 603 628 673 208 232 675 248 258 675 673 248 675 208 673 676 246 251 676 251 253 676 671 246 676 253 677 678 675 258 679 678 258 679 265 271 679 263 265 679 258 263 680 607 631 681 259 247 681 261 259 681 269 261 681 3 269 682 273 276 682 683 684 680 658 607 682 276 683 685 277 270 685 270 264 685 264 686 687 277 685 688 684 689 688 689 293 688 682 684 688 293 290 690 666 691 692 277 687 690 665 666 692 278 277 692 281 278 692 693 281 694 695 298 696 612 632 694 298 294 694 294 299 696 669 612 697 674 628 698 694 299 697 628 645 699 324 288 699 287 286 699 288 287 700 698 299 700 305 307 700 299 305 700 307 314 701 702 311 701 311 310 701 310 316 703 704 314 703 313 318 703 314 313 705 703 318 705 35 34 705 34 704 705 704 703 706 680 631 706 631 648 707 701 316 708 319 321 708 304 319 708 324 699 708 321 324 709 705 318 709 318 331 709 35 705 710 322 336 710 288 324 710 324 322 711 316 325 712 690 691 711 707 316 712 691 713 711 327 341 711 325 327 714 331 329 714 709 331 714 35 709 714 329 35 715 333 317 715 317 310 715 312 334 716 696 632 715 310 312 715 334 333 716 632 651 717 710 336 718 697 645 718 645 665 719 338 337 719 337 348 719 720 338 721 719 348 722 353 356 722 356 339 722 336 353 722 717 336 723 325 317 723 326 325 723 357 359 723 317 357 723 359 326 724 335 725 724 347 333 724 333 335 726 363 727 726 361 363 726 721 348 726 348 361 728 349 337 728 337 339 728 339 356 728 356 369 728 369 349 729 360 340 702 648 669 729 340 326 702 706 648 729 326 359 730 347 724 731 357 347 731 347 730 731 358 357 731 732 358 733 360 729 734 385 362 734 362 361 734 361 349 734 383 385 735 713 736 734 349 383 735 712 713 737 367 7 737 364 367 738 651 674 738 716 651 739 355 354 739 369 355 739 379 369 740 370 360 740 406 371 740 360 733 740 371 370 741 737 7 741 378 364 741 364 737 742 372 371 743 718 665 743 665 690 742 376 372 742 390 376 744 379 739 745 378 741 745 7 8 745 8 746 745 741 7 747 378 745 311 702 669 747 746 381 747 745 746 747 380 378 311 669 696 747 381 380 748 749 384 748 379 744 748 384 383 748 383 379 750 382 381 750 386 382 750 398 386 751 406 405 751 371 406 751 742 371 751 405 409 752 398 750 753 400 399 753 398 752 753 754 400 753 399 398 755 415 421 755 418 415 755 756 418 757 758 759 760 735 736 760 736 761 757 759 404 757 404 403 762 674 697 762 738 674 763 755 421 764 427 765 764 421 425 764 425 427 764 763 421 766 758 757 766 423 424 766 424 767 766 767 758 768 429 440 768 440 441 768 1 429 768 441 455 768 455 460 769 442 438 769 438 426 770 690 712 769 426 428 770 743 690 771 442 769 771 769 428 772 458 447 772 447 451 312 311 696 772 451 773 774 442 771 774 452 442 312 696 716 775 453 452 775 452 774 775 774 473 775 473 453 776 777 469 776 469 468 776 468 474 778 458 772 779 760 761 780 776 474 781 464 463 781 480 489 782 762 697 781 463 480 782 697 718 783 781 489 784 462 458 784 465 462 784 785 465 784 458 778 786 466 467 786 461 466 787 492 788 787 780 474 787 474 490 787 490 492 789 783 489 790 770 712 789 489 503 790 712 735 791 768 460 791 1 768 791 460 461 791 461 786 791 786 467 792 475 468 792 493 475 792 470 494 792 468 470 792 494 493 793 503 501 793 501 473 793 473 789 793 789 503 794 471 473 794 473 500 795 467 506 795 791 467 796 502 797 796 797 798 334 312 716 796 500 502 334 716 738 796 794 500 799 475 508 799 508 510 799 510 491 799 491 490 799 490 475 800 779 761 801 507 493 801 495 802 800 761 803 801 493 495 804 791 795 804 795 506 805 782 718 806 507 801 805 718 743 807 790 735 807 735 760 808 520 525 808 491 510 808 510 520 809 508 507 809 507 806 809 521 509 809 509 508 810 808 525 811 530 533 811 533 516 811 810 525 811 525 530 812 514 516 812 528 514 812 516 533 813 559 561 813 533 532 813 532 559 813 812 533 814 527 541 814 541 544 814 544 815 816 526 527 816 540 526 816 814 815 816 527 814 817 555 818 817 553 555 817 566 553 819 552 551 819 45 552 819 47 45 335 738 762 820 566 817 335 334 738 821 562 565 822 800 803 821 544 562 821 815 544 822 803 823 824 576 51 824 566 820 824 51 570 824 570 566 825 47 819 825 56 47 826 743 770 825 54 56 825 574 54 826 805 743 827 821 565 828 807 760 828 760 779 829 576 830 829 575 576 829 580 575 831 581 584 831 827 565 831 565 581 832 16 17 832 830 16 832 829 830 832 580 829 833 582 580 833 832 17 833 580 832 834 71 582 834 17 71 834 833 17 834 582 833 835 584 579 835 579 585 836 585 80 836 831 584 836 837 831 836 584 835 836 835 585 838 837 836 839 80 79 725 335 762 839 836 80 725 762 782 839 838 836 840 591 84 840 79 591 840 839 79 841 822 823 842 596 597 841 823 843 842 595 596 842 599 2 842 597 599 844 601 21 845 828 779 844 115 605 844 118 114 846 826 770 844 605 601 844 114 115 847 844 21 846 770 790 847 127 118 847 118 844 848 127 847 848 613 127 849 610 134 849 134 617 850 849 617 850 610 849 850 617 621 851 610 850 851 850 621 851 27 26 851 852 27 851 26 610 853 613 848 853 620 613 854 851 621 854 852 851 854 625 852 854 624 625 854 621 624 855 160 163 855 163 136 855 135 614 855 622 160 855 614 622 855 136 135 856 620 853 856 626 620 856 627 626 857 633 627 857 856 858 859 725 782 857 627 856 859 782 805 860 163 182 860 182 634 860 136 163 860 634 630 861 779 800 861 845 779 862 157 188 862 188 641 862 641 644 863 841 843 864 862 644 863 843 865 866 635 192 866 192 191 867 846 790 867 790 807 868 866 191 868 635 866 868 640 635 869 864 644 869 644 649 869 649 519 869 519 483 870 640 868 871 653 652 871 655 207 871 652 655 871 207 209 871 209 653 872 219 642 872 640 870 872 642 640 872 870 220 872 220 219 873 874 664 873 664 663 875 873 663 875 663 671 876 875 671 877 244 238 877 238 662 877 662 647 878 859 805 877 647 638 878 805 826 879 661 880 879 660 661 879 670 660 881 880 876 881 876 671 881 677 880 881 671 676 881 676 677 882 659 208 882 208 675 883 861 800 882 667 659 882 675 678 883 800 822 884 244 877 884 247 244 884 3 681 884 681 247 884 877 3 885 865 886 885 863 865 887 670 879 888 646 629 888 629 672 888 672 670 888 670 887 889 867 807 890 271 242 889 807 828 890 242 667 890 667 882 890 882 678 890 678 679 890 679 271 891 686 892 891 685 686 893 682 688 893 688 290 893 273 682 893 274 273 893 290 292 893 292 274 894 685 891 894 687 685 895 695 694 895 694 698 895 896 695 897 33 896 897 34 33 898 883 822 897 896 895 897 704 34 897 895 698 899 687 894 898 822 841 900 693 692 900 899 901 902 826 846 900 901 693 900 692 687 900 687 899 902 878 826 903 704 897 903 897 698 903 698 700 904 708 699 904 304 708 904 274 292 905 886 727 904 292 304 905 885 886 906 702 701 906 701 707 906 706 702 907 314 704 908 828 845 907 700 314 907 704 903 907 903 700 908 889 828 909 906 707 908 845 861 910 289 288 910 288 710 911 910 710 911 289 910 911 710 717 912 909 707 912 707 711 912 711 341 912 341 295 913 911 717 914 901 720 914 720 719 914 719 721 915 914 721 916 898 841 916 841 863 917 338 913 917 913 717 917 722 339 917 717 722 917 339 338 918 727 886 918 726 727 919 902 846 918 915 721 918 721 726 919 846 867 920 725 859 920 724 725 920 730 724 921 729 359 921 733 729 922 905 727 921 359 358 922 727 363 923 730 920 924 861 883 925 926 732 924 908 861 925 730 923 925 731 730 925 732 731 927 921 358 927 733 921 928 744 739 928 354 402 928 739 354 929 733 927 929 740 733 930 407 406 930 929 407 930 740 929 930 406 740 931 744 928 932 381 746 932 750 381 933 748 744 933 934 749 933 744 931 933 749 748 935 751 409 935 409 411 935 742 751 935 411 397 936 863 885 937 932 746 937 752 750 936 916 863 937 750 932 938 756 755 939 867 889 938 755 763 938 926 756 939 919 867 940 926 938 940 938 763 941 937 746 941 8 9 941 746 8 942 922 363 941 9 943 942 363 362 941 752 937 944 752 941 944 753 752 945 924 883 944 754 753 944 943 754 944 941 943 945 883 898 946 763 764 946 940 763 947 766 757 947 423 766 947 757 403 947 411 423 947 397 411 947 403 397 948 764 765 948 765 949 948 946 764 950 777 776 950 776 780 950 951 777 952 428 464 952 464 781 952 771 428 952 781 783 953 950 780 954 952 783 954 771 952 954 774 771 954 473 774 954 783 789 954 789 473 955 772 773 955 778 772 955 773 956 957 788 956 957 787 788 957 953 780 957 780 787 958 778 955 958 955 956 959 784 778 959 778 958 960 794 796 960 796 798 960 472 471 961 936 885 960 798 472 961 885 905 960 471 794 962 963 785 962 784 959 962 785 784 964 942 362 965 491 808 965 808 810 964 362 385 965 492 491 966 965 810 967 898 916 966 492 965 968 801 802 967 945 898 968 802 969 970 939 889 968 806 801 970 889 908 971 810 811 970 908 924 971 966 810 972 516 515 972 515 971 972 811 516 972 971 811 973 506 505 973 1 791 973 505 524 973 804 506 973 791 804 974 806 968 975 809 806 975 521 809 975 806 974 975 556 521 976 1 973 976 524 540 976 973 524 977 812 813 977 561 568 977 813 561 977 568 539 978 976 540 978 540 816 979 961 905 980 819 551 979 905 922 980 825 819 980 551 539 980 568 574 980 574 825 980 539 568 981 817 818 981 820 817 981 818 982 983 964 385 983 385 384 984 816 815 984 978 816 985 967 916 986 15 16 985 916 936 986 16 830 986 820 981 986 981 982 987 970 924 986 982 15 988 984 815 988 815 821 987 924 945 988 821 827 989 824 820 989 820 986 989 986 830 990 830 576 990 576 824 990 824 989 990 989 830 991 827 831 991 992 988 991 988 827 993 840 84 993 84 593 993 838 839 993 839 840 994 2 993 994 595 842 994 593 595 994 993 593 994 842 2 995 853 848 995 856 853 995 858 856 996 979 922 996 922 942 995 848 847 997 152 146 997 146 139 997 630 152 997 136 860 997 139 136 997 860 630 998 637 633 998 858 995 998 995 847 998 638 637 998 21 3 998 633 857 998 857 858 998 3 877 998 847 21 998 877 638 999 384 749 1000 158 157 999 983 384 1000 862 864 1000 157 862 1001 1000 864 1002 936 961 1002 985 936 1003 483 457 1003 1001 864 1003 864 869 1003 869 483 1004 868 191 1004 870 868 1005 945 967 1006 874 873 1005 987 945 1006 1004 191 1006 873 875 1006 191 874 1007 1004 1006 1007 1006 875 1007 875 876 1008 1004 1007 1008 1007 876 1008 870 1004 1009 876 880 1009 1008 876 1009 870 1008 1009 880 661 1009 220 870 1009 661 220 1010 887 879 1010 879 880 1010 880 677 1011 996 942 1012 887 1010 1011 942 964 1013 666 646 1014 749 934 1013 887 1012 1014 999 749 1013 646 888 1013 888 887 1015 904 699 1015 274 904 1015 282 274 1015 699 286 1015 285 282 1015 286 285 1016 1002 961 1017 894 891 1016 961 979 1017 892 289 1017 891 892 1018 680 706 1018 906 909 1018 706 906 1019 899 894 1019 894 1017 1020 1018 909 1021 967 985 1022 1017 289 1021 1005 967 1022 1019 1017 1022 289 911 1022 911 913 1023 899 1019 1023 1019 1022 1023 1022 913 1024 909 912 1024 912 295 1024 1020 909 1024 295 297 1025 720 901 1025 901 899 1025 899 1023 1025 913 338 1025 1023 913 1025 338 720 1026 693 901 1026 901 914 1026 914 915 1027 1026 915 1028 918 886 1028 886 865 1029 964 983 1028 915 918 1028 1027 915 1030 923 920 1030 920 859 1029 1011 964 1030 859 878 1031 934 1032 1033 923 1030 1031 1014 934 1034 1016 979 1035 926 925 1035 925 923 1034 979 996 1035 923 1033 1035 756 926 1036 732 926 1036 927 358 1037 985 1002 1036 926 940 1037 1021 985 1036 358 732 1038 390 742 1038 742 935 1038 391 390 1038 935 397 1038 392 391 1038 397 392 1039 402 401 1039 928 402 1039 931 928 1040 1036 940 1040 927 1036 1041 927 1040 1041 407 929 1041 929 927 1042 931 1039 1043 940 946 1043 1041 1040 1043 1040 940 1044 931 1042 1044 1032 934 1045 1029 983 1044 934 933 1045 983 999 1044 933 931 1046 1043 946 1046 407 1041 1046 946 948 1046 1041 1043 1046 949 407 1046 948 949 1047 950 953 1047 951 950 1047 1037 951 1048 1031 1032 1049 1047 953 1050 1049 953 1048 1032 1051 1050 957 956 1050 953 957 1050 956 773 1052 1034 996 1053 956 788 1053 788 492 1052 996 1011 1053 492 966 1053 958 956 1054 1053 966 951 1037 1002 1054 958 1053 951 1002 1016 1055 958 1054 1055 959 958 1056 515 963 1056 963 962 1056 959 1055 1056 962 959 1057 971 515 1058 10 11 1057 1054 966 1057 1055 1054 1057 1056 1055 1057 515 1056 1057 966 971 1059 974 968 1059 968 969 1060 999 1014 1059 969 1061 1062 974 1059 1060 1045 999 1063 974 1062 1063 975 974 1063 556 975 1063 554 556 1064 536 534 1064 528 812 1064 812 977 1064 534 528 1064 539 536 1064 977 539 1065 1051 1066 1067 976 978 1065 1048 1051 1067 984 988 1068 1052 1011 1067 978 984 1067 988 992 1068 1011 1029 1069 992 991 1069 2 1 1069 838 993 1069 993 2 1069 1 976 1069 1067 992 1069 831 837 777 1016 1034 1069 991 831 1069 837 838 777 951 1016 1069 976 1067 1070 158 1000 1070 1000 1001 1070 159 158 1071 1070 1001 1072 1001 1003 1072 457 422 1072 1003 457 1072 422 1071 1072 1071 1001 1073 1010 677 1073 677 253 1073 1012 1010 1074 1012 1073 1075 1014 1031 1076 1013 1012 1076 1012 1074 1075 1060 1014 1076 666 1013 1076 691 666 1076 1074 691 1077 658 680 1077 680 1018 1077 1018 1020 1078 658 1077 1078 1077 1020 1079 1066 1080 1079 1065 1066 1081 1020 1024 1081 1024 297 1082 1068 1029 1081 1078 1020 1081 297 298 1083 1026 1027 1082 1029 1045 1083 693 1026 1083 281 693 469 1034 1052 1084 1083 1027 469 777 1034 1085 1031 1048 1086 1084 1027 1086 1028 865 1086 865 843 1086 1027 1028 1086 843 1084 1085 1075 1031 1087 1030 878 1087 1033 1030 1087 878 902 1088 1033 1087 1088 1087 902 1089 1033 1088 1089 418 756 1089 1035 1033 1089 756 1035 1090 401 400 1090 1042 1039 1090 1039 401 1091 1042 1090 1092 1091 1051 1092 1032 1044 1092 1042 1091 1092 1044 1042 1092 1051 1032 1093 1037 1047 1093 1021 1037 1093 1047 1049 1094 1079 1080 1095 1093 1049 1094 1058 11 1094 1080 1058 1095 1021 1093 1096 1082 1045 1097 1049 1050 1096 1045 1060 1097 1095 1049 1097 1050 773 1097 773 451 1098 1061 1099 470 469 1052 1098 1062 1059 1098 1059 1061 470 1052 1068 1100 1062 1098 1100 1098 1099 1101 1085 1048 1102 554 1063 1102 1063 1062 1102 555 554 1102 1062 1100 1101 1048 1065 1103 1070 1071 1104 1060 1075 1103 159 1070 1103 625 159 1105 1103 1071 1104 1096 1060 1105 1071 422 1105 422 396 1106 253 252 1106 1073 253 1107 1073 1106 1107 1074 1073 1108 1074 1107 1108 713 691 1108 691 1074 1109 658 1078 1109 639 658 1110 1109 1078 494 470 1068 1110 298 695 1110 1078 1081 494 1068 1082 1110 1081 298 1111 281 1083 1112 1065 1079 1111 279 281 1112 1101 1065 1113 1111 1083 1113 1083 1084 1114 843 823 1114 1113 1084 1114 1084 843 1115 1088 902 1115 902 919 1116 1104 1075 1117 1088 1115 1117 1089 1088 1116 1075 1085 1118 418 1089 1118 416 418 1118 1089 1117 1119 1090 400 1119 1091 1090 1119 400 754 1120 1051 1091 1120 1091 1119 1120 1066 1051 1121 1005 1021 495 1082 1096 1121 1021 1095 495 494 1082 1122 1121 1095 1122 1095 1097 1123 1097 451 1123 1122 1097 1123 451 449 1124 1079 1094 1125 1100 1099 1124 1112 1079 1126 1085 1101 1125 1099 1127 1128 555 1102 1128 1100 1125 1128 1102 1100 1126 1116 1085 1128 818 555 1129 625 1103 1129 852 625 1130 1103 1105 1130 1129 1103 1131 396 375 1131 1105 396 1131 1130 1105 802 495 1096 1132 1106 252 802 1096 1104 1132 252 254 1132 1107 1106 1133 1132 254 1133 1108 1107 1133 1107 1132 1134 11 12 1135 736 713 1134 12 13 1135 1108 1133 1134 1094 11 1135 713 1108 1134 1124 1094 1136 619 639 1136 639 1109 1137 1136 1109 1137 1109 1110 1138 1137 1110 1138 1110 695 1138 695 896 1139 280 279 1139 279 1111 1139 1111 1113 1140 1101 1112 1141 1139 1113 1140 1126 1101 1141 1113 1114 1142 1141 1114 1142 823 803 1142 1114 823 1143 1115 919 969 1104 1116 969 802 1104 1143 919 939 1144 1115 1143 1144 1117 1115 1145 1144 417 1145 1117 1144 1145 417 416 1145 416 1118 1145 1118 1117 1146 1119 754 1147 1140 1112 1146 754 943 1148 1120 1119 1147 1112 1124 1148 1119 1146 1149 1120 1148 1149 1080 1066 1149 1066 1120 1150 1005 1121 1061 969 1116 1061 1116 1126 1150 987 1005 1151 1121 1122 1151 1150 1121 1152 449 448 1152 1151 1122 1152 1122 1123 1152 1123 449 1153 1125 1127 1153 1127 1154 1155 1125 1153 1155 1128 1125 1156 1134 13 1156 1124 1134 1157 982 818 1157 1128 1155 1156 1147 1124 1157 818 1128 1099 1061 1126 1099 1126 1140 1158 27 852 1158 852 1129 1158 1129 1130 1159 1130 1131 1159 27 1158 1159 1158 1130 1160 28 27 1160 1131 375 1160 1159 1131 1160 309 28 1160 27 1159 1160 375 309 1161 598 619 1161 33 32 1161 619 1136 1161 32 598 1162 1136 1137 1162 33 1161 1162 1161 1136 1163 896 33 1163 1137 1138 1163 1138 896 1163 33 1162 1163 1162 1137 1164 1133 254 1164 1135 1133 1165 1139 1141 1165 1164 254 1127 1140 1147 1165 280 1139 1165 254 280 1166 1141 1142 1127 1099 1140 1166 1165 1141 1166 1164 1165 1167 1135 1164 1167 1166 1142 1167 1164 1166 1168 736 1135 1168 1142 803 1168 1167 1142 1168 1135 1167 1168 803 761 1168 761 736 1169 939 970 1169 1143 939 1169 987 1150 1169 970 987 1170 1143 1169 1170 1169 1150 1171 1144 1143 1171 417 1144 1171 1143 1170 1172 1146 943 1172 943 9 1172 1148 1146 1173 1171 1170 1173 1170 1150 1154 1147 1156 1173 1150 1151 1154 1127 1147 1174 1148 1172 1174 1149 1148 1174 1172 9 1175 417 1171 1175 1171 1173 1175 1173 1151 1175 1152 448 1175 1151 1152 1175 448 417 1176 9 10 1176 1149 1174 1176 1174 9 1176 1058 1080 1176 1080 1149 1176 10 1058 1177 1154 1178 1177 14 15 1177 1178 14 1178 13 14 1177 1153 1154 1178 1156 13 1179 1153 1177 1179 1155 1153 1178 1154 1156 1179 1177 15 1180 1179 15 1180 1155 1179 1180 982 1157 1180 1157 1155 1180 15 982 91 22 21 91 99 22 90 99 91 1181 23 22 1181 1182 23 1181 22 99 97 100 94 101 1182 1181 101 1181 99 101 1183 1182 1184 24 23 1184 23 1182 1184 110 109 1184 109 24 107 1185 1183 107 1183 101 107 101 100 115 104 103 1186 1182 1183 1186 110 1184 1186 1187 110 1186 1184 1182 106 1188 1185 106 1185 107 111 124 113 1189 1183 1185 1189 1187 1186 1189 1190 1187 1189 1186 1183 121 122 1188 121 106 104 121 1188 106 1191 110 1187 1191 124 111 1191 111 110 1191 1192 124 1193 1189 1185 1193 1190 1189 1193 615 1190 1194 1191 1187 1194 1192 1191 1194 1187 1190 1194 141 1192 1195 616 615 1195 1193 1185 1195 615 1193 1195 1185 1188 120 1196 122 138 137 141 138 141 1194 138 1194 1190 138 1190 615 125 124 1192 125 143 133 1197 1188 122 1197 616 1195 1197 623 616 1197 1195 1188 129 1196 120 129 165 1196 1198 144 143 1198 143 125 1198 125 1192 1198 1192 141 1199 1197 122 1199 122 1196 1199 1200 623 1199 623 1197 140 144 1198 140 155 144 140 1198 141 151 129 128 151 165 129 151 1201 165 168 1196 165 168 1199 1196 168 1200 1199 168 170 1200 150 1202 1201 150 1201 151 161 623 1200 161 176 162 1203 188 157 1203 144 155 1203 157 145 1203 145 144 173 150 149 173 1202 150 181 1203 155 181 188 1203 1204 161 1200 1204 1205 176 1204 176 161 1204 1200 170 166 653 167 166 165 1201 172 1202 173 172 213 1202 1206 1205 1204 1206 170 167 1206 1204 170 1206 205 1205 1207 166 1201 1207 653 166 1207 654 653 1207 1201 1202 177 874 191 209 1206 167 209 205 1206 209 167 653 209 206 205 1208 177 176 1208 664 874 1208 176 1205 1208 874 177 184 1209 213 184 172 174 184 213 172 212 211 654 212 654 1207 212 1207 1202 212 1202 213 204 226 664 204 1208 1205 204 664 1208 204 1205 205 194 223 1209 194 1209 184 240 202 201 214 213 1209 214 1210 229 233 654 211 233 249 232 224 1211 223 1212 249 233 1212 1213 249 1212 211 229 1212 233 211 1214 683 1210 1214 214 1209 1214 1210 214 1214 1209 223 256 1211 224 256 224 202 256 1215 1211 1216 1213 1212 1216 1212 229 1216 229 1210 1216 284 1213 245 239 238 1217 223 1211 1217 683 1214 1217 684 683 1217 1214 223 1218 242 271 1218 243 242 1218 280 254 1218 254 243 276 1210 683 276 1216 1210 276 284 1216 276 275 284 257 1219 1215 257 1215 256 250 249 1213 250 686 264 1220 689 684 1220 1211 1215 1220 1217 1211 1220 684 1217 272 1218 271 272 280 1218 1221 686 250 1221 250 1213 1221 892 686 1221 1213 284 1222 689 1220 1222 1223 689 1222 1220 1215 262 3 4 262 4 268 262 268 260 267 1224 1219 267 257 239 267 1219 257 283 1221 284 283 892 1221 283 289 892 1225 1222 1215 1225 1226 1223 1225 1215 1219 1225 1223 1222 1227 4 5 1227 5 1224 1227 1224 267 1227 267 268 1227 268 4 1228 345 1226 1228 1226 1225 1228 1225 1219 1228 1219 1224 293 301 291 293 689 1223 1229 1223 1226 1229 301 293 1229 293 1223 1229 1230 301 1231 5 6 1231 1224 5 1231 346 345 1231 1228 1224 1231 6 346 1231 345 1228 1232 1226 345 1232 1229 1226 1232 1230 1229 1232 366 1230 302 388 320 1233 296 295 1233 373 308 1233 308 296 1233 295 341 315 307 306 315 1234 332 344 366 1232 344 1232 345 344 367 366 342 373 1233 342 1233 341 1235 388 302 1235 302 301 1235 387 388 1235 301 1230 1236 394 1234 1236 306 308 1236 1234 315 1236 315 306 330 329 332 365 1230 366 365 1235 1230 365 387 1235 365 382 387 1237 320 388 1237 354 323 1237 323 320 1237 402 354 377 308 373 377 1236 308 377 394 1236 1238 351 330 1238 332 1234 1238 1239 351 1238 330 332 389 402 1237 389 1237 388 1240 352 351 1240 37 36 1240 36 352 1240 1241 37 1242 1243 1239 1242 1234 394 1242 1239 1238 1242 1238 1234 404 394 393 404 759 1243 404 1243 1242 404 1242 394 1244 1245 1241 1244 1240 351 1244 351 1239 1244 1241 1240 1246 38 37 1246 435 38 1246 37 1241 1247 1239 1243 1247 1248 1245 1247 1245 1244 1247 1244 1239 408 407 949 432 435 1246 432 1246 1241 432 1241 1245 430 1 38 430 38 435 1249 1248 1247 1249 1243 759 1249 1247 1243 1250 408 949 1250 413 408 1250 1251 413 1250 949 765 1252 759 758 1252 1249 759 1252 1248 1249 1252 1253 1248 439 765 427 439 454 1251 439 1251 1250 439 1250 765 434 430 435 446 432 1245 446 433 432 446 1245 1248 424 414 413 424 1254 767 1255 428 420 1255 464 428 1255 417 448 1255 420 417 1256 1253 1252 1256 1252 758 1256 758 767 1256 488 1253 450 464 1255 450 1255 448 1257 477 1254 1257 1254 424 1257 413 1251 1257 424 413 444 446 1248 444 1248 1253 1258 488 1256 1258 1256 767 1258 1259 488 1258 767 1254 1260 1251 454 1260 477 1257 1260 1257 1251 1260 478 477 461 436 433 487 445 444 487 1253 488 487 444 1253 472 454 453 472 1260 454 472 478 1260 472 798 478 479 1254 477 479 499 1259 479 1258 1254 479 1259 1258 506 467 445 485 488 1259 481 1261 504 481 465 785 498 1262 499 498 478 798 512 1259 499 512 485 1259 1263 481 785 1263 785 963 1263 537 1261 1263 1261 481 502 548 797 502 501 504 517 537 1263 517 963 515 517 1263 963 1264 798 797 1264 1262 498 1264 1265 1262 1264 498 798 1266 502 504 1266 548 502 1266 546 548 1266 504 1261 542 512 499 542 527 512 542 499 1262 550 1265 1264 550 797 548 550 40 1265 550 1264 797 1267 546 1266 1267 1266 1261 1267 1268 546 1267 1261 537 543 542 1262 543 1262 1265 1269 571 531 1269 531 523 1269 521 556 1269 523 521 552 1267 537 552 537 538 552 1268 1267 552 45 1268 563 543 1265 563 544 543 557 1269 556 557 571 1269 547 546 1268 547 41 40 564 563 1265 564 1265 40 560 531 571 44 43 41 44 547 1268 44 41 547 44 1268 45 49 571 50 49 560 571 49 58 560 49 52 58 39 565 564 39 564 40 + +TShapes 77 +Ve +1.0001000025e-07 +0 0 200 +0 0 + +0101101 +* +Ve +1.0001000025e-07 +0 0 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 1 0 0 200 +2 1 1 0 0 200 +2 2 2 0 0 200 +6 1 1 0 +6 2 2 0 +0 + +0101000 +-77 0 +76 0 * +Ve +1.0001000025e-07 +0 200 200 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 2 0 0 200 +2 3 1 0 0 200 +2 4 3 0 0 200 +6 3 1 0 +6 4 3 0 +0 + +0101000 +-74 0 +77 0 * +Ve +1.0001000025e-07 +0 200 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 3 0 0 200 +2 5 1 0 0 200 +2 6 4 0 0 200 +6 5 1 0 +6 6 4 0 +0 + +0101000 +-74 0 +72 0 * +Ed + 1.0001000025e-07 1 1 0 +1 4 0 0 200 +2 7 1 0 0 200 +2 8 5 0 0 200 +6 7 1 0 +6 8 5 0 +0 + +0101000 +-72 0 +76 0 * +Wi + +0101000 +-75 0 -73 0 +71 0 +70 0 * +Fa +0 1e-07 1 0 +2 1 +0101000 ++69 0 * +Ve +1.0001000025e-07 +200 0 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 5 0 0 200 +2 9 2 0 0 200 +2 10 5 0 0 200 +6 9 2 0 +6 10 5 0 +0 + +0101000 +-67 0 +76 0 * +Ve +1.0001000025e-07 +200 0 200 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 6 0 0 200 +2 11 6 0 0 200 +2 12 2 0 0 200 +6 11 2 0 +6 12 6 0 +0 + +0101000 +-65 0 +67 0 * +Ed + 1.0001000025e-07 1 1 0 +1 7 0 0 200 +2 13 2 0 0 200 +2 14 3 0 0 200 +6 13 2 0 +6 14 3 0 +0 + +0101000 +-65 0 +77 0 * +Wi + +0101000 +-66 0 -64 0 +63 0 +75 0 * +Fa +0 1e-07 2 0 +2 2 +0101000 ++62 0 * +Ve +1.0001000025e-07 +200 200 200 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 8 0 0 200 +2 15 4 0 0 200 +2 16 3 0 0 200 +6 15 3 0 +6 16 4 0 +0 + +0101000 +-60 0 +74 0 * +Ed + 1.0001000025e-07 1 1 0 +1 9 0 0 200 +2 17 6 0 0 200 +2 18 3 0 0 200 +6 17 3 0 +6 18 6 0 +0 + +0101000 +-60 0 +65 0 * +Wi + +0101000 +-73 0 -59 0 +58 0 +63 0 * +Fa +0 1e-07 3 0 +2 3 +0101000 ++57 0 * +Ve +1.0001000025e-07 +200 200 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 10 0 0 200 +2 19 4 0 0 200 +2 20 5 0 0 200 +6 19 4 0 +6 20 5 0 +0 + +0101000 +-55 0 +72 0 * +Ed + 1.0001000025e-07 1 1 0 +1 11 0 0 200 +2 21 6 0 0 200 +2 22 4 0 0 200 +6 21 4 0 +6 22 6 0 +0 + +0101000 +-60 0 +55 0 * +Wi + +0101000 +-54 0 -53 0 +59 0 +71 0 * +Fa +0 1e-07 4 0 +2 4 +0101000 ++52 0 * +Ed + 1.0001000025e-07 1 1 0 +1 12 0 0 200 +2 23 6 0 0 200 +2 24 5 0 0 200 +6 23 5 0 +6 24 6 0 +0 + +0101000 +-55 0 +67 0 * +Wi + +0101000 +-70 0 -54 0 +50 0 +66 0 * +Fa +0 1e-07 5 0 +2 5 +0101000 ++49 0 * +Wi + +0101000 +-64 0 -58 0 +53 0 +50 0 * +Fa +0 1e-07 6 0 +2 6 +0101000 ++47 0 * +Sh + +0101000 +-68 0 -61 0 +56 0 +51 0 -48 0 +46 0 * +Ve +1.0001000025e-07 +0 0 80 +0 0 + +0101101 +* +Ve +1.0001000025e-07 +0 0 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 13 0 0 80 +2 25 7 0 0 80 +2 26 8 0 0 80 +6 25 7 0 +6 26 8 0 +0 + +0101000 +-44 0 +43 0 * +Ve +1.0001000025e-07 +0 80 80 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 14 0 0 80 +2 27 7 0 0 80 +2 28 9 0 0 80 +6 27 7 0 +6 28 9 0 +0 + +0101000 +-41 0 +44 0 * +Ve +1.0001000025e-07 +0 80 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 15 0 0 80 +2 29 7 0 0 80 +2 30 10 0 0 80 +6 29 7 0 +6 30 10 0 +0 + +0101000 +-41 0 +39 0 * +Ed + 1.0001000025e-07 1 1 0 +1 16 0 0 80 +2 31 7 0 0 80 +2 32 11 0 0 80 +6 31 7 0 +6 32 11 0 +0 + +0101000 +-39 0 +43 0 * +Wi + +0101000 +-42 0 -40 0 +38 0 +37 0 * +Fa +0 1e-07 7 0 +2 7 +0101000 ++36 0 * +Ve +1.0001000025e-07 +80 0 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 17 0 0 80 +2 33 8 0 0 80 +2 34 11 0 0 80 +6 33 8 0 +6 34 11 0 +0 + +0101000 +-34 0 +43 0 * +Ve +1.0001000025e-07 +80 0 80 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 18 0 0 80 +2 35 12 0 0 80 +2 36 8 0 0 80 +6 35 8 0 +6 36 12 0 +0 + +0101000 +-32 0 +34 0 * +Ed + 1.0001000025e-07 1 1 0 +1 19 0 0 80 +2 37 8 0 0 80 +2 38 9 0 0 80 +6 37 8 0 +6 38 9 0 +0 + +0101000 +-32 0 +44 0 * +Wi + +0101000 +-33 0 -31 0 +30 0 +42 0 * +Fa +0 1e-07 8 0 +2 8 +0101000 ++29 0 * +Ve +1.0001000025e-07 +80 80 80 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 20 0 0 80 +2 39 10 0 0 80 +2 40 9 0 0 80 +6 39 9 0 +6 40 10 0 +0 + +0101000 +-27 0 +41 0 * +Ed + 1.0001000025e-07 1 1 0 +1 21 0 0 80 +2 41 12 0 0 80 +2 42 9 0 0 80 +6 41 9 0 +6 42 12 0 +0 + +0101000 +-27 0 +32 0 * +Wi + +0101000 +-40 0 -26 0 +25 0 +30 0 * +Fa +0 1e-07 9 0 +2 9 +0101000 ++24 0 * +Ve +1.0001000025e-07 +80 80 0 +0 0 + +0101101 +* +Ed + 1.0001000025e-07 1 1 0 +1 22 0 0 80 +2 43 10 0 0 80 +2 44 11 0 0 80 +6 43 10 0 +6 44 11 0 +0 + +0101000 +-22 0 +39 0 * +Ed + 1.0001000025e-07 1 1 0 +1 23 0 0 80 +2 45 12 0 0 80 +2 46 10 0 0 80 +6 45 10 0 +6 46 12 0 +0 + +0101000 +-27 0 +22 0 * +Wi + +0101000 +-21 0 -20 0 +26 0 +38 0 * +Fa +0 1e-07 10 0 +2 10 +0101000 ++19 0 * +Ed + 1.0001000025e-07 1 1 0 +1 24 0 0 80 +2 47 12 0 0 80 +2 48 11 0 0 80 +6 47 11 0 +6 48 12 0 +0 + +0101000 +-22 0 +34 0 * +Wi + +0101000 +-37 0 -21 0 +17 0 +33 0 * +Fa +0 1e-07 11 0 +2 11 +0101000 ++16 0 * +Wi + +0101000 +-31 0 -25 0 +20 0 +17 0 * +Fa +0 1e-07 12 0 +2 12 +0101000 ++14 0 * +Sh + +0101000 ++35 1 +28 1 -23 1 -18 1 +15 1 -13 1 * +Ve +1e-07 +1.22460635382238e-15 -2.99932144364427e-31 20 +0 0 + +0101101 +* +Ed + 1e-07 1 1 1 +2 49 13 0 0 6.28318530717959 +6 49 13 0 +0 + +0101100 ++11 0 -11 0 * +Ve +1e-07 +1.22460635382238e-15 -2.99932144364427e-31 -20 +0 0 + +0101101 +* +Ed + 1e-07 1 1 0 +1 25 0 4.71238898038469 7.85398163397448 +3 50 51CN 13 0 4.71238898038469 7.85398163397448 +7 50 51 13 0 +0 + +0101000 +-11 0 +9 0 * +Ed + 1e-07 1 1 1 +2 52 13 0 0 6.28318530717959 +6 52 13 0 +0 + +0101100 ++9 0 -9 0 * +Wi + +0101000 +-10 0 +8 0 +7 0 -8 0 * +Fa +0 1e-07 13 0 +2 13 +0101000 ++6 0 * +Sh + +0101000 +-5 2 * +Sh + +0101000 +-5 3 * +Sh + +0101000 +-5 4 * +So + +0100000 ++45 0 +12 0 +4 0 +3 0 +2 0 * + ++1 0 \ No newline at end of file diff --git a/src/XAO/tests/data/test.xao b/src/XAO/tests/data/test.xao new file mode 100644 index 000000000..81f3fda47 --- /dev/null +++ b/src/XAO/tests/data/test.xao @@ -0,0 +1,345 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 100 + 110 + 120 + + + + + 255 + 0 + 0 + + + + + + diff --git a/src/XAO_Swig/CMakeLists.txt b/src/XAO_Swig/CMakeLists.txt new file mode 100644 index 000000000..03091f925 --- /dev/null +++ b/src/XAO_Swig/CMakeLists.txt @@ -0,0 +1,68 @@ +# Copyright (C) 2012-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# 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(${SWIG_USE_FILE}) + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${PYTHON_INCLUDE_DIRS} + ${PTHREAD_INCLUDE_DIR} + ${CAS_INCLUDE_DIRS} + ${PROJECT_SOURCE_DIR}/src/XAO +) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS( + ${PYTHON_DEFINITIONS} + ${CAS_DEFINITIONS} + ) + +# libraries to link to +SET(_link_LIBRARIES + XAO + ${PYTHON_LIBRARIES} + ) + +# --- scripts --- + +# scripts / swig wrappings +SET(_swig_SCRIPTS + ${CMAKE_CURRENT_BINARY_DIR}/xao.py +) + +# --- sources --- + +# swig flags +SET_SOURCE_FILES_PROPERTIES(xao.i PROPERTIES CPLUSPLUS ON) +SET_SOURCE_FILES_PROPERTIES(xao.i PROPERTIES SWIG_DEFINITIONS "-shadow") +#SET_SOURCE_FILES_PROPERTIES(xao_wrap.cxx PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H") + +# --- rules --- + +SWIG_ADD_MODULE(xao python xao.i) +SWIG_LINK_LIBRARIES(xao "${_link_LIBRARIES}") +IF(WINDOWS) + SET_TARGET_PROPERTIES(_xao PROPERTIES DEBUG_OUTPUT_NAME _xao_d) +ENDIF(WINDOWS) + +INSTALL(TARGETS _xao DESTINATION ${SALOME_INSTALL_PYTHON}) +INSTALL(FILES xao.i DESTINATION ${SALOME_INSTALL_HEADERS}) +SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}" ${SALOME_INSTALL_PYTHON}) diff --git a/src/XAO_Swig/xao.i b/src/XAO_Swig/xao.i new file mode 100644 index 000000000..2a0942b3a --- /dev/null +++ b/src/XAO_Swig/xao.i @@ -0,0 +1,72 @@ +%module xao +%{ +#include "XAO_Exception.hxx" +#include "XAO_XaoUtils.hxx" +#include "XAO_Xao.hxx" +#include "XAO_GeometricElement.hxx" +#include "XAO_Geometry.hxx" +#include "XAO_BrepGeometry.hxx" +#include "XAO_Group.hxx" +#include "XAO_Field.hxx" +#include "XAO_Step.hxx" +#include "XAO_BooleanField.hxx" +#include "XAO_DoubleField.hxx" +#include "XAO_IntegerField.hxx" +#include "XAO_StringField.hxx" +#include "XAO_BooleanStep.hxx" +#include "XAO_DoubleStep.hxx" +#include "XAO_IntegerStep.hxx" +#include "XAO_StringStep.hxx" +%} + +%include "std_string.i" +%include "std_vector.i" +%include "std_list.i" +%include "std_map.i" +%include "std_set.i" +%include "exception.i" +namespace std +{ +%template(ListGroup) list; +%template(ListField) list; +%template(VectorStep) vector; +%template(SetInt) set; + +%template(VectorBoolean) vector; +%template(VectorInteger) vector; +%template(VectorDouble) vector; +%template(VectorString) vector; + +%template(VectorVectorBoolean) vector< vector >; +%template(VectorVectorInteger) vector< vector >; +%template(VectorVectorDouble) vector< vector >; +%template(VectorVectorString) vector< vector >; +} + +%ignore XAO::Xao::addField; +%ignore XAO::Xao::getField; +%ignore XAO::MsgBuilder; +%ignore XAO::XaoUtils; + +%include XAO_Exception.hxx +%include XAO_XaoUtils.hxx + +%include XAO_Step.hxx +%include XAO_BooleanStep.hxx +%include XAO_DoubleStep.hxx +%include XAO_IntegerStep.hxx +%include XAO_StringStep.hxx + +%include XAO_Field.hxx +%include XAO_BooleanField.hxx +%include XAO_DoubleField.hxx +%include XAO_IntegerField.hxx +%include XAO_StringField.hxx + +%include XAO_Group.hxx + +%include XAO_GeometricElement.hxx +%include XAO_Geometry.hxx +%include XAO_BrepGeometry.hxx +%include XAO_Xao.hxx + -- 2.39.2