From ab53385205fe062af0e87d4e14296b1492fe3611 Mon Sep 17 00:00:00 2001 From: abuhsing Date: Tue, 25 Jun 2013 12:59:39 +0000 Subject: [PATCH] Hexa6 : Mise ajour des sources Committing in . Modified Files: Tag: V7_main Makefile.am configure.ac src/Makefile.am src/HEXABLOCK/Hex.cxx src/HEXABLOCK/Hex.hxx src/HEXABLOCK/HexAssoEdge.cxx src/HEXABLOCK/HexAssoEdge.hxx src/HEXABLOCK/HexBiCylinder.cxx src/HEXABLOCK/HexBiCylinder.hxx src/HEXABLOCK/HexBiCylinderShape.cxx src/HEXABLOCK/HexBiCylinderShape.hxx src/HEXABLOCK/HexCloner.cxx src/HEXABLOCK/HexCrossElements.cxx src/HEXABLOCK/HexCrossElements.hxx src/HEXABLOCK/HexDocument.cxx src/HEXABLOCK/HexDocument.hxx src/HEXABLOCK/HexDocument_Xml.cxx src/HEXABLOCK/HexDocument_asso.cxx src/HEXABLOCK/HexDocument_quads.cxx src/HEXABLOCK/HexDocument_skin.cxx src/HEXABLOCK/HexDocument_trans.cxx src/HEXABLOCK/HexDumpStudy.cxx src/HEXABLOCK/HexDumpStudy.hxx src/HEXABLOCK/HexEdge.cxx src/HEXABLOCK/HexEdge.hxx src/HEXABLOCK/HexEdgeShape.cxx src/HEXABLOCK/HexEdgeShape.hxx src/HEXABLOCK/HexElements.cxx src/HEXABLOCK/HexElements.hxx src/HEXABLOCK/HexElements_asso.cxx src/HEXABLOCK/HexElements_bis.cxx src/HEXABLOCK/HexElements_grid.cxx src/HEXABLOCK/HexElements_piq.cxx src/HEXABLOCK/HexElements_ter.cxx src/HEXABLOCK/HexEltBase.cxx src/HEXABLOCK/HexEltBase.hxx src/HEXABLOCK/HexFaceShape.cxx src/HEXABLOCK/HexFaceShape.hxx src/HEXABLOCK/HexGlobale.cxx src/HEXABLOCK/HexGlobale.hxx src/HEXABLOCK/HexGroup.cxx src/HEXABLOCK/HexGroup.hxx src/HEXABLOCK/HexHexa.cxx src/HEXABLOCK/HexHexa.hxx src/HEXABLOCK/HexKas_functions.cxx src/HEXABLOCK/HexMatrix.hxx src/HEXABLOCK/HexNewShape.cxx src/HEXABLOCK/HexNewShape.hxx src/HEXABLOCK/HexPropagation.hxx src/HEXABLOCK/HexQuad.cxx src/HEXABLOCK/HexQuad.hxx src/HEXABLOCK/HexSubShape.cxx src/HEXABLOCK/HexSubShape.hxx src/HEXABLOCK/HexVector.cxx src/HEXABLOCK/HexVector.hxx src/HEXABLOCK/HexVertex.cxx src/HEXABLOCK/HexVertex.hxx src/HEXABLOCK/HexVertexShape.cxx src/HEXABLOCK/HexVertexShape.hxx src/HEXABLOCK/Makefile.am src/HEXABLOCK/Sauver src/HEXABLOCK/hexa_base.hxx src/HEXABLOCK/hexa_utils.cxx src/HEXABLOCK/test_brep.cxx src/HEXABLOCK/test_hexa1.cxx src/HEXABLOCK/test_hexa5.cxx src/HEXABLOCK/test_tools.cxx src/HEXABLOCK/test_unit.hxx src/HEXABLOCK/umake src/HEXABLOCKGUI/CutEdge_QTD.ui src/HEXABLOCKGUI/Disconnect_QTD.ui src/HEXABLOCKGUI/EdgeAssoc_QTD.ui src/HEXABLOCKGUI/Edge_QTD.ui src/HEXABLOCKGUI/Group_QTD.ui src/HEXABLOCKGUI/HEXABLOCKGUI.cxx src/HEXABLOCKGUI/HEXABLOCKGUI.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx src/HEXABLOCKGUI/Hexa_QTD.ui src/HEXABLOCKGUI/JoinQuad_QTD.ui src/HEXABLOCKGUI/Law_QTD.ui src/HEXABLOCKGUI/MakeCartesian_QTD.ui src/HEXABLOCKGUI/MakeCylinder_QTD.ui src/HEXABLOCKGUI/MakeCylinders_QTD.ui src/HEXABLOCKGUI/MakeCylindrical_QTD.ui src/HEXABLOCKGUI/MakeGrid_QTD.ui src/HEXABLOCKGUI/MakeHemiSphere_QTD.ui src/HEXABLOCKGUI/MakePipe_QTD.ui src/HEXABLOCKGUI/MakePipes_QTD.ui src/HEXABLOCKGUI/MakeRind_QTD.ui src/HEXABLOCKGUI/MakeSpherical_QTD.ui src/HEXABLOCKGUI/MakeTranslation_QTD.ui src/HEXABLOCKGUI/Makefile.am src/HEXABLOCKGUI/MergeEdges_QTD.ui src/HEXABLOCKGUI/MergeVertices_QTD.ui src/HEXABLOCKGUI/Merge_QTD.ui src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx src/HEXABLOCKGUI/MyGEOMBase_Skeleton.cxx src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx src/HEXABLOCKGUI/Pipe_QTD.ui src/HEXABLOCKGUI/PrismQuad_QTD.ui src/HEXABLOCKGUI/Propagation_QTD.ui src/HEXABLOCKGUI/QuadAssoc_QTD.ui src/HEXABLOCKGUI/QuadRevolution_QTD.ui src/HEXABLOCKGUI/Quad_QTD.ui src/HEXABLOCKGUI/RemoveHexa_QTD.ui src/HEXABLOCKGUI/ReplaceHexa_QTD.ui src/HEXABLOCKGUI/Symmetry_QTD.ui src/HEXABLOCKGUI/Transformation_QTD.ui src/HEXABLOCKGUI/Vector_QTD.ui src/HEXABLOCKGUI/Vertex_QTD.ui src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel2Spin_QTD.ui src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel3Spin_QTD.ui src/HEXABLOCKGUI/MyDlgRef/DlgRef_2Sel1Spin_QTD.ui src/HEXABLOCKGUI/MyDlgRef/DlgRef_Skeleton_QTD.ui src/HEXABLOCKGUI/resources/HEXABLOCK_icons.ts src/HEXABLOCKGUI/resources/HEXABLOCK_msg_en.ts src/HEXABLOCKGUI/resources/HEXABLOCK_msg_fr.ts src/HEXABLOCKGUI/resources/make_grid.png Added Files: Tag: V7_main src/HEXABLOCK/HexDocument_del.cxx src/HEXABLOCK/HexDocument_tools.cxx src/HEXABLOCK/HexDocument_v6.cxx src/HEXABLOCK/HexDummyCad.hxx src/HEXABLOCK/HexElements_check.cxx src/HEXABLOCK/HexElements_del.cxx src/HEXABLOCK/HexElements_v6.cxx src/HEXABLOCK/HexHexa_disco.cxx src/HEXABLOCK/HexWitness.cxx src/HEXABLOCK/HexWitness.hxx src/HEXABLOCK/Hex_salome.cxx src/HEXABLOCK/make.main src/HEXABLOCK/make.make src/HEXABLOCK/make_dummycad src/HEXABLOCK/make_swig src/HEXABLOCK/makefile.swig src/HEXABLOCK/test_hexa6.cxx src/HEXABLOCK/test_quads.cxx src/HEXABLOCK/work/env_python src/HEXABLOCK/work/geompy.py src/HEXABLOCK/work/hexablock.py src/HEXABLOCK/work/umake src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h src/HEXABLOCKGUI/resources/add_geom.png src/HEXABLOCKGUI/resources/model_info.png src/HEXABLOCK_SWIG/Makefile.am src/HEXABLOCK_SWIG/hexablock.py src/HEXABLOCK_SWIG/hexablock_swig.i src/HEXABLOCK_SWIG/hexablock_swig.py src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc src/HEXABLOCK_SWIG/make_swig Removed Files: Tag: V7_main src/HEXABLOCK/HexKasBiCylinder.cxx src/HEXABLOCK/HexKasBiCylinder.hxx src/HEXABLOCK/HexKasLine.cxx src/HEXABLOCK/HexKasLine.hxx src/HEXABLOCK/HexKasPoint.cxx src/HEXABLOCK/HexKasPoint.hxx src/HEXABLOCKGUI/MyGEOMBase_Helper.cxx src/HEXABLOCKGUI/MyGEOMBase_Helper.hxx ---------------------------------------------------------------------- --- Makefile.am | 4 +- configure.ac | 29 +- src/HEXABLOCK/Hex.cxx | 35 +- src/HEXABLOCK/Hex.hxx | 13 +- src/HEXABLOCK/HexAssoEdge.cxx | 10 +- src/HEXABLOCK/HexAssoEdge.hxx | 36 +- src/HEXABLOCK/HexBiCylinder.cxx | 678 +- src/HEXABLOCK/HexBiCylinder.hxx | 87 +- src/HEXABLOCK/HexBiCylinderShape.cxx | 10 +- src/HEXABLOCK/HexBiCylinderShape.hxx | 3 - src/HEXABLOCK/HexCloner.cxx | 5 +- src/HEXABLOCK/HexCrossElements.cxx | 5 +- src/HEXABLOCK/HexCrossElements.hxx | 19 +- src/HEXABLOCK/HexDocument.cxx | 808 +- src/HEXABLOCK/HexDocument.hxx | 440 +- src/HEXABLOCK/HexDocument_Xml.cxx | 88 +- src/HEXABLOCK/HexDocument_asso.cxx | 70 +- src/HEXABLOCK/HexDocument_del.cxx | 378 + src/HEXABLOCK/HexDocument_quads.cxx | 217 +- src/HEXABLOCK/HexDocument_skin.cxx | 26 +- src/HEXABLOCK/HexDocument_tools.cxx | 466 + src/HEXABLOCK/HexDocument_trans.cxx | 102 +- src/HEXABLOCK/HexDocument_v6.cxx | 1140 + src/HEXABLOCK/HexDummyCad.hxx | 325 + src/HEXABLOCK/HexDumpStudy.cxx | 66 +- src/HEXABLOCK/HexDumpStudy.hxx | 27 +- src/HEXABLOCK/HexEdge.cxx | 160 +- src/HEXABLOCK/HexEdge.hxx | 138 +- src/HEXABLOCK/HexEdgeShape.cxx | 13 +- src/HEXABLOCK/HexEdgeShape.hxx | 20 +- src/HEXABLOCK/HexElements.cxx | 413 +- src/HEXABLOCK/HexElements.hxx | 312 +- src/HEXABLOCK/HexElements_asso.cxx | 405 +- src/HEXABLOCK/HexElements_bis.cxx | 270 +- src/HEXABLOCK/HexElements_check.cxx | 558 + src/HEXABLOCK/HexElements_del.cxx | 131 + src/HEXABLOCK/HexElements_grid.cxx | 138 +- src/HEXABLOCK/HexElements_piq.cxx | 1 + src/HEXABLOCK/HexElements_ter.cxx | 442 +- src/HEXABLOCK/HexElements_v6.cxx | 461 + src/HEXABLOCK/HexEltBase.cxx | 23 +- src/HEXABLOCK/HexEltBase.hxx | 6 +- src/HEXABLOCK/HexFaceShape.cxx | 8 +- src/HEXABLOCK/HexFaceShape.hxx | 19 - src/HEXABLOCK/HexGlobale.cxx | 3 + src/HEXABLOCK/HexGlobale.hxx | 5 +- src/HEXABLOCK/HexGroup.cxx | 35 +- src/HEXABLOCK/HexGroup.hxx | 11 +- src/HEXABLOCK/HexHexa.cxx | 237 +- src/HEXABLOCK/HexHexa.hxx | 136 +- src/HEXABLOCK/HexHexa_disco.cxx | 440 + src/HEXABLOCK/HexKasBiCylinder.cxx | 300 - src/HEXABLOCK/HexKasLine.cxx | 443 - src/HEXABLOCK/HexKasLine.hxx | 83 - src/HEXABLOCK/HexKasPoint.cxx | 138 - src/HEXABLOCK/HexKasPoint.hxx | 61 - src/HEXABLOCK/HexKas_functions.cxx | 34 +- src/HEXABLOCK/HexMatrix.hxx | 87 +- src/HEXABLOCK/HexNewShape.cxx | 99 +- src/HEXABLOCK/HexNewShape.hxx | 23 +- src/HEXABLOCK/HexPropagation.hxx | 13 +- src/HEXABLOCK/HexQuad.cxx | 177 +- src/HEXABLOCK/HexQuad.hxx | 119 +- src/HEXABLOCK/HexSubShape.cxx | 8 +- src/HEXABLOCK/HexSubShape.hxx | 25 +- src/HEXABLOCK/HexVector.cxx | 73 + src/HEXABLOCK/HexVector.hxx | 72 +- src/HEXABLOCK/HexVertex.cxx | 103 +- src/HEXABLOCK/HexVertex.hxx | 129 +- src/HEXABLOCK/HexVertexShape.cxx | 23 +- src/HEXABLOCK/HexVertexShape.hxx | 21 +- src/HEXABLOCK/HexWitness.cxx | 172 + src/HEXABLOCK/HexWitness.hxx | 69 + .../{HexKasBiCylinder.hxx => Hex_salome.cxx} | 44 +- src/HEXABLOCK/Makefile.am | 55 +- src/HEXABLOCK/Sauver | 20 +- src/HEXABLOCK/hexa_base.hxx | 44 +- src/HEXABLOCK/hexa_utils.cxx | 20 +- src/HEXABLOCK/make.main | 33 + src/HEXABLOCK/make.make | 229 + src/HEXABLOCK/make_dummycad | 43 + src/HEXABLOCK/make_swig | 31 + src/HEXABLOCK/makefile.swig | 37 + src/HEXABLOCK/test_brep.cxx | 28 +- src/HEXABLOCK/test_hexa1.cxx | 165 +- src/HEXABLOCK/test_hexa5.cxx | 39 +- src/HEXABLOCK/test_hexa6.cxx | 746 + src/HEXABLOCK/test_quads.cxx | 824 + src/HEXABLOCK/test_tools.cxx | 34 +- src/HEXABLOCK/test_unit.hxx | 27 +- src/HEXABLOCK/umake | 87 +- src/HEXABLOCK/work/env_python | 4 + src/HEXABLOCK/work/geompy.py | 2 + src/HEXABLOCK/work/hexablock.py | 51 + src/HEXABLOCK/work/umake | 6 + src/HEXABLOCKGUI/CutEdge_QTD.ui | 205 +- src/HEXABLOCKGUI/Disconnect_QTD.ui | 14 +- src/HEXABLOCKGUI/EdgeAssoc_QTD.ui | 8 +- src/HEXABLOCKGUI/Edge_QTD.ui | 8 +- src/HEXABLOCKGUI/Group_QTD.ui | 2 +- src/HEXABLOCKGUI/HEXABLOCKGUI.cxx | 1841 +- src/HEXABLOCKGUI/HEXABLOCKGUI.hxx | 113 +- .../HEXABLOCKGUI_DocumentDelegate.cxx | 28 +- .../HEXABLOCKGUI_DocumentDelegate.hxx | 4 - .../HEXABLOCKGUI_DocumentItem.cxx | 73 +- .../HEXABLOCKGUI_DocumentItem.hxx | 6 +- .../HEXABLOCKGUI_DocumentModel.cxx | 3526 +- .../HEXABLOCKGUI_DocumentModel.hxx | 319 +- .../HEXABLOCKGUI_DocumentPanel.cxx | 8852 +++-- .../HEXABLOCKGUI_DocumentPanel.hxx | 264 +- .../HEXABLOCKGUI_DocumentSelectionModel.cxx | 863 +- .../HEXABLOCKGUI_DocumentSelectionModel.hxx | 38 +- .../HEXABLOCKGUI_GraphicViewsHandler.cxx | 38 - .../HEXABLOCKGUI_GraphicViewsHandler.hxx | 2 +- src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx | 330 + src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h | 45 + .../HEXABLOCKGUI_OccGraphicView.cxx | 269 +- .../HEXABLOCKGUI_OccGraphicView.hxx | 31 +- src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx | 850 +- src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx | 52 +- .../HEXABLOCKGUI_VtkDocumentGraphicView.cxx | 260 +- .../HEXABLOCKGUI_VtkDocumentGraphicView.hxx | 47 +- src/HEXABLOCKGUI/Hexa_QTD.ui | 6 +- src/HEXABLOCKGUI/JoinQuad_QTD.ui | 486 +- src/HEXABLOCKGUI/Law_QTD.ui | 4 +- src/HEXABLOCKGUI/MakeCartesian_QTD.ui | 8 +- src/HEXABLOCKGUI/MakeCylinder_QTD.ui | 779 +- src/HEXABLOCKGUI/MakeCylinders_QTD.ui | 235 +- src/HEXABLOCKGUI/MakeCylindrical_QTD.ui | 6 +- src/HEXABLOCKGUI/MakeGrid_QTD.ui | 1277 +- src/HEXABLOCKGUI/MakeHemiSphere_QTD.ui | 1968 +- src/HEXABLOCKGUI/MakePipe_QTD.ui | 807 +- src/HEXABLOCKGUI/MakePipes_QTD.ui | 263 +- src/HEXABLOCKGUI/MakeRind_QTD.ui | 6 +- src/HEXABLOCKGUI/MakeSpherical_QTD.ui | 4 +- src/HEXABLOCKGUI/MakeTranslation_QTD.ui | 6 +- src/HEXABLOCKGUI/Makefile.am | 11 +- src/HEXABLOCKGUI/MergeEdges_QTD.ui | 6 +- src/HEXABLOCKGUI/MergeVertices_QTD.ui | 4 +- src/HEXABLOCKGUI/Merge_QTD.ui | 10 +- src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx | 2130 +- src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx | 92 +- .../MyDlgRef/DlgRef_1Sel2Spin_QTD.ui | 18 +- .../MyDlgRef/DlgRef_1Sel3Spin_QTD.ui | 18 +- .../MyDlgRef/DlgRef_2Sel1Spin_QTD.ui | 32 +- .../MyDlgRef/DlgRef_Skeleton_QTD.ui | 129 +- src/HEXABLOCKGUI/MyGEOMBase_Helper.cxx | 1429 - src/HEXABLOCKGUI/MyGEOMBase_Helper.hxx | 217 - src/HEXABLOCKGUI/MyGEOMBase_Skeleton.cxx | 276 +- src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx | 100 +- src/HEXABLOCKGUI/Pipe_QTD.ui | 4 +- src/HEXABLOCKGUI/PrismQuad_QTD.ui | 712 +- src/HEXABLOCKGUI/Propagation_QTD.ui | 2 +- src/HEXABLOCKGUI/QuadAssoc_QTD.ui | 4 +- src/HEXABLOCKGUI/QuadRevolution_QTD.ui | 488 +- src/HEXABLOCKGUI/Quad_QTD.ui | 6 +- src/HEXABLOCKGUI/RemoveHexa_QTD.ui | 4 +- src/HEXABLOCKGUI/ReplaceHexa_QTD.ui | 10 +- src/HEXABLOCKGUI/Symmetry_QTD.ui | 6 +- src/HEXABLOCKGUI/Transformation_QTD.ui | 8 +- src/HEXABLOCKGUI/Vector_QTD.ui | 8 +- src/HEXABLOCKGUI/Vertex_QTD.ui | 76 +- src/HEXABLOCKGUI/resources/HEXABLOCK_icons.ts | 28 + .../resources/HEXABLOCK_msg_en.ts | 4 +- .../resources/HEXABLOCK_msg_fr.ts | 4 +- src/HEXABLOCKGUI/resources/add_geom.png | Bin 0 -> 2023 bytes src/HEXABLOCKGUI/resources/make_grid.png | Bin 277 -> 1098 bytes src/HEXABLOCKGUI/resources/model_info.png | Bin 0 -> 2407 bytes src/HEXABLOCK_SWIG/Makefile.am | 68 + src/HEXABLOCK_SWIG/hexablock.py | 190 + src/HEXABLOCK_SWIG/hexablock_swig.i | 39 + src/HEXABLOCK_SWIG/hexablock_swig.py | 1002 + src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc | 31458 ++++++++++++++++ src/HEXABLOCK_SWIG/make_swig | 31 + src/Makefile.am | 22 +- 175 files changed, 57520 insertions(+), 19382 deletions(-) create mode 100644 src/HEXABLOCK/HexDocument_del.cxx create mode 100644 src/HEXABLOCK/HexDocument_tools.cxx create mode 100644 src/HEXABLOCK/HexDocument_v6.cxx create mode 100644 src/HEXABLOCK/HexDummyCad.hxx create mode 100644 src/HEXABLOCK/HexElements_check.cxx create mode 100644 src/HEXABLOCK/HexElements_del.cxx create mode 100644 src/HEXABLOCK/HexElements_v6.cxx create mode 100644 src/HEXABLOCK/HexHexa_disco.cxx delete mode 100755 src/HEXABLOCK/HexKasBiCylinder.cxx delete mode 100755 src/HEXABLOCK/HexKasLine.cxx delete mode 100755 src/HEXABLOCK/HexKasLine.hxx delete mode 100755 src/HEXABLOCK/HexKasPoint.cxx delete mode 100755 src/HEXABLOCK/HexKasPoint.hxx create mode 100644 src/HEXABLOCK/HexWitness.cxx create mode 100644 src/HEXABLOCK/HexWitness.hxx rename src/HEXABLOCK/{HexKasBiCylinder.hxx => Hex_salome.cxx} (55%) create mode 100755 src/HEXABLOCK/make.main create mode 100755 src/HEXABLOCK/make.make create mode 100755 src/HEXABLOCK/make_dummycad create mode 100755 src/HEXABLOCK/make_swig create mode 100755 src/HEXABLOCK/makefile.swig create mode 100644 src/HEXABLOCK/test_hexa6.cxx create mode 100644 src/HEXABLOCK/test_quads.cxx create mode 100644 src/HEXABLOCK/work/env_python create mode 100644 src/HEXABLOCK/work/geompy.py create mode 100644 src/HEXABLOCK/work/hexablock.py create mode 100755 src/HEXABLOCK/work/umake create mode 100755 src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx create mode 100755 src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h delete mode 100644 src/HEXABLOCKGUI/MyGEOMBase_Helper.cxx delete mode 100644 src/HEXABLOCKGUI/MyGEOMBase_Helper.hxx create mode 100644 src/HEXABLOCKGUI/resources/add_geom.png create mode 100644 src/HEXABLOCKGUI/resources/model_info.png create mode 100755 src/HEXABLOCK_SWIG/Makefile.am create mode 100644 src/HEXABLOCK_SWIG/hexablock.py create mode 100644 src/HEXABLOCK_SWIG/hexablock_swig.i create mode 100644 src/HEXABLOCK_SWIG/hexablock_swig.py create mode 100644 src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc create mode 100755 src/HEXABLOCK_SWIG/make_swig diff --git a/Makefile.am b/Makefile.am index b97a1fb..24f8cc0 100755 --- a/Makefile.am +++ b/Makefile.am @@ -24,9 +24,9 @@ ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ -I ${GUI_ROOT_DIR}/adm_local/unix/config_files \ -I ${GEOM_ROOT_DIR}/adm_local/unix/config_files -SUBDIRS = idl adm_local src bin doc +SUBDIRS = adm_local src bin doc -DIST_SUBDIRS= idl adm_local src bin doc +DIST_SUBDIRS= adm_local src bin doc DISTCLEANFILES = a.out aclocal.m4 configure diff --git a/configure.ac b/configure.ac index b23e11d..3c121a1 100755 --- a/configure.ac +++ b/configure.ac @@ -151,6 +151,10 @@ echo CHECK_PYTHON AM_PATH_PYTHON(2.3) +CHECK_SWIG + + +AC_PYTHON_DEVEL echo echo --------------------------------------------- @@ -242,7 +246,14 @@ echo CHECK_SALOME_GUI +gui_ok=no +if test "${SalomeGUI_need}" != "no" -a "${FullGUI_ok}" = "yes" ; then + gui_ok=yes +fi + +AM_CONDITIONAL(HEXABLOCK_ENABLE_GUI, [test "${gui_ok}" = "yes"]) +echo WITH GUI: ${gui_ok} echo echo --------------------------------------------- @@ -253,21 +264,6 @@ echo CHECK_GEOM -echo -echo --------------------------------------------- -echo Testing full GUI -echo --------------------------------------------- -echo - -CHECK_CORBA_IN_GUI -if test "x${CORBA_IN_GUI}" != "xyes"; then - echo "failed : For configure HEXABLOCK module necessary full GUI !" - exit -fi - - - - echo echo --------------------------------------------- echo Testing LIBXML @@ -356,9 +352,8 @@ AC_OUTPUT([ \ src/HEXABLOCKGUI/resources/HEXABLOCKCatalog.xml \ src/HEXABLOCKGUI/resources/SalomeApp.xml \ src/HEXABLOCK/Makefile \ - src/HEXABLOCK_I/Makefile \ + src/HEXABLOCK_SWIG/Makefile \ src/TEST_CPP/Makefile \ src/TEST_PY/Makefile \ - idl/Makefile \ Makefile \ ]) diff --git a/src/HEXABLOCK/Hex.cxx b/src/HEXABLOCK/Hex.cxx index d7f951b..9e3f361 100755 --- a/src/HEXABLOCK/Hex.cxx +++ b/src/HEXABLOCK/Hex.cxx @@ -39,11 +39,9 @@ Hex::Hex () // ======================================================== Destructeur Hex::~Hex () { -#ifndef NO_CASCADE int nbre = liste_documents.size(); for (int nd=0 ; nddump.start ("hexablock", "what", false); + + Globale* glob = Globale::getInstance (); + glob->mess.printMessage(); + + glob->dump.close (actif); +} +// ======================================================== sizeofMessage +int Hex::sizeofMessage () +{ + return glob->mess.sizeofMessage (); +} +// ======================================================== getMessageLine +cpchar Hex::getMessageLine (int nlig) +{ + return glob->mess.getLine (nlig); +} +// ======================================================== hex_instance +Hex* hex_instance () +{ + Hex* hexa = Hex::getInstance (); + return hexa; +} +// ======================================================== what (fonction) +void what () +{ + Hex* hexa = Hex::getInstance (); + hexa->what (); +} + END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/Hex.hxx b/src/HEXABLOCK/Hex.hxx index a800d3f..3d5b7c7 100755 --- a/src/HEXABLOCK/Hex.hxx +++ b/src/HEXABLOCK/Hex.hxx @@ -17,7 +17,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #ifndef __HEX_H @@ -27,6 +28,9 @@ BEGIN_NAMESPACE_HEXA +class Hex; +Hex* hex_instance (); + class Hex { public: @@ -41,7 +45,11 @@ public: Document* findDocument (cpchar name); Document* findDocument (const string& name) { return findDocument (name.c_str()) ; } + void what (); + int sizeofMessage (); + cpchar getMessageLine (int nlig); +#ifndef SWIG int loadAllDocs (cpchar flow); int saveAllDocs (cpchar filename); void makeName (cpchar radical, string& name); @@ -58,7 +66,10 @@ private: static Hex* first_instance; vector liste_documents; Globale* glob; +#endif // not SWIG }; +void what (); + END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexAssoEdge.cxx b/src/HEXABLOCK/HexAssoEdge.cxx index f55d560..bbcf28c 100755 --- a/src/HEXABLOCK/HexAssoEdge.cxx +++ b/src/HEXABLOCK/HexAssoEdge.cxx @@ -17,8 +17,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #include "HexAssoEdge.hxx" #include "HexXmlWriter.hxx" @@ -31,9 +31,8 @@ BEGIN_NAMESPACE_HEXA // static bool db = on_debug (); -// static const double TolAsso = 1e-2; // Tolerance pour les associations -// ========================================================= Constructeur +// ======================================================= Constructeur AssoEdge::AssoEdge (EdgeShape* shape, double deb, double fin) { arc_line = shape; @@ -87,12 +86,13 @@ double AssoEdge::length () // ========================================================= getUstart double AssoEdge::getUstart () { + double ustart = 0; BRepAdaptor_Curve* curve = arc_line->getCurve () ; double len = arc_line->getLength (); GCPnts_AbscissaPoint discret_start (*curve, len*arc_para1, curve->FirstParameter() ); - double ustart = discret_start.Parameter(); + ustart = discret_start.Parameter(); return ustart; } // ========================================================= saveXml diff --git a/src/HEXABLOCK/HexAssoEdge.hxx b/src/HEXABLOCK/HexAssoEdge.hxx index b15efc3..445eefa 100644 --- a/src/HEXABLOCK/HexAssoEdge.hxx +++ b/src/HEXABLOCK/HexAssoEdge.hxx @@ -1,34 +1,13 @@ // class : Gestion des formes associees (Hexa 5) -// Copyright (C) 2009-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 -// - #ifndef __ASSO_EDGE_H_ #define __ASSO_EDGE_H_ #include "HexEdgeShape.hxx" -#ifndef NO_CASCADE #include #include -#endif BEGIN_NAMESPACE_HEXA @@ -36,17 +15,18 @@ class AssoEdge { public : AssoEdge (EdgeShape* shape, double deb, double fin); + virtual ~AssoEdge () {} - EdgeShape* getEdgeShape() { return arc_line; } - BRepAdaptor_Curve* getCurve () { return arc_curve; } - double getStart () { return arc_para1; } - double getEnd () { return arc_para2; } + EdgeShape* getEdgeShape() { return arc_line; } + BRepAdaptor_Curve* getCurve () { return arc_curve; } + double getStart () { return arc_para1; } + double getEnd () { return arc_para2; } double length (); double getUstart (); // for Mesh Plugin - const double* getOrigin () { return arc_start; } - const double* getExtrem () { return arc_end; } + const double* getOrigin () { return arc_start; } + const double* getExtrem () { return arc_end; } int onExtremity (AssoEdge* other, int& ext_other); int onExtremity (double* point); @@ -64,7 +44,7 @@ private : bool arc_reverse; Real3 arc_start, arc_end; - BRepAdaptor_Curve* arc_curve; // Duplication a cause du plugin BP + BRepAdaptor_Curve* arc_curve; // Duplication a cause du plugin BP }; END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexBiCylinder.cxx b/src/HEXABLOCK/HexBiCylinder.cxx index c4ea2a6..e35cd78 100755 --- a/src/HEXABLOCK/HexBiCylinder.cxx +++ b/src/HEXABLOCK/HexBiCylinder.cxx @@ -1,24 +1,24 @@ // C++ : Gestion des cylindres croises -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-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 free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #include "HexBiCylinder.hxx" @@ -29,35 +29,23 @@ #include "HexEdge.hxx" #include "HexGlobale.hxx" -#include "HexCylinder.hxx" +#include "HexNewShape.hxx" +#include "HexBiCylinderShape.hxx" -static bool db = false; +/// static const double UnSur2pi = DEMI/M_PI; BEGIN_NAMESPACE_HEXA +static bool db = on_debug (); static const double cos45 = cos (M_PI/4); - - -void geom_define_line (string& brep); -void geom_asso_point (double angle, Vertex* node); - -void geom_create_circle (double* milieu, double rayon, double* normale, - double* base, string& brep); -int geom_create_cylcyl (double* borig, double* bnorm, double* bbase, - double bray, double bhaut, - double* sorig, double* snorm, double* sbase, - double sray, double shaut); -int geom_asso_cylcyl (Edge* edge); +#define NameOf(x) ((x)?x->getName():"Null") // ====================================================== Constructeur BiCylinder::BiCylinder (Document* doc) : Elements (doc) { cyl_fill = false; - cross_cyl1 = NULL; - cross_cyl1 = NULL; - cross_cyl2 = NULL; - grid_type = GR_BICYL; + grid_type = GR_BIPIPE; at_right = at_left = true; tab_hexa.push_back (NULL); @@ -65,6 +53,8 @@ BiCylinder::BiCylinder (Document* doc) tab_edge.push_back (NULL); tab_vertex.push_back (NULL); nbr_vertex = nbr_edges = nbr_quads = nbr_hexas = 1; + + grid_geom = NULL; } // ====================================================== getHexaIJK Hexa* BiCylinder::getHexaIJK (int cyl, int nx, int ny, int nz) @@ -126,7 +116,7 @@ Vertex* BiCylinder::getVertexIJK (int cyl, int nx, int ny, int nz) if (tab_vertex[nro] == NULL) printf ("NULL\n"); else - printf ("%s = (%g, %g, %g)\n", tab_vertex[nro]->getName(), + printf ("%s = (%g, %g, %g)\n", NameOf (tab_vertex[nro]), tab_vertex[nro]->getX(), tab_vertex[nro]->getY(), tab_vertex[nro]->getZ()); } @@ -149,7 +139,7 @@ Vertex* BiCylinder::addVertex (double px, double py, double pz, int cyl, if (node == NULL) printf ("NULL\n"); else - printf ("%s = (%g, %g, %g)\n", node->getName(), node->getX(), + printf ("%s = (%g, %g, %g)\n", NameOf (node), node->getX(), node->getY(), node->getZ()); } nbr_vertex ++; @@ -169,9 +159,9 @@ Edge* BiCylinder::addEdge (Vertex* v1, Vertex* v2, int cyl, int dir, int nx, printf ("pres_edge [%d,%d, %d,%d,%d] = E%d = ", cyl, dir, nx, ny, nz, nbr_edges); - printf ("%s ((%s, %s)) = (%s,%s)\n", edge->getName(), - edge->getVertex(0)->getName(), edge->getVertex(1)->getName(), - v1->getName(), v2->getName()); + printf ("%s ((%s, %s)) = (%s,%s)\n", NameOf(edge), + NameOf(edge->getVertex(0)), NameOf(edge->getVertex(1)), + NameOf(v1), NameOf(v2)); if (NOT edge->definedBy (v1,v2)) printf (" **** Incoherence !!\n"); } @@ -195,9 +185,9 @@ Edge* BiCylinder::addEdge (Vertex* v1, Vertex* v2, int cyl, int dir, int nx, if (edge == NULL) printf ("NULL\n"); else - printf ("%s = (%s, %s)\n", edge->getName(), - edge->getVertex(0)->getName(), - edge->getVertex(1)->getName()); + printf ("%s = (%s, %s)\n", NameOf(edge), + NameOf(edge->getVertex(0)), + NameOf(edge->getVertex(1))); } nbr_edges ++; return edge; @@ -209,7 +199,28 @@ Quad* BiCylinder::addQuad (Edge* e1, Edge* e2, Edge* e3, Edge* e4, int cyl, int key = getKey (cyl, dir, nx, ny, nz); int nro = map_quad [key]; if (nro>0) + { + if (db) + { + Quad* quad = tab_quad [nro]; + + printf ("pres_quad [%d,%d, %d,%d,%d] = Q%d = ", cyl, dir, nx, ny, nz, + nbr_quads); + printf ("%s (%s, %s, %s, %s)\n", NameOf(quad), + NameOf(e1), NameOf(e2), NameOf(e3), NameOf(e4)); + if (NOT quad->definedBy (e1,e3)) + { + printf (" **** Incoherence !!\n"); + printf ("%s = (%s, %s, %s, %s)\n", NameOf(quad), + NameOf(quad->getEdge(0)), NameOf(quad->getEdge(1)), + NameOf(quad->getEdge(1)), NameOf(quad->getEdge(2))); + printf ("%s = (%s, %s, %s, %s)\n", NameOf(quad), + NameOf(quad->getVertex(0)), NameOf(quad->getVertex(1)), + NameOf(quad->getVertex(1)), NameOf(quad->getVertex(2))); + } + } return tab_quad [nro]; + } Quad* quad = newQuad (e1, e2, e3, e4); map_quad [key] = nbr_quads; @@ -222,9 +233,9 @@ Quad* BiCylinder::addQuad (Edge* e1, Edge* e2, Edge* e3, Edge* e4, int cyl, if (quad == NULL) printf ("NULL\n"); else - printf ("%s = (%s, %s, %s, %s)\n", quad->getName(), - quad->getEdge(0)->getName(), quad->getEdge(1)->getName(), - quad->getEdge(2)->getName(), quad->getEdge(3)->getName()); + printf ("%s = (%s, %s, %s, %s)\n", NameOf(quad), + NameOf(quad->getEdge(0)), NameOf(quad->getEdge(1)), + NameOf(quad->getEdge(2)), NameOf(quad->getEdge(3))); } nbr_quads ++; return quad; @@ -252,10 +263,10 @@ Hexa* BiCylinder::addHexa (Quad* q1, Quad* q2, Quad* q3, Quad* q4, Quad* q5, if (hexa == NULL) printf ("NULL\n"); else - printf ("%s = (%s, %s, %s, %s, %s, %s)\n", hexa->getName(), - hexa->getQuad(0)->getName(), hexa->getQuad(1)->getName(), - hexa->getQuad(2)->getName(), hexa->getQuad(3)->getName(), - hexa->getQuad(4)->getName(), hexa->getQuad(5)->getName()); + printf ("%s = (%s, %s, %s, %s, %s, %s)\n", NameOf(hexa), + NameOf(hexa->getQuad(0)), NameOf(hexa->getQuad(1)), + NameOf(hexa->getQuad(2)), NameOf(hexa->getQuad(3)), + NameOf(hexa->getQuad(4)), NameOf(hexa->getQuad(5))); } nbr_hexas ++; return hexa; @@ -276,7 +287,7 @@ Vertex* BiCylinder::findVertex (double px, double py, double pz, if (db) printf ("findVertex [Big,%d,%d,%d] = V%d = '%d' = %s\n", nx, ny, nz, nro, it_map->first, - tab_vertex[nro]->getName()); + NameOf(tab_vertex[nro])); return elt; } } @@ -311,7 +322,7 @@ Edge* BiCylinder::findEdge (Vertex* v1, Vertex* v2, int dir, int nx, if (db) printf ("findEdge [%d, %d,%d,%d] = E%d = '%d' = %s\n", dir, nx, ny, nz, nro, it_map->first, - elt->getName()); + NameOf(elt)); return elt; } } @@ -333,7 +344,7 @@ Quad* BiCylinder::findQuad (Vertex* v1, Vertex* v2, if (db) printf ("findQuad [%d, %d,%d,%d] = E%d = '%d' = %s\n", dir, nx, ny, nz, nro, it_map->first, - elt->getName()); + NameOf(elt)); return elt; } } @@ -353,7 +364,7 @@ Quad* BiCylinder::findQuad (Edge* e1, Edge* e2, int dir, int nx, int ny, int nz) map_quad [key] = nro; if (db) printf ("findQuad [%d, %d,%d,%d] = E%d = '%d' = %s\n", - dir, nx, ny, nz, nro, it_map->first, elt->getName()); + dir, nx, ny, nz, nro, it_map->first, NameOf(elt)); return elt; } } @@ -380,131 +391,116 @@ Hexa* BiCylinder::findHexa (Quad* q1, Quad* q2, int nx, int ny, int nz) fatal_error ("HexBiCylinder : Hexa non trouve"); return NULL; } -// ====================================================== crossCylinders -int BiCylinder::crossCylinders (Cylinder* lun, Cylinder* lautre) +// ====================================================== createLittlePipe +void BiCylinder::createLittlePipe () { - if (lun->getRadius() < lautre->getRadius()) - { - cross_cyl1 = lun; - cross_cyl2 = lautre; - } - else - { - cross_cyl1 = lautre; - cross_cyl2 = lun; - } - - int ier = cross_cyl2->interCylinder (cross_cyl1, at_left, at_right, - cross_center); - if (ier != HOK) - return ier; - - cyl_fill = false; - cross_rayext [CylSmall] = cross_cyl1->getRadius (); - cross_rayext [CylBig] = cross_cyl2->getRadius (); - cross_rayint [CylSmall] = cross_rayext [CylSmall] / 2; - cross_rayint [CylBig ] = cross_rayext [CylBig ] / 2; - cross_hauteur [CylSmall] = cross_cyl1->getHeight (); - cross_hauteur [CylBig] = cross_cyl2->getHeight (); - - createLittleCyl (); - createBigCyl (); - adjustLittleSlice (1, 1); - adjustLittleSlice (0, 2); - adjustLittleSlice (0, 3); - adjustLittleSlice (1, 4); - - Vector* iprim = new Vector (cross_cyl1->getDirection()); - Vector* kprim = new Vector (cross_cyl2->getDirection()); - Vector* jprim = new Vector (kprim); + Real lg = cross_hauteur[CylSmall]; + Real h1 = calc_distance (cross_center, cross_orismall); + Real h2 = cross_rayext[CylBig]*cos45; + Real h3 = (cross_rayext[CylBig] - cross_rayint[CylBig])*cos45; + Real h5 = lg-h1; - iprim->renormer (); - kprim->renormer (); - jprim->vectoriel (kprim, iprim); +// double t_haut [NbrVslices] = { -h1, -h2, -h2+h3, h2-h3, h2, lg-h1 }; - // transfoVertices (cross_center, iprim, jprim, kprim); + if (at_left) + { + addSlice (CylSmall, 0, 0, -h1, cross_rayint [CylSmall]); + addSlice (CylSmall, 1, 0, -h1, cross_rayext [CylSmall]); + addSlice (CylSmall, 1, 1, -h2, cross_rayext [CylSmall]); + addSlice (CylSmall, 0, 2, h3-h2, cross_rayint [CylSmall]); + } - // Real3 snorm, bnorm; - // iprim->getCoord (snorm); - // kprim->getCoord (bnorm); + addSlice (CylSmall, 2, 1, -h2, cross_rayext [CylBig]); + addSlice (CylSmall, 1, 2, h3-h2, cross_rayint [CylBig]); + addSlice (CylSmall, 1, 3, h2-h3, cross_rayint [CylBig]); + addSlice (CylSmall, 2, 4, h2, cross_rayext [CylBig]); - Real3 bnorm = {0, 0, 1}; - Real3 snorm = {1, 0, 0}; - assoCylinders (snorm, bnorm); + if (at_right) + { + addSlice (CylSmall, 0, 3, h2-h3, cross_rayint [CylSmall]); + addSlice (CylSmall, 1, 4, h2, cross_rayext [CylSmall]); + addSlice (CylSmall, 0, 5, h5, cross_rayint [CylSmall]); + addSlice (CylSmall, 1, 5, h5, cross_rayext [CylSmall]); + } -/********************************************* + // ka kb kc kd if (at_left) { - assoIntersection (NxExt, 1, snorm, bnorm); - if (grid_type == GR_BIPIPE) - { - assoIntersection (NxInt, 2, snorm, bnorm); - } + fillSlice (CylSmall, 0,0, 0,2, 1,1, 1,0); + fillSlice (CylSmall, 0,2, 1,2, 2,1, 1,1); + if (cyl_fill) + addCube (CylSmall, 0,0,2); } + else + addCube ( CylSmall, 1, 2); + + fillSlice (CylSmall, 1,2, 1,3, 2,4, 2,1, true); if (at_right) { - assoIntersection (NxExt, NbrSlices1-1, snorm, bnorm); - if (grid_type == GR_BIPIPE) - { - assoIntersection (NxInt, NbrSlices1-2, snorm, bnorm); - } + fillSlice (CylSmall, 1,3, 0,3, 1,4, 2,4); + fillSlice (CylSmall, 0,3, 0,5, 1,5, 1,4); + if (cyl_fill) + addCube (CylSmall, 3, 0, 5); } - - ******************************************* */ - assoResiduelle (); - return HOK; + else + addCube ( CylSmall, 3, 1); } // ====================================================== createLittleCyl void BiCylinder::createLittleCyl () { - Real3 base; - Vertex* vbase = cross_cyl1->getBase(); + Real lg = cross_hauteur[CylSmall]; + Real rayon = cross_rayext[CylSmall]; - Real lg = cross_hauteur[CylSmall]; - Real h1 = calc_distance (cross_center, vbase->getPoint (base)); - Real h2 = cross_rayext[CylBig]*cos45; - Real h3 = (cross_rayext[CylBig] - cross_rayint[CylBig])*cos45; + Real h1 = calc_distance (cross_center, cross_orismall); + Real h2 = cross_rayext[CylBig]*cos45; - double t_haut [NbrVslices] = { -h1, -h2, -h2+h3, h2-h3, h2, lg-h1 }; + if (at_left) + addCarre (CylSmall, 0, -h1, rayon); + addCarre (CylSmall, 1, -h2, rayon); + addCarre (CylSmall, 2, h2, rayon); + if (at_right) + addCarre (CylSmall, 3, lg-h1, rayon); - for (int nk=0; nkgetBase(); Real lg = cross_hauteur[cyl]; Real rext = cross_rayext [cyl]; Real rint = cross_rayint [cyl]; - Real h1 = calc_distance (cross_center, vbase->getPoint (base)); + + Real h1 = calc_distance (cross_center, cross_oribig); Real h2 = rext * cos45; Real h3 = lg - h1; Real dh = (rext - rint)*cos45; @@ -519,8 +515,12 @@ void BiCylinder::createBigCyl () addSlice (CylBig, 1, 3, h3, rext); // A B C D + if (cyl_fill) + addCube (CylBig, 0); fillSlice (CylBig, 0,0, 0,1, 1,1, 1,0); - fillSlice (CylBig, 0,2, 0,3, 1,3, 1,2); + if (cyl_fill) + addCube (CylBig, 2); + fillSlice (CylBig, 0,2, 0,3, 1,3, 1,2); } // ====================================================== adjustLittleSlice void BiCylinder::adjustLittleSlice (int ni, int nk) @@ -570,9 +570,105 @@ void BiCylinder::addSlice (int cyl, int ni, int nk, double hauteur, addVertex (hauteur, px, py, CylSmall, ni, nj, nk); } } +// ====================================================== addCarre +void BiCylinder::addCarre (int cyl, int nk, double hauteur, double rayon, + bool find) +{ + for (int nj=0 ; njgetY(); + double px = sqrt (grayon2 - py*py); + + if (node->getX() > 0) node->setX ( px); + else node->setX (-px); + } +} +// ====================================================== addCube +void BiCylinder::addCube (int cyl, int nk0, int nvi0, int k1) +{ +/* ***************************************************************** + H=bed +----bd-----+ bdf=G......0 + /| /| + be | B bf | + / | / | + E=bce +----bc-----+...|...bcf=F + | de D | df + | E | | F | J + ce | C cf | ^ + D=ade...|...+----ad-|---+ adf=C.....3 | I + | / | / | / + | ae A | af | / + |/ |/ |/ + A=ace +----ac-----+ acf=B.....2 +-----> K + + ***************************************************************** */ + enum { nj0, nj1, nj2, nj3, ni0=0 }; + const int nk1 = k1>0 ? k1 : nk0+1; + const int nvi1 = nvi0==1 ? 2 + : nvi0==2 ? 1 : 0; + + // La face F + Vertex* vacf = getVertexIJK (cyl, nvi1, nj2, nk1); + Vertex* vadf = getVertexIJK (cyl, nvi1, nj3, nk1); + Vertex* vbdf = getVertexIJK (cyl, nvi1, nj0, nk1); + Vertex* vbcf = getVertexIJK (cyl, nvi1, nj1, nk1); + + Edge* eaf = addEdge (vacf, vadf, cyl, dir_y, ni0, nj2, nk1); + Edge* edf = addEdge (vadf, vbdf, cyl, dir_y, ni0, nj3, nk1); + Edge* ebf = addEdge (vbcf, vbdf, cyl, dir_y, ni0, nj0, nk1); + Edge* ecf = addEdge (vacf, vbcf, cyl, dir_y, ni0, nj1, nk1); + + Quad* qf = addQuad (eaf, edf, ebf, ecf, cyl, dir_z, ni0 , nj0, nk1); + + Vertex* vace = getVertexIJK (cyl, nvi0, nj2, nk0); + Vertex* vade = getVertexIJK (cyl, nvi0, nj3, nk0); + Vertex* vbde = getVertexIJK (cyl, nvi0, nj0, nk0); + Vertex* vbce = getVertexIJK (cyl, nvi0, nj1, nk0); + + Edge* eac = addEdge (vace, vacf, cyl, dir_z, ni0, nj2, nk0); + Edge* ead = addEdge (vade, vadf, cyl, dir_z, ni0, nj3, nk0); + Edge* ebd = addEdge (vbde, vbdf, cyl, dir_z, ni0, nj0, nk0); + Edge* ebc = addEdge (vbce, vbcf, cyl, dir_z, ni0, nj1, nk0); + + Edge* eae = addEdge (vace, vade, cyl, dir_y, ni0, nj2, nk0); + Edge* ede = addEdge (vade, vbde, cyl, dir_y, ni0, nj3, nk0); + Edge* ebe = addEdge (vbce, vbde, cyl, dir_y, ni0, nj0, nk0); + Edge* ece = addEdge (vace, vbce, cyl, dir_y, ni0, nj1, nk0); + +// Quad* qe = addQuad (eae, ede, ebe, ece, cyl, dir_z, ni0 , nj0, nk0); + Quad* qe = addQuad (eae, ece, ebe, ede, cyl, dir_z, ni0 , nj0, nk0); + +// Quad* qa = addQuad (eac, eaf, ead, eae, cyl, dir_y, ni0 , nj2, nk0); + Quad* qa = addQuad (eac, eae, ead, eaf, cyl, dir_y, ni0 , nj2, nk0); +// Quad* qd = addQuad (ead, edf, ebd, ede, cyl, dir_x, ni0 , nj3, nk0); + Quad* qd = addQuad (ead, ede, ebd, edf, cyl, dir_x, ni0 , nj3, nk0); + Quad* qb = addQuad (ebc, ebf, ebd, ebe, cyl, dir_y, ni0 , nj0, nk0); + Quad* qc = addQuad (eac, ecf, ebc, ece, cyl, dir_x, ni0 , nj1, nk0); + + addHexa (qa, qb, qc, qd, qe, qf, cyl, ni0, nj0, nk0); +} // ====================================================== fillSlice /* ***************************************************************** - H=bed +----bd-----+ bdf=G + H=bde +----bd-----+ bdf=G /| /| be | B bf | / | / | @@ -606,25 +702,14 @@ void BiCylinder::fillSlice (int cyl, int nia, int nka, int nib, int nkb, Vertex* vbdf = getVertexIJK (cyl, nic, nj1, nkc); Vertex* vbde = getVertexIJK (cyl, nid, nj1, nkd); -/* ******************* - PutName (vace); - PutName (vacf); - PutName (vadf); - PutName (vade); - PutName (vbce); - PutName (vbcf); - PutName (vbdf); - PutName (vbde); - ******************* */ - Edge* eac = addEdge (vace, vacf, cyl, dir_z, nia, nj0, nka); - Edge* ead = addEdge (vade, vadf, cyl, dir_z, nid, nj0, nkd); - Edge* eae = addEdge (vace, vade, cyl, dir_x, nia, nj0, nka); + Edge* ead = addEdge (vadf, vade, cyl, dir_z, nid, nj0, nkd); + Edge* eae = addEdge (vade, vace, cyl, dir_x, nia, nj0, nka); Edge* eaf = addEdge (vacf, vadf, cyl, dir_x, nib, nj0, nkb); Edge* ebc = addEdge (vbce, vbcf, cyl, dir_z, nia, nj1, nka); - Edge* ebd = addEdge (vbde, vbdf, cyl, dir_z, nid, nj1, nkd); - Edge* ebe = addEdge (vbce, vbde, cyl, dir_x, nia, nj1, nka); + Edge* ebd = addEdge (vbdf, vbde, cyl, dir_z, nid, nj1, nkd); + Edge* ebe = addEdge (vbde, vbce, cyl, dir_x, nia, nj1, nka); Edge* ebf = addEdge (vbcf, vbdf, cyl, dir_x, nib, nj1, nkb); Edge* ece = addEdge (vace, vbce, cyl, dir_y, nia, nj0, nka); @@ -632,104 +717,112 @@ void BiCylinder::fillSlice (int cyl, int nia, int nka, int nib, int nkb, Edge* edf = addEdge (vadf, vbdf, cyl, dir_y, nic, nj0, nkc); Edge* ede = addEdge (vade, vbde, cyl, dir_y, nid, nj0, nkd); - Quad* qa = addQuad (eac, eaf, ead, eae, cyl, dir_y, nia , nj0, nka); - Quad* qb = addQuad (ebc, ebf, ebd, ebe, cyl, dir_y, nia , nj1, nka); - Quad* qc = addQuad (eac, ecf, ebc, ece, cyl, dir_x, nia , nj0, nka); - Quad* qd = addQuad (ead, edf, ebd, ede, cyl, dir_x, nid , nj0, nkd); - Quad* qe = addQuad (eae, ede, ebe, ece, cyl, dir_z, nia , nj0, nka); - Quad* qf = addQuad (eaf, edf, ebf, ecf, cyl, dir_z, nib , nj0, nkb); + // Quad* qa = addQuad (eac, eaf, ead, eae, cyl, dir_y, nia+1, nj0, nka); + Quad* qa = addQuad (eac, eae, ead, eaf, cyl, dir_y, nia+1, nj0, nka); + Quad* qb = addQuad (ebc, ebf, ebd, ebe, cyl, dir_y, nia+1, nj1, nka); - addHexa (qa, qb, qc, qd, qe, qf, cyl, nia, nj0, nka); + Quad* qc = addQuad (eac, ecf, ebc, ece, cyl, dir_x, nia+1, nj0, nka); + // Quad* qd = addQuad (ead, edf, ebd, ede, cyl, dir_x, nid+1, nj0, nkd); + Quad* qd = addQuad (ead, ede, ebd, edf, cyl, dir_x, nid+1, nj0, nkd); + + // Quad* qe = addQuad (eae, ede, ebe, ece, cyl, dir_z, nia+1, nj0, nka); + Quad* qe = addQuad (eae, ece, ebe, ede, cyl, dir_z, nia+1, nj0, nka); + Quad* qf = addQuad (eaf, edf, ebf, ecf, cyl, dir_z, nib+1, nj0, nkb); + + addHexa (qa, qb, qc, qd, qe, qf, cyl, nia+1, nj0, nka); } } // ====================================================== assoCylinders void BiCylinder::assoCylinders (double* snormal, double* gnormal) { - assoSlice (CylSmall, 0, 0, snormal); - assoSlice (CylSmall, 1, 0, snormal); - assoSlice (CylSmall, 0, 5, snormal); - assoSlice (CylSmall, 1, 5, snormal); + char name [12]; + sprintf (name, "grid_%02d", el_id); + grid_geom = el_root->addShape (name, SH_INTER); + grid_geom -> openShape(); - for (int nk=0 ; nk<4 ; nk++) - for (int ni=0 ; ni<2 ; ni++) - assoSlice (CylBig, ni, nk, gnormal); + int s_kmax = 5; + int isize = cyl_fill ? 1 : 2; + int g_ksize = 4; - assoIntersection (1, 1, snormal, gnormal); - assoIntersection (0, 2, snormal, gnormal); - assoIntersection (0, 3, snormal, gnormal); - assoIntersection (1, 4, snormal, gnormal); + for (int ni=0 ; ni closeShape(); } // ====================================================== assoSlice void BiCylinder::assoSlice (int cyl, int nx, int nzs, double* normal) { - Real3 center, pnt1, pnt2, vbase; - string brep; + Real3 center, pnt0, pnt1, pnt2, vbase; int ny0 = 0; - int nyd = NbrCotes/2; + int ny1 = 1; + int ny2 = NbrCotes/2; Vertex* v0 = getVertexIJK (cyl, nx, ny0 , nzs); - Vertex* vd = getVertexIJK (cyl, nx, nyd , nzs); + Vertex* v1 = getVertexIJK (cyl, nx, ny1 , nzs); + Vertex* v2 = getVertexIJK (cyl, nx, ny2 , nzs); - if (vd==NULL || v0==NULL) + if (v0==NULL || v1==NULL || v2==NULL) return; - v0->getPoint (pnt1); - vd->getPoint (pnt2); + v0->getPoint (pnt0); + v1->getPoint (pnt1); + v2->getPoint (pnt2); double rayon = 0; for (int nro=0 ; nroaddCircle (center, sqrt(rayon), normal, vbase); for (int ny=0 ; ny (%s,%s)\n", edge->getName(), - edge->getVertex(0)->getName(), edge->getVertex(1)->getName(), - node0->getName(), node1->getName()); + const double Decal = 1.0 / NbrCotes; + const double Start = Decal / 2; - // Shape* shape = new Shape (brep); + int ny2 = ny+1; + double posit = Start + ny*Decal; + Edge* edge = getEdgeJ (cyl, nx, ny, nz); + if (edge==NULL) + return; - // shape->setBounds (ny*Alpha, (ny+1)*Alpha); - // edge ->addAssociation (shape); + // Vertex + Vertex* node = getVertexIJK (cyl, nx, ny, nz); + grid_geom->addAssociation (node, subid, posit); - geom_asso_point ( ny *Theta*rayon, node0); - geom_asso_point ((ny+1)*Theta*rayon, node1); + if (ny2 < NbrCotes) + { + grid_geom->addAssociation (edge, subid, posit, posit+Decal); + // node = getVertexIJK (cyl, nx, ny2, nz); + // grid_geom->addAssociation (node, subid, angle2*UnSur2pi); + } + else + { + grid_geom->addAssociation (edge, subid, posit, 1.0); + grid_geom->addAssociation (edge, subid, 0, Start); + } } // ===================================================== assoIntersection int BiCylinder::assoIntersection (int nxs, int nzs, double* snorm, double* bnorm) { - Real3 X_center = {0, 0, 0}; // provisoire, a la place de cross_center Real3 pse, psw, sorig, sbase; Real3 pbe, pbw, borig, bbase; string brep; @@ -739,10 +832,18 @@ int BiCylinder::assoIntersection (int nxs, int nzs, double* snorm, int nz = nzs < MiddleSlice1 ? 0 : 5; - getVertexIJK (CylSmall, nxs, ny0 , nz)->getPoint (pse); - getVertexIJK (CylSmall, nxs, nyd , nz)->getPoint (psw); - getVertexIJK (CylBig, nxs, ny0 , 0) ->getPoint (pbe); - getVertexIJK (CylBig, nxs, nyd , 0) ->getPoint (pbw); + Vertex* vse = getVertexIJK (CylSmall, nxs, ny0 , nz); + Vertex* vsw = getVertexIJK (CylSmall, nxs, nyd , nz); + Vertex* vbe = getVertexIJK (CylBig, nxs, ny0 , 0); + Vertex* vbw = getVertexIJK (CylBig, nxs, nyd , 0); + + if (vse==NULL || vsw==NULL || vbe==NULL || vbw==NULL) + return HERR; + + vse->getPoint (pse); + vsw->getPoint (psw); + vbe->getPoint (pbe); + vbw->getPoint (pbw); double srayon = calc_distance (pse, psw)/2; double brayon = calc_distance (pbe, pbw)/2; @@ -752,22 +853,13 @@ int BiCylinder::assoIntersection (int nxs, int nzs, double* snorm, calc_vecteur (psw, pse, sbase); calc_vecteur (pbw, pbe, bbase); - double shaut = calc_distance (X_center, sorig); - double bhaut = calc_distance (X_center, borig)*2; - double* orig = nzs < MiddleSlice1 ? sorig : X_center; // Pb orientation - - if (db) - { - PutCoord (borig); - PutCoord (sorig); - PutCoord (orig); - PutData (nz); - PutData (srayon); - PutData (brayon); - } + double shaut = calc_distance (cross_center, sorig); + double bhaut = calc_distance (cross_center, borig)*2; + double* orig = nzs < MiddleSlice1 ? sorig : cross_center; // Pb orientation - int ier = geom_create_cylcyl (borig, bnorm, bbase, brayon, bhaut, - orig, snorm, sbase, srayon, shaut); + BiCylinderShape bicyl_shape (el_root); + int ier = bicyl_shape.defineCyls (borig, bnorm, bbase, brayon, bhaut, + orig, snorm, sbase, srayon, shaut); if (ier != HOK) return ier; @@ -781,29 +873,93 @@ int BiCylinder::assoIntersection (int nxs, int nzs, double* snorm, for (int ny=0 ; nyaddVertex ( 0,0,0); - Vertex* ori2 = docu->addVertex (-5,0,5); - Vector* vz = docu->addVector ( 0,0,1); - Vector* vx = docu->addVector ( 1,0,0); + cyl_fill = fill; + cross_hauteur [CylBig] = h2; + cross_rayext [CylBig ] = rext2; + cross_rayint [CylBig ] = rint2; + + cross_hauteur [CylSmall] = h1; + cross_rayext [CylSmall] = rext1; + cross_rayint [CylSmall] = rint1; + + ori1->getPoint (cross_orismall); + ori2->getPoint (cross_oribig ); + copy_vecteur (vz2, cross_dirbig); + copy_vecteur (vz1, cross_dirsmall); + +// Intersection des 2 cylindres : + int ier = checkInter (cross_oribig, vz2, rext2, h2, + cross_orismall, vz1, rext1, h1, + cross_center, at_left, at_right); + if (ier != HOK) + return ier; + + createLittlePipe (); + createBigPipe (); + + if (at_left) + { + adjustLittleSlice (1, 1); + adjustLittleSlice (0, 2); + } + if (at_right) + { + adjustLittleSlice (0, 3); + adjustLittleSlice (1, 4); + } + + transfoVertices (cross_center, cross_dirsmall, cross_dirbig); + // assoCylinders (cross_dirsmall, cross_dirbig); + +#if 0 + // iprim->getCoord (snorm); + // kprim->getCoord (bnorm); + + Real3 bnorm = {0, 0, 1}; + Real3 snorm = {1, 0, 0}; + assoCylinders (snorm, bnorm); - double r1 = 2*sqrt (2.0); - double r2 = 3*sqrt (2.0); - double l2 = 10; - double l1 = 10; +/********************************************* + if (at_left) + { + assoIntersection (NxExt, 1, snorm, bnorm); + if (grid_type == GR_BIPIPE) + { + assoIntersection (NxInt, 2, snorm, bnorm); + } + } - Cylinder* cyl1 = docu->addCylinder (ori1, vz, r1, l1); - Cylinder* cyl2 = docu->addCylinder (ori2, vx, r2, l2); + if (at_right) + { + assoIntersection (NxExt, NbrSlices1-1, snorm, bnorm); + if (grid_type == GR_BIPIPE) + { + assoIntersection (NxInt, NbrSlices1-2, snorm, bnorm); + } + } - BiCylinder* grid = new BiCylinder (docu); - grid->crossCylinders (cyl1, cyl2); - return grid; + ******************************************* */ + // assoResiduelle (); +#endif + // el_root->reorderQuads (); + return HOK; } END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexBiCylinder.hxx b/src/HEXABLOCK/HexBiCylinder.hxx index 59b6d28..35acf65 100755 --- a/src/HEXABLOCK/HexBiCylinder.hxx +++ b/src/HEXABLOCK/HexBiCylinder.hxx @@ -1,23 +1,24 @@ // Class : Gestion des tutaux en T (like castles in scotland) -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #ifndef __BI_CYLINDER_H_ #define __BI_CYLINDER_H_ @@ -27,19 +28,11 @@ BEGIN_NAMESPACE_HEXA -class BiCylinder : public Elements +class BiCylinder : public Elements { -public: - virtual int countHexa () { return nbr_hexas ; } - virtual int countQuad () { return nbr_quads ; } - virtual int countEdge () { return nbr_edges ; } - virtual int countVertex () { return nbr_vertex ; } - public: BiCylinder (Document* doc); - virtual ~BiCylinder () {} - Hexa* getHexaIJK (int part, int nx, int ny, int nz); Quad* getQuadIJ (int part, int nx, int ny, int nz); Quad* getQuadJK (int part, int nx, int ny, int nz); @@ -49,22 +42,40 @@ public: Edge* getEdgeK (int part, int nx, int ny, int nz); Vertex* getVertexIJK (int part, int nx, int ny, int nz); +#ifndef SWIG +public : + virtual ~BiCylinder () {} // Tutaux en T (like castles in scotland) - int crossCylinders (Cylinder* cyl1, Cylinder* cyl2); + int makeCylinders (Vertex* ori1, double* vz1, double ray1, double h1, + Vertex* ori2, double* vz2, double ray2, double h2); + + int makePipes (Vertex* ori1, double* z1, double ri1, double rx1, double h1, + Vertex* ori2, double* z2, double ri2, double rx2, double h2, + bool fill=false); + + virtual int countHexa () { return nbr_hexas ; } + virtual int countQuad () { return nbr_quads ; } + virtual int countEdge () { return nbr_edges ; } + virtual int countVertex () { return nbr_vertex ; } + + // int crossCylinders (Cylinder* cyl1, Cylinder* cyl2); // perime private : - + enum { NbrSlices=5, NbrVslices=NbrSlices+1, NbrCotes=4 }; + void createLittlePipe (); + void createBigPipe (); void createLittleCyl (); void createBigCyl (); - void adjustLittleSlice (int nx, int nzs); + void adjustLittleSlice (int nx, int nzs); + void adjustLittleSquare (int nk); - Vertex* addVertex (double px, double py, double pz, + Vertex* addVertex (double px, double py, double pz, int cyl, int ni, int nj, int nk); - Edge* addEdge (Vertex* v1, Vertex* v2, + Edge* addEdge (Vertex* v1, Vertex* v2, int cyl, int dir, int nx, int ny, int nz); - Quad* addQuad (Edge* e1, Edge* e2, Edge* e3, Edge* e4, + Quad* addQuad (Edge* e1, Edge* e2, Edge* e3, Edge* e4, int cyl, int dir, int nx, int ny, int nz); Hexa* addHexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf, int cyl, int nx, int ny, int nz); @@ -81,25 +92,26 @@ private : void assoCylinder (int cyl, double* normal); void assoCylinders (double* snormal, double* gnormal); void assoSlice (int cyl, int nx, int nzs, double* norm); - void assoArc (int cyl, int nx, int ny, int nz, string& brep, double ray); + void assoArc (int cyl, int nx, int ny, int nz, int subid); int assoIntersection (int nx, int nzlice, double* snorm, double* bnorm); void addSlice (int cyl, int i, int k, double h, double r, bool find=false); - void fillSlice (int cyl, int nia, int nka, int nib, int nkb, int nic, + void addCarre (int cyl, int k, double h, double r, bool find=false); + void addCube (int cyl, int k, int i=0, int k1=-1); + void fillSlice (int cyl, int nia, int nka, int nib, int nkb, int nic, int nkc, int nid, int nkd, bool med=false); - void fillSmallCyl (); double getAngle (int nj) { return (2*((nj)%4)+1)*M_PI/4; } - int getKey (int cyl, int ni, int nj, int nk) + int getKey (int cyl, int ni, int nj, int nk) { return 1000*(cyl+1) + 100*ni + 10*nj + nk; } - int getKey (int cyl, int dd, int ni, int nj, int nk) + int getKey (int cyl, int dd, int ni, int nj, int nk) { return 10000*(cyl+1) + 1000*dd + 100*ni + 10*nj + nk; } private : - Cylinder* cross_cyl1; // Petit - Cylinder* cross_cyl2; // gros Real3 cross_center; - + Real3 cross_oribig, cross_dirbig; + Real3 cross_orismall, cross_dirsmall; + map map_vertex, map_edge, map_quad, map_hexa; map :: iterator it_map; @@ -109,6 +121,9 @@ private : double cross_hauteur [V_TWO]; bool at_right, at_left; + + NewShape* grid_geom; +#endif }; END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexBiCylinderShape.cxx b/src/HEXABLOCK/HexBiCylinderShape.cxx index d72057f..a1770cd 100755 --- a/src/HEXABLOCK/HexBiCylinderShape.cxx +++ b/src/HEXABLOCK/HexBiCylinderShape.cxx @@ -17,9 +17,9 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // - //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 #include "HexBiCylinderShape.hxx" @@ -31,7 +31,6 @@ #include "HexVertex.hxx" #include "HexEdge.hxx" -#ifndef NO_CASCADE // Cylindre #include #include @@ -214,8 +213,8 @@ int BiCylinderShape::associate (Edge* edge) } // ====================================================== associate // ==== On suppose une orientation correcte -int BiCylinderShape::associate (Edge* edge, EdgeShape* line, double para1, - double para2, int extrem) +int BiCylinderShape::associate (Edge* edge, EdgeShape* line, + double para1, double para2, int extrem) { edge->addAssociation (line, para1, para2); @@ -238,4 +237,3 @@ int BiCylinderShape::associate (Edge* edge, EdgeShape* line, double para1, } } END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexBiCylinderShape.hxx b/src/HEXABLOCK/HexBiCylinderShape.hxx index ec4d38d..3325973 100755 --- a/src/HEXABLOCK/HexBiCylinderShape.hxx +++ b/src/HEXABLOCK/HexBiCylinderShape.hxx @@ -25,8 +25,6 @@ #include "HexGlobale.hxx" -#ifndef NO_CASCADE - BEGIN_NAMESPACE_HEXA class BiCylinderShape @@ -55,4 +53,3 @@ private : }; END_NAMESPACE_HEXA #endif -#endif diff --git a/src/HEXABLOCK/HexCloner.cxx b/src/HEXABLOCK/HexCloner.cxx index 94a539c..f50e322 100755 --- a/src/HEXABLOCK/HexCloner.cxx +++ b/src/HEXABLOCK/HexCloner.cxx @@ -35,7 +35,6 @@ BEGIN_NAMESPACE_HEXA void transfo_brep (string& brep, Matrix* matrice, string& trep); -void geom_dump_asso (Edge* edge); static bool db = false; // ============================================================= Constructeur @@ -109,8 +108,8 @@ Edge* Cloner::clonerEdge (Edge* orig) { printf ( " --- Cloner::Asso (%s) -> asso (%s)\n", orig ->getName (), copie->getName ()); - geom_dump_asso (orig ); - geom_dump_asso (copie); + // geom_dump_asso (orig ); + // geom_dump_asso (copie); } } ***************************************************/ diff --git a/src/HEXABLOCK/HexCrossElements.cxx b/src/HEXABLOCK/HexCrossElements.cxx index 6e21e89..9fab3c2 100755 --- a/src/HEXABLOCK/HexCrossElements.cxx +++ b/src/HEXABLOCK/HexCrossElements.cxx @@ -17,8 +17,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #include "HexCrossElements.hxx" @@ -30,7 +30,6 @@ #include "HexGlobale.hxx" #include "HexCylinder.hxx" -#include "HexOldShape.hxx" #include "HexNewShape.hxx" #include diff --git a/src/HEXABLOCK/HexCrossElements.hxx b/src/HEXABLOCK/HexCrossElements.hxx index 88ecf95..5160cad 100755 --- a/src/HEXABLOCK/HexCrossElements.hxx +++ b/src/HEXABLOCK/HexCrossElements.hxx @@ -36,15 +36,7 @@ enum { NO_CYL=-1, NO_PIPE=0, IS_HERE=1 }; class CrossElements : public Elements { public: - virtual int countHexa () { return nbr_hexas ; } - virtual int countQuad () { return nbr_quads ; } - virtual int countEdge () { return nbr_edges ; } - virtual int countVertex () { return nbr_vertex ; } - -public: - CrossElements (Document* doc, EnumGrid type=GR_BICYL); - - virtual ~CrossElements () {} + CrossElements (Document* doc, EnumGrid type); Hexa* getHexaIJK (int part, int nx, int ny, int nz); Quad* getQuadIJ (int part, int nx, int ny, int nz); @@ -55,12 +47,20 @@ public: Edge* getEdgeK (int part, int nx, int ny, int nz); Vertex* getVertexIJK (int part, int nx, int ny, int nz); +#ifndef SWIG +public : + virtual ~CrossElements () {} // Tutaux en T (like castles in scotland) int crossCylinders (Cylinder* cyl1, Cylinder* cyl2, bool fill=true); void dump (); void dumpVertex (); void dumpHexas (); + virtual int countHexa () { return nbr_hexas ; } + virtual int countQuad () { return nbr_quads ; } + virtual int countEdge () { return nbr_edges ; } + virtual int countVertex () { return nbr_vertex ; } + private : void resize (); @@ -134,6 +134,7 @@ private : bool at_right, at_left; int cyl_right, cyl_left; NewShape* grid_geom; +#endif // SWIG }; END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexDocument.cxx b/src/HEXABLOCK/HexDocument.cxx index 95e0432..5a1e00c 100755 --- a/src/HEXABLOCK/HexDocument.cxx +++ b/src/HEXABLOCK/HexDocument.cxx @@ -1,24 +1,24 @@ // C++ : La clase principale de Hexa -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-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 free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #include "HexDocument.hxx" @@ -30,11 +30,8 @@ #include "HexElements.hxx" #include "HexCrossElements.hxx" -#include "HexBiCylinder.hxx" #include "HexVector.hxx" -#include "HexCylinder.hxx" -#include "HexPipe.hxx" #include "HexMatrix.hxx" #include "HexCloner.hxx" #include "HexPropagation.hxx" @@ -47,6 +44,8 @@ #include "Hex.hxx" #include "HexNewShape.hxx" +void test_six (Hex::Document* docu, int option); + BEGIN_NAMESPACE_HEXA int Document::doc_number = 0; @@ -87,6 +86,9 @@ Document::Document (cpchar name, Hex* dad) defaultLaw = addLaw ("DefaultLaw", 0); DumpRestore; + maj_connection = false; + purge_elements = false; + holes_elements = false; addCloud (); } // ======================================================== Destructeur @@ -199,217 +201,105 @@ Hexa* Document::addHexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, DumpReturn (pave); return pave; } -// ======================================================== addCylinder -Cylinder* Document::addCylinder (Vertex* b, Vector* d, double r, double h) -{ - DumpStart ("addCylinder", b << d << r << h); - - Cylinder* cyl = new Cylinder (b, d, r, h); - doc_cylinder.push_back (cyl); - - DumpReturn (cyl); - return cyl; -} -// ======================================================== addPipe -Pipe* Document::addPipe (Vertex* b, Vector* d, double ri, double re, double h) -{ - DumpStart ("addPipe", b << d << ri << re << h); - - Pipe* tuyau = new Pipe (b, d, ri, re, h); - doc_pipe.push_back (tuyau); - - DumpReturn (tuyau); - return tuyau; -} -// ======================================================== makeCartesian -Elements* Document::makeCartesian (Vertex* v, Vector* dir, - int px, int py, int pz, int mx, int my, int mz) -{ - DumpStart ("makeCartesianDiag", v << dir << px << py << pz << mx << my << mz); - - Vector* v1 = new Vector (this, dir->getDx(), 0, 0); - Vector* v2 = new Vector (this, 0, dir->getDy(), 0); - Vector* v3 = new Vector (this, 0,0, dir->getDz()); - Elements* grille = new Elements (this); - grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz, mx, my, mz); - - DumpReturn (grille); - return grille; -} -// ======================================================== makeCartesian -Elements* Document::makeCartesian (Vertex* v, Vector* v1, Vector* v2, - Vector* v3, int px, int py, int pz) -{ - DumpStart ("makeCartesian", v << v1 << v2 << v3 << px << py << pz); - - Elements* grille = new Elements (this); - grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz); - - DumpReturn (grille); - return grille; -} -// ======================================================== makeCartesian1 -Elements* Document::makeCartesian1 (Vertex* v, Vector* v1, Vector* v2, - Vector* v3, int px, int py, int pz, int mx, int my, int mz) -{ - DumpStart ("makeCartesian1", v << v1 << v2 << v3 << px << py << pz - << mx << my << mz); - - Elements* grille = new Elements (this); - grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz, mx, my, mz); - - DumpReturn (grille); - return grille; -} -// ======================================================== makeSpherical -Elements* Document::makeSpherical (Vertex* c, double rayon, int nb, double k) -{ - DumpStart ("makeSpherical", c << rayon << nb << k ); - - Elements* grille = new Elements (this); - grille->makeSphericalGrid (c, rayon, nb, k); - - DumpReturn (grille); - return grille; -} -// ======================================================== makeCylindrical -Elements* Document::makeCylindrical (Vertex* c, Vector* b, Vector* h, - double dr, double da, double dl, int nr, int na, int nl, bool fill) -{ - DumpStart ("makeCylindrical", c << b << h << dr << da << dl << nr << na - << nl << fill); - - Elements* grille = new Elements (this); - grille->makeCylindricalGrid (c, b, h, dr, da, dl, nr, na, nl, fill); - - DumpReturn (grille); - return grille; -} -// ======================================================== makeSphere -Elements* Document::makeSphere (Vertex* center, Vector* vx, Vector* vz, - double radius, double radhole, Vertex* plorig, - int nrad, int nang, int nhaut) -{ - DumpStart ("makeSphere", center << vx << vz << radius << radhole << plorig - << nrad << nang << nhaut); - - Elements* grille = new Elements (this); - double radint = (radhole + radius)*DEMI; - grille->makeRind (GR_HEMISPHERIC, center, vx, vz, radius, radint, radhole, - plorig, 360.0, nrad, nang, nhaut); - - DumpReturn (grille); - return grille; -} -// ======================================================== makePartSphere -Elements* Document::makePartSphere (Vertex* center, Vector* vx, Vector* vz, - double radius, double radhole, - Vertex* plorig, double angle, - int nrad, int nang, int nhaut) -{ - DumpStart ("makePartSphere", center << vx << vz - << radius << radhole - << plorig << angle - << nrad << nang << nhaut); - - Elements* grille = new Elements (this); - double radint = (radhole + radius)*DEMI; - grille->makeRind (GR_PART_SPHERIC, center, vx, vz, radius, radint, radhole, - plorig, angle, nrad, nang, nhaut); - - DumpReturn (grille); - return grille; -} -// ======================================================== makeRind -Elements* Document::makeRind (Vertex* center, Vector* vx, Vector* vz, - double radext, double radint, double radhole, - Vertex* plorig, int nrad, int nang, int nhaut) -{ - DumpStart ("makeRind", center << vx << vz - << radext << radint << radhole - << plorig << nrad << nang << nhaut); - - Elements* grille = new Elements (this); - grille->makeRind (GR_RIND, center, vx, vz, radext, radint, radhole, - plorig, 360.0, nrad, nang, nhaut); - - DumpReturn (grille); - return grille; -} -// ======================================================== makePartRind -Elements* Document::makePartRind (Vertex* center, Vector* vx, Vector* vz, - double radext, double radint, double radhole, - Vertex* plorig, double angle, - int nrad, int nang, int nhaut) -{ - DumpStart ("makePartRind", center << vx << vz - << radext << radint << radhole - << plorig << angle << nrad << nang << nhaut); - - Elements* grille = new Elements (this); - grille->makeRind (GR_PART_RIND, center, vx, vz, radext, radint, radhole, - plorig, angle, nrad, nang, nhaut); - - DumpReturn (grille); - return grille; -} // ======================================================== findVertex Vertex* Document::findVertex (double vx, double vy, double vz) { + DumpStart ("findVertex", vx << vy << vz); + Vertex* found = NULL; + double xmin = vx - doc_tolerance; double xmax = vx + doc_tolerance; double ymin = vy - doc_tolerance; double ymax = vy + doc_tolerance; double zmin = vz - doc_tolerance; double zmax = vz + doc_tolerance; - - for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); elt!=NULL; + + for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); + elt!= NULL && found == NULL ; elt = elt->next()) { if (elt->isHere()) { - Vertex* node = static_cast (elt); - if (node->isin (xmin, xmax, ymin, ymax, zmin, zmax)) - return node; + Vertex* candidat = static_cast (elt); + if (candidat->isin (xmin, xmax, ymin, ymax, zmin, zmax)) + found = candidat; } } - return NULL; + + DumpReturn (found); + return found; } // ======================================================== findEdge Edge* Document::findEdge (Vertex* v1, Vertex* v2) { - for (EltBase* elt = doc_first_elt[EL_EDGE]->next (); elt!=NULL; + DumpStart ("findEdge", v1 << v2); + Edge* found = NULL; + + for (EltBase* elt = doc_first_elt[EL_EDGE]->next (); + elt!= NULL && found == NULL ; elt = elt->next()) { Edge* candidat = static_cast (elt); if (candidat->definedBy (v1, v2)) - return candidat; + found = candidat; } - return NULL; + + DumpReturn (found); + return found; } // ======================================================== findQuad Quad* Document::findQuad (Vertex* v1, Vertex* v2) { - for (EltBase* elt = doc_first_elt[EL_QUAD]->next (); elt!=NULL; + DumpStart ("findQuad", v1 << v2); + Quad* found = NULL; + + for (EltBase* elt = doc_first_elt[EL_QUAD]->next (); + elt!= NULL && found == NULL ; elt = elt->next()) { Quad* candidat = static_cast (elt); if (candidat->definedBy (v1, v2)) - return candidat; + found = candidat; } - return NULL; + + DumpReturn (found); + return found; +} +// ======================================================== findQuad +Quad* Document::findQuad (Edge* e1, Edge* e2) +{ + DumpStart ("findQuad", e1 << e2); + Quad* found = NULL; + + for (EltBase* elt = doc_first_elt[EL_QUAD]->next (); + elt!= NULL && found == NULL ; + elt = elt->next()) + { + Quad* candidat = static_cast (elt); + if (candidat->definedBy (e1, e2)) + found = candidat; + } + + DumpReturn (found); + return found; } // ======================================================== findHexa Hexa* Document::findHexa (Vertex* v1, Vertex* v2) { - for (EltBase* elt = doc_first_elt[EL_HEXA]->next (); elt!=NULL; + DumpStart ("findHexa", v1 << v2); + Hexa* found = NULL; + + for (EltBase* elt = doc_first_elt[EL_HEXA]->next (); + elt!= NULL && found == NULL ; elt = elt->next()) { Hexa* candidat = static_cast (elt); if (candidat->definedBy (v1, v2)) - return candidat; + found = candidat; } - return NULL; + + DumpReturn (found); + return found; } // ======================================================== findElement EltBase* Document::findElement (EnumElt type, int ident) @@ -755,19 +645,120 @@ int Document::mergeEdges (Edge* e1, Edge* e2, Vertex* v1, Vertex* v2) return HOK; } // ======================================================== mergeVertices -int Document::mergeVertices (Vertex* v1, Vertex* v2) +int Document::mergeVertices (Vertex* vpar, Vertex* vold) { - DumpStart ("mergeVertices", v1 << v2); + DumpStart ("mergeVertices", vpar << vold); + + int ier = HOK; + if (BadElement (vpar)) + { + Mess << "First vertex is not valid"; + ier = HERR; + } + else if (BadElement (vold)) + { + Mess << "Second vertex is not valid"; + ier = HERR; + } + else if (vpar==vold) + { + Mess << "Vertices are identical"; + ier = HERR; + } + else if (EltIsValid (findEdge (vpar, vold))) + { + Mess << "Theese vertices are connected by an edge"; + ier = HERR; + } - if (v1==v2 || v1==NULL || v1->isDeleted() - || v2==NULL || v2->isDeleted()) + if (ier != HOK) { DumpEnd; - return HERR; + return ier; } - replaceVertex (v2, v1); + map rep_quad; + map rep_edge; + map rep_vertex; + + map :: iterator itq; + map :: iterator ited; + map :: iterator itv; + + rep_vertex [vold] = vpar; + int nbparv = vold->getNbrParents (); + + for (int ned=0 ; nedgetParent (ned); + if (edold->isHere()) + { + Vertex* vopp = edold->opposedVertex (vold); + Edge* edpar = findEdge (vpar, vopp); + if (edpar != NULL) + rep_edge [edold] = edpar; + } + } + + Quad *qold=NULL, *qpar=NULL; + + for (ited=rep_edge.begin(); ited!=rep_edge.end() ; ++ited) + { + Edge* edold = ited->first; + Edge* edpar = ited->second; + int nbpared = edold->getNbrParents (); + for (int nq=0 ; nqgetParent (nq); + if (qold->isHere()) + { + for (int ned=0 ; nedgetEdge(ned); + Edge* edge = qold->getEdge (ned); + if (edge != edold) + { + qpar = findQuad (edpar, edge); + if (qpar != NULL) + rep_quad [qold] = qpar; + } + } + } + } + } + + cout << " +++ Intersection : veq = " << rep_vertex.size() + << " " << rep_edge.size() << " " << rep_quad.size() + << endl; + + for (itq=rep_quad.begin(); itq!=rep_quad.end() ; ++itq) + { + qold = itq->first; + qpar = itq->second; + Vertex *tv1[QUAD4], *tv2[QUAD4]; + Edge *te1[QUAD4], *te2[QUAD4]; + Edge* einter = qpar->inter (qold); + if (einter!=NULL) + { + Vertex* va = einter->getVertex (V_AMONT); + Vertex* vb = einter->getVertex (V_AVAL); + qpar->ordonner (va, vb, tv1, te1); + qold->ordonner (va, vb, tv2, te2); + for (int nro=0 ; nrofirst, ited->second); + + for (itv=rep_vertex.begin(); itv!=rep_vertex.end() ; ++itv) + replaceVertex (itv->first, itv->second); + maj_connection = false; DumpEnd; return HOK; @@ -775,12 +766,8 @@ int Document::mergeVertices (Vertex* v1, Vertex* v2) // ======================================================== replaceVertex void Document::replaceVertex (Vertex* old, Vertex* par) { - DumpStart ("replaceVertex", old << par); if (BadElement(old) || BadElement(par) || old==par) - { - DumpEnd; - return; - } + return ; // par->replaceAssociation (old); TODO @@ -792,17 +779,12 @@ void Document::replaceVertex (Vertex* old, Vertex* par) elt->replaceVertex (old, par); } old->suppress (); - DumpEnd; } // ======================================================== replaceEdge void Document::replaceEdge (Edge* old, Edge* par) { - DumpStart ("replaceEdge", old << par); if (BadElement(old) || BadElement(par) || old==par) - { - DumpEnd; return; - } // par->replaceAssociation (old); TODO @@ -815,17 +797,12 @@ void Document::replaceEdge (Edge* old, Edge* par) } old->suppress (); - DumpEnd; } // ======================================================== replaceQuad -void Document::replaceQuad (Quad* old, Quad* par) +int Document::replaceQuad (Quad* old, Quad* par) { - DumpStart ("replaceQuad", old << par); if (BadElement(old) || BadElement(par) || old==par) - { - DumpEnd; - return; - } + return HERR; // par->replaceAssociation (old); TODO @@ -837,95 +814,7 @@ void Document::replaceQuad (Quad* old, Quad* par) cell->replaceQuad (old, par); } old->suppress (); -} -// ======================================================== prismQuad -Elements* Document::prismQuad (Quad* qstart, Vector* dir, int nb) -{ - DumpStart ("prismQuad", qstart << dir << nb); - - Quads tstart; - tstart.push_back (qstart); - - update (); - Elements* prisme = prismQuads (tstart, dir, nb); - - DumpReturn (prisme); - return prisme; -} -// ======================================================== prismQuads -Elements* Document::prismQuads (Quads& tstart, Vector* dir, int nb) -{ - DumpStart ("prismQuads", tstart << dir << nb); - - Elements* prisme = new Elements (this); - - prisme->prismQuads (tstart, dir, nb); - - DumpReturn (prisme); - return prisme; -} -// ======================================================== prismQuadsVec -Elements* Document::prismQuadsVec (Quads& tstart, Vector* dir, RealVector& tlen, - int crit) -{ - DumpStart ("prismQuadVec", tstart << dir << tlen << crit); - Elements* prisme = new Elements (this); - if (tlen.size()<=0) return prisme; - - prisme->prismQuadsVec (tstart, dir, tlen, crit); - - DumpReturn (prisme); - return prisme; -} -// ======================================================== joinQuads -Elements* Document::joinQuads (Quads& tstart, Quad* dest, Vertex* v1, - Vertex* v2, Vertex* v3, Vertex* v4, int nb) -{ - DumpStart ("joinQuads", tstart << dest << v1 << v2 << v3 << v4 << nb); - update (); - Elements* joint = new Elements (this); - if (nb<=0) return joint; - - int ier = joint->joinQuads (tstart, nb, v1, v2, v3, v4, dest); - if (ier !=HOK) - printf ("\n ****\n **** Error in joinQuad(s)\n ****\n"); - - DumpReturn (joint); - return joint; -} -// ======================================================== joinQuad -Elements* Document::joinQuad (Quad* qstart, Quad* dest, Vertex* v1, - Vertex* v2, Vertex* v3, Vertex* v4, int nb) -{ - DumpStart ("joinQuad", qstart << dest << v1 << v2 << v3 << v4 << nb); - - Quads tstart; - tstart.push_back (qstart); - - Elements* joint = joinQuads (tstart, dest, v1, v2, v3, v4, nb); - - DumpReturn (joint); - return joint; -} -// ========================================================== getHexa -Hexa* Document::getHexa (int nro) -{ - return static_cast (getElement (EL_HEXA, nro)); -} -// ========================================================== getQuad -Quad* Document::getQuad (int nro) -{ - return static_cast (getElement (EL_QUAD, nro)); -} -// ========================================================== getEdge -Edge* Document::getEdge (int nro) -{ - return static_cast (getElement (EL_EDGE, nro)); -} -// ========================================================== getVertex -Vertex* Document::getVertex (int nro) -{ - return static_cast (getElement (EL_VERTEX, nro)); + return HOK; } // ========================================================== countElement int Document::countElement (EnumElt type) @@ -970,27 +859,38 @@ Law* Document::addLaw (Law* loi) nbr_laws ++; return loi; } -// ========================================================= GetLaw +// ========================================================= getLaw Law* Document::getLaw (int nro) { - if (nro <0 || nro>= nbr_laws) - return NULL; + DumpStart ("getLaw", nro); + Law* loi = NULL; - return doc_laws [nro]; + if (nro >= 0 && nro < nbr_laws) + loi = doc_laws [nro]; + + DumpReturn (loi); + return loi; } -// ========================================================= FindLaw +// ========================================================= findLaw Law* Document::findLaw (const char* name) { + DumpStart ("findLaw", name); + string nom = name; - for (int nro=0 ; nrogetName() == nom) - return doc_laws [nro]; + loi = doc_laws [nro]; - return NULL; + DumpReturn (loi); + return loi; } // ========================================================= removeLaw int Document::removeLaw (Law* loi) { + DumpStart ("removeLaw", loi); + for (int nro=1 ; nrosetLaw(defaultLaw); } - delete doc_laws [nro]; + // delete doc_laws [nro]; + doc_laws [nro]->suppress (); doc_laws.erase (doc_laws.begin()+nro); nbr_laws = doc_laws.size(); + + DumpReturn (HOK); return HOK; } + DumpReturn (HERR); return HERR; } // ========================================================= majPropagation @@ -1020,7 +924,9 @@ void Document::majPropagation () for (int nro=0 ; nrosuppress(); + ; } doc_propagation.clear (); @@ -1048,7 +954,7 @@ void Document::majPropagation () Edge* arete = cell->getEdge(ne); if (arete->getPropag()<0) { - Propagation* prop = new Propagation (); + Propagation* prop = new Propagation (this); doc_propagation.push_back (prop); arete->propager (prop, nbr_propagations); nbr_propagations ++; @@ -1057,6 +963,7 @@ void Document::majPropagation () } } } + maj_propagation = false; DumpRestore; } // ======================================================== countPropagation @@ -1070,190 +977,117 @@ int Document::countPropagation () // ======================================================== getPropagation Propagation* Document::getPropagation (int nro) { + DumpStart ("getPropagation", nro); + if (maj_propagation) majPropagation (); - if (nro < 0 || nro >= nbr_propagations) - return NULL; + Propagation* prop = NULL; + if (nro >= 0 && nro < nbr_propagations) + prop = doc_propagation [nro]; - return doc_propagation [nro]; + DumpReturn (prop); + return prop; } // ======================================================== findPropagation Propagation* Document::findPropagation (Edge* arete) { - if (arete==NULL) - return NULL; + DumpStart ("findPropagation", arete); - if (maj_propagation) - majPropagation (); + Propagation* prop = NULL; + if (arete!=NULL) + { + if (maj_propagation) + majPropagation (); + prop = getPropagation (arete->getPropag ()); + } - return getPropagation (arete->getPropag ()); + DumpReturn (prop); + return prop; } // ======================================================== disconnectQuad Elements* Document::disconnectQuad (Hexa* cell, Quad* element) { - if (cell==NULL || element==NULL) - return NULL; + DumpStart ("disconnectQuad", cell << element); - update (); - Elements* crees = cell->disconnectQuad (element); + Elements* grid = new Elements (this); + grid->checkDisco (cell, element); - if (crees!=NULL) - majReferences (); + if (grid->isValid()) + { + update (); + cell->disconnectQuad (element, grid); + majReferences (); + } - return crees; + DumpReturn (grid); + return grid; } // ======================================================== disconnectEdge Elements* Document::disconnectEdge (Hexa* cell, Edge* element) { - if (cell==NULL || element==NULL) - return NULL; + DumpStart ("disconnectEdge", cell << element); - update (); - Elements* crees = cell->disconnectEdge (element); + Elements* grid = new Elements (this); + grid->checkDisco (cell, element); + + if (grid->isValid()) + { + update (); + cell->disconnectEdge (element, grid); + majReferences (); + } - if (crees!=NULL) - majReferences (); - return crees; + DumpReturn (grid); + return grid; } // ======================================================== disconnectVertex Elements* Document::disconnectVertex (Hexa* cell, Vertex* element) { - if (cell==NULL || element==NULL) - return NULL; - - update (); - Elements* crees = cell->disconnectVertex (element); - - if (crees!=NULL) - majReferences (); - return crees; -} -// ======================================================== cut -Elements* Document::cut (Edge* edge, int nbcuts) -{ - Elements* t_hexas = new Elements (this); - - if (edge==NULL || nbcuts<=0) - return t_hexas; - - Propagation* prop = findPropagation (edge); - const Edges& t_edges = prop->getEdges (); - - t_hexas->cutHexas (t_edges, nbcuts); - - majPropagation (); - return t_hexas; -} -// ======================================================== addGroup -Group* Document::addGroup (cpchar name, EnumGroup kind) -{ - Group* grp = new Group (name, kind); - doc_group.push_back (grp); - return grp; -} -// ======================================================== findGroup -Group* Document::findGroup (cpchar name) -{ - int nbre = doc_group.size(); + DumpStart ("disconnectVertex", cell << element); - for (int ng=0 ; nggetName(), name)) - return doc_group [ng]; + Elements* grid = new Elements (this); + grid->checkDisco (cell, element); - return NULL; -} -// ======================================================== removeGroup -int Document::removeGroup (Group* grp) -{ - int nbre = doc_group.size(); - for (int ng=0 ; ngmakeCylinder (cyl, base, nr, na, nl); - - DumpReturn (grille); - return grille; -} -// ======================================================== makeCylinders -CrossElements* Document::makeCylinders (Cylinder* cyl1, Cylinder* cyl2) -{ - DumpStart ("makeCylinders", cyl1 << cyl2 ); - - CrossElements* grille = new CrossElements (this, GR_BICYL); - grille->crossCylinders (cyl1, cyl2, true); - - DumpReturn (grille); - return grille; -} - -// ======================================================== makePipe -Elements* Document::makePipe (Pipe* pipe, Vector* bx, int nr, int na, int nl) -{ - DumpStart ("makePipe", - pipe << bx << nr << na << nl); - - Elements* grille = new Elements (this); - grille->makePipe (pipe, bx, nr, na, nr); - - DumpReturn (grille); - return grille; -} -// ======================================================== makePipes -CrossElements* Document::makePipes (Pipe* pipe1, Pipe* pipe2) -{ - DumpStart ("makePipes", - pipe1 << pipe2); - - CrossElements* grille = new CrossElements (this, GR_BIPIPE); - grille->crossCylinders (pipe1, pipe2, false); + if (grid->isValid()) + { + update (); + cell->disconnectVertex (element, grid); + majReferences (); + } - DumpReturn (grille); - return grille; + DumpReturn (grid); + return grid; } // ======================================================== setName int Document::setName (cpchar prefix) { - if (Cestvide (prefix) || el_name==prefix) - return HERR; + DumpStart ("setName", prefix); - string name = prefix; - if (hex_parent != NULL) - hex_parent->makeName (prefix, name); + int ier = HOK; + if (Cestvide (prefix) || el_name==prefix) + ier = HERR; + else + { + string name = prefix; + if (hex_parent != NULL) + hex_parent->makeName (prefix, name); + el_name = name; + } - el_name = name; - return HOK ; + DumpReturn (ier); + return ier ; } // ======================================================== setLevel #ifdef NO_CASCADE -#define _TEST_BIC +#define _TEST_BICYL #endif -class BiCylinder; - -BiCylinder* test_bicylinder (Document* docu, int option); -void set_debug_asso (bool boule); - void Document::setLevel (int niv) { + DumpStart ("setLevel", niv); + if (niv == 747) checkAssociations (); else if (niv == 748) @@ -1268,41 +1102,16 @@ void Document::setLevel (int niv) set_special_option (true); else if (niv == 778) set_special_option (false); -#ifdef _TEST_BICYL - else if (niv >=90 && niv <=99) - test_bicylinder (this, niv-90); -#endif + + else if (niv >=100 && niv <=200) + test_six (this, niv); else { doc_db = niv; - set_debug_asso (niv>0); } + + DumpEnd; } -#if 0 -// ======================================================== getAssoVertices -void Document::getAssoVertices (Vertices& tabelt) -{ - tabelt.clear (); - for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); elt!=NULL; - elt = elt->next()) - if (elt->isHere() && elt->getAssociation()!=NULL) - tabelt.push_back (static_cast (elt)); -} -// ======================================================== getAssoEdges -void Document::getAssoEdges (Edges& tabelt) -{ - tabelt.clear (); - for (EltBase* elt = doc_first_elt[EL_EDGE]->next (); elt!=NULL; - elt = elt->next()) - if (elt->isHere()) - { - Edge* edge = static_cast (elt); - int nbass = edge->getAssociations().size(); - if (nbass>0) - tabelt.push_back (edge); - } -} -#endif // ======================================================== makeVarName char* Document::makeVarName (char* name) { @@ -1363,45 +1172,4 @@ Vector* Document::getVector (int nro) else return NULL; } -// ======================================================== getCylinder -Cylinder* Document::getCylinder (int nro) -{ - int size = doc_cylinder.size(); - if (nro>=0 && nro=0 && nrocrossCylinders (cyl1, cyl2); - - DumpReturn (grille); - return grille; -} -// ======================================================== makeBiPipe -BiCylinder* Document::makeBiPipe (Pipe* pipe1, Pipe* pipe2) -{ - DumpStart ("makeBiPipe", pipe1 << pipe2); - - BiCylinder* grille = new BiCylinder (this); - grille->crossCylinders (pipe1, pipe2); - - DumpReturn (grille); - return grille; -} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexDocument.hxx b/src/HEXABLOCK/HexDocument.hxx index 8950e5c..b48e525 100755 --- a/src/HEXABLOCK/HexDocument.hxx +++ b/src/HEXABLOCK/HexDocument.hxx @@ -25,6 +25,7 @@ #include "HexEltBase.hxx" + BEGIN_NAMESPACE_HEXA class NewShape; @@ -33,97 +34,51 @@ class Document : public EltBase { // Fonctions utilisateur public : - // Fonctions globales - bool isSaved () { return doc_saved ; } - int setName (const char* name); - - int save (const char* ficxml); // Genere le xml dans un seul fichier - int appendXml (pfile fstudy); // Genere le xml dans un fichier ouvert - cpchar getXml (); // Genere le xml et rend un flux - - int getLevel () { return doc_db ; } + Document (cpchar name, Hex* dad=NULL); + void dump (); + int setName (const char* name); void setLevel (int niv); + int save (const char* ficxml); // Genere le xml dans un seul fichier + int saveVtk (cpchar nomfic); - Hexa* getHexa (int nro); - Quad* getQuad (int nro); - Edge* getEdge (int nro); - Vertex* getVertex (int nro); + void purge (); - int countHexa () { return countElement (EL_HEXA); } - int countQuad () { return countElement (EL_QUAD); } - int countEdge () { return countElement (EL_EDGE); } - int countVertex () { return countElement (EL_VERTEX); } + void setTolerance (double tol) { doc_tolerance = std::max (tol, 0.0); } + double getTolerance () { return doc_tolerance; } // Creation d'elements Vertex* addVertex (double x=0.0, double y=0.0, double z=0.0); - Edge* addEdge (Vertex* va, Vertex* vb); - Edge* addEdgeVector (Vertex* va, Vector* vec); - Edge* addEdge (Vertex* va, Vector* vec) // A supprimer - { return addEdgeVector (va, vec) ; } // (comptibilite) + Edge* addEdge (Vertex* va, Vertex* vb); + Edge* addEdgeVector (Vertex* va, Vector* vec); - Quad* addQuadVertices (Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4); - Quad* addQuad (Edge* v1, Edge* v2, Edge* v3, Edge* v4); + Quad* addQuad (Edge* v1, Edge* v2, Edge* v3, Edge* v4); + Quad* addQuadVertices (Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4); - Hexa* addHexaVertices (Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4, + Hexa* addHexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf); + Hexa* addHexaVertices (Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4, Vertex* v5, Vertex* v6, Vertex* v7, Vertex* v8); - Hexa* addHexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf); - - Vector* addVector (double dx=0.0, double dy=0.0, double dz=0.0); - Vector* addVectorVertices (Vertex* va, Vertex* vb); - - Elements* makeCartesian (Vertex* v, Vector* v1, - int px, int py, int pz, int mx=0, int my=0, int mz=0); - Elements* makeCartesian (Vertex* v, Vector* v1, Vector* v2, Vector* v3, - int px, int py, int pz); - Elements* makeCartesian1 (Vertex* v, Vector* v1, Vector* v2, Vector* v3, - int px, int py, int pz, int mx, int my, int mz); - - Elements* makeCylindrical (Vertex* c, Vector* b, Vector* h, double dr, - double da, double dl, int nr, int na, int nl, bool fill=false); - - // Obsolete - Elements* makeSpherical (Vertex* v, Vector* dv, int nb, double k=1) {return NULL;} - Elements* makeSpherical (Vertex* center, double rayon, int nb, double k=1); - - Elements* prismQuad (Quad* start, Vector* dv, int nb); - Elements* prismQuads (Quads& start, Vector* dv, int nb); - Elements* prismQuadsVec (Quads& start, Vector* dv, RealVector& th, int k=0); - - Elements* joinQuad (Quad* start, Quad* dest, Vertex* v1, Vertex* v2, - Vertex* v3, Vertex* v4, int nb); - Elements* joinQuads (Quads& start, Quad* dest, Vertex* v1, Vertex* v2, - Vertex* v3, Vertex* v4, int nb); - - Cylinder* addCylinder (Vertex* b, Vector* d, double r, double h); - Elements* makeCylinder (Cylinder* cyl, Vector* vx, int nr, int na, int nl); - CrossElements* makeCylinders (Cylinder* cyl1, Cylinder* cyl2); - - Pipe* addPipe (Vertex* b, Vector* d, double ri, double re, double h); - Elements* makePipe (Pipe* pip, Vector* vx, int nr, int na, int nl); - CrossElements* makePipes (Pipe* pipe1, Pipe* pipe2); - BiCylinder* makeBiCylinder (Cylinder* cyl1, Cylinder* cyl2); - BiCylinder* makeBiPipe (Pipe* pipe1, Pipe* pipe2); - - int removeHexa (Hexa* maille); - int removeQuad (Quad* maille); - int removeConnectedHexa (Hexa* maille); - int removeElements (Elements* bloc); + Hexa* addHexa2Quads (Quad* q1, Quad* q2); + Hexa* addHexa3Quads (Quad* q1, Quad* q2, Quad* q3); + Hexa* addHexa4Quads (Quad* q1, Quad* q2, Quad* q3, Quad* q4); + Hexa* addHexa5Quads (Quad* q1, Quad* q2, Quad* q3, Quad* q4, Quad* q5); - Vertex* findVertex (double vx, double vy, double vz); - Edge* findEdge (Vertex* va, Vertex* vb); - Quad* findQuad (Vertex* va, Vertex* vb); - Hexa* findHexa (Vertex* va, Vertex* vb); + Vector* addVector (double dx=0.0, double dy=0.0, double dz=0.0); + Vector* addVectorVertices (Vertex* va, Vertex* vb); + Law* addLaw (const char* name, int nbnodes); + int addLaws (double lgmoy, bool usemax=true); - Vertex* findVertex (int id); + Group* addHexaGroup (cpchar name); + Group* addQuadGroup (cpchar name); + Group* addQuadNodeGroup (cpchar name); + Group* addHexaNodeGroup (cpchar name); + Group* addEdgeGroup (cpchar name); + Group* addEdgeNodeGroup (cpchar name); + Group* addVertexNodeGroup (cpchar name); - int mergeVertices (Vertex* v1, Vertex* v2); - int mergeEdges (Edge* e1, Edge* e2, Vertex* v1, Vertex* v2); - int mergeQuads (Quad* q1, Quad* q2, Vertex* v1, Vertex* v2, - Vertex* v3, Vertex* v4); - int closeQuads (Quad* q1, Quad* q2); + // ----------------- Transformations Elements* makeTranslation (Elements* elts, Vector* trans); Elements* makeScale (Elements* elts, Vertex* ver, double k); Elements* makeRotation (Elements* elts, Vertex* ver, Vector* vec, @@ -139,68 +94,220 @@ public : int performSymmetryLine (Elements* elts, Vertex* ver, Vector* vec); int performSymmetryPlane (Elements* elts, Vertex* ver, Vector* vec); - void setTolerance (double tol) { doc_tolerance = std::max (tol, 0.0); } - double getTolerance () { return doc_tolerance; } + // ----------------- Modifications + Elements* cut (Edge* edge, int nbcuts); + Elements* disconnectQuad (Hexa* maille, Quad* face); + Elements* disconnectEdge (Hexa* maille, Edge* arete); + Elements* disconnectVertex (Hexa* maille, Vertex* noeud); + Elements* disconnectEdges (Hexas thexas, Edges edges); - Elements* disconnectQuad (Hexa* maille, Quad* face); - Elements* disconnectEdge (Hexa* maille, Edge* arete); - Elements* disconnectVertex (Hexa* maille, Vertex* noeud); - Elements* disconnectEdges (Hexas& thexas, Edges& edges); + Elements* replace (Quads pattern, Vertex* p1, Vertex* c1, + Vertex* p2, Vertex* c2, Vertex* p3, Vertex* c3); - Elements* cut (Edge* edge, int nbcuts); + int mergeVertices (Vertex* v1, Vertex* v2); + int mergeEdges (Edge* e1, Edge* e2, Vertex* v1, Vertex* v2); + int mergeQuads (Quad* q1, Quad* q2, Vertex* v1, Vertex* v2, + Vertex* v3, Vertex* v4); - Group* addGroup (cpchar name, EnumGroup kind); - Group* getGroup (int nro); - Group* findGroup (cpchar name); - int removeGroup (Group* grp); - int countGroup () { return (int) doc_group.size(); } + // ----------------- Associations + void clearAssociation (); + int associateOpenedLine (Edges& mline, NewShapes& gline, IntVector& tabid, + double pstart, double pend); + + int associateClosedLine (Vertex* mfirst, Edges& mline, + NewShapes& gline, IntVector& tabid, + double pstart, bool inv); + // ----------------- count + int countHexa (); + int countQuad (); + int countEdge (); + int countVertex (); + int countVector () { return doc_vector.size(); } + + int countGroup () { return (int) doc_group.size(); } + int countLaw () { return nbr_laws ; } + int countPropagation (); + int countShape () { return doc_tab_shape.size() ; } - // --------------------------------------------------- + int countUsedHexa (); + int countUsedQuad (); + int countUsedEdge (); + int countUsedVertex (); - Law* addLaw (const char* name, int nbnodes); - Law* addLaw (Law* law); // lo-add-lololo - int countLaw () { return nbr_laws ; } - Law* getLaw (int nro); - Law* findLaw (const char* name); - int removeLaw (Law* loi); + int countCylinder () { return doc_cylinder.size(); } + int countPipe () { return doc_pipe.size(); } - // --------------------------------------------------- - int countPropagation (); + // ----------------- get par indice + Hexa* getHexa (int nro); + Quad* getQuad (int nro); + Edge* getEdge (int nro); + Vertex* getVertex (int nro); + + Hexa* getUsedHexa (int nro); + Quad* getUsedQuad (int nro); + Edge* getUsedEdge (int nro); + Vertex* getUsedVertex (int nro); + + Vector* getVector (int nro); + Cylinder* getCylinder (int nro); + Pipe* getPipe (int nro); + NewShape* getShape (int nro); + Group* getGroup (int nro); + Law* getLaw (int nro); Propagation* getPropagation (int nro); + + // ----------------- find + Vertex* findVertex (double vx, double vy, double vz); + Edge* findEdge (Vertex* va, Vertex* vb); + Quad* findQuad (Vertex* va, Vertex* vb); + Hexa* findHexa (Vertex* va, Vertex* vb); + + Group* findGroup (cpchar name); + Law* findLaw (cpchar name); Propagation* findPropagation (Edge* arete); - void dumpPropagation (); - int countVector () { return doc_vector.size(); } - int countCylinder () { return doc_cylinder.size(); } - int countPipe () { return doc_pipe.size(); } + // ----------------- Suppressions + int removeHexa (Hexa* maille); + int removeQuad (Quad* maille); + int removeConnectedHexa (Hexa* maille); + int removeElements (Elements* bloc); + int removeGroup (Group* grp); + int removeLaw (Law* lau); - Vector* getVector (int nro); - Cylinder* getCylinder (int nro); - Pipe* getPipe (int nro); +public : + // ----------------- Creations Hexav6 + Elements* makeCartesianTop (int nx, int ny, int nz); + Elements* makeCartesianUni (Vertex* ori, Vector* vx, Vector* vy, Vector* vz, + double lx, double ly, double lz, + int nx, int ny, int nz); + Elements* makeCartesian (Vertex* ori, Vector* vx, Vector* vy, Vector* vz, + RealVector tlx, RealVector tly, RealVector tlz); + + Elements* makeCylinderTop (int nr, int na, int nh); + Elements* makeCylinderUni (Vertex* orig, Vector* vx, Vector* vz, + double rint, double rext, double ang, double haut, + int nr, int na, int nh); + Elements* makeCylinder (Vertex* orig, Vector* vx, Vector* vz, + RealVector tray, RealVector tang, RealVector thaut); + + Elements* makePipeTop (int nr, int na, int nh); + Elements* makePipeUni (Vertex* orig, Vector* vx, Vector* vz, + double rint, double rext, double angle, double haut, + int nr, int na, int nh); + Elements* makePipe (Vertex* orig, Vector* vx, Vector* vz, + RealVector tray, RealVector tang, RealVector thaut); + + Elements* makeSphericalTop (int nbre, int crit=0); + Elements* makeSphericalUni (Vertex* centre, Vector* vx, Vector* vz, + double rayon, int nbre, int crit=0); + Elements* makeSpherical (Vertex* centre, Vector* vx, Vector* vz, + RealVector rayon, int crit=0); + Elements* makeSphereTop (int nr, int na, int nh); + Elements* makeSphereUni (Vertex* centre, Vector* vx, Vector* vz, + double rtrou, double rext, double ang, + Vertex* vplan, int nr, int na, int nh); + Elements* makeSphere (Vertex* centre, Vector* vx, Vector* vz, + RealVector tray, RealVector tang, RealVector thaut); + + Elements* makeRindTop (int nr, int na, int nh); + Elements* makeRindUni (Vertex* centre, Vector* vx, Vector* vz, + double raytrou, double rint, double rext, + double ang, Vertex* vplan, int nr, int na, int nh); + Elements* makeRind (Vertex* centre, Vector* vx, Vector* vz, + RealVector tray, RealVector tang, RealVector thaut); + + BiCylinder* makeCylinders (Vertex* ori1, Vector* z1, double r1, double h1, + Vertex* ori2, Vector* z2, double r2, double h2); + BiCylinder* makePipes (Vertex* ori1, Vector* z1, double rint1, double rex1, + double h1, Vertex* ori2, Vector* z2, double rint2, + double rex2, double h2); + + Elements* extrudeQuadTop (Quad* start, int nbre); + Elements* extrudeQuadUni (Quad* start, Vector* dv, double len, int nbre); + Elements* extrudeQuad (Quad* start, Vector* dv, RealVector tlen); + + Elements* extrudeQuadsTop (Quads start, int nbre); + Elements* extrudeQuadsUni (Quads start, Vector* axis, double len, int nbre); + Elements* extrudeQuads (Quads start, Vector* axis, RealVector tlen); + + Elements* revolutionQuadUni (Quad* start, Vertex* center, Vector* axis, + double angle, int nbre); + Elements* revolutionQuad (Quad* start, Vertex* center, Vector* axis, + RealVector angles); + Elements* revolutionQuadsUni (Quads start, Vertex* center, Vector* axis, + double angle, int nbre); + Elements* revolutionQuads (Quads start, Vertex* center, Vector* axis, + RealVector angles); + + Elements* joinQuadUni (Quad* start, Quad* dest, Vertex* v1, Vertex* v2, + Vertex* v3, Vertex* v4, int nb); + + Elements* joinQuadsUni (Quads start, Quad* dest, Vertex* v1, Vertex* v2, + Vertex* v3, Vertex* v4, int nb); + + Elements* joinQuad (Quad* start, Quad* dest, Vertex* va1, Vertex* vb1, + Vertex* va2, Vertex* vb2, RealVector& tlen); + + Elements* joinQuads (Quads start, Quad* dest, Vertex* va1, Vertex* vb1, + Vertex* va2, Vertex* vb2, RealVector& tlen); + + Elements* cutUni (Edge* eddge, int nbre); + Elements* cut (Edge* eddge, RealVector& tlen); + + Group* addGroup (cpchar name, EnumGroup kind); + // Fonctions globales + bool isSaved () { return doc_saved ; } - void purge (); + int appendXml (pfile fstudy); // Genere le xml dans un fichier ouvert + cpchar getXml (); // Genere le xml et rend un flux - // --------------------------------------------------- Evols Hexa3 + int getLevel () { return doc_db ; } - Document* copyDocument (); + Elements* makeCartesian (Vertex* v, Vector* v1, // Obsolete + int px, int py, int pz, int mx=0, int my=0, int mz=0); - int countUsedHexa (); - int countUsedQuad (); - int countUsedEdge (); - int countUsedVertex (); + Vertex* findVertex (int id); - Hexa* getUsedHexa (int nro); - Quad* getUsedQuad (int nro); - Edge* getUsedEdge (int nro); - Vertex* getUsedVertex (int nro); + int closeQuads (Quad* q1, Quad* q2); - Hexa* addHexa2Quads (Quad* q1, Quad* q2); - Hexa* addHexa3Quads (Quad* q1, Quad* q2, Quad* q3); - Hexa* addHexa4Quads (Quad* q1, Quad* q2, Quad* q3, Quad* q4); - Hexa* addHexa5Quads (Quad* q1, Quad* q2, Quad* q3, Quad* q4, Quad* q5); + // --------------------------------------------------- + + Law* addLaw (Law* law); // lo-add-lololo - Elements* revolutionQuads (Quads& start, Vertex* center, Vector* axis, - RealVector &angles); + // --------------------------------------------------- + + int checkAssociations (); + // addShape version Python + NewShape* addShape (long forme, const char* name); + +#ifndef SWIG + // addShape HorsPython + NewShape* addShape (TopoDS_Shape& forme, const char* name); + // ----------------- Perimes Hexav6 + Cylinder* addCylinder (Vertex* b, Vector* d, double r, double h); + Pipe* addPipe (Vertex* b, Vector* d, double ri, double re, double h); + Elements* makeCartesian (Vertex* v, Vector* v1, Vector* v2, Vector* v3, + int px, int py, int pz); + + Elements* makeCartesian1 (Vertex* v, Vector* v1, Vector* v2, Vector* v3, + int px, int py, int pz, int mx, int my, int mz); + + Elements* makeCylindrical (Vertex* c, Vector* b, Vector* h, double dr, + double da, double dl, int nr, int na, int nl, + bool fill); + Elements* makeCylindricals (Vertex* c, Vector* b, Vector* h, + RealVector tdr, RealVector tda, RealVector tdh, + bool fill=false); + + Elements* makeCylinder (Cylinder* cyl, Vector* vx, int nr, int na, int nl); + Elements* makePipe (Pipe* pip, Vector* vx, int nr, int na, int nl); + + Elements* makeSpherical (Vertex* center, double rayon, int nb, double k); + + CrossElements* makeCylinders (Cylinder* cyl1, Cylinder* cyl2); + CrossElements* makePipes (Pipe* pipe1, Pipe* pipe2); + BiCylinder* makeBiCylinder (Cylinder* cyl1, Cylinder* cyl2); + BiCylinder* makeBiPipe (Pipe* pipe1, Pipe* pipe2); Elements* makeSphere (Vertex* center, Vector* vx, Vector* vz, double radius, double radhole, @@ -222,36 +329,28 @@ public : Vertex* plorig, double angle, int nrad, int nang, int nhaut); - Elements* replace (Quads& pattern, Vertex* p1, Vertex* c1, - Vertex* p2, Vertex* c2, Vertex* p3, Vertex* c3); + Elements* prismQuad (Quad* start, Vector* dv, int nb); + Elements* prismQuads (Quads start, Vector* dv, int nb); + Elements* prismQuadsVec (Quads start, Vector* dv, RealVector th, int k); - Elements* makeCylindricals (Vertex* c, Vector* b, Vector* h, - RealVector& tdr, RealVector& tda, RealVector& tdh, - bool fill=false); + Elements* revolutionQuadsVec (Quads start, Vertex* center, Vector* axis, + RealVector angles); - // --------------------------------------------------- Evols Hexa4' + Elements* joinQuad (Quad* start, Quad* dest, Vertex* v1, Vertex* v2, + Vertex* v3, Vertex* v4, int nb); - void clearAssociation (); + Elements* joinQuads (Quads start, Quad* dest, Vertex* v1, Vertex* v2, + Vertex* v3, Vertex* v4, int nb); - typedef std::vector Vertices; - void getAssoEdges (Edges& tabelt); - void getAssoVertices (Vertices& tabelt); + // ----------------- Perimes (fin) +public : + void dumpPropagation (); - // --------------------------------------------------- Evols Hexa5 + Document* copyDocument (); NewShape* getCloud () { return doc_cloud ; } - NewShape* addShape (TopoDS_Shape& forme, const char* name); NewShape* addShape (const char* name, EnumShape type); - NewShape* getShape (int nro); NewShape* findShape (rcstring name); - int countShape () { return doc_tab_shape.size() ; } - - int associateOpenedLine (Edges& mline, NewShapes& gline, IntVector& tabid, - double pstart, double pend); - - int associateClosedLine (Vertex* mfirst, Edges& mline, - NewShapes& gline, IntVector& tabid, - double pstart, bool inv); int associateLine (Vertex* mfirst, Edges& mline, NewShapes& gline, IntVector& tabid, @@ -262,10 +361,9 @@ public : void clearAssoEdges (); void clearAssoQuads (); - int checkAssociations (); + Quad* findQuad (Edge* ea, Edge* eb); public: - Document (cpchar name, Hex* dad=NULL); ~Document (); int loadXml (cpchar name); @@ -277,14 +375,11 @@ public: int getNbrElt (EnumElt type) { return doc_nbr_elt [type]; } void setDeprecated (int level=1); - void dump (); void markAll (int marque, int type=-1); int saveVtk0 (cpchar nomfic); - int saveVtk (cpchar nomfic); int saveVtk (cpchar radical, int &nro); void putError (cpchar mess, cpchar info1=NULL, cpchar info2=NULL); - void nputError (cpchar mess, int info1, cpchar info2=NULL); void hputError (cpchar mess, EltBase* e1, EltBase* e2=NULL); void majReferences (); // M.A.J relation "utilise par" @@ -303,6 +398,13 @@ public: void restoreDump(); bool isEmpty (); + // --------------------------------------------------- Evols Hexa6 + + void addHexa (Hexa* elt) { doc_hexas .push_back (elt) ; } + void addQuad (Quad* elt) { doc_quads .push_back (elt) ; } + void addEdge (Edge* elt) { doc_edges .push_back (elt) ; } + void addVertex (Vertex* elt) { doc_vertex.push_back (elt) ; } + public: Globale* glob; @@ -312,12 +414,13 @@ private : void replaceVertex (Vertex* v1, Vertex* v2); void replaceEdge (Edge* e1, Edge* e2); - void replaceQuad (Quad* q1, Quad* q2); + int replaceQuad (Quad* q1, Quad* q2); int countElement (EnumElt type); EltBase* getElement (EnumElt type, int nro); void majPropagation (); + void recountUsed (); void renumeroter (); Elements* clonerElements (Elements* table, Matrix* matrice); @@ -352,6 +455,7 @@ private : bool doc_saved; bool maj_connection; bool purge_elements; + bool holes_elements; int doc_db; int nbr_errors; @@ -375,7 +479,7 @@ private : std::vector doc_pipe; XmlWriter* doc_xml; - // --------------------------------------------------- HexaBlock v3 + // --------------------------------------------------- Evols Hexa3 std::vector doc_used_hexas; std::vector doc_used_quads; @@ -387,7 +491,7 @@ private : int nbr_used_edges; int nbr_used_vertex; - // --------------------------------------------------- HexaBlock v5 + // --------------------------------------------------- Evols Hexa5 static int doc_number; char doc_ident [8]; @@ -395,35 +499,13 @@ private : NewShape* doc_cloud; // Nuage de points du doc; std::vector doc_tab_shape; -}; -// ========================================================= saveVtk (avec nro) -inline int Document::saveVtk (cpchar radical, int &nro) -{ - char num[8]; - sprintf (num, "%d", nro); - nro ++; - - string filename = radical; - filename += num; - filename += ".vtk"; - int ier = saveVtk (filename.c_str()); - return ier; -} -// ========================================================= setDeprecated -inline void Document::setDeprecated (int level) -{ - switch (level) - { - // En cas de destruction : parents invalides - case 2 : maj_connection = true; - purge_elements = true; - // creation + destruction : propagations a revoir - case 1 : maj_propagation = true; - // Par defaut : - default: doc_modified = true; - count_modified = true; - } -} + // --------------------------------------------------- Evols internes Hexa6 + std::vector doc_hexas; + std::vector doc_quads; + std::vector doc_edges; + std::vector doc_vertex; +#endif +}; END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexDocument_Xml.cxx b/src/HEXABLOCK/HexDocument_Xml.cxx index f2dfb43..ec7fbc6 100755 --- a/src/HEXABLOCK/HexDocument_Xml.cxx +++ b/src/HEXABLOCK/HexDocument_Xml.cxx @@ -47,6 +47,7 @@ #include "HexXmlWriter.hxx" #include "HexXmlTree.hxx" +#include "HexGlobale.hxx" BEGIN_NAMESPACE_HEXA @@ -67,8 +68,8 @@ int get_coords (const string& chaine, double& x, double& y) if (nv!=2) return HERR; return HOK; } -// ======================================================== parseName -int parseName (XmlTree* node, const string& nom, EltBase* elt) +// ======================================================== parse_name +int parse_name (XmlTree* node, const string& nom, EltBase* elt) { int lg = nom.size(); int nroid = 0; @@ -111,6 +112,12 @@ void get_names (const string& chaine, int size, vector& table) if (encours) table.push_back (mot); } +// ======================================================== count_children +int count_children (XmlTree* dad) +{ + int nbre = dad==NULL ? 0 : dad->getNbrChildren (); + return nbre; +} // ======================================================== loadXml int Document::loadXml (cpchar ficname) { @@ -188,7 +195,7 @@ int Document::parseXml (XmlTree& xml) parseShapes (xml); XmlTree* rubrique = xml.findChild ("ListVertices"); - int nbrelts = rubrique->getNbrChildren (); + int nbrelts = count_children (rubrique); Vertex* vertex = NULL; for (int nro=0 ; nro < nbrelts ; nro++) @@ -203,7 +210,7 @@ int Document::parseXml (XmlTree& xml) get_coords (coords, px, py, pz); vertex = addVertex (px, py, pz); - parseName (node, nom, vertex); + parse_name (node, nom, vertex); t_vertex [nom] = vertex; } else if (type=="Asso") @@ -213,7 +220,7 @@ int Document::parseXml (XmlTree& xml) } rubrique = xml.findChild ("ListEdges"); - nbrelts = rubrique->getNbrChildren (); + nbrelts = count_children (rubrique); Edge* edge = NULL; for (int nro=0 ; nro < nbrelts ; nro++) @@ -227,7 +234,7 @@ int Document::parseXml (XmlTree& xml) get_names (vertices, V_TWO, tname); edge = new Edge (t_vertex [tname[0]], t_vertex [tname[1]]); t_edge [nom] = edge; - parseName (node, nom, edge); + parse_name (node, nom, edge); } else if (type=="Asso") { @@ -236,7 +243,7 @@ int Document::parseXml (XmlTree& xml) } rubrique = xml.findChild ("ListQuads"); - nbrelts = rubrique->getNbrChildren (); + nbrelts = count_children (rubrique); Quad* quad = NULL; for (int nro=0 ; nro < nbrelts ; nro++) @@ -252,7 +259,7 @@ int Document::parseXml (XmlTree& xml) quad = new Quad (t_edge [tname[0]], t_edge [tname[1]], t_edge [tname[2]], t_edge [tname[3]]); t_quad [nom] = quad; - parseName (node, nom, quad); + parse_name (node, nom, quad); } else if (type=="Asso") { @@ -261,7 +268,7 @@ int Document::parseXml (XmlTree& xml) } rubrique = xml.findChild ("ListHexas"); - nbrelts = rubrique->getNbrChildren (); + nbrelts = count_children (rubrique); for (int nro=0 ; nro < nbrelts ; nro++) { @@ -274,11 +281,11 @@ int Document::parseXml (XmlTree& xml) t_quad [tname[2]], t_quad [tname[3]], t_quad [tname[4]], t_quad [tname[5]]); t_hexa [nom] = hexa; - parseName (node, nom, hexa); + parse_name (node, nom, hexa); } rubrique = xml.findChild ("ListVectors"); - nbrelts = rubrique == NULL ? 0 : rubrique->getNbrChildren (); + nbrelts = count_children (rubrique); for (int nro=0 ; nro < nbrelts ; nro++) { @@ -290,11 +297,11 @@ int Document::parseXml (XmlTree& xml) Vector* vector = addVector (px, py, pz); t_vector [nom] = vector; - parseName (node, nom, vector); + parse_name (node, nom, vector); } rubrique = xml.findChild ("ListDicretizationLaws"); - nbrelts = rubrique == NULL ? 0 : rubrique->getNbrChildren (); + nbrelts = count_children (rubrique); for (int nro=0 ; nro < nbrelts ; nro++) { @@ -315,7 +322,7 @@ int Document::parseXml (XmlTree& xml) } rubrique = xml.findChild ("ListPropagations"); - nbrelts = rubrique == NULL ? 0 : rubrique->getNbrChildren (); + nbrelts = count_children (rubrique); for (int nro=0 ; nro < nbrelts ; nro++) { @@ -337,7 +344,7 @@ int Document::parseXml (XmlTree& xml) rubrique = pipe ? xml.findChild ("ListPipes") : xml.findChild ("ListCylinders"); - nbrelts = rubrique == NULL ? 0 : rubrique->getNbrChildren (); + nbrelts = count_children (rubrique); for (int nro=0 ; nro < nbrelts ; nro++) { @@ -366,7 +373,7 @@ int Document::parseXml (XmlTree& xml) } rubrique = xml.findChild ("ListGroups"); - int nbrgroups = rubrique == NULL ? 0 : rubrique->getNbrChildren (); + int nbrgroups = count_children (rubrique); for (int nro=0 ; nro < nbrgroups ; nro++) { @@ -379,7 +386,7 @@ int Document::parseXml (XmlTree& xml) Group* groupe = addGroup (nom.c_str(), kind); EnumElt type = groupe->getTypeElt (); - nbrelts = ndgroup->getNbrChildren (); + nbrelts = count_children (ndgroup); for (int nelt=1 ; nelt < nbrelts ; nelt++) { node = ndgroup ->getChild (nelt); @@ -405,14 +412,16 @@ int Document::parseXml (XmlTree& xml) // ======================================================== save int Document::save (const char* ficxml) { + DumpStart ("save", ficxml); + if (doc_xml==NULL) doc_xml = new XmlWriter (); int ier = doc_xml->setFileName (ficxml); - if (ier != HOK) - return ier; + if (ier == HOK) + ier = genXml (); - ier = genXml (); + DumpReturn (ier); return ier; } // ======================================================== appendXml @@ -604,9 +613,10 @@ int Document::saveVtk0 (cpchar nomfic) } // ====================================================== saveVtk -// ==== Nouvelle formule +// ==== Nouvelle formule qui conserve les numeros de vertex int Document::saveVtk (cpchar nomfic) { + DumpStart ("saveVtk", nomfic); int nbnodes = doc_nbr_elt [EL_VERTEX]; int nbcells = countHexa (); @@ -630,26 +640,18 @@ int Document::saveVtk (cpchar nomfic) static const double minvtk = 1e-30; #define Koord(p) koord[p]-minvtk ? 0 : koord[p] - int last_nro = 0; for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); elt!=NULL; elt = elt->next()) { Vertex* node = static_cast (elt); if (node->isHere()) { - int nro = node->getId (); - for (int np = last_nro ; np < nro ; np++) - fprintf (vtk, "0 0 0\n"); - node->getPoint (koord); fprintf (vtk, "%g %g %g\n", Koord(dir_x), Koord(dir_y), Koord(dir_z)); - last_nro = nro+1; } + else + fprintf (vtk, "0 0 0\n"); } - - for (int np = last_nro ; np < nbnodes ; np++) - fprintf (vtk, "0 0 0\n"); - // -- 2) Les hexas fprintf (vtk, "CELLS %d %d\n", nbcells, nbcells*(HV_MAXI+1)); @@ -666,20 +668,24 @@ int Document::saveVtk (cpchar nomfic) for (int nro=0 ; nronext (); elt!=NULL; + for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); elt!=NULL; elt = elt->next()) { - Hexa* cell = static_cast (elt); - if (cell!=NULL && cell->isHere()) - cell->colorNodes (vtk); + Vertex* node = static_cast (elt); + if (node->isHere()) + { + double color = 100*(node->getScalar()+1); + fprintf (vtk, "%g\n", color); + } + else + fprintf (vtk, "100\n"); } -*********************************/ + fclose (vtk); + DumpReturn (HOK); return HOK; } // ====================================================== purge @@ -864,7 +870,7 @@ void Document::parseAssociation (XmlTree* node, Quad* quad) void Document::parseShapes (XmlTree& root) { XmlTree* rubrique = root.findChild ("ListShapes"); - int nbrelts = rubrique==NULL ? 0 : rubrique->getNbrChildren (); + int nbrelts = count_children (rubrique); for (int nro=0 ; nro < nbrelts ; nro++) { @@ -877,13 +883,13 @@ void Document::parseShapes (XmlTree& root) const string& brep = node->findValue ("brep"); NewShape* shape = new NewShape (this, (EnumShape)orig); - parseName (node, nom, shape); + parse_name (node, nom, shape); shape->setBrep (brep); doc_tab_shape.push_back (shape); } else if (type=="Cloud") { - int nbvert = node->getNbrChildren (); + int nbvert = count_children (node); for (int nv=0 ; nv < nbvert ; nv++) { Real3 point; diff --git a/src/HEXABLOCK/HexDocument_asso.cxx b/src/HEXABLOCK/HexDocument_asso.cxx index 6f64c78..e1ebe40 100755 --- a/src/HEXABLOCK/HexDocument_asso.cxx +++ b/src/HEXABLOCK/HexDocument_asso.cxx @@ -17,7 +17,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #include "HexDocument.hxx" #include "HexEdge.hxx" @@ -25,6 +26,9 @@ #include "HexDiagnostics.hxx" #include "HexNewShape.hxx" #include "HexEdgeShape.hxx" +#include "HexPropagation.hxx" + +#include BEGIN_NAMESPACE_HEXA @@ -103,7 +107,7 @@ void Document::clearAssoEdges () // ====================================================== clearAssoQuads void Document::clearAssoQuads () { - for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); elt!=NULL; + for (EltBase* elt = doc_first_elt[EL_QUAD]->next (); elt!=NULL; elt = elt->next()) { Quad* elem = static_cast (elt); @@ -154,6 +158,8 @@ NewShape* Document::findShape (rcstring nom) for (int nro=0 ; nrogetName()) return doc_tab_shape [nro]; + + return NULL; } // ====================================================== find_line EdgeShape* find_line (EdgeShapes& gline, double* point, int& sens) @@ -271,7 +277,6 @@ int Document::associateLine (Vertex* vfirst, Edges& mline, node->setAssociation (doc_cloud, vsid); double lgedge = lgtotale/nbedges; - double smin = 0; double smax = gstart->getLength()*(1-abstart); double emax = lgedge; double pdeb = pstart; @@ -327,18 +332,12 @@ int Document::associateLine (Vertex* vfirst, Edges& mline, { pdeb = 0; if (boucle) - { - smin = smax; smax = shape->getLength (); - } else { nsh ++; if (nshgetLength(); - } } } } @@ -509,13 +508,64 @@ int Document::sortEdges (Vertex* vfirst, Edges& mline, Edges& tab_edge, int Document::checkAssociations () { int nombre = countUsedEdge(); + int nberrors = 0; for (int ned=0 ; nedcheckAssociation (); - // if (ier != HOK) return ier; + if (ier != HOK) nberrors ++; } + cout << " ... Check edges assotiations : " << nberrors + << " error(s)." << endl; + + if (nberrors>0) return HERR; + else return HOK; +} +// ====================================================== addLaws +int Document::addLaws (double lgmoy, bool usemax) +{ + const double Epsilon = 1e-6; + const double Precision = 1e-2; + const double BigNumber = 1e+36; + + std::map existing_law; + std::map :: iterator iter; + + if (lgmoy<=Epsilon) + return HERR; + + int nbprop = countPropagation(); + for (int np=0 ; npgetEdges (); + double lgref = usemax ? 0 : BigNumber; + int nbedges = tab_edges.size(); + for (int ned=0 ; nedgetAssoLen (); + if (usemax) + lgref = std::max (lgref, lg); + else + lgref = std::min (lgref, lg); + } + lgref = lgref / lgmoy; + int nbcut = (int) lgref; + double delta = lgref - (double) nbcut; + if (NOT usemax || (delta < Precision)) + nbcut --; + + iter = existing_law.find (nbcut); + if (iter == existing_law.end()) + { + char name [2]; + sprintf (name, "u_%02d", nbcut); + existing_law [nbcut] = addLaw (name, nbcut); + } + prop->setLaw (existing_law [nbcut]); + } return HOK; } END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexDocument_del.cxx b/src/HEXABLOCK/HexDocument_del.cxx new file mode 100644 index 0000000..9e17c93 --- /dev/null +++ b/src/HEXABLOCK/HexDocument_del.cxx @@ -0,0 +1,378 @@ + +// C++ : Fonctions perimees de HexDocument + +// Copyright (C) 2009-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 + +#include "HexDocument.hxx" + +#include "HexEltBase.hxx" +#include "HexVertex.hxx" +#include "HexEdge.hxx" +#include "HexQuad.hxx" +#include "HexHexa.hxx" + +#include "HexElements.hxx" +#include "HexCrossElements.hxx" + +#include "HexVector.hxx" +#include "HexCylinder.hxx" +#include "HexPipe.hxx" +#include "HexMatrix.hxx" +#include "HexCloner.hxx" +#include "HexPropagation.hxx" +#include "HexLaw.hxx" + +#include "HexXmlWriter.hxx" +#include "HexXmlTree.hxx" +#include "HexGlobale.hxx" +#include "HexGroup.hxx" +#include "Hex.hxx" +#include "HexNewShape.hxx" + +BEGIN_NAMESPACE_HEXA + + +// ======================================================== makeCartesian +Elements* Document::makeCartesian (Vertex* v, Vector* dir, + int px, int py, int pz, int mx, int my, int mz) +{ + DumpStart ("makeCartesianDiag", v << dir << px << py << pz << mx << my << mz); + + Vector* v1 = new Vector (this, dir->getDx(), 0, 0); + Vector* v2 = new Vector (this, 0, dir->getDy(), 0); + Vector* v3 = new Vector (this, 0,0, dir->getDz()); + Elements* grille = new Elements (this); + grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz, mx, my, mz); + + DumpReturn (grille); + return grille; +} +// ======================================================== makeCartesian +Elements* Document::makeCartesian (Vertex* v, Vector* v1, Vector* v2, + Vector* v3, int px, int py, int pz) +{ + DumpStart ("makeCartesian", v << v1 << v2 << v3 << px << py << pz); + + Elements* grille = new Elements (this); + grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz); + + DumpReturn (grille); + return grille; +} +// ======================================================== makeCartesian1 +Elements* Document::makeCartesian1 (Vertex* v, Vector* v1, Vector* v2, + Vector* v3, int px, int py, int pz, int mx, int my, int mz) +{ + DumpStart ("makeCartesian1", v << v1 << v2 << v3 << px << py << pz + << mx << my << mz); + + Elements* grille = new Elements (this); + grille->makeCartesianGrid (v, v1, v2, v3, px, py, pz, mx, my, mz); + + DumpReturn (grille); + return grille; +} +// ======================================================== makeSpherical +Elements* Document::makeSpherical (Vertex* c, double rayon, int nb, double k) +{ + DumpStart ("makeSpherical", c << rayon << nb << k ); + + Elements* grille = new Elements (this); + grille->makeSphericalGrid (c, rayon, nb, k); + + DumpReturn (grille); + return grille; +} +// ======================================================== makeCylindrical +Elements* Document::makeCylindrical (Vertex* c, Vector* b, Vector* h, + double dr, double da, double dl, int nr, int na, int nl, bool fill) +{ + DumpStart ("makeCylindrical", c << b << h << dr << da << dl << nr << na + << nl << fill); + + Elements* grille = new Elements (this); + grille->makeCylindricalGrid (c, b, h, dr, da, dl, nr, na, nl, fill); + + DumpReturn (grille); + return grille; +} +// ======================================================== makeSphere +Elements* Document::makeSphere (Vertex* center, Vector* vx, Vector* vz, + double radius, double radhole, Vertex* plorig, + int nrad, int nang, int nhaut) +{ + DumpStart ("makeSphere", center << vx << vz << radius << radhole << plorig + << nrad << nang << nhaut); + + Elements* grille = new Elements (this); + double radint = (radhole + radius)*DEMI; + grille->makeRind (GR_HEMISPHERIC, center, vx, vz, radius, radint, radhole, + plorig, 360.0, nrad, nang, nhaut); + + DumpReturn (grille); + return grille; +} +// ======================================================== makePartSphere +Elements* Document::makePartSphere (Vertex* center, Vector* vx, Vector* vz, + double radius, double radhole, + Vertex* plorig, double angle, + int nrad, int nang, int nhaut) +{ + DumpStart ("makePartSphere", center << vx << vz + << radius << radhole + << plorig << angle + << nrad << nang << nhaut); + + Elements* grille = new Elements (this); + double radint = (radhole + radius)*DEMI; + grille->makeRind (GR_PART_SPHERIC, center, vx, vz, radius, radint, radhole, + plorig, angle, nrad, nang, nhaut); + + DumpReturn (grille); + return grille; +} +// ======================================================== makeRind +Elements* Document::makeRind (Vertex* center, Vector* vx, Vector* vz, + double radext, double radint, double radhole, + Vertex* plorig, int nrad, int nang, int nhaut) +{ + DumpStart ("makeRind", center << vx << vz + << radext << radint << radhole + << plorig << nrad << nang << nhaut); + + Elements* grille = new Elements (this); + grille->makeRind (GR_RIND, center, vx, vz, radext, radint, radhole, + plorig, 360.0, nrad, nang, nhaut); + + DumpReturn (grille); + return grille; +} +// ======================================================== makePartRind +Elements* Document::makePartRind (Vertex* center, Vector* vx, Vector* vz, + double radext, double radint, double radhole, + Vertex* plorig, double angle, + int nrad, int nang, int nhaut) +{ + DumpStart ("makePartRind", center << vx << vz + << radext << radint << radhole + << plorig << angle << nrad << nang << nhaut); + + Elements* grille = new Elements (this); + grille->makeRind (GR_PART_RIND, center, vx, vz, radext, radint, radhole, + plorig, angle, nrad, nang, nhaut); + + DumpReturn (grille); + return grille; +} +// ======================================================== prismQuad +Elements* Document::prismQuad (Quad* qstart, Vector* dir, int nb) +{ + DumpStart ("prismQuad", qstart << dir << nb); + + Quads tstart; + tstart.push_back (qstart); + + update (); + Elements* prisme = prismQuads (tstart, dir, nb); + + DumpReturn (prisme); + return prisme; +} +// ======================================================== prismQuads +Elements* Document::prismQuads (Quads tstart, Vector* dir, int nb) +{ + DumpStart ("prismQuads", tstart << dir << nb); + + Elements* prisme = new Elements (this); + + prisme->prismQuads (tstart, dir, nb); + + DumpReturn (prisme); + return prisme; +} +// ======================================================== prismQuadsVec +Elements* Document::prismQuadsVec (Quads tstart, Vector* dir, RealVector tlen, + int crit) +{ + DumpStart ("prismQuadVec", tstart << dir << tlen << crit); + Elements* prisme = new Elements (this); + if (tlen.size()<=0) return prisme; + + prisme->prismQuadsVec (tstart, dir, tlen, crit); + + DumpReturn (prisme); + return prisme; +} +// ======================================================== joinQuads +Elements* Document::joinQuads (Quads tstart, Quad* dest, Vertex* v1, + Vertex* v2, Vertex* v3, Vertex* v4, int nb) +{ + DumpStart ("joinQuads", tstart << dest << v1 << v2 << v3 << v4 << nb); + update (); + Elements* joint = new Elements (this); + if (nb<=0) return joint; + + int ier = joint->joinQuads (tstart, nb, v1, v2, v3, v4, dest); + if (ier !=HOK) + printf ("\n ****\n **** Error in joinQuad(s)\n ****\n"); + + DumpReturn (joint); + return joint; +} +// ======================================================== joinQuad +Elements* Document::joinQuad (Quad* qstart, Quad* dest, Vertex* v1, + Vertex* v2, Vertex* v3, Vertex* v4, int nb) +{ + DumpStart ("joinQuad", qstart << dest << v1 << v2 << v3 << v4 << nb); + + Quads tstart; + tstart.push_back (qstart); + + Elements* joint = joinQuads (tstart, dest, v1, v2, v3, v4, nb); + + DumpReturn (joint); + return joint; +} +// ======================================================== cut +Elements* Document::cut (Edge* edge, int nbcuts) +{ + Elements* t_hexas = new Elements (this); + + if (edge==NULL || nbcuts<=0) + return t_hexas; + + Propagation* prop = findPropagation (edge); + const Edges& t_edges = prop->getEdges (); + + t_hexas->cutHexas (t_edges, nbcuts); + + majPropagation (); + return t_hexas; +} +// ======================================================== makeCylinder +Elements* Document::makeCylinder (Cylinder* cyl, Vector* base, int nr, int na, + int nl) +{ + DumpStart ("makeCylinder", cyl << base << nr << na << nl); + + Elements* grille = new Elements (this); + grille->makeCylinder (cyl, base, nr, na, nl); + + DumpReturn (grille); + return grille; +} +// ======================================================== makeCylinders +CrossElements* Document::makeCylinders (Cylinder* cyl1, Cylinder* cyl2) +{ + DumpStart ("makeCylinders", cyl1 << cyl2 ); + + CrossElements* grille = new CrossElements (this, GR_BICYL); + grille->crossCylinders (cyl1, cyl2, true); + + DumpReturn (grille); + return grille; +} + +// ======================================================== makePipe +Elements* Document::makePipe (Pipe* pipe, Vector* bx, int nr, int na, int nl) +{ + DumpStart ("makePipe", + pipe << bx << nr << na << nl); + + Elements* grille = new Elements (this); + grille->makePipe (pipe, bx, nr, na, nr); + + DumpReturn (grille); + return grille; +} +// ======================================================== makePipes +CrossElements* Document::makePipes (Pipe* pipe1, Pipe* pipe2) +{ + DumpStart ("makePipes", + pipe1 << pipe2); + + CrossElements* grille = new CrossElements (this, GR_BIPIPE); + grille->crossCylinders (pipe1, pipe2, false); + + DumpReturn (grille); + return grille; +} +// ======================================================== getCylinder +Cylinder* Document::getCylinder (int nro) +{ + int size = doc_cylinder.size(); + if (nro>=0 && nro=0 && nrorevolutionQuads (start, orig, axis, angles); + return prisme; +} +// ======================================================== makeCylindricals +Elements* Document::makeCylindricals (Vertex* c, Vector* b, Vector* h, + RealVector tdr, RealVector tda, RealVector tdl, bool fill) +{ + Elements* grille = new Elements (this); + grille->makeCylindricalGrid (c, b, h, tdr, tda, tdl, fill); + return grille; +} +END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexDocument_quads.cxx b/src/HEXABLOCK/HexDocument_quads.cxx index ddb3ecb..7470fbc 100755 --- a/src/HEXABLOCK/HexDocument_quads.cxx +++ b/src/HEXABLOCK/HexDocument_quads.cxx @@ -35,6 +35,7 @@ #include "HexAnaQuads.hxx" #include "HexElements.hxx" #include "HexCramer.hxx" +#include "HexGlobale.hxx" BEGIN_NAMESPACE_HEXA @@ -80,153 +81,11 @@ Document* Document::copyDocument () return clone; } -// ---------------------------------------------------------------------------- -// ======================================================== countUsedHexa -int Document::countUsedHexa () -{ - if (count_modified) - renumeroter (); - - return nbr_used_hexas; -} -// ======================================================== countUsedQuad -int Document::countUsedQuad () -{ - if (count_modified) - renumeroter (); - - return nbr_used_quads; -} -// ======================================================== countUsedEdge -int Document::countUsedEdge () -{ - if (count_modified) - renumeroter (); - - return nbr_used_edges; -} -// ======================================================== countUsedVertex -int Document::countUsedVertex () -{ - if (count_modified) - renumeroter (); - - return nbr_used_vertex; -} - -// ======================================================== getUsedHexa -Hexa* Document::getUsedHexa (int nro) -{ - if (count_modified) - renumeroter (); - - if (nro<0 || nro >= nbr_used_hexas) - return NULL; - - return doc_used_hexas [nro]; -} -// ======================================================== getUsedQuad -Quad* Document::getUsedQuad (int nro) -{ - if (count_modified) - renumeroter (); - - if (nro<0 || nro >= nbr_used_quads) - return NULL; - - return doc_used_quads [nro]; -} -// ======================================================== getUsedEdge -Edge* Document::getUsedEdge (int nro) -{ - if (count_modified) - renumeroter (); - - if (nro<0 || nro >= nbr_used_edges) - return NULL; - - return doc_used_edges [nro]; -} -// ======================================================== getUsedVertex -Vertex* Document::getUsedVertex (int nro) -{ - if (count_modified) - renumeroter (); - - if (nro<0 || nro >= nbr_used_vertex) - return NULL; - - return doc_used_vertex [nro]; -} -// ======================================================== renumeroter -void Document::renumeroter () -{ - count_modified = false; - // -- 1) Raz numerotation precedente - markAll (NO_COUNTED); - - doc_used_hexas .clear (); - doc_used_quads .clear (); - doc_used_edges .clear (); - doc_used_vertex.clear (); - - for (EltBase* elt = doc_first_elt[EL_HEXA]->next (); elt!=NULL; - elt = elt->next()) - { - if (elt!=NULL && elt->isHere()) - { - Hexa* cell = static_cast (elt); - doc_used_hexas.push_back (cell); - for (int nb=0 ; nbgetQuad (nb)->setMark (IS_USED); - - for (int nb=0 ; nbgetEdge (nb)->setMark (IS_USED); - - for (int nb=0 ; nbgetVertex (nb)->setMark (IS_USED); - } - } - - for (EltBase* elt = doc_first_elt[EL_QUAD]->next (); elt!=NULL; - elt = elt->next()) - { - if (elt!=NULL && elt->isHere() && elt->getMark()==IS_USED) - { - Quad* cell = static_cast (elt); - doc_used_quads.push_back (cell); - } - } - - for (EltBase* elt = doc_first_elt[EL_EDGE]->next (); elt!=NULL; - elt = elt->next()) - { - if (elt!=NULL && elt->isHere() && elt->getMark()==IS_USED) - { - Edge* cell = static_cast (elt); - doc_used_edges.push_back (cell); - } - } - - for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); elt!=NULL; - elt = elt->next()) - { - if (elt!=NULL && elt->isHere() && elt->getMark()==IS_USED) - { - Vertex* cell = static_cast (elt); - doc_used_vertex.push_back (cell); - } - } - - nbr_used_hexas = doc_used_hexas .size (); - nbr_used_quads = doc_used_quads .size (); - nbr_used_edges = doc_used_edges .size (); - nbr_used_vertex = doc_used_vertex .size (); -} // --------------------------------------------------------------- // ============================================================== addHexa2quads Hexa* Document::addHexa2Quads (Quad* q1, Quad* q2) { + DumpStart ("addHexa2Quads", q1 << q2); AnaQuads ana_quads (q1, q2); Hexa* hexa = NULL; @@ -239,11 +98,13 @@ Hexa* Document::addHexa2Quads (Quad* q1, Quad* q2) else if (ana_quads.nbr_aretes == 1) hexa = addHexaQuadsAC (ana_quads); + DumpReturn (hexa); return hexa; } // ============================================================= addHexa3quads Hexa* Document::addHexa3Quads (Quad* q1, Quad* q2, Quad* q3) { + DumpStart ("addHexa3Quads", q1 << q2 << q3); AnaQuads ana_quads (q1, q2, q3); Hexa* hexa = NULL; @@ -256,11 +117,13 @@ Hexa* Document::addHexa3Quads (Quad* q1, Quad* q2, Quad* q3) else if (ana_quads.nbr_aretes == 3) hexa = addHexaQuadsACE (ana_quads); + DumpReturn (hexa); return hexa; } // ============================================================= addHexa4quads Hexa* Document::addHexa4Quads (Quad* q1, Quad* q2, Quad* q3, Quad* q4) { + DumpStart ("addHexa4Quads", q1 << q2 << q3 << q4); AnaQuads ana_quads (q1, q2, q3, q4); Hexa* hexa = NULL; @@ -273,11 +136,13 @@ Hexa* Document::addHexa4Quads (Quad* q1, Quad* q2, Quad* q3, Quad* q4) else if (ana_quads.nbr_aretes == 5) hexa = addHexaQuadsACDE (ana_quads); + DumpReturn (hexa); return hexa; } // ============================================================== addHexa5quads Hexa* Document::addHexa5Quads (Quad* q1, Quad* q2, Quad* q3, Quad* q4, Quad* q5) { + DumpStart ("addHexa5Quads", q1 << q2 << q3 << q4 << q5); AnaQuads ana_quads (q1, q2, q3, q4, q5); if (ana_quads.status != HOK) return NULL; @@ -307,6 +172,8 @@ Hexa* Document::addHexa5Quads (Quad* q1, Quad* q2, Quad* q3, Quad* q4, Quad* q5) Quad* q_a = ana_quads.tab_quads[qbase]; Quad* q_b = new Quad (tedge[0], tedge[1], tedge[2], tedge[3]); Hexa* hexa = new Hexa (q_a, q_b, tquad[0], tquad[2], tquad[1], tquad[3]); + + DumpReturn (hexa); return hexa; } // --------------------------------------------------------------- @@ -724,39 +591,22 @@ Hexa* Document::addHexaQuadsACDE (AnaQuads& strquads) Hexa* hexa = new Hexa (q_a, q_b, q_c, q_d, q_e, q_f); return hexa; } -// ======================================================== revolutionQuads -Elements* Document::revolutionQuads (Quads& start, Vertex* center, Vector* axis, - RealVector &angles) -{ - if (center==NULL) return NULL; - if (axis ==NULL) return NULL; - if (angles.size()==0) return NULL; - if (start .size()==0) return NULL; - - Elements* prisme = new Elements (this); - prisme->revolutionQuads (start, center, axis, angles); - return prisme; -} -// ======================================================== makeCylindricals -Elements* Document::makeCylindricals (Vertex* c, Vector* b, Vector* h, - RealVector& tdr, RealVector& tda, RealVector& tdl, bool fill) -{ - Elements* grille = new Elements (this); - grille->makeCylindricalGrid (c, b, h, tdr, tda, tdl, fill); - return grille; -} // ========================================================= replace -Elements* Document::replace (Quads& pattern, Vertex* p1, Vertex* c1, +Elements* Document::replace (Quads pattern, Vertex* p1, Vertex* c1, Vertex* p2, Vertex* c2, Vertex* p3, Vertex* c3) { + DumpStart ("replace", pattern << p1 << c1 << p2 << c2 << p3 << c3); + Elements* t_hexas = new Elements (this); int ier = t_hexas->replaceHexas (pattern, p1, c1, p2, c2, p3, c3); if (ier!=HOK) { - cout << " **** Error in Document::replace\n" << endl; + Mess << " **** Error in Document::replace" ; t_hexas->setError (ier); } - return t_hexas; + + DumpReturn (t_hexas); + return t_hexas; } // ========================================================= print_replace void print_replace (Edge* zig, Edge* zag) @@ -808,14 +658,20 @@ void replace_vertex (Hexas& thexas, Vertex* node, Vertex* par) thexas[nh]->replaceVertex (node, par); } // ========================================================= disconnectEdges -Elements* Document::disconnectEdges (Hexas& thexas, Edges& tedges) +Elements* Document::disconnectEdges (Hexas thexas, Edges tedges) { - int nbedges = tedges.size(); - int nbhexas = thexas.size(); - + DumpStart ("disconnectEdges", thexas << tedges); + if (db) cout << " +++ Disconnect Edges" << endl; + Elements* grid = new Elements (this); + + grid->checkDisco (thexas, tedges); + + int nbedges = tedges.size(); + int nbhexas = thexas.size(); + if (nbhexas != nbedges) { cout << " **** Error in Document::disconnectEdges\n" << endl; @@ -825,8 +681,9 @@ Elements* Document::disconnectEdges (Hexas& thexas, Edges& tedges) } else if (nbhexas==1) { - Elements* grille = disconnectEdge (thexas[0], tedges[0]); - return grille; + update (); + thexas[0]->disconnectEdge (tedges[0], grid); + return grid; } for (int nro=0 ; nroaddVertex (node1); + grid->addVertex (node1); new_vertex [tvertex[nro]] = node1; if (db) { @@ -924,7 +780,7 @@ Elements* Document::disconnectEdges (Hexas& thexas, Edges& tedges) if (nro>0) { Edge* edge = new Edge (node0, node1); - nouveaux->addEdge (edge); + grid->addEdge (edge); new_edge [tedges[nro-1]] = edge; state_edge [tedges[nro-1]] = REPLACED; if (db) @@ -977,7 +833,7 @@ Elements* Document::disconnectEdges (Hexas& thexas, Edges& tedges) { Edge* arete = new Edge (v1, v2); new_edge [edge] = arete; - nouveaux->addEdge (arete); + grid->addEdge (arete); if (db) print_replace (edge, arete); } @@ -1015,7 +871,7 @@ Elements* Document::disconnectEdges (Hexas& thexas, Edges& tedges) { Quad* face = new Quad (ted[0], ted[1], ted[2], ted[3]); new_quad [quad] = face; - nouveaux->addQuad (face); + grid->addQuad (face); } state_quad [quad] = etat; } @@ -1073,12 +929,13 @@ Elements* Document::disconnectEdges (Hexas& thexas, Edges& tedges) center1[nc] = (center0[nc] + center1[nc])/2; } - Vertex* node = nouveaux->getVertex (nro); + Vertex* node = grid->getVertex (nro); matrix.defScale (center1, 0.55); matrix.perform (node); } - return nouveaux; + DumpReturn (grid); + return grid; } // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . diff --git a/src/HEXABLOCK/HexDocument_skin.cxx b/src/HEXABLOCK/HexDocument_skin.cxx index 93ef373..f58d68b 100755 --- a/src/HEXABLOCK/HexDocument_skin.cxx +++ b/src/HEXABLOCK/HexDocument_skin.cxx @@ -1,25 +1,6 @@ // C++ : Reordonnancement des faces -// Copyright (C) 2009-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 -// - #include "HexDocument.hxx" #include "HexVertex.hxx" @@ -67,6 +48,13 @@ void Document::reorderQuads () makeSkin (quad); } } + + for (elt = doc_first_elt[EL_QUAD]->next (); elt!=NULL; elt = elt->next()) + if (elt!=NULL && elt->isHere()) + { + Quad* quad = static_cast (elt); + quad->reorienter (); + } } // ========================================================= makeSkin void makeSkin (Quad* orig) diff --git a/src/HEXABLOCK/HexDocument_tools.cxx b/src/HEXABLOCK/HexDocument_tools.cxx new file mode 100644 index 0000000..3b2e25e --- /dev/null +++ b/src/HEXABLOCK/HexDocument_tools.cxx @@ -0,0 +1,466 @@ + +// C++ : Classe Document : Methodes internes 2011 + +// Copyright (C) 2009-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 + +#include "HexDocument.hxx" +#include "HexVertex.hxx" +#include "HexEdge.hxx" +#include "HexQuad.hxx" +#include "HexHexa.hxx" +#include "HexGlobale.hxx" +#include "HexGroup.hxx" + +BEGIN_NAMESPACE_HEXA + +// ======================================================== countHexa +int Document::countHexa () +{ + DumpStart0 ("countHexa"); + if (holes_elements) + renumeroter (); + + int nombre = doc_hexas.size(); + DumpReturn (nombre); + return nombre; +} +// ======================================================== countQuad +int Document::countQuad () +{ + DumpStart0 ("countQuad"); + if (holes_elements) + renumeroter (); + + int nombre = doc_quads.size(); + DumpReturn (nombre); + return nombre; +} +// ======================================================== countEdge +int Document::countEdge () +{ + DumpStart0 ("countEdge"); + if (holes_elements) + renumeroter (); + + int nombre = doc_edges.size(); + DumpReturn (nombre); + return nombre; +} +// ======================================================== countVertex +int Document::countVertex () +{ + DumpStart0 ("countVertex"); + if (holes_elements) + renumeroter (); + + int nombre = doc_vertex.size(); + DumpReturn (nombre); + return nombre; +} + +// ======================================================== getHexa +Hexa* Document::getHexa (int nro) +{ + if (holes_elements) + renumeroter (); + + if (nro<0 || nro >= (int) doc_hexas.size()) + return NULL; + + return doc_hexas [nro]; +} +// ======================================================== getQuad +Quad* Document::getQuad (int nro) +{ + if (holes_elements) + renumeroter (); + + if (nro<0 || nro >= (int) doc_quads.size()) + return NULL; + + return doc_quads [nro]; +} +// ======================================================== getEdge +Edge* Document::getEdge (int nro) +{ + if (holes_elements) + renumeroter (); + + if (nro<0 || nro >= (int) doc_edges.size()) + return NULL; + + return doc_edges [nro]; +} +// ======================================================== getVertex +Vertex* Document::getVertex (int nro) +{ + if (holes_elements) + renumeroter (); + + if (nro<0 || nro >= (int) doc_vertex.size()) + return NULL; + + return doc_vertex [nro]; +} +// ======================================================== renumeroter +void Document::renumeroter () +{ + int nbelts = doc_vertex.size(); + int decal = 0; + for (int nro=0 ; nroisDeleted()) + decal ++; + else if (decal != 0) + doc_vertex [nro-decal] = elt; + } + + if (decal != 0) + doc_vertex.resize (nbelts-decal); + // ----------------- Edges + nbelts = doc_edges.size(); + decal = 0; + for (int nro=0 ; nroisDeleted()) + decal ++; + else if (decal != 0) + doc_edges [nro-decal] = elt; + } + + if (decal != 0) + doc_edges.resize (nbelts-decal); + // ----------------- Quads + nbelts = doc_quads.size(); + decal = 0; + for (int nro=0 ; nroisDeleted()) + decal ++; + else if (decal != 0) + doc_quads [nro-decal] = elt; + } + + if (decal != 0) + doc_quads.resize (nbelts-decal); + // ----------------- Hexas + nbelts = doc_hexas.size(); + decal = 0; + for (int nro=0 ; nroisDeleted()) + decal ++; + else if (decal != 0) + doc_hexas [nro-decal] = elt; + } + + if (decal != 0) + doc_hexas.resize (nbelts-decal); +} +// ---------------------------------------------------------------------------- +// ======================================================== countUsedHexa +int Document::countUsedHexa () +{ + if (count_modified) + recountUsed (); + + return nbr_used_hexas; +} +// ======================================================== countUsedQuad +int Document::countUsedQuad () +{ + if (count_modified) + recountUsed (); + + return nbr_used_quads; +} +// ======================================================== countUsedEdge +int Document::countUsedEdge () +{ + if (count_modified) + recountUsed (); + + return nbr_used_edges; +} +// ======================================================== countUsedVertex +int Document::countUsedVertex () +{ + if (count_modified) + recountUsed (); + + return nbr_used_vertex; +} + +// ======================================================== getUsedHexa +Hexa* Document::getUsedHexa (int nro) +{ + if (count_modified) + recountUsed (); + + if (nro<0 || nro >= nbr_used_hexas) + return NULL; + + return doc_used_hexas [nro]; +} +// ======================================================== getUsedQuad +Quad* Document::getUsedQuad (int nro) +{ + if (count_modified) + recountUsed (); + + if (nro<0 || nro >= nbr_used_quads) + return NULL; + + return doc_used_quads [nro]; +} +// ======================================================== getUsedEdge +Edge* Document::getUsedEdge (int nro) +{ + if (count_modified) + recountUsed (); + + if (nro<0 || nro >= nbr_used_edges) + return NULL; + + return doc_used_edges [nro]; +} +// ======================================================== getUsedVertex +Vertex* Document::getUsedVertex (int nro) +{ + if (count_modified) + recountUsed (); + + if (nro<0 || nro >= nbr_used_vertex) + return NULL; + + return doc_used_vertex [nro]; +} +// ======================================================== recountUsed +void Document::recountUsed () +{ + count_modified = false; + // -- 1) Raz numerotation precedente + markAll (NO_COUNTED); + + doc_used_hexas .clear (); + doc_used_quads .clear (); + doc_used_edges .clear (); + doc_used_vertex.clear (); + + for (EltBase* elt = doc_first_elt[EL_HEXA]->next (); elt!=NULL; + elt = elt->next()) + { + if (elt!=NULL && elt->isHere()) + { + Hexa* cell = static_cast (elt); + doc_used_hexas.push_back (cell); + for (int nb=0 ; nbgetQuad (nb)->setMark (IS_USED); + + for (int nb=0 ; nbgetEdge (nb)->setMark (IS_USED); + + for (int nb=0 ; nbgetVertex (nb)->setMark (IS_USED); + } + } + + for (EltBase* elt = doc_first_elt[EL_QUAD]->next (); elt!=NULL; + elt = elt->next()) + { + if (elt!=NULL && elt->isHere() && elt->getMark()==IS_USED) + { + Quad* cell = static_cast (elt); + doc_used_quads.push_back (cell); + } + } + + for (EltBase* elt = doc_first_elt[EL_EDGE]->next (); elt!=NULL; + elt = elt->next()) + { + if (elt!=NULL && elt->isHere() && elt->getMark()==IS_USED) + { + Edge* cell = static_cast (elt); + doc_used_edges.push_back (cell); + } + } + + for (EltBase* elt = doc_first_elt[EL_VERTEX]->next (); elt!=NULL; + elt = elt->next()) + { + if (elt!=NULL && elt->isHere() && elt->getMark()==IS_USED) + { + Vertex* cell = static_cast (elt); + doc_used_vertex.push_back (cell); + } + } + + nbr_used_hexas = doc_used_hexas .size (); + nbr_used_quads = doc_used_quads .size (); + nbr_used_edges = doc_used_edges .size (); + nbr_used_vertex = doc_used_vertex .size (); +} +// ========================================================= saveVtk (avec nro) +int Document::saveVtk (cpchar radical, int &nro) +{ + char num[8]; + sprintf (num, "%d", nro); + nro ++; + + string filename = radical; + filename += num; + filename += ".vtk"; + int ier = saveVtk (filename.c_str()); + return ier; +} +// ========================================================= setDeprecated +void Document::setDeprecated (int level) +{ + switch (level) + { + // En cas de destruction : parents invalides + case 2 : maj_connection = true; + purge_elements = true; + holes_elements = true; + // creation + destruction : propagations a revoir + case 1 : maj_propagation = true; + // Par defaut : + default: doc_modified = true; + count_modified = true; + } +} + +// ========================================================= addHexaGroup +Group* Document::addHexaGroup (cpchar name) +{ + DumpStart ("addHexaGroup", name); + Group* groupe = addGroup (name, HexaCell); + + DumpReturn (groupe); + return groupe; +} +// ========================================================= addHexaNodeGroup +Group* Document::addHexaNodeGroup (cpchar name) +{ + DumpStart ("addHexaNodeGroup", name); + Group* groupe = addGroup (name, HexaNode); + + DumpReturn (groupe); + return groupe; +} +// ========================================================= addQuadGroup +Group* Document::addQuadGroup (cpchar name) +{ + DumpStart ("addQuadGroup", name); + Group* groupe = addGroup (name, QuadCell); + + DumpReturn (groupe); + return groupe; +} +// ========================================================= addQuadNodeGroup +Group* Document::addQuadNodeGroup (cpchar name) +{ + DumpStart ("addQuadNodeGroup", name); + Group* groupe = addGroup (name, QuadNode); + + DumpReturn (groupe); + return groupe; +} +// ========================================================= addEdgeGroup +Group* Document::addEdgeGroup (cpchar name) +{ + DumpStart ("addEdgeGroup", name); + Group* groupe = addGroup (name, EdgeCell); + + DumpReturn (groupe); + return groupe; +} +// ========================================================= addEdgeNodeGroup +Group* Document::addEdgeNodeGroup (cpchar name) +{ + DumpStart ("addEdgeNodeGroup", name); + Group* groupe = addGroup (name, EdgeNode); + + DumpReturn (groupe); + return groupe; +} +// ========================================================= addVertexNodeGroup +Group* Document::addVertexNodeGroup (cpchar name) +{ + DumpStart ("addVertexNodeGroup", name); + Group* groupe = addGroup (name, VertexNode); + + DumpReturn (groupe); + return groupe; +} +// ======================================================== addGroup +Group* Document::addGroup (cpchar name, EnumGroup kind) +{ + Group* grp = new Group (this, name, kind); + doc_group.push_back (grp); + return grp; +} +// ======================================================== findGroup +Group* Document::findGroup (cpchar name) +{ + DumpStart ("findGroup", name); + + int nbre = doc_group.size(); + Group* groupe = NULL; + + for (int ng=0 ; groupe==NULL && nggetName(), name)) + groupe = doc_group [ng]; + + DumpReturn (groupe); + return groupe; +} +// ======================================================== removeGroup +int Document::removeGroup (Group* grp) +{ + DumpStart ("removeGroup", grp ); + + int nbre = doc_group.size(); + bool more = true; + int ier = HERR; + + for (int ng=0 ; more && ngsuppress (); + + DumpReturn (ier); + return ier; +} +// ---------------------------------------------------------------------------- +END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexDocument_trans.cxx b/src/HEXABLOCK/HexDocument_trans.cxx index a4e9a4e..1d51955 100755 --- a/src/HEXABLOCK/HexDocument_trans.cxx +++ b/src/HEXABLOCK/HexDocument_trans.cxx @@ -46,56 +46,80 @@ BEGIN_NAMESPACE_HEXA // ========================================================= performTranslation int Document::performTranslation (Elements* elts, Vector* trans) { + DumpStart ("performTranslation", elts << trans); + Matrix matrice; matrice.defTranslation (trans); int ier = elts->transform (&matrice); + + DumpReturn (ier); return ier; } // ==================================================== performScale int Document::performScale (Elements* elts, Vertex* ver, double k) { + DumpStart ("performScale", elts << ver << k); + Matrix matrice; matrice.defScale (ver, k); int ier = elts->transform (&matrice); + + DumpReturn (ier); return ier; } // ==================================================== performRotation int Document::performRotation (Elements* elts, Vertex* ver, Vector* vec, double angle) { + DumpStart ("performRotation", elts << ver << vec << angle); + Matrix matrice; matrice.defRotation (ver, vec, angle); int ier = elts->transform (&matrice); + + DumpReturn (ier); return ier; } // ==================================================== performSymmetryPoint int Document::performSymmetryPoint (Elements* elts, Vertex* ver) { + DumpStart ("performSymmetryPoint", elts << ver); + Matrix matrice; matrice.defSymmetryPoint (ver); int ier = elts->transform (&matrice); + + DumpReturn (ier); return ier; } // ==================================================== performSymmetryPlane int Document::performSymmetryPlane (Elements* elts, Vertex* ver, Vector* vec) { + DumpStart ("performSymmetryPlane", elts << ver << vec); + Matrix matrice; matrice.defSymmetryPlane (ver, vec); int ier = elts->transform (&matrice); + + DumpReturn (ier); return ier; } // ==================================================== performSymmetryLine int Document::performSymmetryLine (Elements* elts, Vertex* ver, Vector* vec) { + DumpStart ("performSymmetryLine", elts << ver << vec); + Matrix matrice; matrice.defSymmetryLine (ver, vec); int ier = elts->transform (&matrice); + + DumpReturn (ier); return ier; } // -------------------------------------------------------- @@ -114,56 +138,80 @@ Elements* Document::clonerElements (Elements* table, Matrix* matrice) // ========================================================= makeTranslation Elements* Document::makeTranslation (Elements* table, Vector* trans) { + DumpStart ("makeTranslation", table << trans); + Matrix matrice; matrice.defTranslation (trans); Elements* grille = clonerElements (table, &matrice); - return grille; + + DumpReturn (grille); + return grille; } // ========================================================= makeScale Elements* Document::makeScale (Elements* table, Vertex* ver, double k) { + DumpStart ("makeScale", table << ver << k); + Matrix matrice; matrice.defScale (ver, k); Elements* grille = clonerElements (table, &matrice); + + DumpReturn (grille); return grille; } // ========================================================= makeRotation Elements* Document::makeRotation (Elements* table, Vertex* ver, Vector* vec, - double angle) + double angle) { + DumpStart ("makeRotation", table << ver << vec << angle); + Matrix matrice; matrice.defRotation (ver, vec, angle); Elements* grille = clonerElements (table, &matrice); + + DumpReturn (grille); return grille; } // ========================================================= makeSymmetryPoint Elements* Document::makeSymmetryPoint (Elements* table, Vertex* ver) { + DumpStart ("makeSymmetryPoint", table << ver); + Matrix matrice; matrice.defSymmetryPoint (ver); Elements* grille = clonerElements (table, &matrice); + + DumpReturn (grille); return grille; } // ========================================================= makeSymmetryLine Elements* Document::makeSymmetryLine (Elements* table, Vertex* ver, Vector* vec) { + DumpStart ("makeSymmetryLine", table << ver << vec); + Matrix matrice; matrice.defSymmetryLine (ver, vec); Elements* grille = clonerElements (table, &matrice); + + DumpReturn (grille); return grille; } // ========================================================= makeSymmetryPlane Elements* Document::makeSymmetryPlane (Elements* table, Vertex* ver, Vector* vec) { + DumpStart ("makeSymmetryPlane", table << ver << vec); + Matrix matrice; matrice.defSymmetryPlane (ver, vec); Elements* grille = clonerElements (table, &matrice); + + DumpReturn (grille); return grille; } // ---------------------------------------------------------------------- @@ -172,39 +220,63 @@ Elements* Document::makeSymmetryPlane (Elements* table, Vertex* ver, Vector* vec // ========================================================= removeHexa int Document::removeHexa (Hexa* cell) { + DumpStart ("removeHexa", cell); + + int ier = HOK; if (cell==NULL) - return HERR; + ier = HERR; + else + cell->remove (); - cell->remove (); - return HOK; + DumpReturn (ier); + return ier; } // ========================================================= removeQuad int Document::removeQuad (Quad* cell) { + DumpStart ("removeQuad", cell); + + int ier = HOK; if (cell==NULL) - return HERR; + ier = HERR; + else + cell->remove (); - cell->remove (); - return HOK; + DumpReturn (ier); + return ier; } // ========================================================= removeElements int Document::removeElements (Elements* bloc) { + DumpStart ("removeElements", bloc); + + int ier = HOK; + if (bloc==NULL) - return HERR; + ier = HERR; + else + bloc->remove (); - bloc->remove (); - return HOK; + DumpReturn (ier); + return ier; } // ====================================================== removeConnectedHexa int Document::removeConnectedHexa (Hexa* cell) { + DumpStart ("removeConnectedHexa", cell); + + int ier = HOK; + if (cell==NULL) - return HERR; + ier = HERR; + else + { + update (); + cell->removeConnected (); + } - update (); - cell->removeConnected (); - return HOK; + DumpReturn (ier); + return ier; } // ========================================================= dumpPropagation void Document::dumpPropagation () diff --git a/src/HEXABLOCK/HexDocument_v6.cxx b/src/HEXABLOCK/HexDocument_v6.cxx new file mode 100644 index 0000000..163b770 --- /dev/null +++ b/src/HEXABLOCK/HexDocument_v6.cxx @@ -0,0 +1,1140 @@ + +// C++ : Fonctions de creation HexaBlock v6 + +// Copyright (C) 2009-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 + +#include "HexDocument.hxx" + +#include "HexElements.hxx" +#include "HexBiCylinder.hxx" +#include "HexVector.hxx" +#include "HexQuad.hxx" + +#include "HexGlobale.hxx" + +BEGIN_NAMESPACE_HEXA + + +// ======================================================== makeCartesianTop +Elements* Document::makeCartesianTop (int nx, int ny, int nz) +{ + DumpStart ("makeCartesianTop", nx << ny << nz ); + Elements* grid = new Elements (this); + + RealVector tx, ty, tz; + Real3 rx = { 1, 0, 0 }; + Real3 ry = { 0, 1, 0 }; + Real3 rz = { 0, 0, 1 }; + + grid->checkSize (1, nx, ny, nz, false); + if (grid->isValid()) + { + Vertex* orig = addVertex (0, 0, 0); + for (int nro=1 ; nro<=nx; ++nro) tx.push_back (nro); + for (int nro=1 ; nro<=ny; ++nro) ty.push_back (nro); + for (int nro=1 ; nro<=nz; ++nro) tz.push_back (nro); + grid->makeCartesian (orig, rx, ry, rz, tx, ty, tz); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeCartesianUni +Elements* Document::makeCartesianUni (Vertex* orig, + Vector* vx, Vector* vy, Vector* vz, + double dx, double dy, double dz, + int nx, int ny, int nz) +{ + DumpStart ("makeCartesianUni", orig << vx << vy << vz + << dx << dy << dz + << nx << ny << nz); + + Elements* grid = new Elements (this); + + Real3 rx, ry, rz; + grid->checkOrig (1, orig); + grid->checkSize (8, nx, ny, nz, false); + grid->checkSystem (2, vx, vy, vz, rx, ry, rz); + + if (grid->isValid()) + { + RealVector tx, ty, tz; + for (int nro=1 ; nro<=nx; ++nro) tx.push_back (nro*dx); + for (int nro=1 ; nro<=ny; ++nro) ty.push_back (nro*dy); + for (int nro=1 ; nro<=nz; ++nro) tz.push_back (nro*dz); + + grid->makeCartesian (orig, rx, ry, rz, tx, ty, tz); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeCartesian +Elements* Document::makeCartesian (Vertex* orig, + Vector* vx, Vector* vy, Vector* vz, + RealVector tx, RealVector ty, RealVector tz) +{ + DumpStart ("makeCartesian", orig << vx << vy << vz << tx << ty << tz); + + Elements* grid = new Elements (this); + + Real3 rx, ry, rz; + grid->checkOrig (1, orig); + grid->checkSystem (2, vx, vy, vz, rx, ry, rz); + grid->checkVector (5, tx); + grid->checkVector (6, ty); + grid->checkVector (7, tz); + + if (grid->isValid()) + grid->makeCartesian (orig, rx, ry, rz, tx, ty, tz); + + DumpReturn (grid); + return grid; +} +// ======================================================== makeCylinderTop +Elements* Document::makeCylinderTop (int nr, int na, int nh) +{ + DumpStart ("makeCylinderTop", nr << na << nh); + + Elements* grid = new Elements (this); + + RealVector tray, tang, thaut; + Real3 rx = { 1, 0, 0 }; + Real3 rz = { 0, 0, 1 }; + + grid->checkSize (1, nr, na, nh, true); + if (grid->isValid()) + { + double da = 360.0 / na; + for (int nro=0 ; nro<=nr; ++nro) tray .push_back (nro+1); + for (int nro=0 ; nro<=na; ++nro) tang .push_back (nro*da); + for (int nro=0 ; nro<=nh; ++nro) thaut.push_back (nro); + grid->makeCylinder (NULL, rx, rz, tray, tang, thaut, true); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeCylinderUni +Elements* Document::makeCylinderUni (Vertex* orig, Vector* vx, Vector* vz, + double rint, double rext, double ang, double haut, + int nr, int na, int nh) +{ + DumpStart ("makeCylinderUni", orig << vx << vz << rint << rext + << ang << haut << nr << na << nh); + + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, orig); + grid->checkSize (8, nr, na, nh, true); + grid->checkPipe (4, rint, rext, ang, haut); + grid->checkSystem (2, vx, vz, rx, rz); + + if (grid->isValid()) + { + double dray = (rext-rint) / nr; + double dang = ang / na; + double dhaut = haut / nh; + RealVector tang, tray, thaut; + + for (int nro=0 ; nro<=nr; ++nro) tray .push_back (rint + nro*dray); + for (int nro=0 ; nro<=na; ++nro) tang .push_back (nro*dang); + for (int nro=0 ; nro<=nh; ++nro) thaut.push_back (nro*dhaut); + + grid->makeCylinder (orig, rx, rz, tray, tang, thaut, true); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeCylinder +Elements* Document::makeCylinder (Vertex* orig, Vector* vx, Vector* vz, + RealVector tray, RealVector tang, RealVector thaut) +{ + DumpStart ("makeCylinder", orig << vx << vz << tray << tang << thaut); + + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, orig); + grid->checkSystem (2, vx, vz, rx, rz); + grid->checkVector (4, tray); + grid->checkVector (5, tang, 3); + grid->checkVector (6, thaut); + + if (grid->isValid()) + grid->makeCylinder (orig, rx, rz, tray, tang, thaut, true); + + DumpReturn (grid); + return grid; +} +// ======================================================== makePipeTop +Elements* Document::makePipeTop (int nr, int na, int nh) +{ + DumpStart ("makePipeTop", nr << na << nh); + + Elements* grid = new Elements (this); + + RealVector tray, tang, thaut; + Real3 rx = { 1, 0, 0 }; + Real3 rz = { 0, 0, 1 }; + + grid->checkSize (1,nr, na, nh, true); + if (grid->isValid()) + { + double da = 360.0 / na; + for (int nro=0 ; nro<=nr; ++nro) tray .push_back (nro+1); + for (int nro=0 ; nro<=na; ++nro) tang .push_back (nro*da); + for (int nro=0 ; nro<=nh; ++nro) thaut.push_back (nro); + grid->makeCylinder (NULL, rx, rz, tray, tang, thaut, false); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makePipeUni +Elements* Document::makePipeUni (Vertex* orig, Vector* vx, Vector* vz, + double rint, double rext, double angle, double hauteur, + int nr, int na, int nh) +{ + DumpStart ("makePipeUni", orig << vx << vz << rint << rext + << angle << hauteur << nr << na << nh); + + Elements* grid = new Elements (this); + + Real3 rx, rz; + RealVector tray, tang, thaut; + grid->checkOrig (1, orig); + grid->checkSize (8, nr, na, nh, true); + grid->checkPipe (4, rint, rext, angle, hauteur); + grid->checkSystem (1, vx, vz, rx, rz); + + if (grid->isValid()) + { + double dray = (rext-rint) / nr; + double dang = angle / na; + double dhaut = hauteur / nh; + for (int nro=0 ; nro<=nr; ++nro) tray .push_back (rint + nro*dray); + for (int nro=0 ; nro<=na; ++nro) tang .push_back (nro * dang); + for (int nro=0 ; nro<=nh; ++nro) thaut.push_back (nro * dhaut); + + grid->makeCylinder (orig, rx, rz, tray, tang, thaut, false); + } + DumpReturn (grid); + return grid; +} +// ======================================================== makePipe +Elements* Document::makePipe (Vertex* orig, Vector* vx, Vector* vz, + RealVector tray, RealVector tang, RealVector thaut) +{ + DumpStart ("makePipe", orig << vx << vz << tray << tang << thaut); + + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, orig); + grid->checkSystem (2, vx, vz, rx, rz); + grid->checkVector (4, tray, 2); + grid->checkVector (5, tang, 3); + grid->checkVector (6, thaut, 2); + + if (grid->isValid()) + grid->makeCylinder (orig, rx, rz, tray, tang, thaut, false); + + DumpReturn (grid); + return grid; +} +// ======================================================== makeSphericalTop +Elements* Document::makeSphericalTop (int nbre, int crit) +{ + DumpStart ("makeSphericalTop", nbre << crit); + Elements* grid = new Elements (this); + + Real3 orig = { 0, 0, 0 }; + Real3 rx = { 1, 0, 0 }; + Real3 rz = { 0, 0, 1 }; + + if (nbre<2) + { + grid->setError (HERR); + Mess << "Argument number 1 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + if (grid->isValid()) + { + RealVector trayon; + for (int nro=1 ; nro<=nbre; ++nro) trayon.push_back (nro); + grid->makeSpherical (orig, rx, rz, trayon, crit); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeSphericalUni +Elements* Document::makeSphericalUni (Vertex* center, Vector* vx, Vector* vz, + double rayon, int nbre, int crit) +{ + DumpStart ("makeSphericalUni", center << vx << vz << rayon << nbre << crit); + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, center); + grid->checkSystem (2, vx, vz, rx, rz); + + if (rayon<=1e-5) + { + grid->setError (HERR); + Mess << "Argument number 4 :"; + Mess << "Radius must be positive"; + } + + if (nbre<2) + { + grid->setError (HERR); + Mess << "Argument number 5 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + if (grid->isValid()) + { + Real3 orig; + RealVector trayon; + center->getPoint (orig); + for (int nro=1 ; nro<=nbre; ++nro) trayon.push_back (nro*rayon); + grid->makeSpherical (orig, rx, rz, trayon, crit); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeSpherical +Elements* Document::makeSpherical (Vertex* center, Vector* vx, Vector* vz, + RealVector trayon, int crit) +{ + DumpStart ("makeSpherical", center << vx << vz << trayon << crit); + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, center); + grid->checkSystem (2, vx, vz, rx, rz); + grid->checkVector (4, trayon, 2); + + if (grid->isValid()) + { + Real3 orig; + center->getPoint (orig); + grid->makeSpherical (orig, rx, rz, trayon, crit); + } + + + DumpReturn (grid); + return grid; +} +// ======================================================== makeSphereTop +Elements* Document::makeSphereTop (int nr, int na, int nh) +{ + DumpStart ("makeSphereTop", nr << na << nh); + Elements* grid = new Elements (this); + + Real3 orig = { 0, 0, 0 }; + Real3 rx = { 1, 0, 0 }; + Real3 rz = { 0, 0, 1 }; + + double rtrou = 1; + double rext = 10; + double angle = 360; + double phi0, phi1; + + grid->checkPhi (true, orig, rz, rext, rtrou, NULL, phi0, phi1); + + if (nr<2) + { + grid->setError (HERR); + Mess << "Argument number 1 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + if (na<3) + { + grid->setError (HERR); + Mess << "Argument number 2 :"; + Mess << "Nbr sectors must be greather or equal than 3"; + } + + if (nh<2) + { + grid->setError (HERR); + Mess << "Argument number 3 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + if (grid->isValid()) + { + double dr = (rext-rtrou)/nr; + double da = angle / na; + double dh = (phi1-phi0) / nh; + RealVector tray, tang, thaut; + for (int nro=0 ; nro<=nr; ++nro) tray .push_back (rtrou + nro*dr); + for (int nro=0 ; nro<=na; ++nro) tang .push_back (nro*da); + for (int nro=0 ; nro<=nh; ++nro) thaut.push_back (phi0 + nro*dh); + grid->makeRind (GR_HEMISPHERIC, orig, rx, rz, tray, tang, thaut); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeSphereUni +Elements* Document::makeSphereUni (Vertex* center, Vector* vx, Vector* vz, + double rtrou, double rext, double ang, + Vertex* hplan, int nr, int na, int nh) +{ + DumpStart ("makeSphereUni", center << vx << vz << rtrou << rext << ang + << hplan << nr << na << nh); + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, center); + grid->checkSystem (2, vx, vz, rx, rz); + + Real3 orig = { 0, 0, 0 }; + if (center != NULL) + center->getPoint (orig); + + double phi0, phi1; + grid->checkPhi (true, orig, rz, rext, rtrou, hplan, phi0, phi1); + + if (rtrou<=1e-5) + { + grid->setError (HERR); + Mess << "Argument number 4 :"; + Mess << "Hole radius must be positive"; + } + + if (rextsetError (HERR); + Mess << "Argument number 5 :"; + Mess << "External radius must be greather than hole radius"; + } + + if (ang<1.0) + { + grid->setError (HERR); + Mess << "Argument number 6 :"; + Mess << "Angle must be positive"; + } + + if (nr<2) + { + grid->setError (HERR); + Mess << "Argument number 7 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + if (na<3) + { + grid->setError (HERR); + Mess << "Argument number 8 :"; + Mess << "Nbr sectors must be greather or equal than 3"; + } + + if (nh<2) + { + grid->setError (HERR); + Mess << "Argument number 9 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + EnumGrid type = ang>= 359.9 ? GR_HEMISPHERIC : GR_PART_SPHERIC; + if (grid->isValid()) + { + double dr = (rext-rtrou)/nr; + double dh = (phi1-phi0) /nh; + double da = ang / na; + RealVector tray, tang, thaut; + for (int nro=0 ; nro<=nr; ++nro) tray .push_back (rtrou + nro*dr); + for (int nro=0 ; nro<=na; ++nro) tang .push_back (nro*da); + for (int nro=0 ; nro<=nh; ++nro) thaut.push_back (phi0 + nro*dh); + grid->makeRind (type, orig, rx, rz, tray, tang, thaut); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeSphere +Elements* Document::makeSphere (Vertex* center, Vector* vx, Vector* vz, + RealVector tray, RealVector tang, RealVector thaut) +{ + DumpStart ("makeSphere", center << vx << vz << tray << tang << thaut ); + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, center); + grid->checkSystem (2, vx, vz, rx, rz); + grid->checkVector (4, tray, 2); + grid->checkVector (5, tang, 3); + grid->checkVector (6, thaut, 2); + + int nb = tang.size()-1; + double angle = nb <0 ? 0 : tang[nb] ; + EnumGrid type = angle >= 359.9 ? GR_HEMISPHERIC : GR_PART_SPHERIC; + if (grid->isValid()) + { + Real3 orig; + center->getPoint (orig); + grid->makeRind (type, orig, rx, rz, tray, tang, thaut); + } + + + DumpReturn (grid); + return grid; +} + +// ======================================================== makeRindTop +Elements* Document::makeRindTop (int nr, int na, int nh) +{ + DumpStart ("makeRindTop", nr << na << nh); + Elements* grid = new Elements (this); + + Real3 orig = { 0, 0, 0 }; + Real3 rx = { 1, 0, 0 }; + Real3 rz = { 0, 0, 1 }; + + double rtrou = 1; + double rint = 8; + double rext = 10; + double angle = 360; + double phi0, phi1; + + grid->checkPhi (false, orig, rz, rext, rtrou, NULL, phi0, phi1); + + if (nr<2) + { + grid->setError (HERR); + Mess << "Argument number 1 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + if (na<3) + { + grid->setError (HERR); + Mess << "Argument number 2 :"; + Mess << "Nbr sectors must be greather or equal than 3"; + } + + if (nh<2) + { + grid->setError (HERR); + Mess << "Argument number 3 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + if (grid->isValid()) + { + double dr = (rext-rint)/nr; + double da = angle / na; + double dh = (phi1-phi0) / nh; + RealVector tray, tang, thaut; + tray .push_back (rtrou); + for (int nro=0 ; nro<=nr; ++nro) tray .push_back (rint + nro*dr); + for (int nro=0 ; nro<=na; ++nro) tang .push_back (nro*da); + for (int nro=0 ; nro<=nh; ++nro) thaut.push_back (phi0 + nro*dh); + grid->makeRind (GR_RIND, orig, rx, rz, tray, tang, thaut); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeRindUni +Elements* Document::makeRindUni (Vertex* center, Vector* vx, Vector* vz, + double rtrou, double rint, double rext, + double ang, Vertex* hplan, int nr, int na, int nh) +{ + DumpStart ("makeRindUni", center << vx << vz << rtrou << rint << rext << ang + << hplan << nr << na << nh); + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, center); + grid->checkSystem (2, vx, vz, rx, rz); + grid->checkDiams (4, rtrou, rint); + grid->checkDiams (5, rint, rext); + + Real3 orig = { 0, 0, 0 }; + if (center != NULL) + center->getPoint (orig); + + double phi0, phi1; + grid->checkPhi (false, orig, rz, rext, rtrou, hplan, phi0, phi1); + + if (rtrou<=1e-5) + { + grid->setError (HERR); + Mess << "Argument number 4 :"; + Mess << "Hole radius must be positive"; + } + + if (rintsetError (HERR); + Mess << "Argument number 5 :"; + Mess << "Internal radius must be greather than hole radius"; + } + + if (rextsetError (HERR); + Mess << "Argument number 6 :"; + Mess << "External radius must be greather than internal radius"; + } + + if (ang<1.0) + { + grid->setError (HERR); + Mess << "Argument number 7 :"; + Mess << "Angle must be positive"; + } + + if (nr<2) + { + grid->setError (HERR); + Mess << "Argument number 8 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + if (na<3) + { + grid->setError (HERR); + Mess << "Argument number 9 :"; + Mess << "Nbr sectors must be greather or equal than 3"; + } + + if (nh<2) + { + grid->setError (HERR); + Mess << "Argument number 10 :"; + Mess << "Nbr slices must be greather or equal than 2"; + } + + EnumGrid type = ang>= 359.9 ? GR_RIND : GR_PART_RIND; + if (grid->isValid()) + { + double dr = (rext-rint)/nr; + double dh = (phi1-phi0) /nh; + double da = ang / na; + RealVector tray, tang, thaut; + tray .push_back (rtrou); + for (int nro=0 ; nro<=nr; ++nro) tray .push_back (rint + nro*dr); + for (int nro=0 ; nro<=na; ++nro) tang .push_back (nro*da); + for (int nro=0 ; nro<=nh; ++nro) thaut.push_back (phi0 + nro*dh); + grid->makeRind (type, orig, rx, rz, tray, tang, thaut); + } + + DumpReturn (grid); + return grid; +} +// ======================================================== makeRind +Elements* Document::makeRind (Vertex* center, Vector* vx, Vector* vz, + RealVector tray, RealVector tang, RealVector thaut) +{ + DumpStart ("makeRind", center << vx << vz << tray << tang << thaut ); + Elements* grid = new Elements (this); + + Real3 rx, rz; + grid->checkOrig (1, center); + grid->checkSystem (2, vx, vz, rx, rz); + grid->checkVector (4, tray, 2); + grid->checkVector (5, tang, 3); + grid->checkVector (6, thaut, 2); + + int nb = tang.size()-1; + double angle = nb <0 ? 0 : tang[nb] ; + EnumGrid type = angle >= 359.9 ? GR_RIND : GR_PART_RIND; + if (grid->isValid()) + { + Real3 orig; + center->getPoint (orig); + grid->makeRind (type, orig, rx, rz, tray, tang, thaut); + } + + + DumpReturn (grid); + return grid; +} +// ======================================================== makeCylinders +BiCylinder* Document::makeCylinders (Vertex* ori1, Vector* vz1, double ray1, + double h1, Vertex* ori2, Vector* vz2, double ray2, double h2) +{ + DumpStart ("makeCylinders", ori1 << vz1 << ray1 << h1 << ori2 << vz2 + << ray2<< h2); + BiCylinder* grid = new BiCylinder (this); + + Real3 rz1, rz2; + grid->checkOrig (1, ori1); + grid->checkOrig (5, ori2); + grid->checkSystem (2, vz1, vz2, rz1, rz2); + + if (grid->isValid()) + { + if (ray1 < ray2) + grid->makeCylinders (ori1, rz1, ray1, h1, ori2, rz2, ray2, h2); + else + grid->makeCylinders (ori2, rz2, ray2, h2, ori1, rz1, ray1, h1); + } + + + DumpReturn (grid); + return grid; +} +// ======================================================== makePipes +BiCylinder* Document::makePipes (Vertex* ori1, Vector* vz1, double rint1, + double rext1, double h1, + Vertex* ori2, Vector* vz2, double rint2, double rext2, double h2) +{ + DumpStart ("makePipes", ori1 << vz1 << rint1 << rext1 << h1 + << ori2 << vz2 << rint2 << rext2 << h2); + BiCylinder* grid = new BiCylinder (this); + + Real3 rz1, rz2; + grid->checkOrig (1, ori1); + grid->checkOrig (6, ori2); + grid->checkSystem (2, vz1, vz2, rz1, rz2); + grid->checkDiams (3, rint1, rext1); + grid->checkDiams (8, rint2, rext2); + + if (grid->isValid()) + { + if (rext1 < rext2) + grid->makePipes (ori1,rz1,rint1,rext1,h1, ori2,rz2,rint2,rext2,h2); + else + grid->makePipes (ori2,rz2,rint2,rext2,h2, ori1,rz1,rint1,rext1,h1); + } + + DumpReturn (grid); + return grid; +} +// ------------------------------------------------------------------------ +// ------------------------------------------------------------------------ +// ------------------------------------------------------------------------ +// ========================================================= extrudeQuadTop +Elements* Document::extrudeQuadTop (Quad* start, int nbre) +{ + DumpStart ("extrudeQuadTop", start << nbre); + + Quads tstart; + RealVector tlen; + Real3 axe = { 0, 0, 1 }; + double larg = 1; + Elements* grid = new Elements (this); + + tstart.push_back (start); + + grid->checkQuad (start); + grid->makeNormale (tstart, axe, larg); + for (int nro=0 ; nroisValid()) + { + grid->extrudeQuads (tstart, axe, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= extrudeQuadUni +Elements* Document::extrudeQuadUni (Quad* start, Vector* axis, double len, + int nbre) +{ + DumpStart ("extrudeQuadUni", start << axis << len << nbre); + + Quads tstart; + RealVector tlen; + Real3 axe; + Elements* grid = new Elements (this); + + grid->checkQuad (start); + grid->checkAxis (axis, axe); + + tstart.push_back (start); + + for (int nro=0 ; nroisValid()) + { + grid->extrudeQuads (tstart, axe, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= extrudeQuad +Elements* Document::extrudeQuad (Quad* start, Vector* axis, RealVector tlen) +{ + DumpStart ("extrudeQuad", start << axis << tlen); + + Quads tstart; + Real3 axe; + Elements* grid = new Elements (this); + + grid->checkQuad (start); + grid->checkAxis (axis, axe); + grid->checkVector (3, tlen); + + tstart.push_back (start); + + if (grid->isValid()) + { + grid->extrudeQuads (tstart, axe, tlen); + } + + DumpReturn (grid); + return grid; +} + +// ========================================================= extrudeQuadsTop +Elements* Document::extrudeQuadsTop (Quads tstart, int nbre) +{ + DumpStart ("extrudeQuadsTop", tstart << nbre); + + RealVector tlen; + Real3 axe = { 0, 0, 1 }; + double larg = 1; + Elements* grid = new Elements (this); + + grid->checkQuads (tstart); + grid->makeNormale (tstart, axe, larg); + for (int nro=0 ; nroisValid()) + { + grid->extrudeQuads (tstart, axe, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= extrudeQuadsUni +Elements* Document::extrudeQuadsUni (Quads tstart, Vector* axis, double len, + int nbre) +{ + DumpStart ("extrudeQuadsUni", tstart << axis << len << nbre); + + RealVector tlen; + Real3 axe; + Elements* grid = new Elements (this); + + grid->checkQuads (tstart); + grid->checkAxis (axis, axe); + + for (int nro=0 ; nroisValid()) + { + grid->extrudeQuads (tstart, axe, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= extrudeQuads +Elements* Document::extrudeQuads (Quads tstart, Vector* axis, RealVector tlen) +{ + DumpStart ("extrudeQuads", tstart << axis << tlen); + + Real3 axe; + Elements* grid = new Elements (this); + + grid->checkQuads (tstart); + grid->checkAxis (axis, axe); + grid->checkVector (3, tlen); + + if (grid->isValid()) + { + grid->extrudeQuads (tstart, axe, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= revolutionQuadUni +Elements* Document::revolutionQuadUni (Quad* start, Vertex* center, + Vector* axis, double angle, int nbre) +{ + DumpStart ("revolutionQuadUni", start << center << axis << angle << nbre); + + Quads tstart; + RealVector angles; + Real3 axe; + Elements* grid = new Elements (this); + double alpha = angle / std::max (nbre, 1); + + grid->checkQuad (start); + grid->checkOrig (2, center); + grid->checkAxis (axis, axe); + + tstart.push_back (start); + for (int nro=0 ; nroisValid()) + { + grid->extrudeQuads (tstart, axe, angles, true, center); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= revolutionQuad +Elements* Document::revolutionQuad (Quad* start, Vertex* center, Vector* axis, + RealVector angles) +{ + DumpStart ("revolutionQuads", start << center << axis << angles); + + Quads tstart; + Real3 axe; + Elements* grid = new Elements (this); + + grid->checkQuad (start); + grid->checkOrig (2, center); + grid->checkAxis (axis, axe); + + tstart.push_back (start); + + if (grid->isValid()) + { + grid->extrudeQuads (tstart, axe, angles, true, center); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= revolutionQuadsUni +Elements* Document::revolutionQuadsUni (Quads tstart, Vertex* center, + Vector* axis, double angle, int nbre) +{ + DumpStart ("revolutionQuadsUni", tstart << center << axis << angle << nbre); + + RealVector angles; + Real3 axe; + Elements* grid = new Elements (this); + double alpha = angle / std::max (nbre, 1); + + grid->checkQuads (tstart); + grid->checkOrig (2, center); + grid->checkAxis (axis, axe); + + for (int nro=0 ; nroisValid()) + { + grid->extrudeQuads (tstart, axe, angles, true, center); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= revolutionQuads +Elements* Document::revolutionQuads (Quads tstart, Vertex* center, Vector* axis, + RealVector angles) +{ + DumpStart ("revolutionQuads", tstart << center << axis << angles); + + Real3 axe; + Elements* grid = new Elements (this); + + grid->checkQuads (tstart); + grid->checkOrig (2, center); + grid->checkAxis (axis, axe); + grid->checkVector (4, angles); + + if (grid->isValid()) + { + grid->extrudeQuads (tstart, axe, angles, true, center); + } + + DumpReturn (grid); + return grid; +} +// ------------------------------------------------------------------------ +// ------------------------------------------------------------------------ +// ------------------------------------------------------------------------ +// ========================================================= joinQuadUni +Elements* Document::joinQuadUni (Quad* quada, Quad* quadb, Vertex* va1, + Vertex* vb1, Vertex* va2, Vertex* vb2, int nbre) +{ + DumpStart ("joinQuadUni", quada << quadb << va1<checkQuad (quada); + grid->checkQuad (quadb, -1); + grid->checkSense (3, va1, va2, quada); + grid->checkSense (6, vb1, vb2, quadb); + + nbre = nbre < 0 ? 0 : nbre; + double dist = 1.0 / (nbre+1); + + tquada.push_back (quada); + for (int nro=0 ; nroisValid()) + { + grid->joinQuads (tquada, quadb, va1, vb1, va2, vb2, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= joinQuad +Elements* Document::joinQuad (Quad* quada, Quad* quadb, Vertex* va1, + Vertex* vb1, Vertex* va2, Vertex* vb2, RealVector& tlen) +{ + DumpStart ("joinQuad", quada << quadb << va1 << vb1 << va2 << vb2 << tlen); + + Quads tquada; + Elements* grid = new Elements (this); + + grid->checkQuad (quada); + grid->checkQuad (quadb, -1); + grid->checkSense (3, va1, va2, quada); + grid->checkSense (6, vb1, vb2, quadb); + grid->checkVector (7, tlen, 0, true); + + tquada.push_back (quada); + + if (grid->isValid()) + { + grid->joinQuads (tquada, quadb, va1, vb1, va2, vb2, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= joinQuadsUni +Elements* Document::joinQuadsUni (Quads tquada, Quad* quadb, Vertex* va1, + Vertex* vb1, Vertex* va2, Vertex* vb2, int nbre) +{ + DumpStart ("joinQuadsUni", tquada << quadb << va1 << vb1 << va2 << vb2 + << nbre); + RealVector tlen; + Elements* grid = new Elements (this); + + grid->checkQuads (tquada); + grid->checkQuad (quadb, -1); + if (tquada.size()>0) + grid->checkSense (3, va1, va2, tquada[0]); + grid->checkSense (6, vb1, vb2, quadb); + + nbre = nbre < 0 ? 0 : nbre; + double dist = 1.0 / (nbre+1); + + for (int nro=0 ; nroisValid()) + { + grid->joinQuads (tquada, quadb, va1, vb1, va2, vb2, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= joinQuads +Elements* Document::joinQuads (Quads tquada, Quad* quadb, Vertex* va1, + Vertex* vb1, Vertex* va2, Vertex* vb2, RealVector& tlen) +{ + DumpStart ("joinQuads", tquada << quadb << va1 << vb1 << va2 << vb2 << tlen); + + Elements* grid = new Elements (this); + + grid->checkQuads (tquada); + grid->checkQuad (quadb, -1); + if (tquada.size()>0) + grid->checkSense (3, va1, va2, tquada[0]); + grid->checkSense (6, vb1, vb2, quadb); + grid->checkVector (7, tlen, 1, true); + + if (grid->isValid()) + { + grid->joinQuads (tquada, quadb, va1, vb1, va2, vb2, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= cutUni +Elements* Document::cutUni (Edge* edge, int nbre) +{ + DumpStart ("cutUni", edge << nbre); + + Elements* grid = new Elements (this); + + if (BadElement (edge)) + { + grid->setError (HERR); + Mess << "Argument number 1 : edge is not valid"; + } + + if (nbre <= 0) + { + grid->setError (HERR); + Mess << "Argument number 2 : number od subdivisions must be positive"; + nbre = 0; + } + + double dist = 1.0 / (nbre+1); + + RealVector tlen; + for (int nro=0 ; nroisValid()) + { + grid->cutEdge (edge, tlen); + } + + DumpReturn (grid); + return grid; +} +// ========================================================= cut +Elements* Document::cut (Edge* edge, RealVector& tlen) +{ + DumpStart ("cut", edge << tlen); + + Elements* grid = new Elements (this); + + if (BadElement (edge)) + { + grid->setError (HERR); + Mess << "Argument number 1 : edge is not valid"; + } + + grid->checkVector (2, tlen, 1, true); + + if (grid->isValid()) + { + grid->cutEdge (edge, tlen); + } + + DumpReturn (grid); + return grid; +} +END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexDummyCad.hxx b/src/HEXABLOCK/HexDummyCad.hxx new file mode 100644 index 0000000..0ff5764 --- /dev/null +++ b/src/HEXABLOCK/HexDummyCad.hxx @@ -0,0 +1,325 @@ + +// Class : Ecriture d'un dump python + +// Copyright (C) 2009-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 + +#ifndef __DUMMY_CASCAD_ +#define __DUMMY_CASCAD_ + +class BRepAdaptor_Curve; +class BRepAlgoAPI_Section; +class BRepBuilderAPI_MakeEdge; +class BRepBuilderAPI_MakeVertex; +class BRepBuilderAPI_Transform; +class BRepPrimAPI_MakeCylinder; +class BRepPrimAPI_MakeSphere; +class BRepTools; +class BRep_Builder; +class BRep_Tool; +class GC_MakeCircle; +class GeomAdaptor_Curve; +class GEOMImpl_CircleDriver; +class GEOMImpl_CylinderDriver; +class GEOMImpl_ICircle; +class GEOMImpl_ICylinder; +class GeomAPI_ProjectPointOnCurve; +class Geom_Circle; +class TopExp_Explorer; +class TopTools_IndexedMapOfShape; +class TopoDS; +class TopoDS_Compound; +class TopoDS_Edge; +class TopoDS_Iterator; +class TopoDS_Vertex; + +class gp_Circ; +class gp_Dir; +class gp_Lin; +class gp_Pln; +class gp_Pnt; +class gp_Vec; +class gp_Ax2; + +// ----------------------------------------------------------- +#define Standard_True true +#define Handle(x) int +enum {TopAbs_VERTEX, TopAbs_EDGE, TopAbs_FACE }; +// ----------------------------------------------------------- +class gp_Pnt +{ +public : +gp_Pnt () {} +gp_Pnt (double, double, double) {} +double X () { return 0; } +double Y () { return 0; } +double Z () { return 0; } +}; +// ----------------------------------------------------------- +class gp_Vec +{ +public : +gp_Vec (double, double, double) {} +}; +// ----------------------------------------------------------- +class gp_Dir +{ +public : +gp_Dir (int, int, int) {} +}; +// ----------------------------------------------------------- +class gp_Ax2 +{ +public : +gp_Ax2 (gp_Pnt&, gp_Vec&, gp_Vec&) {} +gp_Ax2 (gp_Pnt&, gp_Dir, gp_Dir) {} +}; +// ----------------------------------------------------------- +class gp_Trsf +{ +public : +void SetTranslation (gp_Vec) {} +void SetValues (double, double, double, double, + double, double, double, double, + double, double, double, double, + double, double) {} +gp_Trsf& operator* (gp_Trsf&) { return *this ; } +}; +// ----------------------------------------------------------- +class TopLoc_Location +{ +public : +TopLoc_Location () {} +TopLoc_Location (gp_Trsf&) {} +gp_Trsf Transformation() { return tra ; } +private : +gp_Trsf tra; +}; +// ----------------------------------------------------------- +class TopoDS_Shape +{ +public : + TopLoc_Location Location () { return top_loc ; } + TopoDS_Shape Located (TopLoc_Location& top_loc) { return *this; } + int ShapeType () const { return 0 ; } + + bool IsNull () const { return true ; } + TopoDS_Shape& operator=(const BRepBuilderAPI_MakeVertex&) + { return *this ; } + +private : + TopLoc_Location top_loc; +}; +// ----------------------------------------------------------- +class gp_Circ +{ +public : +gp_Circ (gp_Ax2&, double ) {} +}; +// ----------------------------------------------------------- +class GCPnts_AbscissaPoint +{ +public : +GCPnts_AbscissaPoint (BRepAdaptor_Curve&, double, double) {} +double Parameter () {return 1; } +static double Length (GeomAdaptor_Curve&, double&, double&) {return 1; } +gp_Pnt Value (double) { return point ; } + +private : +gp_Pnt point; + +}; +// ----------------------------------------------------------- +class BRepAdaptor_Curve +{ +public : +BRepAdaptor_Curve (TopoDS_Edge&) {} +double FirstParameter () {return 1; } +gp_Pnt Value (double) { return point ; } + +private : +gp_Pnt point; +}; +// ----------------------------------------------------------- +class GeomAdaptor_Curve +{ +public : +GeomAdaptor_Curve (int) {} +}; +// ----------------------------------------------------------- +class BRepPrimAPI_MakeCylinder +{ +public : + BRepPrimAPI_MakeCylinder (gp_Ax2&, double, double) {} + void Build () { } + bool IsDone () { return true; } + TopoDS_Shape Shape () { return forme ; } + +private : + TopoDS_Shape forme; +}; +// ----------------------------------------------------------- +class BRepAlgoAPI_Section +{ +public : +BRepAlgoAPI_Section (TopoDS_Shape&, TopoDS_Shape&, bool) {} + void Build () { } + bool IsDone () { return true; } + void Approximation (bool) { } + TopoDS_Shape Shape () { return forme ; } + +private : + TopoDS_Shape forme; +}; +// ----------------------------------------------------------- +class TopoDS_Vertex {}; +// ----------------------------------------------------------- +class TopoDS_Edge {}; +// ----------------------------------------------------------- +class TopoDS +{ +public : + static TopoDS_Edge Edge (const TopoDS_Shape&) { return edge ; } + static TopoDS_Vertex Vertex (const TopoDS_Shape&) { return vertex ; } +private : + static TopoDS_Edge edge; + static TopoDS_Vertex vertex; +}; +// ----------------------------------------------------------- +class BRep_Tool +{ +public : + static int Curve (TopoDS_Edge, double, double) { return 0 ; } + static int Curve (TopoDS_Edge, TopLoc_Location&, double, double) {return 0;} + static gp_Pnt Pnt(TopoDS_Vertex vertex ) { return point; } +private : + static gp_Pnt point; + +}; +// ----------------------------------------------------------- +class GeomAPI_ProjectPointOnCurve +{ +public : +GeomAPI_ProjectPointOnCurve (gp_Pnt&, int) {}; +int NbPoints () {return 0 ;}; +double LowerDistanceParameter () {return 0 ;}; +}; +// ----------------------------------------------------------- +class BRepBuilderAPI_MakeEdge +{ +public : +BRepBuilderAPI_MakeEdge (gp_Circ&) {} +TopoDS_Edge Edge () { return edge ; } +private : + static TopoDS_Edge edge; + +}; +// ----------------------------------------------------------- +class BRep_Builder +{ +public : + void MakeCompound (TopoDS_Compound& ) {} + void Add (TopoDS_Compound&, TopoDS_Shape& ) {} + void Add (TopoDS_Compound&, TopoDS_Edge& ) {} +}; +// ----------------------------------------------------------- +class BRepTools +{ +public : +static void Write (TopoDS_Edge&, ostringstream&) {} +static void Write (TopoDS_Shape&, ostringstream&) {} +static void Read (TopoDS_Shape&, istringstream&, BRep_Builder&) {} +static void Clean (TopoDS_Shape&) {} +}; +// ----------------------------------------------------------- +class BRepPrimAPI_MakeSphere +{ +public : +BRepPrimAPI_MakeSphere(gp_Ax2&, double&) {} +void Build () { } +TopoDS_Shape Face () { return forme ; } +private : + static TopoDS_Shape forme; + +}; +// ----------------------------------------------------------- +class BRepBuilderAPI_Transform +{ +public : +BRepBuilderAPI_Transform (TopoDS_Shape&, gp_Trsf&, bool) {} +TopoDS_Shape Shape () { return forme ; } + +private : + TopoDS_Shape forme; + +}; + +// ----------------------------------------------------------- +class TopExp_Explorer +{ +public : +TopExp_Explorer (TopoDS_Shape&, int) {} +bool More() { return false ; } +void Next() {} +TopoDS_Shape& Current() { return forme ; } +private : + TopoDS_Shape forme; +}; +// ----------------------------------------------------------- +class TopoDS_Iterator +{ +public : +TopoDS_Iterator (const TopoDS_Shape&) {} +bool More() { return false ; } +void Next() {} +TopoDS_Shape& Value() { return forme ; } +private : + TopoDS_Shape forme; +}; +// ----------------------------------------------------------- +class BRepBuilderAPI_MakeVertex +{ +public : +BRepBuilderAPI_MakeVertex (gp_Pnt&) {} +TopoDS_Shape& Shape() { return forme ; } +private : + TopoDS_Shape forme; +}; +// ----------------------------------------------------------- +class TopTools_IndexedMapOfShape +{ +public : +void Clear() {} +int Add (const TopoDS_Shape&) { return 0 ; } +const TopoDS_Shape& FindKey (int id) { return forme ; } + +private : + TopoDS_Shape forme; +}; +// ----------------------------------------------------------- +class GC_MakeCircle {}; +class GEOMImpl_CircleDriver {}; +class GEOMImpl_CylinderDriver {}; +class GEOMImpl_ICircle {}; +class GEOMImpl_ICylinder {}; +class Geom_Circle {}; +class TopoDS_Compound : public TopoDS_Shape {}; +class gp_Lin {}; +class gp_Pln {}; +#endif diff --git a/src/HEXABLOCK/HexDumpStudy.cxx b/src/HEXABLOCK/HexDumpStudy.cxx index c7273a3..d0093d5 100755 --- a/src/HEXABLOCK/HexDumpStudy.cxx +++ b/src/HEXABLOCK/HexDumpStudy.cxx @@ -20,6 +20,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // #include "HexDumpStudy.hxx" +#include "HexWitness.hxx" #include "HexEltBase.hxx" #include "HexDocument.hxx" @@ -38,6 +39,7 @@ DumpStudy::DumpStudy () is_open = NOT DumpActif; nbr_nulls = 0; fic_dump = stdout; + witness = NULL; for (int nc=0 ; ncraz(); return is_open; } // =================================================== operator << (int) @@ -140,6 +144,26 @@ DumpStudy& DumpStudy::operator << (Quads& tab) addArgVector (EL_QUAD, tabelt) ; return *this; } +// =================================================== operator << (Edges) +DumpStudy& DumpStudy::operator << (Edges& tab) +{ + if (not is_open) + return *this; + + TabElts& tabelt = (TabElts&) tab; + addArgVector (EL_EDGE, tabelt) ; + return *this; +} +// =================================================== operator << (Hexas) +DumpStudy& DumpStudy::operator << (Hexas& tab) +{ + if (not is_open) + return *this; + + TabElts& tabelt = (TabElts&) tab; + addArgVector (EL_HEXA, tabelt) ; + return *this; +} // =================================================== operator << (Reals) DumpStudy& DumpStudy::operator << (RealVector& tab) { @@ -184,6 +208,40 @@ void DumpStudy::close (bool reactive, EltBase* result) right_part += ")"; fprintf (fic_dump, "%s = %s\n", name, right_part.c_str()); } +// =================================================== close + return int +void DumpStudy::close (bool reactive, int result) +{ + static int nbr_values = 0; + if (reactive) + is_open = false; + else + return; + + char name [32]; + nbr_values ++; + sprintf (name, "rep%03d", nbr_values); + + declareVectors (); + right_part += ")"; + fprintf (fic_dump, "%s = %s\n", name, right_part.c_str()); +} +// =================================================== close + return double +void DumpStudy::close (bool reactive, double result) +{ + static int nbr_values = 0; + if (reactive) + is_open = false; + else + return; + + char name [32]; + nbr_values ++; + sprintf (name, "val%03d", nbr_values); + + declareVectors (); + right_part += ")"; + fprintf (fic_dump, "%s = %s\n", name, right_part.c_str()); +} // =================================================== close void DumpStudy::close (bool reactive) { @@ -211,6 +269,12 @@ void DumpStudy::restore (bool reactive) if (reactive) is_open = false; } +// =================================================== getBegin +void DumpStudy::getBegin (string& begin) +{ + begin = right_part; + begin += ")"; +} // ------------------------------------------------------------- // ------------ Private // ------------ For members only diff --git a/src/HEXABLOCK/HexDumpStudy.hxx b/src/HEXABLOCK/HexDumpStudy.hxx index 6067dbb..bd58813 100755 --- a/src/HEXABLOCK/HexDumpStudy.hxx +++ b/src/HEXABLOCK/HexDumpStudy.hxx @@ -17,8 +17,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #ifndef __DUMP_STUDY_H_ #define __DUMP_STUDY_H_ @@ -29,6 +29,7 @@ BEGIN_NAMESPACE_HEXA +#define DumpStart0(p) bool actif=el_root->glob->dump.start(this, p) #define DumpStart(p,args) bool actif=el_root->glob->dump.start(this, p); if (actif) el_root->glob->dump << args #define DumpEnd el_root->glob->dump.close (actif) #define DumpReturn(v) el_root->glob->dump.close (actif,v) @@ -36,10 +37,12 @@ BEGIN_NAMESPACE_HEXA #define DumpLock bool actif=el_root->glob->dump.lock () #define DumpRestore el_root->glob->dump.restore (actif) +class Witness; class DumpStudy { public : DumpStudy (); + void setWitness (Witness* temoin) { witness = temoin ; } DumpStudy& operator << (int val); DumpStudy& operator << (double val); @@ -51,12 +54,15 @@ public : DumpStudy& operator << (RealVector& elt); bool start (EltBase* obj, cpchar method); - bool start (cpchar obj, cpchar method); + bool start (cpchar obj, cpchar method, bool razmess=true); void close (bool reactive); void close (bool reactive, EltBase* retour); + void close (bool reactive, int retour); + void close (bool reactive, double retour); bool lock (); - void restore (bool reactive); + void restore (bool reactive); + void getBegin (string& begin); private : cpchar findName (EltBase* elt); @@ -76,12 +82,13 @@ private : string curr_vector; int nbr_values; - FILE* fic_dump; - string this_name; - string right_part; - bool is_open; - int nbr_nulls; - int nbr_args; + FILE* fic_dump; + string this_name; + string right_part; + bool is_open; + int nbr_nulls; + int nbr_args; + Witness* witness; }; END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexEdge.cxx b/src/HEXABLOCK/HexEdge.cxx index e6583a3..7fc3dc5 100755 --- a/src/HEXABLOCK/HexEdge.cxx +++ b/src/HEXABLOCK/HexEdge.cxx @@ -17,7 +17,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #include "HexEdge.hxx" #include "HexVertex.hxx" @@ -61,6 +62,8 @@ Edge::Edge (Vertex* va, Vertex* vb) return; } + if (el_root != NULL) + el_root->addEdge (this); majReferences (); } // ======================================================== Constructeur 2 @@ -75,6 +78,9 @@ Edge::Edge (Edge* other) e_way = true; e_law = NULL; e_clone = NULL; + + if (el_root != NULL) + el_root->addEdge (this); } // ======================================================== majReferences void Edge::majReferences () @@ -126,6 +132,26 @@ void Edge::propager (Propagation* prop, int groupe, int sens) } niveau --; } +// ========================================================= setPropag +void Edge::setPropag (int nro, bool sens) +{ + e_propag = nro; + e_way = sens; + if (NOT db || nro<0) + return; + + int prems = sens ? 0 : 1; + Vertex* v1 = getVertex ( prems); + Vertex* v2 = getVertex (1-prems); + + cout << " setPropag " << el_name + << " = " << nro + << " = (" << v1->getName() << ", " << v2->getName() + << ") = (" << v2->getX() - v1->getX() + << ", " << v2->getY() - v1->getY() + << ", " << v2->getZ() - v1->getZ() + << ")" << endl; +} // ========================================================= getParent Quad* Edge::getParent (int nro) { @@ -233,7 +259,7 @@ string Edge::makeDefinition () return definition; } -// ========================================================== addAssociation +// ===================================================== addAssociation int Edge::addAssociation (EdgeShape* gline, double deb, double fin) { if (gline == NULL) @@ -272,7 +298,7 @@ int Edge::addAssociation (NewShape* geom, int subid, double deb, double fin) int ier = addAssociation (gline, deb, fin); return ier; } -// ========================================================== clearAssociation +// ================================================== clearAssociation void Edge::clearAssociation () { int nombre = tab_assoc.size (); @@ -284,14 +310,114 @@ void Edge::clearAssociation () tab_assoc .clear (); is_associated = false; } -// ========================================================== getAssociation +// ================================================== getAssociation AssoEdge* Edge::getAssociation (int nro) { - if (nro<0 || nro >= tab_assoc.size()) + if (nro<0 || nro >= (int)tab_assoc.size()) return NULL; return tab_assoc [nro]; } +// =============================================================== getVertex +Vertex* Edge::getVertex(int nro) +{ + Vertex* elt = NULL; + if (nro >=0 && nro < V_TWO && el_status == HOK + && e_vertex [nro]->isValid()) + elt = e_vertex [nro]; + + return elt; +} +// =============================================================== index +int Edge::index (Vertex* node) +{ + return node == NULL ? NOTHING + : node == e_vertex[V_AMONT] ? V_AMONT + : node == e_vertex[V_AVAL ] ? V_AVAL : NOTHING; +} +// ============================================================= opposedVertex +Vertex* Edge::opposedVertex (Vertex* sommet) +{ + int nro = index (sommet); + return nro<0 ? NULL : e_vertex[1-nro]; +} +// ============================================================= commonVertex +Vertex* Edge::commonVertex (Edge* other) +{ + int nro = inter (other); + return nro<0 ? NULL : e_vertex[nro]; +} +// ============================================================= commonPoint +double* Edge::commonPoint (Edge* other, double point[]) +{ + Vertex* commun = commonVertex (other); + if (commun==NULL) + { + point[dir_x] = point[dir_y] = point[dir_z] = 0; + return NULL; + } + + commun->getPoint (point); + return point; +} +// =============================================================== inter +int Edge::inter (Edge* other) +{ + int nro; + return inter (other, nro); +} +// =============================================================== inter +int Edge::inter (Edge* other, int& nother) +{ + for (int ni=0 ; nie_vertex[nj]) + { + nother = nj; + return ni; + } + + nother = NOTHING; + return NOTHING; +} +// =============================================================== definedBy +bool Edge::definedBy (Vertex* v1, Vertex* v2) +{ + bool rep = (v1 == e_vertex[V_AMONT] && v2 == e_vertex[V_AVAL ]) + || (v1 == e_vertex[V_AVAL ] && v2 == e_vertex[V_AMONT]); + return rep; +} +// =============================================================== setColor +void Edge::setColor (double val) +{ + e_vertex [V_AMONT]->setColor (val); + e_vertex [V_AVAL ]->setColor (val); +} +// =============================================================== duplicate +void Edge::duplicate () +{ + e_clone = new Edge (GetClone (e_vertex [V_AMONT]), + GetClone (e_vertex [V_AVAL ])); + + // e_clone->tab_shapes = tab_shapes; + e_clone->tab_assoc = tab_assoc; +} +// =============================================================== getVector +double* Edge::getVector (double vecteur[]) +{ + + if (e_vertex[V_AMONT]==NULL || e_vertex[V_AVAL]==NULL) + { + vecteur [dir_x] = vecteur [dir_y] = vecteur [dir_z] = 0; + return NULL; + } + + vecteur[dir_x] = e_vertex[V_AVAL]->getX() - e_vertex[V_AMONT]->getX(); + vecteur[dir_y] = e_vertex[V_AVAL]->getY() - e_vertex[V_AMONT]->getY(); + vecteur[dir_z] = e_vertex[V_AVAL]->getZ() - e_vertex[V_AMONT]->getZ(); + + return vecteur; +} // ========================================================== checkAssociation int Edge::checkAssociation () { @@ -320,8 +446,8 @@ int Edge::checkAssociation () { if (ier==HOK) cout << endl; cout << " Association Edge " << el_name - << " : Le vertex " << e_vertex[nro]->getName() - << " : Le vertex " << e_vertex[nro]->getName() + << " : Le vertex " << e_vertex[nro]->getName() + << " : Le vertex " << e_vertex[nro]->getName() << " Touche les lignes " << arc [nro] << " et " << nass << endl; ier = 112; @@ -371,4 +497,24 @@ int Edge::checkAssociation () return ier; } +// ========================================================== getAssoLen +double Edge::getAssoLen () +{ + int nombre = tab_assoc.size(); + double longueur = 0; + if (nombre==0) + { + Real3 p1, p2; + e_vertex [V_AMONT]-> getAssoCoord (p1); + e_vertex [V_AVAL ]-> getAssoCoord (p2); + longueur = calc_distance (p1, p2); + } + else + { + for (int nass=0 ; nasslength (); + } + + return longueur; +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexEdge.hxx b/src/HEXABLOCK/HexEdge.hxx index de668a6..57dd04b 100755 --- a/src/HEXABLOCK/HexEdge.hxx +++ b/src/HEXABLOCK/HexEdge.hxx @@ -29,23 +29,28 @@ BEGIN_NAMESPACE_HEXA class Edge : public EltBase { public: - virtual int countVertex () { return V_TWO; } virtual Vertex* getVertex (int nro); + + int addAssociation (NewShape* geom, int subid, double deb, double fin); + virtual void clearAssociation (); + void setColor (double valeur); bool getWay () { return e_way ; } + Edge (Vertex* va, Vertex* vb); + +#ifndef SWIG public: + virtual int countVertex () { return V_TWO; } virtual void saveXml (XmlWriter* xml); virtual void replaceVertex (Vertex* old, Vertex* nouveau); - virtual void clearAssociation (); - Edge (Vertex* va, Vertex* vb); Edge (Edge* other); int anaMerge (Vertex* orig, Vertex* couple[]); bool definedBy (Vertex* v1, Vertex* v2); void propager (Propagation* prop, int nro, int sens=1); - void setPropag (int nro, bool sens) { e_propag = nro; e_way=sens; } + void setPropag (int nro, bool sens); int getPropag () { return e_propag ; } Quad* getParent (int nro); @@ -68,138 +73,29 @@ public: Law* getLaw () { return e_law ; } void setLaw (Law* law) { e_law = law ; } - void setScalar (double valeur); - void setColor (double valeur) { setScalar (valeur) ; } - - const Shapes & getAssociations () { return tab_shapes ; } + void setScalar (double valeur) { setColor (valeur) ; } virtual void duplicate (); Edge* getClone () { return e_clone ; } double* getVector (double vecteur[]); string makeDefinition (); - virtual int addAssociation (Shape* forme) {return HOK;} // Perime Hexa5 - virtual void setAssociation (Shape* forme) {} // Perime Hexa5 - - int addAssociation (NewShape* geom, int subid, double deb, double fin); int addAssociation (EdgeShape* gline, double deb, double fin); int checkAssociation (); int countAssociation () { return tab_assoc.size () ; } AssoEdge* getAssociation (int nro); + double getAssoLen (); private: friend class Cloner; - Vertex* e_vertex [V_TWO]; - Edge* e_clone; - int e_propag; - bool e_way; // Sens de propagation - Law* e_law; // Le soleil brille, brille, brille - - Shapes tab_shapes; + Vertex* e_vertex [V_TWO]; + Edge* e_clone; + int e_propag; + bool e_way; // Sens de propagation + Law* e_law; // Le soleil brille, brille, brille AssoEdges tab_assoc; +#endif }; - -// ----------------------------------------------- Inlining -// =============================================================== getVertex -inline Vertex* Edge::getVertex(int nro) -{ - Vertex* elt = NULL; - if (nro >=0 && nro < V_TWO && el_status == HOK - && e_vertex [nro]->isValid()) - elt = e_vertex [nro]; - - return elt; -} -// =============================================================== index -inline int Edge::index (Vertex* node) -{ - return node == NULL ? NOTHING - : node == e_vertex[V_AMONT] ? V_AMONT - : node == e_vertex[V_AVAL ] ? V_AVAL : NOTHING; -} -// ============================================================= opposedVertex -inline Vertex* Edge::opposedVertex (Vertex* sommet) -{ - int nro = index (sommet); - return nro<0 ? NULL : e_vertex[1-nro]; -} -// ============================================================= commonVertex -inline Vertex* Edge::commonVertex (Edge* other) -{ - int nro = inter (other); - return nro<0 ? NULL : e_vertex[nro]; -} -// ============================================================= commonPoint -inline double* Edge::commonPoint (Edge* other, double point[]) -{ - Vertex* commun = commonVertex (other); - if (commun==NULL) - { - point[dir_x] = point[dir_y] = point[dir_z] = 0; - return NULL; - } - - commun->getPoint (point); - return point; -} -// =============================================================== inter -inline int Edge::inter (Edge* other) -{ - int nro; - return inter (other, nro); -} -// =============================================================== inter -inline int Edge::inter (Edge* other, int& nother) -{ - for (int ni=0 ; nie_vertex[nj]) - { - nother = nj; - return ni; - } - - nother = NOTHING; - return NOTHING; -} -// =============================================================== definedBy -inline bool Edge::definedBy (Vertex* v1, Vertex* v2) -{ - bool rep = (v1 == e_vertex[V_AMONT] && v2 == e_vertex[V_AVAL ]) - || (v1 == e_vertex[V_AVAL ] && v2 == e_vertex[V_AMONT]); - return rep; -} -// =============================================================== setScalar -inline void Edge::setScalar (double val) -{ - e_vertex [V_AMONT]->setScalar (val); - e_vertex [V_AVAL ]->setScalar (val); -} -// =============================================================== duplicate -inline void Edge::duplicate () -{ - e_clone = new Edge (GetClone (e_vertex [V_AMONT]), - GetClone (e_vertex [V_AVAL ])); - - e_clone->tab_shapes = tab_shapes; - e_clone->tab_assoc = tab_assoc; -} -// =============================================================== getVector -inline double* Edge::getVector (double vecteur[]) -{ - - if (e_vertex[V_AMONT]==NULL || e_vertex[V_AVAL]==NULL) - { - vecteur [dir_x] = vecteur [dir_y] = vecteur [dir_z] = 0; - return NULL; - } - - vecteur[dir_x] = e_vertex[V_AVAL]->getX() - e_vertex[V_AMONT]->getX(); - vecteur[dir_y] = e_vertex[V_AVAL]->getY() - e_vertex[V_AMONT]->getY(); - vecteur[dir_z] = e_vertex[V_AVAL]->getZ() - e_vertex[V_AMONT]->getZ(); - - return vecteur; -} END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexEdgeShape.cxx b/src/HEXABLOCK/HexEdgeShape.cxx index 3a5b86d..bd34bb7 100755 --- a/src/HEXABLOCK/HexEdgeShape.cxx +++ b/src/HEXABLOCK/HexEdgeShape.cxx @@ -17,15 +17,13 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // - //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 #include "HexEdgeShape.hxx" -#ifndef NO_CASCADE - #include #include #include @@ -179,18 +177,18 @@ double EdgeShape::getParam (double* coord) // ====================================================== getAssociation Edge* EdgeShape::getAssociation (int nro) { - if (nro>0 && nro0 && nro<(int)tab_assoc.size()) return tab_assoc[nro]; else return NULL; } -// ========================================================== addAssociation +// ==================================================== addAssociation void EdgeShape::addAssociation (Edge* edge) { tab_assoc.push_back (edge); is_associated = true; } -// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // ====================================================== updateCurve void EdgeShape::updateCurve () { @@ -220,4 +218,3 @@ void EdgeShape::updateCurve () getPoint (1, lin_end); } END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexEdgeShape.hxx b/src/HEXABLOCK/HexEdgeShape.hxx index 5918355..7face9f 100644 --- a/src/HEXABLOCK/HexEdgeShape.hxx +++ b/src/HEXABLOCK/HexEdgeShape.hxx @@ -1,25 +1,6 @@ // class : Gestion des Sous-shapes categorie Edge -// Copyright (C) 2009-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 -// - #ifndef __LIBE_SHAPE_H_ #define __LIBE_SHAPE_H_ @@ -31,6 +12,7 @@ class EdgeShape : public SubShape { public : EdgeShape (NewShape* dad, int id); + virtual ~EdgeShape () {} void addAssociation (Edge* elt); int countAssociation () { return tab_assoc.size(); } diff --git a/src/HEXABLOCK/HexElements.cxx b/src/HEXABLOCK/HexElements.cxx index 3447987..3489152 100755 --- a/src/HEXABLOCK/HexElements.cxx +++ b/src/HEXABLOCK/HexElements.cxx @@ -54,6 +54,9 @@ Elements::Elements (Document* doc) : EltBase (doc, EL_GRID) cyl_dispo = CYL_NOFILL; revo_lution = false; prism_vec = false; + val_absolues = false; // Version Hexa6 + cyl_phimax = M_PI/2; + under_v6 = true; } // ====================================================== Constructeur Elements::Elements (Document* doc, int nx, int ny, int nz) @@ -74,6 +77,8 @@ Elements::Elements (Document* doc, int nx, int ny, int nz) resize (GR_CYLINDRIC, nx, ny, nz); cyl_closed = true; + grid_geom = NULL; + cyl_phimax = M_PI/2; } // ====================================================== Constructeur (clonage) Elements::Elements (Elements* orig) : EltBase (orig->el_root) @@ -93,6 +98,7 @@ Elements::Elements (Elements* orig) : EltBase (orig->el_root) resize (orig->grid_type, orig->size_hx, orig->size_hy, orig->size_hz); cyl_closed = orig->cyl_closed; + cyl_phimax = orig->cyl_phimax; } // ====================================================== resize void Elements::resize (EnumGrid type, int nx, int ny, int nz, int nplus) @@ -178,180 +184,24 @@ void Elements::resize (EnumGrid type, int nx, int ny, int nz, int nplus) break; } - tab_hexa .resize (nbr_hexas); - tab_quad .resize (nbr_quads); - tab_edge .resize (nbr_edges); - tab_vertex.resize (nbr_vertex); + tab_hexa .resize (nbr_hexas, NULL); + tab_quad .resize (nbr_quads, NULL); + tab_edge .resize (nbr_edges, NULL); + tab_vertex.resize (nbr_vertex, NULL); ker_vertex = nbr_vertex; - - for (int nc=0 ; nc< nbr_hexas ; nc++) tab_hexa [nc] = NULL; - for (int nc=0 ; nc< nbr_quads ; nc++) tab_quad [nc] = NULL; - for (int nc=0 ; nc< nbr_edges ; nc++) tab_edge [nc] = NULL; - for (int nc=0 ; nc< nbr_vertex ; nc++) tab_vertex [nc] = NULL; } - -// ====================================================== makeCartesianGrid -int Elements::makeCartesianGrid (Vertex* orig, Vector* v1, Vector* v2, - Vector* v3, int px, int py, int pz, int mx, int my, int mz) +// ====================================================== saveVtk +int Elements::saveVtk (cpchar nomfic) { - if (BadElement (orig) || BadElement(v1) || BadElement(v2) || BadElement(v3) - || px<=0 || py<=0 || pz <= 0 - || v1->getNorm () <= Epsil || v2->getNorm () <= Epsil - || v3->getNorm () <= Epsil) - { - setError (); - return HERR; - } - - resize (GR_CARTESIAN, px+mx, py+my, pz+mz); + DumpStart ("saveVtk", nomfic); - makeCartesianNodes (orig, v1, v2, v3, px, py, pz, mx, my, mz); - - fillGrid (); - return HOK; -} -// ====================================================== makeCylindricalGrid -int Elements::makeCylindricalGrid (Vertex* c, Vector* b, Vector* h, - double dr, double da, double dl, int nr, int na, int nl, bool fill) -{ - if (BadElement (c) || BadElement(b) || BadElement(h) - || nr<=0 || na<=0 || nl <= 0 || dr < Epsil || da < Epsil || dl < Epsil - || b->getNorm () <= Epsil || h->getNorm () <= Epsil) - { - setError (); - return HERR; - } - resize (GR_CYLINDRIC, nr, na, nl); - cyl_closed = da >= 360.0; - makeCylindricalNodes (c, b, h, dr, da, dl, nr, na, nl, fill); - fillGrid (); - assoCylinder (c, h, da); - return HOK; -} -// ====================================================== makeSphericalGrid -int Elements::makeSphericalGrid (Vertex* c, Vector* dv, int nb, double k) -{ - if (BadElement (c) || BadElement(dv) - || nb<=0 || k < Epsil - || dv->getDx()<=Epsil || dv->getDy()<=Epsil || dv->getDz()<=Epsil) + pfile vtk = fopen (nomfic, "w"); + if (vtk==NULL) { - setError (); + DumpReturn (HERR); return HERR; } - - resize (GR_SPHERIC, nb); - - Vertex* i_node [HV_MAXI]; // Les noeuds de l'hexa englobant - Edge* i_edge [HE_MAXI]; // Les noeuds de l'hexa englobant - Quad* i_quad [HQ_MAXI]; // Les noeuds de l'hexa englobant - - for (int nro=0 ; nroCoordVertex (nro, dir_x) * dv->getDx(); - double dy = glob->CoordVertex (nro, dir_y) * dv->getDy(); - double dz = glob->CoordVertex (nro, dir_z) * dv->getDz(); - - i_node [nro] = el_root->addVertex (c->getX ()+dx, c->getY ()+dy, - c->getZ ()+dz); - } - - for (int nro=0 ; nroEdgeVertex (nro, V_AMONT); - int v2 = glob->EdgeVertex (nro, V_AVAL); - i_edge[nro] = newEdge (i_node[v1], i_node[v2]); - - if (db) - { - char nm0[8], nm1 [8], nm2 [8]; - printf (" %2d : %s = %s = [%s, %s] = [%d,%d] = [%s,%s]\n", nro, - glob->namofHexaEdge(nro), i_edge[nro]->getName(nm0), - glob->namofHexaVertex(v1), glob->namofHexaVertex(v2), v1, v2, - i_node[v1]->getName(nm1), i_node[v2]->getName(nm2)); - } - } - - for (int nro=0 ; nroQuadEdge (nro, E_A)], - i_edge[glob->QuadEdge (nro, E_B)], - i_edge[glob->QuadEdge (nro, E_C)], - i_edge[glob->QuadEdge (nro, E_D)]); - - tab_hexa.push_back (newHexa (i_quad[Q_A], i_quad[Q_B], i_quad[Q_C], - i_quad[Q_D], i_quad[Q_E], i_quad[Q_F])); - double lambda = 1; - double dcell = 1; - for (int niv=0; nivgetX (); - double py0 = center->getY (); - double pz0 = center->getZ (); - e_node[nv] = el_root->addVertex (px0+lambda*(i_node[nv]->getX()-px0), - py0+lambda*(i_node[nv]->getY()-py0), - pz0+lambda*(i_node[nv]->getZ()-pz0)); - - d_edge[nv] = newEdge (i_node[nv], e_node[nv]); - } - // Les aretes exterieures - // + les faces diagonales - for (int nro=0 ; nroEdgeVertex (nro, V_AMONT); - int nv1 = glob->EdgeVertex (nro, V_AVAL ); - e_edge[nro] = newEdge (e_node [nv0], e_node [nv1]); - d_quad[nro] = newQuad (i_edge [nro], d_edge [nv0], - e_edge [nro], d_edge [nv1]); - } - // Les faces exterieures - // + les hexas - Hexa* strate = NULL; - for (int nro=0 ; nroQuadEdge (nro, E_A); - int ne1 = glob->QuadEdge (nro, E_B); - int ne2 = glob->QuadEdge (nro, E_C); - int ne3 = glob->QuadEdge (nro, E_D); - - e_quad[nro] = newQuad (e_edge[ne0], e_edge[ne1], - e_edge[ne2], e_edge[ne3]); - strate = newHexa (i_quad[nro], e_quad[nro], d_quad[ne0], - d_quad[ne2], d_quad[ne1], d_quad[ne3]); - tab_hexa.push_back (strate); - } - - for (int nv=0 ; nvisHere()) cell->razNodes (); } + for (int nro=0 ; nroisHere()) + cell->razNodes (); + } + int nbnodes = 0; int nbcells = 0; @@ -373,7 +230,16 @@ int Elements::saveVtk (cpchar nomfic) } } - pfile vtk = fopen (nomfic, "w"); + for (int nro=0 ; nroisHere()) + { + nbcells ++; + nbnodes += cell->countNodes (); + } + } + fprintf (vtk, "# vtk DataFile Version 3.1\n"); fprintf (vtk, "%s \n", nomfic); fprintf (vtk, "ASCII\n"); @@ -385,6 +251,12 @@ int Elements::saveVtk (cpchar nomfic) for (int nro=0 ; nroisHere()) + cell->printNodes (vtk, nronode); + } + for (int nro=0 ; nroisHere()) cell->printNodes (vtk, nronode); } @@ -398,12 +270,19 @@ int Elements::saveVtk (cpchar nomfic) if (cell!=NULL && cell->isHere()) cell->printHexa (vtk); } + for (int nro=0 ; nroisHere()) + cell->printHexa (vtk); + } fprintf (vtk, "CELL_TYPES %d\n", nbcells); for (int nro=0 ; nromarkAll (IS_NONE); - db = on_debug(); - // db = el_root->debug (); - - gr_hauteur = nb; - nbr_orig = orig.size(); - - for (int nro=0 ; nrogetNbrParents()>1) - { - printf ("\n"); - printf (" *** joinQuads : donnees incorrectes\n"); - printf (" *** le %deme quadrangle de depart n'est pas une " - "face externe\n", nro); - face->dump (); - setError (); - return HERR; - } - orig [nro]->setMark (nro); - tab_orig.push_back (orig[nro]); - } - - Edge* e_orig = tab_orig[0] -> findEdge (v1, v3); - Edge* e_dest = cible -> findEdge (v2, v4); - - if (e_orig==NULL) - { - printf ("\n"); - printf (" *** joinQuads : donnees incorrectes\n"); - printf (" *** Les vertex v1 et v3 passes en argument ne definissent\n"); - printf (" *** pas une arete du 1er quadrangle de depart\n"); - printf ("\n"); - HexDump (v1); - HexDump (v3); - HexDump (orig[0]); - } - - if (e_dest==NULL) - { - printf ("\n"); - printf (" *** joinQuads : donnees incorrectes\n"); - printf (" *** Les vertex v2 et v4 passes en argument ne definissent\n"); - printf (" *** pas une arete du quadrangle cible\n"); - printf ("\n"); - HexDump (v2); - HexDump (v4); - HexDump (cible); - } - - if (e_orig==NULL || e_dest==NULL) - { - setError (); - return HERR; - } - - StrOrient orient (v1, v3, v2, v4); - int ier = this ->coupler (0, cible, &orient); - if (ier!=HOK) - { - setError (); - return HERR; - } - ier = orig[0]->coupler (cible, &orient, this); - return ier; -} // ======================================================== coupler int Elements::coupler (int nquad, Quad* dest, StrOrient* orient) { @@ -564,22 +362,22 @@ int Elements::coupler (int nquad, Quad* dest, StrOrient* orient) double py0 = nd1->getY(); double pz0 = nd1->getZ(); - double dx = (nd2->getX() - nd1->getX()) / gr_hauteur; - double dy = (nd2->getY() - nd1->getY()) / gr_hauteur; - double dz = (nd2->getZ() - nd1->getZ()) / gr_hauteur; + double dxt = nd2->getX() - px0; + double dyt = nd2->getY() - py0; + double dzt = nd2->getZ() - pz0; nd1->setMark (indVertex (nquad, ns, 0)); Vertex* nd = nd1; for (int nh=0 ; nhaddVertex (px0 + nh1*dx, py0 + nh1*dy, - pz0 + nh1*dz); + nd = el_root->addVertex (px0 + coeff*dxt, py0 + coeff*dyt, + pz0 + coeff*dzt); int nv = indVertex (nquad, ns, nh); tab_vertex [nv] = nd; tab_edge [nv] = el_root->addEdge (ndp, nd); @@ -677,33 +475,6 @@ int Elements::coupler (int nquad, Quad* dest, StrOrient* orient) } return HOK; } -// ====================================================== makeCartesianNodes -int Elements::makeCartesianNodes (Vertex* orig, Vector* v1, Vector* v2, - Vector* v3, int px, int py, int pz, int mx, int my, int mz) -{ - double dx = v1->getDx() + v2->getDx() + v3->getDx(); - double dy = v1->getDy() + v2->getDy() + v3->getDy(); - double dz = v1->getDz() + v2->getDz() + v3->getDz(); - - double px0 = orig->getX () - mx * dx; - double py0 = orig->getY () - my * dy; - double pz0 = orig->getZ () - mz * dz; - - int nbre= 0; - - for (int nz=0 ; nzaddVertex (px0 + nx*dx, py0 + ny*dy, - pz0 + nz*dz); - setVertex (node, nx, ny, nz); - nbre++; - } - return HOK; -} // ====================================================== makeCylindricalNodes int Elements::makeCylindricalNodes (Vertex* orig, Vector* base, Vector* haut, double dr, double da, double dl, int nr, int na, int nl, bool fill) @@ -715,61 +486,6 @@ int Elements::makeCylindricalNodes (Vertex* orig, Vector* base, Vector* haut, transfoVertices (orig, base, haut); return HOK; } -// ====================================================== transfoVertices -void Elements::transfoVertices (Vertex* orig, Vector* base, Vector* haut) -{ - Vector* iprim = new Vector (base); - Vector* jprim = new Vector (base); - Vector* kprim = new Vector (haut); - - int ier = kprim->renormer (); - if (ier!=HOK) - return; - - jprim->vectoriel (kprim, base); - ier = jprim->renormer (); - if (ier!=HOK) - return; - - iprim->vectoriel (jprim, kprim); - transfoVertices (orig, iprim, jprim, kprim); -} -// ====================================================== transfoVertices -void Elements::transfoVertices (Vertex* orig, Vector* iprim, Vector* jprim, - Vector* kprim) -{ - double matrice[DIM3][DIM3]={{iprim->getDx(),jprim->getDx(),kprim->getDx()}, - {iprim->getDy(),jprim->getDy(),kprim->getDy()}, - {iprim->getDz(),jprim->getDz(),kprim->getDz()}}; - - double matkx = orig->getX(); - double matky = orig->getY(); - double matkz = orig->getZ(); - - int nbre = tab_vertex.size (); - for (int nro=0 ; nrosetMark (NO_USED); - } - - for (int nro=0 ; nrogetMark() == NO_USED) - { - double point [DIM3] = {node->getX(), node->getY(), node->getZ()}; - double result[DIM3] = {matkx, matky, matkz}; - - for (int ni=0 ; nisetCoord (result[dir_x], result[dir_y], result[dir_z]); - node->setMark (IS_USED); - } - } -} // ====================================================== transform int Elements::transform (Matrix* matrice) { @@ -875,32 +591,32 @@ int Elements::cutHexas (const Edges& t_edges, int nbcuts) nbr_hexas = nbcells*(nbcuts+1); // ------------------- Les noeuds et les aretes verticales - tab_quad.resize (nbr_quads); - tab_edge.resize (nbr_edges); - tab_hexa.resize (nbr_hexas); - tab_vertex.resize (nbr_vertex); + tab_quad.resize (nbr_quads, NULL); + tab_edge.resize (nbr_edges, NULL); + tab_hexa.resize (nbr_hexas, NULL); + tab_vertex.resize (nbr_vertex, NULL); vector tab_pilier (nbpiliers); int nbinter = nbcuts + 1; for (int ned=0; ned getAssociations (); Edges ass_edges; t_edges [ned]->remove (); Vertex* ndamont = v_amont [ned]; Vertex* ndaval = v_aval [ned]; - double dx = (ndaval->getX() - ndamont->getX()) / nbinter; - double dy = (ndaval->getY() - ndamont->getY()) / nbinter; - double dz = (ndaval->getZ() - ndamont->getZ()) / nbinter; + double lgx = ndaval->getX() - ndamont->getX(); + double lgy = ndaval->getY() - ndamont->getY(); + double lgz = ndaval->getZ() - ndamont->getZ(); Vertex* nd0 = tab_vertex [ned] = ndamont; for (int nc=0; ncaddVertex (ndamont->getX() + nc1*dx, - ndamont->getY() + nc1*dy, - ndamont->getZ() + nc1*dz); + double coeff = under_v6 ? ((double)(nc+1))/nbinter : cum_values[nc]; + Vertex* nd1 = el_root->addVertex (ndamont->getX() + coeff*lgx, + ndamont->getY() + coeff*lgy, + ndamont->getZ() + coeff*lgz); tab_vertex [nc1*nbnodes + ned] = nd1; tab_pilier [nc *nbnodes + ned] = newEdge (nd0, nd1); ass_edges.push_back (tab_pilier [nc *nbnodes + ned]); @@ -910,7 +626,8 @@ int Elements::cutHexas (const Edges& t_edges, int nbcuts) tab_pilier [nbcuts *nbnodes + ned] = newEdge (nd0, ndaval); ass_edges.push_back (tab_pilier[nbcuts *nbnodes + ned]); ndamont->setMark (ned); - cutAssociation (ass_shapes, ass_edges); + if (t_edges[ned]->isAssociated()) + cutAssociation (t_edges[ned], ass_edges); } // ------------------- Les aretes horizontales // ------------------- Les faces verticales diff --git a/src/HEXABLOCK/HexElements.hxx b/src/HEXABLOCK/HexElements.hxx index 31f0142..fb3a54c 100755 --- a/src/HEXABLOCK/HexElements.hxx +++ b/src/HEXABLOCK/HexElements.hxx @@ -24,9 +24,10 @@ #define __ELEMENTS_H #include "HexEltBase.hxx" -#include "HexHexa.hxx" #include "HexMatrix.hxx" +#include + BEGIN_NAMESPACE_HEXA class Elements : public EltBase @@ -37,39 +38,43 @@ public: virtual Edge* getEdge (int nro); virtual Vertex* getVertex (int nro); + Hexa* getHexaIJK (int nx, int ny, int nz); + Quad* getQuadIJ (int nx, int ny, int nz); + Quad* getQuadJK (int nx, int ny, int nz); + Quad* getQuadIK (int nx, int ny, int nz); + Edge* getEdgeI (int nx, int ny, int nz); + Edge* getEdgeJ (int nx, int ny, int nz); + Edge* getEdgeK (int nx, int ny, int nz); + Vertex* getVertexIJK (int nx, int ny, int nz); + virtual int countHexa () { return nbr_hexas ; } virtual int countQuad () { return nbr_quads ; } virtual int countEdge () { return nbr_edges ; } virtual int countVertex () { return nbr_vertex ; } + Vertex* nearestVertex (Vertex* other); + + int findVertex (Vertex* elt); + virtual void clearAssociation (); + int saveVtk (cpchar nomfic); + Elements (Document* doc); + +#ifndef SWIG +public: int findHexa (Hexa* elt); int findQuad (Quad* elt); int findEdge (Edge* elt); - int findVertex (Vertex* elt); int findVertex (double vx, double vy, double vz); - -public: - Elements (Document* doc); Elements (Document* doc, int nx, int ny, int nz); Elements (Elements* orig); virtual ~Elements () {} virtual void remove (); - virtual void clearAssociation (); Hexa* getStrate (int couche, EnumHQuad face); - Hexa* getHexaIJK (int nx, int ny, int nz); - Quad* getQuadIJ (int nx, int ny, int nz); - Quad* getQuadJK (int nx, int ny, int nz); - Quad* getQuadIK (int nx, int ny, int nz); - Edge* getEdgeI (int nx, int ny, int nz); - Edge* getEdgeJ (int nx, int ny, int nz); - Edge* getEdgeK (int nx, int ny, int nz); - Vertex* getVertexIJK (int nx, int ny, int nz); - int getHexas (Hexas& liste); void addHexa (Hexa* element); @@ -78,7 +83,6 @@ public: void addVertex (Vertex* element); int transform (Matrix* matrice); - int saveVtk (cpchar nomfic); int saveVtk (cpchar nomfic, int& nro); int makeCartesianGrid (Vertex* orig, Vector* v1, Vector* v2, Vector* v3, @@ -91,7 +95,7 @@ public: double dr, double da, double dl, int nr, int na, int nl, bool fill); int makeSphericalGrid (Vertex* v, Vector* dv, int nb, double k=1); // perime - int makeSphericalGrid (Vertex* v, double rayon, int nb, double k=1); + int makeSphericalGrid (Vertex* v, double rayon, int nb, double k=1); // perime int joinQuads (Quads& q0, int nb, Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4, Quad* dest); @@ -104,6 +108,8 @@ public: void setVertex (Vertex* node, int nx, int ny, int nz); + void transfoVertices (double* orig, double* base, double* haut); + // DELETE les 2 suivants void transfoVertices (Vertex* orig, Vector* vi, Vector* vj, Vector* vk); void transfoVertices (Vertex* orig, Vector* base, Vector* haut); @@ -170,26 +176,83 @@ public: void moveDisco (Hexa* hexa); + + // Hexa v6 + int makeCartesian (Vertex* origine, double* vx, double* vy, double* vz, + RealVector& lx, RealVector& ly, RealVector& lz); + int makeCylinder (Vertex* origine, double* vx, double* vz, + RealVector& rayon, RealVector& angle, RealVector& hauteur, + bool fill); + int makeSpherical (double* centre, double* vx, double* vz, RealVector& ray, + int critere); + int makeRind (EnumGrid type, double* centre, double* vx, double* vz, + RealVector& rayon, RealVector& angle, RealVector& hauteur); + + int extrudeQuads (Quads& quads, double* axe, RealVector& val, + bool revol=false, Vertex* center=NULL); + + int joinQuads (Quads& quadsa, Quad* quadb, Vertex* va1, Vertex* vb1, + Vertex* va2, Vertex* vb2, RealVector& longueur); + + int cutEdge (Edge* edge, RealVector& longueur); + + // Internal Hexa v6 + void checkSystem (int nro, Vector* vx, Vector* vy, Vector* vz, + double* ux, double* uy, double* uz); + void checkSystem (int nro, Vector* vx, Vector* vz, double* ux, double* uz); + void checkSize (int nro, int nx, int ny, int nz, bool rad=false); + void checkVector (int nro, RealVector& table, int lgmin=1, bool relative=false); + void checkPipe (int nro, double rint, double rext, double ang, double hot); + void checkOrig (int nro, Vertex* orig); + void checkDiams (int nro, double rint, double rext); + + int checkPhi (bool sphere, double* orig, double* norm, double rmax, + double rhole, Vertex* plan, double& phi0, double& phi1); + + int checkInter (double* pa, double* ua, double raya, double lga, + double* pb, double* ub, double rayb, double lgb, + double* center, bool& left, bool& right); + + void makeNormale (Quads& tquads, double* normale, double& larg) { } // TODO + void checkQuads (Quads& tquads); + void checkQuad (Quad* quad, int nro=0); + void checkAxis (Vector* vect, double* axe); + void checkSense (int nro, Vertex* v1, Vertex* v2, Quad* quad); + + void checkDisco (Hexas& thexas, Edges& tedges); + void checkDisco (Hexa* cell, Quad* element); + void checkDisco (Hexa* cell, Edge* element); + void checkDisco (Hexa* cell, Vertex* element); + protected : // Evols Hexa3 void cutAssociation (Shapes& tshapes, Edges& tedges, bool exist=true); + void cutAssociation (Edge* orig, Edges& tedges); void assoCylinder (Vertex* center, Vector* vz, double rayon); void assoCylinders (Vertex* center, Vector* vz, double ray, RealVector& ta); + void assoCylinders (double* orig, double* vz, double ray, RealVector& ta); + void assoRind (double* center, double* vx, int nx, NewShape* geom); - void assoSphere (Vertex* center, Edge* t_edge[], Quad* t_quad[]); + void assoSphere (double* center, Edge* t_edge[], Quad* t_quad[]); void assoCircle (double* center, Edge* ed1, Edge* ed2, NewShape* geom); void assoResiduelle (); int makeBasicCylinder (RealVector& tdr, RealVector& tda, RealVector& tdh, bool fill=false); - int propagateAssociation (Edge* orig, Edge* dest, Edge* dir1); - int prismAssociation (Edge* orig, Edge* dest, int nh, Edge* dir); + int propagateAssociation (Edge* orig, Edge* dest, Edge* dir); // Evols Hexa4 void updateMatrix (int hauteur); void endPrism (); + // Evols Hexa5 + int prismAssociation (Edge* orig, Edge* dest, int nh); + + // Evols Hexa6 + int makeRindPoint (double ray, double ang, double haut, double& px, + double& py, double& pz); + protected : @@ -221,9 +284,12 @@ protected : int makeBasicCylinder (double dr, double da, double dl, int nr, int na, int nl, bool fill); - int addStrate (Quad* i_quad[], Edge* i_edge[], Vertex* i_node[], + int addStrate (Quad* i_quad[], Edge* i_edge[], Vertex* i_node[], // DEL Vertex* center, double lambda); + int addStrate (Quad* i_quad[], Edge* i_edge[], Vertex* i_node[], + double* center, double lambda); + int indVertex (int nsommet, int nquad, int nh); int indVertex (int ref_vert, int nh); int nroEdgeH (int nvertex); @@ -233,6 +299,8 @@ protected : void copyVertex (Elements* other, int px, int py, int pz, int nx, int ny, int nz); void completerGrille (double hauteur); + NewShape* getShape (); + void closeShape (); protected : Globale* glob; @@ -260,18 +328,23 @@ protected : bool cyl_closed; // Angle = 180 degres bool cyl_fill; // Interieur rempli + bool val_absolues; // Version Hexa6 EnumCyl cyl_dispo; // Type de remplissage // Evols Hexa3 bool revo_lution; // Number 9 ... Vertex* revo_center; - Vector* revo_axis; + Real3 revo_axe; + bool under_v6; RealVector gen_values; // Angle pour la revolution + RealVector cum_values; // Valeurs cumulees Matrix gen_matrix; + Matrix cum_matrix; // Matrice angles cumules // Evols Hexa4 bool prism_vec ; Real3 prism_dir; + double prism_len; // EnumGrid grid_type; // deja la bool grid_nocart; // Grille non cartesienne : no acces aux getTrucIJK @@ -279,6 +352,7 @@ protected : double cyl_radhole, cyl_radext, cyl_radint; double cyl_dtheta; // angle = na*dtheta double cyl_phi0, cyl_dphi; // angle = phi0 + nh*dphi; + double cyl_phimax; int pat_nbedges; int pat_nbvertex; @@ -286,196 +360,10 @@ protected : std::vector ker_hexa; std::vector ker_hquad, ker_vquad; std::vector ker_hedge, ker_vedge; -}; -// =================================================== getStrate -inline Hexa* Elements::getStrate (int couche, EnumHQuad nroface) -{ - Hexa* cell = NULL; - int nro = couche <= 0 ? 0 : (couche-1)*HQ_MAXI + nroface + 1; - - if (nbr_hexas==0 || nro >= nbr_hexas) - cell = NULL; - else - cell = tab_hexa [nro]; - - return cell; -} -// ============================================================ setHexa -inline void Elements::setHexa (Hexa* elt, int nro) -{ - if (nro >=0 && nro < nbr_hexas) - tab_hexa [nro] = elt; -} -// ============================================================ setQuad -inline void Elements::setQuad (Quad* elt, int nro) -{ - if (nro >=0 && nro < nbr_quads) - tab_quad [nro] = elt; -} -// ============================================================ setEdge -inline void Elements::setEdge (Edge* elt, int nro) -{ - if (nro >=0 && nro < nbr_edges) - tab_edge [nro] = elt; -} -// ============================================================ setVertex -inline void Elements::setVertex (Vertex* elt, int nro) -{ - if (nro >=0 && nro < nbr_vertex) - tab_vertex [nro] = elt; -} -// ----------------------------------------------------------------------- -// ----------------------------------------------------------------------- -// ============================================================ getHexa -inline Hexa* Elements::getHexa (int nro) -{ - Hexa* elt = NULL; - int nombre=tab_hexa.size(); - // if (nro >=0 && nro < nbr_hexas && el_status == HOK Abu 2010/05/06 - if (nro >=0 && nro < nombre && el_status == HOK - && tab_hexa [nro] != NULL && tab_hexa [nro]->isValid()) - elt = tab_hexa [nro]; - - return elt; -} -// ============================================================ getQuad -inline Quad* Elements::getQuad (int nro) -{ - Quad* elt = NULL; - if (nro >=0 && nro < nbr_quads && el_status == HOK - && tab_quad [nro] != NULL && tab_quad [nro]->isValid()) - elt = tab_quad [nro]; - - return elt; -} -// ============================================================ getEdge -inline Edge* Elements::getEdge (int nro) -{ - Edge* elt = NULL; - if (nro >=0 && nro < nbr_edges && el_status == HOK - && tab_edge [nro] != NULL && tab_edge [nro]->isValid()) - elt = tab_edge [nro]; - - return elt; -} -// ============================================================ getVertex -inline Vertex* Elements::getVertex (int nro) -{ - Vertex* elt = NULL; - if (nro >=0 && nro < nbr_vertex && el_status == HOK - && tab_vertex [nro] != NULL && tab_vertex [nro]->isValid()) - elt = tab_vertex [nro]; - - return elt; -} -// ============================================================ indVertex -inline int Elements::indVertex (int nquad, int nsommet, int nh) -{ - int nro = nsommet + QUAD4*nquad + nbr_orig*QUAD4*(nh+1); - return nro; -} -// ============================================================ nroVertex -inline int Elements::nroVertex (int nquad, int nsommet, int nh) -{ - int nro = nsommet + QUAD4*nquad + nbr_orig*QUAD4*nh; - return nro; -} -// ============================================================ indVertex -inline int Elements::indVertex (int ref_edge, int nh) -{ - int nro = ref_edge + nbr_orig*QUAD4*nh; - return nro; -} -// ============================================================ nroEdgeH -inline int Elements::nroEdgeH (int nvertex) -{ - return QUAD4*nbr_orig*gr_hauteur + nvertex; -} -// ============================================================ nroEdgeH -inline int Elements::nroEdgeH (int nquad, int nsommet, int nh) -{ - return QUAD4*nbr_orig*gr_hauteur + indVertex (nquad, nsommet, nh); -} -// ============================================================ nroHexa -inline int Elements::nroHexa (int nquad, int nh) -{ - int nro = gr_hauteur*nquad + nh; - return nro; -} - -// ============================================================ addHexa -inline void Elements::addHexa (Hexa* element) -{ - tab_hexa.push_back (element); - nbr_hexas ++; -} -// ============================================================ addQuad -inline void Elements::addQuad (Quad* element) -{ - tab_quad.push_back (element); - nbr_quads ++; -} -// ============================================================ addEdge -inline void Elements::addEdge (Edge* element) -{ - tab_edge.push_back (element); - nbr_edges ++; -} -// ============================================================ addVertex -inline void Elements::addVertex (Vertex* element) -{ - tab_vertex.push_back (element); - nbr_vertex ++; -} -// ============================================================ findHexa -inline int Elements::findHexa (Hexa* element) -{ - int nbre = tab_hexa.size(); - for (int nro=0 ; nro map_shape; +#endif +}; END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexElements_asso.cxx b/src/HEXABLOCK/HexElements_asso.cxx index aa6b608..4b943ce 100755 --- a/src/HEXABLOCK/HexElements_asso.cxx +++ b/src/HEXABLOCK/HexElements_asso.cxx @@ -1,5 +1,5 @@ // -// CC++ : Interface Cascade de la classe Elements +// CC++ : Ancienne interface Cascade de la classe Elements ** A SUPPRIMER ** // // Copyright (C) 2009-2013 CEA/DEN, EDF R&D // @@ -23,11 +23,11 @@ #include "HexElements.hxx" #include "HexEdge.hxx" #include "HexDocument.hxx" +#include "HexEdgeShape.hxx" +#include "HexAssoEdge.hxx" +#include "HexVertex.hxx" -#include "HexKasBiCylinder.hxx" -#include "HexKasPoint.hxx" -#include "HexKasLine.hxx" - +/***************************************** #include #include #include @@ -46,359 +46,120 @@ #include #include #include - -// HEXABLOCK includes -#include "HexVertex.hxx" -#include "HexOldShape.hxx" -#include "HexDiagnostics.hxx" // Cercles #include #include - -#include -#include - #include #include - #include - // Sphere -#include - // Cylindre -#include -#include -#include -#include -BEGIN_NAMESPACE_HEXA - -static bool db = false; +#include +#include +***************************************************/ -void clear_associations (Edge* edge); +BEGIN_NAMESPACE_HEXA // --------------------------------------------------------------------- - -static KasLine current_line; -static Shape current_shape (""); - +bool requals (const double pnt1[], const double pnt2[]); // ========================================================= cutAssociation -void Elements::cutAssociation (Shapes& tshapes, Edges& tedges, bool exist) +void Elements::cutAssociation (Edge* orig, Edges& tedges) { - db = on_debug (); - char foo[18]; - int nbedges = tedges.size(); - int nbshapes = tshapes.size (); - if (nbshapes==0) - return; - - std::vector tab_gline (nbshapes); + int nbedges = tedges.size(); + int nbassos = orig->countAssociation(); - Vertex* prems = tedges [0] -> getVertex (V_AMONT); - Vertex* derns = tedges [nbedges-1] -> getVertex (V_AVAL); - - KasPoint pnt_first, pnt_last; - pnt_first.definePoint (prems); - pnt_last .definePoint (derns); - - if (exist) - { - if (pnt_first.isBad()) - { - el_root->putError (W_ASSO_CUT1, prems->getName (foo)); - return; - } - else if (pnt_last.isBad ()) - { - el_root->putError (W_ASSO_CUT2, derns->getName (foo)); - return; - } - } - // ----------- Define + longueur totale - double longueur = 0; - for (int ns = 0 ; nsgetAssociation (ns); + lgpara += fabs (asso->getEnd () - asso->getStart ()); } - // ----------- Ordonnancement des shapes - double abscisse = 0; - int nslast = 0; - double* coord = pnt_first.getCoord (); - if (nbshapes==1) - { - tab_gline [0].setRank (0, 0, abscisse); - } - else - { + double delta = lgpara / nbedges; + int nasso = 0; + AssoEdge* asso = orig->getAssociation (nasso); + EdgeShape* shape = asso->getEdgeShape (); + double param1 = asso->getStart (); + double parmax = asso->getEnd (); - for (int rg = 0 ; rg0) { - bool more = true; - for (int ns = 0 ; nsputError (W_ASSO_CUT3, derns->getName (foo)); + Real3 point; + Vertex* node = edge->getVertex (V_AMONT); + shape->getPoint (param1, point); + node->setAssociation (point); + } + if (param2 <= parmax) + edge->addAssociation (shape, param1, param2); + else + { + edge->addAssociation (shape, param1, parmax); + nasso ++; + if (nasso >= nbassos) return; - } + asso = orig->getAssociation (nasso); + shape = asso->getEdgeShape (); + param2 = param2 - 1; + parmax = asso->getEnd (); + edge->addAssociation (shape, 0, param2); } - } - // ----------- Dernier - if (exist) - { - coord = pnt_last.getCoord (); - int pos = tab_gline[nslast].findBound (coord); - if (pos != V_AVAL) - { - el_root->putError (W_ASSO_CUT4, derns->getName (foo)); - return; - } - } - // ----------- Associations - double delta = longueur / nbedges; - for (int ned = 0 ; nedgetAssociation() == NULL) - current_line.assoPoint (angle, node); -} -// ====================================================== geom_asso_point -void geom_asso_point (Vertex* node) -{ - if (node==NULL || node->getAssociation() != NULL) - return; - - Real3 koord = { node->getX(), node->getY(), node->getZ() }; - KasPoint asso_point ; - asso_point.definePoint (koord); - asso_point.associate (node); -} -// ====================================================== geom_create_circle -void geom_create_circle (double* milieu, double rayon, double* normale, - double* base, string& brep) -{ - db = on_debug (); - if (db) printf ("geom_create_circle c=(%g,%g,%g), r=%g\n", - milieu[0], milieu[1], milieu[2], rayon); - if (db) printf (" -------- base=(%g,%g,%g)\n", base[0], base[1], base[2]); - if (db) printf (" -------- norm=(%g,%g,%g)\n", normale[0], normale[1], - normale[2]); - - gp_Pnt gp_center (milieu [dir_x], milieu [dir_y], milieu [dir_z]); - gp_Vec gp_vx (base [dir_x], base [dir_y], base [dir_z]); - gp_Vec gp_norm (normale[dir_x], normale[dir_y], normale[dir_z]); - - gp_Ax2 gp_axes (gp_center, gp_norm, gp_vx); - gp_Circ gp_circ (gp_axes, rayon); - - TopoDS_Edge geom_circ = BRepBuilderAPI_MakeEdge(gp_circ).Edge(); - ostringstream stream_shape; - BRepTools::Write(geom_circ, stream_shape); - brep = stream_shape.str(); - - // geom_make_brep (geom_circ, brep); - if (NOT db) - return; - // Impressions de mise au point - double umin = 0, umax = 0; - TopLoc_Location loc; - Handle(Geom_Curve) handle = BRep_Tool::Curve (geom_circ, loc, umin, umax); - GeomAdaptor_Curve AdaptCurve (handle); - double length = GCPnts_AbscissaPoint::Length(AdaptCurve, umin, umax); - - BRepAdaptor_Curve geom_curve (geom_circ); - - for (int pk=0; pk<=4; pk++) - { - GCPnts_AbscissaPoint s1 (geom_curve, pk*length/4, - geom_curve.FirstParameter()); - double u1 = s1.Parameter (); - gp_Pnt point = geom_curve.Value (u1); - if (db) - printf ( " ..... pnt%d = (%g, %g, %g)\n", pk, point.X(), - point.Y(), point.Z()); + param1 = param2; } } -// ====================================================== geom_create_sphere -void geom_create_sphere (double* milieu, double radius, string& brep) -{ - gp_Pnt gp_center (milieu [dir_x], milieu [dir_y], milieu [dir_z]); - gp_Ax2 gp_axis = gp_Ax2 (gp_center, gp_Dir(0,0,1), gp_Dir(1,0,0)); - - BRepPrimAPI_MakeSphere make_sphere (gp_axis, radius); - - make_sphere.Build(); - - ostringstream stream_shape; - TopoDS_Shape geom_sphere = make_sphere.Face(); - BRepTools::Write (geom_sphere, stream_shape); - brep = stream_shape.str(); -} // ====================================================== geom_dump_asso void geom_dump_asso (Edge* edge) { - printf (" %s dump_edge :\n", - "_______________________________________________________________"); + cout << endl; + cout << " _______________________________________________________ " + << " dump_edge :" << endl; + if (edge==NULL || NOT edge->isHere ()) { - printf ("*** deleted ***)\n"); + cout << "*** deleted ***" << endl; return; } - bool db0 = db; - db = false; - edge->printName(" = ("); - edge->getVertex (V_AMONT)-> printName (", "); - edge->getVertex (V_AVAL) -> printName (")\n"); + cout << endl; + cout << " ... Edge = " << edge->getName () + << " = (" << edge->getVertex(V_AMONT)->getName() + << ", " << edge->getVertex(V_AVAL )->getName() << ")" << endl; - KasPoint asso_point; for (int nro=0 ; nrogetVertex (nro); - vertex->printName (""); - printf (" = (%g, %g, %g)", vertex->getX(), vertex->getY(), - vertex->getZ()); - - int ier = asso_point.definePoint (vertex); - if (ier==HOK) - { - double* coord = asso_point.getCoord(); - printf (", pnt_asso = (%g, %g, %g)", coord[dir_x], coord[dir_y], - coord[dir_z]); - } - printf ("\n"); - } - - KasLine asso_line; - const Shapes& tshapes = edge->getAssociations (); - for (int nro=0 ; nrogetVertex (nro); + cout << " ... " << node->getName() + << " = (" << node->getX() + << ", " << node->getY() + << ", " << node->getZ() << ")"; + + if (node->isAssociated()) + cout << " --> (" << node->getAssoX() + << ", " << node->getAssoY() + << ", " << node->getAssoZ() << ")"; else - { - asso_line.defineLine (shape); - double* deb = asso_line.getStart (); - double* fin = asso_line.getEnd (); - double lg = asso_line.getLength (); - printf (" Longueur = %g\n", lg); - printf (" Debut = %g = (%g, %g, %g)\n", shape->getStart(), - deb[0], deb[1], deb[2]); - printf (" Fin = %g = (%g, %g, %g)\n", shape->getEnd(), - fin[0], fin[1], fin[2]); - } + cout << " (not associated)"; + cout << endl; } - db = db0; -} -// ====================================================== translate_brep -void translate_brep (string& brep, double dir[], string& trep) -{ - gp_Trsf transfo; - BRep_Builder builder; - TopoDS_Shape orig; - - gp_Vec vecteur (dir [dir_x], dir [dir_y], dir [dir_z]); - transfo.SetTranslation (vecteur); - istringstream stream_brep (brep); - BRepTools::Read (orig, stream_brep, builder); - - TopLoc_Location loc_orig = orig.Location(); - gp_Trsf trans_orig = loc_orig.Transformation(); - TopLoc_Location loc_result (transfo * trans_orig); - TopoDS_Shape result = orig.Located (loc_result); - - ostringstream stream_shape; - BRepTools::Write (result, stream_shape); - trep = stream_shape.str(); -} -// ====================================================== transfo_brep -void transfo_brep (string& brep, Matrix* matrice, string& trep) -{ - BRep_Builder builder; - TopoDS_Shape shape_orig; - gp_Trsf transfo; - - double a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34; - matrice->getCoeff (a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34); - transfo.SetValues (a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34, - Epsil2, Epsil2); - istringstream stream_brep (brep); - BRepTools::Read (shape_orig, stream_brep, builder); + int nbr_associations = edge->countAssociation (); + PutData (nbr_associations); - BRepBuilderAPI_Transform brep_transfo (shape_orig, transfo, Standard_True); - TopoDS_Shape result = brep_transfo.Shape(); - - ostringstream stream_shape; - BRepTools::Write (result, stream_shape); - trep = stream_shape.str(); -} -// ====================================================== clear_associations -void clear_associations (Edge* edge) -{ - edge->clearAssociation(); - edge->getVertex(V_AMONT)->clearAssociation(); - edge->getVertex(V_AVAL )->clearAssociation(); -} -// ====================================================== set_debug_asso -void set_debug_asso (bool boule) -{ - db = boule; - if (db) - printf (" ... Traces actives dans HexAssoElements_asso.cxx\n"); -} -// ====================================================== clean_brep -void clean_brep (string& brep) -{ - TopoDS_Shape shape; - BRep_Builder builder; - istringstream stream_brep (brep); - - BRepTools::Read (shape, stream_brep, builder); - BRepTools::Clean (shape); - - ostringstream stream_shape; - BRepTools::Write (shape, stream_shape); - brep = stream_shape.str(); + for (int nro=0 ; nrogetAssociation (nro); + cout << " *** Association nro " << nro+1 << endl; + const double* shape_origin = asso->getOrigin(); + const double* shape_extrem = asso->getExtrem(); + PutData (asso->getStart()); + PutData (asso->getEnd()); + PutCoord (shape_origin); + PutCoord (shape_extrem); + } + cout << endl << endl; } END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexElements_bis.cxx b/src/HEXABLOCK/HexElements_bis.cxx index 4252b06..06d701b 100755 --- a/src/HEXABLOCK/HexElements_bis.cxx +++ b/src/HEXABLOCK/HexElements_bis.cxx @@ -29,17 +29,12 @@ #include "HexEdge.hxx" #include "HexGlobale.hxx" -#include "HexCylinder.hxx" -#include "HexOldShape.hxx" +#include "HexNewShape.hxx" #include BEGIN_NAMESPACE_HEXA -void geom_dump_asso (Edge* edge); -void geom_create_circle (double* milieu, double rayon, double* normale, - double* base, string& brep); - // ====================================================== getHexaIJK Hexa* Elements::getHexaIJK (int nx, int ny, int nz) { @@ -227,181 +222,23 @@ void Elements::remove () if (tab_hexa[nh] != NULL) tab_hexa[nh]->remove(); } -// ====================================================== makeCylinder -int Elements::makeCylinder (Cylinder* cyl, Vector* vx, int nr, int na, int nl) -{ - if (BadElement (cyl) || BadElement (vx) || nr<=0 || na <=3 || nl <=0 - || vx->getNorm () <= Epsil) - { - setError (); - return HERR; - } - - Vertex* orig = cyl->getBase (); - Vector* dir = cyl->getDirection (); - double ray = cyl->getRadius (); - double haut = cyl->getHeight (); - - resize (GR_CYLINDRIC, nr, na, nl); - cyl_closed = true; - makeCylindricalNodes (orig, vx, dir, ray/(nr+1), 360, haut/nl, - nr, na, nl, true); - fillGrid (); - assoCylinder (orig, dir, 360); - return HOK; -} -// ====================================================== makePipe -int Elements::makePipe (Cylinder* cyl, Vector* vx, int nr, int na, int nl) -{ - if (BadElement (cyl) || BadElement (vx) || nr<=0 || na <=3 || nl <=0 - || vx->getNorm () <= Epsil) - { - setError (); - return HERR; - } - - Vertex* orig = cyl->getBase (); - Vector* dir = cyl->getDirection (); - double ray = cyl->getRadius (); - double haut = cyl->getHeight (); - - resize (GR_CYLINDRIC, nr, na, nl); - cyl_closed = true; - makeCylindricalNodes (orig, vx, dir, ray, 360, haut, nr, na, nl, false); - fillGrid (); - assoCylinder (orig, dir, 360); - return HOK; -} -// -// ---------------------------------------- prism Quads -// -// ====================================================== prismQuads -int Elements::prismQuads (Quads& tstart, Vector* dir, int nbiter) -{ - if (BadElement (dir) || dir->getNorm () <= Epsil || nbiter <= 0) - { - setError (); - return HERR; - } - - el_root->markAll (NO_USED); - int nbcells = tstart.size (); - nbr_vertex = 0; - nbr_edges = 0; - - nbr_hexas = nbcells*nbiter; - - tab_hexa.resize (nbr_hexas); - tab_quad.clear (); // verticaux - ker_hquad.clear (); // Horizontaux - tab_edge.clear (); - tab_pilier.clear (); - tab_vertex.clear (); - - revo_lution = false; - prism_vec = false; - gen_matrix.defTranslation (dir); - - for (int nro=0 ; nrogetNorm () <= Epsil || nbiter <= 0) - { - setError (); - return HERR; - } - - el_root->markAll (NO_USED); - int nbcells = tstart.size (); - nbr_vertex = 0; - nbr_edges = 0; - - nbr_hexas = nbcells*nbiter; - - tab_hexa.resize (nbr_hexas); - tab_quad.clear (); // verticaux - ker_hquad.clear (); // Horizontaux - tab_edge.clear (); - tab_pilier.clear (); - tab_vertex.clear (); - - revo_lution = false; - prism_vec = true; - dir->getCoord (prism_dir); - normer_vecteur (prism_dir); - gen_values = tlen; - - for (int nro=0 ; nrogetNorm () <= Epsil) - { - setError (); - return HERR; - } - - el_root->markAll (NO_USED); - nbr_vertex = 0; - nbr_edges = 0; - - nbr_hexas = nbcells*nbiter; - - tab_hexa.resize (nbr_hexas); - tab_quad.clear (); // verticaux - ker_hquad.clear (); // Horizontaux - tab_edge.clear (); - tab_pilier.clear (); - tab_vertex.clear (); - - revo_lution = true; - prism_vec = false; - revo_axis = axis; - revo_center = center; - gen_values = angles; - - for (int nro=0 ; nrogetVertex (ns); + Vertex* vbase = qbase->getVertex (ns); int indx = vbase->getMark (); if (indx<0) { + bool asso = vbase->isAssociated(); + vbase->getAssoCoord (koord); + indx = nbr_vertex++; vbase->setMark (indx); Vertex* nd0 = vbase; @@ -409,33 +246,21 @@ int Elements::prismHexas (int nro, Quad* qbase, int hauteur) double beta = 0; if (revo_lution) { - Real3 centre, vk, point, om; + Real3 centre, point, om; revo_center->getPoint (centre); vbase ->getPoint (point); - revo_axis ->getCoord (vk); - normer_vecteur (vk); - calc_vecteur (centre, point, om); - double oh = prod_scalaire (om, vk); - double rayon = 0; + calc_vecteur (centre, point, om); + double oh = prod_scalaire (om, revo_axe); + double rayon = 0; Real3 ph, hm; for (int dd=dir_x; dd<=dir_z ; dd++) { - ph [dd] = centre [dd] + oh*vk[dd]; + ph [dd] = centre [dd] + oh*revo_axe[dd]; hm [dd] = point [dd] - ph[dd]; rayon += hm[dd] * hm[dd]; } - rayon = sqrt (rayon); -/******************************** - PutCoord (centre); - PutCoord (point); - PutData (oh); - PutCoord (ph); - PutData (rayon); - PutCoord (vk); - PutCoord (hm); -********************************/ - geom_create_circle (ph, rayon, vk, hm, c_rep); + subid = grid_geom->addCircle (ph, sqrt(rayon), revo_axe, hm); } for (int nh=0 ; nhsetBounds (alpha/360, beta/360); - pilier->addAssociation (shape); - // geom_dump_asso (pilier); + grid_geom->addAssociation (pilier, subid, alpha/360, beta/360); + } + if (asso) + { + cum_matrix.perform (koord, transfo); + nd1->setAssociation (transfo); } nd0 = nd1; } @@ -486,7 +313,8 @@ int Elements::prismHexas (int nro, Quad* qbase, int hauteur) Quad* mur = newQuad (ed0, ed1, ed2, ed3); tab_edge.push_back (ed0); tab_quad.push_back (mur); - prismAssociation (ed2, ed0, nh, ed1); + if (ebase->isAssociated ()) + prismAssociation (ebase, ed0, nh); } } ind_poutre [ns] = indx; @@ -516,25 +344,46 @@ int Elements::prismHexas (int nro, Quad* qbase, int hauteur) return HOK; } // ====================================================== updateMatrix -void Elements::updateMatrix (int hauteur) +void Elements::updateMatrix (int nh) { if (revo_lution) { - gen_matrix.defRotation (revo_center, revo_axis, gen_values[hauteur]); + gen_matrix.defRotation (revo_center, revo_axe, gen_values[nh]); + cum_matrix.defRotation (revo_center, revo_axe, cum_values[nh]); } - else if (prism_vec) + else { - double h0 = hauteur>0 ? gen_values[hauteur-1] : 0; - double dh = gen_values[hauteur] - h0; - Real3 decal; + double hauteur = (nh+1)*prism_len; + double dh = prism_len; + if (prism_vec) + { + if (under_v6) + { + hauteur = gen_values[nh]; + dh = nh>0 ? hauteur-gen_values[nh-1] : hauteur; + } + else + { + hauteur = cum_values[nh]; + dh = gen_values[nh]; + } + } + Real3 trans, decal; for (int nc=dir_x ; nc<=dir_z ; nc++) + { decal [nc] = prism_dir [nc]*dh; + trans [nc] = prism_dir [nc]*hauteur; + } + gen_matrix.defTranslation (decal); + cum_matrix.defTranslation (trans); } } // ====================================================== endPrism void Elements::endPrism () { + closeShape(); + int nbelts = ker_hquad.size(); for (int nro=0 ; nroaddShape (name.c_str(), SH_EXTRUD); + grid_geom -> openShape(); + } + + return grid_geom; +} +// ====================================================== closeShape +void Elements::closeShape() +{ + if (grid_geom==NULL) + return; + + grid_geom -> closeShape(); + grid_geom = NULL; +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexElements_check.cxx b/src/HEXABLOCK/HexElements_check.cxx new file mode 100644 index 0000000..4fe03ed --- /dev/null +++ b/src/HEXABLOCK/HexElements_check.cxx @@ -0,0 +1,558 @@ + +// C++ : Controle arguments + +// Copyright (C) 2009-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 + +#include "HexDocument.hxx" + +#include "HexElements.hxx" +#include "HexVector.hxx" +#include "HexHexa.hxx" +#include "HexQuad.hxx" +#include "HexEdge.hxx" +#include "HexVertex.hxx" + +#include "HexGlobale.hxx" + +BEGIN_NAMESPACE_HEXA + +double calcul_phimax (double radhole, double radext, bool sphere); + +// ======================================================== checkSystem +void Elements::checkSystem (int arg, Vector* vx, Vector* vy, Vector* vz, + double* ux, double* uy, double* uz) +{ + int jer [DIM3]; + jer[dir_x] = vx->getUnitVector (ux); + jer[dir_y] = vy->getUnitVector (uy); + jer[dir_z] = vz->getUnitVector (uz); + + bool sortie = false; + for (int dd=dir_x ; dd<=dir_z ; dd++) + if (jer[dd]!=HOK) + { + setError (HERR); + sortie = true; + Mess << "Vector number " << dd+1 << " is null" ; + } + if (sortie) + return; + + double prod = prod_mixte (ux, uy, uz); + if (prod > -Epsil && prod < Epsil) + { + setError (HERR); + Mess << "These vectors are coplanar" ; + } +} +// ======================================================== checkAxis +void Elements::checkAxis (Vector* vz, double* uz) +{ + int ier = vz->getUnitVector (uz); + if (ier != HOK) + { + setError (HERR); + Mess << " Second argument vector is null" ; + } +} +// ======================================================== checkDiams +void Elements::checkDiams (int arg, double rint, double rext) +{ + if (rint < 0.0) + { + setError (HERR); + Mess << "Argument number " << arg << " :"; + Mess << "The internal radius must be positive"; + } + if (rext < 0.0) + { + setError (HERR); + Mess << "Argument number " << arg+1 << " :"; + Mess << "The external radius must be positive"; + } + if (rext <= rint ) + { + setError (HERR); + Mess << "The internal radius (arg" << arg << " = " << rint + << ") must be smaller than the external (arg" << arg+1 + << " = " << rext << ")"; + } +} +// ======================================================== checkSystem +void Elements::checkSystem (int arg, Vector* vx, Vector* vz, + double* ux, double* uz) +{ + int ier1 = vx->getUnitVector (ux); + int ier2 = vz->getUnitVector (uz); + + if (ier1!=HOK) + { + setError (HERR); + Mess << "First vector is null" ; + return; + } + else if (ier2!=HOK) + { + setError (HERR); + Mess << "Second vector is null" ; + return; + } + + Real3 pv; + prod_vectoriel (ux, uz, pv); + double prod = calc_norme (pv); + if (prod > -Epsil && prod < Epsil) + { + setError (HERR); + Mess << "These two vectors are colinear" ; + } +} +// ======================================================== checkSize +void Elements::checkSize (int arg, int nx, int ny, int nz, bool rad) +{ + if (nx <= 0) + { + Mess << "Argument number " << arg << " :"; + Mess << "This dimension must be positive"; + setError (HERR); + } + if (nz <= 0) + { + Mess << "Argument number " << arg+2 << " :"; + Mess << "This dimension must be positive"; + setError (HERR); + } + + if (rad) + { + if (ny < 3) + { + Mess << "Argument number " << arg+1 << " :"; + Mess << "The number of sectors must be greather than 3"; + setError (HERR); + } + } + else if (nx < 1) + { + Mess << "Argument number " << arg+1 << " :"; + Mess << "This dimension must be positive"; + setError (HERR); + } +} +// ======================================================== checkVector +void Elements::checkVector (int arg, RealVector& table, int lgmin, bool relative) +{ + int nbre = table.size(); + if (nbre= 1.0)) + { + setError (HERR); + Mess << "Argument number " << arg+1 << " :"; + Mess << "This vector contains relative lengths" ; + Mess << "Values must be between 0 and 1" ; + Mess << "(value[" << nv << "] = " << val; + return; + } + + if (nv>0 && val <= table [nv-1]) + { + setError (HERR); + Mess << "Argument number " << arg+1 << " :"; + Mess << "Vector is not growing" ; + Mess << "(value[" << nv << "] = " << val + << " <= value[" << nv-1 << "] = " << table [nv-1] ; + return; + } + } +} +// ======================================================== checkPipe +void Elements::checkPipe (int arg, double rint, double rext, double angle, + double hauteur) +{ + if (rint <= Epsil) + { + setError (HERR); + Mess << "Argument number " << arg << " :"; + Mess << "Internal radius (=" << rint << ") must be greather than 0"; + } + if (rext <= Epsil) + { + setError (HERR); + Mess << "Argument number " << arg+1 << " :"; + Mess << "External radius (=" << rext << ") must be greather than 0"; + } + if (rint >= rext) + { + setError (HERR); + Mess << "Arguments number " << arg << " and " << arg+1 << " :"; + Mess << "Internal radius (" << rint + << ") must be smaller than external (=" << rext << ")"; + } + if (angle <= Epsil) + { + setError (HERR); + Mess << "Argument number " << arg+2 << " :"; + Mess << "Angle (=" << angle << ") must be greather than"; + } + if (hauteur <= Epsil) + { + setError (HERR); + Mess << "Argument number " << arg+3 << " :"; + Mess << "Height (=" << hauteur << ") must be greather than"; + } +} +// ======================================================== checkOrig +void Elements::checkOrig (int arg, Vertex* orig) +{ + if (orig==NULL || orig->isBad()) + { + setError (HERR); + Mess << "Argument number " << arg << " :"; + Mess << "Origin vertex is not valid"; + } +} +// ======================================================== checkQuads +void Elements::checkQuads (Quads& tquad) +{ + int nbre = tquad.size(); + if (nbre==0) + { + setError (HERR); + Mess << "Start quads list is empty"; + } + + for (int nro=0 ; nroisBad()) + { + setError (HERR); + if (nro>0) + Mess << "Start quad nr " << nro << " is not valid"; + else if (nro<0) + Mess << "Target quad must is not valid"; + else + Mess << "Start quad is not valid"; + return; + } + + if (quad->getNbrParents () == 2) + { + setError (HERR); + if (nro>0) + Mess << "Start quad nr " << nro << " must be an external face"; + else if (nro<0) + Mess << "Target quad must be an external face"; + else + Mess << "Start quad must be an external face"; + return; + } +} +// ======================================================== checkSense +void Elements::checkSense (int nro, Vertex* v1, Vertex* v2, Quad* quad) +{ + if (v1==NULL || v1->isBad()) + { + setError (HERR); + Mess << "Argument nr " << nro << " : vertex is not valid"; + return; + } + + if (v2==NULL || v2->isBad()) + { + setError (HERR); + Mess << "Argument nr " << nro+1 << " : vertex is not valid"; + return; + } + Edge* edge = quad -> findEdge (v1, v2); + if (edge!=NULL) + return; + + cpchar where = nro < 4 ? "start" : "target"; + setError (HERR); + Mess << "Arguments nr " << nro << " and " << nro+2 + << " : these vertices doenst define an edge of the " + << where << " quad"; +} +// ======================================================== checkPhi +int Elements::checkPhi (bool sphere, double* orig, double* norm, double rmax, + double rhole, Vertex* plan, double& phi0, double& phi1) +{ + int ier = HOK; + double beta = -M_PI/2; + + if (plan!=NULL) + { + Real3 oplan; + plan->getPoint (oplan); + + Real3 om = { oplan[0]-orig[0], oplan[1]-orig[1], oplan[2]-orig[2] }; + double hmin = prod_scalaire (norm, om); + if (hmin >= rmax) + { + ier = HERR; + setError (ier); + Mess << "Sphere is under the horizontal plan"; + } + else if (hmin > -rmax) + beta = asin (hmin/rmax); + } + + phi1 = calcul_phimax (rhole, rmax, sphere); + phi0 = std::max (-phi1, beta); + + phi1 = rad2degres (phi1); + phi0 = rad2degres (phi0); + return ier; +} +// ======================================================== checkInter +/* === Intersection de 2 cylindres (A,ua) et (B,ub) + ua et ub : vecteurs directeurs unitaires. + A a le gros diametre, B le petit + H = proj ortho de B sur (A, ua) + AH = AB . ua + (mesure algebrique de AH = produit scalaire de AB par ua + + ---------------------------------------------------------------- */ +int Elements::checkInter (double* pa, double* ua, double ra, double lga, + double* pb, double* ub, double rb, double lgb, + double* center, bool& left, bool& right) +{ + int ier = HOK; + left = right = true; + + Real3 ab, cprim; + calc_vecteur (pa, pb, ab); + double ah = prod_scalaire (ab, ua); // ah > 0 ???? : A voir avec FK + double bh = -prod_scalaire (ab, ub); + + for (int dd=dir_x ; dd<=dir_z ; dd++) + { + center [dd] = pa [dd] + ah * ua [dd]; + cprim [dd] = pb [dd] + bh * ub [dd]; + } + // Controles : + ah = fabs (ah); + bh = fabs (bh); + + double dist = calc_distance (center, cprim); + double dcmin = lga*0.05; + double lgmin = (ah - rb)*1.1; + + if (ah < ra ) + { + ier = HERR; + setError (ier); + Mess << "The base of the big cylinder is included in the smaller" ; + } + else if (lga < lgmin) + { + ier = HERR; + setError (ier); + Mess << "The big cylinder is not long enough too reach the smaller" ; + Mess << "Actual lengh = " << lga; + Mess << "Minimal length = " << lgmin; + } + else if (lgb < bh - ra) + { + ier = HERR; + setError (ier); + Mess << "The small cylinder is not long enough too reach the large" ; + Mess << "Actual lengh = " << lgb; + Mess << "Minimal length = " << bh-rb; + } + else if (dist > dcmin) + { + ier = HERR; + setError (ier); + Mess << "Cylinders axes are not secant"; + Mess << "Distance between axes = " << dist; + } + else + { + if (bh < rb) + left = false; + if (bh + rb > lgb ) + right = false; + } + + if (NOT left && NOT right) + { + ier = HERR; + setError (ier); + Mess << "The small cylinder is included in the large" ; + } + + return ier; +} +// ======================================================== checkDisco +void Elements::checkDisco (Hexa* cell, Vertex* element) +{ + if (BadElement (cell)) + { + Mess << "Hexaedron is not valid"; + setError (HERR); + return; + } + + if (BadElement (element)) + { + Mess << "Vertex is not valid"; + setError (HERR); + return; + } + + int node = cell->findVertex (element); + if (node==NOTHING) + { + setError (HERR); + Mess << "Vertex doesn't belong to Hexaedron"; + return; + } +} +// ======================================================== checkDisco +void Elements::checkDisco (Hexa* cell, Edge* element) +{ + if (BadElement (cell)) + { + Mess << "Hexaedron is not valid"; + setError (HERR); + return; + } + + if (BadElement (element)) + { + Mess << "Edge is not valid"; + setError (HERR); + return; + } + + int node = cell->findEdge (element); + if (node==NOTHING) + { + setError (HERR); + Mess << "Edge doesn't belong to Hexaedron"; + return; + } +} +// ======================================================== checkDisco +void Elements::checkDisco (Hexa* cell, Quad* element) +{ + if (BadElement (cell)) + { + Mess << "Hexaedron is not valid"; + setError (HERR); + return; + } + + if (BadElement (element)) + { + Mess << "Quad is not valid"; + setError (HERR); + return; + } + + int node = cell->findQuad (element); + if (node==NOTHING) + { + setError (HERR); + Mess << "Quadrangle doesn't belong to Hexaedron"; + return; + } +} +// ======================================================== checkDisco +void Elements::checkDisco (Hexas& thexas, Edges& tedges) +{ + int nbedges = tedges.size(); + int nbhexas = thexas.size(); + + if (nbhexas != nbedges) + { + Mess << " **** Error in Document::disconnectEdges"; + Mess << " **** Number of Edges and number of Hexas are different"; + setError (HERR); + return; + } + + for (int nro=0 ; nrofindEdge (edge); + if (ned==NOTHING) + { + Mess << " **** Edge number " << nro+1 + << " doesnt belong to corresponding hexa"; + setError (HERR); + return; + } + if (nro>0) + { + Vertex* vertex = edge->commonVertex (tedges[nro-1]); + if (vertex==NULL) + { + setError (HERR); + Mess << " **** Edge number " << nro + << " doesnt intesect next edge"; + } + } + } +} +// ======================================================== calcul_phimax +double calcul_phimax (double radhole, double radext, bool sphere) +{ + double phi = asin (radhole/radext); + if (sphere) + phi = 2*phi; + phi = M_PI*DEMI - phi; + return phi; +} + +END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexElements_del.cxx b/src/HEXABLOCK/HexElements_del.cxx new file mode 100644 index 0000000..71845a7 --- /dev/null +++ b/src/HEXABLOCK/HexElements_del.cxx @@ -0,0 +1,131 @@ + +// C++ : Grilles + +// Copyright (C) 2009-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 +// + +#include "HexElements.hxx" +#include "HexDocument.hxx" +#include "HexVector.hxx" +#include "HexVertex.hxx" +#include "HexHexa.hxx" +#include "HexEdge.hxx" +#include "HexGlobale.hxx" +#include "HexCylinder.hxx" + +#include + +BEGIN_NAMESPACE_HEXA + +// ====================================================== makeCartesianGrid +int Elements::makeCartesianGrid (Vertex* orig, Vector* v1, Vector* v2, + Vector* v3, int px, int py, int pz, int mx, int my, int mz) +{ + return HERR; +} +// ====================================================== makeCartesianNodes +int Elements::makeCartesianNodes (Vertex* orig, Vector* v1, Vector* v2, + Vector* v3, int px, int py, int pz, int mx, int my, int mz) +{ + return HERR; +} +// ====================================================== makeBasicCylinder +int Elements::makeBasicCylinder (double dr, double da, double dl, int nr, + int na, int nl, bool fill) +{ + return HERR; +} +// ====================================================== transfoVertices +void Elements::transfoVertices (Vertex* orig, Vector* base, Vector* haut) +{ +} +// ====================================================== transfoVertices +void Elements::transfoVertices (Vertex* orig, Vector* iprim, Vector* jprim, + Vector* kprim) +{ +} +// ====================================================== makeSphericalGrid +int Elements::makeSphericalGrid (Vertex* c, double rayon, int nb, double k) +{ + return HERR; +} +// ====================================================== makeSphericalGrid +// ==== Deja perimee en Hexa5 +int Elements::makeSphericalGrid (Vertex* c, Vector* dv, int nb, double k) +{ + return HERR; +} +// ====================================================== addStrate +int Elements::addStrate (Quad* i_quad[], Edge* i_edge[], Vertex* i_node[], + Vertex* center, double lambda) +{ + return HERR; +} +// ====================================================== makeCylinder +int Elements::makeCylinder (Cylinder* cyl, Vector* vx, int nr, int na, int nl) +{ + return HERR; +} +// ====================================================== makePipe +int Elements::makePipe (Cylinder* cyl, Vector* vx, int nr, int na, int nl) +{ + return HERR; +} +// +// ---------------------------------------- prism Quads +// +// ====================================================== prismQuads +int Elements::prismQuads (Quads& tstart, Vector* dir, int nbiter) +{ + return HERR; +} +// ====================================================== prismQuadsVec +int Elements::prismQuadsVec (Quads& tstart, Vector* dir, RealVector& tlen, + int mode) +{ + return HERR; +} +// ======================================================== revolutionQuads +int Elements::revolutionQuads (Quads& start, Vertex* center, Vector* axis, + RealVector &angles) +{ + return HERR; +} +// ====================================================== joinQuads +int Elements::joinQuads (Quads& orig, int nb, Vertex* v1, Vertex* v2, + Vertex* v3, Vertex* v4, Quad* cible) +{ + return HERR; +} +// ====================================================== makeCylindricalGrid +// ==== Version avec vecteurs --> TODO DELETE ???? +int Elements::makeCylindricalGrid (Vertex* orig, Vector* base, Vector* haut, + RealVector& tdr, RealVector& tda, RealVector& tdh, + bool fill) +{ + return HOK; +} +// ====================================================== makeCylindricalGrid +int Elements::makeCylindricalGrid (Vertex* c, Vector* b, Vector* h, + double dr, double da, double dl, int nr, int na, int nl, bool fill) +{ + return HOK; +} + +END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexElements_grid.cxx b/src/HEXABLOCK/HexElements_grid.cxx index d5fa25a..4371cb9 100755 --- a/src/HEXABLOCK/HexElements_grid.cxx +++ b/src/HEXABLOCK/HexElements_grid.cxx @@ -32,81 +32,6 @@ #include BEGIN_NAMESPACE_HEXA -// ====================================================== makeBasicCylinder -int Elements::makeBasicCylinder (double dr, double da, double dl, int nr, - int na, int nl, bool fill) -{ - cyl_dispo = CYL_NOFILL; - if (fill && na > 3) - { - if (cyl_closed) - { - if (na==4) - cyl_dispo = CYL_CL4; - else if (na==6) - cyl_dispo = CYL_CL6; - else if (na MODULO 2 == 0) - cyl_dispo = CYL_CLOSED; - } - else if ((na MODULO 2)==0) - cyl_dispo = CYL_PEER; - else - cyl_dispo = CYL_ODD; - } - - cyl_fill = cyl_dispo != CYL_NOFILL; - - double alpha = M_PI*da/180; - double beta = alpha / na; - double theta = 0; - int nb_secteurs = cyl_closed ? size_vy-1 : size_vy; - - for (int ny=0 ; nyaddVertex (px, py, pz); - setVertex (node, nx, ny, nz); - } - } - } - - if (cyl_closed) - { - for (int nx=0 ; nxaddVertex (0, 0, nz*dl); - tab_vertex.push_back (node); - nbr_vertex ++; - } - } - - return HOK; -} // ====================================================== fillGrid int Elements::fillGrid () { @@ -229,11 +154,11 @@ void Elements::fillCenter () size_ehplus = nbrayons * size_vz; size_evplus = size_hz; - ker_hexa .resize (size_hplus); - ker_hquad.resize (size_qhplus); - ker_vquad.resize (size_qvplus); - ker_hedge.resize (size_ehplus); - ker_vedge.resize (size_evplus); + ker_hexa .resize (size_hplus, NULL); + ker_hquad.resize (size_qhplus, NULL); + ker_vquad.resize (size_qvplus, NULL); + ker_hedge.resize (size_ehplus, NULL); + ker_vedge.resize (size_evplus, NULL); Vertex* pcenter = NULL; @@ -490,47 +415,14 @@ void Elements::fillCenterOdd () // -------------------------------------------------------------------------- // ----------------------------------------- Evols Hexa 3 // -------------------------------------------------------------------------- -// ====================================================== makeCylindricalGrid -// ==== Version avec vecteurs -int Elements::makeCylindricalGrid (Vertex* orig, Vector* base, Vector* haut, - RealVector& tdr, RealVector& tda, RealVector& tdh, - bool fill) -{ - if (BadElement (orig) || BadElement(base) || BadElement(haut) - || base->getNorm () <= Epsil || haut->getNorm () <= Epsil - || tdr.size () <= 0 || tda.size () <= 0 || tdh.size () <= 0) - { - setError (); - return HERR; - } - - int nr = tdr.size() - 1; - int na = tda.size(); - int nl = tdh.size(); - double angle = 0; - - for (int nro=0 ; nro= 359.9; - - int ier = makeBasicCylinder (tdr, tda, tdh, fill); - if (ier!=HOK) - return ier; - transfoVertices (orig, base, haut); - - fillGrid (); - assoCylinders (orig, haut, angle, tda); - return HOK; -} // ====================================================== makeBasicCylinder // ==== Version avec vecteurs int Elements::makeBasicCylinder (RealVector& tdr, RealVector& tda, RealVector& tdh, bool fill) { - int na = tda.size(); + int na = tda.size()-1; + PutData (na); cyl_dispo = CYL_NOFILL; if (fill && na > 3) @@ -557,26 +449,20 @@ int Elements::makeBasicCylinder (RealVector& tdr, RealVector& tda, for (int ny=0 ; ny0) - alpha += tda[ny-1]; - + alpha = tda[ny]; double theta = M_PI*alpha/180; double cos_theta = cos (theta); double sin_theta = sin (theta); - double rayon = 0; for (int nx=0 ; nx 0) - pz += tdh [nz-1]; + double pz = tdh [nz]; Vertex* node = el_root->addVertex (px, py, pz); setVertex (node, nx, ny, nz); } @@ -595,12 +481,10 @@ int Elements::makeBasicCylinder (RealVector& tdr, RealVector& tda, // Les vertex centraux if (cyl_fill) { - double pz = 0; ker_vertex = nbr_vertex; for (int nz=0 ; nz 0) - pz += tdh [nz-1]; + double pz = tdh [nz]; Vertex* node = el_root->addVertex (0, 0, pz); tab_vertex.push_back (node); nbr_vertex ++; diff --git a/src/HEXABLOCK/HexElements_piq.cxx b/src/HEXABLOCK/HexElements_piq.cxx index b449d1e..cd51d14 100755 --- a/src/HEXABLOCK/HexElements_piq.cxx +++ b/src/HEXABLOCK/HexElements_piq.cxx @@ -27,6 +27,7 @@ #include "HexEdge.hxx" #include "HexDiagnostics.hxx" #include "HexDocument.hxx" +#include "HexHexa.hxx" #include #include diff --git a/src/HEXABLOCK/HexElements_ter.cxx b/src/HEXABLOCK/HexElements_ter.cxx index 549d326..4cb09df 100755 --- a/src/HEXABLOCK/HexElements_ter.cxx +++ b/src/HEXABLOCK/HexElements_ter.cxx @@ -31,15 +31,13 @@ #include "HexNewShape.hxx" #include "HexEdgeShape.hxx" +#include "HexAssoEdge.hxx" #include BEGIN_NAMESPACE_HEXA -void translate_brep (string& brep, double vdir[], string& trep); -void transfo_brep (string& brep, Matrix* matrice, string& trep); - -static bool db=false; +// static bool db=false; // ====================================================== makeRind int Elements::makeRind (EnumGrid type, Vertex* center, Vector* vx, Vector* vz, @@ -189,41 +187,55 @@ int Elements::getHexas (Hexas& liste) // ====================================================== assoCylinder void Elements::assoCylinder (Vertex* ori, Vector* normal, double angle) { + if (normal==NULL || ori==NULL) + return; + RealVector tangles; - assoCylinders (ori, normal, angle, tangles); + Real3 vz, center; + normal->getCoord (vz); + ori ->getPoint (center); + assoCylinders (center, vz, angle, tangles); } // ====================================================== assoCylinders void Elements::assoCylinders (Vertex* ori, Vector* normal, double angle, RealVector& t_angles) +{ + if (normal==NULL || ori==NULL) + return; + + Real3 vz, center; + normal->getCoord (vz); + ori ->getPoint (center); + assoCylinders (center, vz, angle, t_angles); +} +// ====================================================== assoCylinders +void Elements::assoCylinders (double* ori, double* vk, double angle, + RealVector& t_angles) { char name [12]; sprintf (name, "grid_%02d", el_id); NewShape* geom = el_root->addShape (name, SH_CYLINDER); geom -> openShape(); - int na = t_angles.size(); - bool regul = na == 0; - double alpha = angle/size_hy; - string brep; - Real3 vk = { normal->getDx(), normal->getDy(), normal->getDz() }; - normer_vecteur (vk); + // Real3 vk = { normal->getDx(), normal->getDy(), normal->getDz() }; + // normer_vecteur (vk); for (int nz=0 ; nzgetX() - ori->getX(), - pm->getY() - ori->getY(), - pm->getZ() - ori->getZ() }; + Real3 om = { pm->getX() - ori[dir_x], + pm->getY() - ori[dir_y], + pm->getZ() - ori[dir_z] }; double oh = prod_scalaire (om, vk); double rayon = 0; Real3 ph, hm; for (int dd=dir_x; dd<=dir_z ; dd++) { - ph [dd] = ori->getCoord(dd) + oh*vk[dd]; + ph [dd] = ori[dd] + oh*vk[dd]; hm [dd] = pm ->getCoord(dd) - ph[dd]; rayon += hm[dd] * hm[dd]; } @@ -231,17 +243,14 @@ void Elements::assoCylinders (Vertex* ori, Vector* normal, double angle, rayon = sqrt (rayon); int subid = geom->addCircle (ph, rayon, vk, hm); - double pmax = 0; for (int ny=0 ; nyaddAssociation (edge, subid, pmin, pmax); - // Shape* shape = new Shape (brep); - // shape-> setBounds (pmin, pmax); - // edge->addAssociation (shape); + cout << " assoCylinders : ny= " << ny << ", nz= " << nz + << " param = (" << pmin << ", " << pmax << ")\n"; } } } @@ -249,25 +258,34 @@ void Elements::assoCylinders (Vertex* ori, Vector* normal, double angle, // Traitement des faces spheriques Real3 vi = { -vk[dir_x], -vk[dir_y], -vk[dir_z] }; - Real3 po = { ori->getX(), ori->getY(), ori->getZ() }; switch (grid_type) { case GR_HEMISPHERIC : // Pour l'exterieur case GR_PART_SPHERIC : - assoRind (po, vi, size_vx-1, geom); + assoRind (ori, vi, size_vx-1, geom); break; case GR_PART_RIND : // Exterieur + interieur case GR_RIND : - assoRind (po, vi, 0, geom); - assoRind (po, vi, size_vx-1, geom); + assoRind (ori, vi, 0, geom); + assoRind (ori, vi, size_vx-1, geom); break; default : break; } - // assoResiduelle (); // Association des sommets residuels geom->closeShape (); } +// ====================================================== calcul_param +double calcul_param (double* ori, double* vi, Vertex* vert) +{ + Real3 pnt, vj; + vert->getPoint (pnt); + calc_vecteur (ori, pnt, vj); + normer_vecteur (vj); + double kos = prod_scalaire (vi, vj); + double alpha = acos (kos) / (2*M_PI); + return alpha; +} // ====================================================== assoRind // Association des meridiennes // Creation sphere geometrique + association faces @@ -275,7 +293,6 @@ void Elements::assoRind (double* ori, double* vi, int nx, NewShape* geom) { Real3 vk; double radius = nx==0 ? cyl_radint : cyl_radext; - double paramin = std::max ((cyl_phi0 + M_PI/2) / (2*M_PI), 0.0); int sphid = geom->addSphere (ori, radius); int nz1 = size_vz/2; @@ -288,14 +305,18 @@ void Elements::assoRind (double* ori, double* vi, int nx, NewShape* geom) prod_vectoriel (vi, vj, vk); double rayon = cyl_radint + nx*(cyl_radext-cyl_radint)/size_hx; int subid = geom->addCircle (ori, rayon, vk, vi); - double pmax = paramin; for (int nz=0 ; nzgetVertex (V_AMONT); + Vertex* nd2 = edge->getVertex (V_AVAL); + double pmin = calcul_param (ori, vi, nd1); + double pmax = calcul_param (ori, vi, nd2); + cout << " assoRind : ny= " << ny << ", nz= " << nz + << " param = (" << pmin << ", " << pmax << ")\n"; + geom->addAssociation (edge, subid, pmin, pmax); geom->addAssociation (quad, sphid); } @@ -335,9 +356,6 @@ void Elements::assoCircle (double* center, Edge* ed1, Edge* ed2, NewShape* geom) double rayon = calc_norme (oa); int subid = geom->addCircle (center, rayon, normal, oa); - // Shape* asso1 = new Shape (brep); - // Shape* asso2 = new Shape (brep); - const double alpha = atan (sqrt(2)/2)/M_PI; // angle proche de 70.528 degres // asso1->setBounds (0, alpha); // asso2->setBounds (0.5, alpha + 0.5); @@ -346,15 +364,14 @@ void Elements::assoCircle (double* center, Edge* ed1, Edge* ed2, NewShape* geom) geom->addAssociation (ed2, subid, 0.5, alpha+0.5); } // ====================================================== assoSphere -void Elements::assoSphere (Vertex* ori, Edge* t_edge[], Quad* t_quad[]) +void Elements::assoSphere (double* center, Edge* t_edge[], Quad* t_quad[]) { char name [12]; sprintf (name, "grid_%02d", el_id); NewShape* geom = el_root->addShape (name, SH_SPHERE); geom -> openShape (); - Real3 center, sommet; - ori->getPoint(center); + Real3 sommet; assoCircle (center, t_edge [E_AC], t_edge [E_BD], geom); assoCircle (center, t_edge [E_AD], t_edge [E_BC], geom); @@ -364,77 +381,13 @@ void Elements::assoSphere (Vertex* ori, Edge* t_edge[], Quad* t_quad[]) assoCircle (center, t_edge [E_CF], t_edge [E_DE], geom); t_edge[E_AC]->getVertex(V_AMONT)->getPoint (sommet); - double radius = calc_distance (center, sommet);; + double radius = calc_distance (center, sommet); int sphid = geom -> addSphere (center, radius); geom->closeShape(); for (int nf=0 ; nf < HQ_MAXI ; nf++) t_quad[nf]->addAssociation (geom, sphid); - - // assoResiduelle (); // Association des sommets residuels -} -// ====================================================== makeSphericalGrid -int Elements::makeSphericalGrid (Vertex* c, double rayon, int nb, double k) -{ - if (nb<=0 || rayon <=Epsil || k <= Epsil || BadElement (c)) - { - setError (); - return HERR; - } - - resize (GR_SPHERIC, nb); - - Vertex* i_node [HV_MAXI]; // Les noeuds de l'hexa englobant - Edge* i_edge [HE_MAXI]; // Les noeuds de l'hexa englobant - Quad* i_quad [HQ_MAXI]; // Les noeuds de l'hexa englobant - - for (int nro=0 ; nroCoordVertex (nro, dir_x) * rayon; - double dy = glob->CoordVertex (nro, dir_y) * rayon; - double dz = glob->CoordVertex (nro, dir_z) * rayon; - - i_node [nro] = el_root->addVertex (c->getX ()+dx, c->getY ()+dy, - c->getZ ()+dz); - } - - for (int nro=0 ; nroEdgeVertex (nro, V_AMONT); - int v2 = glob->EdgeVertex (nro, V_AVAL); - i_edge[nro] = newEdge (i_node[v1], i_node[v2]); - - if (db) - { - char nm0[8], nm1 [8], nm2 [8]; - printf (" %2d : %s = %s = [%s, %s] = [%d,%d] = [%s,%s]\n", nro, - glob->namofHexaEdge(nro), i_edge[nro]->getName(nm0), - glob->namofHexaVertex(v1), glob->namofHexaVertex(v2), v1, v2, - i_node[v1]->getName(nm1), i_node[v2]->getName(nm2)); - } - } - - for (int nro=0 ; nroQuadEdge (nro, E_A)], - i_edge[glob->QuadEdge (nro, E_B)], - i_edge[glob->QuadEdge (nro, E_C)], - i_edge[glob->QuadEdge (nro, E_D)]); - - tab_hexa.push_back (newHexa (i_quad[Q_A], i_quad[Q_B], i_quad[Q_C], - i_quad[Q_D], i_quad[Q_E], i_quad[Q_F])); - double lambda = 1; - double dcell = 1; - for (int niv=0; nivcountAssociation (); + if (nbshapes==0) + return HOK; - const Shapes& tab_shapes = orig->getAssociations (); - const Shapes& tab_dest = dest->getAssociations (); - int nbdest = tab_dest.size(); - int nbshapes = tab_shapes.size(); - bool on_edge = nbshapes>0 && nbdest==0; - - Vertex* vo1 = orig->commonVertex (dir); - Vertex* vd1 = dest->commonVertex (dir); - - if (vo1==NULL || vd1==NULL) - return HERR; - - string trep; - Real3 porig, pdest, vdir; - vo1->getPoint (porig); - vd1->getPoint (pdest); - calc_vecteur (porig, pdest, vdir); - - if (on_edge) - { - for (int nro=0 ; nrogetBrep(); - // translate_brep (brep, vdir, trep); - transfo_brep (brep, &gen_matrix, trep); - // Shape* tshape = new Shape (trep); - // tshape->setBounds (shape->getStart(), shape->getEnd()); - // dest->addAssociation (tshape); - } - } - } - - for (int nro=V_AMONT ; nro<=V_AVAL ; nro++) + NewShape* new_shape = getShape (); + for (int nro=0 ; nrogetAssociation (); - if (shape!=NULL && vd1->getAssociation ()==NULL) - { - string brep = shape->getBrep(); - // translate_brep (brep, vdir, trep); - transfo_brep (brep, &gen_matrix, trep); - // Shape* tshape = new Shape (trep); - // vd1->setAssociation (tshape); - } - vo1 = orig->opposedVertex (vo1); - vd1 = dest->opposedVertex (vd1); + AssoEdge* asso = lorig->getAssociation (nro); + EdgeShape* shape = asso ->getEdgeShape(); + double p1 = asso ->getStart(); + double p2 = asso ->getEnd (); + int subid = 0; + char name [24]; + + sprintf (name, "0x%lx#%d", (unsigned long) shape, nh); + map::iterator iter = map_shape.find (name); + if (iter != map_shape.end()) + subid = iter->second; + else + subid = map_shape[name] = new_shape->transfoShape (cum_matrix, shape); + + new_shape->addAssociation (ldest, subid, p1, p2); + printf (" prismAsso : %s -> %s(%d) = %s [ %g , %g]\n", + lorig->getName(), ldest->getName(), nh, name, p1, p2); } return HOK; -#endif } // ====================================================== assoResiduelle void Elements::assoResiduelle () @@ -586,4 +510,206 @@ void Elements::moveDisco (Hexa* hexa) matrix.perform (tab_vertex [nv]); } } +// =================================================== getStrate +Hexa* Elements::getStrate (int couche, EnumHQuad nroface) +{ + Hexa* cell = NULL; + int nro = couche <= 0 ? 0 : (couche-1)*HQ_MAXI + nroface + 1; + + if (nbr_hexas==0 || nro >= nbr_hexas) + cell = NULL; + else + cell = tab_hexa [nro]; + + return cell; +} +// ============================================================ setHexa +void Elements::setHexa (Hexa* elt, int nro) +{ + if (nro >=0 && nro < nbr_hexas) + tab_hexa [nro] = elt; +} +// ============================================================ setQuad +void Elements::setQuad (Quad* elt, int nro) +{ + if (nro >=0 && nro < nbr_quads) + tab_quad [nro] = elt; +} +// ============================================================ setEdge +void Elements::setEdge (Edge* elt, int nro) +{ + if (nro >=0 && nro < nbr_edges) + tab_edge [nro] = elt; +} +// ============================================================ setVertex +void Elements::setVertex (Vertex* elt, int nro) +{ + if (nro >=0 && nro < nbr_vertex) + tab_vertex [nro] = elt; +} +// ----------------------------------------------------------------------- +// ----------------------------------------------------------------------- +// ============================================================ getHexa +Hexa* Elements::getHexa (int nro) +{ + DumpStart ("getHexa", nro); + + Hexa* elt = NULL; + int nombre=tab_hexa.size(); + // if (nro >=0 && nro < nbr_hexas && el_status == HOK Abu 2010/05/06 + if (nro >=0 && nro < nombre && el_status == HOK + && tab_hexa [nro] != NULL && tab_hexa [nro]->isValid()) + elt = tab_hexa [nro]; + + DumpReturn (elt); + return elt; +} +// ============================================================ getQuad +Quad* Elements::getQuad (int nro) +{ + DumpStart ("getQuad", nro); + + Quad* elt = NULL; + if (nro >=0 && nro < nbr_quads && el_status == HOK + && tab_quad [nro] != NULL && tab_quad [nro]->isValid()) + elt = tab_quad [nro]; + + DumpReturn (elt); + return elt; +} +// ============================================================ getEdge +Edge* Elements::getEdge (int nro) +{ + DumpStart ("getEdge", nro); + + Edge* elt = NULL; + if (nro >=0 && nro < nbr_edges && el_status == HOK + && tab_edge [nro] != NULL && tab_edge [nro]->isValid()) + elt = tab_edge [nro]; + + DumpReturn (elt); + return elt; +} +// ============================================================ getVertex +Vertex* Elements::getVertex (int nro) +{ + DumpStart ("getVertex", nro); + + Vertex* elt = NULL; + if (nro >=0 && nro < nbr_vertex && el_status == HOK + && tab_vertex [nro] != NULL && tab_vertex [nro]->isValid()) + elt = tab_vertex [nro]; + + DumpReturn (elt); + return elt; +} +// ============================================================ indVertex +int Elements::indVertex (int nquad, int nsommet, int nh) +{ + int nro = nsommet + QUAD4*nquad + nbr_orig*QUAD4*(nh+1); + return nro; +} +// ============================================================ nroVertex +int Elements::nroVertex (int nquad, int nsommet, int nh) +{ + int nro = nsommet + QUAD4*nquad + nbr_orig*QUAD4*nh; + return nro; +} +// ============================================================ indVertex +int Elements::indVertex (int ref_edge, int nh) +{ + int nro = ref_edge + nbr_orig*QUAD4*nh; + return nro; +} +// ============================================================ nroEdgeH +int Elements::nroEdgeH (int nvertex) +{ + return QUAD4*nbr_orig*gr_hauteur + nvertex; +} +// ============================================================ nroEdgeH +int Elements::nroEdgeH (int nquad, int nsommet, int nh) +{ + return QUAD4*nbr_orig*gr_hauteur + indVertex (nquad, nsommet, nh); +} +// ============================================================ nroHexa +int Elements::nroHexa (int nquad, int nh) +{ + int nro = gr_hauteur*nquad + nh; + return nro; +} + +// ============================================================ addHexa +void Elements::addHexa (Hexa* element) +{ + tab_hexa.push_back (element); + nbr_hexas ++; +} +// ============================================================ addQuad +void Elements::addQuad (Quad* element) +{ + tab_quad.push_back (element); + nbr_quads ++; +} +// ============================================================ addEdge +void Elements::addEdge (Edge* element) +{ + tab_edge.push_back (element); + nbr_edges ++; +} +// ============================================================ addVertex +void Elements::addVertex (Vertex* element) +{ + tab_vertex.push_back (element); + nbr_vertex ++; +} +// ============================================================ findHexa +int Elements::findHexa (Hexa* element) +{ + int nbre = tab_hexa.size(); + for (int nro=0 ; nro +#include + +BEGIN_NAMESPACE_HEXA + +static bool db=false; +double calcul_phimax (double radhole, double radext, bool sphere); + +// ====================================================== makeCartesian +int Elements::makeCartesian (Vertex* orig, double* ux, double* uy, double* uz, + RealVector& tx, RealVector& ty, RealVector& tz) +{ + resize (GR_CARTESIAN, tx.size(), ty.size(), tz.size()); + + double dx, dy, dz; + double kx, ky, kz; + double px0 = orig->getX (); + double py0 = orig->getY (); + double pz0 = orig->getZ (); + + setVertex (orig, 0, 0, 0); + for (int nz=0 ; nzaddVertex (dx, dy, dz); + setVertex (node, nx, ny, nz); + } + } + } + fillGrid (); + return HOK; +} +// ====================================================== makeCylinder +int Elements::makeCylinder (Vertex* vorig, double* base, double* haut, + RealVector& tray, RealVector& tang, RealVector& thaut, + bool fill) +{ + Real3 orig = { 0, 0, 0 }; + if (vorig!=NULL) + vorig->getPoint (orig); + + int nr = tray .size() - 1; + int na = tang .size() - 1; + int nl = thaut.size() - 1; + double angle = tang[na]; + + resize (GR_CYLINDRIC, nr, na, nl); + cyl_closed = angle >= 359.9; + + val_absolues = true; + int ier = makeBasicCylinder (tray, tang, thaut, fill); + if (ier!=HOK) + return ier; + + transfoVertices (orig, base, haut); + + fillGrid (); + assoCylinders (orig, haut, angle, tang); + return HOK; +} +// ====================================================== transfoVertices +void Elements::transfoVertices (double* omega, double* base, double* haut) +{ + Matrix matrice; + Real3 iprim, jprim; + + prod_vectoriel (haut, base, jprim); + prod_vectoriel (jprim, haut, iprim); + + matrice.define (omega, iprim, jprim, haut); + int nbre = tab_vertex.size (); + for (int nro=0 ; nrosetMark (NO_USED); + } + + for (int nro=0 ; nrogetMark() == NO_USED) + { + matrice.perform (node); + node->setMark (IS_USED); + } + } +} +// ====================================================== makeSpherical +int Elements::makeSpherical (double* center, double* base, double* haut, + RealVector& trayon, int critere) +{ + Real3 iprim, jprim; + prod_vectoriel (haut, base, jprim); + prod_vectoriel (jprim, haut, iprim); + + int nbre = trayon.size(); + resize (GR_SPHERIC, nbre); + + Vertex* i_node [HV_MAXI]; // Les noeuds de l'hexa englobant + Edge* i_edge [HE_MAXI]; // Les noeuds de l'hexa englobant + Quad* i_quad [HQ_MAXI]; // Les noeuds de l'hexa englobant + + double rayon = trayon [0]; + for (int nro=0 ; nroCoordVertex (nro, dir_x) * rayon; + double dy = glob->CoordVertex (nro, dir_y) * rayon; + double dz = glob->CoordVertex (nro, dir_z) * rayon; + + double px = center[0] + dx*iprim[0] + dy*jprim[0] + dz*haut[0] ; + double py = center[1] + dx*iprim[1] + dy*jprim[1] + dz*haut[1] ; + double pz = center[2] + dx*iprim[2] + dy*jprim[2] + dz*haut[2] ; + + i_node [nro] = el_root->addVertex (px, py, pz); + } + + for (int nro=0 ; nroEdgeVertex (nro, V_AMONT); + int v2 = glob->EdgeVertex (nro, V_AVAL); + i_edge[nro] = newEdge (i_node[v1], i_node[v2]); + + if (db) + { + char nm0[8], nm1 [8], nm2 [8]; + printf (" %2d : %s = %s = [%s, %s] = [%d,%d] = [%s,%s]\n", nro, + glob->namofHexaEdge(nro), i_edge[nro]->getName(nm0), + glob->namofHexaVertex(v1), glob->namofHexaVertex(v2), v1, v2, + i_node[v1]->getName(nm1), i_node[v2]->getName(nm2)); + } + } + + for (int nro=0 ; nroQuadEdge (nro, E_A)], + i_edge[glob->QuadEdge (nro, E_B)], + i_edge[glob->QuadEdge (nro, E_C)], + i_edge[glob->QuadEdge (nro, E_D)]); + + tab_hexa.push_back (newHexa (i_quad[Q_A], i_quad[Q_B], i_quad[Q_C], + i_quad[Q_D], i_quad[Q_E], i_quad[Q_F])); + + for (int niv=1; nivaddVertex (px0+lambda*(i_node[nv]->getX()-px0), + py0+lambda*(i_node[nv]->getY()-py0), + pz0+lambda*(i_node[nv]->getZ()-pz0)); + + d_edge[nv] = newEdge (i_node[nv], e_node[nv]); + } + // Les aretes exterieures + // + les faces diagonales + for (int nro=0 ; nroEdgeVertex (nro, V_AMONT); + int nv1 = glob->EdgeVertex (nro, V_AVAL ); + e_edge[nro] = newEdge (e_node [nv0], e_node [nv1]); + d_quad[nro] = newQuad (i_edge [nro], d_edge [nv0], + e_edge [nro], d_edge [nv1]); + } + // Les faces exterieures + // + les hexas + Hexa* strate = NULL; + for (int nro=0 ; nroQuadEdge (nro, E_A); + int ne1 = glob->QuadEdge (nro, E_B); + int ne2 = glob->QuadEdge (nro, E_C); + int ne3 = glob->QuadEdge (nro, E_D); + + e_quad[nro] = newQuad (e_edge[ne0], e_edge[ne1], + e_edge[ne2], e_edge[ne3]); + strate = newHexa (i_quad[nro], e_quad[nro], d_quad[ne0], + d_quad[ne2], d_quad[ne1], d_quad[ne3]); + tab_hexa.push_back (strate); + } + + for (int nv=0 ; nvaddVertex (px, py, pz); + setVertex (node, nx, ny, nz); + } + } + } + + if (cyl_closed) + { + for (int nx=0 ; nxmarkAll (NO_USED); + nbr_vertex = 0; + nbr_edges = 0; + + nbr_hexas = nbcells*nbiter; + + tab_hexa.resize (nbr_hexas, NULL); + tab_quad.clear (); // verticaux + ker_hquad.clear (); // Horizontaux + tab_edge.clear (); + tab_pilier.clear (); + tab_vertex.clear (); + copy_vecteur (axe, prism_dir); + + revo_lution = revol; + prism_vec = NOT revol; + copy_vecteur (axe, revo_axe); + revo_center = center; + gen_values = tabval; + cum_values = gen_values; + + for (int nro=1 ; nromarkAll (IS_NONE); + db = on_debug(); + + gr_hauteur = nbiter; + nbr_orig = nbquads; + tab_orig = tstart; + cum_values = tlen; + + for (int nq=0 ; nqsetMark (nq); + + StrOrient orient (va1, va2, vb1, vb2); + int ier = this ->coupler (0, cible, &orient); + if (ier!=HOK) + { + setError (); + return HERR; + } + ier = tstart[0]->coupler (cible, &orient, this); + return ier; +} +// ============================================================ cutEdge +int Elements::cutEdge (Edge* edge, RealVector& tlen) +{ + under_v6 = false; + gen_values = tlen; + cum_values = gen_values; + + Propagation* prop = el_root->findPropagation (edge); + const Edges& t_edges = prop->getEdges (); + + int nbcuts = tlen.size (); + cutHexas (t_edges, nbcuts); + + // el_root->majPropagation (); + return HOK; +} +// ============================================================ nearestVertex +Vertex* Elements::nearestVertex (Vertex* other) +{ + if (BadElement (other)) + return NULL; + + Vertex* vsol = NULL; + double dmin = 1e+77; + int nbre = countVertex (); + for (int nro=0 ; nrodist2 (vert); + if (dist < dmin) + { + dmin = dist; + vsol = vert; + } + } + return vsol; +} +END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexEltBase.cxx b/src/HEXABLOCK/HexEltBase.cxx index 797ceb6..727530d 100755 --- a/src/HEXABLOCK/HexEltBase.cxx +++ b/src/HEXABLOCK/HexEltBase.cxx @@ -80,7 +80,8 @@ void EltBase::remove () return; el_root->setDeprecated (2); - el_type = EL_REMOVED; + el_type = EL_REMOVED; + el_status = HERR; int nbp = el_parent.size(); for (int nro=0 ; nrosetDeprecated (2); - el_type = EL_REMOVED; + el_type = EL_REMOVED; + el_status = HERR; } // ========================================================= getName cpchar EltBase::getName () @@ -163,9 +165,10 @@ void EltBase::setId (int ln) // ========================================================= makeVarName char* EltBase::makeVarName (char* nom) { - static cpchar PREFIX[] = {"Undef", "Node", "Edge", "Quad", "Hexa", - "Vect", "Grid", "Cyl", "Pipe", "Group", "Law", - "Xxxx", "Xxxx", "Xxxx" }; + static cpchar PREFIX [EL_MAXI] = {"undef", "ver", "edge", "quad", "hexa", + "vect", "grid", "cyl", "pipe", "group", + "law", "shape", "subsh", "prop", + "doc", "Xxxx" }; sprintf (nom, "%s%d", PREFIX[el_type], el_id); return nom; } @@ -174,5 +177,15 @@ bool EltBase::debug (int niv) { return el_root != NULL && el_root->getLevel() > niv ; } +// ========================================================= getNextName +string EltBase::getNextName () +{ + if (el_root != NULL) + return el_root->getNextName (el_type); + + char name [16]; + makeName (el_type, 0, name); + return string (name); +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexEltBase.hxx b/src/HEXABLOCK/HexEltBase.hxx index aea5b3d..1e185f4 100755 --- a/src/HEXABLOCK/HexEltBase.hxx +++ b/src/HEXABLOCK/HexEltBase.hxx @@ -32,6 +32,7 @@ #define GetClone(elt) ((elt)==NULL ? NULL : elt->getClone()) #define BadElement(elt) (elt)==NULL || (elt)->isBad() +#define EltIsValid(elt) (elt)!=NULL && (elt)->isValid() BEGIN_NAMESPACE_HEXA @@ -100,8 +101,9 @@ public : void setName (const string& nom) { el_name = nom ; } void setName (cpchar nom) { el_name = nom ; } - bool debug (int niv=0); - bool isAssociated () { return is_associated ; } + bool debug (int niv=0); + bool isAssociated () { return is_associated ; } + string getNextName (); protected : EnumElt el_type; diff --git a/src/HEXABLOCK/HexFaceShape.cxx b/src/HEXABLOCK/HexFaceShape.cxx index 32e4699..261ba42 100755 --- a/src/HEXABLOCK/HexFaceShape.cxx +++ b/src/HEXABLOCK/HexFaceShape.cxx @@ -17,13 +17,12 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #include "HexFaceShape.hxx" -#ifndef NO_CASCADE - BEGIN_NAMESPACE_HEXA @@ -43,11 +42,10 @@ void FaceShape::addAssociation (Quad* quad) // ====================================================== getAssociation Quad* FaceShape::getAssociation (int nro) { - if (nro>0 && nro0 && nro < (int)tab_assoc.size()) return tab_assoc[nro]; else return NULL; } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexFaceShape.hxx b/src/HEXABLOCK/HexFaceShape.hxx index ece65f5..5489e74 100644 --- a/src/HEXABLOCK/HexFaceShape.hxx +++ b/src/HEXABLOCK/HexFaceShape.hxx @@ -1,25 +1,6 @@ // class : Gestion des Sous-shapes categorie Faces -// Copyright (C) 2009-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 -// - #ifndef __FACE_SHAPE_H_ #define __FACE_SHAPE_H_ diff --git a/src/HEXABLOCK/HexGlobale.cxx b/src/HEXABLOCK/HexGlobale.cxx index eab1bb1..5e1d8fe 100755 --- a/src/HEXABLOCK/HexGlobale.cxx +++ b/src/HEXABLOCK/HexGlobale.cxx @@ -93,6 +93,9 @@ Globale::Globale () setOpposedQuad ( Q_C, Q_D ); setOpposedQuad ( Q_E, Q_F ); + dump.setWitness (&mess); + mess.setDump (&dump); + dump_study = DumpActif; } // ====================================================== getInstance diff --git a/src/HEXABLOCK/HexGlobale.hxx b/src/HEXABLOCK/HexGlobale.hxx index 3f69601..ac6d696 100755 --- a/src/HEXABLOCK/HexGlobale.hxx +++ b/src/HEXABLOCK/HexGlobale.hxx @@ -17,7 +17,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #ifndef _HEX_GLOBALE_H @@ -25,6 +26,7 @@ #include "hexa_base.hxx" #include "HexDumpStudy.hxx" +#include "HexWitness.hxx" /* ----------------------------------------------------- @@ -76,6 +78,7 @@ public : public : DumpStudy dump; + Witness mess; private : Globale (); // Constructeur prive diff --git a/src/HEXABLOCK/HexGroup.cxx b/src/HEXABLOCK/HexGroup.cxx index 0871dca..763a90e 100755 --- a/src/HEXABLOCK/HexGroup.cxx +++ b/src/HEXABLOCK/HexGroup.cxx @@ -21,34 +21,25 @@ // #include "HexGroup.hxx" -#include "HexEltBase.hxx" #include "HexXmlWriter.hxx" BEGIN_NAMESPACE_HEXA -int Group::last_grp_id = 0; static const cpchar kind_name[] = { "HexaCell", "QuadCell", "EdgeCell", - "HexaNode", "QuadNode", "EdgeNode", "VertexNode" }; + "HexaNode", "QuadNode", "EdgeNode", "VertexNode" }; // ======================================================== Constructeur -Group::Group (cpchar nom, EnumGroup grp) +Group::Group (Document* dad, cpchar nom, EnumGroup grp) + : EltBase (dad, EL_GROUP) { - grp_id = last_grp_id++; + string name = std::string(nom); + name.erase (name.find_last_not_of (" \n\r\t" ) + 1); + name.erase (0, name.find_first_not_of (" \n\r\t" )); - //Initialisation du nom du groupe: un nom par défaut est donné s'il n'est pas fourni - std::string _nom = std::string(nom); - _nom.erase (_nom.find_last_not_of (" \n\r\t" ) + 1); - _nom.erase (0, _nom.find_first_not_of (" \n\r\t" )); - if (!_nom.empty()) - grp_name = _nom; - else { - char buffer [16]; - sprintf (buffer, "g%04d", grp_id); - grp_name = std::string(buffer); - } + if (NOT name.empty()) + setName (name); grp_kind = grp; - switch (grp_kind) { case HexaCell : case HexaNode : @@ -113,7 +104,7 @@ void Group::saveXml (XmlWriter* xml) xml->addMark ("Group"); xml->openMark ("Identification"); - xml->addAttribute ("name", grp_name); + xml->addAttribute ("name", el_name); xml->addAttribute ("kind", kind_name [grp_kind]); xml->closeMark (); @@ -128,14 +119,6 @@ void Group::saveXml (XmlWriter* xml) } xml->closeMark (); } - -// ========================================================= getNextName -char* Group::getNextName (pchar buffer) -{ - sprintf (buffer, "g%04d", last_grp_id); - return buffer; -} - // ======================================================== getKind EnumGroup Group::getKind (cpchar kind) { diff --git a/src/HEXABLOCK/HexGroup.hxx b/src/HEXABLOCK/HexGroup.hxx index a26170a..c55067a 100755 --- a/src/HEXABLOCK/HexGroup.hxx +++ b/src/HEXABLOCK/HexGroup.hxx @@ -23,19 +23,16 @@ #ifndef __GROUP_H #define __GROUP_H -#include "hexa_base.hxx" +#include "HexEltBase.hxx" BEGIN_NAMESPACE_HEXA -class Group +class Group : public EltBase { public : - Group (cpchar nom, EnumGroup grp); + Group (Document* dad, cpchar nom, EnumGroup grp); ~Group () {} - void setName (cpchar nom) { grp_name = nom ; } - cpchar getName () { return grp_name.c_str () ; } - char* getNextName (pchar buffer); EnumGroup getKind () { return grp_kind ; } int addElement (EltBase* elt); int removeElement (EltBase* elt); @@ -53,10 +50,8 @@ public : private : int grp_id; - static int last_grp_id; EnumGroup grp_kind; EnumElt grp_typelt; - std::string grp_name; std::vector grp_table; }; diff --git a/src/HEXABLOCK/HexHexa.cxx b/src/HEXABLOCK/HexHexa.cxx index 126ae50..3290a83 100755 --- a/src/HEXABLOCK/HexHexa.cxx +++ b/src/HEXABLOCK/HexHexa.cxx @@ -45,7 +45,7 @@ Hexa::Hexa (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd, h_vertex [V_ADE] = vc; // = vb ; Modif Abu 30/08/2011 h_vertex [V_ADF] = vd; - h_vertex [V_BCE] = ve; + h_vertex [V_BCE] = ve; h_vertex [V_BCF] = vf; // = vg ; Modif Abu 30/08/2011 h_vertex [V_BDE] = vg; // = vf ; Modif Abu 30/08/2011 h_vertex [V_BDF] = vh; @@ -58,7 +58,7 @@ Hexa::Hexa (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd, for (int nro=0 ; nroEdgeVertex (nro, V_AMONT)], + h_edge[nro] = new Edge (h_vertex[glob->EdgeVertex (nro, V_AMONT)], h_vertex[glob->EdgeVertex (nro, V_AVAL)]); } @@ -72,6 +72,8 @@ Hexa::Hexa (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd, h_quad[nro] -> addParent (this); } majReferences (); + if (el_root != NULL && el_status==HOK) + el_root->addHexa (this); } // ======================================================== Constructeur 2 Hexa::Hexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf) @@ -95,7 +97,7 @@ Hexa::Hexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf) majReferences (); if (el_status != HOK) - { + { printf (" +++++++++++++++++++++++++++++++++++++++++++ \n"); printf (" +++ Heaedre impossible \n"); printf (" +++++++++++++++++++++++++++++++++++++++++++ \n"); @@ -108,6 +110,8 @@ Hexa::Hexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf) printf (" +++++++++++++++++++++++++++++++++++++++++++ \n"); // exit (1); } + else + el_root->addHexa (this); } // ========================================================= Constructeur 3 // === a utiliser uniquement pour le clonage @@ -117,6 +121,10 @@ Hexa::Hexa (Hexa* other) for (int nro=0 ; nroaddHexa (this); } // ======================================================== majReferences void Hexa::majReferences () @@ -130,7 +138,7 @@ void Hexa::controlerArete (int arete, int face1, int face2) h_edge [arete] = h_quad[face1]->commonEdge (h_quad[face2]); if (h_edge [arete]==NULL) { - el_root->putError (W_H_BAD_EDGE, + el_root->putError (W_H_BAD_EDGE, el_root->glob->namofHexaEdge (arete)); el_status = 888; } @@ -145,43 +153,43 @@ void Hexa::controlerSommet (int node, int ne1, int ne2, int ne3) h_vertex [node] = hv; if (hv == NULL) { - el_root->putError (W_H_BAD_VERTEX, + el_root->putError (W_H_BAD_VERTEX, el_root->glob->namofHexaVertex(node)); el_status = 888; } else if (hv == NULL || h_edge[ne3]->index (hv)<0) { char b[10]; - el_root->putError (W_H_BAD_VERTEX, + el_root->putError (W_H_BAD_VERTEX, el_root->glob->namofHexaVertex(node)); el_status = 888; - printf ("%s = %s\n", el_root->glob->namofHexaVertex(node), + printf ("%s = %s\n", el_root->glob->namofHexaVertex(node), hv->getName(b)); - printf ("%s = %s\n", el_root->glob->namofHexaEdge(ne1), + printf ("%s = %s\n", el_root->glob->namofHexaEdge(ne1), h_edge[ne1]->getName(b)); - printf ("%s = %s\n", el_root->glob->namofHexaEdge(ne2), + printf ("%s = %s\n", el_root->glob->namofHexaEdge(ne2), h_edge[ne2]->getName(b)); - printf ("%s = %s\n", el_root->glob->namofHexaEdge(ne3), + printf ("%s = %s\n", el_root->glob->namofHexaEdge(ne3), h_edge[ne3]->getName(b)); } } // ======================================================== controlerFaces void Hexa::controlerFaces () { - for (int n1=0 ; n1putError (W_H_NULL_QUAD, + el_root->putError (W_H_NULL_QUAD, el_root->glob->namofHexaQuad (n1)); setError (886); return; } - for (int n2=n1+1 ; n2putError (W_H_EQ_QUAD, - el_root->glob->namofHexaQuad (n1), + el_root->putError (W_H_EQ_QUAD, + el_root->glob->namofHexaQuad (n1), el_root->glob->namofHexaQuad (n2)); setError (888); } @@ -190,20 +198,20 @@ void Hexa::controlerFaces () // ======================================================== controlerSommets void Hexa::controlerSommets () { - for (int n1=0 ; n1putError (W_H_NULL_QUAD, + el_root->putError (W_H_NULL_QUAD, el_root->glob->namofHexaVertex (n1)); setError (886); return; } - for (int n2=n1+1 ; n2putError (W_H_EQ_QUAD, - el_root->glob->namofHexaVertex (n1), + el_root->putError (W_H_EQ_QUAD, + el_root->glob->namofHexaVertex (n1), el_root->glob->namofHexaVertex (n2)); setError (888); } @@ -242,7 +250,7 @@ void Hexa::verifierSommets () controlerSommet (V_BCE, E_BC, E_BE, E_CE); controlerSommet (V_BCF, E_BC, E_BF, E_CF); controlerSommet (V_BDF, E_BD, E_BF, E_DF); - controlerSommet (V_BDE, E_BD, E_BE, E_DE); + controlerSommet (V_BDE, E_BD, E_BE, E_DE); } // ======================================================== Inter Quad* Hexa::Inter (Hexa* other) @@ -260,15 +268,15 @@ Quad* Hexa::Inter (Hexa* other) // ======================================================= razNodes void Hexa::razNodes () { - for (int nb=0 ; nbsetMark (NO_COUNTED); } // ======================================================= countNodes int Hexa::countNodes () { int nombre = 0; - for (int nb=0 ; nbgetMark () == NO_COUNTED) + for (int nb=0 ; nbgetMark () == NO_COUNTED) { h_vertex[nb]->setMark (NO_USED); nombre ++; @@ -282,7 +290,7 @@ void Hexa::printNodes (pfile vtk, int& compteur) const double minvtk = 1e-30; Real3 koord; - for (int nb=0 ; nbgetMark()==NO_USED) { h_vertex[nb]->getPoint (koord); @@ -298,7 +306,7 @@ void Hexa::printNodes (pfile vtk, int& compteur) // ======================================================= colorNodes void Hexa::colorNodes (pfile vtk) { - for (int nb=0 ; nbgetMark()>=0) { double color = 100*(h_vertex[nb]->getScalar()+1); @@ -309,7 +317,7 @@ void Hexa::colorNodes (pfile vtk) // ======================================================= moveNodes void Hexa::moveNodes (Matrix* matrice) { - for (int nb=0 ; nbgetMark()!=IS_USED) { matrice->perform (h_vertex[nb]); @@ -319,7 +327,7 @@ void Hexa::moveNodes (Matrix* matrice) // ======================================================= transform void Hexa::transform (Matrix* matrice) { - for (int nb=0 ; nbperform (h_vertex[nb]); } // ======================================================= printHexa @@ -378,7 +386,7 @@ void Hexa::propager (Propagation* prop, int nro) if (h_edge[nro]->getMark()<0) h_edge[nro]->propager (prop, nro); } -// ========================================================= saveXml +// ========================================================= saveXml void Hexa::saveXml (XmlWriter* xml) { char ident[12]; @@ -394,11 +402,11 @@ void Hexa::saveXml (XmlWriter* xml) xml->openMark ("Hexa"); xml->addAttribute ("id", ident); xml->addAttribute ("quads", quads); - if (el_name!=ident) + if (el_name!=ident) xml->addAttribute ("name", el_name); xml->closeMark (); } -// ========================================================= findQuad +// ========================================================= findQuad int Hexa::findQuad (Quad* element) { for (int nro=0 ; nrointer (quad, bid); - Edge* ecut = pface->getEdge ((ncut+1) MODULO QUAD4); + Edge* ecut = pface->getEdge ((ncut+1) MODULO QUAD4); Vertex* vopp = ecut->getVertex(V_AMONT); if (vopp==o_v0) vopp = ecut->getVertex (V_AVAL); else if (o_v0 != ecut->getVertex (V_AVAL)); { - ecut = pface->getEdge ((ncut+3) MODULO QUAD4); + ecut = pface->getEdge ((ncut+3) MODULO QUAD4); vopp = ecut->getVertex(V_AMONT); if (vopp==o_v0) vopp = ecut->getVertex (V_AVAL); @@ -530,7 +538,7 @@ Elements* Hexa::disconnectQuad (Quad* quad) } } - Quad* new_quad = new Quad (new_node[0], new_node[1], new_node[2], + Quad* new_quad = new Quad (new_node[0], new_node[1], new_node[2], new_node[3]); Quad* new_opp_quad [QUAD4]; @@ -541,7 +549,7 @@ Elements* Hexa::disconnectQuad (Quad* quad) new_opp_quad [nro] = NULL; if (make_quad[nro]) { - int nro1 = (nro+1) MODULO QUAD4; + int nro1 = (nro+1) MODULO QUAD4; Edge* n_edge0 = new_quad->getEdge (nro); Edge* n_edge1 = new_opp_edge [nro]; @@ -551,9 +559,9 @@ Elements* Hexa::disconnectQuad (Quad* quad) int iv3 = n_edge3->inter (n_edge0); if (iv1 <0 || iv3 <0) return NULL; - + Quad* o_face = h_quad [ind_opp_quad [nro]]; - Edge* edge2 = o_face->findEdge (n_edge1->getVertex (1-iv1), + Edge* edge2 = o_face->findEdge (n_edge1->getVertex (1-iv1), n_edge3->getVertex (1-iv3)); if (edge2==NULL) return NULL; @@ -608,7 +616,7 @@ Elements* Hexa::disconnectQuad (Quad* quad) nouveaux->moveDisco (this); return nouveaux; } -// ========================================================= disconnectEdge +// ========================================================= disconnectEdge Elements* Hexa::disconnectEdge (Edge* arete) { int nedge = findEdge (arete); @@ -648,8 +656,8 @@ Elements* Hexa::disconnectEdge (Edge* arete) if ( n_edge[nro]==NULL && h_edge[nro] != NULL && h_edge[nro]->getNbrParents()>2) { - Vertex* va = h_edge[nro]->getVertex (V_AMONT); - Vertex* vb = h_edge[nro]->getVertex (V_AVAL); + Vertex* va = h_edge[nro]->getVertex (V_AMONT); + Vertex* vb = h_edge[nro]->getVertex (V_AVAL); if (va==old_amont) n_edge [nro] = new Edge (new_amont, vb); @@ -662,7 +670,7 @@ Elements* Hexa::disconnectEdge (Edge* arete) } } - // Un quad non remplace, qui contient un edge remplace + // Un quad non remplace, qui contient un edge remplace // commun a plus de 2 Hexas // doit etre duplique @@ -684,8 +692,8 @@ Elements* Hexa::disconnectEdge (Edge* arete) duplic = true; } } - if (duplic) - n_quad[nro] = new Quad (qedge[Q_A], qedge[Q_B], + if (duplic) + n_quad[nro] = new Quad (qedge[Q_A], qedge[Q_B], qedge[Q_C], qedge[Q_D]); } @@ -720,7 +728,7 @@ Elements* Hexa::disconnectEdge (Edge* arete) nouveaux->moveDisco (this); return nouveaux; } -// ========================================================= disconnectVertex +// ========================================================= disconnectVertex Elements* Hexa::disconnectVertex (Vertex* noeud) { if (debug()) @@ -743,7 +751,7 @@ Elements* Hexa::disconnectVertex (Vertex* noeud) { new_quad [nro] = NULL; // Cete face contient le sommet et est commune a 2 hexas - if ( h_quad[nro]->indexVertex(noeud) >= 0 + if ( h_quad[nro]->indexVertex(noeud) >= 0 && h_quad[nro]->getNbrParents () >= 2) { int nbmod = 0; @@ -754,32 +762,32 @@ Elements* Hexa::disconnectVertex (Vertex* noeud) int indv = arete->index (noeud); if (indv>=0) { - nbmod++; + nbmod++; int hed = findEdge (arete); if (hed<0) return NULL; if (new_edge [hed]==NULL) - new_edge [hed] = new Edge (new_node, + new_edge [hed] = new Edge (new_node, arete->getVertex(1-indv)); tedge [qed] = new_edge [hed]; } } if (nbmod!=2) - return NULL; + return NULL; new_quad [nro] = new Quad (tedge[0], tedge[1], tedge[2], tedge[3]); } } Elements* nouveaux = new Elements (el_root); - for (int nro=0 ; nroaddQuad (new_quad[nro]); } - for (int nro=0 ; nromoveDisco (this); return nouveaux; } -// ========================================================= getBase +// ========================================================= getBase int Hexa::getBase (Vertex* orig, Edge* normale) { for (int nq=0 ; nqindexVertex(orig) >= 0 + if ( h_quad[nq]->indexVertex(orig) >= 0 && h_quad[nq]->indexEdge (normale) < 0) return nq; } @@ -815,7 +823,7 @@ void Hexa::replaceQuad (Quad* old, Quad* par) { for (int nro=0 ; nrogetNbrParents (); - + for (int nc=0 ; ncgetParent(nc); @@ -939,11 +947,11 @@ void Hexa::dump () printf (")\n"); printf (" = ("); - + for (int nro=0; nroindexEdge (ed1) >= 0 - && h_quad[nro]->indexEdge (ed2) >= 0) + && h_quad[nro]->indexEdge (ed2) >= 0) return h_quad [nro]; } return NULL; } -// ========================================================= findEdge +// ========================================================= findEdge Edge* Hexa::findEdge (Vertex* v1, Vertex* v2) { for (int nro=0 ; nroindex (v1) >= 0 - && h_edge[nro]->index (v2) >= 0) + && h_edge[nro]->index (v2) >= 0) return h_edge [nro]; } @@ -1079,10 +1087,99 @@ Edge* Hexa::getPerpendicularEdge (Quad* quad, Vertex* vertex) for (int nro=0 ; nroindexEdge (h_edge[nro])<0 && h_edge[nro]->index(vertex)>=0) + if (quad->indexEdge (h_edge[nro])<0 && h_edge[nro]->index(vertex)>=0) return h_edge [nro]; } return NULL; } +// ============================================================ getQuad +Quad* Hexa::getQuad (int nro) +{ + Quad* elt = NULL; + if (nro >=0 && nro < HQ_MAXI && el_status == HOK && h_quad [nro]->isValid()) + elt = h_quad [nro]; + + return elt; +} +// ============================================================ getEdge +Edge* Hexa::getEdge (int nro) +{ + Edge* elt = NULL; + if (nro >=0 && nro < HE_MAXI && el_status == HOK && h_edge [nro]->isValid()) + elt = h_edge [nro]; + + return elt; +} +// ============================================================ getVertex +Vertex* Hexa::getVertex (int nro) +{ + Vertex* elt = NULL; + if (nro >=0 && nro < HV_MAXI && el_status == HOK && h_vertex [nro]->isValid()) + elt = h_vertex [nro]; + + return elt; +} +// ============================================================ getCenter +double* Hexa::getCenter (double centre[]) +{ + centre [dir_x] = centre [dir_y] = centre [dir_z] = 0; + + for (int nv=0 ; nvgetX (); + centre [dir_y] += h_vertex[nv]->getY (); + centre [dir_z] += h_vertex[nv]->getZ (); + } + + centre [dir_x] /= HV_MAXI; + centre [dir_y] /= HV_MAXI; + centre [dir_z] /= HV_MAXI; + return centre; +} +// =============================================================== definedBy +bool Hexa::definedBy (Vertex* v1, Vertex* v2) +{ + for (int n1=0 ; n1< HV_MAXI ; n1++) + { +// ( Diagonale ) Dessus + int n2 = (n1 + 2) MODULO HV_MAXI + HV_MAXI; + if ( (v1 == h_vertex[n1] && v2 == h_vertex[n2]) + || (v1 == h_vertex[n2] && v2 == h_vertex[n1])) return true; + } + return false; +} +// =============================================================== definedBy +bool Hexa::definedBy (Quad* qa, Quad* qb) +{ + for (int nc=0 ; nc< 3 ; nc++) + { + if ( (qa == h_quad[2*nc] && qb == h_quad[2*nc+1]) + || (qa == h_quad[2*nc+1] && qb == h_quad[2*nc])) return true; + } + return false; +} +// =============================================================== setColor +void Hexa::setColor (double val) +{ + for (int nc=0 ; nc< HV_MAXI ; nc++) + h_vertex[nc] -> setColor (val); +} +// ============================================================== markElements +void Hexa::markElements (int marque) +{ + for (int nc=0 ; nc< HQ_MAXI ; nc++) h_quad [nc] -> setMark (marque); + for (int nc=0 ; nc< HE_MAXI ; nc++) h_edge [nc] -> setMark (marque); + for (int nc=0 ; nc< HV_MAXI ; nc++) h_vertex[nc] -> setMark (marque); +} +// =============================================================== duplicate +void Hexa::duplicate () +{ + h_clone = new Hexa (GetClone (h_quad [Q_A]), + GetClone (h_quad [Q_B]), + GetClone (h_quad [Q_C]), + GetClone (h_quad [Q_D]), + GetClone (h_quad [Q_E]), + GetClone (h_quad [Q_F])); +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexHexa.hxx b/src/HEXABLOCK/HexHexa.hxx index 06de28a..5b3895f 100755 --- a/src/HEXABLOCK/HexHexa.hxx +++ b/src/HEXABLOCK/HexHexa.hxx @@ -22,8 +22,8 @@ /* ----------------------------------------------------- - // ---- Numerotation des faces (%x) - + // ---- Numerotation des faces (%x) + 6=bed +----bd-----+ bdf=7 /| /| be | B bf | @@ -37,7 +37,7 @@ | ae A | af | / |/ |/ |/ 0=ace +----ac-----+ acf=1 +-----> x - + * ----------------------------------------------------- */ #ifndef __HEX_HEXA_H_ #define __HEX_HEXA_H_ @@ -50,21 +50,27 @@ BEGIN_NAMESPACE_HEXA -class Hexa : public EltBase +class Hexa : public EltBase { public: virtual Quad* getQuad (int nro); virtual Edge* getEdge (int nro); virtual Vertex* getVertex (int nro); - virtual int countQuad () { return HQ_MAXI; } - virtual int countEdge () { return HE_MAXI; } - virtual int countVertex () { return HV_MAXI; } + void setColor (double valeur); + Hexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf); + +#ifndef SWIG public: - Hexa (Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4, + + Hexa (Vertex* v1, Vertex* v2, Vertex* v3, Vertex* v4, Vertex* v5, Vertex* v6, Vertex* v7, Vertex* v8); - Hexa (Quad* qa, Quad* qb, Quad* qc, Quad* qd, Quad* qe, Quad* qf); + + virtual int countQuad () { return HQ_MAXI; } + virtual int countEdge () { return HE_MAXI; } + virtual int countVertex () { return HV_MAXI; } + Hexa (Hexa* other); Quad* Inter (Hexa* other); bool definedBy (Vertex* v1, Vertex* v2); @@ -72,21 +78,20 @@ public: virtual void dump (); virtual void dumpPlus (); virtual void dumpFull (); - + void razNodes (); int countNodes (); // Compte et numerote les noeuds void printNodes (pfile vtk, int& count); // Impression format vtk void colorNodes (pfile vtk); // Impression scalaires vtk void moveNodes (Matrix* matrice); // transfo controlee ds un ensemble void transform (Matrix* matrice); // transfo indivituelle - void printHexa (pfile vtk); // Impression de la cellule - void printHexaVtk (pfile vtk); // Impression de la cellule + void printHexa (pfile vtk); // Impression de la cellule + void printHexaVtk (pfile vtk); // Impression de la cellule virtual void majReferences(); // M.A.J relation "utilise par" bool hasFreeEdges (); void propager (Propagation* prop, int nro); - void setScalar (double valeur); - void setColor (double valeur) { setScalar (valeur) ; } + void setScalar (double valeur) { setColor (valeur) ; } virtual void saveXml (XmlWriter* xml); @@ -94,6 +99,10 @@ public: Elements* disconnectEdge (Edge* arete); Elements* disconnectVertex (Vertex* noeud); + int disconnectQuad (Quad* face, Elements* dest); + int disconnectEdge (Edge* arete, Elements* dest); + int disconnectVertex (Vertex* noeud, Elements* dest); + int getBase (Vertex* orig, Edge* normale); void replaceQuad (Quad* old, Quad* nouveau); @@ -106,9 +115,9 @@ public: virtual void duplicate (); Hexa* getClone () { return h_clone ; } Quad* getOpposedQuad (Quad* face); - Vertex* getOpposedVertex (Quad* face, Vertex* vertex); + // Vertex* getOpposedVertex (Quad* face, Vertex* vertex); Edge* getPerpendicularEdge (Quad* face, Vertex* vertex); - Edge* getParallelEdge (Quad* face, Edge* edge); + // Edge* getParallelEdge (Quad* face, Edge* edge); Quad* findQuad (Edge* e1, Edge* e2); Edge* findEdge (Vertex* v1, Vertex* v2); @@ -122,8 +131,8 @@ private: void OrdonnerAretes (); // obsolete ? void OrdonnerSommets (); // obsolete ? - void controlerFaces (); // Controle primaire des donnees utilisateur - void controlerSommets (); // Idem; + void controlerFaces (); // Controle primaire des donnees utilisateur + void controlerSommets (); // Idem; void verifierSommets (); // Controle de coherence des quads void verifierAretes (); // Idem @@ -138,97 +147,8 @@ private: Edge* h_edge [HE_MAXI]; Vertex* h_vertex [HV_MAXI]; Hexa* h_clone; +#endif }; -// ------------------------------------------------------------ inlining -// ============================================================ getQuad -inline Quad* Hexa::getQuad (int nro) -{ - Quad* elt = NULL; - if (nro >=0 && nro < HQ_MAXI && el_status == HOK && h_quad [nro]->isValid()) - elt = h_quad [nro]; - - return elt; -} -// ============================================================ getEdge -inline Edge* Hexa::getEdge (int nro) -{ - Edge* elt = NULL; - if (nro >=0 && nro < HE_MAXI && el_status == HOK && h_edge [nro]->isValid()) - elt = h_edge [nro]; - - return elt; -} -// ============================================================ getVertex -inline Vertex* Hexa::getVertex (int nro) -{ - Vertex* elt = NULL; - if (nro >=0 && nro < HV_MAXI && el_status == HOK && h_vertex [nro]->isValid()) - elt = h_vertex [nro]; - - return elt; -} -// ============================================================ getCenter -inline double* Hexa::getCenter (double centre[]) -{ - centre [dir_x] = centre [dir_y] = centre [dir_z] = 0; - - for (int nv=0 ; nvgetX (); - centre [dir_y] += h_vertex[nv]->getY (); - centre [dir_z] += h_vertex[nv]->getZ (); - } - - centre [dir_x] /= HV_MAXI; - centre [dir_y] /= HV_MAXI; - centre [dir_z] /= HV_MAXI; - return centre; -} -// =============================================================== definedBy -inline bool Hexa::definedBy (Vertex* v1, Vertex* v2) -{ - for (int n1=0 ; n1< HV_MAXI ; n1++) - { -// ( Diagonale ) Dessus - int n2 = (n1 + 2) MODULO HV_MAXI + HV_MAXI; - if ( (v1 == h_vertex[n1] && v2 == h_vertex[n2]) - || (v1 == h_vertex[n2] && v2 == h_vertex[n1])) return true; - } - return false; -} -// =============================================================== definedBy -inline bool Hexa::definedBy (Quad* qa, Quad* qb) -{ - for (int nc=0 ; nc< 3 ; nc++) - { - if ( (qa == h_quad[2*nc] && qb == h_quad[2*nc+1]) - || (qa == h_quad[2*nc+1] && qb == h_quad[2*nc])) return true; - } - return false; -} -// =============================================================== setScalar -inline void Hexa::setScalar (double val) -{ - for (int nc=0 ; nc< HV_MAXI ; nc++) - h_vertex[nc] -> setScalar (val); -} -// ============================================================== markElements -inline void Hexa::markElements (int marque) -{ - for (int nc=0 ; nc< HQ_MAXI ; nc++) h_quad [nc] -> setMark (marque); - for (int nc=0 ; nc< HE_MAXI ; nc++) h_edge [nc] -> setMark (marque); - for (int nc=0 ; nc< HV_MAXI ; nc++) h_vertex[nc] -> setMark (marque); -} -// =============================================================== duplicate -inline void Hexa::duplicate () -{ - h_clone = new Hexa (GetClone (h_quad [Q_A]), - GetClone (h_quad [Q_B]), - GetClone (h_quad [Q_C]), - GetClone (h_quad [Q_D]), - GetClone (h_quad [Q_E]), - GetClone (h_quad [Q_F])); -} END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexHexa_disco.cxx b/src/HEXABLOCK/HexHexa_disco.cxx new file mode 100644 index 0000000..c7c803d --- /dev/null +++ b/src/HEXABLOCK/HexHexa_disco.cxx @@ -0,0 +1,440 @@ + +// C++ : Gestion des Hexaedres + +// Copyright (C) 2009-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 +// +#include "HexHexa.hxx" +#include "HexQuad.hxx" + +#include "HexVertex.hxx" +#include "HexDocument.hxx" +#include "HexEdge.hxx" + +#include "HexGlobale.hxx" +#include "HexXmlWriter.hxx" +#include "HexDiagnostics.hxx" +#include "HexGlobale.hxx" +#include "HexMatrix.hxx" +#include "HexElements.hxx" + +BEGIN_NAMESPACE_HEXA + +// ========================================================= disconnectQuad +int Hexa::disconnectQuad (Quad* quad, Elements* nouveaux) +{ + if (debug()) + { + printf (" ... Avant disconnectQuad, quad="); + quad->printName ("\n"); + dumpFull (); + } + + int nface = findQuad (quad); + if (nface==NOTHING) + { + setError (HERR); + Mess << "Quadangle doesn't belong to Hexaedron"; + return HERR; + } + // Face opposee : replace + // int nfopp = (nface MODULO 2==0) ? nface+1 : nface-1; + + int ind_edge [QUAD4], ind_opp_quad [QUAD4]; + bool make_quad [QUAD4], make_edge [QUAD4]; + + for (int nro=0 ; nrogetEdge (nro)); + int pnode = findVertex (quad->getVertex (nro)); + int oppq = findOpposedQuad (quad, quad->getEdge (nro)); + + ind_edge [nro] = pedge; + ind_opp_quad [nro] = oppq; + + if (pedge==NOTHING || pnode==NOTHING || oppq==NOTHING) + { + setError (HERR); + Mess << "Topologic problem(1) for quad's edge nr " << nro; + return HERR; + } + + make_quad [nro] = h_quad[oppq]->getNbrParents() == 2; + make_edge [nro ] = make_edge [nro ] || make_quad [nro]; + make_edge [nro1] = make_edge [nro1] || make_quad [nro]; + + if (debug()) + { + printf (" Sommet nro %d : ", nro); + quad->getVertex(nro)->printName (", "); + printf (" edge = "); + quad->getEdge(nro)->printName (", "); + printf (" quad oppose = "); + h_quad[oppq]->printName(""); + if (make_quad [nro]) + printf (" a dissocier\n"); + else + printf ("\n"); + + } + } + + Vertex* new_node [QUAD4]; + Edge* new_opp_edge [QUAD4]; + Edge* old_opp_edge [QUAD4]; + + for (int nro=0 ; nrogetVertex (nro); + new_node [nro] = new Vertex (o_v0); + if (debug()) + { + printf (" quad.vertex [%d] = ", nro); + quad->getVertex (nro)->printName (" --> "); + new_node [nro]->printName ("\n"); + } + + if (make_edge[nro]) + { + Quad* pface = h_quad [ind_opp_quad [nro]]; + int bid; + int ncut = pface->inter (quad, bid); + Edge* ecut = pface->getEdge ((ncut+1) MODULO QUAD4); + Vertex* vopp = ecut->getVertex(V_AMONT); + if (vopp==o_v0) + vopp = ecut->getVertex (V_AVAL); + else if (o_v0 != ecut->getVertex (V_AVAL)); + { + ecut = pface->getEdge ((ncut+3) MODULO QUAD4); + vopp = ecut->getVertex(V_AMONT); + if (vopp==o_v0) + vopp = ecut->getVertex (V_AVAL); + else if (o_v0 != ecut->getVertex (V_AVAL)) + { + setError (HERR); + Mess << "Topologic problem(2) for quad's edge nr " << nro; + return HERR; + } + } + + old_opp_edge [nro] = ecut; + new_opp_edge [nro] = new Edge (new_node[nro], vopp); + if (debug()) + { + printf (" quad.opp_edge [%d] = ", nro); + old_opp_edge [nro]->printName (" --> "); + new_opp_edge [nro]->printName ("\n"); + } + } + } + + Quad* new_quad = new Quad (new_node[0], new_node[1], new_node[2], + new_node[3]); + + Quad* new_opp_quad [QUAD4]; + Quad* old_opp_quad [QUAD4]; + for (int nro=0 ; nrogetEdge (nro); + Edge* n_edge1 = new_opp_edge [nro]; + Edge* n_edge3 = new_opp_edge [nro1]; + + int iv1 = n_edge1->inter (n_edge0); + int iv3 = n_edge3->inter (n_edge0); + if (iv1 <0 || iv3 <0) + { + setError (HERR); + Mess << "Topologic problem(3) for quad's edge nr " << nro; + return HERR; + } + + Quad* o_face = h_quad [ind_opp_quad [nro]]; + Edge* edge2 = o_face->findEdge (n_edge1->getVertex (1-iv1), + n_edge3->getVertex (1-iv3)); + if (edge2==NULL) + { + setError (HERR); + Mess << "Topologic problem(4) for quad's edge nr " << nro; + return HERR; + } + // Edge* o_edge0 = h_edge [ind_edge [nro]]; + // int sens = 1; + // Edge* edge2 = o_face->getOpposEdge (o_edge0, sens); + + old_opp_quad [nro] = o_face; + if (debug()) + printf (" -------- Quad oppose nro %d\n", nro); + new_opp_quad [nro] = new Quad (n_edge0, n_edge1, edge2, n_edge3); + } + } + + replaceQuad (quad, new_quad); + for (int nro=0 ; nrogetEdge (nro)); + if (make_edge[nro]) + replaceEdge (old_opp_edge [nro], new_opp_edge [nro]); + } + + for (int nro=0 ; nrogetVertex(nro), new_node[nro]); + } + + + h_quad [nface] = new_quad; + if (debug()) + { + printf (" ... Apres disconnectQuad, new_quad="); + new_quad->printName ("\n"); + dumpFull (); + } + + nouveaux->addQuad (new_quad); + for (int nro=0 ; nroaddEdge (new_quad->getEdge (nro)); + nouveaux->addVertex (new_quad->getVertex (nro)); + if (make_edge[nro]) + nouveaux->addEdge (new_opp_edge [nro]); + if (make_quad[nro]) + nouveaux->addQuad (new_opp_quad [nro]); + } + nouveaux->moveDisco (this); + return HOK; +} +// ========================================================= disconnectEdge +int Hexa::disconnectEdge (Edge* arete, Elements* nouveaux) +{ + int nedge = findEdge (arete); + int namont = findVertex (arete->getVertex(V_AMONT)); + int naval = findVertex (arete->getVertex(V_AVAL )); + + if (nedge==NOTHING || namont==NOTHING || naval==NOTHING) + { + setError (HERR); + Mess << "Edge doesn't belong to Hexaedron"; + return HERR; + } + + if (debug()) + { + printf (" ... Avant disconnectEdge, arete="); + arete->printName ("\n"); + dumpFull (); + } + + Edge* n_edge [HE_MAXI]; + Quad* n_quad [HQ_MAXI]; + Vertex* n_vertex [HV_MAXI]; + + for (int nro=0 ; nrogetVertex (V_AMONT); + Vertex* old_aval = arete->getVertex (V_AVAL ); + Vertex* new_amont = n_vertex [namont] = new Vertex (old_amont); + Vertex* new_aval = n_vertex [naval] = new Vertex (old_aval); + n_edge [nedge] = new Edge (new_amont, new_aval); + + // Un edge non remplace, qui contient un vertex remplace + // commun a plus de 2 faces (donc appartenant a un autre hexa) + // doit etre duplique + + for (int nro=0 ; nrogetNbrParents()>2) + { + Vertex* va = h_edge[nro]->getVertex (V_AMONT); + Vertex* vb = h_edge[nro]->getVertex (V_AVAL); + + if (va==old_amont) + n_edge [nro] = new Edge (new_amont, vb); + else if (va==old_aval) + n_edge [nro] = new Edge (new_aval, vb); + else if (vb==old_amont) + n_edge [nro] = new Edge (va, new_amont); + else if (vb==old_aval) + n_edge [nro] = new Edge (va, new_aval); + } + } + + // Un quad non remplace, qui contient un edge remplace + // commun a plus de 2 Hexas + // doit etre duplique + + Globale* glob = Globale::getInstance(); + for (int nro=0 ; nrogetNbrParents()>1) + { + Edge* qedge[QUAD4]; + bool duplic = false; + for (int ned=0 ; nedQuadEdge (nro, (EnumQuad)ned); + if (n_edge [ndup] ==NULL) + qedge [ned] = h_edge[ndup]; + else + { + qedge [ned] = n_edge[ndup]; + duplic = true; + } + } + if (duplic) + n_quad[nro] = new Quad (qedge[Q_A], qedge[Q_B], + qedge[Q_C], qedge[Q_D]); + } + + for (int nro=0 ; nroaddQuad (n_quad[nro]); + } + + for (int nro=0 ; nroaddEdge (n_edge[nro]); + } + + for (int nro=0 ; nroaddVertex (n_vertex[nro]); + } + + if (debug()) + { + printf (" ... Apres disconnectEdge\n"); + dumpFull (); + } + + nouveaux->moveDisco (this); + return HOK; +} +// ========================================================= disconnectVertex +int Hexa::disconnectVertex (Vertex* noeud, Elements* nouveaux) +{ + if (debug()) + { + printf (" ... Avant disconnectVertex, vertex="); + noeud->printName ("\n"); + dumpFull (); + } + + int node = findVertex (noeud); + if (node==NOTHING) + { + setError (HERR); + Mess << "Vertex doesn't belong to Hexaedron"; + return HERR; + } + + Vertex* new_node = new Vertex (noeud); + Quad* new_quad [HQ_MAXI]; + Edge* new_edge [HE_MAXI]; + + for (int nro=0 ; nroindexVertex(noeud) >= 0 + && h_quad[nro]->getNbrParents () >= 2) + { + int nbmod = 0; + Edge* tedge [QUAD4]; + for (int qed=0 ; qedgetEdge (qed); + int indv = arete->index (noeud); + if (indv>=0) + { + nbmod++; + int hed = findEdge (arete); + if (hed<0) + { + setError (HERR); + Mess << "Topologic problem(1) for face nr " << nro; + return HERR; + } + if (new_edge [hed]==NULL) + new_edge [hed] = new Edge (new_node, + arete->getVertex(1-indv)); + tedge [qed] = new_edge [hed]; + } + } + if (nbmod!=2) + { + setError (HERR); + Mess << "Topologic problem(2) for face nr " << nro; + return HERR; + } + new_quad [nro] = new Quad (tedge[0], tedge[1], tedge[2], tedge[3]); + } + } + + for (int nro=0 ; nroaddQuad (new_quad[nro]); + } + + for (int nro=0 ; nroaddEdge (new_edge[nro]); + } + + replaceVertex (noeud, new_node); + nouveaux->addVertex (new_node); + + if (debug()) + { + printf (" ... Apres disconnectVertex\n"); + dumpFull (); + } + + nouveaux->moveDisco (this); + return HOK; +} +END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexKasBiCylinder.cxx b/src/HEXABLOCK/HexKasBiCylinder.cxx deleted file mode 100755 index dedc902..0000000 --- a/src/HEXABLOCK/HexKasBiCylinder.cxx +++ /dev/null @@ -1,300 +0,0 @@ -// -// CC++ : Interface Cascade de la classe Elements -// -// Copyright (C) 2009-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 -// - -#include "HexKasBiCylinder.hxx" -#include "HexKasLine.hxx" -#include "HexKas_functions.hxx" - -#ifndef NO_CASCADE - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -// HEXABLOCK includes -#include "HexVertex.hxx" -#include "HexEdge.hxx" -#include "HexOldShape.hxx" -#include "HexDiagnostics.hxx" - // Cercles -#include -#include - -#include -#include - -#include -#include - -#include - // Sphere -#include - // Cylindre -#include -#include -#include -#include - // Decoupage -#include -#include - -BEGIN_NAMESPACE_HEXA - -static bool db = false; - -static KasBiCylinder current_bicyl; - -// ====================================================== purge -void KasBiCylinder::purge () -{ - no_inter = true; - inter_line.clear (); -} -// ====================================================== defineCyls -int KasBiCylinder::defineCyls (double* borig, double* bnorm, double* bbase, - double brayon, double bhaut, - double* sorig, double* snorm, double* sbase, - double srayon, double shaut) -{ - db = on_debug (); - purge (); - if (db) - { - printf (" ====================== defineCyls\n"); - printf (" ----- borig=(%g,%g,%g)\n", borig[0], borig[1], borig[2]); - printf (" ----- bbase=(%g,%g,%g)\n", bbase[0], bbase[1], bbase[2]); - printf (" ----- bnorm=(%g,%g,%g)\n", bnorm[0], bnorm[1], bnorm[2]); - printf (" ----- brayon=%g, bhaut=%g\n", brayon, bhaut); - printf ("\n"); - printf (" ----- sorig=(%g,%g,%g)\n", sorig[0], sorig[1], sorig[2]); - printf (" ----- sbase=(%g,%g,%g)\n", sbase[0], sbase[1], sbase[2]); - printf (" ----- snorm=(%g,%g,%g)\n", snorm[0], snorm[1], snorm[2]); - printf (" ----- srayon=%g, shaut=%g\n", srayon, shaut); - } - - // --------------------------- Preparation - gp_Pnt gpb_orig (borig [dir_x], borig [dir_y], borig [dir_z]); - gp_Vec gpb_norm (bnorm [dir_x], bnorm [dir_y], bnorm [dir_z]); - gp_Vec gpb_vx (bbase [dir_x], bbase [dir_y], bbase [dir_z]); - gp_Ax2 gpb_axes (gpb_orig, gpb_norm, gpb_vx); -// gp_Ax2 gp_axes (gp_center, gp_norm, gp_vx); - - BRepPrimAPI_MakeCylinder make_bcyl (gpb_axes, brayon, bhaut); - make_bcyl.Build(); - - gp_Pnt gps_orig (sorig [dir_x], sorig [dir_y], sorig [dir_z]); - gp_Vec gps_vx (sbase [dir_x], sbase [dir_y], sbase [dir_z]); - gp_Vec gps_norm (snorm [dir_x], snorm [dir_y], snorm [dir_z]); - gp_Ax2 gps_axes (gps_orig, gps_norm, gpb_vx); - - BRepPrimAPI_MakeCylinder make_scyl (gps_axes, srayon, shaut); - make_scyl.Build(); - - if (NOT make_bcyl.IsDone()) - { - printf ("defineCyls : Can' build big cylinder\n"); - return HERR; - } - else if (NOT make_scyl.IsDone()) - { - printf ("defineCyls : Can' build small cylinder\n"); - return HERR; - } - // --------------------------- Intersection - - TopoDS_Shape cyl_big = make_bcyl.Shape(); - TopoDS_Shape cyl_small = make_scyl.Shape(); - - BRepAlgoAPI_Section make_inter (cyl_big, cyl_small, false); - make_inter.Approximation (true); - make_inter.Build(); - - if (NOT make_inter.IsDone()) - { - printf ("defineCyls : No intersection\n"); - return HERR; - } - - TopoDS_Shape cyl_inter = make_inter.Shape(); - // geom_make_brep (cyl_inter, brep); - - // --------------------------- Recuperation - string crep; - Shape shape (crep); - - TopExp_Explorer explo (cyl_inter, TopAbs_EDGE); - int nroline = 0; - static int nbrep = 0; - while (explo.More()) - { - TopoDS_Shape ligne = explo.Current(); - // TopoDS_Edge ligne = explo.Current(); - explo.Next (); - - if (db) - cout << "____________________________________ Ligne suivante" - << endl; - geom_make_brep (ligne, crep); - if (db) - { - cout << "---- save_brep inter" << nbrep+1 << ".brep" << endl; - save_brep ("inter", crep, nbrep); - } - shape.setBrep (crep); - - KasLine* geom_line = new KasLine (&shape); - inter_line.push_back (geom_line); - nroline ++; - } - return HOK; -} -// ====================================================== anaVertex -// === Trouve le(s) ligne(s) contenant ce vertex et le(s) parametre(s) -int KasBiCylinder::anaVertex (Vertex* node, int* tline, double* tpara) -{ - Real3 point; - node->getPoint (point); - int nbsol = 0; - int nblines = inter_line.size(); - - for (int nl=0 ; nlfindParam (point); - if (param>=0) - { - if (db) - cout << " ... findParam " << node->getName() - << ", point=(" << point[0] << ", " << point[1] - << ", " << point[2] - << "), nl=" << nl << ", param=" << param << endl; - if (nbsol>=2) - return nbsol; - - tline [nbsol] = nl; - tpara [nbsol] = param; - nbsol ++; - } - } - - if (nbsol==1) - { - if (tpara[0]<=Epsil) - { - nbsol ++; - tpara[1] = 1.0; - tline[1] = tline[0]-1; - if (tline[1] <0) tline[1] = nblines-1; - } - else if (tpara[0]>=UnEpsil) - { - nbsol ++; - tpara[1] = 0; - tline[1] = tline[0]+1; - if (tline[1] >= nblines) tline[1] = 0; - } - } - - return nbsol; -} -// ====================================================== associate -// ==== On suppose une orientation correcte -int KasBiCylinder::associate (Edge* edge) -{ - edge->clearAssociation (); - - double tparam1 [V_TWO], tparam2 [V_TWO]; - int tline1 [V_TWO], tline2 [V_TWO]; - int sol1 = anaVertex (edge->getVertex(V_AMONT), tline1, tparam1); - int sol2 = anaVertex (edge->getVertex(V_AVAL), tline2, tparam2); - - if (sol1==0 || sol2==0) - return HERR; - // Ligne commune ? - for (int ns1=0 ; ns1= 1.0-Epsil && param1 <= 1.0+Epsil) - param1 = 0.0; - if (param2 >= -Epsil && param2 <= Epsil) - param2 = 1.0; - if (param1 < param2) - inter_line[nlig]->assoEdge (edge, param1, param2, 2); - else - // Le debut de la ligne (fermee) est entre les 2 vertex) - { - inter_line[nlig]->assoEdge (edge, param1, 1.0, V_AMONT); - inter_line[nlig]->assoEdge (edge, 0.0, param2, V_AVAL); - } - return HOK; - } - } - } - - inter_line[tline1[0]]->assoEdge (edge, tparam1[0], 1.0, V_AMONT); - inter_line[tline2[0]]->assoEdge (edge, 0, tparam2[0], V_AVAL); - return HOK; -} -// ====================================================== geom_create_cylcyl -int geom_create_cylcyl (double* borig, double* bnorm, double* bbase, - double bray, double bhaut, - double* sorig, double* snorm, double* sbase, - double sray, double shaut) -{ - int ier = current_bicyl.defineCyls (borig, bnorm, bbase, bray, bhaut, - sorig, snorm, sbase, sray, shaut); - return ier; -} -// ====================================================== geom_asso_cylcyl -int geom_asso_cylcyl (Edge* edge) -{ - if (db) - cout << " ___________________________________ geom_asso_cylcyl " - << edge->getName () << " = (" << edge->getVertex(0)->getName () - << "," << edge->getVertex(1)->getName () - << ")" << endl; - - int ier = current_bicyl.associate (edge); - return ier; -} -END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexKasLine.cxx b/src/HEXABLOCK/HexKasLine.cxx deleted file mode 100755 index cac2a72..0000000 --- a/src/HEXABLOCK/HexKasLine.cxx +++ /dev/null @@ -1,443 +0,0 @@ -// -// CC++ : Implementation Cascade des lignes -// -// Copyright (C) 2009-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 -// - -#include "HexKasLine.hxx" -#include "HexKasPoint.hxx" -#include "HexKas_functions.hxx" - -#ifndef NO_CASCADE - -#include -#include -#include -#include -#include - -#include - -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -// HEXABLOCK includes -#include "HexVertex.hxx" -#include "HexEdge.hxx" -#include "HexOldShape.hxx" -#include "HexDiagnostics.hxx" - -#include - -BEGIN_NAMESPACE_HEXA - -static bool db = on_debug (); -static const double TolAsso = 1e-2; // Tolerance pour les associations - -void arrondir (double &val); - -// ======================================================= Constructeur -KasLine::KasLine () -{ - lig_brep = ""; - lig_debut = 0; - lig_fin = 1; - geom_inverse = false; - start_absc = 0; - end_absc = 1; - geom_rang = NOTHING; - - // geom_line = TopoDS::Edge(shape); - geom_curve = NULL; - geom_length = 0; - geom_total_length = 0; - for (int nc=0; nc getBrep (); - lig_ident = asso->getIdent (); - lig_ior = asso->getIor (); - - if (fin<0.0) - { - lig_debut = asso->getStart();; - lig_fin = asso->getEnd();; - } - else if (deb >= UnEpsil) - { - lig_debut = fin; - lig_fin = deb ; - } - else - { - lig_debut = deb; - lig_fin = fin; - } - - geom_inverse = false; - start_absc = 0; - end_absc = 1; - - istringstream streamBrep (lig_brep); - BRep_Builder aBuilder; - TopoDS_Shape topo; - - BRepTools::Read(topo, streamBrep, aBuilder); - geom_line = TopoDS::Edge(topo); - delete geom_curve; - geom_curve = new BRepAdaptor_Curve (geom_line); - // Longueur de la ligne - double umin = 0, umax = 0; - TopLoc_Location loc; - Handle(Geom_Curve) handle = BRep_Tool::Curve (geom_line, loc, umin, umax); - GeomAdaptor_Curve AdaptCurve (handle); - geom_total_length = GCPnts_AbscissaPoint::Length(AdaptCurve, umin, umax); - geom_length = geom_total_length * fabs (lig_fin-lig_debut); - - // Extremites - GCPnts_AbscissaPoint s1 (*geom_curve, geom_total_length*lig_debut, - geom_curve->FirstParameter()); - GCPnts_AbscissaPoint s2 (*geom_curve, geom_total_length*lig_fin, - geom_curve->FirstParameter()); - - par_mini = s1.Parameter (); - par_maxi = s2.Parameter (); - start_gpoint = geom_curve->Value (par_mini); - end_gpoint = geom_curve->Value (par_maxi); - majCoord (); - - if (db) - { - Echo (" ____________________________________ KasLine::defineLine"); - HexDisplay (deb); - HexDisplay (fin); - HexDisplay (lig_debut); - HexDisplay (lig_fin); - HexDisplay (geom_total_length); - HexDisplay (geom_curve->FirstParameter()); - HexDisplay (s1.Parameter()); - HexDisplay (s2.Parameter()); - - PutCoord (start_coord); - PutCoord (end_coord); - } -} -// ========================================================= assoPoint -void KasLine::assoPoint (double abscis, Vertex* node) -{ - GCPnts_AbscissaPoint s1 (*geom_curve, abscis, - geom_curve->FirstParameter()); - double gparam = s1.Parameter (); - gp_Pnt pnt_asso = geom_curve->Value (gparam); - - KasPoint gpoint; - gpoint.definePoint (pnt_asso); - gpoint.associate (node); - - if (db) - { - double* coord = gpoint.getCoord(); - char car = '%'; - if (node->definedBy (coord[dir_x], coord[dir_y], coord[dir_z])) - car= ' '; - printf (" ... assoPoint%c: v=%s (%g,%g,%g), p=%g", car, - node->getName(), node->getX(), node->getY(), node->getZ(), abscis); - - printf (" -> (%g,%g,%g)\n", coord[dir_x], coord[dir_y], coord[dir_z]); - } -} -// ========================================================= associate -void KasLine::associate (Edge* edge, double sm1, double sm2, int vorig) -{ - if (sm2 < start_absc) return; - if (sm1 > end_absc) return; - - Vertex* segment[V_TWO] = { edge->getVertex (vorig), - edge->getVertex (1-vorig) }; - - double vpara1 = lig_debut + (sm1-start_absc)/geom_total_length; - double vpara2 = lig_debut + (sm2-start_absc)/geom_total_length; - if (geom_inverse) - { - vpara2 = lig_fin - (sm1-start_absc)/geom_total_length; - vpara1 = lig_fin - (sm2-start_absc)/geom_total_length; - } - - double lpara1 = std::max (lig_debut, std::min (lig_fin, vpara1)); - double lpara2 = std::max (lig_debut, std::min (lig_fin, vpara2)); - - arrondir (vpara1); arrondir (vpara2); - arrondir (lpara1); arrondir (lpara2); - - if (db) - { - cout << " ++ KasLine::associate : rg=" << geom_rang << "s=" << vorig - << endl; - cout << " ligpara = [ " << lig_debut << ", " << lig_fin << " ]" << endl; - cout << " absc = [ " << start_absc << ", " << end_absc << " ]\n" ; - - cout << " Edge = " << edge->getName() << - " = [ " << segment[0]->getName() << ", " - << "," << segment[1]->getName() << endl; - cout << " smx = [ " << sm1 << ", " << sm2 << " ]" << endl; - cout << " vparam = [ " << vpara1 << ", " << vpara2 << " ]" << endl; - cout << " lparam = [ " << lpara1 << ", " << lpara2 << " ]" << endl; - } - - if (lpara2 >= lpara1 + TolAsso) - { - assoEdge (edge, lpara1, lpara2); - } - else if (db) - { - printf (" Asso Line refusee %s -> (%g,%g)\n", edge->getName(), - lpara1, lpara2); - } - - // ---------------Association du vertex - double hparam = geom_inverse ? vpara2 : vpara1; - double smx = sm1; - double absc1 = start_absc - TolAsso*geom_total_length; - double absc2 = end_absc + TolAsso*geom_total_length; - - for (int nx=V_AMONT ; nx<=V_AVAL ; nx++) - { - if (smx >= absc1 && smx <= absc2) - { - Vertex* node = segment [nx]; - if (node->getAssociation()==NULL) - { - // ..... Coordonnees du point - - double abscis = geom_total_length*hparam; - GCPnts_AbscissaPoint s1 (*geom_curve, abscis, - geom_curve->FirstParameter()); - double gparam = s1.Parameter (); - gp_Pnt pnt_asso = geom_curve->Value (gparam); - - // ..... Creation d'un vertex Geom - KasPoint gpoint; - gpoint.definePoint (pnt_asso); - gpoint.associate (node); - if (db) - { - double* ass = gpoint.getCoord(); - printf (" Asso Point %s (%g,%g,%g) -> (%g,%g,%g) p=%g s=%g\n", - node->getName(), node->getX(), node->getY(), node->getZ(), - ass[dir_x], ass[dir_y], ass[dir_z], hparam, smx); - } - } - else if (db) - { - double abscis = geom_total_length*hparam; - GCPnts_AbscissaPoint s1 (*geom_curve, abscis, - geom_curve->FirstParameter()); - double gparam = s1.Parameter (); - gp_Pnt pnt_asso = geom_curve->Value (gparam); - - // ..... Creation d'un vertex Geom - KasPoint gpoint; - gpoint.definePoint (pnt_asso); - double* ass = gpoint.getCoord(); - // gpoint.associate (node); - printf (" Asso Point %s (%g,%g,%g) -> (%g,%g,%g) p=%g s=%g\n", - node->getName(), - node->getX(), node->getY(), node->getZ(), - ass[dir_x], ass[dir_y], ass[dir_z], hparam, smx); - - gpoint.definePoint (node); - ass = gpoint.getCoord(); - printf (" ignore car deja associe a (%g,%g, %g)\n", - ass[dir_x], ass[dir_y], ass[dir_z]); - } - } - hparam = geom_inverse ? vpara1 : vpara2; - smx = sm2; - } -} -// ========================================================= assoEdge -void KasLine::assoEdge (Edge* edge, double para1, double para2, int vass) -{ - Shape* shape = new Shape (lig_brep); - shape->setIdent (lig_ident); - shape->setIor (lig_ior); - shape->setBounds (para1, para2); - - edge ->addAssociation (shape); - - if (db) printf (" ... Asso Edge %s -> (%g,%g)\n", - edge->getName(), para1, para2); - - double lg = geom_total_length; - switch (vass) - { - case V_AMONT : - assoPoint (para1*lg, edge->getVertex (V_AMONT)); - break; - case V_AVAL : - assoPoint (para2*lg, edge->getVertex (V_AVAL)); - break; - case V_TWO : - assoPoint (para1*lg, edge->getVertex (V_AMONT)); - assoPoint (para2*lg, edge->getVertex (V_AVAL )); - break; - default :; - } -} -// ========================================================= majCoord -void KasLine::majCoord () -{ - start_coord [dir_x] = start_gpoint.X(); - start_coord [dir_y] = start_gpoint.Y(); - start_coord [dir_z] = start_gpoint.Z(); - - end_coord [dir_x] = end_gpoint.X(); - end_coord [dir_y] = end_gpoint.Y(); - end_coord [dir_z] = end_gpoint.Z(); -} -// ========================================================= setBounds -void KasLine::setBounds (double deb, double fin) -{ - lig_debut = deb; - lig_fin = fin; -} -// ========================================================= inverser -void KasLine::inverser () -{ - gp_Pnt foo = start_gpoint; - start_gpoint = end_gpoint; - end_gpoint = foo; - - // Prendre le complementaire de l'intercvale initial - if (lig_debut > Epsil && lig_debut < UnEpsil) - { - lig_fin = lig_debut; - lig_debut = 0; - if (db) - cout << " ... inverser : fin = debut = " << lig_fin << endl; - } - else if (lig_fin > Epsil && lig_fin < UnEpsil) - { - lig_debut = lig_fin; - lig_fin = 1; - if (db) - cout << " ... inverser : debut = fin = " << lig_debut << endl; - } - - geom_inverse = NOT geom_inverse; - majCoord (); -} -// ========================================================= setRank -void KasLine::setRank (int nro, int sens, double& abscisse) -{ - if (sens==V_AVAL) - inverser (); - - geom_rang = nro; - start_absc = abscisse; - abscisse = end_absc = start_absc + (lig_fin-lig_debut) * geom_total_length; - - if (db) - { - cout << "KasLine::setRank : nro = " << nro << " sens=" << sens - << " = (" << start_absc << ", " << end_absc << ")" << endl; - } -} -// ========================================================= findBound -int KasLine::findBound (double* coord) -{ - if (same_coords (coord, start_coord) ) - return V_AMONT; - - if (same_coords (coord, end_coord) ) - return V_AVAL; - - return NOTHING; -} -// ========================================================= findParam -double KasLine::findParam (double* coord) -{ - double umin = 0, umax = 0; - gp_Pnt gpoint (coord[dir_x], coord[dir_y], coord[dir_z]); - Handle(Geom_Curve) handle = BRep_Tool::Curve (geom_line, umin, umax); - - GeomAPI_ProjectPointOnCurve projector (gpoint, handle); - if ( projector.NbPoints() == 0 ) - return -1.0; - - double gparam = projector.LowerDistanceParameter(); - if (gparam par_maxi) - { - // cout << " Rejet : " << gparam << " not in (" << par_mini - // << ", " << par_maxi << ")" << endl; - return -1.0; - } - - gp_Pnt rpoint = geom_curve->Value (gparam); - if (NOT same_coords (gpoint, rpoint)) - { - // cout << " Rejet : points differents " << endl; - return -1.0; - } - - - GeomAdaptor_Curve adapt_curve (handle); - double abscis = GCPnts_AbscissaPoint::Length (adapt_curve, umin, gparam); - double hparam = abscis/geom_total_length; - - // gparam = (gparam-par_mini) / (par_maxi-par_mini); - return hparam; -} -// ========================================================= arrondir -void arrondir (double &val) -{ - if (val >= -TolAsso && val <= TolAsso) - { - val = 0.0; - } - else if (val >= 1.0-TolAsso && val <= 1.0+TolAsso) - { - val = 1.0; - } -} -END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexKasLine.hxx b/src/HEXABLOCK/HexKasLine.hxx deleted file mode 100755 index 82366af..0000000 --- a/src/HEXABLOCK/HexKasLine.hxx +++ /dev/null @@ -1,83 +0,0 @@ -// -// CC++ : Interface Cascade de la ligne -// -// Copyright (C) 2009-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 -// - -#ifndef __KAS_LINE_HXX_ -#define __KAS_LINE_HXX_ - -#include "HexGlobale.hxx" - -#ifndef NO_CASCADE - -#include -#include - -BEGIN_NAMESPACE_HEXA - -class KasPoint; - -class KasLine -{ -public : - KasLine (); - KasLine (Shape* shape, double deb=-1.0, double fin=-1.0); - ~KasLine (); - - int findBound (double* point); - // void setAbscissa (double total, double& abscisse); - void inverser (); - void setBounds (double deb, double fin); - - double* getStart () { return start_coord ; } - double* getEnd () { return end_coord ; } - double getLength () { return geom_length ; } - double getRank () { return geom_rang ; } - - void defineLine (Shape* asso, double deb=-1.0, double fin=-1.0); - void setRank (int rang, int sens, double& abscisse); - void associate (Edge* edge, double sm1, double sm2, int orig=V_AMONT); - void assoEdge (Edge* edge, double pm1, double pm2, int vass=NOTHING); - void assoPoint (double alpha, Vertex* node); - - double findParam (double* point); - -private : - void majCoord (); - -private : - string lig_brep, lig_ident, lig_ior; - double lig_debut, lig_fin; - double par_mini, par_maxi; - - bool geom_inverse; - int geom_rang; - Real3 start_coord, end_coord; - double start_absc, end_absc; // Abscisse globale - double geom_length; - double geom_total_length; - - gp_Pnt start_gpoint, end_gpoint; - TopoDS_Edge geom_line; - BRepAdaptor_Curve* geom_curve; -}; -END_NAMESPACE_HEXA -#endif -#endif diff --git a/src/HEXABLOCK/HexKasPoint.cxx b/src/HEXABLOCK/HexKasPoint.cxx deleted file mode 100755 index e42562c..0000000 --- a/src/HEXABLOCK/HexKasPoint.cxx +++ /dev/null @@ -1,138 +0,0 @@ -// -// CC++ : Interface Cascade de la classe Elements -// -// Copyright (C) 2009-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 -// - -#include "HexKasPoint.hxx" -#include "HexVertex.hxx" -#include "HexOldShape.hxx" - -#ifndef NO_CASCADE - -#include -#include -#include - -#include - -#include -#include -#include - -#include - -BEGIN_NAMESPACE_HEXA - -static bool db = false; - -// ======================================================= Constructeur -KasPoint::KasPoint () -{ - db = on_debug(); - razPoint (); -} -// ======================================================= razPoint -void KasPoint::razPoint () -{ - is_ok = false; - b_rep = ""; - for (int nc=0; nc getAssociation(); - if (asso==NULL) - return HERR; - - b_rep = asso->getBrep (); - - TopoDS_Shape topo; - istringstream streamBrep(b_rep); - BRep_Builder aBuilder; - BRepTools::Read(topo, streamBrep, aBuilder); - - if (topo.ShapeType() != TopAbs_VERTEX) - return HERR; - - is_ok = true; - g_vertex = TopoDS::Vertex (topo); - g_point = BRep_Tool::Pnt( g_vertex ); - - g_coord [dir_x] = g_point.X(); - g_coord [dir_y] = g_point.Y(); - g_coord [dir_z] = g_point.Z(); - return HOK; -#endif -} -// ======================================================= definePoint (xyz) -void KasPoint::definePoint (Real3 coord) -{ - gp_Pnt gpoint (coord[dir_x], coord[dir_y], coord[dir_z]); - definePoint (gpoint); -} -// ======================================================= definePoint (g_pnt) -void KasPoint::definePoint (gp_Pnt& gpoint) -{ - is_ok = true; - g_point = gpoint; - - ostringstream stream_shape; - - BRepBuilderAPI_MakeVertex mkVertex (g_point); - TopoDS_Shape aShape = mkVertex.Shape(); - BRepTools::Write(aShape, stream_shape); - - g_vertex = TopoDS::Vertex( aShape ); - b_rep = stream_shape.str(); - - g_coord [dir_x] = g_point.X(); - g_coord [dir_y] = g_point.Y(); - g_coord [dir_z] = g_point.Z(); - - if (db) - { - cout << " KasPoint::definePoint :" << endl; - PutCoord (g_coord); - } -} -// ======================================================= associate -void KasPoint::associate (Vertex* node) -{ -/**************** - if (db) cout << " ++ KasPoint::associate " << endl; - if (db) PutName (node); - if (node==NULL) - return; - - Shape* vshape = new Shape (b_rep); - node->setAssociation (vshape); - -*********************/ -} -END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexKasPoint.hxx b/src/HEXABLOCK/HexKasPoint.hxx deleted file mode 100755 index 0559dd5..0000000 --- a/src/HEXABLOCK/HexKasPoint.hxx +++ /dev/null @@ -1,61 +0,0 @@ -// -// CC++ : Representation Cascade d'un point -// -// Copyright (C) 2009-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 -// - -#ifndef __KAS_POINT_HXX_ -#define __KAS_POINT_HXX_ - -#include "HexGlobale.hxx" - -#ifndef NO_CASCADE - -#include -#include - -BEGIN_NAMESPACE_HEXA -class KasPoint -{ -public : - KasPoint (); - - double* getCoord () { return g_coord; } - bool isOk () { return is_ok; } - bool isBad () { return NOT is_ok; } - - void associate (Vertex* node); - void razPoint (); - int definePoint (Vertex* node); - void definePoint (double* coord); - void definePoint (gp_Pnt& gpoint); - - TopoDS_Vertex& getVertex () { return g_vertex; } - -private : - string b_rep; - Real3 g_coord; - bool is_ok; - - TopoDS_Vertex g_vertex; - gp_Pnt g_point; -}; -END_NAMESPACE_HEXA -#endif -#endif diff --git a/src/HEXABLOCK/HexKas_functions.cxx b/src/HEXABLOCK/HexKas_functions.cxx index 4a847d3..0028452 100755 --- a/src/HEXABLOCK/HexKas_functions.cxx +++ b/src/HEXABLOCK/HexKas_functions.cxx @@ -17,12 +17,12 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #include "HexKas_functions.hxx" - -#ifndef NO_CASCADE +// #include "HexEdge.hxx" #include #include @@ -33,6 +33,8 @@ #include +#include + BEGIN_NAMESPACE_HEXA // ====================================================== same_coords @@ -97,13 +99,25 @@ int geom_brep2point (rcstring brep, double& px, double& py, double& pz) pz = g_point.Z(); return HOK; } -END_NAMESPACE_HEXA +// ====================================================== clear_associations +// void clear_associations (Edge* edge) +// { + // edge->clearAssociation(); + // edge->getVertex(V_AMONT)->clearAssociation(); + // edge->getVertex(V_AVAL )->clearAssociation(); +// } +// ====================================================== clean_brep +void clean_brep (string& brep) +{ + TopoDS_Shape shape; + BRep_Builder builder; + istringstream stream_brep (brep); -#else // *************************************************** NO_CASCADE + BRepTools::Read (shape, stream_brep, builder); + BRepTools::Clean (shape); -BEGIN_NAMESPACE_HEXA -int geom_brep2point (rcstring b, double& x, double& y, double& z) {return HOK;} -int geom_brep2shape (rcstring brep, TopoDS_Shape& shape) {return HOK ; } -TopoDS_Shape geom_brep2shape (rcstring brep) {return O ; } + ostringstream stream_shape; + BRepTools::Write (shape, stream_shape); + brep = stream_shape.str(); +} END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexMatrix.hxx b/src/HEXABLOCK/HexMatrix.hxx index 3103f06..255d008 100755 --- a/src/HEXABLOCK/HexMatrix.hxx +++ b/src/HEXABLOCK/HexMatrix.hxx @@ -30,7 +30,7 @@ BEGIN_NAMESPACE_HEXA -class Matrix +class Matrix { public: Matrix (); @@ -38,12 +38,17 @@ public: int defTranslation (double* depl); int defScale (Vertex* center, double scale); int defScale (double* center, double scale); - int defRotation (Vertex* center, Vector* depl, double degres); + int defRotation (Vertex* center, Vector* axe, double degres); + int defRotation (Vertex* center, double* axe, double degres); int defSymmetryPoint (Vertex* center); int defSymmetryLine (Vertex* center, Vector* dir); int defSymmetryPlane (Vertex* center, Vector* normale); - int perform (Vertex* noeud); + void define (double* orig, double* iprim, double* jprim, double* kprim); + + void perform (Vertex* noeud); + void perform (double* point); + void perform (double* point, double* result); void getCoeff (double& a11, double& a12, double& a13, double& a14, double& a21, double& a22, double& a23, double& a24, @@ -70,7 +75,7 @@ inline void Matrix::erase () mat11 = mat22 = mat33 = 1.0; } // ========================================================= perform -inline int Matrix::perform (Vertex* noeud) +inline void Matrix::perform (Vertex* noeud) { double px, py, pz; px = mat11*noeud->getX()+mat12*noeud->getY()+mat13*noeud->getZ()+mat14; @@ -78,7 +83,6 @@ inline int Matrix::perform (Vertex* noeud) pz = mat31*noeud->getX()+mat32*noeud->getY()+mat33*noeud->getZ()+mat34; noeud->setCoord (px, py, pz); - return HOK; } // ========================================================= defTranslation inline int Matrix::defTranslation (Vector* boulevard) @@ -129,17 +133,19 @@ inline int Matrix::defScale (Vertex* center, double scale) return ier; } // ========================================================= defRotation -inline int Matrix::defRotation (Vertex* center, Vector* dir, double degres) +inline int Matrix::defRotation (Vertex* center, double* axe, double degres) { erase(); + if (BadElement (center)) + return HERR; - double normed = dir->getNorm (); - if (normed< 1e-30) + double norme = calc_norme (axe); + if (norme< 1e-30) return HERR; - double ux = dir->getDx () / normed; - double uy = dir->getDy () / normed; - double uz = dir->getDz () / normed; + double ux = axe [dir_x] / norme; + double uy = axe [dir_y] / norme; + double uz = axe [dir_z] / norme; double cx = center->getX (); double cy = center->getY (); @@ -166,6 +172,17 @@ inline int Matrix::defRotation (Vertex* center, Vector* dir, double degres) return HOK; } +// ========================================================= defRotation +inline int Matrix::defRotation (Vertex* center, Vector* dir, double degres) +{ + if (BadElement (dir)) + return HERR; + + Real3 axe; + dir->getCoord (axe); + int ier = defRotation (center, axe, degres); + return ier; +} // ========================================================= defSymmetryPoint inline int Matrix::defSymmetryPoint (Vertex* center) { @@ -183,11 +200,11 @@ inline int Matrix::defSymmetryPoint (Vertex* center) // MH.d = 0 (1) // CH = lambda*d (2) // MM' = 2MH (3) -// +// // (1) et (2) => lambda = ((x-xc)*xd + (y-yc)*yd + (z-zc)*zd) / norme(d) // // MM' = 2MH (3) -// <=> MO + OM' = 2 (MO + OC + CH) +// <=> MO + OM' = 2 (MO + OC + CH) // <=> OM' = MO + 2.OC + 2.CH // <=> OM' = -OM + 2.OC + 2.lambda.d (2) et (3) // @@ -232,7 +249,7 @@ inline int Matrix::defSymmetryLine (Vertex* center, Vector* dir) // CH.n = 0 (1) // MH = lambda*n (2) // MM' = 2MH (3) -// +// // (1) et (2) => lambda = ((x-xc)*xn + (y-yc)*yn + (z-zc)*zn) / norme(n) // // MM' = 2MH (3) @@ -280,6 +297,26 @@ inline int Matrix::defSymmetryPlane (Vertex* center, Vector* normale) return HOK; } +// ========================================================= define +inline void Matrix::define (double* omega, double* iprim, double* jprim, + double* kprim) +{ + mat11 = iprim [dir_x]; + mat21 = iprim [dir_y]; + mat31 = iprim [dir_z]; + + mat12 = jprim [dir_x]; + mat22 = jprim [dir_y]; + mat32 = jprim [dir_z]; + + mat13 = kprim [dir_x]; + mat23 = kprim [dir_y]; + mat33 = kprim [dir_z]; + + mat14 = omega [dir_x]; + mat24 = omega [dir_y]; + mat34 = omega [dir_z]; +} // ========================================================= getCoeff inline void Matrix::getCoeff(double& a11, double& a12, double& a13, double& a14, double& a21, double& a22, double& a23, double& a24, @@ -300,5 +337,27 @@ inline void Matrix::getCoeff(double& a11, double& a12, double& a13, double& a14, a33 = mat33; a34 = mat34; } +// ========================================================= perform +inline void Matrix::perform (double* point) +{ + double px = point [dir_x]; + double py = point [dir_y]; + double pz = point [dir_z]; + + point [dir_x] = mat11*px + mat12*py + mat13*pz + mat14; + point [dir_y] = mat21*px + mat22*py + mat23*pz + mat24; + point [dir_z] = mat31*px + mat32*py + mat33*pz + mat34; +} +// ========================================================= perform +inline void Matrix::perform (double* point, double* result) +{ + double px = point [dir_x]; + double py = point [dir_y]; + double pz = point [dir_z]; + + result [dir_x] = mat11*px + mat12*py + mat13*pz + mat14; + result [dir_y] = mat21*px + mat22*py + mat23*pz + mat24; + result [dir_z] = mat31*px + mat32*py + mat33*pz + mat34; +} END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexNewShape.cxx b/src/HEXABLOCK/HexNewShape.cxx index 79ac508..6f9e6f3 100755 --- a/src/HEXABLOCK/HexNewShape.cxx +++ b/src/HEXABLOCK/HexNewShape.cxx @@ -17,8 +17,8 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #include "HexNewShape.hxx" #include "HexSubShape.hxx" @@ -28,13 +28,13 @@ #include "HexQuad.hxx" #include "HexEdge.hxx" +#include "HexMatrix.hxx" #include "HexKas_functions.hxx" #include "HexXmlWriter.hxx" #include "HexXmlTree.hxx" -#ifndef NO_CASCADE #include #include #include @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -171,6 +172,42 @@ int NewShape::addSphere (double* milieu, double radius) curr_subid += 7; return subid; } +// ====================================================== transfoShape +int NewShape::transfoShape (Matrix& matrice, SubShape* shape) +{ + gp_Trsf transfo; + double a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34; + matrice.getCoeff (a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34); + transfo.SetValues (a11,a12,a13,a14, a21,a22,a23,a24, a31,a32,a33,a34, + Epsil2, Epsil2); + + TopoDS_Shape shape_orig = shape->getShape (); + BRepBuilderAPI_Transform builder (shape_orig, transfo, Standard_True); + TopoDS_Shape result = builder.Shape(); + + geo_builder.Add (geo_compound, result); + + int subid = curr_subid; + curr_subid += 2; // PROVISOIRE + return subid; +} +// ====================================================== translateShape +int NewShape::translateShape (double dir[], SubShape* shape) +{ + gp_Trsf transfo; + gp_Vec vecteur (dir [dir_x], dir [dir_y], dir [dir_z]); + transfo.SetTranslation (vecteur); + + TopoDS_Shape shape_orig = shape->getShape (); + BRepBuilderAPI_Transform builder (shape_orig, transfo, Standard_True); + TopoDS_Shape result = builder.Shape(); + + geo_builder.Add (geo_compound, result); + + int subid = curr_subid; + curr_subid += 2; // PROVISOIRE + return subid; +} // ====================================================== addAssociation void NewShape::addAssociation (Vertex* vertex, int subid, double param) { @@ -283,7 +320,7 @@ SubShape* NewShape::findSubShape (int shid) // ====================================================== getVertex int NewShape::getVertex (int nro) { - if (nro <0 || nro >= tab_vertex.size()) + if (nro <0 || nro >= (int) tab_vertex.size()) return 0; SubShape* shape = tab_vertex [nro]; @@ -292,7 +329,7 @@ int NewShape::getVertex (int nro) // ====================================================== getEdge int NewShape::getEdge (int nro) { - if (nro <0 || nro >= tab_edge.size()) + if (nro <0 || nro >= (int) tab_edge.size()) return 0; SubShape* shape = tab_edge [nro]; @@ -301,7 +338,7 @@ int NewShape::getEdge (int nro) // ====================================================== getFace int NewShape::getFace (int nro) { - if (nro <0 || nro >= tab_face.size()) + if (nro <0 || nro >= (int) tab_face.size()) return 0; SubShape* shape = tab_face [nro]; @@ -311,7 +348,7 @@ int NewShape::getFace (int nro) // ====================================================== getNameVertex cpchar NewShape::getNameVertex (int nro) { - if (nro <0 || nro >= tab_vertex.size()) + if (nro <0 || nro >= (int) tab_vertex.size()) return "?"; SubShape* shape = tab_vertex [nro]; @@ -320,7 +357,7 @@ cpchar NewShape::getNameVertex (int nro) // ====================================================== getNameEdge cpchar NewShape::getNameEdge (int nro) { - if (nro <0 || nro >= tab_edge.size()) + if (nro <0 || nro >= (int) tab_edge.size()) return "?"; SubShape* shape = tab_edge [nro]; @@ -329,7 +366,7 @@ cpchar NewShape::getNameEdge (int nro) // ====================================================== getNameFace cpchar NewShape::getNameFace (int nro) { - if (nro <0 || nro >= tab_face.size()) + if (nro <0 || nro >= (int) tab_face.size()) return "?"; SubShape* shape = tab_face [nro]; @@ -338,7 +375,7 @@ cpchar NewShape::getNameFace (int nro) // ====================================================== getFaceShape FaceShape* NewShape::getFaceShape (int nro) { - if (nro <0 || nro >= tab_face.size()) + if (nro <0 || nro >= (int) tab_face.size()) return 0; FaceShape* shape = tab_face [nro]; @@ -347,7 +384,7 @@ FaceShape* NewShape::getFaceShape (int nro) // ====================================================== getEdgeShape EdgeShape* NewShape::getEdgeShape (int nro) { - if (nro <0 || nro >= tab_edge.size()) + if (nro <0 || nro >= (int) tab_edge.size()) return 0; EdgeShape* shape = tab_edge [nro]; @@ -356,7 +393,7 @@ EdgeShape* NewShape::getEdgeShape (int nro) // ====================================================== getVertexShape VertexShape* NewShape::getVertexShape (int nro) { - if (nro <0 || nro >= tab_vertex.size()) + if (nro <0 || nro >= (int) tab_vertex.size()) return 0; VertexShape* shape = tab_vertex [nro]; @@ -366,9 +403,9 @@ VertexShape* NewShape::getVertexShape (int nro) int NewShape::addPoint (double* point) { char suffix [32]; - int subid = tab_vertex.size() + 1; + int subid = tab_vertex.size() + 2; - sprintf (suffix, ":vertex%02d", subid); + sprintf (suffix, ":vertex_%02d", subid); string name = el_name + suffix; VertexShape* sub_shape = new VertexShape (this, subid, point); @@ -385,12 +422,13 @@ int NewShape::saveBrep () if (ier != HOK) return ier; - pfile fic = fopen (filename.c_str(), "w"); - if (fic==NULL) - return HERR; + pfile fic = fopen (filename.c_str(), "w"); + if (fic==NULL) + return HERR; - fprintf (fic, "%s\n", geo_brep.c_str()); - fclose (fic); + fprintf (fic, "%s\n", geo_brep.c_str()); + fclose (fic); + return HOK; } // ====================================================== saveXml void NewShape::saveXml (XmlWriter* xml) @@ -535,26 +573,3 @@ int NewShape::updateBrep () return HOK; } END_NAMESPACE_HEXA - -#else - -// ====================================================== =================== -BEGIN_NAMESPACE_HEXA -NewShape::NewShape (Document* dad) : EltBase (dad, EL_SHAPE) {} -void NewShape::setShape (const TopoDS_Shape& shape) {} -void NewShape::saveXml (XmlWriter* xml) {} -SubShape* NewShape::findSubShape (int shid) { return NULL; } -SubShape* NewShape::findVertex (int shid) { return NULL; } -SubShape* NewShape::findEdge (int shid) { return NULL; } -SubShape* NewShape::findFace (int shid) { return NULL; } - -int NewShape::getVertex (int nro) { return 0 ; } -int NewShape::getEdge (int nro) { return 0 ; } -int NewShape::getFace (int nro) { return 0 ; } - -cpchar NewShape::getNameVertex (int nro) { return "Nothing" ; } -cpchar NewShape::getNameEdge (int nro) { return "Nothing" ; } -cpchar NewShape::getNameFace (int nro) { return "Nothing" ; } - -END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexNewShape.hxx b/src/HEXABLOCK/HexNewShape.hxx index 935cc7a..1793f85 100644 --- a/src/HEXABLOCK/HexNewShape.hxx +++ b/src/HEXABLOCK/HexNewShape.hxx @@ -1,36 +1,15 @@ // class : Gestion des formes associees (Hexa 5) -// Copyright (C) 2009-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 -// - #ifndef __NEW_SHAPE_H_ #define __NEW_SHAPE_H_ #include "HexEltBase.hxx" -#ifndef NO_CASCADE #include #include #include #include -#endif BEGIN_NAMESPACE_HEXA @@ -81,6 +60,8 @@ public : // for Others void openShape (); int addCircle (double* center, double rad, double* norm, double* base); int addSphere (double* center, double radius); + int transfoShape (Matrix& matrix, SubShape* shape); + int translateShape (double dir[], SubShape* shape); void closeShape(); private : diff --git a/src/HEXABLOCK/HexPropagation.hxx b/src/HEXABLOCK/HexPropagation.hxx index 3f3bfc2..eb816a7 100755 --- a/src/HEXABLOCK/HexPropagation.hxx +++ b/src/HEXABLOCK/HexPropagation.hxx @@ -22,14 +22,17 @@ #ifndef __PROPAGATION_H #define __PROPAGATION_H +#include "HexEltBase.hxx" + #include "HexDocument.hxx" #include "HexEdge.hxx" #include "HexXmlWriter.hxx" #include "HexLaw.hxx" +#include "HexGlobale.hxx" BEGIN_NAMESPACE_HEXA -class Propagation +class Propagation : public EltBase { public: const Edges& getEdges () { return prop_edges; } @@ -40,7 +43,7 @@ public: int setLaw (Law* loi); public: - Propagation (); + Propagation (Document* doc); void saveXml (XmlWriter* xml); void addEdge (Edge* arete); void majLaw (); @@ -51,7 +54,8 @@ private: bool prop_way; }; // =========================================================== Constructeur -inline Propagation::Propagation () +inline Propagation::Propagation (Document* doc) + : EltBase (doc, EL_PROPAGATION) { prop_law = NULL; prop_way = true; @@ -76,6 +80,9 @@ inline int Propagation::setLaw (Law* loi) { prop_law = loi; majLaw (); + + DumpStart ("setLaw", loi); + DumpEnd; return HOK; } // =========================================================== majLaw diff --git a/src/HEXABLOCK/HexQuad.cxx b/src/HEXABLOCK/HexQuad.cxx index f512f87..1488e70 100755 --- a/src/HEXABLOCK/HexQuad.cxx +++ b/src/HEXABLOCK/HexQuad.cxx @@ -32,7 +32,7 @@ BEGIN_NAMESPACE_HEXA -bool db = false; +bool db = true; // ======================================================== Constructeur Quad::Quad (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd) @@ -58,6 +58,8 @@ Quad::Quad (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd) setError (); } + if (el_root != NULL && el_status==HOK) + el_root->addQuad (this); majReferences (); } // ======================================================== Constructeur bis @@ -113,6 +115,8 @@ Quad::Quad (Edge* ea, Edge* eb, Edge* ec, Edge* ed) fatal_error ("Quadrangle impossible"); } + if (el_root != NULL && el_status==HOK) + el_root->addQuad (this); majReferences (); } // ======================================================== Constructeur ter @@ -126,6 +130,9 @@ Quad::Quad (Quad* other) } q_orientation = Q_UNDEFINED; q_clone = NULL; + + if (el_root != NULL && el_status==HOK) + el_root->addQuad (this); } // ============================================================ getEdge Edge* Quad::getEdge (int nro) @@ -196,7 +203,7 @@ int Quad::anaMerge (Vertex* v1, Vertex* v2, Vertex* tv1[], Edge* te1[]) return HOK; } // ======================================================== ordoVertex -int Quad::ordoVertex (Vertex* v1, Vertex* v2, Vertex* tv1[]) +int Quad::ordoVertex (Vertex* v1, Vertex* v2, Vertex* tver[]) { int orig = NOTHING; for (int nro=0 ; orig == NOTHING && nro < QUAD4 ; nro++) @@ -212,18 +219,33 @@ int Quad::ordoVertex (Vertex* v1, Vertex* v2, Vertex* tv1[]) if (q_vertex [nsp1] == v2) { for (int nro=0 ; nro < QUAD4 ; nro++) - tv1 [nro] = q_vertex [(orig+nro) MODULO QUAD4]; + tver [nro] = q_vertex [(orig+nro) MODULO QUAD4]; } else if (q_vertex [nsm1] == v2) { for (int nro=0 ; nro < QUAD4 ; nro++) - tv1 [nro] = q_vertex [(orig+QUAD4-nro) MODULO QUAD4]; + tver [nro] = q_vertex [(orig+QUAD4-nro) MODULO QUAD4]; } else return 588; return HOK; } +// ======================================================== ordonner +int Quad::ordonner (Vertex* v1, Vertex* v2, Vertex* tver[], Edge* ted[]) +{ + tver [0] = tver [1] = tver [2] = tver [3] = NULL; + ted [0] = ted [1] = ted [2] = ted [3] = NULL; + + int ier = ordoVertex (v1, v2, tver); + if (ier != HOK) + return ier; + + for (int nro=0 ; nro < QUAD4 ; nro++) + ted [nro] = findEdge (tver[nro], tver [(nro+1) MODULO QUAD4]); + + return HOK; +} // ======================================================== getBrother Quad* Quad::getBrother (StrOrient* orient) { @@ -598,7 +620,7 @@ int Quad::setOrientation () double pmixte = prod_mixte (vi, vj, vk); q_orientation = pmixte > ZEROR ? Q_DIRECT : Q_INVERSE; if (db) - printf (" %s = %s\n", el_name.c_str(), t_ori [ q_orientation ]); + printf (" %s := %s\n", el_name.c_str(), t_ori [ q_orientation ]); return q_orientation; } // ========================================================== clearAssociation @@ -632,9 +654,152 @@ int Quad::addAssociation (FaceShape* face) // ========================================================== getAssociation FaceShape* Quad::getAssociation (int nro) { - if (nro < 0 || nro >= tab_assoc.size()) + if (nro < 0 || nro >= (int)tab_assoc.size()) return NULL; return tab_assoc [nro]; } +// ======================================================== commonEdge +Edge* Quad::commonEdge (Quad* other) +{ + for (int ne1=0 ; ne1q_edge [ne2]) + return q_edge [ne1]; + + return NULL; +} +// ======================================================== Inter +int Quad::inter (Quad* other, int& nother) +{ + for (int ne1=0 ; ne1q_edge [ne2]) + { + nother = ne2; + return ne1; + } + + nother = NOTHING; + return NOTHING; +} +// ======================================================== Inter (2) +Edge* Quad::inter (Quad* other) +{ + for (int ne1=0 ; ne1q_edge [ne2]) + return q_edge [ne1]; + return NULL; +} +// ============================================================ definedBy (v) +bool Quad::definedBy (Vertex* v1, Vertex* v2) +{ + for (int n1=0 ; n1< QUAD4 ; n1++) + if (v1 == q_vertex[n1] && v2 == q_vertex[(n1+2) MODULO QUAD4]) + return true; + + return false; +} +// ============================================================ definedBy (e) +bool Quad::definedBy (Edge* e1, Edge* e2) +{ + if (e1==e2 || BadElement (e1) || BadElement (e2)) + return false; + + bool f1=false, f2=false; + for (int ned=0 ; ned< QUAD4 ; ned++) + if (e1 == q_edge[ned]) f1 = true; + else if (e2 == q_edge[ned]) f2 = true; + // if (e1 == q_edge[ned] && e2 == q_edge[(ned+2) MODULO QUAD4]) return true; + + return f1 && f2; +} +// =============================================================== findEdge +Edge* Quad::findEdge (Vertex* v1, Vertex* v2) +{ + for (int nro=0 ; nro< QUAD4 ; nro++) + { + Vertex* va = q_edge[nro]->getVertex(V_AMONT) ; + Vertex* vb = q_edge[nro]->getVertex(V_AVAL) ; + if ((v1==va && v2==vb) || (v1==vb && v2==va)) + return q_edge [nro]; + } + + return NULL; +} +// =============================================================== indexVertex +int Quad::indexVertex (Vertex* elt) +{ + for (int n1=0 ; n1< QUAD4 ; n1++) + if (elt == q_vertex[n1]) + return n1; + + return NOTHING; +} +// =============================================================== indexEdge +int Quad::indexEdge (Edge* elt) +{ + for (int n1=0 ; n1< QUAD4 ; n1++) + if (elt == q_edge[n1]) + return n1; + + return NOTHING; +} +// =============================================================== setColor +void Quad::setColor (double val) +{ + for (int n1=0 ; n1< QUAD4 ; n1++) + q_vertex[n1] -> setColor (val); +} +// =============================================================== duplicate +void Quad::duplicate () +{ + q_orientation = Q_UNDEFINED; + q_clone = new Quad (GetClone (q_edge [E_A]), + GetClone (q_edge [E_B]), + GetClone (q_edge [E_C]), + GetClone (q_edge [E_D])); + q_clone->tab_assoc = tab_assoc; +} +// ============================================================ nearestVertex +Vertex* Quad::nearestVertex (Vertex* other) +{ + if (BadElement (other)) + return NULL; + + Vertex* vsol = NULL; + double dmin = 1e+77; + int nbre = countVertex (); + for (int nro=0 ; nrodist2 (vert); + if (dist < dmin) + { + dmin = dist; + vsol = vert; + } + } + return vsol; +} +// =============================================================== reorienter +void Quad::reorienter () +{ + if (q_orientation != Q_INVERSE) + return; + + Edge* edge = q_edge [E_B]; + q_edge [E_B] = q_edge [E_D]; + q_edge [E_B] = edge; + + q_vertex [E_A] = q_edge [E_D]->commonVertex(q_edge [E_A]); + q_vertex [E_B] = q_edge [E_A]->commonVertex(q_edge [E_B]); + q_vertex [E_C] = q_edge [E_B]->commonVertex(q_edge [E_C]); + q_vertex [E_D] = q_edge [E_C]->commonVertex(q_edge [E_D]); + + if (db) + printf (" %s est reoriente\n", el_name.c_str()); + q_orientation = Q_DIRECT; +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexQuad.hxx b/src/HEXABLOCK/HexQuad.hxx index 6036b56..ef4a8e9 100755 --- a/src/HEXABLOCK/HexQuad.hxx +++ b/src/HEXABLOCK/HexQuad.hxx @@ -26,6 +26,7 @@ BEGIN_NAMESPACE_HEXA +#ifndef SWIG struct StrOrient { Vertex* v11; // 1er sommet 1er quad @@ -41,6 +42,7 @@ StrOrient ( StrOrient* s) : v11 (s->v11), v12(s->v12), v21(s->v21), v22(s->v22), dir(s->dir){} }; +#endif class Quad : public EltBase { @@ -48,14 +50,20 @@ public: virtual Edge* getEdge (int nro); virtual Vertex* getVertex (int nro); - virtual int countEdge () { return QUAD4; } - virtual int countVertex () { return QUAD4; } + int addAssociation (NewShape* forme, int subid); + virtual void clearAssociation (); -public: + void setColor (double valeur); Quad (Vertex* va, Vertex* vb, Vertex* vc, Vertex* vd); + +#ifndef SWIG +public: Quad (Edge* ea, Edge* eb, Edge* ec, Edge* ed); Quad (Quad* other); + virtual int countEdge () { return QUAD4; } + virtual int countVertex () { return QUAD4; } + Hexa* getParent (int nro); Edge* findEdge (Vertex* v1, Vertex*v2); @@ -63,16 +71,17 @@ public: int anaMerge (Vertex* v1, Vertex* v2, Vertex* tv[], Edge* te[]); int ordoVertex (Vertex* v1, Vertex* v2, Vertex* tv[]); - int prepaMerge (Vertex* tv1[], Vertex* tv2[], Edge* te1[]); + int ordonner (Vertex* v1, Vertex* v2, Vertex* tv[], Edge* ted[]); int inter (Quad* other, int& nro); + Edge* inter (Quad* other); bool definedBy (Vertex* v1, Vertex* v2); bool definedBy (Edge* e1, Edge* e2); int indexVertex (Vertex* elt); int indexEdge (Edge* elt); - int accoupler (Quad* other, StrOrient* orient); + //int accoupler (Quad* other, StrOrient* orient); int coupler (Quad* other, StrOrient* orient, Elements* table); Edge* getOpposEdge (Edge* arete, int &sens); @@ -82,8 +91,7 @@ public: virtual void dump (); virtual void dumpPlus (); virtual void saveXml (XmlWriter* xml); - void setScalar (double valeur); - void setColor (double valeur) { setScalar (valeur) ; } + void setScalar (double valeur) { setColor (valeur); } void replace (Quad* old); virtual void replaceEdge (Edge* old, Edge* nouveau); @@ -92,7 +100,6 @@ public: virtual void setAssociation (Shape* forme) {} // PERIME virtual int addAssociation (Shape* forme) {return HOK ; } // PERIME - virtual void clearAssociation (); // const Shapes& getAssociations () { return tab_shapes ; } @@ -105,12 +112,14 @@ public: int getOrientation () { return q_orientation; } int setOrientation (); void setOrientation (int ori); + void reorienter (); // Hexa5 - int addAssociation (NewShape* forme, int subid); int addAssociation (FaceShape* forme); int countAssociation () { return tab_assoc.size () ; } FaceShape* getAssociation (int nro); + Vertex* nearestVertex (Vertex* other); + private: friend class Cloner; Quad* getBrother (StrOrient* orient); @@ -122,98 +131,8 @@ private: int q_orientation; FaceShapes tab_assoc; +#endif }; -// ----------------------------------------------- Inlining -// ======================================================== commonEdge -inline Edge* Quad::commonEdge (Quad* other) -{ - for (int ne1=0 ; ne1q_edge [ne2]) - return q_edge [ne1]; - - return NULL; -} - -// ======================================================== Inter -inline int Quad::inter (Quad* other, int& nother) -{ - for (int ne1=0 ; ne1q_edge [ne2]) - { - nother = ne2; - return ne1; - } - - nother = NOTHING; - return NOTHING; -} -// ============================================================ definedBy (v) -inline bool Quad::definedBy (Vertex* v1, Vertex* v2) -{ - for (int n1=0 ; n1< QUAD4 ; n1++) - if (v1 == q_vertex[n1] && v2 == q_vertex[(n1+2) MODULO QUAD4]) - return true; - - return false; -} -// ============================================================ definedBy (e) -inline bool Quad::definedBy (Edge* e1, Edge* e2) -{ - for (int n1=0 ; n1< QUAD4 ; n1++) - if (e1 == q_edge[n1] && e2 == q_edge[(n1+2) MODULO QUAD4]) - return true; - - return false; -} -// =============================================================== findEdge -inline Edge* Quad::findEdge (Vertex* v1, Vertex* v2) -{ - for (int nro=0 ; nro< QUAD4 ; nro++) - { - Vertex* va = q_edge[nro]->getVertex(V_AMONT) ; - Vertex* vb = q_edge[nro]->getVertex(V_AVAL) ; - if ((v1==va && v2==vb) || (v1==vb && v2==va)) - return q_edge [nro]; - } - - return NULL; -} -// =============================================================== indexVertex -inline int Quad::indexVertex (Vertex* elt) -{ - for (int n1=0 ; n1< QUAD4 ; n1++) - if (elt == q_vertex[n1]) - return n1; - - return NOTHING; -} -// =============================================================== indexEdge -inline int Quad::indexEdge (Edge* elt) -{ - for (int n1=0 ; n1< QUAD4 ; n1++) - if (elt == q_edge[n1]) - return n1; - - return NOTHING; -} -// =============================================================== setScalar -inline void Quad::setScalar (double val) -{ - for (int n1=0 ; n1< QUAD4 ; n1++) - q_vertex[n1] -> setScalar (val); -} -// =============================================================== duplicate -inline void Quad::duplicate () -{ - q_orientation = Q_UNDEFINED; - q_clone = new Quad (GetClone (q_edge [E_A]), - GetClone (q_edge [E_B]), - GetClone (q_edge [E_C]), - GetClone (q_edge [E_D])); - q_clone->tab_assoc = tab_assoc; -} END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexSubShape.cxx b/src/HEXABLOCK/HexSubShape.cxx index 5a3392e..5195eb9 100755 --- a/src/HEXABLOCK/HexSubShape.cxx +++ b/src/HEXABLOCK/HexSubShape.cxx @@ -17,15 +17,14 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #include "HexSubShape.hxx" #include "HexNewShape.hxx" #include "HexXmlWriter.hxx" -#ifndef NO_CASCADE - #include #include #include @@ -43,7 +42,7 @@ SubShape::SubShape (NewShape* dad, int id, int dim) sub_dim = dim; maj_brep = maj_shape = true; } -// ====================================================== updateShape +// ====================================================== getShape const TopoDS_Shape& SubShape::getShape () { if (maj_shape) @@ -79,4 +78,3 @@ void SubShape::updateShape () geo_shape = ss_parent->getGeoShape (sub_ident); } END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexSubShape.hxx b/src/HEXABLOCK/HexSubShape.hxx index 240f8f1..676b72d 100644 --- a/src/HEXABLOCK/HexSubShape.hxx +++ b/src/HEXABLOCK/HexSubShape.hxx @@ -1,35 +1,12 @@ // class : Gestion des formes associees (Hexa 5) -// Copyright (C) 2009-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 -// - #ifndef __SUB_SHAPE_H_ #define __SUB_SHAPE_H_ - - #include "HexEltBase.hxx" -#ifndef NO_CASCADE #include -#endif BEGIN_NAMESPACE_HEXA @@ -43,7 +20,7 @@ public : int getDim () { return sub_dim ; } const string& getBrep (); - const TopoDS_Shape& getShape (); + virtual const TopoDS_Shape& getShape (); void saveXml (XmlWriter* xml); void callXml (XmlWriter* xml); diff --git a/src/HEXABLOCK/HexVector.cxx b/src/HEXABLOCK/HexVector.cxx index 5b627dd..f37212c 100755 --- a/src/HEXABLOCK/HexVector.cxx +++ b/src/HEXABLOCK/HexVector.cxx @@ -105,5 +105,78 @@ double Vector::getAngleX () double deg = acos(kos) * 180.0 / M_PI; return deg; } +// ===================================================== getCoord +double Vector::getCoord (int dir) +{ + double val = 0; + switch (dir) + { + case dir_x : val = v_dx; + break; + case dir_y : val = v_dy; + break; + case dir_z : val = v_dz; + break; + } + return val; +} +// ===================================================== renormer +int Vector::renormer() +{ + double dn = getNorm (); + if (dn < 1e-30) + return HERR; + + v_dx /= dn; + v_dy /= dn; + v_dz /= dn; + + return HOK; +} +// ===================================================== vectoriel +void Vector::vectoriel (Vector* a, Vector*b) +{ + v_dx = a->v_dy * b->v_dz - b->v_dy * a->v_dz; + v_dy = a->v_dz * b->v_dx - b->v_dz * a->v_dx; + v_dz = a->v_dx * b->v_dy - b->v_dx * a->v_dy; +} + +// ===================================================== getCoord +double* Vector::getCoord (double coord[]) +{ + coord [dir_x] = v_dx; + coord [dir_y] = v_dy; + coord [dir_z] = v_dz; + return coord; +} +// ===================================================== getUnitVector +int Vector::getUnitVector (double coord[]) +{ + coord [dir_x] = v_dx; + coord [dir_y] = v_dy; + coord [dir_z] = v_dz; + int ier = normer_vecteur (coord); + return ier; +} +// ===================================================== multiplier +void Vector::multiplier (double scalaire) +{ + v_dx *= scalaire; + v_dy *= scalaire; + v_dz *= scalaire; +} +// ===================================================== dump +void Vector::dump () +{ + printf ("Vector "); + printName (" = "); + if (NOT isHere ()) + { + printf ("(*** deleted ***)\n"); + return; + } + + printf ("(%g, %g, %g)\n", v_dx,v_dy,v_dz); +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexVector.hxx b/src/HEXABLOCK/HexVector.hxx index c726d4d..4b788e3 100755 --- a/src/HEXABLOCK/HexVector.hxx +++ b/src/HEXABLOCK/HexVector.hxx @@ -37,14 +37,15 @@ public: double getNorm () { return sqrt (v_dx*v_dx + v_dy*v_dy + v_dz*v_dz); } double getAngleX (); - -public: Vector (Document* doc, double dx=0, double dy=0, double dz=0); +#ifndef SWIG +public: Vector (Vector* lautre); virtual ~Vector () {} virtual void dump (); double getCoord (int dir); double* getCoord (double coord[]); + int getUnitVector (double coord[]); virtual void saveXml (XmlWriter* xml); int renormer (); @@ -56,72 +57,7 @@ private: double v_dx; double v_dy; double v_dz; +#endif }; -// ------------------------------------------- Inlining -// ===================================================== getCoord -inline double Vector::getCoord (int dir) -{ - double val = 0; - switch (dir) - { - case dir_x : val = v_dx; - break; - case dir_y : val = v_dy; - break; - case dir_z : val = v_dz; - break; - } - return val; -} -// ===================================================== renormer -inline int Vector::renormer() -{ - double dn = getNorm (); - if (dn < 1e-30) - return HERR; - - v_dx /= dn; - v_dy /= dn; - v_dz /= dn; - - return HOK; -} -// ===================================================== vectoriel -inline void Vector::vectoriel (Vector* a, Vector*b) -{ - v_dx = a->v_dy * b->v_dz - b->v_dy * a->v_dz; - v_dy = a->v_dz * b->v_dx - b->v_dz * a->v_dx; - v_dz = a->v_dx * b->v_dy - b->v_dx * a->v_dy; -} - -// ===================================================== getCoord -inline double* Vector::getCoord (double coord[]) -{ - coord [dir_x] = v_dx; - coord [dir_y] = v_dy; - coord [dir_z] = v_dz; - return coord; -} -// ===================================================== multiplier -inline void Vector::multiplier (double scalaire) -{ - v_dx *= scalaire; - v_dy *= scalaire; - v_dz *= scalaire; -} -// ===================================================== dump -inline void Vector::dump () -{ - printf ("Vector "); - printName (" = "); - if (NOT isHere ()) - { - printf ("(*** deleted ***)\n"); - return; - } - - printf ("(%g, %g, %g)\n", v_dx,v_dy,v_dz); -} - END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexVertex.cxx b/src/HEXABLOCK/HexVertex.cxx index b296d3b..795c9f0 100755 --- a/src/HEXABLOCK/HexVertex.cxx +++ b/src/HEXABLOCK/HexVertex.cxx @@ -26,7 +26,6 @@ #include "HexXmlWriter.hxx" #include "HexDocument.hxx" -#include "HexOldShape.hxx" #include "HexNewShape.hxx" #include "HexVertexShape.hxx" #include "HexKas_functions.hxx" @@ -46,6 +45,34 @@ Vertex::Vertex (Document* doc, double x, double y, double z) v_shape = NULL; v_scalar = 0; v_clone = NULL; + + if (el_root != NULL) + el_root->addVertex (this); +} +// ========================================================= Constructeur bis +Vertex::Vertex (Vertex* other) + : EltBase (other->dad(), EL_VERTEX) +{ + if (other!= NULL) + { + v_x = other->v_x; + v_y = other->v_y; + v_z = other->v_z; + v_scalar = other->v_scalar; + gc_x = other->gc_x; + gc_y = other->gc_y; + gc_z = other->gc_z; + v_clone = NULL; + v_shape = other->v_shape; + } + else + { + v_x = v_y = v_z = 0; + gc_x = gc_y = gc_z = 0; + v_scalar = 0; + v_shape = NULL; + v_clone = NULL; + } } // ========================================================= getParent Edge* Vertex::getParent (int nro) @@ -167,4 +194,78 @@ void Vertex::getAssoCoord (double* point) { getAssoCoord (point[dir_x], point[dir_y], point[dir_z]); } +// ===================================================== getCoord +double Vertex::getCoord (int dir) +{ + double val = 0; + switch (dir) + { + case dir_x : val = v_x; + break; + case dir_y : val = v_y; + break; + case dir_z : val = v_z; + break; + } + return val; +} +// ========================================================= dump +void Vertex::dump () +{ + printName (" = "); + if (NOT isHere ()) + { + printf ("(*** deleted ***)\n"); + return; + } + + printf ("(%g, %g, %g)", v_x,v_y,v_z); + dumpRef (); +} +// ========================================================= setCoord +void Vertex::setCoord (double x, double y, double z) +{ + v_x = x; + v_y = y; + v_z = z; +} +// ========================================================= isin +bool Vertex::isin (double xmin, double xmax, double ymin, double ymax, + double zmin, double zmax) +{ + bool rep = v_x >= xmin && v_x <= xmax + && v_y >= ymin && v_y <= ymax + && v_z >= zmin && v_z <= zmax; + return rep; +} +// ========================================================= getPoint +double* Vertex::getPoint (double point[]) +{ + point [dir_x] = v_x; + point [dir_y] = v_y; + point [dir_z] = v_z; + return point; +} +// ========================================================= duplicate +void Vertex::duplicate (Document* cible) +{ + v_clone = new Vertex (cible, v_x, v_y, v_z); + v_clone->v_scalar = v_scalar; +} +// ========================================================= definedBy +bool Vertex::definedBy (double px, double py, double pz, double eps2) +{ + double dist2 = carre (v_x-px) + carre (v_y-py) + carre (v_z-pz); + return dist2 < eps2; +} +// ========================================================= dist2 +double Vertex::dist2 (Vertex* other) +{ + if (BadElement (other)) + return 1e+77; + + double dist = carre (v_x-other->v_x) + carre (v_y-other->v_y) + + carre (v_z-other->v_z); + return dist; +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexVertex.hxx b/src/HEXABLOCK/HexVertex.hxx index 9dcabfe..7e3bbf3 100755 --- a/src/HEXABLOCK/HexVertex.hxx +++ b/src/HEXABLOCK/HexVertex.hxx @@ -33,23 +33,32 @@ public : double getX() { return v_x; } double getY() { return v_y; } double getZ() { return v_z; } - double getCoord (int dir); - - virtual int countVertex () { return 1; } - virtual Vertex* getVertex (int nro) { return this; } - void setX (double v) { v_x = v ; } void setY (double v) { v_y = v ; } void setZ (double v) { v_z = v ; } - virtual void setAssociation (Shape* forme) {} // PERIME + double getAssoX () { return is_associated ? gc_x : v_x ; } + double getAssoY () { return is_associated ? gc_y : v_y ; } + double getAssoZ () { return is_associated ? gc_z : v_z ; } + + int setAssociation (NewShape* geom, int subid); + void clearAssociation (); + + void setColor (double valeur) { v_scalar = valeur ; } + + Vertex (Document* prev, double x, double y, double z); + +#ifndef SWIG +public : + double getCoord (int dir); + virtual int countVertex () { return 1; } + virtual Vertex* getVertex (int nro) { return this; } + // Hexa5 - int setAssociation (NewShape* geom, int subid); int setAssociation (VertexShape* forme); int setAssociation (double* point); int setAssociation (double px, double py, double pz); - void clearAssociation (); VertexShape* getAssoVertex () { return v_shape ;} VertexShape* getAssociation () { return v_shape ;} @@ -57,20 +66,14 @@ public : void getAssoCoord (double &x, double &y, double &z); void getAssoCoord (double* point); - double getAssoX () { return is_associated ? gc_x : v_x ; } - double getAssoY () { return is_associated ? gc_y : v_y ; } - double getAssoZ () { return is_associated ? gc_z : v_z ; } - public : - Vertex (Document* prev, double x=0.0, double y=0.0, double z=0.0); Vertex (Vertex* other); virtual ~Vertex () {} virtual void dump () ; virtual void saveXml (XmlWriter* xml); - void setScalar (double val) { v_scalar = val ; } + void setScalar (double val) { setColor (val) ; } double getScalar () { return v_scalar ; } - void setColor (double valeur) { setScalar (valeur) ; } double* getPoint (double point[]); void setCoord (double x, double y, double z); @@ -79,15 +82,15 @@ public : bool isin (double xmin, double xmax, double ymin, double ymax, double zmin, double zmax); Edge* getParent (int nro); - Vertex* makeSymetric (Vertex* other); - void translate (Vector* vecteur, double fact=1.0); - void replace (Vertex* old); + void translate (Vector* vecteur, double fact=1.0); + void replace (Vertex* old); Vertex* getClone () { return v_clone ; } void duplicate (Document* doc); static Vertex* createMiddle (Vertex* left, Vertex* right); bool definedBy (double px, double py, double pz, double eps2=1e-4); + double dist2 (Vertex* other); private : double v_x; @@ -98,95 +101,7 @@ private : Vertex* v_clone; double gc_x, gc_y, gc_z; VertexShape* v_shape; +#endif }; -// ========================================================= Constructeur bis -inline Vertex::Vertex (Vertex* other) - : EltBase (other->dad(), EL_VERTEX) -{ - if (other!= NULL) - { - v_x = other->v_x; - v_y = other->v_y; - v_z = other->v_z; - v_scalar = other->v_scalar; - gc_x = other->gc_x; - gc_y = other->gc_y; - gc_z = other->gc_z; - v_clone = NULL; - v_shape = other->v_shape; - } - else - { - v_x = v_y = v_z = 0; - gc_x = gc_y = gc_z = 0; - v_scalar = 0; - v_shape = NULL; - v_clone = NULL; - } -} -// ===================================================== getCoord -inline double Vertex::getCoord (int dir) -{ - double val = 0; - switch (dir) - { - case dir_x : val = v_x; - break; - case dir_y : val = v_y; - break; - case dir_z : val = v_z; - break; - } - return val; -} -// ========================================================= dump -inline void Vertex::dump () -{ - printName (" = "); - if (NOT isHere ()) - { - printf ("(*** deleted ***)\n"); - return; - } - - printf ("(%g, %g, %g)", v_x,v_y,v_z); - dumpRef (); -} -// ========================================================= setCoord -inline void Vertex::setCoord (double x, double y, double z) -{ - v_x = x; - v_y = y; - v_z = z; -} -// ========================================================= isin -inline bool Vertex::isin (double xmin, double xmax, double ymin, double ymax, - double zmin, double zmax) -{ - bool rep = v_x >= xmin && v_x <= xmax - && v_y >= ymin && v_y <= ymax - && v_z >= zmin && v_z <= zmax; - return rep; -} -// ========================================================= getPoint -inline double* Vertex::getPoint (double point[]) -{ - point [dir_x] = v_x; - point [dir_y] = v_y; - point [dir_z] = v_z; - return point; -} -// ========================================================= duplicate -inline void Vertex::duplicate (Document* cible) -{ - v_clone = new Vertex (cible, v_x, v_y, v_z); - v_clone->v_scalar = v_scalar; -} -// ========================================================= duplicate -inline bool Vertex::definedBy (double px, double py, double pz, double eps2) -{ - double dist2 = carre (v_x-px) + carre (v_y-py) + carre (v_z-pz); - return dist2 < eps2; -} END_NAMESPACE_HEXA #endif diff --git a/src/HEXABLOCK/HexVertexShape.cxx b/src/HEXABLOCK/HexVertexShape.cxx index ba720ad..d532eb2 100755 --- a/src/HEXABLOCK/HexVertexShape.cxx +++ b/src/HEXABLOCK/HexVertexShape.cxx @@ -17,14 +17,14 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #include "HexVertexShape.hxx" +#include "HexNewShape.hxx" #include "HexXmlWriter.hxx" -#ifndef NO_CASCADE - #include #include #include @@ -83,6 +83,20 @@ void VertexShape::getCoords (double& px, double& py, double& pz) py = ss_coord[dir_y]; pz = ss_coord[dir_z]; } +// ====================================================== getShape +const TopoDS_Shape& VertexShape::getShape() +{ + if (geo_shape.IsNull() && ss_parent != NULL && + ss_parent->getOrigin() == SH_CLOUD) + { + double x, y, z; + getCoords(x, y, z); + gp_Pnt pnt(x, y, z); + geo_shape = BRepBuilderAPI_MakeVertex(pnt); + } + + return SubShape::getShape (); +} // ====================================================== addAssociation void VertexShape::addAssociation (Vertex* elt) { @@ -92,7 +106,7 @@ void VertexShape::addAssociation (Vertex* elt) // ====================================================== getAssociation Vertex* VertexShape::getAssociation (int nro) { - if (nro>0 && nro0 && nro < (int)tab_assoc.size()) return tab_assoc[nro]; else return NULL; @@ -111,4 +125,3 @@ void VertexShape::saveXml (XmlWriter* xml) xml->closeMark (); } END_NAMESPACE_HEXA -#endif diff --git a/src/HEXABLOCK/HexVertexShape.hxx b/src/HEXABLOCK/HexVertexShape.hxx index a5056a2..e31e587 100644 --- a/src/HEXABLOCK/HexVertexShape.hxx +++ b/src/HEXABLOCK/HexVertexShape.hxx @@ -1,25 +1,6 @@ // class : Gestion des Sous-shapes categorie Vertex -// Copyright (C) 2009-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 -// - #ifndef __NODE_SHAPE_H_ #define __NODE_SHAPE_H_ @@ -40,6 +21,8 @@ public : void getCoords (double& px, double& py, double& pz); void saveXml (XmlWriter* xml); + virtual const TopoDS_Shape& getShape(); // #mbarry + private : void updateCoords (); diff --git a/src/HEXABLOCK/HexWitness.cxx b/src/HEXABLOCK/HexWitness.cxx new file mode 100644 index 0000000..bd1c8dc --- /dev/null +++ b/src/HEXABLOCK/HexWitness.cxx @@ -0,0 +1,172 @@ + +// C++ : Dump python + +// Copyright (C) 2009-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 +// +#include "HexWitness.hxx" +#include "HexDumpStudy.hxx" +#include "HexEltBase.hxx" +#include "HexDocument.hxx" + +BEGIN_NAMESPACE_HEXA + +// =================================================== Constructeur +Witness::Witness () +{ + mess_state = NoMessage; + dump_study = NULL; + line_open = false;; + nbr_lines = 0; +} +// =================================================== operator << (int) +Witness& Witness::operator << (int val) +{ + openMessage (); + + char valeur [20]; + sprintf (valeur, "%d", val); + + curr_line += valeur; + line_open = true; + return *this; +} +// =================================================== operator << (double) +Witness& Witness::operator << (double val) +{ + openMessage (); + + char valeur [20]; + sprintf (valeur, "%g", val); + + curr_line += valeur; + line_open = true; + return *this; +} +// =================================================== operator << (cpchar) +Witness& Witness::operator << (cpchar val) +{ + openMessage (); + curr_line += val; + line_open = true; + return *this; +} +// =================================================== operator << (string) +Witness& Witness::operator << (rcstring val) +{ + openMessage (); + if (val==Begin) + pushLine (); + + curr_line += val; + line_open = true; + return *this; +} +// =================================================== operator << (elt) +Witness& Witness::operator << (EltBase* elt) +{ + openMessage (); + cpchar name = elt==NULL ? "" : elt->getName(); + curr_line += name; + return *this; +} +// =================================================== printMessage +void Witness::printMessage () +{ + if (mess_state==NoMessage) + return; + + if (line_open) + pushLine (); + + int nbre = bla_bla.size(); + if (nbre ==0) + return; + + cout << endl + << " ... In function :" << endl; + cout << bla_bla [0] << endl << endl; + for (int nro=1 ; nro= nbr_lines) + return ""; + + return bla_bla[nro].c_str(); +} + +// ------------------------------------------------------------- +// ------------ Private +// ------------ For members only +// ------------------------------------------------------------- +// =================================================== openMessage +void Witness::openMessage () +{ + if (mess_state!=NoMessage) + return; + + mess_state = MessOpen; + bla_bla.clear (); + if (dump_study == NULL) + { + curr_line = ""; + return; + } + + nbr_lines = 0; + dump_study->getBegin (curr_line); + curr_line += " :" ; +} +// =================================================== pushLine +void Witness::pushLine () +{ + if (mess_state != MessOpen) + { + nbr_lines = 0; + return; + } + + bla_bla.push_back (curr_line); + curr_line = ""; + line_open = false; + nbr_lines = bla_bla.size (); +} +END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/HexWitness.hxx b/src/HEXABLOCK/HexWitness.hxx new file mode 100644 index 0000000..c94c54b --- /dev/null +++ b/src/HEXABLOCK/HexWitness.hxx @@ -0,0 +1,69 @@ + +// Class : Enregistrement des dianostics + +// Copyright (C) 2009-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 + +#ifndef __WITNESS_H_ +#define __WITNESS_H_ + +#define Mess el_root->glob->mess << Begin +#define Follow el_root->glob->mess + +#include "hexa_base.hxx" + +BEGIN_NAMESPACE_HEXA + +const std::string Begin (" **** "); + +class DumpStudy; +class Witness +{ +public : + Witness (); + void setDump (DumpStudy* dd) { dump_study = dd ; } + void raz () { mess_state = NoMessage ; } + bool hasMessage () { return mess_state != NoMessage ; } + TabText& getMessage (); + int sizeofMessage (); + cpchar getLine (int nro); + void printMessage (); + + Witness& operator << (int val); + Witness& operator << (double val); + Witness& operator << (cpchar val); + Witness& operator << (rcstring val); + Witness& operator << (EltBase* val); + +private : + void openMessage (); + void closeMessage () {}; + void pushLine (); + +private : + TabText bla_bla; + std::string curr_line; + int w_status; + int nbr_lines; + enum EnumMessage { NoMessage, MessOpen, MessClosed } mess_state; + bool line_open; + DumpStudy* dump_study; +}; +END_NAMESPACE_HEXA +#endif diff --git a/src/HEXABLOCK/HexKasBiCylinder.hxx b/src/HEXABLOCK/Hex_salome.cxx similarity index 55% rename from src/HEXABLOCK/HexKasBiCylinder.hxx rename to src/HEXABLOCK/Hex_salome.cxx index 02d2993..248b9ce 100755 --- a/src/HEXABLOCK/HexKasBiCylinder.hxx +++ b/src/HEXABLOCK/Hex_salome.cxx @@ -1,6 +1,6 @@ -// -// CC++ : Representation Cascade d'un bi-cylindre -// + +// C++ : La clase principale de Hexa + // Copyright (C) 2009-2013 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or @@ -20,37 +20,17 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -#ifndef __KAS_BI_CYLINDER_HXX_ -#define __KAS_BI_CYLINDER_HXX_ - -#include "HexGlobale.hxx" - -#ifndef NO_CASCADE +#include "HexDocument.hxx" +#include BEGIN_NAMESPACE_HEXA - -class KasLine; - -class KasBiCylinder +//--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 +// ======================================================== addShape +NewShape* Document::addShape (long object, const char* name) { -public : - KasBiCylinder () { purge () ; } - ~KasBiCylinder () { purge () ; } - - int defineCyls (double* borig, double* bnorm, double* bbase, - double brayon, double bhaut, - double* sorig, double* snorm, double* sbase, - double srayon, double shaut); - int associate (Edge* edge); - -private : - int anaVertex (Vertex* node, int* tline, double* tpara); - void purge (); + TopoDS_Shape* topo = (TopoDS_Shape*) object; + NewShape* shape = addShape (*topo, name); -private : - std::vector inter_line; - bool no_inter; -}; + return shape; +} END_NAMESPACE_HEXA -#endif -#endif diff --git a/src/HEXABLOCK/Makefile.am b/src/HEXABLOCK/Makefile.am index c21aa89..342b094 100755 --- a/src/HEXABLOCK/Makefile.am +++ b/src/HEXABLOCK/Makefile.am @@ -61,10 +61,8 @@ salomeinclude_HEADERS = \ HexBiCylinder.hxx \ HexDumpStudy.hxx \ HexAnaQuads.hxx \ - HexKasPoint.hxx \ - HexKasLine.hxx \ - HexKasBiCylinder.hxx \ HexKas_functions.hxx \ + HexWitness.hxx \ HexCramer.hxx @@ -72,9 +70,9 @@ salomeinclude_HEADERS = \ # SD/Propagation/HexPropagation.cxx \ # SD/Law/HexLaw.cxx \ # -lib_LTLIBRARIES = libHEXABLOCKimpl.la +lib_LTLIBRARIES = libHEXABLOCKEngine.la -dist_libHEXABLOCKimpl_la_SOURCES = \ +dist_libHEXABLOCKEngine_la_SOURCES = \ hexa_utils.cxx \ HexEltBase.cxx \ HexGlobale.cxx \ @@ -83,8 +81,9 @@ dist_libHEXABLOCKimpl_la_SOURCES = \ HexEdge.cxx \ HexQuad.cxx \ HexHexa.cxx \ + HexHexa_disco.cxx \ HexVector.cxx \ - HexElements.cxx \ + HexElements.cxx \ HexElements_bis.cxx \ HexElements_ter.cxx \ HexElements_piq.cxx \ @@ -98,6 +97,7 @@ dist_libHEXABLOCKimpl_la_SOURCES = \ HexNewShape.cxx \ HexSubShape.cxx \ HexDocument_trans.cxx \ + HexDocument_tools.cxx \ HexVertexShape.cxx \ HexEdgeShape.cxx \ HexFaceShape.cxx \ @@ -114,19 +114,26 @@ dist_libHEXABLOCKimpl_la_SOURCES = \ Hex.cxx \ HexDocument_asso.cxx \ HexDocument_quads.cxx \ - HexKasPoint.cxx \ - HexKasLine.cxx \ - HexKasBiCylinder.cxx \ - HexKas_functions.cxx + HexDocument_del.cxx \ + HexDocument_skin.cxx \ + HexDocument_v6.cxx \ + HexElements_v6.cxx \ + HexElements_check.cxx \ + HexElements_del.cxx \ + HexWitness.cxx \ + Hex_salome.cxx \ + test_hexa6.cxx \ + HexKas_functions.cxx -# libHEXABLOCKimpl_la_CPPFLAGS = \ +# libHEXABLOCKEngine_la_CPPFLAGS = \ # -I$(top_builddir)/salome_adm/unix # -# libHEXABLOCKimpl_la_LDFLAGS = \ +# libHEXABLOCKEngine_la_LDFLAGS = \ # -lOpUtil -libHEXABLOCKimpl_la_CPPFLAGS = \ +libHEXABLOCKEngine_la_CPPFLAGS = \ $(KERNEL_CXXFLAGS) \ + $(PYTHON_CPPFLAGS) \ $(CAS_CPPFLAGS) \ $(VTK_INCLUDES) \ $(GEOM_CXXFLAGS) \ @@ -137,27 +144,9 @@ libHEXABLOCKimpl_la_CPPFLAGS = \ $(CORBA_INCLUDES) \ -I$(top_builddir)/idl -libHEXABLOCKimpl_la_LDFLAGS = \ +libHEXABLOCKEngine_la_LDFLAGS = \ + $(PYTHON_LDFLAGS) \ $(CAS_KERNEL) -lTKBRep -lTKPrim -lTKG2d -lTKG3d -lTKTopAlgo -lTKGeomBase -lTKGeomAlgo -lTKBool -lTKBO \ $(KERNEL_LDFLAGS) -lSALOMELocalTrace -lSALOMEBasics -#### libHexaBlockimpl_la_CPPFLAGS = \ - #### $(KERNEL_CXXFLAGS) \ - #### $(CAS_CPPFLAGS) \ - #### $(VTK_INCLUDES) \ - #### $(GEOM_CXXFLAGS) \ - #### $(HEXABLOCK_CXXFLAGS) \ - #### $(MED_CXXFLAGS) \ - #### $(SMESH_CXXFLAGS) \ - #### $(BOOST_CPPFLAGS) \ - #### $(CORBA_CXXFLAGS) \ - #### $(CORBA_INCLUDES) \ - #### -I$(top_builddir)/idl -#### libHexaBlockimpl_la_LDFLAGS = \ - #### ../../idl/libSalomeIDLHEXABLOCKPLUGIN.la \ - #### $(CAS_KERNEL) -lTKBRep -lTKG2d -lTKG3d -lTKTopAlgo -lTKGeomBase -lTKGeomAlgo \ - #### $(HEXABLOCK_LDFLAGS) -lHEXABLOCKEngine \ - #### $(MED_LDFLAGS) -lSalomeIDLMED \ - #### $(SMESH_LDFLAGS) -lSMESHimpl -lSMESHEngine -lSMESHDS -lSMDS \ - #### $(KERNEL_LDFLAGS) -lSalomeGenericObj -lSALOMELocalTrace -lSALOMEBasics diff --git a/src/HEXABLOCK/Sauver b/src/HEXABLOCK/Sauver index 10fbd6f..a7b7be3 100755 --- a/src/HEXABLOCK/Sauver +++ b/src/HEXABLOCK/Sauver @@ -1,28 +1,10 @@ #!/bin/sh -# Copyright (C) 2009-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 -# - # Comm : Sauvegarde model=`pwd` model=`basename $model` saved=motor_saved +saved=saved_motor umake -clean touch _____________________________ diff --git a/src/HEXABLOCK/hexa_base.hxx b/src/HEXABLOCK/hexa_base.hxx index 39e2ba6..c5d09b6 100755 --- a/src/HEXABLOCK/hexa_base.hxx +++ b/src/HEXABLOCK/hexa_base.hxx @@ -17,10 +17,11 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // -#define DumpActif false +#define DumpActif true #ifndef _HEXA_BASE_H_ #define _HEXA_BASE_H_ @@ -39,12 +40,15 @@ typedef FILE* pfile; #define Cestnonvide(c1) c1[0] // Pour rendre les operateurs plus visibles + // ... mais ne passe pas avec ce @#! de swig +#ifndef SWIG #define NOT ! #define XOR ^ #define MODULO % #define INOT ` // #define IOR | #define IAND & +#endif // Swig // Chaines de bits #define DeuxPuissance(n) (1 << (n)) @@ -66,9 +70,11 @@ typedef FILE* pfile; // typedef double Real; // typedef double Real3 [DIM3]; -#ifndef PI -#define PI 3.1415926535898 +#ifndef M_PI +#define M_PI 3.14159265358979323846 #endif +#define Degre2Radian M_PI/180 + // Conventions C++ #include #include @@ -78,9 +84,9 @@ typedef const std::string& rcstring; #include using namespace std; -#define HexDisplay(x) cout << " ... " #x " = " << x << endl +#define HexDisplay(x) cout << " ... " #x " = " << x << endl #define PutData(x) cout << " ... " #x " = " << x << endl -#define PutCoord(x) cout << " ... " #x " = (" << x[0] << ", " \ +#define PutCoord(x) cout << " ... " #x " = (" << x[0] << ", " \ << x[1] << ", " << x[2] << ")" << endl #define Echo(m) cout << " _______________ " << m << endl @@ -115,13 +121,7 @@ using namespace std; //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 -#ifndef NO_CASCADE class TopoDS_Shape; -#else -typedef int TopoDS_Shape; -typedef int TopTools_IndexedMapOfShape; -#endif - class BRepAdaptor_Curve; BEGIN_NAMESPACE_HEXA @@ -129,17 +129,17 @@ BEGIN_NAMESPACE_HEXA enum EnumCoord { dir_x, dir_y, dir_z, DIM3 }; enum EnumElt { EL_NONE, EL_VERTEX, EL_EDGE, EL_QUAD, EL_HEXA, EL_VECTOR, EL_GRID, EL_CYLINDER, EL_PIPE, EL_GROUP, EL_LAW, - EL_SHAPE, EL_SUBSHAPE, - EL_REMOVED, EL_MAXI }; + EL_SHAPE, EL_SUBSHAPE, EL_PROPAGATION, + EL_DOCU, EL_REMOVED, EL_MAXI }; -const cpchar ABR_TYPES = "xveqhwtcpglsu???"; +const cpchar ABR_TYPES = "xveqhwtcpglsupdz???"; enum EnumGroup { HexaCell, QuadCell, EdgeCell, HexaNode, QuadNode, EdgeNode, VertexNode}; // Origine des shapes -enum EnumShape { SH_NONE, SH_IMPORT, SH_CYLINDER, SH_INTER, SH_SPHERE, - SH_CLOUD }; +enum EnumShape { SH_NONE, SH_IMPORT, SH_CYLINDER, SH_INTER, SH_SPHERE, + SH_CLOUD, SH_EXTRUD }; // Modes de remplissage des grilles cylindriques enum EnumCyl { CYL_NOFILL, CYL_CL4, CYL_CL6, CYL_CLOSED, CYL_PEER, CYL_ODD}; @@ -210,6 +210,7 @@ class Pattern; class Shape; class SubShape; class VertexShape; +class BiCylinderShape; class EdgeShape; class FaceShape; class AssoEdge; @@ -220,6 +221,8 @@ typedef std::vector Hexas; typedef std::vector Quads; typedef std::vector Edges; typedef std::vector Shapes; +typedef std::vector Vertices; + typedef std::vector NewShapes; typedef std::vector SubShapes; typedef std::vector AssoEdges; @@ -243,15 +246,22 @@ double prod_scalaire (double v1[], double v2[]); double* prod_vectoriel (double v1[], double v2[], double v3[]); double prod_mixte (double vi[], double vj[], double vk[]); +inline double deg2radians (double angle) { return (angle*M_PI/180.0); } +inline double rad2degres (double angle) { return (angle*180.0/M_PI); } + double calc_norme (double v1[]); double calc_distance (double v1[], double v2[]); void calc_vecteur (double pta[], double ptb[], double vab[]); +void copy_vecteur (double va [], double vb []); void calc_milieu (double pta[], double ptb[], double milieu[]); int normer_vecteur (double v1[]); double carre (double val); bool same_coords (double* pa, double* pb, double epsilon=1e-6); +bool requals (const double v1, const double v2); +bool requals (const double* v1, const double* v2); + bool on_debug(); // == getenv ("HEXA_DB") > 0 bool in_test (); // == getenv ("HEXA_TEST") > 0 int niv_debug(); // Implemente prochainement diff --git a/src/HEXABLOCK/hexa_utils.cxx b/src/HEXABLOCK/hexa_utils.cxx index cfdd356..76a039e 100755 --- a/src/HEXABLOCK/hexa_utils.cxx +++ b/src/HEXABLOCK/hexa_utils.cxx @@ -111,6 +111,13 @@ void calc_vecteur (double pta[], double ptb[], double vab[]) vab [dir_y] = ptb [dir_y] - pta [dir_y]; vab [dir_z] = ptb [dir_z] - pta [dir_z]; } +// ========================================================= copy_vecteur +void copy_vecteur (double va[], double vb[]) +{ + vb [dir_x] = va [dir_x]; + vb [dir_y] = va [dir_y]; + vb [dir_z] = va [dir_z]; +} // ========================================================= calc_milieu void calc_milieu (double pta[], double ptb[], double milieu[]) { @@ -147,7 +154,6 @@ double carre (double val) // ====================================================== same_coords bool same_coords (double* pa, double* pb, double epsilon2) { - double d2 = carre (pb[dir_x]-pa[dir_x]) + carre (pb[dir_y]-pa[dir_y]) + carre (pb[dir_z]-pa[dir_z]); return d2 < epsilon2; @@ -251,4 +257,16 @@ cpchar get_time (string& buffer) buffer = quand; return buffer.c_str(); } +// ======================================================== requals +bool requals (const double v1, const double v2) +{ + static const double Epsilon = 1e-6; + return v1 >= v2 - Epsilon && v1 <= v2 + Epsilon; +} +// ======================================================== requals +bool requals (const double* lun, const double* lautre) +{ + return lun!=NULL && lautre!=NULL && requals (lun [0], lautre [0]) + && requals (lun [1], lautre [1]) && requals (lun [2], lautre [2]) ; +} END_NAMESPACE_HEXA diff --git a/src/HEXABLOCK/make.main b/src/HEXABLOCK/make.main new file mode 100755 index 0000000..e0b0ae1 --- /dev/null +++ b/src/HEXABLOCK/make.main @@ -0,0 +1,33 @@ + +# ================================================== create_test +create_test() +{ +cat << END_PGM +// C++ : appel de $test_u + +int $test_u (int nbargs, const char* tabargs []); + +// ================================ main +int main (int nbargs, const char* tabargs []) +{ + int ier = $test_u (nbargs, tabargs); + return ier; +} + +END_PGM +} +# ================================================== Begin + +test_u=test_hexa +if ( [ -n "$1" ] ) then + test_u=$1 + fi + +echo +echo " ... Generation du fichier $test_u.cpp" +echo + +rm -rf work/$test_u.cpp +create_test > work/$test_u.cpp + + diff --git a/src/HEXABLOCK/make.make b/src/HEXABLOCK/make.make new file mode 100755 index 0000000..9674d53 --- /dev/null +++ b/src/HEXABLOCK/make.make @@ -0,0 +1,229 @@ +#!/bin/sh +# Comm : Generateur de Makefile + +commande=$0 +liste_args="$*" + +# =============================================== al_aide +al_aide() +{ +proc=`basename $commande` +cat << END_HELP +Syntaxe : + $ $proc [ options ] +Effet : + Genere un Makefile tenant compte des fichiers sources passes en argument + et des includes appeles par ces fichiers. +Avec : + liste des fichiers *.c *.cc *.cpp *.cxx et *.C + pris en compte pour constituer le Makefile. + Si des fichiers *.h sont presents, c'est pour generer des + fichiers qt (utilitaire moc) + Options: + Make= : Nom du makefile a generer + opt=val : Option passee + : options de compilation + (par exemple le repertoire des includes) +END_HELP +exit +} +# =============================================== ana_arguments +ana_arguments() +{ +liste_src= +liste_rad= +liste_qrc= +liste_bnf= +liste_moc= +for arg in $liste_args + do + case $arg in + -setx ) + set -x + ;; + -h | --help ) + al_aide + ;; + Make=* | make=* ) + make_file=`echo $arg | cut -f2 -d=` + ;; + * ) + arg_gcc="$arg_gcc $arg" + ;; + esac + done + +for arg in *.cxx + do + case $arg in + + \*.* ) : + ;; + + *.cpp | *.cc | *.cxx | *.C | *.c ) + rad=`echo $arg | cut -f1 -d.` + liste_src="$liste_src $arg" + liste_rad="$liste_rad $rad" + ;; + * ) : + ;; + esac + done +} +# =============================================== put_includes +put_includes() +{ + if ( [ -z "$3" ] ) then + return + fi + + obj=$repobj/$1 + shift 2 + + for mot in $* + do + case $mot in + \\* ) : ;; + + */Qt/* ) : ;; + */VTK* ) : ;; + + * ) echo $obj $mot + ;; + esac + done +} +# =============================================== init_par_defaut +init_par_defaut() +{ +os=`uname` +if ( [ $os = Linux ] ) then + opt_pic=-fPIC + fi + +hdebut=`date '+%Hh %Mmn %Ss'` +make_file=Makefile +make_file=makefile.ozz +antislash=\\ +liste_src= +liste_rad= +arg_gcc= +arg_plus= +make_body=OK +make_ref=OK + +repobj='$(REPOBJ)' +replib='$(REPLIB)' +repexe='$(REPEXE)' +opt_user='$(OPT)' +compile='$(CPIL)' +archive='$(ARCH)' +link='$(LINK)' + +val_repobj=. +cmd_cpil="g++ -c -g $opt_pic -Wall -DNO_CASCADE -Inokas --pedantic" +cmd_arch='ar rcvu $(BIBLI) *.o' +cmd_link='g++ -g' +uf=`pwd` +uf=`basename "$uf"` + +ext= +namof_lib=lib$uf.a + +comm=`basename $commande` +reptools=`dirname $commande` + ### Definition des includes par $ozz_opt_cpp + +if ( [ -n "$OZZ_FLAGS" -a -f "$OZZ_FLAGS" ] ) then + . $OZZ_FLAGS +fi +} +# =============================================== add_entete +add_entete() +{ +today=`date "+%d/%m/%y a %Hh%M"` +echo +echo "# Makefile OZZ genere le $today" +echo "# Par la commande : $comm " +echo "# Role de ce makefile : " +echo "# - Compiler les fichiers-source defraichis avec la commande \$CPIL" +echo "# - Les archiver sur le fichier archive \$REPLIB/\$BIBLI" +echo "# - Linker le programme principal (test unitaire) passe en argument" +echo +echo ".SUFFIXES:" ## Pour ne pas etre emm.... +echo "OPT = " ## Options de compilation de l'appelant +echo "REPOBJ = ." +echo "REPLIB = ." +echo "REPEXE = ./work" +echo "BIBLI = $namof_lib" +echo "ARCH = $cmd_arch" +echo "CPIL = $cmd_cpil" +echo "LINK = $cmd_link" +echo "main = test_hexa" +echo + +precedente="OBJECTS =" + +for module in $liste_rad + do + echo "$precedente \\" + precedente=" $repobj/$module.o" + done + +cat << FIN +$precedente + +all : saut link + +saut : + @ echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo ; echo + +link : $repexe/\$(main).exe + +$repexe/\$(main).cpp : + ./make.main \$(main) + +$repexe/\$(main).exe : $repexe/\$(main).cpp \$(REPLIB)/\$(BIBLI) + \$(LINK) $repexe/\$(main).cpp \$(REPLIB)/\$(BIBLI) -o $repexe/\$(main).exe + +\$(REPLIB)/\$(BIBLI) : \$(OBJECTS) + $archive + +clean : + rm -rf *.exe \$(REPLIB)/\$(BIBLI) \$(REPOBJ)/*.o *.bak *~ + +cleanobj : + rm -rf \$(REPLIB)/\$(BIBLI) \$(REPOBJ)/*.o *.bak *~ + +FIN +} +# =============================================== add_sources +add_sources() +{ +echo +echo " ### Compilations" +echo +for arg in $liste_src + do + radical=`echo $arg | cut -f1 -d.` + echo "$repobj/$radical.o : $arg" + echo " $compile $opt_user $arg" + done +} +# =============================================== Begin +init_par_defaut +echo +echo " ... Generation de $make_file qui met a jour $namof_lib ..." + +ana_arguments +./make_dummycad + +rm -rf $make_file +add_entete >> $make_file +add_sources >> $make_file + +makedepend -f $make_file -Y -I. $liste_src 2> /dev/null + +hfin=`date '+%Hh %Mmn %Ss'` +echo " ... Fin de la generation : $hfin" +echo " ... Elle avait debute a : $hdebut" diff --git a/src/HEXABLOCK/make_dummycad b/src/HEXABLOCK/make_dummycad new file mode 100755 index 0000000..8fe2894 --- /dev/null +++ b/src/HEXABLOCK/make_dummycad @@ -0,0 +1,43 @@ +#!/bin/sh +# Comm : Generation d'une partie CasCade fictive + +rm -rf nokas +mkdir -p nokas +cp HexDummyCad.hxx nokas/ + +while read fic + do + echo '#include "HexDummyCad.hxx"' > nokas/$fic + done << END_OF_FILE +BRepAdaptor_Curve.hxx +BRepAlgoAPI_Section.hxx +BRepBuilderAPI_MakeEdge.hxx +BRepBuilderAPI_MakeVertex.hxx +BRepBuilderAPI_Transform.hxx +BRepPrimAPI_MakeCylinder.hxx +BRepPrimAPI_MakeSphere.hxx +BRepTools.hxx +BRep_Builder.hxx +BRep_Tool.hxx +GCPnts_AbscissaPoint.hxx +GC_MakeCircle.hxx +GEOMImpl_CircleDriver.hxx +GEOMImpl_CylinderDriver.hxx +GEOMImpl_ICircle.hxx +GEOMImpl_ICylinder.hxx +GeomAPI_ProjectPointOnCurve.hxx +Geom_Circle.hxx +TopExp_Explorer.hxx +TopTools_IndexedMapOfShape.hxx +TopoDS.hxx +TopoDS_Compound.hxx +TopoDS_Edge.hxx +TopoDS_Iterator.hxx +TopoDS_Shape.hxx +TopoDS_Vertex.hxx +gp_Circ.hxx +gp_Dir.hxx +gp_Lin.hxx +gp_Pln.hxx +gp_Pnt.hxx +END_OF_FILE diff --git a/src/HEXABLOCK/make_swig b/src/HEXABLOCK/make_swig new file mode 100755 index 0000000..3f193bc --- /dev/null +++ b/src/HEXABLOCK/make_swig @@ -0,0 +1,31 @@ +#!/bin/sh +# Comm : I'm swigging in the rain + +module=hexablock_swig +bibli=`pwd` +bibli=`basename $bibli` + +wrapped=${module}_wrap +wrap_src=$wrapped.cc + +os=`uname` +shared=_$module.so +opt_pic=-fPIC +if ( [ $os != Linux ] ) then + shared=_$module.dll + opt_pic= + fi + + +for a in a a a a a a a a a a a a a a a a a a a a a a a + do echo ; done + +echo " -- Je swigge ..." +swig -python -c++ -o $wrap_src -module ${module} ${module}.i + +echo " -- Je compile ..." +g++ $opt_pic -I/usr/include/python2.6 -c $wrap_src +echo " -- Je linke ..." +g++ -fPIC -shared $wrapped.o -L. -l$bibli -lpython2.6 -o ${shared} +echo " -- J'ai fini." + diff --git a/src/HEXABLOCK/makefile.swig b/src/HEXABLOCK/makefile.swig new file mode 100755 index 0000000..c5f8d3e --- /dev/null +++ b/src/HEXABLOCK/makefile.swig @@ -0,0 +1,37 @@ + +module = hexablock_swig +uf = model +wrapped = $(module)_wrap +wrap_src = $(wrapped).cc +lib_ext = so +shared = _$(module).$(lib_ext) +opt_cpp = -fPIC +pyvers = 2.5 ## Saclay +pyvers = 2.6 + +all : $(shared) + @echo " -- Librairie dynamique $(shared) a jour" + +$(wrap_src) : $(module).i + @echo " -- Appel de swig ..." + swig -python -c++ -o $(wrap_src) $(module).i +####swig -python -c++ -o $(wrap_src) -module $(module) $(module).i + +$(wrapped).o : $(wrap_src) + @echo " -- Compilation module genere par swig ..." + g++ $(opt_cpp) -I/usr/include/python$(pyvers) -c $(wrap_src) + +$(shared) : $(wrapped).o lib$(uf).a + @echo " -- Edition de liens librairie dynamique ..." + g++ -shared $(wrapped).o -L. -l$(uf) -lpython$(pyvers) -o $(shared) + +$(wrap_src) : Hex.hxx +$(wrap_src) : HexDocument.hxx +$(wrap_src) : HexEltBase.hxx +$(wrap_src) : HexVertex.hxx +$(wrap_src) : HexEdge.hxx +$(wrap_src) : HexQuad.hxx +$(wrap_src) : HexHexa.hxx +$(wrap_src) : HexElements.hxx +$(wrap_src) : HexCrossElements.hxx +$(wrap_src) : HexBiCylinder.hxx diff --git a/src/HEXABLOCK/test_brep.cxx b/src/HEXABLOCK/test_brep.cxx index 7879930..397dae8 100755 --- a/src/HEXABLOCK/test_brep.cxx +++ b/src/HEXABLOCK/test_brep.cxx @@ -1,24 +1,24 @@ // C++ : Extraction des brep d'un fichier XML -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D and My Apple // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #include "HexXmlTree.hxx" diff --git a/src/HEXABLOCK/test_hexa1.cxx b/src/HEXABLOCK/test_hexa1.cxx index a7d68f9..089b6cc 100755 --- a/src/HEXABLOCK/test_hexa1.cxx +++ b/src/HEXABLOCK/test_hexa1.cxx @@ -1,24 +1,24 @@ // C++ : Tests unitaires -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #include "test_unit.hxx" @@ -33,7 +33,6 @@ #include "HexVertex.hxx" #include "HexPropagation.hxx" -#include "HexOldShape.hxx" #include "HexLaw.hxx" #include "HexMatrix.hxx" #include "HexCramer.hxx" @@ -234,7 +233,7 @@ int test_joint (int nbargs, cpchar tabargs[]) Hex::Vector* vectj = doc->addVector (0,1,0); Hex::Vector* vecti = doc->addVector (1,0,0); Hex::Elements* grid2 = doc->makeCylindrical (orig2, vecti, vectj, - 1, 180, 1, dimz,dimy,dimx); + 1, 180, 1, dimz,dimy,dimx, true); int mx = dimx/2; int my = dimy/2; @@ -442,7 +441,6 @@ int test_revolution (int nbargs, cpchar tabargs[]) Hex::Elements* grid = doc->makeCylindrical (ori, vx,vz, dr,da,dl, nr,na,nl, false); - Hex::Quads liste; for (int nx=0; nxmakeCylindrical (orig1, vx,vz,dr, 360, dl,nr, 10, nl, false); +// Hex::Elements* c1 = + doc->makeCylindrical (orig1, vx,vz,dr, 360, dl,nr, 10, nl, false); HexDisplay (doc->countVertex ()); HexDisplay (doc->countUsedVertex ()); @@ -624,9 +621,10 @@ int test_gen_xml (int nbargs, cpchar tabargs[]) Hex::Vertex* orig = doc->addVertex (0,0,0); Hex::Vector* dir = doc->addVector (1,1,1); - Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x,size_y,size_z); + // Hex::Elements* grid = + doc->makeCartesian (orig, dir, size_x,size_y,size_z); - Hex::Hexa* cell = grid->getHexa (0); + // Hex::Hexa* cell = grid->getHexa (0); // Hex::Quad* face = cell->getQuad (0); // Hex::Edge* arete = cell->getEdge (0); // Hex::Vertex* noeud = cell->getVertex (0); @@ -676,9 +674,10 @@ int test_string_xml (int nbargs, cpchar tabargs[]) Hex::Vertex* orig = doc->addVertex (0,0,0); Hex::Vector* dir = doc->addVector (1,1,1); - Hex::Elements* grid = doc->makeCartesian (orig, dir, size_x,size_y,size_z); + // Hex::Elements* grid = + doc->makeCartesian (orig, dir, size_x,size_y,size_z); - Hex::Hexa* cell = grid->getHexa (0); + // Hex::Hexa* cell = grid->getHexa (0); // Hex::Quad* face = cell->getQuad (0); // Hex::Edge* arete = cell->getEdge (0); // Hex::Vertex* noeud = cell->getVertex (0); @@ -808,11 +807,11 @@ int test_spherical (int nbargs, const char* tabargs[]) double rayon = 1; int nbr = 3; - Hex::Elements* grid = doc->makeSpherical (orig, rayon, nbr); + Hex::Elements* grid = doc->makeSpherical (orig, rayon, nbr, 1); int nbhexas = grid->countHexa (); HexDisplay (nbhexas); - for (int nro=0 ; nrogetHexa(nro)->remove(); HexDisplay (doc->countHexa ()); doc->saveVtk ("shperical.vtk"); @@ -843,14 +842,13 @@ int test_grille_cyl (int nbargs, cpchar tabargs[]) int nr = 2; int nl = 3; - Hex::Elements *c1, *c2, *c3, *c4, *c5, *c6; - - c1 = doc->makeCylindrical (orig1, vx,vz,dr, 360, dl,nr, 4, nl, true); - c2 = doc->makeCylindrical (orig2, vx,vz,dr, 360, dl,nr, 8, nl, true); - c3 = doc->makeCylindrical (orig3, vx,vz,dr, 270, dl,nr, 8, nl, true); - c4 = doc->makeCylindrical (orig4, vx,vz,dr, 270, dl,nr, 7, nl, true); - c5 = doc->makeCylindrical (orig5, vx,vz,dr, 360, dl,nr, 5, nl, true); - c6 = doc->makeCylindrical (orig6, vx,vz,dr, 360, dl,nr, 6, nl, true); + doc->makeCylindrical (orig1, vx,vz,dr, 360, dl,nr, 4, nl, true); + Hex::Elements* c2 = + doc->makeCylindrical (orig2, vx,vz,dr, 360, dl,nr, 8, nl, true); + doc->makeCylindrical (orig3, vx,vz,dr, 270, dl,nr, 8, nl, true); + doc->makeCylindrical (orig4, vx,vz,dr, 270, dl,nr, 7, nl, true); + doc->makeCylindrical (orig5, vx,vz,dr, 360, dl,nr, 5, nl, true); + doc->makeCylindrical (orig6, vx,vz,dr, 360, dl,nr, 6, nl, true); int base2 = nr*nl*8; c2->getHexa(base2 + 0)->setScalar (5); @@ -899,7 +897,7 @@ int test_cylindrical (int nbargs, cpchar tabargs[]) // Hex::Cylinder* cyl = doc->addCylinder (orig, vz, nr, nl); // Hex::Elements* grid = doc->makeCylinder (cyl, vx, nr, na, nl); doc->makeCylindrical (orig,vx, vz, dr,da,dl, nr,na, nl, true); - doc ->saveVtk (fic_vtk, na); + doc->saveVtk (fic_vtk, na); return HOK; } // ===================================================== test_cylinder @@ -1102,23 +1100,23 @@ int test_joint2 (int nbargs, cpchar tabargs[]) int test_croix (int nbargs, cpchar tabargs[]) { Hex::Hex mon_ex; - docu = mon_ex.addDocument (); + case_name = "croix"; + docu = mon_ex.addDocument (case_name); - Hex::Vertex* ori1 = docu->addVertex ( 100,0,0); + Hex::Vertex* ori1 = docu->addVertex ( 0,0,0); Hex::Vertex* ori2 = docu->addVertex (-5,0,5); Hex::Vector* vz = docu->addVector ( 0,0,1); Hex::Vector* vx = docu->addVector ( 1,0,0); double r1 = 2; double r2 = 3; - double l1 = 5; + double l1 = 10; double l2 = 10; Hex::Cylinder* cyl1 = docu->addCylinder (ori1, vz, r1, l1); Hex::Cylinder* cyl2 = docu->addCylinder (ori2, vx, r2, l2); Hex::CrossElements* grid = docu->makeCylinders (cyl1, cyl2); - case_name = "croix"; save_vtk (); PutData ((BadElement (grid))); @@ -1155,6 +1153,44 @@ int test_croix (int nbargs, cpchar tabargs[]) del_tranche (grid, 1, 1, 2, 2); return HOK; } +// ======================================================== test_croix2 +int test_croix2 (int nbargs, cpchar tabargs[]) +{ + Hex::Hex mon_ex; + case_name = "croix"; + docu = mon_ex.addDocument (case_name); + + Hex::Vertex* pt1 = docu->addVertex ( 0,0,0); + Hex::Vertex* pt2 = docu->addVertex (10,0,0); + + Hex::Vector* dx = docu->addVector ( 1,0,0); + Hex::Vector* dy = docu->addVector ( 0,1,0); + Hex::Vector* dz = docu->addVector ( 0,0,1); + + double r1 = 4; + double r2 = 2; + double l1 = 20; + double l2 = 15; + + Hex::Cylinder* cyl1 = docu->addCylinder (pt1, dx, r1, l1); + Hex::Cylinder* cyl2 = docu->addCylinder (pt2, dz, r2, l2); + + int nr = 3; + int na = 8; + int nl = 2; + Hex::Elements* grid1 = docu->makeCylinder (cyl1, dy, nr, na, nl); + grid1->saveVtk ("cyl_big.vtk"); + Hex::Elements* grid2 = docu->makeCylinder (cyl2, dy, nr, na, nl); + grid2->saveVtk ("cyl_small.vtk"); + + PutData ((BadElement (grid1))); + PutData ((BadElement (grid2))); + + Hex::CrossElements* grid = docu->makeCylinders (cyl1, cyl2); + + grid->saveVtk ("cyl_all.vtk"); + return HOK; +} // ======================================================== test_pipes int test_pipes (int nbargs, cpchar tabargs[]) { @@ -1298,25 +1334,17 @@ int test_disconnect2 (int nbargs, cpchar tabargs[]) const int size_z = 1; Hex::Hex mon_ex; - Hex::Document* doc = mon_ex.addDocument (); - - Hex::Vertex* orig2 = doc->addVertex (0,0,0); - Hex::Vector* dir = doc->addVector (1,1,1); - Hex::Elements* grid2 = doc->makeCartesian (orig2, dir, size_x,size_y,size_z); - - doc->dump (); + Hex::Document* doc = mon_ex.addDocument (); + Hex::Elements* grid2 = doc->makeCartesianTop (size_x,size_y,size_z); int nvtk = 0; doc->setLevel (1); - Hex::Matrix matrice; - Hex::Vector* ecart = doc->addVector (0.5,0.5,0); - matrice.defTranslation (ecart); Hex::Hexa* hexa2 = grid2->getHexaIJK (1,1,0); Hex::Edge* edge = grid2->getEdgeK (1,2,0); - hexa2->setScalar (2); - edge->setScalar (5); + hexa2->setColor (2); + edge->setColor (5); doc->saveVtk ("test_disco", nvtk); @@ -1328,22 +1356,12 @@ int test_disconnect2 (int nbargs, cpchar tabargs[]) HexDisplay (disco_edges->countQuad()); HexDisplay (disco_edges->countHexa()); - // hexa2->transform (&matrice); - /********************************** - for (int ns=0; nscountVertex(); ns++) - { - Hex::Vertex* sommet = disco_edges->getVertex(ns); - sommet->setX (sommet->getX()+0.5); - sommet->setY (sommet->getY()+0.5); - } - ********************************* */ - doc->saveVtk ("test_disco", nvtk); doc->save ("test_disco"); - doc->dump (); - hexa2->dumpFull (); + // doc->dump (); + // hexa2->dumpFull (); - doc->setLevel (4); + // doc->setLevel (4); return HOK; } // ======================================================== test_disconnect4 @@ -1391,7 +1409,7 @@ int test_disconnect4 (int nbargs, cpchar tabargs[]) doc->setLevel (4); return HOK; } -// ======================================================== test_disconnect +// ======================================================== test_disconnect1 // ==== Disconnect Quad int test_disconnect1 (int nbargs, cpchar tabargs[]) { @@ -1510,10 +1528,17 @@ int test_disconnect (int nbargs, cpchar tabargs[]) Hex::Vertex* orig2 = doc->addVertex (4,0,0); Hex::Vertex* orig3 = doc->addVertex (8,0,0); - Hex::Vector* dir = doc->addVector (1,1,1); - Hex::Elements* grid1 = doc->makeCartesian (orig1, dir, size_x,size_y,size_z); - Hex::Elements* grid2 = doc->makeCartesian (orig2, dir, size_x,size_y,size_z); - Hex::Elements* grid3 = doc->makeCartesian (orig3, dir, size_x,size_y,size_z); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + double dx=1, dy=1, dz=1; + + Hex::Elements* grid1 = doc->makeCartesianUni (orig1, vx,vy,vz, dx,dy,dz, + size_x,size_y,size_z); + Hex::Elements* grid2 = doc->makeCartesianUni (orig2, vx,vy,vz, dx,dy,dz, + size_x,size_y,size_z); + Hex::Elements* grid3 = doc->makeCartesianUni (orig3, vx,vy,vz, dx,dy,dz, + size_x,size_y,size_z); int nvtk = 0; doc->setLevel (1); @@ -1890,7 +1915,7 @@ int test_edge (int nbargs, cpchar tabargs[]) Hex::Vertex* orig = doc->addVertex (0, 0, 0); Hex::Vector* vx = doc->addVector (1 ,0, 0); - doc->addEdge (orig, vx); + doc->addEdgeVector (orig, vx); HexDisplay (doc->countVertex()); HexDisplay (doc->countEdge()); diff --git a/src/HEXABLOCK/test_hexa5.cxx b/src/HEXABLOCK/test_hexa5.cxx index dac404e..3a85baf 100644 --- a/src/HEXABLOCK/test_hexa5.cxx +++ b/src/HEXABLOCK/test_hexa5.cxx @@ -1,23 +1,24 @@ // C++ : Tests unitaires sur les creations h'hexaedres -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #include "Hex.hxx" @@ -101,8 +102,8 @@ int test_replace5 (int nbargs, cpchar tabargs[]) doc->saveVtk (son_nom, nvtk); - Hex::Elements* grid2 = doc->makeCylindrical (ori2, vx, vz, - dr, da, dl, nr, na, nl, false); + // Hex::Elements* grid2 = + doc->makeCylindrical (ori2, vx, vz, dr, da, dl, nr, na, nl, false); doc->saveVtk (son_nom, nvtk); grid0->remove (); @@ -150,7 +151,7 @@ int test_get (int nbargs, cpchar tabargs[]) doc->saveVtk (son_nom, nvtk); doc->saveVtk (son_nom, nvtk); doc->saveVtk (son_nom, nvtk); - + return HOK; } // ======================================================== test_dump int test_dump (int nbargs, cpchar tabargs[]) @@ -161,7 +162,7 @@ int test_dump (int nbargs, cpchar tabargs[]) double lgcell = 3; double cray = lgcell*size_x/2; - double decal = lgcell/sqrt (2.0); + // double decal = lgcell/sqrt (2.0); int nvtk = 0; cpchar son_nom = "test_dump"; @@ -174,8 +175,8 @@ int test_dump (int nbargs, cpchar tabargs[]) Hex::Vector* vy = doc->addVector (0,3,0); Hex::Vector* vz = doc->addVector (0,0,1); - Hex::Elements* grid1 = doc->makeCartesian (ori1, vx, vy, vz, - size_x,size_y,size_z); + //Hex::Elements* grid1 = + doc->makeCartesian (ori1, vx, vy, vz, size_x,size_y,size_z); doc->saveVtk (son_nom, nvtk); return HOK; } diff --git a/src/HEXABLOCK/test_hexa6.cxx b/src/HEXABLOCK/test_hexa6.cxx new file mode 100644 index 0000000..017bc7e --- /dev/null +++ b/src/HEXABLOCK/test_hexa6.cxx @@ -0,0 +1,746 @@ + +// C++ : Tests unitaires + +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 "test_unit.hxx" + +#include "Hex.hxx" +#include "HexDocument.hxx" +#include "HexElements.hxx" +#include "HexBiCylinder.hxx" +// #include "HexCrossElements.hxx" + +#include "HexHexa.hxx" +// #include "HexQuad.hxx" +// #include "HexEdge.hxx" +// #include "HexVertex.hxx" + +static Hex::Hex mon_ex; +static Hex::Document* docu = NULL; +static cpchar case_name = "hexa"; + +// ======================================================== get_document +Hex::Document* get_document () +{ + if (docu==NULL) + docu = mon_ex.addDocument (); + + return docu; +} + +// ======================================================== save_file +void save_file () +{ + static int nbr_files = 0; + char filename[20]; + + nbr_files ++; + sprintf (filename, "%s%02d.vtk", case_name, nbr_files); + docu->saveVtk (filename); +} + +// ======================================================== nearest +Hex::Vertex* nearest (Hex::Elements* grid, Hex::Vertex* vertex) +{ + int nbre = grid->countVertex(); + double dmin = 1e+6; + Hex::Vertex* result = NULL; + double px = vertex->getX(); + double py = vertex->getY(); + double pz = vertex->getZ(); + for (int nro=0 ; nro < nbre ; ++nro) + { + Hex::Vertex* v1 = grid->getVertex (nro); + double d2 = Hex::carre(px-v1->getX()) + Hex::carre(py-v1->getY()) + + Hex::carre(pz-v1->getZ()) ; + if (d2 < dmin) + { + result = v1; + dmin = d2; + } + } + + cout << " nearest : " << vertex->getName() + << " -> " << result->getName() + << " ( " << px << ", " << py << ", " << pz << ") " << endl; + return result; +} + +// ======================================================== eplucher +void eplucher (Hex::Document* doc, Hex::Elements* grid, string& radical) +{ + int nbfic = 0; + int nbre = grid->countHexa(); + for (int nro=nbre-1 ; nro >0 ; nro--) + { + nbfic++; + char name [32]; + sprintf (name, "%s%02d.vtk", radical.c_str(), nbfic); + grid->saveVtk (name); + doc->removeHexa (grid->getHexa(nro)); + } +} +// ======================================================== test_cartesian6 +int test_cartesian6 (int nbargs, cpchar tabargs[]) +{ + case_name = "cartesian_top"; + const int size_x = 3; + const int size_y = 4; + const int size_z = 5; + + Hex::Document* doc = get_document (); + + Hex::Elements* grid1 = doc->makeCartesianTop (size_x, size_y, size_z); + grid1->saveVtk ("makeCartesianTop.vtk"); + PutData (grid1->isValid()); + return HOK; + + Hex::Vertex* orig2 = doc->addVertex (10, 0, 0); + Hex::Vector* vx = doc->addVector (1, 0, 0); + Hex::Vector* vy = doc->addVector (0, 1, 0); + Hex::Vector* vz = doc->addVector (0, 0, 1); + double dx =1, dy=1, dz=1; + Hex::Elements* grid2 = doc->makeCartesianUni (orig2, vx, vy, vz, dx, dy, dz, + size_x, size_y, size_z); + grid2->saveVtk ("makeCartesianUni.vtk"); + PutData (grid2->isValid()); + + Hex::Vertex* orig3 = doc->addVertex (20, 0, 0); + Hex::RealVector tx, ty, tz; + for (int nro=1 ; nro<6 ; nro++) + { + tx.push_back (nro); + ty.push_back (nro); + tz.push_back (nro); + } + + tz.push_back (1); + Hex::Elements* grid3 = doc->makeCartesian (orig3, vx, vy, vz, tx, ty, tz); + grid3->saveVtk ("makeCartesian.vtk"); + PutData (grid3->isValid()); + + // doc->dump (); + return HOK; +} +// ======================================================== test_cylinder60 +int test_cylinder60 (int nbargs, cpchar tabargs[]) +{ + case_name = "cylinders"; + const int size_x = 1; + const int size_y = 4; + const int size_z = 1; + + Hex::Document* doc = get_document (); + Hex::Vertex* orig = doc->addVertex (0, 0, 0); + Hex::Vector* vx = doc->addVector (1, 0, 0); + Hex::Vector* vz = doc->addVector (0, 0, 1); + double rint =1, rext = 3, angle = 360, hauteur = 2; + Hex::Elements* grid3 = doc->makePipeUni (orig, vx, vz, + rint, rext, angle, hauteur, + size_x, size_y, size_z); + grid3->saveVtk ("makeCylinderUni.vtk"); + PutData (grid3->isValid()); + if (NOT (grid3->isValid())) + Hex::what (); + + doc->dump (); + return HOK; +} +// ======================================================== test_cylinder_top +int test_cylinder_top (int nbargs, cpchar tabargs[]) +{ + case_name = "cylinders"; + const int size_x = 1; + const int size_y = 3; + const int size_z = 1; + + Hex::Document* doc = get_document (); + Hex::Elements* grid1 = doc->makeCylinderTop (size_x, size_y, size_z); + + grid1->saveVtk ("makeCylinderTop.vtk"); + PutData (grid1->isValid()); + return HOK; +} +// ======================================================== test_cylinder6 +int test_cylinder6 (int nbargs, cpchar tabargs[]) +{ + case_name = "cylinders"; + const int size_x = 3; + const int size_y = 8; + const int size_z = 2; + + Hex::Document* doc = get_document (); + + /******************** + Hex::Elements* grid1 = doc->makeCylinderTop (size_x, size_y, size_z); + grid1->saveVtk ("makeCylinderTop.vtk"); + PutData (grid1->isValid()); + + + Hex::Elements* grid2 = doc->makePipeTop (size_x, size_y, size_z); + grid2->saveVtk ("makePipeTop.vtk"); + PutData (grid2->isValid()); + ******************************/ + + Hex::Vertex* orig2 = doc->addVertex (0, 0, 5); + Hex::Vector* vx = doc->addVector (1, 0, 0); + Hex::Vector* vz = doc->addVector (0, 0, 1); + double rint =2, rext = 4, angle = 300, hauteur = 1; + Hex::Elements* grid3 = doc->makeCylinderUni (orig2, vx, vz, + rint, rext, angle, hauteur, + 2, 3, 2); + // size_x, size_y, size_z); + grid3->saveVtk ("makeCylinderUni1.vtk"); + PutData (grid3->isValid()); + if (NOT (grid3->isValid())) + Hex::what (); + return HOK; + +#if 0 + Hex::Vertex* orig3 = doc->addVertex (20, 0, 0); + Hex::RealVector tx, ty, tz; + for (int nro=1 ; nro<6 ; nro++) + { + tx.push_back (nro); + ty.push_back (nro); + tz.push_back (nro); + } + + tz.push_back (1); + Hex::Elements* grid3 = doc->makeCartesian (orig3, vx, vy, vz, tx, ty, tz); + grid3->saveVtk ("makeCartesian.vtk"); + PutData (grid3->isValid()); + + // doc->dump (); +#endif + return HOK; +} +// ======================================================== test_spherical6 +int test_spherical6 (int nbargs, cpchar tabargs[]) +{ + case_name = "spherical"; + const int size_x = 3; + + Hex::Document* doc = get_document (); + + Hex::Elements* grid1 = doc->makeSphericalTop (size_x); + PutData (grid1->isValid()); + + int nbhexas = grid1->countHexa (); + PutData (nbhexas); + for (int nro=3 ; nrogetHexa(nro)->remove(); + + grid1->saveVtk ("makeSphericalTop.vtk"); + + Hex::Vertex* orig2 = doc->addVertex (0, 0, 10); + Hex::Vector* vx = doc->addVector (1, 0, 0); + Hex::Vector* vz = doc->addVector (0, 1, 1); + double rayon = 1; + Hex::Elements* grid2 = doc->makeSphericalUni (orig2, vx, vz, rayon, size_x); + if (NOT (grid1->isValid())) + Hex::what (); + + PutData (grid2->isValid()); + if (NOT (grid2->isValid())) + Hex::what (); + + for (int nro=3 ; nrogetHexa(nro)->remove(); + + grid2->saveVtk ("makeSphericalUni.vtk"); + return HOK; +} +// ======================================================== test_rind6 +int test_rind6 (int nbargs, cpchar tabargs[]) +{ + case_name = "rind"; + const int size_r = 4; + const int size_a = 8; + const int size_h = 12; + + Hex::Document* doc = get_document (); + + Hex::Elements* grid1 = doc->makeSphereTop (size_r, size_a, size_h); + PutData (grid1->isValid()); + if (NOT (grid1->isValid())) + Hex::what (); + else + grid1->saveVtk ("makeSphereTop.vtk"); + + Hex::Elements* grid2 = doc->makeRindTop (size_r, size_a, size_h); + PutData (grid2->isValid()); + if (NOT (grid2->isValid())) + Hex::what (); + else + grid2->saveVtk ("makeRindTop.vtk"); + + Hex::Vertex* orig = doc->addVertex (0, 0, 0); + Hex::Vertex* vplan = doc->addVertex (0, 0, -0.5); + Hex::Vector* vx = doc->addVector (1, 0, 0); + Hex::Vector* vz = doc->addVector (0, 0, 1); + double rtrou = 1; + double rint = 8; + double rext = 10; + double angle = 180; + + Hex::Elements* grid3 = doc->makeSphereUni (orig, vx, vz, + rtrou, rext, angle, vplan, + size_r, size_a, size_h); + if (NOT (grid3->isValid())) + Hex::what (); + else + grid3->saveVtk ("makeSphereUni.vtk"); + + Hex::Elements* grid4 = doc->makeRindUni (orig, vx, vz, + rtrou, rext, rint, angle, vplan, + size_r, size_a, size_h); + if (NOT (grid4->isValid())) + Hex::what (); + else + grid4->saveVtk ("makeRindUni.vtk"); + + Hex::Elements* grid5 = doc->makePartSphere (orig, vx, vz, rext, rtrou, vplan, + angle, size_r, size_a, size_h); + if (NOT (grid5->isValid())) + Hex::what (); + else + grid5->saveVtk ("makeSphereOld.vtk"); + + Hex::RealVector trad, tang, tphi; + double dr = (rext-rtrou)/size_r; + double dtheta = angle/size_a; + double dphi = 180.0/size_h; + for (int nro=0 ; nro<=size_r ; nro++) trad.push_back (rtrou + nro*dr); + for (int nro=0 ; nro<=size_a ; nro++) tang.push_back ( nro*dtheta); + for (int nro=0 ; nro<=size_h ; nro++) tphi.push_back (-90 + nro*dphi); + + Hex::Elements* grid6 = doc->makeSphere (orig, vx, vz, trad, tang, tphi); + if (NOT (grid6->isValid())) + Hex::what (); + else + grid6->saveVtk ("makeSphereNew.vtk"); + + trad.clear (); + trad.push_back (rtrou); + for (int nro=0 ; nro<=size_r ; nro++) trad.push_back (rint + nro*dr); + Hex::Elements* grid7 = doc->makeRind (orig, vx, vz, trad, tang, tphi); + if (NOT (grid7->isValid())) + Hex::what (); + else + grid7->saveVtk ("makeRindNew.vtk"); + return HOK; +} +// ======================================================== test_pipes6 +int test_pipes6 (int nbargs, cpchar tabargs[]) +{ + case_name = "pipes"; + bool t_left = false; + bool t_right = false; + bool pipe = true; + + for (int narg=1 ; narg " << endl; + cout << " avec args parmi :" << endl; + cout << " -cyl : croisement de 2 cylindres " << endl; + cout << " -pipe : croisement de 2 tuyaux " << endl; + cout << " -left : Forme en T, barre a gauche " << endl; + cout << " -right : Forme en T, barre a droite " << endl; + return HOK; + } + } + + string radical = pipe ? "makePipes" : "makeCylinders"; + + double rext1 = 2*sqrt (2.0); + double rext2 = 3*sqrt (2.0); + double rint2 = rext1; + double rint1 = rext1/2; + double h1 = 16; + double h2 = 16; + double xl1 = -8; + + if (t_left) + { + h1 = 10; + radical += "_L"; + } + else if (t_right) + { + xl1 = -2; + h1 = 10; + radical += "_R"; + } + + Hex::Document* doc = get_document (); + + Hex::Vertex* ori1 = doc->addVertex ( 0, 0, xl1); + Hex::Vertex* ori2 = doc->addVertex (-8, 0, 0); + Hex::Vector* vz1 = doc->addVector ( 0, 0, 1); + Hex::Vector* vz2 = doc->addVector ( 1, 0, 0); + + Hex::BiCylinder* grid1 = NULL; + if (pipe) + grid1 = doc->makePipes (ori1, vz1, rint1, rext1, h1, ori2, vz2, rint2, + rext2, h2); + else + grid1 = doc->makeCylinders (ori1, vz1, rext1, h1, ori2, vz2, rext2, h2); + + PutData (grid1->isValid()); + Hex::what (); + if (grid1->isValid()) + eplucher (doc, grid1, radical); + + return HOK; +} +// ======================================================== test_extrude6 +int test_extrude6 (int nbargs, cpchar tabargs[]) +{ + const int dimx = 11; + const int dimy = 11; + const int dimz = 2; + + Hex::Document* doc = get_document (); + + Hex::Vertex* orig1 = doc->addVertex ( 0,0,0); + Hex::Vector* vx = doc->addVector ( 1,0,0); + Hex::Vector* vy = doc->addVector ( 0,1,0); + Hex::Vector* vz = doc->addVector ( 0,0,1); + Hex::Vector* dir1 = doc->addVector ( 1,1,1); + Hex::Vector* dir2 = doc->addVector ( 1,1,-1); + + double dx =1, dy=1, dz=1; + Hex::Elements* grid1 = doc->makeCartesianUni (orig1, vx,vy,vz, dx,dy,dz, + dimx,dimy,dimz); + + int mx = dimx/2; + int my = dimy/2; + Hex::Quads liste1, liste2; + + liste1.push_back (grid1->getQuadIJ (mx, my, dimz)); + liste2.push_back (grid1->getQuadIJ (mx, my, 0)); + for (int nx=0; nxgetQuadIJ (nx, my, dimz)); + liste2.push_back (grid1->getQuadIJ (nx, my, 0)); + } + + for (int ny=0; nygetQuadIJ (mx, ny, dimz)); + liste2.push_back (grid1->getQuadIJ (mx, ny, 0)); + } + + Hex::RealVector tlen; + double dh0 = 1; + double dh = 0.02; + double lh = 0; + for (int nro=0; nro<5; nro++) + { + dh = 1.5*dh + 1; + lh += dh; + tlen.push_back (lh); + } + + const int nbiter = 5; + doc->saveVtk ("prisme1.vtk"); + Hex::Elements* prisme2 = doc->extrudeQuadsUni (liste2, dir2, dh0, nbiter); + doc->saveVtk ("prisme2.vtk"); + + Hex::Elements* prisme1 = doc->extrudeQuads (liste1, dir1, tlen); + + PutData (liste1.size()); + PutData (tlen.size()); + PutData (prisme1->countHexa()); + PutData (prisme1->countQuad()); + PutData (prisme1->countEdge()); + PutData (prisme1->countVertex()); + + for (int nro=0 ; nro getHexa (nbiter+nro); + cell->setScalar (5); + } + + doc->saveVtk ("prisme3.vtk"); + return HOK; +} +// ======================================================== test_revolution6 +int test_revolution6 (int nbargs, cpchar tabargs[]) +{ + Hex::Document* doc = get_document (); + + Hex::Vertex* centre = doc->addVertex (0, 0, 0); + Hex::Vector* vz = doc->addVector (0, 0, 1); + + Hex::Vertex* v1 = doc->addVertex (10, 0, 0); + Hex::Vertex* v2 = doc->addVertex (11, 0, 0); + Hex::Vertex* v3 = doc->addVertex (11, 0, 2); + Hex::Vertex* v4 = doc->addVertex (10, 0, 2); + Hex::Quad* quad = doc->addQuadVertices (v1, v2, v3, v4); + + Hex::Elements* grid0 = doc->revolutionQuadUni (quad, centre, vz, 180, 8); + doc->saveVtk ("revolution1.vtk"); + return HOK; + + int nr = 1; + int na = 6; + int nl = 1; + + Hex::Elements* grid = doc->makeCylinderTop (nr,na,nl); + + Hex::Quads liste; + for (int nx=0; nxgetQuadIJ (nx, ny, nl); + liste.push_back (cell); + cell -> setScalar (5); + } + + Hex::Vertex* center = doc->addVertex (0, -10, 0); + center -> setScalar (6); + Hex::Vector* axis = doc->addVector (1, 0, 0); + + doc->saveVtk ("revolution1.vtk"); + + Hex::Elements* grid1 = doc->revolutionQuadsUni (liste, center, axis, 180, 9); + Hex::what (); + if (grid1->isValid()) + doc->saveVtk ("revolution2.vtk"); + + return HOK; +} +// ======================================================== test_joint6 +int test_joint6 (int nbargs, cpchar tabargs[]) +{ + const int dimx = 11; + const int dimy = 11; + const int dimz = 2; + + Hex::Document* doc = get_document (); + + Hex::Elements* grid1 = doc->makeCartesianTop (dimx,dimy,dimz); + + Hex::Vertex* orig2 = doc->addVertex (dimx/2.0,0,8); + Hex::Vector* vectj = doc->addVector (0,1,0); + Hex::Vector* vecti = doc->addVector (1,0,0); + Hex::Elements* grid2 = doc->makeCylinderUni (orig2, vecti, vectj, + 1.0, 2.0, 180.0, 11.0, dimz,dimy,dimx); + + int mx = dimx/2; + int my = dimy/2; + Hex::Quad* prems = grid1->getQuadIJ (mx, my, dimz); + Hex::Quad* cible = grid2->getQuadJK (dimz, mx, my); + + Hex::Vertex* va1 = prems->getVertex (0); + Hex::Vertex* va2 = prems->getVertex (1); + + Hex::Vertex* vb1 = cible->getVertex (1); + Hex::Vertex* vb2 = cible->getVertex (2); + + + Hex::Quads liste; + + liste.push_back (prems); + for (int nx=0; nxgetQuadIJ (nx, my, dimz)); + + for (int ny=0; nygetQuadIJ (mx, ny, dimz)); + + doc->saveVtk ("jointQuad1.vtk"); + const int hauteur = 5; + Hex::Elements* joint = doc->joinQuadsUni (liste, cible, va1,vb1,va2,vb2, + hauteur); + // for (int nh=0 ; nhgetHexa(nh)->setScalar (5); + + Hex::what (); + if (NOT joint->isValid ()) + return HERR; + + doc->saveVtk ("jointQuad2.vtk"); + int nbr_joint_vertex = joint->countVertex (); + int nbr_surf_vertex = nbr_joint_vertex/(hauteur+1); + + HexDisplay (nbr_joint_vertex); + HexDisplay (nbr_surf_vertex); + + int indice0 = joint->findVertex (va1); + HexDisplay (indice0); + + for (int nh=0 ; nhgetVertex(nh)->setScalar (5); + + for (int nh=0 ; nh<=hauteur ; nh++) + joint->getVertex(nh*nbr_surf_vertex)->setScalar (3); + + doc->saveVtk ("jointQuad3.vtk"); + return HOK; +} +// ======================================================== test_cut6 +int test_cut6 (int nbargs, cpchar tabargs[]) +{ + const int size_x = 2; + const int size_y = 1; + const int size_z = 1; + + Hex::Document* doc = get_document (); + + Hex::Elements* grid = doc->makeCartesianTop (size_x,size_y,size_z); + Hex::Edge* arete = grid->getEdgeK (0, 0, 0); + + // doc ->dump (); + int nvtk=0; + doc ->saveVtk ("decoupe", nvtk); + Hex::Elements* grid2 = doc->cutUni (arete, 2); + Hex::what (); + if (NOT grid2->isValid ()) + return HERR; + doc ->saveVtk ("decoupe", nvtk); + + Hex::RealVector tablen; + double reste = 1; + double abscisse = 0; + for (int nl=0 ; nl < 5 ; nl++) + { + reste /= 2; + abscisse += reste; + tablen.push_back (abscisse); + } + arete = grid2->getEdge (0); + Hex::Elements* grid3 = doc->cut (arete, tablen); + if (NOT grid3->isValid ()) + return HERR; + + doc ->saveVtk ("decoupe", nvtk); + return HOK; +} +// ======================================================== test_six +void test_six (Hex::Document* doc, int action) +{ + cpchar tabargs[] = { "salome" }; + int nbargs = 1; + + docu = doc; + switch (action) + { + case 101 : test_cartesian6 (nbargs, tabargs); + break; + + case 102 : test_cylinder6 (nbargs, tabargs); + break; + + case 103 : test_spherical6 (nbargs, tabargs); + break; + + case 104 : test_rind6 (nbargs, tabargs); + break; + + case 105 : test_pipes6 (nbargs, tabargs); + break; + + case 106 : test_extrude6 (nbargs, tabargs); + break; + + case 107 : test_joint6 (nbargs, tabargs); + break; + + case 108 : test_cut6 (nbargs, tabargs); + break; + + default : ; + } +} +// ======================================================== test_monica +int test_monica (int nbargs, cpchar tabargs[]) +{ + case_name = "monica"; + + Hex::Document* doc = get_document (); + Hex::Vertex* orig = doc->addVertex (0, 0, 0); + Hex::Vertex* orig2 = doc->addVertex (1.5, 1.5, -1); + + Hex::Vector* vx = doc->addVector (1, 0, 0); + Hex::Vector* vy = doc->addVector (0, 1, 0); + Hex::Vector* vz = doc->addVector (0, 0, 1); + Hex::Vector* vxy = doc->addVector (1, 1, 0); + + Hex::Elements* plaque = doc->makeCartesianUni (orig, vx,vy,vz, 1,1,1, 3,3,1); + save_file (); + + Hex::Hexa* trou = plaque->getHexaIJK (1, 1, 0); + vector tabv0, tabv1; + for (int nv=0 ; nv<8 ; nv++) + tabv1.push_back (trou->getVertex(nv)); + + doc->dump (); + doc->removeHexa (trou); + Hex::what (); + save_file (); + + Hex::Elements* pipe = doc->makePipeUni (orig2, vxy, vz, 0.15, 0.5, 360, 3, + 1, 4, 3); + doc->dump (); + Hex::what (); + for (int nv=0 ; nv<8 ; nv++) + tabv0.push_back (nearest (pipe, tabv1[nv])); + + doc->setLevel (1); + for (int nv=0 ; nv<8 ; nv++) + { + int ier = doc->mergeVertices (tabv0[nv], tabv1[nv]); + cout << " nro = " << nv << ", ier = " << ier << endl; + Hex::what (); + save_file (); + } + + doc->dump (); + return HOK; +} +// ======================================================== test_abu +int test_abu (int nbargs, cpchar tabargs[]) +{ + case_name = "abu"; + + Hex::Document* doc = get_document (); + doc->makeCylinderTop (1,3,1); + Hex::what (); + PutData (doc->countVertex()); + save_file (); + save_file (); + doc->save (case_name); + // doc->dump (); + return HOK; +} diff --git a/src/HEXABLOCK/test_quads.cxx b/src/HEXABLOCK/test_quads.cxx new file mode 100644 index 0000000..eb431ba --- /dev/null +++ b/src/HEXABLOCK/test_quads.cxx @@ -0,0 +1,824 @@ + +// C++ : Tests unitaires sur les creations h'hexaedres + +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// 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 "Hex.hxx" + +#include + +#include "HexDocument.hxx" +#include "HexElements.hxx" +#include "HexCrossElements.hxx" + +#include "HexHexa.hxx" +#include "HexQuad.hxx" +#include "HexEdge.hxx" +#include "HexVertex.hxx" + +#include "HexCramer.hxx" + +// ======================================================== test_hexa_quads_5 +int test_hexa_quads_5 (int nbargs, cpchar tabargs[]) +{ + const int size_x = 3; + const int size_y = 3; + const int size_z = 2; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + + int nvtk = 0; + cpchar fic_vtk = "HexaQuad_5"; + doc->saveVtk (fic_vtk, nvtk); + + Hex::Hexa* hexa = grid->getHexaIJK (1,1,1); + + Hex::Quad* qa = hexa->getQuad (Hex::Q_A); + Hex::Quad* qb = hexa->getQuad (Hex::Q_B); + Hex::Quad* qc = hexa->getQuad (Hex::Q_C); + Hex::Quad* qd = hexa->getQuad (Hex::Q_D); + Hex::Quad* qe = hexa->getQuad (Hex::Q_E); + Hex::Quad* qf = hexa->getQuad (Hex::Q_F); + + qb->setScalar (5); + doc->saveVtk (fic_vtk, nvtk); + + qb->remove (); + doc->saveVtk (fic_vtk, nvtk); + + doc->addHexa5Quads (qa, qc, qd, qe, qf); + doc->saveVtk (fic_vtk, nvtk); + + grid->remove (); + HexDisplay (doc->countHexa ()); + HexDisplay (doc->countQuad ()); + HexDisplay (doc->countEdge ()); + HexDisplay (doc->countVertex ()); + + doc->saveVtk (fic_vtk, nvtk); + return HOK; +} +// ====================================================== test_hexa_quads_ab +int test_hexa_quads_ab (int nbargs, cpchar tabargs[]) +{ + const int size_x = 1; + const int size_y = 1; + const int size_z = 3; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + + int nvtk = 0; + cpchar fic_vtk = "HexaQuad_ab"; + doc->saveVtk (fic_vtk, nvtk); + + Hex::Hexa* hexa = grid->getHexaIJK (0, 0, 1); + + Hex::Quad* qa = hexa->getQuad (Hex::Q_A); + Hex::Quad* qb = hexa->getQuad (Hex::Q_B); + Hex::Quad* qc = hexa->getQuad (Hex::Q_C); + Hex::Quad* qd = hexa->getQuad (Hex::Q_D); + Hex::Quad* qe = hexa->getQuad (Hex::Q_E); + Hex::Quad* qf = hexa->getQuad (Hex::Q_F); + + qc->remove (); + qd->remove (); + qe->remove (); + qf->remove (); + doc->saveVtk (fic_vtk, nvtk); + + doc->addHexa2Quads (qa, qb); + doc->saveVtk (fic_vtk, nvtk); + + grid->remove (); + HexDisplay (doc->countHexa ()); + HexDisplay (doc->countQuad ()); + HexDisplay (doc->countEdge ()); + HexDisplay (doc->countVertex ()); + + doc->saveVtk (fic_vtk, nvtk); + return HOK; +} +// ====================================================== test_hexa_quads_ac +int test_hexa_quads_ac (int nbargs, cpchar tabargs[]) +{ + const int size_x = 2; + const int size_y = 1; + const int size_z = 2; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + int nvtk = 0; + cpchar fic_vtk = "HexaQuad_ac"; + doc->saveVtk (fic_vtk, nvtk); + + Hex::Hexa* hexa = grid->getHexaIJK (1,0,1); + + Hex::Quad* qa = hexa->getQuad (Hex::Q_A); + Hex::Quad* qb = hexa->getQuad (Hex::Q_B); + Hex::Quad* qc = hexa->getQuad (Hex::Q_C); + Hex::Quad* qd = hexa->getQuad (Hex::Q_D); + Hex::Quad* qe = hexa->getQuad (Hex::Q_E); + Hex::Quad* qf = hexa->getQuad (Hex::Q_F); + + qb->remove (); + qc->remove (); + qd->remove (); + qf->remove (); + doc->saveVtk (fic_vtk, nvtk); + + doc->addHexa2Quads (qa, qe); + doc->saveVtk (fic_vtk, nvtk); + + grid->remove (); + HexDisplay (doc->countHexa ()); + HexDisplay (doc->countQuad ()); + HexDisplay (doc->countEdge ()); + HexDisplay (doc->countVertex ()); + + HexDisplay (doc->countUsedHexa ()); + HexDisplay (doc->countUsedQuad ()); + HexDisplay (doc->countUsedEdge ()); + HexDisplay (doc->countUsedVertex ()); + + doc->saveVtk (fic_vtk, nvtk); + return HOK; +} +// ====================================================== test_hexa_quads_ace +int test_hexa_quads_ace (int nbargs, cpchar tabargs[]) +{ + const int size_x = 2; + const int size_y = 2; + const int size_z = 2; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + int nvtk = 0; + cpchar fic_vtk = "HexaQuad_ace"; + doc->saveVtk (fic_vtk, nvtk); + + Hex::Hexa* hexa = grid->getHexaIJK (1,0,1); + + Hex::Quad* qa = hexa->getQuad (Hex::Q_A); + Hex::Quad* qb = hexa->getQuad (Hex::Q_B); + Hex::Quad* qc = hexa->getQuad (Hex::Q_C); + Hex::Quad* qd = hexa->getQuad (Hex::Q_D); + Hex::Quad* qe = hexa->getQuad (Hex::Q_E); + Hex::Quad* qf = hexa->getQuad (Hex::Q_F); + + qb->remove (); + qf->remove (); + qc->remove (); + doc->saveVtk (fic_vtk, nvtk); + + doc->addHexa3Quads (qa, qd, qe); + doc->saveVtk (fic_vtk, nvtk); + + grid->remove (); + HexDisplay (doc->countHexa ()); + HexDisplay (doc->countQuad ()); + HexDisplay (doc->countEdge ()); + HexDisplay (doc->countVertex ()); + + HexDisplay (doc->countUsedHexa ()); + HexDisplay (doc->countUsedQuad ()); + HexDisplay (doc->countUsedEdge ()); + HexDisplay (doc->countUsedVertex ()); + + doc->saveVtk (fic_vtk, nvtk); + return HOK; +} +// ====================================================== test_hexa_quads_acd +int test_hexa_quads_acd (int nbargs, cpchar tabargs[]) +{ + const int size_x = 3; + const int size_y = 1; + const int size_z = 2; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + int nvtk = 0; + cpchar fic_vtk = "HexaQuad_acd"; + doc->saveVtk (fic_vtk, nvtk); + + Hex::Hexa* hexa = grid->getHexaIJK (1,0,1); + + Hex::Quad* qa = hexa->getQuad (Hex::Q_A); + Hex::Quad* qb = hexa->getQuad (Hex::Q_B); + Hex::Quad* qc = hexa->getQuad (Hex::Q_C); + Hex::Quad* qd = hexa->getQuad (Hex::Q_D); + Hex::Quad* qe = hexa->getQuad (Hex::Q_E); + Hex::Quad* qf = hexa->getQuad (Hex::Q_F); + + qb->remove (); + qc->remove (); + qd->remove (); + doc->saveVtk (fic_vtk, nvtk); + + doc->addHexa3Quads (qa, qe, qf); + doc->saveVtk (fic_vtk, nvtk); + + grid->remove (); + HexDisplay (doc->countHexa ()); + HexDisplay (doc->countQuad ()); + HexDisplay (doc->countEdge ()); + HexDisplay (doc->countVertex ()); + + HexDisplay (doc->countUsedHexa ()); + HexDisplay (doc->countUsedQuad ()); + HexDisplay (doc->countUsedEdge ()); + HexDisplay (doc->countUsedVertex ()); + + doc->saveVtk (fic_vtk, nvtk); + return HOK; +} +// ====================================================== test_hexa_quads_abcd +int test_hexa_quads_abcd (int nbargs, cpchar tabargs[]) +{ + const int size_x = 3; + const int size_y = 1; + const int size_z = 3; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + int nvtk = 0; + cpchar fic_vtk = "HexaQuad_abcd"; + doc->saveVtk (fic_vtk, nvtk); + + Hex::Hexa* hexa = grid->getHexaIJK (1,0,1); + + Hex::Quad* qa = hexa->getQuad (Hex::Q_A); + Hex::Quad* qb = hexa->getQuad (Hex::Q_B); + Hex::Quad* qc = hexa->getQuad (Hex::Q_C); + Hex::Quad* qd = hexa->getQuad (Hex::Q_D); + Hex::Quad* qe = hexa->getQuad (Hex::Q_E); + Hex::Quad* qf = hexa->getQuad (Hex::Q_F); + + qc->remove (); + qd->remove (); + doc->saveVtk (fic_vtk, nvtk); + + doc->addHexa4Quads (qa, qe, qf, qb); + doc->saveVtk (fic_vtk, nvtk); + + grid->remove (); + HexDisplay (doc->countHexa ()); + HexDisplay (doc->countQuad ()); + HexDisplay (doc->countEdge ()); + HexDisplay (doc->countVertex ()); + + HexDisplay (doc->countUsedHexa ()); + HexDisplay (doc->countUsedQuad ()); + HexDisplay (doc->countUsedEdge ()); + HexDisplay (doc->countUsedVertex ()); + + doc->saveVtk (fic_vtk, nvtk); + return HOK; +} +// ====================================================== test_hexa_quads_abce +int test_hexa_quads_abce (int nbargs, cpchar tabargs[]) +{ + const int size_x = 3; + const int size_y = 2; + const int size_z = 2; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + int nvtk = 0; + cpchar fic_vtk = "HexaQuad_abce"; + doc->saveVtk (fic_vtk, nvtk); + + Hex::Hexa* hexa = grid->getHexaIJK (1,0,1); + + Hex::Quad* qa = hexa->getQuad (Hex::Q_A); + Hex::Quad* qb = hexa->getQuad (Hex::Q_B); + Hex::Quad* qc = hexa->getQuad (Hex::Q_C); + Hex::Quad* qd = hexa->getQuad (Hex::Q_D); + Hex::Quad* qe = hexa->getQuad (Hex::Q_E); + Hex::Quad* qf = hexa->getQuad (Hex::Q_F); + + qc->remove (); + qb->remove (); + doc->saveVtk (fic_vtk, nvtk); + + doc->addHexa4Quads (qa, qe, qf, qd); + doc->saveVtk (fic_vtk, nvtk); + + grid->remove (); + HexDisplay (doc->countHexa ()); + HexDisplay (doc->countQuad ()); + HexDisplay (doc->countEdge ()); + HexDisplay (doc->countVertex ()); + + HexDisplay (doc->countUsedHexa ()); + HexDisplay (doc->countUsedQuad ()); + HexDisplay (doc->countUsedEdge ()); + HexDisplay (doc->countUsedVertex ()); + + doc->saveVtk (fic_vtk, nvtk); + return HOK; +} +// ======================================================== test_cramer +int test_cramer (int nbargs, cpchar tabargs[]) +{ + double matrice [] = { 2, 7, 1, + 0, 3, 0, + 1, 9, 5 }; + double second [] = { 1, 1, 1 }; + + Hex::Real3 solution; + Hex::Cramer systeme(3); + + int ier = systeme.resoudre (matrice, second, solution); + HexDisplay (ier); + cout << endl; + cout << " Second membre = (" << second[Hex::dir_x] << ", " + << second[Hex::dir_y] << ", " << second[Hex::dir_z] << ")" + << endl; + + cout << " Solution = (" << solution[Hex::dir_x] << ", " + << solution[Hex::dir_y] << ", " << solution[Hex::dir_z] << ")" + << endl; + + Hex::Real3 produit; + systeme.multiply (solution, produit); + cout << " Produit = (" << produit[Hex::dir_x] << ", " + << produit[Hex::dir_y] << ", " << produit[Hex::dir_z] << ")" + << endl; + + return HOK; +} +// ====================================================== test_hexa_quads_ac1 +int test_hexa_quads_ac1 (int nbargs, cpchar tabargs[]) +{ + int nbtraces = 0; + cout << "test_hexa_quads_ac1, trace nro " << ++nbtraces <addVertex (0,0,0); + Hex::Vertex* acf = doc->addVertex (1,0,0); + + /**************************************** + Hex::Vertex* ade = doc->addVertex (0,1,0); + Hex::Vertex* adf = doc->addVertex (1,1,0); + + Hex::Vertex* bce = doc->addVertex (0,0,1); + Hex::Vertex* bcf = doc->addVertex (1,0,1); + Hex::Vertex* bde = doc->addVertex (0,1,1); + Hex::Vertex* bdf = doc->addVertex (1,1,1); + *****************************************/ + + Hex::Vertex* ade = doc->addVertex (-2,2,0); + Hex::Vertex* adf = doc->addVertex ( 2,1,0); + Hex::Vertex* bce = doc->addVertex ( 1,0,1); + Hex::Vertex* bcf = doc->addVertex ( 2,0,1); + + Hex::Edge* ac = doc->addEdge (ace, acf); + Hex::Edge* af = doc->addEdge (adf, acf); + Hex::Edge* ad = doc->addEdge (ade, adf); + Hex::Edge* ae = doc->addEdge (ace, ade); + + Hex::Edge* bc = doc->addEdge (bce, bcf); + // Hex::Edge* bf = doc->addEdge (bdf, bcf); + // Hex::Edge* bd = doc->addEdge (bde, bdf); + // Hex::Edge* be = doc->addEdge (bce, bde); + + Hex::Edge* ce = doc->addEdge (ace, bce); + Hex::Edge* cf = doc->addEdge (acf, bcf); + // Hex::Edge* de = doc->addEdge (ade, bde); + // Hex::Edge* df = doc->addEdge (adf, bdf); + + Hex::Quad* qa = doc->addQuad (ac, af, ad, ae); + Hex::Quad* qc = doc->addQuad (ac, cf, bc, ce); + + /* Hex::Hexa* hexa = */ doc->addHexa2Quads (qa, qc); + + // doc->dump(); + doc->saveVtk ("hexa_quads.vtk"); + return HOK; +} +// ======================================================== test_part_rind +int test_part_rind (int& nvtk) +{ + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* center = doc->addVertex (0,0,0); + Hex::Real radius = 8; + Hex::Real radint = 7; + Hex::Vertex* orig = NULL; + Hex::Vector* vz = doc->addVector (0,0,1); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Real angle = 90; + Hex::Real radhole = 1; + int nrad = 3; + int nang = 4; + int nhaut = 8; + + Hex::Elements* grid = doc->makePartRind (center, vx, vz, radius, radint, + radhole, orig, angle, nrad, nang, nhaut); + if (grid!=NULL) + doc->saveVtk ("makeSphere", nvtk); + return HOK; +} +// ======================================================== test_rind +int test_rind (int& nvtk) +{ + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* center = doc->addVertex (0,0,0); + Hex::Real radius = 8; + Hex::Real radint = 7; + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vz = doc->addVector (0,1,1); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Real radhole = 1; + int nrad = 3; + int nang = 16; + int nhaut = 8; + + Hex::Elements* grid = doc->makeRind (center, vx, vz, radius, radint, + radhole, orig, nrad, nang, nhaut); + if (grid!=NULL) + doc->saveVtk ("makeSphere", nvtk); + return HOK; +} +// ======================================================== test_part_sphere +int test_part_sphere (int& nvtk) +{ + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* center = doc->addVertex (0,0,0); + Hex::Real radius = 8; + Hex::Vertex* orig = doc->addVertex (0,0,-4); + Hex::Vector* vz = doc->addVector (0,0,1); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Real angle = 90; + Hex::Real radhole = 1; + int nrad = 3; + int nang = 4; + int nhaut = 8; + + Hex::Elements* grid = doc->makePartSphere (center, vx, vz, radius, + radhole, orig, angle, nrad, nang, nhaut); + if (grid!=NULL) + doc->saveVtk ("makeSphere", nvtk); + return HOK; +} +// ======================================================== test_sphere +int test_sphere (int& nvtk) +{ + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* center = doc->addVertex (0,0,0); + Hex::Real radius = 8; + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vz = doc->addVector (0,0,1); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Real radhole = 1; + int nrad = 3; + int nang = 16; + int nhaut = 8; + + Hex::Elements* grid = doc->makeSphere (center, vx, vz, radius, + radhole, orig, nrad, nang, nhaut); + if (grid!=NULL) + doc->saveVtk ("makeSphere", nvtk); + return HOK; +} +// ================================================== test_asso_grid +int test_asso_grid (int nbargs, cpchar tabargs[]) +{ + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig1 = doc->addVertex ( 0, 0,0); + + Hex::Vector* vz = doc->addVector (0,0,1); + Hex::Vector* vx = doc->addVector (1,0,0); + + double dr = 1; + double dl = 1; + int nr = 2; + int nl = 3; + int na = 8; + + Hex::Elements *c1 = NULL; + + c1 = doc->makeCylindrical (orig1, vx,vz,dr, 300, dl, nr, na, nl, false); + for (int ned=0 ; nedgetEdgeJ (nr, ned, 1); + if (edge != NULL) + edge->setScalar (5); + else + printf (" ... c1->getEdgeJ (nr, %d, 1) = NULL\n", ned); + } + + doc->saveVtk ("asso_grid.vtk"); + + return HOK; +} +// ======================================================== test_piquage +int test_piquage (int nbargs, cpchar tabargs[]) +{ + const int size_x = 3; + const int size_y = 3; + const int size_z = 3; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + + double dr = 1; + double dl = 1; + + int nr = 1; + int na = 4; + int nl = 1; + + Hex::Vertex* orig2 = doc->addVertex (0,0,5); + Hex::Elements* grid2 = doc->makeCylindrical (orig2, vx,vz, + dr, 360, dl, nr, na, nl, false); + + Hex::Vertex* c1 = grid->getVertexIJK (1, 2, size_z); + Hex::Vertex* c2 = grid->getVertexIJK (1, 1, size_z); + Hex::Vertex* c3 = grid->getVertexIJK (2, 1, size_z); + + Hex::Vertex* p1 = grid2->getVertexIJK (1, 0, 1); + Hex::Vertex* p2 = grid2->getVertexIJK (1, 1, 1); + Hex::Vertex* p3 = grid2->getVertexIJK (1, 2, 1); + + c1->setScalar (4); + c2->setScalar (6); + c3->setScalar (6); + + p1->setScalar (4); + p2->setScalar (6); + p3->setScalar (6); + + int nvtk=0; + doc->saveVtk ("piquage", nvtk); + + Hex::Quads qpattern; + for (int ny=0; ny<4 ; ny++) + { + Hex::Quad* quad = grid2->getQuadIJ (0, ny, 1); + quad->setScalar(5); + qpattern.push_back (quad); + } + + doc->saveVtk ("piquage", nvtk); + doc->replace (qpattern, p1,c1, p2,c2, p3,c3); + + doc->saveVtk ("piquage", nvtk); + + return HOK; +} +// ======================================================== test_replace +int test_replace (int nbargs, cpchar tabargs[]) +{ + const int size_x = 3; + const int size_y = 3; + const int size_z = 3; + + Hex::Hex mon_ex; + Hex::Document* doc = mon_ex.addDocument (); + + Hex::Vertex* orig = doc->addVertex (0,0,0); + Hex::Vector* vx = doc->addVector (1,0,0); + Hex::Vector* vy = doc->addVector (0,1,0); + Hex::Vector* vz = doc->addVector (0,0,1); + + Hex::Elements* grid = doc->makeCartesian (orig, vx, vy, vz, + size_x,size_y,size_z); + + Hex::Vertex* c1 = grid->getVertexIJK (1, 2, size_z); + Hex::Vertex* c2 = grid->getVertexIJK (1, 1, size_z); + Hex::Vertex* c3 = grid->getVertexIJK (2, 1, size_z); + + Hex::Vertex* pa1 = doc->addVertex (-1, -1); + Hex::Vertex* pb1 = doc->addVertex ( 1, -1); + Hex::Vertex* pc1 = doc->addVertex ( 1, 1); + Hex::Vertex* pd1 = doc->addVertex (-1, 1); + + Hex::Vertex* pa2 = doc->addVertex (-2, -2); + Hex::Vertex* pb2 = doc->addVertex ( 2, -2); + Hex::Vertex* pc2 = doc->addVertex ( 2, 2); + Hex::Vertex* pd2 = doc->addVertex (-2, 2); + + Hex::Edge* edab1 = doc->addEdge (pa1, pb1); + Hex::Edge* edbc1 = doc->addEdge (pb1, pc1); + Hex::Edge* edcd1 = doc->addEdge (pc1, pd1); + Hex::Edge* edda1 = doc->addEdge (pd1, pa1); + + Hex::Edge* edab2 = doc->addEdge (pa2, pb2); + Hex::Edge* edbc2 = doc->addEdge (pb2, pc2); + Hex::Edge* edcd2 = doc->addEdge (pc2, pd2); + Hex::Edge* edda2 = doc->addEdge (pd2, pa2); + + Hex::Edge* edaa = doc->addEdge (pa1, pa2); + Hex::Edge* edbb = doc->addEdge (pb1, pb2); + Hex::Edge* edcc = doc->addEdge (pc1, pc2); + Hex::Edge* eddd = doc->addEdge (pd1, pd2); + + Hex::Quads qpattern; + // qpattern.push_back (doc->addQuad (edab1, edbc1, edcd1, edda1)); + qpattern.push_back (doc->addQuad (edab1, edbb, edab2, edaa)); + qpattern.push_back (doc->addQuad (edbc1, edcc, edbc2, edbb)); + qpattern.push_back (doc->addQuad (edcd1, eddd, edcd2, edcc)); + qpattern.push_back (doc->addQuad (edda1, edaa, edda2, eddd)); + + doc->saveVtk ("replace0.vtk"); + + doc->replace (qpattern, pd2,c1, pa2,c2, pb2,c3); + + c1->setScalar (4); + c2->setScalar (6); + c3->setScalar (6); + doc->saveVtk ("replace1.vtk"); + + return HOK; +} +// ======================================================== test_hemispheres +int test_hemispheres (int nbargs, cpchar tabargs[]) +{ + int nvtk = 0; + test_sphere (nvtk); + test_rind (nvtk); + test_part_rind (nvtk); + test_part_sphere (nvtk); + return HOK; +} +// ======================================================== test_quads +int test_quads (int nbargs, cpchar tabargs[]) +{ + cpchar option = "?"; + cpchar appel = strrchr (tabargs[0], '/'); + if (appel != NULL) + appel += 1; + else + { + appel = strrchr (tabargs[0], '\\'); + if (appel!=NULL) + appel += 1; + else + appel = tabargs[0]; + } + + if (nbargs>1) + option = tabargs[1]; + + if (Cestegal (option, "-ab") || Cestegal (option, "-AB")) + { + printf (" __________________ Appel de test_hexa_quads_ab \n"); + test_hexa_quads_ab (nbargs, tabargs); + } + + else if (Cestegal (option, "-ac1") || Cestegal (option, "-AC1")) + { + printf (" __________________ Appel de test_hexa_quads_ac1 \n"); + test_hexa_quads_ac1 (nbargs, tabargs); + } + else if (Cestegal (option, "-ac") || Cestegal (option, "-AC")) + { + printf (" __________________ Appel de test_hexa_quads_ac \n"); + test_hexa_quads_ac (nbargs, tabargs); + } + + else if (Cestegal (option, "-ace") || Cestegal (option, "-ACE")) + { + printf (" __________________ Appel de test_hexa_quads_ace \n"); + test_hexa_quads_ace (nbargs, tabargs); + } + + else if (Cestegal (option, "-acd") || Cestegal (option, "-ACD")) + { + printf (" __________________ Appel de test_hexa_quads_acd \n"); + test_hexa_quads_acd (nbargs, tabargs); + } + + else if (Cestegal (option, "-abcd") || Cestegal (option, "-ABCD")) + { + printf (" __________________ Appel de test_hexa_quads_abcd \n"); + test_hexa_quads_abcd (nbargs, tabargs); + } + + else if (Cestegal (option, "-abce") || Cestegal (option, "-ABCE")) + { + printf (" __________________ Appel de test_hexa_quads_abce \n"); + test_hexa_quads_abce (nbargs, tabargs); + } + + else if (Cestegal (option, "-5") || Cestegal (option, "-abcde") + || Cestegal (option, "-ABCDE")) + { + printf (" __________________ Appel de test_hexa_quads_abcde \n"); + test_hexa_quads_5 (nbargs, tabargs); + } + + else + { + printf (" +++ Veuillez indiquer votre cas-test en argument SVP\n"); + printf (" +++ Creation d'un hexadedre a partir de quadrangles :\n"); + printf (" %s -ab : A partir des quadrangles A et B (opposes)\n", appel); + printf (" %s -ac : A partir des quadrangles A et C (diedre)\n", appel); + printf (" %s -acd : A partir des quadrangles A, C et D (triedre)\n", + appel); + printf (" %s -ace : A partir des quadrangles A, C et E (en U)\n", + appel); + printf (" %s -acbd : A partir des quadrangles A, B, C et D (tunnel)\n", + appel); + printf (" %s -acbe : A partir des quadrangles A, B, C et E (but)\n", + appel); + printf (" %s -5 : A partir de 5 quadrangles (boite sans couvercle)\n", + appel); + } + + return HOK; +} diff --git a/src/HEXABLOCK/test_tools.cxx b/src/HEXABLOCK/test_tools.cxx index bfb2782..a1697c9 100755 --- a/src/HEXABLOCK/test_tools.cxx +++ b/src/HEXABLOCK/test_tools.cxx @@ -1,24 +1,24 @@ // C++ : Outils communs aux tests unitaires -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com #include "test_unit.hxx" @@ -30,9 +30,9 @@ #include // pour getpid() #include // pour getpid() -static int nbr_vtk = 0; -static cpchar case_name = "hexa"; -static Hex::Document* docu = NULL; +// static int nbr_vtk = 0; +// static cpchar case_name = "hexa"; +// static Hex::Document* docu = NULL; static string workspace = "/tmp/test_hexablock"; static bool w_default = true; diff --git a/src/HEXABLOCK/test_unit.hxx b/src/HEXABLOCK/test_unit.hxx index 342a823..33f4a0b 100644 --- a/src/HEXABLOCK/test_unit.hxx +++ b/src/HEXABLOCK/test_unit.hxx @@ -1,21 +1,22 @@ -// Copyright (C) 2009-2013 CEA/DEN, EDF R&D +// Copyright (C) 2009-2011 CEA/DEN, EDF R&D // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ +// or email : webmaster.salome@opencascade.com // #ifndef _TEST_UNIT_H_ diff --git a/src/HEXABLOCK/umake b/src/HEXABLOCK/umake index 2dfb930..0273ecb 100755 --- a/src/HEXABLOCK/umake +++ b/src/HEXABLOCK/umake @@ -1,39 +1,60 @@ #!/bin/sh -# Copyright (C) 2009-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 -# - # Comm : Makefile associe aux tests unitaires commande=$0 liste_args="$*" +# =============================================== al_aide +al_aide() +{ +comm=`basename $appel` + +cat << ENDOF_BLABLA + + ---- Recompilation locale de HexaBlock + Syntaxe : + $ $comm + + Options de $comm : + -h : Rappel des options + -make : Regenerer le Makefile + -lib : Regenerer la librairie partagee au moyen de swig + -clean : Detruire codes objets, executables et fichiers generes + -trace : Detail des sous-commandes + -setx : Observer le deroulement de la procedure + -jN : Compiler sur N process + test_* : Linker le test unitaire test_X.exe + + Par defaut 1) le programme test_hexa.exe est genere + 2) la librairie _hexablock_swig.so (ou *.dll) est generee + +ENDOF_BLABLA +exit +} # =============================================== Begin test_u= opt= +make_lib= for arg in $* do case $arg in -setx ) set -x ;; + -h ) al_aide + ;; + -lib ) make_lib=OK + ;; + -make ) + chmod +x *make* + ./make.make + exit + ;; -clean ) rm -rf *.exe *.a *.o *.bak *.brep *~ *.vtk *.cpp *.xml *.exe.stackdump + rm -rf work/*.exe work/*.brep work/*~ work/*.vtk work/*.cpp work/*.xml + rm -rf work/*.exe.stackdump + rm -rf *.so *.dll exit ;; -j ) opt="$opt -j4" @@ -58,10 +79,38 @@ for arg in $* if ( [ -z "$test_u" ] ) then test_u=test_hexa + make_lib=OK fi if ( [ ! -f makefile.ozz ] ) then ./make.make fi +uf=`pwd` +uf=`basename "$uf"` +os=`uname` + +if ( [ $os = Linux ] ) then + opt_cpp=-fPIC + lib_ext=so +else ## CYGWIN + opt_cpp= + lib_ext=dll + fi + +echo " -- Maj $uf.a et $test_u.exe" make -f makefile.ozz $opt main=$test_u +ier=$? + + ###### Verrue Saclay +vpy= +mach=`hostname` +mach=`echo $mach | cut -c1-2` +if ( [ $mach = is ] ) then + vpy='pyvers=2.5' + fi + + +if ( [ $ier = 0 -a -n "$make_lib" ] ) then + make -f makefile.swig $vpy lib_ext=$lib_ext opt_cpp=$opt_cpp uf=$uf + fi diff --git a/src/HEXABLOCK/work/env_python b/src/HEXABLOCK/work/env_python new file mode 100644 index 0000000..a0ec8c9 --- /dev/null +++ b/src/HEXABLOCK/work/env_python @@ -0,0 +1,4 @@ + +export PYTHONPATH=.. +PS1="hexa) " + diff --git a/src/HEXABLOCK/work/geompy.py b/src/HEXABLOCK/work/geompy.py new file mode 100644 index 0000000..cead4b7 --- /dev/null +++ b/src/HEXABLOCK/work/geompy.py @@ -0,0 +1,2 @@ +def coucou () : + print "Coucou, coucou, coucou !" diff --git a/src/HEXABLOCK/work/hexablock.py b/src/HEXABLOCK/work/hexablock.py new file mode 100644 index 0000000..ff151b1 --- /dev/null +++ b/src/HEXABLOCK/work/hexablock.py @@ -0,0 +1,51 @@ +# -*- coding: latin-1 -*- +# HexaBlock : Module principal + +import hexablock_swig + +hexa = hexablock_swig.hex_instance () + +# ======================================================== what +def what () : + hexa.what () + +# ======================================================== countDocument +def countDocument () : + return hexa.countDocument () + +# ======================================================== getDocument +def getDocument (nro) : + return hexa.getDocument (nro) + +# ======================================================== removeDocument +def removeDocument (doc) : + return hexa.removeDocument (doc) + +# ======================================================== addDocument +def addDocument (nomdoc) : + return hexa.addDocument (nomdoc) + +# ======================================================== loadDocument +def loadDocument (filename) : + return hexa.loadDocument (filename) + +# ======================================================== findDocument +def findDocument (name) : + return hexa.findDocument (name) + +# ======================================================== mesh +def mesh (doc, name=None, dim=3, container="FactoryServer"): + return 0 + +# ======================================================== mesh +def mesh (doc, name=None, dim=3, container="FactoryServer"): + return 0 + +# ======================================================== mesh +def mesh (doc, name=None, dim=3, container="FactoryServer"): + return 0 + +# ======================================================== dump +def dump (doc, mesh=None, full=False) : + return [ 36, 15, 36, 17] + diff --git a/src/HEXABLOCK/work/umake b/src/HEXABLOCK/work/umake new file mode 100755 index 0000000..f59d55f --- /dev/null +++ b/src/HEXABLOCK/work/umake @@ -0,0 +1,6 @@ +#!/bin/sh +# Comm : Makefile associe aux tests unitaires + +cd .. +./umake $* + diff --git a/src/HEXABLOCKGUI/CutEdge_QTD.ui b/src/HEXABLOCKGUI/CutEdge_QTD.ui index 50569c5..03cd5be 100644 --- a/src/HEXABLOCKGUI/CutEdge_QTD.ui +++ b/src/HEXABLOCKGUI/CutEdge_QTD.ui @@ -6,12 +6,12 @@ 0 0 - 191 - 114 + 289 + 326 - + 0 0 @@ -19,19 +19,42 @@ Cut Edge Operation - + - + + + + + + + + + Uniform + + + true + + + + + + + Custom + + + + + + + + 0 0 - - Arguments - - + @@ -58,7 +81,13 @@ - + + + + + + + @@ -67,11 +96,11 @@ - nb + Nb layers - + @@ -93,6 +122,91 @@ + + + + + 0 + 0 + + + + 0 + + + + height + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -100,5 +214,70 @@ nb_cut_spb - + + + cutUni_rb + clicked() + layers_height_lw + hide() + + + 73 + 44 + + + 119 + 303 + + + + + cutUni_rb + clicked() + widget_2 + show() + + + 73 + 44 + + + 119 + 146 + + + + + cut_rb + clicked() + layers_height_lw + show() + + + 173 + 44 + + + 119 + 303 + + + + + cut_rb + clicked() + widget_2 + hide() + + + 173 + 44 + + + 119 + 146 + + + + diff --git a/src/HEXABLOCKGUI/Disconnect_QTD.ui b/src/HEXABLOCKGUI/Disconnect_QTD.ui index b5f82fe..0a58bd0 100644 --- a/src/HEXABLOCKGUI/Disconnect_QTD.ui +++ b/src/HEXABLOCKGUI/Disconnect_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 229 - 269 + 338 + 598 @@ -29,9 +29,9 @@ 0 - -318 - 234 - 556 + 0 + 318 + 578 @@ -59,7 +59,7 @@ - Disconnect + @@ -126,7 +126,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/EdgeAssoc_QTD.ui b/src/HEXABLOCKGUI/EdgeAssoc_QTD.ui index ad1d19c..0208df7 100644 --- a/src/HEXABLOCKGUI/EdgeAssoc_QTD.ui +++ b/src/HEXABLOCKGUI/EdgeAssoc_QTD.ui @@ -48,8 +48,8 @@ 0 0 - 223 - 618 + 222 + 654 @@ -68,7 +68,7 @@ - Mode + @@ -103,7 +103,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/Edge_QTD.ui b/src/HEXABLOCKGUI/Edge_QTD.ui index 7615441..4ad095f 100644 --- a/src/HEXABLOCKGUI/Edge_QTD.ui +++ b/src/HEXABLOCKGUI/Edge_QTD.ui @@ -9,8 +9,8 @@ 0 0 - 241 - 322 + 244 + 323 @@ -41,7 +41,7 @@ - Edge + By @@ -88,7 +88,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/Group_QTD.ui b/src/HEXABLOCKGUI/Group_QTD.ui index 868bdc7..d581574 100644 --- a/src/HEXABLOCKGUI/Group_QTD.ui +++ b/src/HEXABLOCKGUI/Group_QTD.ui @@ -35,7 +35,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx index 7bab2d8..d7eb83a 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.cxx @@ -19,20 +19,13 @@ //#define _DEVDEBUG_ -// #include - #include -// #include "klinkitemselectionmodel.h" - - #include #include #include - - #include #include #include @@ -44,7 +37,6 @@ #include #include -// #include #include #include #include @@ -60,9 +52,9 @@ #include #include #include - -#include - +#include +#include +#include // SALOME KERNEL includes #include @@ -89,20 +81,14 @@ #include -#include - #include - #include "Resource.hxx" -// #include "QtGuiContext.hxx" #include "HEXABLOCKGUI.hxx" #include "HEXABLOCKGUI_Export.hxx" #include "HEXABLOCKGUI_Trace.hxx" #include "HEXABLOCKGUI_Resource.hxx" -#include "GEOMBase.h" -// #include "HEXABLOCKGUI_DataModel.hxx" #include "HEXABLOCKGUI_DocumentModel.hxx" #include "HEXABLOCKGUI_DocumentSelectionModel.hxx" @@ -116,13 +102,28 @@ #include "MyBasicGUI_PointDlg.hxx" -// #include CORBA_CLIENT_HEADER(HEXABLOCKPlugin_Algorithm) - -#include "HEXABLOCK.hxx" -#include "HexDocument_impl.hxx" +// #include "HEXABLOCK.hxx" del Hexa6 +// #include "HexDocument_impl.hxx" del Hexa6 #include "Hex.hxx" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + + #define DW_MINIMUM_WIDTH 50 #define DWINPUT_MINIMUM_HEIGHT 50 #define DWINPUT_MINIMUM_WIDTH 50//255 @@ -131,26 +132,17 @@ using namespace std; using namespace HEXABLOCK::GUI; int HEXABLOCKGUI::_oldStudyId = -1; -//bool jepeux = false; - -HEXABLOCK_ORB::HEXABLOCK_Gen_var HEXABLOCKGUI::_hexaEngine = HEXABLOCK_ORB::HEXABLOCK_Gen::_nil(); -// SMESH::SMESH_Gen_var HEXABLOCKGUI::_smeshEngine = SMESH::SMESH_Gen::_nil(); - GEOM::GEOM_Gen_var HEXABLOCKGUI::_geomEngine = GEOM::GEOM_Gen::_nil(); - -// std::map HEXABLOCKGUI::svtkViews; -// std::map HEXABLOCKGUI::svtkViews; -// std::map HEXABLOCKGUI::salomeViews; -// HEXABLOCK::GUI::DocumentModel *HEXABLOCKGUI::getCurrentModel() = NULL; +// HEXABLOCK_ORB::HEXABLOCK_Gen_var HEXABLOCKGUI::_hexaEngine = HEXABLOCK_ORB::HEXABLOCK_Gen::_nil(); +// VtkDocumentGraphicView* HEXABLOCKGUI::currentDocGView = NULL; OccGraphicView* HEXABLOCKGUI::currentOccGView = NULL; -MyGEOMBase_Helper* HEXABLOCKGUI::geomBaseHelper = NULL; bool HEXABLOCKGUI::assocInProgress = false; SalomeApp_Application* HEXABLOCKGUI::myApplication = NULL; -GEOMGUI_OCCSelector* HEXABLOCKGUI::currentOccSelector = NULL; HEXABLOCKGUI::HEXABLOCKGUI() : - SalomeApp_Module( "HEXABLOCK" ), // default name + SalomeApp_Module( "HEXABLOCK" ), + LightApp_Module( "HEXABLOCK" ), _menuId(190), _dwPattern(0), _dwAssociation(0), @@ -161,7 +153,6 @@ HEXABLOCKGUI::HEXABLOCKGUI() : _patternDataTreeView(0), _patternBuilderTreeView(0), _patternGeomTreeView(0), - _associationTreeView(0), _groupsTreeView(0), _meshTreeView(0), _treeViewDelegate(0), @@ -204,16 +195,15 @@ HEXABLOCKGUI::HEXABLOCKGUI() : currentDialog(NULL) { DEBTRACE("HEXABLOCKGUI::HEXABLOCKGUI"); - // _studyContextMap.clear(); + graphicViewsHandler = new GraphicViewsHandler(); loadDocLastPath = new QDir(); saveDocLastPath = new QDir(); + hexa_root = HEXA_NS::Hex::getInstance (); } HEXABLOCKGUI::~HEXABLOCKGUI() { - // if ( getApp() ) - // disconnect( getApp(), SIGNAL(studyClosed()), _genericGui, SLOT (onCleanOnExit())); } @@ -228,6 +218,7 @@ SalomeApp_Study* HEXABLOCKGUI::activeStudy() // Gets an reference to the module's engine +/**************************************************** HEXABLOCK_ORB::HEXABLOCK_Gen_ptr HEXABLOCKGUI::InitHEXABLOCKGen( SalomeApp_Application* app ) { Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( "FactoryServer", "HEXABLOCK" ); @@ -235,35 +226,14 @@ HEXABLOCK_ORB::HEXABLOCK_Gen_ptr HEXABLOCKGUI::InitHEXABLOCKGen( SalomeApp_Appli ASSERT(!CORBA::is_nil(clr)); return clr; } - -// // Gets an reference to SMESH's engine CS_TO_DELETE -// SMESH::SMESH_Gen_ptr HEXABLOCKGUI::InitSMESHGen( SalomeApp_Application* app, -// const std::string& container ) -// { -// Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( container.c_str(), "SMESH" ); -// SMESH::SMESH_Gen_ptr clr = SMESH::SMESH_Gen::_narrow(comp); -// ASSERT(!CORBA::is_nil(clr)); -// return clr; -// } -// -// // Gets an reference to GEOM's engine CS_TO_DELETE -GEOM::GEOM_Gen_ptr HEXABLOCKGUI::InitGEOMGen( SalomeApp_Application* app, - const std::string& container ) -{ - Engines::EngineComponent_var comp = app->lcc()->FindOrLoad_Component( container.c_str(), "GEOM" ); - GEOM::GEOM_Gen_ptr clr = GEOM::GEOM_Gen::_narrow(comp); - ASSERT(!CORBA::is_nil(clr)); - return clr; -} - + **************************************************** */ void HEXABLOCKGUI::initialize( CAM_Application* app ) { DEBTRACE("HEXABLOCKGUI::initialize"); SalomeApp_Module::initialize( app ); - _hexaEngine = InitHEXABLOCKGen( dynamic_cast( app ) ); - _geomEngine = InitGEOMGen( dynamic_cast( app ) ); + // _hexaEngine = InitHEXABLOCKGen( dynamic_cast( app ) ); DEBTRACE(app << " " << application() << " " << application()->desktop() << " " << aParent); @@ -275,19 +245,11 @@ void HEXABLOCKGUI::initialize( CAM_Application* app ) createMenus(); createTools(); studyActivated(); - // add component to study -// if (createSComponent()) updateObjBrowser() -// createSComponent(); - - if (_dwInputPanel != NULL) - geomBaseHelper = new MyGEOMBase_Helper(dynamic_cast(_dwInputPanel->parent())); } void HEXABLOCKGUI::viewManagers( QStringList& list ) const { DEBTRACE("HEXABLOCKGUI::viewManagers"); - // foreach (const QString &str, list) - // MESSAGE("HEXABLOCKGUI::viewManagers"<getViewWindow()->installEventFilter(this); } - //Init VTK if (currentDocGView == NULL) newDocument(); @@ -318,7 +278,6 @@ void HEXABLOCKGUI::restoreGraphicViews() currentDocGView->setViewWindow(graphicViewsHandler->createVtkWindow()); currentDocGView->getViewWindow()->installEventFilter(this); } - } @@ -339,16 +298,12 @@ bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy ) bool bOk = SalomeApp_Module::activateModule( theStudy ); if ( !bOk ) return false; - // setMenuShown( true ); - // setToolShown( true ); - // showDockWidgets(false); showDockWidgets(true); connect( getApp()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ), this, SLOT(onWindowActivated( SUIT_ViewWindow* )), Qt::UniqueConnection ); connect( getApp()->objectBrowser()->treeView(),SIGNAL( clicked(const QModelIndex&) ), this, SLOT( onObjectBrowserClick(const QModelIndex&) ), Qt::UniqueConnection ); - // connect( getApp(), SIGNAL(studyClosed()), _genericGui,SLOT (onCleanOnExit())); LightApp_SelectionMgr* sm = getApp()->selectionMgr(); @@ -358,7 +313,7 @@ bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy ) application()->viewManagers( OCCViewer_Viewer::Type(), OCCViewManagers ); QListIterator itOCC( OCCViewManagers ); while ( itOCC.hasNext() && (vm = itOCC.next()) ) - myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) ); + myOCCSelectors.append( new HEXABLOCKGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) ); application()->viewManagers( SVTK_Viewer::Type(), VTKViewManagers ); QListIterator itVTK( VTKViewManagers ); @@ -372,9 +327,9 @@ bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy ) // disable OCC selectors getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() ); - QListIterator itOCCSel( myOCCSelectors ); + QListIterator itOCCSel( myOCCSelectors ); while ( itOCCSel.hasNext() ) - if ( GEOMGUI_OCCSelector* sr = itOCCSel.next() ) + if ( HEXABLOCKGUI_OCCSelector* sr = itOCCSel.next() ) sr->setEnabled(true); // disable VTK selectors @@ -402,18 +357,18 @@ bool HEXABLOCKGUI::activateModule( SUIT_Study* theStudy ) this, SLOT( onWindowClosed(SUIT_ViewWindow *) ), Qt::UniqueConnection ); } + /* ************************************ TODO Hexa6 _hexaEngine->SetCurrentStudy(SALOMEDS::Study::_nil()); if ( SalomeApp_Study* s = dynamic_cast( theStudy )) if ( _PTR(Study) aStudy = s->studyDS()) { - //define _CAST(Class, shared_ptr_Obj) dynamic_cast(shared_ptr_Obj.get()) _hexaEngine->SetCurrentStudy( _CAST(Study,aStudy)->GetStudy() ); updateObjBrowser(); // objects can be removed } + ************************************ */ if (currentOccGView != NULL && currentOccGView->getViewWindow() != NULL) currentOccGView->getViewWindow()->installEventFilter(this); - if (currentDocGView != NULL) { switchModel(currentDocGView); @@ -435,21 +390,17 @@ bool HEXABLOCKGUI::deactivateModule( SUIT_Study* theStudy ) this, SLOT(onWindowActivated( SUIT_ViewWindow* )) ); disconnect( getApp()->objectBrowser()->treeView(),SIGNAL( clicked(const QModelIndex&) ), this, SLOT( onObjectBrowserClick(const QModelIndex&) ) ); - // connect( getApp(), SIGNAL(studyClosed()), _genericGui,SLOT (onCleanOnExit())); - if ( currentDocGView != NULL && currentDocGView->getViewWindow() != NULL ) //default selectionMode in VTKView currentDocGView->getViewWindow()->SetSelectionMode( ActorSelection ); - if (currentOccGView != NULL && currentOccGView->getViewWindow() != NULL) + if (currentOccGView != NULL) { //defaut selectionMode in OccView - getApp()->selectionMgr()->clearSelected(); - geomBaseHelper->globalSelection(currentOccGView->getViewWindow()); -// geomBaseHelper->localSelection(GEOM::GEOM_Object::_nil(), TopAbs_SHAPE); - if (currentOccGView != NULL) - geomBaseHelper->localSelection(currentOccGView->getViewWindow(), TopAbs_SHAPE); + selectionMgr()->clearSelected(); + currentOccGView->globalSelection(); + currentOccGView->localSelection(TopAbs_SHAPE); } qDeleteAll(myOCCSelectors); @@ -476,42 +427,79 @@ bool HEXABLOCKGUI::deactivateModule( SUIT_Study* theStudy ) setMenuShown( false ); setToolShown( false ); showDockWidgets( false ); - if (_dwInputPanel) _dwInputPanel->close(); + if (_dwInputPanel) + _dwInputPanel->close(); - //hide the current document actor hideActor(); return bOk; } -QString HEXABLOCKGUI::addInStudy(QString& fileName) +SALOMEDS::Study_var HEXABLOCKGUI::ClientStudyToStudy (_PTR(Study) theStudy) { - QString objStudyEntry; - - if ( !fileName.isEmpty() ) { + SALOME_NamingService *aNamingService = SalomeApp_Application::namingService(); + CORBA::Object_var aSMObject = aNamingService->Resolve("/myStudyManager"); + SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow(aSMObject); + int aStudyID = theStudy->StudyId(); + SALOMEDS::Study_var aDSStudy = aStudyManager->GetStudyByID(aStudyID); + return aDSStudy._retn(); +} - SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication()); - SalomeApp_Study* appStudy = app ? dynamic_cast( app->activeStudy() ) : NULL; - if(!appStudy) return objStudyEntry; +void HEXABLOCKGUI::addInStudy(QMap& topo_shapes, + QMap& docShapesEntry, + QMap& docShapesName) +{ + if (topo_shapes.size() == 0 || currentOccGView == NULL || currentDocGView == NULL) + return; //there's nothing to publish in this case - _PTR(Study) aStudy = appStudy->studyDS(); - SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy ); + SalomeApp_Study* appStudy = HEXABLOCKGUI::activeStudy(); + if(!appStudy) return; + _PTR(Study) aStudy = appStudy->studyDS(); + SALOMEDS::Study_var aDSStudy = ClientStudyToStudy( aStudy ); + SALOMEDS::StudyBuilder_var aBuilder (aDSStudy->NewBuilder()); + QString entry = currentDocGView->getDocumentModel()->documentEntry(); + SALOMEDS::SObject_var aFatherSO = aDSStudy->FindObjectID( qPrintable(entry) ); + if (aFatherSO->_is_nil()) + return; - GEOM::GEOM_IInsertOperations_var aInsOp = _geomEngine->GetIInsertOperations( aStudy->StudyId() ); - GEOM::GEOM_Object_var anObj = aInsOp->ImportFile(fileName.toStdString().c_str(), "BREP"); - if ( !anObj->_is_nil() && aInsOp->IsDone() ) - { - QStringList sList = fileName.split("."); - SALOMEDS::SObject_var aSO = _geomEngine->PublishInStudy( aDSStudy, - SALOMEDS::SObject::_nil(), - anObj, - sList[0].toStdString().c_str() ); - objStudyEntry = aSO->GetID(); - } + // * get a presentation + bool isNewPrs = false; + SOCC_Prs* prs = getOccPrs(currentDocGView); + if (prs == NULL) + { + prs = new SOCC_Prs(); + isNewPrs = true; } - return objStudyEntry; + + // * init the presentation with the given shapes + QMap::const_iterator i = topo_shapes.constBegin(); + while (i != topo_shapes.constEnd()) + { + QString shapeName = i.key(); + TopoDS_Shape shapeValue = i.value(); + Handle(AIS_Shape) ais_shape = new AIS_Shape(shapeValue); + SALOMEDS::SObject_var aSO = aBuilder->NewObject(aFatherSO); + QString objStudyEntry = aSO->GetID(); //the entry of the published object + Handle( SALOME_InteractiveObject ) io = new SALOME_InteractiveObject(objStudyEntry.toStdString().c_str(), + "HEXABLOCK", shapeName.toStdString().c_str()); + ais_shape->SetOwner(io); + prs->AddObject(ais_shape); + aSO->SetAttrString("AttributeName", shapeName.toStdString().c_str()); + docShapesEntry[shapeName] = objStudyEntry; + docShapesName[objStudyEntry] = shapeName; + currentOccGView->addShape(objStudyEntry, ais_shape); + i++; //handle next shape + } + // * set the preview + if (isNewPrs) + prs->AddObject(currentOccGView->getPreviewShape()); + + occPrs[currentDocGView] = prs; + getApp()->updateObjectBrowser(); + showOnlyActor(); } + bool HEXABLOCKGUI::renameAllowed( const QString& entry) const { SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); @@ -524,8 +512,13 @@ bool HEXABLOCKGUI::renameAllowed( const QString& entry) const bool HEXABLOCKGUI::renameObject( const QString& entry, const QString& name) { - bool result = false; + + // Pas de renommage des shapes pour le moment, juste les documents + VtkDocumentGraphicView* dgview = getDocGViewByEntry(entry); + if (dgview == NULL || dgview->getDocumentModel() == NULL) + return result; + SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication()); SalomeApp_Study* appStudy = app ? dynamic_cast( app->activeStudy() ) : 0; @@ -542,17 +535,11 @@ bool HEXABLOCKGUI::renameObject( const QString& entry, const QString& name) if ( obj ){ if ( obj->FindAttribute(anAttr, "AttributeName") ){ _PTR(AttributeName) aName (anAttr); - // GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(obj)); - // - // HEXABLOCK_Gen_i::Document_var aDoc = HEXABLOCK_Gen_i::Document::_narrow( theIOR ); - // if (!CORBA::is_nil(aDoc)) { -// aName->SetValue( name.toLatin1().data() ); // rename the SObject - // aDoc->setName( name.toLatin1().data() ); // Rename the corresponding GEOM_Object - DocumentModel* currentModel = getCurrentModel(); - if (currentModel == NULL) return result; - currentModel->setName( name/*.toLatin1().data()*/ ); - aName->SetValue( getCurrentModel()->getName().toLatin1().data() ); - // _currentGraphicView->setWindowTitle( getCurrentModel()->getName() ); + DocumentModel* docModel = dgview->getDocumentModel(); + docModel->setName( name ); + aName->SetValue( name.toLatin1().data() ); + getApp()->updateObjectBrowser(); + _dwPattern->setWindowTitle( name ); result = true; } } @@ -568,24 +555,19 @@ void HEXABLOCKGUI::windows( QMap& theMap ) const theMap.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea ); } - -// QString HEXABLOCKGUI::engineIOR() const -// { -// DEBTRACE("HEXABLOCKGUI::engineIOR"); -// // return getApp()->defaultEngineIOR(); -// } - - QString HEXABLOCKGUI::engineIOR() const { DEBTRACE("HEXABLOCKGUI::engineIOR"); + + /* ************************************ TODO Hexa6 CORBA::ORB_var anORB = getApp()->orb(); CORBA::String_var anIOR = anORB->object_to_string(_hexaEngine); return QString( anIOR.in() ); + ************************************ */ + return ""; } - -VtkDocumentGraphicView* HEXABLOCKGUI::getDocument(SalomeApp_DataObject* studyObject) +VtkDocumentGraphicView* HEXABLOCKGUI::getOrCreateDocument(SalomeApp_DataObject* studyObject) { if (docs.count(studyObject->entry()) == 0) { @@ -597,47 +579,46 @@ VtkDocumentGraphicView* HEXABLOCKGUI::getDocument(SalomeApp_DataObject* studyObj //------------------ Load the document ----------------- HEXA_NS::Document* document = directory->findDocument(studyObject->name().toStdString()); - if (document == NULL) return NULL; //No document found + if (document == NULL) + return NULL; //No document found DocumentModel* docModel = new DocumentModel(document, studyObject->entry(), this ); if (!docModel) { MESSAGE("Doc model creation failed!"); return NULL; } - dgview = graphicViewsHandler->createDocumentGraphicView( - docModel, - NULL/*viewWindow*/, - application()->desktop() ); + dgview = graphicViewsHandler->createDocumentGraphicView( docModel, NULL, application()->desktop() ); if (dgview == NULL) return NULL; //update the data tree -// dgview->loadDocument(); docs[studyObject->entry()] = dgview; } return docs[studyObject->entry()]; } - - void HEXABLOCKGUI::onObjectBrowserClick(const QModelIndex& index) { - DEBTRACE("HEXABLOCKGUI::onObjectBrowserClick"); - // we want to switch automatically to the right view windows -// QWidget *viewWindow = NULL; + // ** we want to switch automatically to the right view windows //first, find selected item QString itemEntry; DataObjectList dol = getApp()->objectBrowser()->getSelected(); if (dol.isEmpty()) return; SalomeApp_DataObject* item = dynamic_cast(dol[0]); - if (!item || item->parent()->name().compare(tr("HEXABLOCK")) != 0) return; - VtkDocumentGraphicView* docGView = getDocument(item); - if (docGView == NULL) - { -// currentDocGView = NULL; + if (!item || item->parent()->name().compare(tr("HEXABLOCK")) != 0 || + item->entry().isEmpty()) + return; + + // find the document corresponding to it + VtkDocumentGraphicView* docGView = NULL; + if (docs.contains(item->entry())) + docGView = docs[item->entry()]; + else + docGView = getOrCreateDocument(item); + + if (docGView == NULL || docGView == currentDocGView) return; - } //Init OCC if necessary if (currentOccGView == NULL) @@ -663,47 +644,24 @@ void HEXABLOCKGUI::onObjectBrowserClick(const QModelIndex& index) else docGView->setViewWindow(currentDocGView->getViewWindow()); - if (docGView->getDocumentActor() == NULL) docGView->update(); + if (docGView->getDocumentActor() == NULL) + docGView->update(); } -// setOpen (const QModelIndex &theObject, const bool theOpen=true) -// updateTree (SUIT_DataObject *=0, const bool=true) //update the current document switchModel(docGView); - } void HEXABLOCKGUI::onWindowActivated( SUIT_ViewWindow* svw) { DEBTRACE("HEXABLOCKGUI::onWindowActivated"); -// OCCViewer_ViewWindow* anOccVw = dynamic_cast(svw); - - //update the current occ view -// if (anOccVw != NULL) -// currentOccGView->getViewWindow() = anOccVw; - - //set event filter for the occ view -// if (currentOccGView != NULL && currentOccGView->getViewWindow() != NULL) -// currentOccGView->getViewWindow()->installEventFilter(this); - - // we want to switch automatically to the right model - // only VTK view -// SVTK_ViewWindow* viewWindow = dynamic_cast(svw); -// if (viewWindow == NULL) return; -// -// if (getApp()->activeModule() && getApp()->activeModule()->moduleName().compare("HEXABLOCK") != 0) //CS_TODO? -// getApp()->activateModule("HEXABLOCK"); - - //update the current model and the current vtk view -// switchModel( viewWindow ); } void HEXABLOCKGUI::onWindowClosed( SUIT_ViewWindow* svw) { DEBTRACE("HEXABLOCKGUI::onWindowClosed"); - //Decharger le model correspondant (VTK) SVTK_ViewWindow* window = dynamic_cast(svw); if (window != NULL) @@ -770,13 +728,12 @@ void HEXABLOCKGUI::onViewManagerAdded( SUIT_ViewManager* vm) if ( vm && vm->getType() == OCCViewer_Viewer::Type() ) { LightApp_SelectionMgr* sm = getApp()->selectionMgr(); - myOCCSelectors.append( new GEOMGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) ); - + myOCCSelectors.append( new HEXABLOCKGUI_OCCSelector( ((OCCViewer_ViewManager*)vm)->getOCCViewer(), sm ) ); // disable OCC selectors getApp()->selectionMgr()->setEnabled( false, OCCViewer_Viewer::Type() ); - QListIterator itOCCSel( myOCCSelectors ); + QListIterator itOCCSel( myOCCSelectors ); while ( itOCCSel.hasNext() ) - if ( GEOMGUI_OCCSelector* sr = itOCCSel.next() ) + if ( HEXABLOCKGUI_OCCSelector* sr = itOCCSel.next() ) sr->setEnabled(true); } else if ( vm->getType() == SVTK_Viewer::Type() ) @@ -834,9 +791,9 @@ void HEXABLOCKGUI::onViewManagerRemoved( SUIT_ViewManager* vm) if ( vm && vm->getType() == OCCViewer_Viewer::Type() ) { //OCC View removed: remove its selector - QListIterator itOCCSel( myOCCSelectors ); + QListIterator itOCCSel( myOCCSelectors ); while ( itOCCSel.hasNext() ) - if ( GEOMGUI_OCCSelector* sr = itOCCSel.next() ) + if ( HEXABLOCKGUI_OCCSelector* sr = itOCCSel.next() ) if ( sr->viewer() == viewer ) { delete myOCCSelectors.takeAt( myOCCSelectors.indexOf( sr ) ); @@ -871,19 +828,6 @@ void HEXABLOCKGUI::onSelectionChanged( const QItemSelection & selected, const QI } } -// void HEXABLOCKGUI::onTryClose(bool &isClosed, QxScene_ViewWindow* window) //CS_TODO -// { -// DEBTRACE("HEXABLOCKGUI::onTryClose"); -// isClosed = _genericGui->closeContext(window); -// } - -// CAM_DataModel* HEXABLOCKGUI::createDataModel() -// { -// DEBTRACE("HEXABLOCKGUI::createDataModel"); -// return new HEXABLOCKGUI_DataModel(this); -// // return NULL; -// } - bool HEXABLOCKGUI::createSComponent() //addComponent { DEBTRACE("HEXABLOCKGUI::createSComponent"); @@ -904,38 +848,15 @@ bool HEXABLOCKGUI::createSComponent() //addComponent anAttr = aBuilder->FindOrCreateAttribute(aComponent, "AttributePixMap"); _PTR(AttributePixMap) aPixmap(anAttr); - // aPixmap->SetPixMap("share/salome/resources/hexablock/ModuleHexablock.png"); aPixmap->SetPixMap(tr("ICO_MODULE_HEXABLOCK_SMALL").toStdString()); aBuilder->DefineComponentInstance(aComponent, engineIOR().toStdString()); DEBTRACE("HEXABLOCKGUI::createSComponent engineIOR=>"<DefineComponentInstance(aComponent, getApp()->defaultEngineIOR().toStdString()); - // DEBTRACE("HEXABLOCKGUI::createSComponent defaultEngineIOR=>"<defaultEngineIOR().toStdString()); - - // SalomeApp_DataModel::synchronize( aComponent, HEXABLOCKGUI::activeStudy() ); return true; } return false; } -// bool HEXABLOCKGUI::isSelectionCompatible() -// { -// DEBTRACE("HEXABLOCKGUI::isSelectionCompatible"); -// -// bool isCompatible = true; -// SALOME_ListIO selected; -// if ( LightApp_SelectionMgr *Sel = selectionMgr() ) -// Sel->selectedObjects( selected ); -// -// SALOME_ListIteratorOfListIO It( selected ); -// for ( ; isCompatible && It.More(); It.Next()) -// isCompatible = -// ( strcmp("GEOM", It.Value()->getComponentDataType()) == 0 ) || -// ( strcmp("HEXABLOCK", It.Value()->getComponentDataType()) == 0 ); -// -// return isCompatible; -// } - void HEXABLOCKGUI::setResource(SUIT_ResourceMgr* r) { DEBTRACE("HEXABLOCKGUI::setResource"); @@ -953,35 +874,30 @@ void HEXABLOCKGUI::preferencesChanged( const QString& sect, const QString& name { DEBTRACE("HEXABLOCKGUI::preferencesChanged"); _myresource->preferencesChanged(sect, name); - if(name=="userCatalog") - { - // _genericGui->getCatalogWidget()->addCatalogFromFile(Resource::userCatalog.toStdString()); - } +// if(name=="userCatalog") +// _genericGui->getCatalogWidget()->addCatalogFromFile(Resource::userCatalog.toStdString()); } void HEXABLOCKGUI::studyActivated() //CS_TODO { int newStudyId = getApp()->activeStudy()->id(); DEBTRACE("HEXABLOCKGUI::studyActivated " << _oldStudyId << " " << newStudyId); - - if (_oldStudyId != -1) - { - // _studyContextMap[_oldStudyId] = QtGuiContext::getQtCurrent(); - // if (_studyContextMap.count(newStudyId)) - // { - // DEBTRACE("switch to valid context " << QtGuiContext::getQtCurrent() << " " << _studyContextMap[newStudyId]); - // QtGuiContext::setQtCurrent(_studyContextMap[newStudyId]); - // } - // else - // { - // DEBTRACE("no switch to null context"); - // } - } +// if (_oldStudyId != -1) +// { +// _studyContextMap[_oldStudyId] = QtGuiContext::getQtCurrent(); +// if (_studyContextMap.count(newStudyId)) +// { +// DEBTRACE("switch to valid context " << QtGuiContext::getQtCurrent() << " " << _studyContextMap[newStudyId]); +// QtGuiContext::setQtCurrent(_studyContextMap[newStudyId]); +// } +// else +// { +// DEBTRACE("no switch to null context"); +// } +// } _oldStudyId = newStudyId; } - - void HEXABLOCKGUI::treeContextMenu(const QPoint& aPosition) { QModelIndex currentIndex = _patternDataTreeView->currentIndex(); @@ -991,7 +907,6 @@ void HEXABLOCKGUI::treeContextMenu(const QPoint& aPosition) currentAssocVariant = currentIndex.data( HEXA_ASSOC_ENTRY_ROLE ); currentAssocEntry = currentIndex.data( HEXA_ASSOC_ENTRY_ROLE ).toString(); if ( currentAssocVariant.isValid() && !currentAssocEntry.isEmpty() ){ - // getCurrentModel()->allowEdition(); QMenu menu( _patternDataTreeView ); //Remove association QAction *clearAct = menu.addAction( "Remove association(s)" ); @@ -1037,25 +952,15 @@ void HEXABLOCKGUI::createAndFillDockWidget() //1) *********** user input panel ( contain user's edit dialog box ) _dwInputPanel = new QDockWidget(aParent); - // QLayout* inputLayout = new QVBoxLayout(aParent); - // _dwInputPanel->setLayout(inputLayout); - // _dwInputPanel->setWindowFlags(Qt::FramelessWindowHint); - // _dwInputPanel->setWindowFlags(Qt::WindowTitleHint); _dwInputPanel->setVisible(false); _dwInputPanel->setWindowTitle("Input Panel"); - // _dwInputPanel->setMinimumHeight(DWINPUT_MINIMUM_HEIGHT); _dwInputPanel->setMinimumWidth(DWINPUT_MINIMUM_WIDTH); // --- force a minimum until display -// _dwInputPanel->raise(); - - // _stacked = new QStackedWidget(_dwInputPanel); - // _dwInputPanel->setWidget(_stacked); _treeViewDelegate = new DocumentDelegate(_dwInputPanel); //2) ************* document data ( Pattern, Association, Mesh ) in treeview representation // Pattern _dwPattern = new QDockWidget(aParent); - // _dwPattern->installEventFilter(this); _dwPattern->setVisible(false); _dwPattern->setWindowTitle("Model"); _dwPattern->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display @@ -1072,10 +977,9 @@ void HEXABLOCKGUI::createAndFillDockWidget() splitter->addWidget(_patternBuilderTreeView); splitter->addWidget(_patternGeomTreeView); patternLayout->addWidget(splitter); - // _patternDataTreeView->setMinimumHeight(DW_MINIMUM_WIDTH); _patternDataTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers/*QAbstractItemView::DoubleClicked*/); - _patternDataTreeView->setSelectionMode(QAbstractItemView::SingleSelection/*QAbstractItemView::MultiSelection*/);//);//QAbstractItemView::DoubleClicked, QAbstractItemView::SelectedClicked) + _patternDataTreeView->setSelectionMode(QAbstractItemView::SingleSelection/*QAbstractItemView::MultiSelection*/); _patternDataTreeView->setItemDelegate(_treeViewDelegate); @@ -1087,17 +991,14 @@ void HEXABLOCKGUI::createAndFillDockWidget() _dwPattern->setWidget(patternFrame); patternFrame->show(); - //_dwPattern->raise(); // Groups _dwGroups = new QDockWidget(aParent); - // _dwGroups->installEventFilter(this); _dwGroups->setVisible(false); _dwGroups->setWindowTitle("Groups"); _dwGroups->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display _groupsTreeView = new QTreeView(_dwGroups); - // _associationTreeView->setMinimumHeight(DW_MINIMUM_WIDTH); _groupsTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers); _groupsTreeView->setItemDelegate(_treeViewDelegate); _dwGroups->setWidget(_groupsTreeView); @@ -1105,46 +1006,31 @@ void HEXABLOCKGUI::createAndFillDockWidget() // Mesh _dwMesh = new QDockWidget(aParent); - // _dwMesh->installEventFilter(this); _dwMesh->setVisible(false); _dwMesh->setWindowTitle("Mesh"); _dwMesh->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display _meshTreeView = new QTreeView(_dwMesh); - // _meshTreeView->setMinimumHeight(DW_MINIMUM_WIDTH); _meshTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers); _meshTreeView->setSelectionMode(QAbstractItemView::SingleSelection); _meshTreeView->setItemDelegate(_treeViewDelegate); _dwMesh->setWidget(_meshTreeView); _meshTreeView->show(); - // _dwMesh->raise(); - - - //3) ************* documents ( salome objectbrowser ) QDockWidget *_dwObjectBrowser = 0; QWidget* wid = getApp()->objectBrowser()->treeView(); - // QWidget *wid = application()->objectBrowser()->treeView(); QWidget *w = wid->parentWidget(); while ( w && !_dwObjectBrowser ) { _dwObjectBrowser = ::qobject_cast( w ); w = w->parentWidget(); } - // _dwObjectBrowser->installEventFilter(this); - // _dwObjectBrowser->setVisible(false); _dwObjectBrowser->setMinimumWidth(DW_MINIMUM_WIDTH); // --- force a minimum until display _dwObjectBrowser->setWindowTitle("Study"); - // dock widget position - // aParent->addDockWidget(Qt::LeftDockWidgetArea, _dwPattern); - // aParent->addDockWidget(Qt::RightDockWidgetArea, _dwInputPanel); - // aParent->addDockWidget( Qt::LeftDockWidgetArea, _dwPattern ); aParent->addDockWidget( Qt::LeftDockWidgetArea, _dwObjectBrowser ); aParent->addDockWidget( Qt::LeftDockWidgetArea, _dwInputPanel ); aParent->tabifyDockWidget( _dwObjectBrowser, _dwPattern ); - // aParent->tabifyDockWidget( _dwPattern, /*_dwAssociation ); - // aParent->tabifyDockWidget( _dwAssociation, */_dwGroups ); aParent->tabifyDockWidget( _dwPattern, _dwGroups ); aParent->tabifyDockWidget( _dwGroups, _dwMesh ); @@ -1154,17 +1040,13 @@ void HEXABLOCKGUI::createAndFillDockWidget() #endif - // connect( _dwPattern, SIGNAL( visibilityChanged(bool) ), this, SLOT( showPatternMenus(bool) ) ); - // // connect( _dwAssociation, SIGNAL( visibilityChanged(bool) ), this, SLOT( showAssociationMenus(bool) ) ); - // connect( _dwGroups, SIGNAL( visibilityChanged(bool) ), this, SLOT( showGroupsMenus(bool) ) ); - // connect( _dwMesh, SIGNAL( visibilityChanged(bool) ), this, SLOT( showMeshMenus(bool) ) ); - // popup menu on data tree view _patternDataTreeView->setContextMenuPolicy(Qt::CustomContextMenu); connect(_patternDataTreeView, SIGNAL(customContextMenuRequested(const QPoint &)), this, - SLOT(treeContextMenu(const QPoint &)), Qt::UniqueConnection); + SLOT(treeContextMenu(const QPoint &)), + Qt::UniqueConnection ); } void HEXABLOCKGUI::createActions() @@ -1196,10 +1078,6 @@ void HEXABLOCKGUI::createActions() tr("Save the document"), 0, aParent, false, this, SLOT(saveDocument())); - // _testAct = createAction(_menuId++, tr("Test"), resMgr->loadPixmap("HEXABLOCK", tr("ICON_TEST")), - // tr("Test"), tr("New test"), - // 0, aParent, false, this, SLOT(test_association())); - // Pattern Data creation _addVertex = createAction(_menuId++, tr("Create a vertex"), @@ -1237,19 +1115,19 @@ void HEXABLOCKGUI::createActions() tr("Create a new vector"), 0, aParent, false, this, SLOT(addVector())); - _addCylinder = createAction(_menuId++, - tr("Create a cylinder"), - resMgr->loadPixmap("HEXABLOCK", tr("ICON_ADD_CYLINDER")), - tr("Add Cylinder"), - tr("Create a new cylinder"), - 0, aParent, false, this, SLOT(addCylinder())); +// _addCylinder = createAction(_menuId++, +// tr("Create a cylinder"), +// resMgr->loadPixmap("HEXABLOCK", tr("ICON_ADD_CYLINDER")), +// tr("Add Cylinder"), +// tr("Create a new cylinder"), +// 0, aParent, false, this, SLOT(addCylinder())); - _addPipe = createAction(_menuId++, - tr("Create a pipe"), - resMgr->loadPixmap("HEXABLOCK", tr("ICON_ADD_PIPE")), - tr("Add Pipe"), - tr("Create a new pipe"), - 0, aParent, false, this, SLOT(addPipe())); +// _addPipe = createAction(_menuId++, +// tr("Create a pipe"), +// resMgr->loadPixmap("HEXABLOCK", tr("ICON_ADD_PIPE")), +// tr("Add Pipe"), +// tr("Create a new pipe"), +// 0, aParent, false, this, SLOT(addPipe())); _makeGrid = createAction(_menuId++, tr("Make a grid"), @@ -1286,10 +1164,6 @@ void HEXABLOCKGUI::createActions() tr("Make pipes"), 0, aParent, false, this, SLOT(makePipes())); - // // _makeRind = createAction( _menuId++, tr("Make rind"), resMgr->loadPixmap( "HEXABLOCK", tr("ICON_MAKE_RIND")), - // // tr("Make rind"), tr("Make rind"), - // // 0, aParent, false, this, SLOT(makeRind())); - _makeHemiSphere = createAction(_menuId++, tr("Make an hemisphere"), resMgr->loadPixmap("HEXABLOCK", tr("ICON_MAKE_HEMISPHERE")), @@ -1398,10 +1272,10 @@ void HEXABLOCKGUI::createActions() 0, aParent, false, this, SLOT(assocEdge())); _assocQuad = createAction(_menuId++, - tr("Make quadrangle association"), + tr("Make quad association"), resMgr->loadPixmap("HEXABLOCK", tr("ICON_QUAD_ASSOCIATION")), - tr("Make Quadrangle Association"), - tr("Make quadrangle association"), + tr("Make Quad Association"), + tr("Make quad association"), 0, aParent, false, this, SLOT(assocQuad())); // Group @@ -1448,76 +1322,55 @@ void HEXABLOCKGUI::createActions() tr("Compute mesh"), 0, aParent, false, this, SLOT(computeMesh())); - QPixmap pix; _showModelInfoAct = createAction(_menuId++, tr("Show Model Info"), - QIcon(pix), - tr("MODEL_INFO"),//TODO: must be added in translation file + resMgr->loadPixmap("HEXABLOCK", tr("ICON_MODEL_INFO")), + tr("MODEL_INFO"), tr("MODEL_INFO"), 0, aParent, false, this, SLOT(showModelInfo())); _addShapeAct = createAction(_menuId++, tr("Add Shape"), - QIcon(pix), - tr("ADD_SHAPE"),//TODO: must be added in translation file + resMgr->loadPixmap("HEXABLOCK", tr("ICON_GEOM_ASSOCIATION")), + tr("ADD_SHAPE"), tr("ADD_SHAPE"), 0, aParent, false, this, SLOT(addShape())); - //Show actor -// _showAct = createAction(_menuId++, -// tr("Show"), -// QIcon(pix), -// tr("Show"), -// tr("Show the actor"), -// 0, aParent, false, this, SLOT(showActor())); - //Hide actor -// _hideAct = createAction(_menuId++, -// tr("Hide"), -// QIcon(pix), -// tr("Hide"), -// tr("Hide the actor"), -// 0, aParent, false, this, SLOT(hideActor())); - - //Show only -// _showOnlyAct = createAction(_menuId++, -// tr("Show Only"), -// QIcon(pix), -// tr("Show Only"), -// tr("Show only this actor"), -// 0, aParent, false, this, SLOT(showOnlyActor())); - - - // _newAct->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_N ); // --- QKeySequence::New ambiguous in SALOME - // QAction* createAction(const int id, - // const QString& toolTip, - // const QIcon& icon, - // const QString& menu, - // const QString& status, - // const int shortCut, - // QObject* parent =0, - // bool checkable = false, - // QObject* receiver =0, - // const char* member =0); +// _newAct->setShortcut( Qt::CTRL + Qt::SHIFT + Qt::Key_N ); // --- QKeySequence::New ambiguous in SALOME +// QAction* createAction(const int id, +// const QString& toolTip, +// const QIcon& icon, +// const QString& menu, +// const QString& status, +// const int shortCut, +// QObject* parent =0, +// bool checkable = false, +// QObject* receiver =0, +// const char* member =0); + + _sep1 = separator(); + _sep2 = separator(); + _sep3 = separator(); + _sep4 = separator(); } void HEXABLOCKGUI::createMenus() { - int aMenuId, subMenuId; - aMenuId = createMenu( tr("MEN_FILE"), -1, -1 ); - createMenu( separator(), aMenuId, -1, 10 ); - aMenuId = createMenu( tr("HEXABLOCK"), aMenuId, -1, 10 ); - createMenu( _newAct, aMenuId ); - createMenu( _importAct, aMenuId ); - createMenu( _saveAct, aMenuId ); - // createMenu( _testAct, aMenuId ); + int aMenuId, subMenuId,aMenuIdMain; - // aMenuId = createMenu( tr( "HEXABLOCK" ), -1, -1, 30 ); - aMenuId = createMenu( tr( "Document" ), -1, -1, 30 ); - createMenu( _newAct, aMenuId );//, 10 - createMenu( _importAct, aMenuId ); + aMenuIdMain = createMenu( tr("MEN_FILE"), -1, -1); + + aMenuId = createMenu( tr("HEXABLOCK"), aMenuIdMain, -1, 10 ); + createMenu( actionId(_newAct), aMenuId ); + createMenu( actionId(_importAct), aMenuId ); createMenu( _saveAct, aMenuId ); - // createMenu( _testAct, aMenuId ); + + + int aMenuDocId = createMenu( tr( "Document" ), -1, -1, 30 ); + createMenu( _newAct, aMenuDocId );//, 10 + createMenu( _importAct, aMenuDocId ); + createMenu( _saveAct, aMenuDocId ); aMenuId = createMenu( tr("Model"), -1, -1, 30 ); subMenuId = createMenu( tr( "Construction" ), aMenuId, -1 ); @@ -1525,39 +1378,45 @@ void HEXABLOCKGUI::createMenus() createMenu( _addEdge, subMenuId ); createMenu( _addQuad, subMenuId ); createMenu( _addHexa, subMenuId ); - createMenu( separator(), subMenuId ); + createMenu( _sep1, subMenuId); // Pattern Builder createMenu( _addVector, subMenuId ); - createMenu( _addCylinder, subMenuId ); - createMenu( _addPipe, subMenuId ); - createMenu( separator(), subMenuId); +// createMenu( _addCylinder, subMenuId ); +// createMenu( _addPipe, subMenuId ); + + createMenu( _sep2, subMenuId); + createMenu( _makeGrid, subMenuId ); //Cartesian, Cylindrical, Spherical createMenu( _makeHemiSphere,subMenuId ); - createMenu( separator(), subMenuId); + + createMenu( _sep3, subMenuId); + createMenu( _makeCylinder, subMenuId ); createMenu( _makePipe, subMenuId ); createMenu( _makeCylinders,subMenuId ); createMenu( _makePipes, subMenuId ); - // createMenu( _makeRind, aMenuId ); // Pattern Data Edition subMenuId = createMenu( tr( "Operation" ), aMenuId, -1 ); createMenu( _removeHexa, subMenuId ); createMenu( _prismQuad, subMenuId ); createMenu( _joinQuad, subMenuId ); - createMenu( _merge, subMenuId );// createMenu( _mergeVertices, aMenuId ); // createMenu( _mergeEdges, aMenuId ); + createMenu( _merge, subMenuId ); createMenu( _disconnect, subMenuId ); createMenu( _cutEdge, subMenuId ); - createMenu( _makeTransformation, subMenuId ); // createMenu( _makeTranslation, aMenuId ); + createMenu( _makeTransformation, subMenuId ); createMenu( _makeSymmetry, subMenuId ); createMenu( _performTransformation, subMenuId ); createMenu( _performSymmetry, subMenuId ); createMenu( _replaceHexa, subMenuId ); createMenu( _quadRevolution, subMenuId ); + createMenu( _sep4, aMenuId ); + createMenu( _showModelInfoAct, aMenuId ); // Association aMenuId = createMenu( tr("Association"), -1, -1, 30 ); + createMenu( _addShapeAct, aMenuId ); createMenu( _assocVertex, aMenuId ); createMenu( _assocEdge, aMenuId ); createMenu( _assocQuad, aMenuId ); @@ -1576,7 +1435,7 @@ void HEXABLOCKGUI::createMenus() //show model infomation menu QString aRule = "$component={'HEXABLOCK'}"; - popupMgr()->insert( _showModelInfoAct, -1, -1 ); // link the model information action to context menu + popupMgr()->insert( _showModelInfoAct, -1, -1 ); popupMgr()->setRule( _showModelInfoAct, aRule); //associate shape to a document menu @@ -1616,7 +1475,6 @@ void HEXABLOCKGUI::createMenus() // popupMgr()->setRule(_showOnlyAct, aRule.arg( "" ), QtxPopupMgr::VisibleRule ); // // popupMgr()->insert( separator(), -1, -1 ); - } @@ -1628,6 +1486,7 @@ void HEXABLOCKGUI::createTools() createTool( _newAct, aToolId ); createTool( _importAct, aToolId ); createTool( _saveAct, aToolId ); + createTool( _showModelInfoAct, aToolId ); // createTool( _testAct, aToolId ); //createTool( separator(), aToolId ); @@ -1637,23 +1496,25 @@ void HEXABLOCKGUI::createTools() createTool( _addEdge, aToolId ); createTool( _addQuad, aToolId ); createTool( _addHexa, aToolId ); - createTool( separator(), aToolId ); + + createTool( _sep1, aToolId ); // Pattern Builder createTool( _addVector, aToolId ); - createTool( _addCylinder, aToolId ); - createTool( _addPipe, aToolId ); - createTool( separator(), aToolId ); +// createTool( _addCylinder, aToolId ); +// createTool( _addPipe, aToolId ); + + createTool( _sep2, aToolId ); createTool( _makeGrid, aToolId ); createTool( _makeHemiSphere, aToolId ); - createTool( separator(), aToolId ); + + createTool( _sep3, aToolId ); + createTool( _makeCylinder, aToolId ); createTool( _makePipe, aToolId ); createTool( _makeCylinders,aToolId ); createTool( _makePipes, aToolId ); - // createTool( _makeRind, aToolId); -// createTool( separator(), aToolId ); // Pattern Data Edition aToolId = createTool ( tr( "Operation" ) ); @@ -1669,20 +1530,18 @@ void HEXABLOCKGUI::createTools() createTool( _performSymmetry, aToolId ); createTool( _replaceHexa, aToolId ); createTool( _quadRevolution, aToolId ); - //createTool( separator(), aToolId ); // Association aToolId = createTool ( tr( "Association" ) ); createTool( _assocVertex, aToolId ); createTool( _assocEdge, aToolId ); createTool( _assocQuad, aToolId ); - //createTool( separator(), aToolId ); + createTool( _addShapeAct, aToolId ); // Group aToolId = createTool ( tr( "Group" ) ); createTool( _addGroup, aToolId ); createTool( _removeGroup, aToolId ); //CS_TODO - //createTool( separator(), aToolId ); // Law aToolId = createTool ( tr( "Mesh" ) ); @@ -1720,10 +1579,10 @@ void HEXABLOCKGUI::showDocumentMenus(bool show) setToolShown(_newAct, show); setMenuShown(_importAct, show); setToolShown(_importAct, show); + setMenuShown(_showModelInfoAct, show); + setToolShown(_showModelInfoAct, show); setMenuShown(_saveAct, show); setToolShown(_saveAct, show); - // setMenuShown(_testAct, show); - // setToolShown(_testAct, show); } void HEXABLOCKGUI::showPatternMenus(bool show) @@ -1732,63 +1591,73 @@ void HEXABLOCKGUI::showPatternMenus(bool show) DEBTRACE("getCurrentModel() " << getCurrentModel() ); if ( show && !getCurrentModel() ) return; - setMenuShown(_addVertex, show );//true); + setMenuShown(_addVertex, show ); setToolShown(_addVertex, show); - setMenuShown(_addEdge, show );//true); + setMenuShown(_addEdge, show ); setToolShown(_addEdge, show); - setMenuShown(_addQuad, show );//true); + setMenuShown(_addQuad, show ); setToolShown(_addQuad, show); - setMenuShown(_addHexa, show );//true); + setMenuShown(_addHexa, show ); setToolShown(_addHexa, show); + setMenuShown(_sep1, show ); + setToolShown(_sep1, show); - setMenuShown( _addVector, show );//true); + setMenuShown( _addVector, show ); setToolShown( _addVector, show); - setMenuShown( _addCylinder, show );//true); - setToolShown( _addCylinder, show); - setMenuShown( _addPipe, show );//true); - setToolShown( _addPipe, show); - setMenuShown( _makeGrid, show );//true); +// setMenuShown( _addCylinder, show ); +// setToolShown( _addCylinder, show); +// setMenuShown( _addPipe, show ); +// setToolShown( _addPipe, show); + + setMenuShown(_sep2, show ); + setToolShown(_sep2, show); + + setMenuShown( _makeGrid, show ); setToolShown( _makeGrid, show); - setMenuShown( _makeCylinder, show );//true); - setToolShown( _makeCylinder, show); - setMenuShown( _makePipe, show );//true); + setMenuShown( _makePipe, show ); setToolShown( _makePipe, show); - setMenuShown( _makeCylinders, show );//true); + + setMenuShown(_sep3, show ); + setToolShown(_sep3, show); + + setMenuShown( _makeCylinder, show ); + setToolShown( _makeCylinder, show); + setMenuShown( _makeCylinders, show ); setToolShown( _makeCylinders, show); - setMenuShown( _makePipes, show );//true); + setMenuShown( _makePipes, show ); setToolShown( _makePipes, show); - // setMenuShown( _makeRind, show );//true); - // setToolShown( _makeRind, show); - setMenuShown( _makeHemiSphere, show );//true); + setMenuShown( _makeHemiSphere, show ); setToolShown( _makeHemiSphere, show); // Pattern Data Edition - setMenuShown( _removeHexa, show );//true); + setMenuShown( _removeHexa, show ); setToolShown( _removeHexa, show); - setMenuShown( _prismQuad, show );//true); + setMenuShown( _prismQuad, show ); setToolShown( _prismQuad, show); - setMenuShown( _joinQuad, show );//true); + setMenuShown( _joinQuad, show ); setToolShown( _joinQuad, show); - setMenuShown( _merge, show );//true); + setMenuShown( _merge, show ); setToolShown( _merge, show); - setMenuShown( _disconnect, show );//true); + setMenuShown( _disconnect, show ); setToolShown( _disconnect, show); - setMenuShown( _cutEdge, show );//true); + setMenuShown( _cutEdge, show ); setToolShown( _cutEdge, show); - setMenuShown( _makeTransformation, show );//true); + setMenuShown( _makeTransformation, show ); setToolShown( _makeTransformation, show); - setMenuShown( _makeSymmetry, show );//true); + setMenuShown( _makeSymmetry, show ); setToolShown( _makeSymmetry, show); - setMenuShown( _performTransformation, show );//true); + setMenuShown( _performTransformation, show ); setToolShown( _performTransformation, show); - setMenuShown( _performSymmetry, show );//true); + setMenuShown( _performSymmetry, show ); setToolShown( _performSymmetry, show); - setMenuShown( _replaceHexa, show );//true); + setMenuShown( _replaceHexa, show ); setToolShown( _replaceHexa, show); - setMenuShown( _quadRevolution, show );//true); + setMenuShown( _quadRevolution, show ); setToolShown( _quadRevolution, show); + setMenuShown( _sep4, show ); + setMenuShown( _showModelInfoAct, show ); } @@ -1799,11 +1668,13 @@ void HEXABLOCKGUI::showAssociationMenus(bool show) // Association Edition setMenuShown( _assocVertex, show ); - setToolShown( _assocVertex, show); + setToolShown( _assocVertex, show ); setMenuShown( _assocEdge, show ); - setToolShown( _assocEdge, show); + setToolShown( _assocEdge, show ); setMenuShown( _assocQuad, show ); - setToolShown( _assocQuad, show); + setToolShown( _assocQuad, show ); + setMenuShown( _addShapeAct, show ); + setToolShown( _addShapeAct, show ); } @@ -1811,9 +1682,9 @@ void HEXABLOCKGUI::showGroupsMenus(bool show) { DEBTRACE("HEXABLOCKGUI::showGroupsMenus" << show); if ( show && !getCurrentModel() ) return; - setMenuShown( _addGroup, show );//true); + setMenuShown( _addGroup, show ); setToolShown( _addGroup, show); - setMenuShown( _removeGroup , show );//true); + setMenuShown( _removeGroup , show ); setToolShown( _removeGroup , show); } @@ -1821,19 +1692,18 @@ void HEXABLOCKGUI::showMeshMenus(bool show) { DEBTRACE("HEXABLOCKGUI::showMeshMenus" << show); if ( show && !getCurrentModel() ) return; - setMenuShown( _addLaw, show );//true); + setMenuShown( _addLaw, show ); setToolShown( _addLaw, show); - setMenuShown( _removeLaw, show );//true); + setMenuShown( _removeLaw, show ); setToolShown( _removeLaw, show);; - setMenuShown( _setPropagation, show );//true); + setMenuShown( _setPropagation, show ); setToolShown( _setPropagation, show); - setMenuShown( _computeMesh, show); //true); + setMenuShown( _computeMesh, show); setToolShown( _computeMesh, show); } void HEXABLOCKGUI::showActor() { - //TODO: Implement the real one (this is not show only actor, but show actor) VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); if (currentVtkGView == NULL || currentVtkGView->getViewWindow() == NULL || currentVtkGView->isEmpty() || currentVtkGView->getDocumentActor() == NULL) @@ -1850,24 +1720,28 @@ void HEXABLOCKGUI::showActor() if (aStudy == NULL || vman == NULL) return; Handle(SALOME_InteractiveObject) anIO = currentVtkGView->getDocumentActor()->getIO(); - aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), GEOM::propertyName(GEOM::Visibility), 1 ); + aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), "Visibility", 1 ); displayer()->setVisibilityState(anIO->getEntry(), Qtx::ShownState); } +//SOCC_Prs* currentPrs = NULL; void HEXABLOCKGUI::showOnlyActor() { VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); - if (currentVtkGView == NULL || currentVtkGView->getViewWindow() == NULL || - currentVtkGView->isEmpty() || currentVtkGView->getDocumentActor() == NULL) + if (currentVtkGView == NULL || currentVtkGView->isEmpty() || + currentVtkGView->getDocumentActor() == NULL) + return; + SVTK_ViewWindow* vtkView = currentVtkGView->getViewWindow(); + if (vtkView == NULL) return; SALOME_Actor *actor = NULL; vtkActor *aVTKActor = NULL; Handle(SALOME_InteractiveObject) anIO; - SUIT_ViewManager* vman = currentVtkGView->getViewWindow()->getViewManager(); + SUIT_ViewManager* vman = vtkView->getViewManager(); SalomeApp_Study* aStudy = HEXABLOCKGUI::activeStudy(); - vtkRenderer *aRenderer = currentDocGView->getViewWindow()->getRenderer(); + vtkRenderer *aRenderer = vtkView->getRenderer(); if (aStudy == NULL || vman == NULL || aRenderer == NULL) return; //update the visibility state for all actors ----------- @@ -1876,88 +1750,57 @@ void HEXABLOCKGUI::showOnlyActor() if (aCollection == NULL) return; aCollection->InitTraversal(); - while( aVTKActor = aCollection->GetNextActor() ){ + while( (aVTKActor = aCollection->GetNextActor()) != NULL ){ actor = dynamic_cast( aVTKActor ); if ( actor && actor->hasIO() ){ anIO = actor->getIO(); if( anIO->hasEntry()) { - aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), GEOM::propertyName(GEOM::Visibility), 0 ); + aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), "Visibility", 0 ); displayer()->setVisibilityState(anIO->getEntry(), Qtx::HiddenState); }//if }//if }//while //show only the current actor ----------------- - currentVtkGView->getViewWindow()->setFocus(); - currentVtkGView->getViewWindow()->DisplayOnly(currentVtkGView->getDocumentActor()->getIO()); + vtkView->setFocus(); + vtkView->DisplayOnly(currentVtkGView->getDocumentActor()->getIO()); currentVtkGView->update(); - currentVtkGView->getViewWindow()->onFitAll(); anIO = currentVtkGView->getDocumentActor()->getIO(); - aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), GEOM::propertyName(GEOM::Visibility), 1 ); + aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), "Visibility", 1 ); displayer()->setVisibilityState(anIO->getEntry(), Qtx::ShownState); + vtkView->onFitAll(); +// //showOnly in occ viewer ------------- - //showOnly in occ viewer ------------- - - OCCViewer_ViewWindow* occView = currentOccGView == NULL ? NULL : currentOccGView->getViewWindow(); - DocumentModel* docModel = currentVtkGView->getDocumentModel(); - if (occView == NULL || docModel == NULL) return; + if (currentOccGView == NULL) + return; + OCCViewer_ViewWindow* occView = currentOccGView->getViewWindow(); + if (occView == NULL) + return; SALOME_View* vf = dynamic_cast(occView->getViewManager()->getViewModel()); - if (vf == NULL) return; - - GEOM_Displayer* disp = geomBaseHelper->getDisplayer(); - if (disp == NULL) - { - MESSAGE("Displayer IS NULL"); + if (vf == NULL) return; - } - _PTR(Study) aStudyDS = aStudy->studyDS(); - if (aStudyDS == NULL) return; - - //erase all shapes from the occ viewer - disp->EraseAll(false, true, vf); - //show only the shapes of the document - QList entries = docModel->getShapesEntries(); - - CORBA::Object_var aCorbaObj = CORBA::Object::_nil(); - GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_nil(); - HEXABLOCKGUI::geomBaseHelper->erasePreview(true); - - foreach(const QString& entry, entries) - { - if (!entry.isEmpty()) - { - _PTR(SObject) aSChild = aStudyDS->FindObjectID( entry.toStdString() ); - aCorbaObj = corbaObj( aSChild ); - aGeomObj = GEOM::GEOM_Object::_narrow( aCorbaObj ); - if ( !CORBA::is_nil(aGeomObj) ){ - geomBaseHelper->display(aGeomObj._retn()); -// QString objIOR = GEOMBase::GetIORFromObject( aGeomObj._retn() ); -// Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape( objIOR );//, true ) -// if ( !aSh.IsNull() ) -// disp->Display(aSh->getIO(), true, vf); -// else -// { -// MESSAGE("aSh IS NULL"); -// } - } - } - } - occView->onResetView (); + vf->EraseAll(); + currentOccGView->globalSelection(); + SOCC_Prs* prs = getOccPrs(currentDocGView); + currentOccGView->setPrs(prs); + vf->Display(prs); + vf->Repaint(); + occView->onFitAll(); } void HEXABLOCKGUI::hideActor() { + // * vtk -- VtkDocumentGraphicView* currentVtkGView = getCurrentVtkGraphicView(); if (currentVtkGView == NULL || currentVtkGView->isEmpty() || currentVtkGView->getViewWindow() == NULL || currentVtkGView->getDocumentActor() == NULL) return; -// currentVtkGView->getViewWindow()->setFocus(); currentVtkGView->getViewWindow()->Erase(currentVtkGView->getDocumentActor()->getIO()); - currentVtkGView->getViewWindow()->onFitAll(); + currentVtkGView->getViewWindow()->onResetView(); //update the visibility state now SalomeApp_Study* aStudy = HEXABLOCKGUI::activeStudy(); @@ -1965,18 +1808,24 @@ void HEXABLOCKGUI::hideActor() if (aStudy == NULL || vman == NULL) return; Handle(SALOME_InteractiveObject) anIO = currentVtkGView->getDocumentActor()->getIO(); - aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), GEOM::propertyName(GEOM::Visibility), 0 ); + aStudy->setObjectProperty(vman->getId(), anIO->getEntry(), "Visibility", 0 ); displayer()->setVisibilityState(anIO->getEntry(), Qtx::HiddenState); -} + // * occ -- + OCCViewer_ViewWindow* occView = currentOccGView == NULL ? NULL : currentOccGView->getViewWindow(); + DocumentModel* docModel = currentVtkGView->getDocumentModel(); + if (occView == NULL || docModel == NULL) + return; + SALOME_View* vf = dynamic_cast(occView->getViewManager()->getViewModel()); + if (vf == NULL) + return; -VtkDocumentGraphicView* HEXABLOCKGUI::getCurrentVtkGraphicView() -{ -// VtkDocumentGraphicView* gv = graphicViewsHandler->getDocumentGraphicView(currentVtkView); -// return graphicViewsHandler->getDocumentGraphicView(currentVtkView); - return currentDocGView; + vf->EraseAll(); + vf->Repaint(); + occView->onResetView(); } + void HEXABLOCKGUI::showDockWidgets(bool isVisible) { DEBTRACE("HEXABLOCKGUI::showDockWidgets " << isVisible); @@ -1987,349 +1836,67 @@ void HEXABLOCKGUI::showDockWidgets(bool isVisible) if (_dwPattern) _dwPattern->setVisible(isVisible); if (_dwPattern) _dwPattern->toggleViewAction()->setVisible(isVisible); - // if (_dwAssociation) _dwAssociation->setVisible(isVisible); - // if (_dwAssociation) _dwAssociation->toggleViewAction()->setVisible(isVisible); - if (_dwMesh) _dwMesh->setVisible(isVisible); if (_dwMesh) _dwMesh->toggleViewAction()->setVisible(isVisible); if (_dwGroups) _dwGroups->setVisible(isVisible); if (_dwGroups) _dwGroups->toggleViewAction()->setVisible(isVisible); - -// if (_dwInputPanel) _dwInputPanel->setVisible(isVisible); -// if (_dwInputPanel) _dwInputPanel->toggleViewAction()->setVisible(isVisible); - -// QWidget* w = _dwInputPanel->widget(); -// if (w) w->show(); - // if ( isVisible ) _dwObjectBrowser->raise();//_dwPattern->raise(); } -// void HEXABLOCKGUI::raiseStacked() -// { -// // if (_dwStacked) _dwStacked->raise(); -// } - - -void HEXABLOCKGUI::testDocument() +//clear all used dialogs by the current model +void HEXABLOCKGUI::clearDialogs() { - //CS_TEST - // ---------- - // QStandardItem *parentItem = getCurrentModel()->invisibleRootItem(); - // QStandardItem *myItem = new QStandardItem("MyItem"); - // parentItem->appendRow(myItem); - // // ---------- - // QModelIndex v0 = getCurrentModel()->addVertex(0., 0., 0.); - // QModelIndex v1 = getCurrentModel()->addVertex(5., 0., 0.); - // QModelIndex v2 = getCurrentModel()->addVertex(5., 5., 0.); - // QModelIndex v3 = getCurrentModel()->addVertex(0., 5., 0.); - // QModelIndex v4 = getCurrentModel()->addVertex(0., 0., 5.); - // QModelIndex v5 = getCurrentModel()->addVertex(5., 0., 5.); - // QModelIndex v6 = getCurrentModel()->addVertex(5., 5., 5.); - // QModelIndex v7 = getCurrentModel()->addVertex(0., 5., 5.); - // // - // // - // QModelIndex q0 = getCurrentModel()->addQuadVertices( v0, v1, v2, v3 ); - // QModelIndex q1 = getCurrentModel()->addQuadVertices( v4, v5, v6, v7 ); - // QModelIndex q2 = getCurrentModel()->addQuadVertices( v0, v3, v7, v4 ); - // QModelIndex q3 = getCurrentModel()->addQuadVertices( v1, v2, v6, v5 ); - // QModelIndex q4 = getCurrentModel()->addQuadVertices( v0, v1, v5, v4 ); - // QModelIndex q5 = getCurrentModel()->addQuadVertices( v3, v2, v6, v7 ); - // - // QModelIndex h0 = getCurrentModel()->addHexaQuad( q0, q1, q2, q3, q4, q5 ); - // QModelIndex vx = getCurrentModel()->addVector(1., 0., 0.); - // QModelIndex vy = getCurrentModel()->addVector(0., 1., 0.); - // QModelIndex vz = getCurrentModel()->addVector(0., 0., 1.); - // + std::set::const_iterator debut (currentModelDialogs.begin()), + fin (currentModelDialogs.end()); + for(;debut!=fin;++debut) (*debut)->clear(); + currentModelDialogs.clear(); //empty the used dialogs list +} +HexaBaseDialog* HEXABLOCKGUI::getDlgBox(VtkDocumentGraphicView* dgview) +{ + if (!gViewDlgBox.contains(dgview)) return NULL; + return gViewDlgBox[dgview]; +} - // // QModelIndex orig1 = getCurrentModel()->addVertex (0, 0,0); - // // QModelIndex orig2 = getCurrentModel()->addVertex (50,0,0); - // // QModelIndex vz = getCurrentModel()->addVector (0,0,1); - // // QModelIndex vx = getCurrentModel()->addVector (1,0,0); - // // - // // int nr = 4; - // // int nri = 3; - // // int nre = nr; - // // int na = 9; - // // int nl = 5; - // // - // // QModelIndex cyl = getCurrentModel()->addCylinder (orig1, vz, nr, nl); - // // QModelIndex pipe = getCurrentModel()->addPipe (orig2, vz, nri, nre, nl); - // // - // // getCurrentModel()->makeCylinder (cyl, vx, nr, na, nl); - // // getCurrentModel()->makePipe(pipe, vx, nr, na, nl); +void HEXABLOCKGUI::switchOnGraphicView(VtkDocumentGraphicView* dgview) +{ + if (dgview == NULL) return; + switchOffGraphicView(dgview, false); //to avoid double connect + //connect signals + connect( selectionMgr(), SIGNAL( currentSelectionChanged() ), + dgview->getPatternDataSelectionModel(), SLOT( salomeSelectionChanged() ), Qt::UniqueConnection ); + connect( dgview->getPatternDataSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); + connect( dgview->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); + connect( dgview->getPatternGeomSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); + connect( dgview->getGroupsSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); + connect( dgview->getMeshSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); - // newMesh( "toto", 3, "FactoryServer"); - // newMesh + if (currentDocGView != NULL) + { + if (currentDocGView->getViewWindow() != NULL) + dgview->setViewWindow(currentDocGView->getViewWindow()); + else + { + dgview->setViewWindow(graphicViewsHandler->createVtkWindow()); + dgview->getViewWindow()->installEventFilter(this); + } + } + dgview->getViewWindow()->setFocus(); + showAllMenus(); } -void HEXABLOCKGUI::test_make_cart_grid() +void HEXABLOCKGUI::switchOffGraphicView(VtkDocumentGraphicView* dgview, bool saveCurrentDlg) { - QModelIndex orig1 = getCurrentModel()->addVertex( 0, 0, 0); - QModelIndex orig2 = getCurrentModel()->addVertex( 10, 0, 0); - QModelIndex orig3 = getCurrentModel()->addVertex( 0, 10, 0); - QModelIndex orig4 = getCurrentModel()->addVertex( 10, 10, 0); - QModelIndex orig5 = getCurrentModel()->addVertex( 0, 20, 0); - QModelIndex orig6 = getCurrentModel()->addVertex( 10, 20, 0); - - QModelIndex vz = getCurrentModel()->addVector(0, 0, 1); - QModelIndex vx = getCurrentModel()->addVector(1, 0, 0); - - //int dr = 1; - //int dl = 1; - //int nr = 2; - //int nl = 3; - - // QModelIndex c1 = getCurrentModel()->makeCylindrical(orig1, vx, vz, dr, 360, dl, nr, 4, nl, true); - // QModelIndex c2 = getCurrentModel()->makeCylindrical(orig2, vx, vz, dr, 360, dl, nr, 8, nl, true); - // QModelIndex c3 = getCurrentModel()->makeCylindrical(orig3, vx, vz, dr, 270, dl, nr, 8, nl, true); - // QModelIndex c4 = getCurrentModel()->makeCylindrical(orig4, vx, vz, dr, 270, dl, nr, 7, nl, true); - // QModelIndex c5 = getCurrentModel()->makeCylindrical(orig5, vx, vz, dr, 360, dl, nr, 5, nl, true); - // QModelIndex c6 = getCurrentModel()->makeCylindrical(orig6, vx, vz, dr, 360, dl, nr, 6, nl, true); - -} - - -void HEXABLOCKGUI::test_make_elmts_transform() -{ - - int size_x = 1; - int size_y = 1; - int size_z = 2; - - QModelIndex orig = getCurrentModel()->addVertex(0, 0, 0); - QModelIndex dirVr = getCurrentModel()->addVector(1, 1, 1); - - QModelIndex grid = getCurrentModel()->makeCartesian(orig, dirVr, size_x, size_y, size_z);//, 0, 0, 0); - // orig.setScalar(2); - - // file_name = os.path.join(os.environ['TMP'], 'transfo0.vtk') - // getCurrentModel()->saveVtk(file_name) - - QModelIndex devant = getCurrentModel()->addVector(5, 0, 0); - QModelIndex grid2 = getCurrentModel()->makeTranslation(grid, devant); - - // file_name = os.path.join(os.environ['TMP'], 'transfo_translation.vtk') - // getCurrentModel()->saveVtk(file_name) - - QModelIndex grid4 = getCurrentModel()->makeRotation(grid2, orig, dirVr, 45); - - - // file_name = os.path.join(os.environ['TMP'], 'transfo_rotation.vtk'); - // getCurrentModel()->saveVtk(file_name); - - - // print "...test make elements by transforming elements OK" -} - - -void HEXABLOCKGUI::test() -{ - DEBTRACE("HEXABLOCKGUI::test"); - VtkDocumentGraphicView* currentDGView = getCurrentVtkGraphicView(); - if (currentDGView == NULL) return; - currentDGView->update(); - -} - -void HEXABLOCKGUI::test_association() -{ - DEBTRACE("HEXABLOCKGUI::test_association"); - newDocument(); - - QModelIndex v0, v1, v2, v3, e0, e1, q0; - - DocumentModel::GeomObj v0Assoc, v1Assoc, v2Assoc, v3Assoc; - DocumentModel::GeomObj e0AssocA, e1AssocA, e1AssocB, e1AssocC; - DocumentModel::GeomObj q0AssocA, q0AssocB; - - DocumentModel::GeomObj v0Assoc_test, v1Assoc_test, v2Assoc_test, v3Assoc_test; - QList e1Assocs_test; - DocumentModel::GeomObj q0Assoc_test; - - v0 = getCurrentModel()->addVertex(0, 0, 0); - v1 = getCurrentModel()->addVertex(1, 0, 0); - v2 = getCurrentModel()->addVertex(1, 1, 0); - v3 = getCurrentModel()->addVertex(0, 1, 0); - e0 = getCurrentModel()->addEdgeVertices(v0, v1); - e1 = getCurrentModel()->addEdgeVertices(v1, v2); - q0 = getCurrentModel()->addQuadVertices( v0, v1, v2, v3 ); - - - // >>> face3.GetEntry()'0:1:4' - // >>> e1.GetEntry()'0:1:8' - // >>> e2.GetEntry()'0:1:9' - // >>> e3.GetEntry()'0:1:10' - // >>> e4.GetEntry()'0:1:11' - // >>> v1.GetEntry()'0:1:12' - // >>> v2.GetEntry()'0:1:13' - // >>> v3.GetEntry()'0:1:14' - // >>> v4.GetEntry()'0:1:15' - - - // v0Assoc.name = "geomV0"; - // v0Assoc.entry = "0:1:1:1:3:6";//"0:1:12"; - // v0Assoc.brep = "brepV0"; - // v1Assoc.name = "geomV1"; - // v1Assoc.entry = "0:1:1:1:3:7";//"0:1:13"; - // v1Assoc.brep = "brepV1"; - // v2Assoc.name = "geomV2"; - // v2Assoc.entry = "0:1:1:1:3:8";//"0:1:14"; - // v2Assoc.brep = "brepV2"; - // v3Assoc.name = "geomV3"; - // v3Assoc.entry = "0:1:1:1:3:9";//"0:1:15"; - // v3Assoc.brep = "brepV3"; - // - // - // - // e0AssocA.name = "geomE0a"; - // e0AssocA.entry = "0:1:1:1:3:5";//"0:1:8"; - // e0AssocA.brep = "brepE0a"; - // e0AssocA.start = 0.10; - // e0AssocA.end = 0.95; - // - // - // - // e1AssocA.name = "geomE1a"; - // e1AssocA.entry = "0:1:1:1:3:2";//"0:1:8"; - // e1AssocA.brep = "brepE1a"; - // e1AssocA.start = 0.12; - // e1AssocA.end = 0.89; - // e1AssocB.name = "geomE1b"; - // e1AssocB.entry = "0:1:1:1:3:3";//"0:1:9"; - // e1AssocB.brep = "brepE1b"; - // e1AssocB.start = 0.20; - // e1AssocB.end = 0.80; - // e1AssocC.name = "geomE1c"; - // e1AssocC.entry = "0:1:1:1:3:4";//"0:1:10"; - // e1AssocC.brep = "brepE1c"; - // e1AssocC.start = 0.16; - // e1AssocC.end = 0.96; - // - // q0AssocA.name = "geomQuad"; - // q0AssocA.entry = "0:1:1:1:3"; - // q0AssocA.brep = "brepq0"; - // - // q0AssocB.name = "geomQuad"; - // q0AssocB.entry = "0:1:1:1:4"; - // q0AssocB.brep = "brepq0"; - // - // getCurrentModel()->addAssociation( v0, v0Assoc ); - // getCurrentModel()->addAssociation( v1, v1Assoc ); - // getCurrentModel()->addAssociation( v2, v2Assoc ); - // getCurrentModel()->addAssociation( v3, v3Assoc ); - // - // - // getCurrentModel()->addAssociation( e0, e0AssocA ); - // - // getCurrentModel()->addAssociation( e1, e1AssocA ); - // getCurrentModel()->addAssociation( e1, e1AssocB ); - // getCurrentModel()->addAssociation( e1, e1AssocC ); - // - // getCurrentModel()->addAssociation( q0, q0AssocA ); - // getCurrentModel()->addAssociation( q0, q0AssocB ); - - - - - - // v0Assoc_test = getCurrentModel()->getAssociations( v0 )[0]; - // v1Assoc_test = getCurrentModel()->getAssociations( v1 )[0]; - // v2Assoc_test = getCurrentModel()->getAssociations( v2 )[0]; - // v3Assoc_test = getCurrentModel()->getAssociations( v3 )[0]; - // ASSERT( v0Assoc.name == v0Assoc_test.name ); - // ASSERT( v1Assoc.name == v1Assoc_test.name ); - // ASSERT( v2Assoc.name == v2Assoc_test.name ); - // ASSERT( v3Assoc.name == v3Assoc_test.name ); - // ASSERT( v0Assoc.entry == v0Assoc_test.entry ); - // ASSERT( v1Assoc.entry == v1Assoc_test.entry ); - // ASSERT( v2Assoc.entry == v2Assoc_test.entry ); - // ASSERT( v3Assoc.entry == v3Assoc_test.entry ); - // - // - // e1Assocs_test = getCurrentModel()->getAssociations( e1 ); - // ASSERT( e1Assocs_test[0].name == e1AssocA.name ); - // ASSERT( e1Assocs_test[1].name == e1AssocB.name ); - // ASSERT( e1Assocs_test[2].name == e1AssocC.name ); - // ASSERT( e1Assocs_test[0].entry == e1AssocA.entry ); - // ASSERT( e1Assocs_test[1].entry == e1AssocB.entry ); - // ASSERT( e1Assocs_test[2].entry == e1AssocC.entry ); - // ASSERT( e1Assocs_test[0].start == e1AssocA.start ); - // ASSERT( e1Assocs_test[1].start == e1AssocB.start ); - // ASSERT( e1Assocs_test[2].start == e1AssocC.start ); - // ASSERT( e1Assocs_test[0].end == e1AssocA.end ); - // ASSERT( e1Assocs_test[1].end == e1AssocB.end ); - // ASSERT( e1Assocs_test[2].end == e1AssocC.end ); - // - // q0Assoc_test = getCurrentModel()->getAssociations( q0 )[0]; - // ASSERT( q0Assoc_test.name == q0Assoc.name ); - // ASSERT( q0Assoc_test.entry == q0Assoc.entry ); - - - DEBTRACE("HEXABLOCKGUI::test_association fin"); -} - -//clear all used dialogs by the current model -void HEXABLOCKGUI::clearDialogs() -{ - std::set::const_iterator debut (currentModelDialogs.begin()), - fin (currentModelDialogs.end()); - for(;debut!=fin;++debut) (*debut)->clear(); - - if (_vertexAssocDiag != NULL) _vertexAssocDiag->clear(); //not a subclass of HexaBaseDialog - - currentModelDialogs.clear(); //empty the used dialogs list -} - -HexaBaseDialog* HEXABLOCKGUI::getDlgBox(VtkDocumentGraphicView* dgview) -{ - if (!gViewDlgBox.contains(dgview)) return NULL; - return gViewDlgBox[dgview]; -} - -void HEXABLOCKGUI::switchOnGraphicView(VtkDocumentGraphicView* dgview) -{ - if (dgview == NULL) return; - - switchOffGraphicView(dgview, false); //to avoid double connect - - //connect signals - connect( selectionMgr(), SIGNAL( currentSelectionChanged() ), - dgview->getPatternDataSelectionModel(), SLOT( salomeSelectionChanged() ), Qt::UniqueConnection ); - connect( dgview->getPatternDataSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); - connect( dgview->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); - connect( dgview->getPatternGeomSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); - connect( dgview->getGroupsSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); - connect( dgview->getMeshSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); - - if (currentDocGView != NULL) - { - if (currentDocGView->getViewWindow() != NULL) - dgview->setViewWindow(currentDocGView->getViewWindow()); - else - { - dgview->setViewWindow(graphicViewsHandler->createVtkWindow()); - dgview->getViewWindow()->installEventFilter(this); - } - } - dgview->getViewWindow()->setFocus(); - - showAllMenus(); - //_showDialogBox(getDlgBox(dgview)); -} - -void HEXABLOCKGUI::switchOffGraphicView(VtkDocumentGraphicView* dgview, bool saveCurrentDlg) -{ - if (dgview == NULL) return; + if (dgview == NULL) return; //disconnect signals disconnect( selectionMgr(), SIGNAL( currentSelectionChanged() ), @@ -2360,7 +1927,7 @@ void HEXABLOCKGUI::switchModel(VtkDocumentGraphicView* dgview) { DEBTRACE("HEXABLOCKGUI::switchModel " << dgview); - if (dgview == NULL /*|| dgview == currentDocGView*/ ) //Need to switch? + if (dgview == NULL) { MESSAGE("HEXABLOCKGUI::switchModel : no need to switch!"); return; @@ -2377,7 +1944,6 @@ void HEXABLOCKGUI::switchModel(VtkDocumentGraphicView* dgview) //clear the dialogs used by the current model so they can be used by the new model if (currentDocGView != dgview) clearDialogs(); - _patternDataTreeView->setModel(dgview->getPatternDataModel()); _patternBuilderTreeView->setModel(dgview->getPatternBuilderModel()); _patternGeomTreeView->setModel(dgview->getPatternGeomModel()); @@ -2385,7 +1951,7 @@ void HEXABLOCKGUI::switchModel(VtkDocumentGraphicView* dgview) _meshTreeView->setModel(dgview->getMeshModel()); _patternDataTreeView->setSelectionModel(dgview->getPatternDataSelectionModel()); - _patternDataTreeView->setEditTriggers(/*QAbstractItemView::EditKeyPressed*/QAbstractItemView::AllEditTriggers /*QAbstractItemView::NoEditTriggers*/); + _patternDataTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers); _patternBuilderTreeView->setSelectionModel(dgview->getPatternBuilderSelectionModel()); _patternBuilderTreeView->setEditTriggers(QAbstractItemView::AllEditTriggers); @@ -2402,27 +1968,13 @@ void HEXABLOCKGUI::switchModel(VtkDocumentGraphicView* dgview) //switch on this graphic view (connect signals...) switchOnGraphicView(dgview); currentDocGView = dgview; - if (_vertexAssocDiag != NULL) - { - _vertexAssocDiag->setDocumentModel(getCurrentModel()); - _vertexAssocDiag->setPatternDataSelectionModel(currentDocGView->getPatternDataSelectionModel()); - } currentDocGView->getViewWindow()->setFocus(); showOnlyActor(); currentDocGView->getDocumentModel()->refresh(); + _dwPattern->setWindowTitle(currentDocGView->getDocumentModel()->getName()); showAllMenus(); } -// void detruitDialog() { - // currentDialog = NULL; - - // if (_sdjfgjh) delete _sdjfgjh; - - -// } - - - DocumentModel* HEXABLOCKGUI::getCurrentModel() { if (currentDocGView == NULL) return NULL; @@ -2446,21 +1998,32 @@ HEXABLOCKGUI::ViewType HEXABLOCKGUI::getActiveViewType() return UNKNOWN; } -pair HEXABLOCKGUI::newHexaDocument() +HEXABLOCKGUI* HEXABLOCKGUI::getInstance() { - // Create Document from HEXABLOCK ENGINE - // WARNING : IN HEXABLOCK component, GUI and ENGINE share the same process - HEXABLOCK_ORB::Document_ptr docIn = _hexaEngine->addDocument("default"); + SalomeApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); + if (anApp == NULL) + return NULL; - HEXA_NS::Document* doc = NULL; - QString docEntry; + return dynamic_cast(anApp->activeModule()); +} + +pair HEXABLOCKGUI::newHexaDocument() +{ + // Create Document from HEXABLOCK ENGINE + // WARNING : IN HEXABLOCK component, GUI and ENGINE share the same process + // HEXABLOCK_ORB::Document_ptr docIn = _hexaEngine->addDocument("default"); // Perime Hexa6 // looking doc impl ( c++ ) - Document_impl* dServant = DownCast( docIn ); - ASSERT( dServant ); - if ( dServant) doc = dServant->GetImpl(); + // ^Hexa6 Document_impl* dServant = DownCast( docIn ); + // ^Hexa6 ASSERT( dServant ); + // ^Hexa6 if ( dServant) + // ^Hexa6 doc = dServant->GetImpl(); + + HEXA_NS::Document* doc = hexa_root->addDocument ("default"); + QString docEntry = addDocInStudy (doc); // looking for docEntry + /* **************************************************************** if ( !CORBA::is_nil(docIn) ){ CORBA::String_var anIOR = SalomeApp_Application::orb()->object_to_string( docIn ); QString docIOR = anIOR.in(); @@ -2471,6 +2034,7 @@ pair HEXABLOCKGUI::newHexaDocument() docEntry = SO->GetID().c_str(); } } + **************************************************************** */ DEBTRACE("HEXABLOCKGUI::newHexaDocument docEntry "<desktop(); QWidget *central = aParent->centralWidget(); @@ -2544,19 +2106,8 @@ void HEXABLOCKGUI::newDocument() docs[docEntry_Doc.first] = newGraphicView; switchModel(newGraphicView); //select the corresponding document in the browser instead -// showAllMenus(); -// _dwPattern->raise(); - -// _PTR(Study) aStudy = (( SalomeApp_Study* )(getApp()->activeStudy()))->studyDS(); -// _PTR(SComponent) aComponent = aStudy->FindComponent("HEXABLOCK"); -// SalomeApp_DataModel::updateTree (aComponent, HEXABLOCKGUI::activeStudy()); getApp()->updateObjectBrowser(); showAllMenus(); -// jepeux = true; -// for (double i=0; i < 10000000000000000; ++i); - -// MESSAGE("===== NEW DOCUMENT: j'ai fini!"); - } @@ -2589,43 +2140,34 @@ void HEXABLOCKGUI::loadDocument( const QString &inFile ) } else selectedFile = inFile; - if (! selectedFile.isEmpty()) + if (selectedFile.isEmpty()) + return; + + //we create a new document if necessary + if (currentDocGView == NULL) + //Need a new document + newDocument(); + else if (currentDocGView->getViewWindow() == NULL) //there's a document without a view { - //we create a new document if necessary - if (currentDocGView == NULL) - //Need a new document - newDocument(); - else if (currentDocGView->getViewWindow() == NULL) //there's a document without a view - { - currentDocGView->setViewWindow(graphicViewsHandler->createVtkWindow()); - currentDocGView->getViewWindow()->installEventFilter(this); - } + currentDocGView->setViewWindow(graphicViewsHandler->createVtkWindow()); + currentDocGView->getViewWindow()->installEventFilter(this); + } - if (!currentDocGView->isEmpty()) - //we can only have one document for a graphic view - newDocument(); + if (!currentDocGView->isEmpty()) + //we can only have one document for a graphic view + newDocument(); - //we load the selected file in the current graphic view - currentDocGView->loadDocument(selectedFile); - DocumentModel* currentModel = getCurrentModel(); - renameObject( currentModel->documentEntry(), currentModel->getName() ); + //we load the selected file in the current graphic view + currentDocGView->loadDocument(selectedFile); + DocumentModel* currentModel = getCurrentModel(); + renameObject( currentModel->documentEntry(), currentModel->getName() ); -// _PTR(Study) aStudy = (( SalomeApp_Study* )(getApp()->activeStudy()))->studyDS(); -// _PTR(SComponent) aComponent = aStudy->FindComponent("HEXABLOCK"); -// SalomeApp_DataModel::updateTree (aComponent, HEXABLOCKGUI::activeStudy()); - getApp()->updateObjectBrowser(); - } showOnlyActor(); } void HEXABLOCKGUI::saveDocument() { QMainWindow *aParent = application()->desktop(); -// QString anInitialPath = ""; -// if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() ) -// anInitialPath = QDir::currentPath(); - // QString aMeshName = anIO->getName(); - QString aDocName = "document", aFilename; QStringList filter; @@ -2658,19 +2200,7 @@ void HEXABLOCKGUI::saveDocument() void HEXABLOCKGUI::slot_modelChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight) { - //std::cout << "HHHHHHHHHHHHHHHHHH Model changed." << std::endl; - //std::cout << "HHHHHHHHHHHHHHHHHH slot_modelChanged topLeft -> " << topLeft.data().toString().toStdString()<" << bottomRight.data().toString().toStdString()<openPersistentEditor( topLeft ); - - // // Make the combo boxes always displayed. - // for ( int i = 0; i < getCurrentModel()->rowCount(); ++i ) - // { - // QModelIndex ind = getCurrentModel()->index(i); - // _patternDataTreeView->openPersistentEditor( ind ); - // std::cout << "ind" << ind.data() << std::endl; - // } } void HEXABLOCKGUI::_showDialogBox( HexaBaseDialog* diag ) @@ -2694,7 +2224,8 @@ void HEXABLOCKGUI::_showDialogBox( HexaBaseDialog* diag ) else diag->debugEdgeAssoc = false; - if (diag == _quadAssocDiag || diag == _edgeAssocDiag || diag == _addShapeDiag) + if (diag == _vertexAssocDiag || diag == _edgeAssocDiag || + diag == _quadAssocDiag || diag == _addShapeDiag) assocInProgress = true; else assocInProgress = false; @@ -2703,8 +2234,7 @@ void HEXABLOCKGUI::_showDialogBox( HexaBaseDialog* diag ) diag->resetSizeAndShow(_dwInputPanel); //clear the current selections - if (HEXABLOCKGUI::selectionMgr() != NULL) - HEXABLOCKGUI::selectionMgr()->clearSelected(); + selectionMgr()->clearSelected(); currentDialog = diag; diag->setFocus(); @@ -2959,59 +2489,27 @@ void HEXABLOCKGUI::quadRevolution() // NEW HEXA3 } -// void HEXABLOCKGUI::assocVertex() -// { -// if ( !_vertexAssocDiag ){ -// _vertexAssocDiag = new VertexAssocDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE); -// } -// _showDialogBox( vertexAssocDiag ); -// } - - void HEXABLOCKGUI::assocVertex() { - if (!_dwInputPanel) return; - QWidget* d = dynamic_cast(_dwInputPanel->parent()); - - VtkDocumentGraphicView* currentDGView = getCurrentVtkGraphicView(); - if (currentDGView == NULL) return; - - if ( !_vertexAssocDiag ){ - _vertexAssocDiag = new VertexAssocDialog( NULL, d ); - if (!_vertexAssocDiag) return; - } - _vertexAssocDiag->setDocumentModel(getCurrentModel()); - _vertexAssocDiag->setPatternDataSelectionModel(currentDGView->getPatternDataSelectionModel()); - - //close current widget - if (_treeViewDelegate != NULL) _treeViewDelegate->closeDialog(); - if (_dwInputPanel->widget()) _dwInputPanel->widget()->close(); - - //add the vertex assoc dialog in the dockwidget - if ( !_dwInputPanel->isVisible() ) _dwInputPanel->setVisible(true); - _dwInputPanel->setWidget(_vertexAssocDiag); - _dwInputPanel->setWindowTitle(_vertexAssocDiag->windowTitle()); - _vertexAssocDiag->adjustSize(); - assocInProgress = true; - _vertexAssocDiag->show(); + if (!_dwInputPanel) return; + QWidget* d = dynamic_cast(_dwInputPanel->parent()); + if ( !_vertexAssocDiag ) + _vertexAssocDiag = new VertexAssocDialog( d /*_dwInputPanel*/); + _showDialogBox( _vertexAssocDiag ); } - void HEXABLOCKGUI::assocEdge() { - if ( !_edgeAssocDiag ){ + if ( !_edgeAssocDiag ) _edgeAssocDiag = new EdgeAssocDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE); - // _edgeAssocDiag->setGeomEngine( _geomEngine ); - } _showDialogBox( _edgeAssocDiag ); } void HEXABLOCKGUI::assocQuad() { - if ( !_quadAssocDiag ){ + if ( !_quadAssocDiag ) _quadAssocDiag = new QuadAssocDialog(_dwInputPanel, HexaBaseDialog::NEW_MODE); - } _showDialogBox( _quadAssocDiag ); } @@ -3130,7 +2628,7 @@ void HEXABLOCKGUI::removeLaw() } if (!nbLawsRemoved) SUIT_MessageBox::information( 0, tr( "CANNOT REMOVE LAW" ), - tr( "No law selected!" ) ); + tr( "No law selected!" ) ); } @@ -3143,7 +2641,6 @@ void HEXABLOCKGUI::setPropagation() _showDialogBox( _propagationDiag ); } - // Dialog box to compute a mesh from a document // -------------------------------------------- void HEXABLOCKGUI::computeMesh() @@ -3194,7 +2691,6 @@ void HEXABLOCKGUI::clearAllAssociations() VtkDocumentGraphicView* currentDGView = getCurrentVtkGraphicView(); if (currentDGView == NULL) return; - int currentChildIndex = 0; QModelIndex currentIndex = currentDGView->getPatternDataModel()->mapToSource(_patternDataTreeView->currentIndex()); if (!currentIndex.isValid()) return; QVariant currentAssocVariant; @@ -3234,19 +2730,6 @@ void HEXABLOCKGUI::clearAllAssociations() DocumentModel* docModel = getCurrentModel(); if (docModel == NULL) return; docModel->clearAssociation(hexaType); - -// QModelIndex currentChild = currentIndex.child(currentChildIndex++, 0); -// while( currentChild.isValid() ) { -// -// currentAssocVariant = currentChild.data( HEXA_ASSOC_ENTRY_ROLE ); -// currentAssocEntry = currentChild.data( HEXA_ASSOC_ENTRY_ROLE ).toString(); -// if ( currentAssocVariant.isValid() && !currentAssocEntry.isEmpty() ) -// getCurrentModel()->clearEltAssociations(currentChild); -// -// currentChild = currentChild.sibling(currentChildIndex++, 0); -// } - - //SUIT_MessageBox::information( 0, tr( "HEXA_INFO" ), tr( "ASSOCIATION CLEARED" ) ); } void HEXABLOCKGUI::showAssociations() @@ -3270,7 +2753,8 @@ void HEXABLOCKGUI::showAssociations() currentChild = currentChild.sibling(currentChildIndex++, 0); } - currentDGView->getPatternDataSelectionModel()->highlightEltsWithAssocs(elts); + currentDocGView->highlight(elts); + currentOccGView->highlight(elts, false); } @@ -3285,36 +2769,29 @@ LightApp_SelectionMgr* HEXABLOCKGUI::selectionMgr() bool HEXABLOCKGUI::eventFilter(QObject *obj, QEvent *event) { - if ( currentDialog == NULL ) return false; + if ( event->type() == QEvent::Enter ) + { // *** ENTER EVENT - if ( event->type() == QEvent::Enter ){ // ENTER EVENT + if (currentDialog == NULL || !currentDialog->isVisible()) + return QObject::eventFilter(obj, event); - // The window acquire the focus when the cursor enter + // ** The window acquire the focus when the cursor enter - //OCC - window enter + //OCC - window enter OCCViewer_ViewWindow* occWindow = dynamic_cast(obj); if ( occWindow != NULL) + currentDialog->onWindowActivated(occWindow->getViewManager()); + else + //VTK - window enter { - if (!occWindow->hasFocus()) occWindow->setFocus(); - if (currentDialog != NULL && !currentDialog->isHidden()) - currentDialog->onWindowActivated(occWindow->getViewManager()); - } - - //VTK - SVTK_ViewWindow* vtkWindow = dynamic_cast(obj); - if ( vtkWindow != NULL) - { - if (!vtkWindow->hasFocus()) vtkWindow->setFocus(); - if (currentDialog != NULL && !currentDialog->isHidden()) + SVTK_ViewWindow* vtkWindow = dynamic_cast(obj); + if ( vtkWindow != NULL) currentDialog->onWindowActivated(vtkWindow->getViewManager()); } - - //Don't pass the signal - return true; } - else - //standard event processing - return QObject::eventFilter(obj, event); + + //standard event processing + return QObject::eventFilter(obj, event); } QStringList HEXABLOCKGUI::getQuickDirList() @@ -3328,149 +2805,315 @@ QStringList HEXABLOCKGUI::getQuickDirList() } - // --- Export the module extern "C" { -HEXABLOCKGUI_EXPORT CAM_Module* createModule() - { - return new HEXABLOCKGUI(); - } + HEXABLOCKGUI_EXPORT CAM_Module* createModule() + { + return new HEXABLOCKGUI(); + } -HEXABLOCKGUI_EXPORT char* getModuleVersion() - { - return (char*)HEXABLOCK_VERSION_STR; - } + HEXABLOCKGUI_EXPORT char* getModuleVersion() + { + return (char*)HEXABLOCK_VERSION_STR; + } } -// void HEXABLOCKGUI::newMesh( const std::string& meshName, -// int dim, -// const std::string& container ) -// { -// SalomeApp_Application* app = getApp(); -// int activeStudyId = app->activeStudy()->id(); -// -// if ( CORBA::is_nil(_hexaEngine) ) _hexaEngine = InitHEXABLOCKGen( app ); -// if ( CORBA::is_nil(_smeshEngine)) _smeshEngine = InitSMESHGen( app, container ); -// if ( CORBA::is_nil(_geomEngine) ) _geomEngine = InitGEOMGen( app, container ); -// -// std::cout << "_hexaEngine =>" << _hexaEngine << std::endl; -// std::cout << "_smeshEngine =>" << _smeshEngine << std::endl; -// std::cout << "_geomEngine =>" << _geomEngine << std::endl; -// -// HEXA_NS::Document* docImpl = getCurrentModel()->documentImpl(); -// std::cout << "docImpl =>" << docImpl << std::endl; -// std::cout << "docImpl->getFile() =>" << docImpl->getFile() << std::endl; -// HEXABLOCK_ORB::Document_var anDocObj= _hexaEngine->loadDocument( docImpl->getFile() ); -// std::cout << "anDocObj =>" << anDocObj << std::endl; -// -// -// GEOM::GEOM_I3DPrimOperations_var anGeomOper = _geomEngine->GetI3DPrimOperations( activeStudyId ); -// if ( CORBA::is_nil(anGeomOper) ) return; //!anGeomOper->_is_nil() ) { -// std::cout << "anGeomOper =>" << anGeomOper << std::endl; -// GEOM::GEOM_Object_var anGeomObj = anGeomOper->MakeBoxDXDYDZ( 5., 5., 5. ); -// std::cout << "anGeomObj =>" << anGeomObj << std::endl; -// -// -// SALOMEDS::SObject _geomEngine->AddInStudy (in SALOMEDS::Study theStudy, -// in GEOM_Object theObject, -// in string theName, -// -// -// -// // void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object ) -// // { -// SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); -// if ( study && !CORBA::is_nil( object ) ) { -// _PTR(Study) studyDS = study->studyDS(); -// QString entry = GetEntry( object ); -// GEOM::GEOM_Object_var father = object->GetMainShape(); -// QString fatherEntry = GetEntry( father ); -// if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) { -// QString name = GetName( object ); -// GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ), -// object, name.toLatin1().data(), father.in() ); -// } -// } -// } -// -// -// // geompy = smesh.geompy -// // #fkl: shape = doc.getShape() -// // shape = geompy.MakeBox(0, 0, 0, 1, 1, 1) -// // geompy.addToStudy(shape, name) -// // -// // component = salome.lcc.FindOrLoadComponent(container, "SMESH") -// // component.init_smesh(salome.myStudy, geompy.geom) -// // mesh = component.Mesh(shape, name) -// // -// // so = "libHexaBlockEngine.so" -// // -// // algo = smesh.SMESH._objref_SMESH_Gen.CreateHypothesis(component, "HEXABLOCK_3D", so) -// SMESH::SMESH_Hypothesis_var algo = _smeshEngine->CreateHypothesis( "HEXABLOCK_3D", "libHexaBlockEngine.so"); -// // raises ( SALOME::SALOME_Exception ); -// // mesh.mesh.AddHypothesis(shape, algo) -// // -// // hypo = smesh.SMESH._objref_SMESH_Gen.CreateHypothesis(component, "HEXABLOCK_Parameters", so) -// //HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis_var -// SMESH::SMESH_Hypothesis_var hypo = _smeshEngine->CreateHypothesis( "HEXABLOCK_Parameters", "libHexaBlockEngine.so"); -// -// HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis_var hexHypo = HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis::_narrow(hypo); -// ASSERT(!CORBA::is_nil(hexHypo)); -// -// // mesh.mesh.AddHypothesis(shape, hypo) -// // -// // hexHypo->SetDocument(anDocObj); -// // hexHypo->SetDimension(dim); -// // -// // mesh.Compute() -// // -// // return mesh -// -// } -// -// -// -// void newMesh( const std::string& meshName, int dim )// const std::string& container ) -// { -// -// // _smeshEngine.init_smesh(salome.myStudy, geompy.geom) -// SMESH::SMESH_var mesh = _smeshEngine->Mesh(shape, name); -// SMESH::SMESH_Hypothesis_var algo = _smeshEngine->CreateHypothesis( "HEXABLOCK_3D", "libHexaBlockEngine.so"); -// SMESH::SMESH_Hypothesis_var hypo = _smeshEngine->CreateHypothesis( "HEXABLOCK_Parameters", "libHexaBlockEngine.so"); -// HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis_var hexHypo = HEXABLOCKPlugin::HEXABLOCKPlugin_Hypothesis::_narrow(hypo); -// hexHypo->SetDocument(anDocObj); -// hexHypo->SetDimension(dim); -// } - -/* -SMESH::SMESH_Gen_var SMESHGUI::GetSMESHGen() -{ - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); //Document OCAF de l'etude active - if ( CORBA::is_nil( myComponentSMESH ) ) - { - SMESHGUI aGUI; //SRN BugID: IPAL9186: Create an instance of SMESHGUI to initialize myComponentSMESH - if ( aStudy ) - aGUI.myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy()); - return aGUI.myComponentSMESH; - } - if ( aStudy ) - myComponentSMESH->SetCurrentStudy(_CAST(Study,aStudy)->GetStudy()); - return myComponentSMESH; -}*/ - - -// try { -// // throw SALOME_Exception(LOCALIZED("assocVertex")); -// } catch ( SALOME::SALOME_Exception& exc ){ -// INFOS("Following exception was cought:\n\t"<invisibleRootItem(); + // QStandardItem *myItem = new QStandardItem("MyItem"); + // parentItem->appendRow(myItem); + // // ---------- + // QModelIndex v0 = getCurrentModel()->addVertex(0., 0., 0.); + // QModelIndex v1 = getCurrentModel()->addVertex(5., 0., 0.); + // QModelIndex v2 = getCurrentModel()->addVertex(5., 5., 0.); + // QModelIndex v3 = getCurrentModel()->addVertex(0., 5., 0.); + // QModelIndex v4 = getCurrentModel()->addVertex(0., 0., 5.); + // QModelIndex v5 = getCurrentModel()->addVertex(5., 0., 5.); + // QModelIndex v6 = getCurrentModel()->addVertex(5., 5., 5.); + // QModelIndex v7 = getCurrentModel()->addVertex(0., 5., 5.); + // // + // // + // QModelIndex q0 = getCurrentModel()->addQuadVertices( v0, v1, v2, v3 ); + // QModelIndex q1 = getCurrentModel()->addQuadVertices( v4, v5, v6, v7 ); + // QModelIndex q2 = getCurrentModel()->addQuadVertices( v0, v3, v7, v4 ); + // QModelIndex q3 = getCurrentModel()->addQuadVertices( v1, v2, v6, v5 ); + // QModelIndex q4 = getCurrentModel()->addQuadVertices( v0, v1, v5, v4 ); + // QModelIndex q5 = getCurrentModel()->addQuadVertices( v3, v2, v6, v7 ); + // + // QModelIndex h0 = getCurrentModel()->addHexaQuad( q0, q1, q2, q3, q4, q5 ); + // QModelIndex vx = getCurrentModel()->addVector(1., 0., 0.); + // QModelIndex vy = getCurrentModel()->addVector(0., 1., 0.); + // QModelIndex vz = getCurrentModel()->addVector(0., 0., 1.); + // + + + + // // QModelIndex orig1 = getCurrentModel()->addVertex (0, 0,0); + // // QModelIndex orig2 = getCurrentModel()->addVertex (50,0,0); + // // QModelIndex vz = getCurrentModel()->addVector (0,0,1); + // // QModelIndex vx = getCurrentModel()->addVector (1,0,0); + // // + // // int nr = 4; + // // int nri = 3; + // // int nre = nr; + // // int na = 9; + // // int nl = 5; + // // + // // QModelIndex cyl = getCurrentModel()->addCylinder (orig1, vz, nr, nl); + // // QModelIndex pipe = getCurrentModel()->addPipe (orig2, vz, nri, nre, nl); + // // + // // getCurrentModel()->makeCylinder (cyl, vx, nr, na, nl); + // // getCurrentModel()->makePipe(pipe, vx, nr, na, nl); + + + + // newMesh( "toto", 3, "FactoryServer"); + // newMesh +} + +void HEXABLOCKGUI::test_make_cart_grid() +{ + QModelIndex orig1 = getCurrentModel()->addVertex( 0, 0, 0); + QModelIndex orig2 = getCurrentModel()->addVertex( 10, 0, 0); + QModelIndex orig3 = getCurrentModel()->addVertex( 0, 10, 0); + QModelIndex orig4 = getCurrentModel()->addVertex( 10, 10, 0); + QModelIndex orig5 = getCurrentModel()->addVertex( 0, 20, 0); + QModelIndex orig6 = getCurrentModel()->addVertex( 10, 20, 0); + + QModelIndex vz = getCurrentModel()->addVector(0, 0, 1); + QModelIndex vx = getCurrentModel()->addVector(1, 0, 0); + + //int dr = 1; + //int dl = 1; + //int nr = 2; + //int nl = 3; + + // QModelIndex c1 = getCurrentModel()->makeCylindrical(orig1, vx, vz, dr, 360, dl, nr, 4, nl, true); + // QModelIndex c2 = getCurrentModel()->makeCylindrical(orig2, vx, vz, dr, 360, dl, nr, 8, nl, true); + // QModelIndex c3 = getCurrentModel()->makeCylindrical(orig3, vx, vz, dr, 270, dl, nr, 8, nl, true); + // QModelIndex c4 = getCurrentModel()->makeCylindrical(orig4, vx, vz, dr, 270, dl, nr, 7, nl, true); + // QModelIndex c5 = getCurrentModel()->makeCylindrical(orig5, vx, vz, dr, 360, dl, nr, 5, nl, true); + // QModelIndex c6 = getCurrentModel()->makeCylindrical(orig6, vx, vz, dr, 360, dl, nr, 6, nl, true); + +} + + +void HEXABLOCKGUI::test_make_elmts_transform() +{ + + int size_x = 1; + int size_y = 1; + int size_z = 2; + + QModelIndex orig = getCurrentModel()->addVertex(0, 0, 0); + QModelIndex dirVr = getCurrentModel()->addVector(1, 1, 1); + + //obsolete + QModelIndex grid = getCurrentModel()->makeCartesian(orig, dirVr, size_x, size_y, size_z);//, 0, 0, 0); + // orig.setScalar(2); + + // file_name = os.path.join(os.environ['TMP'], 'transfo0.vtk') + // getCurrentModel()->saveVtk(file_name) + + QModelIndex devant = getCurrentModel()->addVector(5, 0, 0); + QModelIndex grid2 = getCurrentModel()->makeTranslation(grid, devant); + + // file_name = os.path.join(os.environ['TMP'], 'transfo_translation.vtk') + // getCurrentModel()->saveVtk(file_name) + + QModelIndex grid4 = getCurrentModel()->makeRotation(grid2, orig, dirVr, 45); + + + // file_name = os.path.join(os.environ['TMP'], 'transfo_rotation.vtk'); + // getCurrentModel()->saveVtk(file_name); + + + // print "...test make elements by transforming elements OK" +} +// =============================================================== addDocInSudy +QString HEXABLOCKGUI::addDocInStudy (HEXA_NS::Document* document) +{ + QString docEntry; + + if (document == NULL) + return docEntry; + + QString docName = document->getName (); + + SalomeApp_Study* app_study = HEXABLOCKGUI::activeStudy(); + if (app_study == NULL) + return docEntry; + + _PTR(Study) study = app_study->studyDS(); + SALOMEDS::Study_var ds_study = ClientStudyToStudy (study); + SALOMEDS::StudyBuilder_var aBuilder (ds_study->NewBuilder()); + QString entry = app_study->centry("HEXABLOCK"); + SALOMEDS::SObject_var aFatherSO = ds_study->FindObjectID( qPrintable(entry) ); + if (aFatherSO->_is_nil()) + return docEntry; + + SALOMEDS::SObject_var aSO = aBuilder->NewObject(aFatherSO); + if (aSO->_is_nil()) + return docEntry; + aSO->SetAttrString("AttributeName", docName.toStdString().c_str()); + docEntry = aSO->GetID(); //the entry of the published object + + return docEntry; +} + +//--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8 + +void HEXABLOCKGUI::test() +{ + DEBTRACE("HEXABLOCKGUI::test"); + VtkDocumentGraphicView* currentDGView = getCurrentVtkGraphicView(); + if (currentDGView == NULL) return; + currentDGView->update(); + +} + +void HEXABLOCKGUI::test_association() +{ + DEBTRACE("HEXABLOCKGUI::test_association"); + newDocument(); + + QModelIndex v0, v1, v2, v3, e0, e1, q0; + + DocumentModel::GeomObj v0Assoc, v1Assoc, v2Assoc, v3Assoc; + DocumentModel::GeomObj e0AssocA, e1AssocA, e1AssocB, e1AssocC; + DocumentModel::GeomObj q0AssocA, q0AssocB; + + DocumentModel::GeomObj v0Assoc_test, v1Assoc_test, v2Assoc_test, v3Assoc_test; + QList e1Assocs_test; + DocumentModel::GeomObj q0Assoc_test; + + v0 = getCurrentModel()->addVertex(0, 0, 0); + v1 = getCurrentModel()->addVertex(1, 0, 0); + v2 = getCurrentModel()->addVertex(1, 1, 0); + v3 = getCurrentModel()->addVertex(0, 1, 0); + e0 = getCurrentModel()->addEdgeVertices(v0, v1); + e1 = getCurrentModel()->addEdgeVertices(v1, v2); + q0 = getCurrentModel()->addQuadVertices( v0, v1, v2, v3 ); + + + // >>> face3.GetEntry()'0:1:4' + // >>> e1.GetEntry()'0:1:8' + // >>> e2.GetEntry()'0:1:9' + // >>> e3.GetEntry()'0:1:10' + // >>> e4.GetEntry()'0:1:11' + // >>> v1.GetEntry()'0:1:12' + // >>> v2.GetEntry()'0:1:13' + // >>> v3.GetEntry()'0:1:14' + // >>> v4.GetEntry()'0:1:15' + + + // v0Assoc.name = "geomV0"; + // v0Assoc.entry = "0:1:1:1:3:6";//"0:1:12"; + // v0Assoc.brep = "brepV0"; + // v1Assoc.name = "geomV1"; + // v1Assoc.entry = "0:1:1:1:3:7";//"0:1:13"; + // v1Assoc.brep = "brepV1"; + // v2Assoc.name = "geomV2"; + // v2Assoc.entry = "0:1:1:1:3:8";//"0:1:14"; + // v2Assoc.brep = "brepV2"; + // v3Assoc.name = "geomV3"; + // v3Assoc.entry = "0:1:1:1:3:9";//"0:1:15"; + // v3Assoc.brep = "brepV3"; + // + // + // + // e0AssocA.name = "geomE0a"; + // e0AssocA.entry = "0:1:1:1:3:5";//"0:1:8"; + // e0AssocA.brep = "brepE0a"; + // e0AssocA.start = 0.10; + // e0AssocA.end = 0.95; + // + // + // + // e1AssocA.name = "geomE1a"; + // e1AssocA.entry = "0:1:1:1:3:2";//"0:1:8"; + // e1AssocA.brep = "brepE1a"; + // e1AssocA.start = 0.12; + // e1AssocA.end = 0.89; + // e1AssocB.name = "geomE1b"; + // e1AssocB.entry = "0:1:1:1:3:3";//"0:1:9"; + // e1AssocB.brep = "brepE1b"; + // e1AssocB.start = 0.20; + // e1AssocB.end = 0.80; + // e1AssocC.name = "geomE1c"; + // e1AssocC.entry = "0:1:1:1:3:4";//"0:1:10"; + // e1AssocC.brep = "brepE1c"; + // e1AssocC.start = 0.16; + // e1AssocC.end = 0.96; + // + // q0AssocA.name = "geomQuad"; + // q0AssocA.entry = "0:1:1:1:3"; + // q0AssocA.brep = "brepq0"; + // + // q0AssocB.name = "geomQuad"; + // q0AssocB.entry = "0:1:1:1:4"; + // q0AssocB.brep = "brepq0"; + // + // getCurrentModel()->addAssociation( v0, v0Assoc ); + // getCurrentModel()->addAssociation( v1, v1Assoc ); + // getCurrentModel()->addAssociation( v2, v2Assoc ); + // getCurrentModel()->addAssociation( v3, v3Assoc ); + // + // + // getCurrentModel()->addAssociation( e0, e0AssocA ); + // + // getCurrentModel()->addAssociation( e1, e1AssocA ); + // getCurrentModel()->addAssociation( e1, e1AssocB ); + // getCurrentModel()->addAssociation( e1, e1AssocC ); + // + // getCurrentModel()->addAssociation( q0, q0AssocA ); + // getCurrentModel()->addAssociation( q0, q0AssocB ); + + + + + + // v0Assoc_test = getCurrentModel()->getAssociations( v0 )[0]; + // v1Assoc_test = getCurrentModel()->getAssociations( v1 )[0]; + // v2Assoc_test = getCurrentModel()->getAssociations( v2 )[0]; + // v3Assoc_test = getCurrentModel()->getAssociations( v3 )[0]; + // ASSERT( v0Assoc.name == v0Assoc_test.name ); + // ASSERT( v1Assoc.name == v1Assoc_test.name ); + // ASSERT( v2Assoc.name == v2Assoc_test.name ); + // ASSERT( v3Assoc.name == v3Assoc_test.name ); + // ASSERT( v0Assoc.entry == v0Assoc_test.entry ); + // ASSERT( v1Assoc.entry == v1Assoc_test.entry ); + // ASSERT( v2Assoc.entry == v2Assoc_test.entry ); + // ASSERT( v3Assoc.entry == v3Assoc_test.entry ); + // + // + // e1Assocs_test = getCurrentModel()->getAssociations( e1 ); + // ASSERT( e1Assocs_test[0].name == e1AssocA.name ); + // ASSERT( e1Assocs_test[1].name == e1AssocB.name ); + // ASSERT( e1Assocs_test[2].name == e1AssocC.name ); + // ASSERT( e1Assocs_test[0].entry == e1AssocA.entry ); + // ASSERT( e1Assocs_test[1].entry == e1AssocB.entry ); + // ASSERT( e1Assocs_test[2].entry == e1AssocC.entry ); + // ASSERT( e1Assocs_test[0].start == e1AssocA.start ); + // ASSERT( e1Assocs_test[1].start == e1AssocB.start ); + // ASSERT( e1Assocs_test[2].start == e1AssocC.start ); + // ASSERT( e1Assocs_test[0].end == e1AssocA.end ); + // ASSERT( e1Assocs_test[1].end == e1AssocB.end ); + // ASSERT( e1Assocs_test[2].end == e1AssocC.end ); + // + // q0Assoc_test = getCurrentModel()->getAssociations( q0 )[0]; + // ASSERT( q0Assoc_test.name == q0Assoc.name ); + // ASSERT( q0Assoc_test.entry == q0Assoc.entry ); + + + DEBTRACE("HEXABLOCKGUI::test_association fin"); +} diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx index 2f77181..6e513cb 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI.hxx @@ -34,29 +34,18 @@ #include #include #include -// #include #include #include - +#include #include - -// #include "MyBasicGUI_PointDlg.hxx" -// #include "Resource.hxx" #include "HEXABLOCKGUI_Resource.hxx" - -#include "GEOMGUI_OCCSelector.h" - +#include "HEXABLOCKGUI_OCCSelector.h" #include "hexa_base.hxx" - - -#include CORBA_CLIENT_HEADER(HEXABLOCK_Gen) -// #include CORBA_CLIENT_HEADER(GEOM_Gen) -// #include CORBA_CLIENT_HEADER(SMESH_Gen) - +// #include CORBA_CLIENT_HEADER(HEXABLOCK_Gen) // Abu Juin 2013 namespace HEXABLOCK { @@ -122,14 +111,6 @@ class SUIT_ViewWindow; class SVTK_ViewWindow; class OCCViewer_ViewWindow; class LightApp_VTKSelector; -class MyGEOMBase_Helper; - -// // SALOME KERNEL includes -// #include -// #include -// #include -// #include -// #include class HEXABLOCKGUI : public SalomeApp_Module @@ -150,32 +131,27 @@ public: static SalomeApp_Study* activeStudy(); - static HEXABLOCK_ORB::HEXABLOCK_Gen_ptr InitHEXABLOCKGen( SalomeApp_Application* ); -// static SMESH::SMESH_Gen_ptr InitSMESHGen( SalomeApp_Application* app, const std::string& container = "FactoryServer" ); - static GEOM::GEOM_Gen_ptr InitGEOMGen( SalomeApp_Application* app, const std::string& container = "FactoryServer" ); - + // static HEXABLOCK_ORB::HEXABLOCK_Gen_ptr InitHEXABLOCKGen( SalomeApp_Application* ); static LightApp_SelectionMgr* selectionMgr(); + static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy); + static ViewType getActiveViewType(); + static HEXABLOCKGUI* getInstance(); //add an object in the study - static QString addInStudy(QString& fileName); - + void addInStudy(QMap& topo_shapes, + QMap& docShapesEntry, + QMap& docShapesName); -// static SVTK_ViewWindow* currentVtkView; static HEXABLOCK::GUI::VtkDocumentGraphicView* currentDocGView; static HEXABLOCK::GUI::OccGraphicView* currentOccGView; - static MyGEOMBase_Helper* geomBaseHelper; static bool assocInProgress; static SalomeApp_Application* myApplication; - static GEOMGUI_OCCSelector* currentOccSelector; - - //HEXABLOCK::GUI::DocumentModel* virtual void initialize( CAM_Application* app); virtual bool renameAllowed( const QString& ) const; virtual bool renameObject( const QString& entry, const QString& name); virtual void windows( QMap& theMap) const; -// virtual LightApp_Displayer* displayer(); virtual QString engineIOR() const; virtual void viewManagers(QStringList& list) const; @@ -197,22 +173,22 @@ public: void showAllMenus(); void updateSelectors(); -// void showBaseMenus(bool show); -// void showEditionMenus(bool show); -// void showExecMenus(bool show); -// void showCommonMenus(bool show); - void switchModel(HEXABLOCK::GUI::VtkDocumentGraphicView* dgview); void switchOnGraphicView(HEXABLOCK::GUI::VtkDocumentGraphicView* dgview); void switchOffGraphicView(HEXABLOCK::GUI::VtkDocumentGraphicView* dgview, bool saveCurrentDlg = true); void showDockWidgets(bool isVisible); - HEXABLOCK::GUI::VtkDocumentGraphicView* getCurrentVtkGraphicView(); - HEXABLOCK::GUI::VtkDocumentGraphicView* getDocument(SalomeApp_DataObject* studyObject); + HEXABLOCK::GUI::VtkDocumentGraphicView* getCurrentVtkGraphicView() const { return currentDocGView; } + HEXABLOCK::GUI::VtkDocumentGraphicView* getOrCreateDocument(SalomeApp_DataObject* studyObject); + HEXABLOCK::GUI::VtkDocumentGraphicView* getDocGViewByEntry(const QString& entry) const + { + return ( (docs.contains(entry) ? docs[entry] : NULL ) ); + } HEXABLOCK::GUI::DocumentModel* getCurrentModel(); HEXABLOCK::GUI::HexaBaseDialog* getDlgBox(HEXABLOCK::GUI::VtkDocumentGraphicView* view); - static ViewType getActiveViewType(); + QTreeView* getPatternDataTreeView() const { return _patternDataTreeView; } + QTreeView* getPatternGeomTreeView() const { return _patternGeomTreeView; } public slots: bool deactivateModule( SUIT_Study* theStudy); @@ -224,15 +200,13 @@ public slots: void showAssociationMenus(bool show); void showGroupsMenus(bool show); void showMeshMenus(bool show); - + protected slots: void onWindowActivated( SUIT_ViewWindow* svw); void onWindowClosed( SUIT_ViewWindow* svw); -// void OnMouseMove( SUIT_ViewWindow*, QMouseEvent* ); virtual void onViewManagerAdded( SUIT_ViewManager* ); virtual void onViewManagerRemoved( SUIT_ViewManager* ); -// void onTryClose(bool &isClosed, QxScene_ViewWindow* window); void onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ); void showActor(); @@ -240,21 +214,15 @@ protected slots: void showOnlyActor(); protected: -// virtual CAM_DataModel* createDataModel(); bool createSComponent(); -// virtual bool isSelectionCompatible(); virtual bool eventFilter(QObject *obj, QEvent *event); void _showDialogBox( HEXABLOCK::GUI::HexaBaseDialog* diag ); HEXABLOCK::GUI::HexaBaseDialog* currentDialog; -// bool _selectFromTree; HEXABLOCKGUI_Resource* _myresource; -// SUIT_ResourceMgr* _myresource; static int _oldStudyId; - static HEXABLOCK_ORB::HEXABLOCK_Gen_var _hexaEngine; -// static SMESH::SMESH_Gen_var _smeshEngine; - static GEOM::GEOM_Gen_var _geomEngine; + // static HEXABLOCK_ORB::HEXABLOCK_Gen_var _hexaEngine; // Hexa6 TODo private slots: void slot_modelChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); @@ -277,26 +245,20 @@ private slots: void addVector(); void addCylinder(); void addPipe(); -// void makeCartesian(); -// void makeCylindrical(); void makeGrid(); void makeCylinder(); void makePipe(); void makeCylinders(); void makePipes(); -// void makeRind(); // NEW HEXA3 void makeHemiSphere(); // NEW HEXA3 void removeHexa(); void prismQuad(); void joinQuad(); -// void mergeVertices(); -// void mergeEdges(); void merge(); void disconnectElts(); void cutEdge(); -// void makeTranslation(); void makeTransformation(); void makeSymmetry(); void performTransformation(); @@ -333,15 +295,22 @@ private slots: private: - QList myOCCSelectors; + QList myOCCSelectors; QList myVTKSelectors; QStringList getQuickDirList(); -// HEXABLOCK::GUI::DocumentGraphicView* newGraphicView(); void restoreGraphicViews(); void clearDialogs(); + SOCC_Prs* getOccPrs(HEXABLOCK::GUI::VtkDocumentGraphicView* docGView) + { + if (docGView == NULL) + return NULL; + if (!occPrs.contains(docGView)) + occPrs[docGView] = new SOCC_Prs(); + return occPrs[docGView]; + } // ------------------------------------------------------------------------------------------------- // MainWindow presentation @@ -416,7 +385,6 @@ private: QAction *_makeCylinders; QAction *_makePipes; -// QAction *_makeRind; // NEW HEXA3 QAction *_makeHemiSphere; // NEW HEXA3 @@ -458,17 +426,18 @@ private: QAction* _addShapeAct; -// QAction *_showAct; -// QAction *_showOnlyAct; -// QAction *_hideAct; + + QAction* _sep1; // tmonin + QAction* _sep2; // tmonin + QAction* _sep3; // tmonin + QAction* _sep4; // ...... tparti // ------------------------------------------------------------------------------------------------- - // Model/View implementation + // Model/View implementation // ------------------------------------------------------------------------------------------------- HEXABLOCK::GUI::AssociationsModel *_associationsModel; // sub-part of DocumentModel - // VIEW VIEW VIEW VIEW VIEW VIEW VIEW VIEW VIEW VIEW QTreeView* _patternDataTreeView; // document's pattern : 1 ( only one view ) QTreeView* _patternBuilderTreeView; // document's pattern : 1 ( only one view ) @@ -478,27 +447,27 @@ private: QTreeView* _meshTreeView; // document's mesh property: 1 ( only one view ) // DELEGATE DELEGATE DELEGATE DELEGATE DELEGATE DELEGATE DELEGATE - HEXABLOCK::GUI::DocumentDelegate *_treeViewDelegate; // specific editor for each item of the tree + HEXABLOCK::GUI::DocumentDelegate *_treeViewDelegate; // specific editor for each item of the tree HEXABLOCK::GUI::GraphicViewsHandler* graphicViewsHandler; //vtk views hanlder (create, close, ...) - // SALOME SALOME SALOME SALOME SALOME SALOME SALOME SALOME SALOME SALOME - std::map docs; // key = entry + // SALOME SALOME SALOME SALOME SALOME SALOME SALOME SALOME SALOME SALOME + QMap docs; // key = entry QMap gViewDlgBox; // key = entry + QMap occPrs; -// int _documentCnt; bool _isSaved; bool moduleActivatedOnce; QDir* loadDocLastPath; QDir* saveDocLastPath; - void testDocument(); void test_make_cart_grid(); void test_make_elmts_transform(); - + QString addDocInStudy (HEXA_NS::Document* doc); // Hexa6 + HEXA_NS::Hex* hexa_root; // Hexa6 }; #endif diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx index a9fe246..18384aa 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.cxx @@ -41,10 +41,6 @@ DocumentDelegate::DocumentDelegate(QDockWidget *dw, QObject *parent) _dw(dw), _currentEditor(NULL) { -// connect( this, SIGNAL( closeEditor(QWidget *, QAbstractItemDelegate::EndEditHint) ), -// this, SLOT( onCloseEditor(QWidget *, QAbstractItemDelegate::EndEditHint) ) ); -// connect( this, SIGNAL( commitData ( QWidget * ) ), -// this, SLOT( onCommitData ( QWidget * ) ) ); } @@ -52,7 +48,6 @@ QWidget *DocumentDelegate::createEditor( QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index ) const { - //close current editor if there's one before creating a new one if (_currentEditor != NULL) { @@ -66,7 +61,6 @@ QWidget *DocumentDelegate::createEditor( QWidget *parent, if ( !_dw->isVisible() ) _dw->setVisible(true); switch ( index.data(HEXA_TREE_ROLE).toInt() ){ -// case VERTEX_TREE : editor = new VertexDialog(_dw, HexaBaseDialog::UPDATE_MODE); break; //Modification case VERTEX_TREE : editor = new VertexDialog(_dw, HexaBaseDialog::INFO_MODE); break; case EDGE_TREE : editor = new EdgeDialog(_dw, HexaBaseDialog::INFO_MODE); break; case QUAD_TREE : editor = new QuadDialog(_dw, HexaBaseDialog::INFO_MODE); break; @@ -74,8 +68,6 @@ QWidget *DocumentDelegate::createEditor( QWidget *parent, case VECTOR_TREE : editor = new VectorDialog(_dw, HexaBaseDialog::INFO_MODE); break; case CYLINDER_TREE : editor = new CylinderDialog(_dw, HexaBaseDialog::INFO_MODE); break; case PIPE_TREE : editor = new PipeDialog(_dw, HexaBaseDialog::INFO_MODE); break; - // case ELEMENTS_TREE : break; - // case CROSSELEMENTS_TREE : break; case GROUP_TREE : editor = new GroupDialog(_dw, HexaBaseDialog::INFO_MODE/*UPDATE_MODE*/); break; case LAW_TREE : editor = new LawDialog(_dw, HexaBaseDialog::INFO_MODE); break; case PROPAGATION_TREE : editor = new PropagationDialog(_dw, HexaBaseDialog::INFO_MODE); break; @@ -89,7 +81,6 @@ QWidget *DocumentDelegate::createEditor( QWidget *parent, else _dw->close(); - _currentEditor = editor; return editor; } @@ -116,7 +107,6 @@ void DocumentDelegate::setEditorData( QWidget *editor, switch ( index.data(HEXA_TREE_ROLE).toInt() ){ case VERTEX_TREE : { -// HEXA_NS::Vertex *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Vertex* >(); HEXA_NS::Vertex *value = documentModel->getHexaPtr(index); VertexDialog *vertexEditor = static_cast(editor); vertexEditor->setValue(value); @@ -158,8 +148,6 @@ void DocumentDelegate::setEditorData( QWidget *editor, pipeEditor->setValue(value); } break; -// case ELEMENTSITEM : editor = new ElementsDialog(parent); break; -// case CROSSELEMENTSITEM : editor = new CrossElementsDialog(parent); break; case GROUP_TREE :{ HEXA_NS::Group *value = index.data( HEXA_DATA_ROLE ).value< HEXA_NS::Group* >(); GroupDialog *groupEditor = static_cast(editor); @@ -188,21 +176,7 @@ bool DocumentDelegate::editorEvent ( QEvent *event, const QStyleOptionViewItem &option, const QModelIndex &index ) { -/************************************************************ - MESSAGE("DocumentDelegate::editorEvent(){"); - MESSAGE("* item is: " << index.data().toString().toStdString()); - MESSAGE("* event is: " << event->type() ); - - Qt::ItemFlags flags = model->flags(index); - if ( flags == Qt::ItemFlags( ~Qt::ItemIsEditable ) ){ - MESSAGE("* you can select it "); - } else { - MESSAGE("* you cannot select it "); - } - - //return QItemDelegate::editorEvent ( event, model, option, index ); - *************************************************************/ - return false; + return QItemDelegate::editorEvent ( event, model, option, index ); } bool DocumentDelegate::eventFilter ( QObject * editor, QEvent * event ) diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx index 550ac70..eaeebef 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentDelegate.hxx @@ -75,10 +75,6 @@ namespace HEXABLOCK const QStyleOptionViewItem & option, const QModelIndex & index ); virtual bool eventFilter ( QObject * editor, QEvent * event ); - public slots: -// void onCloseEditor( QWidget *, QAbstractItemDelegate::EndEditHint); -// void onCommitData ( QWidget * editor ); - private: QDockWidget* _dw; // creator's container diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.cxx index 7c83de6..8405795 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.cxx @@ -17,14 +17,16 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include "HEXABLOCKGUI_SalomeTools.hxx" #include "HEXABLOCKGUI_DocumentItem.hxx" #include "HexShape.hxx" -#include "HEXABLOCKGUI_SalomeTools.hxx" + #include "HEXABLOCKGUI_DocumentModel.hxx" #include "HexAssoEdge.hxx" #include + using namespace std; using namespace HEXABLOCK::GUI; @@ -38,6 +40,8 @@ QStandardItem() if (m_DocElt != NULL) { setText(m_DocElt->getName()); + if ( m_DocElt->isAssociated() ) + setData(Qt::darkGreen, Qt::ForegroundRole); } setData( treeRole, HEXA_TREE_ROLE ); setData( entry, HEXA_DOC_ENTRY_ROLE); @@ -50,10 +54,16 @@ QStandardItem() if (m_type == VERTEXITEM) //Vertex { HEXA_NS::Vertex* vertex = (HEXA_NS::Vertex*) m_DocElt; - double assocX, assocY, assocZ; - vertex->getAssoCoord(assocX, assocY, assocZ); - entry = QString::number(assocX)+","+QString::number(assocY)+","+QString::number(assocZ); - setData( entry, HEXA_ASSOC_ENTRY_ROLE ); + HEXA_NS::VertexShape* assoc = vertex->getAssociation(); + if (assoc != NULL) + { + HEXA_NS::NewShape* mainSh = assoc->getParentShape(); + if (mainSh != NULL) + { + entry = QString(mainSh->getName())+","+QString::number(assoc->getIdent())+";"; + setData( entry, HEXA_ASSOC_ENTRY_ROLE ); + } + } } else if (m_type == EDGEITEM) { @@ -70,7 +80,7 @@ QStandardItem() geomEdge = anEdgeAssoc->getEdgeShape(); if (geomEdge == NULL) continue; mainShape = geomEdge->getParentShape(); - if (mainShape == NULL) continue; // => les generatrices ne sont pas gerees pour le moment + if (mainShape == NULL) continue; entries += QString(mainShape->getName())+","+QString::number(geomEdge->getIdent())+";"; } if ( !entries.isEmpty() ) @@ -100,33 +110,30 @@ QStandardItem() //--------------------------------------------------------------- QVariant ElementItem::data( int role ) const { - if ( role == HEXA_DATA_ROLE ){ - switch(m_type) - { - case VERTEXITEM: return QVariant::fromValue( (HEXA_NS::Vertex*)m_DocElt ); - case EDGEITEM: return QVariant::fromValue( (HEXA_NS::Edge*)m_DocElt ); - case QUADITEM: return QVariant::fromValue( (HEXA_NS::Quad*)m_DocElt ); - case HEXAITEM: return QVariant::fromValue( (HEXA_NS::Hexa*)m_DocElt ); - case VECTORITEM: return QVariant::fromValue( (HEXA_NS::Vector*)m_DocElt ); - case CYLINDERITEM: return QVariant::fromValue( (HEXA_NS::Cylinder*)m_DocElt ); - case PIPEITEM: return QVariant::fromValue( (HEXA_NS::Pipe*)m_DocElt ); - case ELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::Elements*)m_DocElt ); - case CROSSELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::CrossElements*)m_DocElt ); - case GEOMSHAPEITEM: return QVariant::fromValue( (HEXA_NS::NewShape*) m_DocElt ); - case GEOMPOINTITEM: return QVariant::fromValue( (HEXA_NS::VertexShape*) m_DocElt ); - case GEOMEDGEITEM: return QVariant::fromValue( (HEXA_NS::EdgeShape*) m_DocElt ); - case GEOMFACEITEM: return QVariant::fromValue( (HEXA_NS::FaceShape*) m_DocElt ); - default: return QVariant::fromValue( m_DocElt ); - } - } + if ( role == HEXA_DATA_ROLE ){ + switch(m_type) + { + case VERTEXITEM: return QVariant::fromValue( (HEXA_NS::Vertex*)m_DocElt ); + case EDGEITEM: return QVariant::fromValue( (HEXA_NS::Edge*)m_DocElt ); + case QUADITEM: return QVariant::fromValue( (HEXA_NS::Quad*)m_DocElt ); + case HEXAITEM: return QVariant::fromValue( (HEXA_NS::Hexa*)m_DocElt ); + case VECTORITEM: return QVariant::fromValue( (HEXA_NS::Vector*)m_DocElt ); + case CYLINDERITEM: return QVariant::fromValue( (HEXA_NS::Cylinder*)m_DocElt ); + case PIPEITEM: return QVariant::fromValue( (HEXA_NS::Pipe*)m_DocElt ); + case ELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::Elements*)m_DocElt ); + case CROSSELEMENTSITEM: return QVariant::fromValue( (HEXA_NS::CrossElements*)m_DocElt ); + case GEOMSHAPEITEM: return QVariant::fromValue( (HEXA_NS::NewShape*) m_DocElt ); + case GEOMPOINTITEM: return QVariant::fromValue( (HEXA_NS::VertexShape*) m_DocElt ); + case GEOMEDGEITEM: return QVariant::fromValue( (HEXA_NS::EdgeShape*) m_DocElt ); + case GEOMFACEITEM: return QVariant::fromValue( (HEXA_NS::FaceShape*) m_DocElt ); + default: return QVariant::fromValue( m_DocElt ); + } + } - if (role == Qt::ForegroundRole ) { - if ( m_DocElt->isAssociated() ) - return QColor(Qt::darkGreen); - else - return QColor(Qt::black); - } - return QStandardItem::data( role ); + if (role == Qt::ForegroundRole && m_DocElt != NULL && !m_DocElt->isAssociated()) + return QColor(Qt::black); + + return QStandardItem::data( role ); } //--------------------------------------------------------------- @@ -314,8 +321,6 @@ PropagationItem::PropagationItem( HEXA_NS::Propagation* hexaPropagation ): QStandardItem(), _hexaPropagation( hexaPropagation ) { -// char pName[12]; -// QString name = _hexaPropagation->getName(pName); QString name = "Propagation"; setText(name); setData( PROPAGATION_TREE, HEXA_TREE_ROLE ); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx index 78373f0..017e2d5 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentItem.hxx @@ -60,6 +60,7 @@ Q_DECLARE_METATYPE( HEXA_NS::Pipe* ); Q_DECLARE_METATYPE( HEXA_NS::Elements* ); Q_DECLARE_METATYPE( HEXA_NS::CrossElements* ); Q_DECLARE_METATYPE( HEXA_NS::NewShape* ); +Q_DECLARE_METATYPE( HEXA_NS::SubShape* ); Q_DECLARE_METATYPE( HEXA_NS::VertexShape* ); Q_DECLARE_METATYPE( HEXA_NS::EdgeShape* ); Q_DECLARE_METATYPE( HEXA_NS::FaceShape* ); @@ -70,8 +71,6 @@ Q_DECLARE_METATYPE( HEXA_NS::Propagation* ); -// Q_DECLARE_METATYPE( QList ); // association - namespace HEXABLOCK { namespace GUI @@ -173,10 +172,11 @@ namespace HEXABLOCK int type () const; virtual bool isAssoc() const; virtual QString IDptr() const; + HEXA_NS::EltBase* getEltBase() const { return m_DocElt;} private: int m_type; - HEXA_NS::EltBase* m_DocElt; // Vertex and so. + HEXA_NS::EltBase* m_DocElt; }; //=================================================================================== diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx index 9307998..da56ff1 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.cxx @@ -26,7 +26,6 @@ #include "HEXABLOCKGUI_DocumentModel.hxx" #include "HEXABLOCKGUI_DocumentItem.hxx" -#include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" #include "HEXABLOCKGUI.hxx" #include "HEXABLOCKGUI_Trace.hxx" @@ -35,23 +34,24 @@ #include "HexShape.hxx" #include "HexSubShape.hxx" #include "HexAssoEdge.hxx" +#include "HexBiCylinder.hxx" +#include +#include #include #include "HEXABLOCKGUI_SalomeTools.hxx" -#include "MyGEOMBase_Helper.hxx" #include "GEOM_GEOMBase.hxx" -#include "GEOM_GenericObjPtr.h" -#include #include #include #include -#include CORBA_CLIENT_HEADER(GEOM_Gen) #include +#include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" + //#define _DEVDEBUG_ @@ -148,7 +148,6 @@ DocumentModel::DocumentModel(HEXA_NS::Document* docIn, const QString& entryIn, Q parentItem->appendRow(_explicitShapesDirItem); parentItem->appendRow(_implicitShapesDirItem); -// parentItem->appendRow(_cloudOfPointsDirItem); parentItem->appendRow(_groupDirItem); parentItem->appendRow(_lawDirItem); @@ -218,66 +217,47 @@ int DocumentModel::getNbrUsedElt(HEXA_NS::EnumElt eltType) } //associate a shape to the current document -bool DocumentModel::addShape(TopoDS_Shape& aShape, QString& name) +bool DocumentModel::addShape(TopoDS_Shape& aShape, QString& name, bool publish) { - if (aShape.IsNull()) return false; - return (_hexaDocument != NULL ? _hexaDocument->addShape(aShape, name.toStdString().c_str()) != NULL : false); + if (aShape.IsNull() || name.isEmpty()) + return false; + bool ok = (_hexaDocument != NULL ? _hexaDocument->addShape(aShape, name.toStdString().c_str()) != NULL : false); + + // * publish the shape in the study + if (ok && publish) + { + HEXABLOCKGUI* module = HEXABLOCKGUI::getInstance(); + if (module != NULL) + { + QMap topo_shapes; + topo_shapes[name] = aShape; + module->addInStudy(topo_shapes, docShapesEntry, docShapesName); + } + } + + // * update data + if (ok) + updateGeomTree(); + + return ok; } //get the number of unused elements of type 'eltType' in the document int DocumentModel::getNbrUnusedElt(HEXA_NS::EnumElt eltType) { - if (_hexaDocument == NULL) return 0; + if (_hexaDocument == NULL) + return 0; return getNbrElt(eltType) - getNbrUsedElt(eltType); } -DocumentModel::GeomObj* DocumentModel::convertToGeomObj(GEOM::GeomObjPtr geomObjPtr) -{ - TopoDS_Shape aShape; - DocumentModel::GeomObj *res = NULL; - - if ( geomObjPtr && GEOMBase::GetShape(geomObjPtr.get(), aShape) && !aShape.IsNull() ) - { - res = new DocumentModel::GeomObj; - if (res == NULL) return NULL; - QString mainShapeEntry; - int subId = -1; - QString brep; - - if ( geomObjPtr->IsMainShape() ){ - mainShapeEntry = geomObjPtr->GetStudyEntry(); - brep = shape2string( aShape ).c_str(); - } else { - TopoDS_Shape shape; - TopoDS_Shape subshape; - GEOM::GEOM_Object_var mainShape = geomObjPtr->GetMainShape(); - mainShapeEntry = mainShape->GetStudyEntry(); - // CS_TODO : à optimiser - bool okShape = GEOMBase::GetShape( mainShape , shape); - bool oksubShape = GEOMBase::GetShape( geomObjPtr.get(), subshape ); - if ( okShape && oksubShape ){ - brep = shape2string( subshape ).c_str(); - subId = GEOMBase::GetIndex( subshape, shape ); - MESSAGE("subid = " << QString::number(subId).toStdString()); - } - } - res->shapeName = getGeomObjName(mainShapeEntry); - res->name = GEOMBase::GetName( geomObjPtr.get() ); - res->subid = QString::number(subId); - res->brep = brep; - res->start = 0.; - res->end = 1.; - } - - return res; -} - //Load the current Document void DocumentModel::load() { - if (_hexaDocument == NULL) return; + if (_hexaDocument == NULL) + return; + load(_hexaDocument->getName()); } @@ -295,8 +275,6 @@ void DocumentModel::load( const QString& xmlFileName ) // Fill Data fillMesh(); emit patternDataChanged(); - - // BUILDER, ASSOCIATION, GROUPS, ... CS_TODO _fillBuilderFrom( _hexaDocument ); } bool DocumentModel::isEmpty() const @@ -324,6 +302,21 @@ void DocumentModel::updateData() emit patternDataChanged(); } +void DocumentModel::updateGeomTree() +{ + clearGeometry(); + fillGeometry(); +} + +QModelIndex DocumentModel::addToElementsTree(HEXA_NS::Elements* helts) +{ + updateData(); + ElementsItem* eltsItem = new ElementsItem(helts); + _elementsDirItem->appendRow(eltsItem); + + return eltsItem->index(); +} + void DocumentModel::refresh() { clearAll(); @@ -336,7 +329,6 @@ void DocumentModel::refresh() fillMesh(); emit patternDataChanged(); - } void DocumentModel::clearAll() @@ -347,9 +339,6 @@ void DocumentModel::clearAll() clearAssociation(); clearGroups(); clearMesh(); - - //dataChanged( const QModelIndex & topLeft, const QModelIndex & bottomRight ) - //CS_TODO : todo : association, groups, mesh } void DocumentModel::clearData() @@ -396,10 +385,16 @@ void DocumentModel::clearMesh() void DocumentModel::fillData() { + PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel(); + if (pdsm == NULL) + return; + pdsm->clearHighlightedItems(); + // DATA HEXA_NS::Vertex *v = NULL; VertexItem *vItem = NULL; - for ( int i=0; i<_hexaDocument->countVertex(); ++i ){ + int nbVertex = _hexaDocument->countVertex(); + for ( int i=0; igetVertex(i); vItem = new VertexItem(v, _entry); _vertexDirItem->appendRow(vItem); @@ -407,7 +402,8 @@ void DocumentModel::fillData() HEXA_NS::Edge *e = NULL; EdgeItem *eItem = NULL; - for ( int i=0; i<_hexaDocument->countEdge(); ++i ){ + int nbEdge = _hexaDocument->countEdge(); + for ( int i=0; igetEdge(i); eItem = new EdgeItem(e, _entry); _edgeDirItem->appendRow(eItem); @@ -415,7 +411,8 @@ void DocumentModel::fillData() HEXA_NS::Quad *q = NULL; QuadItem *qItem = NULL; - for ( int i=0; i<_hexaDocument->countQuad(); ++i ){ + int nbQuad = _hexaDocument->countQuad(); + for ( int i=0; igetQuad(i); qItem = new QuadItem(q, _entry); _quadDirItem->appendRow(qItem); @@ -423,7 +420,8 @@ void DocumentModel::fillData() HEXA_NS::Hexa *h = NULL; HexaItem *hItem = NULL; - for ( int i=0; i<_hexaDocument->countHexa(); ++i ){ + int nbHexa = _hexaDocument->countHexa(); + for ( int i=0; igetHexa(i); hItem = new HexaItem(h, _entry); _hexaDirItem->appendRow(hItem); @@ -435,7 +433,8 @@ void DocumentModel::fillBuilder() { HEXA_NS::Vector *v = NULL; VectorItem *vItem = NULL; - for ( int i=0; i<_hexaDocument->countVector(); ++i ){ + int nbVector = _hexaDocument->countVector(); + for ( int i=0; igetVector(i); vItem = new VectorItem(v); _vectorDirItem->appendRow(vItem); @@ -444,7 +443,8 @@ void DocumentModel::fillBuilder() // _cylinderDirItem HEXA_NS::Cylinder *c = NULL; CylinderItem *cItem = NULL; - for ( int i=0; i<_hexaDocument->countCylinder(); ++i ){ + int nbCylinder = _hexaDocument->countCylinder(); + for ( int i=0; igetCylinder(i); cItem = new CylinderItem(c, _entry); _cylinderDirItem->appendRow(cItem); @@ -453,7 +453,8 @@ void DocumentModel::fillBuilder() // _pipeDirItem HEXA_NS::Pipe *p = NULL; PipeItem *pItem = NULL; - for ( int i=0; i<_hexaDocument->countPipe(); ++i ){ + int nbPipe = _hexaDocument->countPipe(); + for ( int i=0; igetPipe(i); pItem = new PipeItem(p); _pipeDirItem->appendRow(pItem); @@ -462,60 +463,69 @@ void DocumentModel::fillBuilder() void DocumentModel::fillGeometry() { - - if (_hexaDocument == NULL) return; + PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); + if (_hexaDocument == NULL || isEmpty() || pgsm == NULL) + return; HEXA_NS::NewShape* shape; HEXA_NS::VertexShape* node; HEXA_NS::EdgeShape* line; HEXA_NS::FaceShape* face; + TopoDS_Compound vertexCompound; + BRep_Builder compoundBuilder; - //explicit shape + // * fill the shape tree - //fill the shape tree shapeById.clear(); - for (int i=0; i < _hexaDocument->countShape(); ++i) + pgsm->clearHighlightedItems(); + QMap topo_shapes; + int nbShapes = _hexaDocument->countShape(); + for (int i=0; i < nbShapes; ++i) { shape = _hexaDocument->getShape(i); QString shapeName = shape->getName(); - - //publish the shape in the study if not done yet if (!docShapesEntry.contains(shapeName)) { - //save the brep of the shape in a temporary file - QString fileName = shapeName + ".brep"; - shape->saveBrep(); - - //importing the brep in the study - QString objStudyEntry = HEXABLOCKGUI::addInStudy(fileName); - - docShapesName[objStudyEntry] = shapeName; - docShapesEntry[shapeName] = objStudyEntry; + if (shape->getOrigin() == HEXA_NS::SH_CLOUD) + { + compoundBuilder.MakeCompound(vertexCompound); + topo_shapes[shapeName] = vertexCompound; + } + else + topo_shapes[shapeName] = shape->getShape(); } GeomShapeItem* shItem = new GeomShapeItem(shape); if (shape->getOrigin() == HEXA_NS::SH_IMPORT) + // * explicit shapes _explicitShapesDirItem->appendRow(shItem); else + // * implicit shapes _implicitShapesDirItem->appendRow(shItem); //add vertices to the tree QStandardItem* geomPointDirItem = new QStandardItem(tr("TREE_ITEM_VERTEX")); geomPointDirItem->setData( GEOMPOINT_DIR_TREE, HEXA_TREE_ROLE ); shItem->appendRow(geomPointDirItem); - for (int j=0; j < shape->countVertex(); ++j) + int nbVertexShape = shape->countVertex(); + for (int j=0; j < nbVertexShape; ++j) { node = shape->getVertexShape(j); GeomPointItem* gPointItem = new GeomPointItem(node); geomPointDirItem->appendRow(gPointItem); shapeById[shapeName+","+QString::number(node->getIdent())] = node; + + // * update the compound of vertices + if (shape->getOrigin() == HEXA_NS::SH_CLOUD && !vertexCompound.IsNull()) + compoundBuilder.Add(topo_shapes[shapeName], node->getShape()); } //add edges to the tree QStandardItem* geomEdgeDirItem = new QStandardItem(tr("TREE_ITEM_EDGE")); geomEdgeDirItem->setData( GEOMEDGE_DIR_TREE, HEXA_TREE_ROLE ); shItem->appendRow(geomEdgeDirItem); - for (int j = 0; j < shape->countEdge(); ++j) + int nbEdgeShape = shape->countEdge(); + for (int j = 0; j < nbEdgeShape; ++j) { line = shape->getEdgeShape(j); GeomEdgeItem* gEdgeItem = new GeomEdgeItem(line); @@ -527,7 +537,8 @@ void DocumentModel::fillGeometry() QStandardItem* geomFaceDirItem = new QStandardItem(tr("TREE_ITEM_QUAD")); geomFaceDirItem->setData( GEOMFACE_DIR_TREE, HEXA_TREE_ROLE ); shItem->appendRow(geomFaceDirItem); - for (int j = 0; j < shape->countFace(); ++j) + int nbFaceShape = shape->countFace(); + for (int j = 0; j < nbFaceShape; ++j) { face = shape->getFaceShape(j); GeomFaceItem* gFaceItem = new GeomFaceItem(face); @@ -536,13 +547,13 @@ void DocumentModel::fillGeometry() } } - //implicit shapes - //...here - - - //cloud of points - //...here + if (topo_shapes.size() == 0) + return; + // * register shapes + HEXABLOCKGUI* module = HEXABLOCKGUI::getInstance(); + if (module != NULL) + module->addInStudy(topo_shapes, docShapesEntry, docShapesName); } void DocumentModel::fillAssociation() @@ -554,7 +565,8 @@ void DocumentModel::fillAssociation() //{ // HEXA_NS::Group *g = NULL; // GroupItem *gItem = NULL; -// for ( int i=0; i<_hexaDocument->countGroup(); ++i ){ +// int nbGroup = _hexaDocument->countGroup(); +// for ( int i=0; igetGroup(i); // gItem = new GroupItem(g, _entry); // _groupDirItem->appendRow(gItem); @@ -565,7 +577,8 @@ void DocumentModel::fillAssociation() //{ // HEXA_NS::Law *l = NULL; // LawItem *lItem = NULL; -// for ( int i=0; i<_hexaDocument->countLaw(); ++i ){ +// int nbLaw = _hexaDocument->countLaw(); +// for ( int i=0; igetLaw(i); // lItem = new LawItem(l); // _lawDirItem->appendRow(lItem); @@ -573,7 +586,8 @@ void DocumentModel::fillAssociation() // // HEXA_NS::Propagation *p = NULL; // PropagationItem *pItem = NULL; -// for ( int i=0; i<_hexaDocument->countPropagation(); ++i ){ +// int nbPropagation = _hexaDocument->countPropagation(); +// for ( int i=0; igetPropagation(i); // pItem = new PropagationItem(p, _entry); // pItem->setText(QString("Propagation%1").arg(i) ); @@ -586,7 +600,8 @@ void DocumentModel::fillGroups() { HEXA_NS::Group *g = NULL; GroupItem *gItem = NULL; - for ( int i=0; i<_hexaDocument->countGroup(); ++i ){ + int nbGroup = _hexaDocument->countGroup(); + for ( int i=0; igetGroup(i); //std::cout<<"getGroup => "<< i << std::endl; gItem = new GroupItem(g); @@ -600,7 +615,8 @@ void DocumentModel::fillMesh() // _lawDirItem HEXA_NS::Law *l = NULL; LawItem *lItem = NULL; - for ( int i=0; i<_hexaDocument->countLaw(); ++i ){ + int nbLaw = _hexaDocument->countLaw(); + for ( int i=0; igetLaw(i); lItem = new LawItem(l); _lawDirItem->appendRow(lItem); @@ -609,7 +625,8 @@ void DocumentModel::fillMesh() // _propagationDirItem HEXA_NS::Propagation *p = NULL; PropagationItem *pItem = NULL; - for ( int i=0; i<_hexaDocument->countPropagation(); ++i ){ + int nbPropagation = _hexaDocument->countPropagation(); + for ( int i=0; igetPropagation(i); pItem = new PropagationItem(p); pItem->setText(QString("Propagation%1").arg(i) ); @@ -621,7 +638,8 @@ void DocumentModel::fillMesh() HEXA_NS::Hexa* DocumentModel::getQuadHexa(HEXA_NS::Quad* quad) { HEXA_NS::Hexa* hexa; - for ( int i=0; i<_hexaDocument->countHexa(); ++i ){ + int nbHexa = _hexaDocument->countHexa(); + for ( int i=0; igetHexa(i); if (hexa->findQuad(quad) > -1) return hexa; } @@ -979,35 +997,6 @@ QModelIndex DocumentModel::addEdgeVertices (const QModelIndex &i_v0, const QMode return edgeIndex; } -QModelIndex DocumentModel::addEdgeVector( const QModelIndex &i_v, const QModelIndex &i_vec ) -{ - QModelIndex edgeIndex; - - HEXA_NS::Vertex* hv = getHexaPtr(i_v); - HEXA_NS::Vector* hvec = getHexaPtr(i_vec); - - if (!hv || !hvec) return edgeIndex; - - HEXA_NS::Edge* he = _hexaDocument->addEdge( hv, hvec ); - if ( BadElement(he) ) return edgeIndex; - - HEXA_NS::Vertex* hv2 = he->getAval(); //the new vertex resulting from the creation of the edge - if (hv2 == NULL) return edgeIndex; - - //ADD the elements in the treeview - //The Edge - EdgeItem* e = new EdgeItem(he, _entry); - _edgeDirItem->appendRow(e); - - //The resulting Vertex - VertexItem* v = new VertexItem(hv2, _entry); - _vertexDirItem->appendRow(v); - edgeIndex = e->index(); - emit patternDataChanged(); - - return edgeIndex; -} - QModelIndex DocumentModel::addQuadVertices( const QModelIndex &i_v0, const QModelIndex &i_v1, const QModelIndex &i_v2, const QModelIndex &i_v3 ) { //CS_TODO : gestion erreur @@ -1143,8 +1132,6 @@ QModelIndex DocumentModel::addHexaQuads( const QModelIndexList &iquads) return hexaIndex; } -// Vector addVector( in double dx, in double dy, in double dz ) -// raises (SALOME::SALOME_Exception); QModelIndex DocumentModel::addVector( double dx, double dy, double dz ) { QModelIndex vectorIndex; @@ -1176,158 +1163,120 @@ QModelIndex DocumentModel::addVectorVertices( const QModelIndex &iv0, const QMod return iVec; } -QModelIndex DocumentModel::addCylinder( const QModelIndex &iv, const QModelIndex &ivec, double r, double h ) -{ - QModelIndex iCyl; - HEXA_NS::Vertex* hv = getHexaPtr(iv); - HEXA_NS::Vector* hvec = getHexaPtr(ivec); +// ************ EDIT HEXABLOCK MODEL ************ - HEXA_NS::Cylinder* hcyl = _hexaDocument->addCylinder( hv, hvec, r, h ); - if ( BadElement(hcyl) ) return iCyl; +bool DocumentModel::updateVertex( const QModelIndex& ivertex, double x, double y, double z ) +{ + bool ret = false; - CylinderItem* cyl = new CylinderItem(hcyl); - _cylinderDirItem->appendRow(cyl); - iCyl = cyl->index(); + HEXA_NS::Vertex* hVertex = getHexaPtr(ivertex); - return iCyl; + if ( hVertex ){ +// hVertex->setName( name.toStdString() ); + hVertex->setX ( x ); + hVertex->setY ( y ); + hVertex->setZ ( z ); + emit patternDataChanged(); + ret = true; + } + + return ret; } -QModelIndex DocumentModel::addPipe( const QModelIndex &iv, const QModelIndex &ivec, double ri, double re, double h ) +bool DocumentModel::removeHexa( const QModelIndex& ihexa ) { - QModelIndex iPipe; - - HEXA_NS::Vertex* hv = getHexaPtr(iv); - HEXA_NS::Vector* hvec = getHexaPtr(ivec); - - HEXA_NS::Pipe* hPipe = _hexaDocument->addPipe( hv, hvec, ri, re, h ); - if ( BadElement(hPipe) ) return iPipe; + HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); - PipeItem* pipe = new PipeItem(hPipe); - _pipeDirItem->appendRow(pipe); - iPipe = pipe->index(); + int r = _hexaDocument->removeHexa( hHexa ); + if ( r == HOK ){ + updateData(); + return true; + } - return iPipe; + return false; } -QModelIndex DocumentModel::makeCartesian( const QModelIndex& i_pt, - const QModelIndex& i_vec_x, const QModelIndex& i_vec_y, const QModelIndex& i_vec_z, - long nx, long ny, long nz) +bool DocumentModel::removeConnectedHexa( const QModelIndex& ihexa ) { - QModelIndex eltsIndex; - //std::cout<<"makeCartesian begin"<(i_pt); - HEXA_NS::Vector* hvec_x = getHexaPtr(i_vec_x); - HEXA_NS::Vector* hvec_y = getHexaPtr(i_vec_y); - HEXA_NS::Vector* hvec_z = getHexaPtr(i_vec_z); - - HEXA_NS::Elements* new_helts = _hexaDocument->makeCartesian( hpt, - hvec_x, hvec_y, hvec_z, - nx, ny, nz ); - if ( BadElement(new_helts) ) return eltsIndex; + HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(new_helts); - _elementsDirItem->appendRow(eltsItem); - eltsIndex = eltsItem->index(); + int r = _hexaDocument->removeConnectedHexa( hHexa ); + if ( r == HOK ){ + updateData(); + return true; + } - return eltsIndex; + return false; } -QModelIndex DocumentModel::makeCartesian( const QModelIndex& ivex, - const QModelIndex& ivec, - int nx, int ny, int nz ) +bool DocumentModel::mergeVertices( const QModelIndex &iv0, const QModelIndex &iv1 ) //CS_TODO : impact sur le model? { - QModelIndex iElts; - - HEXA_NS::Vertex* hVex = getHexaPtr(ivex); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); - - HEXA_NS::Elements* hElts = _hexaDocument->makeCartesian( hVex, - hVec, - nx, ny, nz ); - if ( BadElement(hElts) ) return iElts; + HEXA_NS::Vertex* hv0 = getHexaPtr(iv0); + HEXA_NS::Vertex* hv1 = getHexaPtr(iv1); - updateData(); //CS_TODO more or less? - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); + int r = _hexaDocument->mergeVertices( hv0, hv1 ); + if ( r == HOK ){ + updateData(); //CS_TODO more or less? + return true; + } - return iElts; + return false; } -// Elements makeCylindrical( in Vertex pt, -// in Vector vex, in Vector vez, -// in double dr, in double da, in double dl, -// in long nr, in long na, in long nl, -// in boolean fill ) -// raises (SALOME::SALOME_Exception); -QModelIndex DocumentModel::makeCylindrical( const QModelIndex& i_pt, - const QModelIndex& i_vec_x, const QModelIndex& i_vec_z, - double dr, double da, double dl, - long nr, long na, long nl, - bool fill ) +bool DocumentModel::mergeEdges( const QModelIndex &ie0, const QModelIndex &ie1, + const QModelIndex &iv0, const QModelIndex &iv1 ) +//CS_TODO : impact sur le model? { + HEXA_NS::Edge* he0 = getHexaPtr(ie0); + HEXA_NS::Edge* he1 = getHexaPtr(ie1); - QModelIndex eltsIndex; - - HEXA_NS::Vertex* hpt = getHexaPtr(i_pt); - HEXA_NS::Vector* hvec_x = getHexaPtr(i_vec_x); - HEXA_NS::Vector* hvec_z = getHexaPtr(i_vec_z); - - HEXA_NS::Elements* new_helts = _hexaDocument->makeCylindrical( hpt, hvec_x, hvec_z, dr, da, dl, nr, na, nl, fill ); - if ( BadElement(new_helts) ) return eltsIndex; + HEXA_NS::Vertex* hv0 = getHexaPtr(iv0); + HEXA_NS::Vertex* hv1 = getHexaPtr(iv1); - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(new_helts); - _elementsDirItem->appendRow(eltsItem); - eltsIndex = eltsItem->index(); + //Merge + int r = _hexaDocument->mergeEdges( he0, he1, hv0, hv1 ); + if ( r == HOK ){ + updateData(); + return true; + } - return eltsIndex; + return false; } -QModelIndex DocumentModel::makeCylindricals( - const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& iheight, - QList< double> radius, QList angles, QList heights, - bool fill ) //HEXA3 +bool DocumentModel::mergeQuads( const QModelIndex& iquad0, const QModelIndex& iquad1, + const QModelIndex& iv0, const QModelIndex& iv1, + const QModelIndex& iv2, const QModelIndex& iv3 ) { - QModelIndex eltsIndex; - - HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); - HEXA_NS::Vector* hbase =getHexaPtr(ibase); - HEXA_NS::Vector* hheight = getHexaPtr(iheight); - - // HEXA_NS::Elements* helts; - std::vector r = radius.toVector().toStdVector(); - std::vector a = angles.toVector().toStdVector(); - std::vector h = heights.toVector().toStdVector(); + HEXA_NS::Quad* hquad0 = data(iquad0, HEXA_DATA_ROLE).value(); + HEXA_NS::Quad* hquad1 = data(iquad1, HEXA_DATA_ROLE).value(); - HEXA_NS::Elements* helts = _hexaDocument->makeCylindricals( - hcenter, hbase, hheight, - r, a, h, - fill ); - if ( BadElement(helts) ) return eltsIndex; + HEXA_NS::Vertex* hv0 = getHexaPtr(iv0); + HEXA_NS::Vertex* hv1 = getHexaPtr(iv1); + HEXA_NS::Vertex* hv2 = getHexaPtr(iv2); + HEXA_NS::Vertex* hv3 = getHexaPtr(iv3); - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(helts); - _elementsDirItem->appendRow(eltsItem); - eltsIndex = eltsItem->index(); + int r = _hexaDocument->mergeQuads( hquad0, hquad1, hv0, hv1, hv2, hv3 ); + if ( r == HOK ){ + updateData(); + return true; + } - return eltsIndex; + return false; } -QModelIndex DocumentModel::makeSpherical( const QModelIndex& iv, const QModelIndex& ivec, int nb, double k) +// +QModelIndex DocumentModel::disconnectVertex( const QModelIndex& ihexa, const QModelIndex& ivertex ) { QModelIndex iElts; - HEXA_NS::Vertex* hv = getHexaPtr(iv); - HEXA_NS::Vector* hvec = getHexaPtr(ivec); + HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); + HEXA_NS::Vertex* hVertex = getHexaPtr(ivertex); - HEXA_NS::Elements* hElts = _hexaDocument->makeSpherical( hv, hvec, nb, k ); + HEXA_NS::Elements* hElts = _hexaDocument->disconnectVertex( hHexa, hVertex ); if ( BadElement(hElts) ) return iElts; - updateData(); //CS_TODO more or less? + updateData(); //CS_TO_CHECK ElementsItem* elts = new ElementsItem(hElts); _elementsDirItem->appendRow(elts); iElts = elts->index(); @@ -1335,35 +1284,51 @@ QModelIndex DocumentModel::makeSpherical( const QModelIndex& iv, const QModelInd return iElts; } -QModelIndex DocumentModel::makeSpherical( const QModelIndex& icenter, double radius, int nb, double k ) +QModelIndex DocumentModel::disconnectEdge( const QModelIndex& ihexa, const QModelIndex& iedge ) { QModelIndex iElts; - HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); + HEXA_NS::Edge* hEdge = getHexaPtr(iedge); - HEXA_NS::Elements* helts = _hexaDocument->makeSpherical( hcenter, radius, nb, k ); - if ( BadElement(helts) ) return iElts; + HEXA_NS::Elements* hElts = _hexaDocument->disconnectEdge( hHexa, hEdge ); + if ( BadElement(hElts) ) return iElts; - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(helts); - _elementsDirItem->appendRow(eltsItem); - iElts = eltsItem->index(); + updateData(); //CS_TO_CHECK + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); return iElts; } -QModelIndex DocumentModel::makeCylinder( const QModelIndex& icyl, const QModelIndex& ivec, - int nr, int na, int nl ) + +QModelIndex DocumentModel::disconnectEdges( const QModelIndexList& ihexas, const QModelIndexList& iedges ) { QModelIndex iElts; - HEXA_NS::Cylinder* hcyl = getHexaPtr(icyl); - HEXA_NS::Vector* hvec = getHexaPtr(ivec); + HEXA_NS::Hexas hHexas; + HEXA_NS::Edges hEdges; - HEXA_NS::Elements* hElts = _hexaDocument->makeCylinder( hcyl, hvec, nr, na, nl ); + //edges list + HEXA_NS::Edge* hedge = NULL; + foreach( const QModelIndex& iedge, iedges ){ + hedge = getHexaPtr(iedge); + hEdges.push_back( hedge ); + } + + //hexas list + HEXA_NS::Hexa* hhexa = NULL; + foreach( const QModelIndex& ihexa, ihexas ){ + hhexa = getHexaPtr(ihexa); + hHexas.push_back( hhexa ); + } + + + HEXA_NS::Elements* hElts = _hexaDocument->disconnectEdges( hHexas, hEdges ); if ( BadElement(hElts) ) return iElts; - updateData(); //CS_TODO more or less? + updateData(); //CS_TO_CHECK ElementsItem* elts = new ElementsItem(hElts); _elementsDirItem->appendRow(elts); iElts = elts->index(); @@ -1371,18 +1336,18 @@ QModelIndex DocumentModel::makeCylinder( const QModelIndex& icyl, const QModelIn return iElts; } -QModelIndex DocumentModel::makePipe( const QModelIndex& ipipe, const QModelIndex& ivecx, - int nr, int na, int nl ) + +QModelIndex DocumentModel::disconnectQuad( const QModelIndex& ihexa, const QModelIndex& iquad ) { QModelIndex iElts; - HEXA_NS::Pipe* hPipe = getHexaPtr(ipipe); - HEXA_NS::Vector* hVecx = getHexaPtr(ivecx); + HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); + HEXA_NS::Quad* hQuad = getHexaPtr(iquad); - HEXA_NS::Elements* hElts = _hexaDocument->makePipe( hPipe, hVecx, nr, na, nl ); + HEXA_NS::Elements* hElts = _hexaDocument->disconnectQuad( hHexa, hQuad ); if ( BadElement(hElts) ) return iElts; - updateData(); //CS_TODO more or less? + updateData(); //CS_TO_CHECK ElementsItem* elts = new ElementsItem(hElts); _elementsDirItem->appendRow(elts); iElts = elts->index(); @@ -1390,181 +1355,153 @@ QModelIndex DocumentModel::makePipe( const QModelIndex& ipipe, const QModelIndex return iElts; } -QModelIndex DocumentModel::makeCylinders(const QModelIndex& icyl1, const QModelIndex& icyl2) -{ //CS_TODO - QModelIndex iCrossElts; - HEXA_NS::Cylinder* hCyl1 = getHexaPtr(icyl1); - HEXA_NS::Cylinder* hCyl2 = getHexaPtr(icyl2); +QModelIndex DocumentModel::makeTranslation( const QModelIndex& ielts, const QModelIndex& ivec ) +{ + QModelIndex iElts; - HEXA_NS::CrossElements* hCrossElts = _hexaDocument->makeCylinders( hCyl1, hCyl2 ); - if ( BadElement(hCrossElts) ) return iCrossElts; + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); - updateData(); //CS_TODO more or less? - ElementsItem* crossElts = new ElementsItem(hCrossElts); - _crossElementsDirItem->appendRow(crossElts); - iCrossElts = crossElts->index(); + HEXA_NS::Elements* hNewElts = _hexaDocument->makeTranslation( hElts, hVec ); + if ( BadElement(hNewElts) ) return iElts; - return iCrossElts; + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(hNewElts); + _elementsDirItem->appendRow(eltsItem); + iElts = eltsItem->index(); + + return iElts; } -// -QModelIndex DocumentModel::makePipes( const QModelIndex& ipipe1, const QModelIndex& ipipe2 ) + + +QModelIndex DocumentModel::makeScale( const QModelIndex& ielts, const QModelIndex& ivex, double k ) { - QModelIndex iCrossElts; + QModelIndex iElts; - HEXA_NS::Pipe* hPipe1 = getHexaPtr(ipipe1); - HEXA_NS::Pipe* hPipe2 = getHexaPtr(ipipe2); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(ivex); - HEXA_NS::CrossElements* hCrossElts = _hexaDocument->makePipes( hPipe1, hPipe2 ); - if ( BadElement(hCrossElts) ) return iCrossElts; + HEXA_NS::Elements* hNewElts = _hexaDocument->makeScale( hElts, hVex, k ); + if ( BadElement(hNewElts) ) return iElts; - updateData(); //CS_TODO more or less? - ElementsItem* crossElts = new ElementsItem(hCrossElts); - _crossElementsDirItem->appendRow(crossElts); - iCrossElts = crossElts->index(); + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(hNewElts); + _elementsDirItem->appendRow(eltsItem); + iElts = eltsItem->index(); - return iCrossElts; + return iElts; } -QModelIndex DocumentModel::makeRind( const QModelIndex& icenter, - const QModelIndex& ivecx, const QModelIndex& ivecz, - double radext, double radint, double radhole, - const QModelIndex& iplorig, - int nrad, int nang, int nhaut ) + + +QModelIndex DocumentModel::makeRotation( const QModelIndex& ielts, + const QModelIndex& iv, + const QModelIndex& ivec, double angle ) { QModelIndex iElts; - HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); - HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); - HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); - HEXA_NS::Vertex* hplorig = getHexaPtr(iplorig); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(iv); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); - HEXA_NS::Elements* hElts = _hexaDocument->makeRind( hcenter, - hvecx, hvecz, - radext, radint, radhole, - hplorig, - nrad, nang, nhaut ); - if ( BadElement(hElts) ) return iElts; + HEXA_NS::Elements* hNewElts = _hexaDocument->makeRotation( hElts, hVex, hVec, angle ); + if ( BadElement(hNewElts) ) return iElts; - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(hElts); + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(hNewElts); _elementsDirItem->appendRow(eltsItem); iElts = eltsItem->index(); return iElts; } -QModelIndex DocumentModel::makePartRind( const QModelIndex& icenter, - const QModelIndex& ivecx, const QModelIndex& ivecz, - double radext, double radint, double radhole, - const QModelIndex& iplorig, double angle, - int nrad, int nang, int nhaut ) + +QModelIndex DocumentModel::makeSymmetryPoint( const QModelIndex& ielts, const QModelIndex& iv ) { QModelIndex iElts; - HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); - HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); - HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); - HEXA_NS::Vertex* hplorig = getHexaPtr(iplorig); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(iv); - HEXA_NS::Elements* hElts = _hexaDocument->makePartRind( hcenter, - hvecx, hvecz, - radext, radint, radhole, - hplorig, angle, - nrad, nang, nhaut ); - if ( BadElement(hElts) ) return iElts; + HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryPoint (hElts, hVex); + if ( BadElement(hNewElts) ) return iElts; - updateData(); - ElementsItem* eltsItem = new ElementsItem(hElts); + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(hNewElts); _elementsDirItem->appendRow(eltsItem); iElts = eltsItem->index(); return iElts; } -QModelIndex DocumentModel::makeSphere( const QModelIndex& icenter, - const QModelIndex& ivecx, const QModelIndex& ivecz, - double radius, double radhole, - const QModelIndex& iplorig, - int nrad, int nang, int nhaut ) + +QModelIndex DocumentModel::makeSymmetryLine( const QModelIndex& ielts, + const QModelIndex& iv, + const QModelIndex& ivec ) { QModelIndex iElts; - HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); - HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); - HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); - HEXA_NS::Vertex* hplorig = getHexaPtr(iplorig); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(iv); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); - HEXA_NS::Elements* hElts = _hexaDocument->makeSphere( hcenter, - hvecx, hvecz, - radius, radhole, - hplorig, - nrad, nang, nhaut); - if ( BadElement(hElts) ) return iElts; - updateData(); - ElementsItem* eltsItem = new ElementsItem(hElts); + HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryLine( hElts, hVex, hVec ); + if ( BadElement(hNewElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(hNewElts); _elementsDirItem->appendRow(eltsItem); iElts = eltsItem->index(); return iElts; } -QModelIndex DocumentModel::makePartSphere( const QModelIndex& icenter, - const QModelIndex& ivecx, const QModelIndex& ivecz, - double radius, double radhole, - const QModelIndex& iplorig, double angle, - int nrad, int nang, int nhaut ) + +QModelIndex DocumentModel::makeSymmetryPlane( const QModelIndex& ielts, const QModelIndex& iv, const QModelIndex& ivec ) { QModelIndex iElts; - HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); - HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); - HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); - HEXA_NS::Vertex* hplorig = getHexaPtr(iplorig); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(iv); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); - HEXA_NS::Elements* hElts = _hexaDocument->makePartSphere( hcenter, - hvecx, hvecz, - radius, radhole, - hplorig, angle, - nrad, nang, nhaut); - if ( BadElement(hElts) ) return iElts; + HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryPlane( hElts, hVex, hVec ); + if ( BadElement(hNewElts) ) return iElts; - updateData(); - ElementsItem* eltsItem = new ElementsItem(hElts); + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(hNewElts); _elementsDirItem->appendRow(eltsItem); iElts = eltsItem->index(); return iElts; } -// ************ EDIT HEXABLOCK MODEL ************ -bool DocumentModel::updateVertex( const QModelIndex& ivertex, double x, double y, double z ) +bool DocumentModel::performTranslation( const QModelIndex& ielts, const QModelIndex& ivec ) { - bool ret = false; - - //HEXA_NS::Vertex* hVertex = ivertex.data(HEXA_DATA_ROLE).value(); //CS_TODO? pareil pour toutes les autres méthodes du modèle? - HEXA_NS::Vertex* hVertex = getHexaPtr(ivertex); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); - if ( hVertex ){ - // hVertex->setName( name.toStdString() ); - hVertex->setX ( x ); - hVertex->setY ( y ); - hVertex->setZ ( z ); - emit patternDataChanged(); - ret = true; + int r = _hexaDocument->performTranslation (hElts, hVec); + if ( r == HOK ){ //Job well done? + updateData(); + return true; } - return ret; + return false; } -bool DocumentModel::removeHexa( const QModelIndex& ihexa ) + +// +bool DocumentModel::performScale( const QModelIndex& ielts, const QModelIndex& ivex, double k ) { - HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(ivex); - int r = _hexaDocument->removeHexa( hHexa ); + int r = _hexaDocument->performScale (hElts, hVex, k); if ( r == HOK ){ updateData(); return true; @@ -1573,11 +1510,14 @@ bool DocumentModel::removeHexa( const QModelIndex& ihexa ) return false; } -bool DocumentModel::removeConnectedHexa( const QModelIndex& ihexa ) +// +bool DocumentModel::performRotation( const QModelIndex& ielts, const QModelIndex& ivex, const QModelIndex& ivec, double angle ) { - HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(ivex); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); - int r = _hexaDocument->removeConnectedHexa( hHexa ); + int r = _hexaDocument-> performRotation( hElts, hVex, hVec, angle ); if ( r == HOK ){ updateData(); return true; @@ -1586,161 +1526,30 @@ bool DocumentModel::removeConnectedHexa( const QModelIndex& ihexa ) return false; } -QModelIndex DocumentModel::prismQuad( const QModelIndex& iquad, const QModelIndex& ivec, int nb) -{ - QModelIndex iElts; - - HEXA_NS::Quad* hQuad = getHexaPtr(iquad); - HEXA_NS::Vector* hVect = getHexaPtr(ivec); - - HEXA_NS::Elements* hElts = _hexaDocument->prismQuad( hQuad, hVect, nb ); - if ( BadElement(hElts) ) return iElts; - - updateData(); //CS_TODO more or less? - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); - - return iElts; -} - -QModelIndex DocumentModel::prismQuads( const QModelIndexList& iquads, const QModelIndex& ivec, int nb) -{ - QModelIndex iElts; - - HEXA_NS::Quads hQuads; - HEXA_NS::Quad* hQuad = NULL; - foreach( const QModelIndex& iquad, iquads ){ - hQuad = getHexaPtr(iquad); - hQuads.push_back( hQuad ); - } - HEXA_NS::Vector* hVect = getHexaPtr(ivec); - - HEXA_NS::Elements* hElts = _hexaDocument->prismQuads( hQuads, hVect, nb ); - if ( BadElement(hElts) ) return iElts; - - updateData(); //CS_TODO more or less? - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); - - return iElts; -} - -QModelIndex DocumentModel::prismQuads( const QModelIndexList& iquads, const QModelIndex& ivec, std::vector layersSize, int nb) -{ - QModelIndex iElts; - - HEXA_NS::Quads hQuads; - HEXA_NS::Quad* hQuad = NULL; - foreach( const QModelIndex& iquad, iquads ){ - hQuad = getHexaPtr(iquad); - hQuads.push_back( hQuad ); - } - HEXA_NS::Vector* hVect = getHexaPtr(ivec); - - HEXA_NS::Elements* hElts = _hexaDocument->prismQuadsVec( hQuads, hVect, layersSize, nb ); - if ( BadElement(hElts) ) return iElts; - - updateData(); //CS_TODO more or less? - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); - - return iElts; -} // -QModelIndex DocumentModel::joinQuad( - const QModelIndex& iquadstart, const QModelIndex& iquaddest, - const QModelIndex& iv0, const QModelIndex& iv1, - const QModelIndex& iv2, const QModelIndex& iv3, - int nb ) -{ - QModelIndex iElts; - - HEXA_NS::Quad* hQuadStart = getHexaPtr(iquadstart); - HEXA_NS::Quad* hQuadDest = getHexaPtr(iquaddest); - - HEXA_NS::Vertex* hVertex0 = getHexaPtr(iv0); - HEXA_NS::Vertex* hVertex1 = getHexaPtr(iv1); - HEXA_NS::Vertex* hVertex2 = getHexaPtr(iv2); - HEXA_NS::Vertex* hVertex3 = getHexaPtr(iv3); - - HEXA_NS::Elements* hElts = _hexaDocument->joinQuad( hQuadStart, hQuadDest, - hVertex0, hVertex1, hVertex2, hVertex3, nb ); - if ( BadElement(hElts) ) return iElts; - - updateData(); //CS_TODO more or less? - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); - - return iElts; -} - -QModelIndex DocumentModel::joinQuads( - const QModelIndexList& iquadsstart, const QModelIndex& iquaddest, - const QModelIndex& iv0, const QModelIndex& iv1, - const QModelIndex& iv2, const QModelIndex& iv3, - int nb ) -{ - QModelIndex iElts; - - HEXA_NS::Quad* hQuadStart; - HEXA_NS::Quads hQuadsStart; - - foreach( const QModelIndex& iquad, iquadsstart ){ - hQuadStart = data( iquad, HEXA_DATA_ROLE ).value(); - hQuadsStart.push_back( hQuadStart ); - } - HEXA_NS::Quad* hQuadDest = data( iquaddest, HEXA_DATA_ROLE ).value(); - - HEXA_NS::Vertex* hVertex0 = getHexaPtr(iv0); - HEXA_NS::Vertex* hVertex1 = getHexaPtr(iv1); - HEXA_NS::Vertex* hVertex2 = getHexaPtr(iv2); - HEXA_NS::Vertex* hVertex3 = getHexaPtr(iv3); - - HEXA_NS::Elements* hElts = _hexaDocument->joinQuads( - hQuadsStart, hQuadDest, - hVertex0, hVertex1, hVertex2, hVertex3, - nb ); - if ( BadElement(hElts) ) return iElts; - - updateData(); //CS_TODO more or less? - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); - - return iElts; -} - -bool DocumentModel::mergeVertices( const QModelIndex &iv0, const QModelIndex &iv1 ) //CS_TODO : impact sur le model? +bool DocumentModel::performSymmetryPoint( const QModelIndex& ielts, const QModelIndex& ivex ) { - HEXA_NS::Vertex* hv0 = getHexaPtr(iv0); - HEXA_NS::Vertex* hv1 = getHexaPtr(iv1); + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(ivex); - int r = _hexaDocument->mergeVertices( hv0, hv1 ); + int r = _hexaDocument->performSymmetryPoint( hElts, hVex ); if ( r == HOK ){ - updateData(); //CS_TODO more or less? + updateData(); return true; } return false; } -bool DocumentModel::mergeEdges( const QModelIndex &ie0, const QModelIndex &ie1, - const QModelIndex &iv0, const QModelIndex &iv1 ) -//CS_TODO : impact sur le model? -{ - HEXA_NS::Edge* he0 = getHexaPtr(ie0); - HEXA_NS::Edge* he1 = getHexaPtr(ie1); - HEXA_NS::Vertex* hv0 = getHexaPtr(iv0); - HEXA_NS::Vertex* hv1 = getHexaPtr(iv1); +bool DocumentModel::performSymmetryLine( const QModelIndex& ielts, const QModelIndex& ivex, const QModelIndex& ivec ) +{ + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(ivex); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); - //Merge - int r = _hexaDocument->mergeEdges( he0, he1, hv0, hv1 ); + int r = _hexaDocument->performSymmetryLine( hElts, hVex, hVec ); if ( r == HOK ){ updateData(); return true; @@ -1749,19 +1558,16 @@ bool DocumentModel::mergeEdges( const QModelIndex &ie0, const QModelIndex &ie1, return false; } -bool DocumentModel::mergeQuads( const QModelIndex& iquad0, const QModelIndex& iquad1, - const QModelIndex& iv0, const QModelIndex& iv1, - const QModelIndex& iv2, const QModelIndex& iv3 ) -{ - HEXA_NS::Quad* hquad0 = data(iquad0, HEXA_DATA_ROLE).value(); - HEXA_NS::Quad* hquad1 = data(iquad1, HEXA_DATA_ROLE).value(); - HEXA_NS::Vertex* hv0 = getHexaPtr(iv0); - HEXA_NS::Vertex* hv1 = getHexaPtr(iv1); - HEXA_NS::Vertex* hv2 = getHexaPtr(iv2); - HEXA_NS::Vertex* hv3 = getHexaPtr(iv3); +bool DocumentModel::performSymmetryPlane( const QModelIndex& ielts, + const QModelIndex& ivex, + const QModelIndex& ivec ) +{ + HEXA_NS::Elements* hElts = getHexaPtr(ielts); + HEXA_NS::Vertex* hVex = getHexaPtr(ivex); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); - int r = _hexaDocument->mergeQuads( hquad0, hquad1, hv0, hv1, hv2, hv3 ); + int r = _hexaDocument->performSymmetryPlane( hElts, hVex, hVec ); if ( r == HOK ){ updateData(); return true; @@ -1770,282 +1576,376 @@ bool DocumentModel::mergeQuads( const QModelIndex& iquad0, const QModelIndex& iq return false; } -// -QModelIndex DocumentModel::disconnectVertex( const QModelIndex& ihexa, const QModelIndex& ivertex ) +QModelIndex DocumentModel::revolutionQuads( const QModelIndexList& istartquads, + const QModelIndex& icenter, + const QModelIndex& ivecaxis, + const QList& angles ) { - QModelIndex iElts; + QModelIndex ielts; - HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); - HEXA_NS::Vertex* hVertex = getHexaPtr(ivertex); + HEXA_NS::Quads hstartquads; + HEXA_NS::Quad* hquad = NULL; + foreach( const QModelIndex& iquad, istartquads){ + hquad = data( iquad, HEXA_DATA_ROLE ).value(); + hstartquads.push_back( hquad ); + } + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* haxis = getHexaPtr(ivecaxis); + std::vector hangles = angles.toVector().toStdVector(); - HEXA_NS::Elements* hElts = _hexaDocument->disconnectVertex( hHexa, hVertex ); - if ( BadElement(hElts) ) return iElts; + HEXA_NS::Elements* helts = _hexaDocument->revolutionQuads( hstartquads, hcenter, haxis, hangles ); + if ( BadElement(helts) ) return ielts; - updateData(); //CS_TO_CHECK - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); + updateData(); + ElementsItem* eltsItem = new ElementsItem(helts); + _elementsDirItem->appendRow(eltsItem); + ielts = eltsItem->index(); - return iElts; + return ielts; } -QModelIndex DocumentModel::disconnectEdge( const QModelIndex& ihexa, const QModelIndex& iedge ) +QModelIndex DocumentModel::replace( const QModelIndexList& iquadsPattern, + const QModelIndex& ip1, const QModelIndex& ic1, + const QModelIndex& ip2, const QModelIndex& ic2, + const QModelIndex& ip3, const QModelIndex& ic3 ) { - QModelIndex iElts; + QModelIndex ielts; - HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); - HEXA_NS::Edge* hEdge = getHexaPtr(iedge); + HEXA_NS::Vertex* hp1 = getHexaPtr(ip1); + HEXA_NS::Vertex* hc1 = getHexaPtr(ic1); + HEXA_NS::Vertex* hp2 = getHexaPtr(ip2); + HEXA_NS::Vertex* hc2 = getHexaPtr(ic2); + HEXA_NS::Vertex* hp3 = getHexaPtr(ip3); + HEXA_NS::Vertex* hc3 = getHexaPtr(ic3); - HEXA_NS::Elements* hElts = _hexaDocument->disconnectEdge( hHexa, hEdge ); - if ( BadElement(hElts) ) return iElts; + HEXA_NS::Quads hquads; + HEXA_NS::Quad* hquad = NULL; + foreach( const QModelIndex& iquad, iquadsPattern ){ + hquad = getHexaPtr(iquad); + hquads.push_back( hquad ); + } - updateData(); //CS_TO_CHECK - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); + HEXA_NS::Elements* helts = _hexaDocument->replace( hquads, + hp1, hc1, hp2, hc2, hp3, hc3 ); + if ( BadElement(helts) ) return ielts; - return iElts; -} + updateData(); + ElementsItem* eltsItem = new ElementsItem(helts); + _elementsDirItem->appendRow(eltsItem); + ielts = eltsItem->index(); + return ielts; +} -QModelIndex DocumentModel::disconnectEdges( const QModelIndexList& ihexas, const QModelIndexList& iedges ) +QModelIndex DocumentModel::getGeomModelIndex(QString& id) const { - QModelIndex iElts; + QModelIndex result; + PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); - HEXA_NS::Hexas hHexas; - HEXA_NS::Edges hEdges; + // ** get the model index of the geom element having this ID + HEXA_NS::SubShape* eltPtr = getGeomPtr(id); + HEXA_NS::VertexShape* geomVertex = dynamic_cast(eltPtr); + HEXA_NS::EdgeShape* geomEdge = dynamic_cast(eltPtr); + HEXA_NS::FaceShape* geomFace = dynamic_cast(eltPtr); + if (geomVertex != NULL) + result = pgsm->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(geomVertex)); + if (geomEdge != NULL) + result = pgsm->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(geomEdge)); + if (geomFace != NULL) + result = pgsm->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(geomFace)); - //edges list - HEXA_NS::Edge* hedge = NULL; - foreach( const QModelIndex& iedge, iedges ){ - hedge = getHexaPtr(iedge); - hEdges.push_back( hedge ); - } + return result; +} - //hexas list - HEXA_NS::Hexa* hhexa = NULL; - foreach( const QModelIndex& ihexa, ihexas ){ - hhexa = getHexaPtr(ihexa); - hHexas.push_back( hhexa ); - } +QMultiMap< QString, int > DocumentModel::getAssocShapesIds(const QModelIndex& dataIndex) +{ + QMultiMap< QString, int > result; + HEXA_NS::NewShape* mainShape; + HEXA_NS::VertexShape* node; + HEXA_NS::EdgeShape* line; + HEXA_NS::FaceShape* face; + QString shapeName; + int subid; + PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel(); + QModelIndexList assocsInd = pdsm->getGeomAssociations(dataIndex); + foreach( const QModelIndex& anAssoc, assocsInd ) + { + node = getHexaPtr(anAssoc); + line = getHexaPtr(anAssoc); + face = getHexaPtr(anAssoc); - HEXA_NS::Elements* hElts = _hexaDocument->disconnectEdges( hHexas, hEdges ); - if ( BadElement(hElts) ) return iElts; + if (node != NULL) + { + mainShape = node->getParentShape(); + if (mainShape != NULL) + { + shapeName = mainShape->getName(); + subid = node->getIdent(); + } + } + else if (line != NULL) + { + mainShape = line->getParentShape(); + if (mainShape != NULL) + { + shapeName = mainShape->getName(); + subid = line->getIdent(); + } + } + else if (face != NULL) + { + mainShape = face->getParentShape(); + if (mainShape != NULL) + { + shapeName = mainShape->getName(); + subid = face->getIdent(); + } + } - updateData(); //CS_TO_CHECK - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); + if (!shapeName.isEmpty()) + result.insert( shapeName, subid ); - return iElts; + shapeName = QString(); + } + return result; } - -QModelIndex DocumentModel::disconnectQuad( const QModelIndex& ihexa, const QModelIndex& iquad ) +bool DocumentModel::setVertexAssociation( const QModelIndex& iVertex, double x, double y, double z) { - QModelIndex iElts; - - HEXA_NS::Hexa* hHexa = getHexaPtr(ihexa); - HEXA_NS::Quad* hQuad = getHexaPtr(iquad); + HEXA_NS::Vertex* vertex = getHexaPtr(iVertex); - HEXA_NS::Elements* hElts = _hexaDocument->disconnectQuad( hHexa, hQuad ); - if ( BadElement(hElts) ) return iElts; + if (vertex == NULL || _hexaDocument == NULL || vertex->setAssociation(x, y, z) != HOK) + return false; - updateData(); //CS_TO_CHECK - ElementsItem* elts = new ElementsItem(hElts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); + HEXA_NS::VertexShape* assoc = vertex->getAssociation(); + if (assoc != NULL) + { + HEXA_NS::NewShape* mainSh = assoc->getParentShape(); + setData( iVertex, QVariant::fromValue(QString(mainSh->getName())+","+QString::number(assoc->getIdent())+";"), HEXA_ASSOC_ENTRY_ROLE ); + } - return iElts; + return true; } - -QModelIndex DocumentModel::cutEdge( const QModelIndex &i_e0, int nbcuts ) -//CS_TODO : impact sur le model? +bool DocumentModel::setVertexAssociation( const QModelIndex& iVertex, const QModelIndex& iGeomVertex) { - QModelIndex iElts; - - HEXA_NS::Edge* he0 = getHexaPtr(i_e0); - HEXA_NS::Elements* helts = _hexaDocument->cut( he0, nbcuts ); + //parameters control + QString newAssoc; + HEXA_NS::Vertex* vertex = getHexaPtr(iVertex); + HEXA_NS::VertexShape* geomVertex = getHexaPtr(iGeomVertex); + if (_hexaDocument == NULL || vertex == NULL || geomVertex == NULL) return false; + HEXA_NS::NewShape* mainShape = geomVertex->getParentShape(); + if (mainShape == NULL) return false; - if ( BadElement(helts) ) return iElts; + //add association + if (vertex->setAssociation(geomVertex) != HOK) + return false; - updateData(); //CS_TODO more? - ElementsItem* elts = new ElementsItem(helts); - _elementsDirItem->appendRow(elts); - iElts = elts->index(); + //update association state in the model + newAssoc = QString(mainShape->getName()) + "," + QString::number(geomVertex->getIdent()) + ";"; + setData( iVertex, QVariant::fromValue(newAssoc), HEXA_ASSOC_ENTRY_ROLE ); - return iElts; + return true; } - -// Elements makeTranslation( in Elements l, in Vector vec ) -// raises (SALOME::SALOME_Exception); -QModelIndex DocumentModel::makeTranslation( const QModelIndex& ielts, const QModelIndex& ivec ) +bool DocumentModel::addEdgeAssociation( const QModelIndex& iEdge, const QModelIndex& iGeomEdge, double start, double end) { - QModelIndex iElts; + //parameters control + QString currentAssoc, newAssoc; + HEXA_NS::Edge* edge = getHexaPtr(iEdge); + HEXA_NS::EdgeShape* geomEdge = getHexaPtr(iGeomEdge); + if (_hexaDocument == NULL || edge == NULL || + geomEdge == NULL || start > end) return false; + HEXA_NS::NewShape* mainShape = geomEdge->getParentShape(); + if (mainShape == NULL) return false; - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); + //add association in the engine side + if (edge->addAssociation(geomEdge, start, end) != HOK) + return false; - HEXA_NS::Elements* hNewElts = _hexaDocument->makeTranslation( hElts, hVec ); - if ( BadElement(hNewElts) ) return iElts; + //add/update association in the model side (UI) + currentAssoc = data(iEdge, HEXA_ASSOC_ENTRY_ROLE).toString(); + newAssoc = QString(mainShape->getName()) + "," + QString::number(geomEdge->getIdent()) + ";"; + if (!currentAssoc.isEmpty()) newAssoc = currentAssoc + newAssoc; - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(hNewElts); - _elementsDirItem->appendRow(eltsItem); - iElts = eltsItem->index(); + setData( iEdge, QVariant::fromValue(newAssoc), HEXA_ASSOC_ENTRY_ROLE ); - return iElts; + return true; } - -QModelIndex DocumentModel::makeScale( const QModelIndex& ielts, const QModelIndex& ivex, double k ) +bool DocumentModel::addQuadAssociation (const QModelIndex& iQuad, const QModelIndex& iGeomFace) { - QModelIndex iElts; - - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(ivex); + //parameters control + QString currentAssoc, newAssoc; + HEXA_NS::Quad* quad = getHexaPtr(iQuad); + HEXA_NS::FaceShape* geomFace = getHexaPtr(iGeomFace); + if (_hexaDocument == NULL || quad == NULL || geomFace == NULL) + return false; + HEXA_NS::NewShape* mainShape = geomFace->getParentShape(); + if (mainShape == NULL) return false; - HEXA_NS::Elements* hNewElts = _hexaDocument->makeScale( hElts, hVex, k ); - if ( BadElement(hNewElts) ) return iElts; + //add association + if (quad->addAssociation(geomFace) != HOK) + return false; - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(hNewElts); - _elementsDirItem->appendRow(eltsItem); - iElts = eltsItem->index(); + //update association + currentAssoc = data( iQuad, HEXA_ASSOC_ENTRY_ROLE).toString(); + newAssoc = QString(mainShape->getName()) + "," + QString::number(geomFace->getIdent()) + ";"; + if (!currentAssoc.isEmpty()) newAssoc = currentAssoc + newAssoc; + setData( iQuad, QVariant::fromValue(newAssoc), HEXA_ASSOC_ENTRY_ROLE ); - return iElts; + return true; } - -QModelIndex DocumentModel::makeRotation( const QModelIndex& ielts, - const QModelIndex& iv, - const QModelIndex& ivec, double angle ) +QModelIndex DocumentModel::getVertexAssociation(const QModelIndex& iVertex) { - QModelIndex iElts; - - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(iv); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); + HEXA_NS::Vertex* vertex = getHexaPtr(iVertex); + if (vertex == NULL) + return QModelIndex(); - HEXA_NS::Elements* hNewElts = _hexaDocument->makeRotation( hElts, hVex, hVec, angle ); - if ( BadElement(hNewElts) ) return iElts; + //get the associated geom vertex + HEXA_NS::VertexShape* geomVertex = vertex->getAssociation(); + if (geomVertex == NULL) + return QModelIndex(); - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(hNewElts); - _elementsDirItem->appendRow(eltsItem); - iElts = eltsItem->index(); + //convert geom vertex to qmodelindex + PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); + if (pgsm == NULL) + return QModelIndex(); - return iElts; + return pgsm->indexBy(HEXA_DATA_ROLE, QVariant::fromValue(geomVertex)); } -QModelIndex DocumentModel::makeSymmetryPoint( const QModelIndex& ielts, const QModelIndex& iv ) +QModelIndexList DocumentModel::getEdgeAssociations(const QModelIndex& iEdge) { - QModelIndex iElts; - - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(iv); + QModelIndexList result; + HEXA_NS::Edge* edge = getHexaPtr(iEdge); + if (edge == NULL) return result; - HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryPoint (hElts, hVex); - if ( BadElement(hNewElts) ) return iElts; + HEXA_NS::EdgeShape* geomEdge; + HEXA_NS::AssoEdge* anEdgeAssoc; - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(hNewElts); - _elementsDirItem->appendRow(eltsItem); - iElts = eltsItem->index(); + PatternGeomSelectionModel* pGSModel = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); + int nbAssocs = edge->countAssociation(); + for (int i = 0; i < nbAssocs; ++i) + { + anEdgeAssoc = edge->getAssociation(i); + if (anEdgeAssoc == NULL) continue; + geomEdge = anEdgeAssoc->getEdgeShape(); + if (geomEdge == NULL) continue; + result << pGSModel->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(geomEdge)); + } - return iElts; + return result; } -QModelIndex DocumentModel::makeSymmetryLine( const QModelIndex& ielts, - const QModelIndex& iv, - const QModelIndex& ivec ) +QModelIndexList DocumentModel::getQuadAssociations(const QModelIndex& iQuad) { - QModelIndex iElts; + QModelIndexList result; + QModelIndex geomQuadIndex; + HEXA_NS::Quad* quad = getHexaPtr(iQuad); + if (quad == NULL) return result; - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(iv); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); + if (HEXABLOCKGUI::currentDocGView == NULL) return result; + PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); + PatternGeomModel* pgm = HEXABLOCKGUI::currentDocGView->getPatternGeomModel(); + if (pgsm == NULL || pgm == NULL) return result; + HEXA_NS::FaceShape* geomFace; - HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryLine( hElts, hVex, hVec ); - if ( BadElement(hNewElts) ) return iElts; + int nbAssocs = quad->countAssociation(); + for (int i = 0; i < nbAssocs; ++i) + { + geomFace = quad->getAssociation(i); + if (geomFace == NULL) continue; - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(hNewElts); - _elementsDirItem->appendRow(eltsItem); - iElts = eltsItem->index(); + geomQuadIndex = pgsm->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(geomFace) ); + result << geomQuadIndex; + } - return iElts; + return result; } -QModelIndex DocumentModel::makeSymmetryPlane( const QModelIndex& ielts, const QModelIndex& iv, const QModelIndex& ivec ) +bool DocumentModel::associateOpenedLine( const QModelIndexList& iedges, + HEXA_NS::NewShapes shapes, + HEXA_NS::IntVector subIds, + double pstart, + double pend ) { - QModelIndex iElts; - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(iv); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); + HEXA_NS::Edges mline; - HEXA_NS::Elements* hNewElts = _hexaDocument->makeSymmetryPlane( hElts, hVex, hVec ); - if ( BadElement(hNewElts) ) return iElts; - - updateData(); //CS_TODO more or less? - ElementsItem* eltsItem = new ElementsItem(hNewElts); - _elementsDirItem->appendRow(eltsItem); - iElts = eltsItem->index(); + HEXA_NS::Edge* hedge = NULL; + foreach( const QModelIndex& iedge, iedges ){ + hedge = getHexaPtr(iedge); + if (hedge != NULL) + mline.push_back( hedge ); + } - return iElts; + int err = _hexaDocument->associateOpenedLine( mline, shapes, subIds, pstart, pend ); + if ( err == HOK ){ + updateData(); + return true; + } + return false; } - -bool DocumentModel::performTranslation( const QModelIndex& ielts, const QModelIndex& ivec ) +bool DocumentModel::associateClosedLine( const QModelIndex& ivertex, + const QModelIndexList& iedges, + HEXA_NS::NewShapes shapes, + HEXA_NS::IntVector subIds, + double pstart, + bool inv ) { - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); + HEXA_NS::Vertex* mfirst = getHexaPtr(ivertex); + HEXA_NS::Edges mline; - int r = _hexaDocument->performTranslation (hElts, hVec); - if ( r == HOK ){ //Job well done? + HEXA_NS::Edge* hedge = NULL; + foreach( const QModelIndex& iedge, iedges ){ + hedge = getHexaPtr(iedge); + if (hedge != NULL) + mline.push_back( hedge ); + } + + int err = _hexaDocument->associateClosedLine( mfirst, mline, shapes, subIds, pstart, inv); + if ( err == HOK ){ updateData(); return true; } - return false; } - +// ************ GROUPS ************ // -bool DocumentModel::performScale( const QModelIndex& ielts, const QModelIndex& ivex, double k ) +QModelIndex DocumentModel::addGroup( const QString& name, Group kind ) { - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(ivex); + QModelIndex iGroup; - int r = _hexaDocument->performScale (hElts, hVex, k); - if ( r == HOK ){ - updateData(); - return true; - } + HEXA_NS::Group* hGroup = _hexaDocument->addGroup( name.toLocal8Bit().constData(), kind ); + if ( hGroup == NULL ) return iGroup; - return false; + GroupItem* groupItem = new GroupItem(hGroup); + groupItem->setData( _entry, HEXA_DOC_ENTRY_ROLE ); + _groupDirItem->appendRow(groupItem); + iGroup = groupItem->index(); + + return iGroup; } -// -bool DocumentModel::performRotation( const QModelIndex& ielts, const QModelIndex& ivex, const QModelIndex& ivec, double angle ) + +bool DocumentModel::removeGroup( const QModelIndex& igrp ) { - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(ivex); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); + HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); + int r = _hexaDocument->removeGroup ( hGroup ); - int r = _hexaDocument-> performRotation( hElts, hVex, hVec, angle ); if ( r == HOK ){ - updateData(); + removeRow( igrp.row(), igrp.parent()); return true; } @@ -2053,1020 +1953,1744 @@ bool DocumentModel::performRotation( const QModelIndex& ielts, const QModelIndex } -// -bool DocumentModel::performSymmetryPoint( const QModelIndex& ielts, const QModelIndex& ivex ) +QModelIndexList DocumentModel::getGroupElements( const QModelIndex& iGroup, DocumentModel::Group& kind ) const { - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(ivex); + QModelIndexList iElements; - int r = _hexaDocument->performSymmetryPoint( hElts, hVex ); - if ( r == HOK ){ - updateData(); - return true; - } + HEXA_NS::Group* g = iGroup.data(HEXA_DATA_ROLE).value(); + if ( g == NULL ) return iElements; - return false; + QModelIndexList iFound; + QVariant q; + HEXA_NS::EltBase* eltBase = NULL; + int nbElement = g->countElement(); + for ( int nr = 0; nr < nbElement; ++nr ){ + eltBase = g->getElement( nr ); + kind = g->getKind(); + switch ( kind ){ + case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: q = QVariant::fromValue( (HEXA_NS::Hexa *)eltBase ); break; + case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: q = QVariant::fromValue( (HEXA_NS::Quad *)eltBase ); break; + case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: q = QVariant::fromValue( (HEXA_NS::Edge *)eltBase ); break; + case HEXA_NS::VertexNode: q = QVariant::fromValue( (HEXA_NS::Vertex *)eltBase ); break; + } + iFound = match( index(0, 0), + HEXA_DATA_ROLE, + q, + 1, + Qt::MatchRecursive ); + if ( !iFound.isEmpty() ) + iElements << iFound[0]; + } + return iElements; } +// 7.4 Boite: éditer un groupe +void DocumentModel::setGroupName( const QModelIndex& igrp, const QString& name ) +{ + HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); + + if ( hGroup ){ + hGroup->setName( name.toLocal8Bit().constData() ); + setData(igrp, QVariant::fromValue( name ) ); + } +} -bool DocumentModel::performSymmetryLine( const QModelIndex& ielts, const QModelIndex& ivex, const QModelIndex& ivec ) +bool DocumentModel::addGroupElement( const QModelIndex& igrp, const QModelIndex& ielt ) { - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(ivex); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); + HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); + if (hGroup == NULL) return false; - int r = _hexaDocument->performSymmetryLine( hElts, hVex, hVec ); - if ( r == HOK ){ - updateData(); - return true; + HEXA_NS::EltBase* hElt = NULL; + switch ( hGroup->getKind() ){ + case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: hElt = getHexaPtr(ielt); break; + case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: hElt = getHexaPtr(ielt); break; + case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: hElt = getHexaPtr(ielt); break; + case HEXA_NS::VertexNode: hElt = getHexaPtr(ielt); break; } + int res = HERR; + if ( hElt != NULL ) + res = hGroup->addElement( hElt ); + + if ( res == HOK ) return true; + return false; } +bool DocumentModel::removeGroupElement( const QModelIndex& igrp, int nro ) +{ //CS_TODO : remove child? + HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); + if (hGroup == NULL) return false; + + if (hGroup->removeElement( nro ) == HOK) return true; -bool DocumentModel::performSymmetryPlane( const QModelIndex& ielts, - const QModelIndex& ivex, - const QModelIndex& ivec ) + return false; +} + +bool DocumentModel::clearGroupElement( const QModelIndex& igrp ) { - HEXA_NS::Elements* hElts = getHexaPtr(ielts); - HEXA_NS::Vertex* hVex = getHexaPtr(ivex); - HEXA_NS::Vector* hVec = getHexaPtr(ivec); + HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); - int r = _hexaDocument->performSymmetryPlane( hElts, hVex, hVec ); - if ( r == HOK ){ - updateData(); + if ( hGroup != NULL) + { + hGroup->clearElement(); return true; } - return false; } -QModelIndex DocumentModel::revolutionQuads( const QModelIndexList& istartquads, - const QModelIndex& icenter, - const QModelIndex& ivecaxis, - const QList& angles ) -{ - QModelIndex ielts; +// ************ LAWS ************ - HEXA_NS::Quads hstartquads; - HEXA_NS::Quad* hquad = NULL; - foreach( const QModelIndex& iquad, istartquads){ - hquad = data( iquad, HEXA_DATA_ROLE ).value(); - hstartquads.push_back( hquad ); - } - HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); - HEXA_NS::Vector* haxis = getHexaPtr(ivecaxis); - std::vector hangles = angles.toVector().toStdVector(); +// +QModelIndex DocumentModel::addLaw( const QString& name, int nbnodes ) +{ + QModelIndex iLaw; - HEXA_NS::Elements* helts = _hexaDocument->revolutionQuads( hstartquads, hcenter, haxis, hangles ); - if ( BadElement(helts) ) return ielts; + HEXA_NS::Law* hLaw = _hexaDocument->addLaw( name.toLocal8Bit().constData(), nbnodes ); + if ( BadElement(hLaw) ) return iLaw; - updateData(); - ElementsItem* eltsItem = new ElementsItem(helts); - _elementsDirItem->appendRow(eltsItem); - ielts = eltsItem->index(); + LawItem* lawItem = new LawItem(hLaw); + _lawDirItem->appendRow(lawItem); + iLaw = lawItem->index(); - return ielts; + return iLaw; } -QModelIndex DocumentModel::replace( const QModelIndexList& iquadsPattern, - const QModelIndex& ip1, const QModelIndex& ic1, - const QModelIndex& ip2, const QModelIndex& ic2, - const QModelIndex& ip3, const QModelIndex& ic3 ) +bool DocumentModel::setLaw( const QModelIndex& ilaw, int nbnodes, double coeff, KindLaw type ) { - QModelIndex ielts; + bool ret = false; - HEXA_NS::Vertex* hp1 = getHexaPtr(ip1); - HEXA_NS::Vertex* hc1 = getHexaPtr(ic1); - HEXA_NS::Vertex* hp2 = getHexaPtr(ip2); - HEXA_NS::Vertex* hc2 = getHexaPtr(ic2); - HEXA_NS::Vertex* hp3 = getHexaPtr(ip3); - HEXA_NS::Vertex* hc3 = getHexaPtr(ic3); + HEXA_NS::Law* hLaw = data(ilaw, HEXA_DATA_ROLE).value(); - HEXA_NS::Quads hquads; - HEXA_NS::Quad* hquad = NULL; - foreach( const QModelIndex& iquad, iquadsPattern ){ - hquad = getHexaPtr(iquad); - hquads.push_back( hquad ); + if ( hLaw ){ + int ok; + ok = hLaw->setNodes( nbnodes ); + ( ok == HOK) ? ret = true : ret = false; + ok = hLaw->setCoefficient( coeff ); + hLaw->setKind(type); } - HEXA_NS::Elements* helts = _hexaDocument->replace( hquads, - hp1, hc1, hp2, hc2, hp3, hc3 ); - if ( BadElement(helts) ) return ielts; - - updateData(); - ElementsItem* eltsItem = new ElementsItem(helts); - _elementsDirItem->appendRow(eltsItem); - ielts = eltsItem->index(); - - return ielts; + return ret; } -// ************ ADD ASSOCIATION ************ // +bool DocumentModel::removeLaw( const QModelIndex& ilaw ) +{ + HEXA_NS::Law* hLaw = data(ilaw, HEXA_DATA_ROLE).value(); + int r = _hexaDocument->removeLaw( hLaw ); -//--------------- METHOD OBSOLETE -//void DocumentModel::addAssociation( const QModelIndex& iElt, const DocumentModel::GeomObj& assocIn ) -//{ -// // assocIn.name; -// HEXA_NS::Shape* assoc = new HEXA_NS::Shape( assocIn.brep.toStdString() );//CS_TODO : delete assoc -// assoc->setStart (assocIn.start); -// assoc->setEnd (assocIn.end); -// assoc->setIdent ( (assocIn.shapeName + "," + assocIn.subid).toStdString() ); -// -// QString currentAssoc, newAssoc; -// -// if ( data(iElt, HEXA_TREE_ROLE) == VERTEX_TREE ){ -// HEXA_NS::Vertex* hVex = getHexaPtr(iElt); -// hVex->setAssociation( assoc ); -// } else if ( data(iElt, HEXA_TREE_ROLE) == EDGE_TREE ){ -// HEXA_NS::Edge* hEdge = getHexaPtr(iElt); -// hEdge->addAssociation( assoc ); -// } else if ( data(iElt, HEXA_TREE_ROLE) == QUAD_TREE ){ -// HEXA_NS::Quad* hQuad = getHexaPtr(iElt); -// hQuad->addAssociation( assoc ); -// } -// -// currentAssoc = data( iElt, HEXA_ASSOC_ENTRY_ROLE ).toString(); -// if ( !currentAssoc.isEmpty() ){ -// newAssoc = currentAssoc + assocIn.shapeName + "," + assocIn.subid + ";"; -// } else { -// newAssoc = assocIn.shapeName + "," + assocIn.subid + ";"; -// } -// setData( iElt, QVariant::fromValue(newAssoc), HEXA_ASSOC_ENTRY_ROLE ); -//} -//-------------------------------- + if ( r == HOK ){ + removeRow( ilaw.row(), ilaw.parent()); + return true; + } + return false; +} -QMultiMap< QString, int > DocumentModel::getAssocShapesIds(const QModelIndex& dataIndex) +bool DocumentModel::setPropagation( const QModelIndex& iPropagation, const QModelIndex& iLaw, bool way ) { - QMultiMap< QString, int > result; - HEXA_NS::NewShape* mainShape; - HEXA_NS::VertexShape* node; - HEXA_NS::EdgeShape* line; - HEXA_NS::FaceShape* face; - QString shapeName; - int subid; - - PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel(); - QModelIndexList assocsInd = pdsm->getGeomAssociations(/*index*/dataIndex); - foreach( const QModelIndex& anAssoc, assocsInd ) - { - node = getHexaPtr(anAssoc); - line = getHexaPtr(anAssoc); - face = getHexaPtr(anAssoc); + HEXA_NS::Propagation* hPropagation = data(iPropagation, HEXA_DATA_ROLE).value(); + HEXA_NS::Law* hLaw = data(iLaw, HEXA_DATA_ROLE).value(); - if (node != NULL) - { - mainShape = node->getParentShape(); - if (mainShape != NULL) - { - shapeName = mainShape->getName(); - subid = node->getIdent(); - } - } - else if (line != NULL) - { - mainShape = line->getParentShape(); - if (mainShape != NULL) - { - shapeName = mainShape->getName(); - subid = line->getIdent(); - } - } - else if (face != NULL) - { - mainShape = face->getParentShape(); - if (mainShape != NULL) - { - shapeName = mainShape->getName(); - subid = face->getIdent(); - } - } + int r = hPropagation->setLaw( hLaw ); + hPropagation->setWay( way ); - if (!shapeName.isEmpty()) - result.insert( shapeName, subid ); + if ( r == HOK ) return true; - shapeName = QString(); - } - return result; + return false; } -bool DocumentModel::setVertexAssociation( const QModelIndex& iVertex, double x, double y, double z) + +QModelIndexList DocumentModel::getPropagation( const QModelIndex& iPropagation ) const { - HEXA_NS::Vertex* vertex = getHexaPtr(iVertex); + QModelIndexList iEdges; - if (vertex == NULL || _hexaDocument == NULL || vertex->setAssociation(x, y, z) != HOK) - return false; + QModelIndexList iFound; + HEXA_NS::Propagation* propa = iPropagation.data(HEXA_DATA_ROLE).value(); + if ( propa == NULL ) return iEdges; - setData( iVertex, QVariant::fromValue(QString::number(x)+","+QString::number(y)+","+QString::number(z)), HEXA_ASSOC_ENTRY_ROLE ); - return true; + const HEXA_NS::Edges& edges = propa->getEdges(); + for ( HEXA_NS::Edges::const_iterator anEdge = edges.begin(), endIt = edges.end(); + anEdge != endIt; + ++anEdge ){ + iFound = match( index(0, 0), + HEXA_DATA_ROLE, + QVariant::fromValue( *anEdge ), + 1, + Qt::MatchRecursive); + if ( !iFound.isEmpty() ) + iEdges << iFound[0]; + } + + return iEdges; } -bool DocumentModel::setVertexAssociation( const QModelIndex& iVertex, const QModelIndex& iGeomVertex) +HEXA_NS::Document* DocumentModel::documentImpl() { - //parameters control - QString newAssoc; - HEXA_NS::Vertex* vertex = getHexaPtr(iVertex); - HEXA_NS::VertexShape* geomVertex = getHexaPtr(iGeomVertex); - if (_hexaDocument == NULL || vertex == NULL || geomVertex == NULL) return false; - HEXA_NS::NewShape* mainShape = geomVertex->getParentShape(); - if (mainShape == NULL) return false; - - //add association - if (vertex->setAssociation(geomVertex) != HOK) - return false; - - //update association state in the model - newAssoc = QString(mainShape->getName()) + "," + QString::number(geomVertex->getIdent()) + ";"; - setData( iVertex, QVariant::fromValue(newAssoc), HEXA_ASSOC_ENTRY_ROLE ); - - return true; + return _hexaDocument; } -bool DocumentModel::addEdgeAssociation( const QModelIndex& iEdge, const QModelIndex& iGeomEdge, double start, double end) +QString DocumentModel::documentEntry() { - //parameters control - QString currentAssoc, newAssoc; - HEXA_NS::Edge* edge = getHexaPtr(iEdge); - HEXA_NS::EdgeShape* geomEdge = getHexaPtr(iGeomEdge); - if (_hexaDocument == NULL || edge == NULL || - geomEdge == NULL || start > end) return false; - HEXA_NS::NewShape* mainShape = geomEdge->getParentShape(); - if (mainShape == NULL) return false; + return _entry; +} - //add association in the engine side - if (edge->addAssociation(geomEdge, start, end) != HOK) - return false; +// 8.3 Boite: éditer une loi CS_TODO +// (idem création) - //add/update association in the model side (UI) - currentAssoc = data(iEdge, HEXA_ASSOC_ENTRY_ROLE).toString(); - newAssoc = QString(mainShape->getName()) + "," + QString::number(geomEdge->getIdent()) + ";"; - if (!currentAssoc.isEmpty()) newAssoc = currentAssoc + newAssoc; +/***************************************************************** + PatternDataModel + *****************************************************************/ - setData( iEdge, QVariant::fromValue(newAssoc), HEXA_ASSOC_ENTRY_ROLE ); +PatternDataModel::PatternDataModel( QObject * parent ) : + QSortFilterProxyModel( parent ) +{ + QString dataRegExp = QString("(%1|%2|%3|%4|%5|%6|%7|%8)"). + arg(VERTEX_TREE).arg(EDGE_TREE).arg(QUAD_TREE).arg(HEXA_TREE). + arg(VERTEX_DIR_TREE).arg(EDGE_DIR_TREE).arg(QUAD_DIR_TREE).arg(HEXA_DIR_TREE); - return true; + setFilterRole(HEXA_TREE_ROLE); + setFilterRegExp ( QRegExp(dataRegExp) ); } -bool DocumentModel::addQuadAssociation (const QModelIndex& iQuad, const QModelIndex& iGeomFace) -{ - //parameters control - QString currentAssoc, newAssoc; - HEXA_NS::Quad* quad = getHexaPtr(iQuad); - HEXA_NS::FaceShape* geomFace = getHexaPtr(iGeomFace); - if (_hexaDocument == NULL || quad == NULL || geomFace == NULL) - return false; - HEXA_NS::NewShape* mainShape = geomFace->getParentShape(); - if (mainShape == NULL) return false; +// *** Pour suppression des panneaux "Builder" et "Geometry" ****/ - //add association - if (quad->addAssociation(geomFace) != HOK) - return false; +//PatternDataModel::PatternDataModel( QObject * parent ) : +// QSortFilterProxyModel( parent ) +//{ +// QString dataRegExp = QString("(%1|%2|%3|%4|%5|%6|%7|%8|%9|%10|%11|%12|%13|%14|%15|%16|%17|%18|%19|%20|%21|%22|%23|%24|%25|%26)"). +// arg(VERTEX_TREE).arg(EDGE_TREE).arg(QUAD_TREE).arg(HEXA_TREE). +// arg(VERTEX_DIR_TREE).arg(EDGE_DIR_TREE).arg(QUAD_DIR_TREE). +// arg(HEXA_DIR_TREE).arg(VECTOR_TREE).arg(ELEMENTS_TREE). +// arg(VECTOR_DIR_TREE).arg(ELEMENTS_DIR_TREE). +// arg(IMPLICIT_SHAPES_TREE).arg(EXPLICIT_SHAPES_TREE).arg(CLOUD_OF_POINTS_TREE). +// arg(GEOMSHAPE_TREE).arg(GEOMPOINT_TREE).arg(GEOMEDGE_TREE).arg(GEOMFACE_TREE). +// arg(IMPLICIT_SHAPES_DIR_TREE).arg(EXPLICIT_SHAPES_DIR_TREE).arg(CLOUD_OF_POINTS_DIR_TREE). +// arg(GEOMSHAPE_DIR_TREE).arg(GEOMPOINT_DIR_TREE).arg(GEOMEDGE_DIR_TREE).arg(GEOMFACE_DIR_TREE); +// +// setFilterRole(HEXA_TREE_ROLE); +// setFilterRegExp ( QRegExp(dataRegExp) ); +//} - //update association - currentAssoc = data( iQuad, HEXA_ASSOC_ENTRY_ROLE).toString(); - newAssoc = QString(mainShape->getName()) + "," + QString::number(geomFace->getIdent()) + ";"; - if (!currentAssoc.isEmpty()) newAssoc = currentAssoc + newAssoc; - setData( iQuad, QVariant::fromValue(newAssoc), HEXA_ASSOC_ENTRY_ROLE ); +// **************** - return true; +PatternDataModel::~PatternDataModel() +{ } - -QModelIndex DocumentModel::getVertexAssociation(const QModelIndex& iVertex) +HEXA_NS::Document* PatternDataModel::documentImpl() { - HEXA_NS::Vertex* vertex = getHexaPtr(iVertex); - if (vertex == NULL) return QModelIndex(); + HEXA_NS::Document* doc = NULL; + DocumentModel *m = dynamic_cast( sourceModel() ); + if (m) doc = m->documentImpl(); + return doc; +} - //get the associated geom vertex - HEXA_NS::VertexShape* geomVertex = vertex->getAssoVertex(); - if (geomVertex == NULL) return QModelIndex(); +QString PatternDataModel::documentEntry() +{ + QString entry; + DocumentModel *m = dynamic_cast( sourceModel() ); + if (m) entry = m->documentEntry(); + return entry; +} - //convert geom vertex to qmodelindex - if (HEXABLOCKGUI::currentDocGView == NULL) return QModelIndex(); - PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); - PatternGeomModel* pgm = HEXABLOCKGUI::currentDocGView->getPatternGeomModel(); - if (pgsm == NULL || pgm == NULL) return QModelIndex(); +Qt::ItemFlags PatternDataModel::flags(const QModelIndex &index) const +{ + Qt::ItemFlags flags; - return pgm->mapToSource(pgsm->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(geomVertex) )); + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + flags = m->flags( mapToSource(index) ); + } + return flags; } -QList DocumentModel::getEdgeAssociations(const QModelIndex& iEdge) +QVariant PatternDataModel::headerData ( int section, Qt::Orientation orientation, int role ) const { - QList result; - HEXA_NS::Edge* edge = getHexaPtr(iEdge); - if (edge == NULL) return result; + if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ + return QVariant( "Data" ); + } else { + return QSortFilterProxyModel::headerData ( section, orientation, role ); + } +} - DocumentModel::GeomObj assoc; - HEXA_NS::EdgeShape* geomEdge; - HEXA_NS::AssoEdge* anEdgeAssoc; - HEXA_NS::NewShape* mainShape; - QString name; - int nbAssocs = edge->countAssociation(); - for (int i = 0; i < nbAssocs; ++i) - { - anEdgeAssoc = edge->getAssociation(i); - if (anEdgeAssoc == NULL) continue; - geomEdge = anEdgeAssoc->getEdgeShape(); - if (geomEdge == NULL) continue; - mainShape = geomEdge->getParentShape(); - if (mainShape == NULL) continue; // => les generatrices ne sont pas gerees pour le moment - assoc.shapeName = mainShape->getName(); - assoc.subid = QString::number(geomEdge->getIdent()); - assoc.start = anEdgeAssoc->getStart(); - assoc.end = anEdgeAssoc->getEnd(); - result << assoc; +QStandardItem* PatternDataModel::itemFromIndex ( const QModelIndex & index ) const +{ + QStandardItem *item = NULL; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + item = m->itemFromIndex( mapToSource(index) ); } - - return result; + return item; } - -QModelIndexList DocumentModel::getQuadAssociations(const QModelIndex& iQuad) +PatternBuilderModel::PatternBuilderModel( QObject * parent ) : + QSortFilterProxyModel( parent ) { - QModelIndexList result; - QModelIndex geomQuadIndex; - HEXA_NS::Quad* quad = getHexaPtr(iQuad); - if (quad == NULL) return result; + QString builderRegExp =QString("(%1|%2|%3|%4|%5|%6|%7|%8|%9|%10)"). + arg(VECTOR_TREE).arg(CYLINDER_TREE).arg(PIPE_TREE).arg(ELEMENTS_TREE). + arg(CROSSELEMENTS_TREE).arg(VECTOR_DIR_TREE).arg(CYLINDER_DIR_TREE). + arg(PIPE_DIR_TREE).arg(ELEMENTS_DIR_TREE).arg(CROSSELEMENTS_DIR_TREE); - if (HEXABLOCKGUI::currentDocGView == NULL) return result; - PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); - PatternGeomModel* pgm = HEXABLOCKGUI::currentDocGView->getPatternGeomModel(); - if (pgsm == NULL || pgm == NULL) return result; + setFilterRole( HEXA_TREE_ROLE ); + setFilterRegExp ( QRegExp( builderRegExp ) ); +} - HEXA_NS::FaceShape* geomFace; +PatternBuilderModel::~PatternBuilderModel() +{ +} - int nbAssocs = quad->countAssociation(); - for (int i = 0; i < nbAssocs; ++i) - { - geomFace = quad->getAssociation(i); - if (geomFace == NULL) continue; +Qt::ItemFlags PatternBuilderModel::flags(const QModelIndex &index) const +{ + Qt::ItemFlags flags; - geomQuadIndex = pgm->mapToSource(pgsm->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(geomFace) )); - result << geomQuadIndex; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + flags = m->flags( mapToSource(index) ); } - - return result; + return flags; } -//--------------- METHOD OBSOLETE -//QList DocumentModel::getAssociations( const QModelIndex& iElt ) -//{ -// QList res; -// DocumentModel::GeomObj assoc; -// -// //std::cout << "getAssociations() start" << std::endl; -// if ( data(iElt, HEXA_TREE_ROLE) == VERTEX_TREE ){ -// // HEXA_NS::Vertex* hVex = data(iElt, HEXA_DATA_ROLE).value(); -// HEXA_NS::Vertex *hVex = getHexaPtr(iElt); -// HEXA_NS::Shape* hShape = hVex->getAssociation(); -// QStringList shapeID; -// if ( hShape != NULL ){ -// assoc.shapeName = QString(); -// assoc.subid = QString::number(-1); -// assoc.brep = hShape->getBrep().c_str(); -// assoc.start = hShape->getStart(); -// assoc.end = hShape->getEnd(); -// -// shapeID = QString( hShape->getIdent().c_str() ).split(","); -// if ( shapeID.count() == 2 ){ -// assoc.shapeName = shapeID[0]; -// assoc.subid = shapeID[1].isEmpty()? QString::number(-1) : shapeID[1]; -// } -// res << assoc; -// } -// } else if ( data(iElt, HEXA_TREE_ROLE) == EDGE_TREE ){ -// HEXA_NS::Edge* hEdge = getHexaPtr(iElt); -// HEXA_NS::Shapes hShapes = hEdge->getAssociations(); -// QStringList shapeID; -// for ( HEXA_NS::Shapes::iterator it = hShapes.begin(); it != hShapes.end(); ++it){ -// assoc.shapeName = QString(); -// assoc.subid = QString::number(-1); -// assoc.brep = (*it)->getBrep().c_str(); -// assoc.start = (*it)->getStart(); -// assoc.end = (*it)->getEnd(); -// -// shapeID = QString( (*it)->getIdent().c_str() ).split(","); -// if ( shapeID.count() == 2 ){ -// assoc.shapeName = shapeID[0]; -// assoc.subid = shapeID[1].isEmpty()? QString::number(-1) : shapeID[1]; -// } -// res << assoc; -// } -// } else if ( data(iElt, HEXA_TREE_ROLE) == QUAD_TREE ){ -// HEXA_NS::Quad* hQuad = getHexaPtr(iElt); -// HEXA_NS::Shapes hShapes = hQuad->getAssociations(); -// QStringList shapeID; -// for ( HEXA_NS::Shapes::iterator it = hShapes.begin(); it != hShapes.end(); ++it){ -// assoc.shapeName = QString(); -// assoc.subid = QString::number(-1); -// assoc.brep = (*it)->getBrep().c_str(); -// assoc.start = (*it)->getStart(); -// assoc.end = (*it)->getEnd(); -// shapeID = QString( (*it)->getIdent().c_str() ).split(","); -// if ( shapeID.count() == 2 ){ -// assoc.shapeName = shapeID[0]; -// assoc.subid = shapeID[1].isEmpty()? QString::number(-1) : shapeID[1]; -// } -// -// res << assoc; -// } -// } -// -// return res; -//} -//---------------------------------- - -bool DocumentModel::associateOpenedLine( const QModelIndexList& iedges, - HEXA_NS::NewShapes shapes, - HEXA_NS::IntVector subIds, - double pstart, - double pend ) +QVariant PatternBuilderModel::headerData ( int section, Qt::Orientation orientation, int role ) const { - - HEXA_NS::Edges mline; - - HEXA_NS::Edge* hedge = NULL; - foreach( const QModelIndex& iedge, iedges ){ - hedge = getHexaPtr(iedge); - if (hedge != NULL) - mline.push_back( hedge ); + if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ + return QVariant( "Builder" ); + } else { + return QSortFilterProxyModel::headerData ( section, orientation, role ); } +} - int err = _hexaDocument->associateOpenedLine( mline, shapes, subIds, pstart, pend ); - if ( err == HOK ){ - updateData(); - return true; +QStandardItem* PatternBuilderModel::itemFromIndex ( const QModelIndex & index ) const +{ + QStandardItem *item = NULL; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + item = m->itemFromIndex( mapToSource(index) ); } - return false; + return item; } - -bool DocumentModel::associateClosedLine( const QModelIndex& ivertex, - const QModelIndexList& iedges, - HEXA_NS::NewShapes shapes, - HEXA_NS::IntVector subIds, - double pstart, - bool inv ) +//==================================================================== +// PatternGeomModel +//==================================================================== +PatternGeomModel::PatternGeomModel( QObject * parent ) : + QSortFilterProxyModel( parent ) { - HEXA_NS::Vertex* mfirst = getHexaPtr(ivertex); - HEXA_NS::Edges mline; + QString builderRegExp =QString("(%1|%2|%3|%4|%5|%6|%7|%8|%9|%10|%11|%12|%13|%14)"). + arg(EXPLICIT_SHAPES_TREE).arg(IMPLICIT_SHAPES_TREE).arg(CLOUD_OF_POINTS_TREE). + arg(GEOMSHAPE_TREE).arg(GEOMPOINT_TREE).arg(GEOMEDGE_TREE).arg(GEOMFACE_TREE). + arg(EXPLICIT_SHAPES_DIR_TREE).arg(IMPLICIT_SHAPES_DIR_TREE).arg(CLOUD_OF_POINTS_DIR_TREE). + arg(GEOMSHAPE_DIR_TREE).arg(GEOMPOINT_DIR_TREE).arg(GEOMEDGE_DIR_TREE).arg(GEOMFACE_DIR_TREE); - HEXA_NS::Edge* hedge = NULL; - foreach( const QModelIndex& iedge, iedges ){ - hedge = getHexaPtr(iedge); - if (hedge != NULL) - mline.push_back( hedge ); - } + setFilterRole( HEXA_TREE_ROLE ); + setFilterRegExp ( QRegExp(builderRegExp ) ); +} - int err = _hexaDocument->associateClosedLine( mfirst, mline, shapes, subIds, pstart, inv); - if ( err == HOK ){ - updateData(); - return true; - } - return false; +PatternGeomModel::~PatternGeomModel() +{ } -// ************ GROUPS ************ -// -QModelIndex DocumentModel::addGroup( const QString& name, Group kind ) +Qt::ItemFlags PatternGeomModel::flags(const QModelIndex &index) const { - QModelIndex iGroup; + Qt::ItemFlags flags; - HEXA_NS::Group* hGroup = _hexaDocument->addGroup( name.toLocal8Bit().constData(), kind ); - if ( hGroup == NULL ) return iGroup; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + flags = m->flags( mapToSource(index) ); + } + return flags; +} - GroupItem* groupItem = new GroupItem(hGroup); - groupItem->setData( _entry, HEXA_DOC_ENTRY_ROLE ); - _groupDirItem->appendRow(groupItem); - iGroup = groupItem->index(); +QVariant PatternGeomModel::headerData ( int section, Qt::Orientation orientation, int role ) const +{ + if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ + return QVariant( "Geometry" ); + } else { + return QSortFilterProxyModel::headerData ( section, orientation, role ); + } +} - return iGroup; +QStandardItem* PatternGeomModel::itemFromIndex ( const QModelIndex & index ) const +{ + QStandardItem *item = NULL; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + item = m->itemFromIndex( mapToSource(index) ); + } + return item; } +//============================================================== -// -bool DocumentModel::removeGroup( const QModelIndex& igrp ) +AssociationsModel::AssociationsModel( QObject * parent ) : + QSortFilterProxyModel( parent ) { - HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); - int r = _hexaDocument->removeGroup ( hGroup ); - - if ( r == HOK ){ - removeRow( igrp.row(), igrp.parent()); - return true; - } + QString assocRegExp; - return false; + setFilterRole( HEXA_TREE_ROLE ); + setFilterRegExp ( QRegExp(assocRegExp) ); } -/* -QModelIndex* DocumentModel::found(eltBase) + +AssociationsModel::~AssociationsModel() { - TODO_JMD } - */ -QModelIndexList DocumentModel::getGroupElements( const QModelIndex& iGroup, DocumentModel::Group& kind ) const +Qt::ItemFlags AssociationsModel::flags(const QModelIndex &index) const { - QModelIndexList iElements; - - HEXA_NS::Group* g = iGroup.data(HEXA_DATA_ROLE).value(); - if ( g == NULL ) return iElements; + Qt::ItemFlags flags; - QModelIndexList iFound; - QVariant q; - HEXA_NS::EltBase* eltBase = NULL; - for ( int nr = 0; nr < g->countElement(); ++nr ){ - eltBase = g->getElement( nr ); - kind = g->getKind(); - switch ( kind ){ - case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: q = QVariant::fromValue( (HEXA_NS::Hexa *)eltBase ); break; - case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: q = QVariant::fromValue( (HEXA_NS::Quad *)eltBase ); break; - case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: q = QVariant::fromValue( (HEXA_NS::Edge *)eltBase ); break; - case HEXA_NS::VertexNode: q = QVariant::fromValue( (HEXA_NS::Vertex *)eltBase ); break; - } - iFound = match( index(0, 0), - HEXA_DATA_ROLE, - q, - 1, - Qt::MatchRecursive ); - if ( !iFound.isEmpty() ) - iElements << iFound[0]; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + flags = m->flags( mapToSource(index) ); } - return iElements; + return flags; } -// 7.4 Boite: éditer un groupe -void DocumentModel::setGroupName( const QModelIndex& igrp, const QString& name ) +QVariant AssociationsModel::headerData ( int section, Qt::Orientation orientation, int role ) const { - HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); - - if ( hGroup ){ - hGroup->setName( name.toLocal8Bit().constData() ); - setData(igrp, QVariant::fromValue( name ) ); + if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ + return QVariant( "Associations" ); + } else { + return QSortFilterProxyModel::headerData ( section, orientation, role ); } - } -bool DocumentModel::addGroupElement( const QModelIndex& igrp, const QModelIndex& ielt ) -{ //CS_TODO : check input? add child? - // int addElement (EltBase* elt); - - HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); - if (hGroup == NULL) return false; - - HEXA_NS::EltBase* hElt = NULL; - switch ( hGroup->getKind() ){ - case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: hElt = getHexaPtr(ielt); break; - case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: hElt = getHexaPtr(ielt); break; - case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: hElt = getHexaPtr(ielt); break; - case HEXA_NS::VertexNode: hElt = getHexaPtr(ielt); break; +QStandardItem* AssociationsModel::itemFromIndex ( const QModelIndex & index ) const +{ + QStandardItem *item = NULL; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + item = m->itemFromIndex( mapToSource(index) ); } + return item; +} - int res = HERR; - if ( hElt != NULL ) - res = hGroup->addElement( hElt ); - - if ( res == HOK ) return true; +GroupsModel::GroupsModel( QObject * parent ) : + QSortFilterProxyModel( parent ) +{ + QString groupsRegExp =QString("(%1|%2)").arg(GROUP_TREE).arg(GROUP_DIR_TREE); - return false; + setFilterRole( HEXA_TREE_ROLE ); + setFilterRegExp ( QRegExp(groupsRegExp ) ); } -bool DocumentModel::removeGroupElement( const QModelIndex& igrp, int nro ) -{ //CS_TODO : remove child? - HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); - if (hGroup == NULL) return false; +GroupsModel::~GroupsModel() +{ +} - if (hGroup->removeElement( nro ) == HOK) return true; +Qt::ItemFlags GroupsModel::flags(const QModelIndex &index) const +{ + Qt::ItemFlags flags; - return false; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + flags = m->flags( mapToSource(index) ); + } + return flags; } -bool DocumentModel::clearGroupElement( const QModelIndex& igrp ) +QVariant GroupsModel::headerData ( int section, Qt::Orientation orientation, int role ) const { - HEXA_NS::Group* hGroup = data(igrp, HEXA_DATA_ROLE).value(); - - if ( hGroup != NULL) - { - hGroup->clearElement(); - return true; + if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ + return QVariant( "Groups" ); + } else { + return QSortFilterProxyModel::headerData ( section, orientation, role ); } - return false; } -// ************ LAWS ************ +QStandardItem* GroupsModel::itemFromIndex ( const QModelIndex & index ) const +{ + QStandardItem *item = NULL; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + item = m->itemFromIndex( mapToSource(index) ); + } + return item; +} -// -QModelIndex DocumentModel::addLaw( const QString& name, int nbnodes ) +QModelIndexList GroupsModel::getGroupElements( const QModelIndex& iGroup, DocumentModel::Group& kind ) const { - QModelIndex iLaw; + QModelIndexList elements; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + elements = m->getGroupElements( mapToSource(iGroup), kind ); + } + return elements; +} - HEXA_NS::Law* hLaw = _hexaDocument->addLaw( name.toLocal8Bit().constData(), nbnodes ); - if ( BadElement(hLaw) ) return iLaw; +MeshModel::MeshModel( QObject * parent ) : + QSortFilterProxyModel( parent ) +{ + QString meshRegExp =QString("(%1|%2|%3|%4)").arg(LAW_TREE).arg(LAW_DIR_TREE) .arg(PROPAGATION_TREE).arg(PROPAGATION_DIR_TREE); - LawItem* lawItem = new LawItem(hLaw); - _lawDirItem->appendRow(lawItem); - iLaw = lawItem->index(); + setFilterRole( HEXA_TREE_ROLE ); + setFilterRegExp ( QRegExp(meshRegExp) ); +} - return iLaw; +MeshModel::~MeshModel() +{ } -bool DocumentModel::setLaw( const QModelIndex& ilaw, int nbnodes, double coeff, KindLaw type ) +Qt::ItemFlags MeshModel::flags(const QModelIndex &index) const { - bool ret = false; + Qt::ItemFlags flags; - HEXA_NS::Law* hLaw = data(ilaw, HEXA_DATA_ROLE).value(); - - if ( hLaw ){ - int ok; - ok = hLaw->setNodes( nbnodes ); - ( ok == HOK) ? ret = true : ret = false; - ok = hLaw->setCoefficient( coeff ); - hLaw->setKind(type); + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + flags = m->flags( mapToSource(index) ); } - - return ret; + return flags; } -// -bool DocumentModel::removeLaw( const QModelIndex& ilaw ) +QVariant MeshModel::headerData ( int section, Qt::Orientation orientation, int role ) const { - HEXA_NS::Law* hLaw = data(ilaw, HEXA_DATA_ROLE).value(); - int r = _hexaDocument->removeLaw( hLaw ); - - if ( r == HOK ){ - removeRow( ilaw.row(), ilaw.parent()); - return true; + if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ + return QVariant( "Mesh" ); + } else { + return QSortFilterProxyModel::headerData ( section, orientation, role ); } +} - return false; +QStandardItem* MeshModel::itemFromIndex ( const QModelIndex & index ) const +{ + QStandardItem *item = NULL; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + item = m->itemFromIndex( mapToSource(index) ); + } + return item; } -bool DocumentModel::setPropagation( const QModelIndex& iPropagation, const QModelIndex& iLaw, bool way ) +QModelIndexList MeshModel::getPropagation( const QModelIndex& iPropagation ) const { - HEXA_NS::Propagation* hPropagation = data(iPropagation, HEXA_DATA_ROLE).value(); - HEXA_NS::Law* hLaw = data(iLaw, HEXA_DATA_ROLE).value(); + QModelIndexList edges; + DocumentModel *m = dynamic_cast( sourceModel() ); + if ( m != NULL ){ + edges = m->getPropagation( mapToSource(iPropagation) ); + } + return edges; +} - int r = hPropagation->setLaw( hLaw ); - hPropagation->setWay( way ); - if ( r == HOK ) return true; +// ================================== NEW ====================================== - return false; -} +// ===== CARTESIAN GRID -QModelIndexList DocumentModel::getPropagation( const QModelIndex& iPropagation ) const +QModelIndex DocumentModel::makeCartesianTop(int nx, int ny, int nz) { - QModelIndexList iEdges; + QModelIndex result; - QModelIndexList iFound; - HEXA_NS::Propagation* propa = iPropagation.data(HEXA_DATA_ROLE).value(); - if ( propa == NULL ) return iEdges; + HEXA_NS::Elements* helts = _hexaDocument->makeCartesianTop( nx, ny, nz ); + if ( BadElement(helts) ) + return result; - const HEXA_NS::Edges& edges = propa->getEdges(); - for ( HEXA_NS::Edges::const_iterator anEdge = edges.begin(); - anEdge != edges.end(); - ++anEdge ){ - iFound = match( index(0, 0), - HEXA_DATA_ROLE, - QVariant::fromValue( *anEdge ), - 1, - Qt::MatchRecursive); - if ( !iFound.isEmpty() ) - iEdges << iFound[0]; - } + result = addToElementsTree(helts); - return iEdges; + return result; } -HEXA_NS::Document* DocumentModel::documentImpl() +QModelIndex DocumentModel::makeCartesianUni(const QModelIndex& icenter, + const QModelIndex& ibase, const QModelIndex& ivec, const QModelIndex& iaxis, + double lx, double ly, double lz, int nx, int ny, int nz) { - return _hexaDocument; + QModelIndex result; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hbase = getHexaPtr(ibase); + HEXA_NS::Vector* hvec = getHexaPtr(ivec); + HEXA_NS::Vector* haxis = getHexaPtr(iaxis); + + HEXA_NS::Elements* helts = _hexaDocument->makeCartesianUni( hcenter, hbase, hvec, haxis, + lx, ly, lz, nx, ny, nz); + if ( BadElement(helts) ) + return result; + + result = addToElementsTree(helts); + + return result; } -QString DocumentModel::documentEntry() +QModelIndex DocumentModel::makeCartesian(const QModelIndex& icenter, + const QModelIndex& ibase, const QModelIndex& ivec, const QModelIndex& iaxis, + vector& radius, vector& angles, vector& heights) { - return _entry; -} + QModelIndex result; -// 8.3 Boite: éditer une loi CS_TODO -// (idem création) + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hbase = getHexaPtr(ibase); + HEXA_NS::Vector* hvec = getHexaPtr(ivec); + HEXA_NS::Vector* haxis = getHexaPtr(iaxis); -/***************************************************************** - PatternDataModel - *****************************************************************/ + HEXA_NS::Elements* helts = _hexaDocument->makeCartesian( hcenter, hbase, hvec, haxis, + radius, angles, heights); + if ( BadElement(helts) ) + return result; -PatternDataModel::PatternDataModel( QObject * parent ) : - QSortFilterProxyModel( parent ) -{ - QString dataRegExp = QString("(%1|%2|%3|%4|%5|%6|%7|%8)"). - arg(VERTEX_TREE).arg(EDGE_TREE).arg(QUAD_TREE).arg(HEXA_TREE). - arg(VERTEX_DIR_TREE).arg(EDGE_DIR_TREE).arg(QUAD_DIR_TREE).arg(HEXA_DIR_TREE); + result = addToElementsTree(helts); - setFilterRole(HEXA_TREE_ROLE); - setFilterRegExp ( QRegExp(dataRegExp) ); + return result; } -PatternDataModel::~PatternDataModel() -{ -} -HEXA_NS::Document* PatternDataModel::documentImpl() +// ===== SPHERE + +QModelIndex DocumentModel::makeSphereTop (int nr, int na, int nh) { - HEXA_NS::Document* doc = NULL; - DocumentModel *m = dynamic_cast( sourceModel() ); - if (m) doc = m->documentImpl(); - return doc; + QModelIndex result; + + HEXA_NS::Elements* helts = _hexaDocument->makeSphereTop( nr, na, nh ); + if ( BadElement(helts) ) + return result; + + result = addToElementsTree(helts); + + return result; } -QString PatternDataModel::documentEntry() +QModelIndex DocumentModel::makeSphereUni (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + double rtrou, double rext, double ang, + QModelIndex& ivplan, + int nr, int na, int nh) { - QString entry; - DocumentModel *m = dynamic_cast( sourceModel() ); - if (m) entry = m->documentEntry(); - return entry; + QModelIndex result; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvec_x = getHexaPtr(ivec_x); + HEXA_NS::Vector* hvec_z = getHexaPtr(ivec_z); + HEXA_NS::Vertex* hvplan = getHexaPtr(ivplan); + + HEXA_NS::Elements* helts = _hexaDocument->makeSphereUni( hcenter, hvec_x, hvec_z, + rtrou, rext, ang, hvplan, + nr, na, nh); + result = addToElementsTree(helts); + + return result; } -Qt::ItemFlags PatternDataModel::flags(const QModelIndex &index) const +QModelIndex DocumentModel::makeSphere (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + vector& tray, vector& tang, vector& thaut) { - Qt::ItemFlags flags; + QModelIndex result; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - flags = m->flags( mapToSource(index) ); - } - return flags; -} + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvec_x = getHexaPtr(ivec_x); + HEXA_NS::Vector* hvec_z = getHexaPtr(ivec_z); + HEXA_NS::Elements* helts = _hexaDocument->makeSphere( hcenter, hvec_x, hvec_z, + tray, tang, thaut); -QVariant PatternDataModel::headerData ( int section, Qt::Orientation orientation, int role ) const -{ - if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ - return QVariant( "Data" ); - } else { - return QSortFilterProxyModel::headerData ( section, orientation, role ); - } + result = addToElementsTree(helts); + + return result; } +// ====== SPHERICAL -QStandardItem* PatternDataModel::itemFromIndex ( const QModelIndex & index ) const +QModelIndex DocumentModel::makeSphericalTop (int nbre, int crit) { - QStandardItem *item = NULL; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - item = m->itemFromIndex( mapToSource(index) ); - } - return item; -} + QModelIndex result; -PatternBuilderModel::PatternBuilderModel( QObject * parent ) : - QSortFilterProxyModel( parent ) -{ - QString builderRegExp =QString("(%1|%2|%3|%4|%5|%6|%7|%8|%9|%10)"). - arg(VECTOR_TREE).arg(CYLINDER_TREE).arg(PIPE_TREE).arg(ELEMENTS_TREE). - arg(CROSSELEMENTS_TREE).arg(VECTOR_DIR_TREE).arg(CYLINDER_DIR_TREE). - arg(PIPE_DIR_TREE).arg(ELEMENTS_DIR_TREE).arg(CROSSELEMENTS_DIR_TREE); + HEXA_NS::Elements* helts = _hexaDocument->makeSphericalTop(nbre, crit); + if (BadElement(helts)) + return result; - setFilterRole( HEXA_TREE_ROLE ); - setFilterRegExp ( QRegExp(builderRegExp ) ); -} + result = addToElementsTree(helts); -PatternBuilderModel::~PatternBuilderModel() -{ + return result; } -Qt::ItemFlags PatternBuilderModel::flags(const QModelIndex &index) const +QModelIndex DocumentModel::makeSphericalUni (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + double rayon, + int nbre, int crit) { - // std::cout<<"PatternBuilderModel::flags()"<( sourceModel() ); - if ( m != NULL ){ - flags = m->flags( mapToSource(index) ); - } - return flags; + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvec_x = getHexaPtr(ivec_x); + HEXA_NS::Vector* hvec_z = getHexaPtr(ivec_z); + + HEXA_NS::Elements* helts = _hexaDocument->makeSphericalUni(hcenter, hvec_x, hvec_z, rayon, nbre, crit); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QVariant PatternBuilderModel::headerData ( int section, Qt::Orientation orientation, int role ) const +QModelIndex DocumentModel::makeSpherical (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + vector& rayon, + int crit) { - if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ - return QVariant( "Builder" ); - } else { - return QSortFilterProxyModel::headerData ( section, orientation, role ); - } + QModelIndex result; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvec_x = getHexaPtr(ivec_x); + HEXA_NS::Vector* hvec_z = getHexaPtr(ivec_z); + + HEXA_NS::Elements* helts = _hexaDocument->makeSpherical(hcenter, hvec_x, hvec_z, rayon, crit); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QStandardItem* PatternBuilderModel::itemFromIndex ( const QModelIndex & index ) const +// ===== RIND +QModelIndex DocumentModel::makeRindTop (int nr, int na, int nh) { - QStandardItem *item = NULL; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - item = m->itemFromIndex( mapToSource(index) ); - } - return item; + QModelIndex result; + + HEXA_NS::Elements* helts = _hexaDocument->makeRindTop(nr, na, nh); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -//==================================================================== -// PatternGeomModel -//==================================================================== -PatternGeomModel::PatternGeomModel( QObject * parent ) : - QSortFilterProxyModel( parent ) +QModelIndex DocumentModel::makeRindUni (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + double raytrou, double rint, double rext, double ang, + QModelIndex& ivplan, + int nr, int na, int nh) { - QString builderRegExp =QString("(%1|%2|%3|%4|%5|%6|%7|%8|%9|%10|%11|%12|%13|%14)"). - arg(EXPLICIT_SHAPES_TREE).arg(IMPLICIT_SHAPES_TREE).arg(CLOUD_OF_POINTS_TREE). - arg(GEOMSHAPE_TREE).arg(GEOMPOINT_TREE).arg(GEOMEDGE_TREE).arg(GEOMFACE_TREE). - arg(EXPLICIT_SHAPES_DIR_TREE).arg(IMPLICIT_SHAPES_DIR_TREE).arg(CLOUD_OF_POINTS_DIR_TREE). - arg(GEOMSHAPE_DIR_TREE).arg(GEOMPOINT_DIR_TREE).arg(GEOMEDGE_DIR_TREE).arg(GEOMFACE_DIR_TREE); + QModelIndex result; - setFilterRole( HEXA_TREE_ROLE ); - setFilterRegExp ( QRegExp(builderRegExp ) ); + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvec_x = getHexaPtr(ivec_x); + HEXA_NS::Vector* hvec_z = getHexaPtr(ivec_z); + HEXA_NS::Vertex* hvplan = getHexaPtr(ivplan); + + HEXA_NS::Elements* helts = _hexaDocument->makeRindUni(hcenter, hvec_x, hvec_z, raytrou, rint, rext, ang, + hvplan, nr, na, nh); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -PatternGeomModel::~PatternGeomModel() +QModelIndex DocumentModel::makeRind (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + vector& tray, vector& tang, vector& thaut) { + QModelIndex result; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvec_x = getHexaPtr(ivec_x); + HEXA_NS::Vector* hvec_z = getHexaPtr(ivec_z); + + HEXA_NS::Elements* helts = _hexaDocument->makeRind(hcenter, hvec_x, hvec_z, tray, tang, thaut); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -Qt::ItemFlags PatternGeomModel::flags(const QModelIndex &index) const +// ======== Cylinder +QModelIndex DocumentModel::makeCylinderTop(int nr, int na, int nh) { - Qt::ItemFlags flags; + QModelIndex result; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - flags = m->flags( mapToSource(index) ); - } - return flags; + HEXA_NS::Elements* helts = _hexaDocument->makeCylinderTop(nr, na, nh); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QVariant PatternGeomModel::headerData ( int section, Qt::Orientation orientation, int role ) const +QModelIndex DocumentModel::makeCylinderUni(QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, + double rint, double rext, double angle, double haut, + int nr, int na, int nh) { - if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ - return QVariant( "Geometry" ); - } else { - return QSortFilterProxyModel::headerData ( section, orientation, role ); - } + QModelIndex result; + + HEXA_NS::Vertex* horig = getHexaPtr(iorig); + HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); + HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); + + HEXA_NS::Elements* helts = _hexaDocument->makeCylinderUni(horig, hvecx, hvecz, + rint, rext, angle, haut, + nr, na, nh); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QStandardItem* PatternGeomModel::itemFromIndex ( const QModelIndex & index ) const +QModelIndex DocumentModel::makeCylinder(QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, + vector& tray, vector& tang, vector& thaut) { - QStandardItem *item = NULL; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - item = m->itemFromIndex( mapToSource(index) ); - } - return item; -} -//============================================================== + QModelIndex result; + HEXA_NS::Vertex* horig = getHexaPtr(iorig); + HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); + HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); + HEXA_NS::Elements* helts = _hexaDocument->makeCylinder(horig, hvecx, hvecz, tray, tang, thaut); + if (BadElement(helts)) + return result; -AssociationsModel::AssociationsModel( QObject * parent ) : - QSortFilterProxyModel( parent ) -{ - QString assocRegExp;// =QString("(%1|%2)").arg(GROUP_TREE).arg(GROUP_DIR_TREE); CS_TODO + result = addToElementsTree(helts); - setFilterRole( HEXA_TREE_ROLE ); - setFilterRegExp ( QRegExp(assocRegExp) ); + return result; } -AssociationsModel::~AssociationsModel() + +// ======== Cylinders +QModelIndex DocumentModel::makeCylinders(QModelIndex& iorig1, QModelIndex& ivecz1, double r1, double h1, + QModelIndex& iorig2, QModelIndex& ivecz2, double r2, double h2) { -} + QModelIndex result; -Qt::ItemFlags AssociationsModel::flags(const QModelIndex &index) const + HEXA_NS::Vertex* horig1 = getHexaPtr(iorig1); + HEXA_NS::Vertex* horig2 = getHexaPtr(iorig2); + HEXA_NS::Vector* hvecz1 = getHexaPtr(ivecz1); + HEXA_NS::Vector* hvecz2 = getHexaPtr(ivecz2); + + HEXA_NS::BiCylinder* helts = _hexaDocument->makeCylinders(horig1, hvecz1, r1, h1, + horig2, hvecz2, r2, h2); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; +} + +// =========== PIPE +QModelIndex DocumentModel::makePipeTop(int nr, int na, int nh) { - Qt::ItemFlags flags; + QModelIndex result; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - flags = m->flags( mapToSource(index) ); - } - return flags; + HEXA_NS::Elements* helts = _hexaDocument->makePipeTop(nr, na, nh); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QVariant AssociationsModel::headerData ( int section, Qt::Orientation orientation, int role ) const +QModelIndex DocumentModel::makePipeUni(QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, + double rint, double rext, double angle, double haut, + int nr, int na, int nh) { - if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ - return QVariant( "Associations" ); - } else { - return QSortFilterProxyModel::headerData ( section, orientation, role ); - } + QModelIndex result; + + HEXA_NS::Vertex* horig = getHexaPtr(iorig); + HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); + HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); + + HEXA_NS::Elements* helts = _hexaDocument->makePipeUni(horig, hvecx, hvecz, rint, rext, angle, + haut, nr, na, nh); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QStandardItem* AssociationsModel::itemFromIndex ( const QModelIndex & index ) const +QModelIndex DocumentModel::makePipe(QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, + vector& tray, vector& tang, vector& thaut) { - QStandardItem *item = NULL; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - item = m->itemFromIndex( mapToSource(index) ); - } - return item; + QModelIndex result; + + HEXA_NS::Vertex* horig = getHexaPtr(iorig); + HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); + HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); + + HEXA_NS::Elements* helts = _hexaDocument->makePipe(horig, hvecx, hvecz, tray, tang, thaut); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -GroupsModel::GroupsModel( QObject * parent ) : - QSortFilterProxyModel( parent ) +// ======== Pipes +QModelIndex DocumentModel::makePipes(QModelIndex& iorig1, QModelIndex& ivecz1, double rint1, double rex1, double h1, + QModelIndex& iorig2, QModelIndex& ivecz2, double rint2, double rex2, double h2) { - QString groupsRegExp =QString("(%1|%2)").arg(GROUP_TREE).arg(GROUP_DIR_TREE); + QModelIndex result; - setFilterRole( HEXA_TREE_ROLE ); - setFilterRegExp ( QRegExp(groupsRegExp ) ); + HEXA_NS::Vertex* horig1 = getHexaPtr(iorig1); + HEXA_NS::Vertex* horig2 = getHexaPtr(iorig2); + HEXA_NS::Vector* hvecz1 = getHexaPtr(ivecz1); + HEXA_NS::Vector* hvecz2 = getHexaPtr(ivecz2); + + HEXA_NS::BiCylinder* helts = _hexaDocument->makePipes(horig1, hvecz1, rint1, rex1, h1, + horig2, hvecz2, rint2, rex2, h2); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -GroupsModel::~GroupsModel() +// ======== Join Quads +QModelIndex DocumentModel::joinQuadUni(QModelIndex& istart, QModelIndex& idest, QModelIndex& iv1, QModelIndex& iv2, + QModelIndex& iv3, QModelIndex& iv4, int nb) { + QModelIndex result; + + HEXA_NS::Quad* hstart = getHexaPtr(istart); + HEXA_NS::Quad* hdest = getHexaPtr(idest); + HEXA_NS::Vertex* hv1 = getHexaPtr(iv1); + HEXA_NS::Vertex* hv2 = getHexaPtr(iv2); + HEXA_NS::Vertex* hv3 = getHexaPtr(iv3); + HEXA_NS::Vertex* hv4 = getHexaPtr(iv4); + + HEXA_NS::Elements* helts = _hexaDocument->joinQuadUni(hstart, hdest, hv1, hv2, hv3, hv4, nb); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -Qt::ItemFlags GroupsModel::flags(const QModelIndex &index) const +QModelIndex DocumentModel::joinQuad(QModelIndex& istart, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1, + QModelIndex& iva2, QModelIndex& ivb2, vector& tlen) { - Qt::ItemFlags flags; + QModelIndex result; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - flags = m->flags( mapToSource(index) ); - } - return flags; + HEXA_NS::Quad* hstart = getHexaPtr(istart); + HEXA_NS::Quad* hdest = getHexaPtr(idest); + HEXA_NS::Vertex* hva1 = getHexaPtr(iva1); + HEXA_NS::Vertex* hvb1 = getHexaPtr(ivb1); + HEXA_NS::Vertex* hva2 = getHexaPtr(iva2); + HEXA_NS::Vertex* hvb2 = getHexaPtr(ivb2); + + HEXA_NS::Elements* helts = _hexaDocument->joinQuad(hstart, hdest, hva1, hvb1, hva2, hvb2, tlen); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QVariant GroupsModel::headerData ( int section, Qt::Orientation orientation, int role ) const +QModelIndex DocumentModel::joinQuadsUni(QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iv1, QModelIndex& iv2, + QModelIndex& iv3, QModelIndex& iv4, int nb) { - if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ - return QVariant( "Groups" ); - } else { - return QSortFilterProxyModel::headerData ( section, orientation, role ); - } + QModelIndex result; + + HEXA_NS::Quads hstarts; + int nbQuads = istarts.size(); + for (int i = 0; i < nbQuads; ++i) + hstarts.push_back(getHexaPtr(istarts[i])); + + HEXA_NS::Quad* hdest = getHexaPtr(idest); + HEXA_NS::Vertex* hv1 = getHexaPtr(iv1); + HEXA_NS::Vertex* hv2 = getHexaPtr(iv2); + HEXA_NS::Vertex* hv3 = getHexaPtr(iv3); + HEXA_NS::Vertex* hv4 = getHexaPtr(iv4); + + HEXA_NS::Elements* helts = _hexaDocument->joinQuadsUni(hstarts, hdest, hv1, hv2, hv3, hv4, nb); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QStandardItem* GroupsModel::itemFromIndex ( const QModelIndex & index ) const +QModelIndex DocumentModel::joinQuads(QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1, + QModelIndex& iva2, QModelIndex& ivb2, vector& tlen) { - QStandardItem *item = NULL; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - item = m->itemFromIndex( mapToSource(index) ); - } - return item; + QModelIndex result; + + HEXA_NS::Quads hstarts; + int nbQuads = istarts.size(); + for (int i = 0; i < nbQuads; ++i) + hstarts.push_back(getHexaPtr(istarts[i])); + + HEXA_NS::Quad* hdest = getHexaPtr(idest); + HEXA_NS::Vertex* hva1 = getHexaPtr(iva1); + HEXA_NS::Vertex* hvb1 = getHexaPtr(ivb1); + HEXA_NS::Vertex* hva2 = getHexaPtr(iva2); + HEXA_NS::Vertex* hvb2 = getHexaPtr(ivb2); + + HEXA_NS::Elements* helts = _hexaDocument->joinQuads(hstarts, hdest, hva1, hvb1, hva2, hvb2, tlen); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QModelIndexList GroupsModel::getGroupElements( const QModelIndex& iGroup, DocumentModel::Group& kind ) const +// ======== Quad Revolution +QModelIndex DocumentModel::revolutionQuadUni(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis, + double angle, int nbre) { - QModelIndexList elements; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - elements = m->getGroupElements( mapToSource(iGroup), kind ); - } - return elements; + QModelIndex result; + + HEXA_NS::Quad* hstart = getHexaPtr(istart); + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* haxis = getHexaPtr(iaxis); + + HEXA_NS::Elements* helts = _hexaDocument->revolutionQuadUni(hstart, hcenter, haxis, angle, nbre); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -MeshModel::MeshModel( QObject * parent ) : - QSortFilterProxyModel( parent ) +QModelIndex DocumentModel::revolutionQuad(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis, + vector& angles) { - QString meshRegExp =QString("(%1|%2|%3|%4)").arg(LAW_TREE).arg(LAW_DIR_TREE) .arg(PROPAGATION_TREE).arg(PROPAGATION_DIR_TREE); + QModelIndex result; - setFilterRole( HEXA_TREE_ROLE ); - setFilterRegExp ( QRegExp(meshRegExp) ); + HEXA_NS::Quad* hstart = getHexaPtr(istart); + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* haxis = getHexaPtr(iaxis); + + HEXA_NS::Elements* helts = _hexaDocument->revolutionQuad(hstart, hcenter, haxis, angles); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -MeshModel::~MeshModel() +QModelIndex DocumentModel::revolutionQuadsUni(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis, + double angle, int nbre) +{ + QModelIndex result; + + HEXA_NS::Quads hstarts; + int nbQuads = istarts.count(); + for (int i = 0; i < nbQuads; ++i) + hstarts.push_back(getHexaPtr(istarts[i])); + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* haxis = getHexaPtr(iaxis); + + HEXA_NS::Elements* helts = _hexaDocument->revolutionQuadsUni(hstarts, hcenter, haxis, angle, nbre); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; +} + +QModelIndex DocumentModel::revolutionQuads(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis, + vector& angles) { + QModelIndex result; + + HEXA_NS::Quads hstarts; + int nbQuads = istarts.count(); + for (int i = 0; i < nbQuads; ++i) + hstarts.push_back(getHexaPtr(istarts[i])); + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* haxis = getHexaPtr(iaxis); + + HEXA_NS::Elements* helts = _hexaDocument->revolutionQuads(hstarts, hcenter, haxis, angles); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; + } -Qt::ItemFlags MeshModel::flags(const QModelIndex &index) const +// ==== PrismQuad or ExtrudeQuad +QModelIndex DocumentModel::extrudeQuadTop(QModelIndex& istart, int nbre) { - Qt::ItemFlags flags; + QModelIndex result; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - flags = m->flags( mapToSource(index) ); - } - return flags; + HEXA_NS::Quad* hstart = getHexaPtr(istart); + HEXA_NS::Elements* helts = _hexaDocument->extrudeQuadTop(hstart, nbre); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QVariant MeshModel::headerData ( int section, Qt::Orientation orientation, int role ) const +QModelIndex DocumentModel::extrudeQuadUni(QModelIndex& istart, QModelIndex& dv, double len, int nbre) { - if ( section == 0 and orientation == Qt::Horizontal and role == Qt::DisplayRole ){ - return QVariant( "Mesh" ); - } else { - return QSortFilterProxyModel::headerData ( section, orientation, role ); - } + QModelIndex result; + + HEXA_NS::Quad* hstart = getHexaPtr(istart); + HEXA_NS::Vector* hvec = getHexaPtr(dv); + + HEXA_NS::Elements* helts = _hexaDocument->extrudeQuadUni(hstart, hvec, len, nbre); + if (BadElement(helts)) + return result; + + result = addToElementsTree(helts); + + return result; } -QStandardItem* MeshModel::itemFromIndex ( const QModelIndex & index ) const +QModelIndex DocumentModel::extrudeQuad(QModelIndex& istart, QModelIndex& dv, vector& tlen) { - QStandardItem *item = NULL; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - item = m->itemFromIndex( mapToSource(index) ); - } - return item; + QModelIndex result; + + HEXA_NS::Quad* hstart = getHexaPtr(istart); + HEXA_NS::Vector* hvec = getHexaPtr(dv); + + HEXA_NS::Elements* helts = _hexaDocument->extrudeQuad(hstart, hvec, tlen); + if (BadElement(helts)) + return result; + result = addToElementsTree(helts); + + return result; } -QModelIndexList MeshModel::getPropagation( const QModelIndex& iPropagation ) const +QModelIndex DocumentModel::extrudeQuadsTop (QModelIndexList& istarts, int nbre) { - QModelIndexList edges; - DocumentModel *m = dynamic_cast( sourceModel() ); - if ( m != NULL ){ - edges = m->getPropagation( mapToSource(iPropagation) ); - } - return edges; + QModelIndex result; + + HEXA_NS::Quads hquads; + int nbQuads = istarts.count(); + for (int i = 0; i < nbQuads; ++i) + hquads.push_back(getHexaPtr(istarts[i])); + + HEXA_NS::Elements* helts = _hexaDocument->extrudeQuadsTop(hquads, nbre); + if (BadElement(helts)) + return result; + result = addToElementsTree(helts); + + return result; +} + +QModelIndex DocumentModel::extrudeQuadsUni (QModelIndexList& istarts, QModelIndex& axis, double len, int nbre) +{ + QModelIndex result; + + HEXA_NS::Quads hquads; + int nbQuads = istarts.count(); + for (int i = 0; i < nbQuads; ++i) + hquads.push_back(getHexaPtr(istarts[i])); + + HEXA_NS::Vector* haxis = getHexaPtr(axis); + + HEXA_NS::Elements* helts = _hexaDocument->extrudeQuadsUni(hquads, haxis, len, nbre); + if (BadElement(helts)) + return result; + result = addToElementsTree(helts); + + return result; +} + +QModelIndex DocumentModel::extrudeQuads(QModelIndexList& istarts, QModelIndex& iaxis, vector& tlen) +{ + QModelIndex result; + + HEXA_NS::Quads hquads; + int nbQuads = istarts.count(); + for (int i=0; i < nbQuads; ++i) + hquads.push_back(getHexaPtr(istarts[i])); + + HEXA_NS::Vector* haxis = getHexaPtr(iaxis); + + HEXA_NS::Elements* helts = _hexaDocument->extrudeQuads(hquads, haxis, tlen); + if (BadElement(helts)) + return result; + result = addToElementsTree(helts); + + return result; +} + +// ==== Cut Edge +QModelIndex DocumentModel::cutUni(QModelIndex& iEdge, int nbre) +{ + QModelIndex result; + + HEXA_NS::Edge* hedge = getHexaPtr(iEdge); + + HEXA_NS::Elements* helts = _hexaDocument->cutUni(hedge, nbre); + if (BadElement(helts)) + return result; + result = addToElementsTree(helts); + + return result; +} + +QModelIndex DocumentModel::cut(QModelIndex& iEdge, vector& tlen) +{ + QModelIndex result; + + HEXA_NS::Edge* hedge = getHexaPtr(iEdge); + + HEXA_NS::Elements* helts = _hexaDocument->cut(hedge, tlen); + if (BadElement(helts)) + return result; + result = addToElementsTree(helts); + + return result; +} + +// ================================== END NEW ================================== + + +// ================================== OBSOLETE ============================================= + +QModelIndex DocumentModel::makeCartesian( const QModelIndex& i_pt, + const QModelIndex& i_vec_x, const QModelIndex& i_vec_y, const QModelIndex& i_vec_z, + long nx, long ny, long nz) +{ + QModelIndex eltsIndex; + + HEXA_NS::Vertex* hpt = getHexaPtr(i_pt); + HEXA_NS::Vector* hvec_x = getHexaPtr(i_vec_x); + HEXA_NS::Vector* hvec_y = getHexaPtr(i_vec_y); + HEXA_NS::Vector* hvec_z = getHexaPtr(i_vec_z); + + HEXA_NS::Elements* new_helts = _hexaDocument->makeCartesian( hpt, + hvec_x, hvec_y, hvec_z, + nx, ny, nz ); + if ( BadElement(new_helts) ) + return eltsIndex; + + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(new_helts); + _elementsDirItem->appendRow(eltsItem); + eltsIndex = eltsItem->index(); + + return eltsIndex; } + +QModelIndex DocumentModel::makeCartesian( const QModelIndex& ivex, + const QModelIndex& ivec, + int nx, int ny, int nz ) +{ + QModelIndex iElts; + + HEXA_NS::Vertex* hVex = getHexaPtr(ivex); + HEXA_NS::Vector* hVec = getHexaPtr(ivec); + + HEXA_NS::Elements* hElts = _hexaDocument->makeCartesian( hVex, + hVec, + nx, ny, nz ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +QModelIndex DocumentModel::makeCylindrical( const QModelIndex& i_pt, + const QModelIndex& i_vec_x, const QModelIndex& i_vec_z, + double dr, double da, double dl, + long nr, long na, long nl, + bool fill ) +{ + + QModelIndex eltsIndex; + + HEXA_NS::Vertex* hpt = getHexaPtr(i_pt); + HEXA_NS::Vector* hvec_x = getHexaPtr(i_vec_x); + HEXA_NS::Vector* hvec_z = getHexaPtr(i_vec_z); + + HEXA_NS::Elements* new_helts = _hexaDocument->makeCylindrical( hpt, hvec_x, hvec_z, dr, da, dl, nr, na, nl, fill ); + if ( BadElement(new_helts) ) return eltsIndex; + + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(new_helts); + _elementsDirItem->appendRow(eltsItem); + eltsIndex = eltsItem->index(); + + return eltsIndex; +} + +QModelIndex DocumentModel::makeCylindricals( + const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& iheight, + QList< double> radius, QList angles, QList heights, + bool fill ) //HEXA3 +{ + QModelIndex eltsIndex; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hbase =getHexaPtr(ibase); + HEXA_NS::Vector* hheight = getHexaPtr(iheight); + + std::vector r = radius.toVector().toStdVector(); + std::vector a = angles.toVector().toStdVector(); + std::vector h = heights.toVector().toStdVector(); + + HEXA_NS::Elements* helts = _hexaDocument->makeCylindricals( + hcenter, hbase, hheight, + r, a, h, + fill ); + if ( BadElement(helts) ) return eltsIndex; + + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(helts); + _elementsDirItem->appendRow(eltsItem); + eltsIndex = eltsItem->index(); + + return eltsIndex; +} + +QModelIndex DocumentModel::makeSpherical( const QModelIndex& iv, const QModelIndex& ivec, int nb, double k) +{ + QModelIndex iElts; + +// HEXA_NS::Vertex* hv = getHexaPtr(iv); +// HEXA_NS::Vector* hvec = getHexaPtr(ivec); +// +// HEXA_NS::Elements* hElts = _hexaDocument->makeSpherical( hv, hvec, nb, k ); // OBSOLETE +// HEXA_NS::Elements* hElts = NULL; +// if ( BadElement(hElts) ) return iElts; +// +// updateData(); //CS_TODO more or less? +// ElementsItem* elts = new ElementsItem(hElts); +// _elementsDirItem->appendRow(elts); +// iElts = elts->index(); + + return iElts; +} + +QModelIndex DocumentModel::makeSpherical( const QModelIndex& icenter, double radius, int nb, double k ) +{ + QModelIndex iElts; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + + HEXA_NS::Elements* helts = _hexaDocument->makeSpherical( hcenter, radius, nb, k ); + if ( BadElement(helts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(helts); + _elementsDirItem->appendRow(eltsItem); + iElts = eltsItem->index(); + + return iElts; +} + +QModelIndex DocumentModel::makeCylinder( const QModelIndex& icyl, const QModelIndex& ivec, + int nr, int na, int nl ) +{ + QModelIndex iElts; + + HEXA_NS::Cylinder* hcyl = getHexaPtr(icyl); + HEXA_NS::Vector* hvec = getHexaPtr(ivec); + + HEXA_NS::Elements* hElts = _hexaDocument->makeCylinder( hcyl, hvec, nr, na, nl ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +QModelIndex DocumentModel::makeCylinders(const QModelIndex& icyl1, const QModelIndex& icyl2) +{ //CS_TODO + QModelIndex iCrossElts; + + HEXA_NS::Cylinder* hCyl1 = getHexaPtr(icyl1); + HEXA_NS::Cylinder* hCyl2 = getHexaPtr(icyl2); + + HEXA_NS::CrossElements* hCrossElts = _hexaDocument->makeCylinders( hCyl1, hCyl2 ); + if ( BadElement(hCrossElts) ) return iCrossElts; + + updateData(); //CS_TODO more or less? + ElementsItem* crossElts = new ElementsItem(hCrossElts); + _crossElementsDirItem->appendRow(crossElts); + iCrossElts = crossElts->index(); + + return iCrossElts; +} + +QModelIndex DocumentModel::addEdgeVector( const QModelIndex &i_v, const QModelIndex &i_vec ) +{ + QModelIndex edgeIndex; + + HEXA_NS::Vertex* hv = getHexaPtr(i_v); + HEXA_NS::Vector* hvec = getHexaPtr(i_vec); + + if (!hv || !hvec) return edgeIndex; + +// HEXA_NS::Edge* he = _hexaDocument->addEdge( hv, hvec ); //OBSOLETE + HEXA_NS::Edge* he = NULL; + if ( BadElement(he) ) return edgeIndex; + + HEXA_NS::Vertex* hv2 = he->getAval(); //the new vertex resulting from the creation of the edge + if (hv2 == NULL) return edgeIndex; + + //ADD the elements in the treeview + //The Edge + EdgeItem* e = new EdgeItem(he, _entry); + _edgeDirItem->appendRow(e); + + //The resulting Vertex + VertexItem* v = new VertexItem(hv2, _entry); + _vertexDirItem->appendRow(v); + edgeIndex = e->index(); + emit patternDataChanged(); + + return edgeIndex; +} + +QModelIndex DocumentModel::addCylinder( const QModelIndex &iv, const QModelIndex &ivec, double r, double h ) +{ + QModelIndex iCyl; + + HEXA_NS::Vertex* hv = getHexaPtr(iv); + HEXA_NS::Vector* hvec = getHexaPtr(ivec); + + HEXA_NS::Cylinder* hcyl = _hexaDocument->addCylinder( hv, hvec, r, h ); + if ( BadElement(hcyl) ) return iCyl; + + CylinderItem* cyl = new CylinderItem(hcyl); + _cylinderDirItem->appendRow(cyl); + iCyl = cyl->index(); + + return iCyl; +} + + +QModelIndex DocumentModel::addPipe( const QModelIndex &iv, const QModelIndex &ivec, double ri, double re, double h ) +{ + QModelIndex iPipe; + + HEXA_NS::Vertex* hv = getHexaPtr(iv); + HEXA_NS::Vector* hvec = getHexaPtr(ivec); + + HEXA_NS::Pipe* hPipe = _hexaDocument->addPipe( hv, hvec, ri, re, h ); + if ( BadElement(hPipe) ) return iPipe; + + PipeItem* pipe = new PipeItem(hPipe); + _pipeDirItem->appendRow(pipe); + iPipe = pipe->index(); + + return iPipe; +} + +QModelIndex DocumentModel::makePipe( const QModelIndex& ipipe, const QModelIndex& ivecx, + int nr, int na, int nl ) +{ + QModelIndex iElts; + + HEXA_NS::Pipe* hPipe = getHexaPtr(ipipe); + HEXA_NS::Vector* hVecx = getHexaPtr(ivecx); + + HEXA_NS::Elements* hElts = _hexaDocument->makePipe( hPipe, hVecx, nr, na, nl ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +// +QModelIndex DocumentModel::makePipes( const QModelIndex& ipipe1, const QModelIndex& ipipe2 ) +{ + QModelIndex iCrossElts; + + HEXA_NS::Pipe* hPipe1 = getHexaPtr(ipipe1); + HEXA_NS::Pipe* hPipe2 = getHexaPtr(ipipe2); + + HEXA_NS::CrossElements* hCrossElts = _hexaDocument->makePipes( hPipe1, hPipe2 ); + if ( BadElement(hCrossElts) ) return iCrossElts; + + updateData(); //CS_TODO more or less? + ElementsItem* crossElts = new ElementsItem(hCrossElts); + _crossElementsDirItem->appendRow(crossElts); + iCrossElts = crossElts->index(); + + return iCrossElts; +} + +QModelIndex DocumentModel::makeRind( const QModelIndex& icenter, + const QModelIndex& ivecx, const QModelIndex& ivecz, + double radext, double radint, double radhole, + const QModelIndex& iplorig, + int nrad, int nang, int nhaut ) +{ + QModelIndex iElts; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); + HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); + HEXA_NS::Vertex* hplorig = getHexaPtr(iplorig); + + HEXA_NS::Elements* hElts = _hexaDocument->makeRind( hcenter, + hvecx, hvecz, + radext, radint, radhole, + hplorig, + nrad, nang, nhaut ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* eltsItem = new ElementsItem(hElts); + _elementsDirItem->appendRow(eltsItem); + iElts = eltsItem->index(); + + return iElts; +} + +QModelIndex DocumentModel::makePartRind( const QModelIndex& icenter, + const QModelIndex& ivecx, const QModelIndex& ivecz, + double radext, double radint, double radhole, + const QModelIndex& iplorig, double angle, + int nrad, int nang, int nhaut ) +{ + QModelIndex iElts; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); + HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); + HEXA_NS::Vertex* hplorig = getHexaPtr(iplorig); + + HEXA_NS::Elements* hElts = _hexaDocument->makePartRind( hcenter, + hvecx, hvecz, + radext, radint, radhole, + hplorig, angle, + nrad, nang, nhaut ); + if ( BadElement(hElts) ) return iElts; + + updateData(); + ElementsItem* eltsItem = new ElementsItem(hElts); + _elementsDirItem->appendRow(eltsItem); + iElts = eltsItem->index(); + + return iElts; +} + +QModelIndex DocumentModel::makeSphere( const QModelIndex& icenter, + const QModelIndex& ivecx, const QModelIndex& ivecz, + double radius, double radhole, + const QModelIndex& iplorig, + int nrad, int nang, int nhaut ) +{ + QModelIndex iElts; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); + HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); + HEXA_NS::Vertex* hplorig = getHexaPtr(iplorig); + + HEXA_NS::Elements* hElts = _hexaDocument->makeSphere( hcenter, + hvecx, hvecz, + radius, radhole, + hplorig, + nrad, nang, nhaut); + if ( BadElement(hElts) ) return iElts; + + updateData(); + ElementsItem* eltsItem = new ElementsItem(hElts); + _elementsDirItem->appendRow(eltsItem); + iElts = eltsItem->index(); + + return iElts; +} + +QModelIndex DocumentModel::makePartSphere( const QModelIndex& icenter, + const QModelIndex& ivecx, const QModelIndex& ivecz, + double radius, double radhole, + const QModelIndex& iplorig, double angle, + int nrad, int nang, int nhaut ) +{ + QModelIndex iElts; + + HEXA_NS::Vertex* hcenter = getHexaPtr(icenter); + HEXA_NS::Vector* hvecx = getHexaPtr(ivecx); + HEXA_NS::Vector* hvecz = getHexaPtr(ivecz); + HEXA_NS::Vertex* hplorig = getHexaPtr(iplorig); + + HEXA_NS::Elements* hElts = _hexaDocument->makePartSphere( hcenter, + hvecx, hvecz, + radius, radhole, + hplorig, angle, + nrad, nang, nhaut); + if ( BadElement(hElts) ) return iElts; + + updateData(); + ElementsItem* eltsItem = new ElementsItem(hElts); + _elementsDirItem->appendRow(eltsItem); + iElts = eltsItem->index(); + + return iElts; +} + +QModelIndex DocumentModel::prismQuad( const QModelIndex& iquad, const QModelIndex& ivec, int nb) +{ + QModelIndex iElts; + + HEXA_NS::Quad* hQuad = getHexaPtr(iquad); + HEXA_NS::Vector* hVect = getHexaPtr(ivec); + + HEXA_NS::Elements* hElts = _hexaDocument->prismQuad( hQuad, hVect, nb ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +QModelIndex DocumentModel::prismQuads( const QModelIndexList& iquads, const QModelIndex& ivec, int nb) +{ + QModelIndex iElts; + + HEXA_NS::Quads hQuads; + HEXA_NS::Quad* hQuad = NULL; + foreach( const QModelIndex& iquad, iquads ){ + hQuad = getHexaPtr(iquad); + hQuads.push_back( hQuad ); + } + HEXA_NS::Vector* hVect = getHexaPtr(ivec); + + HEXA_NS::Elements* hElts = _hexaDocument->prismQuads( hQuads, hVect, nb ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +QModelIndex DocumentModel::prismQuads( const QModelIndexList& iquads, const QModelIndex& ivec, std::vector layersSize, int nb) +{ + QModelIndex iElts; + + HEXA_NS::Quads hQuads; + HEXA_NS::Quad* hQuad = NULL; + foreach( const QModelIndex& iquad, iquads ){ + hQuad = getHexaPtr(iquad); + hQuads.push_back( hQuad ); + } + HEXA_NS::Vector* hVect = getHexaPtr(ivec); + + HEXA_NS::Elements* hElts = _hexaDocument->prismQuadsVec( hQuads, hVect, layersSize, nb ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +// +QModelIndex DocumentModel::joinQuad( + const QModelIndex& iquadstart, const QModelIndex& iquaddest, + const QModelIndex& iv0, const QModelIndex& iv1, + const QModelIndex& iv2, const QModelIndex& iv3, + int nb ) +{ + QModelIndex iElts; + + HEXA_NS::Quad* hQuadStart = getHexaPtr(iquadstart); + HEXA_NS::Quad* hQuadDest = getHexaPtr(iquaddest); + + HEXA_NS::Vertex* hVertex0 = getHexaPtr(iv0); + HEXA_NS::Vertex* hVertex1 = getHexaPtr(iv1); + HEXA_NS::Vertex* hVertex2 = getHexaPtr(iv2); + HEXA_NS::Vertex* hVertex3 = getHexaPtr(iv3); + + HEXA_NS::Elements* hElts = _hexaDocument->joinQuad( hQuadStart, hQuadDest, + hVertex0, hVertex1, hVertex2, hVertex3, nb ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +QModelIndex DocumentModel::joinQuads( + const QModelIndexList& iquadsstart, const QModelIndex& iquaddest, + const QModelIndex& iv0, const QModelIndex& iv1, + const QModelIndex& iv2, const QModelIndex& iv3, + int nb ) +{ + QModelIndex iElts; + + HEXA_NS::Quad* hQuadStart; + HEXA_NS::Quads hQuadsStart; + + foreach( const QModelIndex& iquad, iquadsstart ){ + hQuadStart = data( iquad, HEXA_DATA_ROLE ).value(); + hQuadsStart.push_back( hQuadStart ); + } + HEXA_NS::Quad* hQuadDest = data( iquaddest, HEXA_DATA_ROLE ).value(); + + HEXA_NS::Vertex* hVertex0 = getHexaPtr(iv0); + HEXA_NS::Vertex* hVertex1 = getHexaPtr(iv1); + HEXA_NS::Vertex* hVertex2 = getHexaPtr(iv2); + HEXA_NS::Vertex* hVertex3 = getHexaPtr(iv3); + + HEXA_NS::Elements* hElts = _hexaDocument->joinQuads( + hQuadsStart, hQuadDest, + hVertex0, hVertex1, hVertex2, hVertex3, + nb ); + if ( BadElement(hElts) ) return iElts; + + updateData(); //CS_TODO more or less? + ElementsItem* elts = new ElementsItem(hElts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +QModelIndex DocumentModel::cutEdge( const QModelIndex &i_e0, int nbcuts ) +//CS_TODO : impact sur le model? +{ + QModelIndex iElts; + + HEXA_NS::Edge* he0 = getHexaPtr(i_e0); + HEXA_NS::Elements* helts = _hexaDocument->cut( he0, nbcuts ); + + if ( BadElement(helts) ) return iElts; + + updateData(); //CS_TODO more? + ElementsItem* elts = new ElementsItem(helts); + _elementsDirItem->appendRow(elts); + iElts = elts->index(); + + return iElts; +} + +// ===================================== END OBSOLETE ========================================== + diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx index a6df36d..96fd2c4 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentModel.hxx @@ -30,32 +30,42 @@ #include "HEXABLOCKGUI_DocumentItem.hxx" #include "HexDocument.hxx" #include "HexNewShape.hxx" +#include "Hex.hxx" + namespace HEXABLOCK { namespace GUI { - class DocumentModel : public QStandardItemModel { Q_OBJECT public: - // enum EnumGroup { HexaCell, QuadCell, EdgeCell, - // HexaNode, QuadNode, EdgeNode, Vertex_Node}; - typedef HEXA_NS::EnumGroup Group; - typedef HEXA_NS::KindLaw KindLaw; - struct GeomObj { - QString shapeName; - QString name; - QString subid; // sub-shape id - QString brep; - double start; - double end; + QString shapeName; //main shape name + QString shapeEntry; //main shape entry + QString name; + QString subId; // sub-shape id (if it's a sub shape) + QString brep; + double start; + double end; }; + typedef HEXA_NS::EnumGroup Group; + typedef HEXA_NS::KindLaw KindLaw; + +// struct GeomObj +// { +// QString shapeName; +// QString name; +// QString subid; // sub-shape id +// QString brep; +// double start; +// double end; +// }; + typedef QList GeomObjList; DocumentModel( HEXA_NS::Document* doc, const QString& entry, QObject * parent = 0 ); @@ -70,8 +80,8 @@ namespace HEXABLOCK void load( const QString& xmlFileName ); void load(); //Loads the current document void save( const QString& xmlFileName ); - struct GeomObj* convertToGeomObj(GEOM::GeomObjPtr geomObjPtr); void updateData(); + void updateGeomTree(); void refresh(); //refresh data bool isEmpty() const; @@ -96,8 +106,6 @@ namespace HEXABLOCK void allowEdition(); void disallowEdition(); - // void setDefaultSelection(); - // void allowSelection(); void allowDataSelectionOnly(); void allowVertexSelectionOnly(); void allowEdgeSelectionOnly(); @@ -112,6 +120,7 @@ namespace HEXABLOCK void allowLawSelectionOnly(); + Hex::Hex* getHexaRoot() { return Hex::Hex::getInstance(); } HEXA_NS::EltBase* getHexaPtr(const QModelIndex& iElt); template @@ -127,29 +136,34 @@ namespace HEXABLOCK int getNbrUsedElt(HEXA_NS::EnumElt eltType); int getNbrUnusedElt(HEXA_NS::EnumElt eltType); + QModelIndex addToElementsTree(HEXA_NS::Elements* helts); + //associate a shape to the current document - bool addShape(TopoDS_Shape& forme, QString& shapeName); + bool addShape(TopoDS_Shape& forme, QString& shapeName, bool publish=true); //returns the geom obj id in the document using its entry - QString getGeomObjName(QString& studyEntry) { + QString getGeomObjName(QString& studyEntry) const { return docShapesName.contains(studyEntry) ? docShapesName[studyEntry] : QString(); } //returns the geom obj entry in the document using its id - QString getGeomObjEntry(QString& shapeName) { + QString getGeomObjEntry(QString& shapeName) const { return docShapesEntry.contains(shapeName) ? docShapesEntry[shapeName] : QString(); } //returns the document's shapes entries QList getShapesEntries() const { return docShapesName.uniqueKeys(); } - //returns the associated geom index to the data index - HEXA_NS::SubShape* getGeomPtr(QString& id) + //returns the associated geom object to the data index + HEXA_NS::SubShape* getGeomPtr(QString& id) const { - if (!shapeById.contains(id)) return NULL; + if (!shapeById.contains(id)) + return NULL; return shapeById[id]; } + QModelIndex getGeomModelIndex(QString& id) const; + void setGeomObjName(QString& studyEntry, QString& shapeName) {docShapesName[studyEntry] = shapeName;} void setGeomObjEntry(QString& shapeName, QString& studyEntry) {docShapesEntry[shapeName] = studyEntry;} @@ -157,7 +171,7 @@ namespace HEXABLOCK bool clearEltAssociations( const QModelIndex& iElt ); HEXA_NS::Hexa* getQuadHexa(HEXA_NS::Quad* quad); - // ************ BUILD HEXABLOCK MODEL ************ + // ************ BUILD HEXABLOCK MODEL (OBSOLETE)************ QModelIndex addVertex( double x, double y, double z ); // @@ -191,7 +205,7 @@ namespace HEXABLOCK QModelIndex addPipe( const QModelIndex &iv, const QModelIndex &ivec, double ri, double re, double h ); - // + // ===================== OBSOLETE ================================= QModelIndex makeCartesian( const QModelIndex& ivex, const QModelIndex& ivecx, const QModelIndex& ivecy, const QModelIndex& ivecz, long nx, long ny, long nz); @@ -201,10 +215,10 @@ namespace HEXABLOCK int nx, int ny, int nz ); QModelIndex makeCylindrical( const QModelIndex& i_pt, - const QModelIndex& i_vx, const QModelIndex& i_vz, - double dr, double da, double dl, - long nr, long na, long nl, - bool fill = false ); + const QModelIndex& i_vx, const QModelIndex& i_vz, + double dr, double da, double dl, + long nr, long na, long nl, + bool fill = false ); QModelIndex makeCylindricals( const QModelIndex& i_center, const QModelIndex& i_base, const QModelIndex& i_height, @@ -215,70 +229,190 @@ namespace HEXABLOCK QModelIndex makeSpherical( const QModelIndex& i_center, double rayon, int nb, double k = 1 ); - // QModelIndex makeCylinder( const QModelIndex& cyl, const QModelIndex& vec, - int nr, int na, int nl ); + int nr, int na, int nl ); - // - QModelIndex makePipe( const QModelIndex& pipe, const QModelIndex& vecx, - int nr, int na, int nl ); + QModelIndex makeCylinders(const QModelIndex& cyl1, const QModelIndex& cyl2); // - QModelIndex makeCylinders(const QModelIndex& cyl1, const QModelIndex& cyl2); + QModelIndex makePipe( const QModelIndex& pipe, const QModelIndex& vecx, + int nr, int na, int nl ); // QModelIndex makePipes( const QModelIndex& pipe1, const QModelIndex& pipe2 ); - - QModelIndex makeRind( const QModelIndex& center, const QModelIndex& vecx, const QModelIndex& vecz, - double radext, double radint, double radhole, - const QModelIndex& plorig, - int nrad, int nang, int nhaut ); //NEW HEXA3 + double radext, double radint, double radhole, + const QModelIndex& plorig, + int nrad, int nang, int nhaut ); //NEW HEXA3 QModelIndex makePartRind( const QModelIndex& center, const QModelIndex& vecx, const QModelIndex& vecz, - double radext, double radint, double radhole, - const QModelIndex& plorig, double angle, - int nrad, int nang, int nhaut ); //NEW HEXA3 + double radext, double radint, double radhole, + const QModelIndex& plorig, double angle, + int nrad, int nang, int nhaut ); //NEW HEXA3 QModelIndex makeSphere( const QModelIndex& center, const QModelIndex& vecx, const QModelIndex& vecz, - double radius, double radhole, - const QModelIndex& plorig, - int nrad, int nang, int nhaut ); //NEW HEXA3 + double radius, double radhole, + const QModelIndex& plorig, + int nrad, int nang, int nhaut ); //NEW HEXA3 QModelIndex makePartSphere( const QModelIndex& center, const QModelIndex& vecx, const QModelIndex& vecz, - double radius, double radhole, - const QModelIndex& plorig, double angle, - int nrad, int nang, int nhaut ); //NEW HEXA3 - - // ************ EDIT HEXABLOCK MODEL ************ - - bool updateVertex( const QModelIndex& vertex, double x, double y, double z ); - - // - bool removeHexa( const QModelIndex& hexa ); - bool removeConnectedHexa( const QModelIndex& hexa ); + double radius, double radhole, + const QModelIndex& plorig, double angle, + int nrad, int nang, int nhaut ); //NEW HEXA3 - - // + // OBSOLETE: replaced by extrudeQuad... QModelIndex prismQuad( const QModelIndex& quad, const QModelIndex& dv, int nb); QModelIndex prismQuads( const QModelIndexList& quads, const QModelIndex& dv, int nb); QModelIndex prismQuads( const QModelIndexList& quads, const QModelIndex& dv, std::vector, int nb=0); // QModelIndex joinQuad( const QModelIndex& start_q, const QModelIndex& dest_q, - const QModelIndex& v0, const QModelIndex& v1, - const QModelIndex& v2, const QModelIndex& v3, - int nb ); - + const QModelIndex& v0, const QModelIndex& v1, + const QModelIndex& v2, const QModelIndex& v3, int nb ); QModelIndex joinQuads( const QModelIndexList& start_q, const QModelIndex& dest_q, - const QModelIndex& v0, const QModelIndex& v1, - const QModelIndex& v2, const QModelIndex& v3, - int nb ); + const QModelIndex& v0, const QModelIndex& v1, + const QModelIndex& v2, const QModelIndex& v3, int nb ); + QModelIndex revolutionQuads( const QModelIndexList& startQuads, const QModelIndex& center, + const QModelIndex& vec_axis, const QList& angles); //NEW HEXA3 // + QModelIndex cutEdge( const QModelIndex &e, int nbcuts ); + + // ======================= END OBSOLETE ================================= + + + + // ===================== NEW ================================= + + // ===== CARTESIAN GRID + + QModelIndex makeCartesianTop(int nx, int ny, int nz); + QModelIndex makeCartesianUni(const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& ivec, + const QModelIndex& iaxis, double lx, double ly, double lz, int nx, int ny, int nz); + QModelIndex makeCartesian(const QModelIndex& icenter, const QModelIndex& ibase, const QModelIndex& ivec, + const QModelIndex& iaxis, vector& radius, vector& angles, vector& heights); + + // ====== SPHERE + + QModelIndex makeSphereTop (int nr, int na, int nh); + + QModelIndex makeSphereUni (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + double rtrou, double rext, double ang, + QModelIndex& ivplan, + int nr, int na, int nh); + + QModelIndex makeSphere (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + vector& tray, vector& tang, vector& thaut); + + // ====== SPHERICAL + + QModelIndex makeSphericalTop (int nbre, int crit); + + QModelIndex makeSphericalUni (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + double rayon, + int nbre, int crit); + + QModelIndex makeSpherical (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + vector& rayon, + int crit); + + // =========== RIND + QModelIndex makeRindTop (int nr, int na, int nh); + + QModelIndex makeRindUni (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + double raytrou, double rint, double rext, double ang, + QModelIndex& ivplan, + int nr, int na, int nh); + + QModelIndex makeRind (QModelIndex& icenter, + QModelIndex& ivec_x, QModelIndex& ivec_z, + vector& tray, vector& tang, vector& thaut); + + // ======== Cylinder + QModelIndex makeCylinderTop(int nr, int na, int nh); + + QModelIndex makeCylinderUni(QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, + double rint, double rext, double angle, double haut, + int nr, int na, int nh); + + QModelIndex makeCylinder (QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, + vector& tray, vector& tang, vector& thaut); + + // ======== Cylinders + QModelIndex makeCylinders (QModelIndex& iorig1, QModelIndex& ivecz1, double r1, double h1, + QModelIndex& iorig2, QModelIndex& ivecz2, double r2, double h2); + + // =========== PIPE + QModelIndex makePipeTop (int nr, int na, int nh); + + QModelIndex makePipeUni (QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, + double rint, double rext, double angle, double haut, + int nr, int na, int nh); + + QModelIndex makePipe (QModelIndex& iorig, QModelIndex& ivecx, QModelIndex& ivecz, + vector& tray, vector& tang, vector& thaut); + + // ======== Pipes + QModelIndex makePipes (QModelIndex& iorig1, QModelIndex& ivecz1, double rint1, double rex1, double h1, + QModelIndex& iorig2, QModelIndex& ivecz2, double rint2, double rex2, double h2); + + // ======== Join Quads + QModelIndex joinQuadUni(QModelIndex& istart, QModelIndex& idest, QModelIndex& iv1, QModelIndex& iv2, + QModelIndex& iv3, QModelIndex& iv4, int nb); + + QModelIndex joinQuad (QModelIndex& istart, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1, + QModelIndex& iva2, QModelIndex& ivb2, vector& tlen); + + QModelIndex joinQuadsUni (QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iv1, QModelIndex& iv2, + QModelIndex& iv3, QModelIndex& iv4, int nb); + + QModelIndex joinQuads (QModelIndexList& istarts, QModelIndex& idest, QModelIndex& iva1, QModelIndex& ivb1, + QModelIndex& iva2, QModelIndex& ivb2, vector& tlen); + + // ======== Quad Revolution + QModelIndex revolutionQuadUni(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis, + double angle, int nbre); + + QModelIndex revolutionQuad(QModelIndex& istart, QModelIndex& icenter, QModelIndex& iaxis, + vector& angles); + + QModelIndex revolutionQuadsUni(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis, + double angle, int nbre); + + QModelIndex revolutionQuads(QModelIndexList& istarts, QModelIndex& icenter, QModelIndex& iaxis, + vector& angles); + + // ==== PrismQuad or ExtrudeQuad + QModelIndex extrudeQuadTop (QModelIndex& istart, int nbre); + QModelIndex extrudeQuadUni (QModelIndex& istart, QModelIndex& dv, double len, int nbre); + QModelIndex extrudeQuad (QModelIndex& istart, QModelIndex& dv, vector& tlen); + + QModelIndex extrudeQuadsTop (QModelIndexList& istarts, int nbre); + QModelIndex extrudeQuadsUni (QModelIndexList& istarts, QModelIndex& axis, double len, int nbre); + QModelIndex extrudeQuads (QModelIndexList& istarts, QModelIndex& iaxis, vector& tlen); + + // ==== Cut Edge + QModelIndex cutUni (QModelIndex& iEdge, int nbre); + QModelIndex cut (QModelIndex& iEdge, vector& tlen); + + // ============================== END NEW ================================ + + // ************ EDIT HEXABLOCK MODEL ************ + + bool updateVertex( const QModelIndex& vertex, double x, double y, double z ); + + // + bool removeHexa( const QModelIndex& hexa ); + bool removeConnectedHexa( const QModelIndex& hexa ); + bool mergeVertices( const QModelIndex& va, const QModelIndex& vb ); bool mergeEdges( const QModelIndex& ea, const QModelIndex& eb, const QModelIndex& v0, const QModelIndex& v1 ); @@ -292,9 +426,6 @@ namespace HEXABLOCK QModelIndex disconnectQuad( const QModelIndex& h, const QModelIndex& q ); QModelIndex disconnectEdges( const QModelIndexList& h, const QModelIndexList& e ); - // - QModelIndex cutEdge( const QModelIndex &e, int nbcuts ); - // QModelIndex makeTranslation( const QModelIndex& elts, const QModelIndex& vec ); QModelIndex makeScale( const QModelIndex& elts, const QModelIndex& v, double k ); @@ -321,33 +452,22 @@ namespace HEXABLOCK bool performSymmetryLine( const QModelIndex& elts, const QModelIndex& v, const QModelIndex& vec ); bool performSymmetryPlane( const QModelIndex& elts, const QModelIndex& v, const QModelIndex& vec ); - - QModelIndex revolutionQuads( const QModelIndexList& startQuads, const QModelIndex& center, - const QModelIndex& vec_axis, const QList& angles); //NEW HEXA3 - QModelIndex replace( const QModelIndexList& quadsPattern, const QModelIndex& p1, const QModelIndex& c1, const QModelIndex& p2, const QModelIndex& c2, const QModelIndex& p3, const QModelIndex& c3 ); //NEW HEXA3 - - - // ************ ASSOCIATION ************ - // elt is Vertex, Edge, Quad -// void addAssociation( const QModelIndex& elt, const GeomObj& assoc ); //perime -// QList getAssociations( const QModelIndex& elt ); //perime - bool setVertexAssociation( const QModelIndex& iVertex, double x, double y, double z); bool setVertexAssociation(const QModelIndex& iVertex, const QModelIndex& iGeomVertex); bool addEdgeAssociation(const QModelIndex& iEdge, const QModelIndex& iGeomEdge, double start, double end); bool addQuadAssociation (const QModelIndex& iQuad, const QModelIndex& iGeomFace); QMultiMap< QString, int > getAssocShapesIds(const QModelIndex& dataIndex); - QModelIndex getVertexAssociation(const QModelIndex& iVertex); - QList getEdgeAssociations(const QModelIndex& iEdge); - QModelIndexList getQuadAssociations(const QModelIndex& iQuad); + QModelIndex getVertexAssociation(const QModelIndex& iVertex); + QModelIndexList getEdgeAssociations(const QModelIndex& iEdge); + QModelIndexList getQuadAssociations(const QModelIndex& iQuad); //---------- perimees ------------- bool associateOpenedLine( const QModelIndexList& edges, @@ -379,7 +499,6 @@ namespace HEXABLOCK // ************ GROUPS ************ - // QModelIndex addGroup( const QString& name, Group kind ); @@ -397,43 +516,16 @@ namespace HEXABLOCK // ************ LAWS ************ - // QModelIndex addLaw( const QString& name, int nbnodes ); - - // 8.2 Boite: créer une loi - // class Law - // { - // public: - // int setNodes (int nbre); - // int setCoefficient (double coeff); - // void setKind (KindLaw type); - // } - bool setLaw( const QModelIndex& ilaw, int nbnodes, double coeff, KindLaw type ); - - // bool removeLaw( const QModelIndex& law ); - - // 8.3 Boite: éditer une loi - // (idem création) - - // 9 Discrétisation - // 9.1 Boite: poser une loi de discrétisation sur une propagation - // int setLaw (Law* loi); - // void setWay (bool sens); bool setPropagation( const QModelIndex& iPropagation, const QModelIndex& iLaw, bool way ); QModelIndexList getPropagation( const QModelIndex& iPropagation ) const; - // - // 9.1 Boite: éditer - // (idem création) - - // tools HEXA_NS::Document* documentImpl(); QString documentEntry(); - // QModelIndex indexBy( int role, const QString& value ); signals: void patternDataChanged(); @@ -470,11 +562,9 @@ namespace HEXABLOCK QStandardItem *_implicitShapesDirItem; QStandardItem *_cloudOfPointsDirItem; - //association // CS_TODO - // groups QStandardItem *_groupDirItem; @@ -512,11 +602,8 @@ namespace HEXABLOCK QStandardItem * itemFromIndex ( const QModelIndex & index ) const; - HEXA_NS::Document* documentImpl(); QString documentEntry(); - - }; @@ -544,7 +631,6 @@ namespace HEXABLOCK }; - class AssociationsModel : public QSortFilterProxyModel { public: @@ -585,9 +671,6 @@ namespace HEXABLOCK QModelIndexList getPropagation( const QModelIndex& iPropagation ) const; }; - - - } } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx index c7ee880..9c5ef82 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.cxx @@ -22,9 +22,8 @@ #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" #include "HEXABLOCKGUI_OccGraphicView.hxx" #include "HEXABLOCKGUI_SalomeTools.hxx" -//#include "HEXABLOCKGUI.hxx" - +#include "Hex.hxx" #include #include #include @@ -38,8 +37,6 @@ #include #include -// #include - #include #include @@ -48,7 +45,6 @@ #include #include - #include #include #include @@ -61,17 +57,7 @@ #include - -// #include - #include -#include - - - -#include "MyGEOMBase_Helper.hxx" -#include "GEOMBase.h" -#include "GEOM_Operation.h" #define BUTTON_BOX_MIN_WIDTH 5 #define VERTEX_COORD_MIN -1000000 @@ -87,139 +73,152 @@ using namespace HEXABLOCK::GUI; Q_DECLARE_METATYPE(HEXABLOCK::GUI::HexaTreeRole); +Q_DECLARE_METATYPE(DocumentModel::GeomObj); Q_DECLARE_METATYPE(TopAbs_ShapeEnum); +Q_DECLARE_METATYPE(TopoDS_Shape); //General SpinBox Delegate class HexaDoubleSpinBoxDelegate : public QStyledItemDelegate { public: - HexaDoubleSpinBoxDelegate(QObject *parent=0) : QStyledItemDelegate (parent){} - - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const{ - QDoubleSpinBox *sb = new QDoubleSpinBox( parent ); - sb->setDecimals(NB_DECIMALS); - return sb; - } + HexaDoubleSpinBoxDelegate(QObject *parent=0) : QStyledItemDelegate (parent){} + + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const{ + QDoubleSpinBox *sb = new QDoubleSpinBox( parent ); + sb->setDecimals(NB_DECIMALS); + return sb; + } }; //Angle SpinBox Delegate class HexaAngleDoubleSpinBoxDelegate : public QStyledItemDelegate { public: - HexaAngleDoubleSpinBoxDelegate(QObject *parent=0) : QStyledItemDelegate (parent){} - - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const{ - QDoubleSpinBox *sb = new QDoubleSpinBox( parent ); - sb->setMinimum(SPINBOX_POSITIVE_DOUBLE_MIN); - sb->setMaximum(SPINBOX_ANGLE_MAX); - sb->setDecimals(NB_DECIMALS); - return sb; - } + HexaAngleDoubleSpinBoxDelegate(QObject *parent=0) : QStyledItemDelegate (parent){} + + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const{ + QDoubleSpinBox *sb = new QDoubleSpinBox( parent ); + sb->setMinimum(SPINBOX_POSITIVE_DOUBLE_MIN); + sb->setMaximum(SPINBOX_ANGLE_MAX); + sb->setDecimals(NB_DECIMALS); + return sb; + } }; //Positive DoubleSpinBox Delegate (for heigth, radius, ...) class HexaPositiveDoubleSpinBoxDelegate : public QStyledItemDelegate { public: - HexaPositiveDoubleSpinBoxDelegate(QObject *parent=0) : QStyledItemDelegate (parent){} - - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const{ - QDoubleSpinBox *sb = new QDoubleSpinBox( parent ); - sb->setMinimum(SPINBOX_POSITIVE_DOUBLE_MIN); - /////// sb->setMaximum(1000000000000000); //10e15 Abu : Pb en 32 bits - sb->setMaximum(SPINBOX_DOUBLE_MAX); //10e9 - sb->setDecimals(NB_DECIMALS); - return sb; - } + HexaPositiveDoubleSpinBoxDelegate(QObject *parent=0) : QStyledItemDelegate (parent){} + + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, + const QModelIndex &index) const{ + QDoubleSpinBox *sb = new QDoubleSpinBox( parent ); + sb->setMinimum(SPINBOX_POSITIVE_DOUBLE_MIN); + /////// sb->setMaximum(1000000000000000); //10e15 Abu : Pb en 32 bits + sb->setMaximum(SPINBOX_DOUBLE_MAX); //10e9 + sb->setDecimals(NB_DECIMALS); + return sb; + } }; // ======================================================== Constructeur HexaBaseDialog::HexaBaseDialog( QWidget * parent, Mode editmode, Qt::WindowFlags f ): - QDialog(parent, f), - MyGEOMBase_Helper( dynamic_cast(parent->parent()) ), - _editMode( editmode ), - _currentObj(NULL), - _expectedSelection(-1), - _selectionMutex( false ), - // _applyCloseButton(0), - _applyButton(NULL), - debugEdgeAssoc(false), - autoFocusSwitch(true) -{ - _strHexaWidgetType[VERTEX_TREE] = tr( "VERTEX" ); - _strHexaWidgetType[EDGE_TREE] = tr( "EDGE" ); - _strHexaWidgetType[QUAD_TREE] = tr( "QUAD" ); - _strHexaWidgetType[HEXA_TREE] = tr( "HEXA" ); - - _strHexaWidgetType[VECTOR_TREE] = tr( "VECTOR" ); - _strHexaWidgetType[CYLINDER_TREE] = tr( "CYLINDER" ); - _strHexaWidgetType[PIPE_TREE] = tr( "PIPE" ); - _strHexaWidgetType[ELEMENTS_TREE] = tr( "ELEMENTS" ); - _strHexaWidgetType[CROSSELEMENTS_TREE]= tr( "CROSSELEMENTS" ); - - //geom - _strHexaWidgetType[GEOMSHAPE_TREE] = tr( "GEOMSHAPE" ); - _strHexaWidgetType[GEOMPOINT_TREE] = tr( "GEOMPOINT" ); - _strHexaWidgetType[GEOMEDGE_TREE] = tr( "GEOMEDGE" ); - _strHexaWidgetType[GEOMFACE_TREE] = tr( "GEOMFACE" ); - - - _strHexaWidgetType[GROUP_TREE] = tr( "GROUP" ); - _strHexaWidgetType[LAW_TREE] = tr( "LAW" ); - _strHexaWidgetType[PROPAGATION_TREE]= tr( "PROPAGATION" ); -} - -// ============================================================= getIndexList -QModelIndexList HexaBaseDialog::getIndexList(QListWidget* itemsList) + QDialog(parent, f), + _editMode( editmode ), + _currentObj(NULL), + _applyButton(NULL), + debugEdgeAssoc(false), + autoFocusSwitch(true) { - QModelIndexList iItems; - QModelIndex iItem; - QListWidgetItem* item = NULL; + _strHexaWidgetType[VERTEX_TREE] = tr( "VERTEX" ); + _strHexaWidgetType[EDGE_TREE] = tr( "EDGE" ); + _strHexaWidgetType[QUAD_TREE] = tr( "QUAD" ); + _strHexaWidgetType[HEXA_TREE] = tr( "HEXA" ); + + _strHexaWidgetType[VECTOR_TREE] = tr( "VECTOR" ); + _strHexaWidgetType[CYLINDER_TREE] = tr( "CYLINDER" ); + _strHexaWidgetType[PIPE_TREE] = tr( "PIPE" ); + _strHexaWidgetType[ELEMENTS_TREE] = tr( "ELEMENTS" ); + _strHexaWidgetType[CROSSELEMENTS_TREE]= tr( "CROSSELEMENTS" ); - const PatternDataModel* patternDataModel = getPatternDataModel(); - if (patternDataModel == NULL || itemsList == NULL) return iItems; + //geom + _strHexaWidgetType[GEOMSHAPE_TREE] = tr( "GEOMSHAPE" ); + _strHexaWidgetType[GEOMPOINT_TREE] = tr( "GEOMPOINT" ); + _strHexaWidgetType[GEOMEDGE_TREE] = tr( "GEOMEDGE" ); + _strHexaWidgetType[GEOMFACE_TREE] = tr( "GEOMFACE" ); - unsigned int nbItems = itemsList->count(); - for ( int r = 0; r < nbItems; ++r){ - item = itemsList->item(r); - iItem = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - iItems << iItem; - } - return iItems; + + _strHexaWidgetType[GROUP_TREE] = tr( "GROUP" ); + _strHexaWidgetType[LAW_TREE] = tr( "LAW" ); + _strHexaWidgetType[PROPAGATION_TREE]= tr( "PROPAGATION" ); +} + +// ============================================================= getIndexList +QModelIndexList HexaBaseDialog::getIndexList(QListWidget* itemsList, bool mapToSource) +{ + QModelIndexList iItems; + QModelIndex iItem; + QListWidgetItem* item = NULL; + + const PatternDataModel* patternDataModel = getPatternDataModel(); + if (patternDataModel == NULL || itemsList == NULL) return iItems; + + unsigned int nbItems = itemsList->count(); + for ( int r = 0; r < nbItems; ++r){ + item = itemsList->item(r); + if (mapToSource) + iItem = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + else + iItem = item->data(LW_QMODELINDEX_ROLE).value(); + iItems << iItem; + } + return iItems; } // ============================================================= lockSizeToSizeHint void HexaBaseDialog::lockSizeToSizeHint() { - setMaximumHeight(sizeHint().height()); -// setMaximumWidth(sizeHint().width()); - // setMinimumHeight(sizeHint().height()); - // setMinimumWidth(sizeHint().width()); + setMaximumHeight(sizeHint().height()); + // setMaximumWidth(sizeHint().width()); + // setMinimumHeight(sizeHint().height()); + // setMinimumWidth(sizeHint().width()); } // ============================================================= unlockSizeModification void HexaBaseDialog::unlockSizeModification() { - setMaximumHeight(MAX_HEIGHT); -// setMaximumWidth(MAX_WIDTH); - // setMinimumHeight(MIN_HEIGHT); - // setMinimumWidth(MIN_WIDTH); + setMaximumHeight(MAX_HEIGHT); + // setMaximumWidth(MAX_WIDTH); + // setMinimumHeight(MIN_HEIGHT); + // setMinimumWidth(MIN_WIDTH); } // ============================================================= resetSizeAndShow void HexaBaseDialog::resetSizeAndShow(QDockWidget* parent) { - //force the dialog to fit its contain - lockSizeToSizeHint(); + //force the dialog to fit its contain + lockSizeToSizeHint(); + + //set the dialog in the dockwidget + parent->setWidget(this); + parent->setWindowTitle(windowTitle()); + parent->setVisible(true); + show(); + + unlockSizeModification(); +} - //set the dialog in the dockwidget - parent->setWidget(this); - parent->setWindowTitle(windowTitle()); - parent->setVisible(true); - show(); +QString HexaBaseDialog::getErrorMsg() +{ + DocumentModel* docModel = getDocumentModel(); + Hex::Hex* hex = docModel->getHexaRoot(); + int nbErrorMsg = hex->sizeofMessage(); + QString msg, newLine = "\n"; + for (int i = 1; i < nbErrorMsg; ++i) + msg += newLine + hex->getMessageLine(i); - unlockSizeModification(); + return msg; } //unlink the widget from the model @@ -227,9 +226,19 @@ void HexaBaseDialog::modelUnregister(QWidget* widget) { if (widget == NULL) return; - //Update the line edit + if (widget->property("GeomWidgetType").isValid()) + { + widget->setProperty("GeomObj", QVariant()); + widget->setProperty("TopoDS_Shape", QVariant()); + } + + widget->setProperty("HexaData", QVariant()); widget->setProperty("QModelIndex", QVariant()); _index[widget] = QModelIndex(); + + HexaBaseDialog* diag = dynamic_cast(widget); + if (diag != NULL) + diag->clearWidgetsIndexes(); } // ============================================================= connectDocumentGraphicView @@ -246,7 +255,7 @@ void HexaBaseDialog::connectDocumentGraphicView(VtkDocumentGraphicView* docGView connect( docGView->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); connect( docGView->getPatternGeomSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); connect( docGView->getGroupsSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ), Qt::UniqueConnection ); connect( docGView->getMeshSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), @@ -256,32 +265,31 @@ void HexaBaseDialog::connectDocumentGraphicView(VtkDocumentGraphicView* docGView // ============================================================= disconnectDocumentGraphicView void HexaBaseDialog::disconnectDocumentGraphicView(VtkDocumentGraphicView* docGView) { - if (docGView == NULL) docGView = HEXABLOCKGUI::currentDocGView; - if (docGView == NULL) return; + if (docGView == NULL) docGView = HEXABLOCKGUI::currentDocGView; + if (docGView == NULL) return; - //Disconnect graphic view signals form the dialog box - disconnect(docGView->getPatternDataSelectionModel(), SIGNAL( selectionChanged ( const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); + //Disconnect graphic view signals form the dialog box + disconnect(docGView->getPatternDataSelectionModel(), SIGNAL( selectionChanged ( const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); - disconnect(docGView->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); + disconnect(docGView->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); - disconnect(docGView->getPatternGeomSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), + disconnect(docGView->getPatternGeomSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); - disconnect( docGView->getGroupsSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); + disconnect( docGView->getGroupsSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); - disconnect( docGView->getMeshSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); + disconnect( docGView->getMeshSelectionModel(), SIGNAL( selectionChanged( const QItemSelection &, const QItemSelection &) ), + this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); } - // ============================================================= onCurrentSelectionChanged void HexaBaseDialog::onCurrentSelectionChanged() { - highlightSelectedAssocs(); + highlightSelectedAssocs(); } void HexaBaseDialog::clearCurrentObjectFocus() @@ -298,305 +306,249 @@ void HexaBaseDialog::clearCurrentObjectFocus() //Sets focus to the next field of the current object void HexaBaseDialog::setFocusToNextField() { - activateWindow (); - - if (!HEXABLOCKGUI::assocInProgress && autoFocusSwitch) - { - _highlightWidget(_currentObj, Qt::white); - focusNextChild (); - } - - if (!_isLineOrListWidget(focusWidget())) clearVTKSelection(); + activateWindow (); + if (!HEXABLOCKGUI::assocInProgress && autoFocusSwitch) + { + _highlightWidget(_currentObj, Qt::white); + focusNextChild (); + } } // ============================================================== _initButtonBox QGroupBox* HexaBaseDialog::_initButtonBox( Mode editmode ) { - if ( editmode == INFO_MODE ) - return NULL; - - //QDialogButtonBox* buttonBox = new QDialogButtonBox(this); - QGroupBox* buttonBox = new QGroupBox(); - buttonBox->setMinimumWidth(BUTTON_BOX_MIN_WIDTH); - buttonBox->setObjectName(QString::fromUtf8("buttonBox")); - //buttonBox->setOrientation(Qt::Horizontal); - QHBoxLayout* buttonsHLayout = new QHBoxLayout(); - _applyButton = new QPushButton(tr("Apply")); - QPushButton* closeButton = new QPushButton(tr("Close")); - QPushButton* helpButton = new QPushButton(tr("Help")); - //_applyCloseButton = new QPushButton(tr("Apply And Close")); - - //connect( buttonBox, SIGNAL(clicked()), this, SLOT(applyAndClose()) ); - connect( _applyButton, SIGNAL(clicked()), this, SLOT(apply()), Qt::UniqueConnection ); - connect( closeButton, SIGNAL(clicked()), this, SLOT(close()), Qt::UniqueConnection ); - connect( helpButton, SIGNAL(clicked()), this, SLOT(onHelpRequested()), Qt::UniqueConnection ); - - buttonsHLayout->addWidget( _applyButton ); - buttonsHLayout->addWidget( closeButton ); - buttonsHLayout->addStretch(1); - buttonsHLayout->addWidget( helpButton ); - //buttonsHLayout->addButton( _applyCloseButton ); - buttonBox->setLayout(buttonsHLayout); - layout()->addWidget(buttonBox); - buttonBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); - return buttonBox; + if ( editmode == INFO_MODE ) + return NULL; + + QGroupBox* buttonBox = new QGroupBox(); + buttonBox->setMinimumWidth(BUTTON_BOX_MIN_WIDTH); + buttonBox->setObjectName(QString::fromUtf8("buttonBox")); + QHBoxLayout* buttonsHLayout = new QHBoxLayout(); + _applyButton = new QPushButton(tr("Apply")); + QPushButton* closeButton = new QPushButton(tr("Close")); + QPushButton* helpButton = new QPushButton(tr("Help")); + + connect( _applyButton, SIGNAL(clicked()), this, SLOT(apply()), Qt::UniqueConnection ); + connect( closeButton, SIGNAL(clicked()), this, SLOT(close()), Qt::UniqueConnection ); + connect( helpButton, SIGNAL(clicked()), this, SLOT(onHelpRequested()), Qt::UniqueConnection ); + + buttonsHLayout->addWidget( _applyButton ); + buttonsHLayout->addWidget( closeButton ); + buttonsHLayout->addStretch(1); + buttonsHLayout->addWidget( helpButton ); + buttonBox->setLayout(buttonsHLayout); + layout()->addWidget(buttonBox); + buttonBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + return buttonBox; } // ============================================================== _initWidget void HexaBaseDialog::_initWidget( Mode editmode ) { - _initInputWidget( editmode ); - _initButtonBox( editmode ); -} - -// ============================================================== _initViewManager -void HexaBaseDialog::_initViewManager() -{ -// SalomeApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); -// if (anApp == NULL) return; -// _mgr = dynamic_cast( anApp->selectionMgr() ); -// _occVm = anApp->getViewManager( OCCViewer_Viewer::Type(), true ); -// _vtkVm = anApp->getViewManager( SVTK_Viewer::Type(), true ); -// SUIT_ViewManager* activeVm = anApp->activeViewManager(); -// onWindowActivated ( activeVm ); + _initInputWidget( editmode ); + _initButtonBox( editmode ); } // ============================================================== apply bool HexaBaseDialog::apply() { - QModelIndex iNew; - bool applied = apply(iNew); - if ( applied ){ - // clear all selection - if (getPatternDataSelectionModel() != NULL) getPatternDataSelectionModel()->clearSelection(); - if (getPatternBuilderSelectionModel() != NULL) getPatternBuilderSelectionModel()->clearSelection(); - if (getPatternGeomSelectionModel() != NULL) getPatternGeomSelectionModel()->clearSelection(); - if (getGroupsSelectionModel() != NULL) getGroupsSelectionModel()->clearSelection(); - if (getMeshSelectionModel() != NULL) getMeshSelectionModel()->clearSelection(); - // select and highlight in vtk view the result - _selectAndHighlight( iNew ); - // reinitialization - // _currentObj = NULL; - } - return applied; -} - -// ============================================================== accept -//void HexaBaseDialog::accept() -//{ -// bool applied = apply(); -// if ( applied ){ -// QDialog::accept(); -// _disallowSelection(); -// } -//} + QModelIndex iNew; + bool applied = apply(iNew); + if ( applied ) + { + _selectAndHighlight( iNew ); + if (!HEXABLOCKGUI::assocInProgress) + getDocumentModel()->updateGeomTree(); + } + return applied; +} void HexaBaseDialog::clearVTKSelection() { HEXABLOCKGUI::currentDocGView->clearSelection(); -// setFocus(); _highlightWidget(_currentObj, Qt::white); -// _disallowSelection(); } void HexaBaseDialog::clearOCCSelection() { - if (HEXABLOCKGUI::currentOccGView != NULL) - HEXABLOCKGUI::currentOccGView->clearSelection(); + HEXABLOCKGUI::currentOccGView->clearSelection(); } // ============================================================== close void HexaBaseDialog::close() { - - //Clear vtk selection -// clearVTKSelection(); - //reset the data selection pattern (forget all selections of the current context) -// if (getPatternDataSelectionModel() != NULL) -// getPatternDataSelectionModel()->reset(); -// -// if (getPatternGeomSelectionModel() != NULL) -// getPatternGeomSelectionModel()->reset(); + getPatternDataSelectionModel()->reset(); + getPatternBuilderSelectionModel()->reset(); + getPatternGeomSelectionModel()->reset(); + + //Clear vtk selection + clearVTKSelection(); //Clear occ selection -// clearOCCSelection(); + clearOCCSelection(); - //Close the dialog box - if (parentWidget()) parentWidget()->close(); + //Close the dialog box + if (parentWidget()) + parentWidget()->close(); } // ============================================================== onHelpRequested void HexaBaseDialog::onHelpRequested() { - LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() ); - if ( app ) - // app->onHelpContextModule( myGeometryGUI ? app->moduleName( myGeometryGUI->moduleName() ) : QString( "" ), _helpFileName ); - app->onHelpContextModule( "HEXABLOCK", _helpFileName ); - - else { - QString platform; + LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() ); + if ( app ) + app->onHelpContextModule( "HEXABLOCK", _helpFileName ); + else { + QString platform; #ifdef WIN32 - platform = "winapplication"; + platform = "winapplication"; #else - platform = "application"; + platform = "application"; #endif - SUIT_MessageBox::warning( 0, QObject::tr( "WRN_WARNING" ), - QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( _helpFileName ), - QObject::tr( "BUT_OK" ) ); - } + SUIT_MessageBox::warning( 0, QObject::tr( "WRN_WARNING" ), + QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). + arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( _helpFileName ), + QObject::tr( "BUT_OK" ) ); + } } // ============================================================== highlightSelectedAssocs void HexaBaseDialog::highlightSelectedAssocs() { - if (getPatternDataSelectionModel() == NULL || - HEXABLOCKGUI::selectionMgr() == NULL || - HEXABLOCKGUI::currentDocGView->getViewWindow() == NULL) return; - - QMultiMap geomAssocs = getAssocsGEOM(); - QModelIndexList vtkAssocs = getAssocsVTK(); + QMultiMap geomAssocs = getAssocsGEOM(); + QModelIndexList vtkAssocs = getAssocsVTK(); - //highlight geom selected elts - if (geomAssocs.size() > 0) - { - HEXABLOCKGUI::selectionMgr()->clearSelected(); - HEXABLOCKGUI::currentOccGView->highlight(geomAssocs); - } +// HEXABLOCKGUI::selectionMgr()->clearSelected(); + //highlight geom selected elts + if (geomAssocs.size() > 0) + HEXABLOCKGUI::currentOccGView->highlight(geomAssocs, false); - //highlight vtk selected elts - if (!vtkAssocs.isEmpty()) - HEXABLOCKGUI::currentDocGView->highlight(vtkAssocs); + //highlight vtk selected elts + if (!vtkAssocs.isEmpty()) + HEXABLOCKGUI::currentDocGView->highlight(vtkAssocs); } // ============================================================== refreshHighlight void HexaBaseDialog::refreshHighlight() { - if (HEXABLOCKGUI::selectionMgr() != NULL) - HEXABLOCKGUI::selectionMgr()->clearSelected(); - highlightSelectedAssocs(); + HEXABLOCKGUI::selectionMgr()->clearSelected(); + highlightSelectedAssocs(); } // ============================================================== getObjectViewType HEXABLOCKGUI::ViewType HexaBaseDialog::getObjectViewType(QObject* obj) { - if (obj == NULL) return HEXABLOCKGUI::UNKNOWN; - QVariant v = obj->property("HexaWidgetType"); - if ( v.isValid() ) return HEXABLOCKGUI::VTK; - v = obj->property("GeomWidgetType"); - if ( v.isValid() ) return HEXABLOCKGUI::OCC; - return HEXABLOCKGUI::UNKNOWN; + if (obj == NULL) + return HEXABLOCKGUI::UNKNOWN; + + QVariant v = obj->property("GeomWidgetType"); + if ( v.isValid() ) + return HEXABLOCKGUI::OCC; + + v = obj->property("HexaWidgetType"); + if ( v.isValid() ) + return HEXABLOCKGUI::VTK; + + return HEXABLOCKGUI::UNKNOWN; } // ============================================================== _selectAndHighlight void HexaBaseDialog::_selectAndHighlight( const QModelIndex& i ) { - if ( !i.isValid() ) return; - setProperty("QModelIndex", QVariant::fromValue(i)); - setFocus(); + if ( !i.isValid() ) return; + setProperty("QModelIndex", QVariant::fromValue(i)); + setFocus(); } // ============================================================== _allowSelection void HexaBaseDialog::_allowSelection() { - if ( getDocumentModel() ){ - getDocumentModel()->disallowEdition(); - } + if ( getDocumentModel() ) + getDocumentModel()->disallowEdition(); } // ============================================================== _disallowSelection void HexaBaseDialog::_disallowSelection() { - if ( getDocumentModel() ){ - getDocumentModel()->allowEdition(); - } - HEXABLOCKGUI::currentDocGView->setAllSelection(); + if ( getDocumentModel() ){ + getDocumentModel()->allowEdition(); + } + HEXABLOCKGUI::currentDocGView->setAllSelection(); } - // ============================================================== _allowVTKSelection bool HexaBaseDialog::_allowVTKSelection( QObject* obj ) { - bool isOk = false; - - QVariant v = obj->property("HexaWidgetType"); - HexaWidgetType wType = v.value(); - - switch (wType){ - case VERTEX_TREE: - HEXABLOCKGUI::currentDocGView->setVertexSelection(); isOk = true; - break; - case EDGE_TREE: - HEXABLOCKGUI::currentDocGView->setEdgeSelection(); isOk = true; - break; - case QUAD_TREE: - HEXABLOCKGUI::currentDocGView->setQuadSelection(); isOk = true; - break; - case HEXA_TREE: - HEXABLOCKGUI::currentDocGView->setHexaSelection(); isOk = true; - break; - // case VECTOR_TREE: - // case CYLINDER_TREE: - // case PIPE_TREE: - // case ELEMENTS_TREE: - // case CROSSELEMENTS_TREE: //selector = getPatternDataSelectionModel(); - // case GROUP_TREE: //selector = getGroupsSelectionModel(); - // case LAW_TREE: - // case PROPAGATION_TREE: // selector = getMeshSelectionModel(); - default: HEXABLOCKGUI::currentDocGView->setAllSelection(); - } - return isOk; + bool isOk = false; + + QVariant v = obj->property("HexaWidgetType"); + HexaWidgetType wType = v.value(); + + switch (wType){ + case VERTEX_TREE: + HEXABLOCKGUI::currentDocGView->setVertexSelection(); isOk = true; + break; + case EDGE_TREE: + HEXABLOCKGUI::currentDocGView->setEdgeSelection(); isOk = true; + break; + case QUAD_TREE: + HEXABLOCKGUI::currentDocGView->setQuadSelection(); isOk = true; + break; + case HEXA_TREE: + HEXABLOCKGUI::currentDocGView->setHexaSelection(); isOk = true; + break; + default: HEXABLOCKGUI::currentDocGView->setAllSelection(); + } + return isOk; } // ============================================================== _allowOCCSelection bool HexaBaseDialog::_allowOCCSelection( QObject* obj ) { - QVariant v = obj->property("GeomWidgetType"); - GeomWidgetType wType = v.value(); - HEXABLOCKGUI::currentOccGView->setSelectionMode(wType); + QVariant v = obj->property("GeomWidgetType"); + GeomWidgetType wType = v.value(); + HEXABLOCKGUI::currentOccGView->setSelectionMode(wType); - return true; + return true; } // ============================================================== _getSelector QItemSelectionModel* HexaBaseDialog::_getSelector( QObject* obj ) { - QItemSelectionModel* selector = NULL; - - QString objectName = obj->objectName(); - QString className = obj->metaObject()->className(); - - HexaWidgetType wtype; - QVariant v = obj->property("HexaWidgetType"); - if ( !v.isValid() ) { - return NULL; - } - - wtype = v.value(); - - switch (wtype){ - case VERTEX_TREE: - case EDGE_TREE: - case QUAD_TREE: - case HEXA_TREE: selector = getPatternDataSelectionModel(); break; - case VECTOR_TREE: - case CYLINDER_TREE: - case PIPE_TREE: - case ELEMENTS_TREE: - case CROSSELEMENTS_TREE: selector = getPatternBuilderSelectionModel(); break; - case GEOMPOINT_TREE: - case GEOMEDGE_TREE: - case GEOMFACE_TREE: selector = getPatternGeomSelectionModel(); break; - case GROUP_TREE: selector = getGroupsSelectionModel(); break; - case LAW_TREE: - case PROPAGATION_TREE: selector = getMeshSelectionModel(); break; - default : ; - } - return selector; + QItemSelectionModel* selector = NULL; + + HexaWidgetType wtype; + QVariant v = obj->property("HexaWidgetType"); + if ( !v.isValid() ) { + return NULL; + } + + wtype = v.value(); + + switch (wtype){ + case VERTEX_TREE: + case EDGE_TREE: + case QUAD_TREE: + case HEXA_TREE: selector = getPatternDataSelectionModel(); break; + case VECTOR_TREE: + case CYLINDER_TREE: + case PIPE_TREE: + case ELEMENTS_TREE: + case CROSSELEMENTS_TREE: selector = getPatternBuilderSelectionModel(); break; + case GEOMPOINT_TREE: + case GEOMEDGE_TREE: + case GEOMFACE_TREE: selector = getPatternGeomSelectionModel(); break; + case GROUP_TREE: selector = getGroupsSelectionModel(); break; + case LAW_TREE: + case PROPAGATION_TREE: selector = getMeshSelectionModel(); break; + default : ; + } + + return selector; } DocumentModel::GeomObj* HexaBaseDialog::getGeomObj(const QModelIndex& index) @@ -607,7 +559,7 @@ DocumentModel::GeomObj* HexaBaseDialog::getGeomObj(const QModelIndex& index) { geomObj = new DocumentModel::GeomObj; geomObj->shapeName = aSh->getName(); - geomObj->subid = QString::number(-1); + geomObj->subId = QString::number(-1); } else { @@ -620,7 +572,7 @@ DocumentModel::GeomObj* HexaBaseDialog::getGeomObj(const QModelIndex& index) if (aSSh->getParentShape() != NULL) shapeName = aSSh->getParentShape()->getName(); geomObj->shapeName = shapeName; - geomObj->subid = QString::number(aSSh->getIdent()); + geomObj->subId = QString::number(aSSh->getIdent()); } } return geomObj; @@ -633,45 +585,62 @@ DocumentModel::GeomObj* HexaBaseDialog::getGeomObj(const QModelIndex& index) */ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QLineEdit* le ) { - QModelIndexList l = sel.indexes(); - if ( l.count() == 0 ) return false; - - //type from selection (first) - QModelIndex selected = l[0]; - int selType = selected.data(HEXA_TREE_ROLE).toInt(); - - //type of widget - QVariant v = le->property("HexaWidgetType"); - if ( !v.isValid() ) return false; - HexaWidgetType wType = v.value(); - - // check selection compatibility between selection and widget - if ( selType != wType ){ - SUIT_MessageBox::information( 0, - tr("HEXA_INFO"), - tr("%1: Bad type selected\nPlease select a %2.").arg(windowTitle()).arg(_strHexaWidgetType[wType])); - return false; - } - if (le->property("GeomWidgetType").isValid()) - { - DocumentModel::GeomObj* geomObj = getGeomObj(selected); - if (geomObj != NULL) - { - le->setProperty("GeomObj", QVariant::fromValue(*geomObj)); - setCurrentGeomObj(geomObj); - } - } - - //fill the lineEdit if selection is OK - le->setText( selected.data().toString() );// namee - le->setProperty("QModelIndex", QVariant::fromValue(selected) ); - _index[le] = selected; - - QLineEdit* lineEdit = dynamic_cast(_currentObj); - if (selected.isValid() && lineEdit != NULL) - setFocusToNextField(); - - return true; + QModelIndexList l = sel.indexes(); + if ( l.count() == 0 ) return false; + + // mono selection mode: we just get the first selected element + QModelIndex selected = l[0]; + + // we just return if the selection is not valid or the selection and the + // line content are the same + if ( !selected.isValid() || le->property("HexaData") == selected.data(HEXA_DATA_ROLE) ) + return false; + + // type of selection + int selType = selected.data(HEXA_TREE_ROLE).toInt(); + + // type of widget + QVariant v = le->property("HexaWidgetType"); + if ( !v.isValid() ) return false; + HexaWidgetType wType = v.value(); + + // check selection compatibility between selection and widget + if ( selType != wType ){ + SUIT_MessageBox::information( 0, tr("HEXA_INFO"), + tr("%1: Bad type selected\nPlease select a %2.").arg(windowTitle()).arg(_strHexaWidgetType[wType])); + return false; + } + if (le->property("GeomWidgetType").isValid()) + { + DocumentModel::GeomObj* geomObj = getGeomObj(selected); + if (geomObj != NULL) + { + le->setProperty("GeomObj", QVariant::fromValue(*geomObj)); + + DocumentModel* docModel = getDocumentModel(); + QString objId = geomObj->shapeName + "," + geomObj->subId; + HEXA_NS::SubShape* ssh = docModel->getGeomPtr(objId); + if (ssh != NULL) + { + TopoDS_Shape shape = ssh->getShape(); + if (!shape.IsNull()) + le->setProperty("TopoDS_Shape", QVariant::fromValue(shape)); + } + setCurrentGeomObj(geomObj); + } + } + + //fill the lineEdit if selection is OK + le->setText( selected.data().toString() );// name + le->setProperty("QModelIndex", QVariant::fromValue(selected)); + le->setProperty("HexaData", selected.data(HEXA_DATA_ROLE)); + _index[le] = selected; + + QLineEdit* lineEdit = dynamic_cast(_currentObj); + if (selected.isValid() && lineEdit != NULL) + setFocusToNextField(); + + return true; } // ============================================================== _onSelectionChanged @@ -681,33 +650,33 @@ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QLineEdit* */ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QListWidget* lw ) { - QModelIndexList l = sel.indexes(); + QModelIndexList l = sel.indexes(); - if ( l.count() == 0 ) return false; + if ( l.count() == 0 ) return false; - //type of widget - QVariant v = lw->property("HexaWidgetType"); - if ( !v.isValid() ) return false; - HexaWidgetType wType = v.value(); + //type of widget + QVariant v = lw->property("HexaWidgetType"); + if ( !v.isValid() ) return false; + HexaWidgetType wType = v.value(); - //fill the listWidget - QListWidgetItem* item = NULL; - int selType; - QString selName; - // int maxSize = 8; - foreach( const QModelIndex& isel, l ){ - // if ( lw->count() == maxSize) break; - selType = isel.data(HEXA_TREE_ROLE).toInt(); - if ( selType != wType ){ // check selection compatibility between selection and widget + //fill the listWidget + QListWidgetItem* item = NULL; + int selType; + QString selName; + // int maxSize = 8; + foreach( const QModelIndex& isel, l ){ + // if ( lw->count() == maxSize) break; + selType = isel.data(HEXA_TREE_ROLE).toInt(); + if ( selType != wType ){ // check selection compatibility between selection and widget SUIT_MessageBox::information( 0, - tr("HEXA_INFO"), - tr("%1: Bad type selected\nPlease select a %2.").arg(windowTitle()).arg( _strHexaWidgetType[wType]) ); + tr("HEXA_INFO"), + tr("%1: Bad type selected\nPlease select a %2.").arg(windowTitle()).arg( _strHexaWidgetType[wType]) ); return false; - } - // add selection to listWidget if selection is OK - selName = isel.data().toString(); - QList twice = lw->findItems( selName, Qt::MatchExactly); - if ( twice.count() == 0 ){ + } + // add selection to listWidget if selection is OK + selName = isel.data().toString(); + QList twice = lw->findItems( selName, Qt::MatchExactly); + if ( twice.count() == 0 ){ item = new QListWidgetItem( selName ); item->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(isel) ); item->setData(LW_DATA_ROLE, isel.data(HEXA_DATA_ROLE)); @@ -719,9 +688,9 @@ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QListWidget } lw->addItem(item); updateButtonBox(); - } - } - return true; + } + } + return true; } // ============================================================== onSelectionChanged @@ -731,105 +700,77 @@ bool HexaBaseDialog::_onSelectionChanged( const QItemSelection& sel, QListWidget */ void HexaBaseDialog::onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel ) { - QString className = metaObject()->className(); - - // highlightSelectedAssocs(); - QItemSelectionModel* selector = dynamic_cast(sender()); + // * no edition for Info Dialogs + if ( _editMode == INFO_MODE ) + return; - if ( _selectionMutex ) return; - bool selOk = false; - QLineEdit* aLineEdit = NULL; - QListWidget* aListWidget = NULL; - aLineEdit = dynamic_cast(_currentObj); + QLineEdit* aLineEdit = NULL; + QListWidget* aListWidget = NULL; - if ( aLineEdit){ //fill the lineedit with selection - selOk = _onSelectionChanged( sel, aLineEdit ); - } - aListWidget = dynamic_cast(_currentObj); - if ( aListWidget){ //fill the listWidget with selection - selOk = _onSelectionChanged( sel, aListWidget ); - } + // * fill the lineedit with selection + aLineEdit = dynamic_cast(_currentObj); + if ( aLineEdit) + { + _onSelectionChanged( sel, aLineEdit ); + return; + } - if ( !selOk && selector && ( aLineEdit || aListWidget ) ){ - selector->clearSelection(); - } + // * fill the listWidget with selection + aListWidget = dynamic_cast(_currentObj); + if ( aListWidget) + _onSelectionChanged( sel, aListWidget ); } // ============================================================== showEvent void HexaBaseDialog::showEvent( QShowEvent * event ) { - QString className = metaObject()->className(); - - if (getDocumentModel() == NULL) - { - QDialog::showEvent ( event ); - return; - } - - if ( _editMode == INFO_MODE ){ - getDocumentModel()->allowEdition(); - } else { - getDocumentModel()->disallowEdition(); - } - - //Connect to salome selection signals - if (HEXABLOCKGUI::selectionMgr() != NULL) - { - connect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(onCurrentSelectionChanged()), Qt::UniqueConnection ); - } - - //Connect to vtk window activation signals - if (HEXABLOCKGUI::currentDocGView->getViewWindow() != NULL) - { - connect( HEXABLOCKGUI::currentDocGView->getViewWindow()->getViewManager(), SIGNAL( activated(SUIT_ViewManager*) ), - this, SLOT( onWindowActivated(SUIT_ViewManager*) ), Qt::UniqueConnection ); - } + if ( _editMode == INFO_MODE ) + getDocumentModel()->allowEdition(); + else + getDocumentModel()->disallowEdition(); - //connect to occ window activation signals - if (HEXABLOCKGUI::currentOccGView->getViewWindow() != NULL) - { - connect( HEXABLOCKGUI::currentOccGView->getViewWindow()->getViewManager(), - SIGNAL( activated(SUIT_ViewManager*) ), - this, SLOT( onWindowActivated(SUIT_ViewManager*) ), Qt::UniqueConnection ); - } + //Connect to salome selection signals + if (HEXABLOCKGUI::selectionMgr() != NULL) + { + connect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(onCurrentSelectionChanged()), Qt::UniqueConnection ); + } - //connect model selection signals - connectDocumentGraphicView(); + //connect model selection signals + connectDocumentGraphicView(); - QDialog::showEvent ( event ); + QDialog::showEvent ( event ); } // ============================================================== hideEvent void HexaBaseDialog::hideEvent ( QHideEvent * event ) { - QString className = metaObject()->className(); - if (getDocumentModel() == NULL) return; - - //Disconnection salome selection signals - if (HEXABLOCKGUI::selectionMgr() != NULL) - disconnect( HEXABLOCKGUI::selectionMgr() , SIGNAL(currentSelectionChanged()), - this, SLOT(onCurrentSelectionChanged()) ); + //Disconnection salome selection signals + if (HEXABLOCKGUI::selectionMgr() != NULL) + { + disconnect( HEXABLOCKGUI::selectionMgr() , SIGNAL(currentSelectionChanged()), + this, SLOT(onCurrentSelectionChanged()) ); + } - //Disconnect vtk window activation signals - if (HEXABLOCKGUI::currentDocGView->getViewWindow() != NULL) - disconnect( HEXABLOCKGUI::currentDocGView->getViewWindow()->getViewManager(), - SIGNAL( activated(SUIT_ViewManager*) ), - this, SLOT( onWindowActivated(SUIT_ViewManager*) ) ); + //Disconnect vtk window activation signals +// if (HEXABLOCKGUI::currentDocGView->getViewWindow() != NULL) +// disconnect( HEXABLOCKGUI::currentDocGView->getViewWindow()->getViewManager(), +// SIGNAL( activated(SUIT_ViewManager*) ), +// this, SLOT( onWindowActivated(SUIT_ViewManager*) ) ); - //Disconnect occ window activation signals - if (HEXABLOCKGUI::currentOccGView->getViewWindow() != NULL) - disconnect( HEXABLOCKGUI::currentOccGView->getViewWindow()->getViewManager(), - SIGNAL( activated(SUIT_ViewManager*) ), - this, SLOT( onWindowActivated(SUIT_ViewManager*) ) ); + //Disconnect occ window activation signals +// if (HEXABLOCKGUI::currentOccGView->getViewWindow() != NULL) +// disconnect( HEXABLOCKGUI::currentOccGView->getViewWindow()->getViewManager(), +// SIGNAL( activated(SUIT_ViewManager*) ), +// this, SLOT( onWindowActivated(SUIT_ViewManager*) ) ); - //Disconnect model selection signals - disconnectDocumentGraphicView(); + //Disconnect model selection signals + disconnectDocumentGraphicView(); - getDocumentModel()->allowEdition(); + getDocumentModel()->allowEdition(); - QDialog::hideEvent( event ); + QDialog::hideEvent( event ); } // ============================================================== updateButtonBox @@ -840,61 +781,51 @@ void HexaBaseDialog::updateButtonBox() // ============================================================== updateName void HexaBaseDialog::updateName() { - if (!getDocumentModel()) return; - if ( getPatternDataSelectionModel() == NULL ) return; - const PatternDataModel* patternDataModel = getPatternDataModel(); - if (patternDataModel == NULL) return; + const PatternDataModel* patternDataModel = getPatternDataModel(); - QLineEdit* lineEdit = dynamic_cast(sender()); - if (!lineEdit) return; - QString newName = lineEdit->text(); - if ( newName.isEmpty() ) return; + QLineEdit* lineEdit = dynamic_cast(sender()); + if (!lineEdit) return; + QString newName = lineEdit->text(); + if ( newName.isEmpty() ) return; - QVariant v = lineEdit->property("QModelIndex"); - if ( !v.isValid() ) return; + QVariant v = lineEdit->property("QModelIndex"); + if ( !v.isValid() ) return; - QModelIndex index = v.value(); - if ( index.isValid() ) - getDocumentModel()->setName( patternDataModel->mapToSource(index), newName ); + QModelIndex index = v.value(); + if ( index.isValid() ) + getDocumentModel()->setName( patternDataModel->mapToSource(index), newName ); } // ============================================================== updateDefaultName void HexaBaseDialog::updateDefaultName(QLineEdit* name_field, HEXA_NS::EnumElt type) { - if (getDocumentModel() == NULL || name_field == NULL) return; + if (name_field == NULL) return; - HEXA_NS::Document* doc = getDocumentModel()->getHexaDocument(); - if (doc == NULL) return; + HEXA_NS::Document* doc = getDocumentModel()->getHexaDocument(); + if (doc == NULL) return; - name_field->setText(doc->getNextName(type).c_str()); + name_field->setText(doc->getNextName(type).c_str()); } // ============================================================== selectElementOfModel /*Selects in the model (treeview) elements selected in a listwidget, * or an element in a line edit.*/ - void HexaBaseDialog::selectElementOfModel() { - if (getPatternDataSelectionModel() == NULL) return; - - QListWidget* currentListWidget = dynamic_cast( sender() ); - if ( !currentListWidget ) return; + if (getPatternDataSelectionModel() == NULL) return; - _selectionMutex = true; - - QList sel = currentListWidget->selectedItems(); - QModelIndex index; - getPatternDataSelectionModel()->clearSelection(); - foreach ( QListWidgetItem *item, sel ){ -// index = item->data(LW_QMODELINDEX_ROLE).value(); //unsafe: index can change in the tree - index = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); - if ( index.isValid() ) - { - getPatternDataSelectionModel()->select( index, QItemSelectionModel::Select ); - } - } - _selectionMutex = false; + QListWidget* currentListWidget = dynamic_cast( sender() ); + if ( !currentListWidget ) return; + QList sel = currentListWidget->selectedItems(); + QModelIndex index; + getPatternDataSelectionModel()->clearSelection(); + foreach ( QListWidgetItem *item, sel ){ + //index = item->data(LW_QMODELINDEX_ROLE).value(); //unsafe: index can change in the tree + index = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); + if ( index.isValid() ) + getPatternDataSelectionModel()->select( index, QItemSelectionModel::SelectCurrent ); + } } // ============================================================== _isLineOrListWidget @@ -904,11 +835,11 @@ void HexaBaseDialog::selectElementOfModel() */ bool HexaBaseDialog::_isLineOrListWidget(QObject *widget) { - if (widget == NULL) return false; + if (widget == NULL) return false; - QLineEdit *lineEdit = dynamic_cast(widget); - QListWidget *listWidget = dynamic_cast(widget); - return (lineEdit != NULL) || (listWidget != NULL); + QLineEdit *lineEdit = dynamic_cast(widget); + QListWidget *listWidget = dynamic_cast(widget); + return (lineEdit != NULL) || (listWidget != NULL); }//_isLineOrListWidget @@ -919,12 +850,12 @@ bool HexaBaseDialog::_isLineOrListWidget(QObject *widget) */ void HexaBaseDialog::_highlightWidget(QObject *obj, Qt::GlobalColor clr) { - if (!_isLineOrListWidget(obj)) return; + if (!_isLineOrListWidget(obj)) return; - QWidget *widget = dynamic_cast(obj); //sure it's not NULL (_isLineOrListWidget(obj)) - QPalette palette1 = widget->palette(); - palette1.setColor(widget->backgroundRole(), clr); - widget->setPalette(palette1); + QWidget *widget = dynamic_cast(obj); //sure it's not NULL (_isLineOrListWidget(obj)) + QPalette palette1 = widget->palette(); + palette1.setColor(widget->backgroundRole(), clr); + widget->setPalette(palette1); }//_highlightWidget @@ -932,9 +863,9 @@ void HexaBaseDialog::_highlightWidget(QObject *obj, Qt::GlobalColor clr) // ============================================================== _updateCurrentObject void HexaBaseDialog::_updateCurrentObject(QObject* obj) { - _highlightWidget(_currentObj, Qt::white); - _currentObj = obj; - _highlightWidget(obj, Qt::yellow); + _highlightWidget(_currentObj, Qt::white); + _currentObj = obj; + _highlightWidget(obj, Qt::yellow); } // ============================================================== eventFilter @@ -943,142 +874,84 @@ void HexaBaseDialog::_updateCurrentObject(QObject* obj) */ bool HexaBaseDialog::eventFilter(QObject *obj, QEvent *event) { - // highlightSelectedAssocs(); - QLineEdit *lineEdit = dynamic_cast(obj); - QListWidget *listWidget = dynamic_cast(obj); - HexaBaseDialog *dialog = dynamic_cast(obj); - - if ( event->type() == QEvent::KeyPress ) - { - if ( ((QKeyEvent*)event)->key() == Qt::Key_Return) - { - setFocusToNextField(); - return true; - } - } + QLineEdit *lineEdit = dynamic_cast(obj); + QListWidget *listWidget = dynamic_cast(obj); - if ( event->type() == QEvent::FocusOut ){ - QString className = obj->metaObject()->className(); - QString objectName = obj->objectName(); - } + // * Enter key press ------ + if ( event->type() == QEvent::KeyPress && + ((QKeyEvent*)event)->key() == Qt::Key_Return) + { + setFocusToNextField(); + return true; + } - if ( event->type() == QEvent::FocusIn ){ - QString className = obj->metaObject()->className(); - QString objectName = obj->objectName(); + // * Focus out from a list widget ------ + if ( event->type() == QEvent::FocusOut && listWidget != NULL) + { + QItemSelectionModel * selectionModel = listWidget->selectionModel(); + selectionModel->clearSelection(); + } - } - else return false; + if ( event->type() != QEvent::FocusIn ) + return false; + // * Focus In ------ + // allow vtk selection + if (getObjectViewType(obj) == HEXABLOCKGUI::VTK) + _allowVTKSelection( obj ); - /* ON FOCUS ON A WIDGET*/ + //allow occ selection + if (getObjectViewType(obj) == HEXABLOCKGUI::OCC) + _allowOCCSelection( obj ); - QVariant v; - QModelIndex index; + //Depending on the focused widget type, get the right selector for it + QVariant v; + QModelIndex index; + QItemSelectionModel* selector = _getSelector( obj ); + if ( selector == NULL ) + { + _updateCurrentObject(obj); + return false; + } - QItemSelectionModel *selector = 0; + if ( _currentObj != obj && (lineEdit == NULL || listWidget == NULL) ) + selector->clearSelection(); - //vtk selection - if (getObjectViewType(obj) == HEXABLOCKGUI::VTK) - _allowVTKSelection( obj ); + _updateCurrentObject(obj); - //geom selection - if (getObjectViewType(obj) == HEXABLOCKGUI::OCC) - _allowOCCSelection( obj ); + //If the widget contains an element, select it in model/view + if ( lineEdit != NULL ){ //element can be from lineEdit + v = lineEdit->property("HexaData"); + if ( !v.isValid() ) + return QObject::eventFilter(obj, event); + index = ((SelectionModel*)selector)->indexBy( HEXA_DATA_ROLE, v); + if (index.isValid()) + selector->select( index, QItemSelectionModel::SelectCurrent ); + } - //If the widget is a geom line edit highlight its content in the occ view - if (lineEdit != NULL && getPatternDataSelectionModel() != NULL && - getObjectViewType(obj) == HEXABLOCKGUI::OCC && !lineEdit->text().isEmpty()) - { - //highlight element in the OCC View - QMultiMap geomElts; - DocumentModel::GeomObj geomObj; - QVariant v = lineEdit->property("GeomObj"); - if ( v.isValid() ) - { - geomObj = v.value(); - geomElts.insert( geomObj.shapeName, geomObj.subid.toInt() ); - } - HEXABLOCKGUI::currentOccGView->highlight(geomElts); - } - - //Depending of focused widget type, get the right selector for it - selector = _getSelector( obj ); - if ( selector == NULL ) - { - _updateCurrentObject(obj); - return false; - } - - if ( _currentObj != obj && (lineEdit || listWidget) ) - selector->clearSelection(); - - _updateCurrentObject(obj); - - //If there is a current selection fill the widget with it - if ( selector->hasSelection() ){ - // QItemSelection currentSelection = selector->selection(); - // bool selOk = false; - // if ( lineEdit ){ //element can be from lineEdit - // selOk = _onSelectionChanged( currentSelection, lineEdit ); - // } else if ( listWidget ){ - // selOk = _onSelectionChanged( currentSelection, listWidget ); - // } - // if ( !selOk && ( lineEdit || listWidget ) ){ - // selector->clearSelection(); - // } - - } else { //If the widget contains an hexa element, select it in model/view - if ( lineEdit ){ //element can be from lineEdit - v = lineEdit->property("QModelIndex"); - if ( !v.isValid() ) { - //return QObject::eventFilter(obj, event); - return false; - } - index = v.value(); - - _selectionMutex = true; - selector->select( index, QItemSelectionModel::Clear ); - selector->select( index, QItemSelectionModel::Select ); - _selectionMutex = false; - } - - if ( dialog ){ //element can be from a dialog box - v = dialog->property("QModelIndex"); - if ( !v.isValid() ) { - //return QObject::eventFilter(obj, event); - return false; - } - index = v.value(); - _selectionMutex = true; - selector->select( index, QItemSelectionModel::Clear ); - selector->select( index, QItemSelectionModel::Select ); - _selectionMutex = false; - } - - } - return false; + return QObject::eventFilter(obj, event); } // ------------------------- VERTEX ---------------------------------- // ============================================================== Constructeur VertexDialog::VertexDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f), - _value(0) + HexaBaseDialog(parent, editmode, f), + _value(0) { - _helpFileName = "gui_vertex.html"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( name_le ); + _helpFileName = "gui_vertex.html"; + setupUi( this ); + _initWidget(editmode); + // setFocusProxy( name_le ); - if ( editmode == NEW_MODE ){ - setWindowTitle( tr("Vertex Construction") ); - } else if ( editmode == UPDATE_MODE ){ - setWindowTitle( tr("Vertex Modification") ); - } - else if ( editmode == INFO_MODE){ - setWindowTitle( tr("Vertex Information") ); - } + if ( editmode == NEW_MODE ){ + setWindowTitle( tr("Vertex Construction") ); + } else if ( editmode == UPDATE_MODE ){ + setWindowTitle( tr("Vertex Modification") ); + } + else if ( editmode == INFO_MODE){ + setWindowTitle( tr("Vertex Information") ); + } } // ============================================================== Destructeur @@ -1086,148 +959,156 @@ VertexDialog::~VertexDialog() { } - // ============================================================== _initInputWidget void VertexDialog::_initInputWidget( Mode editmode ) { - x_spb->setRange(VERTEX_COORD_MIN, VERTEX_COORD_MAX); - y_spb->setRange(VERTEX_COORD_MIN, VERTEX_COORD_MAX); - z_spb->setRange(VERTEX_COORD_MIN, VERTEX_COORD_MAX); +// x_spb->setRange(VERTEX_COORD_MIN, VERTEX_COORD_MAX); +// y_spb->setRange(VERTEX_COORD_MIN, VERTEX_COORD_MAX); +// z_spb->setRange(VERTEX_COORD_MIN, VERTEX_COORD_MAX); + QDoubleValidator *doubleValidator = new QDoubleValidator(widget_2); + x_spb->setValidator(doubleValidator); + y_spb->setValidator(doubleValidator); + z_spb->setValidator(doubleValidator); -// setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - installEventFilter(this); -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - name_le->installEventFilter(this); + // setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + installEventFilter(this); + // name_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + name_le->installEventFilter(this); - if (editmode == INFO_MODE) - { - name_le->setReadOnly(true); - x_spb->setReadOnly(true); - y_spb->setReadOnly(true); - z_spb->setReadOnly(true); - } + if (editmode == INFO_MODE) + { + name_le->setReadOnly(true); + x_spb->setReadOnly(true); + y_spb->setReadOnly(true); + z_spb->setReadOnly(true); + } - //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName())); + //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName())); } // ============================================================== clear void VertexDialog::clear() { - name_le->clear(); + name_le->clear(); - modelUnregister(this); + modelUnregister(this); } // ============================================================== setValue void VertexDialog::setValue(HEXA_NS::Vertex* v) { - //0) Name - name_le->setText( v->getName() ); + //0) Name + name_le->setText( v->getName() ); - //1) Value (x,y,z) - x_spb->setValue( v->getX() ); - y_spb->setValue( v->getY() ); - z_spb->setValue( v->getZ() ); + //1) Value (x,y,z) +// x_spb->setValue( v->getX() ); +// y_spb->setValue( v->getY() ); +// z_spb->setValue( v->getZ() ); + x_spb->setText( QString::number(v->getX()) ); + y_spb->setText( QString::number(v->getY()) ); + z_spb->setText( QString::number(v->getZ()) ); - if ( getPatternDataSelectionModel() != NULL ){ - QModelIndex iv = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v) ); + if ( getPatternDataSelectionModel() != NULL ){ + QModelIndex iv = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v) ); - setProperty( "QModelIndex", QVariant::fromValue(iv) ); - name_le->setProperty( "QModelIndex", QVariant::fromValue(iv) ); - } - _value = v; + setProperty( "QModelIndex", QVariant::fromValue(iv) ); + name_le->setProperty( "QModelIndex", QVariant::fromValue(iv) ); + } + _value = v; } - // ============================================================== getValue HEXA_NS::Vertex* VertexDialog::getValue() { - return _value; + return _value; } // ============================================================== apply bool VertexDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - if ( !getPatternDataSelectionModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return false; - - bool isOk = false; - - QModelIndex iVertex; - double newX = x_spb->value(); - double newY = y_spb->value(); - double newZ = z_spb->value(); - - if ( _editMode == UPDATE_MODE){ - QVariant v = property("QModelIndex"); - if ( v.isValid() ){ - iVertex = patternDataModel->mapToSource( v.value() ); - if ( iVertex.isValid() ) - isOk = getDocumentModel()->updateVertex( iVertex, newX, newY, newZ ); - } - } else if ( _editMode == NEW_MODE){ - iVertex = getDocumentModel()->addVertex( newX, newY, newZ ); - if ( iVertex.isValid() ) - { - isOk = true; - } - } - if (!isOk) { - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "VERTEX UPDATE/CONSTRUCTION" ) ); - return false; - } + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ - getDocumentModel()->setName( iVertex, newName ); + if ( !getDocumentModel() ) return false; + if ( !getPatternDataSelectionModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return false; - //the default name in the dialog box - HEXA_NS::Vertex* v = getDocumentModel()->getHexaPtr(iVertex); - if (v != NULL) - updateDefaultName(name_le, v->getType()); + QModelIndex iVertex; - // to select/highlight result - result = patternDataModel->mapFromSource(iVertex); + QString xStr = x_spb->text(); + QString yStr = y_spb->text(); + QString zStr = z_spb->text(); + bool isOk = false, validArgs = !xStr.isEmpty() && !yStr.isEmpty() && !zStr.isEmpty(); - // updateDialogBoxName(name_le, result); - // const char *defaultName = getDocumentModel()->getHexaPtr(last)->getName(); - return isOk; -} + double newX, newY, newZ; + if (validArgs) + { + newX = xStr.toDouble(); + newY = yStr.toDouble(); + newZ = zStr.toDouble(); + } + + if ( _editMode == UPDATE_MODE && validArgs){ + QVariant v = property("QModelIndex"); + if ( v.isValid() ){ + iVertex = patternDataModel->mapToSource( v.value() ); + if ( iVertex.isValid() ) + isOk = getDocumentModel()->updateVertex( iVertex, newX, newY, newZ ); + } + } else if ( _editMode == NEW_MODE && validArgs){ + iVertex = getDocumentModel()->addVertex( newX, newY, newZ ); + if ( iVertex.isValid() ) + isOk = true; + } + if (!isOk) { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "VERTEX UPDATE/CONSTRUCTION" ) + "\n" + getErrorMsg() ); + return false; + } + + QString newName = name_le->text(); + if ( !newName.isEmpty() )/*{*/ + getDocumentModel()->setName( iVertex, newName ); + //the default name in the dialog box + HEXA_NS::Vertex* v = getDocumentModel()->getHexaPtr(iVertex); + if (v != NULL) + updateDefaultName(name_le, v->getType()); + + // to select/highlight result + result = patternDataModel->mapFromSource(iVertex); + + // updateDialogBoxName(name_le, result); + // const char *defaultName = getDocumentModel()->getHexaPtr(last)->getName(); + return isOk; +} // ------------------------- EDGE ---------------------------------- // ============================================================== Constructeur EdgeDialog::EdgeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f), - _value(0) + HexaBaseDialog(parent, editmode, f), + _value(0) { - _helpFileName = "gui_edge.html"; - setupUi( this ); - _initWidget(editmode); + _helpFileName = "gui_edge.html"; + setupUi( this ); + _initWidget(editmode); - // rb0->setFocusProxy( v0_le_rb0 ); - // rb1->setFocusProxy( vex_le_rb1 ); + // rb0->setFocusProxy( v0_le_rb0 ); + // rb1->setFocusProxy( vex_le_rb1 ); - if ( editmode == INFO_MODE ){ - setWindowTitle( tr("Edge Information") ); - rb1->hide(); - } - else if ( editmode == UPDATE_MODE ){ - setWindowTitle( tr("Edge Modification") ); - } + if ( editmode == INFO_MODE ){ + setWindowTitle( tr("Edge Information") ); + rb1->hide(); + } + else if ( editmode == UPDATE_MODE ){ + setWindowTitle( tr("Edge Modification") ); + } - rb0->click(); + rb0->click(); } - // ============================================================== Destructeur EdgeDialog::~EdgeDialog() { @@ -1237,161 +1118,150 @@ EdgeDialog::~EdgeDialog() // ============================================================== _initInputWidget void EdgeDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); -// setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - installEventFilter(this); + // setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + installEventFilter(this); -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - name_le->installEventFilter(this); + // name_le->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + name_le->installEventFilter(this); - v0_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v1_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v0_le_rb0->setValidator( validator ); - v1_le_rb0->setValidator( validator ); - v0_le_rb0->installEventFilter(this); - v1_le_rb0->installEventFilter(this); + v0_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v1_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v0_le_rb0->setValidator( validator ); + v1_le_rb0->setValidator( validator ); + v0_le_rb0->installEventFilter(this); + v1_le_rb0->installEventFilter(this); - vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - vex_le_rb1->setValidator( validator ); - vec_le_rb1->setValidator( validator ); - vex_le_rb1->installEventFilter(this); - vec_le_rb1->installEventFilter(this); + vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vec_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + vex_le_rb1->setValidator( validator ); + vec_le_rb1->setValidator( validator ); + vex_le_rb1->installEventFilter(this); + vec_le_rb1->installEventFilter(this); - v0_le_rb0->setReadOnly(true); - v1_le_rb0->setReadOnly(true); - vex_le_rb1->setReadOnly(true); - vec_le_rb1->setReadOnly(true); + v0_le_rb0->setReadOnly(true); + v1_le_rb0->setReadOnly(true); + vex_le_rb1->setReadOnly(true); + vec_le_rb1->setReadOnly(true); - if (editmode == INFO_MODE) - name_le->setReadOnly(true); + if (editmode == INFO_MODE) + name_le->setReadOnly(true); - //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) ); + //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) ); } - // ============================================================== Clear void EdgeDialog::clear() { - name_le->clear(); + name_le->clear(); - v0_le_rb0->clear(); - modelUnregister(v0_le_rb0); + v0_le_rb0->clear(); + modelUnregister(v0_le_rb0); - v1_le_rb0->clear(); - modelUnregister(v1_le_rb0); + v1_le_rb0->clear(); + modelUnregister(v1_le_rb0); - vex_le_rb1->clear(); - modelUnregister(vex_le_rb1); + vex_le_rb1->clear(); + modelUnregister(vex_le_rb1); - vec_le_rb1->clear(); - modelUnregister(vec_le_rb1); + vec_le_rb1->clear(); + modelUnregister(vec_le_rb1); - modelUnregister(this); + modelUnregister(this); } - - // ============================================================== setValue void EdgeDialog::setValue(HEXA_NS::Edge* e) { - HEXA_NS::Vertex* v0 = e->getVertex(0); - HEXA_NS::Vertex* v1 = e->getVertex(1); - // HEXA_NS::EltBase* e0 = e; - // HEXA_NS::EltBase* v0 = e->getVertex(0); - // HEXA_NS::EltBase* v1 = e->getVertex(1); + HEXA_NS::Vertex* v0 = e->getVertex(0); + HEXA_NS::Vertex* v1 = e->getVertex(1); - name_le->setText( e->getName() ); - v0_le_rb0->setText( v0->getName() ); - v1_le_rb0->setText( v1->getName() ); + name_le->setText( e->getName() ); + v0_le_rb0->setText( v0->getName() ); + v1_le_rb0->setText( v1->getName() ); - if ( getPatternDataSelectionModel() ){ - QModelIndex ie = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e) ); - QModelIndex iv0 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v0) ); - QModelIndex iv1 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v1) ); + if ( getPatternDataSelectionModel() ){ + QModelIndex ie = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e) ); + QModelIndex iv0 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v0) ); + QModelIndex iv1 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v1) ); - name_le->setProperty( "QModelIndex", QVariant::fromValue(ie) ); - v0_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv0) ); - v1_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv1) ); - } - _value = e; + name_le->setProperty( "QModelIndex", QVariant::fromValue(ie) ); + v0_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv0) ); + v1_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv1) ); + } + _value = e; } - // ============================================================== getValue HEXA_NS::Edge* EdgeDialog::getValue() { - return _value; + return _value; } // ============================================================== apply bool EdgeDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel ) return false; + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel ) return false; - QModelIndex iEdge; + QModelIndex iEdge; - if ( rb0->isChecked() ){ - QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb0] ); - QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb0] ); - if ( iv0.isValid()&& iv1.isValid() ){ - iEdge = getDocumentModel()->addEdgeVertices( iv0, iv1 ); - } - } else if ( rb1->isChecked() ){ - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] ); - if ( ivex.isValid() && ivec.isValid() ){ - iEdge = getDocumentModel()->addEdgeVector( ivex, ivec ); - } - } + if ( rb0->isChecked() ){ + QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb0] ); + QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb0] ); + if ( iv0.isValid()&& iv1.isValid() ){ + iEdge = getDocumentModel()->addEdgeVertices( iv0, iv1 ); + } + } else if ( rb1->isChecked() ){ + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] ); + if ( ivex.isValid() && ivec.isValid() ){ + iEdge = getDocumentModel()->addEdgeVector( ivex, ivec ); + } + } - if ( !iEdge.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT BUILD EDGE" ) ); - return false; - } - _value = iEdge.model()->data(iEdge, HEXA_DATA_ROLE).value(); + if ( !iEdge.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT BUILD EDGE" ) + "\n" + getErrorMsg() ); + return false; + } + _value = iEdge.model()->data(iEdge, HEXA_DATA_ROLE).value(); - QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ - getDocumentModel()->setName( iEdge, newName ); + QString newName = name_le->text(); + if ( !newName.isEmpty() )/*{*/ + getDocumentModel()->setName( iEdge, newName ); - //update the default name in the dialog box - if (_value != NULL) - updateDefaultName(name_le, _value->getType()); + //update the default name in the dialog box + if (_value != NULL) + updateDefaultName(name_le, _value->getType()); - result = patternDataModel->mapFromSource(iEdge); + result = patternDataModel->mapFromSource(iEdge); - return true; + return true; } - // ------------------------- QUAD ---------------------------------- // ============================================================== Constructeur QuadDialog::QuadDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f), - _value(0) +HexaBaseDialog(parent, editmode, f), +_value(0) { - _helpFileName = "gui_quadrangle.html"; - setupUi( this ); - _initWidget(editmode); - // rb0->setFocusProxy( v0_le_rb0 ); - // rb1->setFocusProxy( e0_le_rb1 ); - rb0->click(); + _helpFileName = "gui_quadrangle.html"; + setupUi( this ); + _initWidget(editmode); + rb0->click(); - if ( editmode == INFO_MODE ){ - setWindowTitle( tr("Quad Information") ); - } + if ( editmode == INFO_MODE ){ + setWindowTitle( tr("Quad Information") ); + } } // ============================================================== Destructeur @@ -1402,246 +1272,234 @@ QuadDialog::~QuadDialog() // ============================================================== _initInputWidget void QuadDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - -// setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - installEventFilter(this); - -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - name_le->installEventFilter(this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); - v0_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v1_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v2_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v3_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + installEventFilter(this); + name_le->installEventFilter(this); - v0_le_rb0->setValidator( validator ); - v1_le_rb0->setValidator( validator ); - v2_le_rb0->setValidator( validator ); - v3_le_rb0->setValidator( validator ); - v0_le_rb0->installEventFilter(this); - v1_le_rb0->installEventFilter(this); - v2_le_rb0->installEventFilter(this); - v3_le_rb0->installEventFilter(this); + v0_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v1_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v2_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v3_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - e0_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - e1_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - e2_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - e3_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + v0_le_rb0->setValidator( validator ); + v1_le_rb0->setValidator( validator ); + v2_le_rb0->setValidator( validator ); + v3_le_rb0->setValidator( validator ); + v0_le_rb0->installEventFilter(this); + v1_le_rb0->installEventFilter(this); + v2_le_rb0->installEventFilter(this); + v3_le_rb0->installEventFilter(this); - e0_le_rb1->setValidator( validator ); - e1_le_rb1->setValidator( validator ); - e2_le_rb1->setValidator( validator ); - e3_le_rb1->setValidator( validator ); + e0_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + e1_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + e2_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + e3_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - e0_le_rb1->installEventFilter(this); - e1_le_rb1->installEventFilter(this); - e2_le_rb1->installEventFilter(this); - e3_le_rb1->installEventFilter(this); + e0_le_rb1->setValidator( validator ); + e1_le_rb1->setValidator( validator ); + e2_le_rb1->setValidator( validator ); + e3_le_rb1->setValidator( validator ); - v0_le_rb0->setReadOnly(true); - v1_le_rb0->setReadOnly(true); - v2_le_rb0->setReadOnly(true); - v3_le_rb0->setReadOnly(true); + e0_le_rb1->installEventFilter(this); + e1_le_rb1->installEventFilter(this); + e2_le_rb1->installEventFilter(this); + e3_le_rb1->installEventFilter(this); - e0_le_rb1->setReadOnly(true); - e1_le_rb1->setReadOnly(true); - e2_le_rb1->setReadOnly(true); - e3_le_rb1->setReadOnly(true); + v0_le_rb0->setReadOnly(true); + v1_le_rb0->setReadOnly(true); + v2_le_rb0->setReadOnly(true); + v3_le_rb0->setReadOnly(true); - if (editmode == INFO_MODE) - name_le->setReadOnly(true); + e0_le_rb1->setReadOnly(true); + e1_le_rb1->setReadOnly(true); + e2_le_rb1->setReadOnly(true); + e3_le_rb1->setReadOnly(true); - //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) ); + if (editmode == INFO_MODE) + name_le->setReadOnly(true); } - // ============================================================== clear void QuadDialog::clear() { //Clear the dialog and unregister it from the model - QModelIndex invalidIndex; + QModelIndex invalidIndex; - name_le->clear(); + name_le->clear(); - v0_le_rb0->clear(); - modelUnregister(v0_le_rb0); + v0_le_rb0->clear(); + modelUnregister(v0_le_rb0); - v1_le_rb0->clear(); - modelUnregister(v1_le_rb0); + v1_le_rb0->clear(); + modelUnregister(v1_le_rb0); - v2_le_rb0->clear(); - modelUnregister(v2_le_rb0); + v2_le_rb0->clear(); + modelUnregister(v2_le_rb0); - v3_le_rb0->clear(); - modelUnregister(v3_le_rb0); + v3_le_rb0->clear(); + modelUnregister(v3_le_rb0); - e0_le_rb1->clear(); - modelUnregister(e0_le_rb1); + e0_le_rb1->clear(); + modelUnregister(e0_le_rb1); - e1_le_rb1->clear(); - modelUnregister(e1_le_rb1); + e1_le_rb1->clear(); + modelUnregister(e1_le_rb1); - e2_le_rb1->clear(); - modelUnregister(e2_le_rb1); + e2_le_rb1->clear(); + modelUnregister(e2_le_rb1); - e3_le_rb1->clear(); - modelUnregister(e3_le_rb1); + e3_le_rb1->clear(); + modelUnregister(e3_le_rb1); - modelUnregister(this); + modelUnregister(this); } - // ============================================================== setValue void QuadDialog::setValue(HEXA_NS::Quad* q) { - Q_ASSERT( q->countEdge() == 4 ); - Q_ASSERT( q->countVertex() == 4 ); + Q_ASSERT( q->countEdge() == 4 ); + Q_ASSERT( q->countVertex() == 4 ); - //0) Name - name_le->setText( q->getName() ); + //0) Name + name_le->setText( q->getName() ); - //1) Vertices - HEXA_NS::Vertex* v0 = q->getVertex(0); - HEXA_NS::Vertex* v1 = q->getVertex(1); - HEXA_NS::Vertex* v2 = q->getVertex(2); - HEXA_NS::Vertex* v3 = q->getVertex(3); + //1) Vertices + HEXA_NS::Vertex* v0 = q->getVertex(0); + HEXA_NS::Vertex* v1 = q->getVertex(1); + HEXA_NS::Vertex* v2 = q->getVertex(2); + HEXA_NS::Vertex* v3 = q->getVertex(3); - v0_le_rb0->setText( v0->getName() ); - v1_le_rb0->setText( v1->getName() ); - v2_le_rb0->setText( v2->getName() ); - v3_le_rb0->setText( v3->getName() ); + v0_le_rb0->setText( v0->getName() ); + v1_le_rb0->setText( v1->getName() ); + v2_le_rb0->setText( v2->getName() ); + v3_le_rb0->setText( v3->getName() ); - //2) Edges - HEXA_NS::Edge* e0 = q->getEdge(0); - HEXA_NS::Edge* e1 = q->getEdge(1); - HEXA_NS::Edge* e2 = q->getEdge(2); - HEXA_NS::Edge* e3 = q->getEdge(3); + //2) Edges + HEXA_NS::Edge* e0 = q->getEdge(0); + HEXA_NS::Edge* e1 = q->getEdge(1); + HEXA_NS::Edge* e2 = q->getEdge(2); + HEXA_NS::Edge* e3 = q->getEdge(3); - e0_le_rb1->setText( e0->getName() ); - e1_le_rb1->setText( e1->getName() ); - e2_le_rb1->setText( e2->getName() ); - e3_le_rb1->setText( e3->getName() ); + e0_le_rb1->setText( e0->getName() ); + e1_le_rb1->setText( e1->getName() ); + e2_le_rb1->setText( e2->getName() ); + e3_le_rb1->setText( e3->getName() ); - if ( getPatternDataSelectionModel() ){ - QModelIndex iq = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(q) ); + if ( getPatternDataSelectionModel() ){ + QModelIndex iq = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(q) ); - QModelIndex iv0 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v0) ); - QModelIndex iv1 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v1) ); - QModelIndex iv2 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v2) ); - QModelIndex iv3 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v3) ); + QModelIndex iv0 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v0) ); + QModelIndex iv1 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v1) ); + QModelIndex iv2 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v2) ); + QModelIndex iv3 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v3) ); - QModelIndex ie0 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e0) ); - QModelIndex ie1 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e1) ); - QModelIndex ie2 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e2) ); - QModelIndex ie3 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e3) ); + QModelIndex ie0 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e0) ); + QModelIndex ie1 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e1) ); + QModelIndex ie2 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e2) ); + QModelIndex ie3 = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(e3) ); - name_le->setProperty( "QModelIndex", QVariant::fromValue(iq) ); + name_le->setProperty( "QModelIndex", QVariant::fromValue(iq) ); - v0_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv0) ); - v1_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv1) ); - v2_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv2) ); - v3_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv3) ); + v0_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv0) ); + v1_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv1) ); + v2_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv2) ); + v3_le_rb0->setProperty( "QModelIndex", QVariant::fromValue(iv3) ); - e0_le_rb1->setProperty( "QModelIndex", QVariant::fromValue(ie0) ); - e1_le_rb1->setProperty( "QModelIndex", QVariant::fromValue(ie1) ); - e2_le_rb1->setProperty( "QModelIndex", QVariant::fromValue(ie2) ); - e3_le_rb1->setProperty( "QModelIndex", QVariant::fromValue(ie3) ); - } - _value = q; + e0_le_rb1->setProperty( "QModelIndex", QVariant::fromValue(ie0) ); + e1_le_rb1->setProperty( "QModelIndex", QVariant::fromValue(ie1) ); + e2_le_rb1->setProperty( "QModelIndex", QVariant::fromValue(ie2) ); + e3_le_rb1->setProperty( "QModelIndex", QVariant::fromValue(ie3) ); + } + _value = q; } // ============================================================== getValue HEXA_NS::Quad* QuadDialog::getValue() { - return _value; + return _value; } // ============================================================== apply bool QuadDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return false; + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return false; - QModelIndex iQuad; + QModelIndex iQuad; - if ( rb0->isChecked() ){ //vertices - QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb0] ); - QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb0] ); - QModelIndex iv2 = patternDataModel->mapToSource( _index[v2_le_rb0] ); - QModelIndex iv3 = patternDataModel->mapToSource( _index[v3_le_rb0] ); + if ( rb0->isChecked() ){ //vertices + QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb0] ); + QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb0] ); + QModelIndex iv2 = patternDataModel->mapToSource( _index[v2_le_rb0] ); + QModelIndex iv3 = patternDataModel->mapToSource( _index[v3_le_rb0] ); - if ( iv0.isValid() - && iv1.isValid() - && iv2.isValid() - && iv3.isValid() ){ - iQuad = getDocumentModel()->addQuadVertices( iv0, iv1, iv2, iv3 ); - } - } else if ( rb1->isChecked() ){ //edges - QModelIndex ie0 = patternDataModel->mapToSource( _index[e0_le_rb1] ); - QModelIndex ie1 = patternDataModel->mapToSource( _index[e1_le_rb1] ); - QModelIndex ie2 = patternDataModel->mapToSource( _index[e2_le_rb1] ); - QModelIndex ie3 = patternDataModel->mapToSource( _index[e3_le_rb1] ); - - if ( ie0.isValid() - && ie1.isValid() - && ie2.isValid() - && ie3.isValid() ){ - iQuad = getDocumentModel()->addQuadEdges( ie0, ie1, ie2, ie3 ); - } - } + if ( iv0.isValid() + && iv1.isValid() + && iv2.isValid() + && iv3.isValid() ){ + iQuad = getDocumentModel()->addQuadVertices( iv0, iv1, iv2, iv3 ); + } + } else if ( rb1->isChecked() ){ //edges + QModelIndex ie0 = patternDataModel->mapToSource( _index[e0_le_rb1] ); + QModelIndex ie1 = patternDataModel->mapToSource( _index[e1_le_rb1] ); + QModelIndex ie2 = patternDataModel->mapToSource( _index[e2_le_rb1] ); + QModelIndex ie3 = patternDataModel->mapToSource( _index[e3_le_rb1] ); + + if ( ie0.isValid() + && ie1.isValid() + && ie2.isValid() + && ie3.isValid() ){ + iQuad = getDocumentModel()->addQuadEdges( ie0, ie1, ie2, ie3 ); + } + } - if ( !iQuad.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT BUILD QUAD" ) ); - return false; - } - _value = iQuad.model()->data(iQuad, HEXA_DATA_ROLE).value(); + if ( !iQuad.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT BUILD QUAD" ) + "\n" + getErrorMsg()); + return false; + } + _value = iQuad.model()->data(iQuad, HEXA_DATA_ROLE).value(); - QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ - getDocumentModel()->setName( iQuad, newName ); + QString newName = name_le->text(); + if ( !newName.isEmpty() )/*{*/ + getDocumentModel()->setName( iQuad, newName ); - //the default name in the dialog box - if (_value != NULL) - updateDefaultName(name_le, _value->getType()); + //the default name in the dialog box + if (_value != NULL) + updateDefaultName(name_le, _value->getType()); - // to select/highlight result - result = patternDataModel->mapFromSource(iQuad); + // to select/highlight result + result = patternDataModel->mapFromSource(iQuad); - return true; + return true; } - // ------------------------- HEXA ---------------------------------- // ============================================================== HexaDialog HexaDialog::HexaDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): -HexaBaseDialog(parent, editmode, f), -_value(0) + HexaBaseDialog(parent, editmode, f), + _value(0) { - _helpFileName = "gui_hexahedron.html"; - setupUi( this ); - _initWidget(editmode); - // quads_rb->setFocusProxy( quads_lw ); - // vertices_rb->setFocusProxy( vertices_lw ); - quads_rb->click(); - // quads_rb->setFocus(); + _helpFileName = "gui_hexahedron.html"; + setupUi( this ); + _initWidget(editmode); + quads_rb->click(); - if ( editmode == INFO_MODE ){ - setWindowTitle( tr("Hexahedron Information") ); - } + if ( editmode == INFO_MODE ){ + setWindowTitle( tr("Hexahedron Information") ); + } } // ============================================================== Destructeur @@ -1649,66 +1507,60 @@ HexaDialog::~HexaDialog() { } - // ============================================================== _initInputWidget void HexaDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); + QRegExp rx(""); -// setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); - installEventFilter(this); + installEventFilter(this); + name_le->installEventFilter(this); -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); - name_le->installEventFilter(this); + quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + quads_lw->installEventFilter(this); - quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - quads_lw->installEventFilter(this); + vertices_lw->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vertices_lw->installEventFilter(this); - vertices_lw->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vertices_lw->installEventFilter(this); + if ( editmode != INFO_MODE ) { + // delete item from listwidget + QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); + QShortcut* delVertexShortcut = new QShortcut( QKeySequence(Qt::Key_X), vertices_lw ); + delQuadShortcut->setContext( Qt::WidgetShortcut ); + delVertexShortcut->setContext( Qt::WidgetShortcut ); + connect(delQuadShortcut, SIGNAL(activated()), this, SLOT(deleteQuadItem())); + connect(delVertexShortcut, SIGNAL(activated()), this, SLOT(deleteVertexItem())); + } + // highlight item on model view (VTK) from listwidget + connect( quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); + connect( vertices_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); - if ( editmode != INFO_MODE ) { - // delete item from listwidget - QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); - QShortcut* delVertexShortcut = new QShortcut( QKeySequence(Qt::Key_X), vertices_lw ); - delQuadShortcut->setContext( Qt::WidgetShortcut ); - delVertexShortcut->setContext( Qt::WidgetShortcut ); - connect(delQuadShortcut, SIGNAL(activated()), this, SLOT(deleteQuadItem())); - connect(delVertexShortcut, SIGNAL(activated()), this, SLOT(deleteVertexItem())); - } - // edit name - //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) ); - // highlight item on model view (VTK) from listwidget - connect( quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); - connect( vertices_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); - - if ( editmode != INFO_MODE) - { - connect( vertices_rb, SIGNAL(clicked()), vertices_lw, SLOT(setFocus())); - connect( quads_rb, SIGNAL(clicked()), quads_lw, SLOT(setFocus())); - } + if ( editmode != INFO_MODE) + { + connect( vertices_rb, SIGNAL(clicked()), vertices_lw, SLOT(setFocus())); + connect( quads_rb, SIGNAL(clicked()), quads_lw, SLOT(setFocus())); + } - connect( vertices_rb, SIGNAL(clicked()), this, SLOT(refreshHighlight()), Qt::UniqueConnection); - connect( quads_rb, SIGNAL(clicked()), this, SLOT(refreshHighlight()), Qt::UniqueConnection); + connect( vertices_rb, SIGNAL(clicked()), this, SLOT(refreshHighlight()), Qt::UniqueConnection); + connect( quads_rb, SIGNAL(clicked()), this, SLOT(refreshHighlight()), Qt::UniqueConnection); - if (editmode == INFO_MODE) - name_le->setReadOnly(true); + if (editmode == INFO_MODE) + name_le->setReadOnly(true); } // ============================================================== clear void HexaDialog::clear() { - name_le->clear(); + name_le->clear(); - quads_lw->clear(); - modelUnregister(quads_lw); + quads_lw->clear(); + modelUnregister(quads_lw); - vertices_lw->clear(); - modelUnregister(vertices_lw); + vertices_lw->clear(); + modelUnregister(vertices_lw); - modelUnregister(this); + modelUnregister(this); } // ============================================================== getAssocsVTK @@ -1717,198 +1569,190 @@ void HexaDialog::clear() */ QModelIndexList HexaDialog::getAssocsVTK() { - QModelIndexList assocs; - QModelIndex iQuad, iVertex; - QListWidgetItem* item = NULL; - - const PatternDataModel* patternDataModel = getPatternDataModel(); - if (patternDataModel == NULL) return assocs; - if (quads_rb->isChecked()) - { - //ListWidget content - for ( int r = 0; r < quads_lw->count(); ++r ){ - item = quads_lw->item(r); - iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iQuad.isValid() ) - assocs << iQuad; - } - return assocs; - } - else if (vertices_rb->isChecked()) - { - //ListWidget content - for ( int r = 0; r < vertices_lw->count(); ++r ){ - item = vertices_lw->item(r); - iVertex = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iVertex.isValid() ) - assocs << iVertex; - } - return assocs; - } - else return assocs; + QModelIndexList assocs; + QModelIndex iQuad, iVertex; + QListWidgetItem* item = NULL; + + const PatternDataModel* patternDataModel = getPatternDataModel(); + if (patternDataModel == NULL) return assocs; + if (quads_rb->isChecked()) + { + //ListWidget content + int nbQuads = quads_lw->count(); + for ( int r = 0; r < nbQuads; ++r ){ + item = quads_lw->item(r); + iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iQuad.isValid() ) + assocs << iQuad; + } + return assocs; + } + else if (vertices_rb->isChecked()) + { + //ListWidget content + int nbVertices = vertices_lw->count(); + for ( int r = 0; r < nbVertices; ++r ){ + item = vertices_lw->item(r); + iVertex = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iVertex.isValid() ) + assocs << iVertex; + } + return assocs; + } + else return assocs; } // ============================================================== updateButtonBox void HexaDialog::updateButtonBox() { - if ( quads_rb->isChecked() ){ // build from quads count() must be between [2,6] - int nbQuads = quads_lw->count(); - //std::cout << "nbQuads => " << nbQuads << std::endl; - if ( nbQuads >= 2 && nbQuads <= 6 ){ - //_applyCloseButton->setEnabled(true); - _applyButton->setEnabled(true); - // _applyCloseButton->setFlat( false ); - // _applyButton->setFlat( false ); - } else { - //_applyCloseButton->setEnabled(false); - _applyButton->setEnabled(false); - // _applyCloseButton->setFlat( true ); - // _applyButton->setFlat( true ); - } - } else if ( vertices_rb->isChecked() ){ // build from vertices count() must be equals to 8 - int nbVertices = vertices_lw->count(); - //std::cout << "nbVertices => " << nbVertices << std::endl; - if ( nbVertices == 8 ){ - //_applyCloseButton->setEnabled(true); - _applyButton->setEnabled(true); - // _applyCloseButton->setFlat( false ); - // _applyButton->setFlat( false ); - } else { - //_applyCloseButton->setEnabled(false); - _applyButton->setEnabled(false); - // _applyCloseButton->setFlat( true ); - // _applyButton->setFlat( true ); - } - } + if ( _editMode == INFO_MODE ) + return; + + if ( quads_rb->isChecked() ){ // build from quads count() must be between [2,6] + int nbQuads = quads_lw->count(); + if ( nbQuads >= 2 && nbQuads <= 6 ){ + _applyButton->setEnabled(true); + } else { + _applyButton->setEnabled(false); + } + } else if ( vertices_rb->isChecked() ){ // build from vertices count() must be equals to 8 + int nbVertices = vertices_lw->count(); + if ( nbVertices == 8 ){ + _applyButton->setEnabled(true); + } else { + _applyButton->setEnabled(false); + } + } } // ============================================================== deleteQuadItem void HexaDialog::deleteQuadItem() { - delete quads_lw->currentItem(); - updateButtonBox(); + delete quads_lw->currentItem(); + updateButtonBox(); } // ============================================================== deleteVertexItem void HexaDialog::deleteVertexItem() { - delete vertices_lw->currentItem(); - updateButtonBox(); + delete vertices_lw->currentItem(); + updateButtonBox(); } // ============================================================== _setValueQuads void HexaDialog::_setValueQuads( HEXA_NS::Hexa* h ) { - QListWidgetItem *qItem = NULL; - HEXA_NS::Quad *q = NULL; - QModelIndex qIndex; - if (getPatternDataSelectionModel() == NULL) return; - quads_lw->clear(); - for( int i = 0; i <= 5; ++i ){ - q = h->getQuad(i); - qIndex = getPatternDataSelectionModel()->indexBy( HEXA_ENTRY_ROLE, QString::number(reinterpret_cast(q)) ); - qItem = new QListWidgetItem( q->getName() ); - qItem->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(qIndex) ); - qItem->setData(LW_DATA_ROLE, qIndex.data(HEXA_DATA_ROLE)); - quads_lw->addItem( qItem ); - } + QListWidgetItem *qItem = NULL; + HEXA_NS::Quad *q = NULL; + QModelIndex qIndex; + if (getPatternDataSelectionModel() == NULL) return; + quads_lw->clear(); + for( int i = 0; i <= 5; ++i ){ + q = h->getQuad(i); + qIndex = getPatternDataSelectionModel()->indexBy( HEXA_ENTRY_ROLE, QString::number(reinterpret_cast(q)) ); + qItem = new QListWidgetItem( q->getName() ); + qItem->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(qIndex) ); + qItem->setData(LW_DATA_ROLE, qIndex.data(HEXA_DATA_ROLE)); + quads_lw->addItem( qItem ); + } } // ============================================================== _setValueVertices void HexaDialog::_setValueVertices( HEXA_NS::Hexa* h ) { - QListWidgetItem *vItem = NULL; - HEXA_NS::Vertex* v = NULL; - QModelIndex vIndex; - if (getPatternDataSelectionModel() == NULL) return; - vertices_lw->clear(); - for( int i = 0; i <= 7; ++i ){ - v = h->getVertex(i); - vIndex = getPatternDataSelectionModel()->indexBy( HEXA_ENTRY_ROLE, QString::number(reinterpret_cast(v)) ); - vItem = new QListWidgetItem( v->getName() ); - vItem->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(vIndex) ); - vItem->setData(LW_DATA_ROLE, vIndex.data(HEXA_DATA_ROLE)); - vertices_lw->addItem( vItem ); - } + QListWidgetItem *vItem = NULL; + HEXA_NS::Vertex* v = NULL; + QModelIndex vIndex; + if (getPatternDataSelectionModel() == NULL) return; + vertices_lw->clear(); + for( int i = 0; i <= 7; ++i ){ + v = h->getVertex(i); + vIndex = getPatternDataSelectionModel()->indexBy( HEXA_ENTRY_ROLE, QString::number(reinterpret_cast(v)) ); + vItem = new QListWidgetItem( v->getName() ); + vItem->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(vIndex) ); + vItem->setData(LW_DATA_ROLE, vIndex.data(HEXA_DATA_ROLE)); + vertices_lw->addItem( vItem ); + } } // ============================================================== setValue void HexaDialog::setValue(HEXA_NS::Hexa* h) { - // 0) name - name_le->setText( h->getName() ); + // 0) name + name_le->setText( h->getName() ); - if ( getPatternDataSelectionModel()){ - QModelIndex hIndex = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(h) ); - _setValueVertices(h); - _setValueQuads(h); - name_le->setProperty( "QModelIndex", QVariant::fromValue(hIndex) ); - } - _value = h; + if ( getPatternDataSelectionModel()){ + QModelIndex hIndex = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(h) ); + _setValueVertices(h); + _setValueQuads(h); + name_le->setProperty( "QModelIndex", QVariant::fromValue(hIndex) ); + } + _value = h; } // ============================================================== getValue HEXA_NS::Hexa* HexaDialog::getValue() { - return _value; + return _value; } // ============================================================== apply bool HexaDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return false; + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return false; - QModelIndex iHexa; + QModelIndex iHexa; - QListWidget* currentLw = NULL; - QListWidgetItem* item = NULL; + QListWidget* currentLw = NULL; + QListWidgetItem* item = NULL; - if ( quads_rb->isChecked() ) - currentLw = dynamic_cast( quads_lw ); - else if ( vertices_rb->isChecked() ) - currentLw = dynamic_cast( vertices_lw ); + if ( quads_rb->isChecked() ) + currentLw = dynamic_cast( quads_lw ); + else if ( vertices_rb->isChecked() ) + currentLw = dynamic_cast( vertices_lw ); - QModelIndex iElt; - QModelIndexList iElts; - for ( int r = 0; r < currentLw->count(); ++r){ - item = currentLw->item(r); - iElt = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iElt.isValid() ) + QModelIndex iElt; + QModelIndexList iElts; + int nbItems = currentLw->count(); + for ( int r = 0; r < nbItems; ++r){ + item = currentLw->item(r); + iElt = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iElt.isValid() ) iElts << iElt; - } + } - if ( quads_rb->isChecked() and (iElts.count()>=2 and iElts.count()<=6) ){ // build from quads iElts.count() should be between [2,6] - iHexa = getDocumentModel()->addHexaQuads( iElts ); - } else if ( vertices_rb->isChecked() and iElts.count()== 8 ){ // build from vertices - iHexa = getDocumentModel()->addHexaVertices( iElts[0], iElts[1], iElts[2], iElts[3], - iElts[4], iElts[5], iElts[6], iElts[7] ); - } + nbItems = iElts.count(); + if ( quads_rb->isChecked() and (nbItems>=2 and nbItems<=6) ){ // build from quads iElts.count() should be between [2,6] + iHexa = getDocumentModel()->addHexaQuads( iElts ); + } else if ( vertices_rb->isChecked() and nbItems== 8 ){ // build from vertices + iHexa = getDocumentModel()->addHexaVertices( iElts[0], iElts[1], iElts[2], iElts[3], + iElts[4], iElts[5], iElts[6], iElts[7] ); + } - if ( !iHexa.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT BUILD HEXA" ) ); - return false; - } - _value = iHexa.model()->data(iHexa, HEXA_DATA_ROLE).value(); + if ( !iHexa.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT BUILD HEXA" ) + "\n" + getErrorMsg() ); + return false; + } + _value = iHexa.model()->data(iHexa, HEXA_DATA_ROLE).value(); - QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ - getDocumentModel()->setName( iHexa, newName ); + QString newName = name_le->text(); + if ( !newName.isEmpty() )/*{*/ + getDocumentModel()->setName( iHexa, newName ); - //update the default name in the dialog box - if (_value != NULL) - updateDefaultName(name_le, _value->getType()); + //update the default name in the dialog box + if (_value != NULL) + updateDefaultName(name_le, _value->getType()); - // to select/highlight result - result = patternDataModel->mapFromSource(iHexa); + // to select/highlight result + result = patternDataModel->mapFromSource(iHexa); - return true; + return true; } @@ -1917,22 +1761,19 @@ bool HexaDialog::apply(QModelIndex& result) // ============================================================== Constructeur VectorDialog::VectorDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f), - _value(0) +HexaBaseDialog(parent, editmode, f), +_value(0) { - _helpFileName = "gui_vector.html"; - setupUi( this ); - _initWidget(editmode); + _helpFileName = "gui_vector.html"; + setupUi( this ); + _initWidget(editmode); - // rb0->setFocusProxy( dx_spb_rb0 ); - // rb1->setFocusProxy( v0_le_rb1 ); - rb0->click(); - // setFocusProxy( rb0 ); + rb0->click(); - if ( editmode == INFO_MODE ){ - setWindowTitle( tr("Vector Information") ); - rb1->hide(); - } + if ( editmode == INFO_MODE ){ + setWindowTitle( tr("Vector Information") ); + rb1->hide(); + } } // ============================================================== Destructeur @@ -1943,1128 +1784,981 @@ VectorDialog::~VectorDialog() // ============================================================== _initInputWidget void VectorDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - -// setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - installEventFilter(this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - name_le->installEventFilter(this); + installEventFilter(this); + name_le->installEventFilter(this); - v0_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v0_le_rb1->setValidator( validator ); - v0_le_rb1->installEventFilter(this); + v0_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v0_le_rb1->setValidator( validator ); + v0_le_rb1->installEventFilter(this); - v1_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v1_le_rb1->setValidator( validator ); - v1_le_rb1->installEventFilter(this); + v1_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v1_le_rb1->setValidator( validator ); + v1_le_rb1->installEventFilter(this); - if ( editmode == INFO_MODE ){ - name_le->setReadOnly(true); - dx_spb_rb0->setReadOnly(true); - dy_spb_rb0->setReadOnly(true); - dz_spb_rb0->setReadOnly(true); - } - - v0_le_rb1->setReadOnly(true); - v1_le_rb1->setReadOnly(true); + if ( editmode == INFO_MODE ){ + name_le->setReadOnly(true); + dx_spb_rb0->setReadOnly(true); + dy_spb_rb0->setReadOnly(true); + dz_spb_rb0->setReadOnly(true); + } - //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName()) ); + v0_le_rb1->setReadOnly(true); + v1_le_rb1->setReadOnly(true); } // ============================================================== clear void VectorDialog::clear() { - name_le->clear(); -// dx_spb_rb0->clear(); -// dy_spb_rb0->clear(); -// dz_spb_rb0->clear(); - v0_le_rb1->clear(); - modelUnregister(v0_le_rb1); + name_le->clear(); + v0_le_rb1->clear(); + modelUnregister(v0_le_rb1); - v1_le_rb1->clear(); - modelUnregister(v1_le_rb1); + v1_le_rb1->clear(); + modelUnregister(v1_le_rb1); - modelUnregister(this); + modelUnregister(this); } // ============================================================== setValue void VectorDialog::setValue(HEXA_NS::Vector* v) { - name_le->setText( v->getName() ); - dx_spb_rb0->setValue( v->getDx() ); - dy_spb_rb0->setValue( v->getDy() ); - dz_spb_rb0->setValue( v->getDz() ); + name_le->setText( v->getName() ); + dx_spb_rb0->setValue( v->getDx() ); + dy_spb_rb0->setValue( v->getDy() ); + dz_spb_rb0->setValue( v->getDz() ); - if ( getPatternDataSelectionModel() ){ - QModelIndex ivec = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v) ); - name_le->setProperty( "QModelIndex", QVariant::fromValue(ivec) ); - } - _value = v; + if ( getPatternDataSelectionModel() ){ + QModelIndex ivec = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(v) ); + name_le->setProperty( "QModelIndex", QVariant::fromValue(ivec) ); + } + _value = v; } // ============================================================== getValue HEXA_NS::Vector* VectorDialog::getValue() { - return _value; + return _value; } // ============================================================== apply bool VectorDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; - QModelIndex iVector; + QModelIndex iVector; - if ( rb0->isChecked() ){ //scalar - double dx = dx_spb_rb0->value(); - double dy = dy_spb_rb0->value(); - double dz = dz_spb_rb0->value(); + if ( rb0->isChecked() ){ //scalar + double dx = dx_spb_rb0->value(); + double dy = dy_spb_rb0->value(); + double dz = dz_spb_rb0->value(); - iVector = getDocumentModel()->addVector( dx, dy, dz ); - } else if ( rb1->isChecked() ){ //vertices - QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb1] ); - QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb1] ); + iVector = getDocumentModel()->addVector( dx, dy, dz ); + } else if ( rb1->isChecked() ){ //vertices + QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb1] ); + QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb1] ); - if ( iv0.isValid() - && iv1.isValid() ){ - iVector = getDocumentModel()->addVectorVertices( iv0, iv1 ); - } - } + if ( iv0.isValid() + && iv1.isValid() ){ + iVector = getDocumentModel()->addVectorVertices( iv0, iv1 ); + } + } - if ( !iVector.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT BUILD VECTOR" ) ); - return false; - } + if ( !iVector.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT BUILD VECTOR" ) + "\n" + getErrorMsg()); + return false; + } - _value = iVector.model()->data(iVector, HEXA_DATA_ROLE).value(); + _value = iVector.model()->data(iVector, HEXA_DATA_ROLE).value(); - QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ - getDocumentModel()->setName( iVector, newName ); + QString newName = name_le->text(); + if ( !newName.isEmpty() )/*{*/ + getDocumentModel()->setName( iVector, newName ); - //update the default name in the dialog box - if (_value != NULL) - updateDefaultName(name_le, _value->getType()); + //update the default name in the dialog box + if (_value != NULL) + updateDefaultName(name_le, _value->getType()); - // to select/highlight result - result = patternBuilderModel->mapFromSource(iVector); + // to select/highlight result + result = patternBuilderModel->mapFromSource(iVector); - return true; + return true; } - +// ------------------------- MakeGridDialog ---------------------------------- // ============================================================== Constructeur -CylinderDialog::CylinderDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) -: HexaBaseDialog(parent, editmode, f), - _value(0) + +MakeGridDialog::MakeGridDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) +: HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_cyl.html"; - setupUi( this ); - _initWidget(editmode); + setupUi( this ); + _initWidget(editmode); + rb0->click(); - if ( editmode == INFO_MODE ){ - setWindowTitle( tr("Cylinder Information") ); - } -} + _helpFileName = "creategrids.html#guicartgrid"; + connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb0, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb0, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + + connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + + connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); +} // ============================================================== Destructeur -CylinderDialog::~CylinderDialog() +MakeGridDialog::~MakeGridDialog() { } // ============================================================== _initInputWidget -void CylinderDialog::_initInputWidget( Mode editmode ) +void MakeGridDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + center_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + base_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); -// setProperty( "HexaWidgetType", QVariant::fromValue(CYLINDER_TREE) ); - installEventFilter(this); + center_le->setReadOnly(true); + axis_le->setReadOnly(true); + base_le->setReadOnly(true); + vec_le->setReadOnly(true); -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(CYLINDER_TREE) ); - name_le->installEventFilter(this); + installEventFilter(this); + center_le->installEventFilter(this); + axis_le->installEventFilter(this); + base_le->installEventFilter(this); + vec_le->installEventFilter(this); - vex_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + radius_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw)); + radius_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - vex_le->setValidator( validator ); - vec_le->setValidator( validator ); + angle_lw->setItemDelegate(new HexaAngleDoubleSpinBoxDelegate(angle_lw)); + angle_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - vex_le->installEventFilter(this); - vec_le->installEventFilter(this); + height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); + height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - vex_le->setReadOnly(true); - vec_le->setReadOnly(true); + connect( add_radius_pb, SIGNAL(clicked()), this, SLOT(addRadiusItem()) ); + connect( del_radius_pb, SIGNAL(clicked()), this, SLOT(delRadiusItem()) ); - if (editmode == INFO_MODE) - { - name_le->setReadOnly(true); - r_spb->setReadOnly(true); - h_spb->setReadOnly(true); - } + connect( add_angle_pb, SIGNAL(clicked()), this, SLOT(addAngleItem()) ); + connect( del_angle_pb, SIGNAL(clicked()), this, SLOT(delAngleItem()) ); - //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName())); + connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); + connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); } // ============================================================== clear -void CylinderDialog::clear() +void MakeGridDialog::clear() { - name_le->clear(); + center_le->clear(); + modelUnregister(center_le); - vex_le->clear(); - modelUnregister(vex_le); + axis_le->clear(); + modelUnregister(axis_le); - vec_le->clear(); - modelUnregister(vec_le); + base_le->clear(); + modelUnregister(base_le); - r_spb->clear(); - h_spb->clear(); + vec_le->clear(); + modelUnregister(vec_le); - modelUnregister(this); + modelUnregister(this); +} +// ============================================================== updateHelpFileName +void MakeGridDialog::updateHelpFileName() +{ + if ( sender() == rb0 ){ + _helpFileName = "creategrids.html#guicartgrid"; + } else if ( sender() == rb1 ){ + _helpFileName = "creategrids.html#guicylgrid"; + } else if ( sender() == rb2 ){ + _helpFileName = "creategrids.html#guisphergrid"; + } } -// ============================================================== setValue -void CylinderDialog::setValue(HEXA_NS::Cylinder* c) +// ============================================================== addRadiusItem +void MakeGridDialog::addRadiusItem() { - HEXA_NS::Vertex* base = c->getBase(); - HEXA_NS::Vector* direction = c->getDirection(); - double r = c->getRadius(); - double h = c->getHeight(); + QListWidgetItem* previousItem = radius_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - name_le->setText( c->getName() ); - vex_le->setText( base->getName() ); - vec_le->setText( direction->getName() ); - r_spb->setValue(r); - h_spb->setValue(h); + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - if ( getPatternDataSelectionModel() ){ - QModelIndex iCyl = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(c) ); - QModelIndex iBase = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(base) ); - QModelIndex iDirection = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(direction) ); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + radius_lw->addItem(newItem); +} - name_le->setProperty( "QModelIndex", QVariant::fromValue(iCyl) ); - vex_le->setProperty( "QModelIndex", QVariant::fromValue(iBase) ); - vec_le->setProperty( "QModelIndex", QVariant::fromValue(iDirection) ); - } - _value = c; +// ============================================================== delRadiusItem +void MakeGridDialog::delRadiusItem() +{ + delete radius_lw->currentItem(); } -// ============================================================== getValue -HEXA_NS::Cylinder* CylinderDialog::getValue() +// ============================================================== addAngleItem +void MakeGridDialog::addAngleItem() +{ + QListWidgetItem* previousItem = angle_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); + + double defaultValue = 180.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); + + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + angle_lw->addItem(newItem); +} + +// ============================================================== delAngleItem +void MakeGridDialog::delAngleItem() { - return _value; + delete angle_lw->currentItem(); } +// ============================================================== addHeightItem +void MakeGridDialog::addHeightItem() +{ + QListWidgetItem* previousItem = height_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); + + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + height_lw->addItem(newItem); +} + +// ============================================================== delHeightItem +void MakeGridDialog::delHeightItem() +{ + delete height_lw->currentItem(); +} // ============================================================== apply -bool CylinderDialog::apply(QModelIndex& result) +bool MakeGridDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - QModelIndex iCyl; - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); - double r = r_spb->value(); - double h = h_spb->value(); + QModelIndex iNewElts; + if ( rb0->isChecked() ) + { + long nx = nx_spb->value(); + long ny = ny_spb->value(); + long nz = nz_spb->value(); + iNewElts = docModel->makeCartesianTop(nx, ny, nz); + } + else if ( rb1->isChecked() ) + { + QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] ); + QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] ); + QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); - if ( ivex.isValid() - && ivec.isValid() ){ - iCyl = getDocumentModel()->addCylinder( ivex, ivec, r, h ); - } + if ( icenter.isValid() && iaxis.isValid() && ibase.isValid() && ivec.isValid() ) + { + double nx = nx_spb->value(); + double ny = ny_spb->value(); + double nz = nz_spb->value(); + double lx = lx_spb->value(); + double ly = ly_spb->value(); + double lz = lz_spb->value(); + + iNewElts = docModel->makeCartesianUni( icenter, ibase, ivec, iaxis, + nx, ny, nz, lx, ly, lz); + } - if ( !iCyl.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD CYLINDER" ) ); - return false; - } + } else if ( rb2->isChecked() ) + { + QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] ); + QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] ); + QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); - _value = iCyl.model()->data(iCyl, HEXA_DATA_ROLE).value(); + if ( icenter.isValid() && iaxis.isValid() && ibase.isValid() && ivec.isValid() ) + { + QListWidgetItem* item = NULL; + + vector radius; + vector angles; + vector heights; + + double somme = 0.; + int nbAngles = angle_lw->count(); + for ( int r = 0; r < nbAngles; ++r){ + item = angle_lw->item(r); + double itemValue = item->data(Qt::EditRole).toDouble(); + angles.push_back(itemValue); + somme += itemValue; + } + if (somme > 360.01) + { + SUIT_MessageBox::information( 0, + tr("HEXA_INFO"), + tr("The sum of the picked angles has to be \nless or equal than %1 degrees.").arg(360)); + return false; + } - QString newName = name_le->text(); - if (!newName.isEmpty()) /*{*/ - getDocumentModel()->setName( iCyl, newName ); + int nbRadius = radius_lw->count(); + for ( int r = 0; r < nbRadius; ++r){ + item = radius_lw->item(r); + radius.push_back(item->data(Qt::EditRole).toDouble()); + } - //update the default name in the dialog box - if (_value != NULL) - updateDefaultName(name_le, _value->getType()); + int nbHeight = height_lw->count(); + for ( int r = 0; r < nbHeight; ++r){ + item = height_lw->item(r); + heights.push_back(item->data(Qt::EditRole).toDouble()); + } - // to select/highlight result - result = patternBuilderModel->mapFromSource(iCyl); + iNewElts = docModel->makeCartesian( icenter, ibase, ivec, iaxis, + radius, angles, heights); + } - return true; -} + } + if ( !iNewElts.isValid() ) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE GRID" ) + "\n" + getErrorMsg() ); + return false; + } -//------------------------------- PipeDialog ----------------------------------- + result = patternBuilderModel->mapFromSource( iNewElts ); + + return true; +} // ============================================================== Constructeur -PipeDialog::PipeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) -: HexaBaseDialog(parent, editmode, f), - _value(0) +MakeCylinderDialog::MakeCylinderDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) +: HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_pipe.html"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( vex_le ); - - if ( editmode == INFO_MODE ){ - setWindowTitle( tr("Pipe Information") ); - } + _helpFileName = "gui_blocks_for_cyl_pipe.html#make-cylinder"; + setupUi( this ); + _initWidget(editmode); + rb0->click(); } // ============================================================== Destructeur -PipeDialog::~PipeDialog() +MakeCylinderDialog::~MakeCylinderDialog() { } -// ============================================================== _initInputWidget -void PipeDialog::_initInputWidget( Mode editmode ) +void MakeCylinderDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + origin_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE)); + axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + base_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE)); + installEventFilter(this); + origin_le->installEventFilter(this); + axis_le->installEventFilter(this); + base_le->installEventFilter(this); -// setProperty( "HexaWidgetType", QVariant::fromValue(PIPE_TREE) ); - installEventFilter(this); + origin_le->setReadOnly(true); + axis_le->setReadOnly(true); + base_le->setReadOnly(true); -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(PIPE_TREE) ); - name_le->installEventFilter(this); + radius_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw)); + radius_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - //Vertex Field config - vex_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vex_le->installEventFilter(this); - vex_le->setValidator( validator ); + angle_lw->setItemDelegate(new HexaAngleDoubleSpinBoxDelegate(angle_lw)); + angle_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - //Vector Field config - vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - vec_le->installEventFilter(this); - vec_le->setValidator( validator ); + height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); + height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); + connect( add_radius_pb, SIGNAL(clicked()), this, SLOT(addRadiusItem()) ); + connect( del_radius_pb, SIGNAL(clicked()), this, SLOT(delRadiusItem()) ); - if ( editmode == INFO_MODE ){ - name_le->setReadOnly(true); - ir_spb->setReadOnly(true); - er_spb->setReadOnly(true); - h_spb->setReadOnly(true); - } + connect( add_angle_pb, SIGNAL(clicked()), this, SLOT(addAngleItem()) ); + connect( del_angle_pb, SIGNAL(clicked()), this, SLOT(delAngleItem()) ); - vex_le->setReadOnly(true); - vec_le->setReadOnly(true); - - //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName())); + connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); + connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); } - -// ============================================================== clear -void PipeDialog::clear() +// ============================================================== addRadiusItem +void MakeCylinderDialog::addRadiusItem() { - name_le->clear(); + QListWidgetItem* previousItem = radius_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - vex_le->clear(); - modelUnregister(vex_le); + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - vec_le->clear(); - modelUnregister(vec_le); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + radius_lw->addItem(newItem); +} - modelUnregister(this); +// ============================================================== delRadiusItem +void MakeCylinderDialog::delRadiusItem() +{ + delete radius_lw->currentItem(); } -// ============================================================== setValue -void PipeDialog::setValue(HEXA_NS::Pipe* p) +// ============================================================== addAngleItem +void MakeCylinderDialog::addAngleItem() { - HEXA_NS::Vertex* base = p->getBase(); - HEXA_NS::Vector* direction = p->getDirection(); - double ir = p->getInternalRadius(); - double er = p->getRadius(); - double h = p->getHeight(); + QListWidgetItem* previousItem = angle_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - name_le->setText( p->getName() ); - vex_le->setText( base->getName() ); - vec_le->setText( direction->getName() ); - ir_spb->setValue(ir); - er_spb->setValue(er); - h_spb->setValue(h); + double defaultValue = 180.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - if ( getPatternDataSelectionModel() ){ - QModelIndex iPipe = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(p) ); - QModelIndex iBase = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(base) ); - QModelIndex iDirection = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(direction) ); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + angle_lw->addItem(newItem); +} - name_le->setProperty( "QModelIndex", QVariant::fromValue(iPipe) ); - vex_le->setProperty( "QModelIndex", QVariant::fromValue(iBase) ); - vec_le->setProperty( "QModelIndex", QVariant::fromValue(iDirection) ); - } - _value = p; +// ============================================================== delAngleItem +void MakeCylinderDialog::delAngleItem() +{ + delete angle_lw->currentItem(); } -// ============================================================== getValue -HEXA_NS::Pipe* PipeDialog::getValue() +// ============================================================== addHeightItem +void MakeCylinderDialog::addHeightItem() { - return _value; + QListWidgetItem* previousItem = height_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); + + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); + + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + height_lw->addItem(newItem); } +// ============================================================== delHeightItem +void MakeCylinderDialog::delHeightItem() +{ + delete height_lw->currentItem(); +} -// ============================================================== apply -bool PipeDialog::apply(QModelIndex& result) +// ============================================================== clear +void MakeCylinderDialog::clear() { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + origin_le->clear(); + modelUnregister(origin_le); - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + axis_le->clear(); + modelUnregister(axis_le); - QModelIndex iPipe; - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); - double ir = ir_spb->value(); - double er = er_spb->value(); - double h = h_spb->value(); + base_le->clear(); + modelUnregister(base_le); - if (ir >= er) { - SUIT_MessageBox::information( this, tr( "CANNOT ADD PIPE" ), tr( "External radius must be greather than Internal radius!" ) ); - return false; - } + modelUnregister(this); +} +// ============================================================== apply +bool MakeCylinderDialog::apply(QModelIndex& result) +{ + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - if ( ivex.isValid() - && ivec.isValid() ){ - iPipe = getDocumentModel()->addPipe( ivex, ivec, ir, er, h ); - } + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + + QModelIndex iorigin = patternDataModel->mapToSource( _index[origin_le] ); + QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] ); + QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] ); + double rext = ext_radius_spb->value(); + double rint = int_radius_spb->value(); + double angle = angle_spb->value(); + double height = height_spb->value(); + double nr = nr_spb->value(); + double na = na_spb->value(); + double nh = nh_spb->value(); + + QModelIndex iElts; + if (rb0->isChecked()) + iElts = docModel->makeCylinderTop(nr, na, nh); + else if (rb1->isChecked()) + { + if ( iorigin.isValid() && iaxis.isValid() && ibase.isValid()) + iElts = docModel->makeCylinderUni(iorigin, ibase, iaxis, rint, + rext, angle, height, nr, na, nh); + } + else if (rb2->isChecked()) + { + QListWidgetItem* item = NULL; + + vector radius; + vector angles; + vector heights; + + double somme = 0.; + int nbAngles = angle_lw->count(); + for ( int r = 0; r < nbAngles; ++r){ + item = angle_lw->item(r); + double itemValue = item->data(Qt::EditRole).toDouble(); + angles.push_back(itemValue); + somme += itemValue; + } + if (somme > 360.01) + { + SUIT_MessageBox::information( 0, + tr("HEXA_INFO"), + tr("The sum of the picked angles has to be \nless or equal than %1 degrees.").arg(360)); + return false; + } - if ( !iPipe.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD PIPE" ) ); - return false; - } - _value = iPipe.model()->data(iPipe, HEXA_DATA_ROLE).value(); + int nbRadius = radius_lw->count(); + for ( int r = 0; r < nbRadius; ++r){ + item = radius_lw->item(r); + radius.push_back(item->data(Qt::EditRole).toDouble()); + } - QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ - getDocumentModel()->setName( iPipe, newName ); + int nbHeight = height_lw->count(); + for ( int r = 0; r < nbHeight; ++r){ + item = height_lw->item(r); + heights.push_back(item->data(Qt::EditRole).toDouble()); + } - //update the default name in the dialog box - if (_value != NULL) - updateDefaultName(name_le, _value->getType()); + if ( iorigin.isValid() && iaxis.isValid() && ibase.isValid()) + iElts = docModel->makeCylinder( iorigin, ibase, iaxis, radius, angles, heights); + } - // to select/highlight result - result = patternBuilderModel->mapFromSource(iPipe); - return true; -} + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE CYLINDER" ) + "\n" + getErrorMsg() ); + return false; + } + result = patternBuilderModel->mapFromSource(iElts); -// ------------------------- MakeGridDialog ---------------------------------- -// ( Cartesian, Cylindrical, Spherical ) + return true; +} +//---------------------------------- MakePipeDialog ----------------------------- // ============================================================== Constructeur -MakeGridDialog::MakeGridDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) +MakePipeDialog::MakePipeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - setupUi( this ); - _initWidget(editmode); - rb0->click();// Default : cartesian grid - uniform_rb->click(); - // rb0->setFocusProxy( vex_le_rb0 ); - // rb1->setFocusProxy( center_le_rb1 ); - // rb2->setFocusProxy( vex_le_rb2 ); - // setFocusProxy( rb0 ); - - _helpFileName = "creategrids.html#guicartgrid"; - connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb0, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb0, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); - - connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); - - connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + _helpFileName = "gui_blocks_for_cyl_pipe.html#make-pipe"; + setupUi( this ); + _initWidget(editmode); + rb0->click(); } - // ============================================================== Destructeur -MakeGridDialog::~MakeGridDialog() +MakePipeDialog::~MakePipeDialog() { } // ============================================================== _initInputWidget -void MakeGridDialog::_initInputWidget( Mode editmode ) -{ - - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); - - vex_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - vex_le_rb0->setValidator( validator ); - vec_le_rb0->setValidator( validator ); - vex_le_rb0->installEventFilter(this); - vec_le_rb0->installEventFilter(this); - - center_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - base_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - height_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - center_le_rb1->setValidator( validator ); - base_le_rb1->setValidator( validator ); - height_le_rb1->setValidator( validator ); - center_le_rb1->installEventFilter(this); - base_le_rb1->installEventFilter(this); - height_le_rb1->installEventFilter(this); - - vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vex_le_rb2->setValidator( validator ); - vex_le_rb2->installEventFilter(this); - - if ( editmode != INFO_MODE ){ - //Cylindrical - radius_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw)); - radius_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - - angle_lw->setItemDelegate(new HexaAngleDoubleSpinBoxDelegate(angle_lw)); - angle_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - - height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); - height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - - connect( add_radius_pb, SIGNAL(clicked()), this, SLOT(addRadiusItem()) ); - connect( del_radius_pb, SIGNAL(clicked()), this, SLOT(delRadiusItem()) ); - connect( add_angle_pb, SIGNAL(clicked()), this, SLOT(addAngleItem()) ); - connect( del_angle_pb, SIGNAL(clicked()), this, SLOT(delAngleItem()) ); - connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); - connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); - } - - vex_le_rb0->setReadOnly(true); - vec_le_rb0->setReadOnly(true); - vex_le_rb2->setReadOnly(true); - center_le_rb1->setReadOnly(true); - base_le_rb1->setReadOnly(true); - height_le_rb1->setReadOnly(true); - -} - - -// ============================================================== clear -void MakeGridDialog::clear() +void MakePipeDialog::_initInputWidget( Mode editmode ) { - vex_le_rb0->clear(); - modelUnregister(vex_le_rb0); - - vec_le_rb0->clear(); - modelUnregister(vec_le_rb0); + origin_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + base_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - base_le_rb1->clear(); - modelUnregister(base_le_rb1); + installEventFilter(this); + origin_le->installEventFilter(this); + axis_le->installEventFilter(this); + base_le->installEventFilter(this); - center_le_rb1->clear(); - modelUnregister(center_le_rb1); + origin_le->setReadOnly(true); + axis_le->setReadOnly(true); + base_le->setReadOnly(true); - height_le_rb1->clear(); - modelUnregister(height_le_rb1); + radius_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw)); + radius_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - vex_le_rb2->clear(); - modelUnregister(vex_le_rb2); + angle_lw->setItemDelegate(new HexaAngleDoubleSpinBoxDelegate(angle_lw)); + angle_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - modelUnregister(this); -} + height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); + height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); -// ============================================================== updateHelpFileName -void MakeGridDialog::updateHelpFileName() -{ - if ( sender() == rb0 ){ - _helpFileName = "creategrids.html#guicartgrid"; - } else if ( sender() == rb1 ){ - _helpFileName = "creategrids.html#guicylgrid"; - } else if ( sender() == rb2 ){ - _helpFileName = "creategrids.html#guisphergrid"; - } -} + connect( add_radius_pb, SIGNAL(clicked()), this, SLOT(addRadiusItem()) ); + connect( del_radius_pb, SIGNAL(clicked()), this, SLOT(delRadiusItem()) ); + connect( add_angle_pb, SIGNAL(clicked()), this, SLOT(addAngleItem()) ); + connect( del_angle_pb, SIGNAL(clicked()), this, SLOT(delAngleItem()) ); -// ============================================================== updateButtonBox -void MakeGridDialog::updateButtonBox() //CS_TODO? -{ - // int nbQuads = quads_lw->count(); - // int nbAngles = angles_lw->count(); - // - // if ( nbQuads>0 && nbAngles> 0 ){ - // _applyCloseButton->setEnabled(true); - // _applyButton->setEnabled(true); - // } else { - // _applyCloseButton->setEnabled(false); - // _applyButton->setEnabled(false); - // } - - // if ( rb0->isChecked() ){ //cartesian - // } else if ( rb1->isChecked() ){ //cylindrical - // nb_radius = radius_lw->item(r); - // nb_angle = angle_lw->item(r); - // nb_height = height_lw->item(r); - // } else if ( rb2->isChecked() ){ //spherical - // } + connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); + connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); } // ============================================================== addRadiusItem -void MakeGridDialog::addRadiusItem() +void MakePipeDialog::addRadiusItem() { - QListWidgetItem* previousItem = radius_lw->currentItem(); - QListWidgetItem* newItem = new QListWidgetItem(); - - double defaultValue = 1.; - if ( previousItem ) - defaultValue = previousItem->data(Qt::EditRole).toDouble(); + QListWidgetItem* previousItem = radius_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - newItem->setData( Qt::EditRole, QVariant(defaultValue) ); - newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); - radius_lw->addItem(newItem); + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - updateButtonBox(); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + radius_lw->addItem(newItem); } // ============================================================== delRadiusItem -void MakeGridDialog::delRadiusItem() +void MakePipeDialog::delRadiusItem() { - delete radius_lw->currentItem(); - updateButtonBox(); + delete radius_lw->currentItem(); } // ============================================================== addAngleItem -void MakeGridDialog::addAngleItem() +void MakePipeDialog::addAngleItem() { - QListWidgetItem* previousItem = angle_lw->currentItem(); - QListWidgetItem* newItem = new QListWidgetItem(); + QListWidgetItem* previousItem = angle_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - double defaultValue = 180.; - if ( previousItem ) - defaultValue = previousItem->data(Qt::EditRole).toDouble(); + double defaultValue = 180.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - newItem->setData( Qt::EditRole, QVariant(defaultValue) ); - newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); - angle_lw->addItem(newItem); - - updateButtonBox(); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + angle_lw->addItem(newItem); } // ============================================================== delAngleItem -void MakeGridDialog::delAngleItem() +void MakePipeDialog::delAngleItem() { - //std::cout << "delAngleItem()" << std::endl; - delete angle_lw->currentItem(); - updateButtonBox(); + delete angle_lw->currentItem(); } // ============================================================== addHeightItem -void MakeGridDialog::addHeightItem() +void MakePipeDialog::addHeightItem() { - QListWidgetItem* previousItem = height_lw->currentItem(); - QListWidgetItem* newItem = new QListWidgetItem(); - - double defaultValue = 1.; - if ( previousItem ) - defaultValue = previousItem->data(Qt::EditRole).toDouble(); + QListWidgetItem* previousItem = height_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - newItem->setData( Qt::EditRole, QVariant(defaultValue) ); - newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); - height_lw->addItem(newItem); + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - updateButtonBox(); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + height_lw->addItem(newItem); } // ============================================================== delHeightItem -void MakeGridDialog::delHeightItem() +void MakePipeDialog::delHeightItem() { - //std::cout << "delHeightItem()" << std::endl; - delete height_lw->currentItem(); - updateButtonBox(); + delete height_lw->currentItem(); } -// ============================================================== apply -bool MakeGridDialog::apply(QModelIndex& result) +// ============================================================== clear +void MakePipeDialog::clear() { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; - - QModelIndex iNewElts; - if ( rb0->isChecked() ){ //cartesian - QModelIndex ivex_rb0 = patternDataModel->mapToSource( _index[vex_le_rb0] ); - QModelIndex ivec_rb0 = patternBuilderModel->mapToSource( _index[vec_le_rb0] ); - long nx = nx_spb_rb0->value(); - long ny = ny_spb_rb0->value(); - long nz = nz_spb_rb0->value(); - - if ( ivex_rb0.isValid() - && ivec_rb0.isValid() ){ - iNewElts = getDocumentModel()->makeCartesian( ivex_rb0, ivec_rb0, nx, ny, nz ); - } - - } else if ( rb1->isChecked() ){ //cylindrical - QModelIndex icenter_rb1 = patternDataModel->mapToSource( _index[center_le_rb1] ); - QModelIndex ibase_rb1 = patternBuilderModel->mapToSource( _index[base_le_rb1] ); - QModelIndex iheight_rb1 = patternBuilderModel->mapToSource( _index[height_le_rb1] ); - - if ( icenter_rb1.isValid() - && ibase_rb1.isValid() - && iheight_rb1.isValid() ){ - - bool fill = fill_cb_rb1->isChecked(); - if ( uniform_rb->isChecked() ){ - double dr = dr_spb_rb1->value(); - double da = da_spb_rb1->value(); - double dl = dl_spb_rb1->value(); - double nr = nr_spb_rb1->value(); - double na = na_spb_rb1->value(); - double nl = nl_spb_rb1->value(); - - iNewElts = getDocumentModel()->makeCylindrical( icenter_rb1, - ibase_rb1, iheight_rb1, - dr, da, dl, nr, na, nl, fill ); - } - if ( random_rb->isChecked() ){ - QListWidgetItem* item = NULL; - // QDoubleSpinBox* spb = NULL; - - QList radius; - QList angles; - QList heights; - - double somme = 0.; - for ( int r = 0; r < angle_lw->count(); ++r){ - item = angle_lw->item(r); - angles << item->data(Qt::EditRole).toDouble(); - somme += item->data(Qt::EditRole).toDouble(); - } - if (somme > 360.01) - { - SUIT_MessageBox::information( 0, - tr("HEXA_INFO"), - tr("The sum of the picked angles has to be \nless or equal than %1 degrees.").arg(360)); - return false; - } - - for ( int r = 0; r < radius_lw->count(); ++r){ - item = radius_lw->item(r); - //std::cout << "radius : " << item->data(Qt::EditRole).toDouble()<< std::endl; - radius << item->data(Qt::EditRole).toDouble(); - } - - for ( int r = 0; r < height_lw->count(); ++r){ - item = height_lw->item(r); - heights << item->data(Qt::EditRole).toDouble(); - } - - iNewElts = getDocumentModel()->makeCylindricals( - icenter_rb1, ibase_rb1, iheight_rb1, - radius, angles, heights, - fill ); //NEW HEXA3 - } - } - - } else if ( rb2->isChecked() ){ //spherical - QModelIndex ivex_rb2 = patternDataModel->mapToSource( _index[vex_le_rb2] ); - // QModelIndex ivecx_rb2 = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); - double radius = radius_spb_rb2->value(); - int nb = nb_spb_rb2->value(); - int k = k_spb_rb2->value(); - - if ( ivex_rb2.isValid() ){ - iNewElts = getDocumentModel()->makeSpherical( ivex_rb2, radius, nb, k ); - } - } - - if ( !iNewElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE GRID" ) ); - return false; - } - - // to select/highlight result - result = patternBuilderModel->mapFromSource( iNewElts ); - - return true; + origin_le->clear(); + modelUnregister(origin_le); + + axis_le->clear(); + modelUnregister(axis_le); + + base_le->clear(); + modelUnregister(base_le); + + modelUnregister(this); } +// ============================================================== apply +bool MakePipeDialog::apply(QModelIndex& result) +{ + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + + QModelIndex iorigin = patternDataModel->mapToSource( _index[origin_le] ); + QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] ); + QModelIndex ibase = patternBuilderModel->mapToSource( _index[base_le] ); + double rext = ext_radius_spb->value(); + double rint = int_radius_spb->value(); + double angle = angle_spb->value(); + double height = height_spb->value(); + int nr = nr_spb->value(); + int na = na_spb->value(); + int nh = nh_spb->value(); + + QModelIndex iElts; + + if (rb0->isChecked()) + iElts = docModel->makePipeTop(nr, na, nh); + else if (rb1->isChecked()) + { + if ( iorigin.isValid() && iaxis.isValid() && ibase.isValid()) + iElts = docModel->makePipeUni(iorigin, ibase, iaxis, rint, rext, angle, height, + nr, na, nh); + } + else if (rb2->isChecked()) + { + QListWidgetItem* item = NULL; + + vector radius; + vector angles; + vector heights; + + double somme = 0.; + int nbAngles = angle_lw->count(); + for ( int r = 0; r < nbAngles; ++r){ + item = angle_lw->item(r); + double itemValue = item->data(Qt::EditRole).toDouble(); + angles.push_back(itemValue); + somme += itemValue; + } + if (somme > 360.01) + { + SUIT_MessageBox::information( 0, + tr("HEXA_INFO"), + tr("The sum of the picked angles has to be \nless or equal than %1 degrees.").arg(360)); + return false; + } + + int nbRadius = radius_lw->count(); + for ( int r = 0; r < nbRadius; ++r){ + item = radius_lw->item(r); + radius.push_back(item->data(Qt::EditRole).toDouble()); + } + + int nbHeight = height_lw->count(); + for ( int r = 0; r < nbHeight; ++r){ + item = height_lw->item(r); + heights.push_back(item->data(Qt::EditRole).toDouble()); + } + if ( iorigin.isValid() && iaxis.isValid() && ibase.isValid()) + iElts = docModel->makePipe( iorigin, ibase, iaxis, radius, angles, heights ); + } + + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE PIPE" ) + "\n" + getErrorMsg() ); + return false; + } + + // to select/highlight result + result = patternBuilderModel->mapFromSource(iElts); + return true; +} +//---------------------------------- MakeCylindersDialog ----------------------------- // ============================================================== Constructeur -MakeCylinderDialog::MakeCylinderDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) +MakeCylindersDialog::MakeCylindersDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_blocks_for_cyl_pipe.html#make-cylinder"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( cyl_le ); + _helpFileName = "gui_blocks_for_cyl_pipe.html#make-cylinders"; + setupUi( this ); + _initWidget(editmode); } // ============================================================== Destructeur -MakeCylinderDialog::~MakeCylinderDialog() +MakeCylindersDialog::~MakeCylindersDialog() { } -void MakeCylinderDialog::_initInputWidget( Mode editmode ) +void MakeCylindersDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + center_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + center2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + direction_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + direction2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + installEventFilter(this); + center_le->installEventFilter(this); + center2_le->installEventFilter(this); + direction_le->installEventFilter(this); + direction2_le->installEventFilter(this); - cyl_le->setProperty( "HexaWidgetType", QVariant::fromValue(CYLINDER_TREE) ); - vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - cyl_le->setValidator( validator ); - vec_le->setValidator( validator ); - cyl_le->installEventFilter(this); - vec_le->installEventFilter(this); - - cyl_le->setReadOnly(true); - vec_le->setReadOnly(true); + center_le->setReadOnly(true); + center2_le->setReadOnly(true); + direction_le->setReadOnly(true); + direction2_le->setReadOnly(true); } // ============================================================== clear -void MakeCylinderDialog::clear() +void MakeCylindersDialog::clear() { - cyl_le->clear(); - modelUnregister(cyl_le); + center_le->clear(); + modelUnregister(center_le); - vec_le->clear(); - modelUnregister(vec_le); + center2_le->clear(); + modelUnregister(center2_le); - modelUnregister(this); -} + direction_le->clear(); + modelUnregister(direction_le); + direction2_le->clear(); + modelUnregister(direction2_le); + + modelUnregister(this); +} // ============================================================== apply -bool MakeCylinderDialog::apply(QModelIndex& result) +bool MakeCylindersDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternBuilderModel ) return false; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - QModelIndex iElts; - QModelIndex icyl = patternBuilderModel->mapToSource( _index[cyl_le] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); - double nr = nr_spb->value(); - double na = na_spb->value(); - double nl = nl_spb->value(); - - if ( icyl.isValid() - && ivec.isValid() ){ - iElts = getDocumentModel()->makeCylinder( icyl, ivec, nr, na, nl ); - } + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + + QModelIndex iElts; + QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] ); + QModelIndex icenter2 = patternDataModel->mapToSource( _index[center2_le] ); + QModelIndex idir = patternBuilderModel->mapToSource( _index[direction_le] ); + QModelIndex idir2 = patternBuilderModel->mapToSource( _index[direction2_le] ); + + if ( icenter.isValid() && icenter2.isValid() && idir.isValid() && idir2.isValid()){ + double r1 = radius_spb->value(); + double h1 = height_spb->value(); + double r2 = radius2_spb->value(); + double h2 = height2_spb->value(); + iElts = docModel->makeCylinders( icenter, idir, r1, h1, icenter2, idir2, r2, h2 ); + } - if ( !iElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE CYLINDER" ) ); - return false; - } + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE CYLINDERS" ) + "\n" + getErrorMsg() ); + return false; + } - // to select/highlight result - result = patternBuilderModel->mapFromSource(iElts); + result = patternBuilderModel->mapFromSource(iElts); - return true; + return true; } - -//---------------------------------- MakePipeDialog ----------------------------- - +//---------------------------------- MakePipesDialog ----------------------------- // ============================================================== Constructeur -MakePipeDialog::MakePipeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) +MakePipesDialog::MakePipesDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_blocks_for_cyl_pipe.html#make-pipe"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( pipe_le ); + _helpFileName = "gui_blocks_for_cyl_pipe.html#make-pipes"; + setupUi( this ); + _initWidget(editmode); } // ============================================================== Destructeur -MakePipeDialog::~MakePipeDialog() +MakePipesDialog::~MakePipesDialog() { } // ============================================================== _initInputWidget -void MakePipeDialog::_initInputWidget( Mode editmode ) +void MakePipesDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + origin_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + origin2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + dir_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + dir2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + installEventFilter(this); + origin_le->installEventFilter(this); + origin2_le->installEventFilter(this); + dir_le->installEventFilter(this); + dir2_le->installEventFilter(this); - pipe_le->setProperty( "HexaWidgetType", QVariant::fromValue(PIPE_TREE) ); - vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - - pipe_le->setValidator( validator ); - vec_le->setValidator( validator ); + origin_le->setReadOnly(true); + origin2_le->setReadOnly(true); + dir_le->setReadOnly(true); + dir2_le->setReadOnly(true); +} - pipe_le->installEventFilter(this); - vec_le->installEventFilter(this); +// ============================================================== clear +void MakePipesDialog::clear() +{ + origin_le->clear(); + modelUnregister(origin_le); - pipe_le->setReadOnly(true); - vec_le->setReadOnly(true); + origin2_le->clear(); + modelUnregister(origin2_le); + dir_le->clear(); + modelUnregister(dir_le); + dir2_le->clear(); + modelUnregister(dir2_le); + modelUnregister(this); } -// ============================================================== clear -void MakePipeDialog::clear() -{ - pipe_le->clear(); - modelUnregister(pipe_le); - - vec_le->clear(); - modelUnregister(vec_le); - - modelUnregister(this); -} - - -// ============================================================== apply -bool MakePipeDialog::apply(QModelIndex& result) -{ - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternBuilderModel ) return false; - - QModelIndex iElts; - QModelIndex ipipe = patternBuilderModel->mapToSource( _index[pipe_le] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); - double nr = nr_spb->value(); - double na = na_spb->value(); - double nl = nl_spb->value(); - - if ( ipipe.isValid() - && ivec.isValid() ){ - iElts = getDocumentModel()->makePipe( ipipe, ivec, nr, na, nl ); - } - if ( !iElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE PIPE" ) ); - return false; - } - - // to select/highlight result - result = patternBuilderModel->mapFromSource(iElts); - - return true; -} - -//---------------------------------- MakeCylindersDialog ----------------------------- - -// ============================================================== Constructeur - -MakeCylindersDialog::MakeCylindersDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) -: HexaBaseDialog(parent, editmode, f) -{ - _helpFileName = "gui_blocks_for_cyl_pipe.html#make-cylinders"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( cyl1_le ); -} - -// ============================================================== Destructeur -MakeCylindersDialog::~MakeCylindersDialog() -{ -} - -void MakeCylindersDialog::_initInputWidget( Mode editmode ) -{ - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - -// setProperty( "HexaWidgetType", QVariant::fromValue(CROSSELEMENTS_TREE) ); - installEventFilter(this); - - cyl1_le->setProperty( "HexaWidgetType", QVariant::fromValue(CYLINDER_TREE) ); - cyl2_le->setProperty( "HexaWidgetType", QVariant::fromValue(CYLINDER_TREE) ); - - cyl1_le->setValidator( validator ); - cyl2_le->setValidator( validator ); - - cyl1_le->installEventFilter(this); - cyl2_le->installEventFilter(this); - - cyl1_le->setReadOnly(true); - cyl2_le->setReadOnly(true); -} - -// ============================================================== clear -void MakeCylindersDialog::clear() -{ - cyl1_le->clear(); - modelUnregister(cyl1_le); - - cyl2_le->clear(); - modelUnregister(cyl2_le); - - modelUnregister(this); -} - - -// ============================================================== apply -bool MakeCylindersDialog::apply(QModelIndex& result) -{ - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternBuilderModel ) return false; - - QModelIndex iCrossElts; - QModelIndex icyl1 = patternBuilderModel->mapToSource( _index[cyl1_le] ); - QModelIndex icyl2 = patternBuilderModel->mapToSource( _index[cyl2_le] ); - - if ( icyl1.isValid() - && icyl2.isValid() ){ - iCrossElts = getDocumentModel()->makeCylinders( icyl1, icyl2 ); - } - - if ( !iCrossElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE CYLINDERS" ) ); - return false; - } - - // to select/highlight result - result = patternBuilderModel->mapFromSource(iCrossElts); - - return true; -} - - - -//---------------------------------- MakePipesDialog ----------------------------- - -// ============================================================== Constructeur - -MakePipesDialog::MakePipesDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) -: HexaBaseDialog(parent, editmode, f) -{ - _helpFileName = "gui_blocks_for_cyl_pipe.html#make-pipes"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( pipe1_le ); -} - -// ============================================================== Destructeur -MakePipesDialog::~MakePipesDialog() -{ -} - -// ============================================================== _initInputWidget -void MakePipesDialog::_initInputWidget( Mode editmode ) -{ - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - - pipe1_le->setProperty( "HexaWidgetType", QVariant::fromValue(PIPE_TREE) ); - pipe2_le->setProperty( "HexaWidgetType", QVariant::fromValue(PIPE_TREE) ); - - pipe1_le->setValidator( validator ); - pipe2_le->setValidator( validator ); - - pipe1_le->installEventFilter(this); - pipe2_le->installEventFilter(this); - - pipe1_le->setReadOnly(true); - pipe2_le->setReadOnly(true); -} - - -// ============================================================== clear -void MakePipesDialog::clear() -{ - pipe1_le->clear(); - modelUnregister(pipe1_le); - - pipe2_le->clear(); - modelUnregister(pipe2_le); - - modelUnregister(this); -} - - // ============================================================== apply bool MakePipesDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternBuilderModel ) return false; - - QModelIndex iCrossElts; - QModelIndex ipipe1 = patternBuilderModel->mapToSource( _index[pipe1_le] ); - QModelIndex ipipe2 = patternBuilderModel->mapToSource( _index[pipe2_le] ); + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + + QModelIndex iorigin1 = patternDataModel->mapToSource( _index[origin_le] ); + QModelIndex iorigin2 = patternDataModel->mapToSource( _index[origin2_le] ); + QModelIndex idir1 = patternBuilderModel->mapToSource( _index[dir_le] ); + QModelIndex idir2 = patternBuilderModel->mapToSource( _index[dir2_le] ); + double rint1 = int_radius_spb->value(); + double rext1 = ext_radius_spb->value(); + double height1 = height_spb->value(); + double rint2 = int_radius2_spb->value(); + double rext2 = ext_radius2_spb->value(); + double height2 = height_spb->value(); + + QModelIndex iElts; + + if ( iorigin1.isValid() && iorigin2.isValid() && idir1.isValid() && idir2.isValid()) + iElts = docModel->makePipes( iorigin1, idir1, rint1, rext1, height1, + iorigin2, idir2, rint2, rext2, height2); + + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE PIPES" ) + "\n" + getErrorMsg() ); + return false; + } - if ( ipipe1.isValid() - && ipipe2.isValid() ){ - iCrossElts = getDocumentModel()->makePipes( ipipe1, ipipe2 ); - } - if ( !iCrossElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE PIPES" ) ); - return false; - } - result = patternBuilderModel->mapFromSource(iCrossElts); + result = patternBuilderModel->mapFromSource(iElts); - return true; + return true; } - //---------------------------------- RemoveHexaDialog ----------------------------- - // ============================================================== Constructeur RemoveHexaDialog::RemoveHexaDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_remove.html"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( hexa_le ); + _helpFileName = "gui_remove.html"; + setupUi( this ); + _initWidget(editmode); } // ============================================================== Destructeur @@ -3075,76 +2769,68 @@ RemoveHexaDialog::~RemoveHexaDialog() // ============================================================== _initInputWidget void RemoveHexaDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); - hexa_le->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); - hexa_le->setValidator( validator ); - hexa_le->installEventFilter(this); - hexa_le->setReadOnly(true); - autoFocusSwitch = false; + hexa_le->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); + hexa_le->setValidator( validator ); + hexa_le->installEventFilter(this); + hexa_le->setReadOnly(true); + autoFocusSwitch = false; } // ============================================================== clear void RemoveHexaDialog::clear() { - hexa_le->clear(); - modelUnregister(hexa_le); + hexa_le->clear(); + modelUnregister(hexa_le); - modelUnregister(this); + modelUnregister(this); } - // ============================================================== apply bool RemoveHexaDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return false; + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return false; - QModelIndex ihexa = patternDataModel->mapToSource( _index[hexa_le] ); + QModelIndex ihexa = patternDataModel->mapToSource( _index[hexa_le] ); - bool removed = false; - if ( ihexa.isValid() ){ - if ( connected_cb->isChecked() ){ - removed = getDocumentModel()->removeConnectedHexa( ihexa ); - } else { - removed = getDocumentModel()->removeHexa( ihexa ); - } - } + bool removed = false; + if ( ihexa.isValid() ){ + if ( connected_cb->isChecked() ){ + removed = getDocumentModel()->removeConnectedHexa( ihexa ); + } else { + removed = getDocumentModel()->removeHexa( ihexa ); + } + } - if ( removed == false ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT REMOVE HEXA" ) ); - return false; - } + if ( removed == false ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT REMOVE HEXA" ) + "\n" + getErrorMsg() ); + return false; + } - clear(); + clear(); - return true; + return true; } - //---------------------------------- PrismQuadDialog ----------------------------- - // ============================================================== Constructeur PrismQuadDialog::PrismQuadDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_prism_join_quad.html#prism-quadrangles"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( quads_lw ); - // connect( regular_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - // connect( irregular_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - regular_rb->click(); + _helpFileName = "gui_prism_join_quad.html#prism-quadrangles"; + setupUi( this ); + _initWidget(editmode); + extrudeTop_rb->click(); } - // ============================================================== Destructeur PrismQuadDialog::~PrismQuadDialog() { @@ -3156,53 +2842,44 @@ PrismQuadDialog::~PrismQuadDialog() */ QModelIndexList PrismQuadDialog::getAssocsVTK() { - QModelIndexList assocs; - QModelIndex iQuad; - QListWidgetItem* item = NULL; - - //ListWidget content - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return assocs; - for ( int r = 0; r < quads_lw->count(); ++r ){ - item = quads_lw->item(r); - iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iQuad.isValid() ) + QModelIndexList assocs; + QModelIndex iQuad; + QListWidgetItem* item = NULL; + + //ListWidget content + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return assocs; + int nbQuads = quads_lw->count(); + for ( int r = 0; r < nbQuads; ++r ){ + item = quads_lw->item(r); + iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iQuad.isValid() ) assocs << iQuad; - } - return assocs; + } + return assocs; } - // ============================================================== _initInputWidget void PrismQuadDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + installEventFilter(this); + quads_lw->installEventFilter(this); + axis_le->installEventFilter(this); - vec_le->setValidator( validator ); + axis_le->setReadOnly(true); - vec_le->installEventFilter(this); - quads_lw->installEventFilter(this); + QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); + delQuadShortcut->setContext( Qt::WidgetShortcut ); + height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); + height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - if ( editmode != INFO_MODE ){ - QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); - delQuadShortcut->setContext( Qt::WidgetShortcut ); - connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(removeQuad()) ); - } - - vec_le->setReadOnly(true); - - connect( quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); - height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); - height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); - connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); + connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(removeQuad()) ); + connect( quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); + connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); + connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); } // ============================================================== clear @@ -3211,8 +2888,8 @@ void PrismQuadDialog::clear() quads_lw->clear(); modelUnregister(quads_lw); - vec_le->clear(); - modelUnregister(vec_le); + axis_le->clear(); + modelUnregister(axis_le); modelUnregister(this); } @@ -3220,119 +2897,103 @@ void PrismQuadDialog::clear() // ============================================================== removeQuad void PrismQuadDialog::removeQuad() { - QListWidgetItem *item = quads_lw->currentItem(); - - if (item) { - int r = quads_lw->row(item); - quads_lw->takeItem(r); - delete item; - } + QListWidgetItem *item = quads_lw->currentItem(); + if (item) { + int r = quads_lw->row(item); + quads_lw->takeItem(r); + delete item; + } } -// void PrismQuadDialog::clearQuads() -// { -// if (quads_lw->count() != 0) -// quads_lw->clear(); -// } - // ============================================================== addHeightItem void PrismQuadDialog::addHeightItem() { - QListWidgetItem* previousItem = height_lw->currentItem(); - QListWidgetItem* newItem = new QListWidgetItem(); - - double defaultValue = 1.; - if ( previousItem ) - defaultValue = previousItem->data(Qt::EditRole).toDouble(); + QListWidgetItem* previousItem = height_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - newItem->setData( Qt::EditRole, QVariant(defaultValue) ); - newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); - height_lw->addItem(newItem); + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - // updateButtonBox(); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + height_lw->addItem(newItem); } // ============================================================== delHeightItem void PrismQuadDialog::delHeightItem() { - delete height_lw->currentItem(); - // updateButtonBox(); + delete height_lw->currentItem(); } - - // ============================================================== apply bool PrismQuadDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + DocumentModel* docModel = getDocumentModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - ///// - QModelIndexList iquads = getIndexList(quads_lw); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); + QModelIndexList iquads = getIndexList(quads_lw); + QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] ); + double length = length_spb->value(); + int nb = nb_spb->value(); - QModelIndex iElts; - if ( ivec.isValid() ){ - if (regular_rb->isChecked()) - { - int nb = nb_spb->value(); - if ( iquads.count() == 1 ){ - iElts = getDocumentModel()->prismQuad( iquads[0], ivec, nb ); - } else if ( iquads.count() > 1 ){ - iElts = getDocumentModel()->prismQuads( iquads, ivec, nb ); - } - } - else //irregular_rb is checked - { - QVector heights; - QListWidgetItem* item = NULL; - unsigned int nbItems = height_lw->count(); - - for ( int r = 0; r < nbItems; ++r){ - item = height_lw->item(r); - heights << item->data(Qt::EditRole).toDouble(); - } - if (iquads.count() == 0 || heights.size() == 0) - { - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), - tr( "Parameters are invalid!" ) ); - return false; - } - iElts = getDocumentModel()->prismQuads( iquads, ivec, heights.toStdVector()/*, nb*/ ); - } - } + vector heights; + QListWidgetItem* item = NULL; + int nbItems = height_lw->count(); + + for ( int r = 0; r < nbItems; ++r){ + item = height_lw->item(r); + heights.push_back( item->data(Qt::EditRole).toDouble() ); + } + + QModelIndex iElts; + int nbQuads = iquads.count(); + + if (nbQuads == 1 && iquads[0].isValid()) + { + if (extrudeTop_rb->isChecked()) + iElts = docModel->extrudeQuadTop(iquads[0], nb); + else if (extrudeUni_rb->isChecked() && iaxis.isValid()) + iElts = docModel->extrudeQuadUni(iquads[0], iaxis, length, nb); + else if (extrude_rb->isChecked() && iaxis.isValid()) + iElts = docModel->extrudeQuad(iquads[0], iaxis, heights); + } + else if (nbQuads > 1) + { + if (extrudeTop_rb->isChecked()) + iElts = docModel->extrudeQuadsTop(iquads, nb); + else if (extrudeUni_rb->isChecked() && iaxis.isValid()) + iElts = docModel->extrudeQuadsUni(iquads, iaxis, length, nb); + else if (extrude_rb->isChecked() && iaxis.isValid()) + iElts = docModel->extrudeQuads(iquads, iaxis, heights); + } - if ( !iElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT PRISM QUAD(S)" ) ); - return false; - } + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT PRISM QUAD(S)" ) + "\n" + getErrorMsg() ); + return false; + } - result = patternBuilderModel->mapFromSource(iElts); + result = patternBuilderModel->mapFromSource(iElts); - return true; + return true; } //---------------------------------- JoinQuadDialog ----------------------------- - // ============================================================== Constructeur JoinQuadDialog::JoinQuadDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_prism_join_quad.html#join-quadrangles"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( quads_lw ); + _helpFileName = "gui_prism_join_quad.html#join-quadrangles"; + setupUi( this ); + _initWidget(editmode); + joinUni_rb->click(); } - // ============================================================== Destructeur JoinQuadDialog::~JoinQuadDialog() { @@ -3344,207 +3005,203 @@ JoinQuadDialog::~JoinQuadDialog() */ QModelIndexList JoinQuadDialog::getAssocsVTK() { - QModelIndexList assocs; - QModelIndex iQuad; - QListWidgetItem* item = NULL; - - if (getPatternDataSelectionModel() == NULL) return assocs; - - //ListWidget content - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return assocs; - for ( int r = 0; r < quads_lw->count(); ++r ){ - item = quads_lw->item(r); - // iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); //unsafe - iQuad = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); - if ( iQuad.isValid() ) assocs << iQuad; - } - return assocs; + QModelIndexList assocs; + QModelIndex iQuad; + QListWidgetItem* item = NULL; + + if (getPatternDataSelectionModel() == NULL) return assocs; + + //ListWidget content + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return assocs; + int nbQuads = quads_lw->count(); + for ( int r = 0; r < nbQuads; ++r ){ + item = quads_lw->item(r); + // iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); //unsafe + iQuad = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); + if ( iQuad.isValid() ) assocs << iQuad; + } + return assocs; } // ============================================================== _initInputWidget void JoinQuadDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + quad_dest_le->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + vex0_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vex1_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vex2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vex3_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + + installEventFilter(this); + quad_dest_le->installEventFilter(this); + quads_lw->installEventFilter(this); + vex0_le->installEventFilter(this); + vex1_le->installEventFilter(this); + vex2_le->installEventFilter(this); + vex3_le->installEventFilter(this); -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); + delQuadShortcut->setContext( Qt::WidgetShortcut ); + connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(removeQuad()) ); - vex0_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vex1_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vex2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vex3_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - quad_dest_le->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + quad_dest_le->setReadOnly(true); + vex0_le->setReadOnly(true); + vex1_le->setReadOnly(true); + vex2_le->setReadOnly(true); + vex3_le->setReadOnly(true); - vex0_le->setValidator( validator ); - vex1_le->setValidator( validator ); - vex2_le->setValidator( validator ); - vex3_le->setValidator( validator ); - quad_dest_le->setValidator( validator ); + _currentObj = quads_lw; + height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); + height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - vex0_le->installEventFilter(this); - vex1_le->installEventFilter(this); - vex2_le->installEventFilter(this); - vex3_le->installEventFilter(this); - quad_dest_le->installEventFilter(this); - quads_lw->installEventFilter(this); + connect( quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); - if ( editmode != INFO_MODE ){ - QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); - delQuadShortcut->setContext( Qt::WidgetShortcut ); - connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(removeQuad()) ); - } + connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); + connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); +} - vex0_le->setReadOnly(true); - vex1_le->setReadOnly(true); - vex2_le->setReadOnly(true); - vex3_le->setReadOnly(true); - quad_dest_le->setReadOnly(true); +// ============================================================== addHeightItem +void JoinQuadDialog::addHeightItem() +{ + QListWidgetItem* previousItem = height_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - _currentObj = quads_lw; + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - connect( quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + height_lw->addItem(newItem); } +// ============================================================== delHeightItem +void JoinQuadDialog::delHeightItem() +{ + delete height_lw->currentItem(); +} // ============================================================== clear void JoinQuadDialog::clear() { - quads_lw->clear(); - modelUnregister(quads_lw); + quad_dest_le->clear(); + modelUnregister(quad_dest_le); - vex0_le->clear(); - modelUnregister(vex0_le); + quads_lw->clear(); + modelUnregister(quads_lw); - vex2_le->clear(); - modelUnregister(vex2_le); + vex0_le->clear(); + modelUnregister(vex0_le); - quad_dest_le->clear(); - modelUnregister(quad_dest_le); + vex1_le->clear(); + modelUnregister(vex1_le); - vex1_le->clear(); - modelUnregister(vex1_le); + vex2_le->clear(); + modelUnregister(vex2_le); - vex3_le->clear(); - modelUnregister(vex3_le); + vex3_le->clear(); + modelUnregister(vex3_le); - modelUnregister(this); + modelUnregister(this); } - // ============================================================== removeQuad void JoinQuadDialog::removeQuad() { - QListWidgetItem *item = quads_lw->currentItem(); - - if (item) { - int r = quads_lw->row(item); - quads_lw->takeItem(r); - delete item; - } + QListWidgetItem *item = quads_lw->currentItem(); + if (item) { + int r = quads_lw->row(item); + quads_lw->takeItem(r); + delete item; + } } -// void JoinQuadDialog::clearQuads() -// { -// if (quads_lw->count() != 0) -// quads_lw->clear(); -// } - - // ============================================================== apply bool JoinQuadDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; - - ///// - QModelIndexList iquads; - QModelIndex iquad; - QListWidgetItem* item = NULL; - for ( int r = 0; r < quads_lw->count(); ++r){ - item = quads_lw->item(r); - iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iquad.isValid() ) iquads << iquad; - } - QModelIndex iquaddest = patternDataModel->mapToSource( _index[quad_dest_le] ); - QModelIndex ivex0 = patternDataModel->mapToSource( _index[vex0_le] ); - QModelIndex ivex1 = patternDataModel->mapToSource( _index[vex1_le] ); - QModelIndex ivex2 = patternDataModel->mapToSource( _index[vex2_le] ); - QModelIndex ivex3 = patternDataModel->mapToSource( _index[vex3_le] ); - - QModelIndex iElts; - if ( iquaddest.isValid() - && ivex0.isValid() - && ivex1.isValid() - && ivex2.isValid() - && ivex3.isValid() ){ - int nb = nb_spb->value(); - if ( iquads.count() == 1 ){ - iElts = getDocumentModel()->joinQuad( iquads[0], iquaddest, - ivex0, ivex1, ivex2, ivex3, - nb ); - } else if ( iquads.count() > 1 ){ - iElts = getDocumentModel()->joinQuads( iquads, iquaddest, - ivex0, ivex1, ivex2, ivex3, - nb ); - } - } - - if ( !iElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT JOIN QUAD(S)" ) ); - return false; - } - - result = patternBuilderModel->mapFromSource(iElts); - - return true; -} - - -// void JoinQuadDialog::reject() -// { -// QDialog::reject(); -// _disallowSelection(); -// } + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + + QModelIndexList iquads; + QModelIndex iquad; + QListWidgetItem* item = NULL; + int nbQuads = quads_lw->count(); + for ( int r = 0; r < nbQuads; ++r){ + item = quads_lw->item(r); + iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iquad.isValid() ) + iquads << iquad; + } + QModelIndex iquaddest = patternDataModel->mapToSource( _index[quad_dest_le] ); + QModelIndex ivex0 = patternDataModel->mapToSource( _index[vex0_le] ); + QModelIndex ivex1 = patternDataModel->mapToSource( _index[vex1_le] ); + QModelIndex ivex2 = patternDataModel->mapToSource( _index[vex2_le] ); + QModelIndex ivex3 = patternDataModel->mapToSource( _index[vex3_le] ); + double nb = nb_spb->value(); + + vector heights; + int nbHeight = height_lw->count(); + for ( int r = 0; r < nbHeight; ++r){ + item = height_lw->item(r); + heights.push_back(item->data(Qt::EditRole).toDouble()); + } + QModelIndex iElts; + if (nbQuads == 1 && iquads[0].isValid() && iquaddest.isValid() && ivex0.isValid() && + ivex1.isValid() && ivex2.isValid() && ivex3.isValid()) + { + if (joinUni_rb->isChecked()) + iElts = docModel->joinQuadUni(iquads[0], iquaddest, ivex0, ivex1, ivex2, ivex3, nb); + else if (join_rb->isChecked()) + iElts = docModel->joinQuad(iquads[0], iquaddest, ivex0, ivex1, ivex2, ivex3, heights); + } + else if (nbQuads > 1 && iquaddest.isValid() && ivex0.isValid() && + ivex1.isValid() && ivex2.isValid() && ivex3.isValid()) + { + if (joinUni_rb->isChecked()) + iElts = docModel->joinQuadsUni(iquads, iquaddest, ivex0, ivex1, ivex2, ivex3, nb); + else if (join_rb->isChecked()) + iElts = docModel->joinQuads(iquads, iquaddest, ivex0, ivex1, ivex2, ivex3, heights); + } + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT JOIN QUAD(S)" ) + "\n" + getErrorMsg() ); + return false; + } + result = patternBuilderModel->mapFromSource(iElts); -// ------------------------- MergeDialog ---------------------------------- + return true; +} +// ------------------------- MergeDialog ---------------------------------- // ============================================================== Constructeur MergeDialog::MergeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - setupUi( this ); - _initWidget(editmode); - // rb0->setFocusProxy( v0_le_rb0 ); - // rb1->setFocusProxy( e0_le_rb1 ); - // rb2->setFocusProxy( q0_le_rb2 ); - // setFocusProxy( rb0 ); - rb0->click(); + setupUi( this ); + _initWidget(editmode); + rb0->click(); - _helpFileName = "gui_merge_elmts.html#merge-two-vertices"; - connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb0, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb0, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + _helpFileName = "gui_merge_elmts.html#merge-two-vertices"; + connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb0, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb0, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb2, SIGNAL(cliked()), this, SLOT(clearVTKSelection()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb2, SIGNAL(cliked()), this, SLOT(clearVTKSelection()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); } // ============================================================== Destructeur @@ -3555,222 +3212,209 @@ MergeDialog::~MergeDialog() // ============================================================== _initInputWidget void MergeDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - - - v0_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v1_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v0_le_rb0->setValidator( validator ); - v1_le_rb0->setValidator( validator ); - v0_le_rb0->installEventFilter(this); - v1_le_rb0->installEventFilter(this); - - v0_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v1_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - e0_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - e1_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - - v0_le_rb1->setValidator( validator ); - v1_le_rb1->setValidator( validator ); - e0_le_rb1->setValidator( validator ); - e1_le_rb1->setValidator( validator ); - - v0_le_rb1->installEventFilter(this); - v1_le_rb1->installEventFilter(this); - e0_le_rb1->installEventFilter(this); - e1_le_rb1->installEventFilter(this); - - - v0_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v1_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v2_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - v3_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - q0_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - q1_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - - - v0_le_rb2->setValidator( validator ); - v1_le_rb2->setValidator( validator ); - v2_le_rb2->setValidator( validator ); - v3_le_rb2->setValidator( validator ); - q0_le_rb2->setValidator( validator ); - q1_le_rb2->setValidator( validator ); - - v0_le_rb2->installEventFilter(this); - v1_le_rb2->installEventFilter(this); - v2_le_rb2->installEventFilter(this); - v3_le_rb2->installEventFilter(this); - q0_le_rb2->installEventFilter(this); - q1_le_rb2->installEventFilter(this); - - v0_le_rb0->setReadOnly(true); - v1_le_rb0->setReadOnly(true); - - v0_le_rb1->setReadOnly(true); - v1_le_rb1->setReadOnly(true); - e0_le_rb1->setReadOnly(true); - e1_le_rb1->setReadOnly(true); - - v0_le_rb2->setReadOnly(true); - v1_le_rb2->setReadOnly(true); - v2_le_rb2->setReadOnly(true); - v3_le_rb2->setReadOnly(true); - q0_le_rb2->setReadOnly(true); - q1_le_rb2->setReadOnly(true); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); + + v0_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v1_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v0_le_rb0->setValidator( validator ); + v1_le_rb0->setValidator( validator ); + v0_le_rb0->installEventFilter(this); + v1_le_rb0->installEventFilter(this); + + v0_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v1_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + e0_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + e1_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + + v0_le_rb1->setValidator( validator ); + v1_le_rb1->setValidator( validator ); + e0_le_rb1->setValidator( validator ); + e1_le_rb1->setValidator( validator ); + + v0_le_rb1->installEventFilter(this); + v1_le_rb1->installEventFilter(this); + e0_le_rb1->installEventFilter(this); + e1_le_rb1->installEventFilter(this); + + v0_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v1_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v2_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + v3_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + q0_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + q1_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + + v0_le_rb2->setValidator( validator ); + v1_le_rb2->setValidator( validator ); + v2_le_rb2->setValidator( validator ); + v3_le_rb2->setValidator( validator ); + q0_le_rb2->setValidator( validator ); + q1_le_rb2->setValidator( validator ); + + v0_le_rb2->installEventFilter(this); + v1_le_rb2->installEventFilter(this); + v2_le_rb2->installEventFilter(this); + v3_le_rb2->installEventFilter(this); + q0_le_rb2->installEventFilter(this); + q1_le_rb2->installEventFilter(this); + + v0_le_rb0->setReadOnly(true); + v1_le_rb0->setReadOnly(true); + + v0_le_rb1->setReadOnly(true); + v1_le_rb1->setReadOnly(true); + e0_le_rb1->setReadOnly(true); + e1_le_rb1->setReadOnly(true); + + v0_le_rb2->setReadOnly(true); + v1_le_rb2->setReadOnly(true); + v2_le_rb2->setReadOnly(true); + v3_le_rb2->setReadOnly(true); + q0_le_rb2->setReadOnly(true); + q1_le_rb2->setReadOnly(true); } - // ============================================================== clear void MergeDialog::clear() { - v0_le_rb0->clear(); - modelUnregister(v0_le_rb0); + v0_le_rb0->clear(); + modelUnregister(v0_le_rb0); - v1_le_rb0->clear(); - modelUnregister(v1_le_rb0); + v1_le_rb0->clear(); + modelUnregister(v1_le_rb0); - e0_le_rb1->clear(); - modelUnregister(e0_le_rb1); + e0_le_rb1->clear(); + modelUnregister(e0_le_rb1); - e1_le_rb1->clear(); - modelUnregister(e1_le_rb1); + e1_le_rb1->clear(); + modelUnregister(e1_le_rb1); - v0_le_rb1->clear(); - modelUnregister(v0_le_rb1); + v0_le_rb1->clear(); + modelUnregister(v0_le_rb1); - v1_le_rb1->clear(); - modelUnregister(v1_le_rb1); + v1_le_rb1->clear(); + modelUnregister(v1_le_rb1); - q0_le_rb2->clear(); - modelUnregister(q0_le_rb2); + q0_le_rb2->clear(); + modelUnregister(q0_le_rb2); - q1_le_rb2->clear(); - modelUnregister(q1_le_rb2); + q1_le_rb2->clear(); + modelUnregister(q1_le_rb2); - v0_le_rb2->clear(); - modelUnregister(v0_le_rb2); + v0_le_rb2->clear(); + modelUnregister(v0_le_rb2); - v1_le_rb2->clear(); - modelUnregister(v1_le_rb2); + v1_le_rb2->clear(); + modelUnregister(v1_le_rb2); - v2_le_rb2->clear(); - modelUnregister(v2_le_rb2); + v2_le_rb2->clear(); + modelUnregister(v2_le_rb2); - v3_le_rb2->clear(); - modelUnregister(v3_le_rb2); + v3_le_rb2->clear(); + modelUnregister(v3_le_rb2); - modelUnregister(this); + modelUnregister(this); } // ============================================================== updateHelpFileName void MergeDialog::updateHelpFileName() { - if ( sender() == rb0 ){ - _helpFileName = "gui_merge_elmts.html#merge-two-vertices"; - } else if ( sender() == rb1 ){ - _helpFileName = "gui_merge_elmts.html#merge-two-edges"; - } else if ( sender() == rb2 ){ - _helpFileName = "gui_merge_elmts.html#merge-two-quadrangles"; - } + if ( sender() == rb0 ){ + _helpFileName = "gui_merge_elmts.html#merge-two-vertices"; + } else if ( sender() == rb1 ){ + _helpFileName = "gui_merge_elmts.html#merge-two-edges"; + } else if ( sender() == rb2 ){ + _helpFileName = "gui_merge_elmts.html#merge-two-quadrangles"; + } } - // ============================================================== apply bool MergeDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - if (getDocumentModel() == NULL) return false; - SUIT_OverrideCursor wc; - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return false; - - bool merged = false; - - if ( rb0->isChecked() ){ - QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb0] ); - QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb0] ); - - if ( iv0.isValid() - && iv1.isValid() ){ - merged = getDocumentModel()->mergeVertices( iv0, iv1 ); - } - } else if ( rb1->isChecked() ){ - QModelIndex ie0 = patternDataModel->mapToSource( _index[e0_le_rb1] ); - QModelIndex ie1 = patternDataModel->mapToSource( _index[e1_le_rb1] ); - QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb1] ); - QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb1] ); - - if ( ie0.isValid() - && ie1.isValid() - && iv0.isValid() - && iv1.isValid() ){ - merged = getDocumentModel()->mergeEdges( ie0, ie1, iv0, iv1); - } - } else if ( rb2->isChecked() ){ - - QModelIndex iq0 = patternDataModel->mapToSource( _index[q0_le_rb2] ); - QModelIndex iq1 = patternDataModel->mapToSource( _index[q1_le_rb2] ); - QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb2] ); - QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb2] ); - QModelIndex iv2 = patternDataModel->mapToSource( _index[v2_le_rb2] ); - QModelIndex iv3 = patternDataModel->mapToSource( _index[v3_le_rb2] ); - - if ( iq0.isValid() - && iq1.isValid() - && iv0.isValid() - && iv1.isValid() - && iv2.isValid() - && iv3.isValid() ){ - merged = getDocumentModel()->mergeQuads( iq0, iq1, - iv0, iv1, iv2, iv3 ); - } - } - - if ( merged == false ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MERGE" ) ); - return false; - } - - return true; -} + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + if (getDocumentModel() == NULL) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return false; -// ------------------------- DisconnectDialog ---------------------------------- + bool merged = false; + + if ( rb0->isChecked() ){ + QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb0] ); + QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb0] ); + + if ( iv0.isValid() + && iv1.isValid() ){ + merged = getDocumentModel()->mergeVertices( iv0, iv1 ); + } + } else if ( rb1->isChecked() ){ + QModelIndex ie0 = patternDataModel->mapToSource( _index[e0_le_rb1] ); + QModelIndex ie1 = patternDataModel->mapToSource( _index[e1_le_rb1] ); + QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb1] ); + QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb1] ); + + if ( ie0.isValid() + && ie1.isValid() + && iv0.isValid() + && iv1.isValid() ){ + merged = getDocumentModel()->mergeEdges( ie0, ie1, iv0, iv1); + } + } else if ( rb2->isChecked() ){ + + QModelIndex iq0 = patternDataModel->mapToSource( _index[q0_le_rb2] ); + QModelIndex iq1 = patternDataModel->mapToSource( _index[q1_le_rb2] ); + QModelIndex iv0 = patternDataModel->mapToSource( _index[v0_le_rb2] ); + QModelIndex iv1 = patternDataModel->mapToSource( _index[v1_le_rb2] ); + QModelIndex iv2 = patternDataModel->mapToSource( _index[v2_le_rb2] ); + QModelIndex iv3 = patternDataModel->mapToSource( _index[v3_le_rb2] ); + + if ( iq0.isValid() + && iq1.isValid() + && iv0.isValid() + && iv1.isValid() + && iv2.isValid() + && iv3.isValid() ){ + merged = getDocumentModel()->mergeQuads( iq0, iq1, + iv0, iv1, iv2, iv3 ); + } + } + + if ( merged == false ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MERGE" ) + "\n" + getErrorMsg() ); + return false; + } + + return true; +} +// ------------------------- DisconnectDialog ---------------------------------- // ============================================================== Constructeur DisconnectDialog::DisconnectDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - setupUi( this ); - _initWidget(editmode); - // rb0->setFocusProxy( v_le_rb0 ); - // rb1->setFocusProxy( e_le_rb1 ); - // rb2->setFocusProxy( q_le_rb2 ); - // rb3->setFocusProxy( d_edges_lw); - rb0->click(); - // setFocusProxy( rb0 ); + setupUi( this ); + _initWidget(editmode); + rb0->click(); - _helpFileName = "gui_disc_elmts.html#disconnect-a-vertex"; + _helpFileName = "gui_disc_elmts.html#disconnect-a-vertex"; - connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb0, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb0, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb0, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb0, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); - connect( rb3, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb3, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); - connect( rb3, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + connect( rb3, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb3, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rb3, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); } @@ -3782,61 +3426,60 @@ DisconnectDialog::~DisconnectDialog() // ============================================================== _initInputWidget void DisconnectDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + installEventFilter(this); - //vertex - v_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - h_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); - v_le_rb0->setValidator( validator ); - h_le_rb0->setValidator( validator ); - v_le_rb0->installEventFilter(this); - h_le_rb0->installEventFilter(this); + //vertex + v_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + h_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); + v_le_rb0->setValidator( validator ); + h_le_rb0->setValidator( validator ); + v_le_rb0->installEventFilter(this); + h_le_rb0->installEventFilter(this); - //edge - e_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - h_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); - e_le_rb1->setValidator( validator ); - h_le_rb1->setValidator( validator ); - e_le_rb1->installEventFilter(this); - h_le_rb1->installEventFilter(this); + //edge + e_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + h_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); + e_le_rb1->setValidator( validator ); + h_le_rb1->setValidator( validator ); + e_le_rb1->installEventFilter(this); + h_le_rb1->installEventFilter(this); - //quad - q_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - h_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); - q_le_rb2->setValidator( validator ); - h_le_rb2->setValidator( validator ); - q_le_rb2->installEventFilter(this); - h_le_rb2->installEventFilter(this); + //quad + q_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + h_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); + q_le_rb2->setValidator( validator ); + h_le_rb2->setValidator( validator ); + q_le_rb2->installEventFilter(this); + h_le_rb2->installEventFilter(this); - //edges - d_edges_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - hexas_lw->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); - d_edges_lw->installEventFilter(this); - hexas_lw->installEventFilter(this); + //edges + d_edges_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + hexas_lw->setProperty( "HexaWidgetType", QVariant::fromValue(HEXA_TREE) ); + d_edges_lw->installEventFilter(this); + hexas_lw->installEventFilter(this); - QShortcut* delEdgeShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X/*Qt::Key_Alt*//*Qt::Key_Space*/), d_edges_lw); - QShortcut* delHexaShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X/*Qt::Key_Alt*//*Qt::Key_Space*/), hexas_lw); - delEdgeShortcut->setContext( Qt::WidgetShortcut ); - delHexaShortcut->setContext( Qt::WidgetShortcut ); + QShortcut* delEdgeShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X/*Qt::Key_Alt*//*Qt::Key_Space*/), d_edges_lw); + QShortcut* delHexaShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X/*Qt::Key_Alt*//*Qt::Key_Space*/), hexas_lw); + delEdgeShortcut->setContext( Qt::WidgetShortcut ); + delHexaShortcut->setContext( Qt::WidgetShortcut ); - v_le_rb0->setReadOnly(true); - h_le_rb0->setReadOnly(true); + v_le_rb0->setReadOnly(true); + h_le_rb0->setReadOnly(true); - e_le_rb1->setReadOnly(true); - h_le_rb1->setReadOnly(true); + e_le_rb1->setReadOnly(true); + h_le_rb1->setReadOnly(true); - q_le_rb2->setReadOnly(true); - h_le_rb2->setReadOnly(true); + q_le_rb2->setReadOnly(true); + h_le_rb2->setReadOnly(true); - connect( d_edges_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); - connect( hexas_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); - connect( delEdgeShortcut, SIGNAL(activated()), this, SLOT(deleteEdgeItem()) ); - connect( delHexaShortcut, SIGNAL(activated()), this, SLOT(deleteHexaItem()) ); - autoFocusSwitch = false; + connect( d_edges_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); + connect( hexas_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); + connect( delEdgeShortcut, SIGNAL(activated()), this, SLOT(deleteEdgeItem()) ); + connect( delHexaShortcut, SIGNAL(activated()), this, SLOT(deleteHexaItem()) ); + autoFocusSwitch = false; } @@ -3846,183 +3489,180 @@ void DisconnectDialog::_initInputWidget( Mode editmode ) */ QModelIndexList DisconnectDialog::getAssocsVTK() { - QModelIndexList iElts; - QModelIndex index; - QListWidgetItem* item = NULL; - - const PatternDataModel* patternDataModel = getPatternDataModel(); - if (patternDataModel == NULL) return iElts; - if (rb3->isChecked()) - { - //ListWidget content - if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == EDGE_TREE) - { - for ( int r = 0; r < d_edges_lw->count(); ++r ) - { - item = d_edges_lw->item(r); - index = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( index.isValid() ) - iElts << index; - } - } - else if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == HEXA_TREE) - { - for ( int r = 0; r < hexas_lw->count(); ++r ) - { - item = hexas_lw->item(r); - index = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( index.isValid() ) - iElts << index; - } - } - return iElts; - } - else - return iElts; + QModelIndexList iElts; + QModelIndex index; + QListWidgetItem* item = NULL; + + const PatternDataModel* patternDataModel = getPatternDataModel(); + if (patternDataModel == NULL || !rb3->isChecked()) + return iElts; + //ListWidget content + if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == EDGE_TREE) + { + int nbEdges = d_edges_lw->count(); + for ( int r = 0; r < nbEdges; ++r ) + { + item = d_edges_lw->item(r); + index = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( index.isValid() ) + iElts << index; + } + } + else if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == HEXA_TREE) + { + int nbHexas = hexas_lw->count(); + for ( int r = 0; r < nbHexas; ++r ) + { + item = hexas_lw->item(r); + index = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( index.isValid() ) + iElts << index; + } + } + return iElts; } // ============================================================== clear void DisconnectDialog::clear() { - v_le_rb0->clear(); - modelUnregister(v_le_rb0); + v_le_rb0->clear(); + modelUnregister(v_le_rb0); - h_le_rb0->clear(); - modelUnregister(h_le_rb0); + h_le_rb0->clear(); + modelUnregister(h_le_rb0); - e_le_rb1->clear(); - modelUnregister(e_le_rb1); + e_le_rb1->clear(); + modelUnregister(e_le_rb1); - h_le_rb1->clear(); - modelUnregister(h_le_rb1); + h_le_rb1->clear(); + modelUnregister(h_le_rb1); - d_edges_lw->clear(); - modelUnregister(d_edges_lw); + d_edges_lw->clear(); + modelUnregister(d_edges_lw); - hexas_lw->clear(); - modelUnregister(hexas_lw); + hexas_lw->clear(); + modelUnregister(hexas_lw); - q_le_rb2->clear(); - modelUnregister(q_le_rb2); + q_le_rb2->clear(); + modelUnregister(q_le_rb2); - h_le_rb2->clear(); - modelUnregister(h_le_rb2); + h_le_rb2->clear(); + modelUnregister(h_le_rb2); - modelUnregister(this); + modelUnregister(this); } // ============================================================== deleteEdgeItem void DisconnectDialog::deleteEdgeItem() { - delete d_edges_lw->currentItem(); + delete d_edges_lw->currentItem(); } // ============================================================== deleteHexaItem void DisconnectDialog::deleteHexaItem() { - delete hexas_lw->currentItem(); + delete hexas_lw->currentItem(); } // ============================================================== updateHelpFileName void DisconnectDialog::updateHelpFileName() { - if ( sender() == rb0 ){ - _helpFileName = "gui_disc_elmts.html#disconnect-a-vertex"; - } else if ( sender() == rb1 ){ - _helpFileName = "gui_disc_elmts.html#disconnect-an-edge"; - } else if ( sender() == rb2 ){ - _helpFileName = "gui_disc_elmts.html#disconnect-a-quadrangle"; - } else if (sender() == rb3 ){ - _helpFileName = "gui_disc_elmts.html#disconnect-edges"; - } + if ( sender() == rb0 ){ + _helpFileName = "gui_disc_elmts.html#disconnect-a-vertex"; + } else if ( sender() == rb1 ){ + _helpFileName = "gui_disc_elmts.html#disconnect-an-edge"; + } else if ( sender() == rb2 ){ + _helpFileName = "gui_disc_elmts.html#disconnect-a-quadrangle"; + } else if (sender() == rb3 ){ + _helpFileName = "gui_disc_elmts.html#disconnect-edges"; + } } // ============================================================== apply bool DisconnectDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - if (getDocumentModel() == NULL) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; - - SUIT_OverrideCursor wc; - QModelIndex iElts; - - if ( rb0->isChecked() ){ - QModelIndex ihexa = patternDataModel->mapToSource( _index[h_le_rb0] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[v_le_rb0] ); + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + if (getDocumentModel() == NULL) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; - if ( ihexa.isValid() - && ivex.isValid() ){ - iElts = getDocumentModel()->disconnectVertex( ihexa, ivex ); - } - } else if ( rb1->isChecked() ){ - QModelIndex ihexa = patternDataModel->mapToSource( _index[h_le_rb1] ); - QModelIndex iedge = patternDataModel->mapToSource( _index[e_le_rb1] ); + QModelIndex iElts; - if ( ihexa.isValid() - && iedge.isValid() ){ - iElts = getDocumentModel()->disconnectEdge( ihexa, iedge ); - } - } else if ( rb2->isChecked() ){ - QModelIndex ihexa = patternDataModel->mapToSource( _index[h_le_rb2] ); - QModelIndex iquad = patternDataModel->mapToSource( _index[q_le_rb2] ); + if ( rb0->isChecked() ){ + QModelIndex ihexa = patternDataModel->mapToSource( _index[h_le_rb0] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[v_le_rb0] ); - if ( ihexa.isValid() - && iquad.isValid() ){ - iElts = getDocumentModel()->disconnectQuad( ihexa, iquad ); - } - } else if ( rb3->isChecked() ){ // + if ( ihexa.isValid() + && ivex.isValid() ){ + iElts = getDocumentModel()->disconnectVertex( ihexa, ivex ); + } + } else if ( rb1->isChecked() ){ + QModelIndex ihexa = patternDataModel->mapToSource( _index[h_le_rb1] ); + QModelIndex iedge = patternDataModel->mapToSource( _index[e_le_rb1] ); - QModelIndex iedge, ihexa; - QModelIndexList iedges, ihexas; - QListWidgetItem* item = NULL; + if ( ihexa.isValid() + && iedge.isValid() ){ + iElts = getDocumentModel()->disconnectEdge( ihexa, iedge ); + } + } else if ( rb2->isChecked() ){ + QModelIndex ihexa = patternDataModel->mapToSource( _index[h_le_rb2] ); + QModelIndex iquad = patternDataModel->mapToSource( _index[q_le_rb2] ); - //Liste des edges - for (int r = 0; r < d_edges_lw->count(); ++r){ - item = d_edges_lw->item(r); - iedge = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iedge.isValid() ) - iedges << iedge; - } + if ( ihexa.isValid() + && iquad.isValid() ){ + iElts = getDocumentModel()->disconnectQuad( ihexa, iquad ); + } + } else if ( rb3->isChecked() ){ // + + QModelIndex iedge, ihexa; + QModelIndexList iedges, ihexas; + QListWidgetItem* item = NULL; + + //Liste des edges + int nbEdges = d_edges_lw->count(); + for (int r = 0; r < nbEdges; ++r){ + item = d_edges_lw->item(r); + iedge = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iedge.isValid() ) + iedges << iedge; + } - //Liste des hexas - for (int r = 0; r < hexas_lw->count(); ++r){ - item = hexas_lw->item(r); - ihexa = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( ihexa.isValid() ) - ihexas << ihexa; - } + //Liste des hexas + int nbHexas = hexas_lw->count(); + for (int r = 0; r < nbHexas; ++r){ + item = hexas_lw->item(r); + ihexa = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( ihexa.isValid() ) + ihexas << ihexa; + } - iElts = getDocumentModel()->disconnectEdges( ihexas, iedges ); - } + iElts = getDocumentModel()->disconnectEdges( ihexas, iedges ); + } - if ( !iElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT DISCONNECT" ) ); - return false; - } + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT DISCONNECT" ) + "\n" + getErrorMsg() ); + return false; + } - result = patternBuilderModel->mapFromSource(iElts); + result = patternBuilderModel->mapFromSource(iElts); - return true; + return true; } - - // ------------------------- CutEdgeDialog ---------------------------------- - // ============================================================== Constructeur CutEdgeDialog::CutEdgeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f) +HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_cut_hexa.html"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( e_le ); + _helpFileName = "gui_cut_hexa.html"; + setupUi( this ); + _initWidget(editmode); + + cutUni_rb->click(); } // ============================================================== Destructeur @@ -4033,87 +3673,115 @@ CutEdgeDialog::~CutEdgeDialog() // ============================================================== _initInputWidget void CutEdgeDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + installEventFilter(this); + + e_le->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + e_le->installEventFilter(this); -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + e_le->setReadOnly(true); - e_le->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - e_le->setValidator( validator ); - e_le->installEventFilter(this); + height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); + height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); - e_le->setReadOnly(true); + connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); + connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); } // ============================================================== clear void CutEdgeDialog::clear() { - e_le->clear(); - modelUnregister(e_le); + e_le->clear(); + modelUnregister(e_le); - modelUnregister(this); + modelUnregister(this); +} + +// ============================================================== addHeightItem +void CutEdgeDialog::addHeightItem() +{ + QListWidgetItem* previousItem = height_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); + + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); + + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + height_lw->addItem(newItem); } +// ============================================================== delHeightItem +void CutEdgeDialog::delHeightItem() +{ + delete height_lw->currentItem(); +} // ============================================================== apply bool CutEdgeDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - int nbCut = nb_cut_spb->value(); - QModelIndex iedge = patternDataModel->mapToSource( _index[e_le] ); + QModelIndex iElts; + QModelIndex iedge = patternDataModel->mapToSource( _index[e_le] ); - QModelIndex iElts; - if ( iedge.isValid() ){ - iElts = getDocumentModel()->cutEdge( iedge, nbCut ); - } + if (cutUni_rb->isChecked() && iedge.isValid()) + { + int nbCut = nb_cut_spb->value(); + iElts = docModel->cutUni(iedge, nbCut); + } + else if (cut_rb->isChecked() && iedge.isValid()) + { + vector heights; + QListWidgetItem* item = NULL; + int nbItems = height_lw->count(); - if ( !iElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT CUT EDGE" ) ); - return false; - } + for ( int r = 0; r < nbItems; ++r){ + item = height_lw->item(r); + heights.push_back( item->data(Qt::EditRole).toDouble() ); + } - result = patternBuilderModel->mapFromSource(iElts); + iElts = docModel->cut(iedge, heights); + } - //Update the line edit - QVariant invalid; - e_le->setProperty("QModelIndex", invalid ); + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT CUT EDGE" ) + "\n" + getErrorMsg() ); + return false; + } + + result = patternBuilderModel->mapFromSource(iElts); + + //Update the line edit + QVariant invalid; + e_le->setProperty("QModelIndex", invalid ); - QModelIndex invalidIndex; - _index[e_le] = invalidIndex; + QModelIndex invalidIndex; + _index[e_le] = invalidIndex; - clear(); + clear(); - return true; + return true; } // // ------------------------- MakeTransformationDialog ---------------------------------- - // ============================================================== Constructeur MakeTransformationDialog::MakeTransformationDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - setupUi( this ); - _initWidget(editmode); - // rb0->setFocusProxy( elts_le_rb0 ); - // rb1->setFocusProxy( elts_le_rb1 ); - // rb2->setFocusProxy( elts_le_rb2 ); - // setFocusProxy( rb0 ); - rb0->click(); + setupUi( this ); + _initWidget(editmode); + rb0->click(); - _helpFileName = "gui_make_elmts.html#make-elements-by-translation"; - connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + _helpFileName = "gui_make_elmts.html#make-elements-by-translation"; + connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); } // ============================================================== Destructeur @@ -4124,46 +3792,45 @@ MakeTransformationDialog::~MakeTransformationDialog() // ============================================================== _initInputWidget void MakeTransformationDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + installEventFilter(this); - vec_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vec_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vec_le_rb0->setValidator( validator ); - elts_le_rb0->setValidator( validator ); - vec_le_rb0->installEventFilter(this); - elts_le_rb0->installEventFilter(this); + vec_le_rb0->setValidator( validator ); + elts_le_rb0->setValidator( validator ); + vec_le_rb0->installEventFilter(this); + elts_le_rb0->installEventFilter(this); - vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - elts_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb1->setValidator( validator ); - elts_le_rb1->setValidator( validator ); - vex_le_rb1->installEventFilter(this); - elts_le_rb1->installEventFilter(this); + vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + elts_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb1->setValidator( validator ); + elts_le_rb1->setValidator( validator ); + vex_le_rb1->installEventFilter(this); + elts_le_rb1->installEventFilter(this); - vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - elts_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb2->setValidator( validator ); - vec_le_rb2->setValidator( validator ); - elts_le_rb2->setValidator( validator ); - vex_le_rb2->installEventFilter(this); - vec_le_rb2->installEventFilter(this); - elts_le_rb2->installEventFilter(this); + vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vec_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + elts_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb2->setValidator( validator ); + vec_le_rb2->setValidator( validator ); + elts_le_rb2->setValidator( validator ); + vex_le_rb2->installEventFilter(this); + vec_le_rb2->installEventFilter(this); + elts_le_rb2->installEventFilter(this); - vec_le_rb0->setReadOnly(true); - elts_le_rb0->setReadOnly(true); + vec_le_rb0->setReadOnly(true); + elts_le_rb0->setReadOnly(true); - vex_le_rb1->setReadOnly(true); - elts_le_rb1->setReadOnly(true); + vex_le_rb1->setReadOnly(true); + elts_le_rb1->setReadOnly(true); - vex_le_rb2->setReadOnly(true); - vec_le_rb2->setReadOnly(true); - elts_le_rb2->setReadOnly(true); + vex_le_rb2->setReadOnly(true); + vec_le_rb2->setReadOnly(true); + elts_le_rb2->setReadOnly(true); } @@ -4194,91 +3861,84 @@ void MakeTransformationDialog::clear() modelUnregister(this); } - // ============================================================== updateHelpFileName void MakeTransformationDialog::updateHelpFileName() { - if ( sender() == rb0 ){ - _helpFileName = "gui_make_elmts.html#make-elements-by-translation"; - } else if ( sender() == rb1 ){ - _helpFileName = "gui_make_elmts.html#make-elements-by-scaling"; - } else if ( sender() == rb2 ){ - _helpFileName = "gui_make_elmts.html#make-elements-by-rotation"; - } + if ( sender() == rb0 ){ + _helpFileName = "gui_make_elmts.html#make-elements-by-translation"; + } else if ( sender() == rb1 ){ + _helpFileName = "gui_make_elmts.html#make-elements-by-scaling"; + } else if ( sender() == rb2 ){ + _helpFileName = "gui_make_elmts.html#make-elements-by-rotation"; + } } // ============================================================== apply bool MakeTransformationDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if (getDocumentModel() == NULL) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + if (getDocumentModel() == NULL) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; - QModelIndex iNewElts; + QModelIndex iNewElts; - if ( rb0->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb0] ); + if ( rb0->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb0] ); - if ( ielts.isValid() - && ivec.isValid() ) + if ( ielts.isValid() + && ivec.isValid() ) iNewElts = getDocumentModel()->makeTranslation( ielts, ivec ); - } else if ( rb1->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); - double k = k_spb->value(); + } else if ( rb1->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); + double k = k_spb->value(); - if ( ielts.isValid() - && ivex.isValid() ) + if ( ielts.isValid() + && ivex.isValid() ) iNewElts = getDocumentModel()->makeScale( ielts, ivex, k ); - } else if ( rb2->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); - double angle = angle_spb->value(); + } else if ( rb2->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); + double angle = angle_spb->value(); - if ( ielts.isValid() - && ivex.isValid() - && ivec.isValid() ) + if ( ielts.isValid() + && ivex.isValid() + && ivec.isValid() ) iNewElts = getDocumentModel()->makeRotation( ielts, ivex, ivec, angle ); - } + } - if ( !iNewElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE TRANSFORMATION" ) ); - return false; - } + if ( !iNewElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE TRANSFORMATION" ) + "\n" + getErrorMsg() ); + return false; + } - result = patternBuilderModel->mapFromSource(iNewElts); + result = patternBuilderModel->mapFromSource(iNewElts); - return true; + return true; } // // ------------------------- MakeSymmetryDialog ---------------------------------- - // ============================================================== Constructeur MakeSymmetryDialog::MakeSymmetryDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f) +HexaBaseDialog(parent, editmode, f) { - setupUi( this ); - _initWidget(editmode); - // rb0->setFocusProxy( elts_le_rb0 ); - // rb1->setFocusProxy( elts_le_rb1 ); - // rb2->setFocusProxy( elts_le_rb2 ); - rb0->click(); - // setFocusProxy( rb0 ); + setupUi( this ); + _initWidget(editmode); + rb0->click(); - _helpFileName = "gui_make_symmetry.html#make-elements-by-point-symmetry"; - connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + _helpFileName = "gui_make_symmetry.html#make-elements-by-point-symmetry"; + connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); } // ============================================================== Destructeur @@ -4289,48 +3949,46 @@ MakeSymmetryDialog::~MakeSymmetryDialog() // ============================================================== _initInputWidget void MakeSymmetryDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); - - vex_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb0->setValidator( validator ); - elts_le_rb0->setValidator( validator ); - vex_le_rb0->installEventFilter(this); - elts_le_rb0->installEventFilter(this); - - vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - elts_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb1->setValidator( validator ); - vec_le_rb1->setValidator( validator ); - elts_le_rb1->setValidator( validator ); - vex_le_rb1->installEventFilter(this); - vec_le_rb1->installEventFilter(this); - elts_le_rb1->installEventFilter(this); - - - vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - elts_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb2->setValidator( validator ); - vec_le_rb2->setValidator( validator ); - elts_le_rb2->setValidator( validator ); - vex_le_rb2->installEventFilter(this); - vec_le_rb2->installEventFilter(this); - elts_le_rb2->installEventFilter(this); - - vex_le_rb0->setReadOnly(true); - elts_le_rb0->setReadOnly(true); - vex_le_rb1->setReadOnly(true); - vec_le_rb1->setReadOnly(true); - elts_le_rb1->setReadOnly(true); - vex_le_rb2->setReadOnly(true); - vec_le_rb2->setReadOnly(true); - elts_le_rb2->setReadOnly(true); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); + + installEventFilter(this); + + vex_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb0->setValidator( validator ); + elts_le_rb0->setValidator( validator ); + vex_le_rb0->installEventFilter(this); + elts_le_rb0->installEventFilter(this); + + vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vec_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + elts_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb1->setValidator( validator ); + vec_le_rb1->setValidator( validator ); + elts_le_rb1->setValidator( validator ); + vex_le_rb1->installEventFilter(this); + vec_le_rb1->installEventFilter(this); + elts_le_rb1->installEventFilter(this); + + vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vec_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + elts_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb2->setValidator( validator ); + vec_le_rb2->setValidator( validator ); + elts_le_rb2->setValidator( validator ); + vex_le_rb2->installEventFilter(this); + vec_le_rb2->installEventFilter(this); + elts_le_rb2->installEventFilter(this); + + vex_le_rb0->setReadOnly(true); + elts_le_rb0->setReadOnly(true); + vex_le_rb1->setReadOnly(true); + vec_le_rb1->setReadOnly(true); + elts_le_rb1->setReadOnly(true); + vex_le_rb2->setReadOnly(true); + vec_le_rb2->setReadOnly(true); + elts_le_rb2->setReadOnly(true); } // ============================================================== clear @@ -4366,86 +4024,80 @@ void MakeSymmetryDialog::clear() // ============================================================== updateHelpFileName void MakeSymmetryDialog::updateHelpFileName() { - if ( sender() == rb0 ){ - _helpFileName = "gui_make_symmetry.html#make-elements-by-point-symmetry"; - } else if ( sender() == rb1 ){ - _helpFileName = "gui_make_symmetry.html#make-elements-by-line-symmetry"; - } else if ( sender() == rb2 ){ - _helpFileName = "gui_make_symmetry.html#make-elements-by-plane-symmetry"; - } + if ( sender() == rb0 ){ + _helpFileName = "gui_make_symmetry.html#make-elements-by-point-symmetry"; + } else if ( sender() == rb1 ){ + _helpFileName = "gui_make_symmetry.html#make-elements-by-line-symmetry"; + } else if ( sender() == rb2 ){ + _helpFileName = "gui_make_symmetry.html#make-elements-by-plane-symmetry"; + } } // ============================================================== apply bool MakeSymmetryDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - if (getDocumentModel() == NULL) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + if (getDocumentModel() == NULL) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; - SUIT_OverrideCursor wc; - QModelIndex iNewElts; + QModelIndex iNewElts; - if ( rb0->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb0] ); + if ( rb0->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb0] ); - if ( ielts.isValid() - && ivex.isValid() ) + if ( ielts.isValid() + && ivex.isValid() ) iNewElts = getDocumentModel()->makeSymmetryPoint( ielts, ivex ); - } else if ( rb1->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] ); + } else if ( rb1->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] ); - if ( ielts.isValid() - && ivex.isValid() - && ivec.isValid() ) + if ( ielts.isValid() + && ivex.isValid() + && ivec.isValid() ) iNewElts = getDocumentModel()->makeSymmetryLine( ielts, ivex, ivec ); - } else if ( rb2->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); + } else if ( rb2->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); - if ( ielts.isValid() - && ivex.isValid() - && ivec.isValid() ) + if ( ielts.isValid() + && ivex.isValid() + && ivec.isValid() ) iNewElts = getDocumentModel()->makeSymmetryPlane( ielts, ivex, ivec ); - } + } - if ( !iNewElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE TRANSFORMATION" ) ); - return false; - } + if ( !iNewElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE TRANSFORMATION" ) + "\n" + getErrorMsg() ); + return false; + } - result = patternBuilderModel->mapFromSource(iNewElts); + result = patternBuilderModel->mapFromSource(iNewElts); - return true; + return true; } // // ------------------------- PerformTransformationDialog ---------------------------------- // ============================================================== Constructeur - PerformTransformationDialog::PerformTransformationDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f) +HexaBaseDialog(parent, editmode, f) { - setupUi( this ); - _initWidget(editmode); - // rb0->setFocusProxy( elts_le_rb0 ); - // rb1->setFocusProxy( elts_le_rb1 ); - // rb2->setFocusProxy( elts_le_rb2 ); - // setFocusProxy( rb0 ); - rb0->click(); + setupUi( this ); + _initWidget(editmode); + rb0->click(); - _helpFileName = "gui_modify_elmts.html#modify-elements-by-translation"; - connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + _helpFileName = "gui_modify_elmts.html#modify-elements-by-translation"; + connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); } // ============================================================== Destructeur @@ -4456,41 +4108,41 @@ PerformTransformationDialog::~PerformTransformationDialog() // ============================================================== _initInputWidget void PerformTransformationDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); - vec_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vec_le_rb0->setValidator( validator ); - elts_le_rb0->setValidator( validator ); - vec_le_rb0->installEventFilter(this); - elts_le_rb0->installEventFilter(this); + vec_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vec_le_rb0->setValidator( validator ); + elts_le_rb0->setValidator( validator ); + vec_le_rb0->installEventFilter(this); + elts_le_rb0->installEventFilter(this); - vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - elts_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb1->setValidator( validator ); - elts_le_rb1->setValidator( validator ); - vex_le_rb1->installEventFilter(this); - elts_le_rb1->installEventFilter(this); + vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + elts_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb1->setValidator( validator ); + elts_le_rb1->setValidator( validator ); + vex_le_rb1->installEventFilter(this); + elts_le_rb1->installEventFilter(this); - vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - elts_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb2->setValidator( validator ); - vec_le_rb2->setValidator( validator ); - elts_le_rb2->setValidator( validator ); - vex_le_rb2->installEventFilter(this); - vec_le_rb2->installEventFilter(this); - elts_le_rb2->installEventFilter(this); + vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vec_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + elts_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb2->setValidator( validator ); + vec_le_rb2->setValidator( validator ); + elts_le_rb2->setValidator( validator ); + vex_le_rb2->installEventFilter(this); + vec_le_rb2->installEventFilter(this); + elts_le_rb2->installEventFilter(this); - vec_le_rb0->setReadOnly(true); - elts_le_rb0->setReadOnly(true); - vex_le_rb1->setReadOnly(true); - elts_le_rb1->setReadOnly(true); - vex_le_rb2->setReadOnly(true); - vec_le_rb2->setReadOnly(true); - elts_le_rb2->setReadOnly(true); + vec_le_rb0->setReadOnly(true); + elts_le_rb0->setReadOnly(true); + vex_le_rb1->setReadOnly(true); + elts_le_rb1->setReadOnly(true); + vex_le_rb2->setReadOnly(true); + vec_le_rb2->setReadOnly(true); + elts_le_rb2->setReadOnly(true); } @@ -4524,88 +4176,78 @@ void PerformTransformationDialog::clear() // ============================================================== updateHelpFileName void PerformTransformationDialog::updateHelpFileName() { - if ( sender() == rb0 ){ - _helpFileName = "gui_modify_elmts.html#modify-elements-by-translation"; - } else if ( sender() == rb1 ){ - _helpFileName = "gui_modify_elmts.html#modify-elements-by-scaling"; - } else if ( sender() == rb2 ){ - _helpFileName = "gui_modify_elmts.html#modify-elements-by-rotation"; - } + if ( sender() == rb0 ){ + _helpFileName = "gui_modify_elmts.html#modify-elements-by-translation"; + } else if ( sender() == rb1 ){ + _helpFileName = "gui_modify_elmts.html#modify-elements-by-scaling"; + } else if ( sender() == rb2 ){ + _helpFileName = "gui_modify_elmts.html#modify-elements-by-rotation"; + } } - // ============================================================== apply bool PerformTransformationDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if (getDocumentModel() == NULL) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + if (getDocumentModel() == NULL) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; - bool performed = false; + bool performed = false; - if ( rb0->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb0] ); + if ( rb0->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb0] ); - if ( ielts.isValid() - && ivec.isValid() ) + if ( ielts.isValid() + && ivec.isValid() ) performed = getDocumentModel()->performTranslation( ielts, ivec ); - } else if ( rb1->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); - double k = k_spb->value(); + } else if ( rb1->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); + double k = k_spb->value(); - if ( ielts.isValid() - && ivex.isValid() ) + if ( ielts.isValid() + && ivex.isValid() ) performed = getDocumentModel()->performScale( ielts, ivex, k ); - } else if ( rb2->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); - double angle = angle_spb->value(); + } else if ( rb2->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); + double angle = angle_spb->value(); - if ( ielts.isValid() - && ivex.isValid() - && ivec.isValid() ) + if ( ielts.isValid() + && ivex.isValid() + && ivec.isValid() ) performed = getDocumentModel()->performRotation( ielts, ivex, ivec, angle ); - } - - if ( performed == false){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT PERFORM TRANSFORMATION" ) ); - return false; - } + } + if ( performed == false){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT PERFORM TRANSFORMATION" ) + "\n" + getErrorMsg() ); + return false; + } - return true; + return true; } - // // ------------------------- PerformSymmetryDialog ---------------------------------- - // ============================================================== Constructeur - PerformSymmetryDialog::PerformSymmetryDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f) { - setupUi( this ); - _initWidget( editmode ); - // rb0->setFocusProxy( elts_le_rb0 ); - // rb1->setFocusProxy( elts_le_rb1 ); - // rb2->setFocusProxy( elts_le_rb2 ); - // setFocusProxy( rb0 ); - rb0->click(); + setupUi( this ); + _initWidget( editmode ); + rb0->click(); - _helpFileName = "gui_modify_symmetry.html#modify-elements-by-point-symmetry"; - connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + _helpFileName = "gui_modify_symmetry.html#modify-elements-by-point-symmetry"; + connect( rb0, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rb2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); } // ============================================================== Destructeur @@ -4616,273 +4258,255 @@ PerformSymmetryDialog::~PerformSymmetryDialog() // ============================================================== _initInputWidget void PerformSymmetryDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - - vex_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb0->setValidator( validator ); - elts_le_rb0->setValidator( validator ); - vex_le_rb0->installEventFilter(this); - elts_le_rb0->installEventFilter(this); - - vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - elts_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb1->setValidator( validator ); - vec_le_rb1->setValidator( validator ); - elts_le_rb1->setValidator( validator ); - vex_le_rb1->installEventFilter(this); - vec_le_rb1->installEventFilter(this); - elts_le_rb1->installEventFilter(this); - - - vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - vec_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - elts_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - vex_le_rb2->setValidator( validator ); - vec_le_rb2->setValidator( validator ); - elts_le_rb2->setValidator( validator ); - vex_le_rb2->installEventFilter(this); - vec_le_rb2->installEventFilter(this); - elts_le_rb2->installEventFilter(this); - - vex_le_rb0->setReadOnly(true); - elts_le_rb0->setReadOnly(true); - vex_le_rb1->setReadOnly(true); - vec_le_rb1->setReadOnly(true); - elts_le_rb1->setReadOnly(true); - vex_le_rb2->setReadOnly(true); - vec_le_rb2->setReadOnly(true); - elts_le_rb2->setReadOnly(true); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); + + vex_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + elts_le_rb0->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb0->setValidator( validator ); + elts_le_rb0->setValidator( validator ); + vex_le_rb0->installEventFilter(this); + elts_le_rb0->installEventFilter(this); + + vex_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vec_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + elts_le_rb1->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb1->setValidator( validator ); + vec_le_rb1->setValidator( validator ); + elts_le_rb1->setValidator( validator ); + vex_le_rb1->installEventFilter(this); + vec_le_rb1->installEventFilter(this); + elts_le_rb1->installEventFilter(this); + + vex_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vec_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + elts_le_rb2->setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); + vex_le_rb2->setValidator( validator ); + vec_le_rb2->setValidator( validator ); + elts_le_rb2->setValidator( validator ); + vex_le_rb2->installEventFilter(this); + vec_le_rb2->installEventFilter(this); + elts_le_rb2->installEventFilter(this); + + vex_le_rb0->setReadOnly(true); + elts_le_rb0->setReadOnly(true); + vex_le_rb1->setReadOnly(true); + vec_le_rb1->setReadOnly(true); + elts_le_rb1->setReadOnly(true); + vex_le_rb2->setReadOnly(true); + vec_le_rb2->setReadOnly(true); + elts_le_rb2->setReadOnly(true); } // ============================================================== clear void PerformSymmetryDialog::clear() { - vex_le_rb0->clear(); - modelUnregister(vex_le_rb0); + vex_le_rb0->clear(); + modelUnregister(vex_le_rb0); - elts_le_rb0->clear(); - modelUnregister(elts_le_rb0); + elts_le_rb0->clear(); + modelUnregister(elts_le_rb0); - elts_le_rb1->clear(); - modelUnregister(elts_le_rb1); + elts_le_rb1->clear(); + modelUnregister(elts_le_rb1); - vex_le_rb1->clear(); - modelUnregister(vex_le_rb1); + vex_le_rb1->clear(); + modelUnregister(vex_le_rb1); - vec_le_rb1->clear(); - modelUnregister(vec_le_rb1); + vec_le_rb1->clear(); + modelUnregister(vec_le_rb1); - elts_le_rb2->clear(); - modelUnregister(elts_le_rb2); + elts_le_rb2->clear(); + modelUnregister(elts_le_rb2); - vex_le_rb2->clear(); - modelUnregister(vex_le_rb2); + vex_le_rb2->clear(); + modelUnregister(vex_le_rb2); - vec_le_rb2->clear(); - modelUnregister(vec_le_rb2); + vec_le_rb2->clear(); + modelUnregister(vec_le_rb2); - modelUnregister(this); + modelUnregister(this); } // ============================================================== updateHelpFileName void PerformSymmetryDialog::updateHelpFileName() { - if ( sender() == rb0 ){ - _helpFileName = "gui_modify_symmetry.html#modify-elements-by-point-symmetry"; - } else if ( sender() == rb1 ){ - _helpFileName = "gui_modify_symmetry.html#modify-elements-by-line-symmetry"; - } else if ( sender() == rb2 ){ - _helpFileName = "gui_modify_symmetry.html#modify-elements-by-plane-symmetry"; - } + if ( sender() == rb0 ){ + _helpFileName = "gui_modify_symmetry.html#modify-elements-by-point-symmetry"; + } else if ( sender() == rb1 ){ + _helpFileName = "gui_modify_symmetry.html#modify-elements-by-line-symmetry"; + } else if ( sender() == rb2 ){ + _helpFileName = "gui_modify_symmetry.html#modify-elements-by-plane-symmetry"; + } } // ============================================================== apply bool PerformSymmetryDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if (getDocumentModel() == NULL) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; + if (getDocumentModel() == NULL) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; - bool performed = false; + bool performed = false; - if ( rb0->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb0] ); + if ( rb0->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb0] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb0] ); - if ( ielts.isValid() - && ivex.isValid() ) + if ( ielts.isValid() + && ivex.isValid() ) performed = getDocumentModel()->performSymmetryPoint( ielts, ivex ); - } else if ( rb1->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] ); + } else if ( rb1->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb1] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb1] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb1] ); - if ( ielts.isValid() - && ivex.isValid() - && ivec.isValid() ) + if ( ielts.isValid() + && ivex.isValid() + && ivec.isValid() ) performed = getDocumentModel()->performSymmetryLine( ielts, ivex, ivec ); - } else if ( rb2->isChecked() ){ - QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] ); - QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] ); - QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); + } else if ( rb2->isChecked() ){ + QModelIndex ielts = patternBuilderModel->mapToSource( _index[elts_le_rb2] ); + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le_rb2] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le_rb2] ); - if ( ielts.isValid() - && ivex.isValid() - && ivec.isValid() ) + if ( ielts.isValid() + && ivex.isValid() + && ivec.isValid() ) performed = getDocumentModel()->performSymmetryPlane( ielts, ivex, ivec ); - } + } - if ( performed == false ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT PERFORM SYMMETRY" ) ); - return false; - } + if ( performed == false ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT PERFORM SYMMETRY" ) + "\n" + getErrorMsg() ); + return false; + } - return true; + return true; } - - // // ------------------------- EdgeAssocDialog ---------------------------------- - // ============================================================== Constructeur - EdgeAssocDialog::EdgeAssocDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog( parent, editmode, f ) +HexaBaseDialog( parent, editmode, f ) { - _helpFileName ="gui_asso_quad_to_geom.html#one-edge"; - setupUi( this ); - _initWidget(editmode); - _initViewManager(); - // setFocusProxy( edges_lw ); - - myLine = NULL; - - _currentParameter = 0.; - single_rb->click(); + _helpFileName ="gui_asso_quad_to_geom.html#one-edge"; + setupUi( this ); + _initWidget(editmode); + myLine = NULL; + single_rb->click(); } // ============================================================== Destructeur EdgeAssocDialog::~EdgeAssocDialog() { - // disconnect( delEdgeShortcut, SIGNAL(activated()), this, SLOT(deleteEdgeItem()) ); - // disconnect( delLineShortcut, SIGNAL(activated()), this, SLOT(deleteLineItem()) ); - disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(addLine()) ); - disconnect( pstart_spb, SIGNAL(valueChanged(double)), this, SLOT( pstartChanged(double)) ); - disconnect( pend_spb, SIGNAL(valueChanged(double)), this, SLOT( pendChanged(double)) ); } // ============================================================== close void EdgeAssocDialog::close() { - HEXABLOCKGUI::assocInProgress = false; - HexaBaseDialog::close(); + HEXABLOCKGUI::assocInProgress = false; + HexaBaseDialog::close(); } // ============================================================== _initInputWidget void EdgeAssocDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); - //model - first_vex_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - first_vex_le->installEventFilter(this); - first_vex_le->setValidator( validator ); + //model + first_vex_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + first_vex_le->installEventFilter(this); + first_vex_le->setValidator( validator ); - single_edge_le->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - single_edge_le->installEventFilter(this); + single_edge_le->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + single_edge_le->installEventFilter(this); - edges_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); - edges_lw->installEventFilter(this); + edges_lw->setProperty( "HexaWidgetType", QVariant::fromValue(EDGE_TREE) ); + edges_lw->installEventFilter(this); - //geom - lines_lw->setProperty("HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) ); - lines_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); - lines_lw->installEventFilter(this); + //geom + lines_lw->setProperty("HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) ); + lines_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + lines_lw->installEventFilter(this); - single_line_le->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) ); - single_line_le->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); - single_line_le->installEventFilter(this); + single_line_le->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) ); + single_line_le->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + single_line_le->installEventFilter(this); - QShortcut* delEdgeShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X), edges_lw); - QShortcut* delLineShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X), lines_lw); - delLineShortcut->setContext( Qt::WidgetWithChildrenShortcut ); - delEdgeShortcut->setContext( Qt::WidgetWithChildrenShortcut ); + QShortcut* delEdgeShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X), edges_lw); + QShortcut* delLineShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X), lines_lw); + delLineShortcut->setContext( Qt::WidgetWithChildrenShortcut ); + delEdgeShortcut->setContext( Qt::WidgetWithChildrenShortcut ); - pend_spb->setValue(1.); + pend_spb->setValue(1.); - first_vex_le->setReadOnly(true); - single_edge_le->setReadOnly(true); - single_line_le->setReadOnly(true); + first_vex_le->setReadOnly(true); + single_edge_le->setReadOnly(true); + single_line_le->setReadOnly(true); - connect( delEdgeShortcut, SIGNAL(activated()), this, SLOT(deleteEdgeItem()) ); - connect( delLineShortcut, SIGNAL(activated()), this, SLOT(deleteLineItem()) ); - connect( pstart_spb, SIGNAL(valueChanged(double)), this, SLOT( pstartChanged(double)) ); - connect( pend_spb, SIGNAL(valueChanged(double)), this, SLOT( pendChanged(double)) ); - connect( edges_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); - connect( lines_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfGeom()), Qt::UniqueConnection ); - connect( single_rb, SIGNAL(clicked()), this, SLOT( refreshHighlight()), Qt::UniqueConnection ); - connect( multiple_rb, SIGNAL(clicked()), this, SLOT(refreshHighlight()), Qt::UniqueConnection ); - connect( single_rb, SIGNAL(clicked()), this, SLOT( updateHelpFileName() ) ); - connect( multiple_rb, SIGNAL(clicked()), this, SLOT( updateHelpFileName() ) ); + connect( delEdgeShortcut, SIGNAL(activated()), this, SLOT(deleteEdgeItem()) ); + connect( delLineShortcut, SIGNAL(activated()), this, SLOT(deleteLineItem()) ); + connect( edges_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); + connect( lines_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfGeom()), Qt::UniqueConnection ); + connect( single_rb, SIGNAL(clicked()), this, SLOT( refreshHighlight()), Qt::UniqueConnection ); + connect( multiple_rb, SIGNAL(clicked()), this, SLOT(refreshHighlight()), Qt::UniqueConnection ); + connect( single_rb, SIGNAL(clicked()), this, SLOT( updateHelpFileName() ) ); + connect( multiple_rb, SIGNAL(clicked()), this, SLOT( updateHelpFileName() ) ); } // ============================================================== updateHelpFileName void EdgeAssocDialog::updateHelpFileName() { - if ( sender() == single_rb ){ - _helpFileName = "gui_asso_quad_to_geom.html#one-edge"; - } else if ( sender() == multiple_rb ){ - _helpFileName = "gui_asso_quad_to_geom.html#line"; - } + if ( sender() == single_rb ){ + _helpFileName = "gui_asso_quad_to_geom.html#one-edge"; + } else if ( sender() == multiple_rb ){ + _helpFileName = "gui_asso_quad_to_geom.html#line"; + } } - // ============================================================== getAssocsVTK /* * Returns elements currently being associated in vtk side */ QModelIndexList EdgeAssocDialog::getAssocsVTK() { - QModelIndexList assocs; - QModelIndex iEdge; - QListWidgetItem* item = NULL; - - if (getPatternDataSelectionModel() == NULL) return assocs; - if (single_rb->isChecked()) - { - //LineEdit content - QVariant v = single_edge_le->property("QModelIndex"); - if ( !v.isValid() ) return assocs; - assocs << v.value(); - return assocs; - } - else if (multiple_rb->isChecked()) - { - //ListWidget content - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return assocs; - for ( int r = 0; r < edges_lw->count(); ++r){ - item = edges_lw->item(r); - iEdge = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iEdge.isValid() ) assocs << iEdge; - } - return assocs; - } - else return assocs; + QModelIndexList assocs; + QModelIndex iEdge; + QListWidgetItem* item = NULL; + + if (getPatternDataSelectionModel() == NULL) return assocs; + if (single_rb->isChecked()) + { + //LineEdit content + QVariant v = single_edge_le->property("QModelIndex"); + if ( !v.isValid() ) return assocs; + assocs << v.value(); + return assocs; + } + else if (multiple_rb->isChecked()) + { + //ListWidget content + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return assocs; + int nbEdges = edges_lw->count(); + for ( int r = 0; r < nbEdges; ++r){ + item = edges_lw->item(r); + iEdge = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iEdge.isValid() ) assocs << iEdge; + } + return assocs; + } + else return assocs; } // ============================================================== getAssocsGEOM @@ -4891,118 +4515,88 @@ QModelIndexList EdgeAssocDialog::getAssocsVTK() */ QMultiMap EdgeAssocDialog::getAssocsGEOM() { - QMultiMap assocs; - QListWidgetItem* item = NULL; - DocumentModel::GeomObj geomObj; - - if (single_rb->isChecked()) - { - //LineEdit content - QVariant v = single_line_le->property("GeomObj"); - if ( !v.isValid() ) return assocs; - geomObj = v.value(); - assocs.insert( geomObj.shapeName, geomObj.subid.toInt() ); - return assocs; - } - else if (multiple_rb->isChecked()) - { - //ListWidget content - unsigned int nbEdges = lines_lw->count(); - for ( int r = 0; r < nbEdges; ++r){ - item = lines_lw->item(r); - geomObj = item->data(LW_ASSOC_ROLE).value(); - assocs.insert( geomObj.shapeName, geomObj.subid.toInt() ); - } - return assocs; - } - else return assocs; + QMultiMap assocs; + QListWidgetItem* item = NULL; + DocumentModel::GeomObj geomObj; + + if (single_rb->isChecked()) + { + //LineEdit content + QVariant v = single_line_le->property("GeomObj"); + if ( !v.isValid() ) return assocs; + geomObj = v.value(); + assocs.insert( geomObj.shapeName, geomObj.subId.toInt() ); + return assocs; + } + else if (multiple_rb->isChecked()) + { + //ListWidget content + unsigned int nbEdges = lines_lw->count(); + for ( int r = 0; r < nbEdges; ++r){ + item = lines_lw->item(r); + geomObj = item->data(LW_ASSOC_ROLE).value(); + assocs.insert( geomObj.shapeName, geomObj.subId.toInt() ); + } + return assocs; + } + else return assocs; } // ============================================================== selectElementOfGeom - /*Highlight in the OCC view selected elements in a listwidget, * or an element in a line edit.*/ - void EdgeAssocDialog::selectElementOfGeom() { - QListWidget* currentListWidget = dynamic_cast( sender() ); - if ( !currentListWidget ) return; - - _selectionMutex = true; - - QMultiMap geomElts; - DocumentModel::GeomObj geomObj; - QList sel = currentListWidget->selectedItems(); - foreach ( QListWidgetItem *item, sel ){ - geomObj = item->data(LW_ASSOC_ROLE).value(); - geomElts.insert( geomObj.shapeName, geomObj.subid.toInt() ); - } - _selectionMutex = false; + QListWidget* currentListWidget = dynamic_cast( sender() ); + if ( !currentListWidget ) + return; - //highlight geom selected elts - if (geomElts.size() > 0 && getPatternDataSelectionModel() != NULL) - HEXABLOCKGUI::currentOccGView->highlight(geomElts); + QModelIndex index; + QList sel = currentListWidget->selectedItems(); + PatternGeomSelectionModel* pgsm = getPatternGeomSelectionModel(); + pgsm->clearSelection(); + if (sel.count() == 0) + return; + QListWidgetItem *item = sel[0]; +// index = item->data(LW_QMODELINDEX_ROLE).value(); //unsafe: index can change in the tree + index = pgsm->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); + if ( index.isValid() ) + pgsm->select( index, QItemSelectionModel::SelectCurrent ); } // ============================================================== clear void EdgeAssocDialog::clear() { - first_vex_le->clear(); - modelUnregister(first_vex_le); - - edges_lw->clear(); - modelUnregister(edges_lw); + first_vex_le->clear(); + modelUnregister(first_vex_le); - lines_lw->clear(); + edges_lw->clear(); + modelUnregister(edges_lw); - single_edge_le->clear(); - modelUnregister(single_edge_le); - - single_line_le->clear(); - QVariant invalid; - single_line_le->setProperty("GeomObj", invalid); - - modelUnregister(this); - -// single_edge_le->setText(""); -// single_line_le->setText(""); -} - -// ============================================================== deleteEdgeItem -void EdgeAssocDialog::deleteEdgeItem() -{ - delete edges_lw->currentItem(); -} + lines_lw->clear(); -// ============================================================== deleteLineItem -void EdgeAssocDialog::deleteLineItem() -{ - delete lines_lw->currentItem(); -} + single_edge_le->clear(); + modelUnregister(single_edge_le); + single_line_le->clear(); + modelUnregister(single_line_le); -// ============================================================== setGeomEngine -void EdgeAssocDialog::setGeomEngine( GEOM::GEOM_Gen_var geomEngine ) -{ - _geomEngine = geomEngine; + modelUnregister(this); } // ============================================================== onWindowActivated void EdgeAssocDialog::onWindowActivated(SUIT_ViewManager* vm) { QString vmType = vm->getType(); - if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ){ - + if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ) + { if (single_rb->isChecked()) single_edge_le->setFocus(); else if (multiple_rb->isChecked() && focusWidget() != first_vex_le ) - edges_lw->setFocus(); + edges_lw->setFocus(); } else if ( vmType == OCCViewer_Viewer::Type() ){ - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), TopAbs_EDGE); - if (single_rb->isChecked()) single_line_le->setFocus(); else if (multiple_rb->isChecked() && focusWidget() != first_vex_le) @@ -5010,258 +4604,159 @@ void EdgeAssocDialog::onWindowActivated(SUIT_ViewManager* vm) } } -// ============================================================== createOperation -GEOM::GEOM_IOperations_ptr EdgeAssocDialog::createOperation() -{ - return _geomEngine->GetIBasicOperations(getStudyId()); -} - -// ============================================================== execute -bool EdgeAssocDialog::execute(ObjectList& objects) -{ - bool res = false; - - GEOM::GEOM_Object_var anObj; - QStringList aParameters; - - GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() ); - anObj = anOper->MakePointOnCurve( _currentLine.get(), _currentParameter ); - if ( !anObj->_is_nil() ) { - objects.push_back(anObj._retn()); - res = true; - } - return res; -} - -// ============================================================== pstartChanged -void EdgeAssocDialog::pstartChanged( double val ) -{ - QListWidgetItem* lineItem = lines_lw->item( 0 ); - if (!lineItem) return; - _currentLine = lineItem->data(LW_GEOM_OBJ_ROLE).value(); - _currentParameter = pstart_spb->value(); -} - -// ============================================================== pendChanged -void EdgeAssocDialog::pendChanged( double val ) -{ - // if ( _lastLine->_is_nil() ) return; - QListWidgetItem* lineItem = lines_lw->item( lines_lw->count()-1 ); - if (!lineItem) return; - _currentLine = lineItem->data(LW_GEOM_OBJ_ROLE).value(); - _currentParameter = pend_spb->value(); -// displayPreview(true); -} - -// ============================================================== onCurrentSelectionChanged -void EdgeAssocDialog::onCurrentSelectionChanged() -{ - if ( !isVisible()) - { - highlightSelectedAssocs(); - return; - } - - SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); - - bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type()); - if (!isOCC || !getDocumentModel()) - { - highlightSelectedAssocs(); - return; - } - - GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_EDGE); - DocumentModel::GeomObj* selectedLine = getDocumentModel()->convertToGeomObj(aSelectedObject); - if ( selectedLine == NULL ) - { - highlightSelectedAssocs(); - return; - } - myLine = selectedLine; - - //don't allow selection on a geometry not associated to the document - QString mainShapeEntry; - if ( aSelectedObject->IsMainShape() ){ - mainShapeEntry = aSelectedObject->GetStudyEntry(); - } else { - GEOM::GEOM_Object_var mainShape = aSelectedObject->GetMainShape(); - mainShapeEntry = mainShape->GetStudyEntry(); - } - if (getDocumentModel()->getGeomObjName(mainShapeEntry).isEmpty()) - { - //unknown geometry - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), HexaBaseDialog::tr( "UNKNOWN_GEOMETRY" ) ); - return; - } - - if (single_rb->isChecked()) { - single_line_le->setText(myLine->name); - single_line_le->setProperty("GeomObj", QVariant::fromValue(*myLine)); - setFocusToNextField(); - } - else if( multiple_rb->isChecked() ) { - QList twice = lines_lw->findItems( myLine->name, Qt::MatchExactly); - if ( twice.count() == 0 ){ - QListWidgetItem* item = new QListWidgetItem( myLine->name ); - item->setData( LW_ASSOC_ROLE, QVariant::fromValue(*myLine) ); - item->setData( LW_GEOM_OBJ_ROLE, QVariant::fromValue(aSelectedObject) ); - lines_lw->addItem(item); - } - } - highlightSelectedAssocs(); -} - // ============================================================== apply bool EdgeAssocDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - bool assocOk = false; + bool assocOk = false; - highlightSelectedAssocs(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternDataSelectionModel* pdsm = getPatternDataSelectionModel(); + PatternGeomSelectionModel* pgsm = getPatternGeomSelectionModel(); - PatternDataModel* patternDataModel = getPatternDataModel(); - PatternGeomModel* pgm = getPatternGeomModel(); - PatternGeomSelectionModel* pgsm = getPatternGeomSelectionModel(); + QModelIndex iEdge, iGeomEdge; + QModelIndexList iEdges; + QListWidgetItem* item = NULL; + QList assocs; + DocumentModel::GeomObj aLine; + HEXA_NS::SubShape* ssh; + HEXA_NS::EdgeShape* sh; + HEXA_NS::NewShapes shapes; + HEXA_NS::IntVector subIds; + QString id; + QModelIndexList edges, lines; - QModelIndex iEdge, iGeomEdge; - QModelIndexList iEdges; - QListWidgetItem* item = NULL; - QList assocs; - DocumentModel::GeomObj aLine; - HEXA_NS::SubShape* ssh; - HEXA_NS::EdgeShape* sh; - HEXA_NS::NewShapes shapes; - HEXA_NS::IntVector subIds; - QString id; + if (single_rb->isChecked()){ //Single edge and/or line association - if (single_rb->isChecked()){ //Single edge and/or line association + iEdge = patternDataModel->mapToSource( _index[single_edge_le] ); + if ( !iEdge.isValid() || myLine == NULL) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); + return false; + } + id = myLine->shapeName+","+myLine->subId; + ssh = getDocumentModel()->getGeomPtr(id); + sh = dynamic_cast(ssh); + iGeomEdge = pgsm->indexBy(HEXA_DATA_ROLE, QVariant::fromValue(sh)); + if (!iGeomEdge.isValid()) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); + return false; + } + assocOk = getDocumentModel()->addEdgeAssociation(iEdge, iGeomEdge, pstart_spb->value(), pend_spb->value()); + edges << _index[single_edge_le]; + lines << iGeomEdge; + } + else { //Multiple edge and/or line association - iEdge = patternDataModel->mapToSource( _index[single_edge_le] ); - if ( !iEdge.isValid() || myLine == NULL) + // edges + iEdges = getIndexList(edges_lw, true); + int nbLines = lines_lw->count(); + if (iEdges.count() == 0 || nbLines == 0) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); + return false; + } + edges = getIndexList(edges_lw, false); + // lines + for (int r = 0; r < nbLines; ++r){ + item = lines_lw->item(r); + aLine = item->data(LW_ASSOC_ROLE).value(); + id = aLine.shapeName+","+aLine.subId; + ssh = getDocumentModel()->getGeomPtr(id); + sh = dynamic_cast(ssh); + if (sh == NULL) { - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); - highlightSelectedAssocs(); - return false; + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); + return false; } - id = myLine->shapeName+","+myLine->subid; - MESSAGE("=====> Association with geom id: " << id.toStdString()); - ssh = getDocumentModel()->getGeomPtr(id); - sh = dynamic_cast(ssh); - iGeomEdge = sh == NULL ? QModelIndex() : pgm->mapToSource(pgsm->indexBy(HEXA_DATA_ROLE, QVariant::fromValue(sh))); - if (!iGeomEdge.isValid()) - { - MESSAGE("iGeomEdge IS NOT VALID: ID = " << id.toStdString()); - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); - highlightSelectedAssocs(); - return false; - } - assocOk = getDocumentModel()->addEdgeAssociation(iEdge, iGeomEdge, pstart_spb->value(), pend_spb->value()); - } - else { //Multiple edge and/or line association - - // edges - iEdges = getIndexList(edges_lw); - if (iEdges.count() == 0 || lines_lw->count() == 0) + shapes.push_back(sh->getParentShape()); + subIds.push_back(sh->getIdent()); + iGeomEdge = pgsm->indexBy(HEXA_DATA_ROLE, QVariant::fromValue(sh)); + if (iGeomEdge.isValid()) + lines << iGeomEdge; + } + + if ( close_cb->isChecked() ){ //closed line + QModelIndex iFirstVertex = patternDataModel->mapToSource( _index[first_vex_le] ); + if ( !iFirstVertex.isValid() ) { - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); - highlightSelectedAssocs(); - return false; + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); + return false; } + bool inv = inverse_cb->isChecked(); + assocOk = getDocumentModel()->associateClosedLine( iFirstVertex, iEdges, shapes, subIds, pstart_spb->value(), inv ); - // lines - for (int r = 0; r < lines_lw->count(); ++r){ - item = lines_lw->item(r); - aLine = item->data(LW_ASSOC_ROLE).value(); - id = aLine.shapeName+","+aLine.subid; - ssh = getDocumentModel()->getGeomPtr(id); - sh = dynamic_cast(ssh); - if (sh == NULL) - { - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); - highlightSelectedAssocs(); - return false; - } - shapes.push_back(sh->getParentShape()); - subIds.push_back(sh->getIdent()); - } - - if ( close_cb->isChecked() ){ //closed line - QModelIndex iFirstVertex = patternDataModel->mapToSource( _index[first_vex_le] ); - if ( !iFirstVertex.isValid() ) - { - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); - highlightSelectedAssocs(); - return false; - } - bool inv = inverse_cb->isChecked(); - assocOk = getDocumentModel()->associateClosedLine( iFirstVertex, iEdges, shapes, subIds, pstart_spb->value(), inv ); - } else + } else //opened line assocOk = getDocumentModel()->associateOpenedLine( iEdges, shapes, subIds, pstart_spb->value(), pend_spb->value() ); - } + } + + if ( !assocOk ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) + "\n" + getErrorMsg() ); + return false; + } - if ( !assocOk ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE EDGE ASSOCIATION" ) ); - highlightSelectedAssocs(); - return false; - } + // highlight associated items in the trees + pdsm->unhighlightTreeItems(); + pgsm->unhighlightTreeItems(); + pdsm->highlightTreeItems(edges); + pgsm->highlightTreeItems(lines); - highlightSelectedAssocs(); - return true; + // highlight associated items in the views + highlightSelectedAssocs(); + + return true; } // ------------------------- QuadAssocDialog ---------------------------------- // ============================================================== Constructeur QuadAssocDialog::QuadAssocDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f) +HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_asso_quad_to_geom.html#associate-to-a-face-or-a-shell-of-the-geometry"; - setupUi( this ); - _initWidget(editmode); - _initViewManager(); - // setFocusProxy( quad_le ); + _helpFileName = "gui_asso_quad_to_geom.html#associate-to-a-face-or-a-shell-of-the-geometry"; + setupUi( this ); + _initWidget(editmode); } // ============================================================== Destructeur QuadAssocDialog::~QuadAssocDialog() { - disconnect( _delFaceShortcut, SIGNAL(activated()), this, SLOT(deleteFaceItem()) ); - disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(addFace()) ); - delete _delFaceShortcut; + disconnect( _delFaceShortcut, SIGNAL(activated()), this, SLOT(deleteFaceItem()) ); + disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), this, SLOT(addFace()) ); + delete _delFaceShortcut; } // ============================================================== close void QuadAssocDialog::close() { - HEXABLOCKGUI::assocInProgress = false; - HexaBaseDialog::close(); + HEXABLOCKGUI::assocInProgress = false; + HexaBaseDialog::close(); } // ============================================================== _initInputWidget void QuadAssocDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); - quad_le->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - quad_le->installEventFilter(this); - quad_le->setValidator( validator ); + quad_le->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + quad_le->installEventFilter(this); + quad_le->setValidator( validator ); - faces_lw->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMFACE_TREE) ); - faces_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_FACE) ); - faces_lw->installEventFilter(this); - _delFaceShortcut = new QShortcut( QKeySequence(Qt::Key_X/*Qt::Key_Delete*/), faces_lw ); - _delFaceShortcut->setContext( Qt::WidgetShortcut ); + faces_lw->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMFACE_TREE) ); + faces_lw->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_FACE) ); + faces_lw->installEventFilter(this); + _delFaceShortcut = new QShortcut( QKeySequence(Qt::Key_X/*Qt::Key_Delete*/), faces_lw ); + _delFaceShortcut->setContext( Qt::WidgetShortcut ); - quad_le->setReadOnly(true); + quad_le->setReadOnly(true); - connect( _delFaceShortcut, SIGNAL(activated()), this, SLOT(deleteFaceItem()) ); - connect( faces_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfGeom()), Qt::UniqueConnection ); + connect( _delFaceShortcut, SIGNAL(activated()), this, SLOT(deleteFaceItem()) ); + connect( faces_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfGeom()), Qt::UniqueConnection ); } // ============================================================== getAssocsVTK @@ -5270,15 +4765,15 @@ void QuadAssocDialog::_initInputWidget( Mode editmode ) */ QModelIndexList QuadAssocDialog::getAssocsVTK() { - QModelIndexList assocs; - QModelIndex iQuad; + QModelIndexList assocs; + QModelIndex iQuad; - //LineEdit content - QVariant v = quad_le->property("QModelIndex"); - if ( !v.isValid() ) - return assocs; - assocs << v.value(); - return assocs; + //LineEdit content + QVariant v = quad_le->property("QModelIndex"); + if ( !v.isValid() ) + return assocs; + assocs << v.value(); + return assocs; } // ============================================================== getAssocsGEOM @@ -5287,18 +4782,18 @@ QModelIndexList QuadAssocDialog::getAssocsVTK() */ QMultiMap QuadAssocDialog::getAssocsGEOM() { - QMultiMap assocs; - QListWidgetItem* item = NULL; - DocumentModel::GeomObj geomObj; + QMultiMap assocs; + QListWidgetItem* item = NULL; + DocumentModel::GeomObj geomObj; - //ListWidget content - unsigned int nbFaces = faces_lw->count(); - for ( int r = 0; r < nbFaces; ++r){ - item = faces_lw->item(r); - geomObj = item->data(LW_ASSOC_ROLE).value(); - assocs.insert( geomObj.shapeName, geomObj.subid.toInt() ); - } - return assocs; + //ListWidget content + unsigned int nbFaces = faces_lw->count(); + for ( int r = 0; r < nbFaces; ++r){ + item = faces_lw->item(r); + geomObj = item->data(LW_ASSOC_ROLE).value(); + assocs.insert( geomObj.shapeName, geomObj.subId.toInt() ); + } + return assocs; } // ============================================================== selectElementOfGeom @@ -5307,178 +4802,127 @@ QMultiMap QuadAssocDialog::getAssocsGEOM() void QuadAssocDialog::selectElementOfGeom() { - QListWidget* currentListWidget = dynamic_cast( sender() ); - if ( !currentListWidget ) return; - - _selectionMutex = true; - - QMultiMap geomElts; - DocumentModel::GeomObj geomObj; - QList sel = currentListWidget->selectedItems(); - foreach ( QListWidgetItem *item, sel ){ - geomObj = item->data(LW_ASSOC_ROLE).value(); - geomElts.insert( geomObj.shapeName, geomObj.subid.toInt() ); - } - _selectionMutex = false; - - //highlight geom selected elts - if (geomElts.size() > 0 && getPatternDataSelectionModel() != NULL) - HEXABLOCKGUI::currentOccGView->highlight(geomElts); + QListWidget* currentListWidget = dynamic_cast( sender() ); + if ( !currentListWidget ) + return; + QModelIndex index; + QList sel = currentListWidget->selectedItems(); + PatternGeomSelectionModel* pgsm = getPatternGeomSelectionModel(); + pgsm->clearSelection(); + if (sel.count() == 0) + return; + QListWidgetItem *item = sel[0]; +// index = item->data(LW_QMODELINDEX_ROLE).value(); + index = pgsm->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); + if ( index.isValid() ) + pgsm->select( index, QItemSelectionModel::SelectCurrent ); } void QuadAssocDialog::clear() { - quad_le->clear(); - modelUnregister(quad_le); - - faces_lw->clear(); - - modelUnregister(this); -} - -// ============================================================== onCurrentSelectionChanged -void QuadAssocDialog::onCurrentSelectionChanged() -{ - - if ( !isVisible() ) - { - highlightSelectedAssocs(); - return; - } - - SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); - - bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type()); - // bool isVTK = (window && window->getViewManager()->getType() == SVTK_Viewer::Type()); - if (!isOCC || !getDocumentModel()) - { - highlightSelectedAssocs(); - return; - } - - GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_FACE); - DocumentModel::GeomObj* aFace = getDocumentModel()->convertToGeomObj(aSelectedObject); - if (aFace == NULL) - { - highlightSelectedAssocs(); - return; - } - - //don't allow selection on a geometry not associated to the document - QString mainShapeEntry; - if ( aSelectedObject->IsMainShape() ){ - mainShapeEntry = aSelectedObject->GetStudyEntry(); - } else { - GEOM::GEOM_Object_var mainShape = aSelectedObject->GetMainShape(); - mainShapeEntry = mainShape->GetStudyEntry(); - } - if (getDocumentModel()->getGeomObjName(mainShapeEntry).isEmpty()) - { - //unknown geometry - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), HexaBaseDialog::tr( "UNKNOWN_GEOMETRY" ) ); - return; - } + quad_le->clear(); + modelUnregister(quad_le); - QList twice = faces_lw->findItems( aFace->name, Qt::MatchExactly); - if ( twice.count() == 0 ){ - QListWidgetItem* item = new QListWidgetItem( aFace->name ); - item->setData( LW_ASSOC_ROLE, QVariant::fromValue(*aFace) ); - faces_lw->addItem(item); - // faces_lw->setCurrentRow( faces_lw->count() - 1 ); - } + faces_lw->clear(); - highlightSelectedAssocs(); + modelUnregister(this); } // ============================================================== onWindowActivated void QuadAssocDialog::onWindowActivated(SUIT_ViewManager* vm) { - QString vmType = vm->getType(); - if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ) - quad_le->setFocus(); - else if ( vmType == OCCViewer_Viewer::Type() ){ - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any -// localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE); - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), TopAbs_FACE); - faces_lw->setFocus(); - } + QString vmType = vm->getType(); + if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ) + quad_le->setFocus(); + else if ( vmType == OCCViewer_Viewer::Type() ){ + faces_lw->setFocus(); + } } // ============================================================== deleteFaceItem void QuadAssocDialog::deleteFaceItem() { - delete faces_lw->currentItem(); + delete faces_lw->currentItem(); } - // ============================================================== apply bool QuadAssocDialog::apply(QModelIndex& result) { - highlightSelectedAssocs(); - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - PatternDataModel* patternDataModel = getPatternDataModel(); - PatternGeomModel* pgm = getPatternGeomModel(); - PatternGeomSelectionModel* pgsm = getPatternGeomSelectionModel(); - - - QModelIndex iQuad, iGeomFace; - HEXA_NS::SubShape* ssh; - HEXA_NS::FaceShape* sh; - QString id; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternDataSelectionModel* pdsm = getPatternDataSelectionModel(); + PatternGeomSelectionModel* pgsm = getPatternGeomSelectionModel(); + + + QModelIndex iQuad, iGeomFace; + HEXA_NS::SubShape* ssh; + HEXA_NS::FaceShape* sh; + QString id; + + // quad + iQuad = patternDataModel->mapToSource( _index[quad_le] ); + + // faces + QListWidgetItem* item = NULL; + DocumentModel::GeomObj aFace; + QModelIndexList quads, faces; + int nbFaces = faces_lw->count(); + for ( int r = 0; r < nbFaces; ++r ){ + item = faces_lw->item(r); + aFace = item->data(LW_ASSOC_ROLE).value(); + id = aFace.shapeName+","+aFace.subId; + ssh = getDocumentModel()->getGeomPtr(id); + sh = dynamic_cast(ssh); + if (sh == NULL) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE QUAD ASSOCIATION" ) ); + return false; + } + iGeomFace = pgsm->indexBy(HEXA_DATA_ROLE, QVariant::fromValue(sh)); + if (!getDocumentModel()->addQuadAssociation(iQuad, iGeomFace)) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE QUAD ASSOCIATION" ) + "\n" + getErrorMsg() ); + return false; + } + else if (iGeomFace.isValid()) + faces << iGeomFace; + } + result = iQuad; - // quad - iQuad = patternDataModel->mapToSource( _index[quad_le] ); + if (iQuad.isValid()) + quads << _index[quad_le]; - // faces - QListWidgetItem* item = NULL; - DocumentModel::GeomObj aFace; - for ( int r = 0; r < faces_lw->count(); ++r ){ - item = faces_lw->item(r); - aFace = item->data(LW_ASSOC_ROLE).value(); - id = aFace.shapeName+","+aFace.subid; - ssh = getDocumentModel()->getGeomPtr(id); - sh = dynamic_cast(ssh); - iGeomFace = sh == NULL ? QModelIndex() : pgm->mapToSource(pgsm->indexBy(HEXA_DATA_ROLE, QVariant::fromValue(sh))); - if (!getDocumentModel()->addQuadAssociation(iQuad, iGeomFace)) - { - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE QUAD ASSOCIATION" ) ); - highlightSelectedAssocs(); - return false; - } - } + // highlight associated items in the trees + pdsm->highlightTreeItems(quads); + pgsm->highlightTreeItems(faces); - result = patternDataModel->mapFromSource(iQuad); + // highlight associated items in the views + highlightSelectedAssocs(); - highlightSelectedAssocs(); - return true; + return true; } - - // ------------------------- GroupDialog ---------------------------------- - // ============================================================== Constructeur - GroupDialog::GroupDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f), - _value(NULL) +HexaBaseDialog(parent, editmode, f), +_value(NULL) { - _helpFileName = "gui_groups.html#add-group"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( name_le/*eltBase_lw */); - - if ( editmode == NEW_MODE ){ - setWindowTitle( tr("Group Construction") ); - } else if ( editmode == UPDATE_MODE ){ - setWindowTitle( tr("Group Modification") ); - } else if ( editmode == INFO_MODE ){ - setWindowTitle( tr("Group Information") ); - } + _helpFileName = "gui_groups.html#add-group"; + setupUi( this ); + _initWidget(editmode); + // setFocusProxy( name_le/*eltBase_lw */); + + if ( editmode == NEW_MODE ){ + setWindowTitle( tr("Group Construction") ); + } else if ( editmode == UPDATE_MODE ){ + setWindowTitle( tr("Group Modification") ); + } else if ( editmode == INFO_MODE ){ + setWindowTitle( tr("Group Information") ); + } } // ============================================================== Destructeur @@ -5492,255 +4936,243 @@ GroupDialog::~GroupDialog() */ QModelIndexList GroupDialog::getAssocsVTK() { - QModelIndexList assocs; - QModelIndex iItem; - QListWidgetItem* item = NULL; - if (getPatternDataSelectionModel() == NULL) return assocs; - //ListWidget content - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return assocs; - for ( int r = 0; r < eltBase_lw->count(); ++r){ - item = eltBase_lw->item(r); - iItem = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iItem.isValid() ) assocs << iItem; - } - return assocs; + QModelIndexList assocs; + QModelIndex iItem; + QListWidgetItem* item = NULL; + if (getPatternDataSelectionModel() == NULL) return assocs; + //ListWidget content + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return assocs; + int nbElts = eltBase_lw->count(); + for ( int r = 0; r < nbElts; ++r){ + item = eltBase_lw->item(r); + iItem = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iItem.isValid() ) assocs << iItem; + } + return assocs; } // ============================================================== _initInputWidget void GroupDialog::_initInputWidget( Mode editmode ) { -// setProperty( "HexaWidgetType", QVariant::fromValue(GROUP_TREE) ); - installEventFilter(this); - -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(GROUP_TREE) ); - name_le->installEventFilter(this); - - // kind checkbox - strKind[ HEXA_NS::HexaCell ] = "HexaCell"; - strKind[ HEXA_NS::QuadCell ] = "QuadCell"; - strKind[ HEXA_NS::EdgeCell ] = "EdgeCell"; - strKind[ HEXA_NS::HexaNode ] = "HexaNode"; - strKind[ HEXA_NS::QuadNode ] = "QuadNode"; - strKind[ HEXA_NS::EdgeNode ] = "EdgeNode"; - strKind[ HEXA_NS::VertexNode ] = "VertexNode"; - kind_cb->clear(); - QMap::ConstIterator iKind; - for( iKind = strKind.constBegin(); iKind != strKind.constEnd(); ++iKind ) - kind_cb->addItem( iKind.value(), QVariant(iKind.key()) ); - - onKindChanged( kind_cb->currentIndex() ); - eltBase_lw->installEventFilter(this); - - if ( editmode != INFO_MODE ){ - QShortcut* delEltShortcut = new QShortcut( QKeySequence(Qt::Key_X), eltBase_lw ); - delEltShortcut->setContext( Qt::WidgetShortcut ); - connect(delEltShortcut, SIGNAL(activated()), this, SLOT(removeEltBase())); - connect(kind_cb, SIGNAL(activated(int)), this, SLOT(onKindChanged(int)) ); - } + installEventFilter(this); + name_le->installEventFilter(this); + + // kind checkbox + strKind[ HEXA_NS::HexaCell ] = "HexaCell"; + strKind[ HEXA_NS::QuadCell ] = "QuadCell"; + strKind[ HEXA_NS::EdgeCell ] = "EdgeCell"; + strKind[ HEXA_NS::HexaNode ] = "HexaNode"; + strKind[ HEXA_NS::QuadNode ] = "QuadNode"; + strKind[ HEXA_NS::EdgeNode ] = "EdgeNode"; + strKind[ HEXA_NS::VertexNode ] = "VertexNode"; + kind_cb->clear(); + QMap::ConstIterator iKind; + for( iKind = strKind.constBegin(); iKind != strKind.constEnd(); ++iKind ) + kind_cb->addItem( iKind.value(), QVariant(iKind.key()) ); + + onKindChanged( kind_cb->currentIndex() ); + eltBase_lw->installEventFilter(this); + + if ( editmode != INFO_MODE ){ + QShortcut* delEltShortcut = new QShortcut( QKeySequence(Qt::Key_X), eltBase_lw ); + delEltShortcut->setContext( Qt::WidgetShortcut ); + connect(delEltShortcut, SIGNAL(activated()), this, SLOT(removeEltBase())); + connect(kind_cb, SIGNAL(activated(int)), this, SLOT(onKindChanged(int)) ); + } - if ( editmode == INFO_MODE) - { - name_le->setReadOnly(true); - kind_cb->setEnabled(false); - } + if ( editmode == INFO_MODE) + { + name_le->setReadOnly(true); + kind_cb->setEnabled(false); + } - connect(eltBase_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection); + connect(eltBase_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection); } // ============================================================== clear void GroupDialog::clear() { - name_le->clear(); + name_le->clear(); - eltBase_lw->clear(); - modelUnregister(eltBase_lw); + eltBase_lw->clear(); + modelUnregister(eltBase_lw); - modelUnregister(this); + modelUnregister(this); } // ============================================================== onKindChanged void GroupDialog::onKindChanged(int index) { - // onKind - switch ( kind_cb->itemData(index).toInt() ){ - case HEXA_NS::HexaCell: - case HEXA_NS::HexaNode: - eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(HEXA_TREE)); - break; + // onKind + switch ( kind_cb->itemData(index).toInt() ){ + case HEXA_NS::HexaCell: + case HEXA_NS::HexaNode: + eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(HEXA_TREE)); + break; - case HEXA_NS::QuadCell: - case HEXA_NS::QuadNode: - eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(QUAD_TREE)); - break; + case HEXA_NS::QuadCell: + case HEXA_NS::QuadNode: + eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(QUAD_TREE)); + break; - case HEXA_NS::EdgeCell: - case HEXA_NS::EdgeNode: eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); - break; + case HEXA_NS::EdgeCell: + case HEXA_NS::EdgeNode: eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(EDGE_TREE)); + break; - case HEXA_NS::VertexNode: - eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(VERTEX_TREE)); - break; + case HEXA_NS::VertexNode: + eltBase_lw->setProperty("HexaWidgetType", QVariant::fromValue(VERTEX_TREE)); + break; - default:Q_ASSERT(false); - } - eltBase_lw->clear(); - eltBase_lw->setFocus(); + default:Q_ASSERT(false); + } + eltBase_lw->clear(); + eltBase_lw->setFocus(); } // ============================================================== setValue void GroupDialog::setValue(HEXA_NS::Group* g) { - //0) name - name_le->setText( g->getName() ); + //0) name + name_le->setText( g->getName() ); - //1) kind - kind_cb->clear(); - kind_cb->addItem ( strKind[g->getKind()], QVariant( g->getKind() ) ); - // onKindChanged( kind_cb->currentIndex() ); + //1) kind + kind_cb->clear(); + kind_cb->addItem ( strKind[g->getKind()], QVariant( g->getKind() ) ); - //2) elts - HEXA_NS::EltBase* eltBase = NULL; - QListWidgetItem* item = NULL; - QModelIndex iEltBase; - QList eltBaseItems; - QVariant v; + //2) elts + HEXA_NS::EltBase* eltBase = NULL; + QListWidgetItem* item = NULL; + QModelIndex iEltBase; + QList eltBaseItems; + QVariant v; - if ( !getPatternDataSelectionModel() ) return; - if ( !getGroupsSelectionModel() ) return; + if ( !getPatternDataSelectionModel() ) return; + if ( !getGroupsSelectionModel() ) return; - QModelIndex iGroup = getGroupsSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(g) ); - name_le->setProperty( "QModelIndex", QVariant::fromValue(iGroup) ); + QModelIndex iGroup = getGroupsSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(g) ); + name_le->setProperty( "QModelIndex", QVariant::fromValue(iGroup) ); - for ( int nr = 0; nr < g->countElement(); ++nr ){ - eltBase = g->getElement( nr ); - switch ( g->getKind() ){ - case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: v = QVariant::fromValue( (HEXA_NS::Hexa *)eltBase ); break; - case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: v = QVariant::fromValue( (HEXA_NS::Quad *)eltBase ); break; - case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: v = QVariant::fromValue( (HEXA_NS::Edge *)eltBase ); break; - case HEXA_NS::VertexNode: v = QVariant::fromValue( (HEXA_NS::Vertex *)eltBase ); break; - } - iEltBase = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, v); - if ( iEltBase.isValid() ){ - item = new QListWidgetItem( eltBase->getName() ); - item->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(iEltBase) ); - item->setData(LW_DATA_ROLE, iEltBase.data(HEXA_DATA_ROLE)); - eltBase_lw->addItem( item ); - } - } - - _value = g; + int nbElts = g->countElement(); + for ( int nr = 0; nr < nbElts; ++nr ){ + eltBase = g->getElement( nr ); + switch ( g->getKind() ){ + case HEXA_NS::HexaCell: case HEXA_NS::HexaNode: v = QVariant::fromValue( (HEXA_NS::Hexa *)eltBase ); break; + case HEXA_NS::QuadCell: case HEXA_NS::QuadNode: v = QVariant::fromValue( (HEXA_NS::Quad *)eltBase ); break; + case HEXA_NS::EdgeCell: case HEXA_NS::EdgeNode: v = QVariant::fromValue( (HEXA_NS::Edge *)eltBase ); break; + case HEXA_NS::VertexNode: v = QVariant::fromValue( (HEXA_NS::Vertex *)eltBase ); break; + } + iEltBase = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, v); + if ( iEltBase.isValid() ){ + item = new QListWidgetItem( eltBase->getName() ); + item->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(iEltBase) ); + item->setData(LW_DATA_ROLE, iEltBase.data(HEXA_DATA_ROLE)); + eltBase_lw->addItem( item ); + } + } + _value = g; } // ============================================================== getValue HEXA_NS::Group* GroupDialog::getValue() { - return _value; + return _value; } - // ============================================================== removeEltBase void GroupDialog::removeEltBase() { - QListWidgetItem *item = eltBase_lw->currentItem(); + QListWidgetItem *item = eltBase_lw->currentItem(); - if (item) { - int r = eltBase_lw->row(item); - eltBase_lw->takeItem(r); - delete item; - } + if (item) { + int r = eltBase_lw->row(item); + eltBase_lw->takeItem(r); + delete item; + } } // ============================================================== apply bool GroupDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const GroupsModel* groupsModel = getGroupsModel(); - if (patternDataModel == NULL || groupsModel == NULL) return false; - - QString grpName = name_le->text(); - DocumentModel::Group grpKind = static_cast( kind_cb->itemData( kind_cb->currentIndex() ).toInt()); - QModelIndex iGrp; - if ( _value == NULL ){ // create group - iGrp = getDocumentModel()->addGroup( grpName, grpKind ); - } else { - QModelIndexList iGrps = getDocumentModel()->match( - getDocumentModel()->index(0, 0), - HEXA_DATA_ROLE, - QVariant::fromValue( _value ), - 1, - Qt::MatchRecursive ); - if ( !iGrps.isEmpty() ) + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const GroupsModel* groupsModel = getGroupsModel(); + if (patternDataModel == NULL || groupsModel == NULL) return false; + + QString grpName = name_le->text(); + DocumentModel::Group grpKind = static_cast( kind_cb->itemData( kind_cb->currentIndex() ).toInt()); + QModelIndex iGrp; + if ( _value == NULL ){ // create group + iGrp = getDocumentModel()->addGroup( grpName, grpKind ); + } else { + QModelIndexList iGrps = getDocumentModel()->match( + getDocumentModel()->index(0, 0), + HEXA_DATA_ROLE, + QVariant::fromValue( _value ), + 1, + Qt::MatchRecursive ); + if ( !iGrps.isEmpty() ) iGrp = iGrps[0]; - } - - // kind_cb-> - if ( !iGrp.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD GROUP" ) ); - return false; - } - - //fill it and select it - QModelIndex iEltBase; - QListWidgetItem* item = NULL; - bool eltAdded = false; - getDocumentModel()->clearGroupElement(iGrp); - for ( int r = 0; r < eltBase_lw->count(); ++r){ - item = eltBase_lw->item(r); - iEltBase = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iEltBase.isValid() ) - eltAdded = getDocumentModel()->addGroupElement( iGrp, iEltBase ); - // if ( eltAdded == false ){ - // //SUIT_MessageBox::information( this, tr( "HEXA_INFO" ), tr( "ELEMENT NOT ADDED : %1" ).arg( iEltBase.data().toString() )); - // } - } + } - QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ - getDocumentModel()->setName( iGrp, newName ); + // kind_cb-> + if ( !iGrp.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD GROUP" ) + "\n" + getErrorMsg() ); + return false; + } - HEXA_NS::Group* hGroup = getDocumentModel()->data(iGrp, HEXA_DATA_ROLE).value(); - if (hGroup != NULL) - { - char buffer [16]; - name_le->setText(hGroup->getNextName(buffer)); -// updateDefaultName(name_le, hGroup->getType()); //to be tested to debug default name - } + //fill it and select it + QModelIndex iEltBase; + QListWidgetItem* item = NULL; + bool eltAdded = false; + getDocumentModel()->clearGroupElement(iGrp); + int nbElts = eltBase_lw->count(); + for ( int r = 0; r < nbElts; ++r){ + item = eltBase_lw->item(r); + iEltBase = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iEltBase.isValid() ) + eltAdded = getDocumentModel()->addGroupElement( iGrp, iEltBase ); + } - result = groupsModel->mapFromSource(iGrp); + QString newName = name_le->text(); + if ( !newName.isEmpty() ) + getDocumentModel()->setName( iGrp, newName ); - return true; -} + HEXA_NS::Group* hGroup = getDocumentModel()->data(iGrp, HEXA_DATA_ROLE).value(); + if (hGroup != NULL) + { + QString groupName = QString::fromStdString(hGroup->getNextName()); + name_le->setText(groupName); + } + result = groupsModel->mapFromSource(iGrp); + return true; +} // ------------------------- LawDialog ---------------------------------- - // ============================================================== Constructeur LawDialog::LawDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f), _value(NULL) { - _helpFileName = "gui_discret_law.html#add-law"; - setupUi( this ); - _initWidget(editmode); - if ( editmode == NEW_MODE ){ - setWindowTitle( tr("Law Construction") ); - } else if ( editmode == UPDATE_MODE ){ - setWindowTitle( tr("Law Modification") ); - } - else if ( editmode == INFO_MODE){ - setWindowTitle( tr("Law Information") ); - } + _helpFileName = "gui_discret_law.html#add-law"; + setupUi( this ); + _initWidget(editmode); + if ( editmode == NEW_MODE ){ + setWindowTitle( tr("Law Construction") ); + } else if ( editmode == UPDATE_MODE ){ + setWindowTitle( tr("Law Modification") ); + } + else if ( editmode == INFO_MODE){ + setWindowTitle( tr("Law Information") ); + } } // ============================================================== Destructeur @@ -5751,232 +5183,216 @@ LawDialog::~LawDialog() // ============================================================== _initInputWidget void LawDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - -// setProperty( "HexaWidgetType", QVariant::fromValue(LAW_TREE) ); - installEventFilter(this); + QRegExp rx(""); -// name_le->setProperty( "HexaWidgetType", QVariant::fromValue(LAW_TREE) ); - name_le->installEventFilter(this); + // setProperty( "HexaWidgetType", QVariant::fromValue(LAW_TREE) ); + installEventFilter(this); - // kind checkbox - strKind[ HEXA_NS::Uniform ] = "Uniform"; - strKind[ HEXA_NS::Arithmetic ] = "Arithmetic"; - strKind[ HEXA_NS::Geometric ] = "Geometric"; + // name_le->setProperty( "HexaWidgetType", QVariant::fromValue(LAW_TREE) ); + name_le->installEventFilter(this); - kind_cb->clear(); - QMap::ConstIterator iKind; - for( iKind = strKind.constBegin(); iKind != strKind.constEnd(); ++iKind ) - kind_cb->addItem( iKind.value(), QVariant(iKind.key()) ); + // kind checkbox + strKind[ HEXA_NS::Uniform ] = "Uniform"; + strKind[ HEXA_NS::Arithmetic ] = "Arithmetic"; + strKind[ HEXA_NS::Geometric ] = "Geometric"; - if (editmode == INFO_MODE) - { - name_le->setReadOnly(true); - nb_nodes_spb->setReadOnly(true); - coeff_spb->setReadOnly(true); - kind_cb->setEnabled(false); - } + kind_cb->clear(); + QMap::ConstIterator iKind, iEnd; + for( iKind = strKind.constBegin(), iEnd = strKind.constEnd(); iKind != iEnd; ++iKind ) + kind_cb->addItem( iKind.value(), QVariant(iKind.key()) ); + if (editmode == INFO_MODE) + { + name_le->setReadOnly(true); + nb_nodes_spb->setReadOnly(true); + coeff_spb->setReadOnly(true); + kind_cb->setEnabled(false); + } } // ============================================================== clear void LawDialog::clear() { - name_le->clear(); + name_le->clear(); - modelUnregister(this); + modelUnregister(this); } // ============================================================== setValue void LawDialog::setValue(HEXA_NS::Law* l) { - // 0) name - name_le->setText( l->getName() ); + // 0) name + name_le->setText( l->getName() ); - nb_nodes_spb->setValue( l->getNodes() ); - coeff_spb->setValue( l->getCoefficient() ); + nb_nodes_spb->setValue( l->getNodes() ); + coeff_spb->setValue( l->getCoefficient() ); - HEXA_NS::KindLaw k = l->getKind(); - kind_cb->setCurrentIndex( kind_cb->findData(k) ); + HEXA_NS::KindLaw k = l->getKind(); + kind_cb->setCurrentIndex( kind_cb->findData(k) ); - _value = l; + _value = l; } // ============================================================== getValue HEXA_NS::Law* LawDialog::getValue() { - return _value; + return _value; } - // ============================================================== apply bool LawDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - - const MeshModel* meshModel = getMeshModel(); - if (meshModel == NULL) return false; - - QString lawName = name_le->text(); - int nbnodes = nb_nodes_spb->value(); - double coeff = coeff_spb->value(); - DocumentModel::KindLaw lawKind = static_cast( kind_cb->itemData( kind_cb->currentIndex() ).toInt()); - - QModelIndex iLaw; - if ( _value == NULL ){ // create Law - iLaw = getDocumentModel()->addLaw( lawName, nbnodes ); - } else { - QModelIndexList iLaws = getDocumentModel()->match( - getDocumentModel()->index(0, 0), - HEXA_DATA_ROLE, - QVariant::fromValue( _value ), - 1, - Qt::MatchRecursive ); - if ( !iLaws.isEmpty() ) - iLaw = iLaws[0]; - } + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + + if ( !getDocumentModel() ) return false; - if ( !iLaw.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD LAW" ) ); - return false; - } - //fill it and select it - bool setOk = getDocumentModel()->setLaw( iLaw, nbnodes, coeff, lawKind ); - if ( !setOk ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD LAW" ) ); - return false; - } + const MeshModel* meshModel = getMeshModel(); + if (meshModel == NULL) return false; - QString newName = name_le->text(); - if ( !newName.isEmpty() )/*{*/ - getDocumentModel()->setName( iLaw, newName ); + QString lawName = name_le->text(); + int nbnodes = nb_nodes_spb->value(); + double coeff = coeff_spb->value(); + DocumentModel::KindLaw lawKind = static_cast( kind_cb->itemData( kind_cb->currentIndex() ).toInt()); - HEXA_NS::Law* hLaw = getDocumentModel()->data(iLaw, HEXA_DATA_ROLE).value(); - if (hLaw != NULL) - { - char buffer [16]; - name_le->setText(hLaw->getNextName(buffer)); -// updateDefaultName(name_le, hLaw->getType()); //to be tested to debug default name + QModelIndex iLaw; + if ( _value == NULL ){ // create Law + iLaw = getDocumentModel()->addLaw( lawName, nbnodes ); + } else { + QModelIndexList iLaws = getDocumentModel()->match( + getDocumentModel()->index(0, 0), + HEXA_DATA_ROLE, + QVariant::fromValue( _value ), + 1, + Qt::MatchRecursive ); + if ( !iLaws.isEmpty() ) + iLaw = iLaws[0]; + } - } + if ( !iLaw.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD LAW" ) + "\n" + getErrorMsg() ); + return false; + } + //fill it and select it + bool setOk = getDocumentModel()->setLaw( iLaw, nbnodes, coeff, lawKind ); + if ( !setOk ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD LAW" ) + "\n" + getErrorMsg() ); + return false; + } - result = meshModel->mapFromSource(iLaw); + QString newName = name_le->text(); + if ( !newName.isEmpty() )/*{*/ + getDocumentModel()->setName( iLaw, newName ); - return true; -} + HEXA_NS::Law* hLaw = getDocumentModel()->data(iLaw, HEXA_DATA_ROLE).value(); + if (hLaw != NULL) + { + char buffer [16]; + name_le->setText(hLaw->getNextName(buffer)); + } + result = meshModel->mapFromSource(iLaw); + return true; +} // ------------------------- PropagationDialog ---------------------------------- - // ============================================================== Constructeur - PropagationDialog::PropagationDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) : HexaBaseDialog(parent, editmode, f), _value(NULL) { - _helpFileName = "gui_propag.html"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( law_le ); - // setFocusProxy( propagations_lw ); + _helpFileName = "gui_propag.html"; + setupUi( this ); + _initWidget(editmode); - if ( editmode == INFO_MODE ){ - setWindowTitle( tr("Propagation Information") ); - if (groupBox_2) + if ( editmode == INFO_MODE ){ + setWindowTitle( tr("Propagation Information") ); + if (groupBox_2) delete groupBox_2; - } else if ( editmode == UPDATE_MODE ){ - setWindowTitle( tr("Propagation Modification") ); - if (groupBox_2) + } else if ( editmode == UPDATE_MODE ){ + setWindowTitle( tr("Propagation Modification") ); + if (groupBox_2) delete groupBox_2; - } else if ( editmode == NEW_MODE ){ - setWindowTitle( tr("Propagation(s) Setting") ); - } + } else if ( editmode == NEW_MODE ){ + setWindowTitle( tr("Propagation(s) Setting") ); + } } - // ============================================================== Destructeur PropagationDialog::~PropagationDialog() { } - // ============================================================== _initInputWidget void PropagationDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); -// setProperty( "HexaWidgetType", QVariant::fromValue(PROPAGATION_TREE) ); - installEventFilter(this); + installEventFilter(this); - law_le->setProperty( "HexaWidgetType", QVariant::fromValue(LAW_TREE) ); - law_le->installEventFilter(this); - law_le->setValidator( validator ); + law_le->setProperty( "HexaWidgetType", QVariant::fromValue(LAW_TREE) ); + law_le->installEventFilter(this); + law_le->setValidator( validator ); - propagations_lw->setProperty( "HexaWidgetType", QVariant::fromValue(PROPAGATION_TREE) ); - propagations_lw->installEventFilter(this); + propagations_lw->setProperty( "HexaWidgetType", QVariant::fromValue(PROPAGATION_TREE) ); + propagations_lw->installEventFilter(this); - QShortcut* delPropagationShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X/*Qt::Key_Alt*//*Qt::Key_Space*/), propagations_lw); - delPropagationShortcut->setContext( Qt::WidgetShortcut ); + QShortcut* delPropagationShortcut = new QShortcut(QKeySequence(/*Qt::Key_Delete*/Qt::Key_X/*Qt::Key_Alt*//*Qt::Key_Space*/), propagations_lw); + delPropagationShortcut->setContext( Qt::WidgetShortcut ); - law_le->setReadOnly(true); + law_le->setReadOnly(true); - if ( editmode == INFO_MODE) - way_cb->setEnabled(false); + if ( editmode == INFO_MODE) + way_cb->setEnabled(false); - connect( delPropagationShortcut, SIGNAL(activated()), this, SLOT(deletePropagationItem()) ); - connect( propagations_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); + connect( delPropagationShortcut, SIGNAL(activated()), this, SLOT(deletePropagationItem()) ); + connect( propagations_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection ); } - // ============================================================== clear void PropagationDialog::clear() { - propagations_lw->clear(); - modelUnregister(propagations_lw); + propagations_lw->clear(); + modelUnregister(propagations_lw); - law_le->clear(); - modelUnregister(law_le); + law_le->clear(); + modelUnregister(law_le); - modelUnregister(this); + modelUnregister(this); } // ============================================================== deletePropagationItem void PropagationDialog::deletePropagationItem() { - delete propagations_lw->currentItem(); + delete propagations_lw->currentItem(); } - // ============================================================== setValue void PropagationDialog::setValue(HEXA_NS::Propagation* p) { - if (getMeshSelectionModel() == NULL) return; - HEXA_NS::Law* l = p->getLaw(); - bool way = p->getWay(); + if (getMeshSelectionModel() == NULL) return; + HEXA_NS::Law* l = p->getLaw(); + bool way = p->getWay(); - // propagation - QModelIndex ip = getMeshSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(p) ); - setProperty( "QModelIndex", QVariant::fromValue(ip) ); + // propagation + QModelIndex ip = getMeshSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(p) ); + setProperty( "QModelIndex", QVariant::fromValue(ip) ); - // law on propagation - if ( l != NULL ){ - law_le->setText( l->getName() ); - QModelIndex il = getMeshSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(l) ); - law_le->setProperty( "QModelIndex", QVariant::fromValue(il) ); - } + // law on propagation + if ( l != NULL ){ + law_le->setText( l->getName() ); + QModelIndex il = getMeshSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(l) ); + law_le->setProperty( "QModelIndex", QVariant::fromValue(il) ); + } - // way of propagation - way_cb->setChecked(way); + // way of propagation + way_cb->setChecked(way); - _value = p; + _value = p; } // ============================================================== selectElementOfModel @@ -5986,120 +5402,109 @@ void PropagationDialog::setValue(HEXA_NS::Propagation* p) void PropagationDialog::selectElementOfModel() { - if (!getMeshSelectionModel()) return; - - QListWidget* currentListWidget = dynamic_cast( sender() ); - if ( !currentListWidget ) return; - - _selectionMutex = true; + if (!getMeshSelectionModel()) return; - QList sel = currentListWidget->selectedItems(); - QModelIndex index; - getMeshSelectionModel()->clearSelection(); - foreach ( QListWidgetItem *item, sel ){ - index = item->data(LW_QMODELINDEX_ROLE).value(); - if ( index.isValid() ) - { - getMeshSelectionModel()->select( index, QItemSelectionModel::Select ); - } - } - _selectionMutex = false; + QListWidget* currentListWidget = dynamic_cast( sender() ); + if ( !currentListWidget ) return; + QList sel = currentListWidget->selectedItems(); + QModelIndex index; + getMeshSelectionModel()->clearSelection(); + foreach ( QListWidgetItem *item, sel ){ + //index = item->data(LW_QMODELINDEX_ROLE).value(); //unsafe: index can change in the tree + index = getMeshSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); + if ( index.isValid() ) + getMeshSelectionModel()->select( index, QItemSelectionModel::SelectCurrent ); + } } - // ============================================================== getValue HEXA_NS::Propagation* PropagationDialog::getValue() { - return _value; + return _value; } - // ============================================================== apply bool PropagationDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - bool isOk = false; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const MeshModel* meshModel = getMeshModel(); - if (meshModel == NULL) return false; + bool isOk = false; + if ( !getDocumentModel() ) return false; + const MeshModel* meshModel = getMeshModel(); + if (meshModel == NULL) return false; - bool way = way_cb->isChecked(); - QListWidgetItem* item = NULL; + bool way = way_cb->isChecked(); + QListWidgetItem* item = NULL; - QModelIndex iPropagation; - QModelIndex iLaw = meshModel->mapToSource( law_le->property("QModelIndex").value() ); - if (!iLaw.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT SET PROPAGATION" ) ); - return false; - } + QModelIndex iPropagation; + QModelIndex iLaw = meshModel->mapToSource( law_le->property("QModelIndex").value() ); + if (!iLaw.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT SET PROPAGATION" ) ); + return false; + } - for (int r = 0; r < propagations_lw->count(); ++r){ - item = propagations_lw->item(r); - iPropagation = meshModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( !iPropagation.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT SET PROPAGATION" ) ); - return false; - } + int nbPropagations = propagations_lw->count(); + for (int r = 0; r < nbPropagations; ++r){ + item = propagations_lw->item(r); + iPropagation = meshModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( !iPropagation.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT SET PROPAGATION" ) ); + return false; + } - //fill it and select it - isOk = getDocumentModel()->setPropagation( iPropagation, iLaw, way ); - if ( !isOk ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT SET PROPAGATION" ) ); - return false; - } + //fill it and select it + isOk = getDocumentModel()->setPropagation( iPropagation, iLaw, way ); + if ( !isOk ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT SET PROPAGATION" ) + "\n" + getErrorMsg() ); + return false; + } - result = meshModel->mapFromSource(iPropagation); - } + result = meshModel->mapFromSource(iPropagation); + } - return true; + return true; } - // ------------------------- ComputeMeshDialog ---------------------------------- - // ============================================================== Constructeur - ComputeMeshDialog::ComputeMeshDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f) +HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_mesh.html"; - setWindowTitle( tr("Compute mesh") ); - QVBoxLayout* layout = new QVBoxLayout; - setLayout(layout); + _helpFileName = "gui_mesh.html"; + setWindowTitle( tr("Compute mesh") ); + QVBoxLayout* layout = new QVBoxLayout; + setLayout(layout); - QHBoxLayout* up = new QHBoxLayout; - QHBoxLayout* down = new QHBoxLayout; + QHBoxLayout* up = new QHBoxLayout; + QHBoxLayout* down = new QHBoxLayout; - layout->addLayout(up); - layout->addLayout(down); + layout->addLayout(up); + layout->addLayout(down); - QVBoxLayout* vlg = new QVBoxLayout; - QVBoxLayout* vld = new QVBoxLayout; + QVBoxLayout* vlg = new QVBoxLayout; + QVBoxLayout* vld = new QVBoxLayout; - up->addLayout(vlg); - up->addLayout(vld); + up->addLayout(vlg); + up->addLayout(vld); - vlg->addWidget(new QLabel("Name")); - vlg->addWidget(new QLabel("Dimension")); - vlg->addWidget(new QLabel("Container")); + vlg->addWidget(new QLabel("Name")); + vlg->addWidget(new QLabel("Dimension")); + vlg->addWidget(new QLabel("Container")); - _name = new QLineEdit("Mesh"); - _dim = new QSpinBox(); - _fact = new QLineEdit("FactoryServer"); + _name = new QLineEdit("Mesh"); + _dim = new QSpinBox(); + _fact = new QLineEdit("FactoryServer"); - vld->addWidget(_name); - vld->addWidget(_dim); - vld->addWidget(_fact); + vld->addWidget(_name); + vld->addWidget(_dim); + vld->addWidget(_fact); - _dim->setRange(1, 3); - _dim->setValue(3); - - _initWidget(editmode); + _dim->setRange(1, 3); + _dim->setValue(3); + _initWidget(editmode); } // ============================================================== Destructeur @@ -6107,7 +5512,6 @@ ComputeMeshDialog::~ComputeMeshDialog() { } - // ============================================================== _initInputWidget void ComputeMeshDialog::_initInputWidget( Mode editmode ) { @@ -6116,9 +5520,8 @@ void ComputeMeshDialog::_initInputWidget( Mode editmode ) // ============================================================== setDocumentModel void ComputeMeshDialog::setDocumentModel(DocumentModel* m) { -// HexaBaseDialog::setDocumentModel(m); - if (m == NULL) return; - _name->setText(m->getName()); + if (m == NULL) return; + _name->setText(m->getName()); } // ============================================================== clear @@ -6130,65 +5533,35 @@ void ComputeMeshDialog::clear() // ============================================================== apply bool ComputeMeshDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if (getDocumentModel() == NULL) return false; - QString command = QString("import hexablock ; %1 = hexablock.mesh(\"%2\", \"%1\", %3, \"%4\")") - .arg( _name->text() ) - .arg( getDocumentModel()->getName() ) - .arg( _dim->value() ) - .arg( _fact->text() ); - //std::cout << "command: " << command.toStdString() << std::endl; + if (getDocumentModel() == NULL) return false; + QString command = QString("import hexablock ; %1 = hexablock.mesh(\"%2\", \"%1\", %3, \"%4\")") + .arg( _name->text() ) + .arg( getDocumentModel()->getName() ) + .arg( _dim->value() ) + .arg( _fact->text() ); - SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); - PyConsole_Console* pyConsole = app->pythonConsole(); + SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); + PyConsole_Console* pyConsole = app->pythonConsole(); - if ( pyConsole ) - pyConsole->exec( command ); - else - return false; + if ( pyConsole ) + pyConsole->exec( command ); + else + return false; - // clear(); - return true; + return true; } -// void ComputeMeshDialog::accept() { -// _disallowSelection(); -// QDialog::accept(); -// -// QString command = QString("import hexablock ; %1 = hexablock.mesh(\"%1\", \"%2\", %3, \"%4\")") -// .arg( _name->text() ) -// .arg( getDocumentModel()->documentEntry() ) -// .arg( _dim->value() ) -// .arg( _fact->text() ); -// std::cout << "command: " << command.toStdString() << std::endl; -// -// SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); -// PyConsole_Console* pyConsole = app->pythonConsole(); -// -// if ( pyConsole ) pyConsole->exec( command ); -// } - -// void ComputeMeshDialog::reject() { -// _disallowSelection(); -// QDialog::reject(); -// } - - - // ------------------------- ReplaceHexaDialog ---------------------------------- - // ============================================================== Constructeur - ReplaceHexaDialog::ReplaceHexaDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f) +HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_replace_hexa.html"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( quads_lw ); + _helpFileName = "gui_replace_hexa.html"; + setupUi( this ); + _initWidget(editmode); } // ============================================================== Destructeur @@ -6202,75 +5575,72 @@ ReplaceHexaDialog::~ReplaceHexaDialog() */ QModelIndexList ReplaceHexaDialog::getAssocsVTK() { - QModelIndexList assocs; - QModelIndex iQuad; - QListWidgetItem* item = NULL; - - //ListWidget content - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return assocs; - for ( int r = 0; r < quads_lw->count(); ++r ){ - item = quads_lw->item(r); - // iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); //unsafe - iQuad = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); - if ( iQuad.isValid() ) assocs << iQuad; - } - return assocs; + QModelIndexList assocs; + QModelIndex iQuad; + QListWidgetItem* item = NULL; + + //ListWidget content + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return assocs; + int nbQuads = quads_lw->count(); + for ( int r = 0; r < nbQuads; ++r ){ + item = quads_lw->item(r); + // iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); //unsafe + iQuad = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); + if ( iQuad.isValid() ) assocs << iQuad; + } + return assocs; } // ============================================================== _initInputWidget void ReplaceHexaDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); + QRegExp rx(""); -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + installEventFilter(this); - c1_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - c2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - c3_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + c1_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + c2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + c3_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - p1_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - p2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - p3_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + p1_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + p2_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + p3_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); -// name_le->installEventFilter(this); - c1_le->installEventFilter(this); - c2_le->installEventFilter(this); - c3_le->installEventFilter(this); + c1_le->installEventFilter(this); + c2_le->installEventFilter(this); + c3_le->installEventFilter(this); - p1_le->installEventFilter(this); - p2_le->installEventFilter(this); - p3_le->installEventFilter(this); + p1_le->installEventFilter(this); + p2_le->installEventFilter(this); + p3_le->installEventFilter(this); - quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); - quads_lw->installEventFilter(this); + quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + quads_lw->installEventFilter(this); - if ( editmode == NEW_MODE ){ - QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); - delQuadShortcut->setContext( Qt::WidgetShortcut ); + if ( editmode == NEW_MODE ){ + QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); + delQuadShortcut->setContext( Qt::WidgetShortcut ); - connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(deleteQuadItem()) ); - connect( quads_lw, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonBox(int)) ); - } + connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(deleteQuadItem()) ); + connect( quads_lw, SIGNAL(currentRowChanged(int)), this, SLOT(updateButtonBox(int)) ); + } - c1_le->setReadOnly(true); - c2_le->setReadOnly(true); - c3_le->setReadOnly(true); + c1_le->setReadOnly(true); + c2_le->setReadOnly(true); + c3_le->setReadOnly(true); - p1_le->setReadOnly(true); - p2_le->setReadOnly(true); - p3_le->setReadOnly(true); + p1_le->setReadOnly(true); + p2_le->setReadOnly(true); + p3_le->setReadOnly(true); - connect(quads_lw, SIGNAL(itemSelectionChanged()), - this, SLOT(selectElementOfModel()), Qt::UniqueConnection); + connect(quads_lw, SIGNAL(itemSelectionChanged()), + this, SLOT(selectElementOfModel()), Qt::UniqueConnection); } // ============================================================== clear void ReplaceHexaDialog::clear() { -// name_le->clear(); - quads_lw->clear(); modelUnregister(quads_lw); @@ -6298,106 +5668,90 @@ void ReplaceHexaDialog::clear() // ============================================================== updateButtonBox void ReplaceHexaDialog::updateButtonBox() { - int nbQuad = quads_lw->count(); + int nbQuad = quads_lw->count(); - if ( nbQuad > 0 ){ - //_applyCloseButton->setEnabled(true); - _applyButton->setEnabled(true); - } else { - //_applyCloseButton->setEnabled(false); - _applyButton->setEnabled(false); - } + if ( nbQuad > 0 ){ + _applyButton->setEnabled(true); + } else { + _applyButton->setEnabled(false); + } } // ============================================================== deleteQuadItem void ReplaceHexaDialog::deleteQuadItem() { - delete quads_lw->currentItem(); - updateButtonBox(); + delete quads_lw->currentItem(); + updateButtonBox(); } // ============================================================== apply bool ReplaceHexaDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; - - QModelIndex ielts; //result - - QListWidgetItem* item = NULL; - QModelIndexList iquads; - QModelIndex iquad; - for ( int r = 0; r < quads_lw->count(); ++r){ - item = quads_lw->item(r); - iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - //std::cout << "iquad => " << iquad.data().toString().toStdString() << std::endl; - if ( iquad.isValid() ) - iquads << iquad; - } - - QModelIndex ic1 = patternDataModel->mapToSource( _index[c1_le] ); - QModelIndex ic2 = patternDataModel->mapToSource( _index[c2_le] ); - QModelIndex ic3 = patternDataModel->mapToSource( _index[c3_le] ); - - QModelIndex ip1 = patternDataModel->mapToSource( _index[p1_le] ); - QModelIndex ip2 = patternDataModel->mapToSource( _index[p2_le] ); - QModelIndex ip3 = patternDataModel->mapToSource( _index[p3_le] ); - - // std::cout << "nbHexa => " << nbHexa << std::endl; - - if ( ic1.isValid() && ic2.isValid() && ic3.isValid() - && ip1.isValid() && ip2.isValid() && ip3.isValid() ){ - ielts = getDocumentModel()->replace( iquads, - ip1, ic1, - ip2, ic2, - ip3, ic3 ); - } - - if ( !ielts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT REPLACE HEXA" ) ); - return false; - } - _value = ielts.model()->data(ielts, HEXA_DATA_ROLE).value(); - -// QString newName = name_le->text(); -// if ( !newName.isEmpty() )/*{*/ -// getDocumentModel()->setName( ielts, newName ); -// -// updateDefaultName(name_le, ielts); + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - result = patternBuilderModel->mapFromSource(ielts); + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; - //update the list (indexes) - for ( int r = 0; r < quads_lw->count(); ++r ){ - item = quads_lw->item(r); - iquad = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); - item->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(iquad) ); - item->setData(LW_DATA_ROLE, iquad.data(HEXA_DATA_ROLE)); - } + QModelIndex ielts; //result - return true; -} + QListWidgetItem* item = NULL; + QModelIndexList iquads; + QModelIndex iquad; + int nbQuads = quads_lw->count(); + for ( int r = 0; r < nbQuads; ++r){ + item = quads_lw->item(r); + iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iquad.isValid() ) + iquads << iquad; + } + QModelIndex ic1 = patternDataModel->mapToSource( _index[c1_le] ); + QModelIndex ic2 = patternDataModel->mapToSource( _index[c2_le] ); + QModelIndex ic3 = patternDataModel->mapToSource( _index[c3_le] ); + QModelIndex ip1 = patternDataModel->mapToSource( _index[p1_le] ); + QModelIndex ip2 = patternDataModel->mapToSource( _index[p2_le] ); + QModelIndex ip3 = patternDataModel->mapToSource( _index[p3_le] ); + if ( ic1.isValid() && ic2.isValid() && ic3.isValid() + && ip1.isValid() && ip2.isValid() && ip3.isValid() ){ + ielts = getDocumentModel()->replace( iquads, + ip1, ic1, + ip2, ic2, + ip3, ic3 ); + } -// ------------------------- QuadRevolutionDialog ---------------------------------- + if ( !ielts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT REPLACE HEXA" ) + "\n" + getErrorMsg() ); + return false; + } + _value = ielts.model()->data(ielts, HEXA_DATA_ROLE).value(); + result = patternBuilderModel->mapFromSource(ielts); + + //update the list (indexes) + for ( int r = 0; r < nbQuads; ++r ){ + item = quads_lw->item(r); + iquad = getPatternDataSelectionModel()->indexBy(HEXA_DATA_ROLE, item->data(LW_DATA_ROLE)); + item->setData( LW_QMODELINDEX_ROLE, QVariant::fromValue(iquad) ); + item->setData(LW_DATA_ROLE, iquad.data(HEXA_DATA_ROLE)); + } + + return true; +} +// ------------------------- QuadRevolutionDialog ---------------------------------- // ============================================================== Constructeur QuadRevolutionDialog::QuadRevolutionDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f) + HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_quad_revolution.html"; - setupUi( this ); - _initWidget(editmode); - // setFocusProxy( quads_lw ); + _helpFileName = "gui_quad_revolution.html"; + setupUi( this ); + _initWidget(editmode); + revolutionUni_rb->click(); } // ============================================================== getAssocsVTK @@ -6406,21 +5760,22 @@ QuadRevolutionDialog::QuadRevolutionDialog( QWidget* parent, Mode editmode, Qt:: */ QModelIndexList QuadRevolutionDialog::getAssocsVTK() { - QModelIndexList assocs; - QModelIndex iQuad; - QListWidgetItem* item = NULL; - if (getPatternDataSelectionModel() == NULL) return assocs; - - //ListWidget content - const PatternDataModel* patternDataModel = getPatternDataModel(); - if ( !patternDataModel ) return assocs; - for ( int r = 0; r < quads_lw->count(); ++r ){ - item = quads_lw->item(r); - iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iQuad.isValid() ) + QModelIndexList assocs; + QModelIndex iQuad; + QListWidgetItem* item = NULL; + if (getPatternDataSelectionModel() == NULL) return assocs; + + //ListWidget content + const PatternDataModel* patternDataModel = getPatternDataModel(); + if ( !patternDataModel ) return assocs; + int nbQuads = quads_lw->count(); + for ( int r = 0; r < nbQuads; ++r ){ + item = quads_lw->item(r); + iQuad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iQuad.isValid() ) assocs << iQuad; - } - return assocs; + } + return assocs; } // ============================================================== Destructeur @@ -6431,177 +5786,163 @@ QuadRevolutionDialog::~QuadRevolutionDialog() // ============================================================== _initInputWidget void QuadRevolutionDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + center_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - center_pt_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - axis_vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - quads_lw->setProperty( "HexaWidgetType", QVariant::fromValue(QUAD_TREE) ); + installEventFilter(this); + quads_lw->installEventFilter(this); + center_le->installEventFilter(this); + axis_le->installEventFilter(this); - center_pt_le->setValidator( validator ); - axis_vec_le->setValidator( validator ); - // quads_lw->setValidator( validator ); + center_le->setReadOnly(true); + axis_le->setReadOnly(true); -// name_le->installEventFilter(this); - center_pt_le->installEventFilter(this); - axis_vec_le->installEventFilter(this); - quads_lw->installEventFilter(this); + angles_lw->setItemDelegate( new HexaAngleDoubleSpinBoxDelegate(angles_lw) ); + angles_lw->setEditTriggers( QAbstractItemView::DoubleClicked ); - if ( editmode == NEW_MODE ){ - angles_lw->setItemDelegate( new HexaAngleDoubleSpinBoxDelegate(angles_lw) ); - angles_lw->setEditTriggers( QAbstractItemView::DoubleClicked ); + QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); + delQuadShortcut->setContext( Qt::WidgetShortcut ); + connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(delQuadItem()) ); + connect( add_angle_pb, SIGNAL(clicked()), this, SLOT(addAngleItem())); + connect( del_angle_pb, SIGNAL(clicked()), this, SLOT(delAngleItem())); - QShortcut* delQuadShortcut = new QShortcut( QKeySequence(Qt::Key_X), quads_lw ); - delQuadShortcut->setContext( Qt::WidgetShortcut ); - connect( delQuadShortcut, SIGNAL(activated()), this, SLOT(delQuadItem()) ); - connect( add_angle_pb, SIGNAL(clicked()), this, SLOT(addAngleItem())); - connect( del_angle_pb, SIGNAL(clicked()), this, SLOT(delAngleItem())); - // connect(clear_pb, SIGNAL(clicked()), this, SLOT(clearQuads())); - } - - center_pt_le->setReadOnly(true); - axis_vec_le->setReadOnly(true); - - connect(quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection); + connect(quads_lw, SIGNAL(itemSelectionChanged()), this, SLOT(selectElementOfModel()), Qt::UniqueConnection); } // ============================================================== clear void QuadRevolutionDialog::clear() { -// name_le->clear(); - quads_lw->clear(); modelUnregister(quads_lw); - center_pt_le->clear(); - modelUnregister(center_pt_le); + center_le->clear(); + modelUnregister(center_le); - axis_vec_le->clear(); - modelUnregister(axis_vec_le); - - angles_lw->clear(); - modelUnregister(angles_lw); + axis_le->clear(); + modelUnregister(axis_le); modelUnregister(this); } - -// ============================================================== updateButtonBox -void QuadRevolutionDialog::updateButtonBox() //CS_TODO? : check center, axis -{ - int nbQuads = quads_lw->count(); - int nbAngles = angles_lw->count(); - - if ( nbQuads>0 && nbAngles> 0 ){ - //_applyCloseButton->setEnabled(true); - _applyButton->setEnabled(true); - } else { - //_applyCloseButton->setEnabled(false); - _applyButton->setEnabled(false); - } -} - - // ============================================================== addAngleItem void QuadRevolutionDialog::addAngleItem() //CS_TODO { - QListWidgetItem* previousItem = angles_lw->currentItem(); - QListWidgetItem* newItem = new QListWidgetItem(); + QListWidgetItem* previousItem = angles_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); - double defaultValue = 180.; - if ( previousItem ) - defaultValue = previousItem->data(Qt::EditRole).toDouble(); + double defaultValue = 180.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - newItem->setData( Qt::EditRole, QVariant(defaultValue) ); - newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); - angles_lw->addItem(newItem); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + angles_lw->addItem(newItem); - updateButtonBox(); + updateButtonBox(); } // ============================================================== delAngleItem void QuadRevolutionDialog::delAngleItem() { - delete angles_lw->currentItem(); - updateButtonBox(); + delete angles_lw->currentItem(); + updateButtonBox(); } // ============================================================== delQuadItem void QuadRevolutionDialog::delQuadItem() { - delete quads_lw->currentItem(); - updateButtonBox(); + delete quads_lw->currentItem(); + updateButtonBox(); } // ============================================================== apply bool QuadRevolutionDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; - - QModelIndex ielts; //result - QListWidgetItem* item = NULL; - - QModelIndexList istartquads; - QModelIndex iquad; - for ( int r = 0; r < quads_lw->count(); ++r){ - item = quads_lw->item(r); - iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); - if ( iquad.isValid() ) + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + + QListWidgetItem* item = NULL; + + QModelIndexList istartquads; + QModelIndex iquad; + int nbQuads = quads_lw->count(); + for ( int r = 0; r < nbQuads; ++r){ + item = quads_lw->item(r); + iquad = patternDataModel->mapToSource( item->data(LW_QMODELINDEX_ROLE).value() ); + if ( iquad.isValid() ) istartquads << iquad; - } - - QModelIndex icenter_pt = patternDataModel->mapToSource( _index[center_pt_le] ); - QModelIndex iaxis_vec = patternBuilderModel->mapToSource( _index[axis_vec_le] ); - - QList angles; - for ( int r = 0; r < angles_lw->count(); ++r){ - item = angles_lw->item(r); - angles << item->data(Qt::EditRole).toDouble(); - } - - if ( icenter_pt.isValid() && iaxis_vec.isValid() ){ - ielts = getDocumentModel()->revolutionQuads( istartquads, icenter_pt, iaxis_vec, angles ); - } - - if ( !ielts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE QUAD REVOLUTION" ) ); - return false; - } - _value = ielts.model()->data(ielts, HEXA_DATA_ROLE).value(); - -// QString newName = name_le->text(); -// if ( !newName.isEmpty() )/*{*/ -// getDocumentModel()->setName( ielts, newName ); -// -// updateDefaultName(name_le, ielts); + } - result = patternBuilderModel->mapFromSource(ielts); + QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] ); + QModelIndex iaxis = patternBuilderModel->mapToSource( _index[axis_le] ); + int angle = angle_spb->value(); + int nbre = nbre_spb->value(); - return true; -} + vector angles; + int nbAngles = angles_lw->count(); + for ( int r = 0; r < nbAngles; ++r){ + item = angles_lw->item(r); + angles.push_back(item->data(Qt::EditRole).toDouble()); + } + QModelIndex iElts; //result + if (nbQuads == 1 && istartquads[0].isValid() && icenter.isValid() && iaxis.isValid()) + { + if (revolutionUni_rb->isChecked()) + iElts = docModel->revolutionQuadUni(istartquads[0], icenter, iaxis, angle, nbre); + else if (revolution_rb->isChecked()) + iElts = docModel->revolutionQuad(istartquads[0], icenter, iaxis, angles); + } + else if (nbQuads > 1 && icenter.isValid() && iaxis.isValid()) + { + if (revolutionUni_rb->isChecked()) + iElts = docModel->revolutionQuadsUni(istartquads, icenter, iaxis, angle, nbre); + else if (revolution_rb->isChecked()) + iElts = docModel->revolutionQuads(istartquads, icenter, iaxis, angles); + } + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE QUAD REVOLUTION" ) + "\n" + getErrorMsg() ); + return false; + } + _value = iElts.model()->data(iElts, HEXA_DATA_ROLE).value(); + result = patternBuilderModel->mapFromSource(iElts); -// ------------------------- MakeHemiSphereDialog ---------------------------------- + return true; +} +// ------------------------- MakeHemiSphereDialog ---------------------------------- // ============================================================== Constructeur - MakeHemiSphereDialog::MakeHemiSphereDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ): - HexaBaseDialog(parent, editmode, f) + HexaBaseDialog(parent, editmode, f) { - _helpFileName = "gui_hemisphere.html"; - setupUi( this ); - _initWidget(editmode); + _helpFileName = "gui_hemisphere.html"; + setupUi( this ); + _initWidget(editmode); + sphere_rb->click(); + + connect( sphereTop_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( sphereUni_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( sphere2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( sphere_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( sphere_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + + connect( sphericalTop_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( sphericalUni_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( spherical2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( spherical_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( spherical_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); + + connect( rindTop_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rindUni_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rind2_rb, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( rind_rb, SIGNAL(clicked()), this, SLOT(clearVTKSelection()) ); + connect( rind_rb, SIGNAL(clicked()), this, SLOT(clearCurrentObjectFocus()) ); } // ============================================================== Destructeur @@ -6612,56 +5953,150 @@ MakeHemiSphereDialog::~MakeHemiSphereDialog() // ============================================================== _initInputWidget void MakeHemiSphereDialog::_initInputWidget( Mode editmode ) { - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); + center_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + hole_axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + base_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + vplan_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + + installEventFilter(this); + center_le->installEventFilter(this); + hole_axis_le->installEventFilter(this); + base_le->installEventFilter(this); + vplan_le->installEventFilter(this); + + center_le->setReadOnly(true); + hole_axis_le->setReadOnly(true); + base_le->setReadOnly(true); + vplan_le->setReadOnly(true); + + radius_lw_1->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw_1)); + radius_lw_1->setEditTriggers(QAbstractItemView::DoubleClicked); + + radius_lw_2->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(radius_lw_2)); + radius_lw_2->setEditTriggers(QAbstractItemView::DoubleClicked); + + angle_lw->setItemDelegate(new HexaAngleDoubleSpinBoxDelegate(angle_lw)); + angle_lw->setEditTriggers(QAbstractItemView::DoubleClicked); + + height_lw->setItemDelegate(new HexaPositiveDoubleSpinBoxDelegate(height_lw)); + height_lw->setEditTriggers(QAbstractItemView::DoubleClicked); + + connect( add_radius_pb_1, SIGNAL(clicked()), this, SLOT(addRadiusItem1()) ); + connect( del_radius_pb_1, SIGNAL(clicked()), this, SLOT(delRadiusItem1()) ); + + connect( add_radius_pb_2, SIGNAL(clicked()), this, SLOT(addRadiusItem2()) ); + connect( del_radius_pb_2, SIGNAL(clicked()), this, SLOT(delRadiusItem2()) ); + + connect( add_angle_pb, SIGNAL(clicked()), this, SLOT(addAngleItem()) ); + connect( del_angle_pb, SIGNAL(clicked()), this, SLOT(delAngleItem()) ); + + connect( add_height_pb, SIGNAL(clicked()), this, SLOT(addHeightItem()) ); + connect( del_height_pb, SIGNAL(clicked()), this, SLOT(delHeightItem()) ); +} + +// ============================================================== addRadiusItem +void MakeHemiSphereDialog::addRadiusItem1() +{ + QListWidgetItem* previousItem = radius_lw_1->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); + + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); + + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + radius_lw_1->addItem(newItem); +} + +// ============================================================== delRadiusItem +void MakeHemiSphereDialog::delRadiusItem1() +{ + delete radius_lw_1->currentItem(); +} + +// ============================================================== addRadiusItem +void MakeHemiSphereDialog::addRadiusItem2() +{ + QListWidgetItem* previousItem = radius_lw_2->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); -// setProperty( "HexaWidgetType", QVariant::fromValue(ELEMENTS_TREE) ); - installEventFilter(this); + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - sphere_center_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - cross_pt_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); - hole_axis_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - cross_vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); - radial_vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + radius_lw_2->addItem(newItem); +} - sphere_center_le->setValidator( validator ); - cross_pt_le->setValidator( validator ); - hole_axis_le->setValidator( validator ); - cross_vec_le->setValidator( validator ); - radial_vec_le->setValidator( validator ); +// ============================================================== delRadiusItem +void MakeHemiSphereDialog::delRadiusItem2() +{ + delete radius_lw_2->currentItem(); +} +// ============================================================== addAngleItem +void MakeHemiSphereDialog::addAngleItem() +{ + QListWidgetItem* previousItem = angle_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); -// name_le->installEventFilter(this); - sphere_center_le->installEventFilter(this); - cross_pt_le->installEventFilter(this); - hole_axis_le->installEventFilter(this); - cross_vec_le->installEventFilter(this); - radial_vec_le->installEventFilter(this); + double defaultValue = 180.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); - sphere_center_le->setReadOnly(true); - cross_pt_le->setReadOnly(true); - hole_axis_le->setReadOnly(true); - cross_vec_le->setReadOnly(true); - radial_vec_le->setReadOnly(true); + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + angle_lw->addItem(newItem); +} + +// ============================================================== delAngleItem +void MakeHemiSphereDialog::delAngleItem() +{ + delete angle_lw->currentItem(); +} + +// ============================================================== addHeightItem +void MakeHemiSphereDialog::addHeightItem() +{ + QListWidgetItem* previousItem = height_lw->currentItem(); + QListWidgetItem* newItem = new QListWidgetItem(); + + double defaultValue = 1.; + if ( previousItem ) + defaultValue = previousItem->data(Qt::EditRole).toDouble(); + + newItem->setData( Qt::EditRole, QVariant(defaultValue) ); + newItem->setFlags( newItem->flags () | Qt::ItemIsEditable); + height_lw->addItem(newItem); +} + +// ============================================================== delHeightItem +void MakeHemiSphereDialog::delHeightItem() +{ + delete height_lw->currentItem(); +} + +// ============================================================== updateHelpFileName +void MakeHemiSphereDialog::updateHelpFileName() +{ } // ============================================================== clear void MakeHemiSphereDialog::clear() { - sphere_center_le->clear(); - modelUnregister(sphere_center_le); + center_le->clear(); + modelUnregister(center_le); hole_axis_le->clear(); modelUnregister(hole_axis_le); - cross_pt_le->clear(); - modelUnregister(cross_pt_le); - - cross_vec_le->clear(); - modelUnregister(cross_vec_le); + base_le->clear(); + modelUnregister(base_le); - radial_vec_le->clear(); - modelUnregister(radial_vec_le); + vplan_le->clear(); + modelUnregister(vplan_le); modelUnregister(this); } @@ -6669,84 +6104,145 @@ void MakeHemiSphereDialog::clear() // ============================================================== apply bool MakeHemiSphereDialog::apply(QModelIndex& result) { - if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); - _currentObj = NULL; - - SUIT_OverrideCursor wc; - if ( !getDocumentModel() ) return false; - const PatternDataModel* patternDataModel = getPatternDataModel(); - const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); - if ( !patternDataModel || !patternBuilderModel) return false; - - QModelIndex iElts; - QModelIndex icenter = patternDataModel->mapToSource( _index[sphere_center_le] ); - QModelIndex iplorig = patternDataModel->mapToSource( _index[cross_pt_le] ); - QModelIndex ivecx = patternBuilderModel->mapToSource( _index[radial_vec_le] ); - QModelIndex ivecz = patternBuilderModel->mapToSource( _index[hole_axis_le] ); - - double radext = sphere_radext_spb->value(); - double radhole = hole_rad_spb->value(); - - int nrad = ngrid_rad_spb->value(); - int nang = ngrid_ang_spb->value(); - int nhaut = ngrid_height_spb->value(); - - - if ( icenter.isValid() && ivecx.isValid() && ivecz.isValid() && iplorig.isValid() ){ - if ( sphere_rind_cb->isChecked() ){ // rind - double radint = sphere_radint_spb->value(); - if ( radial_partial_cb->isChecked() ){ - double angle = radial_angle_spb->value(); - iElts = getDocumentModel()->makePartRind( icenter, ivecx, ivecz, - radext, radint, radhole, - iplorig, angle, - nrad, nang, nhaut ); - } else { - iElts = getDocumentModel()->makeRind( icenter, - ivecx, ivecz, - radext, radint, radhole, - iplorig, - nrad, nang, nhaut ); - } - } else { // sphere - if ( radial_partial_cb->isChecked() ){ - double angle = radial_angle_spb->value(); - iElts = getDocumentModel()->makePartSphere( icenter, ivecx, ivecz, - radext, radhole, - iplorig, angle, - nrad, nang, nhaut ); - } else { - iElts = getDocumentModel()->makeSphere( icenter, - ivecx, ivecz, - radext, radhole, - iplorig, - nrad, nang, nhaut ); - } - } - } - - - if ( !iElts.isValid() ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE RIND" ) ); - return false; - } - _value = iElts.model()->data(iElts, HEXA_DATA_ROLE).value(); - -// QString newName = name_le->text(); -// if ( !newName.isEmpty() )/*{*/ -// getDocumentModel()->setName( iElts, newName ); -// -// updateDefaultName(name_le, iElts); + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + + DocumentModel* docModel = getDocumentModel(); + PatternDataModel* patternDataModel = getPatternDataModel(); + PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + + QModelIndex iElts; + QModelIndex icenter = patternDataModel->mapToSource( _index[center_le] ); + QModelIndex ivplan = patternDataModel->mapToSource( _index[vplan_le] ); + QModelIndex ivecx = patternBuilderModel->mapToSource( _index[base_le] ); + QModelIndex ivecz = patternBuilderModel->mapToSource( _index[hole_axis_le] ); + + double radhole = hole_rad_spb->value(); + double radext = sphere_radext_spb->value(); + double radint = sphere_radint_spb->value(); + double radang = radial_angle_spb->value(); + + int crit = crit_spb->value(); + int nb = nbre_spb->value(); + int nrad = ngrid_rad_spb->value(); + int nang = ngrid_ang_spb->value(); + int nhaut = ngrid_height_spb->value(); + + //radius, angles and heights collection + QListWidgetItem* item = NULL; + + vector radius1; + vector radius2; + vector angles; + vector heights; + + //angles collection + double somme = 0.; + int nbAngles = angle_lw->count(); + for ( int r = 0; r < nbAngles; ++r){ + item = angle_lw->item(r); + double itemValue = item->data(Qt::EditRole).toDouble(); + angles.push_back(itemValue); + somme += itemValue; + } + + //radius1 collection + int nbRadius = radius_lw_1->count(); + for ( int r = 0; r < nbRadius; ++r){ + item = radius_lw_1->item(r); + radius1.push_back(item->data(Qt::EditRole).toDouble()); + } + + //radius2 collection + nbRadius = radius_lw_2->count(); + for ( int r = 0; r < nbRadius; ++r){ + item = radius_lw_2->item(r); + radius2.push_back(item->data(Qt::EditRole).toDouble()); + } + + //heights collection + int nbHeight = height_lw->count(); + for ( int r = 0; r < nbHeight; ++r){ + item = height_lw->item(r); + heights.push_back(item->data(Qt::EditRole).toDouble()); + } + + if (sphere_rb->isChecked()) + { + if (sphereTop_rb->isChecked()) + iElts = docModel->makeSphereTop( nrad, nang, nhaut ); + else if (sphereUni_rb->isChecked()) + { + if (icenter.isValid() && ivplan.isValid() && ivecx.isValid() && ivecz.isValid()) + iElts = docModel->makeSphereUni(icenter, ivecx, ivecz, radhole, radext, radang, + ivplan, nrad, nang, nhaut); + } + else if (sphere2_rb->isChecked()) + { + if (somme > 360.01) + { + SUIT_MessageBox::information( 0, + tr("HEXA_INFO"), + tr("The sum of the picked angles has to be \nless or equal than %1 degrees.").arg(360)); + return false; + } + if (icenter.isValid() && ivecx.isValid() && ivecz.isValid()) + iElts = docModel->makeSphere(icenter, ivecx, ivecz, radius2, angles, heights); + } + } + else if (spherical_rb->isChecked()) + { + if (sphericalTop_rb->isChecked()) + iElts = docModel->makeSphericalTop(nb, crit); + else if (sphericalUni_rb->isChecked()) + { + if (icenter.isValid() && ivecx.isValid() && ivecz.isValid()) + iElts = docModel->makeSphericalUni(icenter, ivecx, ivecz, radhole, nb, crit); + } + else if (spherical2_rb->isChecked()) + { + if (icenter.isValid() && ivecx.isValid() && ivecz.isValid()) + iElts = docModel->makeSpherical(icenter, ivecx, ivecz, radius1, crit); + } + } + else if (rind_rb->isChecked()) + { + if (rindTop_rb->isChecked()) + iElts = docModel->makeRindTop(nrad, nang, nhaut); + else if (rindUni_rb->isChecked()) + { + if (icenter.isValid() && ivecx.isValid() && ivecz.isValid() && ivplan.isValid()) + iElts = docModel->makeRindUni(icenter, ivecx, ivecz, + radhole, radint, radext, radang, + ivplan, nrad, nang, nhaut); + } + else if (rind2_rb->isChecked()) + { + if (somme > 360.01) + { + SUIT_MessageBox::information( 0, + tr("HEXA_INFO"), + tr("The sum of the picked angles has to be \nless or equal than %1 degrees.").arg(360)); + return false; + } + if (icenter.isValid() && ivecx.isValid() && ivecz.isValid()) + iElts = docModel->makeRind(icenter, ivecx, ivecz, radius2, angles, heights); + } + } - result = patternBuilderModel->mapFromSource(iElts); + if ( !iElts.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE RIND" ) + "\n" + getErrorMsg() ); + return false; + } + _value = iElts.model()->data(iElts, HEXA_DATA_ROLE).value(); + result = patternBuilderModel->mapFromSource(iElts); - return true; + return true; } // ------------------------- ModelInfoDialog ---------------------------------- - ModelInfoDialog::ModelInfoDialog(QWidget* parent, Qt::WindowFlags wf): - HexaBaseDialog(parent, INFO_MODE, wf) + HexaBaseDialog(parent, INFO_MODE, wf) { setupUi( this ); setWindowTitle(HEXABLOCKGUI::tr("MODEL_INFO")); @@ -6785,107 +6281,407 @@ void ModelInfoDialog::showEvent( QShowEvent * event ) QDialog::showEvent ( event ); } - // ============================================================== hideEvent void ModelInfoDialog::hideEvent ( QHideEvent * event ) { - QDialog::hideEvent( event ); + QDialog::hideEvent( event ); } - // ------------------------- AddShapeDialog ---------------------------------- - AddShapeDialog::AddShapeDialog(QWidget* parent, Mode editmode, Qt::WindowFlags wf): - HexaBaseDialog(parent, editmode, wf) + HexaBaseDialog(parent, editmode, wf) { _helpFileName = ""; setupUi( this ); _initWidget(editmode); setWindowTitle(HEXABLOCKGUI::tr("ADD_SHAPE")); - - currentGeomObj.nullify(); } // ============================================================== Destructeur AddShapeDialog::~AddShapeDialog() { - disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(onCurrentSelectionChanged()) ); + disconnect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), + this, SLOT(onCurrentSelectionChanged()) ); } // ============================================================== close void AddShapeDialog::close() { - HEXABLOCKGUI::assocInProgress = false; - HexaBaseDialog::close(); + HEXABLOCKGUI::assocInProgress = false; + HexaBaseDialog::close(); } // ============================================================== _initInputWidget void AddShapeDialog::_initInputWidget( Mode editmode ) { - shape_le->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMSHAPE_TREE) ); - shape_le->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_SHAPE) ); - shape_le->installEventFilter(this); - shape_le->setReadOnly(true); + shape_le->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMSHAPE_TREE) ); + shape_le->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_SHAPE) ); + shape_le->installEventFilter(this); + shape_le->setReadOnly(true); } void AddShapeDialog::clear() { - shape_le->clear(); - shape_le->setProperty("GeomObj", QVariant()); - currentGeomObj.nullify(); + shape_le->clear(); + shape_le->setProperty("GeomObj", QVariant()); - modelUnregister(this); + modelUnregister(this); } // ============================================================== onCurrentSelectionChanged void AddShapeDialog::onCurrentSelectionChanged() { - if ( !isVisible() ) return; - - SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); + SALOME_ListIO selectedObjects; + HEXABLOCKGUI::currentDocGView->getSelected(selectedObjects); + if (selectedObjects.IsEmpty()) + return; - bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type()); - if (!isOCC || getDocumentModel() == NULL) return; + // * extract the TopoDS_Shape of the selected object + TopoDS_Shape selectedTopoShape = GEOMBase::GetTopoFromSelection( selectedObjects ); + if (selectedTopoShape.IsNull()) + return; + shape_le->setProperty("TopoDS_Shape", QVariant::fromValue(selectedTopoShape)); - currentGeomObj = getSelected(TopAbs_SHAPE); - shape_le->setText(GEOMBase::GetName( currentGeomObj.get() )); - - DocumentModel::GeomObj* geomObj = getDocumentModel()->convertToGeomObj(currentGeomObj); - if (geomObj != NULL) - shape_le->setProperty("GeomObj", QVariant::fromValue(*geomObj)); + // * extract the name of the selected shape + QString name; + GEOMBase::GetNameOfSelectedIObjects( selectedObjects, name, true ); + shape_le->setText(name); } // ============================================================== onWindowActivated void AddShapeDialog::onWindowActivated(SUIT_ViewManager* vm) { - QString vmType = vm->getType(); - if ( vmType == OCCViewer_Viewer::Type() ){ - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), TopAbs_SHAPE); - shape_le->setFocus(); - } + QString vmType = vm->getType(); + if ( vmType == OCCViewer_Viewer::Type() ) + shape_le->setFocus(); } - // ============================================================== apply bool AddShapeDialog::apply(QModelIndex& result) { - TopoDS_Shape aShape; - bool assocOK = false; + bool assocOk; + QString shapeName = shape_le->text(); + QVariant v = shape_le->property("TopoDS_Shape"); + if ( !v.isValid() || shapeName.isEmpty()) + assocOk = false; + else + { + TopoDS_Shape shape = v.value(); + if (shape.IsNull()) + assocOk = false; + else + assocOk = getDocumentModel()->addShape(shape, shapeName); + } + + if ( !assocOk ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), HEXABLOCKGUI::tr("ADD_SHAPE_FAILED") + "\n" + getErrorMsg() ); + return false; + } + + return true; +} + + + + + + +//***************************** OBSOLETE: A SUPPRIMER !!!! ************************************// + +// ============================================================== Constructeur +CylinderDialog::CylinderDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) +: HexaBaseDialog(parent, editmode, f), + _value(0) +{ + _helpFileName = "gui_cyl.html"; + setupUi( this ); + _initWidget(editmode); + + if ( editmode == INFO_MODE ){ + setWindowTitle( tr("Cylinder Information") ); + } +} + +// ============================================================== Destructeur +CylinderDialog::~CylinderDialog() +{ +} + +// ============================================================== _initInputWidget +void CylinderDialog::_initInputWidget( Mode editmode ) +{ + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); - if ( currentGeomObj && GEOMBase::GetShape(currentGeomObj.get(), aShape) && !aShape.IsNull() ) + installEventFilter(this); + name_le->installEventFilter(this); + + vex_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + + vex_le->setValidator( validator ); + vec_le->setValidator( validator ); + + vex_le->installEventFilter(this); + vec_le->installEventFilter(this); + + vex_le->setReadOnly(true); + vec_le->setReadOnly(true); + + if (editmode == INFO_MODE) { - QString shapeName = GEOMBase::GetName( currentGeomObj.get() ); - assocOK = getDocumentModel()->addShape(aShape, shapeName); + name_le->setReadOnly(true); + r_spb->setReadOnly(true); + h_spb->setReadOnly(true); + } + +} + +// ============================================================== clear +void CylinderDialog::clear() +{ + name_le->clear(); + + vex_le->clear(); + modelUnregister(vex_le); + + vec_le->clear(); + modelUnregister(vec_le); + + r_spb->clear(); + h_spb->clear(); + + modelUnregister(this); + +} + +// ============================================================== setValue +void CylinderDialog::setValue(HEXA_NS::Cylinder* c) +{ + HEXA_NS::Vertex* base = c->getBase(); + HEXA_NS::Vector* direction = c->getDirection(); + double r = c->getRadius(); + double h = c->getHeight(); + + name_le->setText( c->getName() ); + vex_le->setText( base->getName() ); + vec_le->setText( direction->getName() ); + r_spb->setValue(r); + h_spb->setValue(h); + + if ( getPatternDataSelectionModel() ){ + QModelIndex iCyl = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(c) ); + QModelIndex iBase = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(base) ); + QModelIndex iDirection = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(direction) ); + + name_le->setProperty( "QModelIndex", QVariant::fromValue(iCyl) ); + vex_le->setProperty( "QModelIndex", QVariant::fromValue(iBase) ); + vec_le->setProperty( "QModelIndex", QVariant::fromValue(iDirection) ); } + _value = c; +} - if ( !assocOK ){ - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), HEXABLOCKGUI::tr("ADD_SHAPE_FAILED") ); +// ============================================================== getValue +HEXA_NS::Cylinder* CylinderDialog::getValue() +{ + return _value; +} + +// ============================================================== apply +bool CylinderDialog::apply(QModelIndex& result) +{ + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; + + QModelIndex iCyl; + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); + double r = r_spb->value(); + double h = h_spb->value(); + + if ( ivex.isValid() + && ivec.isValid() ){ + iCyl = getDocumentModel()->addCylinder( ivex, ivec, r, h ); + } + + if ( !iCyl.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD CYLINDER" ) ); return false; } - getDocumentModel()->clearGeometry(); - getDocumentModel()->fillGeometry(); + _value = iCyl.model()->data(iCyl, HEXA_DATA_ROLE).value(); + + QString newName = name_le->text(); + if (!newName.isEmpty()) /*{*/ + getDocumentModel()->setName( iCyl, newName ); + + //update the default name in the dialog box + if (_value != NULL) + updateDefaultName(name_le, _value->getType()); + + // to select/highlight result + result = patternBuilderModel->mapFromSource(iCyl); + return true; } + +//------------------------------- PipeDialog ----------------------------------- + +// ============================================================== Constructeur + +PipeDialog::PipeDialog( QWidget* parent, Mode editmode, Qt::WindowFlags f ) +: HexaBaseDialog(parent, editmode, f), + _value(0) +{ + _helpFileName = "gui_pipe.html"; + setupUi( this ); + _initWidget(editmode); + // setFocusProxy( vex_le ); + + if ( editmode == INFO_MODE ){ + setWindowTitle( tr("Pipe Information") ); + } + +} + +// ============================================================== Destructeur +PipeDialog::~PipeDialog() +{ +} + +// ============================================================== _initInputWidget +void PipeDialog::_initInputWidget( Mode editmode ) +{ + QRegExp rx(""); + QValidator *validator = new QRegExpValidator(rx, this); + + installEventFilter(this); + name_le->installEventFilter(this); + + //Vertex Field config + vex_le->setProperty( "HexaWidgetType", QVariant::fromValue(VERTEX_TREE) ); + vex_le->installEventFilter(this); + vex_le->setValidator( validator ); + + //Vector Field config + vec_le->setProperty( "HexaWidgetType", QVariant::fromValue(VECTOR_TREE) ); + vec_le->installEventFilter(this); + vec_le->setValidator( validator ); + + + if ( editmode == INFO_MODE ){ + name_le->setReadOnly(true); + ir_spb->setReadOnly(true); + er_spb->setReadOnly(true); + h_spb->setReadOnly(true); + } + + vex_le->setReadOnly(true); + vec_le->setReadOnly(true); + + //connect( name_le, SIGNAL(returnPressed()), this, SLOT(updateName())); +} + +// ============================================================== clear +void PipeDialog::clear() +{ + name_le->clear(); + + vex_le->clear(); + modelUnregister(vex_le); + + vec_le->clear(); + modelUnregister(vec_le); + + modelUnregister(this); +} + +// ============================================================== setValue +void PipeDialog::setValue(HEXA_NS::Pipe* p) +{ + HEXA_NS::Vertex* base = p->getBase(); + HEXA_NS::Vector* direction = p->getDirection(); + double ir = p->getInternalRadius(); + double er = p->getRadius(); + double h = p->getHeight(); + + name_le->setText( p->getName() ); + vex_le->setText( base->getName() ); + vec_le->setText( direction->getName() ); + ir_spb->setValue(ir); + er_spb->setValue(er); + h_spb->setValue(h); + + if ( getPatternDataSelectionModel() ){ + QModelIndex iPipe = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(p) ); + QModelIndex iBase = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(base) ); + QModelIndex iDirection = getPatternDataSelectionModel()->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(direction) ); + + name_le->setProperty( "QModelIndex", QVariant::fromValue(iPipe) ); + vex_le->setProperty( "QModelIndex", QVariant::fromValue(iBase) ); + vec_le->setProperty( "QModelIndex", QVariant::fromValue(iDirection) ); + } + _value = p; +} + +// ============================================================== getValue +HEXA_NS::Pipe* PipeDialog::getValue() +{ + return _value; +} + +// ============================================================== apply +bool PipeDialog::apply(QModelIndex& result) +{ + if (_currentObj != NULL) _highlightWidget(_currentObj, Qt::white); + _currentObj = NULL; + + if ( !getDocumentModel() ) return false; + const PatternDataModel* patternDataModel = getPatternDataModel(); + const PatternBuilderModel* patternBuilderModel = getPatternBuilderModel(); + if ( !patternDataModel || !patternBuilderModel) return false; + + QModelIndex iPipe; + QModelIndex ivex = patternDataModel->mapToSource( _index[vex_le] ); + QModelIndex ivec = patternBuilderModel->mapToSource( _index[vec_le] ); + double ir = ir_spb->value(); + double er = er_spb->value(); + double h = h_spb->value(); + + if (ir >= er) { + SUIT_MessageBox::information( this, tr( "CANNOT ADD PIPE" ), tr( "External radius must be greather than Internal radius!" ) ); + return false; + } + + + if ( ivex.isValid() + && ivec.isValid() ){ + iPipe = getDocumentModel()->addPipe( ivex, ivec, ir, er, h ); + } + + if ( !iPipe.isValid() ){ + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT ADD PIPE" ) ); + return false; + } + _value = iPipe.model()->data(iPipe, HEXA_DATA_ROLE).value(); + + QString newName = name_le->text(); + if ( !newName.isEmpty() )/*{*/ + getDocumentModel()->setName( iPipe, newName ); + + //update the default name in the dialog box + if (_value != NULL) + updateDefaultName(name_le, _value->getType()); + + // to select/highlight result + result = patternBuilderModel->mapFromSource(iPipe); + + return true; +} +// ************************************** FIN A SUPPRIMER ******************************************// + diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx index 70eab78..2d1c08c 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentPanel.hxx @@ -68,7 +68,6 @@ #include "ui_Law_QTD.h" #include "ui_Propagation_QTD.h" - #include "ui_QuadRevolution_QTD.h" #include "ui_MakeRind_QTD.h" #include "ui_ReplaceHexa_QTD.h" @@ -76,11 +75,6 @@ #include "ui_ModelInfo_QTD.h" #include "ui_AddShapeDialog_QTD.h" - -#include "MyGEOMBase_Helper.hxx" - - - #include "HexVertex.hxx" #include "HexEdge.hxx" #include "HexQuad.hxx" @@ -90,23 +84,17 @@ #include "HEXABLOCKGUI_DocumentSelectionModel.hxx" #include "HEXABLOCKGUI_DocumentModel.hxx" #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" -// #include "HEXABLOCKGUI_SalomeTools.hxx" #include "HEXABLOCKGUI.hxx" #include "klinkitemselectionmodel.hxx" - Q_DECLARE_METATYPE(QModelIndex); -Q_DECLARE_METATYPE(HEXABLOCK::GUI::DocumentModel::GeomObj); -Q_DECLARE_METATYPE(GEOM::GeomObjPtr); - -// class MyBasicGUI_PointDlg; namespace HEXABLOCK { namespace GUI { - class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT HexaBaseDialog : public QDialog, public MyGEOMBase_Helper + class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT HexaBaseDialog : public QDialog { Q_OBJECT @@ -119,13 +107,10 @@ namespace HEXABLOCK // define input widget type => usefull for selection typedef HexaTreeRole HexaWidgetType; - typedef TopAbs_ShapeEnum/*int */GeomWidgetType; //CS_TODO - - // TopAbs_ShapeEnum aType = TopAbs_EDGE; + typedef TopAbs_ShapeEnum GeomWidgetType; //CS_TODO - // listwidget enum { - LW_QMODELINDEX_ROLE = Qt::UserRole + 1, + LW_QMODELINDEX_ROLE = Qt::UserRole + 1, LW_ASSOC_ROLE, LW_GEOM_OBJ_ROLE, LW_DATA_ROLE @@ -136,6 +121,7 @@ namespace HEXABLOCK // clear all input widget virtual void clear(){}; + void clearWidgetsIndexes() { _index.clear(); } void connectDocumentGraphicView(VtkDocumentGraphicView* docGView = NULL); void disconnectDocumentGraphicView(VtkDocumentGraphicView* docGView = NULL); @@ -190,6 +176,8 @@ namespace HEXABLOCK return HEXABLOCKGUI::currentDocGView->getMeshSelectionModel(); } + QString getErrorMsg(); + HEXABLOCKGUI::ViewType getObjectViewType(QObject* obj); void modelUnregister(QWidget* widget); //unlink the widget from the model void resetSizeAndShow(QDockWidget* parent); @@ -211,7 +199,6 @@ namespace HEXABLOCK bool autoFocusSwitch; public slots: - //virtual void accept(); virtual bool apply(); virtual void close(); virtual void onHelpRequested(); @@ -235,9 +222,7 @@ namespace HEXABLOCK virtual void _initInputWidget( Mode editmode )=0; //must be implemented on inherited dialog box virtual QGroupBox* _initButtonBox( Mode editmode ); void _initWidget( Mode editmode ); // call _initInputWidget() & _initButtonBox() - QModelIndexList getIndexList(QListWidget* itemsList); - - void _initViewManager(); + QModelIndexList getIndexList(QListWidget* itemsList, bool mapToSource = true); void _allowSelection(); void _disallowSelection(); @@ -247,10 +232,6 @@ namespace HEXABLOCK bool _allowOCCSelection( QObject* obj ); QItemSelectionModel* _getSelector( QObject* obj ); - - bool _onSelectionChanged( const QItemSelection& sel, QLineEdit* le ); - bool _onSelectionChanged( const QItemSelection& sel, QListWidget* lw ); - void _selectAndHighlight( const QModelIndex& i ); void _highlightWidget(QObject* obj, Qt::GlobalColor clr); @@ -263,15 +244,8 @@ namespace HEXABLOCK QMap _index; QObject* _currentObj; - - int _expectedSelection; - bool _selectionMutex; - QMap _strHexaWidgetType; - - //QPushButton* _applyCloseButton; QPushButton* _applyButton; - QString _helpFileName; private: @@ -280,6 +254,8 @@ namespace HEXABLOCK protected slots: virtual void onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel ); //from qt model/view selectionManager virtual void onCurrentSelectionChanged();//from salome selectionManager + bool _onSelectionChanged( const QItemSelection& sel, QLineEdit* le ); + bool _onSelectionChanged( const QItemSelection& sel, QListWidget* lw ); virtual void updateButtonBox(); void updateName(); virtual void selectElementOfModel(); @@ -306,7 +282,6 @@ namespace HEXABLOCK public slots: virtual bool apply(QModelIndex& result); - // void updateName(); protected: void _initInputWidget( Mode editmode ); @@ -336,7 +311,6 @@ namespace HEXABLOCK public slots: virtual bool apply(QModelIndex& result); - // void updateName(); private: HEXA_NS::Edge *_value; @@ -360,7 +334,6 @@ namespace HEXABLOCK public slots: virtual bool apply(QModelIndex& result); - // void updateName(); protected: void _initInputWidget( Mode editmode ); @@ -423,7 +396,6 @@ namespace HEXABLOCK public slots: virtual bool apply(QModelIndex& result); - // void updateName(); protected: void _initInputWidget( Mode editmode ); @@ -433,65 +405,6 @@ namespace HEXABLOCK QModelIndex _ivalue; }; - - - class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT CylinderDialog : public HexaBaseDialog, - public Ui::CylinderDialog - { - Q_OBJECT - - public: - CylinderDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 ); - virtual ~CylinderDialog(); - - void clear(); - - void setValue( HEXA_NS::Cylinder* v ); - HEXA_NS::Cylinder* getValue(); - - public slots: - virtual bool apply(QModelIndex& result); - // void updateName(); - - protected: - void _initInputWidget( Mode editmode ); - - private: - HEXA_NS::Cylinder *_value; - QModelIndex _ivalue; - }; - - - - class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT PipeDialog : public HexaBaseDialog, - public Ui::PipeDialog - { - Q_OBJECT - - public: - PipeDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 ); - virtual ~PipeDialog(); - - void clear(); - - void setValue( HEXA_NS::Pipe* p ); - HEXA_NS::Pipe* getValue(); - - public slots: - virtual bool apply(QModelIndex& result); - // void updateName(); - - protected: - void _initInputWidget( Mode editmode ); - - private: - HEXA_NS::Pipe *_value; - QModelIndex _ivalue; - - }; - - - class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeGridDialog : public HexaBaseDialog, public Ui::MakeGridDialog { @@ -516,14 +429,11 @@ namespace HEXABLOCK void delAngleItem(); void addHeightItem(); void delHeightItem(); - void updateButtonBox(); void updateHelpFileName(); }; - - class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeCylinderDialog : public HexaBaseDialog, public Ui::MakeCylinderDialog { @@ -538,6 +448,15 @@ namespace HEXABLOCK protected: void _initInputWidget( Mode editmode ); + protected slots: + void addRadiusItem(); + void delRadiusItem(); + void addAngleItem(); + void delAngleItem(); + void addHeightItem(); + void delHeightItem(); + void updateHelpFileName(); + public slots: virtual bool apply(QModelIndex& result); }; @@ -559,6 +478,15 @@ namespace HEXABLOCK protected: void _initInputWidget( Mode editmode ); + + protected slots: + void addRadiusItem(); + void delRadiusItem(); + void addAngleItem(); + void delAngleItem(); + void addHeightItem(); + void delHeightItem(); + void updateHelpFileName(); }; @@ -666,6 +594,10 @@ namespace HEXABLOCK protected: void _initInputWidget( Mode editmode ); + protected slots: + void addHeightItem(); + void delHeightItem(); + private slots: void addQuad(); void removeQuad(); @@ -698,7 +630,6 @@ namespace HEXABLOCK }; - class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT DisconnectDialog : public HexaBaseDialog, public Ui::DisconnectDialog { @@ -736,6 +667,10 @@ namespace HEXABLOCK void clear(); + protected slots: + void addHeightItem(); + void delHeightItem(); + public slots: virtual bool apply(QModelIndex& result); @@ -833,12 +768,7 @@ namespace HEXABLOCK void updateHelpFileName(); }; - - // typedef class MyBasicGUI_PointDlg VertexAssocDialog; - - - - class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT EdgeAssocDialog : public HexaBaseDialog, +class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT EdgeAssocDialog : public HexaBaseDialog, public Ui::EdgeAssocDialog { Q_OBJECT @@ -850,8 +780,6 @@ namespace HEXABLOCK virtual QModelIndexList getAssocsVTK(); virtual QMultiMap getAssocsGEOM(); virtual void setCurrentGeomObj(DocumentModel::GeomObj* geomObj) { myLine = geomObj; } - void setGeomEngine( GEOM::GEOM_Gen_var geomEngine ); - public slots: virtual bool apply(QModelIndex& result); @@ -860,34 +788,20 @@ namespace HEXABLOCK protected: virtual void _initInputWidget( Mode editmode ); - // virtual void hideEvent ( QHideEvent * event ); - // virtual void showEvent ( QShowEvent * event ); - virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool execute( ObjectList& ); protected slots: - virtual void onCurrentSelectionChanged(); - // void onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel ); virtual void selectElementOfGeom(); void updateHelpFileName(); - void deleteEdgeItem(); - void deleteLineItem(); - - void addLine(); - void pstartChanged( double val ); - void pendChanged( double val ); + void deleteEdgeItem(){ + delete edges_lw->currentItem(); + } + void deleteLineItem(){ + delete lines_lw->currentItem(); + }; private: - // QModelIndexList currentAssocList; - // Preview in GEOM - // GEOM::GeomObjPtr _firstLine; - // GEOM::GeomObjPtr _lastLine; - GEOM::GeomObjPtr _currentLine; -// GEOM::GeomObjPtr myLine; DocumentModel::GeomObj* myLine; - double _currentParameter; - GEOM::GEOM_Gen_var _geomEngine ; }; @@ -911,11 +825,8 @@ namespace HEXABLOCK protected: virtual void _initInputWidget( Mode editmode ); - // virtual void hideEvent ( QHideEvent * event ); - // virtual void showEvent ( QShowEvent * event ); protected slots: - virtual void onCurrentSelectionChanged(); void deleteFaceItem(); virtual void selectElementOfGeom(); @@ -949,9 +860,7 @@ namespace HEXABLOCK void _initInputWidget( Mode editmode ); private slots: - // void addEltBase(); void removeEltBase(); - // void clearEltBase(); void onKindChanged( int index ); private: @@ -1034,8 +943,6 @@ namespace HEXABLOCK public slots: virtual bool apply(QModelIndex& result); - // virtual void accept(); - // virtual void reject(); protected: void _initInputWidget( Mode editmode ); @@ -1099,7 +1006,6 @@ namespace HEXABLOCK void addAngleItem(); void delAngleItem(); void delQuadItem(); - void updateButtonBox(); private: HEXA_NS::Elements *_value; @@ -1117,15 +1023,23 @@ namespace HEXABLOCK virtual ~MakeHemiSphereDialog(); void clear(); - // void setValue(HEXA_NS::Propagation* v); - // HEXA_NS::Propagation* getValue(); - public slots: virtual bool apply(QModelIndex& result); protected: void _initInputWidget( Mode editmode ); + protected slots: + void addRadiusItem1(); + void delRadiusItem1(); + void addRadiusItem2(); + void delRadiusItem2(); + void addAngleItem(); + void delAngleItem(); + void addHeightItem(); + void delHeightItem(); + void updateHelpFileName(); + private: HEXA_NS::Elements *_value; }; @@ -1169,28 +1083,62 @@ namespace HEXABLOCK protected slots: virtual void onCurrentSelectionChanged(); - - private: - GEOM::GeomObjPtr currentGeomObj; }; - // class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MakeRindDialog : public HexaBaseDialog, - // public Ui::MakeRindDialog - // { - // Q_OBJECT - // - // public: - // MakeRindDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 ); - // virtual ~MakeRindDialog(); - // - // public slots: - // virtual bool apply(QModelIndex& result); - // - // private: - // // HEXA_NS::Propagation *_value;:q - // - // }; + //***************************** OBSOLETE: A SUPPRIMER !!!! ************************************// + + class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT CylinderDialog : public HexaBaseDialog, + public Ui::CylinderDialog + { + Q_OBJECT + + public: + CylinderDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 ); + virtual ~CylinderDialog(); + + void clear(); + + void setValue( HEXA_NS::Cylinder* v ); + HEXA_NS::Cylinder* getValue(); + + public slots: + virtual bool apply(QModelIndex& result); + + protected: + void _initInputWidget( Mode editmode ); + + private: + HEXA_NS::Cylinder *_value; + QModelIndex _ivalue; + }; + + class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT PipeDialog : public HexaBaseDialog, + public Ui::PipeDialog + { + Q_OBJECT + + public: + PipeDialog( QWidget* = 0, Mode = NEW_MODE, Qt::WindowFlags = Qt::SubWindow );//= 0 ); + virtual ~PipeDialog(); + + void clear(); + + void setValue( HEXA_NS::Pipe* p ); + HEXA_NS::Pipe* getValue(); + + public slots: + virtual bool apply(QModelIndex& result); + + protected: + void _initInputWidget( Mode editmode ); + + private: + HEXA_NS::Pipe *_value; + QModelIndex _ivalue; + + }; + // ************************************** FIN A SUPPRIMER ******************************************// } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.cxx index 23b483b..f72a28d 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.cxx @@ -61,11 +61,11 @@ #include #include #include +#include #include #include "GEOMBase.h" -#include "MyGEOMBase_Helper.hxx" #include #include @@ -91,15 +91,10 @@ using namespace HEXABLOCK::GUI; // //=========================================================================== SelectionModel::SelectionModel( QAbstractItemModel * model ): -QItemSelectionModel( model ), -//_theModelSelectionChanged(false), -//_theVtkSelectionChanged(false), -//_theGeomSelectionChanged(false), -ignoreSignal(false), -salomeNothingSelected(true) +QItemSelectionModel( model ) { -} +} SelectionModel::~SelectionModel() { @@ -161,64 +156,51 @@ QModelIndexList SelectionModel::indexListOf( const QString& anEntry, int role ) const QAbstractItemModel* theModel = model(); if ( !theModel ) return theIndexes; theIndexes = theModel->match( theModel->index(0, 0), - role, - anEntry, - -1, - Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString ); + role, + anEntry, + -1, + Qt::MatchRecursive | Qt::MatchContains );//Qt::MatchFixedString ); return theIndexes; } - - void SelectionModel::salomeSelectionChanged() { - if (HEXABLOCKGUI::assocInProgress && - HEXABLOCKGUI::getActiveViewType() == HEXABLOCKGUI::OCC) return; - - try { - - if ( HEXABLOCKGUI::selectionMgr() == NULL ) return; - SALOME_ListIO salomeSelected; -// _salomeSelectionMgr->selectedObjects( salomeSelected, SVTK_Viewer::Type() );//salomeSelected.Extent() - if (HEXABLOCKGUI::getActiveViewType() == HEXABLOCKGUI::VTK) - { - HEXABLOCKGUI::selectionMgr()->selectedObjects( salomeSelected, SVTK_Viewer::Type()); - } - else if (HEXABLOCKGUI::getActiveViewType() == HEXABLOCKGUI::OCC) - { - HEXABLOCKGUI::selectionMgr()->selectedObjects( salomeSelected, "", false); - } - -// HEXABLOCKGUI::selectionMgr()->selectedObjects( salomeSelected, NULL, false ); - if ( salomeSelected.IsEmpty() ){ - salomeNothingSelected = true; - clearSelection(); - return; - } - - Handle(SALOME_InteractiveObject) anIObject; - SALOME_ListIteratorOfListIO it(salomeSelected); - - //Handle selection according to the source - if (HEXABLOCKGUI::getActiveViewType() == HEXABLOCKGUI::VTK) - { - for( ; it.More(); it.Next()){ - anIObject = it.Value(); //anIObject->getName() - vtkSelectionChanged( anIObject ); // or VTK?... + // clear highlights and selections in the trees + PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel(); + PatternBuilderSelectionModel* pbsm = HEXABLOCKGUI::currentDocGView->getPatternBuilderSelectionModel(); + PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); + pdsm->clearSelection(); + pbsm->clearSelection(); + pgsm->clearSelection(); + pdsm->unhighlightTreeItems(); + pgsm->unhighlightTreeItems(); + + try { + SALOME_ListIO selectedObjects; + Handle(SALOME_InteractiveObject) anIObject; + + switch (HEXABLOCKGUI::getActiveViewType()) + { + case HEXABLOCKGUI::VTK: + { + HEXABLOCKGUI::currentDocGView->getSelected(selectedObjects); + if ( selectedObjects.IsEmpty() ) + return; + anIObject = selectedObjects.First(); + vtkSelectionChanged( anIObject ); + break; } - } - else if (HEXABLOCKGUI::getActiveViewType() == HEXABLOCKGUI::OCC) - { - for( ; it.More(); it.Next()){ - anIObject = it.Value(); //anIObject->getName() - geomSelectionChanged( anIObject );// or VTK?... + case HEXABLOCKGUI::OCC: + HEXABLOCKGUI::currentOccGView->getSelected(selectedObjects); + if ( selectedObjects.IsEmpty() ) + return; + anIObject = selectedObjects.First(); + geomSelectionChanged( anIObject ); + break; } + } catch ( ... ) { + MESSAGE("* Unknown selection exception!"); } - - salomeNothingSelected = false; - } catch ( ... ) { - MESSAGE("* Unknown exception was cought !!!"); - } } @@ -257,47 +239,6 @@ QModelIndexList SelectionModel::getSelectionFromModel(const Handle(SALOME_Intera return selectedIndexes; } -//Returns the element of the model which is associated to the Interactive object -QModelIndexList SelectionModel::getSelectionAssociactions(const Handle(SALOME_InteractiveObject)& anIObject) -{ - QModelIndexList assocsIndexes; - DocumentModel *docModel = NULL; - const QSortFilterProxyModel *pModel = dynamic_cast( model() ); - if ( pModel != NULL) - docModel = dynamic_cast( pModel->sourceModel() ); - - if ( docModel == NULL) return assocsIndexes; - - //verify if the selection is really from OCC View - bool fromGEOM = ( strcmp("GEOM", anIObject->getComponentDataType()) == 0 ); - if ( !fromGEOM || HEXABLOCKGUI::selectionMgr() == NULL || - HEXABLOCKGUI::currentOccGView->getViewWindow() == NULL) - return assocsIndexes; - -// QString aName; - GEOM::GEOM_Object_var aGeomObj = GEOMBase::ConvertIOinGEOMObject( anIObject ); - - //extract associated elements in the model - if ( GEOMBase::IsShape(aGeomObj) ){ -// aName = GEOMBase::GetName(aGeomObj); - TColStd_IndexedMapOfInteger anIndexes; - HEXABLOCKGUI::selectionMgr()->GetIndexes(anIObject, anIndexes); - if (anIndexes.Extent() == 0) return assocsIndexes; - QString aGeomObjStudyEntry = aGeomObj->GetStudyEntry(); - - for( int i = 1; i <= anIndexes.Extent(); ++i) - { - QString aGeomObjModelEntry = docModel->getGeomObjName(aGeomObjStudyEntry) + "," + QString::number(anIndexes(i)) + ";"; - assocsIndexes.append(indexListOf(aGeomObjModelEntry, HEXA_ASSOC_ENTRY_ROLE)); - if (assocsIndexes.count() > 0) - return assocsIndexes; //Premature: On purpose for Monoselection - } - } - - return assocsIndexes; -} - - // //=========================================================================== // PatternDataSelectionModel // //=========================================================================== @@ -328,34 +269,66 @@ void PatternDataSelectionModel::onCurrentChanged( const QModelIndex & current, c HEXABLOCKGUI::currentOccGView->setSelectionMode( current ); } -void PatternDataSelectionModel::highlightEltsWithAssocs(const QModelIndexList& elts) +void PatternDataSelectionModel::highlightTreeItems(QModelIndexList& indexes, + Qt::GlobalColor bgColor, + Qt::GlobalColor fgColor, bool only) +{ + if (indexes.count() == 0) + return; + + if (only) + unhighlightTreeItems(); + + // * highlight item + QAbstractItemModel* theModel = (QAbstractItemModel*) model(); + QMap roles; + roles[Qt::BackgroundRole] = bgColor; + roles[Qt::ForegroundRole] = fgColor; + foreach( const QModelIndex& anItemIndex, indexes ) + { + if (anItemIndex.isValid()) + { + theModel->setItemData(anItemIndex, roles); + currentHighlightedItems << anItemIndex; + } + } + + // * scroll to the first highlighted item in the tree + HEXABLOCKGUI* module = HEXABLOCKGUI::getInstance(); + if (module != NULL && indexes[0].isValid()) + module->getPatternDataTreeView()->scrollTo(indexes[0]); +} + +void PatternDataSelectionModel::unhighlightTreeItems(bool clearSelected) { - try { - /*if ( !_theVtkSelectionChanged )*/ - HEXABLOCKGUI::currentDocGView->highlight(elts); - /*if ( !_theGeomSelectionChanged )*/ - HEXABLOCKGUI::currentOccGView->highlight(elts); - } catch ( ... ) { - MESSAGE("Unknown exception was cought !!!"); - } + if (clearSelected) + clearSelection(); + if (currentHighlightedItems.count() == 0) + return; + + QAbstractItemModel* theModel = (QAbstractItemModel*) model(); + QMap roles; + roles[Qt::BackgroundRole] = Qt::white; + roles[Qt::ForegroundRole] = Qt::darkGreen; + foreach( const QModelIndex& anItemIndex, currentHighlightedItems) + { + if (anItemIndex.isValid()) + theModel->setItemData(anItemIndex, roles); + } + currentHighlightedItems.clear(); } QModelIndexList PatternDataSelectionModel::getGeomAssociations(const QModelIndex& dataIndex) { QModelIndexList geomIndexList; - HEXA_NS::SubShape* ssh; - HEXA_NS::EdgeShape* sh; - if (HEXABLOCKGUI::currentDocGView == NULL) return geomIndexList; - DocumentModel *docModel = NULL; const QSortFilterProxyModel *pModel = dynamic_cast( model() ); - PatternGeomModel* pGModel = HEXABLOCKGUI::currentDocGView->getPatternGeomModel(); PatternGeomSelectionModel* pGSModel = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); if ( pModel != NULL) docModel = dynamic_cast( pModel->sourceModel() ); - if (docModel == NULL || pGModel == NULL || pGSModel == NULL) + if (docModel == NULL || pGSModel == NULL) return geomIndexList; HEXA_NS::Vertex* vertex = docModel->getHexaPtr(dataIndex); @@ -364,139 +337,99 @@ QModelIndexList PatternDataSelectionModel::getGeomAssociations(const QModelIndex QModelIndex index = pModel->mapToSource(dataIndex); if (vertex != NULL) - geomIndexList << docModel->getVertexAssociation( index/*dataIndex*/ ); + geomIndexList << docModel->getVertexAssociation( index ); else if (edge != NULL) - { - QList assocs = docModel->getEdgeAssociations( index/*dataIndex*/ ); - foreach( const DocumentModel::GeomObj& anAssoc, assocs ) - { - QString id = anAssoc.shapeName+","+anAssoc.subid; - ssh = docModel->getGeomPtr(id); - sh = dynamic_cast(ssh); - if (sh != NULL) - geomIndexList << /*pGModel->mapToSource(*/pGSModel->indexBy( HEXA_DATA_ROLE, QVariant::fromValue(sh))/*)*/; - } - } + geomIndexList = docModel->getEdgeAssociations( index ); else if ( quad != NULL) - geomIndexList = docModel->getQuadAssociations( index/*dataIndex*/ ); - + geomIndexList = docModel->getQuadAssociations( index ); return geomIndexList; } - void PatternDataSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ) { -// if (ignoreSignal) -// { -// MESSAGE("PatternDataSelectionModel: ignoring this signal"); -// ignoreSignal = false; -// return; -// } - //need to highlight the associated geom obj in the geometry tree - //first get the association - QModelIndexList associatedGeomIndexes; QModelIndexList indexes = selected.indexes(); - highlightEltsWithAssocs(indexes); - -// //highlight in geom -// if (HEXABLOCKGUI::currentDocGView == NULL || indexes.count() == 0) return; -// associatedGeomIndexes = getGeomAssociations(indexes[0]); //Mono Selection -// if (associatedGeomIndexes.count() == 0) -// { -// MESSAGE("ON SELECTION CHANGED: no association found: returning..."); -// HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel()->setIgnoreSignal(false); -// return; -// } -// if (associatedGeomIndexes[0].isValid()) -// { -//// MESSAGE("Association found: but not selecting... now returning"); -//// return; -// //tell geom selection model to ignore this signal -// HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel()->setIgnoreSignal(true); -// -// //selection of the associated element in the geometry tree -//// HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel()->setCurrentIndex( associatedGeomIndexes[0], -//// QItemSelectionModel::Clear ); -// const QSortFilterProxyModel *pModel = dynamic_cast( HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel()->model() ); -// if (pModel == NULL) -// { -// HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel()->setIgnoreSignal(false); -// return; -// } -// MESSAGE("SELECTING THE GEOM TREE INDEX NOW: "); -// MESSAGE(HEXABLOCKGUI::currentDocGView->getDocumentModel()->getHexaPtr(associatedGeomIndexes[0])->getName()); -// -// HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel()->setCurrentIndex( associatedGeomIndexes[0], -// QItemSelectionModel::ClearAndSelect ); -// } -} + if (indexes.count() == 0) + return; + // ** unhighlight current highlighted items in the trees + PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); + if (pgsm == NULL) + return; + unhighlightTreeItems(false); + + QModelIndexList associatedGeomIndexes = getGeomAssociations(indexes[0]); //Mono Selection + if (associatedGeomIndexes.count() == 0) + pgsm->unhighlightTreeItems(); + + // ** highlight association in geometry tree + pgsm->highlightTreeItems(associatedGeomIndexes); + + // ** highlight association in the vtk view + HEXABLOCKGUI::currentDocGView->highlight(indexes); + + // ** highlight association in the occ view + HEXABLOCKGUI::currentOccGView->highlight(indexes); + +} void PatternDataSelectionModel::geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) { - if (HEXABLOCKGUI::assocInProgress) return; +// if (HEXABLOCKGUI::assocInProgress) return; -// QModelIndexList assocsIndexes = getSelectionAssociactions(anIObject); - PatternGeomSelectionModel* pgsm = NULL; - if (HEXABLOCKGUI::currentDocGView != NULL) - pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); + PatternGeomSelectionModel* pgsm = HEXABLOCKGUI::currentDocGView->getPatternGeomSelectionModel(); if (pgsm == NULL) return; QModelIndex geomModelIndex = pgsm->getModelIndex(anIObject); - clearSelection(); - if (!geomModelIndex.isValid()) return; - pgsm->setCurrentIndex( geomModelIndex, QItemSelectionModel::Clear ); //CS_TEST - pgsm->setCurrentIndex( geomModelIndex, QItemSelectionModel::SelectCurrent ); + if (!geomModelIndex.isValid()) + return; + pgsm->select( geomModelIndex, QItemSelectionModel::SelectCurrent ); } void PatternDataSelectionModel::vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) { - QModelIndexList selectedIndexes = getSelectionFromModel(anIObject); - if (selectedIndexes.count() == 0) - { - clearSelection(); - return; - } - // _theVtkSelectionChanged = true; - QModelIndex anIOIndex = selectedIndexes[0]; //Monoselection - - //Temporary Debug for hexa selection ----------------------------- - if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == HEXA_TREE) - { - DocumentModel *docModel = NULL; - const QSortFilterProxyModel *pModel = dynamic_cast( model() ); - - if ( pModel != NULL){ - docModel = dynamic_cast( pModel->sourceModel() ); - if ( docModel != NULL && anIOIndex.isValid()) - { - //get the selected quad - HEXA_NS::Quad* quad = docModel->getHexaPtr(anIOIndex); - - if (quad != NULL) - { - //get the hexa the quad belongs to - HEXA_NS::Hexa* hexa = docModel->getQuadHexa(quad); - if (hexa != NULL) //convert the hexa to a QModelIndex so we can select it in the model - anIOIndex = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(hexa)); - else - { - SUIT_MessageBox::critical( 0, - tr("HexaBlock"), - tr("The Hexahedron this quad belongs to has been deleted!")); - return; - } - } - } - } - }//end if HEXA_TREE---------------------------------------------- + QModelIndexList selectedIndexes = getSelectionFromModel(anIObject); + if (selectedIndexes.count() == 0) + { + clearSelection(); + return; + } + QModelIndex anIOIndex = selectedIndexes[0]; //Monoselection + + //Temporary Debug for hexa selection ------------------------------ + if (HEXABLOCKGUI::currentDocGView->getSelectionMode() == HEXA_TREE) + { + DocumentModel *docModel = NULL; + const QSortFilterProxyModel *pModel = dynamic_cast( model() ); + + if ( pModel != NULL){ + docModel = dynamic_cast( pModel->sourceModel() ); + if ( docModel != NULL && anIOIndex.isValid()) + { + //get the selected quad + HEXA_NS::Quad* quad = docModel->getHexaPtr(anIOIndex); + + if (quad != NULL) + { + //get the hexa the quad belongs to + HEXA_NS::Hexa* hexa = docModel->getQuadHexa(quad); + if (hexa != NULL) //convert the hexa to a QModelIndex so we can select it in the model + anIOIndex = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(hexa)); + else + { + SUIT_MessageBox::critical( 0, + tr("HexaBlock"), + tr("The Hexahedron this quad belongs to has been deleted!")); + return; + } + } + } + } + }//end if HEXA_TREE----------------------------------------------- - //select the element in the model - setCurrentIndex( anIOIndex, QItemSelectionModel::Clear ); - setCurrentIndex( anIOIndex, QItemSelectionModel::SelectCurrent ); - // _theVtkSelectionChanged = false; + //select the element in the model + select( anIOIndex, QItemSelectionModel::SelectCurrent ); } // //=========================================================================== @@ -520,32 +453,29 @@ PatternGeomSelectionModel::~PatternGeomSelectionModel() this, SLOT( onSelectionChanged( const QItemSelection & , const QItemSelection & ) ) ); } - void PatternGeomSelectionModel::onCurrentChanged( const QModelIndex & current, const QModelIndex & previous ) { //Setting the selection mode of the selected item from the treeview} HEXABLOCKGUI::currentDocGView->setSelectionMode( current ); HEXABLOCKGUI::currentOccGView->setSelectionMode( current ); - } void PatternGeomSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ) { - //don't handle selection signals coming from the data tree -// if (ignoreSignal) -// { -// MESSAGE("PatternGeomSelectionModel: IGNORING THE SIGNAL:!"); -// ignoreSignal = false; -// return; -// } - - DocumentModel *docModel = NULL; - const QSortFilterProxyModel *pModel = dynamic_cast( model() ); + DocumentModel* docModel = NULL; + const QSortFilterProxyModel *pModel = dynamic_cast( model() ); if ( pModel != NULL) - docModel = dynamic_cast( pModel->sourceModel()); + docModel = dynamic_cast(pModel->sourceModel()); QModelIndexList indexes = selected.indexes(); - if (indexes.count() == 0 || docModel == NULL) return; + if (indexes.count() == 0 || docModel == NULL) + return; + + // ** unhighlight current highlighted items in the trees + PatternDataSelectionModel* pdsm = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel(); + if (pdsm == NULL) + return; + unhighlightTreeItems(false); //find the corresponding element in the model HEXA_NS::SubShape* eltSubShape = dynamic_cast(docModel->getHexaPtr(indexes[0])); @@ -558,37 +488,20 @@ void PatternGeomSelectionModel::onSelectionChanged( const QItemSelection & selec QString subId = QString::number(eltSubShape->getIdent()); QString aGeomObjModelEntry = parentShapeName + "," + subId + ";"; - //get the model of the data tree - if (HEXABLOCKGUI::currentDocGView == NULL || HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel() == NULL) - return; - - QModelIndexList assocsIndexes = HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel()->indexListOf(aGeomObjModelEntry, HEXA_ASSOC_ENTRY_ROLE); + QModelIndexList assocsIndexes = pdsm->indexListOf(aGeomObjModelEntry, HEXA_ASSOC_ENTRY_ROLE); + if (assocsIndexes.count() == 0) + pdsm->unhighlightTreeItems(); - //selection of the associated elements - if (assocsIndexes.count() == 1 && assocsIndexes[0].isValid()) - { -// HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel()->setIgnoreSignal(true); - //Select associated element in the model => highlight in vtk view -// HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel()->setCurrentIndex( assocsIndexes[0], QItemSelectionModel::Clear ); //CS_TEST - HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel()->setCurrentIndex( assocsIndexes[0], QItemSelectionModel::ClearAndSelect ); - HEXABLOCKGUI::currentDocGView->getPatternDataSelectionModel()->highlightEltsWithAssocs(assocsIndexes); - } - else - { - /*more than one element associated to this geom object: just highlight in the views, - not in the model (because of mono selection in the model).*/ + // ** highlight associations in the data tree + pdsm->highlightTreeItems(assocsIndexes); - //hight the selected geom obj in the occ view - if (HEXABLOCKGUI::currentOccGView != NULL) - { - QMultiMap entrySubIDs; - entrySubIDs.insert(parentShapeName, eltSubShape->getIdent()); + // ** highlight associations in the vtk view + HEXABLOCKGUI::currentDocGView->highlight(assocsIndexes); - HEXABLOCKGUI::currentOccGView->highlight(entrySubIDs); - } - //...and its associated elements in the vtk view - HEXABLOCKGUI::currentDocGView->highlight(assocsIndexes); - } + // ** highlight the selected element in the occ view + QMultiMap entrySubIDs; + entrySubIDs.insert(parentShapeName, eltSubShape->getIdent()); + HEXABLOCKGUI::currentOccGView->highlight(entrySubIDs); } QModelIndex PatternGeomSelectionModel::getModelIndex(const Handle(SALOME_InteractiveObject)& anIObject) @@ -599,57 +512,83 @@ QModelIndex PatternGeomSelectionModel::getModelIndex(const Handle(SALOME_Interac if ( pModel != NULL) docModel = dynamic_cast( pModel->sourceModel()); - if ( docModel == NULL) return result; - - //verify if the selection is really from OCC View - bool fromGEOM = ( strcmp("GEOM", anIObject->getComponentDataType()) == 0 ); - if ( !fromGEOM || HEXABLOCKGUI::selectionMgr() == NULL || + if ( docModel == NULL || HEXABLOCKGUI::selectionMgr() == NULL || HEXABLOCKGUI::currentOccGView->getViewWindow() == NULL) return result; - // QString aName; - GEOM::GEOM_Object_var aGeomObj = GEOMBase::ConvertIOinGEOMObject( anIObject ); - //extract associated elements in the model - if ( GEOMBase::IsShape(aGeomObj) ){ - // aName = GEOMBase::GetName(aGeomObj); - TColStd_IndexedMapOfInteger anIndexes; - HEXABLOCKGUI::selectionMgr()->GetIndexes(anIObject, anIndexes); - if (anIndexes.Extent() == 0) return result; - QString aGeomObjStudyEntry = aGeomObj->GetStudyEntry(); - QString aGeomObjModelEntry = docModel->getGeomObjName(aGeomObjStudyEntry) + "," + QString::number(anIndexes(1)); - - HEXA_NS::SubShape* ssh = docModel->getGeomPtr(aGeomObjModelEntry); - if (ssh != NULL) - { - MESSAGE("Tranna get: " << aGeomObjModelEntry.toStdString() << ", " << ssh->getName()); - } - else - { - MESSAGE("YOUR SHAPE IS NULL"); - } - MESSAGE("Tranna get: " << aGeomObjModelEntry.toStdString()); - HEXA_NS::VertexShape* vSh = dynamic_cast(ssh); - HEXA_NS::EdgeShape* eSh = dynamic_cast(ssh); - HEXA_NS::FaceShape* fSh = dynamic_cast(ssh); - - if (vSh != NULL) - result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(vSh)); - else if (eSh != NULL) + TColStd_IndexedMapOfInteger anIndexes; + HEXABLOCKGUI::selectionMgr()->GetIndexes(anIObject, anIndexes); + if (anIndexes.Extent() == 0) return result; + QString aGeomObjStudyEntry = anIObject->getEntry(); + QString aGeomObjModelEntry = docModel->getGeomObjName(aGeomObjStudyEntry) + "," + QString::number(anIndexes(1)); + + HEXA_NS::SubShape* ssh = docModel->getGeomPtr(aGeomObjModelEntry); + HEXA_NS::VertexShape* vSh = dynamic_cast(ssh); + HEXA_NS::EdgeShape* eSh = dynamic_cast(ssh); + HEXA_NS::FaceShape* fSh = dynamic_cast(ssh); + + if (vSh != NULL) + result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(vSh)); + else if (eSh != NULL) + result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(eSh)); + else if (fSh != NULL) + result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(fSh)); + + return result; +} + +void PatternGeomSelectionModel::highlightTreeItems(QModelIndexList& indexes, + Qt::GlobalColor bgColor, + Qt::GlobalColor fgColor, bool only) +{ + if (indexes.count() == 0) + return; + + if (only) + unhighlightTreeItems(); + + // * highlight items + QAbstractItemModel* theModel = (QAbstractItemModel*) model(); + QMap roles; + roles[Qt::BackgroundRole] = bgColor; + roles[Qt::ForegroundRole] = fgColor; + foreach( const QModelIndex& anItemIndex, indexes ) + { + if (anItemIndex.isValid()) { - MESSAGE("=====> An EDGE: "<< eSh->getName()); - result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(eSh)); + theModel->setItemData(anItemIndex, roles); + currentHighlightedItems << anItemIndex; } - else if (fSh != NULL) - result = indexBy( HEXA_DATA_ROLE, QVariant::fromValue(fSh)); } - return result; + + // * scroll to the first highlighted item in the tree + HEXABLOCKGUI* module = HEXABLOCKGUI::getInstance(); + if (module != NULL && indexes[0].isValid()) + module->getPatternGeomTreeView()->scrollTo(indexes[0]); +} + +void PatternGeomSelectionModel::unhighlightTreeItems(bool clearSelected) +{ + if (clearSelected) + clearSelection(); + if (currentHighlightedItems.count() == 0) + return; + QAbstractItemModel* theModel = (QAbstractItemModel*) model(); + QMap roles; + roles[Qt::BackgroundRole] = Qt::white; + roles[Qt::ForegroundRole] = Qt::darkGreen; + foreach( const QModelIndex& anItemIndex, currentHighlightedItems) + { + if (anItemIndex.isValid()) + theModel->setItemData(anItemIndex, roles); + } + currentHighlightedItems.clear(); } // //=========================================================================== // GroupsSelectionModel // //=========================================================================== - GroupsSelectionModel::GroupsSelectionModel( QAbstractItemModel * model ): SelectionModel( model ) { @@ -671,30 +610,18 @@ GroupsSelectionModel::~GroupsSelectionModel() void GroupsSelectionModel::onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ) { try { - // if ( _salomeSelectionMgr == NULL ) return; - // _salomeSelectionMgr->clearSelected(); - // erasePreview(true); QModelIndexList indexes = selected.indexes(); for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){ HEXABLOCKGUI::currentDocGView->highlightGroups( *i_index ); } - - // CS_BP todo SALOMEGUI_Swig.cxx:370 - // indexes = deselected.indexes(); - // for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ) - // _unselectSalome( *i_index); } catch ( ... ) { MESSAGE("Unknown exception was cought !!!"); } - } - // //=========================================================================== // MeshSelectionModel // //=========================================================================== - - MeshSelectionModel::MeshSelectionModel( QAbstractItemModel * model ): SelectionModel( model ) { @@ -722,310 +649,8 @@ void MeshSelectionModel::onSelectionChanged( const QItemSelection & selected, co for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ){ HEXABLOCKGUI::currentDocGView->highlightPropagation( *i_index ); } - - // CS_BP todo SALOMEGUI_Swig.cxx:370 - // indexes = deselected.indexes(); - // for( QModelIndexList::const_iterator i_index = indexes.begin(); i_index != indexes.end(); ++i_index ) - // _unselectSalome( *i_index); } catch ( ... ) { MESSAGE("Unknown exception was cought !!!"); } - } - - - - - - - - -// //================================================================================= -// // function : activateSelection -// // purpose : Activate selection in accordance with myEditCurrentArgument -// //================================================================================= -// void PatternDataSelectionModel::activateSelection() -// { -// erasePreview(false); -// -// // local selection -// if (!myObject->_is_nil() && !isAllSubShapes()) -// { -// GEOM_Displayer* aDisplayer = getDisplayer(); -// SALOME_View* view = GEOM_Displayer::GetActiveView(); -// if (view) { -// CORBA::String_var aMainEntry = myObject->GetStudyEntry(); -// Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject (aMainEntry.in(), "GEOM", "TEMP_IO"); -// if (view->isVisible(io)) { -// aDisplayer->Erase(myObject, false, false); -// myIsHiddenMain = true; -// } -// } -// -// int prevDisplayMode = aDisplayer->SetDisplayMode(0); -// -// SUIT_ViewWindow* aViewWindow = 0; -// SUIT_Study* activeStudy = SUIT_Session::session()->activeApplication()->activeStudy(); -// if (activeStudy) -// aViewWindow = SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); -// if (aViewWindow == 0) return; -// -// SUIT_ViewManager* aViewManager = aViewWindow->getViewManager(); -// if (aViewManager->getType() != OCCViewer_Viewer::Type() && -// aViewManager->getType() != SVTK_Viewer::Type()) -// return; -// -// SUIT_ViewModel* aViewModel = aViewManager->getViewModel(); -// SALOME_View* aView = dynamic_cast(aViewModel); -// if (aView == 0) return; -// -// //TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myObject); -// -// TopTools_IndexedMapOfShape aSubShapesMap; -// TopExp::MapShapes(myShape, aSubShapesMap); -// CORBA::String_var aMainEntry = myObject->GetStudyEntry(); -// QString anEntryBase = aMainEntry.in(); -// -// TopExp_Explorer anExp (myShape, (TopAbs_ShapeEnum)shapeType()); -// for (; anExp.More(); anExp.Next()) -// { -// TopoDS_Shape aSubShape = anExp.Current(); -// int index = aSubShapesMap.FindIndex(aSubShape); -// QString anEntry = anEntryBase + QString("_%1").arg(index); -// -// SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView); -// if (aPrs) { -// displayPreview(aPrs, true, false); // append, do not update -// } -// } -// aDisplayer->UpdateViewer(); -// aDisplayer->SetDisplayMode(prevDisplayMode); -// } -// -// globalSelection(GEOM_ALLSHAPES); -// } - - - - -// SUIT_DataOwnerPtrList aList; -// ObjectList::iterator anIter; -// for ( anIter = objects.begin(); anIter != objects.end(); ++anIter ) -// { -// QString anEntry = getEntry( *anIter ); -// LightApp_DataOwner* anOwher = new LightApp_DataOwner( anEntry ); -// aList.append( anOwher ); -// } -// -// SUIT_Session* session = SUIT_Session::session(); -// SalomeApp_Application* app = dynamic_cast( session->activeApplication() ); -// if ( !app ) -// return false; -// -// LightApp_SelectionMgr* aMgr = app->selectionMgr(); -// if ( !aMgr ) -// return false; -// _getVTKViewWindow() -// aMgr->setSelecte_getVTKViewWindow()d( aList, false ); - - - - - -// SMESH_Actor* anActor = SMESH::FindActorByObject(myMesh); -// if (!anActor || !anActor->hasIO()) -// return; -// -// Handle(SALOME_InteractiveObject) anIO = anActor->getIO(); -// //mySelectionMgr->clearSelected(); -// //mySelectionMgr->AddIObject(anIO, false); -// SALOME_ListIO aList; -// aList.Append(anIO); -// mySelectionMgr->setSelectedObjects(aList, false); -// -// // Remove filter corresponding to the current type from viewer -// int aType = myTable->GetType(); -// int aFilterId = SMESH::UnknownFilter; -// if (aType == SMESH::EDGE ) aFilterId = SMESH::EdgeFilter; -// else if (aType == SMESH::FACE ) aFilterId = SMESH::FaceFilter; -// else if (aType == SMESH::VOLUME) aFilterId = SMESH::VolumeFilter; -// Handle(VTKViewer_Filter) aFilter = SMESH::GetFilter(aFilterId); -// SMESH::RemoveFilter(aFilterId); -// -// // get vtk ids -// TColStd_MapOfInteger aMap; -// QList::const_iterator anIter; -// for (anIter = theIds.begin(); anIter != theIds.end(); ++anIter) { -// aMap.Add(*anIter); -// } -// -// // Set new selection -// activeViewWindow->AddOrRemoveIndex(anIO, aMap, false); -// if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) -// aViewWindow->highlight( anIO, true, true ); -// -// // insert previously stored filter in viewer if necessary -// if (!aFilter.IsNull()) -// SMESH::SetFilter(aFilter); - - - - - - - - - -// //CS_TEST -// if(SVTK_Selector* aSelector = aView->GetSelector()){ -// const SALOME_ListIO& aListIO = aSelector->StoredIObjects(); -// SALOME_ListIteratorOfListIO anIter(aListIO); -// for(; anIter.More(); anIter.Next()){ -// Handle(SALOME_InteractiveObject) anIO = anIter.Value(); -// _PTR(Study) aStudy = HEXABLOCKGUI::activeStudy()->studyDS(); -// _PTR(SObject) aSObj = aStudy->FindObjectID( anEntry.toStdString().c_str() ); -// LightApp_DataObject* o = HEXABLOCKGUI::activeStudy()->findObjectByEntry(anEntry.toStdString().c_str()); -// //CS_TEST - - - - - -// void PatternDataSelectionModel::test() -// { -// if (myBusy) return; -// myMeshActor = 0; -// -// SALOME_ListIO aList; -// mySelectionMgr->selectedObjects(aList,SVTK_Viewer::Type()); -// -// if (aList.Extent() == 1) { -// Handle(SALOME_InteractiveObject) anIO = aList.First(); -// myMeshActor = SMESH::FindActorByEntry(anIO->getEntry()); -// if(myMeshActor){ -// QString aText; -// if (SMESH::GetNameOfSelectedNodes(activeViewWindow,anIO,aText) == 1) { -// if(SMDS_Mesh* aMesh = myMeshActor->GetObject()->GetMesh()) { -// if(const SMDS_MeshNode* aNode = aMesh->FindNode(aText.toInt())) { -// myBusy = true; -// myId->setText(aText); -// myX->SetValue(aNode->X()); -// myY->SetValue(aNode->Y()); -// myZ->SetValue(aNode->Z()); -// myBusy = false; -// erasePreview(); // avoid overlapping of a selection and a preview -// updateButtons(); -// return; -// } -// } -// } -// } -// } -// -// reset(); -// } - - -// //CS_TEST -// SUIT_DataOwnerPtrList aOList; -// LightApp_DataOwner* anOwher = new LightApp_DataOwner( "0:1:1:1:2" ); -// aOList.append( anOwher ); -// _salomeSelectionMgr->setSelected( aOList, false ); -// //CS_TEST - -// void PatternDataSelectionModel::highlightGEOM( const QModelIndex & anEltIndex ) -// { -// std::cout << "PatternDataSelectionModel::highlightGEOM go find ASSOCIATION for"<< anEltIndex.data().toString().toStdString()<getViewWindow() -// -// QList assocList; -// -// DocumentModel *docModel = NULL; -// const QSortFilterProxyModel *pModel = NULL; -// // const QStandardItemModel *smodel -// // const QAbstractItemModel *theModel = NULL; -// -// pModel = dynamic_cast( model() ); -// -// std::cout << "pModel "<< pModel << std::endl; -// if ( pModel ){ -// std::cout << "if ( pModel ){"<< std::endl; -// docModel = dynamic_cast( pModel->sourceModel() ); -// if ( docModel ){ -// std::cout << "if ( docModel ){"<< std::endl; -// assocList = docModel->getAssociations( pModel->mapToSource(anEltIndex) ); -// } -// } -// -// -// _PTR(Study) aStudy = GetActiveStudyDocument(); -// _PTR(SObject) aSChild; -// CORBA::Object_var aCorbaObj = CORBA::Object::_nil(); -// GEOM::GEOM_Object_var assoc; -// // foreach( const QString& entry, geomEntries ){ -// // struct GeomObj -// // { -// // QString name; -// // QString entry; -// // QString brep; -// // double start; -// // double end; -// // }; -// -// QVariant treeVariant = pModel->mapToSource(anEltIndex).data( HEXA_TREE_ROLE ); -// int eltType; -// if ( !treeVariant.isValid() ) return; -// eltType = treeVariant.toInt(); -// -// // GEOM::GeomObjPtr -// // GEOM::GEOM_Object_ptr firstLine; //firstLine.nullify();// -// GEOM::GEOM_Object_var firstLine = GEOM::GEOM_Object::_nil(); //GEOM::GeomObjPtr -// GEOM::GEOM_Object_var lastLine = GEOM::GEOM_Object::_nil(); -// double firstParameter = 0.2; //CS_TODO -// double lastParameter = 0.4; //CS_TODO -// -// foreach( const DocumentModel::GeomObj& anAssoc, assocList ){ -// std::cout << "FOUND=> " << anAssoc.entry.toStdString() << std::endl; -// aSChild = aStudy->FindObjectID( anAssoc.entry.toStdString() ); -// aCorbaObj = corbaObj(aSChild); -// assoc = GEOM::GEOM_Object::_narrow(aCorbaObj); -// -// if ( !CORBA::is_nil(assoc) ){ -// std::cout << "geom to highlight =>" << anAssoc.name.toStdString() << std::endl; -// // objects.push_back(assoc._retn()); -// // if ( eltType == EDGE_TREE ){ -// // if ( CORBA::is_nil(firstLine) ){ -// // firstLine = GEOM::GEOM_Object::_duplicate( assoc._retn() ); -// // } -// // lastLine = GEOM::GEOM_Object::_duplicate( assoc._retn() ); -// // } -// displayPreview( assoc._retn(), -// true, //false, //append, -// false,//true, //false, //activate, -// false,//true,//update, -// 4,//lineWidth, -// 1,//-1,//displayMode, -// Quantity_NOC_RED ); -// } else { -// std::cout << "not a geom =>" << anAssoc.name.toStdString()<< std::endl; -// } -// } -// // std::cout << "CORBA::is_nil(firstLine) =>" << CORBA::is_nil(firstLine) << std::endl; -// // std::cout << "CORBA::is_nil(lastLine) =>" << CORBA::is_nil(lastLine) << std::endl; -// // std::cout << "test" << ( !( CORBA::is_nil(firstLine) and !CORBA::is_nil(lastLine) ) ) << std::endl; -// /* -// if ( !( CORBA::is_nil(firstLine) and !CORBA::is_nil(lastLine) ) ){ -// GEOM::GEOM_IBasicOperations_var anOper = _geomEngine->GetIBasicOperations( getStudyId() ); -// GEOM::GEOM_Object_var firstPoint = anOper->MakePointOnCurve( firstLine, firstParameter ); -// GEOM::GEOM_Object_var lastPoint = anOper->MakePointOnCurve( lastLine, lastParameter ); -// -// // std::cout << "firstPoint->_is_nil() =>" << firstPoint->_is_nil() << std::endl; -// std::cout << "lastPoint->_is_nil() =>" << lastPoint->_is_nil() << std::endl; -// if ( !( CORBA::is_nil(firstPoint) ) )// !firstPoint->_is_nil() ) -// displayPreview( firstPoint._retn(), true ); -// if ( !( CORBA::is_nil(lastPoint) ) )//if ( !lastPoint->_is_nil() ) -// displayPreview( lastPoint._retn(), true ); -// }*/ -// } -// diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx index cd01073..4f8fb56 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_DocumentSelectionModel.hxx @@ -26,12 +26,6 @@ #include #include -// #include -// #include -// #include - -#include "MyGEOMBase_Helper.hxx" - #include "klinkitemselectionmodel.hxx" class OCCViewer_ViewWindow; @@ -51,16 +45,15 @@ namespace HEXABLOCK SelectionModel( QAbstractItemModel * model ); virtual ~SelectionModel(); - QModelIndex indexBy( int role, const QString& value ); - QModelIndex indexBy( int role, const QVariant& var ); - QModelIndex indexOf( const QString& anIOEntry, int role ); + QModelIndex indexBy( int role, const QString& value ); + QModelIndex indexBy( int role, const QVariant& var ); + QModelIndex indexOf( const QString& anIOEntry, int role ); QModelIndexList indexListOf( const QString& anEntry, int role ); - void setIgnoreSignal(bool state) { ignoreSignal = state; } virtual void geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) {} virtual void vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ) {} - bool salomeNothingSelected; + void clearHighlightedItems() { currentHighlightedItems.clear(); } protected slots: @@ -74,12 +67,8 @@ namespace HEXABLOCK protected: QModelIndexList getSelectionFromModel(const Handle(SALOME_InteractiveObject)& anIObject); - QModelIndexList getSelectionAssociactions(const Handle(SALOME_InteractiveObject)& anIObject); - bool ignoreSignal; -// bool _theModelSelectionChanged; -// bool _theVtkSelectionChanged; -// bool _theGeomSelectionChanged; + QModelIndexList currentHighlightedItems; }; class PatternBuilderSelectionModel: public KLinkItemSelectionModel @@ -100,7 +89,10 @@ namespace HEXABLOCK PatternDataSelectionModel( QAbstractItemModel * model ); virtual ~PatternDataSelectionModel(); - void highlightEltsWithAssocs(const QModelIndexList& elts); + void highlightTreeItems(QModelIndexList& indexes, + Qt::GlobalColor bgColor = Qt::darkGreen, + Qt::GlobalColor fgColor = Qt::white, bool only=true); + void unhighlightTreeItems(bool clearSelected=true); QModelIndexList getGeomAssociations(const QModelIndex& dataIndex); //Salome @@ -122,12 +114,10 @@ namespace HEXABLOCK virtual ~PatternGeomSelectionModel(); QModelIndex getModelIndex(const Handle(SALOME_InteractiveObject)& anIObject); - -// void highlightEltsWithAssocs(const QModelIndexList& elts); -// -// //Salome -// virtual void geomSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ); -// virtual void vtkSelectionChanged( const Handle(SALOME_InteractiveObject)& anIObject ); + void highlightTreeItems(QModelIndexList& indexes, + Qt::GlobalColor bgColor = Qt::darkGreen, + Qt::GlobalColor fgColor = Qt::white, bool only=true); + void unhighlightTreeItems(bool clearSelected=true); protected slots: virtual void onCurrentChanged( const QModelIndex & current, const QModelIndex & previous ); @@ -145,7 +135,6 @@ namespace HEXABLOCK virtual ~GroupsSelectionModel(); protected slots: -// virtual void onCurrentChanged( const QModelIndex & current, const QModelIndex & previous ); virtual void onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ); @@ -161,7 +150,6 @@ namespace HEXABLOCK virtual ~MeshSelectionModel(); protected slots: -// virtual void onCurrentChanged( const QModelIndex & current, const QModelIndex & previous ); virtual void onSelectionChanged( const QItemSelection & selected, const QItemSelection & deselected ); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.cxx index 9de68ee..a9da07a 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.cxx @@ -135,42 +135,4 @@ void GraphicViewsHandler::closeDocumentGraphicView(SVTK_ViewWindow* window) delete dgview; } -//void GraphicViewsHandler::onPatternDatachanged() -//{ -// INIT_REAC(V_patternDatachaged); -// OCCview->reacPatternDatachanged(); -// OUT_REAC(); -//} - -//VTKGraphicView* m_VTKview; -// -//void DocumentHandler::switchOnVTKGraphicView() -//{ -// verifieVTKView(); -// -// //connect signals -// connect( m_VTKview->getPatternDataSelectionModel(), SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &) ), -// this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); -// connect( m_VTKview->getPatternBuilderSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), -// this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); -// connect( m_VTKview->getGroupsSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), -// this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); -// connect( m_VTKview->getMeshSelectionModel(), SIGNAL( selectionChanged(const QItemSelection &, const QItemSelection &) ), -// this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); -// -// _showDialogBox(getDlgBox(view)); -// } -// -//DocumentHandler::onSelectionChanged(const QItemSelection &, const QItemSelection &) -//{ -// addMapConnect(++cptConnect;"onSelectionChanged"); -// if(onAction) {return;} -// onAction = true; -// -// ptHexaGUI->onSelectionChanged(const QItemSelection &, const QItemSelection &); -// m_VTKview->onSelectionChanged(const QItemSelection &, const QItemSelection &); -// -// onAction = false; -//} - diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx index 0d77c1a..ef6cde0 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_GraphicViewsHandler.hxx @@ -39,7 +39,7 @@ namespace HEXABLOCK { public: - GraphicViewsHandler()/*: vtkViewManager(NULL)*/ {} + GraphicViewsHandler() {} virtual ~GraphicViewsHandler() {} VtkDocumentGraphicView* getDocumentGraphicView(SVTK_ViewWindow* view) const; VtkDocumentGraphicView* createDocumentGraphicView(DocumentModel* docModel, SVTK_ViewWindow* wnd, QWidget* parent); diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx new file mode 100755 index 0000000..042192e --- /dev/null +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.cxx @@ -0,0 +1,330 @@ +// Copyright (C) 2007-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 +// + +// File : HEXABLOCKGUI_OCCSelector.cxx +// + +#include "HEXABLOCKGUI_OCCSelector.h" +#include "HEXABLOCKGUI_SalomeTools.hxx" + +#include + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + + +using namespace HEXABLOCK::GUI; + +//================================================================ +// Function : HEXABLOCKGUI_OCCSelector +// Purpose : +//================================================================ +HEXABLOCKGUI_OCCSelector::HEXABLOCKGUI_OCCSelector( OCCViewer_Viewer* viewer, SUIT_SelectionMgr* mgr ) +: LightApp_OCCSelector( viewer, mgr ) +{ +} + +//================================================================ +// Function : ~HEXABLOCKGUI_OCCSelector +// Purpose : +//================================================================ +HEXABLOCKGUI_OCCSelector::~HEXABLOCKGUI_OCCSelector() +{ +} + +//================================================================ +// Function : getSelection +// Purpose : +//================================================================ +void HEXABLOCKGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const +{ + OCCViewer_Viewer* vw = viewer(); + if (!vw) + return; + + Handle(AIS_InteractiveContext) ic = vw->getAISContext(); + + if (ic->HasOpenedContext()) + { + TopoDS_Shape curBigShape; + TopTools_IndexedMapOfShape subShapes; + + for (ic->InitSelected(); ic->MoreSelected(); ic->NextSelected()) + { + Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(ic->SelectedOwner()); + if (anOwner.IsNull()) + continue; + + Handle(AIS_InteractiveObject) io = Handle(AIS_InteractiveObject)::DownCast(anOwner->Selectable()); + + QString entryStr = entry(io); + int index = -1; + + if (anOwner->ComesFromDecomposition()) // == Local Selection + { + TopoDS_Shape subShape = anOwner->Shape(); + Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast(io); + if (!aisShape.IsNull()) + { + TopoDS_Shape bigShape = aisShape->Shape(); + + if (!bigShape.IsEqual(curBigShape)) + { + curBigShape = bigShape; + subShapes.Clear(); + TopExp::MapShapes(bigShape, subShapes); + } + index = subShapes.FindIndex(subShape); + } + } + + if (!entryStr.isEmpty()) + { + Handle(SALOME_InteractiveObject) anIO = Handle(SALOME_InteractiveObject)::DownCast(io->GetOwner()); + LightApp_DataOwner* owner; + if (index > -1) // Local Selection + owner = new LightApp_DataSubOwner (entryStr, index); + else if ( !anIO.IsNull() ) // Global Selection + owner = new LightApp_DataOwner( anIO ); + + aList.append(SUIT_DataOwnerPtr(owner)); + } + } + } + else + { + for (ic->InitCurrent(); ic->MoreCurrent(); ic->NextCurrent()) + { + Handle(AIS_InteractiveObject) io = ic->Current(); + + QString entryStr = entry( io ); + + if ( !entryStr.isEmpty() ) + { + Handle(SALOME_InteractiveObject) anIO = Handle(SALOME_InteractiveObject)::DownCast(io->GetOwner()); + if ( !anIO.IsNull() ) { + LightApp_DataOwner* owner = new LightApp_DataOwner( anIO ); + aList.append( SUIT_DataOwnerPtr( owner ) ); + } + } + } + } + + // add externally selected objects + SUIT_DataOwnerPtrList::const_iterator anExtIter, itEnd; + for (anExtIter = mySelectedExternals.begin(), itEnd = mySelectedExternals.end(); anExtIter != itEnd; anExtIter++) + { + aList.append(*anExtIter); + } +} + +//================================================================ +// Function : setSelection +// Purpose : +//================================================================ +void HEXABLOCKGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList ) +{ + OCCViewer_Viewer* vw = viewer(); + if ( !vw ) + return; + + Handle(AIS_InteractiveContext) ic = vw->getAISContext(); + + // "entry - list_of_int" map for LOCAL selection + NCollection_DataMap indexesMap; + + QMap globalSelMap; // only Key=entry from this map is used. value(int) is NOT used at all. + SelectMgr_IndexedMapOfOwner ownersmap; // map of owners to be selected + + AIS_ListOfInteractive aDispList; + ic->DisplayedObjects( aDispList ); + + // build a map of data owner indexes to be selected. + // "entry - to - list_of_ids" map + for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(), itEnd = aList.end(); itr != itEnd; ++itr ) + { + const LightApp_DataSubOwner* subOwner = dynamic_cast( (*itr).operator->() ); + if ( subOwner ) + { + QString entry = subOwner->entry(); + if ( indexesMap.IsBound( TCollection_AsciiString(entry.toLatin1().data()))) + { + TColStd_IndexedMapOfInteger& subIndexes = indexesMap.ChangeFind(entry.toLatin1().data()); + subIndexes.Add( subOwner->index() ); + //indexesMap.replace( entry, subIndexes ); + } + else + { + TColStd_IndexedMapOfInteger subIndexes; + subIndexes.Add( subOwner->index() ); + indexesMap.Bind(entry.toLatin1().data(), subIndexes); + } + } + else // the owner is NOT a sub owner, maybe it is a DataOwner == GLOBAL selection + { + const LightApp_DataOwner* owner = dynamic_cast( (*itr).operator->() ); + if ( owner ) + { + SalomeApp_Study* appStudy = + dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + QString anEntry = appStudy->referencedToEntry( owner->entry() ); + + globalSelMap[anEntry] = 1; + } + } + } + + // get all owners. Fill "entry - list_of_owners" map. + for ( AIS_ListIteratorOfListOfInteractive it( aDispList ); it.More(); it.Next() ) + { + Handle(AIS_InteractiveObject) io = it.Value(); + QString entryStr = entry( io ); + if ( !entryStr.isEmpty() ) + { + //EntryToListOfOwnerMap entryOwnersMap; // "entry - list_of_owners" map. temporary use. + SelectMgr_IndexedMapOfOwner owners; + getEntityOwners( io, ic, owners ); // get all owners + + int i, n = owners.Extent(); + + // 1. Prepare map of shapes for local selection + TopTools_IndexedMapOfShape aMapOfShapes; + bool isLocal = false; + + Handle(StdSelect_BRepOwner) anOwner; + for (i = 1; i <= n && !isLocal; i++) + { + anOwner = Handle(StdSelect_BRepOwner)::DownCast(owners( i )); + if (!anOwner.IsNull() && anOwner->HasShape()) + { + if (anOwner->ComesFromDecomposition() || !globalSelMap.contains(entryStr)) + { + // has a local selection + Handle(AIS_Shape) aisShape = Handle(AIS_Shape)::DownCast( io ); + if (!aisShape.IsNull() && indexesMap.IsBound(entryStr.toLatin1().data())) + { + isLocal = true; + TopoDS_Shape shape = aisShape->Shape(); + aMapOfShapes.Clear(); + TopExp::MapShapes(shape, aMapOfShapes); + } + } + } + } + + // 2. Process all owners + for (i = 1; i <= n; i++) + { + anOwner = Handle(StdSelect_BRepOwner)::DownCast(owners( i )); + + if ( anOwner.IsNull() || !anOwner->HasShape() ) + continue; + + // GLOBAL selection + if ( !anOwner->ComesFromDecomposition() && globalSelMap.contains( entryStr ) ) + { + ownersmap.Add( anOwner ); + globalSelMap[entryStr]++; + } + // LOCAL selection + else + { + if (isLocal) + { + const TColStd_IndexedMapOfInteger& subIndexes = + indexesMap.ChangeFind(entryStr.toLatin1().data()); + + const TopoDS_Shape& aSubShape = anOwner->Shape(); + int aSubShapeId = aMapOfShapes.FindIndex( aSubShape ); + + // check if the "sub_shape_index" is found in the "map of indexes for this entry", + // which was passes in the parameter + if ( subIndexes.Contains( aSubShapeId ) ) + { + ownersmap.Add( anOwner ); + } + } + } // end of LOCAL selection + } // end of for(owners) + } // end of if(entry) + } // end of for(AIS_all_ios) + + vw->unHighlightAll( false ); + + // DO the selection + int i = 1, n = ownersmap.Extent(); + bool isAutoHilight = ic->AutomaticHilight(); + ic->SetAutomaticHilight(Standard_False); //Bug 17269: for better performance + for (; i <= n; i++) + { + Handle(SelectMgr_EntityOwner) owner = ownersmap( i ); + if ( owner->State() ) + continue; + + if ( ic->HasOpenedContext() ) + ic->AddOrRemoveSelected( owner, false ); + else + ic->AddOrRemoveSelected( Handle(AIS_InteractiveObject)::DownCast(owner->Selectable()), false ); + } + ic->SetAutomaticHilight(isAutoHilight); //Bug 17269: restore mode + if (n < 3000) + ic->HilightSelected(/*updateviewer*/Standard_True); + else + vw->update(); + + // fill extra selected + mySelectedExternals.clear(); + for ( SUIT_DataOwnerPtrList::const_iterator itr2 = aList.begin(), itEnd = aList.end(); itr2 != itEnd; ++itr2 ) + { + const LightApp_DataSubOwner* subOwner = + dynamic_cast( (*itr2).operator->() ); + if ( !subOwner ) + { + const LightApp_DataOwner* owner = dynamic_cast( (*itr2).operator->() ); + if ( owner ) + { + SalomeApp_Study* appStudy = + dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); + QString anEntry = appStudy->referencedToEntry( owner->entry() ); + if (globalSelMap[anEntry] == 1) mySelectedExternals.append(*itr2); + } + } + } +} diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h b/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h new file mode 100755 index 0000000..cf41914 --- /dev/null +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_OCCSelector.h @@ -0,0 +1,45 @@ +// Copyright (C) 2007-2012 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 +// + +// GEOM GEOMGUI : GUI for Geometry component +// File : HEXABLOCKGUI_OCCSelector.h +// + +#ifndef HEXABLOCKGUI_OCCSELECTOR_H +#define HEXABLOCKGUI_OCCSELECTOR_H + + +#include + +class HEXABLOCKGUI_OCCSelector : public LightApp_OCCSelector +{ +public: + HEXABLOCKGUI_OCCSelector( OCCViewer_Viewer*, SUIT_SelectionMgr* ); + virtual ~HEXABLOCKGUI_OCCSelector(); + +protected: + virtual void getSelection( SUIT_DataOwnerPtrList& ) const; + virtual void setSelection( const SUIT_DataOwnerPtrList& ); + +}; + +#endif // HEXABLOCKGUI_OCCSELECTOR_H diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx index aef52da..5d9cb12 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.cxx @@ -24,13 +24,18 @@ #include "HEXABLOCKGUI.hxx" #include "HEXABLOCKGUI_DocumentModel.hxx" #include "GEOMBase.h" -#include "MyGEOMBase_Helper.hxx" #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" #include "HexNewShape.hxx" #include "HexVertexShape.hxx" #include "HexEdgeShape.hxx" #include "HexFaceShape.hxx" +#include +#include +#include +#include +#include + #include #include @@ -43,22 +48,25 @@ using namespace HEXABLOCK::GUI; // ----------------------------------------------------------------------- OccGraphicView::OccGraphicView( OCCViewer_ViewWindow* view, QWidget* parent ): + prs(NULL), viewWindow( view ), selectionMode(TopAbs_SHAPE) { + TopoDS_Shape shapeToPreview; + previewShape = new AIS_Shape(shapeToPreview); +// previewShape->SetColor(Quantity_NOC_RED); + getContext()->SetColor( previewShape, Quantity_NOC_RED ); } void OccGraphicView::setSelectionMode(TopAbs_ShapeEnum mode) { - if (HEXABLOCKGUI::selectionMgr() == NULL || - HEXABLOCKGUI::geomBaseHelper == NULL || viewWindow == NULL) return; + if (viewWindow == NULL || selectionMode == mode) + return; HEXABLOCKGUI::selectionMgr()->clearSelected(); - HEXABLOCKGUI::geomBaseHelper->globalSelection(viewWindow); -// HEXABLOCKGUI::geomBaseHelper->localSelection(GEOM::GEOM_Object::_nil(), mode); - HEXABLOCKGUI::geomBaseHelper->localSelection(viewWindow, mode); + globalSelection(); + localSelection(mode); selectionMode = mode; - } void OccGraphicView::setSelectionMode(const QModelIndex& eltIndex) @@ -90,21 +98,85 @@ void OccGraphicView::setSelectionMode(const QModelIndex& eltIndex) } } +void OccGraphicView::getSelected(SALOME_ListIO& selectedObjects) +{ + HEXABLOCKGUI::selectionMgr()->selectedObjects( selectedObjects/*, OCCViewer_Viewer::Type()*/ ); + +// SALOME_View* vf = dynamic_cast(HEXABLOCKGUI::currentOccGView->getViewWindow()->getViewManager()->getViewModel()); +// if ( vf == NULL ) return; +// SOCC_Viewer* viewer = dynamic_cast( vf ); +// if (viewer == NULL) +// return; +// AIS_ListOfInteractive theList; +// viewer->getSelectedObjects (theList); +// AIS_ListIteratorOfListOfInteractive it (theList); +// //iterate on list: +// while (it.More ()) +// { +// Handle(SALOME_InteractiveObject) anIO = Handle(SALOME_InteractiveObject)::DownCast(it.Value()->GetOwner()); +// if (!anIO.IsNull()) +// salomeSelected.Append(anIO); +// it.Next (); +// } +} void OccGraphicView::clearSelection() { - if (HEXABLOCKGUI::selectionMgr() == NULL || viewWindow == NULL || - HEXABLOCKGUI::geomBaseHelper == NULL) + if (HEXABLOCKGUI::selectionMgr() == NULL) return; HEXABLOCKGUI::selectionMgr()->clearSelected(); - HEXABLOCKGUI::geomBaseHelper->globalSelection(viewWindow); - HEXABLOCKGUI::geomBaseHelper->localSelection(viewWindow, TopAbs_SHAPE); + globalSelection(); + localSelection(TopAbs_SHAPE); selectionMode = TopAbs_SHAPE; } +void OccGraphicView::localSelection(const int theMode ) +{ + if (viewWindow == NULL || prs == NULL) + return; + + // remove all filters from selection + LightApp_SelectionMgr* sm = HEXABLOCKGUI::selectionMgr(); + sm->clearFilters(); + + SALOME_View* vf = dynamic_cast(viewWindow->getViewManager()->getViewModel()); + if (vf == NULL) + return; + + vf->LocalSelection( prs, theMode ); +} + +void OccGraphicView::globalSelection(const bool update ) +{ + if (viewWindow == NULL) + return; + + SALOME_View* vf = dynamic_cast(viewWindow->getViewManager()->getViewModel()); + if ( vf == NULL ) return; + + // Close local context + vf->GlobalSelection( update ); + + // Set selection filters in accordance with current mode + LightApp_SelectionMgr* sm = HEXABLOCKGUI::selectionMgr(); + if ( sm == NULL) + return; + + sm->clearFilters(); -void OccGraphicView::highlight( const QModelIndex & index ) + // Remove filters from AIS_InteractiveContext + Handle(AIS_InteractiveContext) ic; + SOCC_Viewer* viewer = dynamic_cast( vf ); + if ( viewer ) + { + ic = viewer->getAISContext(); + if ( !ic.IsNull() ) + ic->RemoveFilters(); + } +} + +void OccGraphicView::highlight( const QModelIndex & index, bool only ) { // getting association(s) from model @@ -115,14 +187,13 @@ void OccGraphicView::highlight( const QModelIndex & index ) if (docModel == NULL) return; assocEntrySubIDs += docModel->getAssocShapesIds(index); - highlight( assocEntrySubIDs ); + highlight( assocEntrySubIDs, only ); } -void OccGraphicView::highlight( const QModelIndexList & indexList ) +void OccGraphicView::highlight( const QModelIndexList & indexList, bool only ) { -// QModelIndex index; QMultiMap< QString, int > assocEntrySubIDs; if (HEXABLOCKGUI::currentDocGView == NULL || viewWindow == NULL) return; @@ -132,54 +203,144 @@ void OccGraphicView::highlight( const QModelIndexList & indexList ) foreach( const QModelIndex& anEltIndex, indexList) { -// index = pModel->mapToSource(anEltIndex); assocEntrySubIDs += docModel->getAssocShapesIds(anEltIndex); } - highlight( assocEntrySubIDs ); + highlight( assocEntrySubIDs, only ); } - -void OccGraphicView::highlight( const QMultiMap& entrySubIDs ) +#include +void OccGraphicView::highlightSubShapes(const Handle(AIS_Shape)& anObj, + const TColStd_IndexedMapOfInteger& aIndexMap, bool only) { - if ( viewWindow == NULL ) return; + if (viewWindow == NULL || anObj.IsNull() ) + return; + + //get the context + Handle (AIS_InteractiveContext) anIC = getContext(); + if ( anIC.IsNull() || !anIC->HasOpenedContext() ) + return; + + // ** highlight + Standard_Boolean isAutoHilight = anIC->AutomaticHilight(); + anIC->SetAutomaticHilight( false ); + + if (only) // * clear current highlighted if asked + anIC->ClearSelected( false ); - SOCC_Viewer* soccViewer = dynamic_cast( viewWindow->getViewManager()->getViewModel() ); - if (!soccViewer) return; + SelectMgr_IndexedMapOfOwner anAllMap, aToHiliteMap; - DocumentModel* docModel = HEXABLOCKGUI::currentDocGView->getDocumentModel(); - _PTR(Study) aStudy = GetActiveStudyDocument(); - if (!aStudy || docModel == NULL) return; + // Get entity owners for all activated selection modes + getEntityOwners( anObj, anIC, anAllMap ); - CORBA::Object_var aCorbaObj = CORBA::Object::_nil(); - GEOM::GEOM_Object_var aGeomObj = GEOM::GEOM_Object::_nil(); - HEXABLOCKGUI::geomBaseHelper->erasePreview(true); + // Convert into the map of owners to highlight/unhighlight + indicesToOwners( aIndexMap, anObj->Shape(), anAllMap, aToHiliteMap ); - foreach ( QString shapeName, entrySubIDs.keys() ){ + for ( Standard_Integer i = 1, n = aToHiliteMap.Extent(); i <= n; i++ ) + anIC->AddOrRemoveSelected( aToHiliteMap( i ), false ); + + anIC->SetAutomaticHilight( isAutoHilight ); + anIC->HilightSelected( false ); +} + +void OccGraphicView::highlight( const QMultiMap& entrySubIDs, bool only) +{ + + if (HEXABLOCKGUI::currentDocGView == NULL || viewWindow == NULL) + return; + + SOCC_Viewer* soccViewer = dynamic_cast( viewWindow->getViewManager()->getViewModel() ); + DocumentModel* docModel = HEXABLOCKGUI::currentDocGView->getDocumentModel(); + if (soccViewer == NULL || docModel == NULL) + return; + + foreach ( QString shapeName, entrySubIDs.uniqueKeys() ) + { QString shapeEntry = docModel->getGeomObjEntry(shapeName); - _PTR(SObject) aSChild = aStudy->FindObjectID( shapeEntry.toStdString() ); - aCorbaObj = corbaObj( aSChild ); - aGeomObj = GEOM::GEOM_Object::_narrow( aCorbaObj ); - if ( !CORBA::is_nil(aGeomObj) ){ - QString objIOR = GEOMBase::GetIORFromObject( aGeomObj._retn() ); - Handle(GEOM_AISShape) aSh = GEOMBase::ConvertIORinGEOMAISShape( objIOR );//, true ); - if ( !aSh.IsNull() ){ - TColStd_IndexedMapOfInteger anIndexes; - foreach ( int subid, entrySubIDs.values(shapeName) ){ - if ( subid != -1 ) - anIndexes.Add( subid ); - } - if ( anIndexes.Extent() > 0 ){ // if it's a sub-shape - aSh->highlightSubShapes( anIndexes, true ); - // soccViewer->Repaint(); - } else { // or a main shape - // std::cout << "aSh->getIO() => " << aSh->getIO() << std::endl; - // soccViewer->setColor( aSh->getIO(), QColor( Qt::red ), true ); - // soccViewer->switchRepresentation( aSh->getIO(), 2 ); - // globalSelection(); - soccViewer->highlight( aSh->getIO(), true, true ); // TODO: not working - } - } + Handle(AIS_Shape) anObj = getShape(shapeEntry); + if ( anObj.IsNull() ) continue; + TColStd_IndexedMapOfInteger anIndexes; + QSet subIds = entrySubIDs.values(shapeName).toSet(); + foreach ( int subId, subIds ){ + if ( subId != -1 ) + anIndexes.Add( subId ); } - } - soccViewer->Repaint(); + if ( anIndexes.Extent() == 0 ) continue; + highlightSubShapes( anObj, anIndexes, only ); + } + soccViewer->Repaint(); +} + +void OccGraphicView::addShape(QString& entry, const Handle(AIS_Shape)& ais_shape) +{ + if (shapes.contains(entry) || entry.isEmpty()) + return; + + shapes[entry] = ais_shape; +} + +Handle(AIS_Shape) OccGraphicView::getShape(const QString& entry) +{ + Handle(AIS_Shape) aSh; + + if (!shapes.contains(entry)) + return aSh; + + return shapes[entry]; +} + +Handle(AIS_InteractiveContext) OccGraphicView::getContext() +{ + Handle (AIS_InteractiveContext) anIC; + if (viewWindow == NULL) + return anIC; + + SUIT_ViewManager* vm = viewWindow->getViewManager(); + OCCViewer_Viewer* viewer = dynamic_cast(vm->getViewModel()); + Handle (V3d_Viewer) v3d_viewer = viewer->getViewer3d(); + anIC = viewer->getAISContext(); + + return anIC; +} + +void OccGraphicView::addVertexToCloud(TopoDS_Vertex& vertex) +{ + // * add the vertex to the cloud + DocumentModel* docModel = HEXABLOCKGUI::currentDocGView->getDocumentModel(); + QString shapeName = "cloud"; + Handle(AIS_Shape) ais_shape = shapes[docModel->getGeomObjEntry(shapeName)]; + TopoDS_Shape sh = ais_shape->Shape(); + BRep_Builder compoundBuilder; + compoundBuilder.Add(sh, vertex); + + // * redisplay the cloud + ais_shape->Redisplay(); + if (viewWindow == NULL) + return; + SALOME_View* vf = dynamic_cast(viewWindow->getViewManager()->getViewModel()); + if (vf == NULL) + return; + vf->Repaint(); +} + +void OccGraphicView::displayPreview(TopoDS_Shape& shape) +{ + if (viewWindow == NULL) + return; + SALOME_View* vf = dynamic_cast(viewWindow->getViewManager()->getViewModel()); + if (vf == NULL) + return; + + previewShape->Set(shape); +// previewShape->SetColor(Quantity_NOC_RED); + getContext()->SetColor( previewShape, Quantity_NOC_RED ); + previewShape->Redisplay(); + vf->Repaint(); +} + + +Handle(AIS_Shape) OccGraphicView::getPreviewShape() +{ + TopoDS_Shape shapeToPreview; + previewShape->Set(shapeToPreview); + return previewShape; } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx index c00fc11..4939d36 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_OccGraphicView.hxx @@ -26,6 +26,10 @@ #include #include "HEXABLOCKGUI_SalomeTools.hxx" +#include +#include +#include + #include #include @@ -49,9 +53,13 @@ namespace HEXABLOCK OccGraphicView(OCCViewer_ViewWindow* view, QWidget* parent=NULL); virtual ~OccGraphicView(){}; - void highlight( const QModelIndex & index ); - void highlight( const QModelIndexList & indexList ); - void highlight( const QMultiMap& entrySubIDs ); + void highlight( const QModelIndex & index, bool only=true ); + void highlight( const QModelIndexList & indexList, bool only=true ); + + // * 'only' parameter precise if we want to clear the current highlighted shapes/subshapes first + void highlightSubShapes(const Handle(AIS_Shape)& anObj, + const TColStd_IndexedMapOfInteger& aIndexMap, bool only=true); + void highlight( const QMultiMap& entrySubIDs, bool only=true ); void setViewWindow(OCCViewer_ViewWindow* view) { viewWindow = view; } OCCViewer_ViewWindow* getViewWindow() const { return viewWindow; } @@ -59,12 +67,27 @@ namespace HEXABLOCK void setSelectionMode(TopAbs_ShapeEnum mode); void setSelectionMode(const QModelIndex& eltIndex); TopAbs_ShapeEnum getSelectionMode() const { return selectionMode; } + void getSelected(SALOME_ListIO& selectedObjects); void clearSelection(); + void localSelection(const int theMode); + void globalSelection(const bool update = false ); + + void addShape(QString& entry, const Handle(AIS_Shape)& ais_shape); + Handle(AIS_Shape) getShape(const QString& entry); + Handle(AIS_InteractiveContext) getContext(); + SOCC_Prs* getPrs() const { return prs; } + void setPrs(SOCC_Prs* occPrs) { prs = occPrs; } + void addVertexToCloud(TopoDS_Vertex& vertex); + void displayPreview(TopoDS_Shape& shape); + Handle(AIS_Shape) getPreviewShape(); + private: OCCViewer_ViewWindow* viewWindow; + SOCC_Prs* prs; + Handle(AIS_Shape) previewShape; TopAbs_ShapeEnum selectionMode; - + QMap shapes; }; } } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx index 1ee47e0..e28580f 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.cxx @@ -34,20 +34,9 @@ #include #include -// #include -// #include -// #include - - #include - -// #include -// #include "SALOME_Component_i.hxx" -// #include - - #include #include #include @@ -55,10 +44,26 @@ #include #include - -#include "GeometryGUI.h" -#include CORBA_CLIENT_HEADER(GEOM_Gen) - +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "HEXABLOCKGUI.hxx" #include "HEXABLOCKGUI_SalomeTools.hxx" @@ -68,406 +73,435 @@ //#define _DEVDEBUG_ using namespace std; -// using namespace HEXABLOCK::GUI; - - - -namespace HEXABLOCK{ - - namespace GUI{ - -SUIT_Study* GetActiveStudy() -{ - SUIT_Application* app = SUIT_Session::session()->activeApplication(); - if (app) - return app->activeStudy(); - else - return NULL; -} - - -_PTR(Study) GetActiveStudyDocument() -{ - SalomeApp_Study* aStudy = dynamic_cast(GetActiveStudy()); - if (aStudy) - return aStudy->studyDS(); - else - return _PTR(Study)(); -} - - -CORBA::Object_var corbaObj( _PTR(SObject) theSO ) -{ - //std::cout<< "corbaObj( _PTR(SObject) theSO )" << std::endl; - CORBA::Object_var aCorbaObj = CORBA::Object::_nil(); - if ( theSO ) { - //std::cout<< "theSO" << std::endl; - std::string aValue = theSO->GetIOR(); - //std::cout<< "aValue" << std::endl; - if (strcmp(aValue.c_str(), "") != 0) { - CORBA::ORB_ptr anORB = SalomeApp_Application::orb(); - //std::cout<< "anORB" << anORB << std::endl; - aCorbaObj = anORB->string_to_object(aValue.c_str()); - //std::cout<< "aCorbaObj" << aCorbaObj << std::endl; -// anDoc = Document::_narrow(aCorbaObj); - } - } - return aCorbaObj._retn(); -} - - -CORBA::Object_var corbaObj( const Handle(SALOME_InteractiveObject)& theIO ) -{ - CORBA::Object_var aCorbaObj = CORBA::Object::_nil(); - - if ( !theIO.IsNull() && theIO->hasEntry() ){ - _PTR(Study) aStudy = GetActiveStudyDocument(); - _PTR(SObject) aSObj = aStudy->FindObjectID(theIO->getEntry()); - aCorbaObj = corbaObj(aSObj); - } - return aCorbaObj._retn(); -} - -/* -std::string name( _PTR(SObject) theSO ) -{ - std::cout << "name( _PTR(SObject) theSO )"<< theSO; - std::string aResName; - if ( theSO ) - { - _PTR(GenericAttribute) anAttr; - _PTR(AttributeName) aNameAttr; - if ( theSO->FindAttribute( anAttr, "AttributeName" ) ) - { - std::cout << "FindAttribute"; - aNameAttr = anAttr; - std::cout << "aNameAttr = anAttr"; - aResName = aNameAttr->Value().c_str(); - } - } - return aResName; -} - - -std::string name( const std::string& entry ) -{ - std::cout << "name( const std::string& entry )"<< entry; - std::string aResName; - - SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); - if ( appStudy ){ - std::cout << "appStudy => "<< appStudy ; - _PTR(Study) aStudy = appStudy->studyDS(); - std::cout << "aStudy=> "<< appStudy ; - _PTR(SObject) obj( aStudy->FindObjectID( entry ) ); - std::cout << "obj=> "<< obj; - aResName = name( obj ); - } - - return aResName; -} -*/ - - - -SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry) -{ -// SVTK_ViewWindow* aViewWindow = dynamic_cast(theWindow); - SALOME_Actor *foundActor = NULL; - vtkActor *aVTKActor = NULL; - Handle(SALOME_InteractiveObject) anIO; - - vtkRenderer *aRenderer = theVtkViewWindow->getRenderer(); - VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); - vtkActorCollection *aCollection = aCopy.GetActors(); - aCollection->InitTraversal(); - while( aVTKActor = aCollection->GetNextActor() ){ -// if ( anAct->IsA("GEOM_Actor") ) std::cout<<"is an actor"<< std::endl; - foundActor = dynamic_cast( aVTKActor ); - if ( foundActor && foundActor->hasIO() ){ - anIO = foundActor->getIO(); - if( anIO->hasEntry() && strcmp(anIO->getEntry(), theEntry) == 0 ) - return foundActor; - } - } - - return NULL; // no actor found -} - - - - -/* -SVTK_ViewWindow* GetActiveVTKViewWindow() -{ - SVTK_ViewWindow* aVtkView = NULL; - SalomeApp_Application* anApp = dynamic_cast - ( SUIT_Session::session()->activeApplication() ); - if (anApp) - aVtkView = dynamic_cast(anApp->desktop()->activeWindow()); - return aVtkView; -} - -// SUIT_ViewManager* aViewManager = -// anApp->getViewManager(SVTK_Viewer::Type(), createIfNotFound); -// if (aViewManager) { -// if (SUIT_ViewWindow* aViewWindow = aViewManager->getActiveView()) { -// if (SVTK_ViewWindow* aView = dynamic_cast(aViewWindow)) { -// aViewWindow->raise(); -// aViewWindow->setFocus(); -// return aView; -// } -// } -// } - - -SOCC_ViewWindow* GetActiveOCCViewWindow() -{ - SOCC_ViewWindow* anOccView = NULL; - SalomeApp_Application* anApp = dynamic_cast - (SUIT_Session::session()->activeApplication()); - if (anApp) - anOccView = dynamic_cast(anApp->desktop()->activeWindow()); - - - OCCViewer_ViewWindow* aOCCFrame = dynamic_cast( anApp->desktop()->activeWindow() ); - std::cout << "aOCCFrame => "<< aOCCFrame; - - return anOccView ; -} - -OCCViewer_ViewWindow* GetActiveOCCViewerWindow() +namespace HEXABLOCK { - OCCViewer_ViewWindow* aOCCFrame = NULL; - SalomeApp_Application* anApp = dynamic_cast - (SUIT_Session::session()->activeApplication()); - if (anApp) aOCCFrame = dynamic_cast( anApp->desktop()->activeWindow() ); - std::cout << "aOCCFrame => "<< aOCCFrame; - return aOCCFrame; -} - - - -int GetNameOfSelectedNodes( SVTK_ViewWindow *theWindow, - const Handle(SALOME_InteractiveObject)& theIO, - QString& theName ) -{ - SVTK_Selector* theSelector = theWindow->GetSelector(); - theName = ""; - TColStd_IndexedMapOfInteger aMapIndex; - theSelector->GetIndex(theIO,aMapIndex); - - for( int i = 1; i <= aMapIndex.Extent(); i++ ) - theName += QString(" %1").arg(aMapIndex(i)); - - return aMapIndex.Extent(); -} -*/ - - -int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow, - const Handle(SALOME_InteractiveObject)& theIO, - QString& theName ) +namespace GUI { - SVTK_Selector* theSelector = theWindow->GetSelector(); - - theName = ""; - - TColStd_IndexedMapOfInteger aMapIndex; - theSelector->GetIndex(theIO,aMapIndex); - typedef std::set TIdContainer; + SUIT_Study* GetActiveStudy() + { + SUIT_Application* app = SUIT_Session::session()->activeApplication(); + if (app) + return app->activeStudy(); + else + return NULL; + } - std::set anIdContainer; - for( int i = 1; i <= aMapIndex.Extent(); i++) - anIdContainer.insert(aMapIndex(i)); + _PTR(Study) GetActiveStudyDocument() + { + SalomeApp_Study* aStudy = dynamic_cast(GetActiveStudy()); + if (aStudy) + return aStudy->studyDS(); + else + return _PTR(Study)(); + } + + + CORBA::Object_var corbaObj( _PTR(SObject) theSO ) + { + CORBA::Object_var aCorbaObj = CORBA::Object::_nil(); + if ( theSO ) { + std::string aValue = theSO->GetIOR(); + if (strcmp(aValue.c_str(), "") != 0) { + CORBA::ORB_ptr anORB = SalomeApp_Application::orb(); + aCorbaObj = anORB->string_to_object(aValue.c_str()); + } + } + return aCorbaObj._retn(); + } + + + CORBA::Object_var corbaObj( const Handle(SALOME_InteractiveObject)& theIO ) + { + CORBA::Object_var aCorbaObj = CORBA::Object::_nil(); + + if ( !theIO.IsNull() && theIO->hasEntry() ){ + _PTR(Study) aStudy = GetActiveStudyDocument(); + _PTR(SObject) aSObj = aStudy->FindObjectID(theIO->getEntry()); + aCorbaObj = corbaObj(aSObj); + } + return aCorbaObj._retn(); + } + + + + + SALOME_Actor* findActorByEntry( SVTK_ViewWindow *theVtkViewWindow, const char* theEntry) + { + SALOME_Actor *foundActor = NULL; + vtkActor *aVTKActor = NULL; + Handle(SALOME_InteractiveObject) anIO; + + vtkRenderer *aRenderer = theVtkViewWindow->getRenderer(); + VTK::ActorCollectionCopy aCopy(aRenderer->GetActors()); + vtkActorCollection *aCollection = aCopy.GetActors(); + aCollection->InitTraversal(); + while( aVTKActor = aCollection->GetNextActor() ){ + foundActor = dynamic_cast( aVTKActor ); + if ( foundActor && foundActor->hasIO() ){ + anIO = foundActor->getIO(); + if( anIO->hasEntry() && strcmp(anIO->getEntry(), theEntry) == 0 ) + return foundActor; + } + } + + return NULL; // no actor found + } + + + int GetNameOfSelectedElements( SVTK_ViewWindow *theWindow, + const Handle(SALOME_InteractiveObject)& theIO, + QString& theName ) + { + SVTK_Selector* theSelector = theWindow->GetSelector(); + + theName = ""; + + TColStd_IndexedMapOfInteger aMapIndex; + theSelector->GetIndex(theIO,aMapIndex); + + typedef std::set TIdContainer; + + std::set anIdContainer; + + for( int i = 1; i <= aMapIndex.Extent(); i++) + anIdContainer.insert(aMapIndex(i)); + + std::set::const_iterator anIter = anIdContainer.begin(); + + for( ; anIter != anIdContainer.end(); anIter++) + theName += QString(" %1").arg(*anIter); + + return aMapIndex.Extent(); + } + + string shape2string( const TopoDS_Shape& aShape ) + { + ostringstream streamShape; + BRepTools::Write(aShape, streamShape); + + return streamShape.str(); + } + + void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj, + const Handle(AIS_InteractiveContext)& theIC, + SelectMgr_IndexedMapOfOwner& theMap ) + { + if ( theObj.IsNull() || theIC.IsNull() ) + return; + + TColStd_ListOfInteger modes; + theIC->ActivatedModes( theObj, modes ); + + TColStd_ListIteratorOfListOfInteger itr( modes ); + for (; itr.More(); itr.Next() ) { + int m = itr.Value(); + if ( !theObj->HasSelection( m ) ) + continue; + + Handle(SelectMgr_Selection) sel = theObj->Selection( m ); + + for ( sel->Init(); sel->More(); sel->Next() ) { + Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive(); + if ( entity.IsNull() ) + continue; + + Handle(SelectMgr_EntityOwner) owner = + Handle(SelectMgr_EntityOwner)::DownCast(entity->OwnerId()); + if ( !owner.IsNull() ) + theMap.Add( owner ); + } + } + } + + void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap, + const TopoDS_Shape& aMainShape, + const SelectMgr_IndexedMapOfOwner& anAllMap, + SelectMgr_IndexedMapOfOwner& aToHiliteMap ) + { + TopTools_IndexedMapOfShape aMapOfShapes; + TopExp::MapShapes(aMainShape, aMapOfShapes); + + for ( Standard_Integer i = 1, n = anAllMap.Extent(); i <= n; i++ ) + { + Handle(StdSelect_BRepOwner) anOwner = Handle(StdSelect_BRepOwner)::DownCast(anAllMap( i )); + if ( anOwner.IsNull() || !anOwner->HasShape() ) + continue; + + const TopoDS_Shape& aSubShape = anOwner->Shape(); + Standard_Integer aSubShapeId = aMapOfShapes.FindIndex( aSubShape ); + if ( !aSubShapeId || !aIndexMap.Contains( aSubShapeId ) ) + continue; + + if ( !aToHiliteMap.Contains( anOwner ) ) + aToHiliteMap.Add( anOwner ); + } + } + + TopoDS_Shape getSubShape(const TopoDS_Shape& theShape, const int theIndex) + { + TopoDS_Shape theSubShape; + + if (theShape.IsNull() || theIndex < 1) + return theSubShape; + + TopTools_IndexedMapOfShape anIndices; + TopExp::MapShapes(theShape, anIndices); + if (theIndex > anIndices.Extent()) + return theSubShape; + theSubShape = anIndices.FindKey(theIndex); + + return theSubShape; + } + + int getSubId(const TopoDS_Shape& theShape, const TopoDS_Shape& theSubShape) + { + if (theShape.IsNull() || theSubShape.IsNull()) + return -1; + + TopTools_IndexedMapOfShape anIndices; + TopExp::MapShapes(theShape, anIndices); + + return anIndices.FindIndex(theSubShape); + } + + Standard_Boolean getExtremaSolution(const gp_Pnt& theInitPnt, + const TopoDS_Shape& theRefShape, + gp_Pnt& thePnt) + { + BRepBuilderAPI_MakeVertex mkVertex (theInitPnt); + TopoDS_Vertex anInitV = TopoDS::Vertex(mkVertex.Shape()); + + BRepExtrema_DistShapeShape anExt (anInitV, theRefShape); + if ( !anExt.IsDone() || anExt.NbSolution() < 1 ) + return Standard_False; + thePnt = anExt.PointOnShape2(1); + Standard_Real aMinDist2 = theInitPnt.SquareDistance( thePnt ); + for ( Standard_Integer j = 2, jn = anExt.NbSolution(); j <= jn; j++ ) + { + gp_Pnt aPnt = anExt.PointOnShape2(j); + Standard_Real aDist2 = theInitPnt.SquareDistance( aPnt ); + if ( aDist2 > aMinDist2) + continue; + aMinDist2 = aDist2; + thePnt = aPnt; + } + return Standard_True; + } + + TopoDS_Vertex makePoint(const double x, const double y, const double z) + { + gp_Pnt thePoint(x, y, z); + return BRepBuilderAPI_MakeVertex(thePoint); + } + + TopoDS_Vertex makePointWithReference(const TopoDS_Shape& point, const double dx, + const double dy, + const double dz) + { + TopoDS_Vertex res; + gp_Pnt thePoint; + + if (point.ShapeType() != TopAbs_VERTEX) { + Standard_TypeMismatch::Raise("Aborted: referenced shape is not a vertex"); + return res; + } + gp_Pnt refPoint = BRep_Tool::Pnt(TopoDS::Vertex(point)); + thePoint = gp_Pnt(refPoint.X() + dx, refPoint.Y() + dy, refPoint.Z() + dz); + + return BRepBuilderAPI_MakeVertex(thePoint); + } + + TopoDS_Vertex makePointOnCurve(const TopoDS_Shape& edge, const double param) + { + TopoDS_Vertex res; + gp_Pnt thePoint; + + if (edge.ShapeType() != TopAbs_EDGE) { + Standard_TypeMismatch::Raise("Aborted: curve shape is not an edge"); + return res; + } + Standard_Real aFP, aLP, aP; + Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(edge), aFP, aLP); + aP = aFP + (aLP - aFP) * param; + thePoint = aCurve->Value(aP); + + return BRepBuilderAPI_MakeVertex(thePoint); + } + + TopoDS_Vertex makePointOnCurveByLength(const TopoDS_Shape& edge, const TopoDS_Shape& point, const double length) + { + TopoDS_Vertex res; + gp_Pnt thePoint; + + // RefCurve + if (edge.ShapeType() != TopAbs_EDGE) + { + Standard_TypeMismatch::Raise("Aborted: curve shape is not an edge"); + return res; + } + TopoDS_Edge aRefEdge = TopoDS::Edge(edge); + TopoDS_Vertex V1, V2; + TopExp::Vertices(aRefEdge, V1, V2, Standard_True); + + // RefPoint + TopoDS_Vertex aRefVertex; + if (point.IsNull()) + aRefVertex = V1; + else + { + if (point.ShapeType() != TopAbs_VERTEX) + { + Standard_TypeMismatch::Raise("Aborted: shape is not a vertex"); + return res; + } + aRefVertex = TopoDS::Vertex(point); + } + gp_Pnt aRefPnt = BRep_Tool::Pnt(aRefVertex); + + // Check orientation + Standard_Real UFirst, ULast; + Handle(Geom_Curve) EdgeCurve = BRep_Tool::Curve(aRefEdge, UFirst, ULast); + Handle(Geom_Curve) ReOrientedCurve = EdgeCurve; + + Standard_Real dU = ULast - UFirst; + Standard_Real par1 = UFirst + 0.1 * dU; + Standard_Real par2 = ULast - 0.1 * dU; + + gp_Pnt P1 = EdgeCurve->Value(par1); + gp_Pnt P2 = EdgeCurve->Value(par2); + + if (aRefPnt.SquareDistance(P2) < aRefPnt.SquareDistance(P1)) { + ReOrientedCurve = EdgeCurve->Reversed(); + UFirst = EdgeCurve->ReversedParameter(ULast); + } + + // Get the point by length + GeomAdaptor_Curve AdapCurve = GeomAdaptor_Curve(ReOrientedCurve); + GCPnts_AbscissaPoint anAbsPnt (AdapCurve, length, UFirst); + Standard_Real aParam = anAbsPnt.Parameter(); + thePoint = AdapCurve.Value(aParam); + + return BRepBuilderAPI_MakeVertex(thePoint); + } + + TopoDS_Vertex makePointOnCurveByCoord(const TopoDS_Shape& edge, const double x, const double y, const double z) + { + TopoDS_Vertex res; + gp_Pnt thePoint; + + if (edge.ShapeType() != TopAbs_EDGE) { + Standard_TypeMismatch::Raise("Aborted: curve shape is not an edge"); + return res; + } + gp_Pnt anInitPnt (x, y, z); + if (!getExtremaSolution(anInitPnt, edge, thePoint)) { + Standard_ConstructionError::Raise + ("Point On Surface creation aborted : cannot project point"); + return res; + } + + return BRepBuilderAPI_MakeVertex(thePoint); + } + + TopoDS_Vertex makePointOnLinesIntersection(const TopoDS_Shape& line1, const TopoDS_Shape& line2) + { + TopoDS_Vertex res; + gp_Pnt thePoint; + + if ( (line1.ShapeType() != TopAbs_EDGE && line1.ShapeType() != TopAbs_WIRE) + || (line2.ShapeType() != TopAbs_EDGE && line2.ShapeType() != TopAbs_WIRE) ) { + Standard_TypeMismatch::Raise("Aborted: Line shape is not an edge or wire"); + return res; + } + + if (line1.IsSame(line2)) + { + Standard_ConstructionError::Raise("The lines to make intersection must be different"); + return res; + } + + TopoDS_Compound aCompound; + bool retCompound = false; + + //Calculate Lines Intersection Point + BRepExtrema_DistShapeShape dst (line1, line2); + if (dst.IsDone()) { + gp_Pnt P1, P2; + BRep_Builder B; + B.MakeCompound( aCompound ); + for (int i = 1, nbSols = dst.NbSolution(); i <= nbSols; i++) { + P1 = dst.PointOnShape1(i); + P2 = dst.PointOnShape2(i); + Standard_Real Dist = P1.Distance(P2); + if ( Dist <= Precision::Confusion() && dst.NbSolution() > 1) { + BRepBuilderAPI_MakeVertex mkVertex (P1); + B.Add(aCompound, mkVertex.Shape()); + retCompound = true; + } else if ( Dist <= Precision::Confusion() ) { + thePoint = P1; + } else { + Standard_TypeMismatch::Raise ("Shapes have not an Intersection Point"); + } + } + } + // TopoDS_Shape aShape; + if ( retCompound ) { + Standard_TypeMismatch::Raise + ("Aborted: Intersection is a compound of vertices (Not supported)"); + //aShape = aCompound; + return res; + }/* else { + BRepBuilderAPI_MakeVertex mkVertex (thePoint); + aShape = mkVertex.Shape(); + } + return aShape;*/ + + return BRepBuilderAPI_MakeVertex(thePoint); + } + + TopoDS_Vertex makePointOnSurface(const TopoDS_Shape& face, const double param_u, const double param_v) + { + TopoDS_Vertex res; + gp_Pnt thePoint; + + if (face.ShapeType() != TopAbs_FACE) { + Standard_TypeMismatch::Raise("Aborted: surface shape is not a face"); + return res; + } + + TopoDS_Face F = TopoDS::Face(face); + Handle(Geom_Surface) aSurf = BRep_Tool::Surface(F); + Standard_Real U1,U2,V1,V2; + ShapeAnalysis::GetFaceUVBounds(F,U1,U2,V1,V2); + Standard_Real U = U1 + (U2-U1) * param_u; + Standard_Real V = V1 + (V2-V1) * param_v; + thePoint = aSurf->Value(U,V); + + return BRepBuilderAPI_MakeVertex(thePoint); + } + + TopoDS_Vertex makePointOnSurfaceByCoord(const TopoDS_Shape& face, const double x, const double y, const double z) + { + TopoDS_Vertex res; + gp_Pnt thePoint; + + if (face.ShapeType() != TopAbs_FACE) { + Standard_TypeMismatch::Raise + ("Point On Surface creation aborted : surface shape is not a face"); + return res; + } + gp_Pnt anInitPnt (x, y, z); + if (!getExtremaSolution(anInitPnt, face, thePoint)) { + Standard_ConstructionError::Raise + ("Point On Surface creation aborted : cannot project point"); + } + + return BRepBuilderAPI_MakeVertex(thePoint); + } - std::set::const_iterator anIter = anIdContainer.begin(); - - for( ; anIter != anIdContainer.end(); anIter++) - theName += QString(" %1").arg(*anIter); - - //std::cout << "GetNameOfSelectedElements name =>" << theName.toStdString() << std::endl; - return aMapIndex.Extent(); } -string shape2string( const TopoDS_Shape& aShape ) -{ - ostringstream streamShape; -// string strShape; - BRepTools::Write(aShape, streamShape); -// BRepTools::Write(aShape, strShape); - - return streamShape.str(); } - - - - - -// SALOME_View* LightApp_Displayer::GetActiveView() -// { -// SUIT_Session* session = SUIT_Session::session(); -// if ( SUIT_Application* app = session->activeApplication() ) { -// if ( LightApp_Application* sApp = dynamic_cast( app ) ) { -// if( SUIT_ViewManager* vman = sApp->activeViewManager() ) { -// if ( SUIT_ViewModel* vmod = vman->getViewModel() ) -// return dynamic_cast( vmod ); -// } -// } -// } -// return 0; -// } - - - -MyGEOM_Displayer::MyGEOM_Displayer( SalomeApp_Study* app ): -GEOM_Displayer( app ) -{ -} - -MyGEOM_Displayer::~MyGEOM_Displayer() -{ -} - -SALOME_Prs* MyGEOM_Displayer::BuildPrs( GEOM::GEOM_Object_ptr theObj ) -{ - //std::cout << "MyGEOM_Displayer::BuildPrs( GEOM::GEOM_Object_ptr theObj )" << std::endl; - if ( theObj->_is_nil() ) - return 0; - - SALOME_View* view = NULL; - - SUIT_ViewManager* vman = NULL; - if (HEXABLOCKGUI::currentOccGView->getViewWindow() != NULL) - vman = HEXABLOCKGUI::currentOccGView->getViewWindow()->getViewManager(); - - SUIT_ViewModel* vmodel = NULL; - if ( vman ) - vmodel = vman->getViewModel(); - if ( vmodel ) - view = dynamic_cast(vmodel); - - myViewFrame = view ;//GetActiveView(); - if ( myViewFrame == 0 ) - return 0; - - SALOME_Prs* aPrs = myViewFrame->CreatePrs(); - if ( aPrs == 0 ) - return 0; - - internalReset(); - setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), theObj ) ); - myType = theObj->GetType(); - - // Update presentation - UpdatePrs( aPrs ); - - return aPrs; -} - -} //namespace GUI{ - -}//namespace HEXABLOCK{ - -////////////////////////////////////////////////////////////////////////// - - -// SUIT_Study* GetActiveStudy(); -// std::string name( _PTR(SObject) theSO ); -// std::string name( const std::string& entry ); -// SVTK_ViewWindow* GetActiveVTKViewWindow(); -// SOCC_ViewWindow* GetActiveOCCViewWindow(); -// OCCViewer_ViewWindow* GetActiveOCCViewerWindow(); -// int GetNameOfSelectedNodes( SVTK_ViewWindow *theWindow, -// const Handle(SALOME_InteractiveObject)& theIO, -// QString& theName ); - -// QString addInStudy ( GEOM::GEOM_Object_ptr o, const char* theName ) -// { -// QString res; -// -// std::cout << "getStudyId() => " << getStudyId() << std::endl; -// std::cout << "getStudy() => " << getStudy() << std::endl; -// -// openCommand(); -// res = GEOMBase_Helper::addInStudy(o, theName); -// std::cout << "addInStudy => " << res.toStdString() << std::endl; -// commitCommand(); -// return res; -// } -// -// -// // displayPreview( obj, true, activate, false, lineWidth, displayMode, color ); -// void displayPreview( GEOM::GEOM_Object_ptr obj, -// const bool append = false, -// const bool activate = false, -// const bool update = true, -// const double lineWidth = -1, -// const int displayMode = -1, -// const int color = -1 ) -// { -// std::cout << "AAAAAAAAAA => " << std::endl; -// // GEOM::GEOM_ITransformOperations_var anOp = -// // getGeomEngine()->GetITransformOperations(getStudyId()); -// // GEOM::GEOM_Object_ptr obj2 = anOp->TranslateDXDYDZ (obj, 100, 100, 100); -// -// GEOM::GEOM_IBasicOperations_var anOp = -// getGeomEngine()->GetIBasicOperations(getStudyId()); -// std::cout << "BBBBBBBBBB => " << std::endl; -// GEOM::GEOM_Object_ptr obj2 = anOp->MakePointXYZ (100, 125, 150); -// -// std::cout << "obj2->GetEntry() => " << obj2->GetEntry()<< std::endl; -// std::cout << "obj2->GetStudyID() => " << obj2->GetStudyID()<< std::endl; -// std::cout << "obj2->GetType() => " << obj2->GetType()<< std::endl; -// std::cout << "obj2->GetShapeType() => " << obj2->GetShapeType()<< std::endl; -// -// QString res = addInStudy ( obj2, "trans"); -// std::cout << "trans => " << res.toStdString() << std::endl; -// -// globalSelection(); // close local contexts, if any -// localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); -// GEOMBase_Helper::activate( 39);//GEOM_MARKER ); -// -// // getDisplayer()->SetColor( Quantity_NOC_RED ); -// // getDisplayer()->SetColor( Quantity_NOC_CYAN1 ); -// -// // set width of displayed shape -// // getDisplayer()->SetWidth( (lineWidth == -1)?8:lineWidth ); -// -// GEOMBase_Helper::displayPreview( obj2, -// true, //append, -// true, //activate, -// update, -// 8,//lineWidth, -// displayMode, -// Quantity_NOC_CYAN1);//Quantity_NOC_RED);//color ); -// -// -// } -// -// void erase( GEOM::GEOM_Object_ptr obj, const bool d = true) -// { -// GEOMBase_Helper::erase( obj, d); -// } - - - -// TopoDS_Shape GEOMBase::GetShapeFromIOR(QString IOR) -// { -// TopoDS_Shape result; -// if(IOR.trimmed().isEmpty()) -// return result; -// -// CORBA::Object_var obj = SalomeApp_Application::orb()->string_to_object(IOR.toLatin1().data()); -// if(CORBA::is_nil(obj)) -// return result; -// GEOM::GEOM_Object_var GeomObject = GEOM::GEOM_Object::_narrow( obj ); -// if (GeomObject->_is_nil()) -// return result; -// -// result = GEOM_Client().GetShape(GeometryGUI::GetGeomGen(), GeomObject); -// return result; -// } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx index 7b0f372..57d1693 100644 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_SalomeTools.hxx @@ -25,19 +25,15 @@ #include #include #include - - -#include "GEOM_Client.hxx" -// #include "GEOMBase_Helper.h" -#include "GEOM_Displayer.h" - - - -#include +#include +#include +#include #include #include - +#include +#include +#include namespace HEXABLOCK { @@ -57,31 +53,39 @@ namespace HEXABLOCK std::string shape2string( const TopoDS_Shape& aShape ); + void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj, + const Handle(AIS_InteractiveContext)& theIC, + SelectMgr_IndexedMapOfOwner& theMap ); - - class MyGEOM_Displayer : public GEOM_Displayer - { - public: - MyGEOM_Displayer( SalomeApp_Study* app ); - virtual ~MyGEOM_Displayer(); - - - SALOME_Prs* BuildPrs( GEOM::GEOM_Object_ptr theObj ); + void indicesToOwners( const TColStd_IndexedMapOfInteger& aIndexMap, + const TopoDS_Shape& aMainShape, + const SelectMgr_IndexedMapOfOwner& anAllMap, + SelectMgr_IndexedMapOfOwner& aToHiliteMap ); -// int aPrevDispMode = getDisplayer()->SetDisplayMode( displayMode ); -// getDisplayer()->SetToActivate( activate ); -// getDisplayer()->SetName( objStr.in() ); -// SALOME_Prs* aPrs = getDisplayer()->BuildPrs( object ); + TopoDS_Shape getSubShape(const TopoDS_Shape& theShape, const int theIndex); + int getSubId(const TopoDS_Shape& theShape, const TopoDS_Shape& theSubShape); + Standard_Boolean getExtremaSolution(const gp_Pnt& theInitPnt, + const TopoDS_Shape& theRefShape, + gp_Pnt& thePnt); + TopoDS_Vertex makePoint(const double x, const double y, const double z); + TopoDS_Vertex makePointWithReference(const TopoDS_Shape& point, const double dx, + const double dy, + const double dz); - }; + TopoDS_Vertex makePointOnCurve(const TopoDS_Shape& edge, const double param); + TopoDS_Vertex makePointOnCurveByLength(const TopoDS_Shape& edge, const TopoDS_Shape& point, const double length); + TopoDS_Vertex makePointOnCurveByCoord(const TopoDS_Shape& edge, const double x, const double y, const double z); + TopoDS_Vertex makePointOnLinesIntersection(const TopoDS_Shape& line1, const TopoDS_Shape& line2); + TopoDS_Vertex makePointOnSurface(const TopoDS_Shape& face, const double param_u, const double param_v); + TopoDS_Vertex makePointOnSurfaceByCoord(const TopoDS_Shape& face, const double x, const double y, const double z); } } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.cxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.cxx index a889249..d795a38 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.cxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.cxx @@ -100,18 +100,18 @@ using namespace std; using namespace HEXABLOCK::GUI; using namespace HEXA_NS; - +// !!! ceci est ni pipe ni un actor mais un mélange des deux Document_Actor::Document_Actor( Document* doc, const QString& entry ): SALOME_Actor(), _doc( doc ) { DEBTRACE("Document_Actor::Document_Actor " << entry.toLatin1() ); - Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject( entry.toLatin1(), "HEXABLOCK" );//,theName); CS_TODO + const char* docName = ((doc != NULL) ? doc->getName() : ""); + Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject( entry.toLatin1(), "HEXABLOCK", docName );//,theName); CS_TODO setIO(anIO); vtkUnstructuredGrid* aGrid = getUnstructuredGrid(); - // std::cout << "Document_Actor aGrid->GetNumberOfCells() =>"<< aGrid->GetNumberOfCells(); vtkDataSetMapper* aMapper = vtkDataSetMapper::New(); - aMapper->SetInputData(aGrid); + aMapper->SetInput(aGrid); aGrid->Delete(); SetVisibility( true );//VisibilityOff(); @@ -121,15 +121,14 @@ Document_Actor::Document_Actor( Document* doc, const QString& entry ): vtkProperty* aProp = vtkProperty::New(); - // aProp->SetRepresentationToSurface(); +// aProp->SetRepresentationToSurface(); aProp->SetRepresentationToWireframe(); - // aProp->SetRepresentationToPoints(); +// aProp->SetRepresentationToPoints(); aProp->EdgeVisibilityOn (); aProp->SetPointSize(5); SetProperty( aProp ); aProp->Delete(); - // SetPointRepresentation(true); - +// SetPointRepresentation(true); } Document_Actor::~Document_Actor() @@ -301,12 +300,13 @@ Associate_Actor::Associate_Actor( Document* doc, const QString& entry) : SALOME_Actor(), _doc( doc ) { DEBTRACE("Associate_Actor::Associate_Actor " << entry.toLatin1() ); - Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject( entry.toLatin1(), "HEXABLOCK" );//,theName); CS_TODO + const char* docName = ((doc != NULL) ? doc->getName() : ""); + Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject( entry.toLatin1(), "HEXABLOCK", docName );//,theName); CS_TODO setIO(anIO); vtkUnstructuredGrid* aGrid = getUnstructuredGrid(); vtkDataSetMapper* aMapper = vtkDataSetMapper::New(); - aMapper->SetInputData(aGrid); + aMapper->SetInput(aGrid); aGrid->Delete(); SetVisibility( true );//VisibilityOff(); @@ -316,14 +316,14 @@ Associate_Actor::Associate_Actor( Document* doc, const QString& entry) vtkProperty* aProp = vtkProperty::New(); aProp->SetColor(0,255,0); - // aProp->SetRepresentationToSurface(); +// aProp->SetRepresentationToSurface(); aProp->SetRepresentationToWireframe(); - // aProp->SetRepresentationToPoints(); +// aProp->SetRepresentationToPoints(); aProp->EdgeVisibilityOn (); aProp->SetPointSize(5); SetProperty( aProp ); aProp->Delete(); - // SetPointRepresentation(true); +// SetPointRepresentation(true); } // ===================================================== getUnstructuredGrid @@ -357,7 +357,6 @@ vtkUnstructuredGrid* Associate_Actor::getUnstructuredGrid() aPoints->Delete(); // theGrid->SetCells( 0, 0, 0, 0, 0 ); - // Calculate cells size int nb0DElement = _doc->countVertex(); int nbEdge = _doc->countEdge(); @@ -505,6 +504,7 @@ VtkDocumentGraphicView::VtkDocumentGraphicView( DocumentModel* documentModel, patternGeomModel = new PatternGeomModel(parent); groupsModel = new GroupsModel(parent); meshModel = new MeshModel(parent); + patternDataModel->setSourceModel(documentModel); patternBuilderModel->setSourceModel(documentModel); patternGeomModel->setSourceModel(documentModel); @@ -517,6 +517,7 @@ VtkDocumentGraphicView::VtkDocumentGraphicView( DocumentModel* documentModel, patternGeomSelectionModel = new PatternGeomSelectionModel(patternGeomModel); groupsSelectionModel = new GroupsSelectionModel(groupsModel); meshSelectionModel = new MeshSelectionModel(meshModel ); + setSelectionModel(patternDataSelectionModel); } @@ -580,12 +581,11 @@ void VtkDocumentGraphicView::removeActor() void VtkDocumentGraphicView::update() { - DocumentModel* theModel = dynamic_cast( model() ); if (theModel == NULL || viewWindow == NULL) return; Document* theDocumentImpl = theModel->documentImpl(); - QString theDocumentEntry = theModel->documentEntry(); + QString theDocumentEntry = theModel->documentEntry(); if ( documentActor ){ viewWindow->RemoveActor( documentActor ); @@ -613,19 +613,16 @@ void VtkDocumentGraphicView::setVertexSelection() // // FaceSelection, // // VolumeSelection, // // ActorSelection }; - selectionMode = VERTEX_TREE; } void VtkDocumentGraphicView::setEdgeSelection() { setSelectionMode(EdgeSelection); - selectionMode = EDGE_TREE; } void VtkDocumentGraphicView::setQuadSelection() { setSelectionMode(FaceSelection); - selectionMode = QUAD_TREE; } void VtkDocumentGraphicView::setHexaSelection() @@ -644,13 +641,12 @@ void VtkDocumentGraphicView::setAllSelection() void VtkDocumentGraphicView::setSelectionMode(Selection_Mode theMode) { + if (viewWindow == NULL || selectionMode == theMode) + return; - if ( viewWindow != NULL ) - { - viewWindow->SetSelectionMode( theMode ); - selectionMode = theMode; - } - + HEXABLOCKGUI::selectionMgr()->clearSelected(); + viewWindow->SetSelectionMode( theMode ); + selectionMode = theMode; } void VtkDocumentGraphicView::setSelectionMode( const QModelIndex& eltIndex ) @@ -688,6 +684,11 @@ void VtkDocumentGraphicView::setSelectionMode( const QModelIndex& eltIndex ) } } +void VtkDocumentGraphicView::getSelected(SALOME_ListIO& selectedObjects) +{ + HEXABLOCKGUI::selectionMgr()->selectedObjects( selectedObjects, SVTK_Viewer::Type()); +} + void VtkDocumentGraphicView::clearSelection() { if (viewWindow != NULL) @@ -709,14 +710,16 @@ void VtkDocumentGraphicView::highlight( const QModelIndex& ielt ) void VtkDocumentGraphicView::highlight( const QModelIndexList& elts ) { - if (elts.size() == 0 || viewWindow == NULL || documentActor == NULL) return; + if (elts.size() == 0 || viewWindow == NULL || documentActor == NULL) + return; SVTK_Selector* selector = viewWindow->GetSelector(); - if ( selector == NULL ) return; -// // Set selection mode in VTK view + if ( selector == NULL ) + return; + // Set selection mode in VTK view // viewWindow->SetSelectionMode(VolumeSelection); // --- elements highlight --- - TColStd_MapOfInteger aMap; + TColStd_IndexedMapOfInteger aMap; int vtkElemsId; QString eltEntry; @@ -725,13 +728,12 @@ void VtkDocumentGraphicView::highlight( const QModelIndexList& elts ) { eltEntry = iElt.data( HEXA_ENTRY_ROLE ).toString(); vtkElemsId = documentActor->vtkElemsId[ eltEntry.toInt() ]; - if ( vtkElemsId > 0 ) aMap.Add( vtkElemsId ); + if ( vtkElemsId > 0 ) + aMap.Add( vtkElemsId ); } } - selector->AddOrRemoveIndex( documentActor->getIO(), aMap, false ); //true + selector->AddOrRemoveIndex( documentActor->getIO(), aMap, false ); viewWindow->highlight( documentActor->getIO(), true, true ); - documentActor->highlight( false ); //unhighlight de la bounding box rouge - } @@ -743,12 +745,10 @@ void VtkDocumentGraphicView::highlightGroups( const QModelIndex& eltIndex ) QVariant treeVariant = eltIndex.data( HEXA_TREE_ROLE ); if ( !treeVariant.isValid()) - //INFOS("data from model not valid"); return; int eltType = treeVariant.toInt(); if ( eltType != GROUP_TREE ) - //INFOS("bad element type : not a group item" << eltType ); return; //Get elements to highlight @@ -794,12 +794,10 @@ void VtkDocumentGraphicView::highlightPropagation( const QModelIndex& eltIndex ) QVariant treeVariant = eltIndex.data( HEXA_TREE_ROLE ); if ( !treeVariant.isValid()) - //INFOS("data from model not valid"); return; int eltType = treeVariant.toInt(); if ( eltType != PROPAGATION_TREE ) - //INFOS("bad element type : not a group item" << eltType ); return; // Get elements to highlight @@ -899,8 +897,6 @@ QRegion VtkDocumentGraphicView::visualRegionForSelection(const QItemSelection &s } - - /******************************************************************************** * PROTECTED SLOTS ********************************************************************************/ @@ -914,7 +910,6 @@ void VtkDocumentGraphicView::commitData ( QWidget * editor ) void VtkDocumentGraphicView::currentChanged( const QModelIndex & current, const QModelIndex & previous ) { - // openPersistentEditor( current ); _currentChanged = true; } @@ -922,7 +917,6 @@ void VtkDocumentGraphicView::dataChanged ( const QModelIndex & topLeft, const QM { update(); _currentChanged = false; - // updateObject(topLeft); } void VtkDocumentGraphicView::editorDestroyed ( QObject * editor ) @@ -945,173 +939,20 @@ void VtkDocumentGraphicView::updateGeometries () { } -// bool DocumentGraphicView::canBeDisplayed( const QString& entry, const QString& viewer_type ) const //CS_TODO -// { -// bool result = false; -// -// result = (viewer_type==SVTK_Viewer::Type()); -// // QStringList es = entry.split( "_" );22 -// // bool result = ( es.count() == 3 && es[ 0 ] == "ATOMSOLVGUI" && viewer_type == SVTK_Viewer::Type() ); -// // // printf ( " canBeDisplayed : entry = %s, count = %d, res = %d \n", entry.latin1(), es.count(), result ); -// std::cout << "canBeDisplayed => "<< result << std::endl; -// return result; // entry of an atom for sure -// } - -// SALOME_Prs* HEXABLOCKGUI_Displayer::buildPresentation( const QString& entry, SALOME_View* theViewFrame) -// { -// SALOME_Prs* prs = 0; -// -// SALOME_View* aViewFrame = theViewFrame ? theViewFrame : GetActiveView(); -// -// if ( aViewFrame ) -// { -// SVTK_Viewer* vtk_viewer = dynamic_cast( aViewFrame ); -// if (vtk_viewer) -// { -// SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView(); -// SALOME_Actor* anActor = myGraphicView->FindActorByEntry( wnd, entry.toLatin1().data() ); -// if (!anActor) -// { -// // anActor = myGraphicView->CreateActor( study()->studyDS(), entry.toLatin1().data(), true ); -// anActor = myGraphicView->CreateActor(entry.toLatin1().data()); -// } -// if (anActor) -// { -// // Display actor : -// SVTK_ViewWindow* vtkWnd = dynamic_cast (wnd); -// if (vtkWnd != NULL) -// { -// vtkWnd->AddActor(anActor); -// vtkWnd->Repaint(); -// prs = LightApp_Displayer::buildPresentation(entry.toLatin1().data(), aViewFrame); -// } -// } -// if (prs) -// { -// UpdatePrs(prs); -// } -// else if (anActor) -// { -// //SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor ); -// std::cout << "Remove Actor" << std::endl; -// } -// } -// } -// -// return prs; -// } - -// SALOME_Prs* SMESHGUI_Displayer::buildPresentation( const QString& entry, SALOME_View* theViewFrame ) -// { -// SALOME_Prs* prs = 0; -// -// SALOME_View* aViewFrame = theViewFrame ? theViewFrame : GetActiveView(); -// -// if ( aViewFrame ) -// { -// SVTK_Viewer* vtk_viewer = dynamic_cast( aViewFrame ); -// if( vtk_viewer ) -// { -// SUIT_ViewWindow* wnd = vtk_viewer->getViewManager()->getActiveView(); -// SMESH_Actor* anActor = SMESH::FindActorByEntry( wnd, entry.toLatin1().data() ); -// if( !anActor ) -// anActor = SMESH::CreateActor( study()->studyDS(), entry.toLatin1().data(), true ); -// if( anActor ) -// { -// SMESH::DisplayActor( wnd, anActor ); -// prs = LightApp_Displayer::buildPresentation( entry.toLatin1().data(), aViewFrame ); -// } -// if( prs ) -// UpdatePrs( prs ); -// else if( anActor ) -// SMESH::RemoveActor( vtk_viewer->getViewManager()->getActiveView(), anActor ); -// } -// } -// -// return prs; -// } - -// -// void DocumentGraphicView::RemoveActor(SUIT_ViewWindow *theWnd, SALOME_Actor* theActor) -// { -// std::cout << "RemoveActor() : 1" << std::endl; -// SVTK_ViewWindow* myViewWindow = dynamic_cast(theWnd); -// // SVTK_ViewWindow* myViewWindow = dynamic_cast(_suitView); -// if (myViewWindow != NULL) -// { -// myViewWindow->RemoveActor(theActor); -// if(theActor->hasIO()) -// { -// std::cout << "RemoveActor() : 2" << std::endl; -// Handle(SALOME_InteractiveObject) anIO = theActor->getIO(); -// if(anIO->hasEntry()) -// { -// std::cout << "RemoveActor() : 3" << std::endl; -// std::string anEntry = anIO->getEntry(); -// SalomeApp_Study* aStudy = dynamic_cast( myViewWindow->getViewManager()->study() ); -// int aStudyId = aStudy->id(); -// // TVisualObjCont::key_type aKey(aStudyId,anEntry); -// // VISUAL_OBJ_CONT.erase(aKey); -// } -// } -// theActor->Delete(); -// myViewWindow->Repaint(); -// std::cout << "RemoveActor() : 4" << std::endl; -// } -// } - -// bool DocumentGraphicView::eventFilter(QObject *obj, QEvent *event) -// { -// std::cout << event->type() << std::endl; -// // if ( event->type() == QEvent::FocusIn ){ //QEvent::KeyPress) { -// // return false; -// // } else { -// // // standard event processing -// // // return QObject::eventFilter(obj, event); -// -// if ( event->type() == QEvent::Paint ) { //QEvent::FocusIn ){ -// std::cout << "PAINTTTTTTTTTT"<< std::endl; -// // loadVTK( "/tmp/load.vtk"); //CS_TEST -// } -// return _suitView->event(event); -// // } -// } -// -// - -//show the actor when show=true and hide it when show=false -//void VtkDocumentGraphicView::showActor(bool show) -//{ -// SVTK_ViewWindow* theVTKViewWindow = dynamic_cast(_suitView); -// if (theVTKViewWindow == NULL || _documentActor == NULL) -// return; -// -// if (show) -// { -// _documentActor->SetVisibility(1); -// theVTKViewWindow->onFitAll(); -// } -// else -// { -// _documentActor->SetVisibility(0); -// theVTKViewWindow->onResetView (); -// } -//} void VtkDocumentGraphicView::setModel ( QAbstractItemModel * model ) { QAbstractItemView::setModel( model ); - // PatternDataModel* pdm = dynamic_cast(model); - // if (pdm){ - // connect( pdm, SIGNAL(patternDataChanged() ), this, SLOT ( onPatternDatachanged() ) ); - // } +// PatternDataModel* pdm = dynamic_cast(model); +// if (pdm) +// connect( pdm, SIGNAL(patternDataChanged() ), this, SLOT ( onPatternDatachanged() ) ); DocumentModel* dm = dynamic_cast(model); if (dm){ - // setWindowTitle( dm->getName() ); +// setWindowTitle( dm->getName() ); connect( dm, SIGNAL(patternDataChanged() ), this, SLOT ( onPatternDatachanged() ) ); - // connect( dm, SIGNAL( nameChanged(const QString&) ), this, SLOT ( setWindowTitle(const QString&) ) ); +// connect( dm, SIGNAL( nameChanged(const QString&) ), this, SLOT ( setWindowTitle(const QString&) ) ); } } @@ -1182,24 +1023,3 @@ void VtkDocumentGraphicView::setModel ( QAbstractItemModel * model ) // // myVTKViewWindow->SetSelectionMode( EdgeSelection ); // // myVTKViewWindow->SetSelectionMode( FaceSelection ); // } - -// void DocumentGraphicView::rowsInserted ( const QModelIndex & parent, int start, int end ) -// { -// -// // std::cout << "DocumentGraphicView::rowsInserted : " << parent.data().toString().toStdString() << std::endl; -// QModelIndex newRow; -// -// SVTK_ViewWindow* myViewWindow = dynamic_cast(_suitView); -// SUIT_ViewManager* vman = myViewWindow->getViewManager(); -// SUIT_ViewModel* vmodel = vman->getViewModel(); -// -// for ( int i = start; i<= end; ++i ){ -// newRow = parent.child(i,0); -// // std::cout << "newRow.data().toString() =>" << newRow.data().toString().toStdString() << std::endl; -// QString entry = newRow.data(HEXA_ENTRY_ROLE).toString();//.toStdString(); -// Display(entry, true, dynamic_cast(vmodel)); -// UpdateViewer(); -// -// // addObject(newRow); -// } -// } diff --git a/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx b/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx index be57527..8023424 100755 --- a/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx +++ b/src/HEXABLOCKGUI/HEXABLOCKGUI_VtkDocumentGraphicView.hxx @@ -22,17 +22,12 @@ // SALOME GUI includes #include -// #include #include #include #include #include #include -// #include -// #include -// #include - #include #include #include @@ -46,19 +41,9 @@ #include "HEXABLOCKGUI_DocumentModel.hxx" #include "HEXABLOCKGUI_DocumentSelectionModel.hxx" -// class LightApp_Displayer; -// class SalomeApp_Application; class LightApp_Application; class SALOME_Actor; -// class vtkLookupTable ; -// class vtkPoints ; -// class vtkCellArray ; -// class vtkFloatArray ; -// class vtkActor ; -// class vtkPolyData; - - class vtkUnstructuredGrid; @@ -68,43 +53,33 @@ namespace HEXABLOCK namespace GUI { -// class hexablockInteractorStyle : public SVTK_InteractorStyle -// { -// public: -// hexablockInteractorStyle() {}; -// virtual ~hexablockInteractorStyle() {}; -// -// public: -// static hexablockInteractorStyle* New() -// { -// return new hexablockInteractorStyle; -// }; -// virtual void HighlightActor2D(vtkActor2D* actor2D) {MESSAGE("% HIGHLIGHT PROP 2D %");} -// virtual void HighlightProp(vtkProp* prop) {MESSAGE("% HIGHLIGHT PROP %");} -// virtual void HighlightProp3D(vtkProp3D* prop3D) {MESSAGE("% HIGHLIGHT PROP 3D %");} -// }; - class Document_Actor : public SALOME_Actor { public: Document_Actor(HEXA_NS::Document* doc, const QString& entry); virtual ~Document_Actor(); + // Highlight + virtual void highlight(bool theHighlight) {} + std::map vtkElemsId; std::map hexaElemsId; vtkUnstructuredGrid* getUnstructuredGrid(); private: HEXA_NS::Document* _doc; - }; - // Abu + }; + // Abu class Associate_Actor : public SALOME_Actor { public: Associate_Actor(HEXA_NS::Document* doc, const QString& entry); virtual ~Associate_Actor() {} + // Highlight + virtual void highlight(bool theHighlight) {} + std::map vtkElemsId; std::map hexaElemsId; @@ -134,7 +109,8 @@ namespace HEXABLOCK void setSelectionMode( const Selection_Mode theMode ); void setSelectionMode( const QModelIndex& eltIndex ); - int getSelectionMode() const { return selectionMode;} + int getSelectionMode() const { return selectionMode; } + void getSelected(SALOME_ListIO& selectedObjects); void clearSelection(); void loadDocument(const QString& file); //Loads a selected document @@ -204,9 +180,6 @@ namespace HEXABLOCK int verticalOffset() const; QRegion visualRegionForSelection(const QItemSelection &selection) const; -// protected: -// virtual SALOME_Prs* buildPresentation( const QString&, SALOME_View* = 0 ); - private: SVTK_ViewWindow* viewWindow; int selectionMode; diff --git a/src/HEXABLOCKGUI/Hexa_QTD.ui b/src/HEXABLOCKGUI/Hexa_QTD.ui index 50da541..ffcedc9 100755 --- a/src/HEXABLOCKGUI/Hexa_QTD.ui +++ b/src/HEXABLOCKGUI/Hexa_QTD.ui @@ -6,7 +6,7 @@ 0 0 - 215 + 244 412 @@ -29,7 +29,7 @@ - Hexa + By @@ -73,7 +73,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/JoinQuad_QTD.ui b/src/HEXABLOCKGUI/JoinQuad_QTD.ui index 172d694..deec71f 100644 --- a/src/HEXABLOCKGUI/JoinQuad_QTD.ui +++ b/src/HEXABLOCKGUI/JoinQuad_QTD.ui @@ -6,14 +6,43 @@ 0 0 - 226 - 257 + 344 + 532 + + + 5 + 300 + + Join Quad(s) Operation + + + + + + + Uniform + + + true + + + + + + + Custom + + + + + + @@ -24,25 +53,19 @@ 0 0 - 212 - 427 + 306 + 646 - + - - - - 0 - 0 - - + - From + - + - + 0 @@ -50,33 +73,138 @@ - Quadrangle(s) + - - - + + + + + + 0 + 0 + + + + Quad(s) + + + + + + + + + + + + + 0 + 0 + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + From point a + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + false + + + + + + + From point b + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + false + + + + + - + 0 0 - + + + + - + - Point a + Quadrangle - + + + + 0 + 0 + + + + false + + + + + + + To point a + + + + + 0 @@ -94,15 +222,15 @@ - - + + - Point b + To point b - - + + 0 @@ -123,147 +251,142 @@ - - - - - - - - 0 - 0 - - - - To - - - - - - Quadrangle - - - - - - - - 0 - 0 - - - - false - - - - - - - Point a - - - - - + + - + 0 0 - - - 16777215 - 16777215 - - - - false - - - - - - - Point b + + + + + + + + 0 + 0 + + + + Nb layers + + + + + + + + 0 + 0 + + + + 1 + + + 1000000 + + + 1 + + + + - - + + - + 0 0 - - - 16777215 - 16777215 - - - - false + + 0 + + + height + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + - - - - 0 - 0 - + + + Qt::Vertical - - Grid + + + 20 + 0 + - - - - - - 0 - 0 - - - - size - - - - - - - - 0 - 0 - - - - 1 - - - 1000000 - - - 1 - - - - - + - groupBox_3 - groupBox_8 - groupBox @@ -271,12 +394,77 @@ vex0_le - vex2_le - quad_dest_le vex1_le + quad_dest_le + vex2_le vex3_le nb_spb - + + + joinUni_rb + clicked() + layers_height_w + hide() + + + 102 + 127 + + + 162 + 676 + + + + + join_rb + clicked() + layers_height_w + show() + + + 222 + 53 + + + 162 + 676 + + + + + join_rb + clicked() + groupBox_3 + hide() + + + 222 + 53 + + + 162 + 571 + + + + + joinUni_rb + clicked() + groupBox_3 + show() + + + 102 + 53 + + + 162 + 571 + + + + diff --git a/src/HEXABLOCKGUI/Law_QTD.ui b/src/HEXABLOCKGUI/Law_QTD.ui index 31f39cf..961c15b 100644 --- a/src/HEXABLOCKGUI/Law_QTD.ui +++ b/src/HEXABLOCKGUI/Law_QTD.ui @@ -7,7 +7,7 @@ 0 0 282 - 168 + 180 @@ -35,7 +35,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/MakeCartesian_QTD.ui b/src/HEXABLOCKGUI/MakeCartesian_QTD.ui index 78953b6..3b5e5b5 100644 --- a/src/HEXABLOCKGUI/MakeCartesian_QTD.ui +++ b/src/HEXABLOCKGUI/MakeCartesian_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 219 - 500 + 255 + 544 @@ -32,7 +32,7 @@ - Make cartesian + @@ -70,7 +70,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/MakeCylinder_QTD.ui b/src/HEXABLOCKGUI/MakeCylinder_QTD.ui index 22f7ef1..48f6825 100644 --- a/src/HEXABLOCKGUI/MakeCylinder_QTD.ui +++ b/src/HEXABLOCKGUI/MakeCylinder_QTD.ui @@ -6,12 +6,12 @@ 0 0 - 190 - 196 + 297 + 620 - + 0 0 @@ -19,148 +19,729 @@ 5 - 0 + 273 Cylinder construction - + - + - + 0 0 - + - 5 - 0 + 16777215 + 50 - Arguments + - - - - - Cylinder - - - - - + + + 0 0 - - - 16777215 - 16777215 - - - - false - - - - - - Vector + Simple + + + true - - + + 0 0 - - - 16777215 - 16777215 - - - - false - - - - - - - n (radial) - - - - - - - 1 - - - 1000000 - - - 1 - - - - - - n (angular) + Uniform - - - - 1 - - - 1000000 - - - 3 + + + + + 0 + 0 + - - - - - n (heigth) - - - - - - - 1 - - - 1000000 + Custom - - 1 + + false + + + + true + + + + + 0 + 0 + 259 + 592 + + + + + + + + 0 + 0 + + + + + 5 + 0 + + + + + + + + + + + + + origin + + + + + + + + + + axis + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + false + + + + + + + + + + base + + + + + + + + + + + + + radius + + + + + + + 6 + + + 1000000000.000000000000000 + + + 2.000000000000000 + + + + + + + hole radius + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + 1.000000000000000 + + + + + + + slice angle + + + + + + + 6 + + + 360.000000000000000 + + + 10.000000000000000 + + + 360.000000000000000 + + + + + + + height + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + nb Radial + + + + + + + 1 + + + 1000000 + + + 1 + + + + + + + nb Angular + + + + + + + 1 + + + 1000000 + + + 3 + + + + + + + nb Height + + + + + + + 1 + + + 1000000 + + + 1 + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 150 + + + + 2 + + + + radius + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + angle + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + height + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + + - + + + rb2 + clicked() + n_group + hide() + + + 257 + 40 + + + 163 + 412 + + + + + rb1 + clicked() + n_group + show() + + + 163 + 40 + + + 163 + 412 + + + + + rb2 + clicked() + random_param_w + show() + + + 257 + 40 + + + 163 + 605 + + + + + rb1 + clicked() + geomobj_group + show() + + + 163 + 40 + + + 163 + 145 + + + + + rb0 + clicked() + geomobj_group + hide() + + + 69 + 40 + + + 163 + 145 + + + + + rb0 + clicked() + n_group + show() + + + 69 + 40 + + + 163 + 412 + + + + + rb1 + clicked() + random_param_w + hide() + + + 163 + 40 + + + 163 + 605 + + + + + rb1 + clicked() + rah_group + show() + + + 163 + 40 + + + 163 + 278 + + + + + rb2 + clicked() + rah_group + hide() + + + 257 + 40 + + + 163 + 278 + + + + + rb0 + clicked() + random_param_w + hide() + + + 69 + 40 + + + 163 + 605 + + + + + rb2 + clicked() + geomobj_group + show() + + + 257 + 40 + + + 163 + 145 + + + + + rb0 + clicked() + rah_group + hide() + + + 69 + 40 + + + 163 + 278 + + + + diff --git a/src/HEXABLOCKGUI/MakeCylinders_QTD.ui b/src/HEXABLOCKGUI/MakeCylinders_QTD.ui index 7d4fc63..26075e0 100644 --- a/src/HEXABLOCKGUI/MakeCylinders_QTD.ui +++ b/src/HEXABLOCKGUI/MakeCylinders_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 212 - 106 + 275 + 407 @@ -23,60 +23,205 @@ - Arguments + - - - - - Cylinder1 + + + + + Cylinder 1 + + + + + origin + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + false + + + + + + + + 0 + 0 + + + + + + + + axis + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + radius + + + + + + + height + + + + - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - false + + + + Cylinder 2 + + + + + origin + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + false + + + + + + + + 0 + 0 + + + + + + + + axis + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + radius + + + + + + + height + + + + - - - - Cylinder2 + + + + Qt::Vertical - - - - - - - 0 - 0 - - - + - 16777215 - 16777215 + 20 + 0 - - false - - + diff --git a/src/HEXABLOCKGUI/MakeCylindrical_QTD.ui b/src/HEXABLOCKGUI/MakeCylindrical_QTD.ui index 9007a79..4e29f80 100644 --- a/src/HEXABLOCKGUI/MakeCylindrical_QTD.ui +++ b/src/HEXABLOCKGUI/MakeCylindrical_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 223 - 428 + 263 + 517 @@ -29,7 +29,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/MakeGrid_QTD.ui b/src/HEXABLOCKGUI/MakeGrid_QTD.ui index c47df53..16ac9cb 100644 --- a/src/HEXABLOCKGUI/MakeGrid_QTD.ui +++ b/src/HEXABLOCKGUI/MakeGrid_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 226 - 266 + 383 + 727 @@ -19,7 +19,7 @@ 0 - 0 + 280 @@ -35,6 +35,66 @@ false + + + + + 0 + 0 + + + + + 5 + 0 + + + + + + + + QLayout::SetDefaultConstraint + + + + + + 0 + 0 + + + + Simple + + + true + + + + + + + + 0 + 0 + + + + Uniform + + + + + + + Custom + + + + + + @@ -66,72 +126,12 @@ 0 0 - 189 - 1057 + 363 + 643 - - - - - - 0 - 0 - - - - - 5 - 0 - - - - Make Grid - - - - QLayout::SetDefaultConstraint - - - - - - 0 - 0 - - - - Cartesian - - - true - - - - - - - - 0 - 0 - - - - Cylindrical - - - - - - - Spherical - - - - - - - + + @@ -146,36 +146,21 @@ - Arguments + - - - QLayout::SetDefaultConstraint - + - - - - 0 - 0 - - - - - 0 - 152 - - - + + - + - Vertex : + origin - + 0 @@ -188,94 +173,84 @@ 16777215 + + Select a point (vertex) + + false - - + + - Vector : + vec Z - - - - - 0 - 0 - - + + 16777215 16777215 + + Select a vector + false - - - - n (x) : - - - - - - 1 + + + + 16777215 + 16777215 + - - 1000000 + + Select a vector - - 1 + + false - - + + - n (y) : - - - - - - - 1 - - - 1000000 - - - 1 + vec X - - + + - n (z) : + vec Y - - - - 1 + + + + + 0 + 0 + - - 1000000 + + + 16777215 + 16777215 + - - 1 + + false @@ -283,9 +258,9 @@ - + - + 0 0 @@ -296,511 +271,54 @@ 0 - + + + + + len X + + + + + + + 6 + + + - - - - 0 - 0 - + + + len Y - - Grid + + + + + + 6 - - - - - regular - - - true - - - - - - - irregular - - - - - - - - 0 - 0 - - - - 0 - - - - radius - - - - - - true - - - - 0 - 0 - - - - + - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - - - - Qt::Vertical - - - - 20 - 139 - - - - - - - - - angle - - - - - - true - - - - 0 - 0 - - - - + - - - - - - - - - - - 0 - 0 - - - - - - - - - - - - Qt::Vertical - - - - 20 - 139 - - - - - - - - - height - - - - - - true - - - - 0 - 0 - - - - + - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - - - - Qt::Vertical - - - - 20 - 139 - - - - - - - - - - - - - 0 - 0 - - - - - - - - 0 - 0 - - - - - 0 - 0 - - - - radius - - - - - - size : - - - - - - - 6 - - - 1000000000.000000000000000 - - - 1.000000000000000 - - - - - - - count : - - - - - - - 1 - - - 1000000 - - - 1 - - - - - - - - - - - 0 - 0 - - - - angle - - - - - - value : - - - - - - - 6 - - - 360.000000000000000 - - - 10.000000000000000 - - - 360.000000000000000 - - - - - - - count : - - - - - - - 3 - - - 1000000 - - - 3 - - - - - - - - - - - 0 - 0 - - - - height - - - - - - size : - - - - - - - 6 - - - 1000000000.000000000000000 - - - 1.000000000000000 - - - - - - - count : - - - - - - - 1 - - - 1000000 - - - 1 - - - - - - - - - - - - - fill - - - - - - - - - 0 - 0 - + + + + len Z - - Cylinder + + + + + + 6 - - - - - center - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Select a point (vertex) - - - - false - - - - - - - axis - - - - - - - - 16777215 - 16777215 - - - - Select a vector - - - false - - - - - - - - 16777215 - 16777215 - - - - Select a vector - - - false - - - - - - - base - - - - - + 0 @@ -810,80 +328,59 @@ 0 - 130 + 0 - + - + - Vertex + nb X - - - - 0 - 0 - + + + 1 - - - 16777215 - 16777215 - + + 1000000 - - false + + 1 - + - Radius + nb Y - - - - 0 - 0 - - - - 6 - + - 0.000000000000000 + 1 - 1000000000.000000000000000 + 1000000 - 1.000000000000000 + 3 - + - nb + nb Z - - - - 0 - 0 - - + 1 @@ -895,51 +392,208 @@ - - - - k - - - - - - - - 0 - 0 - - - - 6 - - - 1000000000.000000000000000 - - - 1.000000000000000 - - - - - - Qt::Vertical + + + + 0 + 0 + - - - 20 - 40 - + + 1 - + + + X + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + Y + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + Z + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -947,249 +601,222 @@ - scrollArea rb0 rb1 rb2 - vex_le_rb0 - vec_le_rb0 - center_le_rb1 - height_le_rb1 - base_le_rb1 - vex_le_rb2 - nx_spb_rb0 - ny_spb_rb0 - nz_spb_rb0 - uniform_rb - random_rb + scrollArea + center_le + base_le + vec_le + axis_le + lx_spb + ly_spb + lz_spb + nx_spb + ny_spb + nz_spb random_param_w add_radius_pb del_radius_pb radius_lw - dr_spb_rb1 - nr_spb_rb1 - da_spb_rb1 - na_spb_rb1 - dl_spb_rb1 - nl_spb_rb1 - fill_cb_rb1 - radius_spb_rb2 - nb_spb_rb2 - k_spb_rb2 + del_angle_pb add_angle_pb add_height_pb - del_angle_pb - del_height_pb - height_lw angle_lw + height_lw + del_height_pb - rb1 + rb0 clicked() - cylindrical_widget + cartesian_widget show() - 231 - 56 + 99 + 54 - 208 - 571 + 240 + 347 - rb1 + rb0 clicked() - cartesian_widget + widget hide() - 231 - 56 + 99 + 54 - 208 - 190 + 240 + 251 - rb1 + rb0 clicked() - spherical_widget + random_param_w hide() - 231 - 56 + 99 + 54 - 208 - 938 + 240 + 728 - rb2 + rb0 clicked() - cylindrical_widget + lxyz_widget hide() - 345 - 56 + 99 + 54 - 208 - 571 + 240 + 485 - rb2 + rb1 clicked() - cartesian_widget - hide() + lxyz_widget + show() - 345 - 56 + 233 + 54 - 208 - 190 + 240 + 485 - rb2 + rb1 clicked() - spherical_widget + widget show() - 345 - 56 + 233 + 54 - 208 - 938 + 240 + 251 - rb0 + rb1 clicked() cartesian_widget show() - 95 - 56 + 233 + 54 - 208 - 190 + 240 + 347 - rb0 - clicked() - cylindrical_widget - hide() - - - 95 - 56 - - - 208 - 571 - - - - - rb0 + rb1 clicked() - spherical_widget + random_param_w hide() - 95 - 56 + 233 + 54 - 208 - 938 + 240 + 728 - uniform_rb + rb2 clicked() random_param_w - hide() + show() - 135 - 450 + 348 + 54 - 224 - 539 + 240 + 728 - random_rb + rb2 clicked() - random_param_w + widget show() - 313 - 450 + 348 + 54 - 224 - 539 + 240 + 251 - uniform_rb + rb2 clicked() - uniform_param_w - show() + lxyz_widget + hide() - 135 - 450 + 348 + 54 - 224 - 724 + 240 + 485 - random_rb + rb2 clicked() - uniform_param_w + cartesian_widget hide() - 313 - 450 + 348 + 54 - 224 - 724 + 240 + 347 diff --git a/src/HEXABLOCKGUI/MakeHemiSphere_QTD.ui b/src/HEXABLOCKGUI/MakeHemiSphere_QTD.ui index aa12507..0a56206 100644 --- a/src/HEXABLOCKGUI/MakeHemiSphere_QTD.ui +++ b/src/HEXABLOCKGUI/MakeHemiSphere_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 291 - 704 + 404 + 891 @@ -19,137 +19,172 @@ 0 - 0 + 324 - HemiSphere Construction + Hemisphere Construction - - - Qt::ScrollBarAsNeeded + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + 0 + 0 + + + + Sphere + + + true + + + + + + + + 0 + 0 + + + + Rind + + + + + + + + 0 + 0 + + + + Concentric + + + + + + + + true - + 0 0 - 269 - 682 + 366 + 1076 - + - Arguments + - + - - - - 0 - 0 - - - - Sphere - - - - + + + + - center + Simple + + + true - - - - - 0 - 0 - - - - - - - false + + + + Uniform - - + + - external radius + Custom - - - - - 0 - 0 - - - - 6 - - - 1000000000.000000000000000 + + + + + + + + + + Simple - - 2.000000000000000 + + true - - - - false - + + - internal radius + Uniform - - - - false - - - - 0 - 0 - - - - 6 + + + + Custom - - 1000000000.000000000000000 + + + + + + + + + + + + Simple - - 1.000000000000000 + + true - - + + - rind + Uniform - - false + + + + + + Custom @@ -157,25 +192,39 @@ - - - - 0 - 0 - - - - Hole - + - + - axis(z) + center + + + + 0 + 0 + + + + + + + false + + + + + + + axis + + + + @@ -191,10 +240,29 @@ + + + + base + + + + + + + + + + + + + + QFormLayout::AllNonFixedFieldsGrow + - radius + hole radius @@ -221,108 +289,80 @@ - - - - 0 - 0 - - - - Cross section - - + + - + - point + external radius - + 0 0 - - + + 6 - - + + 1000000000.000000000000000 - - false + + 2.000000000000000 - + + + true + - vector + internal radius - - - - - - - - - - 0 - 0 - - - - Radial section - - - - - - start vector + + + true - - - - - + 0 0 - - + + 6 - - + + 1000000000.000000000000000 - - false + + 1.000000000000000 - + - false + true - angle + slice angle - + - false + true @@ -341,87 +381,414 @@ - - + + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + - partial - - - false + vplan + + + - - - - 0 - 0 - - - - Grid - - + + - + - n (radial) + Criteria - - - - 0 - 0 - - - - 1 - + 1000000 - 1 + 0 - - + + + + + + + + - n (angular) + Nb layers - - - - - 0 - 0 - - - - 1 - + + 1000000 - 3 + 1 - - + + - n (height) + Criteria + + + + + + + 1000000 + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 150 + + + + 0 + + + + radius + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 150 + + + + 0 + + + + radius + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + angle + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + height + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + + + + + + + nb Radial + + + + + + + + 0 + 0 + + + + 1 + + + 1000000 + + + 1 + + + + + + + nb Angular + + + + + + + + 0 + 0 + + + + 1 + + + 1000000 + + + 3 + + + + + + + nb Height @@ -447,6 +814,19 @@ + + + + Qt::Vertical + + + + 20 + 40 + + + + @@ -457,87 +837,1185 @@ + sphere_rb + rind_rb + spherical_rb scrollArea - sphere_center_le - sphere_radext_spb - sphere_radint_spb - sphere_rind_cb + sphereTop_rb + sphereUni_rb + sphere2_rb + sphericalTop_rb + sphericalUni_rb + spherical2_rb + rindTop_rb + rindUni_rb + rind2_rb + center_le hole_axis_le + base_le hole_rad_spb - cross_pt_le - cross_vec_le - radial_vec_le + sphere_radext_spb + sphere_radint_spb radial_angle_spb - radial_partial_cb + vplan_le + crit_spb + nbre_spb + crit_spb_2 + random_param_w_3 + add_radius_pb_1 + del_radius_pb_1 + radius_lw_1 + random_param_w + add_angle_pb + add_radius_pb_2 + del_radius_pb_2 + radius_lw_2 ngrid_rad_spb ngrid_ang_spb ngrid_height_spb + height_lw + del_height_pb + angle_lw + del_angle_pb + add_height_pb - radial_partial_cb - toggled(bool) - radial_angle_spb - setEnabled(bool) + sphere_rb + clicked() + widget_20 + hide() - 217 - 416 + 72 + 28 - 140 - 417 + 192 + 588 - sphere_rind_cb - toggled(bool) - sphere_radint_spb - setEnabled(bool) + sphere_rb + clicked() + widget_5 + hide() - 226 - 195 + 72 + 28 - 161 - 196 + 192 + 639 - sphere_rind_cb - toggled(bool) - int_rad_label - setEnabled(bool) + sphere_rb + clicked() + random_param_w_3 + hide() - 226 - 195 + 72 + 28 - 78 - 196 + 192 + 735 - radial_partial_cb - toggled(bool) - angle_label - setEnabled(bool) + sphere_rb + clicked() + widget_3 + hide() - 217 - 416 + 72 + 28 - 65 + 192 417 + + sphere_rb + clicked() + widget_8 + hide() + + + 72 + 28 + + + 192 + 145 + + + + + sphere_rb + clicked() + widget_9 + hide() + + + 72 + 28 + + + 192 + 191 + + + + + sphere_rb + clicked() + sphereTop_rb + click() + + + 72 + 28 + + + 85 + 99 + + + + + sphereTop_rb + clicked() + widget_6 + show() + + + 85 + 99 + + + 192 + 1007 + + + + + sphereTop_rb + clicked() + widget_2 + hide() + + + 85 + 99 + + + 192 + 273 + + + + + sphereTop_rb + clicked() + widget_10 + hide() + + + 85 + 99 + + + 192 + 360 + + + + + sphereTop_rb + clicked() + random_param_w + hide() + + + 85 + 99 + + + 192 + 877 + + + + + sphereTop_rb + clicked() + widget_4 + hide() + + + 85 + 99 + + + 192 + 504 + + + + + sphereUni_rb + clicked() + widget_2 + show() + + + 192 + 99 + + + 192 + 273 + + + + + sphereUni_rb + clicked() + widget_4 + show() + + + 192 + 99 + + + 192 + 504 + + + + + sphereUni_rb + clicked() + widget_10 + show() + + + 192 + 99 + + + 192 + 360 + + + + + sphereUni_rb + clicked() + widget_6 + show() + + + 192 + 99 + + + 192 + 1007 + + + + + sphereUni_rb + clicked() + random_param_w + hide() + + + 192 + 99 + + + 192 + 877 + + + + + sphere2_rb + clicked() + widget_2 + show() + + + 299 + 99 + + + 192 + 273 + + + + + sphere2_rb + clicked() + random_param_w + show() + + + 299 + 99 + + + 192 + 877 + + + + + sphere2_rb + clicked() + widget_10 + hide() + + + 299 + 99 + + + 192 + 360 + + + + + sphere2_rb + clicked() + widget_6 + hide() + + + 299 + 99 + + + 192 + 1007 + + + + + sphere2_rb + clicked() + widget_4 + hide() + + + 299 + 99 + + + 192 + 504 + + + + + spherical_rb + clicked() + widget_7 + hide() + + + 188 + 28 + + + 192 + 99 + + + + + spherical_rb + clicked() + widget_9 + hide() + + + 188 + 28 + + + 192 + 191 + + + + + spherical_rb + clicked() + widget_4 + hide() + + + 188 + 28 + + + 192 + 504 + + + + + spherical_rb + clicked() + random_param_w + hide() + + + 188 + 28 + + + 192 + 877 + + + + + spherical_rb + clicked() + widget_6 + hide() + + + 188 + 28 + + + 192 + 1007 + + + + + spherical_rb + clicked() + widget_10 + hide() + + + 188 + 28 + + + 192 + 360 + + + + + spherical_rb + clicked() + sphericalTop_rb + click() + + + 188 + 28 + + + 88 + 145 + + + + + sphericalTop_rb + clicked() + widget_5 + show() + + + 88 + 145 + + + 192 + 655 + + + + + sphericalTop_rb + clicked() + widget_2 + hide() + + + 88 + 145 + + + 192 + 273 + + + + + sphericalTop_rb + clicked() + widget_3 + hide() + + + 88 + 145 + + + 192 + 417 + + + + + sphericalTop_rb + clicked() + random_param_w_3 + hide() + + + 88 + 145 + + + 192 + 768 + + + + + sphericalTop_rb + clicked() + widget_20 + hide() + + + 88 + 145 + + + 192 + 588 + + + + + sphericalUni_rb + clicked() + widget_2 + show() + + + 202 + 145 + + + 192 + 273 + + + + + sphericalUni_rb + clicked() + widget_3 + show() + + + 202 + 145 + + + 192 + 417 + + + + + sphericalUni_rb + clicked() + widget_5 + show() + + + 202 + 145 + + + 192 + 655 + + + + + sphericalUni_rb + clicked() + random_param_w_3 + hide() + + + 202 + 145 + + + 192 + 768 + + + + + sphericalUni_rb + clicked() + widget_20 + hide() + + + 202 + 145 + + + 192 + 588 + + + + + spherical_rb + clicked() + widget_8 + show() + + + 188 + 28 + + + 192 + 145 + + + + + sphere_rb + clicked() + widget_7 + show() + + + 72 + 28 + + + 192 + 99 + + + + + spherical2_rb + clicked() + widget_2 + show() + + + 306 + 145 + + + 192 + 273 + + + + + spherical2_rb + clicked() + random_param_w_3 + show() + + + 306 + 145 + + + 192 + 768 + + + + + spherical2_rb + clicked() + widget_20 + show() + + + 306 + 145 + + + 192 + 588 + + + + + spherical2_rb + clicked() + widget_3 + hide() + + + 306 + 145 + + + 192 + 417 + + + + + spherical2_rb + clicked() + widget_5 + hide() + + + 306 + 145 + + + 192 + 655 + + + + + rind_rb + clicked() + widget_9 + show() + + + 303 + 28 + + + 192 + 191 + + + + + rind_rb + clicked() + widget_7 + hide() + + + 303 + 28 + + + 192 + 99 + + + + + rind_rb + clicked() + widget_8 + hide() + + + 303 + 28 + + + 192 + 145 + + + + + rind_rb + clicked() + widget_20 + hide() + + + 303 + 28 + + + 192 + 588 + + + + + rind_rb + clicked() + widget_5 + hide() + + + 303 + 28 + + + 192 + 655 + + + + + rind_rb + clicked() + random_param_w_3 + hide() + + + 303 + 28 + + + 192 + 768 + + + + + rind_rb + clicked() + rindTop_rb + click() + + + 303 + 28 + + + 85 + 191 + + + + + rindTop_rb + clicked() + widget_6 + show() + + + 85 + 191 + + + 192 + 1040 + + + + + rindTop_rb + clicked() + widget_2 + hide() + + + 85 + 191 + + + 192 + 273 + + + + + rindTop_rb + clicked() + widget_10 + hide() + + + 85 + 191 + + + 192 + 360 + + + + + rindTop_rb + clicked() + widget_3 + hide() + + + 85 + 191 + + + 192 + 417 + + + + + rindTop_rb + clicked() + widget_4 + hide() + + + 85 + 191 + + + 192 + 504 + + + + + rindTop_rb + clicked() + random_param_w + hide() + + + 85 + 191 + + + 192 + 910 + + + + + rindUni_rb + clicked() + widget_2 + show() + + + 192 + 191 + + + 192 + 273 + + + + + rindUni_rb + clicked() + widget_10 + show() + + + 192 + 191 + + + 192 + 360 + + + + + rindUni_rb + clicked() + widget_3 + show() + + + 192 + 191 + + + 192 + 417 + + + + + rindUni_rb + clicked() + widget_4 + show() + + + 192 + 191 + + + 192 + 504 + + + + + rindUni_rb + clicked() + widget_6 + show() + + + 192 + 191 + + + 192 + 1040 + + + + + rindUni_rb + clicked() + random_param_w + hide() + + + 192 + 191 + + + 192 + 910 + + + + + rind2_rb + clicked() + widget_2 + show() + + + 299 + 191 + + + 192 + 273 + + + + + rind2_rb + clicked() + random_param_w + show() + + + 299 + 191 + + + 192 + 910 + + + + + rind2_rb + clicked() + widget_10 + hide() + + + 299 + 191 + + + 192 + 360 + + + + + rind2_rb + clicked() + widget_3 + hide() + + + 299 + 191 + + + 192 + 417 + + + + + rind2_rb + clicked() + widget_4 + hide() + + + 299 + 191 + + + 192 + 504 + + + + + rind2_rb + clicked() + widget_6 + hide() + + + 299 + 191 + + + 192 + 1040 + + + diff --git a/src/HEXABLOCKGUI/MakePipe_QTD.ui b/src/HEXABLOCKGUI/MakePipe_QTD.ui index 92c30d7..6cff7c1 100644 --- a/src/HEXABLOCKGUI/MakePipe_QTD.ui +++ b/src/HEXABLOCKGUI/MakePipe_QTD.ui @@ -6,12 +6,12 @@ 0 0 - 195 - 196 + 357 + 376 - + 0 0 @@ -19,161 +19,752 @@ 5 - 0 + 273 Pipe Construction - + - + + + 0 + 0 + + + - 5 - 0 + 16777215 + 50 - Arguments + - - - - - Pipe - - - - - + + + 0 0 - - - 16777215 - 16777215 - - - - false - - - - - - Vector - - - - - - - - 16777215 - 16777215 - + Simple - - false + + true - - - - n (radial) - - - - - + + - + 0 0 - - 1 - - - 1000000 - - - 1 - - - - - - n (angular) + Uniform - - + + - + 0 0 - - 1 - - - 1000000 - - - 3 - - - - - - n (heigth) - - - - - - - - 0 - 0 - - - - 1 - - - 1000000 + Custom - - 1 + + false + + + + true + + + + + 0 + 0 + 319 + 580 + + + + + + + + 0 + 0 + + + + + 5 + 0 + + + + + + + + + + + + + origin + + + + + + + + + + axis + + + + + + + base + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + false + + + + + + + + + + + + + + + + radius + + + + + + + 6 + + + 1000000000.000000000000000 + + + 2.000000000000000 + + + + + + + hole radius + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + slice angle + + + + + + + 6 + + + 360.000000000000000 + + + 10.000000000000000 + + + 360.000000000000000 + + + + + + + height + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + + + + + QFormLayout::AllNonFixedFieldsGrow + + + + + 1 + + + 1000000 + + + 1 + + + + + + + nb Angular + + + + + + + 1 + + + 1000000 + + + 3 + + + + + + + nb Height + + + + + + + 1 + + + 1000000 + + + 1 + + + + + + + nb Radial + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 150 + + + + 0 + + + + radius + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + angle + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + height + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + + + - pipe_le - vec_le + scrollArea + rb0 + rb1 + rb2 + origin_le + axis_le + base_le + ext_radius_spb + int_radius_spb + angle_spb + height_spb nr_spb na_spb - nl_spb + nh_spb + random_param_w + add_radius_pb + del_radius_pb + radius_lw + add_angle_pb + angle_lw + del_angle_pb + add_height_pb + height_lw + del_height_pb - + + + rb0 + clicked() + n_group + show() + + + 66 + 40 + + + 152 + 412 + + + + + rb0 + clicked() + rah_group + hide() + + + 66 + 40 + + + 152 + 278 + + + + + rb0 + clicked() + geomobj_group + hide() + + + 66 + 40 + + + 152 + 145 + + + + + rb0 + clicked() + random_param_w + hide() + + + 66 + 40 + + + 152 + 548 + + + + + rb1 + clicked() + rah_group + show() + + + 152 + 40 + + + 152 + 278 + + + + + rb1 + clicked() + n_group + show() + + + 152 + 40 + + + 152 + 412 + + + + + rb1 + clicked() + geomobj_group + show() + + + 152 + 40 + + + 152 + 145 + + + + + rb1 + clicked() + random_param_w + hide() + + + 152 + 40 + + + 152 + 548 + + + + + rb2 + clicked() + geomobj_group + show() + + + 239 + 40 + + + 152 + 145 + + + + + rb2 + clicked() + random_param_w + show() + + + 239 + 40 + + + 152 + 548 + + + + + rb2 + clicked() + rah_group + hide() + + + 239 + 40 + + + 152 + 278 + + + + + rb2 + clicked() + n_group + hide() + + + 239 + 40 + + + 152 + 412 + + + + diff --git a/src/HEXABLOCKGUI/MakePipes_QTD.ui b/src/HEXABLOCKGUI/MakePipes_QTD.ui index 90fb7a8..75f4aa3 100644 --- a/src/HEXABLOCKGUI/MakePipes_QTD.ui +++ b/src/HEXABLOCKGUI/MakePipes_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 190 - 106 + 305 + 464 @@ -19,62 +19,235 @@ Pipes Construction - + - Arguments + - - - - - Pipe1 + + + + + Pipe 1 + + + + + origin + + + + + + + + 0 + 0 + + + + + + + + axis + + + + + + + + 0 + 0 + + + + + + + + radius + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + hole radius + + + + + + + 6 + + + 1000000000.000000000000000 + + + 0.500000000000000 + + + + + + + height + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - false - - - - - - - Pipe2 - - - - - - - - 16777215 - 16777215 - - - - false + + + + Pipe 2 + + + + + origin + + + + + + + + 0 + 0 + + + + + + + + axis + + + + + + + + 0 + 0 + + + + + + + + radius + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + hole radius + + + + + + + 6 + + + 1000000000.000000000000000 + + + 0.500000000000000 + + + + + + + height + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + diff --git a/src/HEXABLOCKGUI/MakeRind_QTD.ui b/src/HEXABLOCKGUI/MakeRind_QTD.ui index 19797aa..4a30792 100644 --- a/src/HEXABLOCKGUI/MakeRind_QTD.ui +++ b/src/HEXABLOCKGUI/MakeRind_QTD.ui @@ -7,7 +7,7 @@ 0 0 272 - 464 + 508 @@ -29,7 +29,7 @@ - Result Name + @@ -67,7 +67,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/MakeSpherical_QTD.ui b/src/HEXABLOCKGUI/MakeSpherical_QTD.ui index 3b4a2d3..476b5ac 100644 --- a/src/HEXABLOCKGUI/MakeSpherical_QTD.ui +++ b/src/HEXABLOCKGUI/MakeSpherical_QTD.ui @@ -6,7 +6,7 @@ 0 0 - 241 + 254 184 @@ -29,7 +29,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/MakeTranslation_QTD.ui b/src/HEXABLOCKGUI/MakeTranslation_QTD.ui index 9603b40..dd9554b 100644 --- a/src/HEXABLOCKGUI/MakeTranslation_QTD.ui +++ b/src/HEXABLOCKGUI/MakeTranslation_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 270 - 195 + 285 + 201 @@ -29,7 +29,7 @@ - Translate + diff --git a/src/HEXABLOCKGUI/Makefile.am b/src/HEXABLOCKGUI/Makefile.am index 0b938db..6b0d2ce 100755 --- a/src/HEXABLOCKGUI/Makefile.am +++ b/src/HEXABLOCKGUI/Makefile.am @@ -44,6 +44,8 @@ dist_libHEXABLOCK_la_SOURCES = \ HEXABLOCKGUI_VtkDocumentGraphicView.cxx \ HEXABLOCKGUI_OccGraphicView.hxx \ HEXABLOCKGUI_OccGraphicView.cxx \ + HEXABLOCKGUI_OCCSelector.h \ + HEXABLOCKGUI_OCCSelector.cxx \ HEXABLOCKGUI_GraphicViewsHandler.hxx \ HEXABLOCKGUI_GraphicViewsHandler.cxx \ HEXABLOCKGUI_DocumentModel.hxx \ @@ -64,8 +66,6 @@ dist_libHEXABLOCK_la_SOURCES = \ kmodelindexproxymapper.cxx \ klinkitemselectionmodel.hxx \ klinkitemselectionmodel.cxx \ - MyGEOMBase_Helper.hxx \ - MyGEOMBase_Helper.cxx \ MyGEOMBase_Skeleton.hxx \ MyGEOMBase_Skeleton.cxx \ MyBasicGUI_PointDlg.hxx \ @@ -135,7 +135,6 @@ libHEXABLOCK_la_CXXFLAGS = \ $(GUI_CXXFLAGS) \ $(GEOM_CXXFLAGS) \ -I$(srcdir)/../HEXABLOCK \ - -I$(srcdir)/../HEXABLOCK_I \ -I$(top_builddir) \ -I../../idl \ $(qt4_cppflags) \ @@ -147,9 +146,7 @@ libHEXABLOCK_la_CXXFLAGS = \ libHEXABLOCK_la_LDFLAGS = \ ./MyDlgRef/libMyDlgRef.la \ - ../../idl/libSalomeIDLHEXABLOCK.la \ - ../HEXABLOCK_I/libHEXABLOCKEngine.la \ - ../HEXABLOCK/libHEXABLOCKimpl.la \ + ../HEXABLOCK/libHEXABLOCKEngine.la \ -L$(GUI_ROOT_DIR)/lib/salome -lEvent -L$(KERNEL_ROOT_DIR)/lib/salome \ $(qt4_ldflags) $(qsci4_ldflags) \ $(KERNEL_LDFLAGS) -lSalomeLifeCycleCORBA \ @@ -199,6 +196,8 @@ ICONS = \ resources/assoc_vertex.png \ resources/assoc_edge.png \ resources/assoc_quad.png \ + resources/add_geom.png \ + resources/model_info.png \ resources/add_group.png \ resources/remove_group.png \ resources/add_law.png \ diff --git a/src/HEXABLOCKGUI/MergeEdges_QTD.ui b/src/HEXABLOCKGUI/MergeEdges_QTD.ui index b505f66..d80ae66 100644 --- a/src/HEXABLOCKGUI/MergeEdges_QTD.ui +++ b/src/HEXABLOCKGUI/MergeEdges_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 215 - 184 + 232 + 198 @@ -23,7 +23,7 @@ - MergeEdges + diff --git a/src/HEXABLOCKGUI/MergeVertices_QTD.ui b/src/HEXABLOCKGUI/MergeVertices_QTD.ui index 1d80fdd..0de3ce5 100644 --- a/src/HEXABLOCKGUI/MergeVertices_QTD.ui +++ b/src/HEXABLOCKGUI/MergeVertices_QTD.ui @@ -7,7 +7,7 @@ 0 0 242 - 108 + 116 @@ -23,7 +23,7 @@ - MergeVertices + diff --git a/src/HEXABLOCKGUI/Merge_QTD.ui b/src/HEXABLOCKGUI/Merge_QTD.ui index e8adf7e..6a6275f 100644 --- a/src/HEXABLOCKGUI/Merge_QTD.ui +++ b/src/HEXABLOCKGUI/Merge_QTD.ui @@ -38,9 +38,9 @@ 0 - -8 - 217 - 728 + 0 + 216 + 784 @@ -53,7 +53,7 @@ - Merge + @@ -98,7 +98,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx b/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx index bf052c0..48666d1 100644 --- a/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx +++ b/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.cxx @@ -24,9 +24,6 @@ #include #include -#include -#include - #include "MyDlgRef.hxx" #include @@ -77,10 +74,9 @@ using namespace HEXABLOCK::GUI; -Q_DECLARE_METATYPE(QModelIndex); Q_DECLARE_METATYPE(HEXABLOCK::GUI::HexaTreeRole); - -enum { SelectEdge, SelectWire }; +Q_DECLARE_METATYPE(TopAbs_ShapeEnum); +Q_DECLARE_METATYPE(TopoDS_Shape); //================================================================================= // class : MyBasicGUI_PointDlg() @@ -89,155 +85,142 @@ enum { SelectEdge, SelectWire }; // The dialog will by default be modeless, unless you set 'modal' to // TRUE to construct a modal dialog. //================================================================================= -MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* parent, - bool modal, Qt::WindowFlags fl) - : MyGEOMBase_Skeleton(theGeometryGUI, parent, modal, fl), - myBusy (false), - _documentModel(0), - _patternDataSelectionModel(0), - _currentObj(0), - _selectionMutex(false) +MyBasicGUI_PointDlg::MyBasicGUI_PointDlg(QWidget* parent, Qt::WindowFlags fl) +: MyGEOMBase_Skeleton(parent, fl), + myBusy (false) { - QWidget* w = centralWidget(); - QString objectName = w->objectName(); - QString className = w->metaObject()->className(); -; - SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); - QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT"))); - QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_EDGE"))); - QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); - QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_REF"))); - QPixmap image4 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_LINES"))); - QPixmap image5 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_FACE"))); - QPixmap image6 (aResMgr->loadPixmap("GEOM", tr("ICO_LINE"))); - QPixmap image7 (aResMgr->loadPixmap("GEOM", tr("ICO_WIRE"))); - -// setWindowTitle(tr("GEOM_POINT_TITLE")); - setWindowTitle( tr("Vertex Association") ); - setMinimumWidth(260); - - - - - mainFrame()->GroupConstructors->setTitle(tr("GEOM_POINTS")); - mainFrame()->RadioButton1->setIcon(image0); - mainFrame()->RadioButton2->setIcon(image3); - mainFrame()->RadioButton3->setIcon(image1); - mainFrame()->RadioButton4->show(); - mainFrame()->RadioButton4->setIcon(image4); - mainFrame()->RadioButton5->show(); - mainFrame()->RadioButton5->setIcon(image5); - - myParamGroup = new QGroupBox(centralWidget()); - myParamCoord = new QButtonGroup(myParamGroup); - QHBoxLayout* boxLayout = new QHBoxLayout(myParamGroup); - boxLayout->setMargin(MARGIN); boxLayout->setSpacing(SPACING); - QRadioButton* btn = new QRadioButton(tr("GEOM_PARAM_VALUE"), myParamGroup); - myParamCoord->addButton(btn, PARAM_VALUE); - boxLayout->addWidget(btn); - btn = new QRadioButton(tr("GEOM_LENGTH_VALUE"), myParamGroup); - myParamCoord->addButton(btn, LENGTH_VALUE); - boxLayout->addWidget(btn); - btn = new QRadioButton(tr("GEOM_COORD_VALUE"), myParamGroup); - myParamCoord->addButton(btn, COORD_VALUE); - boxLayout->addWidget(btn); - myParamCoord->setExclusive(true); - myParamCoord->button(PARAM_VALUE)->setChecked(true); - - GroupXYZ = new DlgRef_3Spin(centralWidget()); - GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES")); - GroupXYZ->TextLabel1->setText(tr("GEOM_X")); - GroupXYZ->TextLabel2->setText(tr("GEOM_Y")); - GroupXYZ->TextLabel3->setText(tr("GEOM_Z")); - - GroupOnCurve = new DlgRef_2Sel1Spin(centralWidget()); - GroupOnCurve->GroupBox1->setTitle(tr("GEOM_POINT_ON_EDGE")); - GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE")); - GroupOnCurve->TextLabel2->setText(tr("GEOM_START_POINT")); - GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER")); - GroupOnCurve->PushButton1->setIcon(image2); - GroupOnCurve->PushButton2->setIcon(image2); - - GroupOnSurface = new DlgRef_1Sel2Spin(centralWidget()); - GroupOnSurface->GroupBox1->setTitle(tr("GEOM_POINT_ON_FACE")); - GroupOnSurface->TextLabel1->setText(tr("GEOM_FACE")); - GroupOnSurface->TextLabel2->setText(tr("GEOM_UPARAMETER")); - GroupOnSurface->TextLabel3->setText(tr("GEOM_VPARAMETER")); - GroupOnSurface->PushButton1->setIcon(image2); - - GroupRefPoint = new DlgRef_1Sel3Spin(centralWidget()); - GroupRefPoint->GroupBox1->setTitle(tr("GEOM_REF_POINT")); - GroupRefPoint->TextLabel1->setText(tr("GEOM_POINT")); - GroupRefPoint->PushButton1->setIcon(image2); - GroupRefPoint->TextLabel2->setText(tr("GEOM_DX")); - GroupRefPoint->TextLabel3->setText(tr("GEOM_DY")); - GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ")); - - /* popup menu for line intersect buttons */ - myBtnPopup = new QMenu(this); - QIcon ico_line = QIcon(image6); - QIcon ico_wire = QIcon(image7); - myActions[myBtnPopup->addAction(ico_line, tr("GEOM_EDGE"))] = SelectEdge; - myActions[myBtnPopup->addAction(ico_wire, tr("GEOM_WIRE"))] = SelectWire; - - GroupLineIntersection = new DlgRef_2Sel(centralWidget()); - GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION")); - GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1")); - GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2")); - GroupLineIntersection->PushButton1->setIcon(image2); - GroupLineIntersection->PushButton1->setMenu(myBtnPopup); - GroupLineIntersection->PushButton2->setIcon(image2); - GroupLineIntersection->PushButton2->setMenu(myBtnPopup); - GroupLineIntersection->LineEdit2->setEnabled(false); - - myCoordGrp = new QGroupBox(tr("GEOM_COORDINATES_RES"), centralWidget()); - QGridLayout* myCoordGrpLayout = new QGridLayout(myCoordGrp); - myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_X"), myCoordGrp), 0, 0); - myX = new QLineEdit(myCoordGrp); - myCoordGrpLayout->addWidget(myX, 0, 1); - myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_Y"), myCoordGrp), 1, 0); - myY = new QLineEdit(myCoordGrp); - myCoordGrpLayout->addWidget(myY, 1, 1); - myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_Z"), myCoordGrp), 2, 0); - myZ = new QLineEdit(myCoordGrp); - myCoordGrpLayout->addWidget(myZ, 2, 1); - - QVBoxLayout* layout = new QVBoxLayout(centralWidget()); - layout->setMargin(0); layout->setSpacing(6); - layout->addWidget(myParamGroup); - layout->addWidget(GroupXYZ); - layout->addWidget(GroupOnCurve); - layout->addWidget(GroupOnSurface); - layout->addWidget(GroupRefPoint); - layout->addWidget(GroupLineIntersection); - layout->addWidget(myCoordGrp); - - - myX->setReadOnly(true); - myY->setReadOnly(true); - myZ->setReadOnly(true); - - myX->setEnabled(false); - myY->setEnabled(false); - myZ->setEnabled(false); - - QPalette aPal = myX->palette(); - aPal.setColor(QPalette::Disabled, QPalette::Text, QColor(0, 0, 0)); - myX->setPalette(aPal); - myY->setPalette(aPal); - myZ->setPalette(aPal); - - setHelpFileName("gui_asso_quad_to_geom.html#associate-to-a-vertex-of-the-geometry");/*"create_point_page.html"*/ - - Init(); - - /* HEXABLOCK */ - _initInputWidget(); -// _initViewManager(); - /* HEXABLOCK */ + SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr(); + QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT"))); + QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_EDGE"))); + QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT"))); + QPixmap image3 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_REF"))); + QPixmap image4 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_LINES"))); + QPixmap image5 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_POINT_FACE"))); + QPixmap image6 (aResMgr->loadPixmap("GEOM", tr("ICO_LINE"))); + QPixmap image7 (aResMgr->loadPixmap("GEOM", tr("ICO_WIRE"))); + + setWindowTitle( tr("Vertex Association") ); + setMinimumWidth(260); + setMinimumHeight(400); + + mainFrame()->GroupConstructors->setTitle(tr("GEOM_POINTS")); + mainFrame()->RadioButton1->setIcon(image0); + mainFrame()->RadioButton2->setIcon(image3); + mainFrame()->RadioButton3->setIcon(image1); + mainFrame()->RadioButton4->show(); + mainFrame()->RadioButton4->setIcon(image4); + mainFrame()->RadioButton5->show(); + mainFrame()->RadioButton5->setIcon(image5); + + myParamGroup = new QGroupBox(centralWidget()); + myParamCoord = new QButtonGroup(myParamGroup); + QHBoxLayout* boxLayout = new QHBoxLayout(myParamGroup); + boxLayout->setMargin(MARGIN); boxLayout->setSpacing(SPACING); + QRadioButton* btn = new QRadioButton(tr("By Param"), myParamGroup); + myParamCoord->addButton(btn, PARAM_VALUE); + boxLayout->addWidget(btn); + btn = new QRadioButton(tr("By Length"), myParamGroup); + myParamCoord->addButton(btn, LENGTH_VALUE); + boxLayout->addWidget(btn); + btn = new QRadioButton(tr("By Coords"), myParamGroup); + myParamCoord->addButton(btn, COORD_VALUE); + boxLayout->addWidget(btn); + myParamCoord->setExclusive(true); + myParamCoord->button(PARAM_VALUE)->setChecked(true); + + GroupXYZ = new DlgRef_3Spin(centralWidget()); + GroupXYZ->GroupBox1->setTitle(tr("GEOM_COORDINATES")); + GroupXYZ->TextLabel1->setText(tr("GEOM_X")); + GroupXYZ->TextLabel2->setText(tr("GEOM_Y")); + GroupXYZ->TextLabel3->setText(tr("GEOM_Z")); + coordsInputValue[GEOM_POINT_XYZ] = new QVector3D(0, 0, 0); + coordsInputValue[GEOM_POINT_EDGE] = new QVector3D(0, 0, 0); + coordsInputValue[GEOM_POINT_SURF] = new QVector3D(0, 0, 0); + + GroupOnCurve = new DlgRef_2Sel1Spin(centralWidget()); + GroupOnCurve->GroupBox1->setTitle(tr("GEOM_POINT_ON_EDGE")); + GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE")); + GroupOnCurve->TextLabel2->setText(tr("GEOM_START_POINT")); + GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER")); + paramInputValue[PARAM_VALUE] = 0.5; + paramInputValue[LENGTH_VALUE] = 0.5; + + GroupOnSurface = new DlgRef_1Sel2Spin(centralWidget()); + GroupOnSurface->GroupBox1->setTitle(tr("GEOM_POINT_ON_FACE")); + GroupOnSurface->TextLabel1->setText(tr("GEOM_FACE")); + GroupOnSurface->TextLabel2->setText(tr("GEOM_UPARAMETER")); + GroupOnSurface->TextLabel3->setText(tr("GEOM_VPARAMETER")); + + GroupRefPoint = new DlgRef_1Sel3Spin(centralWidget()); + GroupRefPoint->GroupBox1->setTitle(tr("GEOM_REF_POINT")); + GroupRefPoint->TextLabel1->setText(tr("GEOM_POINT")); + GroupRefPoint->TextLabel2->setText(tr("GEOM_DX")); + GroupRefPoint->TextLabel3->setText(tr("GEOM_DY")); + GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ")); + + /* popup menu for line intersect buttons */ + QIcon ico_line = QIcon(image6); + QIcon ico_wire = QIcon(image7); + // * menu for line1 + myBtnPopup = new QMenu(this); + action_line1_edge = myBtnPopup->addAction(ico_line, tr("GEOM_EDGE")); + action_line1_wire = myBtnPopup->addAction(ico_wire, tr("GEOM_WIRE")); + + // * menu for line 2 + myBtnPopup2 = new QMenu(this); + action_line2_edge = myBtnPopup2->addAction(ico_line, tr("GEOM_EDGE")); + action_line2_wire = myBtnPopup2->addAction(ico_wire, tr("GEOM_WIRE")); + + GroupLineIntersection = new DlgRef_2Sel(centralWidget()); + GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION")); + GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1")); + GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2")); + GroupLineIntersection->PushButton1->setIcon(image2); + GroupLineIntersection->PushButton1->setMenu(myBtnPopup); + GroupLineIntersection->PushButton2->setIcon(image2); + GroupLineIntersection->PushButton2->setMenu(myBtnPopup2); + + myCoordGrp = new QGroupBox(tr("GEOM_COORDINATES_RES"), centralWidget()); + QGridLayout* myCoordGrpLayout = new QGridLayout(myCoordGrp); + myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_X"), myCoordGrp), 0, 0); + myX = new QLineEdit(myCoordGrp); + myCoordGrpLayout->addWidget(myX, 0, 1); + myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_Y"), myCoordGrp), 1, 0); + myY = new QLineEdit(myCoordGrp); + myCoordGrpLayout->addWidget(myY, 1, 1); + myCoordGrpLayout->addWidget(new QLabel(tr("GEOM_Z"), myCoordGrp), 2, 0); + myZ = new QLineEdit(myCoordGrp); + myCoordGrpLayout->addWidget(myZ, 2, 1); + + QVBoxLayout* layout = new QVBoxLayout(centralWidget()); + layout->setMargin(0); layout->setSpacing(6); + layout->addWidget(myParamGroup); + layout->addWidget(GroupXYZ); + layout->addWidget(GroupOnCurve); + layout->addWidget(GroupOnSurface); + layout->addWidget(GroupRefPoint); + layout->addWidget(GroupLineIntersection); + layout->addWidget(myCoordGrp); + + myX->setReadOnly(true); + myY->setReadOnly(true); + myZ->setReadOnly(true); + + myX->setEnabled(false); + myY->setEnabled(false); + myZ->setEnabled(false); + + QPalette aPal = myX->palette(); + aPal.setColor(QPalette::Disabled, QPalette::Text, QColor(0, 0, 0)); + myX->setPalette(aPal); + myY->setPalette(aPal); + myZ->setPalette(aPal); + + _helpFileName = "gui_asso_quad_to_geom.html#associate-to-a-vertex-of-the-geometry"; + _initWidget( _editMode ); + mainFrame()->RadioButton1->click(); } - //================================================================================= // function : ~MyBasicGUI_PointDlg() // purpose : Destructor @@ -246,169 +229,170 @@ MyBasicGUI_PointDlg::~MyBasicGUI_PointDlg() { } -//================================================================================= -// function : Init() -// purpose : -//================================================================================= -void MyBasicGUI_PointDlg::Init() +void MyBasicGUI_PointDlg::_initInputWidget( HexaBaseDialog::Mode editmode ) { - GroupOnCurve->LineEdit1->setReadOnly(true); - GroupOnCurve->LineEdit2->setReadOnly(true); - GroupOnSurface->LineEdit1->setReadOnly(true); - GroupRefPoint->LineEdit1->setReadOnly(true); - GroupLineIntersection->LineEdit1->setReadOnly(true); - GroupLineIntersection->LineEdit2->setReadOnly(true); - GroupLineIntersection->LineEdit1->setEnabled(true); - GroupLineIntersection->LineEdit2->setEnabled(false); - - myEdge.nullify(); - myFace.nullify(); - myRefPoint.nullify(); - myLine1.nullify(); - myLine2.nullify(); - myNeedType = TopAbs_VERTEX; - - myEditCurrentArgument = 0; - - /* Get setting of step value from file configuration */ - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100); - - /* min, max, step and decimals for spin boxes */ - initSpinBox(GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision"); - initSpinBox(GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX, step, "length_precision"); - initSpinBox(GroupXYZ->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision"); - GroupXYZ->SpinBox_DX->setValue(0.0); - GroupXYZ->SpinBox_DY->setValue(0.0); - GroupXYZ->SpinBox_DZ->setValue(0.0); - - initSpinBox(GroupRefPoint->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision"); - initSpinBox(GroupRefPoint->SpinBox_DY, COORD_MIN, COORD_MAX, step, "length_precision"); - initSpinBox(GroupRefPoint->SpinBox_DZ, COORD_MIN, COORD_MAX, step, "length_precision"); - GroupRefPoint->SpinBox_DX->setValue(0.0); - GroupRefPoint->SpinBox_DY->setValue(0.0); - GroupRefPoint->SpinBox_DZ->setValue(0.0); - - step = 0.1; - - initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1., step, "parametric_precision"); - GroupOnCurve->SpinBox_DX->setValue(0.5); - - initSpinBox(GroupOnSurface->SpinBox_DX, 0., 1., step, "parametric_precision"); - GroupOnSurface->SpinBox_DX->setValue(0.5); - initSpinBox(GroupOnSurface->SpinBox_DY, 0., 1., step, "parametric_precision"); - GroupOnSurface->SpinBox_DY->setValue(0.5); - - /* signals and slots connections */ - if ( myGeomGUI ){ - connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog())); - connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(close())); - } - //connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk())); - connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply())); - connect(buttonHelp(), SIGNAL(clicked()), this, SLOT(onHelpRequested()) ); -// connect( closeButton, SIGNAL(clicked()), this, SLOT(close()) ); - - connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int))); - - connect(myParamCoord, SIGNAL(buttonClicked(int)), this, SLOT(ClickParamCoord(int))); - - connect(GroupOnCurve->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupOnCurve->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupOnSurface->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument())); - connect(GroupLineIntersection->PushButton1, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument())); - connect(GroupLineIntersection->PushButton2, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument())); - - connect(myBtnPopup, SIGNAL(triggered(QAction*)), this, SLOT(onBtnPopup(QAction*))); - - connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupOnSurface->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupOnSurface->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupXYZ->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupXYZ->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupXYZ->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupRefPoint->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupRefPoint->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - connect(GroupRefPoint->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double))); - - connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( mainFrame()->RadioButton2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( mainFrame()->RadioButton3, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( mainFrame()->RadioButton4, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( mainFrame()->RadioButton5, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( myParamCoord->button(PARAM_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( myParamCoord->button(LENGTH_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - connect( myParamCoord->button(COORD_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); - - if ( myGeomGUI ){ - connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double))); - - connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(SelectionIntoArgument())); - } - - initName(tr("GEOM_VERTEX")); - - ConstructorsClicked(0); + // *** Init input widgets ***/ + initSpinBox(GroupXYZ->SpinBox_DX, COORD_MIN, COORD_MAX); + initSpinBox(GroupXYZ->SpinBox_DY, COORD_MIN, COORD_MAX); + initSpinBox(GroupXYZ->SpinBox_DZ, COORD_MIN, COORD_MAX); + GroupXYZ->SpinBox_DX->setValue(0.0); + GroupXYZ->SpinBox_DY->setValue(0.0); + GroupXYZ->SpinBox_DZ->setValue(0.0); + + initSpinBox(GroupRefPoint->SpinBox_DX, COORD_MIN, COORD_MAX); + initSpinBox(GroupRefPoint->SpinBox_DY, COORD_MIN, COORD_MAX); + initSpinBox(GroupRefPoint->SpinBox_DZ, COORD_MIN, COORD_MAX); + GroupRefPoint->SpinBox_DX->setValue(0.0); + GroupRefPoint->SpinBox_DY->setValue(0.0); + GroupRefPoint->SpinBox_DZ->setValue(0.0); + + initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1.); + GroupOnCurve->SpinBox_DX->setValue(paramInputValue[PARAM_VALUE]); + + initSpinBox(GroupOnSurface->SpinBox_DX, 0., 1.); + GroupOnSurface->SpinBox_DX->setValue(0.5); + initSpinBox(GroupOnSurface->SpinBox_DY, 0., 1.); + GroupOnSurface->SpinBox_DY->setValue(0.5); + + // * vtk input widget + mainFrame()->_vertex_le->setReadOnly(true); + mainFrame()->_vertex_le->setProperty( "HexaWidgetType", QVariant::fromValue(HEXABLOCK::GUI::VERTEX_TREE) ); + mainFrame()->_vertex_le->installEventFilter(this); + + // * geom input widgets + // point with ref + GroupRefPoint->LineEdit1->setReadOnly(true); + GroupRefPoint->LineEdit1->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMPOINT_TREE) ); + GroupRefPoint->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_VERTEX) ); + GroupRefPoint->LineEdit1->installEventFilter(this); + + // point on curve + // - Line + GroupOnCurve->LineEdit1->setReadOnly(true); + GroupOnCurve->LineEdit1->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) ); + GroupOnCurve->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + GroupOnCurve->LineEdit1->installEventFilter(this); + + // - Start point + GroupOnCurve->LineEdit2->setReadOnly(true); + GroupOnCurve->LineEdit2->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMPOINT_TREE) ); + GroupOnCurve->LineEdit2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_VERTEX) ); + GroupOnCurve->LineEdit2->installEventFilter(this); + + // point of 2 lines intersection + // - Line1 + GroupLineIntersection->LineEdit1->setReadOnly(true); + GroupLineIntersection->LineEdit1->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) ); + GroupLineIntersection->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + GroupLineIntersection->LineEdit1->installEventFilter(this); + + // - Line2 + GroupLineIntersection->LineEdit2->setReadOnly(true); + GroupLineIntersection->LineEdit2->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMEDGE_TREE) ); + GroupLineIntersection->LineEdit2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + GroupLineIntersection->LineEdit2->installEventFilter(this); + + //point on surface + GroupOnSurface->LineEdit1->setReadOnly(true); + GroupOnSurface->LineEdit1->setProperty( "HexaWidgetType", QVariant::fromValue(GEOMFACE_TREE) ); + GroupOnSurface->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_FACE) ); + GroupOnSurface->LineEdit1->installEventFilter(this); + + // * connect signals + connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int))); + connect(myParamCoord, SIGNAL(buttonClicked(int)), this, SLOT(ClickParamCoord(int))); + connect(myBtnPopup, SIGNAL(triggered(QAction*)), this, SLOT(onBtnPopup(QAction*))); + connect(myBtnPopup2, SIGNAL(triggered(QAction*)), this, SLOT(onBtnPopup(QAction*))); + + // ref point + connect(GroupRefPoint->LineEdit1, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&))); + + //point on curve + connect(GroupOnCurve->LineEdit1, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&))); + connect(GroupOnCurve->LineEdit2, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&))); + + connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(onParamValueChanged(double))); + connect(GroupOnCurve->SpinBox_DX, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + + // intersection point + connect(GroupLineIntersection->LineEdit1, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&))); + connect(GroupLineIntersection->LineEdit2, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&))); + + // point on surface + connect(GroupOnSurface->SpinBox_DX, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + connect(GroupOnSurface->SpinBox_DY, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + connect(GroupOnSurface->LineEdit1, SIGNAL( textChanged(const QString&) ), this, SLOT(onUpdateResults(const QString&))); //surface: Face + + // Coords X, Y, Z + connect(GroupXYZ->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(onXCoordChanged(double))); + connect(GroupXYZ->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(onYCoordChanged(double))); + connect(GroupXYZ->SpinBox_DZ, SIGNAL(valueChanged(double)), this, SLOT(onZCoordChanged(double))); + + connect(GroupXYZ->SpinBox_DX, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + connect(GroupXYZ->SpinBox_DY, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + connect(GroupXYZ->SpinBox_DZ, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + + // DX, DY, DZ + connect(GroupRefPoint->SpinBox_DX, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + connect(GroupRefPoint->SpinBox_DY, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + connect(GroupRefPoint->SpinBox_DZ, SIGNAL(valueChanged(const QString&)), this, SLOT(onUpdateResults(const QString&))); + + // radio buttons + connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( mainFrame()->RadioButton2, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( mainFrame()->RadioButton3, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( mainFrame()->RadioButton4, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( mainFrame()->RadioButton5, SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + + connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT( refreshHighlight()) ); + connect( mainFrame()->RadioButton2, SIGNAL(clicked()), this, SLOT(refreshHighlight()) ); + connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT( refreshHighlight()) ); + connect( mainFrame()->RadioButton2, SIGNAL(clicked()), this, SLOT(refreshHighlight()) ); + connect( mainFrame()->RadioButton1, SIGNAL(clicked()), this, SLOT( refreshHighlight()) ); + + connect( myParamCoord->button(PARAM_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( myParamCoord->button(LENGTH_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + connect( myParamCoord->button(COORD_VALUE), SIGNAL(clicked()), this, SLOT(updateHelpFileName()) ); + } -//================================================================================= -// function : onHelpRequested() -// purpose : show help in web browser -//================================================================================= -void MyBasicGUI_PointDlg::onHelpRequested() +void MyBasicGUI_PointDlg::showEvent ( QShowEvent * event ) { - LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() ); - if ( app ) - // app->onHelpContextModule( myGeometryGUI ? app->moduleName( myGeometryGUI->moduleName() ) : QString( "" ), _helpFileName ); - app->onHelpContextModule( "HEXABLOCK", myHelpFileName ); - - else { - QString platform; -#ifdef WIN32 - platform = "winapplication"; -#else - platform = "application"; -#endif - - SUIT_MessageBox::warning( 0, QObject::tr( "WRN_WARNING" ), - QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( myHelpFileName ), - QObject::tr( "BUT_OK" ) ); - } + HexaBaseDialog::showEvent(event); + if (getConstructorId() == GEOM_POINT_XYZ) + HEXABLOCKGUI::currentOccGView->setSelectionMode(TopAbs_VERTEX); } - //=============================================================== // function : updateHelpFileName() // purpose : update the help file according to the current panel //=============================================================== void MyBasicGUI_PointDlg::updateHelpFileName() { - if ( sender() == mainFrame()->RadioButton1 ){ - setHelpFileName("gui_asso_quad_to_geom.html#associate-to-a-vertex-of-the-geometry"); - } else if ( sender() == mainFrame()->RadioButton2 ){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-a-reference"); - } else if ( sender() == mainFrame()->RadioButton3 ){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-an-edge-and-a-parameter"); - } else if ( sender() == mainFrame()->RadioButton4 ){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-intersection-of-two-lines-or-wires"); - } else if ( sender() == mainFrame()->RadioButton5 ){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-a-face-and-two-parameters"); - } else if (sender() == myParamCoord->button(PARAM_VALUE)){ - if (mainFrame()->RadioButton3->isChecked()){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-an-edge-and-a-parameter"); - } else if (mainFrame()->RadioButton5->isChecked()){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-a-face-and-two-parameters"); - } - } else if (sender() == myParamCoord->button(LENGTH_VALUE)){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-an-edge-and-a-length"); - } else if (sender() == myParamCoord->button(COORD_VALUE)){ - if (mainFrame()->RadioButton3->isChecked()){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-an-edge-and-coordinates"); - } else if (mainFrame()->RadioButton5->isChecked()){ - setHelpFileName("gui_asso_vertex_to_geom.html#by-a-face-and-coordinates"); - } - } + if ( sender() == mainFrame()->RadioButton1 ){ + _helpFileName = "gui_asso_quad_to_geom.html#associate-to-a-vertex-of-the-geometry"; + } else if ( sender() == mainFrame()->RadioButton2 ){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-a-reference"; + } else if ( sender() == mainFrame()->RadioButton3 ){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-an-edge-and-a-parameter"; + } else if ( sender() == mainFrame()->RadioButton4 ){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-intersection-of-two-lines-or-wires"; + } else if ( sender() == mainFrame()->RadioButton5 ){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-a-face-and-two-parameters"; + } else if (sender() == myParamCoord->button(PARAM_VALUE)){ + if (mainFrame()->RadioButton3->isChecked()){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-an-edge-and-a-parameter"; + } else if (mainFrame()->RadioButton5->isChecked()){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-a-face-and-two-parameters"; + } + } else if (sender() == myParamCoord->button(LENGTH_VALUE)){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-an-edge-and-a-length"; + } else if (sender() == myParamCoord->button(COORD_VALUE)){ + if (mainFrame()->RadioButton3->isChecked()){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-an-edge-and-coordinates"; + } else if (mainFrame()->RadioButton5->isChecked()){ + _helpFileName = "gui_asso_vertex_to_geom.html#by-a-face-and-coordinates"; + } + } } //================================================================================= @@ -417,13 +401,13 @@ void MyBasicGUI_PointDlg::updateHelpFileName() //================================================================================= void MyBasicGUI_PointDlg::SetDoubleSpinBoxStep(double step) { - GroupOnCurve->SpinBox_DX->setSingleStep(step); - GroupXYZ->SpinBox_DX->setSingleStep(step); - GroupXYZ->SpinBox_DY->setSingleStep(step); - GroupXYZ->SpinBox_DZ->setSingleStep(step); - GroupRefPoint->SpinBox_DX->setSingleStep(step); - GroupRefPoint->SpinBox_DY->setSingleStep(step); - GroupRefPoint->SpinBox_DZ->setSingleStep(step); + GroupOnCurve->SpinBox_DX->setSingleStep(step); + GroupXYZ->SpinBox_DX->setSingleStep(step); + GroupXYZ->SpinBox_DY->setSingleStep(step); + GroupXYZ->SpinBox_DZ->setSingleStep(step); + GroupRefPoint->SpinBox_DX->setSingleStep(step); + GroupRefPoint->SpinBox_DY->setSingleStep(step); + GroupRefPoint->SpinBox_DZ->setSingleStep(step); } @@ -433,622 +417,512 @@ void MyBasicGUI_PointDlg::SetDoubleSpinBoxStep(double step) //================================================================================= void MyBasicGUI_PointDlg::ConstructorsClicked(int constructorId) { -// HEXABLOCKGUI::currentOccView->raise(); -// HEXABLOCKGUI::currentOccView->setFocus(); - switch (constructorId) { - case GEOM_POINT_XYZ: + clearVTKSelection(); + clearOCCSelection(); + + switch (constructorId) { + case GEOM_POINT_XYZ: { - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - myNeedType = TopAbs_VERTEX; - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); - - GroupRefPoint->hide(); - GroupOnCurve->hide(); - GroupLineIntersection->hide(); - GroupOnSurface->hide(); - myCoordGrp->hide(); - myParamGroup->hide(); - GroupXYZ->show(); - break; + HEXABLOCKGUI::currentOccGView->setSelectionMode(TopAbs_VERTEX); + GroupRefPoint->hide(); + GroupOnCurve->hide(); + GroupLineIntersection->hide(); + GroupOnSurface->hide(); + myCoordGrp->hide(); + myParamGroup->hide(); + GroupXYZ->show(); + break; } - case GEOM_POINT_REF: + case GEOM_POINT_REF: { - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - myNeedType = TopAbs_VERTEX; - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); - - myEditCurrentArgument = GroupRefPoint->LineEdit1; - //myEditCurrentArgument->setText(""); - //myRefPoint.nullify(); - GroupRefPoint->PushButton1->setDown(true); - myParamGroup->hide(); - GroupXYZ->hide(); - GroupOnCurve->hide(); - GroupLineIntersection->hide(); - GroupOnSurface->hide(); - GroupRefPoint->show(); - myCoordGrp->show(); - break; + myParamGroup->hide(); + GroupXYZ->hide(); + GroupOnCurve->hide(); + GroupLineIntersection->hide(); + GroupOnSurface->hide(); + GroupRefPoint->show(); + myCoordGrp->show(); + break; } - case GEOM_POINT_EDGE: + case GEOM_POINT_EDGE: { - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - myNeedType = TopAbs_EDGE; - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); - - myEditCurrentArgument = GroupOnCurve->LineEdit1; -// myEditCurrentArgument->setText(""); -// myEdge.nullify(); -// myRefPoint.nullify(); - GroupOnCurve->PushButton1->setDown(true); - GroupRefPoint->hide(); - GroupLineIntersection->hide(); - GroupOnSurface->hide(); - myParamGroup->show(); - myParamCoord->button(LENGTH_VALUE)->show(); - myParamCoord->button(PARAM_VALUE)->setChecked(true); - GroupOnCurve->show(); - myCoordGrp->show(); - updateParamCoord(false); - break; + GroupRefPoint->hide(); + GroupLineIntersection->hide(); + GroupOnSurface->hide(); + myParamGroup->show(); + myParamCoord->button(LENGTH_VALUE)->show(); + myParamCoord->button(PARAM_VALUE)->setChecked(true); + GroupOnCurve->show(); + myCoordGrp->show(); + updateParamCoord(false); + break; } - case GEOM_POINT_INTINT: + case GEOM_POINT_INTINT: { - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - myNeedType = TopAbs_EDGE; - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); - - myEditCurrentArgument = GroupLineIntersection->LineEdit1; -// GroupLineIntersection->LineEdit1->setText(""); -// GroupLineIntersection->LineEdit2->setText(""); - GroupLineIntersection->LineEdit1->setEnabled(true); - GroupLineIntersection->LineEdit2->setEnabled(false); -// myLine1.nullify(); -// myLine2.nullify(); - GroupLineIntersection->PushButton1->setDown(true); - GroupLineIntersection->PushButton2->setDown(false); - myParamGroup->hide(); - GroupXYZ->hide(); - GroupRefPoint->hide(); - GroupOnCurve->hide(); - GroupOnSurface->hide(); - myCoordGrp->hide(); - GroupLineIntersection->show(); - break; + myParamGroup->hide(); + GroupXYZ->hide(); + GroupRefPoint->hide(); + GroupOnCurve->hide(); + GroupOnSurface->hide(); + myCoordGrp->show(); + GroupLineIntersection->show(); + break; } - case GEOM_POINT_SURF: + case GEOM_POINT_SURF: { - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - myNeedType = TopAbs_FACE; - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); - - myEditCurrentArgument = GroupOnSurface->LineEdit1; - //myEditCurrentArgument->setText(""); - //myFace.nullify(); - GroupOnSurface->PushButton1->setDown(true); - GroupRefPoint->hide(); - GroupOnCurve->hide(); - GroupLineIntersection->hide(); - myParamGroup->show(); - myParamCoord->button(LENGTH_VALUE)->hide(); - myParamCoord->button(PARAM_VALUE)->setChecked(true); - GroupOnSurface->show(); - myCoordGrp->show(); - updateParamCoord(false); - break; + GroupRefPoint->hide(); + GroupOnCurve->hide(); + GroupLineIntersection->hide(); + myParamGroup->show(); + myParamCoord->button(LENGTH_VALUE)->hide(); + myParamCoord->button(PARAM_VALUE)->setChecked(true); + GroupOnSurface->show(); + myCoordGrp->show(); + updateParamCoord(false); + break; + } } - } - -// myX->setText(""); -// myY->setText(""); -// myZ->setText(""); - - QTimer::singleShot(50, this, SLOT(updateSize())); - SelectionIntoArgument(); + updateInputs(constructorId); } //================================================================================= -// function : ClickOnOk() +// funcion : getParameter() // purpose : //================================================================================= -void MyBasicGUI_PointDlg::ClickOnOk() +double MyBasicGUI_PointDlg::getParameter() const { - setIsApplyAndClose(true); - if (onAccept()) - close(); + return GroupOnCurve->SpinBox_DX->value(); } //================================================================================= -// function : ClickOnApply() +// funcion : getUParameter() // purpose : //================================================================================= -bool MyBasicGUI_PointDlg::ClickOnApply() +double MyBasicGUI_PointDlg::getUParameter() const { - if (!onAccept()) - return false; - - initName(); -// ConstructorsClicked(getConstructorId()); - - //Set selection mode to the last selected mode - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); - - return true; + return GroupOnSurface->SpinBox_DX->value(); } - //================================================================================= -// function : SelectionIntoArgument() -// purpose : Called when selection as changed (for constructors not using local context) +// funcion : getVParameter() +// purpose : //================================================================================= -void MyBasicGUI_PointDlg::SelectionIntoArgument() +double MyBasicGUI_PointDlg::getVParameter() const { - GEOM::GeomObjPtr aSelectedObject = getSelected(myNeedType); - TopoDS_Shape aShape; - if (!aSelectedObject || !GEOMBase::GetShape(aSelectedObject.get(), aShape) || aShape.IsNull()) - return; - - erasePreview(); - const int id = getConstructorId(); - - if ((id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF) - && myEditCurrentArgument != 0) - { - myEditCurrentArgument->setText(""); - myX->setText(""); - myY->setText(""); - myZ->setText(""); - myFace.nullify(); - if (myEditCurrentArgument == GroupOnCurve->LineEdit1) - myEdge.nullify(); - else if (myEditCurrentArgument == GroupOnCurve->LineEdit2) - myRefPoint.nullify(); - } - else if (id == GEOM_POINT_INTINT) { - myEditCurrentArgument->setText(""); - if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) - myLine1.nullify(); - else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) - myLine2.nullify(); - } - - QString aName = GEOMBase::GetName(aSelectedObject.get()); - myBusy = true; - if (id == GEOM_POINT_XYZ) { - gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape)); - GroupXYZ->SpinBox_DX->setValue(aPnt.X()); - GroupXYZ->SpinBox_DY->setValue(aPnt.Y()); - GroupXYZ->SpinBox_DZ->setValue(aPnt.Z()); - } - else if (id == GEOM_POINT_REF) { - myRefPoint = aSelectedObject; - GroupRefPoint->LineEdit1->setText(aName); - } - else if (id == GEOM_POINT_EDGE) { - myEditCurrentArgument->setText(aName); - if (myEditCurrentArgument == GroupOnCurve->LineEdit1) { - myEdge = aSelectedObject; - if (myEdge && !myRefPoint) { - GroupOnCurve->PushButton2->click(); - } - } - else if (myEditCurrentArgument == GroupOnCurve->LineEdit2) { - myRefPoint = aSelectedObject; - if (myRefPoint && !myEdge) { - GroupOnCurve->PushButton1->click(); - } - } - } - else if (id == GEOM_POINT_INTINT) { - myEditCurrentArgument->setText(aName); - if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) { - myLine1 = aSelectedObject; - if (!myLine2) { - GroupLineIntersection->PushButton2->setMenu(0); - GroupLineIntersection->PushButton2->click(); - GroupLineIntersection->PushButton2->setDown(true); - GroupLineIntersection->PushButton2->setMenu(myBtnPopup); - } - } - else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) { - myLine2 = aSelectedObject; - if (!myLine1) { - GroupLineIntersection->PushButton1->setMenu(0); - GroupLineIntersection->PushButton1->click(); - GroupLineIntersection->PushButton1->setDown(true); - GroupLineIntersection->PushButton1->setMenu(myBtnPopup); - } - } - } - else if (id == GEOM_POINT_SURF) { - myFace = aSelectedObject; - GroupOnSurface->LineEdit1->setText(aName); - } - myBusy = false; - - - displayPreview(true); + return GroupOnSurface->SpinBox_DY->value(); } - -//================================================================================= -// function : SetEditCurrentArgument() -// purpose : -//================================================================================= -void MyBasicGUI_PointDlg::SetEditCurrentArgument() +void MyBasicGUI_PointDlg::onParamValueChanged(double newValue) { - QPushButton* send = (QPushButton*)sender(); - - if (send == GroupRefPoint->PushButton1) { - GroupRefPoint->LineEdit1->setFocus(); - myEditCurrentArgument = GroupRefPoint->LineEdit1; - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), TopAbs_VERTEX); - } - else if (send == GroupOnCurve->PushButton1) { - GroupOnCurve->LineEdit1->setFocus(); - myEditCurrentArgument = GroupOnCurve->LineEdit1; - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - myNeedType = TopAbs_EDGE; - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); - GroupOnCurve->PushButton2->setDown(false); - GroupOnCurve->LineEdit1->setEnabled(true); - GroupOnCurve->LineEdit2->setEnabled(false); - } - else if (send == GroupOnCurve->PushButton2) { - GroupOnCurve->LineEdit2->setFocus(); - myEditCurrentArgument = GroupOnCurve->LineEdit2; - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - myNeedType = TopAbs_VERTEX; - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); - GroupOnCurve->PushButton1->setDown(false); - GroupOnCurve->LineEdit2->setEnabled(true); - GroupOnCurve->LineEdit1->setEnabled(false); - } - else if (send == GroupOnSurface->PushButton1) - { - GroupOnSurface->LineEdit1->setFocus(); - myEditCurrentArgument = GroupOnSurface->LineEdit1; - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), TopAbs_FACE); - } - else if (send == GroupLineIntersection->PushButton1) { - GroupLineIntersection->LineEdit1->setFocus(); - myEditCurrentArgument = GroupLineIntersection->LineEdit1; - GroupLineIntersection->PushButton2->setDown(false); - GroupLineIntersection->LineEdit1->setEnabled(true); - GroupLineIntersection->LineEdit2->setEnabled(false); - } - else if (send == GroupLineIntersection->PushButton2) { - GroupLineIntersection->LineEdit2->setFocus(); - myEditCurrentArgument = GroupLineIntersection->LineEdit2; - GroupLineIntersection->PushButton1->setDown(false); - GroupLineIntersection->LineEdit1->setEnabled(false); - GroupLineIntersection->LineEdit2->setEnabled(true); - } - send->setDown(true); - - if ((send == GroupLineIntersection->PushButton1 || - send == GroupLineIntersection->PushButton2) && !myBusy) - SelectionIntoArgument(); + if (getConstructorId() == GEOM_POINT_EDGE) + paramInputValue[myParamCoord->checkedId()] = newValue; } - -//================================================================================= -// function : enterEvent() -// purpose : to reactivate this dialog box when mouse enter onto the window -//================================================================================= -void MyBasicGUI_PointDlg::enterEvent(QEvent*) +// ============================================================== onSelectionChanged +/* + * Puts elements selected in the model in the corresponding widget (list widget or line edit) + * of the current dialog box. + */ +void MyBasicGUI_PointDlg::onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel ) { - if (!mainFrame()->GroupConstructors->isEnabled()) - ActivateThisDialog(); -} + QModelIndexList l = sel.indexes(); + if ( l.count() == 0) + return; + + QModelIndex selected = l[0]; + int selectedType = selected.data(HEXA_TREE_ROLE).toInt(); + // fill the coordinates of the selected point + if ( getConstructorId() == GEOM_POINT_XYZ && selectedType == GEOMPOINT_TREE) + { + DocumentModel::GeomObj* geomObj = getGeomObj(selected); + if (geomObj == NULL) + return; + + DocumentModel* docModel = getDocumentModel(); + QString objId = geomObj->shapeName + "," + geomObj->subId; + HEXA_NS::SubShape* ssh = docModel->getGeomPtr(objId); + if (ssh == NULL) + return; + TopoDS_Shape shape = ssh->getShape(); + if (shape.IsNull() || shape.ShapeType() != TopAbs_VERTEX) + return; + TopoDS_Vertex vertex = TopoDS::Vertex(shape); + gp_Pnt pnt = BRep_Tool::Pnt(vertex); + OnPointSelected(pnt); + return; + } + QLineEdit* aLineEdit = NULL; + QListWidget* aListWidget = NULL; -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void MyBasicGUI_PointDlg::ActivateThisDialog() -{ - MyGEOMBase_Skeleton::ActivateThisDialog(); + // * put selection in the current line edit + aLineEdit = dynamic_cast(_currentObj); + if ( aLineEdit != NULL ) + { + _onSelectionChanged( sel, aLineEdit ); + return; + } - if ( myGeomGUI ){ - connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(SelectionIntoArgument())); - } - ConstructorsClicked(getConstructorId()); + // * put selection in the current list widget + aListWidget = dynamic_cast(_currentObj); + if ( aListWidget ) + _onSelectionChanged( sel, aListWidget ); } -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : public slot to deactivate if active -//================================================================================= -void MyBasicGUI_PointDlg::DeactivateActiveDialog() +bool MyBasicGUI_PointDlg::apply(QModelIndex& result) { - // myGeomGUI->SetState(-1); - MyGEOMBase_Skeleton::DeactivateActiveDialog(); + PatternGeomSelectionModel* pgsm = getPatternGeomSelectionModel(); + PatternDataSelectionModel* pdsm = getPatternDataSelectionModel(); + PatternDataModel* pdm = getPatternDataModel(); + DocumentModel* docModel = getDocumentModel(); + + // get the selected vertex in the vtk view + QVariant v = mainFrame()->_vertex_le->property("QModelIndex"); + if ( !v.isValid() ) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE VERTEX ASSOCIATION" ) ); + return false; + } + QModelIndex iVertex = pdm->mapToSource( v.value() ); + + // get the selected vertex in the geometry (occ view) + TopoDS_Vertex geomVertex = computeGeomVertex(); + + // control + if (!iVertex.isValid() || geomVertex.IsNull()) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE VERTEX ASSOCIATION" ) ); + return false; + } + + // * set association + gp_Pnt aPnt = BRep_Tool::Pnt(geomVertex); + if (!docModel->setVertexAssociation(iVertex, aPnt.X(), aPnt.Y(), aPnt.Z())) + { + SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE VERTEX ASSOCIATION" ) ); + return false; + } + + // * update data in the occ view and the geom tree + HEXABLOCKGUI::currentOccGView->addVertexToCloud(geomVertex); + docModel->updateGeomTree(); + + // highlight associated items + QModelIndex iGeomVertex = docModel->getVertexAssociation(iVertex); + QModelIndexList list1, list2; + result = v.value(); + list1 << result; + list2 << iGeomVertex; + pdsm->highlightTreeItems(list1); // data tree + pgsm->highlightTreeItems(list2); // geom tree + setFocus(); + _updateCurrentObject(NULL); + HEXABLOCKGUI::currentOccGView->setSelectionMode(TopAbs_VERTEX); + HEXABLOCKGUI::currentDocGView->highlight(list1); // vtk view + HEXABLOCKGUI::currentOccGView->highlight(list1); // occ view + + return true; } -//================================================================================= -// function : ValueChangedInSpinBox() -// purpose : -//================================================================================= -void MyBasicGUI_PointDlg::ValueChangedInSpinBox(double newValue) +void MyBasicGUI_PointDlg::onXCoordChanged(double newValue) { - displayPreview(true); + int constructorId = getConstructorId(); + if (constructorId != GEOM_POINT_XYZ && constructorId != GEOM_POINT_EDGE && + constructorId != GEOM_POINT_SURF) + return; + coordsInputValue[constructorId]->setX(newValue); } -//================================================================================= -// function : CheckBoxClicked() -// purpose : Check Boxes Management -//================================================================================= -void MyBasicGUI_PointDlg::CheckBoxClicked(int State) +void MyBasicGUI_PointDlg::onYCoordChanged(double newValue) { - displayPreview(true); + int constructorId = getConstructorId(); + if (constructorId != GEOM_POINT_XYZ && constructorId != GEOM_POINT_EDGE && + constructorId != GEOM_POINT_SURF) + return; + coordsInputValue[constructorId]->setY(newValue); } - -//================================================================================= -// funcion : getParameter() -// purpose : -//================================================================================= -double MyBasicGUI_PointDlg::getParameter() const +void MyBasicGUI_PointDlg::onZCoordChanged(double newValue) { - return GroupOnCurve->SpinBox_DX->value(); -} + int constructorId = getConstructorId(); + if (constructorId != GEOM_POINT_XYZ && constructorId != GEOM_POINT_EDGE && + constructorId != GEOM_POINT_SURF) + return; + coordsInputValue[constructorId]->setZ(newValue); +} -//================================================================================= -// funcion : getUParameter() -// purpose : -//================================================================================= -double MyBasicGUI_PointDlg::getUParameter() const +void MyBasicGUI_PointDlg::onUpdateResults(const QString& data) { - return GroupOnSurface->SpinBox_DX->value(); -} + if (getConstructorId() == GEOM_POINT_XYZ) + return; + // * compute the geom vertex + TopoDS_Vertex vertex = computeGeomVertex(true); -//================================================================================= -// funcion : getVParameter() -// purpose : -//================================================================================= -double MyBasicGUI_PointDlg::getVParameter() const -{ - return GroupOnSurface->SpinBox_DY->value(); + // * update results + if (vertex.IsNull()) + { + myX->setText(""); + myY->setText(""); + myZ->setText(""); + return; + } + gp_Pnt pnt = BRep_Tool::Pnt(vertex); + myX->setText(DlgRef::PrintDoubleValue(pnt.X(), 6)); + myY->setText(DlgRef::PrintDoubleValue(pnt.Y(), 6)); + myZ->setText(DlgRef::PrintDoubleValue(pnt.Z(), 6)); } - -//================================================================================= -// function : OnPointSelected -// purpose : -//================================================================================= -void MyBasicGUI_PointDlg::OnPointSelected(const gp_Pnt& thePnt) +TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomVertex(bool preview) { - if (getConstructorId() == GEOM_POINT_XYZ) { - GroupXYZ->SpinBox_DX->setValue(thePnt.X()); - GroupXYZ->SpinBox_DY->setValue(thePnt.Y()); - GroupXYZ->SpinBox_DZ->setValue(thePnt.Z()); + TopoDS_Vertex vertex; + int constructorId = getConstructorId(); + + //display an emply vertex to erase the current preview + HEXABLOCKGUI::currentOccGView->displayPreview(vertex); + + // compute the point + switch (constructorId) { + case GEOM_POINT_XYZ: + vertex = computeGeomPointXYZ(); + break; + case GEOM_POINT_REF: + vertex = computeGeomPointRef(); + break; + case GEOM_POINT_EDGE: + vertex = computeGeomPointEdge(); + break; + case GEOM_POINT_INTINT: + vertex = computeGeomPointInt(); + break; + case GEOM_POINT_SURF: + vertex = computeGeomPointSurf(); + break; + default: + break; + } + + // * display preview of computed point + if (preview) + HEXABLOCKGUI::currentOccGView->displayPreview(vertex); - displayPreview(true); - } + return vertex; } -//================================================================================= -// function : createOperation -// purpose : -//================================================================================= -GEOM::GEOM_IOperations_ptr MyBasicGUI_PointDlg::createOperation() +TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointXYZ() { - return myGeomGUI->GetGeomGen()->GetIBasicOperations(getStudyId()); + TopoDS_Vertex vertex; + + if (getConstructorId() != GEOM_POINT_XYZ) + return vertex; + + // - X, Y, Z Coords + double x = GroupXYZ->SpinBox_DX->value(); + double y = GroupXYZ->SpinBox_DY->value(); + double z = GroupXYZ->SpinBox_DZ->value(); + + // - compute the resulting vertex + vertex = makePoint(x, y, z); + + return vertex; } -//================================================================================= -// function : isValid -// purpose : -//================================================================================= -bool MyBasicGUI_PointDlg::isValid(QString& msg) +TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointRef() { - bool ok = false; - switch (getConstructorId()) { - case GEOM_POINT_XYZ : - ok = GroupXYZ->SpinBox_DX->isValid(msg, !IsPreview()) && - GroupXYZ->SpinBox_DY->isValid(msg, !IsPreview()) && - GroupXYZ->SpinBox_DZ->isValid(msg, !IsPreview()); - break; - case GEOM_POINT_REF: - ok = GroupRefPoint->SpinBox_DX->isValid(msg, !IsPreview()) && - GroupRefPoint->SpinBox_DY->isValid(msg, !IsPreview()) && - GroupRefPoint->SpinBox_DZ->isValid(msg, !IsPreview()) && - myRefPoint; - break; - case GEOM_POINT_EDGE: - if (myParamCoord->checkedId() == PARAM_VALUE || myParamCoord->checkedId() == LENGTH_VALUE) - ok = GroupOnCurve->SpinBox_DX->isValid(msg, !IsPreview()); - else - ok = GroupXYZ->SpinBox_DX->isValid(msg, !IsPreview()) && - GroupXYZ->SpinBox_DY->isValid(msg, !IsPreview()) && - GroupXYZ->SpinBox_DZ->isValid(msg, !IsPreview()); - ok = myEdge && ok; - break; - case GEOM_POINT_INTINT: - ok = myLine1 && myLine2; - break; - case GEOM_POINT_SURF: - if (myParamCoord->checkedId() == PARAM_VALUE) - ok = GroupOnSurface->SpinBox_DX->isValid(msg, !IsPreview()) && - GroupOnSurface->SpinBox_DY->isValid(msg, !IsPreview()); - else - ok = GroupXYZ->SpinBox_DX->isValid(msg, !IsPreview()) && - GroupXYZ->SpinBox_DY->isValid(msg, !IsPreview()) && - GroupXYZ->SpinBox_DZ->isValid(msg, !IsPreview()); - ok = myFace && ok; - break; - default: - break; - } - return ok; + TopoDS_Vertex vertex; + + if (getConstructorId() != GEOM_POINT_REF) + return vertex; + + // get parameters from widgets + double dx = GroupRefPoint->SpinBox_DX->value(); + double dy = GroupRefPoint->SpinBox_DY->value(); + double dz = GroupRefPoint->SpinBox_DZ->value(); + + QVariant v = GroupRefPoint->LineEdit1->property("TopoDS_Shape"); + if ( !v.isValid() ) + return vertex; + TopoDS_Shape shape = v.value(); + + // compute the resulting point + vertex = makePointWithReference(shape, dx, dy, dz); + + return vertex; } -//================================================================================= -// function : execute -// purpose : -//================================================================================= -bool MyBasicGUI_PointDlg::execute(ObjectList& objects) +TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointEdge() { - bool res = false; + TopoDS_Vertex vertex; - GEOM::GEOM_Object_var anObj; - QStringList aParameters; + if (getConstructorId() != GEOM_POINT_EDGE) + return vertex; - GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow(getOperation()); + // * get inputs values - switch (getConstructorId()) { - case GEOM_POINT_XYZ : - { - double x = GroupXYZ->SpinBox_DX->value(); - double y = GroupXYZ->SpinBox_DY->value(); - double z = GroupXYZ->SpinBox_DZ->value(); + // - the edge + QVariant v1 = GroupOnCurve->LineEdit1->property("TopoDS_Shape"); + if ( !v1.isValid() ) + return vertex; + TopoDS_Shape edgeShape = v1.value(); - aParameters << GroupXYZ->SpinBox_DX->text(); - aParameters << GroupXYZ->SpinBox_DY->text(); - aParameters << GroupXYZ->SpinBox_DZ->text(); + bool isParam = myParamCoord->checkedId() == PARAM_VALUE; + bool isLength = myParamCoord->checkedId() == LENGTH_VALUE; + bool isCoord = myParamCoord->checkedId() == COORD_VALUE; + if (isParam) + { + // - param + double param = GroupOnCurve->SpinBox_DX->value(); - anObj = anOper->MakePointXYZ(x, y, z); - res = true; - break; + // - compute the resulting vertex + vertex = makePointOnCurve(edgeShape, param); } - case GEOM_POINT_REF : + else if (isLength) { - double dx = GroupRefPoint->SpinBox_DX->value(); - double dy = GroupRefPoint->SpinBox_DY->value(); - double dz = GroupRefPoint->SpinBox_DZ->value(); + // - the starting point + QVariant v2 = GroupOnCurve->LineEdit2->property("TopoDS_Shape"); + if ( !v2.isValid() ) + return vertex; + TopoDS_Shape pointShape = v2.value(); - aParameters << GroupRefPoint->SpinBox_DX->text(); - aParameters << GroupRefPoint->SpinBox_DY->text(); - aParameters << GroupRefPoint->SpinBox_DZ->text(); + // - length + double length = GroupOnCurve->SpinBox_DX->value(); - anObj = anOper->MakePointWithReference(myRefPoint.get(), dx, dy, dz); - res = true; - break; + // - compute the resulting vertex + vertex = makePointOnCurveByLength(edgeShape, pointShape,length); } - case GEOM_POINT_EDGE : + else if (isCoord) { - if (myParamCoord->checkedId() == PARAM_VALUE) { - anObj = anOper->MakePointOnCurve(myEdge.get(), getParameter()); - aParameters<SpinBox_DX->text(); - } - else if (myParamCoord->checkedId() == LENGTH_VALUE) { - anObj = anOper->MakePointOnCurveByLength(myEdge.get(), getParameter(), myRefPoint.get()); - aParameters<SpinBox_DX->text(); - } - else if (myParamCoord->checkedId() == COORD_VALUE) { - double x = GroupXYZ->SpinBox_DX->value(); - double y = GroupXYZ->SpinBox_DY->value(); - double z = GroupXYZ->SpinBox_DZ->value(); - - aParameters << GroupXYZ->SpinBox_DX->text(); - aParameters << GroupXYZ->SpinBox_DY->text(); - aParameters << GroupXYZ->SpinBox_DZ->text(); - - anObj = anOper->MakePointOnCurveByCoord(myEdge.get(), x, y, z); - } - res = true; - break; - } - case GEOM_POINT_INTINT : - anObj = anOper->MakePointOnLinesIntersection(myLine1.get(), myLine2.get()); - if (!anObj->_is_nil()) { - QString aName = getNewObjectName(); - if (anObj->GetShapeType() == GEOM::COMPOUND && aName.startsWith("Vertex")) - initName(tr("GEOM_COMPOUND")); - else if (anObj->GetShapeType() == GEOM::VERTEX && aName.startsWith("Compound")) - initName(tr("GEOM_VERTEX")); + // - X, Y, Z Coords + double x = GroupXYZ->SpinBox_DX->value(); + double y = GroupXYZ->SpinBox_DY->value(); + double z = GroupXYZ->SpinBox_DZ->value(); + + // - compute the resulting vertex + vertex = makePointOnCurveByCoord(edgeShape, x, y, z); } - res = true; - break; - case GEOM_POINT_SURF : + + return vertex; +} + +TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointInt() +{ + TopoDS_Vertex vertex; + + if (getConstructorId() != GEOM_POINT_INTINT) + return vertex; + + QVariant v; + + // * get inputs values + + // - get edge 1 + v = GroupLineIntersection->LineEdit1->property("TopoDS_Shape"); + if ( !v.isValid() ) + return vertex; + TopoDS_Shape line1 = v.value(); + + // - get edge 2 + v = GroupLineIntersection->LineEdit2->property("TopoDS_Shape"); + if ( !v.isValid() ) + return vertex; + TopoDS_Shape line2 = v.value(); + + // * compute the resulting vertex + vertex = makePointOnLinesIntersection(line1, line2); + + return vertex; +} + +TopoDS_Vertex MyBasicGUI_PointDlg::computeGeomPointSurf() +{ + TopoDS_Vertex vertex; + + if (getConstructorId() != GEOM_POINT_SURF) + return vertex; + + // * get inputs values + + // - the face + QVariant v = GroupOnSurface->LineEdit1->property("TopoDS_Shape"); + if ( !v.isValid() ) + return vertex; + TopoDS_Shape faceShape = v.value(); + + bool isParam = myParamCoord->checkedId() == PARAM_VALUE; + bool isCoord = myParamCoord->checkedId() == COORD_VALUE; + if (isParam) { - if (myParamCoord->checkedId() == PARAM_VALUE) { - anObj = anOper->MakePointOnSurface(myFace.get(), getUParameter(), getVParameter()); - aParameters<SpinBox_DX->text(); - aParameters<SpinBox_DY->text(); - } else { - double x = GroupXYZ->SpinBox_DX->value(); - double y = GroupXYZ->SpinBox_DY->value(); - double z = GroupXYZ->SpinBox_DZ->value(); - - aParameters << GroupXYZ->SpinBox_DX->text(); - aParameters << GroupXYZ->SpinBox_DY->text(); - aParameters << GroupXYZ->SpinBox_DZ->text(); - - anObj = anOper->MakePointOnSurfaceByCoord(myFace.get(), x, y, z); - } - res = true; - break; - } - } - - const int id = getConstructorId(); - if(!anObj->_is_nil() && !IsPreview() && (id == GEOM_POINT_XYZ || - id == GEOM_POINT_REF || - id == GEOM_POINT_EDGE || - id == GEOM_POINT_SURF)) { - anObj->SetParameters(aParameters.join(":").toLatin1().constData()); - } - - if (id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF) { - TopoDS_Shape aShape; - if (GEOMBase::GetShape(anObj, aShape) && !aShape.IsNull() && - aShape.ShapeType() == TopAbs_VERTEX) { - gp_Pnt aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape)); - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - int aPrecision = resMgr->integerValue("Geometry", "length_precision", 6); - myX->setText(DlgRef::PrintDoubleValue(aPnt.X(), aPrecision)); - myY->setText(DlgRef::PrintDoubleValue(aPnt.Y(), aPrecision)); - myZ->setText(DlgRef::PrintDoubleValue(aPnt.Z(), aPrecision)); - } - else { - myX->setText(""); - myY->setText(""); - myZ->setText(""); + // - params U,V + double param_u = GroupOnSurface->SpinBox_DX->value(); + double param_v = GroupOnSurface->SpinBox_DY->value(); + + // - compute the resulting vertex + vertex = makePointOnSurface(faceShape, param_u, param_v); } - } + else if (isCoord) + { + // - X, Y, Z Coords + double x = GroupXYZ->SpinBox_DX->value(); + double y = GroupXYZ->SpinBox_DY->value(); + double z = GroupXYZ->SpinBox_DZ->value(); - if (!anObj->_is_nil()) { - objects.push_back(anObj._retn()); - } + // - compute the resulting vertex + vertex = makePointOnSurfaceByCoord(faceShape, x, y, z); + } - return res; + return vertex; } //================================================================================= -// function : addSubshapeToStudy -// purpose : virtual method to add new SubObjects if local selection +// function : OnPointSelected +// purpose : //================================================================================= -void MyBasicGUI_PointDlg::addSubshapesToStudy() +void MyBasicGUI_PointDlg::OnPointSelected(const gp_Pnt& thePnt) +{ + if (getConstructorId() == GEOM_POINT_XYZ) { + GroupXYZ->SpinBox_DX->setValue(thePnt.X()); + GroupXYZ->SpinBox_DY->setValue(thePnt.Y()); + GroupXYZ->SpinBox_DZ->setValue(thePnt.Z()); + } +} + +void MyBasicGUI_PointDlg::updateInputs(const int constructorId) { - switch (getConstructorId()) { - case GEOM_POINT_REF: - GEOMBase::PublishSubObject(myRefPoint.get()); - break; - case GEOM_POINT_EDGE: - GEOMBase::PublishSubObject(myEdge.get()); - break; - case GEOM_POINT_INTINT: - GEOMBase::PublishSubObject(myLine1.get()); - GEOMBase::PublishSubObject(myLine2.get()); - break; - case GEOM_POINT_SURF: - GEOMBase::PublishSubObject(myFace.get()); - break; - default: - break; - } + QString str; + QVector3D* coords = NULL; + + switch (constructorId) { + case GEOM_POINT_XYZ : + coords = coordsInputValue[GEOM_POINT_XYZ]; + break; + case GEOM_POINT_REF: + break; + case GEOM_POINT_EDGE: + coords = coordsInputValue[GEOM_POINT_EDGE]; + updateParamCoord(true); + break; + case GEOM_POINT_INTINT: + break; + case GEOM_POINT_SURF: + coords = coordsInputValue[GEOM_POINT_SURF]; + updateParamCoord(true); + break; + default: + break; + } + + if (coords != NULL) + { + GroupXYZ->SpinBox_DX->setValue(coords->x()); + GroupXYZ->SpinBox_DY->setValue(coords->y()); + GroupXYZ->SpinBox_DZ->setValue(coords->z()); + } + + onUpdateResults(str); } //================================================================================= @@ -1057,8 +931,7 @@ void MyBasicGUI_PointDlg::addSubshapesToStudy() //================================================================================= void MyBasicGUI_PointDlg::ClickParamCoord(int id) { - updateParamCoord(true); - displayPreview(true); + updateInputs(getConstructorId()); } //================================================================================= @@ -1067,41 +940,38 @@ void MyBasicGUI_PointDlg::ClickParamCoord(int id) //================================================================================= void MyBasicGUI_PointDlg::updateParamCoord(bool theIsUpdate) { - bool isParam = myParamCoord->checkedId() == PARAM_VALUE; - bool isLength = myParamCoord->checkedId() == LENGTH_VALUE; - - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100); - - const int id = getConstructorId(); - if (id == GEOM_POINT_EDGE) { - GroupOnCurve->TextLabel2->setVisible(isLength); - GroupOnCurve->PushButton2->setVisible(isLength); - GroupOnCurve->LineEdit2->setVisible(isLength); - GroupOnCurve->TextLabel3->setVisible(isParam || isLength); - GroupOnCurve->SpinBox_DX->setVisible(isParam || isLength); - if (isParam){ - initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1., 0.1, "parametric_precision"); -// GroupOnCurve->SpinBox_DX->setValue(0.5); - GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER")); + bool isParam = myParamCoord->checkedId() == PARAM_VALUE; + bool isLength = myParamCoord->checkedId() == LENGTH_VALUE; + + const int id = getConstructorId(); + if (id == GEOM_POINT_EDGE) { + GroupOnCurve->TextLabel2->setVisible(isLength); + GroupOnCurve->LineEdit2->setVisible(isLength); + GroupOnCurve->TextLabel3->setVisible(isParam || isLength); + GroupOnCurve->SpinBox_DX->setVisible(isParam || isLength); + if (isParam){ + GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER")); + double value = paramInputValue[PARAM_VALUE]; + GroupOnCurve->SpinBox_DX->setValue(0.5); + initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1.); + GroupOnCurve->SpinBox_DX->setValue(value); + } + else if (isLength){ + GroupOnCurve->TextLabel3->setText(tr("GEOM_LENGTH")); + double value = paramInputValue[LENGTH_VALUE]; + GroupOnCurve->SpinBox_DX->setValue(0.5); + initSpinBox(GroupOnCurve->SpinBox_DX, COORD_MIN, COORD_MAX); + GroupOnCurve->SpinBox_DX->setValue(value); + } } - else if (isLength){ - initSpinBox(GroupOnCurve->SpinBox_DX, COORD_MIN, COORD_MAX, step, "length_precision"); -// GroupOnCurve->SpinBox_DX->setValue(0); - GroupOnCurve->TextLabel3->setText(tr("GEOM_LENGTH")); + else if (id == GEOM_POINT_SURF) { + GroupOnSurface->TextLabel2->setShown(isParam); + GroupOnSurface->TextLabel3->setShown(isParam); + GroupOnSurface->SpinBox_DX->setShown(isParam); + GroupOnSurface->SpinBox_DY->setShown(isParam); } - } - else if (id == GEOM_POINT_SURF) { - GroupOnSurface->TextLabel2->setShown(isParam); - GroupOnSurface->TextLabel3->setShown(isParam); - GroupOnSurface->SpinBox_DX->setShown(isParam); - GroupOnSurface->SpinBox_DY->setShown(isParam); - } - - GroupXYZ->setShown(!isParam && !isLength); - - if (theIsUpdate) - QTimer::singleShot(50, this, SLOT(updateSize())); + + GroupXYZ->setShown(!isParam && !isLength); } //================================================================================= @@ -1110,9 +980,30 @@ void MyBasicGUI_PointDlg::updateParamCoord(bool theIsUpdate) //================================================================================= void MyBasicGUI_PointDlg::onBtnPopup(QAction* a) { - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); // close local contexts, if any - myNeedType = myActions[a] == SelectEdge ? TopAbs_EDGE : TopAbs_WIRE; - localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), myNeedType); + if (a == action_line1_edge) + { + GroupLineIntersection->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + GroupLineIntersection->LineEdit1->setFocus(); + GroupLineIntersection->PushButton2->setDown(false); + } + else if (a == action_line1_wire) + { + GroupLineIntersection->LineEdit1->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_WIRE) ); + GroupLineIntersection->LineEdit1->setFocus(); + GroupLineIntersection->PushButton2->setDown(false); + } + else if (a == action_line2_edge) + { + GroupLineIntersection->LineEdit2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_EDGE) ); + GroupLineIntersection->LineEdit2->setFocus(); + GroupLineIntersection->PushButton1->setDown(false); + } + else if (a == action_line2_wire) + { + GroupLineIntersection->LineEdit2->setProperty( "GeomWidgetType", QVariant::fromValue(TopAbs_WIRE) ); + GroupLineIntersection->LineEdit2->setFocus(); + GroupLineIntersection->PushButton1->setDown(false); + } } //================================================================================= @@ -1121,463 +1012,56 @@ void MyBasicGUI_PointDlg::onBtnPopup(QAction* a) //================================================================================= void MyBasicGUI_PointDlg::updateSize() { - qApp->processEvents(); - updateGeometry(); - resize(minimumSizeHint()); -} - - - - - -/* - HEXABLOCK -*/ - - - -void MyBasicGUI_PointDlg::setDocumentModel( HEXABLOCK::GUI::DocumentModel* m) -{ - _documentModel = m; -} - -void MyBasicGUI_PointDlg::setPatternDataSelectionModel( HEXABLOCK::GUI::PatternDataSelectionModel* s) -{ - _patternDataSelectionModel = s; -} - -void MyBasicGUI_PointDlg::_initInputWidget() -{ - -// QVBoxLayout* mainLayout = new QVBoxLayout( centralWidget() ); -// setLayout( mainLayout ); -// QHBoxLayout* up = new QHBoxLayout( centralWidget() ); -// QVBoxLayout* down = new QVBoxLayout( centralWidget() ); - -// QGroupBox *GroupBoxName = new QGroupBox(centralWidget()); -// GroupBoxName->setObjectName(QString::fromUtf8("GroupBoxName")); -// GroupBoxName->setTitle("Vertex"); -// QHBoxLayout *hboxLayout1 = new QHBoxLayout(GroupBoxName); -// hboxLayout1->setSpacing(6); -// hboxLayout1->setContentsMargins(9, 9, 9, 9); -// hboxLayout1->setObjectName(QString::fromUtf8("hboxLayout1")); -// QLabel *NameLabel = new QLabel(GroupBoxName); -// NameLabel->setObjectName(QString::fromUtf8("NameLabel")); -// NameLabel->setWordWrap(false); -// NameLabel->setText( "Name : " ); -// hboxLayout1->addWidget( NameLabel ); -// mainFrame()->_vertex_le = new QLineEdit( GroupBoxName ); -// mainFrame()->_vertex_le->setObjectName(QString::fromUtf8("mainFrame()->_vertex_le")); -// hboxLayout1->addWidget(mainFrame()->_vertex_le); -// -// layout()->addWidget( GroupBoxName ); - - - - QRegExp rx(""); - QValidator *validator = new QRegExpValidator(rx, this); - -// setProperty( "HexaWidgetType", QVariant::fromValue(HEXABLOCK::GUI::VERTEX_TREE) ); -// installEventFilter(this); - - mainFrame()->_vertex_le->setProperty( "HexaWidgetType", QVariant::fromValue(HEXABLOCK::GUI::VERTEX_TREE) ); - mainFrame()->_vertex_le->installEventFilter(this); - mainFrame()->_vertex_le->setValidator( validator ); + qApp->processEvents(); + updateGeometry(); + resize(minimumSizeHint()); } void MyBasicGUI_PointDlg::clear() { - mainFrame()->_vertex_le->clear(); - mainFrame()->_vertex_le->setProperty("QModelIndex", QVariant()); -} - -void MyBasicGUI_PointDlg::_initViewManager() -{ -// SalomeApp_Application* anApp = dynamic_cast( SUIT_Session::session()->activeApplication() ); -// _mgr = dynamic_cast( anApp->selectionMgr() ); -// _vtkVm = anApp->getViewManager( SVTK_Viewer::Type(), false ); -// _occVm = anApp->getViewManager( OCCViewer_Viewer::Type(), false ); -// SUIT_ViewManager* activeVm = anApp->activeViewManager(); -// onWindowActivated ( activeVm ); -} - - -// bool MyBasicGUI_PointDlg::_onSelectionChanged( const QItemSelection& sel, QLineEdit* le ) -// { -// QModelIndexList l = sel.indexes(); -// if ( l.count() == 0 ) return false; -// -// //type from selection (first) -// QModelIndex selected = l[0]; -// int selType = selected.data(HEXABLOCK::GUI::HEXA_TREE_ROLE).toInt(); -// -// //type of widget -// QVariant v = le->property("HexaWidgetType"); -// if ( !v.isValid() ) return false; -// HexaWidgetType wType = v.value(); -// -// // check selection compatibility between selection and widget -// if ( selType != wType ){ -// SUIT_MessageBox::information( 0, -// tr("HEXA_INFO"), -// tr("Bad selection type: please select a %1").arg( _strHexaWidgetType[wType]) ); -// return false; -// } -// -// //fill the lineEdit if selection is OK -// le->setText( selected.data().toString() );// name -// le->setProperty("QModelIndex", QVariant::fromValue(selected) ); -// return true; -// } - - - -void MyBasicGUI_PointDlg::onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel ) -{ - QString className = metaObject()->className(); -// QItemSelectionModel* selector = dynamic_cast(sender()); - - if (_patternDataSelectionModel) - _patternDataSelectionModel->highlightEltsWithAssocs(sel.indexes()); - - if ( _selectionMutex ) return; - if ( _currentObj != mainFrame()->_vertex_le ) return; - - bool selOk = false; - - QModelIndexList l = sel.indexes(); - if ( l.count() != 0 ){ - //type from selection (first) - QModelIndex selected = l[0]; - int selType = selected.data(HEXABLOCK::GUI::HEXA_TREE_ROLE).toInt(); - // check selection compatibility between selection and widget - if ( selType == HEXABLOCK::GUI::VERTEX_TREE ){ - mainFrame()->_vertex_le->setText( selected.data().toString() );// name - mainFrame()->_vertex_le->setProperty("QModelIndex", QVariant::fromValue(selected) ); - selOk = true; - } else { - _patternDataSelectionModel->clearSelection(); - SUIT_MessageBox::information( 0, - tr("HEXA_INFO"), - tr("Bad selection type: please select a %1").arg( "VERTEX" ) ); - } - } + modelUnregister(mainFrame()->_vertex_le); + + GroupRefPoint->LineEdit1->clear(); + GroupRefPoint->LineEdit1->setProperty("TopoDS_Shape", QVariant()); + GroupRefPoint->LineEdit1->setProperty("QModelIndex", QVariant()); + GroupRefPoint->LineEdit1->setProperty("HexaData", QVariant()); + + GroupOnCurve->LineEdit1->clear(); + GroupOnCurve->LineEdit1->setProperty("TopoDS_Shape", QVariant()); + GroupOnCurve->LineEdit1->setProperty("QModelIndex", QVariant()); + GroupOnCurve->LineEdit1->setProperty("HexaData", QVariant()); + + GroupOnCurve->LineEdit2->clear(); + GroupOnCurve->LineEdit2->setProperty("TopoDS_Shape", QVariant()); + GroupOnCurve->LineEdit2->setProperty("QModelIndex", QVariant()); + GroupOnCurve->LineEdit2->setProperty("HexaData", QVariant()); + + GroupLineIntersection->LineEdit1->clear(); + GroupLineIntersection->LineEdit1->setProperty("TopoDS_Shape", QVariant()); + GroupLineIntersection->LineEdit1->setProperty("QModelIndex", QVariant()); + GroupLineIntersection->LineEdit1->setProperty("HexaData", QVariant()); + + GroupLineIntersection->LineEdit2->clear(); + GroupLineIntersection->LineEdit2->setProperty("TopoDS_Shape", QVariant()); + GroupLineIntersection->LineEdit2->setProperty("QModelIndex", QVariant()); + GroupLineIntersection->LineEdit2->setProperty("HexaData", QVariant()); + + GroupOnSurface->LineEdit1->clear(); + GroupOnSurface->LineEdit1->setProperty("TopoDS_Shape", QVariant()); + GroupOnSurface->LineEdit1->setProperty("QModelIndex", QVariant()); + GroupOnSurface->LineEdit1->setProperty("HexaData", QVariant()); + + modelUnregister(this); } void MyBasicGUI_PointDlg::onWindowActivated(SUIT_ViewManager* vm) { -// SUIT_ViewWindow* v = vm->getActiveView(); - QString vmType = vm->getType(); - if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ){ - mainFrame()->_vertex_le->setFocus(); - } else if ( vmType == OCCViewer_Viewer::Type() ){ -// lines_lw->setFocus(); -// ConstructorsClicked(0); - ConstructorsClicked( getConstructorId() ); - } -} - -// ============================================================== _isLineOrListWidget -/* - * Return true is the widget is a line or a list - * false otherwise. - */ -bool MyBasicGUI_PointDlg::_isLineOrListWidget(QObject *widget) -{ - if (widget == NULL) return false; - - QLineEdit *lineEdit = dynamic_cast(widget); - QListWidget *listWidget = dynamic_cast(widget); - return (lineEdit != NULL) || (listWidget != NULL); - -}//_isLineOrListWidget - - - -// ============================================================== _highlightWidget -/* - * Highlight the given widget with the given color. - */ -void MyBasicGUI_PointDlg::_highlightWidget(QObject *obj, Qt::GlobalColor clr) -{ - if (!_isLineOrListWidget(obj)) return; - - QWidget *widget = dynamic_cast(obj); //sure it's not NULL (_isLineOrListWidget(obj)) - QPalette palette1 = widget->palette(); - palette1.setColor(widget->backgroundRole(), clr); - widget->setPalette(palette1); - -}//_highlightWidget - - -bool MyBasicGUI_PointDlg::eventFilter(QObject *obj, QEvent *event) -{ - -// if (event->type() == QEvent::FocusOut) -// _highlightWidget(obj, Qt::white); -// -// else - if ( (event->type() != QEvent::FocusIn) - or (obj != mainFrame()->_vertex_le) ){ - return MyGEOMBase_Skeleton::eventFilter(obj, event); - } -// _highlightWidget(obj, Qt::yellow); - - QVariant vxVariant; - QModelIndex vxIndex; - - _currentObj = obj; -// HEXABLOCKGUI::currentVtkView->raise(); - HEXABLOCKGUI::currentDocGView->setVertexSelection(); - - vxVariant = mainFrame()->_vertex_le->property("QModelIndex"); - if ( !vxVariant.isValid() ) { - return MyGEOMBase_Skeleton::eventFilter(obj, event); - } - vxIndex = vxVariant.value(); - _selectionMutex = true; - _patternDataSelectionModel->select( vxIndex, QItemSelectionModel::Clear ); - _patternDataSelectionModel->select( vxIndex, QItemSelectionModel::Select ); - _selectionMutex = false; - return false; -} - - -void MyBasicGUI_PointDlg::hideEvent ( QHideEvent * event ) -{ - disconnect( _patternDataSelectionModel, SIGNAL( selectionChanged ( const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); - - //Disconnection salome selection signals - if (HEXABLOCKGUI::selectionMgr() != NULL) - disconnect( HEXABLOCKGUI::selectionMgr() , SIGNAL(currentSelectionChanged()), - this, SLOT(onCurrentSelectionChanged()) ); - - //Disconnect vtk window activation signals - if (HEXABLOCKGUI::currentDocGView->getViewWindow() != NULL) - disconnect( HEXABLOCKGUI::currentDocGView->getViewWindow()->getViewManager(), - SIGNAL( activated(SUIT_ViewManager*) ), - this, SLOT( onWindowActivated(SUIT_ViewManager*) ) ); - - //Disconnect occ window activation signals - if (HEXABLOCKGUI::currentOccGView->getViewWindow() != NULL) - disconnect( HEXABLOCKGUI::currentOccGView->getViewWindow()->getViewManager(), - SIGNAL( activated(SUIT_ViewManager*) ), - this, SLOT( onWindowActivated(SUIT_ViewManager*) ) ); - - _documentModel->allowEdition(); - DeactivateActiveDialog(); - MyGEOMBase_Skeleton::hideEvent( event ); -} - -void MyBasicGUI_PointDlg::showEvent( QShowEvent * event ) -{ - _documentModel->disallowEdition(); - // _patternDataSelectionModel->clearSelection(); - connect( _patternDataSelectionModel, SIGNAL( selectionChanged ( const QItemSelection &, const QItemSelection &) ), - this, SLOT( onSelectionChanged(const QItemSelection &, const QItemSelection &) ) ); - - //Connect to salome selection signals - if (HEXABLOCKGUI::selectionMgr() != NULL) - { - connect( HEXABLOCKGUI::selectionMgr(), SIGNAL(currentSelectionChanged()), - this, SLOT(onCurrentSelectionChanged()), Qt::UniqueConnection ); - } - - //Connect to vtk window activation signals - if (HEXABLOCKGUI::currentDocGView->getViewWindow() != NULL) - { - connect( HEXABLOCKGUI::currentDocGView->getViewWindow()->getViewManager(), SIGNAL( activated(SUIT_ViewManager*) ), - this, SLOT( onWindowActivated(SUIT_ViewManager*) ), Qt::UniqueConnection ); - } - - //connect to occ window activation signals - if (HEXABLOCKGUI::currentOccGView->getViewWindow() != NULL) - { - connect( HEXABLOCKGUI::currentOccGView->getViewWindow()->getViewManager(), - SIGNAL( activated(SUIT_ViewManager*) ), - this, SLOT( onWindowActivated(SUIT_ViewManager*) ), Qt::UniqueConnection ); - } - -// connect( _mgr, SIGNAL(currentSelectionChanged()), this, SLOT(onCurrentSelectionChanged()) ); -// connect( _vtkVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) ); -// connect( _occVm, SIGNAL( activated(SUIT_ViewManager*) ), this, SLOT( onWindowActivated(SUIT_ViewManager*) ) ); - - - SalomeApp_Application* app = (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ); - - if ( !myGeomGUI && app ) - myGeomGUI = dynamic_cast( app->module( "Geometry" ) ); - - - ActivateThisDialog(); - MyGEOMBase_Skeleton::showEvent ( event ); -} - - - - -bool MyBasicGUI_PointDlg::onAccept( const bool publish, const bool useTransaction ) -{ - - GEOM::GEOM_Object_ptr newVertex; - QString newVertexEntry; - QString newVertexName; - QString newVertexBrep; - gp_Pnt aPnt; - - - - SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); - if ( !appStudy ) return false; - _PTR(Study) aStudy = appStudy->studyDS(); - - bool aLocked = (_PTR(AttributeStudyProperties) (aStudy->GetProperties()))->IsLocked(); - if ( aLocked ) { - SUIT_MessageBox::warning ( (QWidget*)SUIT_Session::session()->activeApplication()->desktop(), - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_STUDY_LOCKED"), - QObject::tr("BUT_OK") ); - return false; - } - - QString msg; - if ( !isValid( msg ) ) { - showError( msg ); - return false; - } - - erasePreview( false ); - - bool result = false; - - try { - if ( ( !publish && !useTransaction ) || openCommand() ) { - SUIT_OverrideCursor wc; - SUIT_Session::session()->activeApplication()->putInfo( "" ); - ObjectList objects; - if ( !execute( objects ) || !getOperation()->IsDone() ) { - wc.suspend(); - abortCommand(); - showError(); - } - else { - addSubshapesToStudy(); // add Subshapes if local selection - const int nbObjs = objects.size(); - QStringList anEntryList; - int aNumber = 1; - for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) { - GEOM::GEOM_Object_var obj=*it; - if ( publish ) { - QString aName = getNewObjectName(); - 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() ); - - newVertex = obj; - newVertexEntry = anEntryList[0]; - TopoDS_Shape aShape; - GEOMBase::GetShape( newVertex, aShape ); - if ( !aShape.IsNull() ){ - newVertexName = GEOMBase::GetName( newVertex ); - newVertexBrep = HEXABLOCK::GUI::shape2string( aShape ).c_str(); - aPnt = BRep_Tool::Pnt(TopoDS::Vertex(aShape)); - } - - // updateView=false - display( obj, false ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - obj->UnRegister(); -#endif - } - else { - // asv : fix of PAL6454. If publish==false, then the original shape - // was modified, and need to be re-cached in GEOM_Client before redisplay -// clearShapeBuffer( obj ); - // withChildren=true, updateView=false - redisplay( obj, true, false ); - } - } - - if ( nbObjs ) { - commitCommand(); - updateObjBrowser(); - if( SUIT_Application* anApp = SUIT_Session::session()->activeApplication() ) { - if( LightApp_Application* aLightApp = dynamic_cast( anApp ) ){ - aLightApp->browseObjects( anEntryList, isApplyAndClose(), isOptimizedBrowsing() ); - } - anApp->putInfo( QObject::tr("GEOM_PRP_DONE") ); - } - result = true; - } - else - abortCommand(); - } - } - } - catch( const SALOME::SALOME_Exception& e ) { - SalomeApp_Tools::QtCatchCorbaException( e ); - abortCommand(); - } - - updateViewer(); - - if (result){ - SUIT_OverrideCursor wc; - if ( !_documentModel ) return false; - if ( !_patternDataSelectionModel ) return false; - const HEXABLOCK::GUI::PatternDataModel* patternDataModel = dynamic_cast( _patternDataSelectionModel->model() ); - if ( !patternDataModel ) return false; - _currentObj = NULL; - - QVariant v = mainFrame()->_vertex_le->property("QModelIndex"); - if ( !v.isValid() ) return false; - QModelIndex iVertex = patternDataModel->mapToSource( v.value() ); - - if ( iVertex.isValid() ){ - HEXABLOCK::GUI::DocumentModel::GeomObj aPoint; - aPoint.shapeName = newVertexName; - aPoint.subid = QString::number(-1); - aPoint.brep = newVertexBrep; - _documentModel->setGeomObjName(newVertexEntry, newVertexName); - _documentModel->setGeomObjEntry(newVertexName, newVertexEntry); -// _documentModel->addAssociation( iVertex, aPoint ); - _documentModel->setVertexAssociation(iVertex, aPnt.X(), aPnt.Y(), aPnt.Z()); - // to select/highlight result -// _patternDataSelectionModel->clearSelection(); -// mainFrame()->_vertex_le->setFocus(); - -// globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); -// localSelection(HEXABLOCKGUI::currentOccGView->getViewWindow(), TopAbs_VERTEX); - _patternDataSelectionModel->select( patternDataModel->mapFromSource(iVertex), QItemSelectionModel::Clear ); - _patternDataSelectionModel->select( patternDataModel->mapFromSource(iVertex), QItemSelectionModel::Select ); - _currentObj = NULL; - result = true; - } else { - SUIT_MessageBox::critical( this, tr( "ERR_ERROR" ), tr( "CANNOT MAKE VERTEX ASSOCIATION" ) ); - return false; + QString vmType = vm->getType(); + if ( (vmType == SVTK_Viewer::Type()) || (vmType == VTKViewer_Viewer::Type()) ){ + mainFrame()->_vertex_le->setFocus(); + } else if ( vmType == OCCViewer_Viewer::Type() ){ + // ... } - } - - - return result; } - diff --git a/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx b/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx index edd76b5..fd7fc3e 100755 --- a/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx +++ b/src/HEXABLOCKGUI/MyBasicGUI_PointDlg.hxx @@ -25,7 +25,6 @@ #include "MyGEOMBase_Skeleton.hxx" -#include "GEOM_GenericObjPtr.h" #include class DlgRef_2Sel1Spin; @@ -47,9 +46,6 @@ class gp_Pnt; #include #include #include -// #include - - #include "SVTK_Selection.h" #include @@ -68,39 +64,23 @@ namespace HEXABLOCK // purpose : //================================================================================= typedef class MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton -{ +{ Q_OBJECT public: - MyBasicGUI_PointDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 ); + MyBasicGUI_PointDlg( QWidget* = 0, Qt::WindowFlags = 0 ); ~MyBasicGUI_PointDlg(); bool acceptMouseEvent() const { return ( getConstructorId() == 0 ); } - void OnPointSelected( const gp_Pnt& ); // called by BasicGUI::OnMousePress() - -protected: - // redefined from GEOMBase_Helper - - virtual GEOM::GEOM_IOperations_ptr createOperation(); - virtual bool isValid( QString& ); - virtual bool execute( ObjectList& ); - virtual void addSubshapesToStudy(); + void OnPointSelected( const gp_Pnt& ); private: - void Init(); - void enterEvent( QEvent* ); double getParameter() const; double getUParameter() const; double getVParameter() const; void updateParamCoord(bool theIsUpdate); private: - GEOM::GeomObjPtr myEdge; - GEOM::GeomObjPtr myFace; - GEOM::GeomObjPtr myRefPoint; - GEOM::GeomObjPtr myLine1; - GEOM::GeomObjPtr myLine2; - bool myBusy; DlgRef_3Spin* GroupXYZ; @@ -108,71 +88,63 @@ private: DlgRef_2Sel1Spin* GroupOnCurve; DlgRef_2Sel* GroupLineIntersection; DlgRef_1Sel2Spin* GroupOnSurface; - + QGroupBox* myCoordGrp; QLineEdit* myX; QLineEdit* myY; QLineEdit* myZ; - + QGroupBox* myParamGroup; QButtonGroup* myParamCoord; QMenu* myBtnPopup; - QMap myActions; + QMenu* myBtnPopup2; + QAction* action_line1_edge; + QAction* action_line1_wire; + QAction* action_line2_edge; + QAction* action_line2_wire; - TopAbs_ShapeEnum myNeedType; - - -public slots: - virtual void onHelpRequested(); - private slots: - void ClickOnOk(); - bool ClickOnApply(); - void ActivateThisDialog(); - void DeactivateActiveDialog(); - void SelectionIntoArgument(); - void SetEditCurrentArgument(); void ConstructorsClicked( int ); - void ValueChangedInSpinBox( double ); void SetDoubleSpinBoxStep( double ); void ClickParamCoord( int ); - void CheckBoxClicked( int ); void onBtnPopup( QAction* ); void updateSize(); + void onRefPointChanged(const QString& pointName); + void onStartPointSelected(const QString& pointName); + void onParamValueChanged(double newValue); + void onXCoordChanged(double newValue); + void onYCoordChanged(double newValue); + void onZCoordChanged(double newValue); + void onUpdateResults(const QString& data); // HEXABLOCK public: - void setDocumentModel( HEXABLOCK::GUI::DocumentModel* m ); - void setPatternDataSelectionModel( HEXABLOCK::GUI::PatternDataSelectionModel* s ); - bool onAccept( const bool publish = true, const bool useTransaction = true ); void clear(); + TopoDS_Vertex computeGeomVertex(bool preview=false); + TopoDS_Vertex computeGeomPointXYZ(); + TopoDS_Vertex computeGeomPointRef(); + TopoDS_Vertex computeGeomPointEdge(); + TopoDS_Vertex computeGeomPointInt(); + TopoDS_Vertex computeGeomPointSurf(); protected: - virtual bool eventFilter( QObject *obj, QEvent *event ); - virtual void hideEvent ( QHideEvent * event ); virtual void showEvent ( QShowEvent * event ); - void _initInputWidget(); - void _initViewManager(); - void _highlightWidget(QObject* obj, Qt::GlobalColor clr); - bool _isLineOrListWidget(QObject*); + + virtual bool apply(QModelIndex& result); + virtual void _initInputWidget( Mode editmode ); + void updateInputs(const int constructorId); + + TopoDS_Vertex currentVertex; + QMap paramInputValue; + QMap coordsInputValue; protected slots: - void onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel ); void onWindowActivated( SUIT_ViewManager* vm ); void updateHelpFileName(); - - -private: - HEXABLOCK::GUI::DocumentModel* _documentModel; - HEXABLOCK::GUI::PatternDataSelectionModel* _patternDataSelectionModel; -// QLineEdit* _vertex_le; - - QObject* _currentObj; - bool _selectionMutex; - + virtual void onSelectionChanged( const QItemSelection& sel, const QItemSelection& unsel ); } VertexAssocDialog; diff --git a/src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel2Spin_QTD.ui b/src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel2Spin_QTD.ui index b390119..3684983 100755 --- a/src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel2Spin_QTD.ui +++ b/src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel2Spin_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 156 - 101 + 219 + 124 @@ -103,19 +103,6 @@ - - - - - 0 - 0 - - - - - - - @@ -131,7 +118,6 @@ - PushButton1 LineEdit1 SpinBox_DX SpinBox_DY diff --git a/src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel3Spin_QTD.ui b/src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel3Spin_QTD.ui index cc07af0..d676cc1 100755 --- a/src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel3Spin_QTD.ui +++ b/src/HEXABLOCKGUI/MyDlgRef/DlgRef_1Sel3Spin_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 156 - 128 + 219 + 158 @@ -129,19 +129,6 @@ - - - - - 0 - 0 - - - - - - - @@ -157,7 +144,6 @@ - PushButton1 LineEdit1 SpinBox_DX SpinBox_DY diff --git a/src/HEXABLOCKGUI/MyDlgRef/DlgRef_2Sel1Spin_QTD.ui b/src/HEXABLOCKGUI/MyDlgRef/DlgRef_2Sel1Spin_QTD.ui index 3835c2e..bcaccca 100755 --- a/src/HEXABLOCKGUI/MyDlgRef/DlgRef_2Sel1Spin_QTD.ui +++ b/src/HEXABLOCKGUI/MyDlgRef/DlgRef_2Sel1Spin_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 156 - 105 + 219 + 124 @@ -80,19 +80,6 @@ - - - - - 0 - 0 - - - - - - - @@ -112,19 +99,6 @@ - - - - - 0 - 0 - - - - - - - @@ -143,9 +117,7 @@ - PushButton1 LineEdit1 - PushButton2 LineEdit2 diff --git a/src/HEXABLOCKGUI/MyDlgRef/DlgRef_Skeleton_QTD.ui b/src/HEXABLOCKGUI/MyDlgRef/DlgRef_Skeleton_QTD.ui index 856d4b5..4254a82 100755 --- a/src/HEXABLOCKGUI/MyDlgRef/DlgRef_Skeleton_QTD.ui +++ b/src/HEXABLOCKGUI/MyDlgRef/DlgRef_Skeleton_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 225 - 267 + 345 + 538 @@ -33,8 +33,8 @@ 0 0 - 201 - 307 + 325 + 518 @@ -44,13 +44,6 @@ Vertex of the model - - - - Name - - - @@ -120,40 +113,6 @@ - - - - - 0 - 0 - - - - - - - - 6 - - - 9 - - - - - - - - false - - - - - - - - - @@ -214,85 +173,6 @@ - - - - - 0 - 0 - - - - - 5 - 0 - - - - - - - - 6 - - - 9 - - - - - - 0 - 0 - - - - &Apply - - - - - - - - 0 - 0 - - - - &Close - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 0 - - - - &Help - - - - - - @@ -304,7 +184,6 @@ RadioButton3 RadioButton4 RadioButton5 - ResultName diff --git a/src/HEXABLOCKGUI/MyGEOMBase_Helper.cxx b/src/HEXABLOCKGUI/MyGEOMBase_Helper.cxx deleted file mode 100644 index 4398b9d..0000000 --- a/src/HEXABLOCKGUI/MyGEOMBase_Helper.cxx +++ /dev/null @@ -1,1429 +0,0 @@ -// Copyright (C) 2009-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 -// - -#include "MyGEOMBase_Helper.hxx" -#include "GEOMBase.h" -#include "GEOM_Operation.h" -#include "HEXABLOCKGUI.hxx" - -#include - -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include - -#include - -#include -#include -#include - -#include -#include -#include -#include - -//To disable automatic genericobj management, the following line should be commented. -//Otherwise, it should be uncommented. Refer to KERNEL_SRC/src/SALOMEDSImpl/SALOMEDSImpl_AttributeIOR.cxx -#define WITHGENERICOBJ - -//================================================================ -// Function : getActiveView -// Purpose : Get active view window, returns 0 if no open study frame -//================================================================ -static SUIT_ViewWindow* getActiveView() -{ - SUIT_Study* activeStudy = SUIT_Session::session()->activeApplication()->activeStudy(); - if ( activeStudy ) - return SUIT_Session::session()->activeApplication()->desktop()->activeWindow(); - - return 0; -} - - -//================================================================ -// Function : getGeomEngine -// Purpose : Static method -//================================================================ -GEOM::GEOM_Gen_ptr MyGEOMBase_Helper::getGeomEngine() -{ - return GeometryGUI::GetGeomGen(); -} - -//================================================================ -// Function : MyGEOMBase_Helper -// Purpose : -//================================================================ -MyGEOMBase_Helper::MyGEOMBase_Helper( SUIT_Desktop* desktop ) - : myDesktop( desktop ), myViewWindow( 0 ), myDisplayer( 0 ), myCommand( 0 ), isPreview( false ), - myIsApplyAndClose( false ), myIsOptimizedBrowsing( false ) -{ -} - -//================================================================ -// Function : ~MyGEOMBase_Helper -// Purpose : -//================================================================ -MyGEOMBase_Helper::~MyGEOMBase_Helper() -{ - //rnv: Fix for the "IPAL21922 : WinTC5.1.4: incorrect quit salome" - if ( !SUIT_Session::session()->activeApplication() || !SUIT_Session::session()->activeApplication()->desktop() ) - return; - - if ( myPreview.size() ) - erasePreview(); - if ( hasCommand() ) - abortCommand(); -// SalomeApp_Application* app = (SalomeApp_Application*)(SUIT_Session::session()->activeApplication()); -// if (app) { -// GeometryGUI* aGeomGUI = dynamic_cast( app->module( "Geometry" ) ); -// if(aGeomGUI) -// globalSelection(aGeomGUI->getLocalSelectionMode() , true ); -// } - - if (myDisplayer) - delete myDisplayer; - if ( !CORBA::is_nil( myOperation ) ) - myOperation->UnRegister(); -} - -//================================================================ -// Function : display -// Purpose : -//================================================================ -void MyGEOMBase_Helper::display( const ObjectList& objList, const bool updateView ) -{ - ObjectList::const_iterator it; - for ( it = objList.begin(); it != objList.end(); it++ ) { - display( *it, false ); - } - if ( !objList.empty() && updateView ) - getDisplayer()->UpdateViewer(); -} - -//================================================================ -// Function : display -// Purpose : Display object. -// Important : Object must be already in study -//================================================================ -void MyGEOMBase_Helper::display( GEOM::GEOM_Object_ptr object, const bool updateView ) -{ - // Unset color of shape ( this color may be set during preview displaying ) - // Default color will be used - getDisplayer()->UnsetColor(); - getDisplayer()->UnsetWidth(); - - // Enable activisation of selection - getDisplayer()->SetToActivate( true ); - - // Display object - getDisplayer()->Display( object, updateView ); -} - -//================================================================ -// Function : erase -// Purpose : -//================================================================ -void MyGEOMBase_Helper::erase( const ObjectList& objList, const bool updateView ) -{ - ObjectList::const_iterator it = objList.begin(); - for ( ; it != objList.end(); it++ ) { - erase( *it, false ); - } - if ( !objList.empty() && updateView ) - getDisplayer()->UpdateViewer(); -} - -//================================================================ -// Function : erase -// Purpose : -//================================================================ -void MyGEOMBase_Helper::erase( GEOM::GEOM_Object_ptr object, const bool updateView ) -{ - if ( !object->_is_nil() ) { - QString entry = getEntry( object ); - getDisplayer()->Erase( new SALOME_InteractiveObject( - entry.toLatin1().constData(), - "GEOM", strdup( GEOMBase::GetName( object ).toLatin1().constData() ) ), true, updateView ); - } -} - -//================================================================ -// Function : redisplay -// Purpose : -//================================================================ -void MyGEOMBase_Helper::redisplay( const ObjectList& objList, - const bool withChildren, - const bool updateView ) -{ - ObjectList::const_iterator it = objList.begin(); - for ( ; it != objList.end(); it++ ) { - redisplay( *it, withChildren, false ); - } - if ( !objList.empty() && updateView ) - getDisplayer()->UpdateViewer(); -} - -//================================================================ -// Function : redisplay -// Purpose : -//================================================================ -void MyGEOMBase_Helper::redisplay( GEOM::GEOM_Object_ptr object, - const bool withChildren, - const bool updateView ) -{ - if ( !object->_is_nil() ) { - // Unset color of shape ( this color may be set during preview displaying ) - // Default color will be used - getDisplayer()->UnsetColor(); - getDisplayer()->UnsetWidth(); - - // Enable activisation of selection - getDisplayer()->SetToActivate( true ); - - QString entry = getEntry( object ); - getDisplayer()->Redisplay(new SALOME_InteractiveObject - (entry.toLatin1().constData(), "GEOM", strdup(GEOMBase::GetName(object).toLatin1().constData())), false); - } - - if ( withChildren ) { - SalomeApp_Study* aDoc = getStudy(); - if ( aDoc && aDoc->studyDS() ) { - _PTR(Study) aStudy = aDoc->studyDS(); - CORBA::String_var objStr = SalomeApp_Application::orb()->object_to_string(object); - _PTR(SObject) aSObj (aStudy->FindObjectIOR(std::string(objStr.in()))); - if ( aSObj ) { - _PTR(ChildIterator) anIt ( aStudy->NewChildIterator( aSObj ) ); - for ( anIt->InitEx( true ); anIt->More(); anIt->Next() ) { - GEOM::GEOM_Object_var aChild = GEOM::GEOM_Object::_narrow - (GeometryGUI::ClientSObjectToObject(anIt->Value())); - if ( !CORBA::is_nil( aChild ) ) { - if ( !aChild->_is_nil() ) { - QString entry = getEntry( aChild ); - getDisplayer()->Redisplay( new SALOME_InteractiveObject( - entry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( aChild ).toLatin1().constData() ) ), false ); - } - } - } - } - } - } - - if ( updateView ) - getDisplayer()->UpdateViewer(); -} - -//================================================================ -// Function : displayPreview -// Purpose : Method for displaying preview based on execute() results -//================================================================ -void MyGEOMBase_Helper::displayPreview( const bool display, - const bool activate, - const bool update, - const bool toRemoveFromEngine, - const double lineWidth, - const int displayMode, - const int color ) -{ - if(!display) { - erasePreview( update ); - return; - } - - isPreview = true; - QString msg; - if ( !isValid( msg ) ) - { - erasePreview( update ); - isPreview = false; - return; - } - - erasePreview( false ); - - try { - SUIT_OverrideCursor wc; - ObjectList objects; - if ( !execute( objects ) || !getOperation()->IsDone() ) { - wc.suspend(); - } - else { - for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) - { - GEOM::GEOM_Object_var obj=*it; - displayPreview( obj, true, activate, false, lineWidth, displayMode, color ); - if ( toRemoveFromEngine ) - obj->UnRegister(); - } - } - } - catch( const SALOME::SALOME_Exception& e ) { - SalomeApp_Tools::QtCatchCorbaException( e ); - } - - isPreview = false; - - if ( update ) - updateViewer(); -} - -//================================================================ -// Function : displayPreview -// Purpose : Method for displaying preview of resulting shape -//================================================================ -void MyGEOMBase_Helper::displayPreview( GEOM::GEOM_Object_ptr object, - const bool append, - const bool activate, - const bool update, - const double lineWidth, - const int displayMode, - const int color ) -{ - // Set color for preview shape - getDisplayer()->SetColor( color == -1 ? Quantity_NOC_VIOLET : color ); - - // set width of displayed shape - getDisplayer()->SetWidth( lineWidth ); - - // set display mode of displayed shape - int aPrevDispMode = getDisplayer()->SetDisplayMode( displayMode ); - - // Disable activation of selection - getDisplayer()->SetToActivate( activate ); - - // Make a reference to GEOM_Object - CORBA::String_var objStr = SalomeApp_Application::orb()->object_to_string( object ); - getDisplayer()->SetName( objStr.in() ); - - // Build prs - SALOME_Prs* aPrs = getDisplayer()->BuildPrs( object ); - if ( aPrs == 0 || aPrs->IsNull() ) - return; - - // Display prs - displayPreview( aPrs, append, update ); - - getDisplayer()->UnsetName(); - getDisplayer()->UnsetColor(); - getDisplayer()->SetDisplayMode( aPrevDispMode ); - - // Enable activation of displayed objects - getDisplayer()->SetToActivate( true ); -} - -//================================================================ -// Function : displayPreview -// Purpose : Method for displaying arbitrary preview objects (not limited to shapes) -//================================================================ -void MyGEOMBase_Helper::displayPreview( const SALOME_Prs* prs, - const bool append, - const bool update ) -{ - if ( !append ) - erasePreview( false ); - - // remember current view frame to make correct erase preview later - myViewWindow = getActiveView(); - - if ( myViewWindow == 0 ) - return; - - // Display prs - SUIT_ViewManager* aViewManager = myViewWindow->getViewManager(); - if ( aViewManager->getType() == OCCViewer_Viewer::Type() || - aViewManager->getType() == SVTK_Viewer::Type() ) - { - SUIT_ViewModel* aViewModel = aViewManager->getViewModel(); - SALOME_View* aView = dynamic_cast(aViewModel); - if (aView) - aView->Display( prs ); - } - - // Add prs to the preview list - myPreview.push_back( (SALOME_Prs*)prs ); - - // Update viewer - if ( update ) - getDisplayer()->UpdateViewer(); -} - -//================================================================ -// Function : erasePreview -// Purpose : -//================================================================ -void MyGEOMBase_Helper::erasePreview( const bool update ) -{ - // check view frame where the preview was displayed - bool vfOK = checkViewWindow() && myViewWindow; - // Iterate through presentations and delete them - for ( PrsList::iterator anIter = myPreview.begin(); anIter != myPreview.end(); ++anIter ) { - if ( vfOK ) - { - SUIT_ViewManager* aViewManager = myViewWindow->getViewManager(); - if ( aViewManager->getType() == OCCViewer_Viewer::Type() || - aViewManager->getType() == SVTK_Viewer::Type() ) - { - SUIT_ViewModel* aViewModel = aViewManager->getViewModel(); - SALOME_View* aView = dynamic_cast(aViewModel); - if (aView) - aView->Erase( *anIter, true ); - } - } - delete *anIter; - } - myPreview.clear(); - - // Update viewer - if ( update ) - updateViewer(); -} - -//================================================================ -// Function : localSelection -// Purpose : Activate selection of objects of a given type -// IMPORTANT : Works after localSelection( ... ) method call only -//================================================================ -void MyGEOMBase_Helper::activate( const int theType ) -{ - if (!getStudy()) return; - _PTR(Study) aStudy = getStudy()->studyDS(); - _PTR(SComponent) aGeom ( aStudy->FindComponent( "GEOM" ) ); - if ( !aGeom ) - return; - - SALOME_ListIO aList; - _PTR(ChildIterator) anIter ( aStudy->NewChildIterator( aGeom ) ); - for ( ; anIter->More(); anIter->Next() ) - { - _PTR(SObject) aSO ( anIter->Value() ); - if ( aSO ) - { - _PTR(SObject) aRefSO; - if ( !aSO->ReferencedObject( aRefSO ) ) - { - GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object::_narrow - (GeometryGUI::ClientSObjectToObject(aSO)); - if ( !anObj->_is_nil() && anObj->GetType() == theType ) - aList.Append( new SALOME_InteractiveObject( aSO->GetID().c_str(), "GEOM", aSO->GetName().c_str()) ); - } - } - } - - getDisplayer()->LocalSelection( aList, 0 ); -} - -//================================================================ -// Function : localSelection -// Purpose : Activate selection of subshapes in accordance with mode -// theMode is from TopAbs_ShapeEnum -//================================================================ -void MyGEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMode ) -{ - SALOME_ListIO aListOfIO; - - ObjectList::const_iterator anIter = theObjs.begin(); - for ( ; anIter != theObjs.end(); ++anIter ) - { - GEOM::GEOM_Object_ptr anObj = *anIter; - if ( anObj->_is_nil() ) - continue; - QString anEntry = getEntry( anObj ); - if ( anEntry != "" ) - aListOfIO.Append( new SALOME_InteractiveObject( - anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) ); - } - - getDisplayer()->LocalSelection( aListOfIO, theMode ); -} - -//================================================================ -// Function : localSelection -// Purpose : Activate selection of subshapes in accordance with mode -// theMode is from TopAbs_ShapeEnum -//================================================================ -void MyGEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const int mode ) -{ - // If object is null local selection for all objects is activated - if ( obj->_is_nil() ) { - getDisplayer()->LocalSelection( Handle(SALOME_InteractiveObject)(), mode ); - return; - } - - ObjectList objList; - objList.push_back( obj ); - localSelection( objList, mode ); -} - -//================================================================ -// Beta version -// Function : localSelection -// Purpose : Activate selection of subshapes in accordance with mode -// theMode is from TopAbs_ShapeEnum -//================================================================ -void MyGEOMBase_Helper::localSelection(SUIT_ViewWindow *view, const int theMode ) -{ - SUIT_Session* session = SUIT_Session::session(); - SalomeApp_Application* app = dynamic_cast( session->activeApplication() ); - if ( app == NULL || view == NULL ) return; - - LightApp_SelectionMgr* sm = app->selectionMgr(); - - // remove all filters from selection - sm->clearFilters(); - - SALOME_View* vf = dynamic_cast(view->getViewManager()->getViewModel()); - if (vf == NULL) return; - - SALOME_Prs* prs = vf->CreatePrs( NULL ); - vf->LocalSelection( prs, theMode ); - delete prs; // delete presentation because displayer is its owner -} - - - -//================================================================ -// Beta version -// Function : globalSelection2 -// Purpose : Activate selection of subshapes. Set selection filters -// in accordance with mode. theMode is from GEOMImpl_Types -// mode = GEOM_ALLOBJECTS -//================================================================ -void MyGEOMBase_Helper::globalSelection(SUIT_ViewWindow *view, const bool update ) -{ - SUIT_Session* session = SUIT_Session::session(); - SalomeApp_Application* app = dynamic_cast( session->activeApplication() ); - if ( app == NULL || view == NULL ) return; - - SALOME_View* vf = dynamic_cast(view->getViewManager()->getViewModel()); - if ( vf == NULL ) return; - - // Close local context - vf->GlobalSelection( update ); - - // Set selection filters in accordance with current mode - LightApp_SelectionMgr* sm = app->selectionMgr(); - if ( !sm ) - return; - - - //@ aSel->ClearIndex(); - - sm->clearFilters(); - - // Remove filters from AIS_InteractiveContext - Handle(AIS_InteractiveContext) ic; - SOCC_Viewer* viewer = dynamic_cast( vf ); - if ( viewer ) - { - ic = viewer->getAISContext(); - if ( !ic.IsNull() ) - ic->RemoveFilters(); - } -} - - -//================================================================ -// Function : globalSelection -// Purpose : Activate selection of subshapes. Set selection filters -// in accordance with mode. theMode is from GEOMImpl_Types -//================================================================ -void MyGEOMBase_Helper::globalSelection( const int theMode, const bool update ) -{ - getDisplayer()->GlobalSelection( theMode, update ); -} - -//================================================================ -// Function : globalSelection -// Purpose : Activate selection of subshapes. Set selection filters -// in accordance with mode. theMode is from GEOMImpl_Types -//================================================================ -void MyGEOMBase_Helper::globalSelection( const TColStd_MapOfInteger& theModes, - const bool update ) -{ - getDisplayer()->GlobalSelection( theModes, update ); -} - -//================================================================ -// Function : globalSelection -// Purpose : Activate selection of subshapes. Set selection filters -// in accordance with mode. theMode is from GEOMImpl_Types -//================================================================ -void MyGEOMBase_Helper::globalSelection( const TColStd_MapOfInteger& theModes, - const QList& subShapes, - const bool update ) -{ - getDisplayer()->GlobalSelection( theModes, update, &subShapes ); -} - -//================================================================ -// Function : addInStudy -// Purpose : Add object in study -//================================================================ -QString MyGEOMBase_Helper::addInStudy( GEOM::GEOM_Object_ptr theObj, const char* theName ) -{ - if ( !hasCommand() ) - return QString(); - - _PTR(Study) aStudy = getStudy()->studyDS(); - if ( !aStudy || theObj->_is_nil() ) - return QString(); - - SALOMEDS::Study_var aStudyDS = GeometryGUI::ClientStudyToStudy(aStudy); - - GEOM::GEOM_Object_ptr aFatherObj = getFather( theObj ); - - SALOMEDS::SObject_var aSO = - getGeomEngine()->AddInStudy(aStudyDS, theObj, theName, aFatherObj); - - QString anEntry; - if ( !aSO->_is_nil() ) - anEntry = aSO->GetID(); - - // Each dialog is responsible for this method implementation, - // default implementation does nothing - restoreSubShapes(aStudyDS, aSO); - aSO->UnRegister(); - - return anEntry; -} - -//================================================================ -// Function : restoreSubShapes -// Purpose : restore tree of argument's sub-shapes under the resulting shape -//================================================================ -void MyGEOMBase_Helper::restoreSubShapes (SALOMEDS::Study_ptr /*theStudy*/, - SALOMEDS::SObject_ptr /*theSObject*/) -{ - // do nothing by default - - // example of implementation in particular dialog: - // GEOM::ListOfGO anArgs; - // anArgs.length(0); // empty list means that all arguments should be restored - // getGeomEngine()->RestoreSubShapesSO(theStudy, theSObject, anArgs, - // /*theFindMethod=*/GEOM::FSM_GetInPlace, - // /*theInheritFirstArg=*/false); -} - -//================================================================ -// Function : updateObjBrowser -// Purpose : Update object browser -//================================================================ -void MyGEOMBase_Helper::updateObjBrowser() const -{ - SalomeApp_Application* app = dynamic_cast(SUIT_Session::session()->activeApplication()); - if (app) { - CAM_Module* module = app->module( "Geometry" ); - SalomeApp_Module* appMod = dynamic_cast( module ); - if ( appMod ) { - appMod->updateObjBrowser( true ); - } - } -} - -//================================================================ -// Function : updateViewer -// Purpose : Update active 3D view -//================================================================ -void MyGEOMBase_Helper::updateViewer() -{ - getDisplayer()->UpdateViewer(); -} - -//================================================================ -// Function : getStudyId -// Purpose : Get study Id -//================================================================ -int MyGEOMBase_Helper::getStudyId() const -{ - int anId = -1; - if ( getStudy() ) - anId = getStudy()->id(); - return anId; -} - -//================================================================ -// Function : getStudy -// Purpose : Returns the active study. It is recommended to use -// this method instead of direct desktop->getActiveStudy() calls -//================================================================ -SalomeApp_Study* MyGEOMBase_Helper::getStudy() const -{ - SUIT_Desktop* aDesktop = getDesktop(); - if (!aDesktop) - return 0; - - QList anAppList = SUIT_Session::session()->applications(); - - SUIT_Application* anApp = 0; - QListIterator it( anAppList ); - while ( it.hasNext() ) - { - anApp = it.next(); - if ( anApp && anApp->desktop() == aDesktop ) - break; - } - - return dynamic_cast(anApp->activeStudy()); -} - -//================================================================ -// Function : getEntry -// Purpose : -//================================================================ -QString MyGEOMBase_Helper::getEntry( GEOM::GEOM_Object_ptr object ) const -{ - SalomeApp_Study* study = getStudy(); - if ( study ) { - QString objIOR = GEOMBase::GetIORFromObject( object ); - if ( objIOR != "" ) { - _PTR(SObject) SO ( study->studyDS()->FindObjectIOR( objIOR.toLatin1().constData() ) ); - if ( SO ) - return QString::fromStdString(SO->GetID()); - } - } - return ""; -} - -//================================================================ -// Function : getDisplayer -// Purpose : -//================================================================ -GEOM_Displayer* MyGEOMBase_Helper::getDisplayer() -{ - if ( !myDisplayer ) - myDisplayer = new GEOM_Displayer( getStudy() ); - return myDisplayer; -} - -//================================================================ -// Function : clearShapeBuffer -// Purpose : -//================================================================ -void MyGEOMBase_Helper::clearShapeBuffer( GEOM::GEOM_Object_ptr theObj ) -{ - if ( CORBA::is_nil( theObj ) ) - return; - - CORBA::String_var IOR = SalomeApp_Application::orb()->object_to_string( theObj ); - TCollection_AsciiString asciiIOR( (char *)IOR.in() ); - GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR ); - - if ( !getStudy() || !getStudy()->studyDS() ) - return; - - _PTR(Study) aStudy = getStudy()->studyDS(); - _PTR(SObject) aSObj ( aStudy->FindObjectIOR( std::string( IOR ) ) ); - if ( !aSObj ) - return; - - _PTR(ChildIterator) anIt ( aStudy->NewChildIterator( aSObj ) ); - for ( anIt->InitEx( true ); anIt->More(); anIt->Next() ) { - _PTR(GenericAttribute) anAttr; - if ( anIt->Value()->FindAttribute(anAttr, "AttributeIOR") ) { - _PTR(AttributeIOR) anIOR ( anAttr ); - TCollection_AsciiString asciiIOR( (char*)anIOR->Value().c_str() ); - GEOM_Client::get_client().RemoveShapeFromBuffer( asciiIOR ); - } - } -} - -//================================================================ -// Function : openCommand -// Purpose : -//================================================================ -bool MyGEOMBase_Helper::openCommand() -{ - bool res = false; - if ( !getStudy() || hasCommand() ) - return res; - - GEOM::GEOM_IOperations_var anOp = GEOM::GEOM_IOperations::_narrow( getOperation() ); - if ( !anOp->_is_nil() ) { - myCommand = new GEOM_Operation( SUIT_Session::session()->activeApplication(), anOp.in() ); - myCommand->start(); - res = true; - } - - return res; -} - -//================================================================ -// Function : abortCommand -// Purpose : -//================================================================ -bool MyGEOMBase_Helper::abortCommand() -{ - if ( !hasCommand() ) - return false; - - myCommand->abort(); - delete myCommand; // I don't know where to delete this object here ? - myCommand = 0; - - return true; -} - -//================================================================ -// Function : commitCommand -// Purpose : -//================================================================ -bool MyGEOMBase_Helper::commitCommand( const char* ) -{ - if ( !hasCommand() ) - return false; - - myCommand->commit(); - delete myCommand; // I don't know where to delete this object here ? - myCommand = 0; - - return true; -} - -//================================================================ -// Function : hasCommand -// Purpose : -//================================================================ -bool MyGEOMBase_Helper::hasCommand() const -{ - return (bool)myCommand; -} - -//================================================================ -// Function : getOperation -// Purpose : -//================================================================ -GEOM::GEOM_IOperations_ptr MyGEOMBase_Helper::getOperation() -{ - if ( myOperation->_is_nil() ) - myOperation = createOperation(); - - return myOperation; -} - - - -//================================================================ -// Function : checkViewWindow -// Purpose : -//================================================================ -bool MyGEOMBase_Helper::checkViewWindow() -{ - if ( myViewWindow ){ - QList aViewWindowsList = SUIT_Session::session()->activeApplication()->desktop()->windows(); - QListIterator it( aViewWindowsList ); - while ( it.hasNext() ) - { - if ( myViewWindow == it.next() ) - return true; - } - } - myViewWindow = 0; - return false; -} - -//================================================================ -// Function : onAccept -// Purpose : This method should be called from dialog's slots onOk() and onApply() -// It perfroms user input validation, then it -// performs a proper operation and manages transactions, etc. -//================================================================ -bool MyGEOMBase_Helper::onAccept( const bool publish, const bool useTransaction ) -{ - SalomeApp_Study* appStudy = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); - if ( !appStudy ) return false; - _PTR(Study) aStudy = appStudy->studyDS(); - - bool aLocked = (_PTR(AttributeStudyProperties) (aStudy->GetProperties()))->IsLocked(); - if ( aLocked ) { - SUIT_MessageBox::warning ( (QWidget*)SUIT_Session::session()->activeApplication()->desktop(), - QObject::tr("WRN_WARNING"), - QObject::tr("WRN_STUDY_LOCKED"), - QObject::tr("BUT_OK") ); - return false; - } - - QString msg; - if ( !isValid( msg ) ) { - showError( msg ); - return false; - } - - erasePreview( false ); - - bool result = false; - - try { - if ( ( !publish && !useTransaction ) || openCommand() ) { - SUIT_OverrideCursor wc; - SUIT_Session::session()->activeApplication()->putInfo( "" ); - ObjectList objects; - if ( !execute( objects ) || !getOperation()->IsDone() ) { - wc.suspend(); - abortCommand(); - showError(); - } - else { - addSubshapesToStudy(); // add Subshapes if local selection - const int nbObjs = objects.size(); - QStringList anEntryList; - int aNumber = 1; - for ( ObjectList::iterator it = objects.begin(); it != objects.end(); ++it ) { - GEOM::GEOM_Object_var obj=*it; - if ( publish ) { - QString aName = getNewObjectName(); - 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 - display( obj, false ); -#ifdef WITHGENERICOBJ - // obj has been published in study. Its refcount has been incremented. - // It is safe to decrement its refcount - // so that it will be destroyed when the entry in study will be removed - obj->UnRegister(); -#endif - } - else { - // asv : fix of PAL6454. If publish==false, then the original shape - // was modified, and need to be re-cached in GEOM_Client before redisplay - clearShapeBuffer( obj ); - // withChildren=true, updateView=false - redisplay( obj, true, false ); - } - } - - if ( nbObjs ) { - commitCommand(); - updateObjBrowser(); - if( SUIT_Application* anApp = SUIT_Session::session()->activeApplication() ) { - if( LightApp_Application* aLightApp = dynamic_cast( anApp ) ) - aLightApp->browseObjects( anEntryList, isApplyAndClose(), isOptimizedBrowsing() ); - anApp->putInfo( QObject::tr("GEOM_PRP_DONE") ); - } - result = true; - } - else - abortCommand(); - } - } - } - catch( const SALOME::SALOME_Exception& e ) { - SalomeApp_Tools::QtCatchCorbaException( e ); - abortCommand(); - } - - updateViewer(); - - return result; -} - - -//================================================================ -// Function : showError -// Purpose : Shows a message box with infromation about an error taken from getOperation()->GetErrorCode() -//================================================================ -void MyGEOMBase_Helper::showError() -{ - QString msg; - if ( !getOperation()->_is_nil() ) - msg = QObject::tr( getOperation()->GetErrorCode() ); - - if ( msg.isEmpty() ) - msg = QObject::tr( "GEOM_PRP_ABORT" ); - - SUIT_MessageBox::critical( SUIT_Session::session()->activeApplication()->desktop(), - QObject::tr( "GEOM_ERROR_STATUS" ), - msg, - QObject::tr( "BUT_OK" ) ); -} - -//================================================================ -// Function : showError -// Purpose : Shows a error message followed by -//================================================================ -void MyGEOMBase_Helper::showError( const QString& msg ) -{ - QString str( QObject::tr( "GEOM_INCORRECT_INPUT" ) ); - if ( !msg.isEmpty() ) - str += "\n" + msg; - SUIT_MessageBox::critical(SUIT_Session::session()->activeApplication()->desktop(), QObject::tr( "GEOM_ERROR" ), str, QObject::tr( "BUT_OK" ) ); -} - -////////////////////////////////////////////////////////////////// -// Virtual methods to be redefined in dialogs -////////////////////////////////////////////////////////////////// - -//================================================================ -// Function : createOperation -// Purpose : Redefine this method to return proper IOperation reference -//================================================================ -GEOM::GEOM_IOperations_ptr MyGEOMBase_Helper::createOperation() -{ - GEOM::GEOM_IOperations_var aNilOp; - return aNilOp._retn(); -} - -//================================================================ -// Function : isValid -// Purpose : Called by onAccept(). Redefine this method to check validity of user input in dialog boxes. -//================================================================ -bool MyGEOMBase_Helper::isValid( QString& ) -{ - return true; -} - -//================================================================ -// Function : execute -// Purpose : This method is called by onAccept(). -// It should perform the required operation and put all new or modified objects into -// argument.Should return if some error occurs during its execution. -//================================================================ -bool MyGEOMBase_Helper::execute( ObjectList& objects ) -{ - return false; -} - -//================================================================ -// Function : getFather -// Purpose : This method is called by addInStudy(). It should return a father object -// for or a nil reference if should be published -// as a top-level object. -//================================================================ -GEOM::GEOM_Object_ptr MyGEOMBase_Helper::getFather( GEOM::GEOM_Object_ptr theObj ) -{ - return GEOM::GEOM_Object::_nil(); -} - -//================================================================ -// Function : getNewObjectName -// Purpose : Redefine this method to return proper name for a new object -//================================================================ -QString MyGEOMBase_Helper::getNewObjectName() const -{ - return QString::null; -} - -//================================================================ -// Function : extractPrefix -// Purpose : Redefine this method to return \c true if necessary -// to extract prefix when generating new name for the -// object(s) being created -//================================================================ -bool MyGEOMBase_Helper::extractPrefix() const -{ - return false; -} - -//================================================================ -// Function : getPrefix -// Purpose : Get prefix for name of created object -//================================================================ -QString MyGEOMBase_Helper::getPrefix( GEOM::GEOM_Object_ptr theObj ) const -{ - if ( !myPrefix.isEmpty() || theObj->_is_nil() ) - return myPrefix; - - GEOM::shape_type aType = theObj->GetShapeType(); - - switch ( aType ) - { - case GEOM::VERTEX : return QObject::tr( "GEOM_VERTEX" ); - case GEOM::EDGE : return QObject::tr( "GEOM_EDGE" ); - case GEOM::WIRE : return QObject::tr( "GEOM_WIRE" ); - case GEOM::FACE : return QObject::tr( "GEOM_FACE" ); - case GEOM::SHELL : return QObject::tr( "GEOM_SHELL" ); - case GEOM::SOLID : return QObject::tr( "GEOM_SOLID" ); - case GEOM::COMPSOLID: return QObject::tr( "GEOM_COMPOUNDSOLID" ); - case GEOM::COMPOUND : return QObject::tr( "GEOM_COMPOUND" ); - default : return ""; - } -} - -//================================================================ -// Function : getDesktop -// Purpose : Returns myDesktop field. Initialized in constructor, -// usually as dynamic_cast(parentWidget()) -//================================================================ -SUIT_Desktop* MyGEOMBase_Helper::getDesktop() const -{ - return myDesktop; -} - -//================================================================ -// Function : selectObjects -// Purpose : Selects list of objects -//================================================================ -bool MyGEOMBase_Helper::selectObjects( ObjectList& objects ) -{ - SUIT_DataOwnerPtrList aList; - ObjectList::iterator anIter; - for ( anIter = objects.begin(); anIter != objects.end(); ++anIter ) - { - QString anEntry = getEntry( *anIter ); - LightApp_DataOwner* anOwher = new LightApp_DataOwner( anEntry ); - aList.append( anOwher ); - } - - SUIT_Session* session = SUIT_Session::session(); - SalomeApp_Application* app = dynamic_cast( session->activeApplication() ); - if ( !app ) - return false; - - LightApp_SelectionMgr* aMgr = app->selectionMgr(); - if ( !aMgr ) - return false; - - aMgr->setSelected( aList, false ); - - return true; -} - -//================================================================ -// Function : findObjectInFather -// Purpose : It should return an object if its founded in study or -// return Null object if the object is not founded -//================================================================ -GEOM::GEOM_Object_ptr MyGEOMBase_Helper::findObjectInFather (GEOM::GEOM_Object_ptr theFather, - const QString& theName) -{ - SalomeApp_Application* app = - dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() ); - SalomeApp_Study* appStudy = dynamic_cast( app->activeStudy() ); - _PTR(Study) aDStudy = appStudy->studyDS(); - QString IOR = GEOMBase::GetIORFromObject( theFather ); - _PTR(SObject) SObj ( aDStudy->FindObjectIOR( IOR.toLatin1().constData() ) ); - - bool inStudy = false; - GEOM::GEOM_Object_var aReturnObject; - for (_PTR(ChildIterator) iit (aDStudy->NewChildIterator( SObj )); iit->More() && !inStudy; iit->Next()) { - _PTR(SObject) child (iit->Value()); - QString aChildName = child->GetName().c_str(); - if (aChildName == theName) { - inStudy = true; - CORBA::Object_var corbaObj = GeometryGUI::ClientSObjectToObject(iit->Value()); - aReturnObject = GEOM::GEOM_Object::_narrow( corbaObj ); - } - } - if (inStudy) - return aReturnObject._retn(); - - return GEOM::GEOM_Object::_nil(); -} - -//================================================================ -// Function : findObjectInFather -// Purpose : It should return an object if its founded in study or -// return Null object if the object is not founded -//================================================================ -GEOM::GEOM_Object_ptr MyGEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr theFather, - int theIndex ) -{ - GEOM::GEOM_Object_var object; - bool found = false; - - SalomeApp_Study* study = dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); - if ( study ) { - _PTR(Study) studyDS = study->studyDS(); - QString IOR = GEOMBase::GetIORFromObject( theFather ); - _PTR(SObject) sobject( studyDS->FindObjectIOR( IOR.toLatin1().constData() ) ); - if ( sobject ) { - _PTR(ChildIterator) it( studyDS->NewChildIterator( sobject ) ); - for ( ; it->More() && !found; it->Next() ) { - GEOM::GEOM_Object_var cobject = GEOM::GEOM_Object::_narrow( GeometryGUI::ClientSObjectToObject( it->Value() ) ); - if ( !CORBA::is_nil( cobject ) ) { - GEOM::ListOfLong_var indices = cobject->GetSubShapeIndices(); - int length = indices->length(); - for ( int i = 0; i < length && !found; i++ ) { - if ( indices[i] == theIndex ) { - object = cobject; - found = true; - } - } - } - } - } - } - - return object._retn(); -} - -//================================================================ -// Function : addSubshapesToStudy -// Purpose : Virtual method to add subshapes if needs -//================================================================ -void MyGEOMBase_Helper::addSubshapesToStudy() -{ - //Impemented in Dialogs, called from Accept method -} - -//================================================================ -// Function : getSelected -// Purpose : Get selected object by specified type -// -// Returns valid object if only one object of the specified type is selected -// (no matter global or local selection is activated). If \a type is TopAbs_SHAPE, -// geometrical object of any valid type is expected. -// -// \param type type of the object to be obtained from selection -// \return selected geometrical object or nil object if selection is not satisfactory -//================================================================ -GEOM::GeomObjPtr MyGEOMBase_Helper::getSelected( TopAbs_ShapeEnum type ) -{ - QList types; - types << type; - return getSelected( types ); -} - -//================================================================ -// Function : getSelected -// Purpose : Get selected object by specified types -// -// Returns valid object if only one object of the specified type is selected -// (no matter global or local selection is activated). The list of allowed -// shape types is passed via \a types. If \a types includes TopAbs_SHAPE, -// geometrical object of any valid type is expected. -// -// \param types list of allowed shape types for the objects to be obtained from selection -// \return selected geometrical object or nil object if selection is not satisfactory -//================================================================ -GEOM::GeomObjPtr MyGEOMBase_Helper::getSelected( const QList& types ) -{ - QList selected = getSelected( types, 1 ); - return selected.count() > 0 ? selected[0] : GEOM::GeomObjPtr(); -} - -//================================================================ -// Function : getSelected -// Purpose : Get selected object(s) by specified type -// -// Returns list of selected objects if selection satisfies specifies selection options. -// (no matter global or local selection is activated). If \a type is TopAbs_SHAPE, -// geometrical objects of any valid type are expected. -// -// The \a type parameter specifies allowed type of the object(s) being selected. -// The \a count parameter specifies exact number of the objects to be retrieved from selection. -// The \a strict parameter specifies policy being applied to the selection. -// If \a count < 0, then any number of the selected objects is valid (including 0). -// In this case, if \a strict is \c true (default), all selected objects should satisfy -// the specified \a type. -// If \a count > 0, only specified number of the objects is retrieved from the selection. -// In this case, if \a strict is \c true (default), function returns empty list if total number of selected -// objects does not correspond to the \a count parameter. Otherwise (if \a strict is \c false), -// function returns valid list of objects if at least \a count objects satisfy specified \a type. -// -// \param type type of the object(s) to be obtained from selection -// \param count number of items to be retrieved from selection -// \param strict selection policy -// \return list of selected geometrical objects or empty list if selection is not satisfactory -//================================================================ -QList MyGEOMBase_Helper::getSelected( TopAbs_ShapeEnum type, int count, bool strict ) -{ - QList types; - types << type; - return getSelected( types, count, strict ); -} - -static bool typeInList( TopAbs_ShapeEnum type, const QList& types ) -{ - bool ok = false; - for ( int i = 0; i < types.count() && !ok; i++ ) - ok = types[i] == TopAbs_SHAPE || types[i] == type; - return ok; -} - -//================================================================ -// Function : getSelected -// Purpose : Get selected objects by specified types -// -// Returns list of selected objects if selection satisfies specifies selection options. -// (no matter global or local selection is activated). If \a types includes TopAbs_SHAPE, -// geometrical objects of any valid type are expected. -// -// The \a types parameter specifies allowed types of the object(s) being selected. -// The \a count parameter specifies exact number of the objects to be retrieved from selection. -// The \a strict parameter specifies policy being applied to the selection. -// If \a count < 0, then any number of the selected objects is valid (including 0). -// In this case, if \a strict is \c true (default), all selected objects should satisfy -// the specified \a type. -// If \a count > 0, only specified number of the objects is retrieved from the selection. -// In this case, if \a strict is \c true (default), function returns empty list if total number of selected -// objects does not correspond to the \a count parameter. Otherwise (if \a strict is \c false), -// function returns valid list of objects if at least \a count objects satisfy specified \a type. -// -// \param types list of allowed shape types for the objects to be obtained from selection -// \param count number of items to be retrieved from selection -// \param strict selection policy -// \return list of selected geometrical objects or empty list if selection is not satisfactory -//================================================================ -QList MyGEOMBase_Helper::getSelected( const QList& types, int count, bool strict ) -{ - SUIT_Session* session = SUIT_Session::session(); - QList result; - - SalomeApp_Application* app = dynamic_cast( session->activeApplication() ); - if ( app ) { -// LightApp_SelectionMgr* selMgr = app->selectionMgr(); -// if ( selMgr ) { - if ( HEXABLOCKGUI::selectionMgr() != NULL) { - SALOME_ListIO selected; - - //====================================== -// SUIT_DataOwnerPtrList selectedDataOwner; -// AIS_ListOfInteractive listOfSelected; -// -// if (HEXABLOCKGUI::currentOccSelector != NULL) -// HEXABLOCKGUI::currentOccSelector->viewer()->getSelectedObjects(listOfSelected); -// -// AIS_ListIteratorOfListOfInteractive it (listOfSelected); -// while (it.More ()) -// { -// //do something with the current item : it.Value () -// selected.Append(it.Value()); -// it.Next (); -// } - //====================================== - -// selMgr->selectedObjects( selected ); - HEXABLOCKGUI::selectionMgr()->selectedObjects( selected/*, "", false*/ ); - SALOME_ListIteratorOfListIO it( selected ); - bool stopped = false; - for ( ; it.More() && !stopped; it.Next() ) { - Handle(SALOME_InteractiveObject) IO = it.Value(); - GEOM::GeomObjPtr object = GEOMBase::ConvertIOinGEOMObject( IO ); - if ( object ) { - TColStd_IndexedMapOfInteger subShapes; - HEXABLOCKGUI::selectionMgr()->GetIndexes( IO, subShapes ); - int nbSubShapes = subShapes.Extent(); - if ( nbSubShapes == 0 ) { - // global selection - if ( typeInList( (TopAbs_ShapeEnum)(object->GetShapeType()), types ) ) { - result << object; - if ( count > 0 ) { - if ( strict && result.count() > count ) { - result.clear(); - stopped = true; - } - else if ( !strict && result.count() == count ) - stopped = true; - } - } - else if ( strict ) { - result.clear(); - stopped = true; - } - } - else { - // local selection - for ( int i = 1; i <= nbSubShapes && !stopped; i++ ) { - int idx = subShapes( i ); - GEOM::GeomObjPtr subShape = findObjectInFather( object.get(), idx ); - if ( !subShape ) { - // sub-shape is not yet published in the study - GEOM::ShapesOpPtr shapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() ); - subShape.take( shapesOp->GetSubShape( object.get(), idx ) ); // take ownership! - } - if ( typeInList( (TopAbs_ShapeEnum)(subShape->GetShapeType()), types ) ) { - result << subShape; - if ( count > 0 ) { - if ( strict && result.count() > count ) { - result.clear(); - stopped = true; - } - else if ( !strict && result.count() == count ) - stopped = true; - } - } - else if ( strict ) { - result.clear(); - stopped = true; - } - } - } - } - } - } - } - return result; -} - -//================================================================ -// Function : setIsApplyAndClose -// Purpose : Set value of the flag indicating that the dialog is -// accepted by Apply & Close button -//================================================================ -void MyGEOMBase_Helper::setIsApplyAndClose( const bool theFlag ) -{ - myIsApplyAndClose = theFlag; -} - -//================================================================ -// Function : isApplyAndClose -// Purpose : Get value of the flag indicating that the dialog is -// accepted by Apply & Close button -//================================================================ -bool MyGEOMBase_Helper::isApplyAndClose() const -{ - return myIsApplyAndClose; -} - -//================================================================ -// Function : setIsOptimizedBrowsing -// Purpose : Set value of the flag switching to optimized -// browsing mode (to select the first published -// object only) -//================================================================ -void MyGEOMBase_Helper::setIsOptimizedBrowsing( const bool theFlag ) -{ - myIsOptimizedBrowsing = theFlag; -} - -//================================================================ -// Function : isOptimizedBrowsing -// Purpose : Get value of the flag switching to optimized -// browsing mode (to select the first published -// object only) -//================================================================ -bool MyGEOMBase_Helper::isOptimizedBrowsing() const -{ - return myIsOptimizedBrowsing; -} diff --git a/src/HEXABLOCKGUI/MyGEOMBase_Helper.hxx b/src/HEXABLOCKGUI/MyGEOMBase_Helper.hxx deleted file mode 100644 index 7ef6013..0000000 --- a/src/HEXABLOCKGUI/MyGEOMBase_Helper.hxx +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (C) 2009-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 -// - -#ifndef MYGEOMBASE_HELPER_HXX -#define MYGEOMBASE_HELPER_HXX - -#include "GEOM_GEOMBase.hxx" -#include "GEOM_GenericObjPtr.h" - -#include -#include -#include -#include -#include CORBA_CLIENT_HEADER(GEOM_Gen) - -#include -#include - -#include - -typedef std::list ObjectList; - -class SalomeApp_Study; -class SUIT_Desktop; -class SUIT_ViewWindow; -class SALOME_Prs; -class GEOM_Operation; -class TColStd_MapOfInteger; - -//================================================================ -// Class : MyGEOMBase_Helper -// Description : Helper class for dialog box development, can be used as -// the second base class for dialog boxes. Contains convenient methods -// performing common operations (display/erase, selection activation, -// publication in a study, transaction management) -//================================================================ -class GEOMBASE_EXPORT MyGEOMBase_Helper -{ -public: - MyGEOMBase_Helper( SUIT_Desktop* ); - virtual ~MyGEOMBase_Helper(); - GEOM_Displayer* getDisplayer(); - void localSelection( const ObjectList&, const int ); - void localSelection( GEOM::GEOM_Object_ptr, const int ); - void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false ); - void globalSelection( const TColStd_MapOfInteger&, const bool = false ); - void globalSelection( const TColStd_MapOfInteger&, const QList& ,const bool = false ); - void erasePreview ( const bool = true ); - void display ( GEOM::GEOM_Object_ptr, const bool = true ); - QString addInStudy ( GEOM::GEOM_Object_ptr, const char* theName ); - - void localSelection(SUIT_ViewWindow *view, const int theMode); - void globalSelection( SUIT_ViewWindow *view, const bool update = false ); - -protected: - static GEOM::GEOM_Gen_ptr getGeomEngine(); - - void display ( const ObjectList&, const bool = true ); -// void display ( GEOM::GEOM_Object_ptr, const bool = true ); - void erase ( const ObjectList&, const bool = true ); - void erase ( GEOM::GEOM_Object_ptr, const bool = true ); - void redisplay ( const ObjectList&, const bool = true, const bool = true ); - void redisplay ( GEOM::GEOM_Object_ptr, const bool = true, const bool = true ); - - virtual void displayPreview ( const bool display, - const bool activate = false, - const bool update = true, - const bool toRemoveFromEngine = true, - const double lineWidth = -1, - const int displayMode = -1, - const int color = -1 ); - // This is the easiest way to show preview. It is based on execute() method. - // It removes temporary GEOM::GEOM_Objects automatically. - - virtual void displayPreview ( GEOM::GEOM_Object_ptr obj, - const bool append = false, - const bool activate = false, - const bool update = true, - const double lineWidth = -1, - const int displayMode = -1, - const int color = -1 ); - void displayPreview ( const SALOME_Prs* prs, - const bool append = false, - const bool = true ); - -// void localSelection( const ObjectList&, const int ); -// void localSelection( GEOM::GEOM_Object_ptr, const int ); - void activate( const int ); -// void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false ); -// void globalSelection( const TColStd_MapOfInteger&, const bool = false ); -// void globalSelection( const TColStd_MapOfInteger&, const QList& ,const bool = false ); - void updateViewer (); - - void prepareSelection( const ObjectList&, const int ); - void prepareSelection( GEOM::GEOM_Object_ptr, const int ); - -// QString addInStudy ( GEOM::GEOM_Object_ptr, const char* theName ); - - bool openCommand (); - bool abortCommand (); - bool commitCommand ( const char* = 0 ); - bool hasCommand () const; - - void updateObjBrowser() const; - int getStudyId () const; - SalomeApp_Study* getStudy () const; - bool checkViewWindow (); - - bool onAccept( const bool publish = true, const bool useTransaction = true ); - // This method should be called from "OK" button handler. - // == true means that objects returned by execute() - // should be published in a study. - - void showError(); - // Shows a message box with infromation about an error taken from getOperation()->GetErrorCode() - void showError( const QString& msg ); - // Shows a error message followed by - - GEOM::GEOM_IOperations_ptr getOperation(); - // If is nil --> calls createOperation() and put the result - // into and returns it; - // otherwise, simply returns - - inline void setPrefix( const QString& prefix ) { myPrefix = prefix; } - QString getPrefix( GEOM::GEOM_Object_ptr = GEOM::GEOM_Object::_nil() ) const; - - bool selectObjects( ObjectList& objects ); - // Selects list of objects - - //////////////////////////////////////////////////////////////////////////// - // Virtual methods, to be redefined in dialog classes - //////////////////////////////////////////////////////////////////////////// - - virtual GEOM::GEOM_IOperations_ptr createOperation(); - // This method should be redefined in dialog boxes so as to return - // proper GEOM_IOperation interface. - // Returns nil reference by default - - virtual bool isValid( QString& msg ); - // Called by onAccept(). Redefine this method to check validity of user input in dialog boxes. - - virtual bool execute( ObjectList& objects ); - // This method is called by onAccept(). - // It should perform the required operation and put all new or modified objects into - // argument.Should return if some error occurs during its execution. - - virtual void restoreSubShapes( SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject ); - // This method is called by addInStudy(). - - virtual GEOM::GEOM_Object_ptr getFather( GEOM::GEOM_Object_ptr theObj ); - // This method is called by addInStudy(). It should return a father object - // for or a nil reference if should be published - // as a top-level object. - - virtual QString getNewObjectName() const; - virtual bool extractPrefix() const; - virtual void addSubshapesToStudy(); - - GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather, const QString& theName ); - GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather, int theIndex ); - // These methods are used to find published sub-object (sub-shape) in the parent object (main shape) - - GEOM::GeomObjPtr getSelected( TopAbs_ShapeEnum type ); - GEOM::GeomObjPtr getSelected( const QList& types ); - QList getSelected( TopAbs_ShapeEnum type, int count, bool strict = true ); - QList getSelected( const QList& types, int count, bool strict = true ); - - void SetIsPreview(const bool thePreview) {isPreview = thePreview;} - bool IsPreview() {return isPreview;} - -// GEOM_Displayer* getDisplayer(); - SUIT_Desktop* getDesktop() const; - - virtual void setIsApplyAndClose( const bool theFlag ); - virtual bool isApplyAndClose() const; - - virtual void setIsOptimizedBrowsing( const bool theFlag ); - virtual bool isOptimizedBrowsing() const; - -private: - QString getEntry( GEOM::GEOM_Object_ptr ) const; - void clearShapeBuffer( GEOM::GEOM_Object_ptr ); - -private: - typedef std::list PrsList; - - PrsList myPreview; - GEOM_Displayer* myDisplayer; - GEOM_Operation* myCommand; - GEOM::GEOM_IOperations_var myOperation; - SUIT_ViewWindow* myViewWindow; - QString myPrefix; - bool isPreview; - SALOME_ListIO mySelected; - SUIT_Desktop* myDesktop; - bool myIsApplyAndClose; - bool myIsOptimizedBrowsing; - -}; - -#endif // GEOMBASE_HELPER_HXX diff --git a/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.cxx b/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.cxx index 2d1e20a..482fb64 100755 --- a/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.cxx +++ b/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.cxx @@ -17,12 +17,12 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +#include + #include "MyGEOMBase_Skeleton.hxx" -#include "GEOMBase.h" #include "HEXABLOCKGUI_VtkDocumentGraphicView.hxx" #include "MyDlgRef.hxx" -#include #include #include @@ -38,6 +38,8 @@ #include #include +using namespace HEXABLOCK::GUI; + //================================================================================= // class : MyGEOMBase_Skeleton() // purpose : Constructs a MyGEOMBase_Skeleton which is a child of 'parent', with the @@ -45,35 +47,21 @@ // The dialog will by default be modeless, unless you set 'modal' to // true to construct a modal dialog. //================================================================================= -MyGEOMBase_Skeleton::MyGEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* parent, - bool modal, Qt::WindowFlags fl ) - : QDialog( parent, fl ), - MyGEOMBase_Helper( dynamic_cast( parent ) ), - myGeomGUI( theGeometryGUI ), +MyGEOMBase_Skeleton::MyGEOMBase_Skeleton( QWidget* parent, Qt::WindowFlags fl ) + : HexaBaseDialog(parent, NEW_MODE, fl), myRBGroup( 0 ) { -// setAttribute( Qt::WA_DeleteOnClose ); - - setModal( modal ); myMainFrame = new MyDlgRef_Skeleton( this ); QVBoxLayout* topLayout = new QVBoxLayout( this ); topLayout->setMargin( 0 ); topLayout->setSpacing( 0 ); topLayout->addWidget( myMainFrame ); - myMainFrame->GroupBoxName->setTitle( tr( "GEOM_RESULT_NAME_GRP" ) ); - myMainFrame->NameLabel->setText( tr( "GEOM_RESULT_NAME_LBL" ) ); - myMainFrame->GroupBoxPublish->setTitle( tr( "GEOM_PUBLISH_RESULT_GRP" ) ); myMainFrame->CheckBoxRestoreSS->setText( tr( "GEOM_RESTORE_SUB_SHAPES" ) ); myMainFrame->CheckBoxAddPrefix->setText( tr( "GEOM_RSS_ADD_FREFIX" ) ); myMainFrame->CheckBoxPreview->setText( tr("GEOM_PREVIEW") ); - buttonCancel()->setText( tr( "GEOM_BUT_CLOSE" ) ); - //buttonOk()->setText( tr( "GEOM_BUT_APPLY_AND_CLOSE" ) ); - buttonApply()->setText( tr( "GEOM_BUT_APPLY" ) ); - buttonHelp()->setText( tr( "GEOM_BUT_HELP" ) ); - myRBGroup = new QButtonGroup( this ); myRBGroup->addButton( myMainFrame->RadioButton1, 0 ); myRBGroup->addButton( myMainFrame->RadioButton2, 1 ); @@ -82,7 +70,6 @@ MyGEOMBase_Skeleton::MyGEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* myRBGroup->addButton( myMainFrame->RadioButton5, 4 ); connect( myRBGroup, SIGNAL( buttonClicked( int ) ), this, SIGNAL( constructorsClicked( int ) ) ); - Init(); } @@ -92,8 +79,6 @@ MyGEOMBase_Skeleton::MyGEOMBase_Skeleton( GeometryGUI* theGeometryGUI, QWidget* //================================================================================= MyGEOMBase_Skeleton::~MyGEOMBase_Skeleton() { - if ( myGeomGUI ) - myGeomGUI->SetActiveDialogBox( 0 ); } //================================================================================= @@ -102,38 +87,10 @@ MyGEOMBase_Skeleton::~MyGEOMBase_Skeleton() //================================================================================= void MyGEOMBase_Skeleton::Init() { - SalomeApp_Application* app = (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ); - if ( !myGeomGUI && app ) - myGeomGUI = dynamic_cast( app->module( "Geometry" ) ); - - /* init variables */ - if ( myGeomGUI ) - myGeomGUI->SetActiveDialogBox( this ); - - /* signals and slots connections */ - connect( buttonCancel(), SIGNAL( clicked() ), this, SLOT( close() ) ); - if ( myGeomGUI ) { - connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ); - connect( myGeomGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( close() ) ); - } - - // connect help button on a private slot that displays help information - connect( buttonHelp(), SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) ); - - connect( myMainFrame->CheckBoxPreview, SIGNAL(toggled(bool)), this, SLOT(processPreview()) ); - /* displays Dialog */ myMainFrame->RadioButton1->setChecked( true ); myMainFrame->RadioButton4->hide(); myMainFrame->RadioButton5->hide(); - - myMainFrame->CheckBoxRestoreSS->setChecked( false ); - myMainFrame->CheckBoxAddPrefix->setChecked( true ); - - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - bool aPrv = (resMgr == 0) ? false : resMgr->booleanValue( "Geometry", "geom_preview", false ); - - myMainFrame->CheckBoxPreview->setChecked( aPrv ); myMainFrame->GroupBoxPublish->hide(); } @@ -154,120 +111,12 @@ void MyGEOMBase_Skeleton::initSpinBox( QSpinBox* spinBox, //================================================================================= void MyGEOMBase_Skeleton::initSpinBox( SalomeApp_DoubleSpinBox* spinBox, double min, double max, - double step, const char* quantity ) + double step, const char* quantity, unsigned int decimals) { - // Obtain precision from preferences - SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr(); - int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 ); - - spinBox->setPrecision( aPrecision ); - spinBox->setDecimals( qAbs( aPrecision ) ); // it's necessary to set decimals before the range setting, - // by default Qt rounds boundaries to 2 decimals at setRange + spinBox->setPrecision( decimals ); + spinBox->setDecimals( decimals ); spinBox->setRange( min, max ); spinBox->setSingleStep( step ); - - // Add a hint for the user saying how to tune precision - QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() ); - spinBox->setProperty( "validity_tune_hint", - QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) ); -} - -//================================================================================= -// function : updateAttributes() -// purpose : Workaround for Translation and Rotation operations with unchecked option "Create a copy". -// In this case PublishInStudy isn't called, so we need to update object's attributes manually -//================================================================================= -void MyGEOMBase_Skeleton::updateAttributes( GEOM::GEOM_Object_ptr theObj, - const QStringList& theParameters) -{ - SALOMEDS::Study_var aStudy = GeometryGUI::ClientStudyToStudy(getStudy()->studyDS()); - SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder(); - SALOMEDS::SObject_var aSObject = aStudy->FindObjectID(theObj->GetStudyEntry()); - SALOMEDS::GenericAttribute_var anAttr = aStudyBuilder->FindOrCreateAttribute(aSObject, "AttributeString"); - SALOMEDS::AttributeString_var aStringAttrib = SALOMEDS::AttributeString::_narrow(anAttr); - - std::string aValue = aStringAttrib->Value(); - if( aValue != "" ) - aValue += "|"; - for( int i = 0, n = theParameters.count(); i < n; i++ ) { - std::string aParameter = theParameters[i].toStdString(); - if(aStudy->IsVariable(aParameter.c_str())) - aValue += aParameter; - if(i != n-1) - aValue += ":"; - } - aStringAttrib->SetValue(aValue.c_str()); -} - - -// ========================================================================== close -// function : close() -// purpose : close the dockwidget -//================================================================================= -void MyGEOMBase_Skeleton::close() -{ -// _currentObj = NULL; - - //Clear VTK selection //no need to test if the graphic view exist - HEXABLOCKGUI::currentDocGView->clearSelection(); - - //Clear OCC selection - if (HEXABLOCKGUI::currentOccGView != NULL) - HEXABLOCKGUI::currentOccGView->clearSelection(); - - //Close the dialog box - if (parentWidget()) parentWidget()->close(); -} - -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void MyGEOMBase_Skeleton::LineEditReturnPressed() -{ - if (!myEditCurrentArgument) - return; - - /* User name of object input management */ - /* If successfull the selection is changed and signal emitted... */ - /* so SelectionIntoArgument() is automatically called. */ - const QString objectUserName = myEditCurrentArgument->text(); - QWidget* thisWidget = (QWidget*)this; - - SALOME_ListIO aList; - LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); - if (aSelMgr) - aSelMgr->selectedObjects(aList); - if (GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, aList)) - myEditCurrentArgument->setText(objectUserName); -} - -//================================================================================= -// function : DeactivateActiveDialog() -// purpose : -//================================================================================= -void MyGEOMBase_Skeleton::DeactivateActiveDialog() -{ - this->setEnabled( false ); - globalSelection(HEXABLOCKGUI::currentOccGView->getViewWindow()); - if ( myGeomGUI ) { - myGeomGUI->SetActiveDialogBox( 0 ); - disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 ); - } - erasePreview(); -} - -//================================================================================= -// function : ActivateThisDialog() -// purpose : -//================================================================================= -void MyGEOMBase_Skeleton::ActivateThisDialog() -{ - /* Emit a signal to deactivate the active dialog */ - if ( myGeomGUI ) myGeomGUI->EmitSignalDeactivateDialog(); - this->setEnabled( true ); - if ( myGeomGUI ) myGeomGUI->SetActiveDialogBox( (QDialog*)this ); - return; } //================================================================================= @@ -276,31 +125,10 @@ void MyGEOMBase_Skeleton::ActivateThisDialog() //================================================================================= void MyGEOMBase_Skeleton::closeEvent( QCloseEvent* e ) { - if ( myGeomGUI ) { - disconnect( myGeomGUI->getApp()->selectionMgr(), 0, this, 0 ); - myGeomGUI->getApp()->updateActions(); - } - QDialog::closeEvent( e ); -} + TopoDS_Shape shape; + HEXABLOCKGUI::currentOccGView->displayPreview(shape); -//================================================================================= -// function : initName() -// purpose : initialize the Name field with a string "thePrefix_X" (Vertex_3) -//================================================================================= -void MyGEOMBase_Skeleton::initName( const QString& thePrefix ) -{ - if ( !thePrefix.isNull() ) - setPrefix( thePrefix ); - myMainFrame->ResultName->setText( GEOMBase::GetDefaultName( getPrefix() ) ); -} - -//================================================================================= -// function : getNewObjectName() -// purpose : returns contents of Name field -//================================================================================= -QString MyGEOMBase_Skeleton::getNewObjectName() const -{ - return myMainFrame->ResultName->text(); + QDialog::closeEvent( e ); } //================================================================================= @@ -338,45 +166,13 @@ void MyGEOMBase_Skeleton::unsetConstructorId() QList btnList = myRBGroup->buttons(); for ( int j = 0; j < 2; j++ ) { - QList::const_iterator it = btnList.constBegin(); - for ( ; it != btnList.constEnd(); ++it ) + QList::const_iterator it = btnList.constBegin(), itEnd = btnList.constEnd(); + for ( ; it != itEnd; ++it ) (*it)->setCheckable( j == 1 ); } myRBGroup->setExclusive( isExclusive ); } -//================================================================================= -// function : ClickOnHelp() -// purpose : -//================================================================================= -void MyGEOMBase_Skeleton::ClickOnHelp() -{ - LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() ); - if ( app ) - app->onHelpContextModule( myGeomGUI ? app->moduleName( myGeomGUI->moduleName() ) : QString(""), myHelpFileName ); - else { - QString platform; -#ifdef WIN32 - platform = "winapplication"; -#else - platform = "application"; -#endif - SUIT_MessageBox::warning( 0, QObject::tr( "WRN_WARNING" ), - QObject::tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ). - arg( app->resourceMgr()->stringValue( "ExternalBrowser", platform ) ).arg( myHelpFileName ), - QObject::tr( "BUT_OK" ) ); - } -} - -//================================================================================= -// function : setHelpFileName() -// purpose : set name for help file html -//================================================================================= -void MyGEOMBase_Skeleton::setHelpFileName( const QString& theName ) -{ - myHelpFileName = theName; -} - MyDlgRef_Skeleton* MyGEOMBase_Skeleton::mainFrame() { return myMainFrame; @@ -387,43 +183,6 @@ QWidget* MyGEOMBase_Skeleton::centralWidget() return myMainFrame->GroupMedium; } -QPushButton* MyGEOMBase_Skeleton::buttonCancel() const -{ - return myMainFrame->buttonCancel; -} - -/*QPushButton* MyGEOMBase_Skeleton::buttonOk() const -{ - return myMainFrame->buttonOk; -}*/ - -QPushButton* MyGEOMBase_Skeleton::buttonApply() const -{ - return myMainFrame->buttonApply; -} - -QPushButton* MyGEOMBase_Skeleton::buttonHelp() const -{ - return myMainFrame->buttonHelp; -} - -//================================================================================= -// function : keyPressEvent() -// purpose : -//================================================================================= -void MyGEOMBase_Skeleton::keyPressEvent( QKeyEvent* e ) -{ - QDialog::keyPressEvent( e ); - if ( e->isAccepted() ) - return; - - if ( e->key() == Qt::Key_F1 ) { - e->accept(); - ClickOnHelp(); - } -} - - //================================================================================= // function : showOnlyPreviewControl() // purpose : display only CheckBoxPreview check box, @@ -435,10 +194,3 @@ void MyGEOMBase_Skeleton::showOnlyPreviewControl(){ mainFrame()->CheckBoxAddPrefix->hide(); } -//================================================================================= -// function : processPreview() -// purpose : Display preview if CheckBoxPreview is checked -//================================================================================= -void MyGEOMBase_Skeleton::processPreview() { - displayPreview(mainFrame()->CheckBoxPreview->isChecked()); -} diff --git a/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx b/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx index d9f924e..d5f31ad 100755 --- a/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx +++ b/src/HEXABLOCKGUI/MyGEOMBase_Skeleton.hxx @@ -20,15 +20,15 @@ #ifndef MYGEOMBASE_SKELETON_H #define MYGEOMBASE_SKELETON_H -#include "GEOM_GEOMBase.hxx" -#include "MyGEOMBase_Helper.hxx" +#include + #include "HEXABLOCKGUI_OccGraphicView.hxx" #include "HEXABLOCKGUI.hxx" +#include "HEXABLOCKGUI_DocumentPanel.hxx" #include class SalomeApp_DoubleSpinBox; -class GeometryGUI; class MyDlgRef_Skeleton; class QSpinBox; class QDoubleSpinBox; @@ -37,81 +37,63 @@ class QButtonGroup; class QPushButton; #ifndef COORD_MIN -# define COORD_MIN -1e+15 -# define COORD_MAX +1e+15 +# define COORD_MIN -1e+12 +# define COORD_MAX +1e+12 # define MAX_NUMBER 100000 -# define DBL_DIGITS_DISPLAY 16 +# define DBL_DIGITS_DISPLAY 13 #endif // COORD_MIN -class GEOMBASE_EXPORT MyGEOMBase_Skeleton : public QDialog, public MyGEOMBase_Helper +namespace HEXABLOCK +{ +namespace GUI +{ + +class HEXABLOCKGUI_DOCUMENTPANEL_EXPORT MyGEOMBase_Skeleton : public HexaBaseDialog { - Q_OBJECT + Q_OBJECT public: - MyGEOMBase_Skeleton( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 ); - ~MyGEOMBase_Skeleton(); + MyGEOMBase_Skeleton( QWidget* = 0, Qt::WindowFlags = 0 ); + ~MyGEOMBase_Skeleton(); private: - void Init(); + void Init(); protected: - void initSpinBox( QSpinBox*, int, int, int = 1 ); - void initSpinBox( SalomeApp_DoubleSpinBox*, double, double, double = 0.1, const char* = "length_precision" ); - - void updateAttributes( GEOM::GEOM_Object_ptr, const QStringList& ); - - void closeEvent( QCloseEvent* ); - void keyPressEvent( QKeyEvent* ); + virtual bool apply(QModelIndex& result) = 0; + virtual void _initInputWidget( Mode editmode ) = 0; + void initSpinBox( QSpinBox*, int, int, int = 1 ); + void initSpinBox( SalomeApp_DoubleSpinBox*, double, double, double = 0.01, + const char* = "length_precision", unsigned int decimals = 6 ); - /*! initialize "Name" field with a string "thePrefix_X" (Vertex_3) - */ - void initName( const QString& = QString() ); + void closeEvent( QCloseEvent* ); - /*! returns contents of "Name" field - */ - virtual QString getNewObjectName() const; + /*! returns id of a selected "constructor" radio button or '-1' in case of error + */ + int getConstructorId() const; + /*! set selected "constructor" radio button id + */ + void setConstructorId( const int ); + /*! unset selection on all "constructor" radio buttons + */ + void unsetConstructorId(); - /*! returns id of a selected "constructor" radio button or '-1' in case of error - */ - int getConstructorId() const; - /*! set selected "constructor" radio button id - */ - void setConstructorId( const int ); - /*! unset selection on all "constructor" radio buttons - */ - void unsetConstructorId(); + void showOnlyPreviewControl(); - void showOnlyPreviewControl(); - - void setHelpFileName( const QString& ); - - MyDlgRef_Skeleton* mainFrame(); - QWidget* centralWidget(); - QPushButton* buttonCancel() const; - //QPushButton* buttonOk() const; - QPushButton* buttonApply() const; - QPushButton* buttonHelp() const; + MyDlgRef_Skeleton* mainFrame(); + QWidget* centralWidget(); protected: - QLineEdit* myEditCurrentArgument; //!< Current LineEdit - GeometryGUI* myGeomGUI; //!< reference GEOM GUI - QString myHelpFileName; //!< Associated HTML help file name - - QButtonGroup* myRBGroup; //!< radio button group - MyDlgRef_Skeleton* myMainFrame; //!< dialog box's mainframe widgetx + QLineEdit* myEditCurrentArgument; //!< Current LineEdit -public slots: - virtual void close(); - -protected slots: - virtual void processPreview(); - void LineEditReturnPressed(); - void DeactivateActiveDialog(); - void ActivateThisDialog(); - void ClickOnHelp(); + QButtonGroup* myRBGroup; //!< radio button group + MyDlgRef_Skeleton* myMainFrame; //!< dialog box's mainframe widgetx signals: - void constructorsClicked( int ); +void constructorsClicked( int ); }; +} +} + #endif // MYGEOMBASE_SKELETON_H diff --git a/src/HEXABLOCKGUI/Pipe_QTD.ui b/src/HEXABLOCKGUI/Pipe_QTD.ui index b80ef9e..c9981f4 100644 --- a/src/HEXABLOCKGUI/Pipe_QTD.ui +++ b/src/HEXABLOCKGUI/Pipe_QTD.ui @@ -7,7 +7,7 @@ 0 0 226 - 241 + 246 @@ -41,7 +41,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/PrismQuad_QTD.ui b/src/HEXABLOCKGUI/PrismQuad_QTD.ui index 357108d..ee8bc69 100644 --- a/src/HEXABLOCKGUI/PrismQuad_QTD.ui +++ b/src/HEXABLOCKGUI/PrismQuad_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 260 - 376 + 424 + 599 @@ -19,7 +19,7 @@ 0 - 0 + 300 @@ -29,7 +29,7 @@ - Prism Quad(s) Operation + Extrude Quad(s) Operation @@ -42,263 +42,273 @@ 0 0 - 267 - 500 + 404 + 579 - - - - 0 - 0 - + + + true - - Arguments - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Quad(s) - - - - - - - 0 - 0 - - - - - - - - - - - - 16777215 - 50 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - Direction - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - false - - - - - - - - - - - 0 - 0 - - - - Layer(s) - - - - - - - - regular - - - true - - - - - - - irregular - - - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - nb - - - - - - - 1 - - - 1000000 - - - 1 - - - - - - - - - - - 16777215 - 169 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - - 0 - 0 - - - - 0 - - - - height - - - - - - true - - - - 0 - 0 - - - - + - - - - - - - - 0 - 0 - - - - - - - - - 0 - 0 - - - - - - - - - - - - Qt::Vertical - - - - 20 - 139 - - - - - + + + + 0 + 0 + 384 + 559 + + + + + + + + 0 + 0 + + + + + + + + + + + + + Simple + + + true + + + + + + + Uniform + + + + + + + Custom + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Quad(s) + + + + + + + 0 + 0 + + + + + + + + + + + + + + + 0 + 0 + + + + direction + - - - - - - - - - + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + false + + + + + + + + + + + + + length + + + + + + + 6 + + + 1000000000.000000000000000 + + + 1.000000000000000 + + + + + + + 1 + + + 1000000 + + + 1 + + + + + + + Nb layers + + + + + + + + + + + 0 + 0 + + + + 0 + + + + height + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 0 + + + + + + + + + @@ -310,66 +320,210 @@ - regular_rb + extrudeTop_rb + clicked() + widget_4 + hide() + + + 95 + 127 + + + 204 + 417 + + + + + extrudeTop_rb + clicked() + label_2 + hide() + + + 95 + 127 + + + 64 + 468 + + + + + extrudeTop_rb + clicked() + length_spb + hide() + + + 95 + 127 + + + 227 + 468 + + + + + extrudeTop_rb clicked() - frame_3 + layers_height_w hide() - 77 - 231 + 95 + 127 - 126 - 390 + 204 + 619 - regular_rb + extrudeUni_rb clicked() - frame_2 + widget_4 show() - 77 - 231 + 204 + 127 - 126 - 273 + 204 + 417 - irregular_rb + extrudeUni_rb clicked() - frame_3 + widget_6 show() - 175 - 231 + 204 + 127 - 126 - 390 + 204 + 487 - irregular_rb + extrudeUni_rb clicked() - frame_2 + layers_height_w hide() - 175 - 231 + 204 + 127 + + + 204 + 619 + + + + + extrude_rb + clicked() + widget_4 + show() + + + 312 + 127 + + + 204 + 417 + + + + + extrude_rb + clicked() + widget_6 + hide() + + + 312 + 127 + + + 204 + 487 + + + + + extrude_rb + clicked() + layers_height_w + show() + + + 312 + 127 + + + 204 + 619 + + + + + extrudeUni_rb + clicked() + label_2 + show() + + + 204 + 127 + + + 64 + 468 + + + + + extrudeUni_rb + clicked() + length_spb + show() + + + 204 + 127 + + + 227 + 468 + + + + + extrudeTop_rb + clicked() + widget_6 + show() + + + 95 + 127 - 126 - 273 + 202 + 521 diff --git a/src/HEXABLOCKGUI/Propagation_QTD.ui b/src/HEXABLOCKGUI/Propagation_QTD.ui index 861e900..91f862a 100644 --- a/src/HEXABLOCKGUI/Propagation_QTD.ui +++ b/src/HEXABLOCKGUI/Propagation_QTD.ui @@ -29,7 +29,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/QuadAssoc_QTD.ui b/src/HEXABLOCKGUI/QuadAssoc_QTD.ui index 2d5d150..30bbdee 100644 --- a/src/HEXABLOCKGUI/QuadAssoc_QTD.ui +++ b/src/HEXABLOCKGUI/QuadAssoc_QTD.ui @@ -6,7 +6,7 @@ 0 0 - 225 + 232 271 @@ -47,7 +47,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/QuadRevolution_QTD.ui b/src/HEXABLOCKGUI/QuadRevolution_QTD.ui index 55452fe..86011b0 100644 --- a/src/HEXABLOCKGUI/QuadRevolution_QTD.ui +++ b/src/HEXABLOCKGUI/QuadRevolution_QTD.ui @@ -6,14 +6,14 @@ 0 0 - 235 - 367 + 389 + 443 5 - 0 + 300 @@ -21,158 +21,364 @@ - - - - 5 - 0 - - - - Arguments - - - - + + + + - Quads : - - - - - - - - 0 - 0 - - - - - - - - Center : - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - + Uniform - - Select a vertex - - - - false - - - - - - - Axis : - - - - - - - - 0 - 0 - - - - - 16777215 - 16777215 - - - - Select a vector - - - - false - - - - - - - Angles : - - - - - - - - 0 - 0 - - - - - - - + true - - - 0 - 0 - - - - + - - - - - - 0 - 0 - - + + - - + Custom - - - - Qt::Vertical - - - - 20 - 45 - - - - + + + + true + + + + + 0 + 0 + 351 + 490 + + + + + + + + 5 + 0 + + + + + + + + + + Quad(s) + + + + + + + 0 + 0 + + + + + + + + + + + + + + center + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Select a vertex + + + + false + + + + + + + axis + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + Select a vector + + + + false + + + + + center_le + label_5 + axis_le + label_4 + + + + + + + + + angle + + + + + + + 6 + + + 360.000000000000000 + + + 10.000000000000000 + + + 360.000000000000000 + + + + + + + Nb layers + + + + + + + 1000000 + + + 1 + + + + + + + + + + + 0 + 0 + + + + + 16777215 + 16777215 + + + + 0 + + + + angle + + + + + + true + + + + 0 + 0 + + + + + + + + + + + + + 0 + 0 + + + + - + + + + + + + Qt::Vertical + + + + 20 + 139 + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + - + + + revolutionUni_rb + clicked() + widget_3 + show() + + + 92 + 101 + + + 152 + 389 + + + + + revolutionUni_rb + clicked() + widget_5 + show() + + + 92 + 101 + + + 152 + 473 + + + + + revolutionUni_rb + clicked() + random_param_w + hide() + + + 92 + 101 + + + 152 + 586 + + + + + revolution_rb + clicked() + widget_5 + hide() + + + 212 + 101 + + + 152 + 473 + + + + + revolution_rb + clicked() + random_param_w + show() + + + 212 + 101 + + + 152 + 586 + + + + diff --git a/src/HEXABLOCKGUI/Quad_QTD.ui b/src/HEXABLOCKGUI/Quad_QTD.ui index da01b21..38360a6 100755 --- a/src/HEXABLOCKGUI/Quad_QTD.ui +++ b/src/HEXABLOCKGUI/Quad_QTD.ui @@ -7,7 +7,7 @@ 0 0 216 - 428 + 463 @@ -44,7 +44,7 @@ - Quad + By @@ -94,7 +94,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/RemoveHexa_QTD.ui b/src/HEXABLOCKGUI/RemoveHexa_QTD.ui index 3eedee7..cdb9fcd 100644 --- a/src/HEXABLOCKGUI/RemoveHexa_QTD.ui +++ b/src/HEXABLOCKGUI/RemoveHexa_QTD.ui @@ -7,7 +7,7 @@ 0 0 225 - 103 + 109 @@ -35,7 +35,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/ReplaceHexa_QTD.ui b/src/HEXABLOCKGUI/ReplaceHexa_QTD.ui index 08a9399..969f574 100644 --- a/src/HEXABLOCKGUI/ReplaceHexa_QTD.ui +++ b/src/HEXABLOCKGUI/ReplaceHexa_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 227 - 255 + 369 + 457 @@ -30,8 +30,8 @@ 0 0 - 234 - 397 + 349 + 437 @@ -50,7 +50,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/Symmetry_QTD.ui b/src/HEXABLOCKGUI/Symmetry_QTD.ui index 4719b89..ceb71a1 100644 --- a/src/HEXABLOCKGUI/Symmetry_QTD.ui +++ b/src/HEXABLOCKGUI/Symmetry_QTD.ui @@ -7,7 +7,7 @@ 0 0 234 - 396 + 422 @@ -50,7 +50,7 @@ - Make + By @@ -101,7 +101,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/Transformation_QTD.ui b/src/HEXABLOCKGUI/Transformation_QTD.ui index 93fdeb1..78b0ba1 100644 --- a/src/HEXABLOCKGUI/Transformation_QTD.ui +++ b/src/HEXABLOCKGUI/Transformation_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 239 - 440 + 287 + 475 @@ -38,7 +38,7 @@ - Make + @@ -89,7 +89,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/Vector_QTD.ui b/src/HEXABLOCKGUI/Vector_QTD.ui index df482f8..80e9001 100644 --- a/src/HEXABLOCKGUI/Vector_QTD.ui +++ b/src/HEXABLOCKGUI/Vector_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 245 - 338 + 255 + 364 @@ -32,7 +32,7 @@ - Vector + By @@ -70,7 +70,7 @@ - Arguments + diff --git a/src/HEXABLOCKGUI/Vertex_QTD.ui b/src/HEXABLOCKGUI/Vertex_QTD.ui index 9727000..4a140bf 100755 --- a/src/HEXABLOCKGUI/Vertex_QTD.ui +++ b/src/HEXABLOCKGUI/Vertex_QTD.ui @@ -6,8 +6,8 @@ 0 0 - 210 - 202 + 246 + 216 @@ -35,7 +35,7 @@ - Arguments + @@ -86,22 +86,6 @@ - - - - - 0 - 0 - - - - 6 - - - 1000000000.000000000000000 - - - @@ -115,22 +99,6 @@ - - - - - 0 - 0 - - - - 6 - - - 1000000000.000000000000000 - - - @@ -144,37 +112,31 @@ - - - - - 0 - 0 - + + + + 0 - - 6 + + + + + + 0 - - 1000000000.000000000000000 + + + + + + 0 - x_spb - label - x_spb - y_spb - label_2 - z_spb - label_3 - widget - widget_2 - x_spb - label diff --git a/src/HEXABLOCKGUI/resources/HEXABLOCK_icons.ts b/src/HEXABLOCKGUI/resources/HEXABLOCK_icons.ts index 5de5ed9..92f78e6 100755 --- a/src/HEXABLOCKGUI/resources/HEXABLOCK_icons.ts +++ b/src/HEXABLOCKGUI/resources/HEXABLOCK_icons.ts @@ -1,4 +1,24 @@ + @default @@ -114,6 +134,10 @@ ICON_QUAD_ASSOCIATION assoc_quad.png + + ICON_GEOM_ASSOCIATION + add_geom.png + ICON_ADD_GROUP add_group.png @@ -121,6 +145,10 @@ ICON_REMOVE_GROUP remove_group.png + + + ICON_MODEL_INFO + model_info.png ICON_ADD_LAW diff --git a/src/HEXABLOCKGUI/resources/HEXABLOCK_msg_en.ts b/src/HEXABLOCKGUI/resources/HEXABLOCK_msg_en.ts index d358d48..e06e2d6 100755 --- a/src/HEXABLOCKGUI/resources/HEXABLOCK_msg_en.ts +++ b/src/HEXABLOCKGUI/resources/HEXABLOCK_msg_en.ts @@ -1158,7 +1158,7 @@ Please select a %2. - Make quadrangle association + Make quad association @@ -1166,7 +1166,7 @@ Please select a %2. - Make Quadrangle Association + Make Quad Association diff --git a/src/HEXABLOCKGUI/resources/HEXABLOCK_msg_fr.ts b/src/HEXABLOCKGUI/resources/HEXABLOCK_msg_fr.ts index 2b2307c..3a7b5d3 100755 --- a/src/HEXABLOCKGUI/resources/HEXABLOCK_msg_fr.ts +++ b/src/HEXABLOCKGUI/resources/HEXABLOCK_msg_fr.ts @@ -1023,11 +1023,11 @@ Choisissez un(e) %2. Associer arêtes - Make quadrangle association + Make quad association Associer des quadrangles - Make Quadrangle Association + Make Quad Association Associer quadrangles diff --git a/src/HEXABLOCKGUI/resources/add_geom.png b/src/HEXABLOCKGUI/resources/add_geom.png new file mode 100644 index 0000000000000000000000000000000000000000..50ffb1acac43873e8f8fd7d428684fdb9cf62090 GIT binary patch literal 2023 zcmVPx#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2i*n( z3Kz?UJ6&X5FYsh`|d3e%vI2x?~e0 zk}HEOi!6$W-rhy-tfNC@#p2UKieV_O1%!o0D8~F;j!LLIChXf7@91=Jra7f^W zzM|`WAl(d_-XkBH2oS({3v(U)NxB)Bd}wA2x$GWtJ-tx68JN?*Oc8zE3uiM&WCN&y z3MlonnFqod;{IQy{ywQ^hVRM5z$1 zK-d?8*m@uc1&JnJXnVtvYQU@2eeh*wsB(KB@4_2T7UV+rS<$HpcC=ga@4U zi!DQ43Z`~mFhp2y5E}vnG%ieSgWK~4PCCBcD`)v@hH?+aBSX1s@3(&?;>}-|zs-l{ z%U&>7KrJFuF||}0y>`Xe7ned^PDq6P#=A%;TsSvv^_HvvIQ3N0=)E4#f*c8*<+LzK?38kBXIrf>5Xbs|Zp|>jZHlVjER!(bHPOmVYcFYu+tADM@hvqEsHt-H`85sFeik6m7sa~j^7vN7nC}x2B;N54R!~@TyjW<5= zXlw~=s~1LwV%x?-Icf}hOtaCRpOKuD7D}ktQQ*}id;I;`vJ-eaSYZ+uZ4$n$ZoNO6 z@x21HEcA$6{XmTE?kgBs2Yt%kL7{;%C;n`>2<`o^j{d9%W_-`!F6s*oQK+$wSABy0x0Q zV;+G3ptms#JcukIXQ}=AnX%?^Q-d*@Rt=z4{FO&?KKb2PD=~yUeMe#lcZD);FdDy= zXp@NM1#s*<&;lODR>$}LsLv~pSBXd!`#i&naU zOJrw((@&?ocrN3PhkG;qOe3FG9|cx6QVJqql!$~nWAvJt;CTWXc8o8H}GbF zX?bBhGF<+%HFJ7gI{T;xpR+Z@xSCK31jfoW7Q%S>gNAtos(ffZ_Q&t!fBVAElTP4% zH7&Lb7hkVj1-+nq+y{oWj|4V|%h`590;{Sp5Q30KRxX0xZx%B8z_om6?)k&F^Va}Q zKb>}tj{p~6uN?4Zf>H_8P(K847Ea?GMm84>g8`{o(mgJzWG?BxnRjG4zZ*5i7!h$n>1U?gdqLX+d!Brp_5B!dUf9y- z9f8%BA$Ilq%et=U&#t*ycF~gg5}g_5 z{e!Kg4tJG=Bhu3q>%Ez@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZUgr(_037EXrW zfB!RN_)KS*v_6gD?>~sT{GbU8ZOd{PzW@5e@b$+ZhOKRZU_*gG1&Ch&1Q3dWNl8in zyC(}UF#P|+@Souq&_zFi^iQA+kpKT5kp2&5|NH+9$p6Bit$2gMC}Ro3z78Ld_8cJI z0T4iNFGoj5|JU{_WthI1f#K`tj|_zoGZ|W!<^o;$59rPR3=Q#347Cet!EBK0wzUN? zT)xlG5Zn9(W(3HEJOBX%c40t3z<*|DW^g$D`t=JOKA%5-X88K`E13W1&mXWH2!Qxs zzI8uVDBE^xiL^OM21^7*hKtfxQPZWPWKnLt^&~FdO2cAcp@ym;MAA-nInf z-CDQ{0Ro5#94^2>2c@%rPz+4c;6w~dQ6L(O{{e&J?{BbJZB!k@_ivb91_&Uqmo+st z|L;962u^eV|Nj7c`}d#U48MOPy!sCqmOzg%eEsr|!N%wXgJDD~L#9_B*wFlpcW^HQ z1Q6KEpk$CWc@j8cKwh4jmCg{~R0Z}H2u#dxXUOX>1seLB;qR{>K#>N9Zy%mBeEjf_ zVaEDEAb%d*g#ZBrHV~BNzI^|~@CT^)`^OgyZ{Pf7V1#%893gMt{)0FZn2&*`f@R`d zmIC$tXSll`Y}f&qfdByn_A(O_)Bnr&B!P+aKhU-RfC>6P*ef6}L%a)&-9Nwp`SG9O z$M^pXrFrieR2-8S?jQ^UWtSsByaphEzy>lhGX6J?>jN6h!tm$kSB4y)UWUF^$-qeX z3wBwO$2^8PTVugN@D~^fclOPJIS6Lh1yDW)(EtGiH;{~?55q8^SziGH2v#^40C578 zCKg~A1`-4aAQmLaJ0!aB1vK2?hJgS;0KvS>4P;AziXReP_yXB55C8};09p|?CtP=@ QIRF3v07*qoM6N<$g5m`0p#T5? literal 277 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`jKx9jP7LeL$-D$|*pj^6T^Rm@ z;DWu&Cj&(|3p^r=85pG3gD_*9)I=GeAbW|YuPgf7v28z*fLW@ni2CqSi;lYwFBGxN+w zhEEZK8tT~lC0fWNPlXx#I^8$+|){5?0ZUa$1OT5%%3gEwinKJUfmJ-Yjs zDu23nFK%k9|Mmy%l2IFE7du&>F?n^PYi;X?328y@j-DNUrd*y+-j&xeOsfyyTxFY` Q26P~Ur>mdKI;Vst0CT=&L;wH) diff --git a/src/HEXABLOCKGUI/resources/model_info.png b/src/HEXABLOCKGUI/resources/model_info.png new file mode 100644 index 0000000000000000000000000000000000000000..0a4f3594c3db792de1d1c35eed65273eb87506a7 GIT binary patch literal 2407 zcmV-t37GbYP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FZT01FZU(%pXi00007bV*G`2i*n( z4F@J_6@PXB00`$vL_t(&-qo6GY?M_V#((cS*G@Z~b~+ts$J(J)sq7|p#RBa@FxobB zKddgq3kt;|vg?HyFa#43wTos+*05hpT#a2(67L{LTNNSbDuf0pLefGTl-ib=wllTu zOy|;h=RNzOmry$`(~Cy z6;)M7uaqn!%Q9N67Ohq*&D5OIG<`sX!(jq}0O4?W1gKuGN0wzIX%MFn0##LsL?T3^ zQ2-1E1Br====FN(nh*$uLZY{~7gbd;8jYCENocjYI4u>y=kpT^g^*<#i^YP`Xq5gh z1O^5M=;`SZ(P)&^)D(=ygpuFe?jZH`UYeWx@OVPNFeZV`X5iLaQ@HK6H0*ZcNS|OZ zKu=FEvMgh@TG8or(r-q<@AnJ8-%nCf5=lu(05moA^3_+DIda5Bq^Opg7Bx&b#?ftS z$eBBb;^GWSN*vsLb20!vpAWy^Phw&s$;rvmj1%yBy&@WoVz;LQ5m{oP7_@5 z{Dgfj{_`2Cs{Tk?ngM`FL}ka0dcuF&F=0RJ*RQaB`)vTYTrR@lFixjanlgdDzCJN9 zFo4ZwLs10JK6?uFo)@pW$E!cO2ZzHn>ba^4mM*Pj$*$KX?4R)Y-+Ae!KcLl0{P^RK zBqk;@XU-gH(pxAL3W;Dah|OjLV9S=etAYo}Oi3RDelR~sEMGqNs{Mm2o@dLJIsoR) zb8`9eWxQUmm=pma1l`@;SS*7PV)yO_wD(oU<&?d>0~1&@5?^_6UnRSDHy}we^XARt z?Afy@iX!4B;Pd%}Ua!Y!OrXBrOY0q5r%tmG15^eSHzW`>vDKtG{OD zyZ@QgI4{3^4uAy<7I5+6MSMP=xT+KT{eBS)21!p(=g1Kk)%p!nj`5dzLL7f=BM*J_ z&XmV^*z^ty7pC#eH{T$HVEOXp(u5WW1Ok}NW&jQzY-KvlnPQw4c!0foF9ML4H=mZ4 zma$dtm0zOK=tyza*B9Zl&!$IUCfb1mt@QON*zI#jNJyZgqeG0lg@VDL=urdCL9$8O9f)=AugUO`9Xw(dS9(<Noi>&UwrWeX0w^1 zq9Q5gfksgj42Hq%dE!JD+!fyhpRB3i+_^tvHtQH(5Lq6ZdloEsf))RMW6}gpoam&q zG?V0H3r$TIC@Lz7y@eD-!DuuLRhhoHCx}J`?d<{D+WN-@9}Y)R)v295hOyY~Hr#GE zkw|2GC)Q{*sH))7rT7Wl|K8iY>3N9Vm+q&m>??x7XpH1Ibw3!!VzDIS@p$n2{bGVd zCWi9C)F%7g_J84a2WHffuf)>Z+e;u2xOy!lNz9sdC6-_3EqQ#_vq$h6#v;X7RXH|e z3A0%@YX}TuiAJLcAx2q2{x$G{fe4ZW^XDhe8Un*u-0n_<5NI@-*aUPs9l>A-fc$*x ztRXOr#pQBgHk(IEoiPNoTJ1=TEiAOp8Un*uT3TALTCJE&CMhNXyoliM%`uLI}>CJ4bGAF0w3-?*lrW4xi7DMkBFmmGhbtSi3d{jYguev60r+ zR`T=nCyqj9vl+kN55THb*?7Vo*9`o@ibq+!ItPH7ni?`PGRV!%otS`Lua{(5roX?R zjEn?sI{wy-0h(+%v0=l_m`qwaJ3Bah_%MqWEgGYt#>@k$si}CqUW5>A-n@XLoBlf4 z+!-^ssFSEqj&AxJPd=Fkz}s){L8sHPY}vB00zj9mtr>SICbh2 zhYlTL-MV$;3Ta{Cq1OkB5qi3Y<O-)VApFf}c zd@K9*-Nob22=3aoH->Vp(AzseG%Cieqa;Z}qZwZx+PC%*YHIE#Ki^6u5@F}gLG5+@ z`t>ov$EA&WJRZ^3*2XQj+=9tu;`{HttXcClWpBJSqY?*dIGx#KXAdU0pMLW3`s?TU;Deu7`R<-c z0pGWF9S=X8%j1vdal;LX0GvO6o^9KQvC444>%kS3JaHzo^BtNth&1g@Or}| zCn+HyEzLk$nts$+Uayzx>S_)gI6!A-C#9vOl$V#2ot-`NS4^?C)VJS$OG85g7K??f ztSp?)Y%()5NKQ5*jnRKpd_EuT?Jk;|o2jp_r@p=(MNzo@_S-2bDWRaC0E5Bs+g; +%template(VectorQuads) vector ; +%template(VectorEdges) vector ; +%template(VectorVertices) vector ; +%template(VectorReal) vector ; +%template(VectorInt) vector ; +} + +%include "hexa_base.hxx" +%include "HexEltBase.hxx" +%include "HexVertex.hxx" +%include "HexEdge.hxx" +%include "HexQuad.hxx" +%include "HexHexa.hxx" +%include "HexVector.hxx" +%include "HexDocument.hxx" +%include "HexPropagation.hxx" +%include "Hex.hxx" +%include "HexElements.hxx" +%include "HexCrossElements.hxx" +%include "HexBiCylinder.hxx" diff --git a/src/HEXABLOCK_SWIG/hexablock_swig.py b/src/HEXABLOCK_SWIG/hexablock_swig.py new file mode 100644 index 0000000..fe22e10 --- /dev/null +++ b/src/HEXABLOCK_SWIG/hexablock_swig.py @@ -0,0 +1,1002 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 1.3.31 +# +# Don't modify this file, modify the SWIG interface instead. +# This file is compatible with both classic and new-style classes. + +import _hexablock_swig +import new +new_instancemethod = new.instancemethod +try: + _swig_property = property +except NameError: + pass # Python < 2.2 doesn't have 'property'. +def _swig_setattr_nondynamic(self,class_type,name,value,static=1): + if (name == "thisown"): return self.this.own(value) + if (name == "this"): + if type(value).__name__ == 'PySwigObject': + self.__dict__[name] = value + return + method = class_type.__swig_setmethods__.get(name,None) + if method: return method(self,value) + if (not static) or hasattr(self,name): + self.__dict__[name] = value + else: + raise AttributeError("You cannot add attributes to %s" % self) + +def _swig_setattr(self,class_type,name,value): + return _swig_setattr_nondynamic(self,class_type,name,value,0) + +def _swig_getattr(self,class_type,name): + if (name == "thisown"): return self.this.own() + method = class_type.__swig_getmethods__.get(name,None) + if method: return method(self) + raise AttributeError,name + +def _swig_repr(self): + try: strthis = "proxy of " + self.this.__repr__() + except: strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + +import types +try: + _object = types.ObjectType + _newclass = 1 +except AttributeError: + class _object : pass + _newclass = 0 +del types + + +class PySwigIterator(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, PySwigIterator, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, PySwigIterator, name) + def __init__(self): raise AttributeError, "No constructor defined" + __repr__ = _swig_repr + __swig_destroy__ = _hexablock_swig.delete_PySwigIterator + __del__ = lambda self : None; + def value(*args): return _hexablock_swig.PySwigIterator_value(*args) + def incr(*args): return _hexablock_swig.PySwigIterator_incr(*args) + def decr(*args): return _hexablock_swig.PySwigIterator_decr(*args) + def distance(*args): return _hexablock_swig.PySwigIterator_distance(*args) + def equal(*args): return _hexablock_swig.PySwigIterator_equal(*args) + def copy(*args): return _hexablock_swig.PySwigIterator_copy(*args) + def next(*args): return _hexablock_swig.PySwigIterator_next(*args) + def previous(*args): return _hexablock_swig.PySwigIterator_previous(*args) + def advance(*args): return _hexablock_swig.PySwigIterator_advance(*args) + def __eq__(*args): return _hexablock_swig.PySwigIterator___eq__(*args) + def __ne__(*args): return _hexablock_swig.PySwigIterator___ne__(*args) + def __iadd__(*args): return _hexablock_swig.PySwigIterator___iadd__(*args) + def __isub__(*args): return _hexablock_swig.PySwigIterator___isub__(*args) + def __add__(*args): return _hexablock_swig.PySwigIterator___add__(*args) + def __sub__(*args): return _hexablock_swig.PySwigIterator___sub__(*args) + def __iter__(self): return self +PySwigIterator_swigregister = _hexablock_swig.PySwigIterator_swigregister +PySwigIterator_swigregister(PySwigIterator) + +class VectorHexas(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, VectorHexas, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, VectorHexas, name) + __repr__ = _swig_repr + def iterator(*args): return _hexablock_swig.VectorHexas_iterator(*args) + def __iter__(self): return self.iterator() + def __nonzero__(*args): return _hexablock_swig.VectorHexas___nonzero__(*args) + def __len__(*args): return _hexablock_swig.VectorHexas___len__(*args) + def pop(*args): return _hexablock_swig.VectorHexas_pop(*args) + def __getslice__(*args): return _hexablock_swig.VectorHexas___getslice__(*args) + def __setslice__(*args): return _hexablock_swig.VectorHexas___setslice__(*args) + def __delslice__(*args): return _hexablock_swig.VectorHexas___delslice__(*args) + def __delitem__(*args): return _hexablock_swig.VectorHexas___delitem__(*args) + def __getitem__(*args): return _hexablock_swig.VectorHexas___getitem__(*args) + def __setitem__(*args): return _hexablock_swig.VectorHexas___setitem__(*args) + def append(*args): return _hexablock_swig.VectorHexas_append(*args) + def empty(*args): return _hexablock_swig.VectorHexas_empty(*args) + def size(*args): return _hexablock_swig.VectorHexas_size(*args) + def clear(*args): return _hexablock_swig.VectorHexas_clear(*args) + def swap(*args): return _hexablock_swig.VectorHexas_swap(*args) + def get_allocator(*args): return _hexablock_swig.VectorHexas_get_allocator(*args) + def begin(*args): return _hexablock_swig.VectorHexas_begin(*args) + def end(*args): return _hexablock_swig.VectorHexas_end(*args) + def rbegin(*args): return _hexablock_swig.VectorHexas_rbegin(*args) + def rend(*args): return _hexablock_swig.VectorHexas_rend(*args) + def pop_back(*args): return _hexablock_swig.VectorHexas_pop_back(*args) + def erase(*args): return _hexablock_swig.VectorHexas_erase(*args) + def __init__(self, *args): + this = _hexablock_swig.new_VectorHexas(*args) + try: self.this.append(this) + except: self.this = this + def push_back(*args): return _hexablock_swig.VectorHexas_push_back(*args) + def front(*args): return _hexablock_swig.VectorHexas_front(*args) + def back(*args): return _hexablock_swig.VectorHexas_back(*args) + def assign(*args): return _hexablock_swig.VectorHexas_assign(*args) + def resize(*args): return _hexablock_swig.VectorHexas_resize(*args) + def insert(*args): return _hexablock_swig.VectorHexas_insert(*args) + def reserve(*args): return _hexablock_swig.VectorHexas_reserve(*args) + def capacity(*args): return _hexablock_swig.VectorHexas_capacity(*args) + __swig_destroy__ = _hexablock_swig.delete_VectorHexas + __del__ = lambda self : None; +VectorHexas_swigregister = _hexablock_swig.VectorHexas_swigregister +VectorHexas_swigregister(VectorHexas) + +class VectorQuads(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, VectorQuads, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, VectorQuads, name) + __repr__ = _swig_repr + def iterator(*args): return _hexablock_swig.VectorQuads_iterator(*args) + def __iter__(self): return self.iterator() + def __nonzero__(*args): return _hexablock_swig.VectorQuads___nonzero__(*args) + def __len__(*args): return _hexablock_swig.VectorQuads___len__(*args) + def pop(*args): return _hexablock_swig.VectorQuads_pop(*args) + def __getslice__(*args): return _hexablock_swig.VectorQuads___getslice__(*args) + def __setslice__(*args): return _hexablock_swig.VectorQuads___setslice__(*args) + def __delslice__(*args): return _hexablock_swig.VectorQuads___delslice__(*args) + def __delitem__(*args): return _hexablock_swig.VectorQuads___delitem__(*args) + def __getitem__(*args): return _hexablock_swig.VectorQuads___getitem__(*args) + def __setitem__(*args): return _hexablock_swig.VectorQuads___setitem__(*args) + def append(*args): return _hexablock_swig.VectorQuads_append(*args) + def empty(*args): return _hexablock_swig.VectorQuads_empty(*args) + def size(*args): return _hexablock_swig.VectorQuads_size(*args) + def clear(*args): return _hexablock_swig.VectorQuads_clear(*args) + def swap(*args): return _hexablock_swig.VectorQuads_swap(*args) + def get_allocator(*args): return _hexablock_swig.VectorQuads_get_allocator(*args) + def begin(*args): return _hexablock_swig.VectorQuads_begin(*args) + def end(*args): return _hexablock_swig.VectorQuads_end(*args) + def rbegin(*args): return _hexablock_swig.VectorQuads_rbegin(*args) + def rend(*args): return _hexablock_swig.VectorQuads_rend(*args) + def pop_back(*args): return _hexablock_swig.VectorQuads_pop_back(*args) + def erase(*args): return _hexablock_swig.VectorQuads_erase(*args) + def __init__(self, *args): + this = _hexablock_swig.new_VectorQuads(*args) + try: self.this.append(this) + except: self.this = this + def push_back(*args): return _hexablock_swig.VectorQuads_push_back(*args) + def front(*args): return _hexablock_swig.VectorQuads_front(*args) + def back(*args): return _hexablock_swig.VectorQuads_back(*args) + def assign(*args): return _hexablock_swig.VectorQuads_assign(*args) + def resize(*args): return _hexablock_swig.VectorQuads_resize(*args) + def insert(*args): return _hexablock_swig.VectorQuads_insert(*args) + def reserve(*args): return _hexablock_swig.VectorQuads_reserve(*args) + def capacity(*args): return _hexablock_swig.VectorQuads_capacity(*args) + __swig_destroy__ = _hexablock_swig.delete_VectorQuads + __del__ = lambda self : None; +VectorQuads_swigregister = _hexablock_swig.VectorQuads_swigregister +VectorQuads_swigregister(VectorQuads) + +class VectorEdges(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, VectorEdges, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, VectorEdges, name) + __repr__ = _swig_repr + def iterator(*args): return _hexablock_swig.VectorEdges_iterator(*args) + def __iter__(self): return self.iterator() + def __nonzero__(*args): return _hexablock_swig.VectorEdges___nonzero__(*args) + def __len__(*args): return _hexablock_swig.VectorEdges___len__(*args) + def pop(*args): return _hexablock_swig.VectorEdges_pop(*args) + def __getslice__(*args): return _hexablock_swig.VectorEdges___getslice__(*args) + def __setslice__(*args): return _hexablock_swig.VectorEdges___setslice__(*args) + def __delslice__(*args): return _hexablock_swig.VectorEdges___delslice__(*args) + def __delitem__(*args): return _hexablock_swig.VectorEdges___delitem__(*args) + def __getitem__(*args): return _hexablock_swig.VectorEdges___getitem__(*args) + def __setitem__(*args): return _hexablock_swig.VectorEdges___setitem__(*args) + def append(*args): return _hexablock_swig.VectorEdges_append(*args) + def empty(*args): return _hexablock_swig.VectorEdges_empty(*args) + def size(*args): return _hexablock_swig.VectorEdges_size(*args) + def clear(*args): return _hexablock_swig.VectorEdges_clear(*args) + def swap(*args): return _hexablock_swig.VectorEdges_swap(*args) + def get_allocator(*args): return _hexablock_swig.VectorEdges_get_allocator(*args) + def begin(*args): return _hexablock_swig.VectorEdges_begin(*args) + def end(*args): return _hexablock_swig.VectorEdges_end(*args) + def rbegin(*args): return _hexablock_swig.VectorEdges_rbegin(*args) + def rend(*args): return _hexablock_swig.VectorEdges_rend(*args) + def pop_back(*args): return _hexablock_swig.VectorEdges_pop_back(*args) + def erase(*args): return _hexablock_swig.VectorEdges_erase(*args) + def __init__(self, *args): + this = _hexablock_swig.new_VectorEdges(*args) + try: self.this.append(this) + except: self.this = this + def push_back(*args): return _hexablock_swig.VectorEdges_push_back(*args) + def front(*args): return _hexablock_swig.VectorEdges_front(*args) + def back(*args): return _hexablock_swig.VectorEdges_back(*args) + def assign(*args): return _hexablock_swig.VectorEdges_assign(*args) + def resize(*args): return _hexablock_swig.VectorEdges_resize(*args) + def insert(*args): return _hexablock_swig.VectorEdges_insert(*args) + def reserve(*args): return _hexablock_swig.VectorEdges_reserve(*args) + def capacity(*args): return _hexablock_swig.VectorEdges_capacity(*args) + __swig_destroy__ = _hexablock_swig.delete_VectorEdges + __del__ = lambda self : None; +VectorEdges_swigregister = _hexablock_swig.VectorEdges_swigregister +VectorEdges_swigregister(VectorEdges) + +class VectorVertices(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, VectorVertices, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, VectorVertices, name) + __repr__ = _swig_repr + def iterator(*args): return _hexablock_swig.VectorVertices_iterator(*args) + def __iter__(self): return self.iterator() + def __nonzero__(*args): return _hexablock_swig.VectorVertices___nonzero__(*args) + def __len__(*args): return _hexablock_swig.VectorVertices___len__(*args) + def pop(*args): return _hexablock_swig.VectorVertices_pop(*args) + def __getslice__(*args): return _hexablock_swig.VectorVertices___getslice__(*args) + def __setslice__(*args): return _hexablock_swig.VectorVertices___setslice__(*args) + def __delslice__(*args): return _hexablock_swig.VectorVertices___delslice__(*args) + def __delitem__(*args): return _hexablock_swig.VectorVertices___delitem__(*args) + def __getitem__(*args): return _hexablock_swig.VectorVertices___getitem__(*args) + def __setitem__(*args): return _hexablock_swig.VectorVertices___setitem__(*args) + def append(*args): return _hexablock_swig.VectorVertices_append(*args) + def empty(*args): return _hexablock_swig.VectorVertices_empty(*args) + def size(*args): return _hexablock_swig.VectorVertices_size(*args) + def clear(*args): return _hexablock_swig.VectorVertices_clear(*args) + def swap(*args): return _hexablock_swig.VectorVertices_swap(*args) + def get_allocator(*args): return _hexablock_swig.VectorVertices_get_allocator(*args) + def begin(*args): return _hexablock_swig.VectorVertices_begin(*args) + def end(*args): return _hexablock_swig.VectorVertices_end(*args) + def rbegin(*args): return _hexablock_swig.VectorVertices_rbegin(*args) + def rend(*args): return _hexablock_swig.VectorVertices_rend(*args) + def pop_back(*args): return _hexablock_swig.VectorVertices_pop_back(*args) + def erase(*args): return _hexablock_swig.VectorVertices_erase(*args) + def __init__(self, *args): + this = _hexablock_swig.new_VectorVertices(*args) + try: self.this.append(this) + except: self.this = this + def push_back(*args): return _hexablock_swig.VectorVertices_push_back(*args) + def front(*args): return _hexablock_swig.VectorVertices_front(*args) + def back(*args): return _hexablock_swig.VectorVertices_back(*args) + def assign(*args): return _hexablock_swig.VectorVertices_assign(*args) + def resize(*args): return _hexablock_swig.VectorVertices_resize(*args) + def insert(*args): return _hexablock_swig.VectorVertices_insert(*args) + def reserve(*args): return _hexablock_swig.VectorVertices_reserve(*args) + def capacity(*args): return _hexablock_swig.VectorVertices_capacity(*args) + __swig_destroy__ = _hexablock_swig.delete_VectorVertices + __del__ = lambda self : None; +VectorVertices_swigregister = _hexablock_swig.VectorVertices_swigregister +VectorVertices_swigregister(VectorVertices) + +class VectorReal(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, VectorReal, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, VectorReal, name) + __repr__ = _swig_repr + def iterator(*args): return _hexablock_swig.VectorReal_iterator(*args) + def __iter__(self): return self.iterator() + def __nonzero__(*args): return _hexablock_swig.VectorReal___nonzero__(*args) + def __len__(*args): return _hexablock_swig.VectorReal___len__(*args) + def pop(*args): return _hexablock_swig.VectorReal_pop(*args) + def __getslice__(*args): return _hexablock_swig.VectorReal___getslice__(*args) + def __setslice__(*args): return _hexablock_swig.VectorReal___setslice__(*args) + def __delslice__(*args): return _hexablock_swig.VectorReal___delslice__(*args) + def __delitem__(*args): return _hexablock_swig.VectorReal___delitem__(*args) + def __getitem__(*args): return _hexablock_swig.VectorReal___getitem__(*args) + def __setitem__(*args): return _hexablock_swig.VectorReal___setitem__(*args) + def append(*args): return _hexablock_swig.VectorReal_append(*args) + def empty(*args): return _hexablock_swig.VectorReal_empty(*args) + def size(*args): return _hexablock_swig.VectorReal_size(*args) + def clear(*args): return _hexablock_swig.VectorReal_clear(*args) + def swap(*args): return _hexablock_swig.VectorReal_swap(*args) + def get_allocator(*args): return _hexablock_swig.VectorReal_get_allocator(*args) + def begin(*args): return _hexablock_swig.VectorReal_begin(*args) + def end(*args): return _hexablock_swig.VectorReal_end(*args) + def rbegin(*args): return _hexablock_swig.VectorReal_rbegin(*args) + def rend(*args): return _hexablock_swig.VectorReal_rend(*args) + def pop_back(*args): return _hexablock_swig.VectorReal_pop_back(*args) + def erase(*args): return _hexablock_swig.VectorReal_erase(*args) + def __init__(self, *args): + this = _hexablock_swig.new_VectorReal(*args) + try: self.this.append(this) + except: self.this = this + def push_back(*args): return _hexablock_swig.VectorReal_push_back(*args) + def front(*args): return _hexablock_swig.VectorReal_front(*args) + def back(*args): return _hexablock_swig.VectorReal_back(*args) + def assign(*args): return _hexablock_swig.VectorReal_assign(*args) + def resize(*args): return _hexablock_swig.VectorReal_resize(*args) + def insert(*args): return _hexablock_swig.VectorReal_insert(*args) + def reserve(*args): return _hexablock_swig.VectorReal_reserve(*args) + def capacity(*args): return _hexablock_swig.VectorReal_capacity(*args) + __swig_destroy__ = _hexablock_swig.delete_VectorReal + __del__ = lambda self : None; +VectorReal_swigregister = _hexablock_swig.VectorReal_swigregister +VectorReal_swigregister(VectorReal) + +class VectorInt(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, VectorInt, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, VectorInt, name) + __repr__ = _swig_repr + def iterator(*args): return _hexablock_swig.VectorInt_iterator(*args) + def __iter__(self): return self.iterator() + def __nonzero__(*args): return _hexablock_swig.VectorInt___nonzero__(*args) + def __len__(*args): return _hexablock_swig.VectorInt___len__(*args) + def pop(*args): return _hexablock_swig.VectorInt_pop(*args) + def __getslice__(*args): return _hexablock_swig.VectorInt___getslice__(*args) + def __setslice__(*args): return _hexablock_swig.VectorInt___setslice__(*args) + def __delslice__(*args): return _hexablock_swig.VectorInt___delslice__(*args) + def __delitem__(*args): return _hexablock_swig.VectorInt___delitem__(*args) + def __getitem__(*args): return _hexablock_swig.VectorInt___getitem__(*args) + def __setitem__(*args): return _hexablock_swig.VectorInt___setitem__(*args) + def append(*args): return _hexablock_swig.VectorInt_append(*args) + def empty(*args): return _hexablock_swig.VectorInt_empty(*args) + def size(*args): return _hexablock_swig.VectorInt_size(*args) + def clear(*args): return _hexablock_swig.VectorInt_clear(*args) + def swap(*args): return _hexablock_swig.VectorInt_swap(*args) + def get_allocator(*args): return _hexablock_swig.VectorInt_get_allocator(*args) + def begin(*args): return _hexablock_swig.VectorInt_begin(*args) + def end(*args): return _hexablock_swig.VectorInt_end(*args) + def rbegin(*args): return _hexablock_swig.VectorInt_rbegin(*args) + def rend(*args): return _hexablock_swig.VectorInt_rend(*args) + def pop_back(*args): return _hexablock_swig.VectorInt_pop_back(*args) + def erase(*args): return _hexablock_swig.VectorInt_erase(*args) + def __init__(self, *args): + this = _hexablock_swig.new_VectorInt(*args) + try: self.this.append(this) + except: self.this = this + def push_back(*args): return _hexablock_swig.VectorInt_push_back(*args) + def front(*args): return _hexablock_swig.VectorInt_front(*args) + def back(*args): return _hexablock_swig.VectorInt_back(*args) + def assign(*args): return _hexablock_swig.VectorInt_assign(*args) + def resize(*args): return _hexablock_swig.VectorInt_resize(*args) + def insert(*args): return _hexablock_swig.VectorInt_insert(*args) + def reserve(*args): return _hexablock_swig.VectorInt_reserve(*args) + def capacity(*args): return _hexablock_swig.VectorInt_capacity(*args) + __swig_destroy__ = _hexablock_swig.delete_VectorInt + __del__ = lambda self : None; +VectorInt_swigregister = _hexablock_swig.VectorInt_swigregister +VectorInt_swigregister(VectorInt) + +HOK = _hexablock_swig.HOK +HERR = _hexablock_swig.HERR +NOTHING = _hexablock_swig.NOTHING +EOL = _hexablock_swig.EOL +EOS = _hexablock_swig.EOS +CHVIDE = _hexablock_swig.CHVIDE +ZEROR = _hexablock_swig.ZEROR +UNR = _hexablock_swig.UNR +DEMI = _hexablock_swig.DEMI +DIM2 = _hexablock_swig.DIM2 +M_PI = _hexablock_swig.M_PI +Degre2Radian = _hexablock_swig.Degre2Radian +dir_x = _hexablock_swig.dir_x +dir_y = _hexablock_swig.dir_y +dir_z = _hexablock_swig.dir_z +DIM3 = _hexablock_swig.DIM3 +EL_NONE = _hexablock_swig.EL_NONE +EL_VERTEX = _hexablock_swig.EL_VERTEX +EL_EDGE = _hexablock_swig.EL_EDGE +EL_QUAD = _hexablock_swig.EL_QUAD +EL_HEXA = _hexablock_swig.EL_HEXA +EL_VECTOR = _hexablock_swig.EL_VECTOR +EL_GRID = _hexablock_swig.EL_GRID +EL_CYLINDER = _hexablock_swig.EL_CYLINDER +EL_PIPE = _hexablock_swig.EL_PIPE +EL_GROUP = _hexablock_swig.EL_GROUP +EL_LAW = _hexablock_swig.EL_LAW +EL_SHAPE = _hexablock_swig.EL_SHAPE +EL_SUBSHAPE = _hexablock_swig.EL_SUBSHAPE +EL_PROPAGATION = _hexablock_swig.EL_PROPAGATION +EL_DOCU = _hexablock_swig.EL_DOCU +EL_REMOVED = _hexablock_swig.EL_REMOVED +EL_MAXI = _hexablock_swig.EL_MAXI +HexaCell = _hexablock_swig.HexaCell +QuadCell = _hexablock_swig.QuadCell +EdgeCell = _hexablock_swig.EdgeCell +HexaNode = _hexablock_swig.HexaNode +QuadNode = _hexablock_swig.QuadNode +EdgeNode = _hexablock_swig.EdgeNode +VertexNode = _hexablock_swig.VertexNode +SH_NONE = _hexablock_swig.SH_NONE +SH_IMPORT = _hexablock_swig.SH_IMPORT +SH_CYLINDER = _hexablock_swig.SH_CYLINDER +SH_INTER = _hexablock_swig.SH_INTER +SH_SPHERE = _hexablock_swig.SH_SPHERE +SH_CLOUD = _hexablock_swig.SH_CLOUD +SH_EXTRUD = _hexablock_swig.SH_EXTRUD +CYL_NOFILL = _hexablock_swig.CYL_NOFILL +CYL_CL4 = _hexablock_swig.CYL_CL4 +CYL_CL6 = _hexablock_swig.CYL_CL6 +CYL_CLOSED = _hexablock_swig.CYL_CLOSED +CYL_PEER = _hexablock_swig.CYL_PEER +CYL_ODD = _hexablock_swig.CYL_ODD +GR_NONE = _hexablock_swig.GR_NONE +GR_CARTESIAN = _hexablock_swig.GR_CARTESIAN +GR_CYLINDRIC = _hexablock_swig.GR_CYLINDRIC +GR_SPHERIC = _hexablock_swig.GR_SPHERIC +GR_JOINT = _hexablock_swig.GR_JOINT +GR_BICYL = _hexablock_swig.GR_BICYL +GR_BIPIPE = _hexablock_swig.GR_BIPIPE +GR_REPLACE = _hexablock_swig.GR_REPLACE +GR_HEMISPHERIC = _hexablock_swig.GR_HEMISPHERIC +GR_RIND = _hexablock_swig.GR_RIND +GR_PART_SPHERIC = _hexablock_swig.GR_PART_SPHERIC +GR_PART_RIND = _hexablock_swig.GR_PART_RIND +S_E = _hexablock_swig.S_E +S_NE = _hexablock_swig.S_NE +S_N = _hexablock_swig.S_N +S_NW = _hexablock_swig.S_NW +S_W = _hexablock_swig.S_W +S_SW = _hexablock_swig.S_SW +S_S = _hexablock_swig.S_S +S_SE = _hexablock_swig.S_SE +S_MAXI = _hexablock_swig.S_MAXI +Uniform = _hexablock_swig.Uniform +Arithmetic = _hexablock_swig.Arithmetic +Geometric = _hexablock_swig.Geometric +OR_FRONT = _hexablock_swig.OR_FRONT +OR_LEFT = _hexablock_swig.OR_LEFT +OR_RIGHT = _hexablock_swig.OR_RIGHT +OR_BACK = _hexablock_swig.OR_BACK +IS_NONE = _hexablock_swig.IS_NONE +IS_MARRIED = _hexablock_swig.IS_MARRIED +NO_COUNTED = _hexablock_swig.NO_COUNTED +NO_USED = _hexablock_swig.NO_USED +IS_USED = _hexablock_swig.IS_USED +V_AMONT = _hexablock_swig.V_AMONT +V_AVAL = _hexablock_swig.V_AVAL +V_TWO = _hexablock_swig.V_TWO +E_A = _hexablock_swig.E_A +E_B = _hexablock_swig.E_B +E_C = _hexablock_swig.E_C +E_D = _hexablock_swig.E_D +QUAD4 = _hexablock_swig.QUAD4 +Q_A = _hexablock_swig.Q_A +Q_B = _hexablock_swig.Q_B +Q_C = _hexablock_swig.Q_C +Q_D = _hexablock_swig.Q_D +Q_E = _hexablock_swig.Q_E +Q_F = _hexablock_swig.Q_F +HQ_MAXI = _hexablock_swig.HQ_MAXI +E_AC = _hexablock_swig.E_AC +E_AD = _hexablock_swig.E_AD +E_BC = _hexablock_swig.E_BC +E_BD = _hexablock_swig.E_BD +E_AE = _hexablock_swig.E_AE +E_AF = _hexablock_swig.E_AF +E_BE = _hexablock_swig.E_BE +E_BF = _hexablock_swig.E_BF +E_CE = _hexablock_swig.E_CE +E_CF = _hexablock_swig.E_CF +E_DE = _hexablock_swig.E_DE +E_DF = _hexablock_swig.E_DF +HE_MAXI = _hexablock_swig.HE_MAXI +V_ACE = _hexablock_swig.V_ACE +V_ACF = _hexablock_swig.V_ACF +V_ADE = _hexablock_swig.V_ADE +V_ADF = _hexablock_swig.V_ADF +V_BCE = _hexablock_swig.V_BCE +V_BCF = _hexablock_swig.V_BCF +V_BDE = _hexablock_swig.V_BDE +V_BDF = _hexablock_swig.V_BDF +HV_MAXI = _hexablock_swig.HV_MAXI +Q_INSIDE = _hexablock_swig.Q_INSIDE +Q_DIRECT = _hexablock_swig.Q_DIRECT +Q_INVERSE = _hexablock_swig.Q_INVERSE +Q_UNDEFINED = _hexablock_swig.Q_UNDEFINED +Q_WAITING = _hexablock_swig.Q_WAITING +CylSmall = _hexablock_swig.CylSmall +CylBig = _hexablock_swig.CylBig +NxInt = _hexablock_swig.NxInt +NxExt = _hexablock_swig.NxExt +get_temp_name = _hexablock_swig.get_temp_name +prod_scalaire = _hexablock_swig.prod_scalaire +prod_vectoriel = _hexablock_swig.prod_vectoriel +prod_mixte = _hexablock_swig.prod_mixte +deg2radians = _hexablock_swig.deg2radians +rad2degres = _hexablock_swig.rad2degres +calc_norme = _hexablock_swig.calc_norme +calc_distance = _hexablock_swig.calc_distance +calc_vecteur = _hexablock_swig.calc_vecteur +copy_vecteur = _hexablock_swig.copy_vecteur +calc_milieu = _hexablock_swig.calc_milieu +normer_vecteur = _hexablock_swig.normer_vecteur +carre = _hexablock_swig.carre +on_debug = _hexablock_swig.on_debug +in_test = _hexablock_swig.in_test +niv_debug = _hexablock_swig.niv_debug +set_minus = _hexablock_swig.set_minus +special_option = _hexablock_swig.special_option +set_special_option = _hexablock_swig.set_special_option +sizeof_file = _hexablock_swig.sizeof_file +read_file = _hexablock_swig.read_file +get_time = _hexablock_swig.get_time +class EltBase(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, EltBase, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, EltBase, name) + __repr__ = _swig_repr + def countHexa(*args): return _hexablock_swig.EltBase_countHexa(*args) + def countQuad(*args): return _hexablock_swig.EltBase_countQuad(*args) + def countEdge(*args): return _hexablock_swig.EltBase_countEdge(*args) + def countVertex(*args): return _hexablock_swig.EltBase_countVertex(*args) + def setError(*args): return _hexablock_swig.EltBase_setError(*args) + def getError(*args): return _hexablock_swig.EltBase_getError(*args) + def isValid(*args): return _hexablock_swig.EltBase_isValid(*args) + def isBad(*args): return _hexablock_swig.EltBase_isBad(*args) + def duplicate(*args): return _hexablock_swig.EltBase_duplicate(*args) + def clearAssociation(*args): return _hexablock_swig.EltBase_clearAssociation(*args) + def replaceEdge(*args): return _hexablock_swig.EltBase_replaceEdge(*args) + def replaceVertex(*args): return _hexablock_swig.EltBase_replaceVertex(*args) + def __init__(self, *args): + this = _hexablock_swig.new_EltBase(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _hexablock_swig.delete_EltBase + __del__ = lambda self : None; + def remove(*args): return _hexablock_swig.EltBase_remove(*args) + def suppress(*args): return _hexablock_swig.EltBase_suppress(*args) + def dump(*args): return _hexablock_swig.EltBase_dump(*args) + def saveXml(*args): return _hexablock_swig.EltBase_saveXml(*args) + def majReferences(*args): return _hexablock_swig.EltBase_majReferences(*args) + def makeVarName(*args): return _hexablock_swig.EltBase_makeVarName(*args) + __swig_getmethods__["makeName"] = lambda x: _hexablock_swig.EltBase_makeName + if _newclass:makeName = staticmethod(_hexablock_swig.EltBase_makeName) + def next(*args): return _hexablock_swig.EltBase_next(*args) + def setNext(*args): return _hexablock_swig.EltBase_setNext(*args) + def getId(*args): return _hexablock_swig.EltBase_getId(*args) + def setId(*args): return _hexablock_swig.EltBase_setId(*args) + def dad(*args): return _hexablock_swig.EltBase_dad(*args) + def getType(*args): return _hexablock_swig.EltBase_getType(*args) + def isHere(*args): return _hexablock_swig.EltBase_isHere(*args) + def isDeleted(*args): return _hexablock_swig.EltBase_isDeleted(*args) + def razReferences(*args): return _hexablock_swig.EltBase_razReferences(*args) + def addParent(*args): return _hexablock_swig.EltBase_addParent(*args) + def getNbrParents(*args): return _hexablock_swig.EltBase_getNbrParents(*args) + def hasParents(*args): return _hexablock_swig.EltBase_hasParents(*args) + def getFather(*args): return _hexablock_swig.EltBase_getFather(*args) + def getMark(*args): return _hexablock_swig.EltBase_getMark(*args) + def setMark(*args): return _hexablock_swig.EltBase_setMark(*args) + def printName(*args): return _hexablock_swig.EltBase_printName(*args) + def dumpRef(*args): return _hexablock_swig.EltBase_dumpRef(*args) + def getName(*args): return _hexablock_swig.EltBase_getName(*args) + def setName(*args): return _hexablock_swig.EltBase_setName(*args) + def debug(*args): return _hexablock_swig.EltBase_debug(*args) + def isAssociated(*args): return _hexablock_swig.EltBase_isAssociated(*args) + def getNextName(*args): return _hexablock_swig.EltBase_getNextName(*args) +EltBase_swigregister = _hexablock_swig.EltBase_swigregister +EltBase_swigregister(EltBase) +cvar = _hexablock_swig.cvar +ABR_TYPES = cvar.ABR_TYPES +fatal_error = _hexablock_swig.fatal_error +same_coords = _hexablock_swig.same_coords +requals = _hexablock_swig.requals +Epsil = cvar.Epsil +UnEpsil = cvar.UnEpsil +Epsil2 = cvar.Epsil2 +EltBase_makeName = _hexablock_swig.EltBase_makeName + +class Vertex(EltBase): + __swig_setmethods__ = {} + for _s in [EltBase]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, Vertex, name, value) + __swig_getmethods__ = {} + for _s in [EltBase]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, Vertex, name) + __repr__ = _swig_repr + def getX(*args): return _hexablock_swig.Vertex_getX(*args) + def getY(*args): return _hexablock_swig.Vertex_getY(*args) + def getZ(*args): return _hexablock_swig.Vertex_getZ(*args) + def setX(*args): return _hexablock_swig.Vertex_setX(*args) + def setY(*args): return _hexablock_swig.Vertex_setY(*args) + def setZ(*args): return _hexablock_swig.Vertex_setZ(*args) + def getAssoX(*args): return _hexablock_swig.Vertex_getAssoX(*args) + def getAssoY(*args): return _hexablock_swig.Vertex_getAssoY(*args) + def getAssoZ(*args): return _hexablock_swig.Vertex_getAssoZ(*args) + def setAssociation(*args): return _hexablock_swig.Vertex_setAssociation(*args) + def clearAssociation(*args): return _hexablock_swig.Vertex_clearAssociation(*args) + def setColor(*args): return _hexablock_swig.Vertex_setColor(*args) + def __init__(self, *args): + this = _hexablock_swig.new_Vertex(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _hexablock_swig.delete_Vertex + __del__ = lambda self : None; +Vertex_swigregister = _hexablock_swig.Vertex_swigregister +Vertex_swigregister(Vertex) + +class Edge(EltBase): + __swig_setmethods__ = {} + for _s in [EltBase]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, Edge, name, value) + __swig_getmethods__ = {} + for _s in [EltBase]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, Edge, name) + __repr__ = _swig_repr + def getVertex(*args): return _hexablock_swig.Edge_getVertex(*args) + def addAssociation(*args): return _hexablock_swig.Edge_addAssociation(*args) + def clearAssociation(*args): return _hexablock_swig.Edge_clearAssociation(*args) + def setColor(*args): return _hexablock_swig.Edge_setColor(*args) + def getWay(*args): return _hexablock_swig.Edge_getWay(*args) + def __init__(self, *args): + this = _hexablock_swig.new_Edge(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _hexablock_swig.delete_Edge + __del__ = lambda self : None; +Edge_swigregister = _hexablock_swig.Edge_swigregister +Edge_swigregister(Edge) + +class Quad(EltBase): + __swig_setmethods__ = {} + for _s in [EltBase]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, Quad, name, value) + __swig_getmethods__ = {} + for _s in [EltBase]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, Quad, name) + __repr__ = _swig_repr + def getEdge(*args): return _hexablock_swig.Quad_getEdge(*args) + def getVertex(*args): return _hexablock_swig.Quad_getVertex(*args) + def addAssociation(*args): return _hexablock_swig.Quad_addAssociation(*args) + def clearAssociation(*args): return _hexablock_swig.Quad_clearAssociation(*args) + def setColor(*args): return _hexablock_swig.Quad_setColor(*args) + def __init__(self, *args): + this = _hexablock_swig.new_Quad(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _hexablock_swig.delete_Quad + __del__ = lambda self : None; +Quad_swigregister = _hexablock_swig.Quad_swigregister +Quad_swigregister(Quad) + +class Hexa(EltBase): + __swig_setmethods__ = {} + for _s in [EltBase]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, Hexa, name, value) + __swig_getmethods__ = {} + for _s in [EltBase]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, Hexa, name) + __repr__ = _swig_repr + def getQuad(*args): return _hexablock_swig.Hexa_getQuad(*args) + def getEdge(*args): return _hexablock_swig.Hexa_getEdge(*args) + def getVertex(*args): return _hexablock_swig.Hexa_getVertex(*args) + def setColor(*args): return _hexablock_swig.Hexa_setColor(*args) + def __init__(self, *args): + this = _hexablock_swig.new_Hexa(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _hexablock_swig.delete_Hexa + __del__ = lambda self : None; +Hexa_swigregister = _hexablock_swig.Hexa_swigregister +Hexa_swigregister(Hexa) + +class Vector(EltBase): + __swig_setmethods__ = {} + for _s in [EltBase]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, Vector, name, value) + __swig_getmethods__ = {} + for _s in [EltBase]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, Vector, name) + __repr__ = _swig_repr + def getDx(*args): return _hexablock_swig.Vector_getDx(*args) + def getDy(*args): return _hexablock_swig.Vector_getDy(*args) + def getDz(*args): return _hexablock_swig.Vector_getDz(*args) + def getNorm(*args): return _hexablock_swig.Vector_getNorm(*args) + def getAngleX(*args): return _hexablock_swig.Vector_getAngleX(*args) + def __init__(self, *args): + this = _hexablock_swig.new_Vector(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _hexablock_swig.delete_Vector + __del__ = lambda self : None; +Vector_swigregister = _hexablock_swig.Vector_swigregister +Vector_swigregister(Vector) + +class Document(EltBase): + __swig_setmethods__ = {} + for _s in [EltBase]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, Document, name, value) + __swig_getmethods__ = {} + for _s in [EltBase]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, Document, name) + __repr__ = _swig_repr + def __init__(self, *args): + this = _hexablock_swig.new_Document(*args) + try: self.this.append(this) + except: self.this = this + def dump(*args): return _hexablock_swig.Document_dump(*args) + def setName(*args): return _hexablock_swig.Document_setName(*args) + def setLevel(*args): return _hexablock_swig.Document_setLevel(*args) + def save(*args): return _hexablock_swig.Document_save(*args) + def saveVtk(*args): return _hexablock_swig.Document_saveVtk(*args) + def purge(*args): return _hexablock_swig.Document_purge(*args) + def setTolerance(*args): return _hexablock_swig.Document_setTolerance(*args) + def getTolerance(*args): return _hexablock_swig.Document_getTolerance(*args) + def addVertex(*args): return _hexablock_swig.Document_addVertex(*args) + def addEdge(*args): return _hexablock_swig.Document_addEdge(*args) + def addEdgeVector(*args): return _hexablock_swig.Document_addEdgeVector(*args) + def addQuad(*args): return _hexablock_swig.Document_addQuad(*args) + def addQuadVertices(*args): return _hexablock_swig.Document_addQuadVertices(*args) + def addHexa(*args): return _hexablock_swig.Document_addHexa(*args) + def addHexaVertices(*args): return _hexablock_swig.Document_addHexaVertices(*args) + def addHexa2Quads(*args): return _hexablock_swig.Document_addHexa2Quads(*args) + def addHexa3Quads(*args): return _hexablock_swig.Document_addHexa3Quads(*args) + def addHexa4Quads(*args): return _hexablock_swig.Document_addHexa4Quads(*args) + def addHexa5Quads(*args): return _hexablock_swig.Document_addHexa5Quads(*args) + def addVector(*args): return _hexablock_swig.Document_addVector(*args) + def addVectorVertices(*args): return _hexablock_swig.Document_addVectorVertices(*args) + def addLaws(*args): return _hexablock_swig.Document_addLaws(*args) + def addHexaGroup(*args): return _hexablock_swig.Document_addHexaGroup(*args) + def addQuadGroup(*args): return _hexablock_swig.Document_addQuadGroup(*args) + def addQuadNodeGroup(*args): return _hexablock_swig.Document_addQuadNodeGroup(*args) + def addHexaNodeGroup(*args): return _hexablock_swig.Document_addHexaNodeGroup(*args) + def addEdgeGroup(*args): return _hexablock_swig.Document_addEdgeGroup(*args) + def addEdgeNodeGroup(*args): return _hexablock_swig.Document_addEdgeNodeGroup(*args) + def addVertexNodeGroup(*args): return _hexablock_swig.Document_addVertexNodeGroup(*args) + def makeTranslation(*args): return _hexablock_swig.Document_makeTranslation(*args) + def makeScale(*args): return _hexablock_swig.Document_makeScale(*args) + def makeRotation(*args): return _hexablock_swig.Document_makeRotation(*args) + def makeSymmetryPoint(*args): return _hexablock_swig.Document_makeSymmetryPoint(*args) + def makeSymmetryLine(*args): return _hexablock_swig.Document_makeSymmetryLine(*args) + def makeSymmetryPlane(*args): return _hexablock_swig.Document_makeSymmetryPlane(*args) + def performTranslation(*args): return _hexablock_swig.Document_performTranslation(*args) + def performScale(*args): return _hexablock_swig.Document_performScale(*args) + def performRotation(*args): return _hexablock_swig.Document_performRotation(*args) + def performSymmetryPoint(*args): return _hexablock_swig.Document_performSymmetryPoint(*args) + def performSymmetryLine(*args): return _hexablock_swig.Document_performSymmetryLine(*args) + def performSymmetryPlane(*args): return _hexablock_swig.Document_performSymmetryPlane(*args) + def disconnectQuad(*args): return _hexablock_swig.Document_disconnectQuad(*args) + def disconnectEdge(*args): return _hexablock_swig.Document_disconnectEdge(*args) + def disconnectVertex(*args): return _hexablock_swig.Document_disconnectVertex(*args) + def disconnectEdges(*args): return _hexablock_swig.Document_disconnectEdges(*args) + def replace(*args): return _hexablock_swig.Document_replace(*args) + def mergeVertices(*args): return _hexablock_swig.Document_mergeVertices(*args) + def mergeEdges(*args): return _hexablock_swig.Document_mergeEdges(*args) + def mergeQuads(*args): return _hexablock_swig.Document_mergeQuads(*args) + def clearAssociation(*args): return _hexablock_swig.Document_clearAssociation(*args) + def associateOpenedLine(*args): return _hexablock_swig.Document_associateOpenedLine(*args) + def associateClosedLine(*args): return _hexablock_swig.Document_associateClosedLine(*args) + def countHexa(*args): return _hexablock_swig.Document_countHexa(*args) + def countQuad(*args): return _hexablock_swig.Document_countQuad(*args) + def countEdge(*args): return _hexablock_swig.Document_countEdge(*args) + def countVertex(*args): return _hexablock_swig.Document_countVertex(*args) + def countVector(*args): return _hexablock_swig.Document_countVector(*args) + def countGroup(*args): return _hexablock_swig.Document_countGroup(*args) + def countLaw(*args): return _hexablock_swig.Document_countLaw(*args) + def countPropagation(*args): return _hexablock_swig.Document_countPropagation(*args) + def countShape(*args): return _hexablock_swig.Document_countShape(*args) + def countUsedHexa(*args): return _hexablock_swig.Document_countUsedHexa(*args) + def countUsedQuad(*args): return _hexablock_swig.Document_countUsedQuad(*args) + def countUsedEdge(*args): return _hexablock_swig.Document_countUsedEdge(*args) + def countUsedVertex(*args): return _hexablock_swig.Document_countUsedVertex(*args) + def countCylinder(*args): return _hexablock_swig.Document_countCylinder(*args) + def countPipe(*args): return _hexablock_swig.Document_countPipe(*args) + def getHexa(*args): return _hexablock_swig.Document_getHexa(*args) + def getQuad(*args): return _hexablock_swig.Document_getQuad(*args) + def getEdge(*args): return _hexablock_swig.Document_getEdge(*args) + def getVertex(*args): return _hexablock_swig.Document_getVertex(*args) + def getUsedHexa(*args): return _hexablock_swig.Document_getUsedHexa(*args) + def getUsedQuad(*args): return _hexablock_swig.Document_getUsedQuad(*args) + def getUsedEdge(*args): return _hexablock_swig.Document_getUsedEdge(*args) + def getUsedVertex(*args): return _hexablock_swig.Document_getUsedVertex(*args) + def getVector(*args): return _hexablock_swig.Document_getVector(*args) + def getCylinder(*args): return _hexablock_swig.Document_getCylinder(*args) + def getPipe(*args): return _hexablock_swig.Document_getPipe(*args) + def getShape(*args): return _hexablock_swig.Document_getShape(*args) + def getGroup(*args): return _hexablock_swig.Document_getGroup(*args) + def getLaw(*args): return _hexablock_swig.Document_getLaw(*args) + def getPropagation(*args): return _hexablock_swig.Document_getPropagation(*args) + def findEdge(*args): return _hexablock_swig.Document_findEdge(*args) + def findQuad(*args): return _hexablock_swig.Document_findQuad(*args) + def findHexa(*args): return _hexablock_swig.Document_findHexa(*args) + def findGroup(*args): return _hexablock_swig.Document_findGroup(*args) + def findLaw(*args): return _hexablock_swig.Document_findLaw(*args) + def findPropagation(*args): return _hexablock_swig.Document_findPropagation(*args) + def removeHexa(*args): return _hexablock_swig.Document_removeHexa(*args) + def removeQuad(*args): return _hexablock_swig.Document_removeQuad(*args) + def removeConnectedHexa(*args): return _hexablock_swig.Document_removeConnectedHexa(*args) + def removeElements(*args): return _hexablock_swig.Document_removeElements(*args) + def removeGroup(*args): return _hexablock_swig.Document_removeGroup(*args) + def removeLaw(*args): return _hexablock_swig.Document_removeLaw(*args) + def makeCartesianTop(*args): return _hexablock_swig.Document_makeCartesianTop(*args) + def makeCartesianUni(*args): return _hexablock_swig.Document_makeCartesianUni(*args) + def makeCylinderTop(*args): return _hexablock_swig.Document_makeCylinderTop(*args) + def makeCylinderUni(*args): return _hexablock_swig.Document_makeCylinderUni(*args) + def makeCylinder(*args): return _hexablock_swig.Document_makeCylinder(*args) + def makePipeTop(*args): return _hexablock_swig.Document_makePipeTop(*args) + def makePipeUni(*args): return _hexablock_swig.Document_makePipeUni(*args) + def makePipe(*args): return _hexablock_swig.Document_makePipe(*args) + def makeSphericalTop(*args): return _hexablock_swig.Document_makeSphericalTop(*args) + def makeSphericalUni(*args): return _hexablock_swig.Document_makeSphericalUni(*args) + def makeSpherical(*args): return _hexablock_swig.Document_makeSpherical(*args) + def makeSphereTop(*args): return _hexablock_swig.Document_makeSphereTop(*args) + def makeSphereUni(*args): return _hexablock_swig.Document_makeSphereUni(*args) + def makeSphere(*args): return _hexablock_swig.Document_makeSphere(*args) + def makeRindTop(*args): return _hexablock_swig.Document_makeRindTop(*args) + def makeRindUni(*args): return _hexablock_swig.Document_makeRindUni(*args) + def makeRind(*args): return _hexablock_swig.Document_makeRind(*args) + def makeCylinders(*args): return _hexablock_swig.Document_makeCylinders(*args) + def makePipes(*args): return _hexablock_swig.Document_makePipes(*args) + def extrudeQuadTop(*args): return _hexablock_swig.Document_extrudeQuadTop(*args) + def extrudeQuadUni(*args): return _hexablock_swig.Document_extrudeQuadUni(*args) + def extrudeQuad(*args): return _hexablock_swig.Document_extrudeQuad(*args) + def extrudeQuadsTop(*args): return _hexablock_swig.Document_extrudeQuadsTop(*args) + def extrudeQuadsUni(*args): return _hexablock_swig.Document_extrudeQuadsUni(*args) + def extrudeQuads(*args): return _hexablock_swig.Document_extrudeQuads(*args) + def revolutionQuadUni(*args): return _hexablock_swig.Document_revolutionQuadUni(*args) + def revolutionQuad(*args): return _hexablock_swig.Document_revolutionQuad(*args) + def revolutionQuadsUni(*args): return _hexablock_swig.Document_revolutionQuadsUni(*args) + def revolutionQuads(*args): return _hexablock_swig.Document_revolutionQuads(*args) + def joinQuadUni(*args): return _hexablock_swig.Document_joinQuadUni(*args) + def joinQuadsUni(*args): return _hexablock_swig.Document_joinQuadsUni(*args) + def joinQuad(*args): return _hexablock_swig.Document_joinQuad(*args) + def joinQuads(*args): return _hexablock_swig.Document_joinQuads(*args) + def cutUni(*args): return _hexablock_swig.Document_cutUni(*args) + def cut(*args): return _hexablock_swig.Document_cut(*args) + def addGroup(*args): return _hexablock_swig.Document_addGroup(*args) + def isSaved(*args): return _hexablock_swig.Document_isSaved(*args) + def appendXml(*args): return _hexablock_swig.Document_appendXml(*args) + def getXml(*args): return _hexablock_swig.Document_getXml(*args) + def getLevel(*args): return _hexablock_swig.Document_getLevel(*args) + def makeCartesian(*args): return _hexablock_swig.Document_makeCartesian(*args) + def findVertex(*args): return _hexablock_swig.Document_findVertex(*args) + def closeQuads(*args): return _hexablock_swig.Document_closeQuads(*args) + def addLaw(*args): return _hexablock_swig.Document_addLaw(*args) + def checkAssociations(*args): return _hexablock_swig.Document_checkAssociations(*args) + def addShape(*args): return _hexablock_swig.Document_addShape(*args) + __swig_destroy__ = _hexablock_swig.delete_Document + __del__ = lambda self : None; +Document_swigregister = _hexablock_swig.Document_swigregister +Document_swigregister(Document) + +class Propagation(EltBase): + __swig_setmethods__ = {} + for _s in [EltBase]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, Propagation, name, value) + __swig_getmethods__ = {} + for _s in [EltBase]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, Propagation, name) + __repr__ = _swig_repr + def getEdges(*args): return _hexablock_swig.Propagation_getEdges(*args) + def getLaw(*args): return _hexablock_swig.Propagation_getLaw(*args) + def getWay(*args): return _hexablock_swig.Propagation_getWay(*args) + def setWay(*args): return _hexablock_swig.Propagation_setWay(*args) + def setLaw(*args): return _hexablock_swig.Propagation_setLaw(*args) + def __init__(self, *args): + this = _hexablock_swig.new_Propagation(*args) + try: self.this.append(this) + except: self.this = this + def saveXml(*args): return _hexablock_swig.Propagation_saveXml(*args) + def addEdge(*args): return _hexablock_swig.Propagation_addEdge(*args) + def majLaw(*args): return _hexablock_swig.Propagation_majLaw(*args) + __swig_destroy__ = _hexablock_swig.delete_Propagation + __del__ = lambda self : None; +Propagation_swigregister = _hexablock_swig.Propagation_swigregister +Propagation_swigregister(Propagation) + +hex_instance = _hexablock_swig.hex_instance +class Hex(_object): + __swig_setmethods__ = {} + __setattr__ = lambda self, name, value: _swig_setattr(self, Hex, name, value) + __swig_getmethods__ = {} + __getattr__ = lambda self, name: _swig_getattr(self, Hex, name) + __repr__ = _swig_repr + __swig_getmethods__["getInstance"] = lambda x: _hexablock_swig.Hex_getInstance + if _newclass:getInstance = staticmethod(_hexablock_swig.Hex_getInstance) + def countDocument(*args): return _hexablock_swig.Hex_countDocument(*args) + def getDocument(*args): return _hexablock_swig.Hex_getDocument(*args) + def removeDocument(*args): return _hexablock_swig.Hex_removeDocument(*args) + def addDocument(*args): return _hexablock_swig.Hex_addDocument(*args) + def loadDocument(*args): return _hexablock_swig.Hex_loadDocument(*args) + def findDocument(*args): return _hexablock_swig.Hex_findDocument(*args) + def what(*args): return _hexablock_swig.Hex_what(*args) + def sizeofMessage(*args): return _hexablock_swig.Hex_sizeofMessage(*args) + def getMessageLine(*args): return _hexablock_swig.Hex_getMessageLine(*args) + def __init__(self, *args): + this = _hexablock_swig.new_Hex(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _hexablock_swig.delete_Hex + __del__ = lambda self : None; +Hex_swigregister = _hexablock_swig.Hex_swigregister +Hex_swigregister(Hex) +Hex_getInstance = _hexablock_swig.Hex_getInstance + +what = _hexablock_swig.what +class Elements(EltBase): + __swig_setmethods__ = {} + for _s in [EltBase]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, Elements, name, value) + __swig_getmethods__ = {} + for _s in [EltBase]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, Elements, name) + __repr__ = _swig_repr + def getHexa(*args): return _hexablock_swig.Elements_getHexa(*args) + def getQuad(*args): return _hexablock_swig.Elements_getQuad(*args) + def getEdge(*args): return _hexablock_swig.Elements_getEdge(*args) + def getVertex(*args): return _hexablock_swig.Elements_getVertex(*args) + def getHexaIJK(*args): return _hexablock_swig.Elements_getHexaIJK(*args) + def getQuadIJ(*args): return _hexablock_swig.Elements_getQuadIJ(*args) + def getQuadJK(*args): return _hexablock_swig.Elements_getQuadJK(*args) + def getQuadIK(*args): return _hexablock_swig.Elements_getQuadIK(*args) + def getEdgeI(*args): return _hexablock_swig.Elements_getEdgeI(*args) + def getEdgeJ(*args): return _hexablock_swig.Elements_getEdgeJ(*args) + def getEdgeK(*args): return _hexablock_swig.Elements_getEdgeK(*args) + def getVertexIJK(*args): return _hexablock_swig.Elements_getVertexIJK(*args) + def countHexa(*args): return _hexablock_swig.Elements_countHexa(*args) + def countQuad(*args): return _hexablock_swig.Elements_countQuad(*args) + def countEdge(*args): return _hexablock_swig.Elements_countEdge(*args) + def countVertex(*args): return _hexablock_swig.Elements_countVertex(*args) + def nearestVertex(*args): return _hexablock_swig.Elements_nearestVertex(*args) + def findVertex(*args): return _hexablock_swig.Elements_findVertex(*args) + def clearAssociation(*args): return _hexablock_swig.Elements_clearAssociation(*args) + def saveVtk(*args): return _hexablock_swig.Elements_saveVtk(*args) + def __init__(self, *args): + this = _hexablock_swig.new_Elements(*args) + try: self.this.append(this) + except: self.this = this + __swig_destroy__ = _hexablock_swig.delete_Elements + __del__ = lambda self : None; +Elements_swigregister = _hexablock_swig.Elements_swigregister +Elements_swigregister(Elements) + +NbrSlices1 = _hexablock_swig.NbrSlices1 +NbrSlices2 = _hexablock_swig.NbrSlices2 +SizeRay = _hexablock_swig.SizeRay +BiCyl = _hexablock_swig.BiCyl +NbrVSlices1 = _hexablock_swig.NbrVSlices1 +NbrVSlices2 = _hexablock_swig.NbrVSlices2 +MiddleSlice1 = _hexablock_swig.MiddleSlice1 +Cyl1 = _hexablock_swig.Cyl1 +Cyl2 = _hexablock_swig.Cyl2 +NO_CYL = _hexablock_swig.NO_CYL +NO_PIPE = _hexablock_swig.NO_PIPE +IS_HERE = _hexablock_swig.IS_HERE +class CrossElements(Elements): + __swig_setmethods__ = {} + for _s in [Elements]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, CrossElements, name, value) + __swig_getmethods__ = {} + for _s in [Elements]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, CrossElements, name) + __repr__ = _swig_repr + def __init__(self, *args): + this = _hexablock_swig.new_CrossElements(*args) + try: self.this.append(this) + except: self.this = this + def getHexaIJK(*args): return _hexablock_swig.CrossElements_getHexaIJK(*args) + def getQuadIJ(*args): return _hexablock_swig.CrossElements_getQuadIJ(*args) + def getQuadJK(*args): return _hexablock_swig.CrossElements_getQuadJK(*args) + def getQuadIK(*args): return _hexablock_swig.CrossElements_getQuadIK(*args) + def getEdgeI(*args): return _hexablock_swig.CrossElements_getEdgeI(*args) + def getEdgeJ(*args): return _hexablock_swig.CrossElements_getEdgeJ(*args) + def getEdgeK(*args): return _hexablock_swig.CrossElements_getEdgeK(*args) + def getVertexIJK(*args): return _hexablock_swig.CrossElements_getVertexIJK(*args) + __swig_destroy__ = _hexablock_swig.delete_CrossElements + __del__ = lambda self : None; +CrossElements_swigregister = _hexablock_swig.CrossElements_swigregister +CrossElements_swigregister(CrossElements) + +class BiCylinder(Elements): + __swig_setmethods__ = {} + for _s in [Elements]: __swig_setmethods__.update(getattr(_s,'__swig_setmethods__',{})) + __setattr__ = lambda self, name, value: _swig_setattr(self, BiCylinder, name, value) + __swig_getmethods__ = {} + for _s in [Elements]: __swig_getmethods__.update(getattr(_s,'__swig_getmethods__',{})) + __getattr__ = lambda self, name: _swig_getattr(self, BiCylinder, name) + __repr__ = _swig_repr + def __init__(self, *args): + this = _hexablock_swig.new_BiCylinder(*args) + try: self.this.append(this) + except: self.this = this + def getHexaIJK(*args): return _hexablock_swig.BiCylinder_getHexaIJK(*args) + def getQuadIJ(*args): return _hexablock_swig.BiCylinder_getQuadIJ(*args) + def getQuadJK(*args): return _hexablock_swig.BiCylinder_getQuadJK(*args) + def getQuadIK(*args): return _hexablock_swig.BiCylinder_getQuadIK(*args) + def getEdgeI(*args): return _hexablock_swig.BiCylinder_getEdgeI(*args) + def getEdgeJ(*args): return _hexablock_swig.BiCylinder_getEdgeJ(*args) + def getEdgeK(*args): return _hexablock_swig.BiCylinder_getEdgeK(*args) + def getVertexIJK(*args): return _hexablock_swig.BiCylinder_getVertexIJK(*args) + __swig_destroy__ = _hexablock_swig.delete_BiCylinder + __del__ = lambda self : None; +BiCylinder_swigregister = _hexablock_swig.BiCylinder_swigregister +BiCylinder_swigregister(BiCylinder) + + + diff --git a/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc b/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc new file mode 100644 index 0000000..cf339f3 --- /dev/null +++ b/src/HEXABLOCK_SWIG/hexablock_swig_wrap.cc @@ -0,0 +1,31458 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 1.3.31 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGPYTHON +#define SWIG_PYTHON_DIRECTOR_NO_VTABLE + +#ifdef __cplusplus +template class SwigValueWrapper { + T *tt; +public: + SwigValueWrapper() : tt(0) { } + SwigValueWrapper(const SwigValueWrapper& rhs) : tt(new T(*rhs.tt)) { } + SwigValueWrapper(const T& t) : tt(new T(t)) { } + ~SwigValueWrapper() { delete tt; } + SwigValueWrapper& operator=(const T& t) { delete tt; tt = new T(t); return *this; } + operator T&() const { return *tt; } + T *operator&() { return tt; } +private: + SwigValueWrapper& operator=(const SwigValueWrapper& rhs); +}; +#endif + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) +# if (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + + +/* Python.h has to appear first */ +#include + +/* ----------------------------------------------------------------------------- + * swigrun.swg + * + * This file contains generic CAPI SWIG runtime support for pointer + * type checking. + * ----------------------------------------------------------------------------- */ + +/* This should only be incremented when either the layout of swig_type_info changes, + or for whatever reason, the runtime changes incompatibly */ +#define SWIG_RUNTIME_VERSION "3" + +/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ +#ifdef SWIG_TYPE_TABLE +# define SWIG_QUOTE_STRING(x) #x +# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) +# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) +#else +# define SWIG_TYPE_TABLE_NAME +#endif + +/* + You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for + creating a static or dynamic library from the swig runtime code. + In 99.9% of the cases, swig just needs to declare them as 'static'. + + But only do this if is strictly necessary, ie, if you have problems + with your compiler or so. +*/ + +#ifndef SWIGRUNTIME +# define SWIGRUNTIME SWIGINTERN +#endif + +#ifndef SWIGRUNTIMEINLINE +# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE +#endif + +/* Generic buffer size */ +#ifndef SWIG_BUFFER_SIZE +# define SWIG_BUFFER_SIZE 1024 +#endif + +/* Flags for pointer conversions */ +#define SWIG_POINTER_DISOWN 0x1 + +/* Flags for new pointer objects */ +#define SWIG_POINTER_OWN 0x1 + + +/* + Flags/methods for returning states. + + The swig conversion methods, as ConvertPtr, return and integer + that tells if the conversion was successful or not. And if not, + an error code can be returned (see swigerrors.swg for the codes). + + Use the following macros/flags to set or process the returning + states. + + In old swig versions, you usually write code as: + + if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { + // success code + } else { + //fail code + } + + Now you can be more explicit as: + + int res = SWIG_ConvertPtr(obj,vptr,ty.flags); + if (SWIG_IsOK(res)) { + // success code + } else { + // fail code + } + + that seems to be the same, but now you can also do + + Type *ptr; + int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); + if (SWIG_IsOK(res)) { + // success code + if (SWIG_IsNewObj(res) { + ... + delete *ptr; + } else { + ... + } + } else { + // fail code + } + + I.e., now SWIG_ConvertPtr can return new objects and you can + identify the case and take care of the deallocation. Of course that + requires also to SWIG_ConvertPtr to return new result values, as + + int SWIG_ConvertPtr(obj, ptr,...) { + if () { + if () { + *ptr = ; + return SWIG_NEWOBJ; + } else { + *ptr = ; + return SWIG_OLDOBJ; + } + } else { + return SWIG_BADOBJ; + } + } + + Of course, returning the plain '0(success)/-1(fail)' still works, but you can be + more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the + swig errors code. + + Finally, if the SWIG_CASTRANK_MODE is enabled, the result code + allows to return the 'cast rank', for example, if you have this + + int food(double) + int fooi(int); + + and you call + + food(1) // cast rank '1' (1 -> 1.0) + fooi(1) // cast rank '0' + + just use the SWIG_AddCast()/SWIG_CheckState() + + + */ +#define SWIG_OK (0) +#define SWIG_ERROR (-1) +#define SWIG_IsOK(r) (r >= 0) +#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) + +/* The CastRankLimit says how many bits are used for the cast rank */ +#define SWIG_CASTRANKLIMIT (1 << 8) +/* The NewMask denotes the object was created (using new/malloc) */ +#define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) +/* The TmpMask is for in/out typemaps that use temporal objects */ +#define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) +/* Simple returning values */ +#define SWIG_BADOBJ (SWIG_ERROR) +#define SWIG_OLDOBJ (SWIG_OK) +#define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) +#define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) +/* Check, add and del mask methods */ +#define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) +#define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) +#define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) +#define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) +#define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) +#define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) + + +/* Cast-Rank Mode */ +#if defined(SWIG_CASTRANK_MODE) +# ifndef SWIG_TypeRank +# define SWIG_TypeRank unsigned long +# endif +# ifndef SWIG_MAXCASTRANK /* Default cast allowed */ +# define SWIG_MAXCASTRANK (2) +# endif +# define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) +# define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) +SWIGINTERNINLINE int SWIG_AddCast(int r) { + return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; +} +SWIGINTERNINLINE int SWIG_CheckState(int r) { + return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; +} +#else /* no cast-rank mode */ +# define SWIG_AddCast +# define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) +#endif + + + + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef void *(*swig_converter_func)(void *); +typedef struct swig_type_info *(*swig_dycast_func)(void **); + +/* Structure to store inforomation on one type */ +typedef struct swig_type_info { + const char *name; /* mangled name of this type */ + const char *str; /* human readable name of this type */ + swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ + struct swig_cast_info *cast; /* linked list of types that can cast into this type */ + void *clientdata; /* language specific type data */ + int owndata; /* flag if the structure owns the clientdata */ +} swig_type_info; + +/* Structure to store a type and conversion function used for casting */ +typedef struct swig_cast_info { + swig_type_info *type; /* pointer to type that is equivalent to this type */ + swig_converter_func converter; /* function to cast the void pointers */ + struct swig_cast_info *next; /* pointer to next cast in linked list */ + struct swig_cast_info *prev; /* pointer to the previous cast */ +} swig_cast_info; + +/* Structure used to store module information + * Each module generates one structure like this, and the runtime collects + * all of these structures and stores them in a circularly linked list.*/ +typedef struct swig_module_info { + swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ + size_t size; /* Number of types in this module */ + struct swig_module_info *next; /* Pointer to next element in circularly linked list */ + swig_type_info **type_initial; /* Array of initially generated type structures */ + swig_cast_info **cast_initial; /* Array of initially generated casting structures */ + void *clientdata; /* Language specific module data */ +} swig_module_info; + +/* + Compare two type names skipping the space characters, therefore + "char*" == "char *" and "Class" == "Class", etc. + + Return 0 when the two name types are equivalent, as in + strncmp, but skipping ' '. +*/ +SWIGRUNTIME int +SWIG_TypeNameComp(const char *f1, const char *l1, + const char *f2, const char *l2) { + for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { + while ((*f1 == ' ') && (f1 != l1)) ++f1; + while ((*f2 == ' ') && (f2 != l2)) ++f2; + if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; + } + return (l1 - f1) - (l2 - f2); +} + +/* + Check type equivalence in a name list like ||... + Return 0 if not equal, 1 if equal +*/ +SWIGRUNTIME int +SWIG_TypeEquiv(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + +/* + Check type equivalence in a name list like ||... + Return 0 if equal, -1 if nb < tb, 1 if nb > tb +*/ +SWIGRUNTIME int +SWIG_TypeCompare(const char *nb, const char *tb) { + int equiv = 0; + const char* te = tb + strlen(tb); + const char* ne = nb; + while (!equiv && *ne) { + for (nb = ne; *ne; ++ne) { + if (*ne == '|') break; + } + equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0; + if (*ne) ++ne; + } + return equiv; +} + + +/* think of this as a c++ template<> or a scheme macro */ +#define SWIG_TypeCheck_Template(comparison, ty) \ + if (ty) { \ + swig_cast_info *iter = ty->cast; \ + while (iter) { \ + if (comparison) { \ + if (iter == ty->cast) return iter; \ + /* Move iter to the top of the linked list */ \ + iter->prev->next = iter->next; \ + if (iter->next) \ + iter->next->prev = iter->prev; \ + iter->next = ty->cast; \ + iter->prev = 0; \ + if (ty->cast) ty->cast->prev = iter; \ + ty->cast = iter; \ + return iter; \ + } \ + iter = iter->next; \ + } \ + } \ + return 0 + +/* + Check the typename +*/ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheck(const char *c, swig_type_info *ty) { + SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty); +} + +/* Same as previous function, except strcmp is replaced with a pointer comparison */ +SWIGRUNTIME swig_cast_info * +SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) { + SWIG_TypeCheck_Template(iter->type == from, into); +} + +/* + Cast a pointer up an inheritance hierarchy +*/ +SWIGRUNTIMEINLINE void * +SWIG_TypeCast(swig_cast_info *ty, void *ptr) { + return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr); +} + +/* + Dynamic pointer casting. Down an inheritance hierarchy +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { + swig_type_info *lastty = ty; + if (!ty || !ty->dcast) return ty; + while (ty && (ty->dcast)) { + ty = (*ty->dcast)(ptr); + if (ty) lastty = ty; + } + return lastty; +} + +/* + Return the name associated with this type +*/ +SWIGRUNTIMEINLINE const char * +SWIG_TypeName(const swig_type_info *ty) { + return ty->name; +} + +/* + Return the pretty name associated with this type, + that is an unmangled type name in a form presentable to the user. +*/ +SWIGRUNTIME const char * +SWIG_TypePrettyName(const swig_type_info *type) { + /* The "str" field contains the equivalent pretty names of the + type, separated by vertical-bar characters. We choose + to print the last name, as it is often (?) the most + specific. */ + if (!type) return NULL; + if (type->str != NULL) { + const char *last_name = type->str; + const char *s; + for (s = type->str; *s; s++) + if (*s == '|') last_name = s+1; + return last_name; + } + else + return type->name; +} + +/* + Set the clientdata field for a type +*/ +SWIGRUNTIME void +SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { + swig_cast_info *cast = ti->cast; + /* if (ti->clientdata == clientdata) return; */ + ti->clientdata = clientdata; + + while (cast) { + if (!cast->converter) { + swig_type_info *tc = cast->type; + if (!tc->clientdata) { + SWIG_TypeClientData(tc, clientdata); + } + } + cast = cast->next; + } +} +SWIGRUNTIME void +SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { + SWIG_TypeClientData(ti, clientdata); + ti->owndata = 1; +} + +/* + Search for a swig_type_info structure only by mangled name + Search is a O(log #types) + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_MangledTypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + swig_module_info *iter = start; + do { + if (iter->size) { + register size_t l = 0; + register size_t r = iter->size - 1; + do { + /* since l+r >= 0, we can (>> 1) instead (/ 2) */ + register size_t i = (l + r) >> 1; + const char *iname = iter->types[i]->name; + if (iname) { + register int compare = strcmp(name, iname); + if (compare == 0) { + return iter->types[i]; + } else if (compare < 0) { + if (i) { + r = i - 1; + } else { + break; + } + } else if (compare > 0) { + l = i + 1; + } + } else { + break; /* should never happen */ + } + } while (l <= r); + } + iter = iter->next; + } while (iter != end); + return 0; +} + +/* + Search for a swig_type_info structure for either a mangled name or a human readable name. + It first searches the mangled names of the types, which is a O(log #types) + If a type is not found it then searches the human readable names, which is O(#types). + + We start searching at module start, and finish searching when start == end. + Note: if start == end at the beginning of the function, we go all the way around + the circular list. +*/ +SWIGRUNTIME swig_type_info * +SWIG_TypeQueryModule(swig_module_info *start, + swig_module_info *end, + const char *name) { + /* STEP 1: Search the name field using binary search */ + swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); + if (ret) { + return ret; + } else { + /* STEP 2: If the type hasn't been found, do a complete search + of the str field (the human readable name) */ + swig_module_info *iter = start; + do { + register size_t i = 0; + for (; i < iter->size; ++i) { + if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) + return iter->types[i]; + } + iter = iter->next; + } while (iter != end); + } + + /* neither found a match */ + return 0; +} + +/* + Pack binary data into a string +*/ +SWIGRUNTIME char * +SWIG_PackData(char *c, void *ptr, size_t sz) { + static const char hex[17] = "0123456789abcdef"; + register const unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register unsigned char uu = *u; + *(c++) = hex[(uu & 0xf0) >> 4]; + *(c++) = hex[uu & 0xf]; + } + return c; +} + +/* + Unpack binary data from a string +*/ +SWIGRUNTIME const char * +SWIG_UnpackData(const char *c, void *ptr, size_t sz) { + register unsigned char *u = (unsigned char *) ptr; + register const unsigned char *eu = u + sz; + for (; u != eu; ++u) { + register char d = *(c++); + register unsigned char uu; + if ((d >= '0') && (d <= '9')) + uu = ((d - '0') << 4); + else if ((d >= 'a') && (d <= 'f')) + uu = ((d - ('a'-10)) << 4); + else + return (char *) 0; + d = *(c++); + if ((d >= '0') && (d <= '9')) + uu |= (d - '0'); + else if ((d >= 'a') && (d <= 'f')) + uu |= (d - ('a'-10)); + else + return (char *) 0; + *u = uu; + } + return c; +} + +/* + Pack 'void *' into a string buffer. +*/ +SWIGRUNTIME char * +SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { + char *r = buff; + if ((2*sizeof(void *) + 2) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,&ptr,sizeof(void *)); + if (strlen(name) + 1 > (bsz - (r - buff))) return 0; + strcpy(r,name); + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + *ptr = (void *) 0; + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sizeof(void *)); +} + +SWIGRUNTIME char * +SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { + char *r = buff; + size_t lname = (name ? strlen(name) : 0); + if ((2*sz + 2 + lname) > bsz) return 0; + *(r++) = '_'; + r = SWIG_PackData(r,ptr,sz); + if (lname) { + strncpy(r,name,lname+1); + } else { + *r = 0; + } + return buff; +} + +SWIGRUNTIME const char * +SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { + if (*c != '_') { + if (strcmp(c,"NULL") == 0) { + memset(ptr,0,sz); + return name; + } else { + return 0; + } + } + return SWIG_UnpackData(++c,ptr,sz); +} + +#ifdef __cplusplus +} +#endif + +/* Errors in SWIG */ +#define SWIG_UnknownError -1 +#define SWIG_IOError -2 +#define SWIG_RuntimeError -3 +#define SWIG_IndexError -4 +#define SWIG_TypeError -5 +#define SWIG_DivisionByZero -6 +#define SWIG_OverflowError -7 +#define SWIG_SyntaxError -8 +#define SWIG_ValueError -9 +#define SWIG_SystemError -10 +#define SWIG_AttributeError -11 +#define SWIG_MemoryError -12 +#define SWIG_NullReferenceError -13 + + + + +/* Add PyOS_snprintf for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) +# define PyOS_snprintf _snprintf +# else +# define PyOS_snprintf snprintf +# endif +#endif + +/* A crude PyString_FromFormat implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 + +#ifndef SWIG_PYBUFFER_SIZE +# define SWIG_PYBUFFER_SIZE 1024 +#endif + +static PyObject * +PyString_FromFormat(const char *fmt, ...) { + va_list ap; + char buf[SWIG_PYBUFFER_SIZE * 2]; + int res; + va_start(ap, fmt); + res = vsnprintf(buf, sizeof(buf), fmt, ap); + va_end(ap); + return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); +} +#endif + +/* Add PyObject_Del for old Pythons */ +#if PY_VERSION_HEX < 0x01060000 +# define PyObject_Del(op) PyMem_DEL((op)) +#endif +#ifndef PyObject_DEL +# define PyObject_DEL PyObject_Del +#endif + +/* A crude PyExc_StopIteration exception for old Pythons */ +#if PY_VERSION_HEX < 0x02020000 +# ifndef PyExc_StopIteration +# define PyExc_StopIteration PyExc_RuntimeError +# endif +# ifndef PyObject_GenericGetAttr +# define PyObject_GenericGetAttr 0 +# endif +#endif +/* Py_NotImplemented is defined in 2.1 and up. */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef Py_NotImplemented +# define Py_NotImplemented PyExc_RuntimeError +# endif +#endif + + +/* A crude PyString_AsStringAndSize implementation for old Pythons */ +#if PY_VERSION_HEX < 0x02010000 +# ifndef PyString_AsStringAndSize +# define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} +# endif +#endif + +/* PySequence_Size for old Pythons */ +#if PY_VERSION_HEX < 0x02000000 +# ifndef PySequence_Size +# define PySequence_Size PySequence_Length +# endif +#endif + + +/* PyBool_FromLong for old Pythons */ +#if PY_VERSION_HEX < 0x02030000 +static +PyObject *PyBool_FromLong(long ok) +{ + PyObject *result = ok ? Py_True : Py_False; + Py_INCREF(result); + return result; +} +#endif + +/* Py_ssize_t for old Pythons */ +/* This code is as recommended by: */ +/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ +#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) +typedef int Py_ssize_t; +# define PY_SSIZE_T_MAX INT_MAX +# define PY_SSIZE_T_MIN INT_MIN +#endif + +/* ----------------------------------------------------------------------------- + * error manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIME PyObject* +SWIG_Python_ErrorType(int code) { + PyObject* type = 0; + switch(code) { + case SWIG_MemoryError: + type = PyExc_MemoryError; + break; + case SWIG_IOError: + type = PyExc_IOError; + break; + case SWIG_RuntimeError: + type = PyExc_RuntimeError; + break; + case SWIG_IndexError: + type = PyExc_IndexError; + break; + case SWIG_TypeError: + type = PyExc_TypeError; + break; + case SWIG_DivisionByZero: + type = PyExc_ZeroDivisionError; + break; + case SWIG_OverflowError: + type = PyExc_OverflowError; + break; + case SWIG_SyntaxError: + type = PyExc_SyntaxError; + break; + case SWIG_ValueError: + type = PyExc_ValueError; + break; + case SWIG_SystemError: + type = PyExc_SystemError; + break; + case SWIG_AttributeError: + type = PyExc_AttributeError; + break; + default: + type = PyExc_RuntimeError; + } + return type; +} + + +SWIGRUNTIME void +SWIG_Python_AddErrorMsg(const char* mesg) +{ + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + + if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (value) { + PyObject *old_str = PyObject_Str(value); + PyErr_Clear(); + Py_XINCREF(type); + PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + Py_DECREF(old_str); + Py_DECREF(value); + } else { + PyErr_Format(PyExc_RuntimeError, mesg); + } +} + + + +#if defined(SWIG_PYTHON_NO_THREADS) +# if defined(SWIG_PYTHON_THREADS) +# undef SWIG_PYTHON_THREADS +# endif +#endif +#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ +# if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) +# if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ +# define SWIG_PYTHON_USE_GIL +# endif +# endif +# if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ +# ifndef SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() +# endif +# ifdef __cplusplus /* C++ code */ + class SWIG_Python_Thread_Block { + bool status; + PyGILState_STATE state; + public: + void end() { if (status) { PyGILState_Release(state); status = false;} } + SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} + ~SWIG_Python_Thread_Block() { end(); } + }; + class SWIG_Python_Thread_Allow { + bool status; + PyThreadState *save; + public: + void end() { if (status) { PyEval_RestoreThread(save); status = false; }} + SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} + ~SWIG_Python_Thread_Allow() { end(); } + }; +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block +# define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow +# define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() +# else /* C code */ +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() +# define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() +# define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) +# endif +# else /* Old thread way, not implemented, user must provide it */ +# if !defined(SWIG_PYTHON_INITIALIZE_THREADS) +# define SWIG_PYTHON_INITIALIZE_THREADS +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_END_BLOCK) +# define SWIG_PYTHON_THREAD_END_BLOCK +# endif +# if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# endif +# if !defined(SWIG_PYTHON_THREAD_END_ALLOW) +# define SWIG_PYTHON_THREAD_END_ALLOW +# endif +# endif +#else /* No thread support */ +# define SWIG_PYTHON_INITIALIZE_THREADS +# define SWIG_PYTHON_THREAD_BEGIN_BLOCK +# define SWIG_PYTHON_THREAD_END_BLOCK +# define SWIG_PYTHON_THREAD_BEGIN_ALLOW +# define SWIG_PYTHON_THREAD_END_ALLOW +#endif + +/* ----------------------------------------------------------------------------- + * Python API portion that goes into the runtime + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* cc-mode */ +#endif +#endif + +/* ----------------------------------------------------------------------------- + * Constant declarations + * ----------------------------------------------------------------------------- */ + +/* Constant Types */ +#define SWIG_PY_POINTER 4 +#define SWIG_PY_BINARY 5 + +/* Constant information structure */ +typedef struct swig_const_info { + int type; + char *name; + long lvalue; + double dvalue; + void *pvalue; + swig_type_info **ptype; +} swig_const_info; + +#ifdef __cplusplus +#if 0 +{ /* cc-mode */ +#endif +} +#endif + + +/* ----------------------------------------------------------------------------- + * See the LICENSE file for information on copyright, usage and redistribution + * of SWIG, and the README file for authors - http://www.swig.org/release.html. + * + * pyrun.swg + * + * This file contains the runtime support for Python modules + * and includes code for managing global variables and pointer + * type checking. + * + * ----------------------------------------------------------------------------- */ + +/* Common SWIG API */ + +/* for raw pointers */ +#define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) +#define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) +#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) +#define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(ptr, type, flags) +#define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) +#define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) +#define swig_owntype int + +/* for raw packed data */ +#define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + +/* for class or struct pointers */ +#define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) +#define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) + +/* for C or C++ function pointers */ +#define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) +#define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(ptr, type, 0) + +/* for C++ member pointers, ie, member methods */ +#define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) +#define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) + + +/* Runtime API */ + +#define SWIG_GetModule(clientdata) SWIG_Python_GetModule() +#define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) +#define SWIG_NewClientData(obj) PySwigClientData_New(obj) + +#define SWIG_SetErrorObj SWIG_Python_SetErrorObj +#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg +#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) +#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) +#define SWIG_fail goto fail + + +/* Runtime API implementation */ + +/* Error manipulation */ + +SWIGINTERN void +SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetObject(errtype, obj); + Py_DECREF(obj); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +SWIGINTERN void +SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + PyErr_SetString(errtype, (char *) msg); + SWIG_PYTHON_THREAD_END_BLOCK; +} + +#define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) + +/* Set a constant value */ + +SWIGINTERN void +SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { + PyDict_SetItemString(d, (char*) name, obj); + Py_DECREF(obj); +} + +/* Append a value to the result obj */ + +SWIGINTERN PyObject* +SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { +#if !defined(SWIG_PYTHON_OUTPUT_TUPLE) + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyList_Check(result)) { + PyObject *o2 = result; + result = PyList_New(1); + PyList_SetItem(result, 0, o2); + } + PyList_Append(result,obj); + Py_DECREF(obj); + } + return result; +#else + PyObject* o2; + PyObject* o3; + if (!result) { + result = obj; + } else if (result == Py_None) { + Py_DECREF(result); + result = obj; + } else { + if (!PyTuple_Check(result)) { + o2 = result; + result = PyTuple_New(1); + PyTuple_SET_ITEM(result, 0, o2); + } + o3 = PyTuple_New(1); + PyTuple_SET_ITEM(o3, 0, obj); + o2 = result; + result = PySequence_Concat(o2, o3); + Py_DECREF(o2); + Py_DECREF(o3); + } + return result; +#endif +} + +/* Unpack the argument tuple */ + +SWIGINTERN int +SWIG_Python_UnpackTuple(PyObject *args, const char *name, int min, int max, PyObject **objs) +{ + if (!args) { + if (!min && !max) { + return 1; + } else { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", + name, (min == max ? "" : "at least "), min); + return 0; + } + } + if (!PyTuple_Check(args)) { + PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); + return 0; + } else { + register int l = PyTuple_GET_SIZE(args); + if (l < min) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at least "), min, l); + return 0; + } else if (l > max) { + PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", + name, (min == max ? "" : "at most "), max, l); + return 0; + } else { + register int i; + for (i = 0; i < l; ++i) { + objs[i] = PyTuple_GET_ITEM(args, i); + } + for (; l < max; ++l) { + objs[l] = 0; + } + return i + 1; + } + } +} + +/* A functor is a function object with one single object argument */ +#if PY_VERSION_HEX >= 0x02020000 +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); +#else +#define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); +#endif + +/* + Helper for static pointer initialization for both C and C++ code, for example + static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); +*/ +#ifdef __cplusplus +#define SWIG_STATIC_POINTER(var) var +#else +#define SWIG_STATIC_POINTER(var) var = 0; if (!var) var +#endif + +/* ----------------------------------------------------------------------------- + * Pointer declarations + * ----------------------------------------------------------------------------- */ + +/* Flags for new pointer objects */ +#define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) +#define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) + +#define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* cc-mode */ +#endif +#endif + +/* How to access Py_None */ +#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# ifndef SWIG_PYTHON_NO_BUILD_NONE +# ifndef SWIG_PYTHON_BUILD_NONE +# define SWIG_PYTHON_BUILD_NONE +# endif +# endif +#endif + +#ifdef SWIG_PYTHON_BUILD_NONE +# ifdef Py_None +# undef Py_None +# define Py_None SWIG_Py_None() +# endif +SWIGRUNTIMEINLINE PyObject * +_SWIG_Py_None(void) +{ + PyObject *none = Py_BuildValue((char*)""); + Py_DECREF(none); + return none; +} +SWIGRUNTIME PyObject * +SWIG_Py_None(void) +{ + static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); + return none; +} +#endif + +/* The python void return value */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Py_Void(void) +{ + PyObject *none = Py_None; + Py_INCREF(none); + return none; +} + +/* PySwigClientData */ + +typedef struct { + PyObject *klass; + PyObject *newraw; + PyObject *newargs; + PyObject *destroy; + int delargs; + int implicitconv; +} PySwigClientData; + +SWIGRUNTIMEINLINE int +SWIG_Python_CheckImplicit(swig_type_info *ty) +{ + PySwigClientData *data = (PySwigClientData *)ty->clientdata; + return data ? data->implicitconv : 0; +} + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_ExceptionType(swig_type_info *desc) { + PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0; + PyObject *klass = data ? data->klass : 0; + return (klass ? klass : PyExc_RuntimeError); +} + + +SWIGRUNTIME PySwigClientData * +PySwigClientData_New(PyObject* obj) +{ + if (!obj) { + return 0; + } else { + PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData)); + /* the klass element */ + data->klass = obj; + Py_INCREF(data->klass); + /* the newraw method and newargs arguments used to create a new raw instance */ + if (PyClass_Check(obj)) { + data->newraw = 0; + data->newargs = obj; + Py_INCREF(obj); + } else { +#if (PY_VERSION_HEX < 0x02020000) + data->newraw = 0; +#else + data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); +#endif + if (data->newraw) { + Py_INCREF(data->newraw); + data->newargs = PyTuple_New(1); + PyTuple_SetItem(data->newargs, 0, obj); + } else { + data->newargs = obj; + } + Py_INCREF(data->newargs); + } + /* the destroy method, aka as the C++ delete method */ + data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + if (PyErr_Occurred()) { + PyErr_Clear(); + data->destroy = 0; + } + if (data->destroy) { + int flags; + Py_INCREF(data->destroy); + flags = PyCFunction_GET_FLAGS(data->destroy); +#ifdef METH_O + data->delargs = !(flags & (METH_O)); +#else + data->delargs = 0; +#endif + } else { + data->delargs = 0; + } + data->implicitconv = 0; + return data; + } +} + +SWIGRUNTIME void +PySwigClientData_Del(PySwigClientData* data) +{ + Py_XDECREF(data->newraw); + Py_XDECREF(data->newargs); + Py_XDECREF(data->destroy); +} + +/* =============== PySwigObject =====================*/ + +typedef struct { + PyObject_HEAD + void *ptr; + swig_type_info *ty; + int own; + PyObject *next; +} PySwigObject; + +SWIGRUNTIME PyObject * +PySwigObject_long(PySwigObject *v) +{ + return PyLong_FromVoidPtr(v->ptr); +} + +SWIGRUNTIME PyObject * +PySwigObject_format(const char* fmt, PySwigObject *v) +{ + PyObject *res = NULL; + PyObject *args = PyTuple_New(1); + if (args) { + if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) { + PyObject *ofmt = PyString_FromString(fmt); + if (ofmt) { + res = PyString_Format(ofmt,args); + Py_DECREF(ofmt); + } + Py_DECREF(args); + } + } + return res; +} + +SWIGRUNTIME PyObject * +PySwigObject_oct(PySwigObject *v) +{ + return PySwigObject_format("%o",v); +} + +SWIGRUNTIME PyObject * +PySwigObject_hex(PySwigObject *v) +{ + return PySwigObject_format("%x",v); +} + +SWIGRUNTIME PyObject * +#ifdef METH_NOARGS +PySwigObject_repr(PySwigObject *v) +#else +PySwigObject_repr(PySwigObject *v, PyObject *args) +#endif +{ + const char *name = SWIG_TypePrettyName(v->ty); + PyObject *hex = PySwigObject_hex(v); + PyObject *repr = PyString_FromFormat("", name, PyString_AsString(hex)); + Py_DECREF(hex); + if (v->next) { +#ifdef METH_NOARGS + PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next); +#else + PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args); +#endif + PyString_ConcatAndDel(&repr,nrep); + } + return repr; +} + +SWIGRUNTIME int +PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +{ +#ifdef METH_NOARGS + PyObject *repr = PySwigObject_repr(v); +#else + PyObject *repr = PySwigObject_repr(v, NULL); +#endif + if (repr) { + fputs(PyString_AsString(repr), fp); + Py_DECREF(repr); + return 0; + } else { + return 1; + } +} + +SWIGRUNTIME PyObject * +PySwigObject_str(PySwigObject *v) +{ + char result[SWIG_BUFFER_SIZE]; + return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? + PyString_FromString(result) : 0; +} + +SWIGRUNTIME int +PySwigObject_compare(PySwigObject *v, PySwigObject *w) +{ + void *i = v->ptr; + void *j = w->ptr; + return (i < j) ? -1 : ((i > j) ? 1 : 0); +} + +SWIGRUNTIME PyTypeObject* _PySwigObject_type(void); + +SWIGRUNTIME PyTypeObject* +PySwigObject_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type(); + return type; +} + +SWIGRUNTIMEINLINE int +PySwigObject_Check(PyObject *op) { + return ((op)->ob_type == PySwigObject_type()) + || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0); +} + +SWIGRUNTIME PyObject * +PySwigObject_New(void *ptr, swig_type_info *ty, int own); + +SWIGRUNTIME void +PySwigObject_dealloc(PyObject *v) +{ + PySwigObject *sobj = (PySwigObject *) v; + PyObject *next = sobj->next; + if (sobj->own) { + swig_type_info *ty = sobj->ty; + PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + PyObject *destroy = data ? data->destroy : 0; + if (destroy) { + /* destroy is always a VARARGS method */ + PyObject *res; + if (data->delargs) { + /* we need to create a temporal object to carry the destroy operation */ + PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0); + res = SWIG_Python_CallFunctor(destroy, tmp); + Py_DECREF(tmp); + } else { + PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); + PyObject *mself = PyCFunction_GET_SELF(destroy); + res = ((*meth)(mself, v)); + } + Py_XDECREF(res); + } else { + const char *name = SWIG_TypePrettyName(ty); +#if !defined(SWIG_PYTHON_SILENT_MEMLEAK) + printf("swig/python detected a memory leak of type '%s', no destructor found.\n", name); +#endif + } + } + Py_XDECREF(next); + PyObject_DEL(v); +} + +SWIGRUNTIME PyObject* +PySwigObject_append(PyObject* v, PyObject* next) +{ + PySwigObject *sobj = (PySwigObject *) v; +#ifndef METH_O + PyObject *tmp = 0; + if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; + next = tmp; +#endif + if (!PySwigObject_Check(next)) { + return NULL; + } + sobj->next = next; + Py_INCREF(next); + return SWIG_Py_Void(); +} + +SWIGRUNTIME PyObject* +#ifdef METH_NOARGS +PySwigObject_next(PyObject* v) +#else +PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + PySwigObject *sobj = (PySwigObject *) v; + if (sobj->next) { + Py_INCREF(sobj->next); + return sobj->next; + } else { + return SWIG_Py_Void(); + } +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +PySwigObject_disown(PyObject *v) +#else +PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + PySwigObject *sobj = (PySwigObject *)v; + sobj->own = 0; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +#ifdef METH_NOARGS +PySwigObject_acquire(PyObject *v) +#else +PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) +#endif +{ + PySwigObject *sobj = (PySwigObject *)v; + sobj->own = SWIG_POINTER_OWN; + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject* +PySwigObject_own(PyObject *v, PyObject *args) +{ + PyObject *val = 0; +#if (PY_VERSION_HEX < 0x02020000) + if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) +#else + if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) +#endif + { + return NULL; + } + else + { + PySwigObject *sobj = (PySwigObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { +#ifdef METH_NOARGS + if (PyObject_IsTrue(val)) { + PySwigObject_acquire(v); + } else { + PySwigObject_disown(v); + } +#else + if (PyObject_IsTrue(val)) { + PySwigObject_acquire(v,args); + } else { + PySwigObject_disown(v,args); + } +#endif + } + return obj; + } +} + +#ifdef METH_O +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)PySwigObject_append, METH_O, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)PySwigObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_NOARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#else +static PyMethodDef +swigobject_methods[] = { + {(char *)"disown", (PyCFunction)PySwigObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, + {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, + {(char *)"own", (PyCFunction)PySwigObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, + {(char *)"append", (PyCFunction)PySwigObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, + {(char *)"next", (PyCFunction)PySwigObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, + {(char *)"__repr__",(PyCFunction)PySwigObject_repr, METH_VARARGS, (char *)"returns object representation"}, + {0, 0, 0, 0} +}; +#endif + +#if PY_VERSION_HEX < 0x02020000 +SWIGINTERN PyObject * +PySwigObject_getattr(PySwigObject *sobj,char *name) +{ + return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); +} +#endif + +SWIGRUNTIME PyTypeObject* +_PySwigObject_type(void) { + static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; + + static PyNumberMethods PySwigObject_as_number = { + (binaryfunc)0, /*nb_add*/ + (binaryfunc)0, /*nb_subtract*/ + (binaryfunc)0, /*nb_multiply*/ + (binaryfunc)0, /*nb_divide*/ + (binaryfunc)0, /*nb_remainder*/ + (binaryfunc)0, /*nb_divmod*/ + (ternaryfunc)0,/*nb_power*/ + (unaryfunc)0, /*nb_negative*/ + (unaryfunc)0, /*nb_positive*/ + (unaryfunc)0, /*nb_absolute*/ + (inquiry)0, /*nb_nonzero*/ + 0, /*nb_invert*/ + 0, /*nb_lshift*/ + 0, /*nb_rshift*/ + 0, /*nb_and*/ + 0, /*nb_xor*/ + 0, /*nb_or*/ + (coercion)0, /*nb_coerce*/ + (unaryfunc)PySwigObject_long, /*nb_int*/ + (unaryfunc)PySwigObject_long, /*nb_long*/ + (unaryfunc)0, /*nb_float*/ + (unaryfunc)PySwigObject_oct, /*nb_oct*/ + (unaryfunc)PySwigObject_hex, /*nb_hex*/ +#if PY_VERSION_HEX >= 0x02020000 + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ +#elif PY_VERSION_HEX >= 0x02000000 + 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ +#endif + }; + + static PyTypeObject pyswigobject_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp + = { + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ + (char *)"PySwigObject", /* tp_name */ + sizeof(PySwigObject), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)PySwigObject_dealloc, /* tp_dealloc */ + (printfunc)PySwigObject_print, /* tp_print */ +#if PY_VERSION_HEX < 0x02020000 + (getattrfunc)PySwigObject_getattr, /* tp_getattr */ +#else + (getattrfunc)0, /* tp_getattr */ +#endif + (setattrfunc)0, /* tp_setattr */ + (cmpfunc)PySwigObject_compare, /* tp_compare */ + (reprfunc)PySwigObject_repr, /* tp_repr */ + &PySwigObject_as_number, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)PySwigObject_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigobject_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + swigobject_methods, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#ifdef COUNT_ALLOCS + 0,0,0,0 /* tp_alloc -> tp_next */ +#endif + }; + pyswigobject_type = tmp; + pyswigobject_type.ob_type = &PyType_Type; + type_init = 1; + } + return &pyswigobject_type; +} + +SWIGRUNTIME PyObject * +PySwigObject_New(void *ptr, swig_type_info *ty, int own) +{ + PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type()); + if (sobj) { + sobj->ptr = ptr; + sobj->ty = ty; + sobj->own = own; + sobj->next = 0; + } + return (PyObject *)sobj; +} + +/* ----------------------------------------------------------------------------- + * Implements a simple Swig Packed type, and use it instead of string + * ----------------------------------------------------------------------------- */ + +typedef struct { + PyObject_HEAD + void *pack; + swig_type_info *ty; + size_t size; +} PySwigPacked; + +SWIGRUNTIME int +PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) +{ + char result[SWIG_BUFFER_SIZE]; + fputs("pack, v->size, 0, sizeof(result))) { + fputs("at ", fp); + fputs(result, fp); + } + fputs(v->ty->name,fp); + fputs(">", fp); + return 0; +} + +SWIGRUNTIME PyObject * +PySwigPacked_repr(PySwigPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { + return PyString_FromFormat("", result, v->ty->name); + } else { + return PyString_FromFormat("", v->ty->name); + } +} + +SWIGRUNTIME PyObject * +PySwigPacked_str(PySwigPacked *v) +{ + char result[SWIG_BUFFER_SIZE]; + if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ + return PyString_FromFormat("%s%s", result, v->ty->name); + } else { + return PyString_FromString(v->ty->name); + } +} + +SWIGRUNTIME int +PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w) +{ + size_t i = v->size; + size_t j = w->size; + int s = (i < j) ? -1 : ((i > j) ? 1 : 0); + return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); +} + +SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void); + +SWIGRUNTIME PyTypeObject* +PySwigPacked_type(void) { + static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type(); + return type; +} + +SWIGRUNTIMEINLINE int +PySwigPacked_Check(PyObject *op) { + return ((op)->ob_type == _PySwigPacked_type()) + || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0); +} + +SWIGRUNTIME void +PySwigPacked_dealloc(PyObject *v) +{ + if (PySwigPacked_Check(v)) { + PySwigPacked *sobj = (PySwigPacked *) v; + free(sobj->pack); + } + PyObject_DEL(v); +} + +SWIGRUNTIME PyTypeObject* +_PySwigPacked_type(void) { + static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; + static PyTypeObject pyswigpacked_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp + = { + PyObject_HEAD_INIT(NULL) + 0, /* ob_size */ + (char *)"PySwigPacked", /* tp_name */ + sizeof(PySwigPacked), /* tp_basicsize */ + 0, /* tp_itemsize */ + (destructor)PySwigPacked_dealloc, /* tp_dealloc */ + (printfunc)PySwigPacked_print, /* tp_print */ + (getattrfunc)0, /* tp_getattr */ + (setattrfunc)0, /* tp_setattr */ + (cmpfunc)PySwigPacked_compare, /* tp_compare */ + (reprfunc)PySwigPacked_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + (hashfunc)0, /* tp_hash */ + (ternaryfunc)0, /* tp_call */ + (reprfunc)PySwigPacked_str, /* tp_str */ + PyObject_GenericGetAttr, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT, /* tp_flags */ + swigpacked_doc, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0, /* tp_iter */ + 0, /* tp_iternext */ + 0, /* tp_methods */ + 0, /* tp_members */ + 0, /* tp_getset */ + 0, /* tp_base */ + 0, /* tp_dict */ + 0, /* tp_descr_get */ + 0, /* tp_descr_set */ + 0, /* tp_dictoffset */ + 0, /* tp_init */ + 0, /* tp_alloc */ + 0, /* tp_new */ + 0, /* tp_free */ + 0, /* tp_is_gc */ + 0, /* tp_bases */ + 0, /* tp_mro */ + 0, /* tp_cache */ + 0, /* tp_subclasses */ + 0, /* tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#ifdef COUNT_ALLOCS + 0,0,0,0 /* tp_alloc -> tp_next */ +#endif + }; + pyswigpacked_type = tmp; + pyswigpacked_type.ob_type = &PyType_Type; + type_init = 1; + } + return &pyswigpacked_type; +} + +SWIGRUNTIME PyObject * +PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty) +{ + PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type()); + if (sobj) { + void *pack = malloc(size); + if (pack) { + memcpy(pack, ptr, size); + sobj->pack = pack; + sobj->ty = ty; + sobj->size = size; + } else { + PyObject_DEL((PyObject *) sobj); + sobj = 0; + } + } + return (PyObject *) sobj; +} + +SWIGRUNTIME swig_type_info * +PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size) +{ + if (PySwigPacked_Check(obj)) { + PySwigPacked *sobj = (PySwigPacked *)obj; + if (sobj->size != size) return 0; + memcpy(ptr, sobj->pack, size); + return sobj->ty; + } else { + return 0; + } +} + +/* ----------------------------------------------------------------------------- + * pointers/data manipulation + * ----------------------------------------------------------------------------- */ + +SWIGRUNTIMEINLINE PyObject * +_SWIG_This(void) +{ + return PyString_FromString("this"); +} + +SWIGRUNTIME PyObject * +SWIG_This(void) +{ + static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This(); + return swig_this; +} + +/* #define SWIG_PYTHON_SLOW_GETSET_THIS */ + +SWIGRUNTIME PySwigObject * +SWIG_Python_GetSwigThis(PyObject *pyobj) +{ + if (PySwigObject_Check(pyobj)) { + return (PySwigObject *) pyobj; + } else { + PyObject *obj = 0; +#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) + if (PyInstance_Check(pyobj)) { + obj = _PyInstance_Lookup(pyobj, SWIG_This()); + } else { + PyObject **dictptr = _PyObject_GetDictPtr(pyobj); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; + } else { +#ifdef PyWeakref_CheckProxy + if (PyWeakref_CheckProxy(pyobj)) { + PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); + return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; + } +#endif + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } + } + } +#else + obj = PyObject_GetAttr(pyobj,SWIG_This()); + if (obj) { + Py_DECREF(obj); + } else { + if (PyErr_Occurred()) PyErr_Clear(); + return 0; + } +#endif + if (obj && !PySwigObject_Check(obj)) { + /* a PyObject is called 'this', try to get the 'real this' + PySwigObject from it */ + return SWIG_Python_GetSwigThis(obj); + } + return (PySwigObject *)obj; + } +} + +/* Acquire a pointer value */ + +SWIGRUNTIME int +SWIG_Python_AcquirePtr(PyObject *obj, int own) { + if (own) { + PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + if (sobj) { + int oldown = sobj->own; + sobj->own = own; + return oldown; + } + } + return 0; +} + +/* Convert a pointer value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { + if (!obj) return SWIG_ERROR; + if (obj == Py_None) { + if (ptr) *ptr = 0; + return SWIG_OK; + } else { + PySwigObject *sobj = SWIG_Python_GetSwigThis(obj); + while (sobj) { + void *vptr = sobj->ptr; + if (ty) { + swig_type_info *to = sobj->ty; + if (to == ty) { + /* no type cast needed */ + if (ptr) *ptr = vptr; + break; + } else { + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) { + sobj = (PySwigObject *)sobj->next; + } else { + if (ptr) *ptr = SWIG_TypeCast(tc,vptr); + break; + } + } + } else { + if (ptr) *ptr = vptr; + break; + } + } + if (sobj) { + if (own) *own = sobj->own; + if (flags & SWIG_POINTER_DISOWN) { + sobj->own = 0; + } + return SWIG_OK; + } else { + int res = SWIG_ERROR; + if (flags & SWIG_POINTER_IMPLICIT_CONV) { + PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0; + if (data && !data->implicitconv) { + PyObject *klass = data->klass; + if (klass) { + PyObject *impconv; + data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ + impconv = SWIG_Python_CallFunctor(klass, obj); + data->implicitconv = 0; + if (PyErr_Occurred()) { + PyErr_Clear(); + impconv = 0; + } + if (impconv) { + PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv); + if (iobj) { + void *vptr; + res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); + if (SWIG_IsOK(res)) { + if (ptr) { + *ptr = vptr; + /* transfer the ownership to 'ptr' */ + iobj->own = 0; + res = SWIG_AddCast(res); + res = SWIG_AddNewMask(res); + } else { + res = SWIG_AddCast(res); + } + } + } + Py_DECREF(impconv); + } + } + } + } + return res; + } + } +} + +/* Convert a function ptr value */ + +SWIGRUNTIME int +SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { + if (!PyCFunction_Check(obj)) { + return SWIG_ConvertPtr(obj, ptr, ty, 0); + } else { + void *vptr = 0; + + /* here we get the method pointer for callbacks */ + const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); + const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; + if (desc) { + desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; + if (!desc) return SWIG_ERROR; + } + if (ty) { + swig_cast_info *tc = SWIG_TypeCheck(desc,ty); + if (!tc) return SWIG_ERROR; + *ptr = SWIG_TypeCast(tc,vptr); + } else { + *ptr = vptr; + } + return SWIG_OK; + } +} + +/* Convert a packed value value */ + +SWIGRUNTIME int +SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { + swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz); + if (!to) return SWIG_ERROR; + if (ty) { + if (to != ty) { + /* check type cast? */ + swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); + if (!tc) return SWIG_ERROR; + } + } + return SWIG_OK; +} + +/* ----------------------------------------------------------------------------- + * Create a new pointer object + * ----------------------------------------------------------------------------- */ + +/* + Create a new instance object, whitout calling __init__, and set the + 'this' attribute. +*/ + +SWIGRUNTIME PyObject* +SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this) +{ +#if (PY_VERSION_HEX >= 0x02020000) + PyObject *inst = 0; + PyObject *newraw = data->newraw; + if (newraw) { + inst = PyObject_Call(newraw, data->newargs, NULL); + if (inst) { +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) + PyObject **dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + PyObject *dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + PyDict_SetItem(dict, SWIG_This(), swig_this); + } + } +#else + PyObject *key = SWIG_This(); + PyObject_SetAttr(inst, key, swig_this); +#endif + } + } else { + PyObject *dict = PyDict_New(); + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + } + return inst; +#else +#if (PY_VERSION_HEX >= 0x02010000) + PyObject *inst; + PyObject *dict = PyDict_New(); + PyDict_SetItem(dict, SWIG_This(), swig_this); + inst = PyInstance_NewRaw(data->newargs, dict); + Py_DECREF(dict); + return (PyObject *) inst; +#else + PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); + if (inst == NULL) { + return NULL; + } + inst->in_class = (PyClassObject *)data->newargs; + Py_INCREF(inst->in_class); + inst->in_dict = PyDict_New(); + if (inst->in_dict == NULL) { + Py_DECREF(inst); + return NULL; + } +#ifdef Py_TPFLAGS_HAVE_WEAKREFS + inst->in_weakreflist = NULL; +#endif +#ifdef Py_TPFLAGS_GC + PyObject_GC_Init(inst); +#endif + PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); + return (PyObject *) inst; +#endif +#endif +} + +SWIGRUNTIME void +SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) +{ + PyObject *dict; +#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) + PyObject **dictptr = _PyObject_GetDictPtr(inst); + if (dictptr != NULL) { + dict = *dictptr; + if (dict == NULL) { + dict = PyDict_New(); + *dictptr = dict; + } + PyDict_SetItem(dict, SWIG_This(), swig_this); + return; + } +#endif + dict = PyObject_GetAttrString(inst, (char*)"__dict__"); + PyDict_SetItem(dict, SWIG_This(), swig_this); + Py_DECREF(dict); +} + + +SWIGINTERN PyObject * +SWIG_Python_InitShadowInstance(PyObject *args) { + PyObject *obj[2]; + if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) { + return NULL; + } else { + PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]); + if (sthis) { + PySwigObject_append((PyObject*) sthis, obj[1]); + } else { + SWIG_Python_SetSwigThis(obj[0], obj[1]); + } + return SWIG_Py_Void(); + } +} + +/* Create a new pointer object */ + +SWIGRUNTIME PyObject * +SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) { + if (!ptr) { + return SWIG_Py_Void(); + } else { + int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; + PyObject *robj = PySwigObject_New(ptr, type, own); + PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0; + if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { + PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); + if (inst) { + Py_DECREF(robj); + robj = inst; + } + } + return robj; + } +} + +/* Create a new packed object */ + +SWIGRUNTIMEINLINE PyObject * +SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { + return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); +} + +/* -----------------------------------------------------------------------------* + * Get type list + * -----------------------------------------------------------------------------*/ + +#ifdef SWIG_LINK_RUNTIME +void *SWIG_ReturnGlobalTypeList(void *); +#endif + +SWIGRUNTIME swig_module_info * +SWIG_Python_GetModule(void) { + static void *type_pointer = (void *)0; + /* first check if module already created */ + if (!type_pointer) { +#ifdef SWIG_LINK_RUNTIME + type_pointer = SWIG_ReturnGlobalTypeList((void *)0); +#else + type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); + if (PyErr_Occurred()) { + PyErr_Clear(); + type_pointer = (void *)0; + } +#endif + } + return (swig_module_info *) type_pointer; +} + +#if PY_MAJOR_VERSION < 2 +/* PyModule_AddObject function was introduced in Python 2.0. The following function + is copied out of Python/modsupport.c in python version 2.3.4 */ +SWIGINTERN int +PyModule_AddObject(PyObject *m, char *name, PyObject *o) +{ + PyObject *dict; + if (!PyModule_Check(m)) { + PyErr_SetString(PyExc_TypeError, + "PyModule_AddObject() needs module as first arg"); + return SWIG_ERROR; + } + if (!o) { + PyErr_SetString(PyExc_TypeError, + "PyModule_AddObject() needs non-NULL value"); + return SWIG_ERROR; + } + + dict = PyModule_GetDict(m); + if (dict == NULL) { + /* Internal error -- modules must have a dict! */ + PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", + PyModule_GetName(m)); + return SWIG_ERROR; + } + if (PyDict_SetItemString(dict, name, o)) + return SWIG_ERROR; + Py_DECREF(o); + return SWIG_OK; +} +#endif + +SWIGRUNTIME void +SWIG_Python_DestroyModule(void *vptr) +{ + swig_module_info *swig_module = (swig_module_info *) vptr; + swig_type_info **types = swig_module->types; + size_t i; + for (i =0; i < swig_module->size; ++i) { + swig_type_info *ty = types[i]; + if (ty->owndata) { + PySwigClientData *data = (PySwigClientData *) ty->clientdata; + if (data) PySwigClientData_Del(data); + } + } + Py_DECREF(SWIG_This()); +} + +SWIGRUNTIME void +SWIG_Python_SetModule(swig_module_info *swig_module) { + static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */ + + PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, + swig_empty_runtime_method_table); + PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); + if (pointer && module) { + PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); + } else { + Py_XDECREF(pointer); + } +} + +/* The python cached type query */ +SWIGRUNTIME PyObject * +SWIG_Python_TypeCache(void) { + static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); + return cache; +} + +SWIGRUNTIME swig_type_info * +SWIG_Python_TypeQuery(const char *type) +{ + PyObject *cache = SWIG_Python_TypeCache(); + PyObject *key = PyString_FromString(type); + PyObject *obj = PyDict_GetItem(cache, key); + swig_type_info *descriptor; + if (obj) { + descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); + } else { + swig_module_info *swig_module = SWIG_Python_GetModule(); + descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); + if (descriptor) { + obj = PyCObject_FromVoidPtr(descriptor, NULL); + PyDict_SetItem(cache, key, obj); + Py_DECREF(obj); + } + } + Py_DECREF(key); + return descriptor; +} + +/* + For backward compatibility only +*/ +#define SWIG_POINTER_EXCEPTION 0 +#define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) +#define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) + +SWIGRUNTIME int +SWIG_Python_AddErrMesg(const char* mesg, int infront) +{ + if (PyErr_Occurred()) { + PyObject *type = 0; + PyObject *value = 0; + PyObject *traceback = 0; + PyErr_Fetch(&type, &value, &traceback); + if (value) { + PyObject *old_str = PyObject_Str(value); + Py_XINCREF(type); + PyErr_Clear(); + if (infront) { + PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str)); + } else { + PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg); + } + Py_DECREF(old_str); + } + return 1; + } else { + return 0; + } +} + +SWIGRUNTIME int +SWIG_Python_ArgFail(int argnum) +{ + if (PyErr_Occurred()) { + /* add information about failing argument */ + char mesg[256]; + PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); + return SWIG_Python_AddErrMesg(mesg, 1); + } else { + return 0; + } +} + +SWIGRUNTIMEINLINE const char * +PySwigObject_GetDesc(PyObject *self) +{ + PySwigObject *v = (PySwigObject *)self; + swig_type_info *ty = v ? v->ty : 0; + return ty ? ty->str : (char*)""; +} + +SWIGRUNTIME void +SWIG_Python_TypeError(const char *type, PyObject *obj) +{ + if (type) { +#if defined(SWIG_COBJECT_TYPES) + if (obj && PySwigObject_Check(obj)) { + const char *otype = (const char *) PySwigObject_GetDesc(obj); + if (otype) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received", + type, otype); + return; + } + } else +#endif + { + const char *otype = (obj ? obj->ob_type->tp_name : 0); + if (otype) { + PyObject *str = PyObject_Str(obj); + const char *cstr = str ? PyString_AsString(str) : 0; + if (cstr) { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", + type, otype, cstr); + } else { + PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", + type, otype); + } + Py_XDECREF(str); + return; + } + } + PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); + } else { + PyErr_Format(PyExc_TypeError, "unexpected type is received"); + } +} + + +/* Convert a pointer value, signal an exception on a type mismatch */ +SWIGRUNTIME void * +SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) { + void *result; + if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { + PyErr_Clear(); + if (flags & SWIG_POINTER_EXCEPTION) { + SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); + SWIG_Python_ArgFail(argnum); + } + } + return result; +} + + +#ifdef __cplusplus +#if 0 +{ /* cc-mode */ +#endif +} +#endif + + + +#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) + +#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else + + + + #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) + + +/* -------- TYPES TABLE (BEGIN) -------- */ + +#define SWIGTYPE_p_FILE swig_types[0] +#define SWIGTYPE_p_Hex__BiCylinder swig_types[1] +#define SWIGTYPE_p_Hex__CrossElements swig_types[2] +#define SWIGTYPE_p_Hex__Cylinder swig_types[3] +#define SWIGTYPE_p_Hex__Document swig_types[4] +#define SWIGTYPE_p_Hex__Edge swig_types[5] +#define SWIGTYPE_p_Hex__Elements swig_types[6] +#define SWIGTYPE_p_Hex__EltBase swig_types[7] +#define SWIGTYPE_p_Hex__Group swig_types[8] +#define SWIGTYPE_p_Hex__Hex swig_types[9] +#define SWIGTYPE_p_Hex__Hex__EltBase swig_types[10] +#define SWIGTYPE_p_Hex__Hexa swig_types[11] +#define SWIGTYPE_p_Hex__Law swig_types[12] +#define SWIGTYPE_p_Hex__NewShape swig_types[13] +#define SWIGTYPE_p_Hex__Pipe swig_types[14] +#define SWIGTYPE_p_Hex__Propagation swig_types[15] +#define SWIGTYPE_p_Hex__Quad swig_types[16] +#define SWIGTYPE_p_Hex__Shape swig_types[17] +#define SWIGTYPE_p_Hex__Vector swig_types[18] +#define SWIGTYPE_p_Hex__Vertex swig_types[19] +#define SWIGTYPE_p_Hex__XmlWriter swig_types[20] +#define SWIGTYPE_p_a_Hex__DIM3__double swig_types[21] +#define SWIGTYPE_p_allocator_type swig_types[22] +#define SWIGTYPE_p_char swig_types[23] +#define SWIGTYPE_p_const_reference swig_types[24] +#define SWIGTYPE_p_difference_type swig_types[25] +#define SWIGTYPE_p_double swig_types[26] +#define SWIGTYPE_p_int swig_types[27] +#define SWIGTYPE_p_p_PyObject swig_types[28] +#define SWIGTYPE_p_reference swig_types[29] +#define SWIGTYPE_p_size_type swig_types[30] +#define SWIGTYPE_p_std__invalid_argument swig_types[31] +#define SWIGTYPE_p_std__vectorTHex__AssoEdge_p_std__allocatorTHex__AssoEdge_p_t_t swig_types[32] +#define SWIGTYPE_p_std__vectorTHex__EdgeShape_p_std__allocatorTHex__EdgeShape_p_t_t swig_types[33] +#define SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t swig_types[34] +#define SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__allocator_type swig_types[35] +#define SWIGTYPE_p_std__vectorTHex__EltBase_p_std__allocatorTHex__EltBase_p_t_t swig_types[36] +#define SWIGTYPE_p_std__vectorTHex__FaceShape_p_std__allocatorTHex__FaceShape_p_t_t swig_types[37] +#define SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t swig_types[38] +#define SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__allocator_type swig_types[39] +#define SWIGTYPE_p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t swig_types[40] +#define SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t swig_types[41] +#define SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__allocator_type swig_types[42] +#define SWIGTYPE_p_std__vectorTHex__Shape_p_std__allocatorTHex__Shape_p_t_t swig_types[43] +#define SWIGTYPE_p_std__vectorTHex__SubShape_p_std__allocatorTHex__SubShape_p_t_t swig_types[44] +#define SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t swig_types[45] +#define SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__allocator_type swig_types[46] +#define SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t swig_types[47] +#define SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t__allocator_type swig_types[48] +#define SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t swig_types[49] +#define SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t__allocator_type swig_types[50] +#define SWIGTYPE_p_std__vectorTstd__string_std__allocatorTstd__string_t_t swig_types[51] +#define SWIGTYPE_p_string swig_types[52] +#define SWIGTYPE_p_swig__PySwigIterator swig_types[53] +#define SWIGTYPE_p_value_type swig_types[54] +#define SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type swig_types[55] +#define SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type swig_types[56] +#define SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type swig_types[57] +#define SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type swig_types[58] +static swig_type_info *swig_types[60]; +static swig_module_info swig_module = {swig_types, 59, 0, 0, 0, 0}; +#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) +#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) + +/* -------- TYPES TABLE (END) -------- */ + +#if (PY_VERSION_HEX <= 0x02000000) +# if !defined(SWIG_PYTHON_CLASSIC) +# error "This python version requires swig to be run with the '-classic' option" +# endif +#endif + +/*----------------------------------------------- + @(target):= _hexablock_swig.so + ------------------------------------------------*/ +#define SWIG_init init_hexablock_swig + +#define SWIG_name "_hexablock_swig" + +#define SWIGVERSION 0x010331 +#define SWIG_VERSION SWIGVERSION + + +#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) +#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) + + +#include + + +namespace swig { + class PyObject_ptr { + protected: + PyObject *_obj; + + public: + PyObject_ptr() :_obj(0) + { + } + + PyObject_ptr(const PyObject_ptr& item) : _obj(item._obj) + { + Py_XINCREF(_obj); + } + + PyObject_ptr(PyObject *obj, bool initial_ref = true) :_obj(obj) + { + if (initial_ref) Py_XINCREF(_obj); + } + + PyObject_ptr & operator=(const PyObject_ptr& item) + { + Py_XINCREF(item._obj); + Py_XDECREF(_obj); + _obj = item._obj; + return *this; + } + + ~PyObject_ptr() + { + Py_XDECREF(_obj); + } + + operator PyObject *() const + { + return _obj; + } + + PyObject *operator->() const + { + return _obj; + } + }; +} + + +namespace swig { + struct PyObject_var : PyObject_ptr { + PyObject_var(PyObject* obj = 0) : PyObject_ptr(obj, false) { } + + PyObject_var & operator = (PyObject* obj) + { + Py_XDECREF(_obj); + _obj = obj; + return *this; + } + }; +} + + +#include "Hex.hxx" +#include "HexDocument.hxx" +#include "HexPropagation.hxx" +#include "HexElements.hxx" +#include "HexQuad.hxx" +#include "HexVertex.hxx" +#include "HexHexa.hxx" +#include "HexEdge.hxx" +#include "HexVector.hxx" +#include "HexCrossElements.hxx" +#include "HexBiCylinder.hxx" + + +#include + + +#include + + + +#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) +# define SWIG_STD_NOASSIGN_STL +# define SWIG_STD_NOINSERT_TEMPLATE_STL +# define SWIG_STD_NOITERATOR_TRAITS_STL +#endif + +#if defined(__GNUC__) +# if __GNUC__ == 2 && __GNUC_MINOR <= 96 +# define SWIG_STD_NOMODERN_STL +# endif +#endif + + + + +#include +#include + + +namespace swig { + struct stop_iteration { + }; + + struct PySwigIterator { + private: + PyObject_ptr _seq; + + protected: + PySwigIterator(PyObject *seq) : _seq(seq) + { + } + + public: + virtual ~PySwigIterator() {} + + // Access iterator method, required by Python + virtual PyObject *value() const = 0; + + // Forward iterator method, required by Python + virtual PySwigIterator *incr(size_t n = 1) = 0; + + // Backward iterator method, very common in C++, but not required in Python + virtual PySwigIterator *decr(size_t n = 1) + { + throw stop_iteration(); + } + + // Random access iterator methods, but not required in Python + virtual ptrdiff_t distance(const PySwigIterator &x) const + { + throw std::invalid_argument("operation not supported"); + } + + virtual bool equal (const PySwigIterator &x) const + { + throw std::invalid_argument("operation not supported"); + } + + // C++ common/needed methods + virtual PySwigIterator *copy() const = 0; + + PyObject *next() + { + PyObject *obj = value(); + incr(); + return obj; + } + + PyObject *previous() + { + decr(); + return value(); + } + + PySwigIterator *advance(ptrdiff_t n) + { + return (n > 0) ? incr(n) : decr(-n); + } + + bool operator == (const PySwigIterator& x) const + { + return equal(x); + } + + bool operator != (const PySwigIterator& x) const + { + return ! operator==(x); + } + + PySwigIterator& operator += (ptrdiff_t n) + { + return *advance(n); + } + + PySwigIterator& operator -= (ptrdiff_t n) + { + return *advance(-n); + } + + PySwigIterator* operator + (ptrdiff_t n) const + { + return copy()->advance(n); + } + + PySwigIterator* operator - (ptrdiff_t n) const + { + return copy()->advance(-n); + } + + ptrdiff_t operator - (const PySwigIterator& x) const + { + return x.distance(*this); + } + + static swig_type_info* descriptor() { + static int init = 0; + static swig_type_info* desc = 0; + if (!init) { + desc = SWIG_TypeQuery("swig::PySwigIterator *"); + init = 1; + } + return desc; + } + }; +} + + +SWIGINTERN int +SWIG_AsVal_double (PyObject *obj, double *val) +{ + int res = SWIG_TypeError; + if (PyFloat_Check(obj)) { + if (val) *val = PyFloat_AsDouble(obj); + return SWIG_OK; + } else if (PyInt_Check(obj)) { + if (val) *val = PyInt_AsLong(obj); + return SWIG_OK; + } else if (PyLong_Check(obj)) { + double v = PyLong_AsDouble(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + double d = PyFloat_AsDouble(obj); + if (!PyErr_Occurred()) { + if (val) *val = d; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + long v = PyLong_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); + } else { + PyErr_Clear(); + } + } + } +#endif + return res; +} + + +#include + + +#include + + +SWIGINTERNINLINE int +SWIG_CanCastAsInteger(double *d, double min, double max) { + double x = *d; + if ((min <= x && x <= max)) { + double fx = floor(x); + double cx = ceil(x); + double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ + if ((errno == EDOM) || (errno == ERANGE)) { + errno = 0; + } else { + double summ, reps, diff; + if (rd < x) { + diff = x - rd; + } else if (rd > x) { + diff = rd - x; + } else { + return 1; + } + summ = rd + x; + reps = diff/summ; + if (reps < 8*DBL_EPSILON) { + *d = rd; + return 1; + } + } + } + return 0; +} + + +SWIGINTERN int +SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) +{ + if (PyInt_Check(obj)) { + long v = PyInt_AsLong(obj); + if (v >= 0) { + if (val) *val = v; + return SWIG_OK; + } else { + return SWIG_OverflowError; + } + } else if (PyLong_Check(obj)) { + unsigned long v = PyLong_AsUnsignedLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + unsigned long v = PyLong_AsUnsignedLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { + if (val) *val = (unsigned long)(d); + return res; + } + } + } +#endif + return SWIG_TypeError; +} + + +SWIGINTERNINLINE int +SWIG_AsVal_size_t (PyObject * obj, size_t *val) +{ + unsigned long v; + int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v); + return res; +} + + + #define SWIG_From_long PyInt_FromLong + + +SWIGINTERNINLINE PyObject * +SWIG_From_ptrdiff_t (ptrdiff_t value) +{ + return SWIG_From_long (static_cast< long >(value)); +} + + +SWIGINTERNINLINE PyObject* + SWIG_From_bool (bool value) +{ + return PyBool_FromLong(value ? 1 : 0); +} + + +SWIGINTERN int +SWIG_AsVal_long (PyObject *obj, long* val) +{ + if (PyInt_Check(obj)) { + if (val) *val = PyInt_AsLong(obj); + return SWIG_OK; + } else if (PyLong_Check(obj)) { + long v = PyLong_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + int dispatch = 0; + long v = PyInt_AsLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_AddCast(SWIG_OK); + } else { + PyErr_Clear(); + } + if (!dispatch) { + double d; + int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { + if (val) *val = (long)(d); + return res; + } + } + } +#endif + return SWIG_TypeError; +} + + +SWIGINTERNINLINE int +SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val) +{ + long v; + int res = SWIG_AsVal_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v); + return res; +} + + +#include + + +#include + + +#include + + +namespace swig { + template + struct noconst_traits { + typedef Type noconst_type; + }; + + template + struct noconst_traits { + typedef Type noconst_type; + }; + + /* + type categories + */ + struct pointer_category { }; + struct value_category { }; + + /* + General traits that provides type_name and type_info + */ + template struct traits { }; + + template + inline const char* type_name() { + return traits::noconst_type >::type_name(); + } + + template + struct traits_info { + static swig_type_info *type_query(std::string name) { + name += " *"; + return SWIG_TypeQuery(name.c_str()); + } + static swig_type_info *type_info() { + static swig_type_info *info = type_query(type_name()); + return info; + } + }; + + template + inline swig_type_info *type_info() { + return traits_info::type_info(); + } + + /* + Partial specialization for pointers + */ + template struct traits { + typedef pointer_category category; + static std::string make_ptr_name(const char* name) { + std::string ptrname = name; + ptrname += " *"; + return ptrname; + } + static const char* type_name() { + static std::string name = make_ptr_name(swig::type_name()); + return name.c_str(); + } + }; + + template + struct traits_as { }; + + template + struct traits_check { }; + +} + + +namespace swig { + /* + Traits that provides the from method + */ + template struct traits_from_ptr { + static PyObject *from(Type *val, int owner = 0) { + return SWIG_NewPointerObj(val, type_info(), owner); + } + }; + + template struct traits_from { + static PyObject *from(const Type& val) { + return traits_from_ptr::from(new Type(val), 1); + } + }; + + template struct traits_from { + static PyObject *from(Type* val) { + return traits_from_ptr::from(val, 0); + } + }; + + template struct traits_from { + static PyObject *from(const Type* val) { + return traits_from_ptr::from(const_cast(val), 0); + } + }; + + + template + inline PyObject *from(const Type& val) { + return traits_from::from(val); + } + + template + inline PyObject *from_ptr(Type* val, int owner) { + return traits_from_ptr::from(val, owner); + } + + /* + Traits that provides the asval/as/check method + */ + template + struct traits_asptr { + static int asptr(PyObject *obj, Type **val) { + Type *p; + int res = (SWIG_ConvertPtr(obj, (void**)&p, type_info(), 0) == SWIG_OK) ? SWIG_OLDOBJ : 0; + if (SWIG_IsOK(res)) { + if (val) *val = p; + } + return res; + } + }; + + template + inline int asptr(PyObject *obj, Type **vptr) { + return traits_asptr::asptr(obj, vptr); + } + + template + struct traits_asval { + static int asval(PyObject *obj, Type *val) { + if (val) { + Type *p = 0; + int res = traits_asptr::asptr(obj, &p); + if (!SWIG_IsOK(res)) return res; + if (p) { + typedef typename noconst_traits::noconst_type noconst_type; + *(const_cast(val)) = *p; + if (SWIG_IsNewObj(res)){ + delete p; + res = SWIG_DelNewMask(res); + } + return res; + } else { + return SWIG_ERROR; + } + } else { + return traits_asptr::asptr(obj, (Type **)(0)); + } + } + }; + + template struct traits_asval { + static int asval(PyObject *obj, Type **val) { + if (val) { + typedef typename noconst_traits::noconst_type noconst_type; + noconst_type *p = 0; + int res = traits_asptr::asptr(obj, &p); + if (SWIG_IsOK(res)) { + *(const_cast(val)) = p; + } + return res; + } else { + return traits_asptr::asptr(obj, (Type **)(0)); + } + } + }; + + template + inline int asval(PyObject *obj, Type *val) { + return traits_asval::asval(obj, val); + } + + template + struct traits_as { + static Type as(PyObject *obj, bool throw_error) { + Type v; + int res = asval(obj, &v); + if (!obj || !SWIG_IsOK(res)) { + if (!PyErr_Occurred()) { + SWIG_Error(SWIG_TypeError, swig::type_name()); + } + if (throw_error) throw std::invalid_argument("bad type"); + } + return v; + } + }; + + template + struct traits_as { + static Type as(PyObject *obj, bool throw_error) { + Type *v = 0; + int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); + if (SWIG_IsOK(res) && v) { + if (SWIG_IsNewObj(res)) { + Type r(*v); + delete v; + return r; + } else { + return *v; + } + } else { + // Uninitialized return value, no Type() constructor required. + static Type *v_def = (Type*) malloc(sizeof(Type)); + if (!PyErr_Occurred()) { + SWIG_Error(SWIG_TypeError, swig::type_name()); + } + if (throw_error) throw std::invalid_argument("bad type"); + memset(v_def,0,sizeof(Type)); + return *v_def; + } + } + }; + + template + struct traits_as { + static Type* as(PyObject *obj, bool throw_error) { + Type *v = 0; + int res = (obj ? traits_asptr::asptr(obj, &v) : SWIG_ERROR); + if (SWIG_IsOK(res)) { + return v; + } else { + if (!PyErr_Occurred()) { + SWIG_Error(SWIG_TypeError, swig::type_name()); + } + if (throw_error) throw std::invalid_argument("bad type"); + return 0; + } + } + }; + + template + inline Type as(PyObject *obj, bool te = false) { + return traits_as::category>::as(obj, te); + } + + template + struct traits_check { + static bool check(PyObject *obj) { + int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR; + return SWIG_IsOK(res) ? true : false; + } + }; + + template + struct traits_check { + static bool check(PyObject *obj) { + int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR; + return SWIG_IsOK(res) ? true : false; + } + }; + + template + inline bool check(PyObject *obj) { + return traits_check::category>::check(obj); + } +} + + +#include + +namespace std { + template <> + struct less : public binary_function + { + bool + operator()(PyObject * v, PyObject *w) const + { + bool res; + SWIG_PYTHON_THREAD_BEGIN_BLOCK; + res = PyObject_Compare(v, w) < 0; + SWIG_PYTHON_THREAD_END_BLOCK; + return res; + } + }; + + template <> + struct less : public binary_function + { + bool + operator()(const swig::PyObject_ptr& v, const swig::PyObject_ptr& w) const + { + return std::less()(v, w); + } + }; + + template <> + struct less : public binary_function + { + bool + operator()(const swig::PyObject_var& v, const swig::PyObject_var& w) const + { + return std::less()(v, w); + } + }; + +} + +namespace swig { + template <> struct traits { + typedef value_category category; + static const char* type_name() { return "PyObject *"; } + }; + + template <> struct traits_asval { + typedef PyObject * value_type; + static int asval(PyObject *obj, value_type *val) { + if (val) *val = obj; + return SWIG_OK; + } + }; + + template <> + struct traits_check { + static bool check(PyObject *) { + return true; + } + }; + + template <> struct traits_from { + typedef PyObject * value_type; + static PyObject *from(const value_type& val) { + Py_XINCREF(val); + return val; + } + }; + +} + +namespace swig { + inline size_t + check_index(ptrdiff_t i, size_t size, bool insert = false) { + if ( i < 0 ) { + if ((size_t) (-i) <= size) + return (size_t) (i + size); + } else if ( (size_t) i < size ) { + return (size_t) i; + } else if (insert && ((size_t) i == size)) { + return size; + } + + throw std::out_of_range("index out of range"); + } + + inline size_t + slice_index(ptrdiff_t i, size_t size) { + if ( i < 0 ) { + if ((size_t) (-i) <= size) { + return (size_t) (i + size); + } else { + throw std::out_of_range("index out of range"); + } + } else { + return ( (size_t) i < size ) ? ((size_t) i) : size; + } + } + + template + inline typename Sequence::iterator + getpos(Sequence* self, Difference i) { + typename Sequence::iterator pos = self->begin(); + std::advance(pos, check_index(i,self->size())); + return pos; + } + + template + inline typename Sequence::const_iterator + cgetpos(const Sequence* self, Difference i) { + typename Sequence::const_iterator pos = self->begin(); + std::advance(pos, check_index(i,self->size())); + return pos; + } + + template + inline Sequence* + getslice(const Sequence* self, Difference i, Difference j) { + typename Sequence::size_type size = self->size(); + typename Sequence::size_type ii = swig::check_index(i, size); + typename Sequence::size_type jj = swig::slice_index(j, size); + + if (jj > ii) { + typename Sequence::const_iterator vb = self->begin(); + typename Sequence::const_iterator ve = self->begin(); + std::advance(vb,ii); + std::advance(ve,jj); + return new Sequence(vb, ve); + } else { + return new Sequence(); + } + } + + template + inline void + setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) { + typename Sequence::size_type size = self->size(); + typename Sequence::size_type ii = swig::check_index(i, size, true); + typename Sequence::size_type jj = swig::slice_index(j, size); + if (jj < ii) jj = ii; + size_t ssize = jj - ii; + if (ssize <= v.size()) { + typename Sequence::iterator sb = self->begin(); + typename InputSeq::const_iterator vmid = v.begin(); + std::advance(sb,ii); + std::advance(vmid, jj - ii); + self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end()); + } else { + typename Sequence::iterator sb = self->begin(); + typename Sequence::iterator se = self->begin(); + std::advance(sb,ii); + std::advance(se,jj); + self->erase(sb,se); + self->insert(sb, v.begin(), v.end()); + } + } + + template + inline void + delslice(Sequence* self, Difference i, Difference j) { + typename Sequence::size_type size = self->size(); + typename Sequence::size_type ii = swig::check_index(i, size, true); + typename Sequence::size_type jj = swig::slice_index(j, size); + if (jj > ii) { + typename Sequence::iterator sb = self->begin(); + typename Sequence::iterator se = self->begin(); + std::advance(sb,ii); + std::advance(se,jj); + self->erase(sb,se); + } + } +} + + +#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL) +#include +#else +namespace std { + template + struct iterator_traits { + typedef ptrdiff_t difference_type; + typedef typename Iterator::value_type value_type; + }; + +#if defined(__SUNPRO_CC) && defined(_RWSTD_VER) + template + struct iterator_traits<__reverse_bi_iterator > { + typedef Distance difference_type; + typedef T value_type; + }; +#endif + + template + struct iterator_traits { + typedef T value_type; + typedef ptrdiff_t difference_type; + }; + + template + inline typename iterator_traits<_InputIterator>::difference_type + distance(_InputIterator __first, _InputIterator __last) + { + typename iterator_traits<_InputIterator>::difference_type __n = 0; + while (__first != __last) { + ++__first; ++__n; + } + return __n; + } + +} +#endif + + +namespace swig { + template + class PySwigIterator_T : public PySwigIterator + { + public: + typedef OutIterator out_iterator; + typedef typename std::iterator_traits::value_type value_type; + typedef PySwigIterator_T self_type; + + PySwigIterator_T(out_iterator curr, PyObject *seq) + : PySwigIterator(seq), current(curr) + { + } + + const out_iterator& get_current() const + { + return current; + } + + + bool equal (const PySwigIterator &iter) const + { + const self_type *iters = dynamic_cast(&iter); + if (iters) { + return (current == iters->get_current()); + } else { + throw std::invalid_argument("bad iterator type"); + } + } + + ptrdiff_t distance(const PySwigIterator &iter) const + { + const self_type *iters = dynamic_cast(&iter); + if (iters) { + return std::distance(current, iters->get_current()); + } else { + throw std::invalid_argument("bad iterator type"); + } + } + + protected: + out_iterator current; + }; + + template + struct from_oper + { + typedef const ValueType& argument_type; + typedef PyObject *result_type; + result_type operator()(argument_type v) const + { + return swig::from(v); + } + }; + + template::value_type, + typename FromOper = from_oper > + class PySwigIteratorOpen_T : public PySwigIterator_T + { + public: + FromOper from; + typedef OutIterator out_iterator; + typedef ValueType value_type; + typedef PySwigIterator_T base; + typedef PySwigIteratorOpen_T self_type; + + PySwigIteratorOpen_T(out_iterator curr, PyObject *seq) + : PySwigIterator_T(curr, seq) + { + } + + PyObject *value() const { + return from(static_cast(*(base::current))); + } + + PySwigIterator *copy() const + { + return new self_type(*this); + } + + PySwigIterator *incr(size_t n = 1) + { + while (n--) { + ++base::current; + } + return this; + } + + PySwigIterator *decr(size_t n = 1) + { + while (n--) { + --base::current; + } + return this; + } + }; + + template::value_type, + typename FromOper = from_oper > + class PySwigIteratorClosed_T : public PySwigIterator_T + { + public: + FromOper from; + typedef OutIterator out_iterator; + typedef ValueType value_type; + typedef PySwigIterator_T base; + typedef PySwigIteratorClosed_T self_type; + + PySwigIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq) + : PySwigIterator_T(curr, seq), begin(first), end(last) + { + } + + PyObject *value() const { + if (base::current == end) { + throw stop_iteration(); + } else { + return from(static_cast(*(base::current))); + } + } + + PySwigIterator *copy() const + { + return new self_type(*this); + } + + PySwigIterator *incr(size_t n = 1) + { + while (n--) { + if (base::current == end) { + throw stop_iteration(); + } else { + ++base::current; + } + } + return this; + } + + PySwigIterator *decr(size_t n = 1) + { + while (n--) { + if (base::current == begin) { + throw stop_iteration(); + } else { + --base::current; + } + } + return this; + } + + private: + out_iterator begin; + out_iterator end; + }; + + template + inline PySwigIterator* + make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0) + { + return new PySwigIteratorClosed_T(current, begin, end, seq); + } + + template + inline PySwigIterator* + make_output_iterator(const OutIter& current, PyObject *seq = 0) + { + return new PySwigIteratorOpen_T(current, seq); + } +} + + +namespace swig +{ + template + struct PySequence_Ref + { + PySequence_Ref(PyObject* seq, int index) + : _seq(seq), _index(index) + { + } + + operator T () const + { + swig::PyObject_var item = PySequence_GetItem(_seq, _index); + try { + return swig::as(item, true); + } catch (std::exception& e) { + char msg[1024]; + sprintf(msg, "in sequence element %d ", _index); + if (!PyErr_Occurred()) { + SWIG_Error(SWIG_TypeError, swig::type_name()); + } + SWIG_Python_AddErrorMsg(msg); + SWIG_Python_AddErrorMsg(e.what()); + throw; + } + } + + PySequence_Ref& operator=(const T& v) + { + PySequence_SetItem(_seq, _index, swig::from(v)); + return *this; + } + + private: + PyObject* _seq; + int _index; + }; + + template + struct PySequence_ArrowProxy + { + PySequence_ArrowProxy(const T& x): m_value(x) {} + const T* operator->() const { return &m_value; } + operator const T*() const { return &m_value; } + T m_value; + }; + + template + struct PySequence_InputIterator + { + typedef PySequence_InputIterator self; + + typedef std::random_access_iterator_tag iterator_category; + typedef Reference reference; + typedef T value_type; + typedef T* pointer; + typedef int difference_type; + + PySequence_InputIterator() + { + } + + PySequence_InputIterator(PyObject* seq, int index) + : _seq(seq), _index(index) + { + } + + reference operator*() const + { + return reference(_seq, _index); + } + + PySequence_ArrowProxy + operator->() const { + return PySequence_ArrowProxy(operator*()); + } + + bool operator==(const self& ri) const + { + return (_index == ri._index) && (_seq == ri._seq); + } + + bool operator!=(const self& ri) const + { + return !(operator==(ri)); + } + + self& operator ++ () + { + ++_index; + return *this; + } + + self& operator -- () + { + --_index; + return *this; + } + + self& operator += (difference_type n) + { + _index += n; + return *this; + } + + self operator +(difference_type n) const + { + return self(_seq, _index + n); + } + + self& operator -= (difference_type n) + { + _index -= n; + return *this; + } + + self operator -(difference_type n) const + { + return self(_seq, _index - n); + } + + difference_type operator - (const self& ri) const + { + return _index - ri._index; + } + + bool operator < (const self& ri) const + { + return _index < ri._index; + } + + reference + operator[](difference_type n) const + { + return reference(_seq, _index + n); + } + + private: + PyObject* _seq; + difference_type _index; + }; + + template + struct PySequence_Cont + { + typedef PySequence_Ref reference; + typedef const PySequence_Ref const_reference; + typedef T value_type; + typedef T* pointer; + typedef int difference_type; + typedef int size_type; + typedef const pointer const_pointer; + typedef PySequence_InputIterator iterator; + typedef PySequence_InputIterator const_iterator; + + PySequence_Cont(PyObject* seq) : _seq(0) + { + if (!PySequence_Check(seq)) { + throw std::invalid_argument("a sequence is expected"); + } + _seq = seq; + Py_INCREF(_seq); + } + + ~PySequence_Cont() + { + if (_seq) Py_DECREF(_seq); + } + + size_type size() const + { + return PySequence_Size(_seq); + } + + bool empty() const + { + return size() == 0; + } + + iterator begin() + { + return iterator(_seq, 0); + } + + const_iterator begin() const + { + return const_iterator(_seq, 0); + } + + iterator end() + { + return iterator(_seq, size()); + } + + const_iterator end() const + { + return const_iterator(_seq, size()); + } + + reference operator[](difference_type n) + { + return reference(_seq, n); + } + + const_reference operator[](difference_type n) const + { + return const_reference(_seq, n); + } + + bool check(bool set_err = true) const + { + int s = size(); + for (int i = 0; i < s; ++i) { + swig::PyObject_var item = PySequence_GetItem(_seq, i); + if (!swig::check(item)) { + if (set_err) { + char msg[1024]; + sprintf(msg, "in sequence element %d", i); + SWIG_Error(SWIG_RuntimeError, msg); + } + return false; + } + } + return true; + } + + private: + PyObject* _seq; + }; + +} + + + namespace swig { + template <> struct traits { + typedef pointer_category category; + static const char* type_name() { return"Hex::Hexa"; } + }; + } + + +namespace swig { + template + inline void + assign(const PySeq& pyseq, Seq* seq) { +#ifdef SWIG_STD_NOASSIGN_STL + typedef typename PySeq::value_type value_type; + typename PySeq::const_iterator it = pyseq.begin(); + for (;it != pyseq.end(); ++it) { + seq->insert(seq->end(),(value_type)(*it)); + } +#else + seq->assign(pyseq.begin(), pyseq.end()); +#endif + } + + template + struct traits_asptr_stdseq { + typedef Seq sequence; + typedef T value_type; + + static int asptr(PyObject *obj, sequence **seq) { + if (PySequence_Check(obj)) { + try { + PySequence_Cont pyseq(obj); + if (seq) { + sequence *pseq = new sequence(); + assign(pyseq, pseq); + *seq = pseq; + return SWIG_NEWOBJ; + } else { + return pyseq.check() ? SWIG_OK : SWIG_ERROR; + } + } catch (std::exception& e) { + if (seq) { + if (!PyErr_Occurred()) { + PyErr_SetString(PyExc_TypeError, e.what()); + } + } + return SWIG_ERROR; + } + } else { + sequence *p; + if (SWIG_ConvertPtr(obj,(void**)&p, + swig::type_info(),0) == SWIG_OK) { + if (seq) *seq = p; + return SWIG_OLDOBJ; + } + } + return SWIG_ERROR; + } + }; + + template + struct traits_from_stdseq { + typedef Seq sequence; + typedef T value_type; + typedef typename Seq::size_type size_type; + typedef typename sequence::const_iterator const_iterator; + + static PyObject *from(const sequence& seq) { + + + + + + + size_type size = seq.size(); + if (size <= (size_type)INT_MAX) { + PyObject *obj = PyTuple_New((int)size); + int i = 0; + for (const_iterator it = seq.begin(); + it != seq.end(); ++it, ++i) { + PyTuple_SetItem(obj,i,swig::from(*it)); + } + return obj; + } else { + PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python"); + return NULL; + } + } + }; +} + + + namespace swig { + template + struct traits_asptr > { + static int asptr(PyObject *obj, std::vector **vec) { + return traits_asptr_stdseq >::asptr(obj, vec); + } + }; + + template + struct traits_from > { + static PyObject *from(const std::vector& vec) { + return traits_from_stdseq >::from(vec); + } + }; + } + + + namespace swig { + template <> struct traits > > { + typedef value_category category; + static const char* type_name() { + return "std::vector<" "Hex::Hexa" " *," "std::allocator" " >"; + } + }; + } + +SWIGINTERN swig::PySwigIterator *std_vector_Sl_Hex_Hexa_Sm__Sg__iterator(std::vector *self,PyObject **PYTHON_SELF){ + return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); + } +SWIGINTERN bool std_vector_Sl_Hex_Hexa_Sm__Sg____nonzero__(std::vector const *self){ + return !(self->empty()); + } +SWIGINTERN std::vector::size_type std_vector_Sl_Hex_Hexa_Sm__Sg____len__(std::vector const *self){ + return self->size(); + } + +SWIGINTERNINLINE PyObject* +SWIG_From_unsigned_SS_long (unsigned long value) +{ + return (value > LONG_MAX) ? + PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_size_t (size_t value) +{ + return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value)); +} + +SWIGINTERN std::vector::value_type std_vector_Sl_Hex_Hexa_Sm__Sg__pop(std::vector *self){ + if (self->size() == 0) + throw std::out_of_range("pop from empty container"); + std::vector >::value_type x = self->back(); + self->pop_back(); + return x; + } +SWIGINTERN std::vector > *std_vector_Sl_Hex_Hexa_Sm__Sg____getslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_Hex_Hexa_Sm__Sg____setslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j,std::vector > const &v){ + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_Hex_Hexa_Sm__Sg____delslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + swig::delslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_Hex_Hexa_Sm__Sg____delitem__(std::vector *self,std::vector::difference_type i){ + self->erase(swig::getpos(self,i)); + } +SWIGINTERN std::vector::value_type std_vector_Sl_Hex_Hexa_Sm__Sg____getitem__(std::vector *self,std::vector::difference_type i){ + return *(swig::cgetpos(self, i)); + } +SWIGINTERN void std_vector_Sl_Hex_Hexa_Sm__Sg____setitem__(std::vector *self,std::vector::difference_type i,std::vector::value_type x){ + *(swig::getpos(self,i)) = x; + } +SWIGINTERN void std_vector_Sl_Hex_Hexa_Sm__Sg__append(std::vector *self,std::vector::value_type x){ + self->push_back(x); + } + + namespace swig { + template <> struct traits { + typedef pointer_category category; + static const char* type_name() { return"Hex::Quad"; } + }; + } + + + namespace swig { + template <> struct traits > > { + typedef value_category category; + static const char* type_name() { + return "std::vector<" "Hex::Quad" " *," "std::allocator" " >"; + } + }; + } + +SWIGINTERN swig::PySwigIterator *std_vector_Sl_Hex_Quad_Sm__Sg__iterator(std::vector *self,PyObject **PYTHON_SELF){ + return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); + } +SWIGINTERN bool std_vector_Sl_Hex_Quad_Sm__Sg____nonzero__(std::vector const *self){ + return !(self->empty()); + } +SWIGINTERN std::vector::size_type std_vector_Sl_Hex_Quad_Sm__Sg____len__(std::vector const *self){ + return self->size(); + } +SWIGINTERN std::vector::value_type std_vector_Sl_Hex_Quad_Sm__Sg__pop(std::vector *self){ + if (self->size() == 0) + throw std::out_of_range("pop from empty container"); + std::vector >::value_type x = self->back(); + self->pop_back(); + return x; + } +SWIGINTERN std::vector > *std_vector_Sl_Hex_Quad_Sm__Sg____getslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_Hex_Quad_Sm__Sg____setslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j,std::vector > const &v){ + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_Hex_Quad_Sm__Sg____delslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + swig::delslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_Hex_Quad_Sm__Sg____delitem__(std::vector *self,std::vector::difference_type i){ + self->erase(swig::getpos(self,i)); + } +SWIGINTERN std::vector::value_type std_vector_Sl_Hex_Quad_Sm__Sg____getitem__(std::vector *self,std::vector::difference_type i){ + return *(swig::cgetpos(self, i)); + } +SWIGINTERN void std_vector_Sl_Hex_Quad_Sm__Sg____setitem__(std::vector *self,std::vector::difference_type i,std::vector::value_type x){ + *(swig::getpos(self,i)) = x; + } +SWIGINTERN void std_vector_Sl_Hex_Quad_Sm__Sg__append(std::vector *self,std::vector::value_type x){ + self->push_back(x); + } + + namespace swig { + template <> struct traits { + typedef pointer_category category; + static const char* type_name() { return"Hex::Edge"; } + }; + } + + + namespace swig { + template <> struct traits > > { + typedef value_category category; + static const char* type_name() { + return "std::vector<" "Hex::Edge" " *," "std::allocator" " >"; + } + }; + } + +SWIGINTERN swig::PySwigIterator *std_vector_Sl_Hex_Edge_Sm__Sg__iterator(std::vector *self,PyObject **PYTHON_SELF){ + return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); + } +SWIGINTERN bool std_vector_Sl_Hex_Edge_Sm__Sg____nonzero__(std::vector const *self){ + return !(self->empty()); + } +SWIGINTERN std::vector::size_type std_vector_Sl_Hex_Edge_Sm__Sg____len__(std::vector const *self){ + return self->size(); + } +SWIGINTERN std::vector::value_type std_vector_Sl_Hex_Edge_Sm__Sg__pop(std::vector *self){ + if (self->size() == 0) + throw std::out_of_range("pop from empty container"); + std::vector >::value_type x = self->back(); + self->pop_back(); + return x; + } +SWIGINTERN std::vector > *std_vector_Sl_Hex_Edge_Sm__Sg____getslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_Hex_Edge_Sm__Sg____setslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j,std::vector > const &v){ + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_Hex_Edge_Sm__Sg____delslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + swig::delslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_Hex_Edge_Sm__Sg____delitem__(std::vector *self,std::vector::difference_type i){ + self->erase(swig::getpos(self,i)); + } +SWIGINTERN std::vector::value_type std_vector_Sl_Hex_Edge_Sm__Sg____getitem__(std::vector *self,std::vector::difference_type i){ + return *(swig::cgetpos(self, i)); + } +SWIGINTERN void std_vector_Sl_Hex_Edge_Sm__Sg____setitem__(std::vector *self,std::vector::difference_type i,std::vector::value_type x){ + *(swig::getpos(self,i)) = x; + } +SWIGINTERN void std_vector_Sl_Hex_Edge_Sm__Sg__append(std::vector *self,std::vector::value_type x){ + self->push_back(x); + } + + namespace swig { + template <> struct traits { + typedef pointer_category category; + static const char* type_name() { return"Hex::Vertex"; } + }; + } + + + namespace swig { + template <> struct traits > > { + typedef value_category category; + static const char* type_name() { + return "std::vector<" "Hex::Vertex" " *," "std::allocator" " >"; + } + }; + } + +SWIGINTERN swig::PySwigIterator *std_vector_Sl_Hex_Vertex_Sm__Sg__iterator(std::vector *self,PyObject **PYTHON_SELF){ + return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); + } +SWIGINTERN bool std_vector_Sl_Hex_Vertex_Sm__Sg____nonzero__(std::vector const *self){ + return !(self->empty()); + } +SWIGINTERN std::vector::size_type std_vector_Sl_Hex_Vertex_Sm__Sg____len__(std::vector const *self){ + return self->size(); + } +SWIGINTERN std::vector::value_type std_vector_Sl_Hex_Vertex_Sm__Sg__pop(std::vector *self){ + if (self->size() == 0) + throw std::out_of_range("pop from empty container"); + std::vector >::value_type x = self->back(); + self->pop_back(); + return x; + } +SWIGINTERN std::vector > *std_vector_Sl_Hex_Vertex_Sm__Sg____getslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_Hex_Vertex_Sm__Sg____setslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j,std::vector > const &v){ + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_Hex_Vertex_Sm__Sg____delslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + swig::delslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_Hex_Vertex_Sm__Sg____delitem__(std::vector *self,std::vector::difference_type i){ + self->erase(swig::getpos(self,i)); + } +SWIGINTERN std::vector::value_type std_vector_Sl_Hex_Vertex_Sm__Sg____getitem__(std::vector *self,std::vector::difference_type i){ + return *(swig::cgetpos(self, i)); + } +SWIGINTERN void std_vector_Sl_Hex_Vertex_Sm__Sg____setitem__(std::vector *self,std::vector::difference_type i,std::vector::value_type x){ + *(swig::getpos(self,i)) = x; + } +SWIGINTERN void std_vector_Sl_Hex_Vertex_Sm__Sg__append(std::vector *self,std::vector::value_type x){ + self->push_back(x); + } + + #define SWIG_From_double PyFloat_FromDouble + + +namespace swig { + template <> struct traits { + typedef value_category category; + static const char* type_name() { return"double"; } + }; + template <> struct traits_asval { + typedef double value_type; + static int asval(PyObject *obj, value_type *val) { + return SWIG_AsVal_double (obj, val); + } + }; + template <> struct traits_from { + typedef double value_type; + static PyObject *from(const value_type& val) { + return SWIG_From_double (val); + } + }; +} + + + namespace swig { + template <> struct traits > > { + typedef pointer_category category; + static const char* type_name() { + return "std::vector<" "double" "," "std::allocator" " >"; + } + }; + } + +SWIGINTERN swig::PySwigIterator *std_vector_Sl_double_Sg__iterator(std::vector *self,PyObject **PYTHON_SELF){ + return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); + } +SWIGINTERN bool std_vector_Sl_double_Sg____nonzero__(std::vector const *self){ + return !(self->empty()); + } +SWIGINTERN std::vector::size_type std_vector_Sl_double_Sg____len__(std::vector const *self){ + return self->size(); + } +SWIGINTERN std::vector::value_type std_vector_Sl_double_Sg__pop(std::vector *self){ + if (self->size() == 0) + throw std::out_of_range("pop from empty container"); + std::vector >::value_type x = self->back(); + self->pop_back(); + return x; + } +SWIGINTERN std::vector > *std_vector_Sl_double_Sg____getslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_double_Sg____setslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j,std::vector > const &v){ + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_double_Sg____delslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + swig::delslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_double_Sg____delitem__(std::vector *self,std::vector::difference_type i){ + self->erase(swig::getpos(self,i)); + } +SWIGINTERN std::vector::value_type const &std_vector_Sl_double_Sg____getitem__(std::vector const *self,std::vector::difference_type i){ + return *(swig::cgetpos(self, i)); + } +SWIGINTERN void std_vector_Sl_double_Sg____setitem__(std::vector *self,std::vector::difference_type i,std::vector::value_type const &x){ + *(swig::getpos(self,i)) = x; + } +SWIGINTERN void std_vector_Sl_double_Sg__append(std::vector *self,std::vector::value_type const &x){ + self->push_back(x); + } + +#include +#ifndef LLONG_MIN +# define LLONG_MIN LONG_LONG_MIN +#endif +#ifndef LLONG_MAX +# define LLONG_MAX LONG_LONG_MAX +#endif +#ifndef ULLONG_MAX +# define ULLONG_MAX ULONG_LONG_MAX +#endif + + +SWIGINTERN int +SWIG_AsVal_int (PyObject * obj, int *val) +{ + long v; + int res = SWIG_AsVal_long (obj, &v); + if (SWIG_IsOK(res)) { + if ((v < INT_MIN || v > INT_MAX)) { + return SWIG_OverflowError; + } else { + if (val) *val = static_cast< int >(v); + } + } + return res; +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_int (int value) +{ + return SWIG_From_long (value); +} + + +namespace swig { + template <> struct traits { + typedef value_category category; + static const char* type_name() { return"int"; } + }; + template <> struct traits_asval { + typedef int value_type; + static int asval(PyObject *obj, value_type *val) { + return SWIG_AsVal_int (obj, val); + } + }; + template <> struct traits_from { + typedef int value_type; + static PyObject *from(const value_type& val) { + return SWIG_From_int (val); + } + }; +} + + + namespace swig { + template <> struct traits > > { + typedef pointer_category category; + static const char* type_name() { + return "std::vector<" "int" "," "std::allocator" " >"; + } + }; + } + +SWIGINTERN swig::PySwigIterator *std_vector_Sl_int_Sg__iterator(std::vector *self,PyObject **PYTHON_SELF){ + return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF); + } +SWIGINTERN bool std_vector_Sl_int_Sg____nonzero__(std::vector const *self){ + return !(self->empty()); + } +SWIGINTERN std::vector::size_type std_vector_Sl_int_Sg____len__(std::vector const *self){ + return self->size(); + } +SWIGINTERN std::vector::value_type std_vector_Sl_int_Sg__pop(std::vector *self){ + if (self->size() == 0) + throw std::out_of_range("pop from empty container"); + std::vector >::value_type x = self->back(); + self->pop_back(); + return x; + } +SWIGINTERN std::vector > *std_vector_Sl_int_Sg____getslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + return swig::getslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_int_Sg____setslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j,std::vector > const &v){ + swig::setslice(self, i, j, v); + } +SWIGINTERN void std_vector_Sl_int_Sg____delslice__(std::vector *self,std::vector::difference_type i,std::vector::difference_type j){ + swig::delslice(self, i, j); + } +SWIGINTERN void std_vector_Sl_int_Sg____delitem__(std::vector *self,std::vector::difference_type i){ + self->erase(swig::getpos(self,i)); + } +SWIGINTERN std::vector::value_type const &std_vector_Sl_int_Sg____getitem__(std::vector const *self,std::vector::difference_type i){ + return *(swig::cgetpos(self, i)); + } +SWIGINTERN void std_vector_Sl_int_Sg____setitem__(std::vector *self,std::vector::difference_type i,std::vector::value_type const &x){ + *(swig::getpos(self,i)) = x; + } +SWIGINTERN void std_vector_Sl_int_Sg__append(std::vector *self,std::vector::value_type const &x){ + self->push_back(x); + } + +SWIGINTERN swig_type_info* +SWIG_pchar_descriptor(void) +{ + static int init = 0; + static swig_type_info* info = 0; + if (!init) { + info = SWIG_TypeQuery("_p_char"); + init = 1; + } + return info; +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtrAndSize(const char* carray, size_t size) +{ + if (carray) { + if (size > INT_MAX) { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + return pchar_descriptor ? + SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void(); + } else { + return PyString_FromStringAndSize(carray, static_cast< int >(size)); + } + } else { + return SWIG_Py_Void(); + } +} + + +SWIGINTERNINLINE PyObject * +SWIG_From_char (char c) +{ + return SWIG_FromCharPtrAndSize(&c,1); +} + + +SWIGINTERNINLINE PyObject * +SWIG_FromCharPtr(const char *cptr) +{ + return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); +} + + +SWIGINTERN int +SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) +{ + if (PyString_Check(obj)) { + char *cstr; Py_ssize_t len; + PyString_AsStringAndSize(obj, &cstr, &len); + if (cptr) { + if (alloc) { + /* + In python the user should not be able to modify the inner + string representation. To warranty that, if you define + SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string + buffer is always returned. + + The default behavior is just to return the pointer value, + so, be careful. + */ +#if defined(SWIG_PYTHON_SAFE_CSTRINGS) + if (*alloc != SWIG_OLDOBJ) +#else + if (*alloc == SWIG_NEWOBJ) +#endif + { + *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1))); + *alloc = SWIG_NEWOBJ; + } + else { + *cptr = cstr; + *alloc = SWIG_OLDOBJ; + } + } else { + *cptr = PyString_AsString(obj); + } + } + if (psize) *psize = len + 1; + return SWIG_OK; + } else { + swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); + if (pchar_descriptor) { + void* vptr = 0; + if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { + if (cptr) *cptr = (char *) vptr; + if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; + if (alloc) *alloc = SWIG_OLDOBJ; + return SWIG_OK; + } + } + } + return SWIG_TypeError; +} + + + + + +SWIGINTERN int +SWIG_AsVal_bool (PyObject *obj, bool *val) +{ + if (obj == Py_True) { + if (val) *val = true; + return SWIG_OK; + } else if (obj == Py_False) { + if (val) *val = false; + return SWIG_OK; + } else { + long v = 0; + int res = SWIG_AddCast(SWIG_AsVal_long (obj, val ? &v : 0)); + if (SWIG_IsOK(res) && val) *val = v ? true : false; + return res; + } +} + +#ifdef __cplusplus +extern "C" { +#endif +SWIGINTERN PyObject *_wrap_delete_PySwigIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_PySwigIterator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_PySwigIterator" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + PyObject *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_value",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_value" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + try { + result = (PyObject *)((swig::PySwigIterator const *)arg1)->value(); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + size_t arg2 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_incr",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_incr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_incr" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + try { + result = (swig::PySwigIterator *)(arg1)->incr(arg2); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_incr",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_incr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + try { + result = (swig::PySwigIterator *)(arg1)->incr(); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_incr(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_PySwigIterator_incr__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_PySwigIterator_incr__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'PySwigIterator_incr'.\n Possible C/C++ prototypes are:\n incr(size_t)\n incr()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + size_t arg2 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_decr",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_decr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_decr" "', argument " "2"" of type '" "size_t""'"); + } + arg2 = static_cast< size_t >(val2); + try { + result = (swig::PySwigIterator *)(arg1)->decr(arg2); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_decr",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_decr" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + try { + result = (swig::PySwigIterator *)(arg1)->decr(); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_decr(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_PySwigIterator_decr__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_PySwigIterator_decr__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'PySwigIterator_decr'.\n Possible C/C++ prototypes are:\n decr(size_t)\n decr()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::PySwigIterator *arg2 = 0 ; + ptrdiff_t result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_distance",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_distance" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator_distance" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator_distance" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); + try { + result = ((swig::PySwigIterator const *)arg1)->distance((swig::PySwigIterator const &)*arg2); + } + catch(std::invalid_argument &_e) { + SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail; + } + + resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::PySwigIterator *arg2 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_equal",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_equal" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator_equal" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator_equal" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); + try { + result = (bool)((swig::PySwigIterator const *)arg1)->equal((swig::PySwigIterator const &)*arg2); + } + catch(std::invalid_argument &_e) { + SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail; + } + + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_copy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_copy" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->copy(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + PyObject *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_next",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_next" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + try { + result = (PyObject *)(arg1)->next(); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + PyObject *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:PySwigIterator_previous",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_previous" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + try { + result = (PyObject *)(arg1)->previous(); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = result; + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + ptrdiff_t arg2 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator_advance",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator_advance" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'"); + } + arg2 = static_cast< ptrdiff_t >(val2); + try { + result = (swig::PySwigIterator *)(arg1)->advance(arg2); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::PySwigIterator *arg2 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___eq__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___eq__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___eq__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___eq__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); + result = (bool)((swig::PySwigIterator const *)arg1)->operator ==((swig::PySwigIterator const &)*arg2); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::PySwigIterator *arg2 = 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___ne__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___ne__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___ne__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___ne__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); + result = (bool)((swig::PySwigIterator const *)arg1)->operator !=((swig::PySwigIterator const &)*arg2); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + ptrdiff_t arg2 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___iadd__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___iadd__" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'"); + } + arg2 = static_cast< ptrdiff_t >(val2); + try { + { + swig::PySwigIterator &_result_ref = (arg1)->operator +=(arg2); + result = (swig::PySwigIterator *) &_result_ref; + } + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + ptrdiff_t arg2 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___isub__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___isub__" "', argument " "1"" of type '" "swig::PySwigIterator *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'"); + } + arg2 = static_cast< ptrdiff_t >(val2); + try { + { + swig::PySwigIterator &_result_ref = (arg1)->operator -=(arg2); + result = (swig::PySwigIterator *) &_result_ref; + } + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + ptrdiff_t arg2 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___add__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___add__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'"); + } + arg2 = static_cast< ptrdiff_t >(val2); + try { + result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->operator +(arg2); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + ptrdiff_t arg2 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___sub__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___sub__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'"); + } + arg2 = static_cast< ptrdiff_t >(val2); + try { + result = (swig::PySwigIterator *)((swig::PySwigIterator const *)arg1)->operator -(arg2); + } + catch(swig::stop_iteration &_e) { + { + (void)_e; + SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void()); + SWIG_fail; + } + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + swig::PySwigIterator *arg1 = (swig::PySwigIterator *) 0 ; + swig::PySwigIterator *arg2 = 0 ; + ptrdiff_t result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:PySwigIterator___sub__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__PySwigIterator, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "PySwigIterator___sub__" "', argument " "1"" of type '" "swig::PySwigIterator const *""'"); + } + arg1 = reinterpret_cast< swig::PySwigIterator * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__PySwigIterator, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "PySwigIterator___sub__" "', argument " "2"" of type '" "swig::PySwigIterator const &""'"); + } + arg2 = reinterpret_cast< swig::PySwigIterator * >(argp2); + result = ((swig::PySwigIterator const *)arg1)->operator -((swig::PySwigIterator const &)*arg2); + resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_PySwigIterator___sub__(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__PySwigIterator, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_PySwigIterator___sub____SWIG_1(self, args); + } + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__PySwigIterator, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_PySwigIterator___sub____SWIG_0(self, args); + } + } + } + +fail: + Py_INCREF(Py_NotImplemented); + return Py_NotImplemented; +} + + +SWIGINTERN PyObject *PySwigIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_swig__PySwigIterator, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_VectorHexas_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + PyObject **arg2 = (PyObject **) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &obj0; + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_iterator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_iterator" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (swig::PySwigIterator *)std_vector_Sl_Hex_Hexa_Sm__Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas___nonzero__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas___nonzero__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)std_vector_Sl_Hex_Hexa_Sm__Sg____nonzero__((std::vector const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas___len__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas___len__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = std_vector_Sl_Hex_Hexa_Sm__Sg____len__((std::vector const *)arg1); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_pop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_pop" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + try { + result = (std::vector::value_type)std_vector_Sl_Hex_Hexa_Sm__Sg__pop(arg1); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorHexas___getslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas___getslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas___getslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorHexas___getslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + result = (std::vector > *)std_vector_Sl_Hex_Hexa_Sm__Sg____getslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas___setslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + int res4 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorHexas___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas___setslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas___setslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorHexas___setslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + { + std::vector > *ptr = (std::vector > *)0; + res4 = swig::asptr(obj3, &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorHexas___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorHexas___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + arg4 = ptr; + } + try { + std_vector_Sl_Hex_Hexa_Sm__Sg____setslice__(arg1,arg2,arg3,(std::vector > const &)*arg4); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res4)) delete arg4; + return resultobj; +fail: + if (SWIG_IsNewObj(res4)) delete arg4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorHexas___delslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas___delslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas___delslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorHexas___delslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + std_vector_Sl_Hex_Hexa_Sm__Sg____delslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorHexas___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas___delitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas___delitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + std_vector_Sl_Hex_Hexa_Sm__Sg____delitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorHexas___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas___getitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas___getitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + result = (std::vector::value_type)std_vector_Sl_Hex_Hexa_Sm__Sg____getitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorHexas___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas___setitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas___setitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorHexas___setitem__" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + try { + std_vector_Sl_Hex_Hexa_Sm__Sg____setitem__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorHexas_append",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_append" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorHexas_append" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + std_vector_Sl_Hex_Hexa_Sm__Sg__append(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorHexas__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_VectorHexas")) SWIG_fail; + result = (std::vector *)new std::vector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorHexas__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = 0 ; + std::vector *result = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorHexas",&obj0)) SWIG_fail; + { + std::vector > *ptr = (std::vector > *)0; + res1 = swig::asptr(obj0, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VectorHexas" "', argument " "1"" of type '" "std::vector const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VectorHexas" "', argument " "1"" of type '" "std::vector const &""'"); + } + arg1 = ptr; + } + result = (std::vector *)new std::vector((std::vector const &)*arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, SWIG_POINTER_NEW | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_empty",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_empty" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)((std::vector const *)arg1)->empty(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_size" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->size(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_clear",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_clear" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->clear(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorHexas_swap",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_swap" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorHexas_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorHexas_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + arg2 = reinterpret_cast< std::vector * >(argp2); + (arg1)->swap(*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + SwigValueWrapper > result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_get_allocator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_get_allocator" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->get_allocator(); + resultobj = SWIG_NewPointerObj((new std::vector::allocator_type(static_cast< const std::vector::allocator_type& >(result))), SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__allocator_type, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_begin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_begin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_begin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_begin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_begin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_begin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_begin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorHexas_begin'.\n Possible C/C++ prototypes are:\n begin()\n begin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_end__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_end" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_end__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_end" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_end(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_end__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_end__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorHexas_end'.\n Possible C/C++ prototypes are:\n end()\n end()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_rbegin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_rbegin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_rbegin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_rbegin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_rbegin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_rbegin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_rbegin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorHexas_rbegin'.\n Possible C/C++ prototypes are:\n rbegin()\n rbegin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_rend__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_rend" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_rend__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_rend" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_rend(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_rend__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_rend__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorHexas_rend'.\n Possible C/C++ prototypes are:\n rend()\n rend()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorHexas__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorHexas",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorHexas" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + result = (std::vector *)new std::vector(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_pop_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_pop_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->pop_back(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorHexas_resize",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->resize(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorHexas_erase",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator arg3 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + swig::PySwigIterator *iter3 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorHexas_erase",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res3) || !iter3) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + if (iter_t) { + arg3 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_erase(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorHexas_erase__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorHexas_erase__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorHexas_erase'.\n Possible C/C++ prototypes are:\n erase(std::vector::iterator)\n erase(std::vector::iterator,std::vector::iterator)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorHexas__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_VectorHexas",&obj0,&obj1)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorHexas" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_VectorHexas" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + result = (std::vector *)new std::vector(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorHexas(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 0) { + return _wrap_new_VectorHexas__SWIG_0(self, args); + } + if (argc == 1) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorHexas__SWIG_2(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorHexas__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorHexas__SWIG_3(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_VectorHexas'.\n Possible C/C++ prototypes are:\n std::vector<(p.Hex::Hexa)>()\n std::vector<(p.Hex::Hexa)>(std::vector const &)\n std::vector<(p.Hex::Hexa)>(std::vector::size_type)\n std::vector<(p.Hex::Hexa)>(std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorHexas_push_back",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_push_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorHexas_push_back" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + (arg1)->push_back(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_front",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_front" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (std::vector::value_type)((std::vector const *)arg1)->front(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_back" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (std::vector::value_type)((std::vector const *)arg1)->back(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorHexas_assign",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_assign" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas_assign" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorHexas_assign" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + (arg1)->assign(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorHexas_resize",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorHexas_resize" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + (arg1)->resize(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_resize(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorHexas_resize__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_resize__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorHexas_resize'.\n Possible C/C++ prototypes are:\n resize(std::vector::size_type)\n resize(std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorHexas_insert",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorHexas_insert" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + result = (arg1)->insert(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::size_type arg3 ; + std::vector::value_type arg4 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + size_t val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorHexas_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorHexas_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorHexas_insert" "', argument " "3"" of type '" "std::vector::size_type""'"); + } + arg3 = static_cast< std::vector::size_type >(val3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorHexas_insert" "', argument " "4"" of type '" "std::vector::value_type""'"); + } + arg4 = reinterpret_cast< std::vector::value_type >(argp4); + (arg1)->insert(arg2,arg3,arg4); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_insert(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_insert__SWIG_0(self, args); + } + } + } + } + if (argc == 4) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorHexas_insert__SWIG_1(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorHexas_insert'.\n Possible C/C++ prototypes are:\n insert(std::vector::iterator,std::vector::value_type)\n insert(std::vector::iterator,std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorHexas_reserve",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_reserve" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorHexas_reserve" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->reserve(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorHexas_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorHexas_capacity",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorHexas_capacity" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->capacity(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_VectorHexas(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorHexas",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorHexas" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *VectorHexas_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_VectorQuads_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + PyObject **arg2 = (PyObject **) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &obj0; + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_iterator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_iterator" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (swig::PySwigIterator *)std_vector_Sl_Hex_Quad_Sm__Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads___nonzero__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads___nonzero__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)std_vector_Sl_Hex_Quad_Sm__Sg____nonzero__((std::vector const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads___len__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads___len__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = std_vector_Sl_Hex_Quad_Sm__Sg____len__((std::vector const *)arg1); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_pop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_pop" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + try { + result = (std::vector::value_type)std_vector_Sl_Hex_Quad_Sm__Sg__pop(arg1); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorQuads___getslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads___getslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads___getslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorQuads___getslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + result = (std::vector > *)std_vector_Sl_Hex_Quad_Sm__Sg____getslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads___setslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + int res4 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorQuads___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads___setslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads___setslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorQuads___setslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + { + std::vector > *ptr = (std::vector > *)0; + res4 = swig::asptr(obj3, &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorQuads___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorQuads___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + arg4 = ptr; + } + try { + std_vector_Sl_Hex_Quad_Sm__Sg____setslice__(arg1,arg2,arg3,(std::vector > const &)*arg4); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res4)) delete arg4; + return resultobj; +fail: + if (SWIG_IsNewObj(res4)) delete arg4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorQuads___delslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads___delslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads___delslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorQuads___delslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + std_vector_Sl_Hex_Quad_Sm__Sg____delslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorQuads___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads___delitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads___delitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + std_vector_Sl_Hex_Quad_Sm__Sg____delitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorQuads___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads___getitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads___getitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + result = (std::vector::value_type)std_vector_Sl_Hex_Quad_Sm__Sg____getitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorQuads___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads___setitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads___setitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorQuads___setitem__" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + try { + std_vector_Sl_Hex_Quad_Sm__Sg____setitem__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorQuads_append",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_append" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorQuads_append" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + std_vector_Sl_Hex_Quad_Sm__Sg__append(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorQuads__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_VectorQuads")) SWIG_fail; + result = (std::vector *)new std::vector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorQuads__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = 0 ; + std::vector *result = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorQuads",&obj0)) SWIG_fail; + { + std::vector > *ptr = (std::vector > *)0; + res1 = swig::asptr(obj0, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VectorQuads" "', argument " "1"" of type '" "std::vector const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VectorQuads" "', argument " "1"" of type '" "std::vector const &""'"); + } + arg1 = ptr; + } + result = (std::vector *)new std::vector((std::vector const &)*arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, SWIG_POINTER_NEW | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_empty",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_empty" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)((std::vector const *)arg1)->empty(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_size" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->size(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_clear",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_clear" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->clear(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorQuads_swap",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_swap" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorQuads_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorQuads_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + arg2 = reinterpret_cast< std::vector * >(argp2); + (arg1)->swap(*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + SwigValueWrapper > result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_get_allocator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_get_allocator" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->get_allocator(); + resultobj = SWIG_NewPointerObj((new std::vector::allocator_type(static_cast< const std::vector::allocator_type& >(result))), SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__allocator_type, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_begin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_begin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_begin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_begin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_begin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_begin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_begin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorQuads_begin'.\n Possible C/C++ prototypes are:\n begin()\n begin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_end__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_end" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_end__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_end" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_end(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_end__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_end__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorQuads_end'.\n Possible C/C++ prototypes are:\n end()\n end()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_rbegin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_rbegin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_rbegin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_rbegin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_rbegin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_rbegin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_rbegin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorQuads_rbegin'.\n Possible C/C++ prototypes are:\n rbegin()\n rbegin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_rend__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_rend" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_rend__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_rend" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_rend(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_rend__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_rend__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorQuads_rend'.\n Possible C/C++ prototypes are:\n rend()\n rend()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorQuads__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorQuads",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorQuads" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + result = (std::vector *)new std::vector(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_pop_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_pop_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->pop_back(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorQuads_resize",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->resize(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorQuads_erase",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator arg3 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + swig::PySwigIterator *iter3 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorQuads_erase",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res3) || !iter3) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + if (iter_t) { + arg3 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_erase(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorQuads_erase__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorQuads_erase__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorQuads_erase'.\n Possible C/C++ prototypes are:\n erase(std::vector::iterator)\n erase(std::vector::iterator,std::vector::iterator)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorQuads__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_VectorQuads",&obj0,&obj1)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorQuads" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_VectorQuads" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + result = (std::vector *)new std::vector(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorQuads(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 0) { + return _wrap_new_VectorQuads__SWIG_0(self, args); + } + if (argc == 1) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorQuads__SWIG_2(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorQuads__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorQuads__SWIG_3(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_VectorQuads'.\n Possible C/C++ prototypes are:\n std::vector<(p.Hex::Quad)>()\n std::vector<(p.Hex::Quad)>(std::vector const &)\n std::vector<(p.Hex::Quad)>(std::vector::size_type)\n std::vector<(p.Hex::Quad)>(std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorQuads_push_back",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_push_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorQuads_push_back" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + (arg1)->push_back(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_front",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_front" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (std::vector::value_type)((std::vector const *)arg1)->front(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_back" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (std::vector::value_type)((std::vector const *)arg1)->back(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorQuads_assign",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_assign" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads_assign" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorQuads_assign" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + (arg1)->assign(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorQuads_resize",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorQuads_resize" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + (arg1)->resize(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_resize(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorQuads_resize__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_resize__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorQuads_resize'.\n Possible C/C++ prototypes are:\n resize(std::vector::size_type)\n resize(std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorQuads_insert",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorQuads_insert" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + result = (arg1)->insert(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::size_type arg3 ; + std::vector::value_type arg4 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + size_t val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorQuads_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorQuads_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorQuads_insert" "', argument " "3"" of type '" "std::vector::size_type""'"); + } + arg3 = static_cast< std::vector::size_type >(val3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorQuads_insert" "', argument " "4"" of type '" "std::vector::value_type""'"); + } + arg4 = reinterpret_cast< std::vector::value_type >(argp4); + (arg1)->insert(arg2,arg3,arg4); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_insert(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_insert__SWIG_0(self, args); + } + } + } + } + if (argc == 4) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorQuads_insert__SWIG_1(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorQuads_insert'.\n Possible C/C++ prototypes are:\n insert(std::vector::iterator,std::vector::value_type)\n insert(std::vector::iterator,std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorQuads_reserve",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_reserve" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorQuads_reserve" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->reserve(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorQuads_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorQuads_capacity",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorQuads_capacity" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->capacity(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_VectorQuads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorQuads",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorQuads" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *VectorQuads_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_VectorEdges_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + PyObject **arg2 = (PyObject **) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &obj0; + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_iterator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_iterator" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (swig::PySwigIterator *)std_vector_Sl_Hex_Edge_Sm__Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges___nonzero__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges___nonzero__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)std_vector_Sl_Hex_Edge_Sm__Sg____nonzero__((std::vector const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges___len__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges___len__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = std_vector_Sl_Hex_Edge_Sm__Sg____len__((std::vector const *)arg1); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_pop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_pop" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + try { + result = (std::vector::value_type)std_vector_Sl_Hex_Edge_Sm__Sg__pop(arg1); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorEdges___getslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges___getslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges___getslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorEdges___getslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + result = (std::vector > *)std_vector_Sl_Hex_Edge_Sm__Sg____getslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges___setslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + int res4 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorEdges___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges___setslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges___setslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorEdges___setslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + { + std::vector > *ptr = (std::vector > *)0; + res4 = swig::asptr(obj3, &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorEdges___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorEdges___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + arg4 = ptr; + } + try { + std_vector_Sl_Hex_Edge_Sm__Sg____setslice__(arg1,arg2,arg3,(std::vector > const &)*arg4); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res4)) delete arg4; + return resultobj; +fail: + if (SWIG_IsNewObj(res4)) delete arg4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorEdges___delslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges___delslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges___delslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorEdges___delslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + std_vector_Sl_Hex_Edge_Sm__Sg____delslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorEdges___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges___delitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges___delitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + std_vector_Sl_Hex_Edge_Sm__Sg____delitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorEdges___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges___getitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges___getitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + result = (std::vector::value_type)std_vector_Sl_Hex_Edge_Sm__Sg____getitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorEdges___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges___setitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges___setitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorEdges___setitem__" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + try { + std_vector_Sl_Hex_Edge_Sm__Sg____setitem__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorEdges_append",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_append" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorEdges_append" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + std_vector_Sl_Hex_Edge_Sm__Sg__append(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorEdges__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_VectorEdges")) SWIG_fail; + result = (std::vector *)new std::vector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorEdges__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = 0 ; + std::vector *result = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorEdges",&obj0)) SWIG_fail; + { + std::vector > *ptr = (std::vector > *)0; + res1 = swig::asptr(obj0, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VectorEdges" "', argument " "1"" of type '" "std::vector const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VectorEdges" "', argument " "1"" of type '" "std::vector const &""'"); + } + arg1 = ptr; + } + result = (std::vector *)new std::vector((std::vector const &)*arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, SWIG_POINTER_NEW | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_empty",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_empty" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)((std::vector const *)arg1)->empty(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_size" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->size(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_clear",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_clear" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->clear(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorEdges_swap",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_swap" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorEdges_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorEdges_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + arg2 = reinterpret_cast< std::vector * >(argp2); + (arg1)->swap(*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + SwigValueWrapper > result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_get_allocator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_get_allocator" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->get_allocator(); + resultobj = SWIG_NewPointerObj((new std::vector::allocator_type(static_cast< const std::vector::allocator_type& >(result))), SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__allocator_type, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_begin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_begin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_begin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_begin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_begin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_begin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_begin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorEdges_begin'.\n Possible C/C++ prototypes are:\n begin()\n begin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_end__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_end" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_end__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_end" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_end(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_end__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_end__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorEdges_end'.\n Possible C/C++ prototypes are:\n end()\n end()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_rbegin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_rbegin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_rbegin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_rbegin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_rbegin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_rbegin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_rbegin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorEdges_rbegin'.\n Possible C/C++ prototypes are:\n rbegin()\n rbegin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_rend__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_rend" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_rend__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_rend" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_rend(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_rend__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_rend__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorEdges_rend'.\n Possible C/C++ prototypes are:\n rend()\n rend()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorEdges__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorEdges",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorEdges" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + result = (std::vector *)new std::vector(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_pop_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_pop_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->pop_back(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorEdges_resize",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->resize(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorEdges_erase",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator arg3 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + swig::PySwigIterator *iter3 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorEdges_erase",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res3) || !iter3) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + if (iter_t) { + arg3 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_erase(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorEdges_erase__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorEdges_erase__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorEdges_erase'.\n Possible C/C++ prototypes are:\n erase(std::vector::iterator)\n erase(std::vector::iterator,std::vector::iterator)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorEdges__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_VectorEdges",&obj0,&obj1)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorEdges" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_VectorEdges" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + result = (std::vector *)new std::vector(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorEdges(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 0) { + return _wrap_new_VectorEdges__SWIG_0(self, args); + } + if (argc == 1) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorEdges__SWIG_2(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorEdges__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorEdges__SWIG_3(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_VectorEdges'.\n Possible C/C++ prototypes are:\n std::vector<(p.Hex::Edge)>()\n std::vector<(p.Hex::Edge)>(std::vector const &)\n std::vector<(p.Hex::Edge)>(std::vector::size_type)\n std::vector<(p.Hex::Edge)>(std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorEdges_push_back",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_push_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorEdges_push_back" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + (arg1)->push_back(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_front",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_front" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (std::vector::value_type)((std::vector const *)arg1)->front(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_back" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (std::vector::value_type)((std::vector const *)arg1)->back(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorEdges_assign",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_assign" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges_assign" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorEdges_assign" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + (arg1)->assign(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorEdges_resize",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorEdges_resize" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + (arg1)->resize(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_resize(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorEdges_resize__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_resize__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorEdges_resize'.\n Possible C/C++ prototypes are:\n resize(std::vector::size_type)\n resize(std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorEdges_insert",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorEdges_insert" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + result = (arg1)->insert(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::size_type arg3 ; + std::vector::value_type arg4 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + size_t val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorEdges_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorEdges_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorEdges_insert" "', argument " "3"" of type '" "std::vector::size_type""'"); + } + arg3 = static_cast< std::vector::size_type >(val3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorEdges_insert" "', argument " "4"" of type '" "std::vector::value_type""'"); + } + arg4 = reinterpret_cast< std::vector::value_type >(argp4); + (arg1)->insert(arg2,arg3,arg4); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_insert(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_insert__SWIG_0(self, args); + } + } + } + } + if (argc == 4) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorEdges_insert__SWIG_1(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorEdges_insert'.\n Possible C/C++ prototypes are:\n insert(std::vector::iterator,std::vector::value_type)\n insert(std::vector::iterator,std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorEdges_reserve",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_reserve" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorEdges_reserve" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->reserve(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorEdges_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorEdges_capacity",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorEdges_capacity" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->capacity(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_VectorEdges(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorEdges",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorEdges" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *VectorEdges_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_VectorVertices_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + PyObject **arg2 = (PyObject **) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &obj0; + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_iterator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_iterator" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (swig::PySwigIterator *)std_vector_Sl_Hex_Vertex_Sm__Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices___nonzero__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices___nonzero__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)std_vector_Sl_Hex_Vertex_Sm__Sg____nonzero__((std::vector const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices___len__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices___len__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = std_vector_Sl_Hex_Vertex_Sm__Sg____len__((std::vector const *)arg1); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_pop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_pop" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + try { + result = (std::vector::value_type)std_vector_Sl_Hex_Vertex_Sm__Sg__pop(arg1); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorVertices___getslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices___getslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices___getslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorVertices___getslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + result = (std::vector > *)std_vector_Sl_Hex_Vertex_Sm__Sg____getslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices___setslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + int res4 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorVertices___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices___setslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices___setslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorVertices___setslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + { + std::vector > *ptr = (std::vector > *)0; + res4 = swig::asptr(obj3, &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorVertices___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorVertices___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + arg4 = ptr; + } + try { + std_vector_Sl_Hex_Vertex_Sm__Sg____setslice__(arg1,arg2,arg3,(std::vector > const &)*arg4); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res4)) delete arg4; + return resultobj; +fail: + if (SWIG_IsNewObj(res4)) delete arg4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorVertices___delslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices___delslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices___delslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorVertices___delslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + std_vector_Sl_Hex_Vertex_Sm__Sg____delslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorVertices___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices___delitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices___delitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + std_vector_Sl_Hex_Vertex_Sm__Sg____delitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorVertices___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices___getitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices___getitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + result = (std::vector::value_type)std_vector_Sl_Hex_Vertex_Sm__Sg____getitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorVertices___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices___setitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices___setitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorVertices___setitem__" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + try { + std_vector_Sl_Hex_Vertex_Sm__Sg____setitem__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorVertices_append",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_append" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorVertices_append" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + std_vector_Sl_Hex_Vertex_Sm__Sg__append(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorVertices__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_VectorVertices")) SWIG_fail; + result = (std::vector *)new std::vector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorVertices__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = 0 ; + std::vector *result = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorVertices",&obj0)) SWIG_fail; + { + std::vector > *ptr = (std::vector > *)0; + res1 = swig::asptr(obj0, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VectorVertices" "', argument " "1"" of type '" "std::vector const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VectorVertices" "', argument " "1"" of type '" "std::vector const &""'"); + } + arg1 = ptr; + } + result = (std::vector *)new std::vector((std::vector const &)*arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, SWIG_POINTER_NEW | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_empty",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_empty" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)((std::vector const *)arg1)->empty(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_size" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->size(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_clear",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_clear" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->clear(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorVertices_swap",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_swap" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorVertices_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorVertices_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + arg2 = reinterpret_cast< std::vector * >(argp2); + (arg1)->swap(*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + SwigValueWrapper > result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_get_allocator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_get_allocator" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->get_allocator(); + resultobj = SWIG_NewPointerObj((new std::vector::allocator_type(static_cast< const std::vector::allocator_type& >(result))), SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__allocator_type, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_begin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_begin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_begin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_begin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_begin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_begin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_begin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorVertices_begin'.\n Possible C/C++ prototypes are:\n begin()\n begin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_end__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_end" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_end__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_end" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_end(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_end__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_end__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorVertices_end'.\n Possible C/C++ prototypes are:\n end()\n end()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_rbegin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_rbegin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_rbegin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_rbegin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_rbegin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_rbegin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_rbegin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorVertices_rbegin'.\n Possible C/C++ prototypes are:\n rbegin()\n rbegin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_rend__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_rend" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_rend__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_rend" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_rend(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_rend__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_rend__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorVertices_rend'.\n Possible C/C++ prototypes are:\n rend()\n rend()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorVertices__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorVertices",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorVertices" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + result = (std::vector *)new std::vector(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_pop_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_pop_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->pop_back(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorVertices_resize",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->resize(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorVertices_erase",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator arg3 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + swig::PySwigIterator *iter3 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorVertices_erase",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res3) || !iter3) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + if (iter_t) { + arg3 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_erase(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorVertices_erase__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorVertices_erase__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorVertices_erase'.\n Possible C/C++ prototypes are:\n erase(std::vector::iterator)\n erase(std::vector::iterator,std::vector::iterator)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorVertices__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_VectorVertices",&obj0,&obj1)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorVertices" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_VectorVertices" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + result = (std::vector *)new std::vector(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorVertices(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 0) { + return _wrap_new_VectorVertices__SWIG_0(self, args); + } + if (argc == 1) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorVertices__SWIG_2(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorVertices__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorVertices__SWIG_3(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_VectorVertices'.\n Possible C/C++ prototypes are:\n std::vector<(p.Hex::Vertex)>()\n std::vector<(p.Hex::Vertex)>(std::vector const &)\n std::vector<(p.Hex::Vertex)>(std::vector::size_type)\n std::vector<(p.Hex::Vertex)>(std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type arg2 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorVertices_push_back",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_push_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorVertices_push_back" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + arg2 = reinterpret_cast< std::vector::value_type >(argp2); + (arg1)->push_back(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_front",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_front" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (std::vector::value_type)((std::vector const *)arg1)->front(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_back" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (std::vector::value_type)((std::vector const *)arg1)->back(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorVertices_assign",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_assign" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices_assign" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorVertices_assign" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + (arg1)->assign(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorVertices_resize",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorVertices_resize" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + (arg1)->resize(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_resize(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorVertices_resize__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_resize__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorVertices_resize'.\n Possible C/C++ prototypes are:\n resize(std::vector::size_type)\n resize(std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::value_type arg3 = (std::vector::value_type) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorVertices_insert",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VectorVertices_insert" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + arg3 = reinterpret_cast< std::vector::value_type >(argp3); + result = (arg1)->insert(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::size_type arg3 ; + std::vector::value_type arg4 = (std::vector::value_type) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + size_t val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorVertices_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorVertices_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorVertices_insert" "', argument " "3"" of type '" "std::vector::size_type""'"); + } + arg3 = static_cast< std::vector::size_type >(val3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorVertices_insert" "', argument " "4"" of type '" "std::vector::value_type""'"); + } + arg4 = reinterpret_cast< std::vector::value_type >(argp4); + (arg1)->insert(arg2,arg3,arg4); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_insert(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_insert__SWIG_0(self, args); + } + } + } + } + if (argc == 4) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorVertices_insert__SWIG_1(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorVertices_insert'.\n Possible C/C++ prototypes are:\n insert(std::vector::iterator,std::vector::value_type)\n insert(std::vector::iterator,std::vector::size_type,std::vector::value_type)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorVertices_reserve",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_reserve" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorVertices_reserve" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->reserve(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorVertices_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorVertices_capacity",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorVertices_capacity" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->capacity(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_VectorVertices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorVertices",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorVertices" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *VectorVertices_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_VectorReal_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + PyObject **arg2 = (PyObject **) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &obj0; + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_iterator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_iterator" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (swig::PySwigIterator *)std_vector_Sl_double_Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal___nonzero__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal___nonzero__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)std_vector_Sl_double_Sg____nonzero__((std::vector const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal___len__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal___len__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = std_vector_Sl_double_Sg____len__((std::vector const *)arg1); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_pop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_pop" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + try { + result = (std::vector::value_type)std_vector_Sl_double_Sg__pop(arg1); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorReal___getslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal___getslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal___getslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorReal___getslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + result = (std::vector > *)std_vector_Sl_double_Sg____getslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal___setslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + int res4 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorReal___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal___setslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal___setslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorReal___setslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + { + std::vector > *ptr = (std::vector > *)0; + res4 = swig::asptr(obj3, &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorReal___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorReal___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + arg4 = ptr; + } + try { + std_vector_Sl_double_Sg____setslice__(arg1,arg2,arg3,(std::vector > const &)*arg4); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res4)) delete arg4; + return resultobj; +fail: + if (SWIG_IsNewObj(res4)) delete arg4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorReal___delslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal___delslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal___delslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorReal___delslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + std_vector_Sl_double_Sg____delslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorReal___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal___delitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal___delitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + std_vector_Sl_double_Sg____delitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorReal___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal___getitem__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal___getitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + { + std::vector::value_type const &_result_ref = std_vector_Sl_double_Sg____getitem__((std::vector const *)arg1,arg2); + result = (std::vector::value_type *) &_result_ref; + } + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_From_double(static_cast< double >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + std::vector::value_type temp3 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorReal___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal___setitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal___setitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorReal___setitem__" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + temp3 = static_cast< std::vector::value_type >(val3); + arg3 = &temp3; + try { + std_vector_Sl_double_Sg____setitem__(arg1,arg2,(double const &)*arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::vector::value_type temp2 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorReal_append",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_append" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal_append" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + temp2 = static_cast< std::vector::value_type >(val2); + arg2 = &temp2; + std_vector_Sl_double_Sg__append(arg1,(double const &)*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorReal__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_VectorReal")) SWIG_fail; + result = (std::vector *)new std::vector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorReal__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = 0 ; + std::vector *result = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorReal",&obj0)) SWIG_fail; + { + std::vector > *ptr = (std::vector > *)0; + res1 = swig::asptr(obj0, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VectorReal" "', argument " "1"" of type '" "std::vector const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VectorReal" "', argument " "1"" of type '" "std::vector const &""'"); + } + arg1 = ptr; + } + result = (std::vector *)new std::vector((std::vector const &)*arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, SWIG_POINTER_NEW | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_empty",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_empty" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)((std::vector const *)arg1)->empty(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_size" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->size(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_clear",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_clear" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->clear(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorReal_swap",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_swap" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorReal_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorReal_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + arg2 = reinterpret_cast< std::vector * >(argp2); + (arg1)->swap(*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + SwigValueWrapper > result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_get_allocator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_get_allocator" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->get_allocator(); + resultobj = SWIG_NewPointerObj((new std::vector::allocator_type(static_cast< const std::vector::allocator_type& >(result))), SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t__allocator_type, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_begin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_begin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_begin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_begin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_begin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorReal_begin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorReal_begin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorReal_begin'.\n Possible C/C++ prototypes are:\n begin()\n begin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_end__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_end" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_end__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_end" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_end(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorReal_end__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorReal_end__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorReal_end'.\n Possible C/C++ prototypes are:\n end()\n end()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_rbegin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_rbegin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_rbegin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_rbegin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_rbegin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorReal_rbegin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorReal_rbegin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorReal_rbegin'.\n Possible C/C++ prototypes are:\n rbegin()\n rbegin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_rend__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_rend" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_rend__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_rend" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_rend(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorReal_rend__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorReal_rend__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorReal_rend'.\n Possible C/C++ prototypes are:\n rend()\n rend()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorReal__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorReal",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorReal" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + result = (std::vector *)new std::vector(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_pop_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_pop_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->pop_back(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorReal_resize",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->resize(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorReal_erase",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator arg3 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + swig::PySwigIterator *iter3 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorReal_erase",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res3) || !iter3) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + if (iter_t) { + arg3 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_erase(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorReal_erase__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorReal_erase__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorReal_erase'.\n Possible C/C++ prototypes are:\n erase(std::vector::iterator)\n erase(std::vector::iterator,std::vector::iterator)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorReal__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector::value_type *arg2 = 0 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + std::vector::value_type temp2 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_VectorReal",&obj0,&obj1)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorReal" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_VectorReal" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + temp2 = static_cast< std::vector::value_type >(val2); + arg2 = &temp2; + result = (std::vector *)new std::vector(arg1,(std::vector::value_type const &)*arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorReal(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 0) { + return _wrap_new_VectorReal__SWIG_0(self, args); + } + if (argc == 1) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorReal__SWIG_2(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorReal__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorReal__SWIG_3(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_VectorReal'.\n Possible C/C++ prototypes are:\n std::vector<(double)>()\n std::vector<(double)>(std::vector const &)\n std::vector<(double)>(std::vector::size_type)\n std::vector<(double)>(std::vector::size_type,std::vector::value_type const &)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::vector::value_type temp2 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorReal_push_back",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_push_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal_push_back" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + temp2 = static_cast< std::vector::value_type >(val2); + arg2 = &temp2; + (arg1)->push_back((std::vector::value_type const &)*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_front",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_front" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + { + std::vector::value_type const &_result_ref = ((std::vector const *)arg1)->front(); + result = (std::vector::value_type *) &_result_ref; + } + resultobj = SWIG_From_double(static_cast< double >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_back" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + { + std::vector::value_type const &_result_ref = ((std::vector const *)arg1)->back(); + result = (std::vector::value_type *) &_result_ref; + } + resultobj = SWIG_From_double(static_cast< double >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + std::vector::value_type temp3 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorReal_assign",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_assign" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal_assign" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorReal_assign" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + temp3 = static_cast< std::vector::value_type >(val3); + arg3 = &temp3; + (arg1)->assign(arg2,(std::vector::value_type const &)*arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + std::vector::value_type temp3 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorReal_resize",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorReal_resize" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + temp3 = static_cast< std::vector::value_type >(val3); + arg3 = &temp3; + (arg1)->resize(arg2,(std::vector::value_type const &)*arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_resize(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorReal_resize__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorReal_resize__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorReal_resize'.\n Possible C/C++ prototypes are:\n resize(std::vector::size_type)\n resize(std::vector::size_type,std::vector::value_type const &)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::value_type *arg3 = 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + std::vector::value_type temp3 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorReal_insert",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorReal_insert" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + temp3 = static_cast< std::vector::value_type >(val3); + arg3 = &temp3; + result = (arg1)->insert(arg2,(std::vector::value_type const &)*arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::size_type arg3 ; + std::vector::value_type *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + size_t val3 ; + int ecode3 = 0 ; + std::vector::value_type temp4 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorReal_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorReal_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorReal_insert" "', argument " "3"" of type '" "std::vector::size_type""'"); + } + arg3 = static_cast< std::vector::size_type >(val3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VectorReal_insert" "', argument " "4"" of type '" "std::vector::value_type""'"); + } + temp4 = static_cast< std::vector::value_type >(val4); + arg4 = &temp4; + (arg1)->insert(arg2,arg3,(std::vector::value_type const &)*arg4); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_insert(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorReal_insert__SWIG_0(self, args); + } + } + } + } + if (argc == 4) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorReal_insert__SWIG_1(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorReal_insert'.\n Possible C/C++ prototypes are:\n insert(std::vector::iterator,std::vector::value_type const &)\n insert(std::vector::iterator,std::vector::size_type,std::vector::value_type const &)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorReal_reserve",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_reserve" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorReal_reserve" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->reserve(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorReal_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorReal_capacity",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorReal_capacity" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->capacity(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_VectorReal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorReal",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorReal" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *VectorReal_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_VectorInt_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + PyObject **arg2 = (PyObject **) 0 ; + swig::PySwigIterator *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + arg2 = &obj0; + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_iterator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_iterator" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (swig::PySwigIterator *)std_vector_Sl_int_Sg__iterator(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__PySwigIterator, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt___nonzero__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt___nonzero__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)std_vector_Sl_int_Sg____nonzero__((std::vector const *)arg1); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt___len__",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt___len__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = std_vector_Sl_int_Sg____len__((std::vector const *)arg1); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_pop",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_pop" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + try { + result = (std::vector::value_type)std_vector_Sl_int_Sg__pop(arg1); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorInt___getslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt___getslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt___getslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorInt___getslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + result = (std::vector > *)std_vector_Sl_int_Sg____getslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt___setslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + std::vector > *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + int res4 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorInt___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt___setslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt___setslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorInt___setslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + { + std::vector > *ptr = (std::vector > *)0; + res4 = swig::asptr(obj3, &ptr); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VectorInt___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorInt___setslice__" "', argument " "4"" of type '" "std::vector > const &""'"); + } + arg4 = ptr; + } + try { + std_vector_Sl_int_Sg____setslice__(arg1,arg2,arg3,(std::vector > const &)*arg4); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + catch(std::invalid_argument &_e) { + SWIG_exception_fail(SWIG_ValueError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + if (SWIG_IsNewObj(res4)) delete arg4; + return resultobj; +fail: + if (SWIG_IsNewObj(res4)) delete arg4; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::difference_type arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + ptrdiff_t val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorInt___delslice__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt___delslice__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt___delslice__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorInt___delslice__" "', argument " "3"" of type '" "std::vector::difference_type""'"); + } + arg3 = static_cast< std::vector::difference_type >(val3); + try { + std_vector_Sl_int_Sg____delslice__(arg1,arg2,arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorInt___delitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt___delitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt___delitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + std_vector_Sl_int_Sg____delitem__(arg1,arg2); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorInt___getitem__",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt___getitem__" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt___getitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + try { + { + std::vector::value_type const &_result_ref = std_vector_Sl_int_Sg____getitem__((std::vector const *)arg1,arg2); + result = (std::vector::value_type *) &_result_ref; + } + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_From_int(static_cast< int >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt___setitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::difference_type arg2 ; + std::vector::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + ptrdiff_t val2 ; + int ecode2 = 0 ; + std::vector::value_type temp3 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorInt___setitem__",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt___setitem__" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt___setitem__" "', argument " "2"" of type '" "std::vector::difference_type""'"); + } + arg2 = static_cast< std::vector::difference_type >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorInt___setitem__" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + temp3 = static_cast< std::vector::value_type >(val3); + arg3 = &temp3; + try { + std_vector_Sl_int_Sg____setitem__(arg1,arg2,(int const &)*arg3); + } + catch(std::out_of_range &_e) { + SWIG_exception_fail(SWIG_IndexError, (&_e)->what()); + } + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::vector::value_type temp2 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorInt_append",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_append" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt_append" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + temp2 = static_cast< std::vector::value_type >(val2); + arg2 = &temp2; + std_vector_Sl_int_Sg__append(arg1,(int const &)*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorInt__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_VectorInt")) SWIG_fail; + result = (std::vector *)new std::vector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorInt__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = 0 ; + std::vector *result = 0 ; + int res1 = SWIG_OLDOBJ ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorInt",&obj0)) SWIG_fail; + { + std::vector > *ptr = (std::vector > *)0; + res1 = swig::asptr(obj0, &ptr); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VectorInt" "', argument " "1"" of type '" "std::vector const &""'"); + } + if (!ptr) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VectorInt" "', argument " "1"" of type '" "std::vector const &""'"); + } + arg1 = ptr; + } + result = (std::vector *)new std::vector((std::vector const &)*arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, SWIG_POINTER_NEW | 0 ); + if (SWIG_IsNewObj(res1)) delete arg1; + return resultobj; +fail: + if (SWIG_IsNewObj(res1)) delete arg1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_empty",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_empty" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (bool)((std::vector const *)arg1)->empty(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_size",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_size" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->size(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_clear",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_clear" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->clear(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorInt_swap",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_swap" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VectorInt_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VectorInt_swap" "', argument " "2"" of type '" "std::vector &""'"); + } + arg2 = reinterpret_cast< std::vector * >(argp2); + (arg1)->swap(*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + SwigValueWrapper > result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_get_allocator",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_get_allocator" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->get_allocator(); + resultobj = SWIG_NewPointerObj((new std::vector::allocator_type(static_cast< const std::vector::allocator_type& >(result))), SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t__allocator_type, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_begin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_begin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_begin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_begin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_begin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->begin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_begin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorInt_begin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorInt_begin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorInt_begin'.\n Possible C/C++ prototypes are:\n begin()\n begin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_end__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_end" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_end__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_end",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_end" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->end(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_end(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorInt_end__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorInt_end__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorInt_end'.\n Possible C/C++ prototypes are:\n end()\n end()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_rbegin__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_rbegin" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_rbegin__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_rbegin",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_rbegin" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rbegin(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_rbegin(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorInt_rbegin__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorInt_rbegin__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorInt_rbegin'.\n Possible C/C++ prototypes are:\n rbegin()\n rbegin()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_rend__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_rend" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = (arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_rend__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::const_reverse_iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_rend",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_rend" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->rend(); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::const_reverse_iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_rend(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[2]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 1); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorInt_rend__SWIG_0(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_VectorInt_rend__SWIG_1(self, args); + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorInt_rend'.\n Possible C/C++ prototypes are:\n rend()\n rend()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorInt__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_VectorInt",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorInt" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + result = (std::vector *)new std::vector(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_pop_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_pop_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + (arg1)->pop_back(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorInt_resize",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->resize(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorInt_erase",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::iterator arg3 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + swig::PySwigIterator *iter3 = 0 ; + int res3 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorInt_erase",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_erase" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_erase" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res3) || !iter3) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter3); + if (iter_t) { + arg3 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_erase" "', argument " "3"" of type '" "std::vector::iterator""'"); + } + } + result = (arg1)->erase(arg2,arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_erase(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorInt_erase__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + return _wrap_VectorInt_erase__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorInt_erase'.\n Possible C/C++ prototypes are:\n erase(std::vector::iterator)\n erase(std::vector::iterator,std::vector::iterator)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorInt__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector::size_type arg1 ; + std::vector::value_type *arg2 = 0 ; + std::vector *result = 0 ; + size_t val1 ; + int ecode1 = 0 ; + std::vector::value_type temp2 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_VectorInt",&obj0,&obj1)) SWIG_fail; + ecode1 = SWIG_AsVal_size_t(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VectorInt" "', argument " "1"" of type '" "std::vector::size_type""'"); + } + arg1 = static_cast< std::vector::size_type >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_VectorInt" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + temp2 = static_cast< std::vector::value_type >(val2); + arg2 = &temp2; + result = (std::vector *)new std::vector(arg1,(std::vector::value_type const &)*arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_VectorInt(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 0) { + return _wrap_new_VectorInt__SWIG_0(self, args); + } + if (argc == 1) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorInt__SWIG_2(self, args); + } + } + if (argc == 1) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_VectorInt__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + { + int res = SWIG_AsVal_size_t(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_VectorInt__SWIG_3(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_VectorInt'.\n Possible C/C++ prototypes are:\n std::vector<(int)>()\n std::vector<(int)>(std::vector const &)\n std::vector<(int)>(std::vector::size_type)\n std::vector<(int)>(std::vector::size_type,std::vector::value_type const &)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + std::vector::value_type temp2 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorInt_push_back",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_push_back" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt_push_back" "', argument " "2"" of type '" "std::vector::value_type""'"); + } + temp2 = static_cast< std::vector::value_type >(val2); + arg2 = &temp2; + (arg1)->push_back((std::vector::value_type const &)*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_front",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_front" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + { + std::vector::value_type const &_result_ref = ((std::vector const *)arg1)->front(); + result = (std::vector::value_type *) &_result_ref; + } + resultobj = SWIG_From_int(static_cast< int >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::value_type *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_back",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_back" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + { + std::vector::value_type const &_result_ref = ((std::vector const *)arg1)->back(); + result = (std::vector::value_type *) &_result_ref; + } + resultobj = SWIG_From_int(static_cast< int >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + std::vector::value_type temp3 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorInt_assign",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_assign" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt_assign" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorInt_assign" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + temp3 = static_cast< std::vector::value_type >(val3); + arg3 = &temp3; + (arg1)->assign(arg2,(std::vector::value_type const &)*arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + std::vector::value_type *arg3 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + std::vector::value_type temp3 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorInt_resize",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_resize" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt_resize" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorInt_resize" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + temp3 = static_cast< std::vector::value_type >(val3); + arg3 = &temp3; + (arg1)->resize(arg2,(std::vector::value_type const &)*arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_resize(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorInt_resize__SWIG_0(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorInt_resize__SWIG_1(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorInt_resize'.\n Possible C/C++ prototypes are:\n resize(std::vector::size_type)\n resize(std::vector::size_type,std::vector::value_type const &)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::value_type *arg3 = 0 ; + std::vector::iterator result; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + std::vector::value_type temp3 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:VectorInt_insert",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorInt_insert" "', argument " "3"" of type '" "std::vector::value_type""'"); + } + temp3 = static_cast< std::vector::value_type >(val3); + arg3 = &temp3; + result = (arg1)->insert(arg2,(std::vector::value_type const &)*arg3); + resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector::iterator & >(result)), + swig::PySwigIterator::descriptor(),SWIG_POINTER_OWN); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::iterator arg2 ; + std::vector::size_type arg3 ; + std::vector::value_type *arg4 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + swig::PySwigIterator *iter2 = 0 ; + int res2 ; + size_t val3 ; + int ecode3 = 0 ; + std::vector::value_type temp4 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:VectorInt_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_insert" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::PySwigIterator::descriptor(), 0); + if (!SWIG_IsOK(res2) || !iter2) { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } else { + swig::PySwigIterator_T::iterator > *iter_t = dynamic_cast::iterator > *>(iter2); + if (iter_t) { + arg2 = iter_t->get_current(); + } else { + SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VectorInt_insert" "', argument " "2"" of type '" "std::vector::iterator""'"); + } + } + ecode3 = SWIG_AsVal_size_t(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VectorInt_insert" "', argument " "3"" of type '" "std::vector::size_type""'"); + } + arg3 = static_cast< std::vector::size_type >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "VectorInt_insert" "', argument " "4"" of type '" "std::vector::value_type""'"); + } + temp4 = static_cast< std::vector::value_type >(val4); + arg4 = &temp4; + (arg1)->insert(arg2,arg3,(std::vector::value_type const &)*arg4); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_insert(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorInt_insert__SWIG_0(self, args); + } + } + } + } + if (argc == 4) { + int _v; + int res = swig::asptr(argv[0], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + swig::PySwigIterator *iter = 0; + int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::PySwigIterator::descriptor(), 0); + _v = (SWIG_IsOK(res) && iter && (dynamic_cast::iterator > *>(iter) != 0)); + if (_v) { + { + int res = SWIG_AsVal_size_t(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_VectorInt_insert__SWIG_1(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'VectorInt_insert'.\n Possible C/C++ prototypes are:\n insert(std::vector::iterator,std::vector::value_type const &)\n insert(std::vector::iterator,std::vector::size_type,std::vector::value_type const &)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:VectorInt_reserve",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_reserve" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + ecode2 = SWIG_AsVal_size_t(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VectorInt_reserve" "', argument " "2"" of type '" "std::vector::size_type""'"); + } + arg2 = static_cast< std::vector::size_type >(val2); + (arg1)->reserve(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_VectorInt_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + std::vector::size_type result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:VectorInt_capacity",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VectorInt_capacity" "', argument " "1"" of type '" "std::vector const *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + result = ((std::vector const *)arg1)->capacity(); + resultobj = SWIG_From_size_t(static_cast< size_t >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_VectorInt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + std::vector *arg1 = (std::vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_VectorInt",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VectorInt" "', argument " "1"" of type '" "std::vector *""'"); + } + arg1 = reinterpret_cast< std::vector * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *VectorInt_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN int ABR_TYPES_set(PyObject *) { + SWIG_Error(SWIG_AttributeError,"Variable ABR_TYPES is read-only."); + return 1; +} + + +SWIGINTERN PyObject *ABR_TYPES_get(void) { + PyObject *pyobj = 0; + + pyobj = SWIG_FromCharPtr(Hex::ABR_TYPES); + return pyobj; +} + + +SWIGINTERN PyObject *_wrap_get_temp_name(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + pchar arg2 = (pchar) 0 ; + pchar result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:get_temp_name",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_temp_name" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "get_temp_name" "', argument " "2"" of type '" "pchar""'"); + } + arg2 = reinterpret_cast< pchar >(buf2); + result = (pchar)Hex::get_temp_name((char const *)arg1,arg2); + resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_fatal_error__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + cpchar arg2 = (cpchar) 0 ; + cpchar arg3 = (cpchar) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:fatal_error",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fatal_error" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fatal_error" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "fatal_error" "', argument " "3"" of type '" "cpchar""'"); + } + arg3 = reinterpret_cast< cpchar >(buf3); + Hex::fatal_error((char const *)arg1,(char const *)arg2,(char const *)arg3); + resultobj = SWIG_Py_Void(); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_fatal_error__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + cpchar arg2 = (cpchar) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:fatal_error",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fatal_error" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "fatal_error" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + Hex::fatal_error((char const *)arg1,(char const *)arg2); + resultobj = SWIG_Py_Void(); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_fatal_error__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:fatal_error",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "fatal_error" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + Hex::fatal_error((char const *)arg1); + resultobj = SWIG_Py_Void(); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_fatal_error(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_fatal_error__SWIG_2(self, args); + } + } + if (argc == 2) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_fatal_error__SWIG_1(self, args); + } + } + } + if (argc == 3) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[2], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_fatal_error__SWIG_0(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'fatal_error'.\n Possible C/C++ prototypes are:\n Hex::fatal_error(cpchar,cpchar,cpchar)\n Hex::fatal_error(cpchar,cpchar)\n Hex::fatal_error(cpchar)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_prod_scalaire(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + double *arg2 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:prod_scalaire",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "prod_scalaire" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "prod_scalaire" "', argument " "2"" of type '" "double []""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + result = (double)Hex::prod_scalaire(arg1,arg2); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_prod_vectoriel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + double *arg2 ; + double *arg3 ; + double *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:prod_vectoriel",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "prod_vectoriel" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "prod_vectoriel" "', argument " "2"" of type '" "double []""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "prod_vectoriel" "', argument " "3"" of type '" "double []""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + result = (double *)Hex::prod_vectoriel(arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_prod_mixte(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + double *arg2 ; + double *arg3 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:prod_mixte",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "prod_mixte" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "prod_mixte" "', argument " "2"" of type '" "double []""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "prod_mixte" "', argument " "3"" of type '" "double []""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + result = (double)Hex::prod_mixte(arg1,arg2,arg3); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_deg2radians(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double arg1 ; + double result; + double val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:deg2radians",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_double(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "deg2radians" "', argument " "1"" of type '" "double""'"); + } + arg1 = static_cast< double >(val1); + result = (double)Hex::deg2radians(arg1); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_rad2degres(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double arg1 ; + double result; + double val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:rad2degres",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_double(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rad2degres" "', argument " "1"" of type '" "double""'"); + } + arg1 = static_cast< double >(val1); + result = (double)Hex::rad2degres(arg1); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_calc_norme(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:calc_norme",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "calc_norme" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + result = (double)Hex::calc_norme(arg1); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_calc_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + double *arg2 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:calc_distance",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "calc_distance" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "calc_distance" "', argument " "2"" of type '" "double []""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + result = (double)Hex::calc_distance(arg1,arg2); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_calc_vecteur(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + double *arg2 ; + double *arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:calc_vecteur",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "calc_vecteur" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "calc_vecteur" "', argument " "2"" of type '" "double []""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "calc_vecteur" "', argument " "3"" of type '" "double []""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + Hex::calc_vecteur(arg1,arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_copy_vecteur(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + double *arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:copy_vecteur",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "copy_vecteur" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "copy_vecteur" "', argument " "2"" of type '" "double []""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + Hex::copy_vecteur(arg1,arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_calc_milieu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + double *arg2 ; + double *arg3 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:calc_milieu",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "calc_milieu" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "calc_milieu" "', argument " "2"" of type '" "double []""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "calc_milieu" "', argument " "3"" of type '" "double []""'"); + } + arg3 = reinterpret_cast< double * >(argp3); + Hex::calc_milieu(arg1,arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_normer_vecteur(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:normer_vecteur",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "normer_vecteur" "', argument " "1"" of type '" "double []""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + result = (int)Hex::normer_vecteur(arg1); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_carre(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double arg1 ; + double result; + double val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:carre",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_double(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "carre" "', argument " "1"" of type '" "double""'"); + } + arg1 = static_cast< double >(val1); + result = (double)Hex::carre(arg1); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_same_coords__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 = (double *) 0 ; + double *arg2 = (double *) 0 ; + double arg3 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:same_coords",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "same_coords" "', argument " "1"" of type '" "double *""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "same_coords" "', argument " "2"" of type '" "double *""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "same_coords" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + result = (bool)Hex::same_coords(arg1,arg2,arg3); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_same_coords__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 = (double *) 0 ; + double *arg2 = (double *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:same_coords",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "same_coords" "', argument " "1"" of type '" "double *""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "same_coords" "', argument " "2"" of type '" "double *""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + result = (bool)Hex::same_coords(arg1,arg2); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_same_coords(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_double, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_double, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_same_coords__SWIG_1(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_double, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_double, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_same_coords__SWIG_0(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'same_coords'.\n Possible C/C++ prototypes are:\n Hex::same_coords(double *,double *,double)\n Hex::same_coords(double *,double *)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_requals__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double arg1 ; + double arg2 ; + bool result; + double val1 ; + int ecode1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:requals",&obj0,&obj1)) SWIG_fail; + ecode1 = SWIG_AsVal_double(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "requals" "', argument " "1"" of type '" "double""'"); + } + arg1 = static_cast< double >(val1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "requals" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + result = (bool)Hex::requals(arg1,arg2); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_requals__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + double *arg1 = (double *) 0 ; + double *arg2 = (double *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:requals",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "requals" "', argument " "1"" of type '" "double const *""'"); + } + arg1 = reinterpret_cast< double * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "requals" "', argument " "2"" of type '" "double const *""'"); + } + arg2 = reinterpret_cast< double * >(argp2); + result = (bool)Hex::requals((double const *)arg1,(double const *)arg2); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_requals(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_double, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_double, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_requals__SWIG_1(self, args); + } + } + } + if (argc == 2) { + int _v; + { + int res = SWIG_AsVal_double(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_requals__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'requals'.\n Possible C/C++ prototypes are:\n Hex::requals(double const,double const)\n Hex::requals(double const *,double const *)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_on_debug(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + bool result; + + if (!PyArg_ParseTuple(args,(char *)":on_debug")) SWIG_fail; + result = (bool)Hex::on_debug(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_in_test(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + bool result; + + if (!PyArg_ParseTuple(args,(char *)":in_test")) SWIG_fail; + result = (bool)Hex::in_test(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_niv_debug(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int result; + + if (!PyArg_ParseTuple(args,(char *)":niv_debug")) SWIG_fail; + result = (int)Hex::niv_debug(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_set_minus(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + string *arg1 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:set_minus",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_string, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "set_minus" "', argument " "1"" of type '" "string &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "set_minus" "', argument " "1"" of type '" "string &""'"); + } + arg1 = reinterpret_cast< string * >(argp1); + Hex::set_minus(*arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_special_option(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + bool result; + + if (!PyArg_ParseTuple(args,(char *)":special_option")) SWIG_fail; + result = (bool)Hex::special_option(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_set_special_option(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + bool arg1 ; + bool val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:set_special_option",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_bool(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "set_special_option" "', argument " "1"" of type '" "bool""'"); + } + arg1 = static_cast< bool >(val1); + Hex::set_special_option(arg1); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_sizeof_file(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + int result; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:sizeof_file",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sizeof_file" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + result = (int)Hex::sizeof_file((char const *)arg1); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_read_file(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + int *arg2 = 0 ; + char *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:read_file",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "read_file" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_int, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "read_file" "', argument " "2"" of type '" "int &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "read_file" "', argument " "2"" of type '" "int &""'"); + } + arg2 = reinterpret_cast< int * >(argp2); + result = (char *)Hex::read_file((char const *)arg1,*arg2); + resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_get_time(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + string *arg1 = 0 ; + cpchar result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:get_time",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_string, 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_time" "', argument " "1"" of type '" "string &""'"); + } + if (!argp1) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "get_time" "', argument " "1"" of type '" "string &""'"); + } + arg1 = reinterpret_cast< string * >(argp1); + result = (cpchar)Hex::get_time(*arg1); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN int Epsil_set(PyObject *) { + SWIG_Error(SWIG_AttributeError,"Variable Epsil is read-only."); + return 1; +} + + +SWIGINTERN PyObject *Epsil_get(void) { + PyObject *pyobj = 0; + + pyobj = SWIG_From_double(static_cast< double >(Hex::Epsil)); + return pyobj; +} + + +SWIGINTERN int UnEpsil_set(PyObject *) { + SWIG_Error(SWIG_AttributeError,"Variable UnEpsil is read-only."); + return 1; +} + + +SWIGINTERN PyObject *UnEpsil_get(void) { + PyObject *pyobj = 0; + + pyobj = SWIG_From_double(static_cast< double >(Hex::UnEpsil)); + return pyobj; +} + + +SWIGINTERN int Epsil2_set(PyObject *) { + SWIG_Error(SWIG_AttributeError,"Variable Epsil2 is read-only."); + return 1; +} + + +SWIGINTERN PyObject *Epsil2_get(void) { + PyObject *pyobj = 0; + + pyobj = SWIG_From_double(static_cast< double >(Hex::Epsil2)); + return pyobj; +} + + +SWIGINTERN PyObject *_wrap_EltBase_countHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_countHexa",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_countHexa" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (int)(arg1)->countHexa(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_countQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_countQuad",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_countQuad" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (int)(arg1)->countQuad(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_countEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_countEdge",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_countEdge" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (int)(arg1)->countEdge(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_countVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_countVertex",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_countVertex" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (int)(arg1)->countVertex(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setError__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_setError",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_setError" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "EltBase_setError" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + (arg1)->setError(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setError__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_setError",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_setError" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->setError(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setError(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EltBase_setError__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_EltBase_setError__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'EltBase_setError'.\n Possible C/C++ prototypes are:\n setError(int)\n setError()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getError(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_getError",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getError" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (int)(arg1)->getError(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_isValid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_isValid",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_isValid" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (bool)(arg1)->isValid(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_isBad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_isBad",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_isBad" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (bool)(arg1)->isBad(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_duplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_duplicate",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_duplicate" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->duplicate(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_clearAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_clearAssociation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_clearAssociation" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->clearAssociation(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_replaceEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + Hex::Edge *arg2 = (Hex::Edge *) 0 ; + Hex::Edge *arg3 = (Hex::Edge *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:EltBase_replaceEdge",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_replaceEdge" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_replaceEdge" "', argument " "2"" of type '" "Hex::Edge *""'"); + } + arg2 = reinterpret_cast< Hex::Edge * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EltBase_replaceEdge" "', argument " "3"" of type '" "Hex::Edge *""'"); + } + arg3 = reinterpret_cast< Hex::Edge * >(argp3); + (arg1)->replaceEdge(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_replaceVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:EltBase_replaceVertex",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_replaceVertex" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_replaceVertex" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EltBase_replaceVertex" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + (arg1)->replaceVertex(arg2,arg3); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_EltBase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::EnumElt arg2 ; + Hex::EltBase *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_EltBase",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_EltBase" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_EltBase" "', argument " "2"" of type '" "Hex::EnumElt""'"); + } + arg2 = static_cast< Hex::EnumElt >(val2); + result = (Hex::EltBase *)new Hex::EltBase(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__EltBase, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_EltBase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::EltBase *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_EltBase",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_EltBase" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (Hex::EltBase *)new Hex::EltBase(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__EltBase, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_EltBase__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EnumElt arg1 ; + Hex::EltBase *result = 0 ; + int val1 ; + int ecode1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_EltBase",&obj0)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_EltBase" "', argument " "1"" of type '" "Hex::EnumElt""'"); + } + arg1 = static_cast< Hex::EnumElt >(val1); + result = (Hex::EltBase *)new Hex::EltBase(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__EltBase, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_EltBase__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_EltBase")) SWIG_fail; + result = (Hex::EltBase *)new Hex::EltBase(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__EltBase, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_EltBase(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 0) { + return _wrap_new_EltBase__SWIG_3(self, args); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_EltBase__SWIG_1(self, args); + } + } + if (argc == 1) { + int _v; + { + int res = SWIG_AsVal_int(argv[0], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_EltBase__SWIG_2(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_EltBase__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_EltBase'.\n Possible C/C++ prototypes are:\n Hex::EltBase(Hex::Document *,Hex::EnumElt)\n Hex::EltBase(Hex::Document *)\n Hex::EltBase(Hex::EnumElt)\n Hex::EltBase()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_EltBase(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_EltBase",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_EltBase" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_remove(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_remove",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_remove" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->remove(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_suppress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_suppress",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_suppress" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->suppress(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_dump(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_dump",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_dump" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->dump(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_saveXml(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + Hex::XmlWriter *arg2 = (Hex::XmlWriter *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_saveXml",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_saveXml" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__XmlWriter, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_saveXml" "', argument " "2"" of type '" "Hex::XmlWriter *""'"); + } + arg2 = reinterpret_cast< Hex::XmlWriter * >(argp2); + (arg1)->saveXml(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_majReferences(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_majReferences",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_majReferences" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->majReferences(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_makeVarName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + char *arg2 = (char *) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_makeVarName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_makeVarName" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_makeVarName" "', argument " "2"" of type '" "char *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (char *)(arg1)->makeVarName(arg2); + resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_makeName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int arg2 ; + char *arg3 = (char *) 0 ; + char *result = 0 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:EltBase_makeName",&obj0,&obj1,&obj2)) SWIG_fail; + ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "EltBase_makeName" "', argument " "1"" of type '" "int""'"); + } + arg1 = static_cast< int >(val1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "EltBase_makeName" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "EltBase_makeName" "', argument " "3"" of type '" "char *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (char *)Hex::EltBase::makeName(arg1,arg2,arg3); + resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + Hex::EltBase *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_next",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_next" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (Hex::EltBase *)(arg1)->next(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setNext(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + Hex::EltBase *arg2 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_setNext",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_setNext" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_setNext" "', argument " "2"" of type '" "Hex::EltBase *""'"); + } + arg2 = reinterpret_cast< Hex::EltBase * >(argp2); + (arg1)->setNext(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_getId",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getId" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (int)(arg1)->getId(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setId(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_setId",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_setId" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "EltBase_setId" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + (arg1)->setId(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_dad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + Hex::Document *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_dad",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_dad" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (Hex::Document *)(arg1)->dad(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + Hex::EnumElt result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_getType",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getType" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (Hex::EnumElt)(arg1)->getType(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_isHere(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_isHere",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_isHere" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (bool)(arg1)->isHere(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_isDeleted(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_isDeleted",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_isDeleted" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (bool)(arg1)->isDeleted(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_razReferences(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_razReferences",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_razReferences" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->razReferences(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_addParent(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + Hex::EltBase *arg2 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_addParent",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_addParent" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_addParent" "', argument " "2"" of type '" "Hex::EltBase *""'"); + } + arg2 = reinterpret_cast< Hex::EltBase * >(argp2); + (arg1)->addParent(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getNbrParents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_getNbrParents",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getNbrParents" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (int)(arg1)->getNbrParents(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_hasParents(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_hasParents",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_hasParents" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (bool)(arg1)->hasParents(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getFather(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int arg2 ; + Hex::EltBase *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_getFather",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getFather" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "EltBase_getFather" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::EltBase *)(arg1)->getFather(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_getMark",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getMark" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (int)(arg1)->getMark(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setMark(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_setMark",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_setMark" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "EltBase_setMark" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + (arg1)->setMark(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getName__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + pchar arg2 = (pchar) 0 ; + char *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_getName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getName" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_getName" "', argument " "2"" of type '" "pchar""'"); + } + arg2 = reinterpret_cast< pchar >(buf2); + result = (char *)(arg1)->getName(arg2); + resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_printName__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + cpchar arg2 = (cpchar) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_printName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_printName" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_printName" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + (arg1)->printName(arg2); + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_printName__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_printName",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_printName" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->printName(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_printName(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EltBase_printName__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EltBase_printName__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'EltBase_printName'.\n Possible C/C++ prototypes are:\n printName(cpchar)\n printName()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_dumpRef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_dumpRef",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_dumpRef" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + (arg1)->dumpRef(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getName__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + cpchar result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_getName",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getName" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (cpchar)(arg1)->getName(); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getName(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EltBase_getName__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EltBase_getName__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'EltBase_getName'.\n Possible C/C++ prototypes are:\n getName(pchar)\n getName()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setName__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + string *arg2 = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_setName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_setName" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_string, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_setName" "', argument " "2"" of type '" "string const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "EltBase_setName" "', argument " "2"" of type '" "string const &""'"); + } + arg2 = reinterpret_cast< string * >(argp2); + (arg1)->setName((string const &)*arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setName__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + cpchar arg2 = (cpchar) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_setName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_setName" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "EltBase_setName" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + (arg1)->setName(arg2); + resultobj = SWIG_Py_Void(); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_setName(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_string, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EltBase_setName__SWIG_0(self, args); + } + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EltBase_setName__SWIG_1(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'EltBase_setName'.\n Possible C/C++ prototypes are:\n setName(string const &)\n setName(cpchar)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_debug__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + int arg2 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:EltBase_debug",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_debug" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "EltBase_debug" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (bool)(arg1)->debug(arg2); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_debug__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_debug",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_debug" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (bool)(arg1)->debug(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_debug(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_EltBase_debug__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__EltBase, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_EltBase_debug__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'EltBase_debug'.\n Possible C/C++ prototypes are:\n debug(int)\n debug()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_isAssociated(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_isAssociated",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_isAssociated" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (bool)(arg1)->isAssociated(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_EltBase_getNextName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::EltBase *arg1 = (Hex::EltBase *) 0 ; + string result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:EltBase_getNextName",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__EltBase, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "EltBase_getNextName" "', argument " "1"" of type '" "Hex::EltBase *""'"); + } + arg1 = reinterpret_cast< Hex::EltBase * >(argp1); + result = (arg1)->getNextName(); + resultobj = SWIG_NewPointerObj((new string(static_cast< const string& >(result))), SWIGTYPE_p_string, SWIG_POINTER_OWN | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *EltBase_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__EltBase, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_Vertex_getX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vertex_getX",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_getX" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + result = (double)(arg1)->getX(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_getY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vertex_getY",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_getY" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + result = (double)(arg1)->getY(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_getZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vertex_getZ",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_getZ" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + result = (double)(arg1)->getZ(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_setX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Vertex_setX",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_setX" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Vertex_setX" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setX(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_setY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Vertex_setY",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_setY" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Vertex_setY" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setY(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_setZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Vertex_setZ",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_setZ" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Vertex_setZ" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setZ(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_getAssoX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vertex_getAssoX",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_getAssoX" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + result = (double)(arg1)->getAssoX(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_getAssoY(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vertex_getAssoY",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_getAssoY" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + result = (double)(arg1)->getAssoY(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_getAssoZ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vertex_getAssoZ",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_getAssoZ" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + result = (double)(arg1)->getAssoZ(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_setAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + Hex::NewShape *arg2 = (Hex::NewShape *) 0 ; + int arg3 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Vertex_setAssociation",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_setAssociation" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__NewShape, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Vertex_setAssociation" "', argument " "2"" of type '" "Hex::NewShape *""'"); + } + arg2 = reinterpret_cast< Hex::NewShape * >(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Vertex_setAssociation" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (int)(arg1)->setAssociation(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_clearAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vertex_clearAssociation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_clearAssociation" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + (arg1)->clearAssociation(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vertex_setColor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Vertex_setColor",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vertex_setColor" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Vertex_setColor" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setColor(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Vertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + double arg3 ; + double arg4 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + double val3 ; + int ecode3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:new_Vertex",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Vertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Vertex" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Vertex" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_Vertex" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + result = (Hex::Vertex *)new Hex::Vertex(arg1,arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Vertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Vertex",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Vertex" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Vertex_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Vertex, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_Edge_getVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Edge *arg1 = (Hex::Edge *) 0 ; + int arg2 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Edge_getVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Edge_getVertex" "', argument " "1"" of type '" "Hex::Edge *""'"); + } + arg1 = reinterpret_cast< Hex::Edge * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Edge_getVertex" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Vertex *)(arg1)->getVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Edge_addAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Edge *arg1 = (Hex::Edge *) 0 ; + Hex::NewShape *arg2 = (Hex::NewShape *) 0 ; + int arg3 ; + double arg4 ; + double arg5 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + double val4 ; + int ecode4 = 0 ; + double val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Edge_addAssociation",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Edge_addAssociation" "', argument " "1"" of type '" "Hex::Edge *""'"); + } + arg1 = reinterpret_cast< Hex::Edge * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__NewShape, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Edge_addAssociation" "', argument " "2"" of type '" "Hex::NewShape *""'"); + } + arg2 = reinterpret_cast< Hex::NewShape * >(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Edge_addAssociation" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Edge_addAssociation" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Edge_addAssociation" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + result = (int)(arg1)->addAssociation(arg2,arg3,arg4,arg5); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Edge_clearAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Edge *arg1 = (Hex::Edge *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Edge_clearAssociation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Edge_clearAssociation" "', argument " "1"" of type '" "Hex::Edge *""'"); + } + arg1 = reinterpret_cast< Hex::Edge * >(argp1); + (arg1)->clearAssociation(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Edge_setColor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Edge *arg1 = (Hex::Edge *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Edge_setColor",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Edge_setColor" "', argument " "1"" of type '" "Hex::Edge *""'"); + } + arg1 = reinterpret_cast< Hex::Edge * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Edge_setColor" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setColor(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Edge_getWay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Edge *arg1 = (Hex::Edge *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Edge_getWay",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Edge_getWay" "', argument " "1"" of type '" "Hex::Edge *""'"); + } + arg1 = reinterpret_cast< Hex::Edge * >(argp1); + result = (bool)(arg1)->getWay(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Edge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_Edge",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Edge" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Edge" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + result = (Hex::Edge *)new Hex::Edge(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Edge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Edge *arg1 = (Hex::Edge *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Edge",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Edge, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Edge" "', argument " "1"" of type '" "Hex::Edge *""'"); + } + arg1 = reinterpret_cast< Hex::Edge * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Edge_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Edge, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_Quad_getEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Quad *arg1 = (Hex::Quad *) 0 ; + int arg2 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Quad_getEdge",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Quad_getEdge" "', argument " "1"" of type '" "Hex::Quad *""'"); + } + arg1 = reinterpret_cast< Hex::Quad * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Quad_getEdge" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Edge *)(arg1)->getEdge(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Quad_getVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Quad *arg1 = (Hex::Quad *) 0 ; + int arg2 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Quad_getVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Quad_getVertex" "', argument " "1"" of type '" "Hex::Quad *""'"); + } + arg1 = reinterpret_cast< Hex::Quad * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Quad_getVertex" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Vertex *)(arg1)->getVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Quad_addAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Quad *arg1 = (Hex::Quad *) 0 ; + Hex::NewShape *arg2 = (Hex::NewShape *) 0 ; + int arg3 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Quad_addAssociation",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Quad_addAssociation" "', argument " "1"" of type '" "Hex::Quad *""'"); + } + arg1 = reinterpret_cast< Hex::Quad * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__NewShape, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Quad_addAssociation" "', argument " "2"" of type '" "Hex::NewShape *""'"); + } + arg2 = reinterpret_cast< Hex::NewShape * >(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Quad_addAssociation" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (int)(arg1)->addAssociation(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Quad_clearAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Quad *arg1 = (Hex::Quad *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Quad_clearAssociation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Quad_clearAssociation" "', argument " "1"" of type '" "Hex::Quad *""'"); + } + arg1 = reinterpret_cast< Hex::Quad * >(argp1); + (arg1)->clearAssociation(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Quad_setColor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Quad *arg1 = (Hex::Quad *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Quad_setColor",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Quad_setColor" "', argument " "1"" of type '" "Hex::Quad *""'"); + } + arg1 = reinterpret_cast< Hex::Quad * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Quad_setColor" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setColor(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Quad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vertex *arg1 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:new_Quad",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Quad" "', argument " "1"" of type '" "Hex::Vertex *""'"); + } + arg1 = reinterpret_cast< Hex::Vertex * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Quad" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_Quad" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_Quad" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + result = (Hex::Quad *)new Hex::Quad(arg1,arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Quad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Quad *arg1 = (Hex::Quad *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Quad",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Quad, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Quad" "', argument " "1"" of type '" "Hex::Quad *""'"); + } + arg1 = reinterpret_cast< Hex::Quad * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Quad_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Quad, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_Hexa_getQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hexa *arg1 = (Hex::Hexa *) 0 ; + int arg2 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hexa_getQuad",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hexa_getQuad" "', argument " "1"" of type '" "Hex::Hexa *""'"); + } + arg1 = reinterpret_cast< Hex::Hexa * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Hexa_getQuad" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Quad *)(arg1)->getQuad(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hexa_getEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hexa *arg1 = (Hex::Hexa *) 0 ; + int arg2 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hexa_getEdge",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hexa_getEdge" "', argument " "1"" of type '" "Hex::Hexa *""'"); + } + arg1 = reinterpret_cast< Hex::Hexa * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Hexa_getEdge" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Edge *)(arg1)->getEdge(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hexa_getVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hexa *arg1 = (Hex::Hexa *) 0 ; + int arg2 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hexa_getVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hexa_getVertex" "', argument " "1"" of type '" "Hex::Hexa *""'"); + } + arg1 = reinterpret_cast< Hex::Hexa * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Hexa_getVertex" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Vertex *)(arg1)->getVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hexa_setColor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hexa *arg1 = (Hex::Hexa *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hexa_setColor",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hexa_setColor" "', argument " "1"" of type '" "Hex::Hexa *""'"); + } + arg1 = reinterpret_cast< Hex::Hexa * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Hexa_setColor" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setColor(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Hexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Quad *arg1 = (Hex::Quad *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Quad *arg4 = (Hex::Quad *) 0 ; + Hex::Quad *arg5 = (Hex::Quad *) 0 ; + Hex::Quad *arg6 = (Hex::Quad *) 0 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:new_Hexa",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Hexa" "', argument " "1"" of type '" "Hex::Quad *""'"); + } + arg1 = reinterpret_cast< Hex::Quad * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Hexa" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "new_Hexa" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "new_Hexa" "', argument " "4"" of type '" "Hex::Quad *""'"); + } + arg4 = reinterpret_cast< Hex::Quad * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "new_Hexa" "', argument " "5"" of type '" "Hex::Quad *""'"); + } + arg5 = reinterpret_cast< Hex::Quad * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "new_Hexa" "', argument " "6"" of type '" "Hex::Quad *""'"); + } + arg6 = reinterpret_cast< Hex::Quad * >(argp6); + result = (Hex::Hexa *)new Hex::Hexa(arg1,arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Hexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hexa *arg1 = (Hex::Hexa *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Hexa",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hexa, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Hexa" "', argument " "1"" of type '" "Hex::Hexa *""'"); + } + arg1 = reinterpret_cast< Hex::Hexa * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Hexa_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Hexa, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_Vector_getDx(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vector *arg1 = (Hex::Vector *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vector_getDx",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vector_getDx" "', argument " "1"" of type '" "Hex::Vector *""'"); + } + arg1 = reinterpret_cast< Hex::Vector * >(argp1); + result = (double)(arg1)->getDx(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vector_getDy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vector *arg1 = (Hex::Vector *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vector_getDy",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vector_getDy" "', argument " "1"" of type '" "Hex::Vector *""'"); + } + arg1 = reinterpret_cast< Hex::Vector * >(argp1); + result = (double)(arg1)->getDy(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vector_getDz(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vector *arg1 = (Hex::Vector *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vector_getDz",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vector_getDz" "', argument " "1"" of type '" "Hex::Vector *""'"); + } + arg1 = reinterpret_cast< Hex::Vector * >(argp1); + result = (double)(arg1)->getDz(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vector_getNorm(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vector *arg1 = (Hex::Vector *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vector_getNorm",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vector_getNorm" "', argument " "1"" of type '" "Hex::Vector *""'"); + } + arg1 = reinterpret_cast< Hex::Vector * >(argp1); + result = (double)(arg1)->getNorm(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Vector_getAngleX(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vector *arg1 = (Hex::Vector *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Vector_getAngleX",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Vector_getAngleX" "', argument " "1"" of type '" "Hex::Vector *""'"); + } + arg1 = reinterpret_cast< Hex::Vector * >(argp1); + result = (double)(arg1)->getAngleX(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Vector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + double arg3 ; + double arg4 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + double val3 ; + int ecode3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:new_Vector",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Vector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Vector" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Vector" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "new_Vector" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + result = (Hex::Vector *)new Hex::Vector(arg1,arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Vector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + double arg3 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:new_Vector",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Vector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Vector" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_Vector" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + result = (Hex::Vector *)new Hex::Vector(arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Vector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_Vector",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Vector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_Vector" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + result = (Hex::Vector *)new Hex::Vector(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Vector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_Vector",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Vector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (Hex::Vector *)new Hex::Vector(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Vector(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_Vector__SWIG_3(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_Vector__SWIG_2(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_Vector__SWIG_1(self, args); + } + } + } + } + if (argc == 4) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_new_Vector__SWIG_0(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Vector'.\n Possible C/C++ prototypes are:\n Hex::Vector(Hex::Document *,double,double,double)\n Hex::Vector(Hex::Document *,double,double)\n Hex::Vector(Hex::Document *,double)\n Hex::Vector(Hex::Document *)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Vector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Vector *arg1 = (Hex::Vector *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Vector",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Vector, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Vector" "', argument " "1"" of type '" "Hex::Vector *""'"); + } + arg1 = reinterpret_cast< Hex::Vector * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Vector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Vector, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_new_Document__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + Hex::Hex *arg2 = (Hex::Hex *) 0 ; + Hex::Document *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_Document",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Document" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_Document" "', argument " "2"" of type '" "Hex::Hex *""'"); + } + arg2 = reinterpret_cast< Hex::Hex * >(argp2); + result = (Hex::Document *)new Hex::Document(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, SWIG_POINTER_NEW | 0 ); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Document__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + cpchar arg1 = (cpchar) 0 ; + Hex::Document *result = 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_Document",&obj0)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Document" "', argument " "1"" of type '" "cpchar""'"); + } + arg1 = reinterpret_cast< cpchar >(buf1); + result = (Hex::Document *)new Hex::Document(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, SWIG_POINTER_NEW | 0 ); + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return resultobj; +fail: + if (alloc1 == SWIG_NEWOBJ) delete[] buf1; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Document(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_Document__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Hex, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_new_Document__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'new_Document'.\n Possible C/C++ prototypes are:\n Hex::Document(cpchar,Hex::Hex *)\n Hex::Document(cpchar)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_dump(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_dump",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_dump" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + (arg1)->dump(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_setName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + char *arg2 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_setName",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_setName" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_setName" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (int)(arg1)->setName((char const *)arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_setLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_setLevel",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_setLevel" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_setLevel" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + (arg1)->setLevel(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_save(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + char *arg2 = (char *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_save",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_save" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_save" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + result = (int)(arg1)->save((char const *)arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_saveVtk(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_saveVtk",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_saveVtk" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_saveVtk" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (int)(arg1)->saveVtk(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_purge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_purge",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_purge" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + (arg1)->purge(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_setTolerance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_setTolerance",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_setTolerance" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_setTolerance" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + (arg1)->setTolerance(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getTolerance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_getTolerance",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getTolerance" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (double)(arg1)->getTolerance(); + resultobj = SWIG_From_double(static_cast< double >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVertex__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + double arg3 ; + double arg4 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + double val3 ; + int ecode3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_addVertex",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addVertex" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_addVertex" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_addVertex" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + result = (Hex::Vertex *)(arg1)->addVertex(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVertex__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + double arg3 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addVertex",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addVertex" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_addVertex" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + result = (Hex::Vertex *)(arg1)->addVertex(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVertex__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addVertex" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + result = (Hex::Vertex *)(arg1)->addVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVertex__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_addVertex",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (Hex::Vertex *)(arg1)->addVertex(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVertex(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Document_addVertex__SWIG_3(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addVertex__SWIG_2(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addVertex__SWIG_1(self, args); + } + } + } + } + if (argc == 4) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addVertex__SWIG_0(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_addVertex'.\n Possible C/C++ prototypes are:\n addVertex(double,double,double)\n addVertex(double,double)\n addVertex(double)\n addVertex()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addEdge",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addEdge" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addEdge" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addEdge" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (Hex::Edge *)(arg1)->addEdge(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addEdgeVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addEdgeVector",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addEdgeVector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addEdgeVector" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addEdgeVector" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + result = (Hex::Edge *)(arg1)->addEdgeVector(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Edge *arg2 = (Hex::Edge *) 0 ; + Hex::Edge *arg3 = (Hex::Edge *) 0 ; + Hex::Edge *arg4 = (Hex::Edge *) 0 ; + Hex::Edge *arg5 = (Hex::Edge *) 0 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_addQuad",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addQuad" "', argument " "2"" of type '" "Hex::Edge *""'"); + } + arg2 = reinterpret_cast< Hex::Edge * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addQuad" "', argument " "3"" of type '" "Hex::Edge *""'"); + } + arg3 = reinterpret_cast< Hex::Edge * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_addQuad" "', argument " "4"" of type '" "Hex::Edge *""'"); + } + arg4 = reinterpret_cast< Hex::Edge * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_addQuad" "', argument " "5"" of type '" "Hex::Edge *""'"); + } + arg5 = reinterpret_cast< Hex::Edge * >(argp5); + result = (Hex::Quad *)(arg1)->addQuad(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addQuadVertices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_addQuadVertices",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addQuadVertices" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addQuadVertices" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addQuadVertices" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_addQuadVertices" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_addQuadVertices" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + result = (Hex::Quad *)(arg1)->addQuadVertices(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Quad *arg4 = (Hex::Quad *) 0 ; + Hex::Quad *arg5 = (Hex::Quad *) 0 ; + Hex::Quad *arg6 = (Hex::Quad *) 0 ; + Hex::Quad *arg7 = (Hex::Quad *) 0 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_addHexa",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addHexa" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addHexa" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addHexa" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_addHexa" "', argument " "4"" of type '" "Hex::Quad *""'"); + } + arg4 = reinterpret_cast< Hex::Quad * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_addHexa" "', argument " "5"" of type '" "Hex::Quad *""'"); + } + arg5 = reinterpret_cast< Hex::Quad * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_addHexa" "', argument " "6"" of type '" "Hex::Quad *""'"); + } + arg6 = reinterpret_cast< Hex::Quad * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_addHexa" "', argument " "7"" of type '" "Hex::Quad *""'"); + } + arg7 = reinterpret_cast< Hex::Quad * >(argp7); + result = (Hex::Hexa *)(arg1)->addHexa(arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addHexaVertices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg6 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg7 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg8 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg9 = (Hex::Vertex *) 0 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + void *argp8 = 0 ; + int res8 = 0 ; + void *argp9 = 0 ; + int res9 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:Document_addHexaVertices",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addHexaVertices" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addHexaVertices" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addHexaVertices" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_addHexaVertices" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_addHexaVertices" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_addHexaVertices" "', argument " "6"" of type '" "Hex::Vertex *""'"); + } + arg6 = reinterpret_cast< Hex::Vertex * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_addHexaVertices" "', argument " "7"" of type '" "Hex::Vertex *""'"); + } + arg7 = reinterpret_cast< Hex::Vertex * >(argp7); + res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "Document_addHexaVertices" "', argument " "8"" of type '" "Hex::Vertex *""'"); + } + arg8 = reinterpret_cast< Hex::Vertex * >(argp8); + res9 = SWIG_ConvertPtr(obj8, &argp9,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res9)) { + SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "Document_addHexaVertices" "', argument " "9"" of type '" "Hex::Vertex *""'"); + } + arg9 = reinterpret_cast< Hex::Vertex * >(argp9); + result = (Hex::Hexa *)(arg1)->addHexaVertices(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addHexa2Quads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addHexa2Quads",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addHexa2Quads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addHexa2Quads" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addHexa2Quads" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + result = (Hex::Hexa *)(arg1)->addHexa2Quads(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addHexa3Quads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Quad *arg4 = (Hex::Quad *) 0 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_addHexa3Quads",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addHexa3Quads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addHexa3Quads" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addHexa3Quads" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_addHexa3Quads" "', argument " "4"" of type '" "Hex::Quad *""'"); + } + arg4 = reinterpret_cast< Hex::Quad * >(argp4); + result = (Hex::Hexa *)(arg1)->addHexa3Quads(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addHexa4Quads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Quad *arg4 = (Hex::Quad *) 0 ; + Hex::Quad *arg5 = (Hex::Quad *) 0 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_addHexa4Quads",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addHexa4Quads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addHexa4Quads" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addHexa4Quads" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_addHexa4Quads" "', argument " "4"" of type '" "Hex::Quad *""'"); + } + arg4 = reinterpret_cast< Hex::Quad * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_addHexa4Quads" "', argument " "5"" of type '" "Hex::Quad *""'"); + } + arg5 = reinterpret_cast< Hex::Quad * >(argp5); + result = (Hex::Hexa *)(arg1)->addHexa4Quads(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addHexa5Quads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Quad *arg4 = (Hex::Quad *) 0 ; + Hex::Quad *arg5 = (Hex::Quad *) 0 ; + Hex::Quad *arg6 = (Hex::Quad *) 0 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Document_addHexa5Quads",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addHexa5Quads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addHexa5Quads" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addHexa5Quads" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_addHexa5Quads" "', argument " "4"" of type '" "Hex::Quad *""'"); + } + arg4 = reinterpret_cast< Hex::Quad * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_addHexa5Quads" "', argument " "5"" of type '" "Hex::Quad *""'"); + } + arg5 = reinterpret_cast< Hex::Quad * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_addHexa5Quads" "', argument " "6"" of type '" "Hex::Quad *""'"); + } + arg6 = reinterpret_cast< Hex::Quad * >(argp6); + result = (Hex::Hexa *)(arg1)->addHexa5Quads(arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + double arg3 ; + double arg4 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + double val3 ; + int ecode3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_addVector",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addVector" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_addVector" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_addVector" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + result = (Hex::Vector *)(arg1)->addVector(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + double arg3 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + double val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addVector",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addVector" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_addVector" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + result = (Hex::Vector *)(arg1)->addVector(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addVector",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addVector" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + result = (Hex::Vector *)(arg1)->addVector(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_addVector",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (Hex::Vector *)(arg1)->addVector(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVector(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Document_addVector__SWIG_3(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addVector__SWIG_2(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addVector__SWIG_1(self, args); + } + } + } + } + if (argc == 4) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addVector__SWIG_0(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_addVector'.\n Possible C/C++ prototypes are:\n addVector(double,double,double)\n addVector(double,double)\n addVector(double)\n addVector()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVectorVertices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addVectorVertices",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVectorVertices" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addVectorVertices" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addVectorVertices" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (Hex::Vector *)(arg1)->addVectorVertices(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addLaw__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; + Hex::Law *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addLaw",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addLaw" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addLaw" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = reinterpret_cast< char * >(buf2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_addLaw" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (Hex::Law *)(arg1)->addLaw((char const *)arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Law, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addLaws__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + bool arg3 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + bool val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addLaws",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addLaws" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addLaws" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_bool(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_addLaws" "', argument " "3"" of type '" "bool""'"); + } + arg3 = static_cast< bool >(val3); + result = (int)(arg1)->addLaws(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addLaws__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addLaws",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addLaws" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addLaws" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + result = (int)(arg1)->addLaws(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addLaws(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addLaws__SWIG_1(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_bool(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addLaws__SWIG_0(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_addLaws'.\n Possible C/C++ prototypes are:\n addLaws(double,bool)\n addLaws(double)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addHexaGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addHexaGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addHexaGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addHexaGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Group *)(arg1)->addHexaGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addQuadGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addQuadGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addQuadGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addQuadGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Group *)(arg1)->addQuadGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addQuadNodeGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addQuadNodeGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addQuadNodeGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addQuadNodeGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Group *)(arg1)->addQuadNodeGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addHexaNodeGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addHexaNodeGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addHexaNodeGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addHexaNodeGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Group *)(arg1)->addHexaNodeGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addEdgeGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addEdgeGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addEdgeGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addEdgeGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Group *)(arg1)->addEdgeGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addEdgeNodeGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addEdgeNodeGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addEdgeNodeGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addEdgeNodeGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Group *)(arg1)->addEdgeNodeGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addVertexNodeGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addVertexNodeGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addVertexNodeGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addVertexNodeGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Group *)(arg1)->addVertexNodeGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeTranslation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_makeTranslation",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeTranslation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeTranslation" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeTranslation" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + result = (Hex::Elements *)(arg1)->makeTranslation(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeScale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + double arg4 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_makeScale",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeScale" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeScale" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeScale" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeScale" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + result = (Hex::Elements *)(arg1)->makeScale(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeRotation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_makeRotation",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeRotation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeRotation" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeRotation" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeRotation" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeRotation" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + result = (Hex::Elements *)(arg1)->makeRotation(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSymmetryPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_makeSymmetryPoint",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSymmetryPoint" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSymmetryPoint" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSymmetryPoint" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (Hex::Elements *)(arg1)->makeSymmetryPoint(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSymmetryLine(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_makeSymmetryLine",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSymmetryLine" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSymmetryLine" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSymmetryLine" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeSymmetryLine" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + result = (Hex::Elements *)(arg1)->makeSymmetryLine(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSymmetryPlane(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_makeSymmetryPlane",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSymmetryPlane" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSymmetryPlane" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSymmetryPlane" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeSymmetryPlane" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + result = (Hex::Elements *)(arg1)->makeSymmetryPlane(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_performTranslation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_performTranslation",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_performTranslation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_performTranslation" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_performTranslation" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + result = (int)(arg1)->performTranslation(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_performScale(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + double arg4 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_performScale",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_performScale" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_performScale" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_performScale" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_performScale" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + result = (int)(arg1)->performScale(arg2,arg3,arg4); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_performRotation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_performRotation",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_performRotation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_performRotation" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_performRotation" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_performRotation" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_performRotation" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + result = (int)(arg1)->performRotation(arg2,arg3,arg4,arg5); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_performSymmetryPoint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_performSymmetryPoint",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_performSymmetryPoint" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_performSymmetryPoint" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_performSymmetryPoint" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (int)(arg1)->performSymmetryPoint(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_performSymmetryLine(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_performSymmetryLine",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_performSymmetryLine" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_performSymmetryLine" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_performSymmetryLine" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_performSymmetryLine" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + result = (int)(arg1)->performSymmetryLine(arg2,arg3,arg4); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_performSymmetryPlane(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_performSymmetryPlane",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_performSymmetryPlane" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_performSymmetryPlane" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_performSymmetryPlane" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_performSymmetryPlane" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + result = (int)(arg1)->performSymmetryPlane(arg2,arg3,arg4); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_cut__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Edge *arg2 = (Hex::Edge *) 0 ; + int arg3 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_cut",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_cut" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_cut" "', argument " "2"" of type '" "Hex::Edge *""'"); + } + arg2 = reinterpret_cast< Hex::Edge * >(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_cut" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (Hex::Elements *)(arg1)->cut(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_disconnectQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Hexa *arg2 = (Hex::Hexa *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_disconnectQuad",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_disconnectQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_disconnectQuad" "', argument " "2"" of type '" "Hex::Hexa *""'"); + } + arg2 = reinterpret_cast< Hex::Hexa * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_disconnectQuad" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + result = (Hex::Elements *)(arg1)->disconnectQuad(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_disconnectEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Hexa *arg2 = (Hex::Hexa *) 0 ; + Hex::Edge *arg3 = (Hex::Edge *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_disconnectEdge",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_disconnectEdge" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_disconnectEdge" "', argument " "2"" of type '" "Hex::Hexa *""'"); + } + arg2 = reinterpret_cast< Hex::Hexa * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_disconnectEdge" "', argument " "3"" of type '" "Hex::Edge *""'"); + } + arg3 = reinterpret_cast< Hex::Edge * >(argp3); + result = (Hex::Elements *)(arg1)->disconnectEdge(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_disconnectVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Hexa *arg2 = (Hex::Hexa *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_disconnectVertex",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_disconnectVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_disconnectVertex" "', argument " "2"" of type '" "Hex::Hexa *""'"); + } + arg2 = reinterpret_cast< Hex::Hexa * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_disconnectVertex" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (Hex::Elements *)(arg1)->disconnectVertex(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_disconnectEdges(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Hexas arg2 ; + Hex::Edges arg3 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_disconnectEdges",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_disconnectEdges" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_disconnectEdges" "', argument " "2"" of type '" "Hex::Hexas""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj2, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_disconnectEdges" "', argument " "3"" of type '" "Hex::Edges""'"); + } + arg3 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->disconnectEdges(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_replace(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quads arg2 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg6 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg7 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg8 = (Hex::Vertex *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + void *argp8 = 0 ; + int res8 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:Document_replace",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_replace" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_replace" "', argument " "2"" of type '" "Hex::Quads""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_replace" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_replace" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_replace" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_replace" "', argument " "6"" of type '" "Hex::Vertex *""'"); + } + arg6 = reinterpret_cast< Hex::Vertex * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_replace" "', argument " "7"" of type '" "Hex::Vertex *""'"); + } + arg7 = reinterpret_cast< Hex::Vertex * >(argp7); + res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "Document_replace" "', argument " "8"" of type '" "Hex::Vertex *""'"); + } + arg8 = reinterpret_cast< Hex::Vertex * >(argp8); + result = (Hex::Elements *)(arg1)->replace(arg2,arg3,arg4,arg5,arg6,arg7,arg8); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_mergeVertices(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_mergeVertices",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_mergeVertices" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_mergeVertices" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_mergeVertices" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (int)(arg1)->mergeVertices(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_mergeEdges(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Edge *arg2 = (Hex::Edge *) 0 ; + Hex::Edge *arg3 = (Hex::Edge *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_mergeEdges",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_mergeEdges" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_mergeEdges" "', argument " "2"" of type '" "Hex::Edge *""'"); + } + arg2 = reinterpret_cast< Hex::Edge * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_mergeEdges" "', argument " "3"" of type '" "Hex::Edge *""'"); + } + arg3 = reinterpret_cast< Hex::Edge * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_mergeEdges" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_mergeEdges" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + result = (int)(arg1)->mergeEdges(arg2,arg3,arg4,arg5); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_mergeQuads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg6 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg7 = (Hex::Vertex *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_mergeQuads",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_mergeQuads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_mergeQuads" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_mergeQuads" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_mergeQuads" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_mergeQuads" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_mergeQuads" "', argument " "6"" of type '" "Hex::Vertex *""'"); + } + arg6 = reinterpret_cast< Hex::Vertex * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_mergeQuads" "', argument " "7"" of type '" "Hex::Vertex *""'"); + } + arg7 = reinterpret_cast< Hex::Vertex * >(argp7); + result = (int)(arg1)->mergeQuads(arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_clearAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_clearAssociation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_clearAssociation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + (arg1)->clearAssociation(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_associateOpenedLine(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Edges *arg2 = 0 ; + Hex::NewShapes *arg3 = 0 ; + Hex::IntVector *arg4 = 0 ; + double arg5 ; + double arg6 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + double val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Document_associateOpenedLine",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_associateOpenedLine" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_associateOpenedLine" "', argument " "2"" of type '" "Hex::Edges &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_associateOpenedLine" "', argument " "2"" of type '" "Hex::Edges &""'"); + } + arg2 = reinterpret_cast< Hex::Edges * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_associateOpenedLine" "', argument " "3"" of type '" "Hex::NewShapes &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_associateOpenedLine" "', argument " "3"" of type '" "Hex::NewShapes &""'"); + } + arg3 = reinterpret_cast< Hex::NewShapes * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_associateOpenedLine" "', argument " "4"" of type '" "Hex::IntVector &""'"); + } + if (!argp4) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_associateOpenedLine" "', argument " "4"" of type '" "Hex::IntVector &""'"); + } + arg4 = reinterpret_cast< Hex::IntVector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_associateOpenedLine" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_double(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_associateOpenedLine" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + result = (int)(arg1)->associateOpenedLine(*arg2,*arg3,*arg4,arg5,arg6); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_associateClosedLine(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Edges *arg3 = 0 ; + Hex::NewShapes *arg4 = 0 ; + Hex::IntVector *arg5 = 0 ; + double arg6 ; + bool arg7 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + double val6 ; + int ecode6 = 0 ; + bool val7 ; + int ecode7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_associateClosedLine",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_associateClosedLine" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_associateClosedLine" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_associateClosedLine" "', argument " "3"" of type '" "Hex::Edges &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_associateClosedLine" "', argument " "3"" of type '" "Hex::Edges &""'"); + } + arg3 = reinterpret_cast< Hex::Edges * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t, 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_associateClosedLine" "', argument " "4"" of type '" "Hex::NewShapes &""'"); + } + if (!argp4) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_associateClosedLine" "', argument " "4"" of type '" "Hex::NewShapes &""'"); + } + arg4 = reinterpret_cast< Hex::NewShapes * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5, SWIGTYPE_p_std__vectorTint_std__allocatorTint_t_t, 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_associateClosedLine" "', argument " "5"" of type '" "Hex::IntVector &""'"); + } + if (!argp5) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_associateClosedLine" "', argument " "5"" of type '" "Hex::IntVector &""'"); + } + arg5 = reinterpret_cast< Hex::IntVector * >(argp5); + ecode6 = SWIG_AsVal_double(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_associateClosedLine" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + ecode7 = SWIG_AsVal_bool(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_associateClosedLine" "', argument " "7"" of type '" "bool""'"); + } + arg7 = static_cast< bool >(val7); + result = (int)(arg1)->associateClosedLine(arg2,*arg3,*arg4,*arg5,arg6,arg7); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countHexa",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countHexa" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countHexa(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countQuad",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countQuad(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countEdge",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countEdge" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countEdge(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countVertex",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countVertex(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countVector",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countVector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countVector(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countGroup",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countGroup(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countLaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countLaw",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countLaw" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countLaw(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countPropagation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countPropagation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countPropagation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countPropagation(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countShape(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countShape",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countShape" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countShape(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countUsedHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countUsedHexa",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countUsedHexa" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countUsedHexa(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countUsedQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countUsedQuad",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countUsedQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countUsedQuad(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countUsedEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countUsedEdge",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countUsedEdge" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countUsedEdge(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countUsedVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countUsedVertex",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countUsedVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countUsedVertex(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countCylinder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countCylinder",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countCylinder" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countCylinder(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_countPipe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_countPipe",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_countPipe" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->countPipe(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getHexa",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getHexa" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getHexa" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Hexa *)(arg1)->getHexa(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getQuad",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getQuad" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Quad *)(arg1)->getQuad(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getEdge",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getEdge" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getEdge" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Edge *)(arg1)->getEdge(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getVertex" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Vertex *)(arg1)->getVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getUsedHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getUsedHexa",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getUsedHexa" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getUsedHexa" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Hexa *)(arg1)->getUsedHexa(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getUsedQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getUsedQuad",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getUsedQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getUsedQuad" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Quad *)(arg1)->getUsedQuad(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getUsedEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getUsedEdge",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getUsedEdge" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getUsedEdge" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Edge *)(arg1)->getUsedEdge(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getUsedVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getUsedVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getUsedVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getUsedVertex" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Vertex *)(arg1)->getUsedVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Vector *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getVector",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getVector" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getVector" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Vector *)(arg1)->getVector(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vector, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getCylinder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Cylinder *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getCylinder",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getCylinder" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getCylinder" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Cylinder *)(arg1)->getCylinder(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Cylinder, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getPipe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Pipe *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getPipe",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getPipe" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getPipe" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Pipe *)(arg1)->getPipe(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Pipe, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getShape(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::NewShape *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getShape",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getShape" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getShape" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::NewShape *)(arg1)->getShape(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__NewShape, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getGroup" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Group *)(arg1)->getGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getLaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Law *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getLaw",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getLaw" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getLaw" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Law *)(arg1)->getLaw(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Law, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getPropagation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Propagation *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_getPropagation",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getPropagation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_getPropagation" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Propagation *)(arg1)->getPropagation(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findVertex__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + double arg2 ; + double arg3 ; + double arg4 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + double val2 ; + int ecode2 = 0 ; + double val3 ; + int ecode3 = 0 ; + double val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_findVertex",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_findVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_double(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_findVertex" "', argument " "2"" of type '" "double""'"); + } + arg2 = static_cast< double >(val2); + ecode3 = SWIG_AsVal_double(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_findVertex" "', argument " "3"" of type '" "double""'"); + } + arg3 = static_cast< double >(val3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_findVertex" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + result = (Hex::Vertex *)(arg1)->findVertex(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_findEdge",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_findEdge" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_findEdge" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_findEdge" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (Hex::Edge *)(arg1)->findEdge(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_findQuad",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_findQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_findQuad" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_findQuad" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (Hex::Quad *)(arg1)->findQuad(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_findHexa",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_findHexa" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_findHexa" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_findHexa" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + result = (Hex::Hexa *)(arg1)->findHexa(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_findGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_findGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_findGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Group *)(arg1)->findGroup(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findLaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Law *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_findLaw",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_findLaw" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_findLaw" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Law *)(arg1)->findLaw(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Law, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findPropagation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Edge *arg2 = (Hex::Edge *) 0 ; + Hex::Propagation *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_findPropagation",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_findPropagation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_findPropagation" "', argument " "2"" of type '" "Hex::Edge *""'"); + } + arg2 = reinterpret_cast< Hex::Edge * >(argp2); + result = (Hex::Propagation *)(arg1)->findPropagation(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_removeHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Hexa *arg2 = (Hex::Hexa *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_removeHexa",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_removeHexa" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_removeHexa" "', argument " "2"" of type '" "Hex::Hexa *""'"); + } + arg2 = reinterpret_cast< Hex::Hexa * >(argp2); + result = (int)(arg1)->removeHexa(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_removeQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_removeQuad",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_removeQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_removeQuad" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + result = (int)(arg1)->removeQuad(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_removeConnectedHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Hexa *arg2 = (Hex::Hexa *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_removeConnectedHexa",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_removeConnectedHexa" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_removeConnectedHexa" "', argument " "2"" of type '" "Hex::Hexa *""'"); + } + arg2 = reinterpret_cast< Hex::Hexa * >(argp2); + result = (int)(arg1)->removeConnectedHexa(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_removeElements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *arg2 = (Hex::Elements *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_removeElements",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_removeElements" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_removeElements" "', argument " "2"" of type '" "Hex::Elements *""'"); + } + arg2 = reinterpret_cast< Hex::Elements * >(argp2); + result = (int)(arg1)->removeElements(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_removeGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Group *arg2 = (Hex::Group *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_removeGroup",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_removeGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_removeGroup" "', argument " "2"" of type '" "Hex::Group *""'"); + } + arg2 = reinterpret_cast< Hex::Group * >(argp2); + result = (int)(arg1)->removeGroup(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_removeLaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Law *arg2 = (Hex::Law *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_removeLaw",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_removeLaw" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Law, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_removeLaw" "', argument " "2"" of type '" "Hex::Law *""'"); + } + arg2 = reinterpret_cast< Hex::Law * >(argp2); + result = (int)(arg1)->removeLaw(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCartesianTop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_makeCartesianTop",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCartesianTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_makeCartesianTop" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_makeCartesianTop" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeCartesianTop" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Elements *)(arg1)->makeCartesianTop(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCartesianUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::Vector *arg5 = (Hex::Vector *) 0 ; + double arg6 ; + double arg7 ; + double arg8 ; + int arg9 ; + int arg10 ; + int arg11 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + double val6 ; + int ecode6 = 0 ; + double val7 ; + int ecode7 = 0 ; + double val8 ; + int ecode8 = 0 ; + int val9 ; + int ecode9 = 0 ; + int val10 ; + int ecode10 = 0 ; + int val11 ; + int ecode11 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + PyObject * obj10 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:Document_makeCartesianUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCartesianUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCartesianUni" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCartesianUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeCartesianUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_makeCartesianUni" "', argument " "5"" of type '" "Hex::Vector *""'"); + } + arg5 = reinterpret_cast< Hex::Vector * >(argp5); + ecode6 = SWIG_AsVal_double(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeCartesianUni" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + ecode7 = SWIG_AsVal_double(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makeCartesianUni" "', argument " "7"" of type '" "double""'"); + } + arg7 = static_cast< double >(val7); + ecode8 = SWIG_AsVal_double(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_makeCartesianUni" "', argument " "8"" of type '" "double""'"); + } + arg8 = static_cast< double >(val8); + ecode9 = SWIG_AsVal_int(obj8, &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Document_makeCartesianUni" "', argument " "9"" of type '" "int""'"); + } + arg9 = static_cast< int >(val9); + ecode10 = SWIG_AsVal_int(obj9, &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Document_makeCartesianUni" "', argument " "10"" of type '" "int""'"); + } + arg10 = static_cast< int >(val10); + ecode11 = SWIG_AsVal_int(obj10, &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "Document_makeCartesianUni" "', argument " "11"" of type '" "int""'"); + } + arg11 = static_cast< int >(val11); + result = (Hex::Elements *)(arg1)->makeCartesianUni(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCartesian__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::Vector *arg5 = (Hex::Vector *) 0 ; + Hex::RealVector arg6 ; + Hex::RealVector arg7 ; + Hex::RealVector arg8 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:Document_makeCartesian",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCartesian" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCartesian" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCartesian" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeCartesian" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_makeCartesian" "', argument " "5"" of type '" "Hex::Vector *""'"); + } + arg5 = reinterpret_cast< Hex::Vector * >(argp5); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj5, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeCartesian" "', argument " "6"" of type '" "Hex::RealVector""'"); + } + arg6 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj6, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeCartesian" "', argument " "7"" of type '" "Hex::RealVector""'"); + } + arg7 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj7, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeCartesian" "', argument " "8"" of type '" "Hex::RealVector""'"); + } + arg8 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->makeCartesian(arg2,arg3,arg4,arg5,arg6,arg7,arg8); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCylinderTop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_makeCylinderTop",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCylinderTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_makeCylinderTop" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_makeCylinderTop" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeCylinderTop" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Elements *)(arg1)->makeCylinderTop(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCylinderUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + double arg6 ; + double arg7 ; + double arg8 ; + int arg9 ; + int arg10 ; + int arg11 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + double val6 ; + int ecode6 = 0 ; + double val7 ; + int ecode7 = 0 ; + double val8 ; + int ecode8 = 0 ; + int val9 ; + int ecode9 = 0 ; + int val10 ; + int ecode10 = 0 ; + int val11 ; + int ecode11 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + PyObject * obj10 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:Document_makeCylinderUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCylinderUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCylinderUni" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCylinderUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeCylinderUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeCylinderUni" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_double(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeCylinderUni" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + ecode7 = SWIG_AsVal_double(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makeCylinderUni" "', argument " "7"" of type '" "double""'"); + } + arg7 = static_cast< double >(val7); + ecode8 = SWIG_AsVal_double(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_makeCylinderUni" "', argument " "8"" of type '" "double""'"); + } + arg8 = static_cast< double >(val8); + ecode9 = SWIG_AsVal_int(obj8, &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Document_makeCylinderUni" "', argument " "9"" of type '" "int""'"); + } + arg9 = static_cast< int >(val9); + ecode10 = SWIG_AsVal_int(obj9, &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Document_makeCylinderUni" "', argument " "10"" of type '" "int""'"); + } + arg10 = static_cast< int >(val10); + ecode11 = SWIG_AsVal_int(obj10, &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "Document_makeCylinderUni" "', argument " "11"" of type '" "int""'"); + } + arg11 = static_cast< int >(val11); + result = (Hex::Elements *)(arg1)->makeCylinderUni(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCylinder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::RealVector arg5 ; + Hex::RealVector arg6 ; + Hex::RealVector arg7 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_makeCylinder",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCylinder" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCylinder" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCylinder" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeCylinder" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj4, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeCylinder" "', argument " "5"" of type '" "Hex::RealVector""'"); + } + arg5 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj5, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeCylinder" "', argument " "6"" of type '" "Hex::RealVector""'"); + } + arg6 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj6, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeCylinder" "', argument " "7"" of type '" "Hex::RealVector""'"); + } + arg7 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->makeCylinder(arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makePipeTop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_makePipeTop",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makePipeTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_makePipeTop" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_makePipeTop" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makePipeTop" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Elements *)(arg1)->makePipeTop(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makePipeUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + double arg6 ; + double arg7 ; + double arg8 ; + int arg9 ; + int arg10 ; + int arg11 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + double val6 ; + int ecode6 = 0 ; + double val7 ; + int ecode7 = 0 ; + double val8 ; + int ecode8 = 0 ; + int val9 ; + int ecode9 = 0 ; + int val10 ; + int ecode10 = 0 ; + int val11 ; + int ecode11 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + PyObject * obj10 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:Document_makePipeUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makePipeUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makePipeUni" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makePipeUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makePipeUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makePipeUni" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_double(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makePipeUni" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + ecode7 = SWIG_AsVal_double(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makePipeUni" "', argument " "7"" of type '" "double""'"); + } + arg7 = static_cast< double >(val7); + ecode8 = SWIG_AsVal_double(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_makePipeUni" "', argument " "8"" of type '" "double""'"); + } + arg8 = static_cast< double >(val8); + ecode9 = SWIG_AsVal_int(obj8, &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Document_makePipeUni" "', argument " "9"" of type '" "int""'"); + } + arg9 = static_cast< int >(val9); + ecode10 = SWIG_AsVal_int(obj9, &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Document_makePipeUni" "', argument " "10"" of type '" "int""'"); + } + arg10 = static_cast< int >(val10); + ecode11 = SWIG_AsVal_int(obj10, &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "Document_makePipeUni" "', argument " "11"" of type '" "int""'"); + } + arg11 = static_cast< int >(val11); + result = (Hex::Elements *)(arg1)->makePipeUni(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makePipe(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::RealVector arg5 ; + Hex::RealVector arg6 ; + Hex::RealVector arg7 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_makePipe",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makePipe" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makePipe" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makePipe" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makePipe" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj4, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makePipe" "', argument " "5"" of type '" "Hex::RealVector""'"); + } + arg5 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj5, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makePipe" "', argument " "6"" of type '" "Hex::RealVector""'"); + } + arg6 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj6, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makePipe" "', argument " "7"" of type '" "Hex::RealVector""'"); + } + arg7 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->makePipe(arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphericalTop__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + int arg3 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_makeSphericalTop",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSphericalTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_makeSphericalTop" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_makeSphericalTop" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (Hex::Elements *)(arg1)->makeSphericalTop(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphericalTop__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_makeSphericalTop",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSphericalTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_makeSphericalTop" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Elements *)(arg1)->makeSphericalTop(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphericalTop(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeSphericalTop__SWIG_1(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeSphericalTop__SWIG_0(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_makeSphericalTop'.\n Possible C/C++ prototypes are:\n makeSphericalTop(int,int)\n makeSphericalTop(int)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphericalUni__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + int arg6 ; + int arg7 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + int val6 ; + int ecode6 = 0 ; + int val7 ; + int ecode7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_makeSphericalUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSphericalUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSphericalUni" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSphericalUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeSphericalUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeSphericalUni" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeSphericalUni" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + ecode7 = SWIG_AsVal_int(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makeSphericalUni" "', argument " "7"" of type '" "int""'"); + } + arg7 = static_cast< int >(val7); + result = (Hex::Elements *)(arg1)->makeSphericalUni(arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphericalUni__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + int arg6 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Document_makeSphericalUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSphericalUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSphericalUni" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSphericalUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeSphericalUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeSphericalUni" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeSphericalUni" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + result = (Hex::Elements *)(arg1)->makeSphericalUni(arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphericalUni(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[8]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 7); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 6) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeSphericalUni__SWIG_1(self, args); + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeSphericalUni__SWIG_0(self, args); + } + } + } + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_makeSphericalUni'.\n Possible C/C++ prototypes are:\n makeSphericalUni(Hex::Vertex *,Hex::Vector *,Hex::Vector *,double,int,int)\n makeSphericalUni(Hex::Vertex *,Hex::Vector *,Hex::Vector *,double,int)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSpherical__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::RealVector arg5 ; + int arg6 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Document_makeSpherical",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSpherical" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSpherical" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSpherical" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeSpherical" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj4, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeSpherical" "', argument " "5"" of type '" "Hex::RealVector""'"); + } + arg5 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeSpherical" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + result = (Hex::Elements *)(arg1)->makeSpherical(arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSpherical__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::RealVector arg5 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_makeSpherical",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSpherical" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSpherical" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSpherical" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeSpherical" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj4, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeSpherical" "', argument " "5"" of type '" "Hex::RealVector""'"); + } + arg5 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->makeSpherical(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSpherical(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[7]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 6); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 5) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = swig::asptr(argv[4], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Document_makeSpherical__SWIG_1(self, args); + } + } + } + } + } + } + if (argc == 6) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = swig::asptr(argv[4], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeSpherical__SWIG_0(self, args); + } + } + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_makeSpherical'.\n Possible C/C++ prototypes are:\n makeSpherical(Hex::Vertex *,Hex::Vector *,Hex::Vector *,Hex::RealVector,int)\n makeSpherical(Hex::Vertex *,Hex::Vector *,Hex::Vector *,Hex::RealVector)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphereTop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_makeSphereTop",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSphereTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_makeSphereTop" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_makeSphereTop" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeSphereTop" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Elements *)(arg1)->makeSphereTop(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphereUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + double arg6 ; + double arg7 ; + Hex::Vertex *arg8 = (Hex::Vertex *) 0 ; + int arg9 ; + int arg10 ; + int arg11 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + double val6 ; + int ecode6 = 0 ; + double val7 ; + int ecode7 = 0 ; + void *argp8 = 0 ; + int res8 = 0 ; + int val9 ; + int ecode9 = 0 ; + int val10 ; + int ecode10 = 0 ; + int val11 ; + int ecode11 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + PyObject * obj10 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:Document_makeSphereUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSphereUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSphereUni" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSphereUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeSphereUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeSphereUni" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_double(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeSphereUni" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + ecode7 = SWIG_AsVal_double(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makeSphereUni" "', argument " "7"" of type '" "double""'"); + } + arg7 = static_cast< double >(val7); + res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "Document_makeSphereUni" "', argument " "8"" of type '" "Hex::Vertex *""'"); + } + arg8 = reinterpret_cast< Hex::Vertex * >(argp8); + ecode9 = SWIG_AsVal_int(obj8, &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Document_makeSphereUni" "', argument " "9"" of type '" "int""'"); + } + arg9 = static_cast< int >(val9); + ecode10 = SWIG_AsVal_int(obj9, &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Document_makeSphereUni" "', argument " "10"" of type '" "int""'"); + } + arg10 = static_cast< int >(val10); + ecode11 = SWIG_AsVal_int(obj10, &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "Document_makeSphereUni" "', argument " "11"" of type '" "int""'"); + } + arg11 = static_cast< int >(val11); + result = (Hex::Elements *)(arg1)->makeSphereUni(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeSphere(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::RealVector arg5 ; + Hex::RealVector arg6 ; + Hex::RealVector arg7 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_makeSphere",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeSphere" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeSphere" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeSphere" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeSphere" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj4, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeSphere" "', argument " "5"" of type '" "Hex::RealVector""'"); + } + arg5 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj5, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeSphere" "', argument " "6"" of type '" "Hex::RealVector""'"); + } + arg6 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj6, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeSphere" "', argument " "7"" of type '" "Hex::RealVector""'"); + } + arg7 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->makeSphere(arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeRindTop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_makeRindTop",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeRindTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_makeRindTop" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_makeRindTop" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeRindTop" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Elements *)(arg1)->makeRindTop(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeRindUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + double arg6 ; + double arg7 ; + double arg8 ; + Hex::Vertex *arg9 = (Hex::Vertex *) 0 ; + int arg10 ; + int arg11 ; + int arg12 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + double val6 ; + int ecode6 = 0 ; + double val7 ; + int ecode7 = 0 ; + double val8 ; + int ecode8 = 0 ; + void *argp9 = 0 ; + int res9 = 0 ; + int val10 ; + int ecode10 = 0 ; + int val11 ; + int ecode11 = 0 ; + int val12 ; + int ecode12 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + PyObject * obj10 = 0 ; + PyObject * obj11 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOOO:Document_makeRindUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10,&obj11)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeRindUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeRindUni" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeRindUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeRindUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeRindUni" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_double(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeRindUni" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + ecode7 = SWIG_AsVal_double(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makeRindUni" "', argument " "7"" of type '" "double""'"); + } + arg7 = static_cast< double >(val7); + ecode8 = SWIG_AsVal_double(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_makeRindUni" "', argument " "8"" of type '" "double""'"); + } + arg8 = static_cast< double >(val8); + res9 = SWIG_ConvertPtr(obj8, &argp9,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res9)) { + SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "Document_makeRindUni" "', argument " "9"" of type '" "Hex::Vertex *""'"); + } + arg9 = reinterpret_cast< Hex::Vertex * >(argp9); + ecode10 = SWIG_AsVal_int(obj9, &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Document_makeRindUni" "', argument " "10"" of type '" "int""'"); + } + arg10 = static_cast< int >(val10); + ecode11 = SWIG_AsVal_int(obj10, &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "Document_makeRindUni" "', argument " "11"" of type '" "int""'"); + } + arg11 = static_cast< int >(val11); + ecode12 = SWIG_AsVal_int(obj11, &val12); + if (!SWIG_IsOK(ecode12)) { + SWIG_exception_fail(SWIG_ArgError(ecode12), "in method '" "Document_makeRindUni" "', argument " "12"" of type '" "int""'"); + } + arg12 = static_cast< int >(val12); + result = (Hex::Elements *)(arg1)->makeRindUni(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11,arg12); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeRind(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::RealVector arg5 ; + Hex::RealVector arg6 ; + Hex::RealVector arg7 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_makeRind",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeRind" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeRind" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeRind" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_makeRind" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj4, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeRind" "', argument " "5"" of type '" "Hex::RealVector""'"); + } + arg5 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj5, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeRind" "', argument " "6"" of type '" "Hex::RealVector""'"); + } + arg6 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj6, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_makeRind" "', argument " "7"" of type '" "Hex::RealVector""'"); + } + arg7 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->makeRind(arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCylinders(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + double arg4 ; + double arg5 ; + Hex::Vertex *arg6 = (Hex::Vertex *) 0 ; + Hex::Vector *arg7 = (Hex::Vector *) 0 ; + double arg8 ; + double arg9 ; + Hex::BiCylinder *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + double val5 ; + int ecode5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + double val8 ; + int ecode8 = 0 ; + double val9 ; + int ecode9 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:Document_makeCylinders",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCylinders" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCylinders" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCylinders" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeCylinders" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeCylinders" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_makeCylinders" "', argument " "6"" of type '" "Hex::Vertex *""'"); + } + arg6 = reinterpret_cast< Hex::Vertex * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_makeCylinders" "', argument " "7"" of type '" "Hex::Vector *""'"); + } + arg7 = reinterpret_cast< Hex::Vector * >(argp7); + ecode8 = SWIG_AsVal_double(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_makeCylinders" "', argument " "8"" of type '" "double""'"); + } + arg8 = static_cast< double >(val8); + ecode9 = SWIG_AsVal_double(obj8, &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Document_makeCylinders" "', argument " "9"" of type '" "double""'"); + } + arg9 = static_cast< double >(val9); + result = (Hex::BiCylinder *)(arg1)->makeCylinders(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makePipes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + double arg4 ; + double arg5 ; + double arg6 ; + Hex::Vertex *arg7 = (Hex::Vertex *) 0 ; + Hex::Vector *arg8 = (Hex::Vector *) 0 ; + double arg9 ; + double arg10 ; + double arg11 ; + Hex::BiCylinder *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + double val5 ; + int ecode5 = 0 ; + double val6 ; + int ecode6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + void *argp8 = 0 ; + int res8 = 0 ; + double val9 ; + int ecode9 = 0 ; + double val10 ; + int ecode10 = 0 ; + double val11 ; + int ecode11 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + PyObject * obj9 = 0 ; + PyObject * obj10 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOOO:Document_makePipes",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9,&obj10)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makePipes" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makePipes" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makePipes" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makePipes" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makePipes" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_double(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makePipes" "', argument " "6"" of type '" "double""'"); + } + arg6 = static_cast< double >(val6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_makePipes" "', argument " "7"" of type '" "Hex::Vertex *""'"); + } + arg7 = reinterpret_cast< Hex::Vertex * >(argp7); + res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "Document_makePipes" "', argument " "8"" of type '" "Hex::Vector *""'"); + } + arg8 = reinterpret_cast< Hex::Vector * >(argp8); + ecode9 = SWIG_AsVal_double(obj8, &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Document_makePipes" "', argument " "9"" of type '" "double""'"); + } + arg9 = static_cast< double >(val9); + ecode10 = SWIG_AsVal_double(obj9, &val10); + if (!SWIG_IsOK(ecode10)) { + SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "Document_makePipes" "', argument " "10"" of type '" "double""'"); + } + arg10 = static_cast< double >(val10); + ecode11 = SWIG_AsVal_double(obj10, &val11); + if (!SWIG_IsOK(ecode11)) { + SWIG_exception_fail(SWIG_ArgError(ecode11), "in method '" "Document_makePipes" "', argument " "11"" of type '" "double""'"); + } + arg11 = static_cast< double >(val11); + result = (Hex::BiCylinder *)(arg1)->makePipes(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_extrudeQuadTop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + int arg3 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_extrudeQuadTop",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_extrudeQuadTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_extrudeQuadTop" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_extrudeQuadTop" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (Hex::Elements *)(arg1)->extrudeQuadTop(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_extrudeQuadUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + double arg4 ; + int arg5 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_extrudeQuadUni",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_extrudeQuadUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_extrudeQuadUni" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_extrudeQuadUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_extrudeQuadUni" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_extrudeQuadUni" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Elements *)(arg1)->extrudeQuadUni(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_extrudeQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::RealVector arg4 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_extrudeQuad",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_extrudeQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_extrudeQuad" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_extrudeQuad" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj3, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_extrudeQuad" "', argument " "4"" of type '" "Hex::RealVector""'"); + } + arg4 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->extrudeQuad(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_extrudeQuadsTop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quads arg2 ; + int arg3 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_extrudeQuadsTop",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_extrudeQuadsTop" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_extrudeQuadsTop" "', argument " "2"" of type '" "Hex::Quads""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_extrudeQuadsTop" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (Hex::Elements *)(arg1)->extrudeQuadsTop(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_extrudeQuadsUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quads arg2 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + double arg4 ; + int arg5 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + double val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_extrudeQuadsUni",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_extrudeQuadsUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_extrudeQuadsUni" "', argument " "2"" of type '" "Hex::Quads""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_extrudeQuadsUni" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + ecode4 = SWIG_AsVal_double(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_extrudeQuadsUni" "', argument " "4"" of type '" "double""'"); + } + arg4 = static_cast< double >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_extrudeQuadsUni" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Elements *)(arg1)->extrudeQuadsUni(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_extrudeQuads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quads arg2 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + Hex::RealVector arg4 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Document_extrudeQuads",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_extrudeQuads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_extrudeQuads" "', argument " "2"" of type '" "Hex::Quads""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_extrudeQuads" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj3, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_extrudeQuads" "', argument " "4"" of type '" "Hex::RealVector""'"); + } + arg4 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->extrudeQuads(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_revolutionQuadUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + int arg6 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Document_revolutionQuadUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_revolutionQuadUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_revolutionQuadUni" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_revolutionQuadUni" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_revolutionQuadUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_revolutionQuadUni" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_revolutionQuadUni" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + result = (Hex::Elements *)(arg1)->revolutionQuadUni(arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_revolutionQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::RealVector arg5 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_revolutionQuad",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_revolutionQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_revolutionQuad" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_revolutionQuad" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_revolutionQuad" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj4, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_revolutionQuad" "', argument " "5"" of type '" "Hex::RealVector""'"); + } + arg5 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->revolutionQuad(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_revolutionQuadsUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quads arg2 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + double arg5 ; + int arg6 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + double val5 ; + int ecode5 = 0 ; + int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Document_revolutionQuadsUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_revolutionQuadsUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_revolutionQuadsUni" "', argument " "2"" of type '" "Hex::Quads""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_revolutionQuadsUni" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_revolutionQuadsUni" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + ecode5 = SWIG_AsVal_double(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_revolutionQuadsUni" "', argument " "5"" of type '" "double""'"); + } + arg5 = static_cast< double >(val5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_revolutionQuadsUni" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + result = (Hex::Elements *)(arg1)->revolutionQuadsUni(arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_revolutionQuads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quads arg2 ; + Hex::Vertex *arg3 = (Hex::Vertex *) 0 ; + Hex::Vector *arg4 = (Hex::Vector *) 0 ; + Hex::RealVector arg5 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:Document_revolutionQuads",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_revolutionQuads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_revolutionQuads" "', argument " "2"" of type '" "Hex::Quads""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_revolutionQuads" "', argument " "3"" of type '" "Hex::Vertex *""'"); + } + arg3 = reinterpret_cast< Hex::Vertex * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_revolutionQuads" "', argument " "4"" of type '" "Hex::Vector *""'"); + } + arg4 = reinterpret_cast< Hex::Vector * >(argp4); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj4, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_revolutionQuads" "', argument " "5"" of type '" "Hex::RealVector""'"); + } + arg5 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + result = (Hex::Elements *)(arg1)->revolutionQuads(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_joinQuadUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg6 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg7 = (Hex::Vertex *) 0 ; + int arg8 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + int val8 ; + int ecode8 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:Document_joinQuadUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_joinQuadUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_joinQuadUni" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_joinQuadUni" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_joinQuadUni" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_joinQuadUni" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_joinQuadUni" "', argument " "6"" of type '" "Hex::Vertex *""'"); + } + arg6 = reinterpret_cast< Hex::Vertex * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_joinQuadUni" "', argument " "7"" of type '" "Hex::Vertex *""'"); + } + arg7 = reinterpret_cast< Hex::Vertex * >(argp7); + ecode8 = SWIG_AsVal_int(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_joinQuadUni" "', argument " "8"" of type '" "int""'"); + } + arg8 = static_cast< int >(val8); + result = (Hex::Elements *)(arg1)->joinQuadUni(arg2,arg3,arg4,arg5,arg6,arg7,arg8); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_joinQuadsUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quads arg2 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg6 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg7 = (Hex::Vertex *) 0 ; + int arg8 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + int val8 ; + int ecode8 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:Document_joinQuadsUni",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_joinQuadsUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_joinQuadsUni" "', argument " "2"" of type '" "Hex::Quads""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_joinQuadsUni" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_joinQuadsUni" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_joinQuadsUni" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_joinQuadsUni" "', argument " "6"" of type '" "Hex::Vertex *""'"); + } + arg6 = reinterpret_cast< Hex::Vertex * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_joinQuadsUni" "', argument " "7"" of type '" "Hex::Vertex *""'"); + } + arg7 = reinterpret_cast< Hex::Vertex * >(argp7); + ecode8 = SWIG_AsVal_int(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_joinQuadsUni" "', argument " "8"" of type '" "int""'"); + } + arg8 = static_cast< int >(val8); + result = (Hex::Elements *)(arg1)->joinQuadsUni(arg2,arg3,arg4,arg5,arg6,arg7,arg8); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_joinQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg6 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg7 = (Hex::Vertex *) 0 ; + Hex::RealVector *arg8 = 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + void *argp8 = 0 ; + int res8 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:Document_joinQuad",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_joinQuad" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_joinQuad" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_joinQuad" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_joinQuad" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_joinQuad" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_joinQuad" "', argument " "6"" of type '" "Hex::Vertex *""'"); + } + arg6 = reinterpret_cast< Hex::Vertex * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_joinQuad" "', argument " "7"" of type '" "Hex::Vertex *""'"); + } + arg7 = reinterpret_cast< Hex::Vertex * >(argp7); + res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 ); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "Document_joinQuad" "', argument " "8"" of type '" "Hex::RealVector &""'"); + } + if (!argp8) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_joinQuad" "', argument " "8"" of type '" "Hex::RealVector &""'"); + } + arg8 = reinterpret_cast< Hex::RealVector * >(argp8); + result = (Hex::Elements *)(arg1)->joinQuad(arg2,arg3,arg4,arg5,arg6,arg7,*arg8); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_joinQuads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quads arg2 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + Hex::Vertex *arg4 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg5 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg6 = (Hex::Vertex *) 0 ; + Hex::Vertex *arg7 = (Hex::Vertex *) 0 ; + Hex::RealVector *arg8 = 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + void *argp5 = 0 ; + int res5 = 0 ; + void *argp6 = 0 ; + int res6 = 0 ; + void *argp7 = 0 ; + int res7 = 0 ; + void *argp8 = 0 ; + int res8 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:Document_joinQuads",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_joinQuads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + { + std::vector > *ptr = (std::vector > *)0; + int res = swig::asptr(obj1, &ptr); + if (!SWIG_IsOK(res) || !ptr) { + SWIG_exception_fail(SWIG_ArgError((ptr ? res : SWIG_TypeError)), "in method '" "Document_joinQuads" "', argument " "2"" of type '" "Hex::Quads""'"); + } + arg2 = *ptr; + if (SWIG_IsNewObj(res)) delete ptr; + } + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_joinQuads" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "Document_joinQuads" "', argument " "4"" of type '" "Hex::Vertex *""'"); + } + arg4 = reinterpret_cast< Hex::Vertex * >(argp4); + res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "Document_joinQuads" "', argument " "5"" of type '" "Hex::Vertex *""'"); + } + arg5 = reinterpret_cast< Hex::Vertex * >(argp5); + res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res6)) { + SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "Document_joinQuads" "', argument " "6"" of type '" "Hex::Vertex *""'"); + } + arg6 = reinterpret_cast< Hex::Vertex * >(argp6); + res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res7)) { + SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "Document_joinQuads" "', argument " "7"" of type '" "Hex::Vertex *""'"); + } + arg7 = reinterpret_cast< Hex::Vertex * >(argp7); + res8 = SWIG_ConvertPtr(obj7, &argp8, SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 ); + if (!SWIG_IsOK(res8)) { + SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "Document_joinQuads" "', argument " "8"" of type '" "Hex::RealVector &""'"); + } + if (!argp8) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_joinQuads" "', argument " "8"" of type '" "Hex::RealVector &""'"); + } + arg8 = reinterpret_cast< Hex::RealVector * >(argp8); + result = (Hex::Elements *)(arg1)->joinQuads(arg2,arg3,arg4,arg5,arg6,arg7,*arg8); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_cutUni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Edge *arg2 = (Hex::Edge *) 0 ; + int arg3 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_cutUni",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_cutUni" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_cutUni" "', argument " "2"" of type '" "Hex::Edge *""'"); + } + arg2 = reinterpret_cast< Hex::Edge * >(argp2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_cutUni" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + result = (Hex::Elements *)(arg1)->cutUni(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_cut__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Edge *arg2 = (Hex::Edge *) 0 ; + Hex::RealVector *arg3 = 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_cut",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_cut" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_cut" "', argument " "2"" of type '" "Hex::Edge *""'"); + } + arg2 = reinterpret_cast< Hex::Edge * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_cut" "', argument " "3"" of type '" "Hex::RealVector &""'"); + } + if (!argp3) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Document_cut" "', argument " "3"" of type '" "Hex::RealVector &""'"); + } + arg3 = reinterpret_cast< Hex::RealVector * >(argp3); + result = (Hex::Elements *)(arg1)->cut(arg2,*arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_cut(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Edge, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__vectorTdouble_std__allocatorTdouble_t_t, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Document_cut__SWIG_1(self, args); + } + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Edge, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_cut__SWIG_0(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_cut'.\n Possible C/C++ prototypes are:\n cut(Hex::Edge *,int)\n cut(Hex::Edge *,Hex::RealVector &)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addGroup(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::EnumGroup arg3 ; + Hex::Group *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addGroup",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addGroup" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addGroup" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Document_addGroup" "', argument " "3"" of type '" "Hex::EnumGroup""'"); + } + arg3 = static_cast< Hex::EnumGroup >(val3); + result = (Hex::Group *)(arg1)->addGroup(arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Group, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_isSaved(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_isSaved",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_isSaved" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (bool)(arg1)->isSaved(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_appendXml(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + pfile arg2 = (pfile) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_appendXml",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_appendXml" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_FILE, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_appendXml" "', argument " "2"" of type '" "pfile""'"); + } + arg2 = reinterpret_cast< pfile >(argp2); + result = (int)(arg1)->appendXml(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getXml(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + cpchar result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_getXml",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getXml" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (cpchar)(arg1)->getXml(); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_getLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_getLevel",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_getLevel" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->getLevel(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCartesian__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + int arg4 ; + int arg5 ; + int arg6 ; + int arg7 ; + int arg8 ; + int arg9 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + int val6 ; + int ecode6 = 0 ; + int val7 ; + int ecode7 = 0 ; + int val8 ; + int ecode8 = 0 ; + int val9 ; + int ecode9 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + PyObject * obj8 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOO:Document_makeCartesian",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCartesian" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCartesian" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCartesian" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeCartesian" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeCartesian" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeCartesian" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + ecode7 = SWIG_AsVal_int(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makeCartesian" "', argument " "7"" of type '" "int""'"); + } + arg7 = static_cast< int >(val7); + ecode8 = SWIG_AsVal_int(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_makeCartesian" "', argument " "8"" of type '" "int""'"); + } + arg8 = static_cast< int >(val8); + ecode9 = SWIG_AsVal_int(obj8, &val9); + if (!SWIG_IsOK(ecode9)) { + SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "Document_makeCartesian" "', argument " "9"" of type '" "int""'"); + } + arg9 = static_cast< int >(val9); + result = (Hex::Elements *)(arg1)->makeCartesian(arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCartesian__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + int arg4 ; + int arg5 ; + int arg6 ; + int arg7 ; + int arg8 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + int val6 ; + int ecode6 = 0 ; + int val7 ; + int ecode7 = 0 ; + int val8 ; + int ecode8 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + PyObject * obj7 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOOO:Document_makeCartesian",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCartesian" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCartesian" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCartesian" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeCartesian" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeCartesian" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeCartesian" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + ecode7 = SWIG_AsVal_int(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makeCartesian" "', argument " "7"" of type '" "int""'"); + } + arg7 = static_cast< int >(val7); + ecode8 = SWIG_AsVal_int(obj7, &val8); + if (!SWIG_IsOK(ecode8)) { + SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "Document_makeCartesian" "', argument " "8"" of type '" "int""'"); + } + arg8 = static_cast< int >(val8); + result = (Hex::Elements *)(arg1)->makeCartesian(arg2,arg3,arg4,arg5,arg6,arg7,arg8); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCartesian__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + int arg4 ; + int arg5 ; + int arg6 ; + int arg7 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + int val6 ; + int ecode6 = 0 ; + int val7 ; + int ecode7 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + PyObject * obj6 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOOO:Document_makeCartesian",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCartesian" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCartesian" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCartesian" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeCartesian" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeCartesian" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeCartesian" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + ecode7 = SWIG_AsVal_int(obj6, &val7); + if (!SWIG_IsOK(ecode7)) { + SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "Document_makeCartesian" "', argument " "7"" of type '" "int""'"); + } + arg7 = static_cast< int >(val7); + result = (Hex::Elements *)(arg1)->makeCartesian(arg2,arg3,arg4,arg5,arg6,arg7); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCartesian__SWIG_4(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vector *arg3 = (Hex::Vector *) 0 ; + int arg4 ; + int arg5 ; + int arg6 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + int val6 ; + int ecode6 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + PyObject * obj5 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOOO:Document_makeCartesian",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_makeCartesian" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_makeCartesian" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Vector, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_makeCartesian" "', argument " "3"" of type '" "Hex::Vector *""'"); + } + arg3 = reinterpret_cast< Hex::Vector * >(argp3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Document_makeCartesian" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "Document_makeCartesian" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + ecode6 = SWIG_AsVal_int(obj5, &val6); + if (!SWIG_IsOK(ecode6)) { + SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "Document_makeCartesian" "', argument " "6"" of type '" "int""'"); + } + arg6 = static_cast< int >(val6); + result = (Hex::Elements *)(arg1)->makeCartesian(arg2,arg3,arg4,arg5,arg6); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_makeCartesian(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[10]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 9); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 6) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeCartesian__SWIG_4(self, args); + } + } + } + } + } + } + } + if (argc == 7) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeCartesian__SWIG_3(self, args); + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = swig::asptr(argv[5], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = swig::asptr(argv[6], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + int res = swig::asptr(argv[7], (std::vector >**)(0)); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Document_makeCartesian__SWIG_0(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 8) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[7], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeCartesian__SWIG_2(self, args); + } + } + } + } + } + } + } + } + } + if (argc == 9) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Vertex, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_Hex__Vector, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[4], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[5], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[6], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[7], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_int(argv[8], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_makeCartesian__SWIG_1(self, args); + } + } + } + } + } + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_makeCartesian'.\n Possible C/C++ prototypes are:\n makeCartesian(Hex::Vertex *,Hex::Vector *,Hex::Vector *,Hex::Vector *,Hex::RealVector,Hex::RealVector,Hex::RealVector)\n makeCartesian(Hex::Vertex *,Hex::Vector *,int,int,int,int,int,int)\n makeCartesian(Hex::Vertex *,Hex::Vector *,int,int,int,int,int)\n makeCartesian(Hex::Vertex *,Hex::Vector *,int,int,int,int)\n makeCartesian(Hex::Vertex *,Hex::Vector *,int,int,int)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findVertex__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int arg2 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_findVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_findVertex" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_findVertex" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Vertex *)(arg1)->findVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_findVertex(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[5]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 4); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_findVertex__SWIG_1(self, args); + } + } + } + if (argc == 4) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_double(argv[1], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + { + int res = SWIG_AsVal_double(argv[3], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_findVertex__SWIG_0(self, args); + } + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_findVertex'.\n Possible C/C++ prototypes are:\n findVertex(double,double,double)\n findVertex(int)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_closeQuads(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Quad *arg2 = (Hex::Quad *) 0 ; + Hex::Quad *arg3 = (Hex::Quad *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_closeQuads",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_closeQuads" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_closeQuads" "', argument " "2"" of type '" "Hex::Quad *""'"); + } + arg2 = reinterpret_cast< Hex::Quad * >(argp2); + res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_Hex__Quad, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_closeQuads" "', argument " "3"" of type '" "Hex::Quad *""'"); + } + arg3 = reinterpret_cast< Hex::Quad * >(argp3); + result = (int)(arg1)->closeQuads(arg2,arg3); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addLaw__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Law *arg2 = (Hex::Law *) 0 ; + Hex::Law *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Document_addLaw",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addLaw" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Law, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Document_addLaw" "', argument " "2"" of type '" "Hex::Law *""'"); + } + arg2 = reinterpret_cast< Hex::Law * >(argp2); + result = (Hex::Law *)(arg1)->addLaw(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Law, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addLaw(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[4]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 3); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_Hex__Law, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Document_addLaw__SWIG_1(self, args); + } + } + } + if (argc == 3) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Document, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + { + int res = SWIG_AsVal_int(argv[2], NULL); + _v = SWIG_CheckState(res); + } + if (_v) { + return _wrap_Document_addLaw__SWIG_0(self, args); + } + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Document_addLaw'.\n Possible C/C++ prototypes are:\n addLaw(char const *,int)\n addLaw(Hex::Law *)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_checkAssociations(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Document_checkAssociations",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_checkAssociations" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (int)(arg1)->checkAssociations(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Document_addShape(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + long arg2 ; + char *arg3 = (char *) 0 ; + Hex::NewShape *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + long val2 ; + int ecode2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOO:Document_addShape",&obj0,&obj1,&obj2)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Document_addShape" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_long(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Document_addShape" "', argument " "2"" of type '" "long""'"); + } + arg2 = static_cast< long >(val2); + res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "Document_addShape" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = reinterpret_cast< char * >(buf3); + result = (Hex::NewShape *)(arg1)->addShape(arg2,(char const *)arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__NewShape, 0 | 0 ); + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return resultobj; +fail: + if (alloc3 == SWIG_NEWOBJ) delete[] buf3; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Document(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Document",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Document" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Document_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Document, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_Propagation_getEdges(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + Hex::Edges *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Propagation_getEdges",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Propagation_getEdges" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + { + Hex::Edges const &_result_ref = (arg1)->getEdges(); + result = (Hex::Edges *) &_result_ref; + } + resultobj = swig::from(static_cast< std::vector > >(*result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Propagation_getLaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + Hex::Law *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Propagation_getLaw",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Propagation_getLaw" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + result = (Hex::Law *)(arg1)->getLaw(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Law, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Propagation_getWay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + bool result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Propagation_getWay",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Propagation_getWay" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + result = (bool)(arg1)->getWay(); + resultobj = SWIG_From_bool(static_cast< bool >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Propagation_setWay(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + bool arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + bool val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Propagation_setWay",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Propagation_setWay" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + ecode2 = SWIG_AsVal_bool(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Propagation_setWay" "', argument " "2"" of type '" "bool""'"); + } + arg2 = static_cast< bool >(val2); + (arg1)->setWay(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Propagation_setLaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + Hex::Law *arg2 = (Hex::Law *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Propagation_setLaw",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Propagation_setLaw" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Law, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Propagation_setLaw" "', argument " "2"" of type '" "Hex::Law *""'"); + } + arg2 = reinterpret_cast< Hex::Law * >(argp2); + result = (int)(arg1)->setLaw(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Propagation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Propagation *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_Propagation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Propagation" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (Hex::Propagation *)new Hex::Propagation(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Propagation, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Propagation_saveXml(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + Hex::XmlWriter *arg2 = (Hex::XmlWriter *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Propagation_saveXml",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Propagation_saveXml" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__XmlWriter, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Propagation_saveXml" "', argument " "2"" of type '" "Hex::XmlWriter *""'"); + } + arg2 = reinterpret_cast< Hex::XmlWriter * >(argp2); + (arg1)->saveXml(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Propagation_addEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + Hex::Edge *arg2 = (Hex::Edge *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Propagation_addEdge",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Propagation_addEdge" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Edge, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Propagation_addEdge" "', argument " "2"" of type '" "Hex::Edge *""'"); + } + arg2 = reinterpret_cast< Hex::Edge * >(argp2); + (arg1)->addEdge(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Propagation_majLaw(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Propagation_majLaw",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Propagation_majLaw" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + (arg1)->majLaw(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Propagation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Propagation *arg1 = (Hex::Propagation *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Propagation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Propagation, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Propagation" "', argument " "1"" of type '" "Hex::Propagation *""'"); + } + arg1 = reinterpret_cast< Hex::Propagation * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Propagation_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Propagation, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_hex_instance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":hex_instance")) SWIG_fail; + result = (Hex::Hex *)Hex::hex_instance(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_getInstance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":Hex_getInstance")) SWIG_fail; + result = (Hex::Hex *)Hex::Hex::getInstance(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_countDocument(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Hex_countDocument",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_countDocument" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + result = (int)(arg1)->countDocument(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_getDocument(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + int arg2 ; + Hex::Document *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hex_getDocument",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_getDocument" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Hex_getDocument" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Document *)(arg1)->getDocument(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_removeDocument(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + Hex::Document *arg2 = (Hex::Document *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hex_removeDocument",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_removeDocument" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Hex_removeDocument" "', argument " "2"" of type '" "Hex::Document *""'"); + } + arg2 = reinterpret_cast< Hex::Document * >(argp2); + (arg1)->removeDocument(arg2); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_addDocument__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Document *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hex_addDocument",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_addDocument" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Hex_addDocument" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Document *)(arg1)->addDocument(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_addDocument__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + Hex::Document *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Hex_addDocument",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_addDocument" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + result = (Hex::Document *)(arg1)->addDocument(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_addDocument(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 1) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Hex, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Hex_addDocument__SWIG_1(self, args); + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Hex, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Hex_addDocument__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Hex_addDocument'.\n Possible C/C++ prototypes are:\n addDocument(cpchar)\n addDocument()\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_loadDocument(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Document *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hex_loadDocument",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_loadDocument" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Hex_loadDocument" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Document *)(arg1)->loadDocument(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_findDocument__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + cpchar arg2 = (cpchar) 0 ; + Hex::Document *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hex_findDocument",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_findDocument" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Hex_findDocument" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (Hex::Document *)(arg1)->findDocument(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_findDocument__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + string *arg2 = 0 ; + Hex::Document *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hex_findDocument",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_findDocument" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_string, 0 | 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Hex_findDocument" "', argument " "2"" of type '" "string const &""'"); + } + if (!argp2) { + SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "Hex_findDocument" "', argument " "2"" of type '" "string const &""'"); + } + arg2 = reinterpret_cast< string * >(argp2); + result = (Hex::Document *)(arg1)->findDocument((string const &)*arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Document, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_findDocument(PyObject *self, PyObject *args) { + int argc; + PyObject *argv[3]; + int ii; + + if (!PyTuple_Check(args)) SWIG_fail; + argc = PyObject_Length(args); + for (ii = 0; (ii < argc) && (ii < 2); ii++) { + argv[ii] = PyTuple_GET_ITEM(args,ii); + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Hex, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_string, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Hex_findDocument__SWIG_1(self, args); + } + } + } + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Hex__Hex, 0); + _v = SWIG_CheckState(res); + if (_v) { + int res = SWIG_AsCharPtrAndSize(argv[1], 0, NULL, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_Hex_findDocument__SWIG_0(self, args); + } + } + } + +fail: + SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number of arguments for overloaded function 'Hex_findDocument'.\n Possible C/C++ prototypes are:\n findDocument(cpchar)\n findDocument(string const &)\n"); + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_what(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Hex_what",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_what" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + (arg1)->what(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_sizeofMessage(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Hex_sizeofMessage",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_sizeofMessage" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + result = (int)(arg1)->sizeofMessage(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Hex_getMessageLine(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + int arg2 ; + cpchar result; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Hex_getMessageLine",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Hex_getMessageLine" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Hex_getMessageLine" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (cpchar)(arg1)->getMessageLine(arg2); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Hex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *result = 0 ; + + if (!PyArg_ParseTuple(args,(char *)":new_Hex")) SWIG_fail; + result = (Hex::Hex *)new Hex::Hex(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hex, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Hex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Hex *arg1 = (Hex::Hex *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Hex",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Hex, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Hex" "', argument " "1"" of type '" "Hex::Hex *""'"); + } + arg1 = reinterpret_cast< Hex::Hex * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Hex_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Hex, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_what(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + + if (!PyArg_ParseTuple(args,(char *)":what")) SWIG_fail; + Hex::what(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Elements_getHexa",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getHexa" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getHexa" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Hexa *)(arg1)->getHexa(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Elements_getQuad",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getQuad" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getQuad" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Quad *)(arg1)->getQuad(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Elements_getEdge",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getEdge" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getEdge" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Edge *)(arg1)->getEdge(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Elements_getVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getVertex" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getVertex" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + result = (Hex::Vertex *)(arg1)->getVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getHexaIJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Elements_getHexaIJK",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getHexaIJK" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getHexaIJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Elements_getHexaIJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Elements_getHexaIJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Hexa *)(arg1)->getHexaIJK(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getQuadIJ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Elements_getQuadIJ",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getQuadIJ" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getQuadIJ" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Elements_getQuadIJ" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Elements_getQuadIJ" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Quad *)(arg1)->getQuadIJ(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getQuadJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Elements_getQuadJK",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getQuadJK" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getQuadJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Elements_getQuadJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Elements_getQuadJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Quad *)(arg1)->getQuadJK(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getQuadIK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Elements_getQuadIK",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getQuadIK" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getQuadIK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Elements_getQuadIK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Elements_getQuadIK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Quad *)(arg1)->getQuadIK(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getEdgeI(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Elements_getEdgeI",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getEdgeI" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getEdgeI" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Elements_getEdgeI" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Elements_getEdgeI" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Edge *)(arg1)->getEdgeI(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getEdgeJ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Elements_getEdgeJ",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getEdgeJ" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getEdgeJ" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Elements_getEdgeJ" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Elements_getEdgeJ" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Edge *)(arg1)->getEdgeJ(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getEdgeK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Elements_getEdgeK",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getEdgeK" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getEdgeK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Elements_getEdgeK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Elements_getEdgeK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Edge *)(arg1)->getEdgeK(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_getVertexIJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOO:Elements_getVertexIJK",&obj0,&obj1,&obj2,&obj3)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_getVertexIJK" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Elements_getVertexIJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "Elements_getVertexIJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "Elements_getVertexIJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + result = (Hex::Vertex *)(arg1)->getVertexIJK(arg2,arg3,arg4); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_countHexa(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Elements_countHexa",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_countHexa" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + result = (int)(arg1)->countHexa(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_countQuad(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Elements_countQuad",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_countQuad" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + result = (int)(arg1)->countQuad(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_countEdge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Elements_countEdge",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_countEdge" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + result = (int)(arg1)->countEdge(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_countVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Elements_countVertex",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_countVertex" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + result = (int)(arg1)->countVertex(); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_nearestVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Elements_nearestVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_nearestVertex" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Elements_nearestVertex" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + result = (Hex::Vertex *)(arg1)->nearestVertex(arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_findVertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + Hex::Vertex *arg2 = (Hex::Vertex *) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Elements_findVertex",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_findVertex" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Elements_findVertex" "', argument " "2"" of type '" "Hex::Vertex *""'"); + } + arg2 = reinterpret_cast< Hex::Vertex * >(argp2); + result = (int)(arg1)->findVertex(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_clearAssociation(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:Elements_clearAssociation",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_clearAssociation" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + (arg1)->clearAssociation(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_Elements_saveVtk(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + cpchar arg2 = (cpchar) 0 ; + int result; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:Elements_saveVtk",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Elements_saveVtk" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Elements_saveVtk" "', argument " "2"" of type '" "cpchar""'"); + } + arg2 = reinterpret_cast< cpchar >(buf2); + result = (int)(arg1)->saveVtk(arg2); + resultobj = SWIG_From_int(static_cast< int >(result)); + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return resultobj; +fail: + if (alloc2 == SWIG_NEWOBJ) delete[] buf2; + return NULL; +} + + +SWIGINTERN PyObject *_wrap_new_Elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::Elements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_Elements",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Elements" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (Hex::Elements *)new Hex::Elements(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Elements, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_Elements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Elements *arg1 = (Hex::Elements *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_Elements",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Elements, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Elements" "', argument " "1"" of type '" "Hex::Elements *""'"); + } + arg1 = reinterpret_cast< Hex::Elements * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *Elements_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__Elements, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_new_CrossElements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::EnumGrid arg2 ; + Hex::CrossElements *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OO:new_CrossElements",&obj0,&obj1)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_CrossElements" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CrossElements" "', argument " "2"" of type '" "Hex::EnumGrid""'"); + } + arg2 = static_cast< Hex::EnumGrid >(val2); + result = (Hex::CrossElements *)new Hex::CrossElements(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__CrossElements, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CrossElements_getHexaIJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:CrossElements_getHexaIJK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CrossElements_getHexaIJK" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CrossElements_getHexaIJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CrossElements_getHexaIJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CrossElements_getHexaIJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CrossElements_getHexaIJK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Hexa *)(arg1)->getHexaIJK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CrossElements_getQuadIJ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:CrossElements_getQuadIJ",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CrossElements_getQuadIJ" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CrossElements_getQuadIJ" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CrossElements_getQuadIJ" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CrossElements_getQuadIJ" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CrossElements_getQuadIJ" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Quad *)(arg1)->getQuadIJ(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CrossElements_getQuadJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:CrossElements_getQuadJK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CrossElements_getQuadJK" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CrossElements_getQuadJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CrossElements_getQuadJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CrossElements_getQuadJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CrossElements_getQuadJK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Quad *)(arg1)->getQuadJK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CrossElements_getQuadIK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:CrossElements_getQuadIK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CrossElements_getQuadIK" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CrossElements_getQuadIK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CrossElements_getQuadIK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CrossElements_getQuadIK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CrossElements_getQuadIK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Quad *)(arg1)->getQuadIK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CrossElements_getEdgeI(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:CrossElements_getEdgeI",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CrossElements_getEdgeI" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CrossElements_getEdgeI" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CrossElements_getEdgeI" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CrossElements_getEdgeI" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CrossElements_getEdgeI" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Edge *)(arg1)->getEdgeI(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CrossElements_getEdgeJ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:CrossElements_getEdgeJ",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CrossElements_getEdgeJ" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CrossElements_getEdgeJ" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CrossElements_getEdgeJ" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CrossElements_getEdgeJ" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CrossElements_getEdgeJ" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Edge *)(arg1)->getEdgeJ(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CrossElements_getEdgeK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:CrossElements_getEdgeK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CrossElements_getEdgeK" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CrossElements_getEdgeK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CrossElements_getEdgeK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CrossElements_getEdgeK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CrossElements_getEdgeK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Edge *)(arg1)->getEdgeK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_CrossElements_getVertexIJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:CrossElements_getVertexIJK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CrossElements_getVertexIJK" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CrossElements_getVertexIJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "CrossElements_getVertexIJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "CrossElements_getVertexIJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "CrossElements_getVertexIJK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Vertex *)(arg1)->getVertexIJK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_CrossElements(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::CrossElements *arg1 = (Hex::CrossElements *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_CrossElements",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__CrossElements, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CrossElements" "', argument " "1"" of type '" "Hex::CrossElements *""'"); + } + arg1 = reinterpret_cast< Hex::CrossElements * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *CrossElements_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__CrossElements, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +SWIGINTERN PyObject *_wrap_new_BiCylinder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::Document *arg1 = (Hex::Document *) 0 ; + Hex::BiCylinder *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:new_BiCylinder",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__Document, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_BiCylinder" "', argument " "1"" of type '" "Hex::Document *""'"); + } + arg1 = reinterpret_cast< Hex::Document * >(argp1); + result = (Hex::BiCylinder *)new Hex::BiCylinder(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__BiCylinder, SWIG_POINTER_NEW | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_BiCylinder_getHexaIJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Hexa *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:BiCylinder_getHexaIJK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BiCylinder_getHexaIJK" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BiCylinder_getHexaIJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BiCylinder_getHexaIJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BiCylinder_getHexaIJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "BiCylinder_getHexaIJK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Hexa *)(arg1)->getHexaIJK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Hexa, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_BiCylinder_getQuadIJ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:BiCylinder_getQuadIJ",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BiCylinder_getQuadIJ" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BiCylinder_getQuadIJ" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BiCylinder_getQuadIJ" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BiCylinder_getQuadIJ" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "BiCylinder_getQuadIJ" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Quad *)(arg1)->getQuadIJ(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_BiCylinder_getQuadJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:BiCylinder_getQuadJK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BiCylinder_getQuadJK" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BiCylinder_getQuadJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BiCylinder_getQuadJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BiCylinder_getQuadJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "BiCylinder_getQuadJK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Quad *)(arg1)->getQuadJK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_BiCylinder_getQuadIK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Quad *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:BiCylinder_getQuadIK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BiCylinder_getQuadIK" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BiCylinder_getQuadIK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BiCylinder_getQuadIK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BiCylinder_getQuadIK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "BiCylinder_getQuadIK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Quad *)(arg1)->getQuadIK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Quad, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_BiCylinder_getEdgeI(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:BiCylinder_getEdgeI",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BiCylinder_getEdgeI" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BiCylinder_getEdgeI" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BiCylinder_getEdgeI" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BiCylinder_getEdgeI" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "BiCylinder_getEdgeI" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Edge *)(arg1)->getEdgeI(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_BiCylinder_getEdgeJ(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:BiCylinder_getEdgeJ",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BiCylinder_getEdgeJ" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BiCylinder_getEdgeJ" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BiCylinder_getEdgeJ" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BiCylinder_getEdgeJ" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "BiCylinder_getEdgeJ" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Edge *)(arg1)->getEdgeJ(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_BiCylinder_getEdgeK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Edge *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:BiCylinder_getEdgeK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BiCylinder_getEdgeK" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BiCylinder_getEdgeK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BiCylinder_getEdgeK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BiCylinder_getEdgeK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "BiCylinder_getEdgeK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Edge *)(arg1)->getEdgeK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Edge, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_BiCylinder_getVertexIJK(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + int arg2 ; + int arg3 ; + int arg4 ; + int arg5 ; + Hex::Vertex *result = 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject * obj0 = 0 ; + PyObject * obj1 = 0 ; + PyObject * obj2 = 0 ; + PyObject * obj3 = 0 ; + PyObject * obj4 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"OOOOO:BiCylinder_getVertexIJK",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BiCylinder_getVertexIJK" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + ecode2 = SWIG_AsVal_int(obj1, &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BiCylinder_getVertexIJK" "', argument " "2"" of type '" "int""'"); + } + arg2 = static_cast< int >(val2); + ecode3 = SWIG_AsVal_int(obj2, &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "BiCylinder_getVertexIJK" "', argument " "3"" of type '" "int""'"); + } + arg3 = static_cast< int >(val3); + ecode4 = SWIG_AsVal_int(obj3, &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "BiCylinder_getVertexIJK" "', argument " "4"" of type '" "int""'"); + } + arg4 = static_cast< int >(val4); + ecode5 = SWIG_AsVal_int(obj4, &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "BiCylinder_getVertexIJK" "', argument " "5"" of type '" "int""'"); + } + arg5 = static_cast< int >(val5); + result = (Hex::Vertex *)(arg1)->getVertexIJK(arg2,arg3,arg4,arg5); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Hex__Vertex, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_delete_BiCylinder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *resultobj = 0; + Hex::BiCylinder *arg1 = (Hex::BiCylinder *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject * obj0 = 0 ; + + if (!PyArg_ParseTuple(args,(char *)"O:delete_BiCylinder",&obj0)) SWIG_fail; + res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Hex__BiCylinder, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BiCylinder" "', argument " "1"" of type '" "Hex::BiCylinder *""'"); + } + arg1 = reinterpret_cast< Hex::BiCylinder * >(argp1); + delete arg1; + + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *BiCylinder_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) { + PyObject *obj; + if (!PyArg_ParseTuple(args,(char*)"O|swigregister", &obj)) return NULL; + SWIG_TypeNewClientData(SWIGTYPE_p_Hex__BiCylinder, SWIG_NewClientData(obj)); + return SWIG_Py_Void(); +} + +static PyMethodDef SwigMethods[] = { + { (char *)"delete_PySwigIterator", _wrap_delete_PySwigIterator, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_value", _wrap_PySwigIterator_value, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_incr", _wrap_PySwigIterator_incr, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_decr", _wrap_PySwigIterator_decr, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_distance", _wrap_PySwigIterator_distance, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_equal", _wrap_PySwigIterator_equal, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_copy", _wrap_PySwigIterator_copy, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_next", _wrap_PySwigIterator_next, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_previous", _wrap_PySwigIterator_previous, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_advance", _wrap_PySwigIterator_advance, METH_VARARGS, NULL}, + { (char *)"PySwigIterator___eq__", _wrap_PySwigIterator___eq__, METH_VARARGS, NULL}, + { (char *)"PySwigIterator___ne__", _wrap_PySwigIterator___ne__, METH_VARARGS, NULL}, + { (char *)"PySwigIterator___iadd__", _wrap_PySwigIterator___iadd__, METH_VARARGS, NULL}, + { (char *)"PySwigIterator___isub__", _wrap_PySwigIterator___isub__, METH_VARARGS, NULL}, + { (char *)"PySwigIterator___add__", _wrap_PySwigIterator___add__, METH_VARARGS, NULL}, + { (char *)"PySwigIterator___sub__", _wrap_PySwigIterator___sub__, METH_VARARGS, NULL}, + { (char *)"PySwigIterator_swigregister", PySwigIterator_swigregister, METH_VARARGS, NULL}, + { (char *)"VectorHexas_iterator", _wrap_VectorHexas_iterator, METH_VARARGS, NULL}, + { (char *)"VectorHexas___nonzero__", _wrap_VectorHexas___nonzero__, METH_VARARGS, NULL}, + { (char *)"VectorHexas___len__", _wrap_VectorHexas___len__, METH_VARARGS, NULL}, + { (char *)"VectorHexas_pop", _wrap_VectorHexas_pop, METH_VARARGS, NULL}, + { (char *)"VectorHexas___getslice__", _wrap_VectorHexas___getslice__, METH_VARARGS, NULL}, + { (char *)"VectorHexas___setslice__", _wrap_VectorHexas___setslice__, METH_VARARGS, NULL}, + { (char *)"VectorHexas___delslice__", _wrap_VectorHexas___delslice__, METH_VARARGS, NULL}, + { (char *)"VectorHexas___delitem__", _wrap_VectorHexas___delitem__, METH_VARARGS, NULL}, + { (char *)"VectorHexas___getitem__", _wrap_VectorHexas___getitem__, METH_VARARGS, NULL}, + { (char *)"VectorHexas___setitem__", _wrap_VectorHexas___setitem__, METH_VARARGS, NULL}, + { (char *)"VectorHexas_append", _wrap_VectorHexas_append, METH_VARARGS, NULL}, + { (char *)"VectorHexas_empty", _wrap_VectorHexas_empty, METH_VARARGS, NULL}, + { (char *)"VectorHexas_size", _wrap_VectorHexas_size, METH_VARARGS, NULL}, + { (char *)"VectorHexas_clear", _wrap_VectorHexas_clear, METH_VARARGS, NULL}, + { (char *)"VectorHexas_swap", _wrap_VectorHexas_swap, METH_VARARGS, NULL}, + { (char *)"VectorHexas_get_allocator", _wrap_VectorHexas_get_allocator, METH_VARARGS, NULL}, + { (char *)"VectorHexas_begin", _wrap_VectorHexas_begin, METH_VARARGS, NULL}, + { (char *)"VectorHexas_end", _wrap_VectorHexas_end, METH_VARARGS, NULL}, + { (char *)"VectorHexas_rbegin", _wrap_VectorHexas_rbegin, METH_VARARGS, NULL}, + { (char *)"VectorHexas_rend", _wrap_VectorHexas_rend, METH_VARARGS, NULL}, + { (char *)"VectorHexas_pop_back", _wrap_VectorHexas_pop_back, METH_VARARGS, NULL}, + { (char *)"VectorHexas_erase", _wrap_VectorHexas_erase, METH_VARARGS, NULL}, + { (char *)"new_VectorHexas", _wrap_new_VectorHexas, METH_VARARGS, NULL}, + { (char *)"VectorHexas_push_back", _wrap_VectorHexas_push_back, METH_VARARGS, NULL}, + { (char *)"VectorHexas_front", _wrap_VectorHexas_front, METH_VARARGS, NULL}, + { (char *)"VectorHexas_back", _wrap_VectorHexas_back, METH_VARARGS, NULL}, + { (char *)"VectorHexas_assign", _wrap_VectorHexas_assign, METH_VARARGS, NULL}, + { (char *)"VectorHexas_resize", _wrap_VectorHexas_resize, METH_VARARGS, NULL}, + { (char *)"VectorHexas_insert", _wrap_VectorHexas_insert, METH_VARARGS, NULL}, + { (char *)"VectorHexas_reserve", _wrap_VectorHexas_reserve, METH_VARARGS, NULL}, + { (char *)"VectorHexas_capacity", _wrap_VectorHexas_capacity, METH_VARARGS, NULL}, + { (char *)"delete_VectorHexas", _wrap_delete_VectorHexas, METH_VARARGS, NULL}, + { (char *)"VectorHexas_swigregister", VectorHexas_swigregister, METH_VARARGS, NULL}, + { (char *)"VectorQuads_iterator", _wrap_VectorQuads_iterator, METH_VARARGS, NULL}, + { (char *)"VectorQuads___nonzero__", _wrap_VectorQuads___nonzero__, METH_VARARGS, NULL}, + { (char *)"VectorQuads___len__", _wrap_VectorQuads___len__, METH_VARARGS, NULL}, + { (char *)"VectorQuads_pop", _wrap_VectorQuads_pop, METH_VARARGS, NULL}, + { (char *)"VectorQuads___getslice__", _wrap_VectorQuads___getslice__, METH_VARARGS, NULL}, + { (char *)"VectorQuads___setslice__", _wrap_VectorQuads___setslice__, METH_VARARGS, NULL}, + { (char *)"VectorQuads___delslice__", _wrap_VectorQuads___delslice__, METH_VARARGS, NULL}, + { (char *)"VectorQuads___delitem__", _wrap_VectorQuads___delitem__, METH_VARARGS, NULL}, + { (char *)"VectorQuads___getitem__", _wrap_VectorQuads___getitem__, METH_VARARGS, NULL}, + { (char *)"VectorQuads___setitem__", _wrap_VectorQuads___setitem__, METH_VARARGS, NULL}, + { (char *)"VectorQuads_append", _wrap_VectorQuads_append, METH_VARARGS, NULL}, + { (char *)"VectorQuads_empty", _wrap_VectorQuads_empty, METH_VARARGS, NULL}, + { (char *)"VectorQuads_size", _wrap_VectorQuads_size, METH_VARARGS, NULL}, + { (char *)"VectorQuads_clear", _wrap_VectorQuads_clear, METH_VARARGS, NULL}, + { (char *)"VectorQuads_swap", _wrap_VectorQuads_swap, METH_VARARGS, NULL}, + { (char *)"VectorQuads_get_allocator", _wrap_VectorQuads_get_allocator, METH_VARARGS, NULL}, + { (char *)"VectorQuads_begin", _wrap_VectorQuads_begin, METH_VARARGS, NULL}, + { (char *)"VectorQuads_end", _wrap_VectorQuads_end, METH_VARARGS, NULL}, + { (char *)"VectorQuads_rbegin", _wrap_VectorQuads_rbegin, METH_VARARGS, NULL}, + { (char *)"VectorQuads_rend", _wrap_VectorQuads_rend, METH_VARARGS, NULL}, + { (char *)"VectorQuads_pop_back", _wrap_VectorQuads_pop_back, METH_VARARGS, NULL}, + { (char *)"VectorQuads_erase", _wrap_VectorQuads_erase, METH_VARARGS, NULL}, + { (char *)"new_VectorQuads", _wrap_new_VectorQuads, METH_VARARGS, NULL}, + { (char *)"VectorQuads_push_back", _wrap_VectorQuads_push_back, METH_VARARGS, NULL}, + { (char *)"VectorQuads_front", _wrap_VectorQuads_front, METH_VARARGS, NULL}, + { (char *)"VectorQuads_back", _wrap_VectorQuads_back, METH_VARARGS, NULL}, + { (char *)"VectorQuads_assign", _wrap_VectorQuads_assign, METH_VARARGS, NULL}, + { (char *)"VectorQuads_resize", _wrap_VectorQuads_resize, METH_VARARGS, NULL}, + { (char *)"VectorQuads_insert", _wrap_VectorQuads_insert, METH_VARARGS, NULL}, + { (char *)"VectorQuads_reserve", _wrap_VectorQuads_reserve, METH_VARARGS, NULL}, + { (char *)"VectorQuads_capacity", _wrap_VectorQuads_capacity, METH_VARARGS, NULL}, + { (char *)"delete_VectorQuads", _wrap_delete_VectorQuads, METH_VARARGS, NULL}, + { (char *)"VectorQuads_swigregister", VectorQuads_swigregister, METH_VARARGS, NULL}, + { (char *)"VectorEdges_iterator", _wrap_VectorEdges_iterator, METH_VARARGS, NULL}, + { (char *)"VectorEdges___nonzero__", _wrap_VectorEdges___nonzero__, METH_VARARGS, NULL}, + { (char *)"VectorEdges___len__", _wrap_VectorEdges___len__, METH_VARARGS, NULL}, + { (char *)"VectorEdges_pop", _wrap_VectorEdges_pop, METH_VARARGS, NULL}, + { (char *)"VectorEdges___getslice__", _wrap_VectorEdges___getslice__, METH_VARARGS, NULL}, + { (char *)"VectorEdges___setslice__", _wrap_VectorEdges___setslice__, METH_VARARGS, NULL}, + { (char *)"VectorEdges___delslice__", _wrap_VectorEdges___delslice__, METH_VARARGS, NULL}, + { (char *)"VectorEdges___delitem__", _wrap_VectorEdges___delitem__, METH_VARARGS, NULL}, + { (char *)"VectorEdges___getitem__", _wrap_VectorEdges___getitem__, METH_VARARGS, NULL}, + { (char *)"VectorEdges___setitem__", _wrap_VectorEdges___setitem__, METH_VARARGS, NULL}, + { (char *)"VectorEdges_append", _wrap_VectorEdges_append, METH_VARARGS, NULL}, + { (char *)"VectorEdges_empty", _wrap_VectorEdges_empty, METH_VARARGS, NULL}, + { (char *)"VectorEdges_size", _wrap_VectorEdges_size, METH_VARARGS, NULL}, + { (char *)"VectorEdges_clear", _wrap_VectorEdges_clear, METH_VARARGS, NULL}, + { (char *)"VectorEdges_swap", _wrap_VectorEdges_swap, METH_VARARGS, NULL}, + { (char *)"VectorEdges_get_allocator", _wrap_VectorEdges_get_allocator, METH_VARARGS, NULL}, + { (char *)"VectorEdges_begin", _wrap_VectorEdges_begin, METH_VARARGS, NULL}, + { (char *)"VectorEdges_end", _wrap_VectorEdges_end, METH_VARARGS, NULL}, + { (char *)"VectorEdges_rbegin", _wrap_VectorEdges_rbegin, METH_VARARGS, NULL}, + { (char *)"VectorEdges_rend", _wrap_VectorEdges_rend, METH_VARARGS, NULL}, + { (char *)"VectorEdges_pop_back", _wrap_VectorEdges_pop_back, METH_VARARGS, NULL}, + { (char *)"VectorEdges_erase", _wrap_VectorEdges_erase, METH_VARARGS, NULL}, + { (char *)"new_VectorEdges", _wrap_new_VectorEdges, METH_VARARGS, NULL}, + { (char *)"VectorEdges_push_back", _wrap_VectorEdges_push_back, METH_VARARGS, NULL}, + { (char *)"VectorEdges_front", _wrap_VectorEdges_front, METH_VARARGS, NULL}, + { (char *)"VectorEdges_back", _wrap_VectorEdges_back, METH_VARARGS, NULL}, + { (char *)"VectorEdges_assign", _wrap_VectorEdges_assign, METH_VARARGS, NULL}, + { (char *)"VectorEdges_resize", _wrap_VectorEdges_resize, METH_VARARGS, NULL}, + { (char *)"VectorEdges_insert", _wrap_VectorEdges_insert, METH_VARARGS, NULL}, + { (char *)"VectorEdges_reserve", _wrap_VectorEdges_reserve, METH_VARARGS, NULL}, + { (char *)"VectorEdges_capacity", _wrap_VectorEdges_capacity, METH_VARARGS, NULL}, + { (char *)"delete_VectorEdges", _wrap_delete_VectorEdges, METH_VARARGS, NULL}, + { (char *)"VectorEdges_swigregister", VectorEdges_swigregister, METH_VARARGS, NULL}, + { (char *)"VectorVertices_iterator", _wrap_VectorVertices_iterator, METH_VARARGS, NULL}, + { (char *)"VectorVertices___nonzero__", _wrap_VectorVertices___nonzero__, METH_VARARGS, NULL}, + { (char *)"VectorVertices___len__", _wrap_VectorVertices___len__, METH_VARARGS, NULL}, + { (char *)"VectorVertices_pop", _wrap_VectorVertices_pop, METH_VARARGS, NULL}, + { (char *)"VectorVertices___getslice__", _wrap_VectorVertices___getslice__, METH_VARARGS, NULL}, + { (char *)"VectorVertices___setslice__", _wrap_VectorVertices___setslice__, METH_VARARGS, NULL}, + { (char *)"VectorVertices___delslice__", _wrap_VectorVertices___delslice__, METH_VARARGS, NULL}, + { (char *)"VectorVertices___delitem__", _wrap_VectorVertices___delitem__, METH_VARARGS, NULL}, + { (char *)"VectorVertices___getitem__", _wrap_VectorVertices___getitem__, METH_VARARGS, NULL}, + { (char *)"VectorVertices___setitem__", _wrap_VectorVertices___setitem__, METH_VARARGS, NULL}, + { (char *)"VectorVertices_append", _wrap_VectorVertices_append, METH_VARARGS, NULL}, + { (char *)"VectorVertices_empty", _wrap_VectorVertices_empty, METH_VARARGS, NULL}, + { (char *)"VectorVertices_size", _wrap_VectorVertices_size, METH_VARARGS, NULL}, + { (char *)"VectorVertices_clear", _wrap_VectorVertices_clear, METH_VARARGS, NULL}, + { (char *)"VectorVertices_swap", _wrap_VectorVertices_swap, METH_VARARGS, NULL}, + { (char *)"VectorVertices_get_allocator", _wrap_VectorVertices_get_allocator, METH_VARARGS, NULL}, + { (char *)"VectorVertices_begin", _wrap_VectorVertices_begin, METH_VARARGS, NULL}, + { (char *)"VectorVertices_end", _wrap_VectorVertices_end, METH_VARARGS, NULL}, + { (char *)"VectorVertices_rbegin", _wrap_VectorVertices_rbegin, METH_VARARGS, NULL}, + { (char *)"VectorVertices_rend", _wrap_VectorVertices_rend, METH_VARARGS, NULL}, + { (char *)"VectorVertices_pop_back", _wrap_VectorVertices_pop_back, METH_VARARGS, NULL}, + { (char *)"VectorVertices_erase", _wrap_VectorVertices_erase, METH_VARARGS, NULL}, + { (char *)"new_VectorVertices", _wrap_new_VectorVertices, METH_VARARGS, NULL}, + { (char *)"VectorVertices_push_back", _wrap_VectorVertices_push_back, METH_VARARGS, NULL}, + { (char *)"VectorVertices_front", _wrap_VectorVertices_front, METH_VARARGS, NULL}, + { (char *)"VectorVertices_back", _wrap_VectorVertices_back, METH_VARARGS, NULL}, + { (char *)"VectorVertices_assign", _wrap_VectorVertices_assign, METH_VARARGS, NULL}, + { (char *)"VectorVertices_resize", _wrap_VectorVertices_resize, METH_VARARGS, NULL}, + { (char *)"VectorVertices_insert", _wrap_VectorVertices_insert, METH_VARARGS, NULL}, + { (char *)"VectorVertices_reserve", _wrap_VectorVertices_reserve, METH_VARARGS, NULL}, + { (char *)"VectorVertices_capacity", _wrap_VectorVertices_capacity, METH_VARARGS, NULL}, + { (char *)"delete_VectorVertices", _wrap_delete_VectorVertices, METH_VARARGS, NULL}, + { (char *)"VectorVertices_swigregister", VectorVertices_swigregister, METH_VARARGS, NULL}, + { (char *)"VectorReal_iterator", _wrap_VectorReal_iterator, METH_VARARGS, NULL}, + { (char *)"VectorReal___nonzero__", _wrap_VectorReal___nonzero__, METH_VARARGS, NULL}, + { (char *)"VectorReal___len__", _wrap_VectorReal___len__, METH_VARARGS, NULL}, + { (char *)"VectorReal_pop", _wrap_VectorReal_pop, METH_VARARGS, NULL}, + { (char *)"VectorReal___getslice__", _wrap_VectorReal___getslice__, METH_VARARGS, NULL}, + { (char *)"VectorReal___setslice__", _wrap_VectorReal___setslice__, METH_VARARGS, NULL}, + { (char *)"VectorReal___delslice__", _wrap_VectorReal___delslice__, METH_VARARGS, NULL}, + { (char *)"VectorReal___delitem__", _wrap_VectorReal___delitem__, METH_VARARGS, NULL}, + { (char *)"VectorReal___getitem__", _wrap_VectorReal___getitem__, METH_VARARGS, NULL}, + { (char *)"VectorReal___setitem__", _wrap_VectorReal___setitem__, METH_VARARGS, NULL}, + { (char *)"VectorReal_append", _wrap_VectorReal_append, METH_VARARGS, NULL}, + { (char *)"VectorReal_empty", _wrap_VectorReal_empty, METH_VARARGS, NULL}, + { (char *)"VectorReal_size", _wrap_VectorReal_size, METH_VARARGS, NULL}, + { (char *)"VectorReal_clear", _wrap_VectorReal_clear, METH_VARARGS, NULL}, + { (char *)"VectorReal_swap", _wrap_VectorReal_swap, METH_VARARGS, NULL}, + { (char *)"VectorReal_get_allocator", _wrap_VectorReal_get_allocator, METH_VARARGS, NULL}, + { (char *)"VectorReal_begin", _wrap_VectorReal_begin, METH_VARARGS, NULL}, + { (char *)"VectorReal_end", _wrap_VectorReal_end, METH_VARARGS, NULL}, + { (char *)"VectorReal_rbegin", _wrap_VectorReal_rbegin, METH_VARARGS, NULL}, + { (char *)"VectorReal_rend", _wrap_VectorReal_rend, METH_VARARGS, NULL}, + { (char *)"VectorReal_pop_back", _wrap_VectorReal_pop_back, METH_VARARGS, NULL}, + { (char *)"VectorReal_erase", _wrap_VectorReal_erase, METH_VARARGS, NULL}, + { (char *)"new_VectorReal", _wrap_new_VectorReal, METH_VARARGS, NULL}, + { (char *)"VectorReal_push_back", _wrap_VectorReal_push_back, METH_VARARGS, NULL}, + { (char *)"VectorReal_front", _wrap_VectorReal_front, METH_VARARGS, NULL}, + { (char *)"VectorReal_back", _wrap_VectorReal_back, METH_VARARGS, NULL}, + { (char *)"VectorReal_assign", _wrap_VectorReal_assign, METH_VARARGS, NULL}, + { (char *)"VectorReal_resize", _wrap_VectorReal_resize, METH_VARARGS, NULL}, + { (char *)"VectorReal_insert", _wrap_VectorReal_insert, METH_VARARGS, NULL}, + { (char *)"VectorReal_reserve", _wrap_VectorReal_reserve, METH_VARARGS, NULL}, + { (char *)"VectorReal_capacity", _wrap_VectorReal_capacity, METH_VARARGS, NULL}, + { (char *)"delete_VectorReal", _wrap_delete_VectorReal, METH_VARARGS, NULL}, + { (char *)"VectorReal_swigregister", VectorReal_swigregister, METH_VARARGS, NULL}, + { (char *)"VectorInt_iterator", _wrap_VectorInt_iterator, METH_VARARGS, NULL}, + { (char *)"VectorInt___nonzero__", _wrap_VectorInt___nonzero__, METH_VARARGS, NULL}, + { (char *)"VectorInt___len__", _wrap_VectorInt___len__, METH_VARARGS, NULL}, + { (char *)"VectorInt_pop", _wrap_VectorInt_pop, METH_VARARGS, NULL}, + { (char *)"VectorInt___getslice__", _wrap_VectorInt___getslice__, METH_VARARGS, NULL}, + { (char *)"VectorInt___setslice__", _wrap_VectorInt___setslice__, METH_VARARGS, NULL}, + { (char *)"VectorInt___delslice__", _wrap_VectorInt___delslice__, METH_VARARGS, NULL}, + { (char *)"VectorInt___delitem__", _wrap_VectorInt___delitem__, METH_VARARGS, NULL}, + { (char *)"VectorInt___getitem__", _wrap_VectorInt___getitem__, METH_VARARGS, NULL}, + { (char *)"VectorInt___setitem__", _wrap_VectorInt___setitem__, METH_VARARGS, NULL}, + { (char *)"VectorInt_append", _wrap_VectorInt_append, METH_VARARGS, NULL}, + { (char *)"VectorInt_empty", _wrap_VectorInt_empty, METH_VARARGS, NULL}, + { (char *)"VectorInt_size", _wrap_VectorInt_size, METH_VARARGS, NULL}, + { (char *)"VectorInt_clear", _wrap_VectorInt_clear, METH_VARARGS, NULL}, + { (char *)"VectorInt_swap", _wrap_VectorInt_swap, METH_VARARGS, NULL}, + { (char *)"VectorInt_get_allocator", _wrap_VectorInt_get_allocator, METH_VARARGS, NULL}, + { (char *)"VectorInt_begin", _wrap_VectorInt_begin, METH_VARARGS, NULL}, + { (char *)"VectorInt_end", _wrap_VectorInt_end, METH_VARARGS, NULL}, + { (char *)"VectorInt_rbegin", _wrap_VectorInt_rbegin, METH_VARARGS, NULL}, + { (char *)"VectorInt_rend", _wrap_VectorInt_rend, METH_VARARGS, NULL}, + { (char *)"VectorInt_pop_back", _wrap_VectorInt_pop_back, METH_VARARGS, NULL}, + { (char *)"VectorInt_erase", _wrap_VectorInt_erase, METH_VARARGS, NULL}, + { (char *)"new_VectorInt", _wrap_new_VectorInt, METH_VARARGS, NULL}, + { (char *)"VectorInt_push_back", _wrap_VectorInt_push_back, METH_VARARGS, NULL}, + { (char *)"VectorInt_front", _wrap_VectorInt_front, METH_VARARGS, NULL}, + { (char *)"VectorInt_back", _wrap_VectorInt_back, METH_VARARGS, NULL}, + { (char *)"VectorInt_assign", _wrap_VectorInt_assign, METH_VARARGS, NULL}, + { (char *)"VectorInt_resize", _wrap_VectorInt_resize, METH_VARARGS, NULL}, + { (char *)"VectorInt_insert", _wrap_VectorInt_insert, METH_VARARGS, NULL}, + { (char *)"VectorInt_reserve", _wrap_VectorInt_reserve, METH_VARARGS, NULL}, + { (char *)"VectorInt_capacity", _wrap_VectorInt_capacity, METH_VARARGS, NULL}, + { (char *)"delete_VectorInt", _wrap_delete_VectorInt, METH_VARARGS, NULL}, + { (char *)"VectorInt_swigregister", VectorInt_swigregister, METH_VARARGS, NULL}, + { (char *)"get_temp_name", _wrap_get_temp_name, METH_VARARGS, NULL}, + { (char *)"fatal_error", _wrap_fatal_error, METH_VARARGS, NULL}, + { (char *)"prod_scalaire", _wrap_prod_scalaire, METH_VARARGS, NULL}, + { (char *)"prod_vectoriel", _wrap_prod_vectoriel, METH_VARARGS, NULL}, + { (char *)"prod_mixte", _wrap_prod_mixte, METH_VARARGS, NULL}, + { (char *)"deg2radians", _wrap_deg2radians, METH_VARARGS, NULL}, + { (char *)"rad2degres", _wrap_rad2degres, METH_VARARGS, NULL}, + { (char *)"calc_norme", _wrap_calc_norme, METH_VARARGS, NULL}, + { (char *)"calc_distance", _wrap_calc_distance, METH_VARARGS, NULL}, + { (char *)"calc_vecteur", _wrap_calc_vecteur, METH_VARARGS, NULL}, + { (char *)"copy_vecteur", _wrap_copy_vecteur, METH_VARARGS, NULL}, + { (char *)"calc_milieu", _wrap_calc_milieu, METH_VARARGS, NULL}, + { (char *)"normer_vecteur", _wrap_normer_vecteur, METH_VARARGS, NULL}, + { (char *)"carre", _wrap_carre, METH_VARARGS, NULL}, + { (char *)"same_coords", _wrap_same_coords, METH_VARARGS, NULL}, + { (char *)"requals", _wrap_requals, METH_VARARGS, NULL}, + { (char *)"on_debug", _wrap_on_debug, METH_VARARGS, NULL}, + { (char *)"in_test", _wrap_in_test, METH_VARARGS, NULL}, + { (char *)"niv_debug", _wrap_niv_debug, METH_VARARGS, NULL}, + { (char *)"set_minus", _wrap_set_minus, METH_VARARGS, NULL}, + { (char *)"special_option", _wrap_special_option, METH_VARARGS, NULL}, + { (char *)"set_special_option", _wrap_set_special_option, METH_VARARGS, NULL}, + { (char *)"sizeof_file", _wrap_sizeof_file, METH_VARARGS, NULL}, + { (char *)"read_file", _wrap_read_file, METH_VARARGS, NULL}, + { (char *)"get_time", _wrap_get_time, METH_VARARGS, NULL}, + { (char *)"EltBase_countHexa", _wrap_EltBase_countHexa, METH_VARARGS, NULL}, + { (char *)"EltBase_countQuad", _wrap_EltBase_countQuad, METH_VARARGS, NULL}, + { (char *)"EltBase_countEdge", _wrap_EltBase_countEdge, METH_VARARGS, NULL}, + { (char *)"EltBase_countVertex", _wrap_EltBase_countVertex, METH_VARARGS, NULL}, + { (char *)"EltBase_setError", _wrap_EltBase_setError, METH_VARARGS, NULL}, + { (char *)"EltBase_getError", _wrap_EltBase_getError, METH_VARARGS, NULL}, + { (char *)"EltBase_isValid", _wrap_EltBase_isValid, METH_VARARGS, NULL}, + { (char *)"EltBase_isBad", _wrap_EltBase_isBad, METH_VARARGS, NULL}, + { (char *)"EltBase_duplicate", _wrap_EltBase_duplicate, METH_VARARGS, NULL}, + { (char *)"EltBase_clearAssociation", _wrap_EltBase_clearAssociation, METH_VARARGS, NULL}, + { (char *)"EltBase_replaceEdge", _wrap_EltBase_replaceEdge, METH_VARARGS, NULL}, + { (char *)"EltBase_replaceVertex", _wrap_EltBase_replaceVertex, METH_VARARGS, NULL}, + { (char *)"new_EltBase", _wrap_new_EltBase, METH_VARARGS, NULL}, + { (char *)"delete_EltBase", _wrap_delete_EltBase, METH_VARARGS, NULL}, + { (char *)"EltBase_remove", _wrap_EltBase_remove, METH_VARARGS, NULL}, + { (char *)"EltBase_suppress", _wrap_EltBase_suppress, METH_VARARGS, NULL}, + { (char *)"EltBase_dump", _wrap_EltBase_dump, METH_VARARGS, NULL}, + { (char *)"EltBase_saveXml", _wrap_EltBase_saveXml, METH_VARARGS, NULL}, + { (char *)"EltBase_majReferences", _wrap_EltBase_majReferences, METH_VARARGS, NULL}, + { (char *)"EltBase_makeVarName", _wrap_EltBase_makeVarName, METH_VARARGS, NULL}, + { (char *)"EltBase_makeName", _wrap_EltBase_makeName, METH_VARARGS, NULL}, + { (char *)"EltBase_next", _wrap_EltBase_next, METH_VARARGS, NULL}, + { (char *)"EltBase_setNext", _wrap_EltBase_setNext, METH_VARARGS, NULL}, + { (char *)"EltBase_getId", _wrap_EltBase_getId, METH_VARARGS, NULL}, + { (char *)"EltBase_setId", _wrap_EltBase_setId, METH_VARARGS, NULL}, + { (char *)"EltBase_dad", _wrap_EltBase_dad, METH_VARARGS, NULL}, + { (char *)"EltBase_getType", _wrap_EltBase_getType, METH_VARARGS, NULL}, + { (char *)"EltBase_isHere", _wrap_EltBase_isHere, METH_VARARGS, NULL}, + { (char *)"EltBase_isDeleted", _wrap_EltBase_isDeleted, METH_VARARGS, NULL}, + { (char *)"EltBase_razReferences", _wrap_EltBase_razReferences, METH_VARARGS, NULL}, + { (char *)"EltBase_addParent", _wrap_EltBase_addParent, METH_VARARGS, NULL}, + { (char *)"EltBase_getNbrParents", _wrap_EltBase_getNbrParents, METH_VARARGS, NULL}, + { (char *)"EltBase_hasParents", _wrap_EltBase_hasParents, METH_VARARGS, NULL}, + { (char *)"EltBase_getFather", _wrap_EltBase_getFather, METH_VARARGS, NULL}, + { (char *)"EltBase_getMark", _wrap_EltBase_getMark, METH_VARARGS, NULL}, + { (char *)"EltBase_setMark", _wrap_EltBase_setMark, METH_VARARGS, NULL}, + { (char *)"EltBase_printName", _wrap_EltBase_printName, METH_VARARGS, NULL}, + { (char *)"EltBase_dumpRef", _wrap_EltBase_dumpRef, METH_VARARGS, NULL}, + { (char *)"EltBase_getName", _wrap_EltBase_getName, METH_VARARGS, NULL}, + { (char *)"EltBase_setName", _wrap_EltBase_setName, METH_VARARGS, NULL}, + { (char *)"EltBase_debug", _wrap_EltBase_debug, METH_VARARGS, NULL}, + { (char *)"EltBase_isAssociated", _wrap_EltBase_isAssociated, METH_VARARGS, NULL}, + { (char *)"EltBase_getNextName", _wrap_EltBase_getNextName, METH_VARARGS, NULL}, + { (char *)"EltBase_swigregister", EltBase_swigregister, METH_VARARGS, NULL}, + { (char *)"Vertex_getX", _wrap_Vertex_getX, METH_VARARGS, NULL}, + { (char *)"Vertex_getY", _wrap_Vertex_getY, METH_VARARGS, NULL}, + { (char *)"Vertex_getZ", _wrap_Vertex_getZ, METH_VARARGS, NULL}, + { (char *)"Vertex_setX", _wrap_Vertex_setX, METH_VARARGS, NULL}, + { (char *)"Vertex_setY", _wrap_Vertex_setY, METH_VARARGS, NULL}, + { (char *)"Vertex_setZ", _wrap_Vertex_setZ, METH_VARARGS, NULL}, + { (char *)"Vertex_getAssoX", _wrap_Vertex_getAssoX, METH_VARARGS, NULL}, + { (char *)"Vertex_getAssoY", _wrap_Vertex_getAssoY, METH_VARARGS, NULL}, + { (char *)"Vertex_getAssoZ", _wrap_Vertex_getAssoZ, METH_VARARGS, NULL}, + { (char *)"Vertex_setAssociation", _wrap_Vertex_setAssociation, METH_VARARGS, NULL}, + { (char *)"Vertex_clearAssociation", _wrap_Vertex_clearAssociation, METH_VARARGS, NULL}, + { (char *)"Vertex_setColor", _wrap_Vertex_setColor, METH_VARARGS, NULL}, + { (char *)"new_Vertex", _wrap_new_Vertex, METH_VARARGS, NULL}, + { (char *)"delete_Vertex", _wrap_delete_Vertex, METH_VARARGS, NULL}, + { (char *)"Vertex_swigregister", Vertex_swigregister, METH_VARARGS, NULL}, + { (char *)"Edge_getVertex", _wrap_Edge_getVertex, METH_VARARGS, NULL}, + { (char *)"Edge_addAssociation", _wrap_Edge_addAssociation, METH_VARARGS, NULL}, + { (char *)"Edge_clearAssociation", _wrap_Edge_clearAssociation, METH_VARARGS, NULL}, + { (char *)"Edge_setColor", _wrap_Edge_setColor, METH_VARARGS, NULL}, + { (char *)"Edge_getWay", _wrap_Edge_getWay, METH_VARARGS, NULL}, + { (char *)"new_Edge", _wrap_new_Edge, METH_VARARGS, NULL}, + { (char *)"delete_Edge", _wrap_delete_Edge, METH_VARARGS, NULL}, + { (char *)"Edge_swigregister", Edge_swigregister, METH_VARARGS, NULL}, + { (char *)"Quad_getEdge", _wrap_Quad_getEdge, METH_VARARGS, NULL}, + { (char *)"Quad_getVertex", _wrap_Quad_getVertex, METH_VARARGS, NULL}, + { (char *)"Quad_addAssociation", _wrap_Quad_addAssociation, METH_VARARGS, NULL}, + { (char *)"Quad_clearAssociation", _wrap_Quad_clearAssociation, METH_VARARGS, NULL}, + { (char *)"Quad_setColor", _wrap_Quad_setColor, METH_VARARGS, NULL}, + { (char *)"new_Quad", _wrap_new_Quad, METH_VARARGS, NULL}, + { (char *)"delete_Quad", _wrap_delete_Quad, METH_VARARGS, NULL}, + { (char *)"Quad_swigregister", Quad_swigregister, METH_VARARGS, NULL}, + { (char *)"Hexa_getQuad", _wrap_Hexa_getQuad, METH_VARARGS, NULL}, + { (char *)"Hexa_getEdge", _wrap_Hexa_getEdge, METH_VARARGS, NULL}, + { (char *)"Hexa_getVertex", _wrap_Hexa_getVertex, METH_VARARGS, NULL}, + { (char *)"Hexa_setColor", _wrap_Hexa_setColor, METH_VARARGS, NULL}, + { (char *)"new_Hexa", _wrap_new_Hexa, METH_VARARGS, NULL}, + { (char *)"delete_Hexa", _wrap_delete_Hexa, METH_VARARGS, NULL}, + { (char *)"Hexa_swigregister", Hexa_swigregister, METH_VARARGS, NULL}, + { (char *)"Vector_getDx", _wrap_Vector_getDx, METH_VARARGS, NULL}, + { (char *)"Vector_getDy", _wrap_Vector_getDy, METH_VARARGS, NULL}, + { (char *)"Vector_getDz", _wrap_Vector_getDz, METH_VARARGS, NULL}, + { (char *)"Vector_getNorm", _wrap_Vector_getNorm, METH_VARARGS, NULL}, + { (char *)"Vector_getAngleX", _wrap_Vector_getAngleX, METH_VARARGS, NULL}, + { (char *)"new_Vector", _wrap_new_Vector, METH_VARARGS, NULL}, + { (char *)"delete_Vector", _wrap_delete_Vector, METH_VARARGS, NULL}, + { (char *)"Vector_swigregister", Vector_swigregister, METH_VARARGS, NULL}, + { (char *)"new_Document", _wrap_new_Document, METH_VARARGS, NULL}, + { (char *)"Document_dump", _wrap_Document_dump, METH_VARARGS, NULL}, + { (char *)"Document_setName", _wrap_Document_setName, METH_VARARGS, NULL}, + { (char *)"Document_setLevel", _wrap_Document_setLevel, METH_VARARGS, NULL}, + { (char *)"Document_save", _wrap_Document_save, METH_VARARGS, NULL}, + { (char *)"Document_saveVtk", _wrap_Document_saveVtk, METH_VARARGS, NULL}, + { (char *)"Document_purge", _wrap_Document_purge, METH_VARARGS, NULL}, + { (char *)"Document_setTolerance", _wrap_Document_setTolerance, METH_VARARGS, NULL}, + { (char *)"Document_getTolerance", _wrap_Document_getTolerance, METH_VARARGS, NULL}, + { (char *)"Document_addVertex", _wrap_Document_addVertex, METH_VARARGS, NULL}, + { (char *)"Document_addEdge", _wrap_Document_addEdge, METH_VARARGS, NULL}, + { (char *)"Document_addEdgeVector", _wrap_Document_addEdgeVector, METH_VARARGS, NULL}, + { (char *)"Document_addQuad", _wrap_Document_addQuad, METH_VARARGS, NULL}, + { (char *)"Document_addQuadVertices", _wrap_Document_addQuadVertices, METH_VARARGS, NULL}, + { (char *)"Document_addHexa", _wrap_Document_addHexa, METH_VARARGS, NULL}, + { (char *)"Document_addHexaVertices", _wrap_Document_addHexaVertices, METH_VARARGS, NULL}, + { (char *)"Document_addHexa2Quads", _wrap_Document_addHexa2Quads, METH_VARARGS, NULL}, + { (char *)"Document_addHexa3Quads", _wrap_Document_addHexa3Quads, METH_VARARGS, NULL}, + { (char *)"Document_addHexa4Quads", _wrap_Document_addHexa4Quads, METH_VARARGS, NULL}, + { (char *)"Document_addHexa5Quads", _wrap_Document_addHexa5Quads, METH_VARARGS, NULL}, + { (char *)"Document_addVector", _wrap_Document_addVector, METH_VARARGS, NULL}, + { (char *)"Document_addVectorVertices", _wrap_Document_addVectorVertices, METH_VARARGS, NULL}, + { (char *)"Document_addLaws", _wrap_Document_addLaws, METH_VARARGS, NULL}, + { (char *)"Document_addHexaGroup", _wrap_Document_addHexaGroup, METH_VARARGS, NULL}, + { (char *)"Document_addQuadGroup", _wrap_Document_addQuadGroup, METH_VARARGS, NULL}, + { (char *)"Document_addQuadNodeGroup", _wrap_Document_addQuadNodeGroup, METH_VARARGS, NULL}, + { (char *)"Document_addHexaNodeGroup", _wrap_Document_addHexaNodeGroup, METH_VARARGS, NULL}, + { (char *)"Document_addEdgeGroup", _wrap_Document_addEdgeGroup, METH_VARARGS, NULL}, + { (char *)"Document_addEdgeNodeGroup", _wrap_Document_addEdgeNodeGroup, METH_VARARGS, NULL}, + { (char *)"Document_addVertexNodeGroup", _wrap_Document_addVertexNodeGroup, METH_VARARGS, NULL}, + { (char *)"Document_makeTranslation", _wrap_Document_makeTranslation, METH_VARARGS, NULL}, + { (char *)"Document_makeScale", _wrap_Document_makeScale, METH_VARARGS, NULL}, + { (char *)"Document_makeRotation", _wrap_Document_makeRotation, METH_VARARGS, NULL}, + { (char *)"Document_makeSymmetryPoint", _wrap_Document_makeSymmetryPoint, METH_VARARGS, NULL}, + { (char *)"Document_makeSymmetryLine", _wrap_Document_makeSymmetryLine, METH_VARARGS, NULL}, + { (char *)"Document_makeSymmetryPlane", _wrap_Document_makeSymmetryPlane, METH_VARARGS, NULL}, + { (char *)"Document_performTranslation", _wrap_Document_performTranslation, METH_VARARGS, NULL}, + { (char *)"Document_performScale", _wrap_Document_performScale, METH_VARARGS, NULL}, + { (char *)"Document_performRotation", _wrap_Document_performRotation, METH_VARARGS, NULL}, + { (char *)"Document_performSymmetryPoint", _wrap_Document_performSymmetryPoint, METH_VARARGS, NULL}, + { (char *)"Document_performSymmetryLine", _wrap_Document_performSymmetryLine, METH_VARARGS, NULL}, + { (char *)"Document_performSymmetryPlane", _wrap_Document_performSymmetryPlane, METH_VARARGS, NULL}, + { (char *)"Document_disconnectQuad", _wrap_Document_disconnectQuad, METH_VARARGS, NULL}, + { (char *)"Document_disconnectEdge", _wrap_Document_disconnectEdge, METH_VARARGS, NULL}, + { (char *)"Document_disconnectVertex", _wrap_Document_disconnectVertex, METH_VARARGS, NULL}, + { (char *)"Document_disconnectEdges", _wrap_Document_disconnectEdges, METH_VARARGS, NULL}, + { (char *)"Document_replace", _wrap_Document_replace, METH_VARARGS, NULL}, + { (char *)"Document_mergeVertices", _wrap_Document_mergeVertices, METH_VARARGS, NULL}, + { (char *)"Document_mergeEdges", _wrap_Document_mergeEdges, METH_VARARGS, NULL}, + { (char *)"Document_mergeQuads", _wrap_Document_mergeQuads, METH_VARARGS, NULL}, + { (char *)"Document_clearAssociation", _wrap_Document_clearAssociation, METH_VARARGS, NULL}, + { (char *)"Document_associateOpenedLine", _wrap_Document_associateOpenedLine, METH_VARARGS, NULL}, + { (char *)"Document_associateClosedLine", _wrap_Document_associateClosedLine, METH_VARARGS, NULL}, + { (char *)"Document_countHexa", _wrap_Document_countHexa, METH_VARARGS, NULL}, + { (char *)"Document_countQuad", _wrap_Document_countQuad, METH_VARARGS, NULL}, + { (char *)"Document_countEdge", _wrap_Document_countEdge, METH_VARARGS, NULL}, + { (char *)"Document_countVertex", _wrap_Document_countVertex, METH_VARARGS, NULL}, + { (char *)"Document_countVector", _wrap_Document_countVector, METH_VARARGS, NULL}, + { (char *)"Document_countGroup", _wrap_Document_countGroup, METH_VARARGS, NULL}, + { (char *)"Document_countLaw", _wrap_Document_countLaw, METH_VARARGS, NULL}, + { (char *)"Document_countPropagation", _wrap_Document_countPropagation, METH_VARARGS, NULL}, + { (char *)"Document_countShape", _wrap_Document_countShape, METH_VARARGS, NULL}, + { (char *)"Document_countUsedHexa", _wrap_Document_countUsedHexa, METH_VARARGS, NULL}, + { (char *)"Document_countUsedQuad", _wrap_Document_countUsedQuad, METH_VARARGS, NULL}, + { (char *)"Document_countUsedEdge", _wrap_Document_countUsedEdge, METH_VARARGS, NULL}, + { (char *)"Document_countUsedVertex", _wrap_Document_countUsedVertex, METH_VARARGS, NULL}, + { (char *)"Document_countCylinder", _wrap_Document_countCylinder, METH_VARARGS, NULL}, + { (char *)"Document_countPipe", _wrap_Document_countPipe, METH_VARARGS, NULL}, + { (char *)"Document_getHexa", _wrap_Document_getHexa, METH_VARARGS, NULL}, + { (char *)"Document_getQuad", _wrap_Document_getQuad, METH_VARARGS, NULL}, + { (char *)"Document_getEdge", _wrap_Document_getEdge, METH_VARARGS, NULL}, + { (char *)"Document_getVertex", _wrap_Document_getVertex, METH_VARARGS, NULL}, + { (char *)"Document_getUsedHexa", _wrap_Document_getUsedHexa, METH_VARARGS, NULL}, + { (char *)"Document_getUsedQuad", _wrap_Document_getUsedQuad, METH_VARARGS, NULL}, + { (char *)"Document_getUsedEdge", _wrap_Document_getUsedEdge, METH_VARARGS, NULL}, + { (char *)"Document_getUsedVertex", _wrap_Document_getUsedVertex, METH_VARARGS, NULL}, + { (char *)"Document_getVector", _wrap_Document_getVector, METH_VARARGS, NULL}, + { (char *)"Document_getCylinder", _wrap_Document_getCylinder, METH_VARARGS, NULL}, + { (char *)"Document_getPipe", _wrap_Document_getPipe, METH_VARARGS, NULL}, + { (char *)"Document_getShape", _wrap_Document_getShape, METH_VARARGS, NULL}, + { (char *)"Document_getGroup", _wrap_Document_getGroup, METH_VARARGS, NULL}, + { (char *)"Document_getLaw", _wrap_Document_getLaw, METH_VARARGS, NULL}, + { (char *)"Document_getPropagation", _wrap_Document_getPropagation, METH_VARARGS, NULL}, + { (char *)"Document_findEdge", _wrap_Document_findEdge, METH_VARARGS, NULL}, + { (char *)"Document_findQuad", _wrap_Document_findQuad, METH_VARARGS, NULL}, + { (char *)"Document_findHexa", _wrap_Document_findHexa, METH_VARARGS, NULL}, + { (char *)"Document_findGroup", _wrap_Document_findGroup, METH_VARARGS, NULL}, + { (char *)"Document_findLaw", _wrap_Document_findLaw, METH_VARARGS, NULL}, + { (char *)"Document_findPropagation", _wrap_Document_findPropagation, METH_VARARGS, NULL}, + { (char *)"Document_removeHexa", _wrap_Document_removeHexa, METH_VARARGS, NULL}, + { (char *)"Document_removeQuad", _wrap_Document_removeQuad, METH_VARARGS, NULL}, + { (char *)"Document_removeConnectedHexa", _wrap_Document_removeConnectedHexa, METH_VARARGS, NULL}, + { (char *)"Document_removeElements", _wrap_Document_removeElements, METH_VARARGS, NULL}, + { (char *)"Document_removeGroup", _wrap_Document_removeGroup, METH_VARARGS, NULL}, + { (char *)"Document_removeLaw", _wrap_Document_removeLaw, METH_VARARGS, NULL}, + { (char *)"Document_makeCartesianTop", _wrap_Document_makeCartesianTop, METH_VARARGS, NULL}, + { (char *)"Document_makeCartesianUni", _wrap_Document_makeCartesianUni, METH_VARARGS, NULL}, + { (char *)"Document_makeCylinderTop", _wrap_Document_makeCylinderTop, METH_VARARGS, NULL}, + { (char *)"Document_makeCylinderUni", _wrap_Document_makeCylinderUni, METH_VARARGS, NULL}, + { (char *)"Document_makeCylinder", _wrap_Document_makeCylinder, METH_VARARGS, NULL}, + { (char *)"Document_makePipeTop", _wrap_Document_makePipeTop, METH_VARARGS, NULL}, + { (char *)"Document_makePipeUni", _wrap_Document_makePipeUni, METH_VARARGS, NULL}, + { (char *)"Document_makePipe", _wrap_Document_makePipe, METH_VARARGS, NULL}, + { (char *)"Document_makeSphericalTop", _wrap_Document_makeSphericalTop, METH_VARARGS, NULL}, + { (char *)"Document_makeSphericalUni", _wrap_Document_makeSphericalUni, METH_VARARGS, NULL}, + { (char *)"Document_makeSpherical", _wrap_Document_makeSpherical, METH_VARARGS, NULL}, + { (char *)"Document_makeSphereTop", _wrap_Document_makeSphereTop, METH_VARARGS, NULL}, + { (char *)"Document_makeSphereUni", _wrap_Document_makeSphereUni, METH_VARARGS, NULL}, + { (char *)"Document_makeSphere", _wrap_Document_makeSphere, METH_VARARGS, NULL}, + { (char *)"Document_makeRindTop", _wrap_Document_makeRindTop, METH_VARARGS, NULL}, + { (char *)"Document_makeRindUni", _wrap_Document_makeRindUni, METH_VARARGS, NULL}, + { (char *)"Document_makeRind", _wrap_Document_makeRind, METH_VARARGS, NULL}, + { (char *)"Document_makeCylinders", _wrap_Document_makeCylinders, METH_VARARGS, NULL}, + { (char *)"Document_makePipes", _wrap_Document_makePipes, METH_VARARGS, NULL}, + { (char *)"Document_extrudeQuadTop", _wrap_Document_extrudeQuadTop, METH_VARARGS, NULL}, + { (char *)"Document_extrudeQuadUni", _wrap_Document_extrudeQuadUni, METH_VARARGS, NULL}, + { (char *)"Document_extrudeQuad", _wrap_Document_extrudeQuad, METH_VARARGS, NULL}, + { (char *)"Document_extrudeQuadsTop", _wrap_Document_extrudeQuadsTop, METH_VARARGS, NULL}, + { (char *)"Document_extrudeQuadsUni", _wrap_Document_extrudeQuadsUni, METH_VARARGS, NULL}, + { (char *)"Document_extrudeQuads", _wrap_Document_extrudeQuads, METH_VARARGS, NULL}, + { (char *)"Document_revolutionQuadUni", _wrap_Document_revolutionQuadUni, METH_VARARGS, NULL}, + { (char *)"Document_revolutionQuad", _wrap_Document_revolutionQuad, METH_VARARGS, NULL}, + { (char *)"Document_revolutionQuadsUni", _wrap_Document_revolutionQuadsUni, METH_VARARGS, NULL}, + { (char *)"Document_revolutionQuads", _wrap_Document_revolutionQuads, METH_VARARGS, NULL}, + { (char *)"Document_joinQuadUni", _wrap_Document_joinQuadUni, METH_VARARGS, NULL}, + { (char *)"Document_joinQuadsUni", _wrap_Document_joinQuadsUni, METH_VARARGS, NULL}, + { (char *)"Document_joinQuad", _wrap_Document_joinQuad, METH_VARARGS, NULL}, + { (char *)"Document_joinQuads", _wrap_Document_joinQuads, METH_VARARGS, NULL}, + { (char *)"Document_cutUni", _wrap_Document_cutUni, METH_VARARGS, NULL}, + { (char *)"Document_cut", _wrap_Document_cut, METH_VARARGS, NULL}, + { (char *)"Document_addGroup", _wrap_Document_addGroup, METH_VARARGS, NULL}, + { (char *)"Document_isSaved", _wrap_Document_isSaved, METH_VARARGS, NULL}, + { (char *)"Document_appendXml", _wrap_Document_appendXml, METH_VARARGS, NULL}, + { (char *)"Document_getXml", _wrap_Document_getXml, METH_VARARGS, NULL}, + { (char *)"Document_getLevel", _wrap_Document_getLevel, METH_VARARGS, NULL}, + { (char *)"Document_makeCartesian", _wrap_Document_makeCartesian, METH_VARARGS, NULL}, + { (char *)"Document_findVertex", _wrap_Document_findVertex, METH_VARARGS, NULL}, + { (char *)"Document_closeQuads", _wrap_Document_closeQuads, METH_VARARGS, NULL}, + { (char *)"Document_addLaw", _wrap_Document_addLaw, METH_VARARGS, NULL}, + { (char *)"Document_checkAssociations", _wrap_Document_checkAssociations, METH_VARARGS, NULL}, + { (char *)"Document_addShape", _wrap_Document_addShape, METH_VARARGS, NULL}, + { (char *)"delete_Document", _wrap_delete_Document, METH_VARARGS, NULL}, + { (char *)"Document_swigregister", Document_swigregister, METH_VARARGS, NULL}, + { (char *)"Propagation_getEdges", _wrap_Propagation_getEdges, METH_VARARGS, NULL}, + { (char *)"Propagation_getLaw", _wrap_Propagation_getLaw, METH_VARARGS, NULL}, + { (char *)"Propagation_getWay", _wrap_Propagation_getWay, METH_VARARGS, NULL}, + { (char *)"Propagation_setWay", _wrap_Propagation_setWay, METH_VARARGS, NULL}, + { (char *)"Propagation_setLaw", _wrap_Propagation_setLaw, METH_VARARGS, NULL}, + { (char *)"new_Propagation", _wrap_new_Propagation, METH_VARARGS, NULL}, + { (char *)"Propagation_saveXml", _wrap_Propagation_saveXml, METH_VARARGS, NULL}, + { (char *)"Propagation_addEdge", _wrap_Propagation_addEdge, METH_VARARGS, NULL}, + { (char *)"Propagation_majLaw", _wrap_Propagation_majLaw, METH_VARARGS, NULL}, + { (char *)"delete_Propagation", _wrap_delete_Propagation, METH_VARARGS, NULL}, + { (char *)"Propagation_swigregister", Propagation_swigregister, METH_VARARGS, NULL}, + { (char *)"hex_instance", _wrap_hex_instance, METH_VARARGS, NULL}, + { (char *)"Hex_getInstance", _wrap_Hex_getInstance, METH_VARARGS, NULL}, + { (char *)"Hex_countDocument", _wrap_Hex_countDocument, METH_VARARGS, NULL}, + { (char *)"Hex_getDocument", _wrap_Hex_getDocument, METH_VARARGS, NULL}, + { (char *)"Hex_removeDocument", _wrap_Hex_removeDocument, METH_VARARGS, NULL}, + { (char *)"Hex_addDocument", _wrap_Hex_addDocument, METH_VARARGS, NULL}, + { (char *)"Hex_loadDocument", _wrap_Hex_loadDocument, METH_VARARGS, NULL}, + { (char *)"Hex_findDocument", _wrap_Hex_findDocument, METH_VARARGS, NULL}, + { (char *)"Hex_what", _wrap_Hex_what, METH_VARARGS, NULL}, + { (char *)"Hex_sizeofMessage", _wrap_Hex_sizeofMessage, METH_VARARGS, NULL}, + { (char *)"Hex_getMessageLine", _wrap_Hex_getMessageLine, METH_VARARGS, NULL}, + { (char *)"new_Hex", _wrap_new_Hex, METH_VARARGS, NULL}, + { (char *)"delete_Hex", _wrap_delete_Hex, METH_VARARGS, NULL}, + { (char *)"Hex_swigregister", Hex_swigregister, METH_VARARGS, NULL}, + { (char *)"what", _wrap_what, METH_VARARGS, NULL}, + { (char *)"Elements_getHexa", _wrap_Elements_getHexa, METH_VARARGS, NULL}, + { (char *)"Elements_getQuad", _wrap_Elements_getQuad, METH_VARARGS, NULL}, + { (char *)"Elements_getEdge", _wrap_Elements_getEdge, METH_VARARGS, NULL}, + { (char *)"Elements_getVertex", _wrap_Elements_getVertex, METH_VARARGS, NULL}, + { (char *)"Elements_getHexaIJK", _wrap_Elements_getHexaIJK, METH_VARARGS, NULL}, + { (char *)"Elements_getQuadIJ", _wrap_Elements_getQuadIJ, METH_VARARGS, NULL}, + { (char *)"Elements_getQuadJK", _wrap_Elements_getQuadJK, METH_VARARGS, NULL}, + { (char *)"Elements_getQuadIK", _wrap_Elements_getQuadIK, METH_VARARGS, NULL}, + { (char *)"Elements_getEdgeI", _wrap_Elements_getEdgeI, METH_VARARGS, NULL}, + { (char *)"Elements_getEdgeJ", _wrap_Elements_getEdgeJ, METH_VARARGS, NULL}, + { (char *)"Elements_getEdgeK", _wrap_Elements_getEdgeK, METH_VARARGS, NULL}, + { (char *)"Elements_getVertexIJK", _wrap_Elements_getVertexIJK, METH_VARARGS, NULL}, + { (char *)"Elements_countHexa", _wrap_Elements_countHexa, METH_VARARGS, NULL}, + { (char *)"Elements_countQuad", _wrap_Elements_countQuad, METH_VARARGS, NULL}, + { (char *)"Elements_countEdge", _wrap_Elements_countEdge, METH_VARARGS, NULL}, + { (char *)"Elements_countVertex", _wrap_Elements_countVertex, METH_VARARGS, NULL}, + { (char *)"Elements_nearestVertex", _wrap_Elements_nearestVertex, METH_VARARGS, NULL}, + { (char *)"Elements_findVertex", _wrap_Elements_findVertex, METH_VARARGS, NULL}, + { (char *)"Elements_clearAssociation", _wrap_Elements_clearAssociation, METH_VARARGS, NULL}, + { (char *)"Elements_saveVtk", _wrap_Elements_saveVtk, METH_VARARGS, NULL}, + { (char *)"new_Elements", _wrap_new_Elements, METH_VARARGS, NULL}, + { (char *)"delete_Elements", _wrap_delete_Elements, METH_VARARGS, NULL}, + { (char *)"Elements_swigregister", Elements_swigregister, METH_VARARGS, NULL}, + { (char *)"new_CrossElements", _wrap_new_CrossElements, METH_VARARGS, NULL}, + { (char *)"CrossElements_getHexaIJK", _wrap_CrossElements_getHexaIJK, METH_VARARGS, NULL}, + { (char *)"CrossElements_getQuadIJ", _wrap_CrossElements_getQuadIJ, METH_VARARGS, NULL}, + { (char *)"CrossElements_getQuadJK", _wrap_CrossElements_getQuadJK, METH_VARARGS, NULL}, + { (char *)"CrossElements_getQuadIK", _wrap_CrossElements_getQuadIK, METH_VARARGS, NULL}, + { (char *)"CrossElements_getEdgeI", _wrap_CrossElements_getEdgeI, METH_VARARGS, NULL}, + { (char *)"CrossElements_getEdgeJ", _wrap_CrossElements_getEdgeJ, METH_VARARGS, NULL}, + { (char *)"CrossElements_getEdgeK", _wrap_CrossElements_getEdgeK, METH_VARARGS, NULL}, + { (char *)"CrossElements_getVertexIJK", _wrap_CrossElements_getVertexIJK, METH_VARARGS, NULL}, + { (char *)"delete_CrossElements", _wrap_delete_CrossElements, METH_VARARGS, NULL}, + { (char *)"CrossElements_swigregister", CrossElements_swigregister, METH_VARARGS, NULL}, + { (char *)"new_BiCylinder", _wrap_new_BiCylinder, METH_VARARGS, NULL}, + { (char *)"BiCylinder_getHexaIJK", _wrap_BiCylinder_getHexaIJK, METH_VARARGS, NULL}, + { (char *)"BiCylinder_getQuadIJ", _wrap_BiCylinder_getQuadIJ, METH_VARARGS, NULL}, + { (char *)"BiCylinder_getQuadJK", _wrap_BiCylinder_getQuadJK, METH_VARARGS, NULL}, + { (char *)"BiCylinder_getQuadIK", _wrap_BiCylinder_getQuadIK, METH_VARARGS, NULL}, + { (char *)"BiCylinder_getEdgeI", _wrap_BiCylinder_getEdgeI, METH_VARARGS, NULL}, + { (char *)"BiCylinder_getEdgeJ", _wrap_BiCylinder_getEdgeJ, METH_VARARGS, NULL}, + { (char *)"BiCylinder_getEdgeK", _wrap_BiCylinder_getEdgeK, METH_VARARGS, NULL}, + { (char *)"BiCylinder_getVertexIJK", _wrap_BiCylinder_getVertexIJK, METH_VARARGS, NULL}, + { (char *)"delete_BiCylinder", _wrap_delete_BiCylinder, METH_VARARGS, NULL}, + { (char *)"BiCylinder_swigregister", BiCylinder_swigregister, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ + +static void *_p_Hex__VectorTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) ((Hex::Vector *) x)); +} +static void *_p_Hex__PropagationTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) ((Hex::Propagation *) x)); +} +static void *_p_Hex__VertexTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) ((Hex::Vertex *) x)); +} +static void *_p_Hex__HexaTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) ((Hex::Hexa *) x)); +} +static void *_p_Hex__EdgeTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) ((Hex::Edge *) x)); +} +static void *_p_Hex__QuadTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) ((Hex::Quad *) x)); +} +static void *_p_Hex__ElementsTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) ((Hex::Elements *) x)); +} +static void *_p_Hex__CrossElementsTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) (Hex::Elements *) ((Hex::CrossElements *) x)); +} +static void *_p_Hex__DocumentTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) ((Hex::Document *) x)); +} +static void *_p_Hex__BiCylinderTo_p_Hex__EltBase(void *x) { + return (void *)((Hex::EltBase *) (Hex::Elements *) ((Hex::BiCylinder *) x)); +} +static void *_p_Hex__CrossElementsTo_p_Hex__Elements(void *x) { + return (void *)((Hex::Elements *) ((Hex::CrossElements *) x)); +} +static void *_p_Hex__BiCylinderTo_p_Hex__Elements(void *x) { + return (void *)((Hex::Elements *) ((Hex::BiCylinder *) x)); +} +static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *|pfile", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__BiCylinder = {"_p_Hex__BiCylinder", "Hex::BiCylinder *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__CrossElements = {"_p_Hex__CrossElements", "Hex::CrossElements *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Cylinder = {"_p_Hex__Cylinder", "Hex::Cylinder *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Document = {"_p_Hex__Document", "Hex::Document *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Edge = {"_p_Hex__Edge", "Hex::Edge *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Elements = {"_p_Hex__Elements", "Hex::Elements *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__EltBase = {"_p_Hex__EltBase", "Hex::EltBase *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Group = {"_p_Hex__Group", "Hex::Group *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Hex = {"_p_Hex__Hex", "Hex::Hex *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Hex__EltBase = {"_p_Hex__Hex__EltBase", "Hex::EltBase *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Hexa = {"_p_Hex__Hexa", "Hex::Hexa *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Law = {"_p_Hex__Law", "Hex::Law *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__NewShape = {"_p_Hex__NewShape", "Hex::NewShape *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Pipe = {"_p_Hex__Pipe", "Hex::Pipe *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Propagation = {"_p_Hex__Propagation", "Hex::Propagation *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Quad = {"_p_Hex__Quad", "Hex::Quad *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Shape = {"_p_Hex__Shape", "Hex::Shape *|Hex::OldShape *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Vector = {"_p_Hex__Vector", "Hex::Vector *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__Vertex = {"_p_Hex__Vertex", "Hex::Vertex *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_Hex__XmlWriter = {"_p_Hex__XmlWriter", "Hex::XmlWriter *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_a_Hex__DIM3__double = {"_p_a_Hex__DIM3__double", "double (*)[Hex::DIM3]|Hex::Real3 *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_const_reference = {"_p_const_reference", "const_reference *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_p_PyObject = {"_p_p_PyObject", "PyObject **", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_reference = {"_p_reference", "reference *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__AssoEdge_p_std__allocatorTHex__AssoEdge_p_t_t = {"_p_std__vectorTHex__AssoEdge_p_std__allocatorTHex__AssoEdge_p_t_t", "std::vector > *|Hex::AssoEdges *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__EdgeShape_p_std__allocatorTHex__EdgeShape_p_t_t = {"_p_std__vectorTHex__EdgeShape_p_std__allocatorTHex__EdgeShape_p_t_t", "std::vector > *|Hex::EdgeShapes *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t = {"_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t", "std::vector > *|Hex::Edges *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__allocator_type = {"_p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__allocator_type", "std::allocator *|std::vector::allocator_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__EltBase_p_std__allocatorTHex__EltBase_p_t_t = {"_p_std__vectorTHex__EltBase_p_std__allocatorTHex__EltBase_p_t_t", "std::vector > *|Hex::TabElts *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__FaceShape_p_std__allocatorTHex__FaceShape_p_t_t = {"_p_std__vectorTHex__FaceShape_p_std__allocatorTHex__FaceShape_p_t_t", "std::vector > *|Hex::FaceShapes *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t = {"_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t", "std::vector > *|Hex::Hexas *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__allocator_type = {"_p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__allocator_type", "std::allocator *|std::vector::allocator_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t = {"_p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t", "std::vector > *|Hex::NewShapes *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t = {"_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t", "std::vector > *|Hex::Quads *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__allocator_type = {"_p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__allocator_type", "std::allocator *|std::vector::allocator_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Shape_p_std__allocatorTHex__Shape_p_t_t = {"_p_std__vectorTHex__Shape_p_std__allocatorTHex__Shape_p_t_t", "std::vector > *|Hex::Shapes *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__SubShape_p_std__allocatorTHex__SubShape_p_t_t = {"_p_std__vectorTHex__SubShape_p_std__allocatorTHex__SubShape_p_t_t", "std::vector > *|Hex::SubShapes *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t = {"_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t", "std::vector > *|Hex::Vertices *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__allocator_type = {"_p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__allocator_type", "std::allocator *|std::vector::allocator_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTdouble_std__allocatorTdouble_t_t = {"_p_std__vectorTdouble_std__allocatorTdouble_t_t", "std::vector > *|Hex::RealVector *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTdouble_std__allocatorTdouble_t_t__allocator_type = {"_p_std__vectorTdouble_std__allocatorTdouble_t_t__allocator_type", "std::allocator *|std::vector::allocator_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTint_std__allocatorTint_t_t = {"_p_std__vectorTint_std__allocatorTint_t_t", "std::vector > *|Hex::IntVector *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTint_std__allocatorTint_t_t__allocator_type = {"_p_std__vectorTint_std__allocatorTint_t_t__allocator_type", "std::allocator *|std::vector::allocator_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_std__vectorTstd__string_std__allocatorTstd__string_t_t = {"_p_std__vectorTstd__string_std__allocatorTstd__string_t_t", "std::vector > *|Hex::TabText *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_string = {"_p_string", "string *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_swig__PySwigIterator = {"_p_swig__PySwigIterator", "swig::PySwigIterator *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type = {"_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type", "Hex::Edge *|std::vector::value_type", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type = {"_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type", "Hex::Hexa *|std::vector::value_type", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type = {"_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type", "Hex::Quad *|std::vector::value_type", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type = {"_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type", "Hex::Vertex *|std::vector::value_type", 0, 0, (void*)0, 0}; + +static swig_type_info *swig_type_initial[] = { + &_swigt__p_FILE, + &_swigt__p_Hex__BiCylinder, + &_swigt__p_Hex__CrossElements, + &_swigt__p_Hex__Cylinder, + &_swigt__p_Hex__Document, + &_swigt__p_Hex__Edge, + &_swigt__p_Hex__Elements, + &_swigt__p_Hex__EltBase, + &_swigt__p_Hex__Group, + &_swigt__p_Hex__Hex, + &_swigt__p_Hex__Hex__EltBase, + &_swigt__p_Hex__Hexa, + &_swigt__p_Hex__Law, + &_swigt__p_Hex__NewShape, + &_swigt__p_Hex__Pipe, + &_swigt__p_Hex__Propagation, + &_swigt__p_Hex__Quad, + &_swigt__p_Hex__Shape, + &_swigt__p_Hex__Vector, + &_swigt__p_Hex__Vertex, + &_swigt__p_Hex__XmlWriter, + &_swigt__p_a_Hex__DIM3__double, + &_swigt__p_allocator_type, + &_swigt__p_char, + &_swigt__p_const_reference, + &_swigt__p_difference_type, + &_swigt__p_double, + &_swigt__p_int, + &_swigt__p_p_PyObject, + &_swigt__p_reference, + &_swigt__p_size_type, + &_swigt__p_std__invalid_argument, + &_swigt__p_std__vectorTHex__AssoEdge_p_std__allocatorTHex__AssoEdge_p_t_t, + &_swigt__p_std__vectorTHex__EdgeShape_p_std__allocatorTHex__EdgeShape_p_t_t, + &_swigt__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, + &_swigt__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__allocator_type, + &_swigt__p_std__vectorTHex__EltBase_p_std__allocatorTHex__EltBase_p_t_t, + &_swigt__p_std__vectorTHex__FaceShape_p_std__allocatorTHex__FaceShape_p_t_t, + &_swigt__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, + &_swigt__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__allocator_type, + &_swigt__p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t, + &_swigt__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, + &_swigt__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__allocator_type, + &_swigt__p_std__vectorTHex__Shape_p_std__allocatorTHex__Shape_p_t_t, + &_swigt__p_std__vectorTHex__SubShape_p_std__allocatorTHex__SubShape_p_t_t, + &_swigt__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, + &_swigt__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__allocator_type, + &_swigt__p_std__vectorTdouble_std__allocatorTdouble_t_t, + &_swigt__p_std__vectorTdouble_std__allocatorTdouble_t_t__allocator_type, + &_swigt__p_std__vectorTint_std__allocatorTint_t_t, + &_swigt__p_std__vectorTint_std__allocatorTint_t_t__allocator_type, + &_swigt__p_std__vectorTstd__string_std__allocatorTstd__string_t_t, + &_swigt__p_string, + &_swigt__p_swig__PySwigIterator, + &_swigt__p_value_type, + &_swigt__std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, + &_swigt__std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, + &_swigt__std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, + &_swigt__std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, +}; + +static swig_cast_info _swigc__p_FILE[] = { {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__BiCylinder[] = { {&_swigt__p_Hex__BiCylinder, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__CrossElements[] = { {&_swigt__p_Hex__CrossElements, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Cylinder[] = { {&_swigt__p_Hex__Cylinder, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Document[] = { {&_swigt__p_Hex__Document, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Edge[] = { {&_swigt__std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Edge, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Elements[] = { {&_swigt__p_Hex__Elements, 0, 0, 0}, {&_swigt__p_Hex__CrossElements, _p_Hex__CrossElementsTo_p_Hex__Elements, 0, 0}, {&_swigt__p_Hex__BiCylinder, _p_Hex__BiCylinderTo_p_Hex__Elements, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__EltBase[] = { {&_swigt__p_Hex__Vertex, _p_Hex__VertexTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__Elements, _p_Hex__ElementsTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__CrossElements, _p_Hex__CrossElementsTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__Hexa, _p_Hex__HexaTo_p_Hex__EltBase, 0, 0}, {&_swigt__std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, _p_Hex__HexaTo_p_Hex__EltBase, 0, 0}, {&_swigt__std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, _p_Hex__VertexTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__Propagation, _p_Hex__PropagationTo_p_Hex__EltBase, 0, 0}, {&_swigt__std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, _p_Hex__EdgeTo_p_Hex__EltBase, 0, 0}, {&_swigt__std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, _p_Hex__QuadTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__Hex__EltBase, 0, 0, 0}, {&_swigt__p_Hex__EltBase, 0, 0, 0}, {&_swigt__p_Hex__Vector, _p_Hex__VectorTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__BiCylinder, _p_Hex__BiCylinderTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__Document, _p_Hex__DocumentTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__Edge, _p_Hex__EdgeTo_p_Hex__EltBase, 0, 0}, {&_swigt__p_Hex__Quad, _p_Hex__QuadTo_p_Hex__EltBase, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Group[] = { {&_swigt__p_Hex__Group, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Hex[] = { {&_swigt__p_Hex__Hex, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Hex__EltBase[] = { {&_swigt__p_Hex__Vertex, 0, 0, 0}, {&_swigt__p_Hex__Elements, 0, 0, 0}, {&_swigt__p_Hex__CrossElements, 0, 0, 0}, {&_swigt__p_Hex__Hexa, 0, 0, 0}, {&_swigt__std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0, 0, 0}, {&_swigt__std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Propagation, 0, 0, 0}, {&_swigt__std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0, 0, 0}, {&_swigt__std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__EltBase, 0, 0, 0}, {&_swigt__p_Hex__Hex__EltBase, 0, 0, 0}, {&_swigt__p_Hex__Vector, 0, 0, 0}, {&_swigt__p_Hex__BiCylinder, 0, 0, 0}, {&_swigt__p_Hex__Document, 0, 0, 0}, {&_swigt__p_Hex__Edge, 0, 0, 0}, {&_swigt__p_Hex__Quad, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Hexa[] = { {&_swigt__std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Hexa, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Law[] = { {&_swigt__p_Hex__Law, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__NewShape[] = { {&_swigt__p_Hex__NewShape, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Pipe[] = { {&_swigt__p_Hex__Pipe, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Propagation[] = { {&_swigt__p_Hex__Propagation, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Quad[] = { {&_swigt__std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Quad, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Shape[] = { {&_swigt__p_Hex__Shape, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Vector[] = { {&_swigt__p_Hex__Vector, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__Vertex[] = { {&_swigt__std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Vertex, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_Hex__XmlWriter[] = { {&_swigt__p_Hex__XmlWriter, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_a_Hex__DIM3__double[] = { {&_swigt__p_a_Hex__DIM3__double, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_allocator_type[] = { {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_const_reference[] = { {&_swigt__p_const_reference, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_difference_type[] = { {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_double[] = { {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_int[] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_p_PyObject[] = { {&_swigt__p_p_PyObject, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_reference[] = { {&_swigt__p_reference, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_size_type[] = { {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__invalid_argument[] = { {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__AssoEdge_p_std__allocatorTHex__AssoEdge_p_t_t[] = { {&_swigt__p_std__vectorTHex__AssoEdge_p_std__allocatorTHex__AssoEdge_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__EdgeShape_p_std__allocatorTHex__EdgeShape_p_t_t[] = { {&_swigt__p_std__vectorTHex__EdgeShape_p_std__allocatorTHex__EdgeShape_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t[] = { {&_swigt__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__allocator_type[] = { {&_swigt__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__EltBase_p_std__allocatorTHex__EltBase_p_t_t[] = { {&_swigt__p_std__vectorTHex__EltBase_p_std__allocatorTHex__EltBase_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__FaceShape_p_std__allocatorTHex__FaceShape_p_t_t[] = { {&_swigt__p_std__vectorTHex__FaceShape_p_std__allocatorTHex__FaceShape_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t[] = { {&_swigt__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__allocator_type[] = { {&_swigt__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t[] = { {&_swigt__p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t[] = { {&_swigt__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__allocator_type[] = { {&_swigt__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Shape_p_std__allocatorTHex__Shape_p_t_t[] = { {&_swigt__p_std__vectorTHex__Shape_p_std__allocatorTHex__Shape_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__SubShape_p_std__allocatorTHex__SubShape_p_t_t[] = { {&_swigt__p_std__vectorTHex__SubShape_p_std__allocatorTHex__SubShape_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t[] = { {&_swigt__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__allocator_type[] = { {&_swigt__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTdouble_std__allocatorTdouble_t_t[] = { {&_swigt__p_std__vectorTdouble_std__allocatorTdouble_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTdouble_std__allocatorTdouble_t_t__allocator_type[] = { {&_swigt__p_std__vectorTdouble_std__allocatorTdouble_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTint_std__allocatorTint_t_t[] = { {&_swigt__p_std__vectorTint_std__allocatorTint_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTint_std__allocatorTint_t_t__allocator_type[] = { {&_swigt__p_std__vectorTint_std__allocatorTint_t_t__allocator_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_std__vectorTstd__string_std__allocatorTstd__string_t_t[] = { {&_swigt__p_std__vectorTstd__string_std__allocatorTstd__string_t_t, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_string[] = { {&_swigt__p_string, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_swig__PySwigIterator[] = { {&_swigt__p_swig__PySwigIterator, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_value_type[] = { {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type[] = { {&_swigt__std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Edge, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type[] = { {&_swigt__std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Hexa, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type[] = { {&_swigt__std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Quad, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type[] = { {&_swigt__std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, 0, 0, 0}, {&_swigt__p_Hex__Vertex, 0, 0, 0},{0, 0, 0, 0}}; + +static swig_cast_info *swig_cast_initial[] = { + _swigc__p_FILE, + _swigc__p_Hex__BiCylinder, + _swigc__p_Hex__CrossElements, + _swigc__p_Hex__Cylinder, + _swigc__p_Hex__Document, + _swigc__p_Hex__Edge, + _swigc__p_Hex__Elements, + _swigc__p_Hex__EltBase, + _swigc__p_Hex__Group, + _swigc__p_Hex__Hex, + _swigc__p_Hex__Hex__EltBase, + _swigc__p_Hex__Hexa, + _swigc__p_Hex__Law, + _swigc__p_Hex__NewShape, + _swigc__p_Hex__Pipe, + _swigc__p_Hex__Propagation, + _swigc__p_Hex__Quad, + _swigc__p_Hex__Shape, + _swigc__p_Hex__Vector, + _swigc__p_Hex__Vertex, + _swigc__p_Hex__XmlWriter, + _swigc__p_a_Hex__DIM3__double, + _swigc__p_allocator_type, + _swigc__p_char, + _swigc__p_const_reference, + _swigc__p_difference_type, + _swigc__p_double, + _swigc__p_int, + _swigc__p_p_PyObject, + _swigc__p_reference, + _swigc__p_size_type, + _swigc__p_std__invalid_argument, + _swigc__p_std__vectorTHex__AssoEdge_p_std__allocatorTHex__AssoEdge_p_t_t, + _swigc__p_std__vectorTHex__EdgeShape_p_std__allocatorTHex__EdgeShape_p_t_t, + _swigc__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t, + _swigc__p_std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__allocator_type, + _swigc__p_std__vectorTHex__EltBase_p_std__allocatorTHex__EltBase_p_t_t, + _swigc__p_std__vectorTHex__FaceShape_p_std__allocatorTHex__FaceShape_p_t_t, + _swigc__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t, + _swigc__p_std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__allocator_type, + _swigc__p_std__vectorTHex__NewShape_p_std__allocatorTHex__NewShape_p_t_t, + _swigc__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t, + _swigc__p_std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__allocator_type, + _swigc__p_std__vectorTHex__Shape_p_std__allocatorTHex__Shape_p_t_t, + _swigc__p_std__vectorTHex__SubShape_p_std__allocatorTHex__SubShape_p_t_t, + _swigc__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t, + _swigc__p_std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__allocator_type, + _swigc__p_std__vectorTdouble_std__allocatorTdouble_t_t, + _swigc__p_std__vectorTdouble_std__allocatorTdouble_t_t__allocator_type, + _swigc__p_std__vectorTint_std__allocatorTint_t_t, + _swigc__p_std__vectorTint_std__allocatorTint_t_t__allocator_type, + _swigc__p_std__vectorTstd__string_std__allocatorTstd__string_t_t, + _swigc__p_string, + _swigc__p_swig__PySwigIterator, + _swigc__p_value_type, + _swigc__std__vectorTHex__Edge_p_std__allocatorTHex__Edge_p_t_t__value_type, + _swigc__std__vectorTHex__Hexa_p_std__allocatorTHex__Hexa_p_t_t__value_type, + _swigc__std__vectorTHex__Quad_p_std__allocatorTHex__Quad_p_t_t__value_type, + _swigc__std__vectorTHex__Vertex_p_std__allocatorTHex__Vertex_p_t_t__value_type, +}; + + +/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ + +static swig_const_info swig_const_table[] = { +{0, 0, 0, 0.0, 0, 0}}; + +#ifdef __cplusplus +} +#endif +/* ----------------------------------------------------------------------------- + * Type initialization: + * This problem is tough by the requirement that no dynamic + * memory is used. Also, since swig_type_info structures store pointers to + * swig_cast_info structures and swig_cast_info structures store pointers back + * to swig_type_info structures, we need some lookup code at initialization. + * The idea is that swig generates all the structures that are needed. + * The runtime then collects these partially filled structures. + * The SWIG_InitializeModule function takes these initial arrays out of + * swig_module, and does all the lookup, filling in the swig_module.types + * array with the correct data and linking the correct swig_cast_info + * structures together. + * + * The generated swig_type_info structures are assigned staticly to an initial + * array. We just loop through that array, and handle each type individually. + * First we lookup if this type has been already loaded, and if so, use the + * loaded structure instead of the generated one. Then we have to fill in the + * cast linked list. The cast data is initially stored in something like a + * two-dimensional array. Each row corresponds to a type (there are the same + * number of rows as there are in the swig_type_initial array). Each entry in + * a column is one of the swig_cast_info structures for that type. + * The cast_initial array is actually an array of arrays, because each row has + * a variable number of columns. So to actually build the cast linked list, + * we find the array of casts associated with the type, and loop through it + * adding the casts to the list. The one last trick we need to do is making + * sure the type pointer in the swig_cast_info struct is correct. + * + * First off, we lookup the cast->type name to see if it is already loaded. + * There are three cases to handle: + * 1) If the cast->type has already been loaded AND the type we are adding + * casting info to has not been loaded (it is in this module), THEN we + * replace the cast->type pointer with the type pointer that has already + * been loaded. + * 2) If BOTH types (the one we are adding casting info to, and the + * cast->type) are loaded, THEN the cast info has already been loaded by + * the previous module so we just ignore it. + * 3) Finally, if cast->type has not already been loaded, then we add that + * swig_cast_info to the linked list (because the cast->type) pointer will + * be correct. + * ----------------------------------------------------------------------------- */ + +#ifdef __cplusplus +extern "C" { +#if 0 +} /* c-mode */ +#endif +#endif + +#if 0 +#define SWIGRUNTIME_DEBUG +#endif + + +SWIGRUNTIME void +SWIG_InitializeModule(void *clientdata) { + size_t i; + swig_module_info *module_head, *iter; + int found; + + clientdata = clientdata; + + /* check to see if the circular list has been setup, if not, set it up */ + if (swig_module.next==0) { + /* Initialize the swig_module */ + swig_module.type_initial = swig_type_initial; + swig_module.cast_initial = swig_cast_initial; + swig_module.next = &swig_module; + } + + /* Try and load any already created modules */ + module_head = SWIG_GetModule(clientdata); + if (!module_head) { + /* This is the first module loaded for this interpreter */ + /* so set the swig module into the interpreter */ + SWIG_SetModule(clientdata, &swig_module); + module_head = &swig_module; + } else { + /* the interpreter has loaded a SWIG module, but has it loaded this one? */ + found=0; + iter=module_head; + do { + if (iter==&swig_module) { + found=1; + break; + } + iter=iter->next; + } while (iter!= module_head); + + /* if the is found in the list, then all is done and we may leave */ + if (found) return; + /* otherwise we must add out module into the list */ + swig_module.next = module_head->next; + module_head->next = &swig_module; + } + + /* Now work on filling in swig_module.types */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: size %d\n", swig_module.size); +#endif + for (i = 0; i < swig_module.size; ++i) { + swig_type_info *type = 0; + swig_type_info *ret; + swig_cast_info *cast; + +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); +#endif + + /* if there is another module already loaded */ + if (swig_module.next != &swig_module) { + type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); + } + if (type) { + /* Overwrite clientdata field */ +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found type %s\n", type->name); +#endif + if (swig_module.type_initial[i]->clientdata) { + type->clientdata = swig_module.type_initial[i]->clientdata; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); +#endif + } + } else { + type = swig_module.type_initial[i]; + } + + /* Insert casting types */ + cast = swig_module.cast_initial[i]; + while (cast->type) { + /* Don't need to add information already in the list */ + ret = 0; +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); +#endif + if (swig_module.next != &swig_module) { + ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); +#ifdef SWIGRUNTIME_DEBUG + if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); +#endif + } + if (ret) { + if (type == swig_module.type_initial[i]) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: skip old type %s\n", ret->name); +#endif + cast->type = ret; + ret = 0; + } else { + /* Check for casting already in the list */ + swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); +#ifdef SWIGRUNTIME_DEBUG + if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); +#endif + if (!ocast) ret = 0; + } + } + + if (!ret) { +#ifdef SWIGRUNTIME_DEBUG + printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); +#endif + if (type->cast) { + type->cast->prev = cast; + cast->next = type->cast; + } + type->cast = cast; + } + cast++; + } + /* Set entry in modules->types array equal to the type */ + swig_module.types[i] = type; + } + swig_module.types[i] = 0; + +#ifdef SWIGRUNTIME_DEBUG + printf("**** SWIG_InitializeModule: Cast List ******\n"); + for (i = 0; i < swig_module.size; ++i) { + int j = 0; + swig_cast_info *cast = swig_module.cast_initial[i]; + printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + while (cast->type) { + printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); + cast++; + ++j; + } + printf("---- Total casts: %d\n",j); + } + printf("**** SWIG_InitializeModule: Cast List ******\n"); +#endif +} + +/* This function will propagate the clientdata field of type to +* any new swig_type_info structures that have been added into the list +* of equivalent types. It is like calling +* SWIG_TypeClientData(type, clientdata) a second time. +*/ +SWIGRUNTIME void +SWIG_PropagateClientData(void) { + size_t i; + swig_cast_info *equiv; + static int init_run = 0; + + if (init_run) return; + init_run = 1; + + for (i = 0; i < swig_module.size; i++) { + if (swig_module.types[i]->clientdata) { + equiv = swig_module.types[i]->cast; + while (equiv) { + if (!equiv->converter) { + if (equiv->type && !equiv->type->clientdata) + SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); + } + equiv = equiv->next; + } + } + } +} + +#ifdef __cplusplus +#if 0 +{ + /* c-mode */ +#endif +} +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + + /* Python-specific SWIG API */ +#define SWIG_newvarlink() SWIG_Python_newvarlink() +#define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) +#define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) + + /* ----------------------------------------------------------------------------- + * global variable support code. + * ----------------------------------------------------------------------------- */ + + typedef struct swig_globalvar { + char *name; /* Name of global variable */ + PyObject *(*get_attr)(void); /* Return the current value */ + int (*set_attr)(PyObject *); /* Set the value */ + struct swig_globalvar *next; + } swig_globalvar; + + typedef struct swig_varlinkobject { + PyObject_HEAD + swig_globalvar *vars; + } swig_varlinkobject; + + SWIGINTERN PyObject * + swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { + return PyString_FromString(""); + } + + SWIGINTERN PyObject * + swig_varlink_str(swig_varlinkobject *v) { + PyObject *str = PyString_FromString("("); + swig_globalvar *var; + for (var = v->vars; var; var=var->next) { + PyString_ConcatAndDel(&str,PyString_FromString(var->name)); + if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); + } + PyString_ConcatAndDel(&str,PyString_FromString(")")); + return str; + } + + SWIGINTERN int + swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { + PyObject *str = swig_varlink_str(v); + fprintf(fp,"Swig global variables "); + fprintf(fp,"%s\n", PyString_AsString(str)); + Py_DECREF(str); + return 0; + } + + SWIGINTERN void + swig_varlink_dealloc(swig_varlinkobject *v) { + swig_globalvar *var = v->vars; + while (var) { + swig_globalvar *n = var->next; + free(var->name); + free(var); + var = n; + } + } + + SWIGINTERN PyObject * + swig_varlink_getattr(swig_varlinkobject *v, char *n) { + PyObject *res = NULL; + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + res = (*var->get_attr)(); + break; + } + var = var->next; + } + if (res == NULL && !PyErr_Occurred()) { + PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + } + return res; + } + + SWIGINTERN int + swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { + int res = 1; + swig_globalvar *var = v->vars; + while (var) { + if (strcmp(var->name,n) == 0) { + res = (*var->set_attr)(p); + break; + } + var = var->next; + } + if (res == 1 && !PyErr_Occurred()) { + PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + } + return res; + } + + SWIGINTERN PyTypeObject* + swig_varlink_type(void) { + static char varlink__doc__[] = "Swig var link object"; + static PyTypeObject varlink_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp + = { + PyObject_HEAD_INIT(NULL) + 0, /* Number of items in variable part (ob_size) */ + (char *)"swigvarlink", /* Type name (tp_name) */ + sizeof(swig_varlinkobject), /* Basic size (tp_basicsize) */ + 0, /* Itemsize (tp_itemsize) */ + (destructor) swig_varlink_dealloc, /* Deallocator (tp_dealloc) */ + (printfunc) swig_varlink_print, /* Print (tp_print) */ + (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */ + (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */ + 0, /* tp_compare */ + (reprfunc) swig_varlink_repr, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + (reprfunc)swig_varlink_str, /* tp_str */ + 0, /* tp_getattro */ + 0, /* tp_setattro */ + 0, /* tp_as_buffer */ + 0, /* tp_flags */ + varlink__doc__, /* tp_doc */ + 0, /* tp_traverse */ + 0, /* tp_clear */ + 0, /* tp_richcompare */ + 0, /* tp_weaklistoffset */ +#if PY_VERSION_HEX >= 0x02020000 + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ +#endif +#if PY_VERSION_HEX >= 0x02030000 + 0, /* tp_del */ +#endif +#ifdef COUNT_ALLOCS + 0,0,0,0 /* tp_alloc -> tp_next */ +#endif + }; + varlink_type = tmp; + varlink_type.ob_type = &PyType_Type; + type_init = 1; + } + return &varlink_type; + } + + /* Create a variable linking object for use later */ + SWIGINTERN PyObject * + SWIG_Python_newvarlink(void) { + swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); + if (result) { + result->vars = 0; + } + return ((PyObject*) result); + } + + SWIGINTERN void + SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + swig_varlinkobject *v = (swig_varlinkobject *) p; + swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); + if (gv) { + size_t size = strlen(name)+1; + gv->name = (char *)malloc(size); + if (gv->name) { + strncpy(gv->name,name,size); + gv->get_attr = get_attr; + gv->set_attr = set_attr; + gv->next = v->vars; + } + } + v->vars = gv; + } + + SWIGINTERN PyObject * + SWIG_globals(void) { + static PyObject *_SWIG_globals = 0; + if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); + return _SWIG_globals; + } + + /* ----------------------------------------------------------------------------- + * constants/methods manipulation + * ----------------------------------------------------------------------------- */ + + /* Install Constants */ + SWIGINTERN void + SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { + PyObject *obj = 0; + size_t i; + for (i = 0; constants[i].type; ++i) { + switch(constants[i].type) { + case SWIG_PY_POINTER: + obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); + break; + case SWIG_PY_BINARY: + obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); + break; + default: + obj = 0; + break; + } + if (obj) { + PyDict_SetItemString(d, constants[i].name, obj); + Py_DECREF(obj); + } + } + } + + /* -----------------------------------------------------------------------------*/ + /* Fix SwigMethods to carry the callback ptrs when needed */ + /* -----------------------------------------------------------------------------*/ + + SWIGINTERN void + SWIG_Python_FixMethods(PyMethodDef *methods, + swig_const_info *const_table, + swig_type_info **types, + swig_type_info **types_initial) { + size_t i; + for (i = 0; methods[i].ml_name; ++i) { + const char *c = methods[i].ml_doc; + if (c && (c = strstr(c, "swig_ptr: "))) { + int j; + swig_const_info *ci = 0; + const char *name = c + 10; + for (j = 0; const_table[j].type; ++j) { + if (strncmp(const_table[j].name, name, + strlen(const_table[j].name)) == 0) { + ci = &(const_table[j]); + break; + } + } + if (ci) { + size_t shift = (ci->ptype) - types; + swig_type_info *ty = types_initial[shift]; + size_t ldoc = (c - methods[i].ml_doc); + size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; + char *ndoc = (char*)malloc(ldoc + lptr + 10); + if (ndoc) { + char *buff = ndoc; + void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; + if (ptr) { + strncpy(buff, methods[i].ml_doc, ldoc); + buff += ldoc; + strncpy(buff, "swig_ptr: ", 10); + buff += 10; + SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); + methods[i].ml_doc = ndoc; + } + } + } + } + } + } + +#ifdef __cplusplus +} +#endif + +/* -----------------------------------------------------------------------------* + * Partial Init method + * -----------------------------------------------------------------------------*/ + +#ifdef __cplusplus +extern "C" +#endif +SWIGEXPORT void SWIG_init(void) { + PyObject *m, *d; + + /* Fix SwigMethods to carry the callback ptrs when needed */ + SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); + + m = Py_InitModule((char *) SWIG_name, SwigMethods); + d = PyModule_GetDict(m); + + SWIG_InitializeModule(0); + SWIG_InstallConstants(d,swig_const_table); + + + SWIG_Python_SetConstant(d, "HOK",SWIG_From_int(static_cast< int >(0))); + SWIG_Python_SetConstant(d, "HERR",SWIG_From_int(static_cast< int >(1))); + SWIG_Python_SetConstant(d, "NOTHING",SWIG_From_int(static_cast< int >(-1))); + SWIG_Python_SetConstant(d, "EOL",SWIG_From_char(static_cast< char >('\n'))); + SWIG_Python_SetConstant(d, "EOS",SWIG_From_int(static_cast< int >(0))); + SWIG_Python_SetConstant(d, "CHVIDE",SWIG_FromCharPtr("")); + SWIG_Python_SetConstant(d, "ZEROR",SWIG_From_double(static_cast< double >(0.0))); + SWIG_Python_SetConstant(d, "UNR",SWIG_From_double(static_cast< double >(1.0))); + SWIG_Python_SetConstant(d, "DEMI",SWIG_From_double(static_cast< double >(0.5))); + SWIG_Python_SetConstant(d, "DIM2",SWIG_From_int(static_cast< int >(2))); + SWIG_Python_SetConstant(d, "M_PI",SWIG_From_double(static_cast< double >(3.14159265358979323846))); + SWIG_Python_SetConstant(d, "Degre2Radian",SWIG_From_double(static_cast< double >(3.14159265358979323846/180))); + SWIG_Python_SetConstant(d, "dir_x",SWIG_From_int(static_cast< int >(Hex::dir_x))); + SWIG_Python_SetConstant(d, "dir_y",SWIG_From_int(static_cast< int >(Hex::dir_y))); + SWIG_Python_SetConstant(d, "dir_z",SWIG_From_int(static_cast< int >(Hex::dir_z))); + SWIG_Python_SetConstant(d, "DIM3",SWIG_From_int(static_cast< int >(Hex::DIM3))); + SWIG_Python_SetConstant(d, "EL_NONE",SWIG_From_int(static_cast< int >(Hex::EL_NONE))); + SWIG_Python_SetConstant(d, "EL_VERTEX",SWIG_From_int(static_cast< int >(Hex::EL_VERTEX))); + SWIG_Python_SetConstant(d, "EL_EDGE",SWIG_From_int(static_cast< int >(Hex::EL_EDGE))); + SWIG_Python_SetConstant(d, "EL_QUAD",SWIG_From_int(static_cast< int >(Hex::EL_QUAD))); + SWIG_Python_SetConstant(d, "EL_HEXA",SWIG_From_int(static_cast< int >(Hex::EL_HEXA))); + SWIG_Python_SetConstant(d, "EL_VECTOR",SWIG_From_int(static_cast< int >(Hex::EL_VECTOR))); + SWIG_Python_SetConstant(d, "EL_GRID",SWIG_From_int(static_cast< int >(Hex::EL_GRID))); + SWIG_Python_SetConstant(d, "EL_CYLINDER",SWIG_From_int(static_cast< int >(Hex::EL_CYLINDER))); + SWIG_Python_SetConstant(d, "EL_PIPE",SWIG_From_int(static_cast< int >(Hex::EL_PIPE))); + SWIG_Python_SetConstant(d, "EL_GROUP",SWIG_From_int(static_cast< int >(Hex::EL_GROUP))); + SWIG_Python_SetConstant(d, "EL_LAW",SWIG_From_int(static_cast< int >(Hex::EL_LAW))); + SWIG_Python_SetConstant(d, "EL_SHAPE",SWIG_From_int(static_cast< int >(Hex::EL_SHAPE))); + SWIG_Python_SetConstant(d, "EL_SUBSHAPE",SWIG_From_int(static_cast< int >(Hex::EL_SUBSHAPE))); + SWIG_Python_SetConstant(d, "EL_PROPAGATION",SWIG_From_int(static_cast< int >(Hex::EL_PROPAGATION))); + SWIG_Python_SetConstant(d, "EL_DOCU",SWIG_From_int(static_cast< int >(Hex::EL_DOCU))); + SWIG_Python_SetConstant(d, "EL_REMOVED",SWIG_From_int(static_cast< int >(Hex::EL_REMOVED))); + SWIG_Python_SetConstant(d, "EL_MAXI",SWIG_From_int(static_cast< int >(Hex::EL_MAXI))); + PyDict_SetItemString(d,(char*)"cvar", SWIG_globals()); + SWIG_addvarlink(SWIG_globals(),(char*)"ABR_TYPES",ABR_TYPES_get, ABR_TYPES_set); + SWIG_Python_SetConstant(d, "HexaCell",SWIG_From_int(static_cast< int >(Hex::HexaCell))); + SWIG_Python_SetConstant(d, "QuadCell",SWIG_From_int(static_cast< int >(Hex::QuadCell))); + SWIG_Python_SetConstant(d, "EdgeCell",SWIG_From_int(static_cast< int >(Hex::EdgeCell))); + SWIG_Python_SetConstant(d, "HexaNode",SWIG_From_int(static_cast< int >(Hex::HexaNode))); + SWIG_Python_SetConstant(d, "QuadNode",SWIG_From_int(static_cast< int >(Hex::QuadNode))); + SWIG_Python_SetConstant(d, "EdgeNode",SWIG_From_int(static_cast< int >(Hex::EdgeNode))); + SWIG_Python_SetConstant(d, "VertexNode",SWIG_From_int(static_cast< int >(Hex::VertexNode))); + SWIG_Python_SetConstant(d, "SH_NONE",SWIG_From_int(static_cast< int >(Hex::SH_NONE))); + SWIG_Python_SetConstant(d, "SH_IMPORT",SWIG_From_int(static_cast< int >(Hex::SH_IMPORT))); + SWIG_Python_SetConstant(d, "SH_CYLINDER",SWIG_From_int(static_cast< int >(Hex::SH_CYLINDER))); + SWIG_Python_SetConstant(d, "SH_INTER",SWIG_From_int(static_cast< int >(Hex::SH_INTER))); + SWIG_Python_SetConstant(d, "SH_SPHERE",SWIG_From_int(static_cast< int >(Hex::SH_SPHERE))); + SWIG_Python_SetConstant(d, "SH_CLOUD",SWIG_From_int(static_cast< int >(Hex::SH_CLOUD))); + SWIG_Python_SetConstant(d, "SH_EXTRUD",SWIG_From_int(static_cast< int >(Hex::SH_EXTRUD))); + SWIG_Python_SetConstant(d, "CYL_NOFILL",SWIG_From_int(static_cast< int >(Hex::CYL_NOFILL))); + SWIG_Python_SetConstant(d, "CYL_CL4",SWIG_From_int(static_cast< int >(Hex::CYL_CL4))); + SWIG_Python_SetConstant(d, "CYL_CL6",SWIG_From_int(static_cast< int >(Hex::CYL_CL6))); + SWIG_Python_SetConstant(d, "CYL_CLOSED",SWIG_From_int(static_cast< int >(Hex::CYL_CLOSED))); + SWIG_Python_SetConstant(d, "CYL_PEER",SWIG_From_int(static_cast< int >(Hex::CYL_PEER))); + SWIG_Python_SetConstant(d, "CYL_ODD",SWIG_From_int(static_cast< int >(Hex::CYL_ODD))); + SWIG_Python_SetConstant(d, "GR_NONE",SWIG_From_int(static_cast< int >(Hex::GR_NONE))); + SWIG_Python_SetConstant(d, "GR_CARTESIAN",SWIG_From_int(static_cast< int >(Hex::GR_CARTESIAN))); + SWIG_Python_SetConstant(d, "GR_CYLINDRIC",SWIG_From_int(static_cast< int >(Hex::GR_CYLINDRIC))); + SWIG_Python_SetConstant(d, "GR_SPHERIC",SWIG_From_int(static_cast< int >(Hex::GR_SPHERIC))); + SWIG_Python_SetConstant(d, "GR_JOINT",SWIG_From_int(static_cast< int >(Hex::GR_JOINT))); + SWIG_Python_SetConstant(d, "GR_BICYL",SWIG_From_int(static_cast< int >(Hex::GR_BICYL))); + SWIG_Python_SetConstant(d, "GR_BIPIPE",SWIG_From_int(static_cast< int >(Hex::GR_BIPIPE))); + SWIG_Python_SetConstant(d, "GR_REPLACE",SWIG_From_int(static_cast< int >(Hex::GR_REPLACE))); + SWIG_Python_SetConstant(d, "GR_HEMISPHERIC",SWIG_From_int(static_cast< int >(Hex::GR_HEMISPHERIC))); + SWIG_Python_SetConstant(d, "GR_RIND",SWIG_From_int(static_cast< int >(Hex::GR_RIND))); + SWIG_Python_SetConstant(d, "GR_PART_SPHERIC",SWIG_From_int(static_cast< int >(Hex::GR_PART_SPHERIC))); + SWIG_Python_SetConstant(d, "GR_PART_RIND",SWIG_From_int(static_cast< int >(Hex::GR_PART_RIND))); + SWIG_Python_SetConstant(d, "S_E",SWIG_From_int(static_cast< int >(Hex::S_E))); + SWIG_Python_SetConstant(d, "S_NE",SWIG_From_int(static_cast< int >(Hex::S_NE))); + SWIG_Python_SetConstant(d, "S_N",SWIG_From_int(static_cast< int >(Hex::S_N))); + SWIG_Python_SetConstant(d, "S_NW",SWIG_From_int(static_cast< int >(Hex::S_NW))); + SWIG_Python_SetConstant(d, "S_W",SWIG_From_int(static_cast< int >(Hex::S_W))); + SWIG_Python_SetConstant(d, "S_SW",SWIG_From_int(static_cast< int >(Hex::S_SW))); + SWIG_Python_SetConstant(d, "S_S",SWIG_From_int(static_cast< int >(Hex::S_S))); + SWIG_Python_SetConstant(d, "S_SE",SWIG_From_int(static_cast< int >(Hex::S_SE))); + SWIG_Python_SetConstant(d, "S_MAXI",SWIG_From_int(static_cast< int >(Hex::S_MAXI))); + SWIG_Python_SetConstant(d, "Uniform",SWIG_From_int(static_cast< int >(Hex::Uniform))); + SWIG_Python_SetConstant(d, "Arithmetic",SWIG_From_int(static_cast< int >(Hex::Arithmetic))); + SWIG_Python_SetConstant(d, "Geometric",SWIG_From_int(static_cast< int >(Hex::Geometric))); + SWIG_Python_SetConstant(d, "OR_FRONT",SWIG_From_int(static_cast< int >(Hex::OR_FRONT))); + SWIG_Python_SetConstant(d, "OR_LEFT",SWIG_From_int(static_cast< int >(Hex::OR_LEFT))); + SWIG_Python_SetConstant(d, "OR_RIGHT",SWIG_From_int(static_cast< int >(Hex::OR_RIGHT))); + SWIG_Python_SetConstant(d, "OR_BACK",SWIG_From_int(static_cast< int >(Hex::OR_BACK))); + SWIG_Python_SetConstant(d, "IS_NONE",SWIG_From_int(static_cast< int >(Hex::IS_NONE))); + SWIG_Python_SetConstant(d, "IS_MARRIED",SWIG_From_int(static_cast< int >(Hex::IS_MARRIED))); + SWIG_Python_SetConstant(d, "NO_COUNTED",SWIG_From_int(static_cast< int >(Hex::NO_COUNTED))); + SWIG_Python_SetConstant(d, "NO_USED",SWIG_From_int(static_cast< int >(Hex::NO_USED))); + SWIG_Python_SetConstant(d, "IS_USED",SWIG_From_int(static_cast< int >(Hex::IS_USED))); + SWIG_Python_SetConstant(d, "V_AMONT",SWIG_From_int(static_cast< int >(Hex::V_AMONT))); + SWIG_Python_SetConstant(d, "V_AVAL",SWIG_From_int(static_cast< int >(Hex::V_AVAL))); + SWIG_Python_SetConstant(d, "V_TWO",SWIG_From_int(static_cast< int >(Hex::V_TWO))); + SWIG_Python_SetConstant(d, "E_A",SWIG_From_int(static_cast< int >(Hex::E_A))); + SWIG_Python_SetConstant(d, "E_B",SWIG_From_int(static_cast< int >(Hex::E_B))); + SWIG_Python_SetConstant(d, "E_C",SWIG_From_int(static_cast< int >(Hex::E_C))); + SWIG_Python_SetConstant(d, "E_D",SWIG_From_int(static_cast< int >(Hex::E_D))); + SWIG_Python_SetConstant(d, "QUAD4",SWIG_From_int(static_cast< int >(Hex::QUAD4))); + SWIG_Python_SetConstant(d, "Q_A",SWIG_From_int(static_cast< int >(Hex::Q_A))); + SWIG_Python_SetConstant(d, "Q_B",SWIG_From_int(static_cast< int >(Hex::Q_B))); + SWIG_Python_SetConstant(d, "Q_C",SWIG_From_int(static_cast< int >(Hex::Q_C))); + SWIG_Python_SetConstant(d, "Q_D",SWIG_From_int(static_cast< int >(Hex::Q_D))); + SWIG_Python_SetConstant(d, "Q_E",SWIG_From_int(static_cast< int >(Hex::Q_E))); + SWIG_Python_SetConstant(d, "Q_F",SWIG_From_int(static_cast< int >(Hex::Q_F))); + SWIG_Python_SetConstant(d, "HQ_MAXI",SWIG_From_int(static_cast< int >(Hex::HQ_MAXI))); + SWIG_Python_SetConstant(d, "E_AC",SWIG_From_int(static_cast< int >(Hex::E_AC))); + SWIG_Python_SetConstant(d, "E_AD",SWIG_From_int(static_cast< int >(Hex::E_AD))); + SWIG_Python_SetConstant(d, "E_BC",SWIG_From_int(static_cast< int >(Hex::E_BC))); + SWIG_Python_SetConstant(d, "E_BD",SWIG_From_int(static_cast< int >(Hex::E_BD))); + SWIG_Python_SetConstant(d, "E_AE",SWIG_From_int(static_cast< int >(Hex::E_AE))); + SWIG_Python_SetConstant(d, "E_AF",SWIG_From_int(static_cast< int >(Hex::E_AF))); + SWIG_Python_SetConstant(d, "E_BE",SWIG_From_int(static_cast< int >(Hex::E_BE))); + SWIG_Python_SetConstant(d, "E_BF",SWIG_From_int(static_cast< int >(Hex::E_BF))); + SWIG_Python_SetConstant(d, "E_CE",SWIG_From_int(static_cast< int >(Hex::E_CE))); + SWIG_Python_SetConstant(d, "E_CF",SWIG_From_int(static_cast< int >(Hex::E_CF))); + SWIG_Python_SetConstant(d, "E_DE",SWIG_From_int(static_cast< int >(Hex::E_DE))); + SWIG_Python_SetConstant(d, "E_DF",SWIG_From_int(static_cast< int >(Hex::E_DF))); + SWIG_Python_SetConstant(d, "HE_MAXI",SWIG_From_int(static_cast< int >(Hex::HE_MAXI))); + SWIG_Python_SetConstant(d, "V_ACE",SWIG_From_int(static_cast< int >(Hex::V_ACE))); + SWIG_Python_SetConstant(d, "V_ACF",SWIG_From_int(static_cast< int >(Hex::V_ACF))); + SWIG_Python_SetConstant(d, "V_ADE",SWIG_From_int(static_cast< int >(Hex::V_ADE))); + SWIG_Python_SetConstant(d, "V_ADF",SWIG_From_int(static_cast< int >(Hex::V_ADF))); + SWIG_Python_SetConstant(d, "V_BCE",SWIG_From_int(static_cast< int >(Hex::V_BCE))); + SWIG_Python_SetConstant(d, "V_BCF",SWIG_From_int(static_cast< int >(Hex::V_BCF))); + SWIG_Python_SetConstant(d, "V_BDE",SWIG_From_int(static_cast< int >(Hex::V_BDE))); + SWIG_Python_SetConstant(d, "V_BDF",SWIG_From_int(static_cast< int >(Hex::V_BDF))); + SWIG_Python_SetConstant(d, "HV_MAXI",SWIG_From_int(static_cast< int >(Hex::HV_MAXI))); + SWIG_Python_SetConstant(d, "Q_INSIDE",SWIG_From_int(static_cast< int >(Hex::Q_INSIDE))); + SWIG_Python_SetConstant(d, "Q_DIRECT",SWIG_From_int(static_cast< int >(Hex::Q_DIRECT))); + SWIG_Python_SetConstant(d, "Q_INVERSE",SWIG_From_int(static_cast< int >(Hex::Q_INVERSE))); + SWIG_Python_SetConstant(d, "Q_UNDEFINED",SWIG_From_int(static_cast< int >(Hex::Q_UNDEFINED))); + SWIG_Python_SetConstant(d, "Q_WAITING",SWIG_From_int(static_cast< int >(Hex::Q_WAITING))); + SWIG_Python_SetConstant(d, "CylSmall",SWIG_From_int(static_cast< int >(Hex::CylSmall))); + SWIG_Python_SetConstant(d, "CylBig",SWIG_From_int(static_cast< int >(Hex::CylBig))); + SWIG_Python_SetConstant(d, "NxInt",SWIG_From_int(static_cast< int >(Hex::NxInt))); + SWIG_Python_SetConstant(d, "NxExt",SWIG_From_int(static_cast< int >(Hex::NxExt))); + SWIG_addvarlink(SWIG_globals(),(char*)"Epsil",Epsil_get, Epsil_set); + SWIG_addvarlink(SWIG_globals(),(char*)"UnEpsil",UnEpsil_get, UnEpsil_set); + SWIG_addvarlink(SWIG_globals(),(char*)"Epsil2",Epsil2_get, Epsil2_set); + SWIG_Python_SetConstant(d, "NbrSlices1",SWIG_From_int(static_cast< int >(Hex::NbrSlices1))); + SWIG_Python_SetConstant(d, "NbrSlices2",SWIG_From_int(static_cast< int >(Hex::NbrSlices2))); + SWIG_Python_SetConstant(d, "SizeRay",SWIG_From_int(static_cast< int >(Hex::SizeRay))); + SWIG_Python_SetConstant(d, "BiCyl",SWIG_From_int(static_cast< int >(Hex::BiCyl))); + SWIG_Python_SetConstant(d, "NbrVSlices1",SWIG_From_int(static_cast< int >(Hex::NbrVSlices1))); + SWIG_Python_SetConstant(d, "NbrVSlices2",SWIG_From_int(static_cast< int >(Hex::NbrVSlices2))); + SWIG_Python_SetConstant(d, "MiddleSlice1",SWIG_From_int(static_cast< int >(Hex::MiddleSlice1))); + SWIG_Python_SetConstant(d, "Cyl1",SWIG_From_int(static_cast< int >(Hex::Cyl1))); + SWIG_Python_SetConstant(d, "Cyl2",SWIG_From_int(static_cast< int >(Hex::Cyl2))); + SWIG_Python_SetConstant(d, "NO_CYL",SWIG_From_int(static_cast< int >(Hex::NO_CYL))); + SWIG_Python_SetConstant(d, "NO_PIPE",SWIG_From_int(static_cast< int >(Hex::NO_PIPE))); + SWIG_Python_SetConstant(d, "IS_HERE",SWIG_From_int(static_cast< int >(Hex::IS_HERE))); +} + diff --git a/src/HEXABLOCK_SWIG/make_swig b/src/HEXABLOCK_SWIG/make_swig new file mode 100755 index 0000000..f4ba791 --- /dev/null +++ b/src/HEXABLOCK_SWIG/make_swig @@ -0,0 +1,31 @@ +#!/bin/sh +# Comm : I'm swigging in the rain + +module=hexablock_swig +bibli=`pwd` +bibli=`basename $bibli` + +wrapped=${module}_wrap +wrap_src=$wrapped.cc + +os=`uname` +shared=_$module.so +opt_pic=-fPIC +if ( [ $os != Linux ] ) then + shared=_$module.dll + opt_pic= + fi + + +for a in a a a a a a a a a a a a a a a a a a a a a a a + do echo ; done + +echo " -- Je swigge ..." +swig -python -c++ -o $wrap_src -I../HEXABLOCK -module ${module} ${module}.i + +## echo " -- Je compile ..." +## g++ $opt_pic -I../HEXABLOCK -I/usr/include/python2.5 -c $wrap_src +##echo " -- Je linke ..." +##g++ -fPIC -shared $wrapped.o -L. -l$bibli -lpython2.6 -o ${shared} +echo " -- J'ai fini." + diff --git a/src/Makefile.am b/src/Makefile.am index 56a809e..00425cf 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,17 +19,15 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am -DIST_SUBDIRS = HEXABLOCK \ - HEXABLOCK_I \ - HEXABLOCKGUI \ - TEST_PY \ - TEST_CPP +##DIST_SUBDIRS = HEXABLOCK HEXABLOCK_SWIG TEST_PY TEST_CPP +DIST_SUBDIRS = HEXABLOCK HEXABLOCK_SWIG TEST_PY +SUBDIRS = HEXABLOCK HEXABLOCK_SWIG TEST_PY -SUBDIRS = HEXABLOCK \ - HEXABLOCK_I \ - HEXABLOCKGUI \ - TEST_PY - -if CPPUNIT_IS_OK - SUBDIRS += TEST_CPP +if HEXABLOCK_ENABLE_GUI + DIST_SUBDIRS += HEXABLOCKGUI + SUBDIRS += HEXABLOCKGUI endif + +## if CPPUNIT_IS_OK + ## SUBDIRS += TEST_CPP +## endif -- 2.39.2