From 018af1baa1507f24dfba2273ddcca54dd1d2a946 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 17 Mar 2021 17:11:57 +0300 Subject: [PATCH] bos #20256: [CEA 18523] Porting SMESH to int 64 bits --- CMakeLists.txt | 7 + SalomeSMESHConfig.cmake.in | 1 + idl/CMakeLists.txt | 4 + idl/SMESH_BasicHypothesis.idl | 40 +- idl/SMESH_Filter.idl | 25 +- idl/SMESH_Gen.idl | 15 +- idl/SMESH_Group.idl | 23 +- idl/SMESH_Hypothesis.idl | 2 +- idl/SMESH_Measurements.idl | 5 +- idl/SMESH_Mesh.idl | 148 +++--- idl/SMESH_MeshEditor.idl | 303 ++++++------- idl/SMESH_Pattern.idl | 17 +- idl/SMESH_smIdType.idl.in | 28 ++ src/Controls/SMESH_Controls.cxx | 118 ++--- src/Controls/SMESH_ControlsDef.hxx | 51 ++- src/Driver/Driver_Mesh.h | 28 +- src/DriverCGNS/DriverCGNS_Read.cxx | 16 +- src/DriverCGNS/DriverCGNS_Write.cxx | 21 +- src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx | 2 +- src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx | 18 +- src/DriverGMF/DriverGMF_Read.cxx | 84 ++-- src/DriverGMF/DriverGMF_Write.cxx | 9 +- src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx | 11 +- src/DriverMED/DriverMED_W_Field.cxx | 2 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 101 +++-- src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx | 18 +- src/DriverUNV/DriverUNV_W_SMDS_Mesh.h | 3 +- src/MEDWrapper/MED_Common.hxx | 2 + src/OBJECT/SMESH_Actor.cxx | 88 ++-- src/OBJECT/SMESH_Actor.h | 2 +- src/OBJECT/SMESH_ActorDef.h | 14 +- src/OBJECT/SMESH_ActorUtils.cxx | 14 +- src/OBJECT/SMESH_ActorUtils.h | 2 +- src/OBJECT/SMESH_CellLabelActor.cxx | 11 +- src/OBJECT/SMESH_DeviceActor.cxx | 30 +- src/OBJECT/SMESH_DeviceActor.h | 12 +- src/OBJECT/SMESH_ExtractGeometry.cxx | 8 +- src/OBJECT/SMESH_ExtractGeometry.h | 4 +- src/OBJECT/SMESH_NodeLabelActor.cxx | 16 +- src/OBJECT/SMESH_Object.cxx | 90 ++-- src/OBJECT/SMESH_Object.h | 21 +- src/OBJECT/SMESH_ObjectDef.h | 40 +- src/OBJECT/SMESH_SVTKActor.cxx | 7 +- src/OBJECT/SMESH_SVTKActor.h | 2 +- src/SMDS/SMDS_CellOfNodes.cxx | 6 +- src/SMDS/SMDS_CellOfNodes.hxx | 14 +- src/SMDS/SMDS_Downward.cxx | 7 +- src/SMDS/SMDS_ElementFactory.cxx | 101 +++-- src/SMDS/SMDS_ElementFactory.hxx | 48 +- src/SMDS/SMDS_ElementHolder.cxx | 13 +- src/SMDS/SMDS_ElementHolder.hxx | 9 +- src/SMDS/SMDS_Mesh.cxx | 319 ++++++------- src/SMDS/SMDS_Mesh.hxx | 217 ++++----- src/SMDS/SMDS_MeshElement.cxx | 6 +- src/SMDS/SMDS_MeshElement.hxx | 11 +- src/SMDS/SMDS_MeshGroup.hxx | 2 +- src/SMDS/SMDS_MeshInfo.hxx | 125 ++--- src/SMDS/SMDS_MeshNode.cxx | 9 +- src/SMDS/SMDS_UnstructuredGrid.cxx | 102 ++--- src/SMDS/SMDS_UnstructuredGrid.hxx | 21 +- src/SMDS/SMDS_VolumeTool.cxx | 4 +- src/SMDS/SMDS_VolumeTool.hxx | 8 +- src/SMESH/SMESH_Algo.cxx | 6 +- src/SMESH/SMESH_Algo.hxx | 6 +- src/SMESH/SMESH_Mesh.cxx | 129 ++++-- src/SMESH/SMESH_Mesh.hxx | 56 ++- src/SMESH/SMESH_MeshEditor.cxx | 94 ++-- src/SMESH/SMESH_MeshEditor.hxx | 28 +- src/SMESH/SMESH_MesherHelper.cxx | 28 +- src/SMESH/SMESH_MesherHelper.hxx | 24 +- src/SMESH/SMESH_Pattern.cxx | 8 +- src/SMESH/SMESH_ProxyMesh.cxx | 8 +- src/SMESH/SMESH_ProxyMesh.hxx | 7 +- src/SMESH/SMESH_subMesh.cxx | 12 +- src/SMESHClient/SMESH_Client.cxx | 93 ++-- src/SMESHDS/SMESHDS_Command.cxx | 178 ++++---- src/SMESHDS/SMESHDS_Command.hxx | 145 +++--- src/SMESHDS/SMESHDS_Group.cxx | 8 +- src/SMESHDS/SMESHDS_Group.hxx | 8 +- src/SMESHDS/SMESHDS_GroupBase.cxx | 10 +- src/SMESHDS/SMESHDS_GroupBase.hxx | 12 +- src/SMESHDS/SMESHDS_GroupOnFilter.cxx | 16 +- src/SMESHDS/SMESHDS_GroupOnFilter.hxx | 10 +- src/SMESHDS/SMESHDS_GroupOnGeom.cxx | 2 +- src/SMESHDS/SMESHDS_GroupOnGeom.hxx | 2 +- src/SMESHDS/SMESHDS_Mesh.cxx | 208 ++++----- src/SMESHDS/SMESHDS_Mesh.hxx | 178 ++++---- src/SMESHDS/SMESHDS_Script.cxx | 144 +++--- src/SMESHDS/SMESHDS_Script.hxx | 140 +++--- src/SMESHDS/SMESHDS_SubMesh.cxx | 8 +- src/SMESHDS/SMESHDS_SubMesh.hxx | 11 +- src/SMESHGUI/SMESHGUI.cxx | 86 ++-- .../SMESHGUI_Add0DElemsOnAllNodesDlg.cxx | 7 +- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 10 +- .../SMESHGUI_AddQuadraticElementDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_ComputeDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_ComputeDlg.h | 2 +- src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx | 2 +- src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx | 4 +- .../SMESHGUI_CreatePolyhedralVolumeDlg.cxx | 12 +- src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx | 3 +- .../SMESHGUI_ExtrusionAlongPathDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx | 12 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.h | 2 +- src/SMESHGUI/SMESHGUI_Filter.cxx | 12 +- src/SMESHGUI/SMESHGUI_Filter.h | 12 +- src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 29 +- src/SMESHGUI/SMESHGUI_FilterDlg.h | 6 +- src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 34 +- src/SMESHGUI/SMESHGUI_IdPreview.cxx | 4 +- src/SMESHGUI/SMESHGUI_IdPreview.h | 3 +- src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx | 16 +- src/SMESHGUI/SMESHGUI_Measurements.cxx | 22 +- src/SMESHGUI/SMESHGUI_MergeDlg.cxx | 12 +- src/SMESHGUI/SMESHGUI_MergeDlg.h | 5 +- src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx | 4 +- src/SMESHGUI/SMESHGUI_MeshInfo.cxx | 6 +- src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx | 2 +- src/SMESHGUI/SMESHGUI_MeshInfosBox.h | 2 +- src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx | 14 +- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 56 +-- src/SMESHGUI/SMESHGUI_MultiEditDlg.h | 12 +- src/SMESHGUI/SMESHGUI_NodesDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_OffsetDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_PreVisualObj.cxx | 20 +- src/SMESHGUI/SMESHGUI_PreVisualObj.h | 20 +- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx | 4 +- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_ScaleDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_SelectionOp.cxx | 4 +- src/SMESHGUI/SMESHGUI_SelectionOp.h | 3 +- src/SMESHGUI/SMESHGUI_SelectionProxy.cxx | 28 +- src/SMESHGUI/SMESHGUI_SelectionProxy.h | 6 +- src/SMESHGUI/SMESHGUI_SewingDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx | 2 +- src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx | 26 +- src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx | 10 +- src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 6 +- src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx | 3 +- src/SMESHGUI/SMESHGUI_VTKUtils.cxx | 26 +- src/SMESHGUI/SMESHGUI_VTKUtils.h | 4 +- src/SMESHUtils/SMESH_Delaunay.hxx | 2 +- src/SMESHUtils/SMESH_MeshAlgos.cxx | 13 +- src/SMESHUtils/SMESH_OctreeNode.hxx | 2 +- src/SMESHUtils/SMESH_Offset.cxx | 16 +- src/SMESHUtils/SMESH_Slot.cxx | 10 +- src/SMESHUtils/SMESH_TryCatch.hxx | 8 +- src/SMESHUtils/SMESH_TypeDefs.hxx | 6 +- src/SMESH_I/SMESH_Filter_i.cxx | 46 +- src/SMESH_I/SMESH_Filter_i.hxx | 18 +- src/SMESH_I/SMESH_Gen_i.cxx | 47 +- src/SMESH_I/SMESH_Gen_i.hxx | 7 +- src/SMESH_I/SMESH_Gen_i_1.cxx | 2 +- src/SMESH_I/SMESH_Group_i.cxx | 54 +-- src/SMESH_I/SMESH_Group_i.hxx | 32 +- src/SMESH_I/SMESH_Hypothesis_i.cxx | 2 +- src/SMESH_I/SMESH_Hypothesis_i.hxx | 2 +- src/SMESH_I/SMESH_Measurements_i.cxx | 8 +- src/SMESH_I/SMESH_MeshEditor_i.cxx | 426 +++++++++--------- src/SMESH_I/SMESH_MeshEditor_i.hxx | 268 +++++------ src/SMESH_I/SMESH_MeshPartDS.hxx | 9 +- src/SMESH_I/SMESH_Mesh_i.cxx | 330 +++++++------- src/SMESH_I/SMESH_Mesh_i.hxx | 124 ++--- src/SMESH_I/SMESH_Pattern_i.cxx | 26 +- src/SMESH_I/SMESH_Pattern_i.hxx | 18 +- src/SMESH_I/SMESH_PreMeshInfo.cxx | 10 +- src/SMESH_I/SMESH_PreMeshInfo.hxx | 2 +- src/SMESH_I/SMESH_PythonDump.cxx | 32 +- src/SMESH_I/SMESH_PythonDump.hxx | 13 +- src/SMESH_I/SMESH_subMesh_i.cxx | 42 +- src/SMESH_I/SMESH_subMesh_i.hxx | 18 +- src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx | 14 +- src/StdMeshers/StdMeshers_AutomaticLength.cxx | 2 +- .../StdMeshers_CartesianParameters3D.cxx | 14 +- src/StdMeshers/StdMeshers_Cartesian_3D.cxx | 4 +- .../StdMeshers_CompositeHexa_3D.cxx | 26 +- src/StdMeshers/StdMeshers_Distribution.cxx | 14 +- src/StdMeshers/StdMeshers_Distribution.hxx | 8 +- src/StdMeshers/StdMeshers_FaceSide.cxx | 6 +- src/StdMeshers/StdMeshers_FaceSide.hxx | 10 +- src/StdMeshers/StdMeshers_FixedPoints1D.cxx | 20 +- src/StdMeshers/StdMeshers_FixedPoints1D.hxx | 13 +- src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx | 4 +- src/StdMeshers/StdMeshers_Hexa_3D.cxx | 26 +- src/StdMeshers/StdMeshers_Import_1D.cxx | 2 +- src/StdMeshers/StdMeshers_Import_1D2D.cxx | 4 +- src/StdMeshers/StdMeshers_MEFISTO_2D.cxx | 6 +- .../StdMeshers_NumberOfSegments.cxx | 10 +- .../StdMeshers_NumberOfSegments.hxx | 8 +- src/StdMeshers/StdMeshers_Penta_3D.cxx | 83 ++-- .../StdMeshers_PolygonPerFace_2D.cxx | 2 +- .../StdMeshers_PolyhedronPerSolid_3D.cxx | 4 +- src/StdMeshers/StdMeshers_Prism_3D.cxx | 52 +-- src/StdMeshers/StdMeshers_Prism_3D.hxx | 2 +- src/StdMeshers/StdMeshers_ProjectionUtils.cxx | 2 +- src/StdMeshers/StdMeshers_Projection_1D.cxx | 2 +- src/StdMeshers/StdMeshers_Projection_1D2D.cxx | 2 +- src/StdMeshers/StdMeshers_Projection_2D.cxx | 10 +- src/StdMeshers/StdMeshers_Projection_3D.cxx | 2 +- .../StdMeshers_QuadFromMedialAxis_1D2D.cxx | 4 +- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 18 +- src/StdMeshers/StdMeshers_RadialPrism_3D.cxx | 38 +- .../StdMeshers_RadialQuadrangle_1D2D.cxx | 18 +- src/StdMeshers/StdMeshers_Regular_1D.cxx | 222 +++++---- src/StdMeshers/StdMeshers_Regular_1D.hxx | 15 +- src/StdMeshers/StdMeshers_ViscousLayers.cxx | 4 +- src/StdMeshers/StdMeshers_ViscousLayers2D.cxx | 3 +- .../StdMeshersGUI_FixedPointsParamWdg.cxx | 17 +- .../StdMeshersGUI_FixedPointsParamWdg.h | 10 +- .../StdMeshersGUI_ObjectReferenceParamWdg.h | 6 +- .../StdMeshersGUI_QuadrangleParamWdg.cxx | 4 +- .../StdMeshers_FixedPoints1D_i.cxx | 20 +- .../StdMeshers_FixedPoints1D_i.hxx | 4 +- .../StdMeshers_NumberOfSegments_i.cxx | 2 +- .../StdMeshers_NumberOfSegments_i.hxx | 2 +- 220 files changed, 3684 insertions(+), 3337 deletions(-) create mode 100644 idl/SMESH_smIdType.idl.in diff --git a/CMakeLists.txt b/CMakeLists.txt index feff178cd..99d18c145 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,6 +71,7 @@ OPTION(SALOME_BUILD_GUI "Enable GUI" ON) OPTION(SALOME_SMESH_USE_CGNS "Enable import/export to CGNS format" OFF) OPTION(SALOME_SMESH_USE_TBB "Enable parallel computation" OFF) OPTION(SALOME_SMESH_DYNLOAD_LOCAL "Load plug-ins' symbols locally (Linux only)" ON) +OPTION(SALOME_USE_64BIT_IDS "Size of IDs to refer cells and nodes. 32 bits when OFF (default), 64 bits when ON." ON) OPTION(SMESH_USE_MESHGEMS_HYPOSET "Prefer MeshGems algorithms in sets of hypotheses" OFF) CMAKE_DEPENDENT_OPTION(SALOME_SMESH_BUILD_FRENCH_DOC "Generate SALOME SMESH French documentation" OFF "SALOME_BUILD_DOC" OFF) @@ -79,6 +80,12 @@ IF(SALOME_SMESH_DYNLOAD_LOCAL) ADD_DEFINITIONS(-DDYNLOAD_LOCAL) ENDIF(SALOME_SMESH_DYNLOAD_LOCAL) +IF(SALOME_USE_64BIT_IDS) + SET(SMESH_ID_TYPE "long long") +ELSE() + SET(SMESH_ID_TYPE "long") +ENDIF() + IF(SMESH_USE_MESHGEMS_HYPOSET) SET(SMESH_USE_MESHGEMS_HYPOSET_VAR "true") ELSE(SMESH_USE_MESHGEMS_HYPOSET) diff --git a/SalomeSMESHConfig.cmake.in b/SalomeSMESHConfig.cmake.in index fba20e0cb..4e3c909d9 100644 --- a/SalomeSMESHConfig.cmake.in +++ b/SalomeSMESHConfig.cmake.in @@ -123,6 +123,7 @@ SET(SALOME_INSTALL_PYTHON_SHARED "@SALOME_INSTALL_PYTHON_SHARED@") SET(SALOME_INSTALL_RES "@SALOME_INSTALL_RES@") SET(SALOME_INSTALL_DOC "@SALOME_INSTALL_DOC@") SET(SALOME_INSTALL_AMCONFIG_LOCAL "@SALOME_INSTALL_AMCONFIG_LOCAL@") +SET(SALOME_USE_64BIT_IDS @SALOME_USE_64BIT_IDS@) # Include GEOM targets if they were not already loaded: IF(NOT (TARGET GEOMbasic)) diff --git a/idl/CMakeLists.txt b/idl/CMakeLists.txt index 7ab17aef9..7b4108908 100644 --- a/idl/CMakeLists.txt +++ b/idl/CMakeLists.txt @@ -26,6 +26,8 @@ INCLUDE_DIRECTORIES( ${PROJECT_BINARY_DIR}/idl ) +SALOME_CONFIGURE_FILE(SMESH_smIdType.idl.in SMESH_smIdType.idl) + SET(SalomeIDLSMESH_IDLSOURCES SMESH_Gen.idl SMESH_Mesh.idl @@ -36,11 +38,13 @@ SET(SalomeIDLSMESH_IDLSOURCES SMESH_Pattern.idl SMESH_MeshEditor.idl SMESH_Measurements.idl + ${CMAKE_CURRENT_BINARY_DIR}/SMESH_smIdType.idl ) SET(_idl_include_dirs ${KERNEL_ROOT_DIR}/idl/salome ${GEOM_ROOT_DIR}/idl/salome + ${PROJECT_BINARY_DIR}/idl ) SET(_idl_link_flags diff --git a/idl/SMESH_BasicHypothesis.idl b/idl/SMESH_BasicHypothesis.idl index a6b6882cc..d9d482758 100644 --- a/idl/SMESH_BasicHypothesis.idl +++ b/idl/SMESH_BasicHypothesis.idl @@ -161,32 +161,32 @@ module StdMeshers /*! * Builds and returns point distribution according to passed density function */ - SMESH::double_array BuildDistributionExpr( in string func, in long nbSeg, in long conv ) + SMESH::double_array BuildDistributionExpr( in string func, in long nbSeg, in long conv ) raises (SALOME::SALOME_Exception); - SMESH::double_array BuildDistributionTab( in SMESH::double_array func, in long nbSeg, in long conv ) + SMESH::double_array BuildDistributionTab( in SMESH::double_array func, in long nbSeg, in long conv ) raises (SALOME::SALOME_Exception); /*! * Sets parameter value */ - void SetNumberOfSegments(in long segmentsNumber) + void SetNumberOfSegments(in SMESH::smIdType segmentsNumber) raises (SALOME::SALOME_Exception); /*! * Returns parameter value */ - long GetNumberOfSegments(); + long GetNumberOfSegments(); /*! * Sets parameter value */ - void SetDistrType(in long typ) + void SetDistrType(in long typ) raises (SALOME::SALOME_Exception); /*! * Returns parameter value */ - long GetDistrType(); + long GetDistrType(); /*! * Sets parameter value @@ -227,13 +227,13 @@ module StdMeshers /*! * Sets parameter value for functional distributions */ - void SetConversionMode(in long conv ) + void SetConversionMode(in long conv ) raises (SALOME::SALOME_Exception); /*! * Returns parameter value for functional distributions */ - long ConversionMode() + long ConversionMode() raises (SALOME::SALOME_Exception); }; @@ -323,13 +323,13 @@ module StdMeshers /*! * Sets parameter value */ - void SetMode(in long mode) + void SetMode(in long mode) raises (SALOME::SALOME_Exception); /*! * Returns parameter value */ - long GetMode(); + long GetMode(); }; /*! @@ -395,7 +395,7 @@ module StdMeshers */ void SetPoints(in SMESH::double_array listParams) raises (SALOME::SALOME_Exception); - void SetNbSegments(in SMESH::long_array listNbSeg) + void SetNbSegments(in SMESH::smIdType_array listNbSeg) raises (SALOME::SALOME_Exception); /*! @@ -406,7 +406,7 @@ module StdMeshers /*! * Returns list of numbers of segments */ - SMESH::long_array GetNbSegments(); + SMESH::smIdType_array GetNbSegments(); }; @@ -519,13 +519,13 @@ module StdMeshers /*! * Sets parameter value */ - void SetNumberOfLayers(in long numberOfLayers) + void SetNumberOfLayers(in long numberOfLayers) raises (SALOME::SALOME_Exception); /*! * Returns parameter value */ - long GetNumberOfLayers(); + long GetNumberOfLayers(); }; @@ -665,7 +665,7 @@ module StdMeshers * Result may be nil if association not set. * Valid indices are 1 and 2 */ - GEOM::GEOM_Object GetSourceVertex(in long i) + GEOM::GEOM_Object GetSourceVertex(in long i) raises (SALOME::SALOME_Exception); /*! @@ -673,7 +673,7 @@ module StdMeshers * Result may be nil if association not set. * Valid indices are 1 and 2 */ - GEOM::GEOM_Object GetTargetVertex(in long i) + GEOM::GEOM_Object GetTargetVertex(in long i) raises (SALOME::SALOME_Exception); }; @@ -722,7 +722,7 @@ module StdMeshers * Result may be nil if association not set. * Valid indices are 1 and 2 */ - GEOM::GEOM_Object GetSourceVertex(in long i) + GEOM::GEOM_Object GetSourceVertex(in long i) raises (SALOME::SALOME_Exception); /*! @@ -730,7 +730,7 @@ module StdMeshers * Result may be nil if association not set. * Valid indices are 1 and 2 */ - GEOM::GEOM_Object GetTargetVertex(in long i) + GEOM::GEOM_Object GetTargetVertex(in long i) raises (SALOME::SALOME_Exception); }; @@ -771,12 +771,12 @@ module StdMeshers /*! * Set base vertex for triangles */ - void SetTriaVertex( in long vertID ); + void SetTriaVertex( in long vertID ); /*! * Returns base vertex for triangles */ - long GetTriaVertex(); + long GetTriaVertex(); /*! * Set entry of the main object diff --git a/idl/SMESH_Filter.idl b/idl/SMESH_Filter.idl index 1d3e0f187..1477f8423 100644 --- a/idl/SMESH_Filter.idl +++ b/idl/SMESH_Filter.idl @@ -30,6 +30,7 @@ #include "SALOME_GenericObj.idl" #include "GEOM_Gen.idl" #include "SMESH_Mesh.idl" +#include "SMESH_smIdType.idl" module SMESH { @@ -119,8 +120,8 @@ module SMESH */ interface NumericalFunctor: Functor { - double GetValue ( in long theElementId ); - boolean IsApplicable( in long theElementId ); + double GetValue ( in smIdType theElementId ); + boolean IsApplicable( in smIdType theElementId ); Histogram GetHistogram ( in short nbIntervals, in boolean isLogarithmic ); Histogram GetLocalHistogram( in short nbIntervals, in boolean isLogarithmic, @@ -374,7 +375,7 @@ module SMESH */ interface RangeOfIds: Predicate { - void SetRange( in long_array theIds ); + void SetRange( in smIdType_array theIds ); boolean SetRangeStr( in string theRange ); string GetRangeStr(); @@ -474,7 +475,7 @@ module SMESH void SetElementType( in ElementType type ); void SetPoint ( in double x, in double y, in double z ); void SetVertex ( in GEOM::GEOM_Object vertex ); - void SetNode ( in long nodeID ); + void SetNode ( in smIdType nodeID ); string GetThreshold ( out ThresholdType type ); void SetThreshold ( in string threshold, in ThresholdType type ) raises (SALOME::SALOME_Exception); @@ -522,16 +523,16 @@ module SMESH typedef sequence Criteria; - void SetPredicate( in Predicate thePredicate ); - void SetMesh( in SMESH_Mesh theMesh ); + void SetPredicate( in Predicate thePredicate ); + void SetMesh( in SMESH_Mesh theMesh ); - long_array GetElementsId( in SMESH_Mesh theMesh ); - long_array GetElementsIdFromParts( in ListOfIDSources theParts ); - ElementType GetElementType(); - Predicate GetPredicate(); + smIdType_array GetElementsId( in SMESH_Mesh theMesh ); + smIdType_array GetElementsIdFromParts( in ListOfIDSources theParts ); + ElementType GetElementType(); + Predicate GetPredicate(); - boolean GetCriteria( out Criteria theCriteria ); - boolean SetCriteria( in Criteria theCriteria ); + boolean GetCriteria( out Criteria theCriteria ); + boolean SetCriteria( in Criteria theCriteria ); }; diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index a7e4c5094..4e71c25d5 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -33,6 +33,7 @@ #include "SMESH_Mesh.idl" #include "SMESH_Hypothesis.idl" +#include "SMESH_smIdType.idl" module SMESH { @@ -385,8 +386,8 @@ module SMESH /*! * Evaluates size of prospective mesh on a shape */ - long_array Evaluate(in SMESH_Mesh theMesh, - in GEOM::GEOM_Object theSubObject) + smIdType_array Evaluate(in SMESH_Mesh theMesh, + in GEOM::GEOM_Object theSubObject) raises ( SALOME::SALOME_Exception ); /*! @@ -444,17 +445,17 @@ module SMESH * The returned geometrical object, if not nil, is either found in the * study or is published by this method with the given name */ - GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh, - in long theElementID, - in string theGeomName) + GEOM::GEOM_Object GetGeometryByMeshElement( in SMESH_Mesh theMesh, + in smIdType theElementID, + in string theGeomName) raises ( SALOME::SALOME_Exception ); /*! * Return geometrical object the given element is built on. * The returned geometrical object not published in study by this method. */ - GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh, - in long theElementID) + GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh, + in smIdType theElementID) raises ( SALOME::SALOME_Exception ); /*! diff --git a/idl/SMESH_Group.idl b/idl/SMESH_Group.idl index b22fa7b1f..9c704d70a 100644 --- a/idl/SMESH_Group.idl +++ b/idl/SMESH_Group.idl @@ -32,6 +32,7 @@ #include "SALOMEDS_Attributes.idl" #include "SMESH_Mesh.idl" +#include "SMESH_smIdType.idl" module SMESH { @@ -61,7 +62,7 @@ module SMESH /*! * Returns the number of elements in the group */ - long Size(); + smIdType Size(); /*! * Returns true if the group does not contain any elements @@ -71,29 +72,29 @@ module SMESH /*! * returns true if the group contains an element with ID == */ - boolean Contains( in long elem_id ); + boolean Contains( in smIdType elem_id ); /*! * Returns ID of an element at position counted from 1 */ - long GetID( in long elem_index ); + smIdType GetID( in smIdType elem_index ); /*! * Returns a sequence of all element IDs in the group */ - long_array GetListOfID(); + smIdType_array GetListOfID(); /*! * Get the number of nodes of cells included to the group * For a nodal group returns the same value as Size() function */ - long GetNumberOfNodes(); + smIdType GetNumberOfNodes(); /*! * Get IDs of nodes of cells included to the group * For a nodal group returns result of GetListOfID() function */ - long_array GetNodeIDs(); + smIdType_array GetNodeIDs(); /*! * Return true if GetNumberOfNodes() won't take a long time for computation @@ -142,24 +143,24 @@ module SMESH /*! * Adds elements or nodes with specified identifiers to the group */ - long Add( in long_array elem_ids ); + smIdType Add( in smIdType_array elem_ids ); /*! * Adds elements or nodes that match specified predicate to the group */ - long AddByPredicate( in Predicate thePredicate ); + smIdType AddByPredicate( in Predicate thePredicate ); /*! * Add all elements or nodes from the specified source to the group */ - long AddFrom( in SMESH_IDSource theSource ); + smIdType AddFrom( in SMESH_IDSource theSource ); /*! * Removes elements or nodes with specified identifiers from the group */ - long Remove( in long_array elem_ids ); + smIdType Remove( in smIdType_array elem_ids ); /*! * Removes elements or nodes that match specified predicate from the group */ - long RemoveByPredicate( in Predicate thePredicate ); + smIdType RemoveByPredicate( in Predicate thePredicate ); }; diff --git a/idl/SMESH_Hypothesis.idl b/idl/SMESH_Hypothesis.idl index d955b7113..1e98120bb 100644 --- a/idl/SMESH_Hypothesis.idl +++ b/idl/SMESH_Hypothesis.idl @@ -57,7 +57,7 @@ module SMESH /*! * Get the internal Id */ - long GetId(); + short GetId(); /*! * Set the variable parameter diff --git a/idl/SMESH_Measurements.idl b/idl/SMESH_Measurements.idl index 726f543ec..9a04e17e2 100644 --- a/idl/SMESH_Measurements.idl +++ b/idl/SMESH_Measurements.idl @@ -28,6 +28,7 @@ #include "SALOME_GenericObj.idl" #include "SMESH_Mesh.idl" +#include "SMESH_smIdType.idl" module SMESH { @@ -37,8 +38,8 @@ module SMESH struct Measure { double minX, minY, minZ; double maxX, maxY, maxZ; - long node1, node2; - long elem1, elem2; + smIdType node1, node2; + smIdType elem1, elem2; double value; }; diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 9fdde321f..21f5bdcd9 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -29,6 +29,7 @@ #include "SALOME_Exception.idl" #include "SALOME_GenericObj.idl" #include "GEOM_Gen.idl" +#include "SMESH_smIdType.idl" module SMESH { @@ -41,6 +42,7 @@ module SMESH typedef sequence double_array ; typedef sequence long_array ; + typedef sequence smIdType_array ; typedef sequence string_array ; typedef sequence array_of_long_array ; @@ -228,12 +230,12 @@ module SMESH enum DriverMED_ReadStatus // in the order of severity { DRS_OK, - DRS_EMPTY, // a file contains no mesh with the given name - DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers, - // so the numbers from the file are ignored - DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data + DRS_EMPTY, // a file contains no mesh with the given name + DRS_WARN_RENUMBER, // a MED file has overlapped ranges of element numbers, + // so the numbers from the file are ignored + DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity - DRS_FAIL // general failure (exception etc.) + DRS_FAIL // general failure (exception etc.) }; /*! @@ -267,7 +269,7 @@ module SMESH */ struct ElementSubType { ElementType SMDS_ElementType; boolean isPoly; - long nbNodesInElement; }; + short nbNodesInElement; }; typedef sequence types_array; @@ -285,19 +287,19 @@ module SMESH /*! * Returns a sequence of all element IDs */ - long_array GetIDs(); + smIdType_array GetIDs(); /*! * Returns number of mesh elements of each \a EntityType * @return array of number of elements per \a EntityType */ - long_array GetMeshInfo(); + smIdType_array GetMeshInfo(); /*! * Returns number of mesh elements of each \a ElementType * @return array of number of elements per \a ElementType */ - long_array GetNbElementsByType(); + smIdType_array GetNbElementsByType(); /*! * Returns types of elements it contains. @@ -747,121 +749,121 @@ module SMESH /*! * Get information about mesh contents */ - long NbNodes() + smIdType NbNodes() raises (SALOME::SALOME_Exception); - long NbElements() + smIdType NbElements() raises (SALOME::SALOME_Exception); - long Nb0DElements() + smIdType Nb0DElements() raises (SALOME::SALOME_Exception); - long NbBalls() + smIdType NbBalls() raises (SALOME::SALOME_Exception); - long NbEdges() + smIdType NbEdges() raises (SALOME::SALOME_Exception); - long NbEdgesOfOrder(in ElementOrder order) + smIdType NbEdgesOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbFaces() + smIdType NbFaces() raises (SALOME::SALOME_Exception); - long NbFacesOfOrder(in ElementOrder order) + smIdType NbFacesOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbTriangles() + smIdType NbTriangles() raises (SALOME::SALOME_Exception); - long NbTrianglesOfOrder(in ElementOrder order) + smIdType NbTrianglesOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbBiQuadTriangles() + smIdType NbBiQuadTriangles() raises (SALOME::SALOME_Exception); - long NbQuadrangles() + smIdType NbQuadrangles() raises (SALOME::SALOME_Exception); - long NbQuadranglesOfOrder(in ElementOrder order) + smIdType NbQuadranglesOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbBiQuadQuadrangles() + smIdType NbBiQuadQuadrangles() raises (SALOME::SALOME_Exception); - long NbPolygons() + smIdType NbPolygons() raises (SALOME::SALOME_Exception); - long NbPolygonsOfOrder(in ElementOrder order) + smIdType NbPolygonsOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbVolumes() + smIdType NbVolumes() raises (SALOME::SALOME_Exception); - long NbVolumesOfOrder(in ElementOrder order) + smIdType NbVolumesOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbTetras() + smIdType NbTetras() raises (SALOME::SALOME_Exception); - long NbTetrasOfOrder(in ElementOrder order) + smIdType NbTetrasOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbHexas() + smIdType NbHexas() raises (SALOME::SALOME_Exception); - long NbHexasOfOrder(in ElementOrder order) + smIdType NbHexasOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbTriQuadraticHexas() + smIdType NbTriQuadraticHexas() raises (SALOME::SALOME_Exception); - long NbPyramids() + smIdType NbPyramids() raises (SALOME::SALOME_Exception); - long NbPyramidsOfOrder(in ElementOrder order) + smIdType NbPyramidsOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbPrisms() + smIdType NbPrisms() raises (SALOME::SALOME_Exception); - long NbPrismsOfOrder(in ElementOrder order) + smIdType NbPrismsOfOrder(in ElementOrder order) raises (SALOME::SALOME_Exception); - long NbHexagonalPrisms() + smIdType NbHexagonalPrisms() raises (SALOME::SALOME_Exception); - long NbPolyhedrons() + smIdType NbPolyhedrons() raises (SALOME::SALOME_Exception); - long NbSubMesh() + smIdType NbSubMesh() raises (SALOME::SALOME_Exception); - long_array GetElementsId() + smIdType_array GetElementsId() raises (SALOME::SALOME_Exception); - long_array GetElementsByType( in ElementType theType ) + smIdType_array GetElementsByType( in ElementType theType ) raises (SALOME::SALOME_Exception); - long_array GetNodesId() + smIdType_array GetNodesId() raises (SALOME::SALOME_Exception); /*! * Returns type of mesh element */ - ElementType GetElementType( in long id, in boolean iselem ) + ElementType GetElementType( in smIdType id, in boolean iselem ) raises (SALOME::SALOME_Exception); - EntityType GetElementGeomType( in long id ) + EntityType GetElementGeomType( in smIdType id ) raises (SALOME::SALOME_Exception); - GeometryType GetElementShape( in long id ) + GeometryType GetElementShape( in smIdType id ) raises (SALOME::SALOME_Exception); - long_array GetSubMeshElementsId(in long ShapeID) + smIdType_array GetSubMeshElementsId(in long ShapeID) raises (SALOME::SALOME_Exception); - long_array GetSubMeshNodesId(in long ShapeID, in boolean all ) + smIdType_array GetSubMeshNodesId(in long ShapeID, in boolean all ) raises (SALOME::SALOME_Exception); ElementType GetSubMeshElementType(in long ShapeID) @@ -902,81 +904,81 @@ module SMESH * Get XYZ coordinates of node as list of double * If there is not node for given ID - returns empty list */ - double_array GetNodeXYZ(in long id); + double_array GetNodeXYZ(in smIdType id); /*! * For given node returns list of IDs of inverse elements * If there is not node for given ID - returns empty list */ - long_array GetNodeInverseElements(in long id, in ElementType elemType); + smIdType_array GetNodeInverseElements(in smIdType id, in ElementType elemType); /*! * \brief Return position of a node on shape */ - NodePosition GetNodePosition(in long NodeID); + NodePosition GetNodePosition(in smIdType NodeID); /*! * \brief Return position of an element on shape */ - ElementPosition GetElementPosition(in long ElemID); + ElementPosition GetElementPosition(in smIdType ElemID); /*! * If given element is node returns IDs of shape from position * If there is not node for given ID - returns -1 */ - long GetShapeID(in long id); + long GetShapeID(in smIdType id); /*! * For given element returns ID of result shape after * ::FindShape() from SMESH_MeshEditor * If there is not element for given ID - returns -1 */ - long GetShapeIDForElem(in long id); + long GetShapeIDForElem(in smIdType id); /*! * Returns number of nodes for given element * If there is not element for given ID - returns -1 */ - long GetElemNbNodes(in long id); + short GetElemNbNodes(in smIdType id); /*! * Returns IDs of nodes of given element */ - long_array GetElemNodes(in long id); + smIdType_array GetElemNodes(in smIdType id); /*! * Returns ID of node by given index for given element * If there is not element for given ID - returns -1 * If there is not node for given index - returns -2 */ - long GetElemNode(in long id, in long index); + smIdType GetElemNode(in smIdType id, in short index); /*! * Returns true if given node is medium node * in given quadratic element */ - boolean IsMediumNode(in long ide, in long idn); + boolean IsMediumNode(in smIdType ide, in smIdType idn); /*! * Returns true if given node is medium node * in one of quadratic elements */ - boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type); + boolean IsMediumNodeOfAnyElem(in smIdType idn, in ElementType elem_type); /*! * Returns number of edges for given element */ - long ElemNbEdges(in long id); + long ElemNbEdges(in smIdType id); /*! * Returns number of faces for given element */ - long ElemNbFaces(in long id); + long ElemNbFaces(in smIdType id); /*! * Returns nodes of given face (counted from zero) for given volumic element. */ - long_array GetElemFaceNodes(in long elemId, in short faceIndex); + smIdType_array GetElemFaceNodes(in smIdType elemId, in short faceIndex); /*! * Returns three components of normal of given mesh face (or an empty array in KO case) @@ -986,34 +988,34 @@ module SMESH /*! * Returns an element based on all given nodes. */ - long FindElementByNodes(in long_array nodes); + smIdType FindElementByNodes(in smIdType_array nodes); /*! * Return elements including all given nodes. */ - long_array GetElementsByNodes(in long_array nodes, in ElementType elem_type); + smIdType_array GetElementsByNodes(in smIdType_array nodes, in ElementType elem_type); /*! * Returns true if given element is polygon */ - boolean IsPoly(in long id); + boolean IsPoly(in smIdType id); /*! * Returns true if given element is quadratic */ - boolean IsQuadratic(in long id); + boolean IsQuadratic(in smIdType id); /*! * Returns diameter of a ball discrete element or zero in case of an invalid \a id */ - double GetBallDiameter(in long id); + double GetBallDiameter(in smIdType id); /*! * Returns XYZ coordinates of bary center for given element * as list of double * If there is not element for given ID - returns empty list */ - double_array BaryCenter(in long id); + double_array BaryCenter(in smIdType id); /*! Gets information about imported MED file */ MedFileInfo GetMEDFileInfo(); @@ -1040,37 +1042,37 @@ module SMESH /*! * */ - long GetNumberOfElements() + smIdType GetNumberOfElements() raises (SALOME::SALOME_Exception); /*! * */ - long GetNumberOfNodes( in boolean all ) + smIdType GetNumberOfNodes( in boolean all ) raises (SALOME::SALOME_Exception); /*! * */ - long_array GetElementsId() + smIdType_array GetElementsId() raises (SALOME::SALOME_Exception); /*! * */ - long_array GetElementsByType( in ElementType theType ) + smIdType_array GetElementsByType( in ElementType theType ) raises (SALOME::SALOME_Exception); /*! * Returns type of mesh element (same as SMESH_Mesh::GetElementType() ) */ - ElementType GetElementType( in long id, in boolean iselem ) + ElementType GetElementType( in smIdType id, in boolean iselem ) raises (SALOME::SALOME_Exception); /*! * */ - long_array GetNodesId() + smIdType_array GetNodesId() raises (SALOME::SALOME_Exception); /*! diff --git a/idl/SMESH_MeshEditor.idl b/idl/SMESH_MeshEditor.idl index 7b8775a7b..e0aa9a321 100644 --- a/idl/SMESH_MeshEditor.idl +++ b/idl/SMESH_MeshEditor.idl @@ -26,6 +26,7 @@ #include "SMESH_Mesh.idl" #include "SMESH_Gen.idl" +#include "SMESH_smIdType.idl" module SMESH { @@ -36,7 +37,7 @@ module SMESH struct FreeBorder { - SMESH::long_array nodeIDs; // all nodes defining a free border + SMESH::smIdType_array nodeIDs; // all nodes defining a free border // 1st and last node is same in a closed border }; struct FreeBorderPart @@ -66,13 +67,13 @@ module SMESH // else ==> point is at xyz* // point 1 - long node1ID1; - long node1ID2; + smIdType node1ID1; + smIdType node1ID2; PointStruct xyz1; // point 2 - long node2ID1; - long node2ID2; + smIdType node2ID1; + smIdType node2ID2; PointStruct xyz2; // vector on the plane; to use a default plane set vector = (0,0,0) @@ -83,9 +84,9 @@ module SMESH // face edge defined by two nodes + optional medium node struct FaceEdge { - long node1; - long node2; - long medium; + smIdType node1; + smIdType node2; + smIdType medium; }; typedef sequence ListOfEdges; @@ -112,14 +113,14 @@ module SMESH * created, this method returns list of their IDs, if new nodes * not created - returns empty list */ - long_array GetLastCreatedNodes() raises (SALOME::SALOME_Exception); + smIdType_array GetLastCreatedNodes() raises (SALOME::SALOME_Exception); /*! * If during last operation of MeshEditor some elements were * created, this method returns list of their IDs, if new elements * not created - returns empty list */ - long_array GetLastCreatedElems() raises (SALOME::SALOME_Exception); + smIdType_array GetLastCreatedElems() raises (SALOME::SALOME_Exception); /*! * \brief Clears sequences of last created elements and nodes @@ -136,27 +137,27 @@ module SMESH * \param IDsOfElements list of mesh elements identifiers * \return new ID source object */ - SMESH_IDSource MakeIDSource(in long_array IDsOfElements, in ElementType type); + SMESH_IDSource MakeIDSource(in smIdType_array IDsOfElements, in ElementType type); /*! * \brief Remove mesh elements specified by their identifiers. * \param IDsOfElements list of mesh elements identifiers * \return \c true if elements are correctly removed or \c false otherwise */ - boolean RemoveElements(in long_array IDsOfElements) raises (SALOME::SALOME_Exception); + boolean RemoveElements(in smIdType_array IDsOfElements) raises (SALOME::SALOME_Exception); /*! * \brief Remove mesh nodes specified by their identifiers. * \param IDsOfNodes list of mesh nodes identifiers * \return \c true if nodes are correctly removed or \c false otherwise */ - boolean RemoveNodes(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception); + boolean RemoveNodes(in smIdType_array IDsOfNodes) raises (SALOME::SALOME_Exception); /*! * \brief Remove all orphan nodes. * \return number of removed nodes */ - long RemoveOrphanNodes() raises (SALOME::SALOME_Exception); + smIdType RemoveOrphanNodes() raises (SALOME::SALOME_Exception); /*! * \brief Add a new node. @@ -165,21 +166,21 @@ module SMESH * \param z Z coordinate of new node * \return integer identifier of new node */ - long AddNode(in double x, in double y, in double z) raises (SALOME::SALOME_Exception); + smIdType AddNode(in double x, in double y, in double z) raises (SALOME::SALOME_Exception); /*! * Create a 0D element on the given node. * \param IdOfNode Node IDs for creation of element. * \param DuplicateElements to add one more 0D element to a node or not */ - long Add0DElement(in long IDOfNode, - in boolean DuplicateElements) raises (SALOME::SALOME_Exception); + smIdType Add0DElement(in smIdType IDOfNode, + in boolean DuplicateElements) raises (SALOME::SALOME_Exception); /*! * Create a ball element on the given node. * \param IdOfNode Node IDs for creation of element. */ - long AddBall(in long IDOfNode, in double diameter) raises (SALOME::SALOME_Exception); + smIdType AddBall(in smIdType IDOfNode, in double diameter) raises (SALOME::SALOME_Exception); /*! * Create an edge, either linear and quadratic (this is determed @@ -189,7 +190,7 @@ module SMESH * of MED. This description is located by the following link: * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. */ - long AddEdge(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception); + smIdType AddEdge(in smIdType_array IDsOfNodes) raises (SALOME::SALOME_Exception); /*! * Create face, either linear and quadratic (this is determed @@ -199,16 +200,16 @@ module SMESH * of MED. This description is located by the following link: * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. */ - long AddFace(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception); + smIdType AddFace(in smIdType_array IDsOfNodes) raises (SALOME::SALOME_Exception); - long AddPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception); + smIdType AddPolygonalFace(in smIdType_array IdsOfNodes) raises (SALOME::SALOME_Exception); /*! * Create a quadratic polygonal face * \param IdsOfNodes - nodes of the polygon; corner nodes follow first - * \return long - ID of a new polygon + * \return smIdType- ID of a new polygon */ - long AddQuadPolygonalFace(in long_array IdsOfNodes) raises (SALOME::SALOME_Exception); + smIdType AddQuadPolygonalFace(in smIdType_array IdsOfNodes) raises (SALOME::SALOME_Exception); /*! * Create volume, either linear and quadratic (this is determed @@ -218,7 +219,7 @@ module SMESH * of MED. This description is located by the following link: * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. */ - long AddVolume(in long_array IDsOfNodes) raises (SALOME::SALOME_Exception); + smIdType AddVolume(in smIdType_array IDsOfNodes) raises (SALOME::SALOME_Exception); /*! * Create volume of many faces, giving nodes for each face. @@ -226,15 +227,15 @@ module SMESH * \param Quantities List of integer values, Quantities[i] * gives quantity of nodes in face number i. */ - long AddPolyhedralVolume (in long_array IdsOfNodes, - in long_array Quantities) raises (SALOME::SALOME_Exception); + smIdType AddPolyhedralVolume (in smIdType_array IdsOfNodes, + in long_array Quantities) raises (SALOME::SALOME_Exception); /*! * Create volume of many faces, giving IDs of existing faces. * \param IdsOfFaces List of face IDs for volume creation. * \note The created volume will refer only to nodes * of the given faces, not to the faces itself. */ - long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces) raises (SALOME::SALOME_Exception); + smIdType AddPolyhedralVolumeByFaces (in smIdType_array IdsOfFaces) raises (SALOME::SALOME_Exception); /*! * Create 0D elements on all nodes of the given object. @@ -255,7 +256,7 @@ module SMESH * \param NodeID - node ID * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0] */ - void SetNodeOnVertex(in long NodeID, in long VertexID) + void SetNodeOnVertex(in smIdType NodeID, in long VertexID) raises (SALOME::SALOME_Exception); /*! * \brief Store node position on an edge @@ -263,7 +264,7 @@ module SMESH * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0] * \param paramOnEdge - parameter on edge where the node is located */ - void SetNodeOnEdge(in long NodeID, in long EdgeID, in double paramOnEdge) + void SetNodeOnEdge(in smIdType NodeID, in long EdgeID, in double paramOnEdge) raises (SALOME::SALOME_Exception); /*! * \brief Store node position on a face @@ -272,34 +273,34 @@ module SMESH * \param u - U parameter on face where the node is located * \param v - V parameter on face where the node is located */ - void SetNodeOnFace(in long NodeID, in long FaceID, in double u, in double v) + void SetNodeOnFace(in smIdType NodeID, in long FaceID, in double u, in double v) raises (SALOME::SALOME_Exception); /*! * \brief Bind a node to a solid * \param NodeID - node ID * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0] */ - void SetNodeInVolume(in long NodeID, in long SolidID) + void SetNodeInVolume(in smIdType NodeID, in long SolidID) raises (SALOME::SALOME_Exception); /*! * \brief Bind an element to a shape * \param ElementID - element ID * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0] */ - void SetMeshElementOnShape(in long ElementID, in long ShapeID) + void SetMeshElementOnShape(in smIdType ElementID, in long ShapeID) raises (SALOME::SALOME_Exception); - boolean MoveNode(in long NodeID, in double x, in double y, in double z) + boolean MoveNode(in smIdType NodeID, in double x, in double y, in double z) raises (SALOME::SALOME_Exception); - boolean InverseDiag(in long NodeID1, in long NodeID2) + boolean InverseDiag(in smIdType NodeID1, in smIdType NodeID2) raises (SALOME::SALOME_Exception); - boolean DeleteDiag(in long NodeID1, in long NodeID2) + boolean DeleteDiag(in smIdType NodeID1, in smIdType NodeID2) raises (SALOME::SALOME_Exception); - boolean Reorient(in long_array IDsOfElements) + boolean Reorient(in smIdType_array IDsOfElements) raises (SALOME::SALOME_Exception); boolean ReorientObject(in SMESH_IDSource theObject) @@ -337,7 +338,7 @@ module SMESH * is still performed; theMaxAngle is measured in radians. * \return \c true in case of success, FALSE otherwise. */ - boolean TriToQuad (in long_array IDsOfElements, + boolean TriToQuad (in smIdType_array IDsOfElements, in NumericalFunctor Criterion, in double MaxAngle) raises (SALOME::SALOME_Exception); /*! @@ -355,7 +356,7 @@ module SMESH * \param theCriterion Is used to choose a diagonal for splitting. * \return TRUE in case of success, FALSE otherwise. */ - boolean QuadToTri (in long_array IDsOfElements, + boolean QuadToTri (in smIdType_array IDsOfElements, in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception); /*! * \brief Split quadrangles into triangles. @@ -376,8 +377,8 @@ module SMESH * \param the13Diag Is used to choose a diagonal for splitting. * \return TRUE in case of success, FALSE otherwise. */ - boolean SplitQuad (in long_array IDsOfElements, - in boolean Diag13) raises (SALOME::SALOME_Exception); + boolean SplitQuad (in smIdType_array IDsOfElements, + in boolean Diag13) raises (SALOME::SALOME_Exception); /*! * \brief Split quadrangles into triangles. * @@ -393,7 +394,7 @@ module SMESH * \return 1 if 1-3 diagonal is better, 2 if 2-4 * diagonal is better, 0 if error occurs. */ - long BestSplit (in long IDOfQuad, + long BestSplit (in long IDOfQuad, in NumericalFunctor Criterion) raises (SALOME::SALOME_Exception); /*! @@ -443,29 +444,29 @@ module SMESH enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH }; - boolean Smooth(in long_array IDsOfElements, - in long_array IDsOfFixedNodes, - in long MaxNbOfIterations, - in double MaxAspectRatio, - in Smooth_Method Method) raises (SALOME::SALOME_Exception); - - boolean SmoothObject(in SMESH_IDSource theObject, - in long_array IDsOfFixedNodes, - in long MaxNbOfIterations, - in double MaxAspectRatio, - in Smooth_Method Method) raises (SALOME::SALOME_Exception); - - boolean SmoothParametric(in long_array IDsOfElements, - in long_array IDsOfFixedNodes, - in long MaxNbOfIterations, - in double MaxAspectRatio, - in Smooth_Method Method) raises (SALOME::SALOME_Exception); - - boolean SmoothParametricObject(in SMESH_IDSource theObject, - in long_array IDsOfFixedNodes, - in long MaxNbOfIterations, - in double MaxAspectRatio, - in Smooth_Method Method) raises (SALOME::SALOME_Exception); + boolean Smooth(in smIdType_array IDsOfElements, + in smIdType_array IDsOfFixedNodes, + in short MaxNbOfIterations, + in double MaxAspectRatio, + in Smooth_Method Method) raises (SALOME::SALOME_Exception); + + boolean SmoothObject(in SMESH_IDSource theObject, + in smIdType_array IDsOfFixedNodes, + in short MaxNbOfIterations, + in double MaxAspectRatio, + in Smooth_Method Method) raises (SALOME::SALOME_Exception); + + boolean SmoothParametric(in smIdType_array IDsOfElements, + in smIdType_array IDsOfFixedNodes, + in short MaxNbOfIterations, + in double MaxAspectRatio, + in Smooth_Method Method) raises (SALOME::SALOME_Exception); + + boolean SmoothParametricObject(in SMESH_IDSource theObject, + in smIdType_array IDsOfFixedNodes, + in short MaxNbOfIterations, + in double MaxAspectRatio, + in Smooth_Method Method) raises (SALOME::SALOME_Exception); void ConvertToQuadratic(in boolean theForce3d) raises (SALOME::SALOME_Exception); @@ -561,12 +562,12 @@ module SMESH * corresponding to groups the input elements included in. * \return ListOfGroups - new groups created if \a ToMakeGroups is true */ - ListOfGroups AdvancedExtrusion(in long_array IDsOfElements, - in DirStruct StepVector, - in long NbOfSteps, - in long ExtrFlags, - in double SewTolerance, - in boolean ToMakeGroups) + ListOfGroups AdvancedExtrusion(in smIdType_array IDsOfElements, + in DirStruct StepVector, + in long NbOfSteps, + in long ExtrFlags, + in double SewTolerance, + in boolean ToMakeGroups) raises (SALOME::SALOME_Exception); enum Extrusion_Error { @@ -584,7 +585,7 @@ module SMESH in ListOfIDSources Faces, in SMESH_IDSource Path, in GEOM::GEOM_Object PathShape, - in long NodeStart, + in smIdType NodeStart, in boolean HasAngles, in double_array Angles, in boolean AnglesVariation, @@ -610,20 +611,20 @@ module SMESH enum MirrorType { POINT, AXIS, PLANE }; - void Mirror (in long_array IDsOfElements, - in AxisStruct Mirror, - in MirrorType Type, - in boolean Copy) + void Mirror (in smIdType_array IDsOfElements, + in AxisStruct Mirror, + in MirrorType Type, + in boolean Copy) raises (SALOME::SALOME_Exception); - ListOfGroups MirrorMakeGroups (in long_array IDsOfElements, - in AxisStruct Mirror, - in MirrorType Type) + ListOfGroups MirrorMakeGroups (in smIdType_array IDsOfElements, + in AxisStruct Mirror, + in MirrorType Type) raises (SALOME::SALOME_Exception); - SMESH_Mesh MirrorMakeMesh (in long_array IDsOfElements, - in AxisStruct Mirror, - in MirrorType Type, - in boolean CopyGroups, - in string MeshName) + SMESH_Mesh MirrorMakeMesh (in smIdType_array IDsOfElements, + in AxisStruct Mirror, + in MirrorType Type, + in boolean CopyGroups, + in string MeshName) raises (SALOME::SALOME_Exception); void MirrorObject (in SMESH_IDSource theObject, @@ -642,17 +643,17 @@ module SMESH in string MeshName) raises (SALOME::SALOME_Exception); - void Translate (in long_array IDsOfElements, - in DirStruct Vector, - in boolean Copy) + void Translate (in smIdType_array IDsOfElements, + in DirStruct Vector, + in boolean Copy) raises (SALOME::SALOME_Exception); - ListOfGroups TranslateMakeGroups (in long_array IDsOfElements, - in DirStruct Vector) + ListOfGroups TranslateMakeGroups (in smIdType_array IDsOfElements, + in DirStruct Vector) raises (SALOME::SALOME_Exception); - SMESH_Mesh TranslateMakeMesh (in long_array IDsOfElements, - in DirStruct Vector, - in boolean CopyGroups, - in string MeshName) + SMESH_Mesh TranslateMakeMesh (in smIdType_array IDsOfElements, + in DirStruct Vector, + in boolean CopyGroups, + in string MeshName) raises (SALOME::SALOME_Exception); void TranslateObject (in SMESH_IDSource theObject, @@ -684,20 +685,20 @@ module SMESH in string MeshName) raises (SALOME::SALOME_Exception); - void Rotate (in long_array IDsOfElements, - in AxisStruct Axis, - in double AngleInRadians, - in boolean Copy) + void Rotate (in smIdType_array IDsOfElements, + in AxisStruct Axis, + in double AngleInRadians, + in boolean Copy) raises (SALOME::SALOME_Exception); - ListOfGroups RotateMakeGroups (in long_array IDsOfElements, - in AxisStruct Axis, - in double AngleInRadians) + ListOfGroups RotateMakeGroups (in smIdType_array IDsOfElements, + in AxisStruct Axis, + in double AngleInRadians) raises (SALOME::SALOME_Exception); - SMESH_Mesh RotateMakeMesh (in long_array IDsOfElements, - in AxisStruct Axis, - in double AngleInRadians, - in boolean CopyGroups, - in string MeshName) + SMESH_Mesh RotateMakeMesh (in smIdType_array IDsOfElements, + in AxisStruct Axis, + in double AngleInRadians, + in boolean CopyGroups, + in string MeshName) raises (SALOME::SALOME_Exception); void RotateObject (in SMESH_IDSource theObject, @@ -775,13 +776,13 @@ module SMESH * If the given ID is a valid node ID (nodeID > 0), just move this node, else * move the node closest to the point to point's location and return ID of the node */ - long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID) + smIdType MoveClosestNodeToPoint(in double x, in double y, in double z, in smIdType nodeID) raises (SALOME::SALOME_Exception); /*! * Return ID of node closest to a given point */ - long FindNodeClosestTo(in double x, in double y, in double z) + smIdType FindNodeClosestTo(in double x, in double y, in double z) raises (SALOME::SALOME_Exception); /*! @@ -789,7 +790,7 @@ module SMESH * * 'ALL' type means elements of any type excluding nodes and 0D elements */ - long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type) + smIdType_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type) raises (SALOME::SALOME_Exception); /*! @@ -798,9 +799,9 @@ module SMESH * * 'ALL' type means elements of any type excluding nodes and 0D elements */ - long_array FindAmongElementsByPoint(in SMESH_IDSource elements, - in double x, in double y, in double z, - in ElementType type) + smIdType_array FindAmongElementsByPoint(in SMESH_IDSource elements, + in double x, in double y, in double z, + in ElementType type) raises (SALOME::SALOME_Exception); /*! @@ -809,12 +810,12 @@ module SMESH * and coordinates of the projection point. * In the case if nothing found, return -1 and [] */ - long ProjectPoint(in double x, - in double y, - in double z, - in ElementType type, - in SMESH_IDSource meshObject, - out double_array projecton) + smIdType ProjectPoint(in double x, + in double y, + in double z, + in ElementType type, + in SMESH_IDSource meshObject, + out double_array projecton) raises (SALOME::SALOME_Exception); /*! @@ -844,7 +845,7 @@ module SMESH * If a group is closed, the first and last nodes of the group are same. */ array_of_long_array Get1DBranches( in SMESH_IDSource edges, - in long startNode, + in smIdType startNode, out array_of_long_array nodeGroups) raises (SALOME::SALOME_Exception); @@ -898,38 +899,38 @@ module SMESH SEW_INTERNAL_ERROR }; - Sew_Error SewFreeBorders (in long FirstNodeID1, - in long SecondNodeID1, - in long LastNodeID1, - in long FirstNodeID2, - in long SecondNodeID2, - in long LastNodeID2, - in boolean CreatePolygons, - in boolean CreatePolyedrs) + Sew_Error SewFreeBorders (in smIdType FirstNodeID1, + in smIdType SecondNodeID1, + in smIdType LastNodeID1, + in smIdType FirstNodeID2, + in smIdType SecondNodeID2, + in smIdType LastNodeID2, + in boolean CreatePolygons, + in boolean CreatePolyedrs) raises (SALOME::SALOME_Exception); - Sew_Error SewConformFreeBorders (in long FirstNodeID1, - in long SecondNodeID1, - in long LastNodeID1, - in long FirstNodeID2, - in long SecondNodeID2) + Sew_Error SewConformFreeBorders (in smIdType FirstNodeID1, + in smIdType SecondNodeID1, + in smIdType LastNodeID1, + in smIdType FirstNodeID2, + in smIdType SecondNodeID2) raises (SALOME::SALOME_Exception); - Sew_Error SewBorderToSide (in long FirstNodeIDOnFreeBorder, - in long SecondNodeIDOnFreeBorder, - in long LastNodeIDOnFreeBorder, - in long FirstNodeIDOnSide, - in long LastNodeIDOnSide, - in boolean CreatePolygons, - in boolean CreatePolyedrs) + Sew_Error SewBorderToSide (in smIdType FirstNodeIDOnFreeBorder, + in smIdType SecondNodeIDOnFreeBorder, + in smIdType LastNodeIDOnFreeBorder, + in smIdType FirstNodeIDOnSide, + in smIdType LastNodeIDOnSide, + in boolean CreatePolygons, + in boolean CreatePolyedrs) raises (SALOME::SALOME_Exception); - Sew_Error SewSideElements (in long_array IDsOfSide1Elements, - in long_array IDsOfSide2Elements, - in long NodeID1OfSide1ToMerge, - in long NodeID1OfSide2ToMerge, - in long NodeID2OfSide1ToMerge, - in long NodeID2OfSide2ToMerge) + Sew_Error SewSideElements (in smIdType_array IDsOfSide1Elements, + in smIdType_array IDsOfSide2Elements, + in smIdType NodeID1OfSide1ToMerge, + in smIdType NodeID1OfSide2ToMerge, + in smIdType NodeID2OfSide1ToMerge, + in smIdType NodeID2OfSide2ToMerge) raises (SALOME::SALOME_Exception); /*! @@ -937,7 +938,7 @@ module SMESH * If number of nodes is not corresponded to type of * element - returns false */ - boolean ChangeElemNodes(in long ide, in long_array newIDs) + boolean ChangeElemNodes(in smIdType id, in smIdType_array newIDs) raises (SALOME::SALOME_Exception); /*! @@ -965,7 +966,7 @@ module SMESH * \return TRUE if operation has been completed successfully, FALSE otherwise * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups() */ - boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems ) + boolean DoubleNodes( in smIdType_array theNodes, in smIdType_array theModifiedElems ) raises (SALOME::SALOME_Exception); /*! @@ -976,7 +977,7 @@ module SMESH * \return TRUE if operation has been completed successfully, FALSE otherwise * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups() */ - boolean DoubleNode( in long theNodeId, in long_array theModifiedElems ) + boolean DoubleNode( in smIdType theNodeId, in smIdType_array theModifiedElems ) raises (SALOME::SALOME_Exception); /*! @@ -1037,9 +1038,9 @@ module SMESH * \return TRUE if operation has been completed successfully, FALSE otherwise * \sa DoubleNodeGroup(), DoubleNodeGroups() */ - boolean DoubleNodeElem( in long_array theElems, - in long_array theNodesNot, - in long_array theAffectedElems ) + boolean DoubleNodeElem( in smIdType_array theElems, + in smIdType_array theNodesNot, + in smIdType_array theAffectedElems ) raises (SALOME::SALOME_Exception); /*! @@ -1053,8 +1054,8 @@ module SMESH * \return TRUE if operation has been completed successfully, FALSE otherwise * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion() */ - boolean DoubleNodeElemInRegion( in long_array theElems, - in long_array theNodesNot, + boolean DoubleNodeElemInRegion( in smIdType_array theElems, + in smIdType_array theNodesNot, in GEOM::GEOM_Object theShape ) raises (SALOME::SALOME_Exception); diff --git a/idl/SMESH_Pattern.idl b/idl/SMESH_Pattern.idl index 5fdc7d37d..39a16c9d0 100644 --- a/idl/SMESH_Pattern.idl +++ b/idl/SMESH_Pattern.idl @@ -29,6 +29,7 @@ #define _SMESH_PATTERN_IDL_ #include "SMESH_Mesh.idl" +#include "SMESH_smIdType.idl" module SMESH { @@ -85,10 +86,10 @@ module SMESH * the loaded pattern to mesh faces. The first key-point * will be mapped into -th node of each face */ - point_array ApplyToMeshFaces(in SMESH_Mesh theMesh, - in long_array theFacesIDs, - in long theNodeIndexOnKeyPoint1, - in boolean theReverse); + point_array ApplyToMeshFaces(in SMESH_Mesh theMesh, + in smIdType_array theFacesIDs, + in short theNodeIndexOnKeyPoint1, + in boolean theReverse); /*! * Compute nodes coordinates applying @@ -97,10 +98,10 @@ module SMESH * The (0,0,1) key-point will be mapped into -th * node of each volume. */ - point_array ApplyToHexahedrons(in SMESH_Mesh theMesh, - in long_array theVolumesIDs, - in long theNode000Index, - in long theNode001Index); + point_array ApplyToHexahedrons(in SMESH_Mesh theMesh, + in smIdType_array theVolumesIDs, + in short theNode000Index, + in short theNode001Index); /*! * Create nodes and elements in using nodes diff --git a/idl/SMESH_smIdType.idl.in b/idl/SMESH_smIdType.idl.in new file mode 100644 index 000000000..5627249d7 --- /dev/null +++ b/idl/SMESH_smIdType.idl.in @@ -0,0 +1,28 @@ +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D, OPEN CASCADE +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef __SMESH_SMIDTYPE_IDL__ +#define __SMESH_SMIDTYPE_IDL__ + +module SMESH +{ + typedef @SMESH_ID_TYPE@ smIdType; +}; + +#endif \ No newline at end of file diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index e45fc2936..4864fb040 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -34,6 +34,7 @@ #include "SMESHDS_Mesh.hxx" #include "SMESH_MeshAlgos.hxx" #include "SMESH_OctreeNode.hxx" +#include "SMESH_Comment.hxx" #include #include @@ -127,7 +128,7 @@ namespace { return aDist; } - int getNbMultiConnection( const SMDS_Mesh* theMesh, const int theId ) + int getNbMultiConnection( const SMDS_Mesh* theMesh, const smIdType theId ) { if ( theMesh == 0 ) return 0; @@ -225,7 +226,7 @@ void NumericalFunctor::SetMesh( const SMDS_Mesh* theMesh ) myMesh = theMesh; } -bool NumericalFunctor::GetPoints(const int theId, +bool NumericalFunctor::GetPoints(const smIdType theId, TSequenceOfXYZ& theRes ) const { theRes.clear(); @@ -322,12 +323,12 @@ bool NumericalFunctor::IsApplicable( long theElementId ) const */ //================================================================================ -void NumericalFunctor::GetHistogram(int nbIntervals, - std::vector& nbEvents, - std::vector& funValues, - const std::vector& elements, - const double* minmax, - const bool isLogarithmic) +void NumericalFunctor::GetHistogram(int nbIntervals, + std::vector& nbEvents, + std::vector& funValues, + const std::vector& elements, + const double* minmax, + const bool isLogarithmic) { if ( nbIntervals < 1 || !myMesh || @@ -346,7 +347,7 @@ void NumericalFunctor::GetHistogram(int nbIntervals, } else { - std::vector::const_iterator id = elements.begin(); + std::vector::const_iterator id = elements.begin(); for ( ; id != elements.end(); ++id ) values.insert( GetValue( *id )); } @@ -1871,7 +1872,7 @@ void Length2D::GetValues(TValues& theValues) { // use special nodes iterator SMDS_NodeIteratorPtr anIter = anElem->interlacedNodesIterator(); - long aNodeId[4] = { 0,0,0,0 }; + smIdType aNodeId[4] = { 0,0,0,0 }; gp_Pnt P[4]; double aLength = 0; @@ -1908,7 +1909,7 @@ void Length2D::GetValues(TValues& theValues) } else { SMDS_NodeIteratorPtr aNodesIter = anElem->nodeIterator(); - long aNodeId[2] = {0,0}; + smIdType aNodeId[2] = {0,0}; gp_Pnt P[3]; double aLength; @@ -1923,7 +1924,7 @@ void Length2D::GetValues(TValues& theValues) for( ; aNodesIter->more(); ) { aNode = aNodesIter->next(); - long anId = aNode->GetID(); + smIdType anId = aNode->GetID(); P[2] = SMESH_NodeXYZ( aNode ); @@ -2092,7 +2093,7 @@ double MultiConnection2D::GetValue( long theElementId ) if (!anIter) break; const SMDS_MeshNode *aNode, *aNode0 = 0; - TColStd_MapOfInteger aMap, aMapPrev; + NCollection_Map< smIdType, smIdHasher > aMap, aMapPrev; for (i = 0; i <= len; i++) { aMapPrev = aMap; @@ -2114,7 +2115,7 @@ double MultiConnection2D::GetValue( long theElementId ) while (anElemIter->more()) { const SMDS_MeshElement* anElem = anElemIter->next(); if (anElem != 0 && anElem->GetType() == SMDSAbs_Face) { - int anId = anElem->GetID(); + smIdType anId = anElem->GetID(); aMap.Add(anId); if (aMapPrev.Contains(anId)) { @@ -2575,14 +2576,14 @@ void FreeEdges::SetMesh( const SMDS_Mesh* theMesh ) myMesh = theMesh; } -bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId ) +bool FreeEdges::IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId ) { SMDS_ElemIteratorPtr anElemIter = theNodes[ 0 ]->GetInverseElementIterator(SMDSAbs_Face); while( anElemIter->more() ) { if ( const SMDS_MeshElement* anElem = anElemIter->next()) { - const int anId = anElem->GetID(); + const smIdType anId = anElem->GetID(); if ( anId != theFaceId && anElem->GetNodeIndex( theNodes[1] ) >= 0 ) return false; } @@ -2867,8 +2868,8 @@ void GroupColor::SetMesh( const SMDS_Mesh* theMesh ) SMDSAbs_ElementType aGrpElType = (SMDSAbs_ElementType)aGrp->GetType(); if ( myType == aGrpElType || (myType == SMDSAbs_All && aGrpElType != SMDSAbs_Node) ) { // add elements IDS into control - int aSize = aGrp->Extent(); - for (int i = 0; i < aSize; i++) + smIdType aSize = aGrp->Extent(); + for (smIdType i = 0; i < aSize; i++) myIDs.insert( aGrp->GetID(i+1) ); } } @@ -3019,7 +3020,7 @@ ConnectedElements::ConnectedElements(): SMDSAbs_ElementType ConnectedElements::GetType() const { return myType; } -int ConnectedElements::GetNode() const +smIdType ConnectedElements::GetNode() const { return myXYZ.empty() ? myNodeID : 0; } // myNodeID can be found by myXYZ std::vector ConnectedElements::GetPoint() const @@ -3046,7 +3047,7 @@ void ConnectedElements::SetMesh( const SMDS_Mesh* theMesh ) } } -void ConnectedElements::SetNode( int nodeID ) +void ConnectedElements::SetNode( smIdType nodeID ) { myNodeID = nodeID; myXYZ.clear(); @@ -3106,7 +3107,7 @@ bool ConnectedElements::IsSatisfy( long theElementId ) return false; std::list< const SMDS_MeshNode* > nodeQueue( 1, node0 ); - std::set< int > checkedNodeIDs; + std::set< smIdType > checkedNodeIDs; // algo: // foreach node in nodeQueue: // foreach element sharing a node: @@ -3131,7 +3132,7 @@ bool ConnectedElements::IsSatisfy( long theElementId ) while ( nIt->more() ) { const SMDS_MeshNode* n = static_cast< const SMDS_MeshNode* >( nIt->next() ); - if ( checkedNodeIDs.insert( n->GetID() ).second ) + if ( checkedNodeIDs.insert( n->GetID()).second ) nodeQueue.push_back( n ); } } @@ -3278,56 +3279,56 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr ) { theResStr.Clear(); - TColStd_SequenceOfInteger anIntSeq; - TColStd_SequenceOfAsciiString aStrSeq; + TIDsSeq anIntSeq; + NCollection_Sequence< std::string > aStrSeq; - TColStd_MapIteratorOfMapOfInteger anIter( myIds ); + TIDsMap::Iterator anIter( myIds ); for ( ; anIter.More(); anIter.Next() ) { - int anId = anIter.Key(); - TCollection_AsciiString aStr( anId ); + smIdType anId = anIter.Key(); + SMESH_Comment aStr( anId ); anIntSeq.Append( anId ); aStrSeq.Append( aStr ); } - for ( int i = 1, n = myMin.Length(); i <= n; i++ ) + for ( smIdType i = 1, n = myMin.size(); i <= n; i++ ) { - int aMinId = myMin( i ); - int aMaxId = myMax( i ); + smIdType aMinId = myMin[i]; + smIdType aMaxId = myMax[i]; - TCollection_AsciiString aStr; + SMESH_Comment aStr; if ( aMinId != IntegerFirst() ) - aStr += aMinId; + aStr << aMinId; - aStr += "-"; + aStr << "-"; - if ( aMaxId != IntegerLast() ) - aStr += aMaxId; + if ( aMaxId != std::numeric_limits::max() ) + aStr << aMaxId; // find position of the string in result sequence and insert string in it if ( anIntSeq.Length() == 0 ) { anIntSeq.Append( aMinId ); - aStrSeq.Append( aStr ); + aStrSeq.Append( (const char*)aStr ); } else { if ( aMinId < anIntSeq.First() ) { anIntSeq.Prepend( aMinId ); - aStrSeq.Prepend( aStr ); + aStrSeq.Prepend( (const char*)aStr ); } else if ( aMinId > anIntSeq.Last() ) { anIntSeq.Append( aMinId ); - aStrSeq.Append( aStr ); + aStrSeq.Append( (const char*)aStr ); } else for ( int j = 1, k = anIntSeq.Length(); j <= k; j++ ) if ( aMinId < anIntSeq( j ) ) { anIntSeq.InsertBefore( j, aMinId ); - aStrSeq.InsertBefore( j, aStr ); + aStrSeq.InsertBefore( j, (const char*)aStr ); break; } } @@ -3335,13 +3336,14 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr ) if ( aStrSeq.Length() == 0 ) return; - - theResStr = aStrSeq( 1 ); + std::string aResStr; + aResStr = aStrSeq( 1 ); for ( int j = 2, k = aStrSeq.Length(); j <= k; j++ ) { - theResStr += ","; - theResStr += aStrSeq( j ); + aResStr += ","; + aResStr += aStrSeq( j ); } + theResStr = aResStr.c_str(); } //======================================================================= @@ -3351,8 +3353,8 @@ void RangeOfIds::GetRangeStr( TCollection_AsciiString& theResStr ) //======================================================================= bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr ) { - myMin.Clear(); - myMax.Clear(); + myMin.clear(); + myMax.clear(); myIds.Clear(); TCollection_AsciiString aStr = theStr; @@ -3390,8 +3392,8 @@ bool RangeOfIds::SetRangeStr( const TCollection_AsciiString& theStr ) (!aMaxStr.IsEmpty() && !aMaxStr.IsIntegerValue()) ) return false; - myMin.Append( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() ); - myMax.Append( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() ); + myMin.push_back( aMinStr.IsEmpty() ? IntegerFirst() : aMinStr.IntegerValue() ); + myMax.push_back( aMaxStr.IsEmpty() ? IntegerLast() : aMaxStr.IntegerValue() ); } } @@ -3440,8 +3442,8 @@ bool RangeOfIds::IsSatisfy( long theId ) if ( myIds.Contains( theId ) ) return true; - for ( int i = 1, n = myMin.Length(); i <= n; i++ ) - if ( theId >= myMin( i ) && theId <= myMax( i ) ) + for ( size_t i = 0; i < myMin.size(); i++ ) + if ( theId >= myMin[i] && theId <= myMax[i] ) return true; return false; @@ -3817,7 +3819,7 @@ bool ManifoldPart::process() // the map of non manifold links and bad geometry TMapOfLink aMapOfNonManifold; - TColStd_MapOfInteger aMapOfTreated; + TIDsMap aMapOfTreated; // begin cycle on faces from start index and run on vector till the end // and from begin to start index to cover whole vector @@ -3830,18 +3832,18 @@ bool ManifoldPart::process() // as result next time when fi will be equal to aStartIndx SMDS_MeshFace* aFacePtr = myAllFacePtr[ fi ]; - if ( aMapOfTreated.Contains( aFacePtr->GetID() ) ) + if ( aMapOfTreated.Contains( aFacePtr->GetID()) ) continue; aMapOfTreated.Add( aFacePtr->GetID() ); - TColStd_MapOfInteger aResFaces; + TIDsMap aResFaces; if ( !findConnected( myAllFacePtrIntDMap, aFacePtr, aMapOfNonManifold, aResFaces ) ) continue; - TColStd_MapIteratorOfMapOfInteger anItr( aResFaces ); + TIDsMap::Iterator anItr( aResFaces ); for ( ; anItr.More(); anItr.Next() ) { - int aFaceId = anItr.Key(); + smIdType aFaceId = anItr.Key(); aMapOfTreated.Add( aFaceId ); myMapIds.Add( aFaceId ); } @@ -3877,7 +3879,7 @@ bool ManifoldPart::findConnected ( const ManifoldPart::TDataMapFacePtrInt& theAllFacePtrInt, SMDS_MeshFace* theStartFace, ManifoldPart::TMapOfLink& theNonManifold, - TColStd_MapOfInteger& theResFaces ) + TIDsMap& theResFaces ) { theResFaces.Clear(); if ( !theAllFacePtrInt.size() ) @@ -3945,7 +3947,7 @@ bool ManifoldPart::findConnected SMDS_MeshFace* aNextFace = *pFace; if ( aPrevFace == aNextFace ) continue; - int anNextFaceID = aNextFace->GetID(); + smIdType anNextFaceID = aNextFace->GetID(); if ( myIsOnlyManifold && theResFaces.Contains( anNextFaceID ) ) // should not be with non manifold restriction. probably bad topology continue; @@ -4176,7 +4178,9 @@ void ElementsOnSurface::process() if ( !myMeshModifTracer.GetMesh() ) return; - myIds.ReSize( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType )); + int nbElems = FromIdType( myMeshModifTracer.GetMesh()->GetMeshInfo().NbElements( myType )); + if ( nbElems > 0 ) + myIds.ReSize( nbElems ); SMDS_ElemIteratorPtr anIter = myMeshModifTracer.GetMesh()->elementsIterator( myType ); for(; anIter->more(); ) diff --git a/src/Controls/SMESH_ControlsDef.hxx b/src/Controls/SMESH_ControlsDef.hxx index 7d25f1dca..06fbe1dba 100644 --- a/src/Controls/SMESH_ControlsDef.hxx +++ b/src/Controls/SMESH_ControlsDef.hxx @@ -32,8 +32,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -58,6 +58,9 @@ class ShapeAnalysis_Surface; class gp_Pln; class gp_Pnt; +typedef NCollection_Map< smIdType, smIdHasher > TIDsMap; +typedef NCollection_Sequence TIDsSeq; + namespace SMESH{ namespace Controls{ @@ -130,12 +133,12 @@ namespace SMESH{ virtual void SetMesh( const SMDS_Mesh* theMesh ); virtual double GetValue( long theElementId ); virtual double GetValue(const TSequenceOfXYZ& /*thePoints*/) { return -1.0;}; - void GetHistogram(int nbIntervals, - std::vector& nbEvents, - std::vector& funValues, - const std::vector& elements, - const double* minmax=0, - const bool isLogarithmic = false); + void GetHistogram(int nbIntervals, + std::vector& nbEvents, + std::vector& funValues, + const std::vector& elements, + const double* minmax=0, + const bool isLogarithmic = false); bool IsApplicable( long theElementId ) const; virtual bool IsApplicable( const SMDS_MeshElement* element ) const; virtual SMDSAbs_ElementType GetType() const = 0; @@ -144,7 +147,7 @@ namespace SMESH{ void SetPrecision( const long thePrecision ); double Round( const double & value ); - bool GetPoints(const int theId, TSequenceOfXYZ& theRes) const; + bool GetPoints(const smIdType theId, TSequenceOfXYZ& theRes) const; static bool GetPoints(const SMDS_MeshElement* theElem, TSequenceOfXYZ& theRes); protected: const SMDS_Mesh* myMesh; @@ -423,9 +426,9 @@ namespace SMESH{ double GetTolerance () const { return myToler; } private: - double myToler; - TColStd_MapOfInteger myCoincidentIDs; - TMeshModifTracer myMeshModifTracer; + double myToler; + TIDsMap myCoincidentIDs; + TMeshModifTracer myMeshModifTracer; }; typedef boost::shared_ptr CoincidentNodesPtr; @@ -591,7 +594,7 @@ namespace SMESH{ virtual void SetMesh( const SMDS_Mesh* theMesh ); virtual bool IsSatisfy( long theElementId ); virtual SMDSAbs_ElementType GetType() const; - static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const int theFaceId ); + static bool IsFreeEdge( const SMDS_MeshNode** theNodes, const smIdType theFaceId ); typedef long TElemId; struct Border{ TElemId myElemId; @@ -650,9 +653,9 @@ namespace SMESH{ protected: const SMDS_Mesh* myMesh; - TColStd_SequenceOfInteger myMin; - TColStd_SequenceOfInteger myMax; - TColStd_MapOfInteger myIds; + std::vector< smIdType > myMin; + std::vector< smIdType > myMax; + TIDsMap myIds; SMDSAbs_ElementType myType; }; @@ -833,7 +836,7 @@ namespace SMESH{ bool findConnected( const TDataMapFacePtrInt& theAllFacePtrInt, SMDS_MeshFace* theStartFace, TMapOfLink& theNonManifold, - TColStd_MapOfInteger& theResFaces ); + TIDsMap& theResFaces ); bool isInPlane( const SMDS_MeshFace* theFace1, const SMDS_MeshFace* theFace2 ); void expandBoundary( TMapOfLink& theMapOfBoundary, @@ -847,8 +850,8 @@ namespace SMESH{ private: const SMDS_Mesh* myMesh; - TColStd_MapOfInteger myMapIds; - TColStd_MapOfInteger myMapBadGeomIds; + TIDsMap myMapIds; + TIDsMap myMapBadGeomIds; TVectorOfFacePtr myAllFacePtr; TDataMapFacePtrInt myAllFacePtrIntDMap; double myAngToler; @@ -909,7 +912,7 @@ namespace SMESH{ private: TMeshModifTracer myMeshModifTracer; - TColStd_MapOfInteger myIds; + TIDsMap myIds; SMDSAbs_ElementType myType; TopoDS_Face mySurf; double myToler; @@ -1149,7 +1152,7 @@ namespace SMESH{ TMeshModifTracer myMeshModifTracer; long myFaceID; double myToler; - TColStd_MapOfInteger myCoplanarIDs; + TIDsMap myCoplanarIDs; }; typedef boost::shared_ptr CoplanarFacesPtr; @@ -1162,9 +1165,9 @@ namespace SMESH{ public: ConnectedElements(); //virtual Predicate* clone() const { return new ConnectedElements( *this ); } - void SetNode( int nodeID ); + void SetNode( smIdType nodeID ); void SetPoint( double x, double y, double z ); - int GetNode() const; + smIdType GetNode() const; std::vector GetPoint() const; void SetType( SMDSAbs_ElementType theType ); @@ -1176,14 +1179,14 @@ namespace SMESH{ //const std::set& GetDomainIDs() const { return myOkIDs; } private: - int myNodeID; + smIdType myNodeID; std::vector myXYZ; SMDSAbs_ElementType myType; TMeshModifTracer myMeshModifTracer; void clearOkIDs(); bool myOkIDsReady; - std::set< int > myOkIDs; // empty means that there is one domain + std::set myOkIDs; // empty means that there is one domain }; typedef boost::shared_ptr ConnectedElementsPtr; diff --git a/src/Driver/Driver_Mesh.h b/src/Driver/Driver_Mesh.h index bd6a71406..30ab4e286 100644 --- a/src/Driver/Driver_Mesh.h +++ b/src/Driver/Driver_Mesh.h @@ -28,6 +28,7 @@ #define _INCLUDE_DRIVER_MESH #include "SMESH_ComputeError.hxx" +#include "SMDS_Mesh.hxx" #include #include @@ -50,12 +51,13 @@ class MESHDRIVER_EXPORT Driver_Mesh enum Status { DRS_OK, - DRS_EMPTY, // a file contains no mesh with the given name - DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers, - // so the numbers from the file are ignored - DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data + DRS_EMPTY, // a file contains no mesh with the given name + DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers, + // so the numbers from the file are ignored + DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity - DRS_FAIL // general failure (exception etc.) + DRS_FAIL, // general failure (exception etc.) + DRS_TOO_LARGE_MESH // mesh is too large for export }; void SetMeshId(int theMeshId); @@ -70,6 +72,22 @@ class MESHDRIVER_EXPORT Driver_Mesh virtual SMESH_ComputeErrorPtr GetError(); + //virtual bool CanExportMesh() const { return false; } //= 0; + + // check if a mesh is too large to export it using IDTYPE; + // check either max ID or number of elements + template< typename IDTYPE > + static bool IsMeshTooLarge( const SMDS_Mesh* mesh, bool checkIDs ) + { + if ( sizeof( IDTYPE ) < sizeof( smIdType )) + { + const smIdType maxNB = std::numeric_limits< IDTYPE >::max(); + return (( checkIDs ? mesh->MaxNodeID() : mesh->NbNodes() ) > maxNB || + ( checkIDs ? mesh->MaxElementID() : mesh->NbElements() > maxNB )); + } + return false; + } + protected: std::string myFile; std::string myMeshName; diff --git a/src/DriverCGNS/DriverCGNS_Read.cxx b/src/DriverCGNS/DriverCGNS_Read.cxx index dc6192470..cfb37c3e4 100644 --- a/src/DriverCGNS/DriverCGNS_Read.cxx +++ b/src/DriverCGNS/DriverCGNS_Read.cxx @@ -33,6 +33,8 @@ #include "SMESH_Comment.hxx" #include "SMESH_TypeDefs.hxx" +#include + #include #include @@ -59,9 +61,9 @@ namespace struct TZoneData { int _id; - int _nodeIdShift; // nb nodes in previously read zones - int _elemIdShift; // nb faces in previously read zones - int _nbNodes, _nbElems; + smIdType _nodeIdShift; // nb nodes in previously read zones + smIdType _elemIdShift; // nb faces in previously read zones + smIdType _nbNodes, _nbElems; int _meshDim; int _sizeX, _sizeY, _sizeZ, _nbCells; // structured cgsize_t _sizes[NB_ZONE_SIZE_VAL]; @@ -546,10 +548,10 @@ namespace } SMDS_MeshElement* add_NGON(cgsize_t* ids, SMESHDS_Mesh* mesh, int ID) { - vector idVec( ids[0] ); + vector idVec( ids[0] ); for ( int i = 0; i < ids[0]; ++i ) - idVec[ i ] = (int) ids[ i + 1]; - return mesh->AddPolygonalFaceWithID( idVec, ID ); + idVec[ i ] = (smIdType) ids[ i + 1]; + return mesh->AddPolygonalFaceWithID( idVec, ToIdType(ID) ); } typedef SMDS_MeshElement* (* PAddElemFun) (cgsize_t* ids, SMESHDS_Mesh* mesh, int ID); @@ -1131,7 +1133,7 @@ Driver_Mesh::Status DriverCGNS_Read::Perform() case 2: addElemFun = & add_QUAD_4; break; case 3: addElemFun = & add_HEXA_8; break; } - int elemID = meshInfo.NbElements(); + smIdType elemID = meshInfo.NbElements(); const SMDS_MeshElement* elem = 0; for ( size_t i = 0; i < ids.size(); i += nbElemNodes ) { diff --git a/src/DriverCGNS/DriverCGNS_Write.cxx b/src/DriverCGNS/DriverCGNS_Write.cxx index 6cbeae2fe..0643273cb 100644 --- a/src/DriverCGNS/DriverCGNS_Write.cxx +++ b/src/DriverCGNS/DriverCGNS_Write.cxx @@ -201,17 +201,17 @@ namespace */ struct TPolyhedFace { - int _id; // id of NGON_n - vector< int > _nodes; // lowest node IDs used for sorting + smIdType _id; // id of NGON_n + vector< smIdType > _nodes; // lowest node IDs used for sorting - TPolyhedFace( const SMDS_MeshNode** nodes, const int nbNodes, int ID):_id(ID) + TPolyhedFace( const SMDS_MeshNode** nodes, const smIdType nbNodes, smIdType ID):_id(ID) { - set< int > ids; - for ( int i = 0; i < nbNodes; ++i ) + set< smIdType > ids; + for ( smIdType i = 0; i < nbNodes; ++i ) ids.insert( nodes[i]->GetID() ); _nodes.resize( 3 ); // std::min( nbNodes, 4 )); hope 3 nodes is enough - set< int >::iterator idIt = ids.begin(); + set< smIdType >::iterator idIt = ids.begin(); for ( size_t j = 0; j < _nodes.size(); ++j, ++idIt ) _nodes[j] = *idIt; } @@ -248,6 +248,9 @@ Driver_Mesh::Status DriverCGNS_Write::Perform() if ( !myMesh || myMesh->GetMeshInfo().NbElements() < 1 ) return addMessage( !myMesh ? "NULL mesh" : "Empty mesh (no elements)", /*fatal = */true ); + if ( Driver_Mesh::IsMeshTooLarge< cgsize_t >( myMesh, /*checkIDs =*/ false)) + return DRS_TOO_LARGE_MESH; + // open the file if ( cg_open(myFile.c_str(), CG_MODE_MODIFY, &_fn) != CG_OK && cg_open(myFile.c_str(), CG_MODE_WRITE, &_fn) != CG_OK ) @@ -276,13 +279,15 @@ Driver_Mesh::Status DriverCGNS_Write::Perform() // create a Zone // -------------- - int nbCells = myMesh->NbEdges(); + smIdType nbCells = myMesh->NbEdges(); if ( meshDim == 3 ) nbCells = myMesh->NbVolumes(); else if ( meshDim == 2 ) nbCells = myMesh->NbFaces(); - cgsize_t size[9] = { myMesh->NbNodes(), nbCells, /*NBoundVertex=*/0, 0,0,0,0,0,0 }; + cgsize_t size[9] = { FromIdType( myMesh->NbNodes() ), + FromIdType( nbCells ), + /*NBoundVertex=*/0, 0,0,0,0,0,0 }; int iZone; if ( cg_zone_write( _fn, iBase, "SMESH_Mesh", size, CGNS_ENUMV( Unstructured ), &iZone) != CG_OK ) diff --git a/src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx b/src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx index da022e638..025eed434 100644 --- a/src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx +++ b/src/DriverDAT/DriverDAT_R_SMDS_Mesh.cxx @@ -76,7 +76,7 @@ Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform() myMesh->AddNodeWithID(coordX, coordY, coordZ, intNumPoint); } - fprintf(stdout, "%d noeuds\n", myMesh->NbNodes()); + fprintf(stdout, "%ld noeuds\n", myMesh->NbNodes()); /**************************************************************************** * LECTURE DES ELEMENTS * ****************************************************************************/ diff --git a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx index 3440ee09a..16ae2bb2d 100644 --- a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx +++ b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx @@ -37,7 +37,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() Kernel_Utils::Localizer loc; Status aResult = DRS_OK; - int nbNodes, nbCells; + smIdType nbNodes, nbCells; #if defined(WIN32) && defined(UNICODE) std::wstring file2Read = Kernel_Utils::utf8_decode_s(myFile); FILE* aFileId = _wfopen(file2Read.c_str(), L"w+"); @@ -60,7 +60,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() nbNodes = myMesh->NbNodes(); /* Combien de mailles, faces ou aretes ? */ - int nb_of_edges, nb_of_faces, nb_of_volumes; + smIdType nb_of_edges, nb_of_faces, nb_of_volumes; nb_of_edges = myMesh->NbEdges(); nb_of_faces = myMesh->NbFaces(); nb_of_volumes = myMesh->NbVolumes(); @@ -70,7 +70,7 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() SCRUTE(nb_of_volumes); //fprintf(stdout, "%d %d\n", nbNodes, nbCells); - fprintf(aFileId, "%d %d\n", nbNodes, nbCells); + fprintf(aFileId, "%ld %ld\n", nbNodes, nbCells); /**************************************************************************** * ECRITURE DES NOEUDS * @@ -104,10 +104,10 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() for ( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); ) { - int nodeID = it->next()->GetID(); + smIdType nodeID = it->next()->GetID(); if ( !nodeNumByID.empty() ) nodeID = nodeNumByID[ nodeID ]; - fprintf(aFileId, "%d ", nodeID ); + fprintf(aFileId, "%ld ", nodeID ); } fprintf(aFileId, "\n"); } @@ -120,10 +120,10 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); ) { - int nodeID = it->next()->GetID(); + smIdType nodeID = it->next()->GetID(); if ( !nodeNumByID.empty() ) nodeID = nodeNumByID[ nodeID ]; - fprintf(aFileId, "%d ", nodeID ); + fprintf(aFileId, "%ld ", nodeID ); } fprintf(aFileId, "\n"); } @@ -155,10 +155,10 @@ Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform() for( SMDS_ElemIteratorPtr it = elem->nodesIterator(); it->more(); ) { - int nodeID = it->next()->GetID(); + smIdType nodeID = it->next()->GetID(); if ( !nodeNumByID.empty() ) nodeID = nodeNumByID[ nodeID ]; - fprintf(aFileId, "%d ", nodeID ); + fprintf(aFileId, "%ld ", nodeID ); } fprintf(aFileId, "\n"); diff --git a/src/DriverGMF/DriverGMF_Read.cxx b/src/DriverGMF/DriverGMF_Read.cxx index 9ce4ff94d..b70f6a33c 100644 --- a/src/DriverGMF/DriverGMF_Read.cxx +++ b/src/DriverGMF/DriverGMF_Read.cxx @@ -89,7 +89,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() int ref; - const int nodeIDShift = myMesh->GetMeshInfo().NbNodes(); + const smIdType nodeIDShift = myMesh->GetMeshInfo().NbNodes(); if ( version != GmfFloat ) { double x, y, z; @@ -114,7 +114,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() int iN[28]; // 28 - nb nodes in HEX27 (+ 1 for safety :) /* Read edges */ - const int edgeIDShift = myMesh->GetMeshInfo().NbElements(); + const smIdType edgeIDShift = myMesh->GetMeshInfo().NbElements(); if ( int nbEdges = GmfStatKwd(meshID, GmfEdges)) { // read extra vertices for quadratic edges @@ -150,7 +150,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() } /* Read triangles */ - const int triaIDShift = myMesh->GetMeshInfo().NbElements(); + const smIdType triaIDShift = myMesh->GetMeshInfo().NbElements(); if ( int nbTria = GmfStatKwd(meshID, GmfTriangles)) { // read extra vertices for quadratic triangles @@ -194,7 +194,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() } /* Read quadrangles */ - const int quadIDShift = myMesh->GetMeshInfo().NbElements(); + const smIdType quadIDShift = myMesh->GetMeshInfo().NbElements(); if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilaterals)) { // read extra vertices for quadratic quadrangles @@ -248,7 +248,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() } /* Read terahedra */ - const int tetIDShift = myMesh->GetMeshInfo().NbElements(); + const smIdType tetIDShift = myMesh->GetMeshInfo().NbElements(); if ( int nbTet = GmfStatKwd( meshID, GmfTetrahedra )) { // read extra vertices for quadratic tetrahedra @@ -273,14 +273,14 @@ Driver_Mesh::Status DriverGMF_Read::Perform() for ( int i = 1; i <= nbTet; ++i ) { GmfGetLin(meshID, GmfTetrahedra, &iN[0], &iN[1], &iN[2], &iN[3], &ref); - std::vector& midN = quadNodesAtTetrahedra[ i ]; + std::vector& midN = quadNodesAtTetrahedra[ i ]; if ( midN.size() >= 10-4 ) // TETRA10 { - if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], + if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], midN[2], midN[1], midN[0], midN[3], midN[5], midN[4], tetIDShift + i )) status = storeBadNodeIds( "GmfTetrahedra + GmfExtraVerticesAtTetrahedra",i, 10, - iN[0], iN[2], iN[1], iN[3], + iN[0], iN[2], iN[1], iN[3], midN[2], midN[1], midN[0], midN[3], midN[5], midN[4] ); } else // TETRA4 @@ -293,7 +293,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() } /* Read pyramids */ - const int pyrIDShift = myMesh->GetMeshInfo().NbElements(); + const smIdType pyrIDShift = myMesh->GetMeshInfo().NbElements(); if ( int nbPyr = GmfStatKwd(meshID, GmfPyramids)) { GmfGotoKwd(meshID, GmfPyramids); @@ -306,7 +306,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() } /* Read hexahedra */ - const int hexIDShift = myMesh->GetMeshInfo().NbElements(); + const smIdType hexIDShift = myMesh->GetMeshInfo().NbElements(); if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra)) { // read extra vertices for quadratic hexahedra @@ -321,7 +321,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() &iN[6], &iN[7], &iN[8], &iN[9], &iN[10], &iN[11], &iN[12], &iN[13], // HEXA20 &iN[14], - &iN[15], &iN[16], &iN[17], &iN[18], + &iN[15], &iN[16], &iN[17], &iN[18], &iN[19], &iN[20]); // HEXA27 if ( iN[0] <= nbHex ) @@ -347,7 +347,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() midN[7], midN[6], midN[5], midN[4], midN[8], midN[11], midN[10], midN[9], hexIDShift + i )) - status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20, + status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20, iN[0], iN[3], iN[2], iN[1], iN[4], iN[7], iN[6], iN[5], midN[3], midN[2], midN[1], midN[0], @@ -366,7 +366,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() midN[17], midN[18], hexIDShift + i )) - status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27, + status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27, iN[0], iN[3], iN[2], iN[1], iN[4], iN[7], iN[6], iN[5], midN[3], midN[2], midN[1], midN[0], @@ -389,7 +389,7 @@ Driver_Mesh::Status DriverGMF_Read::Perform() } /* Read prism */ - const int prismIDShift = myMesh->GetMeshInfo().NbElements(); + const smIdType prismIDShift = myMesh->GetMeshInfo().NbElements(); if ( int nbPrism = GmfStatKwd(meshID, GmfPrisms)) { GmfGotoKwd(meshID, GmfPrisms); @@ -405,33 +405,33 @@ Driver_Mesh::Status DriverGMF_Read::Perform() // Read some entities into groups // see MeshGems/Docs/meshgems_formats_description.pdf - // get ids of existing groups - std::set< int > groupIDs; - const std::set& groups = myMesh->GetGroups(); - std::set::const_iterator grIter = groups.begin(); - for ( ; grIter != groups.end(); ++grIter ) - groupIDs.insert( (*grIter)->GetID() ); - if ( groupIDs.empty() ) groupIDs.insert( 0 ); + // get ids of existing groups + std::set< int > groupIDs; + const std::set& groups = myMesh->GetGroups(); + std::set::const_iterator grIter = groups.begin(); + for ( ; grIter != groups.end(); ++grIter ) + groupIDs.insert( (*grIter)->GetID() ); + if ( groupIDs.empty() ) groupIDs.insert( 0 ); // Read required entities into groups if ( _makeRequiredGroups ) { - const int kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift }, - { GmfRequiredEdges, SMDSAbs_Edge, edgeIDShift }, - { GmfRequiredTriangles, SMDSAbs_Face, triaIDShift }, - { GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift } - }; + const smIdType kes[4][3] = { { GmfRequiredVertices, SMDSAbs_Node, nodeIDShift }, + { GmfRequiredEdges, SMDSAbs_Edge, edgeIDShift }, + { GmfRequiredTriangles, SMDSAbs_Face, triaIDShift }, + { GmfRequiredQuadrilaterals,SMDSAbs_Face, quadIDShift } + }; const char* names[4] = { "_required_Vertices" , "_required_Edges" , "_required_Triangles" , - "_required_Quadrilaterals" - }; + "_required_Quadrilaterals" + }; for ( int i = 0; i < 4; ++i ) { - int gmfKwd = kes[i][0]; + int gmfKwd = FromIdType( kes[i][0] ); SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1]; - int shift = kes[i][2]; + smIdType shift = kes[i][2]; if ( int nb = GmfStatKwd(meshID, gmfKwd)) { const int newID = *groupIDs.rbegin() + 1; @@ -454,27 +454,27 @@ Driver_Mesh::Status DriverGMF_Read::Perform() if ( _makeFaultGroups ) { - const int kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift }, - { GmfFault_BadShape, SMDSAbs_Face, triaIDShift }, - { GmfFault_Overlap, SMDSAbs_Face, triaIDShift }, - { GmfFault_Inter, SMDSAbs_Face, triaIDShift }, - { GmfFault_NearTri, SMDSAbs_Face, triaIDShift }, - { GmfFault_FreeEdge, SMDSAbs_Face, triaIDShift }, - { GmfFault_MultipleEdge, SMDSAbs_Face, triaIDShift } - }; + const smIdType kes[7][3] = { { GmfFault_SmallTri, SMDSAbs_Face, triaIDShift }, + { GmfFault_BadShape, SMDSAbs_Face, triaIDShift }, + { GmfFault_Overlap, SMDSAbs_Face, triaIDShift }, + { GmfFault_Inter, SMDSAbs_Face, triaIDShift }, + { GmfFault_NearTri, SMDSAbs_Face, triaIDShift }, + { GmfFault_FreeEdge, SMDSAbs_Face, triaIDShift }, + { GmfFault_MultipleEdge, SMDSAbs_Face, triaIDShift } + }; const char* names[7] = { "Fault_SmallTri", "Fault_BadShape", "Fault_Overlap", - "Fault_Inter", + "Fault_Inter", "Fault_NearTri", "Fault_FreeEdge", "Fault_MultipleEdge" - }; + }; for ( int i = 0; i < 7; ++i ) { - int gmfKwd = kes[i][0]; + int gmfKwd = FromIdType( kes[i][0] ); SMDSAbs_ElementType entity = (SMDSAbs_ElementType) kes[i][1]; - int shift = kes[i][2]; + smIdType shift = kes[i][2]; if ( int nb = GmfStatKwd(meshID, gmfKwd)) { const int newID = *groupIDs.rbegin() + 1; diff --git a/src/DriverGMF/DriverGMF_Write.cxx b/src/DriverGMF/DriverGMF_Write.cxx index 510585a56..ceaad2197 100644 --- a/src/DriverGMF/DriverGMF_Write.cxx +++ b/src/DriverGMF/DriverGMF_Write.cxx @@ -57,8 +57,8 @@ extern "C" elemIt = elementIterator( SMDSGeom ); \ if ( elemIt->more() ) \ { \ - int totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom ); \ - int nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \ + smIdType totalNbElems = myMesh->GetMeshInfo().NbElements( SMDSGeom );\ + smIdType nbLinearElems = myMesh->GetMeshInfo().NbElements( LinType ); \ if ( totalNbElems - nbLinearElems > 0 ) \ { \ GmfSetKwd(meshID, GmfKwd, totalNbElems - nbLinearElems); \ @@ -100,6 +100,9 @@ Driver_Mesh::Status DriverGMF_Write::Perform() { Kernel_Utils::Localizer loc; + if ( Driver_Mesh::IsMeshTooLarge< int >( myMesh, /*checkIDs =*/ false)) + return DRS_TOO_LARGE_MESH; + const int dim = 3, version = sizeof(double) < 8 ? 1 : 2; int meshID = GmfOpenMesh( myFile.c_str(), GmfWrite, version, dim ); @@ -115,7 +118,7 @@ Driver_Mesh::Status DriverGMF_Write::Perform() // nodes std::map< const SMDS_MeshNode* , int > node2IdMap; - int iN = 0, nbNodes = myMesh->NbNodes(); + smIdType iN = 0, nbNodes = myMesh->NbNodes(); GmfSetKwd( meshID, GmfVertices, nbNodes ); double xyz[3]; SMDS_NodeIteratorPtr nodeIt = myMesh->nodesIterator(); diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx index e2b117cf6..fac44fc86 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx @@ -36,6 +36,7 @@ #include "MED_Utilities.hxx" #include +#include #include "utilities.h" @@ -225,7 +226,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() // Reading pre information about all MED cells //-------------------------------------------- - typedef MED::TVector TNodeIds; + typedef MED::TVector TNodeIds; bool takeNumbers = true; // initially we trust the numbers from file MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo, eNOD); MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin(); @@ -269,7 +270,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() aNodeIds.assign( aBallInfo->myConn->begin(), aBallInfo->myConn->end()); // allocate array of diameters - vtkIdType maxID = myMesh->MaxElementID() + aNbBalls; + vtkIdType maxID = FromIdType(myMesh->MaxElementID() + aNbBalls); if ( anIsElemNum && !aBallInfo->myElemNum->empty() ) maxID = *std::max_element( aBallInfo->myElemNum->begin(), aBallInfo->myElemNum->end() ); @@ -318,7 +319,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX; typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolyWithID) - (const std::vector & nodes_ids, const int ID); + (const std::vector & nodes_ids, const smIdType ID); typedef SMDS_MeshFace* (SMESHDS_Mesh::* FAddPolygon) (const std::vector & nodes); @@ -355,7 +356,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #endif if ( anIsElemNum ) { TInt anElemId = aPolygoneInfo->GetElemNum( iElem ); - anElement = (myMesh->*addPolyWithID)( aNodeIds, anElemId ); + anElement = (myMesh->*addPolyWithID)( aNodeIds, ToIdType(anElemId) ); } if ( !anElement ) { aNodes.resize( aNbConn ); @@ -436,7 +437,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform() #endif if(anIsElemNum){ TInt anElemId = aPolyedreInfo->GetElemNum(iElem); - anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId); + anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,ToIdType(anElemId)); } if(!anElement){ vector aNodes(aNbNodes); diff --git a/src/DriverMED/DriverMED_W_Field.cxx b/src/DriverMED/DriverMED_W_Field.cxx index 9bf879f4c..7bd732c9f 100644 --- a/src/DriverMED/DriverMED_W_Field.cxx +++ b/src/DriverMED/DriverMED_W_Field.cxx @@ -90,7 +90,7 @@ bool DriverMED_W_Field::Set(SMESHDS_Mesh * mesh, } // find out "MED order" of elements - sort elements by geom type - int nbElems; + smIdType nbElems; if ( _nbElemsByGeom.empty() || _elemType != type ) { _elemType = type; diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index 052869ab8..bd5e48f47 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -246,7 +246,7 @@ namespace const SMDS_MeshNode* GetNode(){ return myCurrentNode; } - MED::TIntVector::value_type GetID(){ + MED::TIDVector::value_type GetID(){ return myCurrentNode->GetID(); } MED::TFloatVector::value_type GetCoord(TInt theCoodId){ @@ -343,12 +343,21 @@ namespace } } +//================================================================================ +/*! + * \brief Write my mesh + */ +//================================================================================ + Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() { Status aResult = DRS_OK; try { //MESSAGE("Perform - myFile : "<( myMesh, /*checkIDs =*/ true )) + return DRS_TOO_LARGE_MESH; + // Creating the MED mesh for corresponding SMDS structure //------------------------------------------------------- string aMeshName; @@ -475,12 +484,12 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() int myEdgesDefaultFamilyId = 0; int myFacesDefaultFamilyId = 0; int myVolumesDefaultFamilyId = 0; - int nbNodes = myMesh->NbNodes(); - int nb0DElements = myMesh->Nb0DElements(); - int nbBalls = myMesh->NbBalls(); - int nbEdges = myMesh->NbEdges(); - int nbFaces = myMesh->NbFaces(); - int nbVolumes = myMesh->NbVolumes(); + smIdType nbNodes = myMesh->NbNodes(); + smIdType nb0DElements = myMesh->Nb0DElements(); + smIdType nbBalls = myMesh->NbBalls(); + smIdType nbEdges = myMesh->NbEdges(); + smIdType nbFaces = myMesh->NbFaces(); + smIdType nbVolumes = myMesh->NbVolumes(); if (myDoGroupOfNodes) myNodesDefaultFamilyId = REST_NODES_FAMILY; if (myDoGroupOfEdges) myEdgesDefaultFamilyId = REST_EDGES_FAMILY; if (myDoGroupOfFaces) myFacesDefaultFamilyId = REST_FACES_FAMILY; @@ -539,7 +548,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() const EBooleen theIsElemNames = eFAUX; const EConnectivite theConnMode = eNOD; - TInt aNbNodes = myMesh->NbNodes(); + TInt aNbNodes = FromIdType( myMesh->NbNodes() ); PNodeInfo aNodeInfo = myMed->CrNodeInfo(aMeshInfo, aNbNodes, theMode, theSystem, theIsElemNum, theIsElemNames); @@ -559,7 +568,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() aTCoordSlice[2] = 0.; // node number - int aNodeID = aCoordHelperPtr->GetID(); + TInt aNodeID = FromIdType( aCoordHelperPtr->GetID() ); aNodeInfo->SetElemNum( iNode, aNodeID ); #ifdef _EDF_NODE_IDS_ aNodeIdMap.insert( aNodeIdMap.end(), make_pair( aNodeID, iNode+1 )); @@ -625,66 +634,66 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eBALL, - nbElemInfo.NbBalls(), + FromIdType(nbElemInfo.NbBalls()), SMDSAbs_Ball)); #ifdef _ELEMENTS_BY_DIM_ anEntity = eARETE; #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eSEG2, - nbElemInfo.NbEdges( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbEdges( ORDER_LINEAR )), SMDSAbs_Edge)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eSEG3, - nbElemInfo.NbEdges( ORDER_QUADRATIC ), + FromIdType(nbElemInfo.NbEdges( ORDER_QUADRATIC )), SMDSAbs_Edge)); #ifdef _ELEMENTS_BY_DIM_ anEntity = eFACE; #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA3, - nbElemInfo.NbTriangles( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbTriangles( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA6, - nbElemInfo.NbTriangles( ORDER_QUADRATIC ) - - nbElemInfo.NbBiQuadTriangles(), + FromIdType(nbElemInfo.NbTriangles( ORDER_QUADRATIC ) - + nbElemInfo.NbBiQuadTriangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTRIA7, - nbElemInfo.NbBiQuadTriangles(), + FromIdType(nbElemInfo.NbBiQuadTriangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD4, - nbElemInfo.NbQuadrangles( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbQuadrangles( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD8, - nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) - - nbElemInfo.NbBiQuadQuadrangles(), + FromIdType(nbElemInfo.NbQuadrangles( ORDER_QUADRATIC ) - + nbElemInfo.NbBiQuadQuadrangles()), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eQUAD9, - nbElemInfo.NbBiQuadQuadrangles(), + FromIdType(nbElemInfo.NbBiQuadQuadrangles()), SMDSAbs_Face)); if ( polyTypesSupported ) { aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGONE, - nbElemInfo.NbPolygons( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbPolygons( ORDER_LINEAR )), SMDSAbs_Face)); // we need one more loop on poly elements to count nb of their nodes aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGONE, - nbElemInfo.NbPolygons( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbPolygons( ORDER_LINEAR )), SMDSAbs_Face)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGON2, - nbElemInfo.NbPolygons( ORDER_QUADRATIC ), + FromIdType(nbElemInfo.NbPolygons( ORDER_QUADRATIC )), SMDSAbs_Face)); // we need one more loop on QUAD poly elements to count nb of their nodes aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYGON2, - nbElemInfo.NbPolygons( ORDER_QUADRATIC ), + FromIdType(nbElemInfo.NbPolygons( ORDER_QUADRATIC )), SMDSAbs_Face)); } #ifdef _ELEMENTS_BY_DIM_ @@ -692,58 +701,58 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() #endif aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTETRA4, - nbElemInfo.NbTetras( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbTetras( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eTETRA10, - nbElemInfo.NbTetras( ORDER_QUADRATIC ), + FromIdType(nbElemInfo.NbTetras( ORDER_QUADRATIC )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePYRA5, - nbElemInfo.NbPyramids( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbPyramids( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePYRA13, - nbElemInfo.NbPyramids( ORDER_QUADRATIC ), + FromIdType(nbElemInfo.NbPyramids( ORDER_QUADRATIC )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA6, - nbElemInfo.NbPrisms( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbPrisms( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA15, - nbElemInfo.NbQuadPrisms(), + FromIdType(nbElemInfo.NbQuadPrisms()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePENTA18, - nbElemInfo.NbBiQuadPrisms(), + FromIdType(nbElemInfo.NbBiQuadPrisms()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA8, - nbElemInfo.NbHexas( ORDER_LINEAR ), + FromIdType(nbElemInfo.NbHexas( ORDER_LINEAR )), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA20, - nbElemInfo.NbHexas( ORDER_QUADRATIC )- - nbElemInfo.NbTriQuadHexas(), + FromIdType(nbElemInfo.NbHexas( ORDER_QUADRATIC )- + nbElemInfo.NbTriQuadHexas()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eHEXA27, - nbElemInfo.NbTriQuadHexas(), + FromIdType(nbElemInfo.NbTriQuadHexas()), SMDSAbs_Volume)); aTElemTypeDatas.push_back( TElemTypeData(anEntity, eOCTA12, - nbElemInfo.NbHexPrisms(), + FromIdType(nbElemInfo.NbHexPrisms()), SMDSAbs_Volume)); if ( polyTypesSupported ) { aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYEDRE, - nbElemInfo.NbPolyhedrons(), + FromIdType(nbElemInfo.NbPolyhedrons()), SMDSAbs_Volume)); // we need one more loop on poly elements to count nb of their nodes aTElemTypeDatas.push_back( TElemTypeData(anEntity, ePOLYEDRE, - nbElemInfo.NbPolyhedrons(), + FromIdType(nbElemInfo.NbPolyhedrons()), SMDSAbs_Volume)); } @@ -822,13 +831,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() for(TInt iNode = 0; iNode < aNbNodes; iNode++) { const SMDS_MeshElement* aNode = anElem->GetNode( iNode ); #ifdef _EDF_NODE_IDS_ - aTConnSlice[ iNode ] = aNodeIdMap[aNode->GetID()]; + aTConnSlice[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; #else aTConnSlice[ iNode ] = aNode->GetID(); #endif } // element number - aPolygoneInfo->SetElemNum( iElem, anElem->GetID() ); + aPolygoneInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); // family number int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); @@ -896,14 +905,14 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() while ( nodeIt->more() ) { const SMDS_MeshElement* aNode = nodeIt->next(); #ifdef _EDF_NODE_IDS_ - conn[ iNode ] = aNodeIdMap[aNode->GetID()]; + conn[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; #else conn[ iNode ] = aNode->GetID(); #endif ++iNode; } // element number - aPolyhInfo->SetElemNum( iElem, anElem->GetID() ); + aPolyhInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); // family number int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); @@ -930,12 +939,12 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() // connectivity const SMDS_MeshElement* aNode = anElem->GetNode( 0 ); #ifdef _EDF_NODE_IDS_ - (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[aNode->GetID()]; + (*aBallInfo->myConn)[ iElem ] = aNodeIdMap[FromIdType(aNode->GetID())]; #else (*aBallInfo->myConn)[ iElem ] = aNode->GetID(); #endif // element number - aBallInfo->SetElemNum( iElem, anElem->GetID() ); + aBallInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); // diameter aBallInfo->myDiameters[ iElem ] = @@ -978,13 +987,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() for (TInt iNode = 0; iNode < aNbNodes; iNode++) { const SMDS_MeshElement* aNode = anElem->GetNode( iNode ); #ifdef _EDF_NODE_IDS_ - aTConnSlice[ iNode ] = aNodeIdMap[aNode->GetID()]; + aTConnSlice[ iNode ] = aNodeIdMap[FromIdType(aNode->GetID())]; #else aTConnSlice[ iNode ] = aNode->GetID(); #endif } // element number - aCellInfo->SetElemNum( iElem, anElem->GetID() ); + aCellInfo->SetElemNum( iElem, FromIdType(anElem->GetID()) ); // family number int famNum = getFamilyId( anElemFamMap, anElem, defaultFamilyId ); diff --git a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx index 6b507b00e..da3381285 100644 --- a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx @@ -45,6 +45,10 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() { Kernel_Utils::Localizer loc; Status aResult = DRS_OK; + + if ( Driver_Mesh::IsMeshTooLarge< int >( myMesh, /*checkIDs =*/ false)) + return DRS_TOO_LARGE_MESH; + #if defined(WIN32) && defined(UNICODE) std::wstring aFile = Kernel_Utils::utf8_decode_s(myFile); std::ofstream out_stream(aFile.c_str()); @@ -113,7 +117,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() { const SMDS_MeshNode* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( aNode->GetID() ); + aRec.node_labels.push_back( FromIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -137,7 +141,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() for ( aRec.node_labels.clear(); aNodesIter->more(); ) { const SMDS_MeshNode* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( aNode->GetID() ); + aRec.node_labels.push_back( FromIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -195,7 +199,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() { const SMDS_MeshElement* aNode = aNodesIter->next(); if ( nodeLabelByID.empty() ) - aRec.node_labels.push_back( aNode->GetID() ); + aRec.node_labels.push_back( FromIdType(aNode->GetID()) ); else aRec.node_labels.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -226,7 +230,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() while ( aIter->more() ) { const SMDS_MeshElement* aNode = aIter->next(); if ( nodeLabelByID.empty() ) - aRec.NodeList.push_back( aNode->GetID() ); + aRec.NodeList.push_back( FromIdType(aNode->GetID()) ); else aRec.NodeList.push_back( nodeLabelByID[ aNode->GetID() ]); } @@ -236,7 +240,7 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() while ( aIter->more() ) { const SMDS_MeshElement* aElem = aIter->next(); if ( elemLabelByID.empty() ) - aRec.ElementList.push_back( aElem->GetID() ); + aRec.ElementList.push_back( FromIdType(aElem->GetID()) ); else aRec.ElementList.push_back( elemLabelByID[ aElem->GetID() ]); } @@ -256,11 +260,11 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() EXCEPTION(runtime_error,"ERROR: Output file not good."); } catch(const std::exception& exc){ - INFOS("Follow exception was cought:\n\t"< TGroupList; class MESHDRIVERUNV_EXPORT DriverUNV_W_SMDS_Mesh: public Driver_SMDS_Mesh { public: - virtual Status Perform(); + + virtual Status Perform() override; void AddGroup(SMESHDS_GroupBase* theGroup) { myGroups.push_back(theGroup); } diff --git a/src/MEDWrapper/MED_Common.hxx b/src/MEDWrapper/MED_Common.hxx index d9d8253d3..f6f6f2b0c 100644 --- a/src/MEDWrapper/MED_Common.hxx +++ b/src/MEDWrapper/MED_Common.hxx @@ -32,6 +32,7 @@ #include #include +#include #ifdef WIN32 #pragma warning(disable:4099) @@ -77,6 +78,7 @@ namespace MED typedef enum {eCOOR, eCONN, eNOM, eNUM, eFAM, eCOOR_IND1, eCOOR_IND2, eCOOR_IND3} ETable; typedef TVector TIntVector; + typedef TVector TIDVector; typedef TVector TFloatVector; typedef TVector TStringVector; typedef std::set TStringSet; diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx index 1cc7927bf..a2fda0654 100644 --- a/src/OBJECT/SMESH_Actor.cxx +++ b/src/OBJECT/SMESH_Actor.cxx @@ -139,8 +139,8 @@ SMESH_ActorDef::SMESH_ActorDef() myIsFacesOriented = false; - int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement(); - int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); + float controlsIncrement = (float) SMESH_ActorProps::props()->controlsIncrement(); + float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement(); myControlsPrecision = -1; SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr(); @@ -148,11 +148,11 @@ SMESH_ActorDef::SMESH_ActorDef() if ( mgr && mgr->booleanValue( "SMESH", "use_precision", false ) ) myControlsPrecision = mgr->integerValue( "SMESH", "controls_precision", -1); - double aElem0DSize = SMESH::GetFloat("SMESH:elem0d_size",5); - double aBallElemSize = SMESH::GetFloat("SMESH:ball_elem_size",10); - double aBallElemScale = SMESH::GetFloat("SMESH:ball_elem_scale",1.0); - double aLineWidth = SMESH::GetFloat("SMESH:element_width",1); - double aOutlineWidth = SMESH::GetFloat("SMESH:outline_width",1); + float aElem0DSize = (float) SMESH::GetFloat("SMESH:elem0d_size",5); + float aBallElemSize = (float) SMESH::GetFloat("SMESH:ball_elem_size",10); + float aBallElemScale = (float) SMESH::GetFloat("SMESH:ball_elem_scale",1.0); + float aLineWidth = (float) SMESH::GetFloat("SMESH:element_width",1); + float aOutlineWidth = (float) SMESH::GetFloat("SMESH:outline_width",1); SMESH::LabelFont aFamilyNd = SMESH::FntTimes; bool aBoldNd = true; @@ -1035,7 +1035,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode ) return; } - int aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0; + smIdType aNbCells = myFunctor ? myVisualObj->GetNbEntities( myFunctor->GetType() ) : 0; bool aShowOnlyScalarBarTitle = false; if(aNbCells) { //myControlMode = theMode; @@ -1135,7 +1135,7 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode ) //Update(); } -int SMESH_ActorDef::GetNumberControlEntities() +smIdType SMESH_ActorDef::GetNumberControlEntities() { SMESH_DeviceActor* anAct = NULL; switch(myControlMode){ @@ -1161,7 +1161,7 @@ int SMESH_ActorDef::GetNumberControlEntities() break; default:; } - return (anAct) ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1; + return anAct ? anAct->GetUnstructuredGrid()->GetNumberOfCells() : -1; } void SMESH_ActorDef::AddToRender(vtkRenderer* theRenderer) @@ -1453,27 +1453,27 @@ void SMESH_ActorDef::UnShrink() } -int SMESH_ActorDef::GetNodeObjId(int theVtkID) +vtkIdType SMESH_ActorDef::GetNodeObjId(vtkIdType theVtkID) { return myPickableActor->GetNodeObjId(theVtkID); } -double* SMESH_ActorDef::GetNodeCoord(int theObjID) +double* SMESH_ActorDef::GetNodeCoord(vtkIdType theObjID) { return myPickableActor->GetNodeCoord(theObjID); } -int SMESH_ActorDef::GetNodeVtkId(int theObjID) +vtkIdType SMESH_ActorDef::GetNodeVtkId(vtkIdType theObjID) { return myPickableActor->GetNodeVtkId(theObjID); } -int SMESH_ActorDef::GetElemObjId(int theVtkID) +vtkIdType SMESH_ActorDef::GetElemObjId(vtkIdType theVtkID) { return myPickableActor->GetElemObjId(theVtkID); } -vtkCell* SMESH_ActorDef::GetElemCell(int theObjID) +vtkCell* SMESH_ActorDef::GetElemCell(vtkIdType theObjID) { return myPickableActor->GetElemCell(theObjID); } @@ -1664,11 +1664,11 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode) void SMESH_ActorDef::SetRepresentation (int theMode) { - int aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge); - int aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face); - int aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume); - int aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement); - int aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball); + smIdType aNbEdges = myVisualObj->GetNbEntities(SMDSAbs_Edge); + smIdType aNbFaces = myVisualObj->GetNbEntities(SMDSAbs_Face); + smIdType aNbVolumes = myVisualObj->GetNbEntities(SMDSAbs_Volume); + smIdType aNb0Ds = myVisualObj->GetNbEntities(SMDSAbs_0DElement); + smIdType aNbBalls = myVisualObj->GetNbEntities(SMDSAbs_Ball); if ( myRepresentationCache && aNbEdges + aNbFaces + aNbVolumes + aNb0Ds + aNbBalls ) { @@ -1713,7 +1713,7 @@ void SMESH_ActorDef::SetRepresentation (int theMode) myPickableActor = myBaseActor; vtkProperty *aProp = NULL, *aBackProp = NULL; vtkProperty *aPropVN = NULL, *aPropVR = NULL; - SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::EReperesent(-1); + SMESH_DeviceActor::EReperesent aReperesent = SMESH_DeviceActor::eNoneRepr; SMESH_Actor::EQuadratic2DRepresentation aQuadraticMode = GetQuadratic2DRepresentation(); switch (myRepresentation) { case ePoint: @@ -2125,8 +2125,8 @@ void SMESH_ActorDef::UpdateSelectionProps() { QColor selectionColor = SMESH_ActorProps::props()->selectionColor(); QColor highlightColor = SMESH_ActorProps::props()->highlightColor(); - int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); - double width = GetLineWidth(); + float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement(); + float width = (float) GetLineWidth(); myHighlightProp->SetColor(selectionColor.redF(), selectionColor.greenF(), selectionColor.blueF()); myHighlightProp->SetLineWidth(width + selectionIncrement); myPreselectProp->SetColor(highlightColor.redF(), highlightColor.greenF(), highlightColor.blueF()); @@ -2142,17 +2142,17 @@ double SMESH_ActorDef::GetLineWidth() void SMESH_ActorDef::SetLineWidth(double theVal) { - int controlsIncrement = SMESH_ActorProps::props()->controlsIncrement(); - int selectionIncrement = SMESH_ActorProps::props()->selectionIncrement(); + float controlsIncrement = (float) SMESH_ActorProps::props()->controlsIncrement(); + float selectionIncrement = (float) SMESH_ActorProps::props()->selectionIncrement(); - myEdgeProp->SetLineWidth(theVal); + myEdgeProp->SetLineWidth((float) theVal); - my1DProp->SetLineWidth(theVal + controlsIncrement); - my1DExtProp->SetLineWidth(theVal + controlsIncrement); - my2DExtProp->SetLineWidth(theVal + controlsIncrement); - my3DExtProp->SetLineWidth(theVal + controlsIncrement); - myHighlightProp->SetLineWidth(theVal + selectionIncrement); - myPreselectProp->SetLineWidth(theVal + selectionIncrement); + my1DProp ->SetLineWidth((float) theVal + controlsIncrement); + my1DExtProp ->SetLineWidth((float) theVal + controlsIncrement); + my2DExtProp ->SetLineWidth((float) theVal + controlsIncrement); + my3DExtProp ->SetLineWidth((float) theVal + controlsIncrement); + myHighlightProp->SetLineWidth((float) theVal + selectionIncrement); + myPreselectProp->SetLineWidth((float) theVal + selectionIncrement); Modified(); } @@ -2163,21 +2163,21 @@ double SMESH_ActorDef::GetOutlineWidth() void SMESH_ActorDef::SetOutlineWidth(double theVal) { - myOutLineProp->SetLineWidth(theVal); + myOutLineProp->SetLineWidth((float) theVal); Modified(); } void SMESH_ActorDef::Set0DSize(double theVal) { - my0DProp->SetPointSize(theVal); - myHighlightProp->SetPointSize(theVal); - myPreselectProp->SetPointSize(theVal); + my0DProp ->SetPointSize((float) theVal); + myHighlightProp->SetPointSize((float) theVal); + myPreselectProp->SetPointSize((float) theVal); if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) { - aCustom->Set0DSize(theVal); + aCustom->Set0DSize((float) theVal); } if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) { - aCustom->Set0DSize(theVal); + aCustom->Set0DSize((float) theVal); } Modified(); @@ -2190,13 +2190,13 @@ double SMESH_ActorDef::Get0DSize() void SMESH_ActorDef::SetBallSize(double theVal) { - myBallProp->SetPointSize(theVal); + myBallProp->SetPointSize((float) theVal); if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myHighlightActor )) { - aCustom->SetBallSize(theVal); + aCustom->SetBallSize((float) theVal); } if(SMESH_SVTKActor* aCustom = SMESH_SVTKActor::SafeDownCast( myPreHighlightActor )) { - aCustom->SetBallSize(theVal); + aCustom->SetBallSize((float) theVal); } Modified(); @@ -2225,7 +2225,7 @@ void SMESH_ActorDef::SetBallScale( double theVal ) Modified(); } -int SMESH_ActorDef::GetObjDimension( const int theObjId ) +int SMESH_ActorDef::GetObjDimension( const vtkIdType theObjId ) { return myVisualObj->GetElemDimension( theObjId ); } @@ -2495,7 +2495,7 @@ void SMESH_ActorDef::UpdateDistribution() SMESH_VisualObjDef::TEntityList elems; if ( dynamic_cast(myVisualObj.get())) dynamic_cast(myVisualObj.get())->GetEntities( fun->GetType(), elems ); - std::vector elemIds; elemIds.reserve( elems.size() ); + std::vector elemIds; elemIds.reserve( elems.size() ); for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e) elemIds.push_back( (*e)->GetID()); vtkLookupTable* lookupTable = static_cast(myScalarBarActor->GetLookupTable()); @@ -2681,7 +2681,7 @@ SPlot2d_Histogram* SMESH_ActorDef::UpdatePlot2Histogram() SMESH_VisualObjDef::TEntityList elems; if ( dynamic_cast(myVisualObj.get())) dynamic_cast(myVisualObj.get())->GetEntities( fun->GetType(), elems ); - std::vector elemIds; + std::vector elemIds; for ( SMESH_VisualObjDef::TEntityList::iterator e = elems.begin(); e != elems.end(); ++e) elemIds.push_back( (*e)->GetID()); diff --git a/src/OBJECT/SMESH_Actor.h b/src/OBJECT/SMESH_Actor.h index 9ef509d59..cff7f7511 100644 --- a/src/OBJECT/SMESH_Actor.h +++ b/src/OBJECT/SMESH_Actor.h @@ -148,7 +148,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor virtual void SetControl(SMESH::Controls::FunctorPtr) = 0; virtual eControl GetControlMode() = 0; virtual SMESH::Controls::FunctorPtr GetFunctor() = 0; - virtual int GetNumberControlEntities() = 0; + virtual smIdType GetNumberControlEntities() = 0; virtual SMESH_ScalarBarActor* GetScalarBarActor() = 0; diff --git a/src/OBJECT/SMESH_ActorDef.h b/src/OBJECT/SMESH_ActorDef.h index 36ef136fa..0c31dc6aa 100644 --- a/src/OBJECT/SMESH_ActorDef.h +++ b/src/OBJECT/SMESH_ActorDef.h @@ -144,14 +144,14 @@ class SMESH_ActorDef : public SMESH_Actor virtual void SetBallScale(double size); virtual double GetBallScale(); - virtual int GetNodeObjId(int theVtkID); - virtual double* GetNodeCoord(int theObjID); - virtual int GetNodeVtkId(int theObjID); + virtual vtkIdType GetNodeObjId(vtkIdType theVtkID); + virtual double* GetNodeCoord(vtkIdType theObjID); + virtual vtkIdType GetNodeVtkId(vtkIdType theObjID); - virtual int GetElemObjId(int theVtkID); - virtual vtkCell* GetElemCell(int theObjID); + virtual vtkIdType GetElemObjId(vtkIdType theVtkID); + virtual vtkCell* GetElemCell(vtkIdType theObjID); - virtual int GetObjDimension( const int theObjId ); + virtual int GetObjDimension( const vtkIdType theObjId ) override; virtual void SetVisibility(int theMode); void SetVisibility(int theMode, bool theIsUpdateRepersentation); @@ -206,7 +206,7 @@ class SMESH_ActorDef : public SMESH_Actor virtual void SetControlMode(eControl theMode); virtual void SetControl(SMESH::Controls::FunctorPtr theFunctor); - virtual int GetNumberControlEntities(); + virtual smIdType GetNumberControlEntities(); virtual eControl GetControlMode(){ return myControlMode;} virtual SMESH::Controls::FunctorPtr GetFunctor() { return myFunctor; } diff --git a/src/OBJECT/SMESH_ActorUtils.cxx b/src/OBJECT/SMESH_ActorUtils.cxx index 81f51a986..43c16d5af 100644 --- a/src/OBJECT/SMESH_ActorUtils.cxx +++ b/src/OBJECT/SMESH_ActorUtils.cxx @@ -157,17 +157,17 @@ namespace SMESH } } - std::map GetEntitiesFromObject(SMESH_VisualObj *theObject) { - std::map entities; - entities.insert(std::pair(SMDSAbs_0DElement, + std::map GetEntitiesFromObject(SMESH_VisualObj *theObject) { + std::map entities; + entities.insert(std::pair(SMDSAbs_0DElement, theObject ? theObject->GetNbEntities(SMDSAbs_0DElement) : 0)); - entities.insert(std::pair(SMDSAbs_Ball, + entities.insert(std::pair(SMDSAbs_Ball, theObject ? theObject->GetNbEntities(SMDSAbs_Ball) : 0)); - entities.insert(std::pair(SMDSAbs_Edge, + entities.insert(std::pair(SMDSAbs_Edge, theObject ? theObject->GetNbEntities(SMDSAbs_Edge) : 0)); - entities.insert(std::pair(SMDSAbs_Face, + entities.insert(std::pair(SMDSAbs_Face, theObject ? theObject->GetNbEntities(SMDSAbs_Face) : 0)); - entities.insert(std::pair(SMDSAbs_Volume, + entities.insert(std::pair(SMDSAbs_Volume, theObject ? theObject->GetNbEntities(SMDSAbs_Volume) : 0)); return entities; } diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h index d4d45fa83..90520f295 100644 --- a/src/OBJECT/SMESH_ActorUtils.h +++ b/src/OBJECT/SMESH_ActorUtils.h @@ -84,7 +84,7 @@ SMESHOBJECT_EXPORT QString def); SMESHOBJECT_EXPORT - std::map + std::map GetEntitiesFromObject(SMESH_VisualObj *theObject); SMESHOBJECT_EXPORT diff --git a/src/OBJECT/SMESH_CellLabelActor.cxx b/src/OBJECT/SMESH_CellLabelActor.cxx index 07275df16..693dcb44c 100644 --- a/src/OBJECT/SMESH_CellLabelActor.cxx +++ b/src/OBJECT/SMESH_CellLabelActor.cxx @@ -43,6 +43,7 @@ #include #include #include +#include vtkStandardNewMacro(SMESH_CellLabelActor) @@ -70,7 +71,7 @@ SMESH_CellLabelActor::SMESH_CellLabelActor() myClsLabeledDataMapper = vtkLabeledDataMapper::New(); myClsLabeledDataMapper->SetInputConnection(myClsSelectVisiblePoints->GetOutputPort()); - myClsLabeledDataMapper->SetLabelFormat("%d"); + //myClsLabeledDataMapper->SetLabelFormat("%d"); myClsLabeledDataMapper->SetLabelModeToLabelScalars(); myClsTextProp = vtkTextProperty::New(); @@ -156,18 +157,18 @@ void SMESH_CellLabelActor::SetCellsLabeled(bool theIsCellsLabeled) { myCellsNumDataSet->ShallowCopy(aGrid); vtkUnstructuredGrid *aDataSet = myCellsNumDataSet; - int aNbElem = aDataSet->GetNumberOfCells(); - vtkIntArray *anArray = vtkIntArray::New(); + vtkIdType aNbElem = aDataSet->GetNumberOfCells(); + vtkIdTypeArray *anArray = vtkIdTypeArray::New(); anArray->SetNumberOfValues(aNbElem); myExtractUnstructuredGrid->BuildOut2InMap(); - for(int anId = 0; anId < aNbElem; anId++) + for(vtkIdType anId = 0; anId < aNbElem; anId++) { vtkIdType id = anId; if(IsImplicitFunctionUsed()) id = myExtractGeometry->GetElemObjId(id); id = myExtractUnstructuredGrid->GetInputId(id); id = (id >=0) ? id : anId; - int aSMDSId = myVisualObj->GetElemObjId(id); + vtkIdType aSMDSId = myVisualObj->GetElemObjId(id); anArray->SetValue(anId,aSMDSId); } aDataSet->GetCellData()->SetScalars(anArray); diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx index 882326963..7733dd88d 100644 --- a/src/OBJECT/SMESH_DeviceActor.cxx +++ b/src/OBJECT/SMESH_DeviceActor.cxx @@ -31,7 +31,7 @@ #include "SMESH_ControlsDef.hxx" #include "SMESH_ActorUtils.h" #include "SMESH_FaceOrientationFilter.h" -#include "VTKViewer_CellLocationsArray.h" +//#include "VTKViewer_CellLocationsArray.h" #include "VTKViewer_PolyDataMapper.h" #include @@ -161,7 +161,7 @@ SMESH_DeviceActor myTransformFilter->Delete(); - for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) + for(size_t i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) myPassFilter[i]->Delete(); myShrinkFilter->Delete(); @@ -426,7 +426,7 @@ SMESH_DeviceActor aCellTypesArray->SetNumberOfTuples( aNbCells ); aScalars->SetNumberOfTuples( aNbCells ); - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); @@ -491,7 +491,7 @@ SMESH_DeviceActor aCellTypesArray->SetNumberOfTuples( aNbCells ); aScalars->SetNumberOfTuples( aNbCells ); - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); @@ -586,7 +586,7 @@ SMESH_DeviceActor } } - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); @@ -604,7 +604,7 @@ SMESH_DeviceActor ( aPredicate = dynamic_cast(theFunctor.get()))) { myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding); - vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node); + vtkIdType aNbNodes = FromIdType(myVisualObj->GetNbEntities(SMDSAbs_Node)); for( vtkIdType i = 0; i < aNbNodes; i++ ){ vtkIdType anObjId = myVisualObj->GetNodeObjId(i); if(aPredicate->IsSatisfy(anObjId)) @@ -783,6 +783,8 @@ SMESH_DeviceActor myGeomFilter->SetInside(false); myGeomFilter->SetWireframeMode(false); GetProperty()->SetRepresentation(theMode); + case eNoneRepr: + return; } SetMarkerEnabled(theMode == ePoint); myRepresentation = theMode; @@ -839,9 +841,9 @@ SMESH_DeviceActor } -int +vtkIdType SMESH_DeviceActor -::GetNodeObjId(int theVtkID) +::GetNodeObjId(vtkIdType theVtkID) { vtkIdType anID = theVtkID; @@ -855,7 +857,7 @@ SMESH_DeviceActor double* SMESH_DeviceActor -::GetNodeCoord(int theObjID) +::GetNodeCoord(vtkIdType theObjID) { vtkDataSet* aDataSet = myMergeFilter->GetOutput(); vtkIdType anID = myVisualObj->GetNodeVTKId(theObjID); @@ -864,16 +866,16 @@ SMESH_DeviceActor return aCoord; } -int +vtkIdType SMESH_DeviceActor -::GetNodeVtkId(int theObjID) +::GetNodeVtkId(vtkIdType theObjID) { return myVisualObj->GetNodeVTKId(theObjID); } -int +vtkIdType SMESH_DeviceActor -::GetElemObjId(int theVtkID) +::GetElemObjId(vtkIdType theVtkID) { vtkIdType anId = myGeomFilter->GetElemObjId(theVtkID); if(anId < 0) @@ -897,7 +899,7 @@ SMESH_DeviceActor vtkCell* SMESH_DeviceActor -::GetElemCell(int theObjID) +::GetElemCell(vtkIdType theObjID) { vtkDataSet* aDataSet = myVisualObj->GetUnstructuredGrid(); vtkIdType aGridID = myVisualObj->GetElemVTKId(theObjID); diff --git a/src/OBJECT/SMESH_DeviceActor.h b/src/OBJECT/SMESH_DeviceActor.h index 70c39ba71..a9588e3ed 100644 --- a/src/OBJECT/SMESH_DeviceActor.h +++ b/src/OBJECT/SMESH_DeviceActor.h @@ -68,12 +68,12 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{ void SetStoreGemetryMapping(bool theStoreMapping); void SetStoreIDMapping(bool theStoreMapping); - virtual int GetNodeObjId(int theVtkID); - virtual double* GetNodeCoord(int theObjID); - virtual int GetNodeVtkId(int theObjID); + virtual vtkIdType GetNodeObjId(vtkIdType theVtkID); + virtual double* GetNodeCoord(vtkIdType theObjID); + virtual vtkIdType GetNodeVtkId(vtkIdType theObjID); - virtual int GetElemObjId(int theVtkID); - virtual vtkCell* GetElemCell(int theObjID); + virtual vtkIdType GetElemObjId(vtkIdType theVtkID); + virtual vtkCell* GetElemCell(vtkIdType theObjID); virtual void SetTransform(VTKViewer_Transform* theTransform); virtual vtkMTimeType GetMTime(); @@ -108,7 +108,7 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{ void SetShrink(); void UnShrink(); - enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe}; + enum EReperesent { ePoint, eWireframe, eSurface, eInsideframe, eNoneRepr=-1}; EReperesent GetRepresentation(){ return myRepresentation;} void SetRepresentation(EReperesent theMode); diff --git a/src/OBJECT/SMESH_ExtractGeometry.cxx b/src/OBJECT/SMESH_ExtractGeometry.cxx index 4a4ab1716..02fb74391 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.cxx +++ b/src/OBJECT/SMESH_ExtractGeometry.cxx @@ -58,16 +58,16 @@ SMESH_ExtractGeometry::SMESH_ExtractGeometry() SMESH_ExtractGeometry::~SMESH_ExtractGeometry() {} -vtkIdType SMESH_ExtractGeometry::GetElemObjId(int theVtkID) +vtkIdType SMESH_ExtractGeometry::GetElemObjId(vtkIdType theVtkID) { - if( theVtkID < 0 || theVtkID >= (int)myElemVTK2ObjIds.size()) return -1; + if( theVtkID < 0 || theVtkID >= myElemVTK2ObjIds.size()) return -1; return myElemVTK2ObjIds[theVtkID]; } -vtkIdType SMESH_ExtractGeometry::GetNodeObjId(int theVtkID) +vtkIdType SMESH_ExtractGeometry::GetNodeObjId(vtkIdType theVtkID) { - if ( theVtkID < 0 || theVtkID >= (int)myNodeVTK2ObjIds.size()) return -1; + if ( theVtkID < 0 || theVtkID >= myNodeVTK2ObjIds.size()) return -1; return myNodeVTK2ObjIds[theVtkID]; } diff --git a/src/OBJECT/SMESH_ExtractGeometry.h b/src/OBJECT/SMESH_ExtractGeometry.h index f417c49b2..dac601095 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.h +++ b/src/OBJECT/SMESH_ExtractGeometry.h @@ -42,8 +42,8 @@ public: } bool GetStoreMapping(){ return myStoreMapping;} - virtual vtkIdType GetNodeObjId(int theVtkID); - virtual vtkIdType GetElemObjId(int theVtkID); + virtual vtkIdType GetNodeObjId(vtkIdType theVtkID); + virtual vtkIdType GetElemObjId(vtkIdType theVtkID); protected: SMESH_ExtractGeometry(); diff --git a/src/OBJECT/SMESH_NodeLabelActor.cxx b/src/OBJECT/SMESH_NodeLabelActor.cxx index 4d4afbf41..cafe8bc81 100644 --- a/src/OBJECT/SMESH_NodeLabelActor.cxx +++ b/src/OBJECT/SMESH_NodeLabelActor.cxx @@ -61,7 +61,7 @@ SMESH_NodeLabelActor::SMESH_NodeLabelActor() myPtsLabeledDataMapper = vtkLabeledDataMapper::New(); myPtsLabeledDataMapper->SetInputConnection(myPtsSelectVisiblePoints->GetOutputPort()); - myPtsLabeledDataMapper->SetLabelFormat("%d"); + //myPtsLabeledDataMapper->SetLabelFormat("%d"); myPtsLabeledDataMapper->SetLabelModeToLabelScalars(); myPtsTextProp = vtkTextProperty::New(); @@ -145,18 +145,18 @@ void SMESH_NodeLabelActor::SetPointsLabeled(bool theIsPointsLabeled) { myPointsNumDataSet->ShallowCopy(aGrid); vtkUnstructuredGrid *aDataSet = myPointsNumDataSet; - - int aNbElem = aDataSet->GetNumberOfPoints(); - - vtkIntArray *anArray = vtkIntArray::New(); + + vtkIdType aNbElem = aDataSet->GetNumberOfPoints(); + + vtkIdTypeArray *anArray = vtkIdTypeArray::New(); anArray->SetNumberOfValues( aNbElem ); - + for ( vtkIdType anId = 0; anId < aNbElem; anId++ ) { - int aSMDSId = myVisualObj->GetNodeObjId( anId ); + vtkIdType aSMDSId = myVisualObj->GetNodeObjId( anId ); anArray->SetValue( anId, aSMDSId ); } - + aDataSet->GetPointData()->SetScalars( anArray ); myPtsMaskPoints->SetInputData( aDataSet ); myPointLabels->SetVisibility( GetVisibility() ); diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 039eba728..e7696cd00 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -38,7 +38,7 @@ #include #include -#include +//#include #include CORBA_SERVER_HEADER(SMESH_Gen) #include CORBA_SERVER_HEADER(SALOME_Exception) @@ -103,7 +103,7 @@ SMESH_VisualObjDef::~SMESH_VisualObjDef() // functions : GetNodeObjId, GetNodeVTKId, GetElemObjId, GetElemVTKId // purpose : Methods for retrieving VTK IDs by SMDS IDs and vice versa //================================================================================= -vtkIdType SMESH_VisualObjDef::GetNodeObjId( int theVTKID ) +vtkIdType SMESH_VisualObjDef::GetNodeObjId( vtkIdType theVTKID ) { if (myLocalGrid) { @@ -114,10 +114,10 @@ vtkIdType SMESH_VisualObjDef::GetNodeObjId( int theVTKID ) if( this->GetMesh() ) aNode = this->GetMesh()->FindNodeVtk( theVTKID ); - return aNode ? aNode->GetID() : -1; + return aNode ? FromIdType(aNode->GetID()) : -1; } -vtkIdType SMESH_VisualObjDef::GetNodeVTKId( int theObjID ) +vtkIdType SMESH_VisualObjDef::GetNodeVTKId( vtkIdType theObjID ) { if (myLocalGrid) { @@ -132,17 +132,17 @@ vtkIdType SMESH_VisualObjDef::GetNodeVTKId( int theObjID ) return aNode ? aNode->GetVtkID() : -1; } -vtkIdType SMESH_VisualObjDef::GetElemObjId( int theVTKID ) +vtkIdType SMESH_VisualObjDef::GetElemObjId( vtkIdType theVTKID ) { if (myLocalGrid) { TMapOfIds::const_iterator i = myVTK2SMDSElems.find(theVTKID); return i == myVTK2SMDSElems.end() ? -1 : i->second; } - return this->GetMesh()->FromVtkToSmds(theVTKID); + return FromIdType(this->GetMesh()->FromVtkToSmds(theVTKID)); } -vtkIdType SMESH_VisualObjDef::GetElemVTKId( int theObjID ) +vtkIdType SMESH_VisualObjDef::GetElemVTKId( vtkIdType theObjID ) { if (myLocalGrid) { @@ -171,7 +171,7 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints ) return; TEntityList aNodes; - vtkIdType nbNodes = GetEntities( SMDSAbs_Node, aNodes ); + vtkIdType nbNodes = FromIdType(GetEntities( SMDSAbs_Node, aNodes )); thePoints->SetNumberOfPoints( nbNodes ); int nbPoints = 0; @@ -183,7 +183,7 @@ void SMESH_VisualObjDef::createPoints( vtkPoints* thePoints ) if ( aNode != 0 ) { thePoints->SetPoint( nbPoints, aNode->X(), aNode->Y(), aNode->Z() ); - int anId = aNode->GetID(); + smIdType anId = aNode->GetID(); mySMDS2VTKNodes.insert( mySMDS2VTKNodes.end(), std::make_pair( anId, nbPoints )); myVTK2SMDSNodes.insert( myVTK2SMDSNodes.end(), std::make_pair( nbPoints, anId )); nbPoints++; @@ -284,7 +284,7 @@ namespace{ theConnect.clear(); for(; theNodesIter->more();) theConnect.push_back(theNodesIter->next()); - return theConnect.size(); + return (int) theConnect.size(); } inline @@ -292,7 +292,7 @@ namespace{ const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes, const TConnect& theConnect, int thePosition, - int theId) + vtkIdType theId) { theIdList->SetId(thePosition,theSMDS2VTKNodes.find(theConnect[theId]->GetID())->second); } @@ -319,7 +319,7 @@ void SMESH_VisualObjDef::buildElemPrs() { SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Volume, SMDSAbs_Ball, SMDSAbs_0DElement }; // get entity data - map nbEnts; + map nbEnts; map anEnts; vtkIdType aNbCells = 0; @@ -404,9 +404,9 @@ void SMESH_VisualObjDef::buildElemPrs() vtkIdType aNbNodes = anElem->NbNodes(); anIdList->SetNumberOfIds( aNbNodes ); - const vtkIdType vtkElemType = SMDS_MeshCell::toVtkType( anElem->GetEntityType() ); + const VTKCellType vtkElemType = SMDS_MeshCell::toVtkType( anElem->GetEntityType() ); - int anId = anElem->GetID(); + smIdType anId = anElem->GetID(); mySMDS2VTKElems.insert( mySMDS2VTKElems.end(), std::make_pair( anId, iElem )); myVTK2SMDSElems.insert( myVTK2SMDSElems.end(), std::make_pair( iElem, anId )); @@ -424,7 +424,7 @@ void SMESH_VisualObjDef::buildElemPrs() anIdList->InsertNextId(ph->NbFaceNodes(i)); for(int j = 1; j <= ph->NbFaceNodes(i); j++) { if ( const SMDS_MeshNode* n = ph->GetFaceNode( i, j )) - anIdList->InsertNextId( mySMDS2VTKNodes[ n->GetID() ]); + anIdList->InsertNextId( mySMDS2VTKNodes[ FromIdType(n->GetID()) ]); } } } @@ -435,13 +435,13 @@ void SMESH_VisualObjDef::buildElemPrs() if (aConnectivities.size() > 0) { aConnect.clear(); GetConnect(aNodesIter,aConnect); - for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++) + for (int aNodeId = 0; aNodeId < aNbNodes; aNodeId++) SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]); } else { for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){ const SMDS_MeshElement* aNode = aNodesIter->next(); - anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] ); + anIdList->SetId( aNodeId, mySMDS2VTKNodes[FromIdType(aNode->GetID())] ); } } } @@ -465,7 +465,7 @@ void SMESH_VisualObjDef::buildElemPrs() // Insert cells in grid - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); @@ -491,10 +491,10 @@ void SMESH_VisualObjDef::buildElemPrs() // function : GetEdgeNodes // purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 0 ) //================================================================================= -bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const +bool SMESH_VisualObjDef::GetEdgeNodes( const smIdType theElemId, + const int theEdgeNum, + smIdType& theNodeId1, + smIdType& theNodeId2 ) const { const SMDS_Mesh* aMesh = GetMesh(); if ( aMesh == 0 ) @@ -557,7 +557,7 @@ void SMESH_VisualObjDef::updateEntitiesFlags() unsigned int tmp = myEntitiesState; ClearEntitiesFlags(); - map entities = SMESH::GetEntitiesFromObject(this); + map entities = SMESH::GetEntitiesFromObject(this); if( myEntitiesCache[SMDSAbs_0DElement] != 0 || @@ -681,7 +681,7 @@ bool SMESH_MeshObj::NulData() // function : GetElemDimension // purpose : Get dimension of element //================================================================================= -int SMESH_MeshObj::GetElemDimension( const int theObjId ) +int SMESH_MeshObj::GetElemDimension( const smIdType theObjId ) { const SMDS_MeshElement* anElem = myClient->FindElement( theObjId ); if ( anElem == 0 ) @@ -703,7 +703,7 @@ int SMESH_MeshObj::GetElemDimension( const int theObjId ) // function : GetEntities // purpose : Get entities of specified type. Return number of entities //================================================================================= -int SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const +smIdType SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const { switch ( theType ) { @@ -742,7 +742,7 @@ int SMESH_MeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const } } -int SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const +smIdType SMESH_MeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theObjs ) const { theObjs.clear(); @@ -834,7 +834,7 @@ SMESH_SubMeshObj::~SMESH_SubMeshObj() // function : GetElemDimension // purpose : Get dimension of element //================================================================================= -int SMESH_SubMeshObj::GetElemDimension( const int theObjId ) +int SMESH_SubMeshObj::GetElemDimension( const smIdType theObjId ) { return myMeshObj == 0 ? 0 : myMeshObj->GetElemDimension( theObjId ); } @@ -908,13 +908,13 @@ SMDSAbs_ElementType SMESH_GroupObj::GetElementType() const // function : getNodesFromElems // purpose : Retrieve nodes from elements //================================================================================= -static int getNodesFromElems( SMESH::long_array_var& theElemIds, +static int getNodesFromElems( SMESH::smIdType_array_var& theElemIds, const SMDS_Mesh* theMesh, std::list& theResList ) { set aNodeSet; - for ( CORBA::Long i = 0, n = theElemIds->length(); i < n; i++ ) + for ( CORBA::ULong i = 0, n = theElemIds->length(); i < n; i++ ) { const SMDS_MeshElement* anElem = theMesh->FindElement( theElemIds[ i ] ); if ( anElem != 0 ) @@ -929,11 +929,9 @@ static int getNodesFromElems( SMESH::long_array_var& theElemIds, } } - set::const_iterator anIter; - for ( anIter = aNodeSet.begin(); anIter != aNodeSet.end(); ++anIter ) - theResList.push_back( *anIter ); + theResList.assign( aNodeSet.begin(), aNodeSet.end() ); - return theResList.size(); + return (int) aNodeSet.size(); } //================================================================================= @@ -941,11 +939,11 @@ static int getNodesFromElems( SMESH::long_array_var& theElemIds, // purpose : Get std::list from list of IDs //================================================================================= static int getPointers( const SMDSAbs_ElementType theRequestType, - SMESH::long_array_var& theElemIds, + SMESH::smIdType_array_var& theElemIds, const SMDS_Mesh* theMesh, std::list& theResList ) { - for ( CORBA::Long i = 0, n = theElemIds->length(); i < n; i++ ) + for ( CORBA::ULong i = 0, n = theElemIds->length(); i < n; i++ ) { const SMDS_MeshElement* anElem = theRequestType == SMDSAbs_Node ? theMesh->FindNode( theElemIds[ i ] ) : theMesh->FindElement( theElemIds[ i ] ); @@ -954,7 +952,7 @@ static int getPointers( const SMDSAbs_ElementType theRequestType, theResList.push_back( anElem ); } - return theResList.size(); + return (int) theResList.size(); } @@ -962,7 +960,7 @@ static int getPointers( const SMDSAbs_ElementType theRequestType, // function : GetEntities // purpose : Get entities of specified type. Return number of entities //================================================================================= -int SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const +smIdType SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const { if(SMDSAbs_ElementType(myGroupServer->GetType()) == theType) { return myGroupServer->Size(); @@ -973,11 +971,11 @@ int SMESH_GroupObj::GetNbEntities( const SMDSAbs_ElementType theType) const return 0; } -int SMESH_GroupObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const +smIdType SMESH_GroupObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const { theResList.clear(); SMDS_Mesh* aMesh = myMeshObj->GetMesh(); - + if ( aMesh == 0 ) return 0; @@ -985,7 +983,7 @@ int SMESH_GroupObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& if ( aGrpType != theType && theType != SMDSAbs_Node ) return 0; - SMESH::long_array_var anIds = myGroupServer->GetListOfID(); + SMESH::smIdType_array_var anIds = myGroupServer->GetListOfID(); if ( anIds->length() == 0 ) return 0; @@ -1028,7 +1026,7 @@ SMESH_subMeshObj::~SMESH_subMeshObj() // function : GetEntities // purpose : Get entities of specified type. Return number of entities //================================================================================= -int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const +smIdType SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const { switch ( theType ) { @@ -1043,7 +1041,7 @@ int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const case SMDSAbs_Face: case SMDSAbs_Volume: { - SMESH::long_array_var anIds = + SMESH::smIdType_array_var anIds = mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) ); return anIds->length(); } @@ -1053,7 +1051,7 @@ int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const } } -int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const +smIdType SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityList& theResList ) const { theResList.clear(); @@ -1067,7 +1065,7 @@ int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityLis { if ( theType == SMDSAbs_Node ) { - SMESH::long_array_var anIds = mySubMeshServer->GetNodesId(); + SMESH::smIdType_array_var anIds = mySubMeshServer->GetNodesId(); return getPointers( SMDSAbs_Node, anIds, aMesh, theResList ); } } @@ -1075,12 +1073,12 @@ int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityLis { if ( theType == SMDSAbs_Node ) { - SMESH::long_array_var anIds = mySubMeshServer->GetElementsId(); + SMESH::smIdType_array_var anIds = mySubMeshServer->GetElementsId(); return getNodesFromElems( anIds, aMesh, theResList ); } else { - SMESH::long_array_var anIds = + SMESH::smIdType_array_var anIds = mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) ); return getPointers( theType, anIds, aMesh, theResList ); } diff --git a/src/OBJECT/SMESH_Object.h b/src/OBJECT/SMESH_Object.h index d7c1a3688..7fd4d1450 100644 --- a/src/OBJECT/SMESH_Object.h +++ b/src/OBJECT/SMESH_Object.h @@ -45,6 +45,7 @@ #include "SMDSAbs_ElementType.hxx" #include +#include #include CORBA_SERVER_HEADER(SMESH_Mesh) class SMDS_Mesh; @@ -61,24 +62,24 @@ public: virtual bool Update( int theIsClear = true ) = 0; virtual bool NulData() = 0; virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0; - virtual int GetElemDimension( const int theObjId ) = 0; + virtual int GetElemDimension( const smIdType theObjId ) = 0; - virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0; + virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const = 0; virtual SMDS_Mesh* GetMesh() const = 0; virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0; - virtual bool GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const = 0; + virtual bool GetEdgeNodes( const smIdType theElemId, + const int theEdgeNum, + smIdType& theNodeId1, + smIdType& theNodeId2 ) const = 0; virtual bool IsValid() const = 0; virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0; - virtual vtkIdType GetNodeObjId( int theVTKID ) = 0; - virtual vtkIdType GetNodeVTKId( int theObjID ) = 0; - virtual vtkIdType GetElemObjId( int theVTKID ) = 0; - virtual vtkIdType GetElemVTKId( int theObjID ) = 0; + virtual vtkIdType GetNodeObjId( vtkIdType theVTKID ) = 0; + virtual vtkIdType GetNodeVTKId( vtkIdType theObjID ) = 0; + virtual vtkIdType GetElemObjId( vtkIdType theVTKID ) = 0; + virtual vtkIdType GetElemVTKId( vtkIdType theObjID ) = 0; virtual void ClearEntitiesFlags() = 0; virtual bool GetEntitiesFlag() = 0; virtual unsigned int GetEntitiesState() = 0; diff --git a/src/OBJECT/SMESH_ObjectDef.h b/src/OBJECT/SMESH_ObjectDef.h index de5cee59c..678a34fa5 100644 --- a/src/OBJECT/SMESH_ObjectDef.h +++ b/src/OBJECT/SMESH_ObjectDef.h @@ -63,27 +63,27 @@ public: virtual bool Update( int theIsClear = true ) = 0; virtual bool NulData() {return 0; }; virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ) = 0; - virtual int GetElemDimension( const int theObjId ) = 0; + virtual int GetElemDimension( const smIdType theObjId ) = 0; - virtual int GetNbEntities( const SMDSAbs_ElementType theType) const = 0; - virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0; + virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const = 0; + virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const = 0; virtual bool IsNodePrs() const = 0; virtual SMDS_Mesh* GetMesh() const = 0; virtual SMESH::SMESH_Mesh_ptr GetMeshServer() = 0; virtual bool IsValid() const; - virtual bool GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const; + virtual bool GetEdgeNodes( const smIdType theElemId, + const int theEdgeNum, + smIdType& theNodeId1, + smIdType& theNodeId2 ) const; virtual vtkUnstructuredGrid* GetUnstructuredGrid(); - virtual vtkIdType GetNodeObjId( int theVTKID ); - virtual vtkIdType GetNodeVTKId( int theObjID ); - virtual vtkIdType GetElemObjId( int theVTKID ); - virtual vtkIdType GetElemVTKId( int theObjID ); + virtual vtkIdType GetNodeObjId( vtkIdType theVTKID ); + virtual vtkIdType GetNodeVTKId( vtkIdType theObjID ); + virtual vtkIdType GetElemObjId( vtkIdType theVTKID ); + virtual vtkIdType GetElemVTKId( vtkIdType theObjID ); virtual void ClearEntitiesFlags(); virtual bool GetEntitiesFlag(); @@ -108,7 +108,7 @@ protected: unsigned int myEntitiesState; vtkUnstructuredGrid* myGrid; - std::map myEntitiesCache; + std::map myEntitiesCache; }; @@ -127,11 +127,11 @@ public: virtual bool Update( int theIsClear = true ); virtual bool NulData(); - virtual int GetNbEntities( const SMDSAbs_ElementType) const; - virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; + virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const; + virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; virtual bool IsNodePrs() const; - virtual int GetElemDimension( const int theObjId ); + virtual int GetElemDimension( const smIdType theObjId ); virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ); @@ -160,7 +160,7 @@ public: virtual bool Update( int theIsClear = true ); virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ); - virtual int GetElemDimension( const int theObjId ); + virtual int GetElemDimension( const smIdType theObjId ); virtual SMDS_Mesh* GetMesh() const { return myMeshObj->GetMesh(); } virtual SMESH::SMESH_Mesh_ptr GetMeshServer() { return myMeshObj->GetMeshServer(); } @@ -181,8 +181,8 @@ public: SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr, SMESH_MeshObj* ); virtual ~SMESH_GroupObj(); - virtual int GetNbEntities( const SMDSAbs_ElementType) const; - virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; + virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const; + virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; virtual bool IsNodePrs() const; virtual SMDSAbs_ElementType GetElementType() const; @@ -206,8 +206,8 @@ public: SMESH_MeshObj* ); virtual ~SMESH_subMeshObj(); - virtual int GetNbEntities( const SMDSAbs_ElementType) const; - virtual int GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; + virtual smIdType GetNbEntities( const SMDSAbs_ElementType) const; + virtual smIdType GetEntities( const SMDSAbs_ElementType, TEntityList& ) const; virtual bool IsNodePrs() const; protected: diff --git a/src/OBJECT/SMESH_SVTKActor.cxx b/src/OBJECT/SMESH_SVTKActor.cxx index 103a46f1e..d7a5df295 100644 --- a/src/OBJECT/SMESH_SVTKActor.cxx +++ b/src/OBJECT/SMESH_SVTKActor.cxx @@ -108,7 +108,7 @@ SMESH_SVTKActor void SMESH_SVTKActor ::MapCells(SALOME_Actor* theMapActor, - const TColStd_IndexedMapOfInteger& theMapIndex) + const SVTK_TIndexedMapOfVtkId& theMapIndex) { myUnstructuredGrid->Initialize(); myUnstructuredGrid->Allocate(); @@ -134,8 +134,9 @@ SMESH_SVTKActor cd = aSourceGrid->GetCellData(); } outputCD->CopyAllocate(cd,aNbOfParts,aNbOfParts/2); - for(int ind = 1; ind <= aNbOfParts; ind++){ - int aPartId = theMapIndex( ind ); + for(int ind = 1; ind <= aNbOfParts; ind++) + { + vtkIdType aPartId = theMapIndex( ind ); if(vtkCell* aCell = theMapActor->GetElemCell(aPartId)) { if (aCell->GetCellType() != VTK_POLYHEDRON) diff --git a/src/OBJECT/SMESH_SVTKActor.h b/src/OBJECT/SMESH_SVTKActor.h index 77499fde5..570eb5261 100644 --- a/src/OBJECT/SMESH_SVTKActor.h +++ b/src/OBJECT/SMESH_SVTKActor.h @@ -61,7 +61,7 @@ public: //! Allow to recostruct selected cells from source SALOME_Actor and map of subindexes virtual void MapCells(SALOME_Actor* theMapActor, - const TColStd_IndexedMapOfInteger& theMapIndex); + const SVTK_TIndexedMapOfVtkId& theMapIndex); //! To remove the actor an all its internal devices diff --git a/src/SMDS/SMDS_CellOfNodes.cxx b/src/SMDS/SMDS_CellOfNodes.cxx index 0aed491f4..f01c4a697 100644 --- a/src/SMDS/SMDS_CellOfNodes.cxx +++ b/src/SMDS/SMDS_CellOfNodes.cxx @@ -25,18 +25,18 @@ #include "SMDS_CellOfNodes.hxx" -SMDS_CellOfNodes::SMDS_CellOfNodes( int id, int shapeID ) +SMDS_CellOfNodes::SMDS_CellOfNodes( smIdType id, int shapeID ) : myID( id ) { setShapeID( shapeID ); } -void SMDS_CellOfNodes::setID(const int id) +void SMDS_CellOfNodes::setID(const smIdType id) { myID = id; } -int SMDS_CellOfNodes::GetID() const +smIdType SMDS_CellOfNodes::GetID() const { return myID; } diff --git a/src/SMDS/SMDS_CellOfNodes.hxx b/src/SMDS/SMDS_CellOfNodes.hxx index acedefeb8..4475ab6b3 100644 --- a/src/SMDS/SMDS_CellOfNodes.hxx +++ b/src/SMDS/SMDS_CellOfNodes.hxx @@ -31,6 +31,8 @@ #include "SMDS_MeshElement.hxx" +#include + // ============================================================ /*! * \brief Base class for elements not contained in the mesh @@ -42,8 +44,8 @@ class SMDS_EXPORT SMDS_CellOfNodes : public SMDS_MeshElement { public: - virtual int GetID() const; - virtual int GetShapeID() const; + virtual smIdType GetID() const; + virtual int GetShapeID() const; virtual void setIsMarked( bool is ) const; virtual bool isMarked() const; @@ -52,13 +54,13 @@ public: protected: - SMDS_CellOfNodes( int id = -1, int shapeID = 0); + SMDS_CellOfNodes( smIdType id = -1, int shapeID = 0); - virtual void setID( const int id); + virtual void setID( const smIdType id); virtual void setShapeID( const int shapeID ); - int myID; - int myShapeID; + smIdType myID; + int myShapeID; enum Bits { // use the 1st right bit of myShapeId to set/unset a mark BIT_IS_MARKED = 1, diff --git a/src/SMDS/SMDS_Downward.cxx b/src/SMDS/SMDS_Downward.cxx index a788a9e51..124655a34 100644 --- a/src/SMDS/SMDS_Downward.cxx +++ b/src/SMDS/SMDS_Downward.cxx @@ -27,6 +27,7 @@ #include #include +#include #include @@ -232,7 +233,7 @@ void SMDS_Down1D::compactStorage() _cellIds.resize(_nbDownCells * _maxId); _vtkCellIds.resize(_maxId); - int sizeUpCells = 0; + smIdType sizeUpCells = 0; for (int i = 0; i < _maxId; i++) sizeUpCells += _upCellIdsVector[i].size(); _upCellIds.resize(sizeUpCells, -1); @@ -258,8 +259,8 @@ void SMDS_Down1D::compactStorage() void SMDS_Down1D::addUpCell(int cellId, int upCellId, unsigned char aType) { //ASSERT((cellId >=0) && (cellId < _maxId)); - int nbFaces = _upCellIdsVector[cellId].size(); - for (int i = 0; i < nbFaces; i++) + smIdType nbFaces = _upCellIdsVector[cellId].size(); + for (smIdType i = 0; i < nbFaces; i++) { if ((_upCellIdsVector[cellId][i] == upCellId) && (_upCellTypesVector[cellId][i] == aType)) { diff --git a/src/SMDS/SMDS_ElementFactory.cxx b/src/SMDS/SMDS_ElementFactory.cxx index e4dbe1ae0..1501b1eb5 100644 --- a/src/SMDS/SMDS_ElementFactory.cxx +++ b/src/SMDS/SMDS_ElementFactory.cxx @@ -104,15 +104,15 @@ int SMDS_ElementFactory::ChunkSize() //================================================================================ /*! * \brief Return minimal ID of a non-used element - * \return int - minimal element ID + * \return smIdType - minimal element ID */ //================================================================================ -int SMDS_ElementFactory::GetFreeID() +smIdType SMDS_ElementFactory::GetFreeID() { if ( myChunksWithUnused.empty() ) { - int id0 = myChunks.size() * theChunkSize + 1; + smIdType id0 = myChunks.size() * theChunkSize + 1; myChunks.push_back( new SMDS_ElementChunk( this, id0 )); } SMDS_ElementChunk * chunk = (*myChunksWithUnused.begin()); @@ -122,15 +122,15 @@ int SMDS_ElementFactory::GetFreeID() //================================================================================ /*! * \brief Return maximal ID of an used element - * \return int - element ID + * \return smIdType - element ID */ //================================================================================ -int SMDS_ElementFactory::GetMaxID() +smIdType SMDS_ElementFactory::GetMaxID() { - int id = 0; + smIdType id = 0; TIndexRanges usedRanges; - for ( int i = myChunks.size() - 1; i >= 0; --i ) + for ( smIdType i = myChunks.size() - 1; i >= 0; --i ) if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges )) { int index = usedRanges.back().second-1; @@ -143,13 +143,13 @@ int SMDS_ElementFactory::GetMaxID() //================================================================================ /*! * \brief Return minimal ID of an used element - * \return int - element ID + * \return smIdType - element ID */ //================================================================================ -int SMDS_ElementFactory::GetMinID() +smIdType SMDS_ElementFactory::GetMinID() { - int id = 0; + smIdType id = 0; TIndexRanges usedRanges; for ( size_t i = 0; i < myChunks.size(); ++i ) if ( myChunks[i].GetUsedRanges().GetIndices( true, usedRanges )) @@ -169,20 +169,20 @@ int SMDS_ElementFactory::GetMinID() */ //================================================================================ -SMDS_MeshElement* SMDS_ElementFactory::NewElement( const int id ) +SMDS_MeshElement* SMDS_ElementFactory::NewElement( const smIdType id ) { - int iChunk = ( id - 1 ) / theChunkSize; - int index = ( id - 1 ) % theChunkSize; - while ((int) myChunks.size() <= iChunk ) + smIdType iChunk = ( id - 1 ) / theChunkSize; + smIdType index = ( id - 1 ) % theChunkSize; + while ((smIdType) myChunks.size() <= iChunk ) { - int id0 = myChunks.size() * theChunkSize + 1; + smIdType id0 = myChunks.size() * theChunkSize + 1; myChunks.push_back( new SMDS_ElementChunk( this, id0 )); } - SMDS_MeshElement* e = myChunks[iChunk].Element( index ); + SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType(index) ); if ( !e->IsNull() ) return 0; // element with given ID already exists - myChunks[iChunk].UseElement( index ); + myChunks[iChunk].UseElement( FromIdType(index) ); ++myNbUsedElements; e->myHolder = & myChunks[iChunk]; @@ -200,15 +200,15 @@ SMDS_MeshElement* SMDS_ElementFactory::NewElement( const int id ) */ //================================================================================ -const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const int id ) const +const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const smIdType id ) const { if ( id > 0 ) { - int iChunk = ( id - 1 ) / theChunkSize; - int index = ( id - 1 ) % theChunkSize; - if ( iChunk < (int) myChunks.size() ) + smIdType iChunk = ( id - 1 ) / theChunkSize; + smIdType index = ( id - 1 ) % theChunkSize; + if ( iChunk < (smIdType) myChunks.size() ) { - const SMDS_MeshElement* e = myChunks[iChunk].Element( index ); + const SMDS_MeshElement* e = myChunks[iChunk].Element( FromIdType(index) ); return e->IsNull() ? 0 : e; } } @@ -219,11 +219,11 @@ const SMDS_MeshElement* SMDS_ElementFactory::FindElement( const int id ) const /*! * \brief Return an SMDS ID by a Vtk one * \param [inout] vtkID - Vtk ID - * \return int - SMDS ID + * \return smIdType - SMDS ID */ //================================================================================ -int SMDS_ElementFactory::FromVtkToSmds( vtkIdType vtkID ) +smIdType SMDS_ElementFactory::FromVtkToSmds( vtkIdType vtkID ) { if ( vtkID >= 0 && vtkID < (vtkIdType)mySmdsIDs.size() ) return mySmdsIDs[vtkID] + 1; @@ -281,11 +281,11 @@ void SMDS_ElementFactory::Clear() */ //================================================================================ -void SMDS_ElementFactory::Compact( std::vector& theVtkIDsNewToOld ) +void SMDS_ElementFactory::Compact( std::vector& theVtkIDsNewToOld ) { - int newNbCells = NbUsedElements(); - int maxCellID = GetMaxID(); - int newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize ); + smIdType newNbCells = NbUsedElements(); + smIdType maxCellID = GetMaxID(); + smIdType newNbChunks = newNbCells / theChunkSize + bool ( newNbCells % theChunkSize ); theVtkIDsNewToOld.resize( newNbCells ); @@ -295,7 +295,7 @@ void SMDS_ElementFactory::Compact( std::vector& theVtkIDsNewToOld ) } else if ( newNbCells == maxCellID ) // no holes { - int newID, minLastID = std::min( myVtkIDs.size(), theVtkIDsNewToOld.size() ); + smIdType newID, minLastID = std::min( myVtkIDs.size(), theVtkIDsNewToOld.size() ); for ( newID = 0; newID < minLastID; ++newID ) theVtkIDsNewToOld[ newID ] = myVtkIDs[ newID ]; for ( ; newID < newNbCells; ++newID ) @@ -303,8 +303,8 @@ void SMDS_ElementFactory::Compact( std::vector& theVtkIDsNewToOld ) } else // there are holes in SMDS IDs { - int newVtkID = 0; // same as new smds ID (-1) - for ( int oldID = 1; oldID <= maxCellID; ++oldID ) // smds IDs + smIdType newVtkID = 0; // same as new smds ID (-1) + for ( smIdType oldID = 1; oldID <= maxCellID; ++oldID ) // smds IDs { const SMDS_MeshElement* oldElem = FindElement( oldID ); if ( !oldElem ) continue; @@ -377,16 +377,16 @@ SMDS_NodeFactory::~SMDS_NodeFactory() */ //================================================================================ -void SMDS_NodeFactory::Compact( std::vector& theVtkIDsOldToNew ) +void SMDS_NodeFactory::Compact( std::vector& theVtkIDsOldToNew ) { // IDs of VTK nodes always correspond to SMDS IDs but there can be "holes" // in the chunks. So we remove holes and report relocation in theVtkIDsOldToNew: // theVtkIDsOldToNew[ old VtkID ] = new VtkID - int oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints(); - int newNbNodes = NbUsedElements(); - int newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize ); - int maxNodeID = GetMaxID(); + smIdType oldNbNodes = myMesh->GetGrid()->GetNumberOfPoints(); + smIdType newNbNodes = NbUsedElements(); + smIdType newNbChunks = newNbNodes / theChunkSize + bool ( newNbNodes % theChunkSize ); + smIdType maxNodeID = GetMaxID(); theVtkIDsOldToNew.resize( oldNbNodes, -1 ); @@ -408,13 +408,13 @@ void SMDS_NodeFactory::Compact( std::vector& theVtkIDsOldToNew ) const SMDS_MeshElement* newNode = FindElement( newID+1 ); if ( !newNode ) newNode = NewElement( newID+1 ); - int shapeID = oldNode->GetShapeID(); - int shapeDim = GetShapeDim( shapeID ); - int iChunk = newID / theChunkSize; + int shapeID = oldNode->GetShapeID(); + int shapeDim = GetShapeDim( shapeID ); + smIdType iChunk = newID / theChunkSize; myChunks[ iChunk ].SetShapeID( newNode, shapeID ); if ( shapeDim == 2 || shapeDim == 1 ) { - int iChunkOld = oldID / theChunkSize; + smIdType iChunkOld = oldID / theChunkSize; TParam* oldPos = myChunks[ iChunkOld ].GetPositionPtr( oldNode ); TParam* newPos = myChunks[ iChunk ].GetPositionPtr( newNode, /*allocate=*/true ); if ( oldPos ) @@ -431,7 +431,7 @@ void SMDS_NodeFactory::Compact( std::vector& theVtkIDsOldToNew ) } else // no holes { - for ( int i = 0; i < newNbNodes; ++i ) + for ( smIdType i = 0; i < newNbNodes; ++i ) theVtkIDsOldToNew[ i ] = i; } myChunks.resize( newNbChunks ); @@ -514,7 +514,7 @@ void SMDS_NodeFactory::SetShapeDim( int shapeID, int dim ) */ //================================================================================ -SMDS_ElementChunk::SMDS_ElementChunk( SMDS_ElementFactory* factory, int id0 ): +SMDS_ElementChunk::SMDS_ElementChunk( SMDS_ElementFactory* factory, smIdType id0 ): myFactory( factory ), my1stID( id0 )//, //mySubIDSet( 0 ) @@ -565,7 +565,7 @@ void SMDS_ElementChunk::UseElement( const int index ) */ //================================================================================ -int SMDS_ElementChunk::GetUnusedID() const +smIdType SMDS_ElementChunk::GetUnusedID() const { TUsedRangeSet::set_iterator r = myUsedRanges.mySet.begin(); for ( ; r != myUsedRanges.mySet.end(); ++r ) @@ -603,7 +603,7 @@ void SMDS_ElementChunk::Free( const SMDS_MeshElement* e ) */ //================================================================================ -int SMDS_ElementChunk::GetID( const SMDS_MeshElement* e ) const +smIdType SMDS_ElementChunk::GetID( const SMDS_MeshElement* e ) const { return my1stID + Index( e ); } @@ -618,11 +618,12 @@ void SMDS_ElementChunk::SetVTKID( const SMDS_MeshElement* e, const vtkIdType vtk { if ( e->GetID() - 1 != vtkID ) { - if ((int) myFactory->myVtkIDs.size() <= e->GetID() - 1 ) + if ((smIdType) myFactory->myVtkIDs.size() <= e->GetID() - 1 ) { - size_t i = myFactory->myVtkIDs.size(); + vtkIdType i = (vtkIdType) myFactory->myVtkIDs.size(); myFactory->myVtkIDs.resize( e->GetID() + 100 ); - for ( ; i < myFactory->myVtkIDs.size(); ++i ) + vtkIdType newSize = (vtkIdType) myFactory->myVtkIDs.size(); + for ( ; i < newSize; ++i ) myFactory->myVtkIDs[i] = i; } myFactory->myVtkIDs[ e->GetID() - 1 ] = vtkID; @@ -644,10 +645,10 @@ void SMDS_ElementChunk::SetVTKID( const SMDS_MeshElement* e, const vtkIdType vtk */ //================================================================================ -int SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const +vtkIdType SMDS_ElementChunk::GetVtkID( const SMDS_MeshElement* e ) const { - size_t dfltVtkID = e->GetID() - 1; - return ( dfltVtkID < myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID; + vtkIdType dfltVtkID = FromIdType(e->GetID() - 1); + return ( dfltVtkID < (vtkIdType)myFactory->myVtkIDs.size() ) ? myFactory->myVtkIDs[ dfltVtkID ] : dfltVtkID; } //================================================================================ diff --git a/src/SMDS/SMDS_ElementFactory.hxx b/src/SMDS/SMDS_ElementFactory.hxx index 86d7408ce..165c0af89 100644 --- a/src/SMDS/SMDS_ElementFactory.hxx +++ b/src/SMDS/SMDS_ElementFactory.hxx @@ -40,6 +40,8 @@ #include +#include + class SMDS_ElementChunk; class SMDS_Mesh; class SMDS_MeshCell; @@ -67,8 +69,8 @@ protected: TChunkVector myChunks; // array of chunks of elements TChunkPtrSet myChunksWithUnused; // sorted chunks having unused elements std::vector< vtkIdType > myVtkIDs; // myVtkIDs[ smdsID-1 ] == vtkID - std::vector< int > mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1 - int myNbUsedElements; // counter of elements + std::vector< smIdType > mySmdsIDs; // mySmdsIDs[ vtkID ] == smdsID - 1 + smIdType myNbUsedElements; // counter of elements friend class SMDS_ElementChunk; @@ -78,25 +80,25 @@ public: virtual ~SMDS_ElementFactory(); //! Return minimal ID of a non-used element - int GetFreeID(); + smIdType GetFreeID(); //! Return maximal ID of an used element - int GetMaxID(); + smIdType GetMaxID(); //! Return minimal ID of an used element - int GetMinID(); + smIdType GetMinID(); //! Return an element by ID. NULL if the element with the given ID is already used - SMDS_MeshElement* NewElement( const int id ); + SMDS_MeshElement* NewElement( const smIdType id ); //! Return a SMDS_MeshCell by ID. NULL if the cell with the given ID is already used - SMDS_MeshCell* NewCell( const int id ) { return static_cast( NewElement( id )); } + SMDS_MeshCell* NewCell( const smIdType id ) { return static_cast( NewElement( id )); } //! Return an used element by ID. NULL if the element with the given ID is not yet used - const SMDS_MeshElement* FindElement( const int id ) const; + const SMDS_MeshElement* FindElement( const smIdType id ) const; //! Return a number of used elements - int NbUsedElements() const { return myNbUsedElements; } + smIdType NbUsedElements() const { return myNbUsedElements; } //! Return an iterator on all element filtered using a given filter. // nbElemsToReturn is used to optimize by stopping the iteration as soon as @@ -119,14 +121,14 @@ public: void Free( const SMDS_MeshElement* ); //! Return an SMDS ID by a Vtk one - int FromVtkToSmds( vtkIdType vtkID ); + smIdType FromVtkToSmds( vtkIdType vtkID ); //! De-allocate all elements virtual void Clear(); //! Remove unused elements located not at the end of the last chunk. // Minimize allocated memory - virtual void Compact(std::vector& idCellsOldToNew); + virtual void Compact(std::vector& idCellsOldToNew); //! Return true if Compact() will change IDs of elements virtual bool CompactChangePointers(); @@ -149,10 +151,10 @@ public: ~SMDS_NodeFactory(); //! Return a SMDS_MeshNode by ID. NULL if the node with the given ID is already used - SMDS_MeshNode* NewNode( int id ) { return (SMDS_MeshNode*) NewElement(id); } + SMDS_MeshNode* NewNode( smIdType id ) { return (SMDS_MeshNode*) NewElement(id); } //! Return an used node by ID. NULL if the node with the given ID is not yet used - const SMDS_MeshNode* FindNode( int id ) { return (const SMDS_MeshNode*) FindElement(id); } + const SMDS_MeshNode* FindNode( smIdType id ) { return (const SMDS_MeshNode*) FindElement(id); } //! Set a total number of sub-shapes in the main shape void SetNbShapes( size_t nbShapes ); @@ -168,7 +170,7 @@ public: //! Remove unused nodes located not at the end of the last chunk. // Minimize allocated memory - virtual void Compact(std::vector& idNodesOldToNew); + virtual void Compact(std::vector& idNodesOldToNew); //! Return true if Compact() will change IDs of node virtual bool CompactChangePointers(); @@ -277,7 +279,7 @@ struct _RangeSet rNext = mySet.upper_bound( theIndex ); r = rNext - 1; } - int rSize = Size( r ); // range size + int rSize = Size( r ); // range size attr_t rValue = r->myValue; if ( rValue == theValue ) return rValue; // it happens while compacting @@ -370,7 +372,7 @@ class SMDS_ElementChunk { SMDS_ElementFactory* myFactory; // holder of this chunk SMDS_MeshElement* myElements; // array of elements - int my1stID; // ID of myElements[0] + smIdType my1stID; // ID of myElements[0] TBitSet myMarkedSet; // mark some elements TUsedRangeSet myUsedRanges; // ranges of used/unused elements TSubIDRangeSet mySubIDRanges; // ranges of elements on the same sub-shape @@ -381,7 +383,7 @@ class SMDS_ElementChunk public: - SMDS_ElementChunk( SMDS_ElementFactory* factory = 0, int id0 = 0 ); + SMDS_ElementChunk( SMDS_ElementFactory* factory = 0, smIdType id0 = 0 ); ~SMDS_ElementChunk(); //! Return an element by an index [0,ChunkSize()] @@ -391,7 +393,7 @@ public: const SMDS_MeshElement* Element(int index) const { return & myElements[index]; } //! Return ID of the first non-used element - int GetUnusedID() const; + smIdType GetUnusedID() const; //! Mark an element as used void UseElement( const int index ); @@ -403,10 +405,10 @@ public: static bool IsUsed( const _UsedRange& r ) { return r.myValue; } //! Return index of an element in the chunk - int Index( const SMDS_MeshElement* e ) const { return e - myElements; } + int Index( const SMDS_MeshElement* e ) const { return (int)( e - myElements ); } //! Return ID of the 1st element in the chunk - int Get1stID() const { return my1stID; } + smIdType Get1stID() const { return my1stID; } //! Return pointer to on-shape-parameters of a node TParam* GetPositionPtr( const SMDS_MeshElement* node, bool allocate=false ); @@ -429,9 +431,9 @@ public: // Methods called by SMDS_MeshElement - int GetID( const SMDS_MeshElement* e ) const; + smIdType GetID( const SMDS_MeshElement* e ) const; - int GetVtkID( const SMDS_MeshElement* e ) const; + vtkIdType GetVtkID( const SMDS_MeshElement* e ) const; void SetVTKID( const SMDS_MeshElement* e, const vtkIdType id ); int GetShapeID( const SMDS_MeshElement* e ) const; @@ -563,7 +565,7 @@ SMDS_ElementFactory::GetShapeIterator( int shapeID, size_t nbElemsToReturn, const SMDS_MeshElement* sm1stElem ) { - int iChunk = sm1stElem ? (( sm1stElem->GetID() - 1 ) / ChunkSize()) : 0; + smIdType iChunk = sm1stElem ? (( sm1stElem->GetID() - 1 ) / ChunkSize()) : 0; typedef _ChunkIterator< ElemIterator, TSubIDRangeSet > TChuckIterator; return boost::make_shared< TChuckIterator >( myChunks, & SMDS_ElementChunk::GetSubIDRangesMinMax, diff --git a/src/SMDS/SMDS_ElementHolder.cxx b/src/SMDS/SMDS_ElementHolder.cxx index 50486ee78..1f06ff5aa 100644 --- a/src/SMDS/SMDS_ElementHolder.cxx +++ b/src/SMDS/SMDS_ElementHolder.cxx @@ -59,8 +59,7 @@ SMDS_ElementHolder::~SMDS_ElementHolder() void SMDS_ElementHolder::beforeCompacting() { - int i = 0; - for ( SMDS_ElemIteratorPtr it = getElements(); it->more(); ++i ) + for ( SMDS_ElemIteratorPtr it = getElements(); it->more(); ) { const SMDS_MeshElement* e = it->next(); if ( !e ) continue; @@ -84,8 +83,8 @@ void SMDS_ElementHolder::beforeCompacting() //purpose : restore pointers to elements //======================================================================= -void SMDS_ElementHolder::restoreElements( const std::vector& idNodesOldToNew, - const std::vector& idCellsOldToNew ) +void SMDS_ElementHolder::restoreElements( const std::vector& idNodesOldToNew, + const std::vector& idCellsOldToNew ) { tmpClear(); @@ -94,21 +93,21 @@ void SMDS_ElementHolder::restoreElements( const std::vector& idNodesOldToNe std::vector< bool >::iterator isNode = myIsNode.begin(); for ( size_t i = 0; i < myVtkIDs.size(); ++i, ++isNode ) { - int vtkID = myVtkIDs[i]; + vtkIdType vtkID = myVtkIDs[i]; if ( vtkID < 0 ) { elem = myExternalElems[ (-vtkID)-1 ]; } else if ( *isNode ) { - if ( vtkID < (int)idNodesOldToNew.size() ) + if ( vtkID < (vtkIdType)idNodesOldToNew.size() ) elem = myMesh->FindNodeVtk( idNodesOldToNew[ vtkID ]); else elem = myMesh->FindNodeVtk( vtkID ); } else { - if ( vtkID < (int)idCellsOldToNew.size() ) + if ( vtkID < (vtkIdType)idCellsOldToNew.size() ) elem = myMesh->FindElementVtk( idCellsOldToNew[ vtkID ]); else elem = myMesh->FindElementVtk( vtkID ); diff --git a/src/SMDS/SMDS_ElementHolder.hxx b/src/SMDS/SMDS_ElementHolder.hxx index d644b2f2d..3dcd030c3 100644 --- a/src/SMDS/SMDS_ElementHolder.hxx +++ b/src/SMDS/SMDS_ElementHolder.hxx @@ -29,6 +29,9 @@ #include "SMDS_ElemIterator.hxx" +#include +#include + #include #include @@ -80,12 +83,12 @@ class SMDS_EXPORT SMDS_ElementHolder void beforeCompacting(); //! restore pointers to elements - void restoreElements( const std::vector& idNodessOldToNew, - const std::vector& idCellsOldToNew ); + void restoreElements( const std::vector& idNodessOldToNew, + const std::vector& idCellsOldToNew ); std::vector myExternalElems; //!< elements not contained in the mesh - std::vector< int > myVtkIDs; //!< vtk IDs of elements + std::vector< vtkIdType > myVtkIDs; //!< vtk IDs of elements std::vector< bool > myIsNode; std::set< SMDS_ElementHolder* >::iterator myPtrInMesh; }; diff --git a/src/SMDS/SMDS_Mesh.cxx b/src/SMDS/SMDS_Mesh.cxx index f2aee846a..10f3e1f57 100644 --- a/src/SMDS/SMDS_Mesh.cxx +++ b/src/SMDS/SMDS_Mesh.cxx @@ -183,7 +183,7 @@ SMDS_MeshNode * SMDS_Mesh::AddNode(double x, double y, double z) ///@param ID : The ID of the MeshNode to create ///@return : The created node or NULL if a node with this ID already exists /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshNode * SMDS_Mesh::AddNodeWithID( double x, double y, double z, int ID ) +SMDS_MeshNode * SMDS_Mesh::AddNodeWithID( double x, double y, double z, smIdType ID ) { // find the MeshNode corresponding to ID SMDS_MeshNode *node = myNodeFactory->NewNode( ID ); @@ -201,7 +201,7 @@ SMDS_MeshNode * SMDS_Mesh::AddNodeWithID( double x, double y, double z, int ID ) /// create a Mesh0DElement and add it to the current Mesh /// @return : The created Mesh0DElement /////////////////////////////////////////////////////////////////////////////// -SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(int idnode, int ID) +SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(smIdType idnode, smIdType ID) { const SMDS_MeshNode * node = myNodeFactory->FindNode(idnode); if (!node) return NULL; @@ -224,7 +224,7 @@ SMDS_Mesh0DElement* SMDS_Mesh::Add0DElement(const SMDS_MeshNode * node) /// @return The created 0D element or NULL if an element with this /// ID already exists or if input node is not found. /////////////////////////////////////////////////////////////////////////////// -SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(const SMDS_MeshNode * n, int ID) +SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(const SMDS_MeshNode * n, smIdType ID) { if (!n) return 0; @@ -244,7 +244,7 @@ SMDS_Mesh0DElement* SMDS_Mesh::Add0DElementWithID(const SMDS_MeshNode * n, int I /// create a Ball and add it to the current Mesh /// @return : The created Ball /////////////////////////////////////////////////////////////////////////////// -SMDS_BallElement* SMDS_Mesh::AddBallWithID( int idnode, double diameter, int ID ) +SMDS_BallElement* SMDS_Mesh::AddBallWithID( smIdType idnode, double diameter, smIdType ID ) { const SMDS_MeshNode * node = myNodeFactory->FindNode( idnode ); if (!node) return NULL; @@ -268,7 +268,7 @@ SMDS_BallElement* SMDS_Mesh::AddBall(const SMDS_MeshNode * node, double diameter /// @return The created 0D element or NULL if an element with this /// ID already exists or if input node is not found. /////////////////////////////////////////////////////////////////////////////// -SMDS_BallElement* SMDS_Mesh::AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID) +SMDS_BallElement* SMDS_Mesh::AddBallWithID(const SMDS_MeshNode * n, double diameter, smIdType ID) { if (!n) return 0; @@ -288,7 +288,7 @@ SMDS_BallElement* SMDS_Mesh::AddBallWithID(const SMDS_MeshNode * n, double diame /// @return : The created MeshEdge /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(int idnode1, int idnode2, int ID) +SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(smIdType idnode1, smIdType idnode2, smIdType ID) { const SMDS_MeshNode * node1 = myNodeFactory->FindNode(idnode1); const SMDS_MeshNode * node2 = myNodeFactory->FindNode(idnode2); @@ -318,7 +318,7 @@ SMDS_MeshEdge* SMDS_Mesh::AddEdge(const SMDS_MeshNode * node1, SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, - int ID) + smIdType ID) { if ( !n1 || !n2 ) return 0; @@ -347,7 +347,10 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, /// Add a triangle defined by its nodes IDs /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int idnode1, int idnode2, int idnode3, int ID) +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType idnode1, + smIdType idnode2, + smIdType idnode3, + smIdType ID) { const SMDS_MeshNode * node1 = myNodeFactory->FindNode(idnode1); const SMDS_MeshNode * node2 = myNodeFactory->FindNode(idnode2); @@ -363,7 +366,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int idnode1, int idnode2, int idnode3, i SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 ) return 0; if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -394,11 +397,11 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, /// Add a quadrangle defined by its nodes IDs /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int idnode1, - int idnode2, - int idnode3, - int idnode4, - int ID) +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType idnode1, + smIdType idnode2, + smIdType idnode3, + smIdType idnode4, + smIdType ID) { const SMDS_MeshNode *node1, *node2, *node3, *node4; node1 = myNodeFactory->FindNode(idnode1); @@ -417,7 +420,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n4 ) return 0; if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -451,11 +454,11 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, ///or if input nodes are not found. /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, - int idnode2, - int idnode3, - int idnode4, - int ID) +SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1, + smIdType idnode2, + smIdType idnode3, + smIdType idnode4, + smIdType ID) { const SMDS_MeshNode *node1, *node2, *node3, *node4; node1 = myNodeFactory->FindNode(idnode1); @@ -476,7 +479,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n4 ) return 0; if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -513,12 +516,12 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, ///or if input nodes are not found. /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, - int idnode2, - int idnode3, - int idnode4, - int idnode5, - int ID) +SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1, + smIdType idnode2, + smIdType idnode3, + smIdType idnode4, + smIdType idnode5, + smIdType ID) { const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5; node1 = myNodeFactory->FindNode(idnode1); @@ -542,7 +545,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n4 || !n5 ) return 0; if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -569,7 +572,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n5, const SMDS_MeshNode * n6) { - int ID = myCellFactory->GetFreeID(); + smIdType ID = myCellFactory->GetFreeID(); return SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID); } @@ -581,13 +584,13 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, ///or if input nodes are not found. /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, - int idnode2, - int idnode3, - int idnode4, - int idnode5, - int idnode6, - int ID) +SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1, + smIdType idnode2, + smIdType idnode3, + smIdType idnode4, + smIdType idnode5, + smIdType idnode6, + smIdType ID) { const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6; node1 = myNodeFactory->FindNode(idnode1); @@ -612,7 +615,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5, const SMDS_MeshNode * n6, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 ) return 0; if ( NbVolumes() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -656,19 +659,19 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, ///or if input nodes are not found. /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, - int idnode2, - int idnode3, - int idnode4, - int idnode5, - int idnode6, - int idnode7, - int idnode8, - int idnode9, - int idnode10, - int idnode11, - int idnode12, - int ID) +SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1, + smIdType idnode2, + smIdType idnode3, + smIdType idnode4, + smIdType idnode5, + smIdType idnode6, + smIdType idnode7, + smIdType idnode8, + smIdType idnode9, + smIdType idnode10, + smIdType idnode11, + smIdType idnode12, + smIdType ID) { const SMDS_MeshNode *node1 = myNodeFactory->FindNode(idnode1); const SMDS_MeshNode *node2 = myNodeFactory->FindNode(idnode2); @@ -705,7 +708,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n10, const SMDS_MeshNode * n11, const SMDS_MeshNode * n12, - int ID) + smIdType ID) { SMDS_MeshVolume* volume = 0; if(!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || @@ -738,7 +741,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n7, const SMDS_MeshNode * n8) { - int ID = myCellFactory->GetFreeID(); + smIdType ID = myCellFactory->GetFreeID(); return SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, ID); } @@ -750,15 +753,15 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, ///exists or if input nodes are not found. /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(int idnode1, - int idnode2, - int idnode3, - int idnode4, - int idnode5, - int idnode6, - int idnode7, - int idnode8, - int ID) +SMDS_MeshVolume * SMDS_Mesh::AddVolumeWithID(smIdType idnode1, + smIdType idnode2, + smIdType idnode3, + smIdType idnode4, + smIdType idnode5, + smIdType idnode6, + smIdType idnode7, + smIdType idnode8, + smIdType ID) { const SMDS_MeshNode *node1, *node2, *node3, *node4, *node5, *node6, *node7, *node8; node1 = myNodeFactory->FindNode(idnode1); @@ -789,7 +792,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n6, const SMDS_MeshNode * n7, const SMDS_MeshNode * n8, - int ID) + smIdType ID) { SMDS_MeshVolume* volume = 0; if ( !n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8) return volume; @@ -809,12 +812,12 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, /// Add a polygon defined by its nodes IDs /////////////////////////////////////////////////////////////////////////////// -SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector & nodes_ids, - const int ID) +SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector & nodes_ids, + const smIdType ID) { - int nbNodes = nodes_ids.size(); + size_t nbNodes = nodes_ids.size(); std::vector nodes (nbNodes); - for (int i = 0; i < nbNodes; i++) { + for ( size_t i = 0; i < nbNodes; i++) { nodes[i] = myNodeFactory->FindNode( nodes_ids[i] ); if (!nodes[i]) return NULL; } @@ -827,7 +830,7 @@ SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector & nodes SMDS_MeshFace* SMDS_Mesh::AddPolygonalFaceWithID (const std::vector & nodes, - const int ID) + const smIdType ID) { if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -856,8 +859,8 @@ SMDS_MeshFace* SMDS_Mesh::AddPolygonalFace (const std::vector & nodes_ids, - const int ID) +SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector & nodes_ids, + const smIdType ID) { std::vector nodes( nodes_ids.size() ); for ( size_t i = 0; i < nodes.size(); i++) { @@ -873,7 +876,7 @@ SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector & n SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector & nodes, - const int ID) + const smIdType ID) { if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); if ( nodes.empty() ) @@ -904,13 +907,13 @@ SMDS_MeshFace* SMDS_Mesh::AddQuadPolygonalFace (const std::vector & nodes_ids, - const std::vector & quantities, - const int ID) +SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector & nodes_ids, + const std::vector & quantities, + const smIdType ID) { - int nbNodes = nodes_ids.size(); + size_t nbNodes = nodes_ids.size(); std::vector nodes (nbNodes); - for (int i = 0; i < nbNodes; i++) { + for ( size_t i = 0; i < nbNodes; i++) { nodes[i] = myNodeFactory->FindNode(nodes_ids[i]); if (!nodes[i]) return NULL; } @@ -926,7 +929,7 @@ SMDS_MeshVolume * SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector & SMDS_MeshVolume* SMDS_Mesh::AddPolyhedralVolumeWithID (const std::vector& nodes, const std::vector & quantities, - const int ID) + const smIdType ID) { if ( nodes.empty() || quantities.empty() ) return NULL; @@ -951,7 +954,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddPolyhedralVolume (const std::vector & nodes, const std::vector & quantities) { - int ID = myCellFactory->GetFreeID(); + smIdType ID = myCellFactory->GetFreeID(); return SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID); } @@ -987,7 +990,7 @@ void SMDS_Mesh::MoveNode(const SMDS_MeshNode *n, double x, double y, double z) /////////////////////////////////////////////////////////////////////////////// /// Return the node whose SMDS ID is 'ID'. /////////////////////////////////////////////////////////////////////////////// -const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const +const SMDS_MeshNode * SMDS_Mesh::FindNode(smIdType ID) const { return myNodeFactory->FindNode( ID ); } @@ -995,12 +998,12 @@ const SMDS_MeshNode * SMDS_Mesh::FindNode(int ID) const /////////////////////////////////////////////////////////////////////////////// /// Return the node whose VTK ID is 'vtkId'. /////////////////////////////////////////////////////////////////////////////// -const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(int vtkId) const +const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(vtkIdType vtkId) const { return myNodeFactory->FindNode( vtkId + 1 ); } -const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(int IDelem) const +const SMDS_MeshElement * SMDS_Mesh::FindElementVtk(vtkIdType IDelem) const { return myCellFactory->FindElement( FromVtkToSmds( IDelem )); } @@ -1356,7 +1359,7 @@ const SMDS_MeshFace* SMDS_Mesh::FindFace(const SMDS_MeshNode *node1, //purpose : //======================================================================= -const SMDS_MeshElement* SMDS_Mesh::FindElement(int IDelem) const +const SMDS_MeshElement* SMDS_Mesh::FindElement(smIdType IDelem) const { return myCellFactory->FindElement( IDelem ); } @@ -1456,7 +1459,7 @@ int SMDS_Mesh::GetElementsByNodes(const std::vector& node /////////////////////////////////////////////////////////////////////////////// /// Return the number of nodes /////////////////////////////////////////////////////////////////////////////// -int SMDS_Mesh::NbNodes() const +smIdType SMDS_Mesh::NbNodes() const { return myInfo.NbNodes(); } @@ -1464,14 +1467,14 @@ int SMDS_Mesh::NbNodes() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of elements /////////////////////////////////////////////////////////////////////////////// -int SMDS_Mesh::NbElements() const +smIdType SMDS_Mesh::NbElements() const { return myInfo.NbElements(); } /////////////////////////////////////////////////////////////////////////////// /// Return the number of 0D elements /////////////////////////////////////////////////////////////////////////////// -int SMDS_Mesh::Nb0DElements() const +smIdType SMDS_Mesh::Nb0DElements() const { return myInfo.Nb0DElements(); } @@ -1479,7 +1482,7 @@ int SMDS_Mesh::Nb0DElements() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of 0D elements /////////////////////////////////////////////////////////////////////////////// -int SMDS_Mesh::NbBalls() const +smIdType SMDS_Mesh::NbBalls() const { return myInfo.NbBalls(); } @@ -1487,7 +1490,7 @@ int SMDS_Mesh::NbBalls() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of edges (including construction edges) /////////////////////////////////////////////////////////////////////////////// -int SMDS_Mesh::NbEdges() const +smIdType SMDS_Mesh::NbEdges() const { return myInfo.NbEdges(); } @@ -1495,7 +1498,7 @@ int SMDS_Mesh::NbEdges() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of faces (including construction faces) /////////////////////////////////////////////////////////////////////////////// -int SMDS_Mesh::NbFaces() const +smIdType SMDS_Mesh::NbFaces() const { return myInfo.NbFaces(); } @@ -1503,7 +1506,7 @@ int SMDS_Mesh::NbFaces() const /////////////////////////////////////////////////////////////////////////////// /// Return the number of volumes /////////////////////////////////////////////////////////////////////////////// -int SMDS_Mesh::NbVolumes() const +smIdType SMDS_Mesh::NbVolumes() const { return myInfo.NbVolumes(); } @@ -1512,7 +1515,7 @@ int SMDS_Mesh::NbVolumes() const /// Return the number of child mesh of this mesh. /// Note that the tree structure of SMDS_Mesh is unused in SMESH /////////////////////////////////////////////////////////////////////////////// -int SMDS_Mesh::NbSubMesh() const +smIdType SMDS_Mesh::NbSubMesh() const { return myChildren.size(); } @@ -1586,7 +1589,7 @@ SMDS_NodeIteratorPtr SMDS_Mesh::nodesIterator() const SMDS_ElemIteratorPtr SMDS_Mesh::elementGeomIterator(SMDSAbs_GeometryType type) const { - int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); + smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); return myCellFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::GeomFilter( type ), nbElems); } @@ -1597,7 +1600,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementEntityIterator(SMDSAbs_EntityType type) c { return myNodeFactory->GetIterator< SMDS_ElemIterator >( new SMDS_MeshElement::NonNullFilter ); } - int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); + smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); return myCellFactory->GetIterator( new SMDS_MeshElement::EntityFilter( type ), nbElems); } @@ -1617,7 +1620,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const return myNodeFactory->GetIterator< TIterator >( new SMDS_MeshElement::NonNullFilter ); default: - int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); + smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbElements( type ); return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( type ), nbElems); } @@ -1631,7 +1634,7 @@ SMDS_ElemIteratorPtr SMDS_Mesh::elementsIterator(SMDSAbs_ElementType type) const SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const { typedef SMDS_EdgeIterator TIterator; - int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges(); + smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbEdges(); return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Edge ), nbElems); } @@ -1643,7 +1646,7 @@ SMDS_EdgeIteratorPtr SMDS_Mesh::edgesIterator() const SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const { typedef SMDS_FaceIterator TIterator; - int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces(); + smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbFaces(); return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Face ), nbElems); } @@ -1655,7 +1658,7 @@ SMDS_FaceIteratorPtr SMDS_Mesh::facesIterator() const SMDS_VolumeIteratorPtr SMDS_Mesh::volumesIterator() const { typedef SMDS_VolumeIterator TIterator; - int nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes(); + smIdType nbElems = myCellFactory->CompactChangePointers() ? -1 : myInfo.NbVolumes(); return myCellFactory->GetIterator< TIterator >( new SMDS_MeshElement::TypeFilter( SMDSAbs_Volume ), nbElems ); @@ -1871,7 +1874,7 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, n->RemoveInverseElement((*it)); } - int vtkid = (*it)->GetVtkID(); + vtkIdType vtkid = (*it)->GetVtkID(); switch ((*it)->GetType()) { case SMDSAbs_Node: @@ -1916,7 +1919,7 @@ void SMDS_Mesh::RemoveElement(const SMDS_MeshElement * elem, /////////////////////////////////////////////////////////////////////////////// void SMDS_Mesh::RemoveFreeElement(const SMDS_MeshElement * elem) { - const int vtkId = elem->GetVtkID(); + const vtkIdType vtkId = elem->GetVtkID(); SMDSAbs_ElementType aType = elem->GetType(); if ( aType == SMDSAbs_Node ) { @@ -1977,7 +1980,7 @@ bool SMDS_Mesh::Contains (const SMDS_MeshElement* elem) const //purpose : //======================================================================= -int SMDS_Mesh::MaxNodeID() const +smIdType SMDS_Mesh::MaxNodeID() const { return myNodeFactory->GetMaxID(); } @@ -1987,7 +1990,7 @@ int SMDS_Mesh::MaxNodeID() const //purpose : //======================================================================= -int SMDS_Mesh::MinNodeID() const +smIdType SMDS_Mesh::MinNodeID() const { return myNodeFactory->GetMinID(); } @@ -1997,7 +2000,7 @@ int SMDS_Mesh::MinNodeID() const //purpose : //======================================================================= -int SMDS_Mesh::MaxElementID() const +smIdType SMDS_Mesh::MaxElementID() const { return myCellFactory->GetMaxID(); } @@ -2007,7 +2010,7 @@ int SMDS_Mesh::MaxElementID() const //purpose : //======================================================================= -int SMDS_Mesh::MinElementID() const +smIdType SMDS_Mesh::MinElementID() const { return myCellFactory->GetMinID(); } @@ -2029,7 +2032,7 @@ int SMDS_Mesh::MinElementID() const //purpose : Return type of element or node with id //======================================================================= -SMDSAbs_ElementType SMDS_Mesh::GetElementType( const int id, const bool iselem ) const +SMDSAbs_ElementType SMDS_Mesh::GetElementType( const smIdType id, const bool iselem ) const { const SMDS_MeshElement* elem = 0; if( iselem ) @@ -2054,7 +2057,7 @@ SMDSAbs_ElementType SMDS_Mesh::GetElementType( const int id, const bool iselem ) //function : AddEdgeWithID //purpose : //======================================================================= -SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(int n1, int n2, int n12, int ID) +SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(smIdType n1, smIdType n2, smIdType n12, smIdType ID) { return SMDS_Mesh::AddEdgeWithID (myNodeFactory->FindNode(n1), myNodeFactory->FindNode(n2), @@ -2080,7 +2083,7 @@ SMDS_MeshEdge* SMDS_Mesh::AddEdge(const SMDS_MeshNode* n1, SMDS_MeshEdge* SMDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n12, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n12 ) return 0; @@ -2113,8 +2116,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function : AddFaceWithID //purpose : //======================================================================= -SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, - int n12,int n23,int n31, int ID) +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n12,smIdType n23,smIdType n31, smIdType ID) { return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) , myNodeFactory->FindNode(n2) , @@ -2135,7 +2138,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n12, const SMDS_MeshNode * n23, const SMDS_MeshNode * n31, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31 ) return 0; if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -2170,8 +2173,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function : AddFaceWithID //purpose : //======================================================================= -SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, - int n12,int n23,int n31, int nCenter, int ID) +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID) { return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) , myNodeFactory->FindNode(n2) , @@ -2194,7 +2197,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n23, const SMDS_MeshNode * n31, const SMDS_MeshNode * nCenter, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n12 || !n23 || !n31 || !nCenter) return 0; if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -2230,8 +2233,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function : AddFaceWithID //purpose : //======================================================================= -SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n34,int n41, int ID) +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID) { return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) , myNodeFactory->FindNode(n2) , @@ -2256,7 +2259,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n23, const SMDS_MeshNode * n34, const SMDS_MeshNode * n41, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41) return 0; if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -2292,8 +2295,8 @@ SMDS_MeshFace* SMDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function : AddFaceWithID //purpose : //======================================================================= -SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n34,int n41, int nCenter, int ID) +SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID) { return SMDS_Mesh::AddFaceWithID (myNodeFactory->FindNode(n1) , myNodeFactory->FindNode(n2) , @@ -2320,7 +2323,7 @@ SMDS_MeshFace* SMDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n34, const SMDS_MeshNode * n41, const SMDS_MeshNode * nCenter, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n34 || !n41 || !nCenter) return 0; if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory(); @@ -2359,9 +2362,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : //======================================================================= -SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n31, - int n14,int n24,int n34, int ID) +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n31, + smIdType n14,smIdType n24,smIdType n34, smIdType ID) { return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) , myNodeFactory->FindNode(n2) , @@ -2390,7 +2393,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n14, const SMDS_MeshNode * n24, const SMDS_MeshNode * n34, - int ID) + smIdType ID) { if ( !n1 || !n2 || !n3 || !n4 || !n12 || !n23 || !n31 || !n14 || !n24 || !n34) return 0; @@ -2433,9 +2436,9 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : //======================================================================= -SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, - int n12,int n23,int n34,int n41, - int n15,int n25,int n35,int n45, int ID) +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n15,smIdType n25,smIdType n35,smIdType n45, smIdType ID) { return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) , myNodeFactory->FindNode(n2) , @@ -2470,7 +2473,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n25, const SMDS_MeshNode * n35, const SMDS_MeshNode * n45, - int ID) + smIdType ID) { if (!n1 || !n2 || !n3 || !n4 || !n5 || !n12 || !n23 || !n34 || !n41 || !n15 || !n25 || !n35 || !n45) @@ -2516,11 +2519,11 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : 2d order Pentahedron (prism) with 15 nodes //======================================================================= -SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, - int n4, int n5, int n6, - int n12,int n23,int n31, - int n45,int n56,int n64, - int n14,int n25,int n36, int ID) +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12,smIdType n23,smIdType n31, + smIdType n45,smIdType n56,smIdType n64, + smIdType n14,smIdType n25,smIdType n36, smIdType ID) { return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) , myNodeFactory->FindNode(n2) , @@ -2559,7 +2562,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n14, const SMDS_MeshNode * n25, const SMDS_MeshNode * n36, - int ID) + smIdType ID) { if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 || !n31 || !n45 || !n56 || !n64 || !n14 || !n25 || !n36) @@ -2608,12 +2611,12 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : 2d order Pentahedron (prism) with 18 nodes //======================================================================= -SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, - int n4, int n5, int n6, - int n12,int n23,int n31, - int n45,int n56,int n64, - int n14,int n25,int n36, - int n1245, int n2356, int n1346, int ID) +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12,smIdType n23,smIdType n31, + smIdType n45,smIdType n56,smIdType n64, + smIdType n14,smIdType n25,smIdType n36, + smIdType n1245, smIdType n2356, smIdType n1346, smIdType ID) { return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1) , myNodeFactory->FindNode(n2) , @@ -2658,7 +2661,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n1245, const SMDS_MeshNode * n2356, const SMDS_MeshNode * n1346, - int ID) + smIdType ID) { //MESSAGE("AddVolumeWithID penta18 "<< ID); if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 || @@ -2711,11 +2714,11 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : //======================================================================= -SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12,int n23,int n34,int n41, - int n56,int n67,int n78,int n85, - int n15,int n26,int n37,int n48, int ID) +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n56,smIdType n67,smIdType n78,smIdType n85, + smIdType n15,smIdType n26,smIdType n37,smIdType n48, smIdType ID) { return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1), myNodeFactory->FindNode(n2), @@ -2764,7 +2767,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n26, const SMDS_MeshNode * n37, const SMDS_MeshNode * n48, - int ID) + smIdType ID) { if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 || !n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48) @@ -2823,13 +2826,13 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : //======================================================================= -SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12,int n23,int n34,int n41, - int n56,int n67,int n78,int n85, - int n15,int n26,int n37,int n48, - int n1234,int n1256,int n2367,int n3478, - int n1458,int n5678,int nCenter, int ID) +SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n56,smIdType n67,smIdType n78,smIdType n85, + smIdType n15,smIdType n26,smIdType n37,smIdType n48, + smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478, + smIdType n1458,smIdType n5678,smIdType nCenter, smIdType ID) { return SMDS_Mesh::AddVolumeWithID (myNodeFactory->FindNode(n1), myNodeFactory->FindNode(n2), @@ -2892,7 +2895,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n1458, const SMDS_MeshNode * n5678, const SMDS_MeshNode * nCenter, - int ID) + smIdType ID) { if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n7 || !n8 || !n12 || !n23 || !n34 || !n41 || !n56 || !n67 || !n78 || !n85 || !n15 || !n26 || !n37 || !n48 || @@ -2931,7 +2934,7 @@ void SMDS_Mesh::dumpGrid(std::string ficdump) } int nbCells = myGrid->GetNumberOfCells(); ficcon << "-------------------------------- cells " << nbCells << endl; - for (int i=0; iGetCell(i)->GetCellType() << " -"; int nbptcell = myGrid->GetCell(i)->GetNumberOfPoints(); @@ -2970,16 +2973,16 @@ void SMDS_Mesh::CompactMesh() for ( ; holder != myElemHolders.end(); ++holder ) (*holder)->beforeCompacting(); } - int oldCellSize = myCellFactory->GetMaxID(); + smIdType oldCellSize = myCellFactory->GetMaxID(); // remove "holes" in SMDS numeration - std::vector idNodesOldToNew, idCellsNewToOld, idCellsOldToNew; + std::vector idNodesOldToNew, idCellsNewToOld, idCellsOldToNew; myNodeFactory->Compact( idNodesOldToNew ); myCellFactory->Compact( idCellsNewToOld ); // make VTK IDs correspond to SMDS IDs - int newNodeSize = myNodeFactory->NbUsedElements(); - int newCellSize = myCellFactory->NbUsedElements(); + smIdType newNodeSize = myNodeFactory->NbUsedElements(); + smIdType newCellSize = myCellFactory->NbUsedElements(); myGrid->compactGrid( idNodesOldToNew, newNodeSize, idCellsNewToOld, newCellSize ); if ( idsChange && !myElemHolders.empty() ) @@ -2988,7 +2991,7 @@ void SMDS_Mesh::CompactMesh() idCellsOldToNew.resize( oldCellSize, oldCellSize ); for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); ++iNew ) { - if ( idCellsNewToOld[ iNew ] >= (int) idCellsOldToNew.size() ) + if ( idCellsNewToOld[ iNew ] >= (smIdType) idCellsOldToNew.size() ) idCellsOldToNew.resize( ( 1 + idCellsNewToOld[ iNew ]) * 1.5, oldCellSize ); idCellsOldToNew[ idCellsNewToOld[ iNew ]] = iNew; } @@ -3004,7 +3007,7 @@ void SMDS_Mesh::CompactMesh() return; } -int SMDS_Mesh::FromVtkToSmds( int vtkid ) const +smIdType SMDS_Mesh::FromVtkToSmds( vtkIdType vtkid ) const { return myCellFactory->FromVtkToSmds( vtkid ); } diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index 7e54f5efe..172153052 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -43,6 +43,7 @@ #include #include #include +#include class SMDS_ElementHolder; class SMDS_ElementFactory; @@ -73,53 +74,53 @@ public: size_t nbElemsToReturn=-1, const SMDS_MeshElement* sm1stElem=0) const; - SMDSAbs_ElementType GetElementType( const int id, const bool iselem ) const; + SMDSAbs_ElementType GetElementType( const smIdType id, const bool iselem ) const; SMDS_Mesh *AddSubMesh(); - virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, int ID); + virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, smIdType ID); virtual SMDS_MeshNode* AddNode (double x, double y, double z); - virtual SMDS_Mesh0DElement* Add0DElementWithID(int n, int ID); - virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * n, int ID); + virtual SMDS_Mesh0DElement* Add0DElementWithID(smIdType n, smIdType ID); + virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * n, smIdType ID); virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * n); - virtual SMDS_BallElement* AddBallWithID(int n, double diameter, int ID); - virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID); + virtual SMDS_BallElement* AddBallWithID(smIdType n, double diameter, smIdType ID); + virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, smIdType ID); virtual SMDS_BallElement* AddBall (const SMDS_MeshNode * n, double diameter); - virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID); + virtual SMDS_MeshEdge* AddEdgeWithID(smIdType n1, smIdType n2, smIdType ID); virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, - int ID); + smIdType ID); virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2); // 2d order edge with 3 nodes: n12 - node between n1 and n2 - virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID); + virtual SMDS_MeshEdge* AddEdgeWithID(smIdType n1, smIdType n2, smIdType n12, smIdType ID); virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n12, - int ID); + smIdType ID); virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n12); - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3); - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -127,15 +128,15 @@ public: // 2d order triangle of 6 nodes - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, - int n12,int n23,int n31, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n12,smIdType n23,smIdType n31, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n12, const SMDS_MeshNode * n23, const SMDS_MeshNode * n31, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -144,8 +145,8 @@ public: const SMDS_MeshNode * n31); // 2d order triangle of 7 nodes - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, - int n12,int n23,int n31, int nCenter, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -153,7 +154,7 @@ public: const SMDS_MeshNode * n23, const SMDS_MeshNode * n31, const SMDS_MeshNode * nCenter, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -163,8 +164,8 @@ public: const SMDS_MeshNode * nCenter); // 2d order quadrangle - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n34,int n41, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -173,7 +174,7 @@ public: const SMDS_MeshNode * n23, const SMDS_MeshNode * n34, const SMDS_MeshNode * n41, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -183,8 +184,8 @@ public: const SMDS_MeshNode * n34, const SMDS_MeshNode * n41); - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n34,int n41, int nCenter, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -194,7 +195,7 @@ public: const SMDS_MeshNode * n34, const SMDS_MeshNode * n41, const SMDS_MeshNode * nCenter, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -205,40 +206,40 @@ public: const SMDS_MeshNode * n41, const SMDS_MeshNode * nCenter); - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4); - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5); - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5, const SMDS_MeshNode * n6, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -246,8 +247,8 @@ public: const SMDS_MeshNode * n5, const SMDS_MeshNode * n6); - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -256,7 +257,7 @@ public: const SMDS_MeshNode * n6, const SMDS_MeshNode * n7, const SMDS_MeshNode * n8, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -268,9 +269,9 @@ public: // hexagonal prism - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, - int n7, int n8, int n9, int n10, int n11, int n12, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, + smIdType n7, smIdType n8, smIdType n9, smIdType n10, smIdType n11, smIdType n12, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -283,7 +284,7 @@ public: const SMDS_MeshNode * n10, const SMDS_MeshNode * n11, const SMDS_MeshNode * n12, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -298,9 +299,9 @@ public: const SMDS_MeshNode * n12); // 2d order tetrahedron of 10 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n31, - int n14,int n24,int n34, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n31, + smIdType n14,smIdType n24,smIdType n34, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -311,7 +312,7 @@ public: const SMDS_MeshNode * n14, const SMDS_MeshNode * n24, const SMDS_MeshNode * n34, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -324,10 +325,10 @@ public: const SMDS_MeshNode * n34); // 2d order pyramid of 13 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, - int n12,int n23,int n34,int n41, - int n15,int n25,int n35,int n45, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n15,smIdType n25,smIdType n35,smIdType n45, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -341,7 +342,7 @@ public: const SMDS_MeshNode * n25, const SMDS_MeshNode * n35, const SMDS_MeshNode * n45, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -357,12 +358,12 @@ public: const SMDS_MeshNode * n45); // 2d order Pentahedron with 15 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, - int n4, int n5, int n6, - int n12,int n23,int n31, - int n45,int n56,int n64, - int n14,int n25,int n36, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12,smIdType n23,smIdType n31, + smIdType n45,smIdType n56,smIdType n64, + smIdType n14,smIdType n25,smIdType n36, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -378,7 +379,7 @@ public: const SMDS_MeshNode * n14, const SMDS_MeshNode * n25, const SMDS_MeshNode * n36, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -396,13 +397,13 @@ public: const SMDS_MeshNode * n36); // 2d order Pentahedron with 18 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, - int n4, int n5, int n6, - int n12,int n23,int n31, - int n45,int n56,int n64, - int n14,int n25,int n36, - int n1245, int n2356, int n1346, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12,smIdType n23,smIdType n31, + smIdType n45,smIdType n56,smIdType n64, + smIdType n14,smIdType n25,smIdType n36, + smIdType n1245, smIdType n2356, smIdType n1346, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -421,7 +422,7 @@ public: const SMDS_MeshNode * n1245, const SMDS_MeshNode * n2356, const SMDS_MeshNode * n1346, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -443,12 +444,12 @@ public: // 2d oreder Hexahedrons with 20 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12,int n23,int n34,int n41, - int n56,int n67,int n78,int n85, - int n15,int n26,int n37,int n48, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n56,smIdType n67,smIdType n78,smIdType n85, + smIdType n15,smIdType n26,smIdType n37,smIdType n48, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -469,7 +470,7 @@ public: const SMDS_MeshNode * n26, const SMDS_MeshNode * n37, const SMDS_MeshNode * n48, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -492,14 +493,14 @@ public: const SMDS_MeshNode * n48); // 2d oreder Hexahedrons with 27 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12,int n23,int n34,int n41, - int n56,int n67,int n78,int n85, - int n15,int n26,int n37,int n48, - int n1234,int n1256,int n2367,int n3478, - int n1458,int n5678,int nCenter, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n56,smIdType n67,smIdType n78,smIdType n85, + smIdType n15,smIdType n26,smIdType n37,smIdType n48, + smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478, + smIdType n1458,smIdType n5678,smIdType nCenter, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -527,7 +528,7 @@ public: const SMDS_MeshNode * n1458, const SMDS_MeshNode * n5678, const SMDS_MeshNode * nCenter, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -556,31 +557,31 @@ public: const SMDS_MeshNode * n5678, const SMDS_MeshNode * nCenter); - virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector & nodes_ids, - const int ID); + virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector & nodes_ids, + const smIdType ID); virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector & nodes, - const int ID); + const smIdType ID); virtual SMDS_MeshFace* AddPolygonalFace (const std::vector & nodes); - virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector & nodes_ids, - const int ID); + virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector & nodes_ids, + const smIdType ID); virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector & nodes, - const int ID); + const smIdType ID); virtual SMDS_MeshFace* AddQuadPolygonalFace(const std::vector & nodes); virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID - (const std::vector & nodes_ids, - const std::vector & quantities, - const int ID); + (const std::vector & nodes_ids, + const std::vector & quantities, + const smIdType ID); virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID (const std::vector & nodes, const std::vector & quantities, - const int ID); + const smIdType ID); virtual SMDS_MeshVolume* AddPolyhedralVolume (const std::vector & nodes, @@ -631,10 +632,10 @@ public: static_cast(e) : 0 ); } - const SMDS_MeshNode *FindNode(int idnode) const; - const SMDS_MeshNode *FindNodeVtk(int idnode) const; - const SMDS_MeshElement *FindElementVtk(int IDelem) const; - virtual const SMDS_MeshElement * FindElement(int IDelem) const; + const SMDS_MeshNode *FindNode(smIdType idnode) const; + const SMDS_MeshNode *FindNodeVtk(vtkIdType idnode) const; + const SMDS_MeshElement *FindElementVtk(vtkIdType IDelem) const; + virtual const SMDS_MeshElement * FindElement(smIdType IDelem) const; static const SMDS_Mesh0DElement* Find0DElement(const SMDS_MeshNode * n); static const SMDS_BallElement* FindBall(const SMDS_MeshNode * n); static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1, @@ -681,26 +682,26 @@ public: */ static int CheckMemory(const bool doNotRaise=false); - virtual int MaxNodeID() const; - virtual int MinNodeID() const; - virtual int MaxElementID() const; - virtual int MinElementID() const; + virtual smIdType MaxNodeID() const; + virtual smIdType MinNodeID() const; + virtual smIdType MaxElementID() const; + virtual smIdType MinElementID() const; const SMDS_MeshInfo& GetMeshInfo() const { return myInfo; } - virtual int NbNodes() const; - virtual int NbElements() const; - virtual int Nb0DElements() const; - virtual int NbBalls() const; - virtual int NbEdges() const; - virtual int NbFaces() const; - virtual int NbVolumes() const; - virtual int NbSubMesh() const; + virtual smIdType NbNodes() const; + virtual smIdType NbElements() const; + virtual smIdType Nb0DElements() const; + virtual smIdType NbBalls() const; + virtual smIdType NbEdges() const; + virtual smIdType NbFaces() const; + virtual smIdType NbVolumes() const; + virtual smIdType NbSubMesh() const; virtual ~SMDS_Mesh(); double getMaxDim(); - int FromVtkToSmds(int vtkid) const; + smIdType FromVtkToSmds(vtkIdType vtkid) const; void dumpGrid(std::string ficdump="dumpGrid"); static int chunkSize; diff --git a/src/SMDS/SMDS_MeshElement.cxx b/src/SMDS/SMDS_MeshElement.cxx index ee03cf25a..1ea5e072c 100644 --- a/src/SMDS/SMDS_MeshElement.cxx +++ b/src/SMDS/SMDS_MeshElement.cxx @@ -105,7 +105,7 @@ int SMDS_MeshElement::GetNodeIndex( const SMDS_MeshNode* node ) const */ //================================================================================ -int SMDS_MeshElement::GetID() const +smIdType SMDS_MeshElement::GetID() const { return myHolder ? myHolder->GetID( this ) : -1; } @@ -138,7 +138,7 @@ int SMDS_MeshElement::GetShapeID() const */ //================================================================================ -int SMDS_MeshElement::GetVtkID() const +vtkIdType SMDS_MeshElement::GetVtkID() const { return myHolder->GetVtkID( this ); } @@ -171,7 +171,7 @@ bool SMDS_MeshElement::isMarked() const */ //================================================================================ -void SMDS_MeshElement::setVtkID( const int vtkID ) +void SMDS_MeshElement::setVtkID( const vtkIdType vtkID ) { myHolder->SetVTKID( this, vtkID ); } diff --git a/src/SMDS/SMDS_MeshElement.hxx b/src/SMDS/SMDS_MeshElement.hxx index d22d34181..8634ec6e8 100644 --- a/src/SMDS/SMDS_MeshElement.hxx +++ b/src/SMDS/SMDS_MeshElement.hxx @@ -38,6 +38,7 @@ #include #include +#include class SMDS_ElementChunk; class SMDS_Mesh; @@ -127,10 +128,10 @@ public: virtual int GetNodeIndex( const SMDS_MeshNode* node ) const; - virtual int GetID() const; - virtual int GetVtkID() const; - virtual int getshapeId() const { return GetShapeID(); } - virtual int GetShapeID() const; + virtual smIdType GetID() const; + virtual vtkIdType GetVtkID() const; + virtual int getshapeId() const { return GetShapeID(); } + virtual int GetShapeID() const; // mark this element; to be used in algos virtual void setIsMarked( bool is ) const; @@ -182,7 +183,7 @@ public: SMDS_MeshElement(); - void setVtkID(const int vtkID ); + void setVtkID(const vtkIdType vtkID ); virtual void setShapeID( const int shapeID ) const; SMDS_UnstructuredGrid* getGrid() const; diff --git a/src/SMDS/SMDS_MeshGroup.hxx b/src/SMDS/SMDS_MeshGroup.hxx index 39807aab3..2c3660939 100644 --- a/src/SMDS/SMDS_MeshGroup.hxx +++ b/src/SMDS/SMDS_MeshGroup.hxx @@ -45,7 +45,7 @@ class SMDS_EXPORT SMDS_MeshGroup: public SMDS_MeshObject, SMDS_ElementHolder bool Add(const SMDS_MeshElement * theElem); bool Remove(const SMDS_MeshElement * theElem); bool IsEmpty() const { return myElements.empty(); } - int Extent() const { return myElements.size(); } + smIdType Extent() const { return (smIdType) myElements.size(); } int Tic() const { return myTic; } bool Contains(const SMDS_MeshElement * theElem) const; diff --git a/src/SMDS/SMDS_MeshInfo.hxx b/src/SMDS/SMDS_MeshInfo.hxx index b9cfb61f2..765c859fa 100644 --- a/src/SMDS/SMDS_MeshInfo.hxx +++ b/src/SMDS/SMDS_MeshInfo.hxx @@ -30,6 +30,7 @@ #include "SMDS_MeshElement.hxx" #include +#include class SMDS_EXPORT SMDS_MeshInfo { @@ -39,39 +40,39 @@ public: inline SMDS_MeshInfo& operator=(const SMDS_MeshInfo& other); inline void Clear(); - inline int NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const; - inline int NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); } - inline int NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); } - - inline int NbEntities(SMDSAbs_EntityType type) const; - inline int NbElementsOfGeom(SMDSAbs_GeometryType geom) const; - - int NbNodes() const { return myNbNodes; } - int Nb0DElements() const { return myNb0DElements; } - int NbBalls() const { return myNbBalls; } - inline int NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const; - - inline int NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const; - inline int NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const; - inline int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbBiQuadTriangles() const { return myNbBiQuadTriangles; } - int NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; } - inline int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const; - - inline int NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const; - inline int NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const; - inline int NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const; - inline int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const; - inline int NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const; - inline int NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbTriQuadHexas() const { return myNbTriQuadHexas; } - int NbQuadPrisms() const { return myNbQuadPrisms; } - int NbBiQuadPrisms() const { return myNbBiQuadPrisms; } - int NbPolyhedrons() const { return myNbPolyhedrons; } + inline smIdType NbElements(SMDSAbs_ElementType type=SMDSAbs_All) const; + inline smIdType NbElements(SMDSAbs_EntityType type) const { return NbEntities(type); } + inline smIdType NbElements(SMDSAbs_GeometryType type) const { return NbElementsOfGeom(type); } + + inline smIdType NbEntities(SMDSAbs_EntityType type) const; + inline smIdType NbElementsOfGeom(SMDSAbs_GeometryType geom) const; + + smIdType NbNodes() const { return myNbNodes; } + smIdType Nb0DElements() const { return myNb0DElements; } + smIdType NbBalls() const { return myNbBalls; } + inline smIdType NbEdges (SMDSAbs_ElementOrder order = ORDER_ANY) const; + + inline smIdType NbFaces (SMDSAbs_ElementOrder order = ORDER_ANY) const; + inline smIdType NbTriangles (SMDSAbs_ElementOrder order = ORDER_ANY) const; + inline smIdType NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbBiQuadTriangles() const { return myNbBiQuadTriangles; } + smIdType NbBiQuadQuadrangles() const { return myNbBiQuadQuadrangles; } + inline smIdType NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const; + + inline smIdType NbVolumes (SMDSAbs_ElementOrder order = ORDER_ANY) const; + inline smIdType NbTetras (SMDSAbs_ElementOrder order = ORDER_ANY) const; + inline smIdType NbHexas (SMDSAbs_ElementOrder order = ORDER_ANY) const; + inline smIdType NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const; + inline smIdType NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const; + inline smIdType NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbTriQuadHexas() const { return myNbTriQuadHexas; } + smIdType NbQuadPrisms() const { return myNbQuadPrisms; } + smIdType NbBiQuadPrisms() const { return myNbBiQuadPrisms; } + smIdType NbPolyhedrons() const { return myNbPolyhedrons; } protected: inline void addWithPoly(const SMDS_MeshElement* el); - inline void setNb(const SMDSAbs_EntityType geomType, const int nb); + inline void setNb(const SMDSAbs_EntityType geomType, const smIdType nb); private: friend class SMDS_Mesh; @@ -79,29 +80,29 @@ private: // methods to count NOT POLY elements inline void remove(const SMDS_MeshElement* el); inline void add (const SMDS_MeshElement* el); - inline int index(SMDSAbs_ElementType type, int nbNodes) const; + inline smIdType index(SMDSAbs_ElementType type, int nbNodes) const; // methods to remove elements of ANY kind inline void RemoveEdge(const SMDS_MeshElement* el); inline void RemoveFace(const SMDS_MeshElement* el); inline void RemoveVolume(const SMDS_MeshElement* el); - int myNbNodes; + smIdType myNbNodes; - int myNb0DElements; - int myNbBalls; - int myNbEdges , myNbQuadEdges ; - int myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ; - int myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles; - int myNbPolygons , myNbQuadPolygons; + smIdType myNb0DElements; + smIdType myNbBalls; + smIdType myNbEdges , myNbQuadEdges ; + smIdType myNbTriangles , myNbQuadTriangles, myNbBiQuadTriangles ; + smIdType myNbQuadrangles, myNbQuadQuadrangles, myNbBiQuadQuadrangles; + smIdType myNbPolygons , myNbQuadPolygons; - int myNbTetras , myNbQuadTetras ; - int myNbHexas , myNbQuadHexas, myNbTriQuadHexas; - int myNbPyramids, myNbQuadPyramids; - int myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms; - int myNbHexPrism; - int myNbPolyhedrons; + smIdType myNbTetras , myNbQuadTetras ; + smIdType myNbHexas , myNbQuadHexas, myNbTriQuadHexas; + smIdType myNbPyramids, myNbQuadPyramids; + smIdType myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms; + smIdType myNbHexPrism; + smIdType myNbPolyhedrons; - std::vector myNb; // pointers to myNb... fields + std::vector myNb; // pointers to myNb... fields std::vector myShift; // shift to get an index in myNb by elem->NbNodes() }; @@ -212,7 +213,7 @@ SMDS_MeshInfo::Clear() myNbPolygons=myNbQuadPolygons=myNbPolyhedrons=0; } -inline int // index +inline smIdType // index SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const { return nbNodes + myShift[ type ]; } @@ -250,54 +251,54 @@ inline void // RemoveVolume SMDS_MeshInfo::RemoveVolume(const SMDS_MeshElement* el) { if ( el->IsPoly() ) --myNbPolyhedrons; else remove( el ); } -inline int // NbEdges +inline smIdType // NbEdges SMDS_MeshInfo::NbEdges (SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbEdges+myNbQuadEdges : order == ORDER_LINEAR ? myNbEdges : myNbQuadEdges; } -inline int // NbFaces +inline smIdType // NbFaces SMDS_MeshInfo::NbFaces (SMDSAbs_ElementOrder order) const { return NbTriangles(order)+NbQuadrangles(order)+(order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons ); } -inline int // NbTriangles +inline smIdType // NbTriangles SMDS_MeshInfo::NbTriangles (SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbTriangles+myNbQuadTriangles+myNbBiQuadTriangles : order == ORDER_LINEAR ? myNbTriangles : myNbQuadTriangles+myNbBiQuadTriangles; } -inline int // NbQuadrangles +inline smIdType // NbQuadrangles SMDS_MeshInfo::NbQuadrangles(SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbQuadrangles+myNbQuadQuadrangles+myNbBiQuadQuadrangles : order == ORDER_LINEAR ? myNbQuadrangles : myNbQuadQuadrangles+myNbBiQuadQuadrangles; } -inline int // NbPolygons +inline smIdType // NbPolygons SMDS_MeshInfo::NbPolygons(SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbPolygons+myNbQuadPolygons : order == ORDER_LINEAR ? myNbPolygons : myNbQuadPolygons; } -inline int // NbVolumes +inline smIdType // NbVolumes SMDS_MeshInfo::NbVolumes (SMDSAbs_ElementOrder order) const { return NbTetras(order) + NbHexas(order) + NbPyramids(order) + NbPrisms(order) + NbHexPrisms(order) + (order == ORDER_QUADRATIC ? 0 : myNbPolyhedrons); } -inline int // NbTetras +inline smIdType // NbTetras SMDS_MeshInfo::NbTetras (SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbTetras+myNbQuadTetras : order == ORDER_LINEAR ? myNbTetras : myNbQuadTetras; } -inline int // NbHexas +inline smIdType // NbHexas SMDS_MeshInfo::NbHexas (SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbHexas+myNbQuadHexas+myNbTriQuadHexas : order == ORDER_LINEAR ? myNbHexas : myNbQuadHexas+myNbTriQuadHexas; } -inline int // NbPyramids +inline smIdType // NbPyramids SMDS_MeshInfo::NbPyramids(SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbPyramids+myNbQuadPyramids : order == ORDER_LINEAR ? myNbPyramids : myNbQuadPyramids; } -inline int // NbPrisms +inline smIdType // NbPrisms SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms+myNbBiQuadPrisms: order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms+myNbBiQuadPrisms; } -inline int // NbHexPrisms +inline smIdType // NbHexPrisms SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const { return order == ORDER_ANY ? myNbHexPrism : order == ORDER_LINEAR ? myNbHexPrism : 0; } -inline int // NbElements +inline smIdType // NbElements SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const { - int nb = 0; + smIdType nb = 0; switch (type) { case SMDSAbs_All: for ( size_t i=1+index( SMDSAbs_Node,1 ); i #include #include +#include #include @@ -122,8 +123,8 @@ namespace { for (int i = 0; i < ncells; i++) { - int vtkId = cells[i]; - int smdsId = myMesh->FromVtkToSmds( vtkId ); + vtkIdType vtkId = cells[i]; + smIdType smdsId = myMesh->FromVtkToSmds( vtkId ); const SMDS_MeshElement* elem = myMesh->FindElement( smdsId ); if ( elem->GetType() == type ) { @@ -141,8 +142,8 @@ namespace const SMDS_MeshElement* next() { - int vtkId = myCellList[ myIter++ ]; - int smdsId = myMesh->FromVtkToSmds( vtkId ); + vtkIdType vtkId = myCellList[ myIter++ ]; + smIdType smdsId = myMesh->FromVtkToSmds( vtkId ); const SMDS_MeshElement* elem = myMesh->FindElement(smdsId); if (!elem) { diff --git a/src/SMDS/SMDS_UnstructuredGrid.cxx b/src/SMDS/SMDS_UnstructuredGrid.cxx index 8da9a287b..039d4920b 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.cxx +++ b/src/SMDS/SMDS_UnstructuredGrid.cxx @@ -135,7 +135,7 @@ vtkPoints* SMDS_UnstructuredGrid::GetPoints() return this->Points; } -int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *pts) +vtkIdType SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *pts) { if ( !this->Links ) // don't create Links until they are needed { @@ -146,7 +146,7 @@ int SMDS_UnstructuredGrid::InsertNextLinkedCell(int type, int npts, vtkIdType *p return vtkUnstructuredGrid::InsertNextLinkedCell(type, npts, pts); // --- type = VTK_POLYHEDRON - int cellid = this->InsertNextCell(type, npts, pts); + vtkIdType cellid = this->InsertNextCell(type, npts, pts); std::set setOfNodes; setOfNodes.clear(); @@ -175,15 +175,15 @@ void SMDS_UnstructuredGrid::setSMDS_mesh(SMDS_Mesh *mesh) _mesh = mesh; } -void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int newNodeSize, - std::vector& idCellsNewToOld, int newCellSize) +void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, smIdType newNodeSize, + std::vector& idCellsNewToOld, smIdType newCellSize) { this->DeleteLinks(); // IDs of VTK nodes always correspond to SMDS IDs but there can be "holes" in SMDS numeration. // We compact only if there were holes - int oldNodeSize = this->GetNumberOfPoints(); + vtkIdType oldNodeSize = this->GetNumberOfPoints(); bool updateNodes = ( oldNodeSize > newNodeSize ); if ( true /*updateNodes*/ ) { @@ -191,19 +191,19 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n // Use double type for storing coordinates of nodes instead float. vtkPoints *newPoints = vtkPoints::New(); newPoints->SetDataType( VTK_DOUBLE ); - newPoints->SetNumberOfPoints( newNodeSize ); + newPoints->SetNumberOfPoints( FromIdType(newNodeSize) ); - int i = 0, alreadyCopied = 0; + vtkIdType i = 0, alreadyCopied = 0; while ( i < oldNodeSize ) { // skip a hole if any while ( i < oldNodeSize && idNodesOldToNew[i] < 0 ) ++i; - int startBloc = i; + vtkIdType startBloc = i; // look for a block end while ( i < oldNodeSize && idNodesOldToNew[i] >= 0 ) ++i; - int endBloc = i; + vtkIdType endBloc = i; copyNodes(newPoints, idNodesOldToNew, alreadyCopied, startBloc, endBloc); } this->SetPoints(newPoints); @@ -217,9 +217,9 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n // Compact cells if VTK IDs do not correspond to SMDS IDs or nodes compacted - int oldCellSize = this->Types->GetNumberOfTuples(); - bool updateCells = ( updateNodes || newCellSize != oldCellSize ); - for ( int newID = 0, nbIDs = idCellsNewToOld.size(); newID < nbIDs && !updateCells; ++newID ) + vtkIdType oldCellSize = this->Types->GetNumberOfTuples(); + bool updateCells = ( updateNodes || newCellSize != oldCellSize ); + for ( vtkIdType newID = 0, nbIDs = idCellsNewToOld.size(); newID < nbIDs && !updateCells; ++newID ) updateCells = ( idCellsNewToOld[ newID ] != newID ); if ( false /*!updateCells*/ ) // no holes in elements @@ -236,18 +236,18 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n return; } - if ((int) idNodesOldToNew.size() < oldNodeSize ) + if ((vtkIdType) idNodesOldToNew.size() < oldNodeSize ) { idNodesOldToNew.reserve( oldNodeSize ); - for ( int i = idNodesOldToNew.size(); i < oldNodeSize; ++i ) + for ( vtkIdType i = idNodesOldToNew.size(); i < oldNodeSize; ++i ) idNodesOldToNew.push_back( i ); } // --- create new compacted Connectivity, Locations and Types - int newConnectivitySize = this->Connectivity->GetNumberOfConnectivityEntries(); + vtkIdType newConnectivitySize = this->Connectivity->GetNumberOfConnectivityEntries(); if ( newCellSize != oldCellSize ) - for ( int i = 0; i < oldCellSize - 1; ++i ) + for ( vtkIdType i = 0; i < oldCellSize - 1; ++i ) if ( this->Types->GetValue( i ) == VTK_EMPTY_CELL ) newConnectivitySize -= this->Connectivity->GetCellSize( i ); @@ -257,11 +257,11 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n vtkUnsignedCharArray *newTypes = vtkUnsignedCharArray::New(); newTypes->Initialize(); - newTypes->SetNumberOfValues(newCellSize); + newTypes->SetNumberOfValues(FromIdType(newCellSize)); vtkIdTypeArray *newLocations = vtkIdTypeArray::New(); newLocations->Initialize(); - newLocations->SetNumberOfValues(newCellSize); + newLocations->SetNumberOfValues(FromIdType(newCellSize)); std::vector< vtkIdType > pointsCell(1024); // --- points id to fill a new cell @@ -273,11 +273,11 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n { vtkDoubleArray* newDiameters = vtkDoubleArray::New(); newDiameters->SetNumberOfComponents(1); - for ( int newCellID = 0; newCellID < newCellSize; newCellID++ ) + for ( vtkIdType newCellID = 0; newCellID < newCellSize; newCellID++ ) { if ( newTypes->GetValue( newCellID ) == VTK_POLY_VERTEX ) { - int oldCellID = idCellsNewToOld[ newCellID ]; + vtkIdType oldCellID = idCellsNewToOld[ newCellID ]; newDiameters->InsertValue( newCellID, diameters->GetValue( oldCellID )); } vtkDataSet::CellData->SetScalars( newDiameters ); @@ -292,22 +292,22 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n vtkIdTypeArray *newFaces = vtkIdTypeArray::New(); newFaces->Initialize(); newFaces->Allocate(this->Faces->GetSize()); - for ( int newCellID = 0; newCellID < newCellSize; newCellID++ ) + for ( vtkIdType newCellID = 0; newCellID < newCellSize; newCellID++ ) { if ( newTypes->GetValue( newCellID ) == VTK_POLYHEDRON ) { - int oldCellId = idCellsNewToOld[ newCellID ]; + smIdType oldCellId = idCellsNewToOld[ newCellID ]; newFaceLocations->InsertNextValue( newFaces->GetMaxId()+1 ); - int oldFaceLoc = this->FaceLocations->GetValue( oldCellId ); - int nCellFaces = this->Faces->GetValue( oldFaceLoc++ ); - newFaces->InsertNextValue( nCellFaces ); + smIdType oldFaceLoc = this->FaceLocations->GetValue( FromIdType(oldCellId) ); + smIdType nCellFaces = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); + newFaces->InsertNextValue( FromIdType(nCellFaces) ); for ( int n = 0; n < nCellFaces; n++ ) { - int nptsInFace = this->Faces->GetValue( oldFaceLoc++ ); + int nptsInFace = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); newFaces->InsertNextValue( nptsInFace ); for ( int k = 0; k < nptsInFace; k++ ) { - int oldpt = this->Faces->GetValue( oldFaceLoc++ ); + vtkIdType oldpt = this->Faces->GetValue( FromIdType(oldFaceLoc++) ); newFaces->InsertNextValue( idNodesOldToNew[ oldpt ]); } } @@ -335,15 +335,15 @@ void SMDS_UnstructuredGrid::compactGrid(std::vector& idNodesOldToNew, int n newConnectivity->Delete(); } -void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints, - std::vector& /*idNodesOldToNew*/, - int& alreadyCopied, - int start, - int end) +void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints, + std::vector& /*idNodesOldToNew*/, + vtkIdType& alreadyCopied, + vtkIdType start, + vtkIdType end) { void *target = newPoints->GetVoidPointer(3 * alreadyCopied); void *source = this->Points->GetVoidPointer(3 * start); - int nbPoints = end - start; + vtkIdType nbPoints = end - start; if (nbPoints > 0) { memcpy(target, source, 3 * sizeof(double) * nbPoints); @@ -352,15 +352,15 @@ void SMDS_UnstructuredGrid::copyNodes(vtkPoints * newPoints, } void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray * newTypes, - const std::vector& idCellsNewToOld, - const std::vector& idNodesOldToNew, + const std::vector& idCellsNewToOld, + const std::vector& idNodesOldToNew, vtkCellArray* newConnectivity, vtkIdTypeArray* newLocations, std::vector& pointsCell) { for ( size_t iNew = 0; iNew < idCellsNewToOld.size(); iNew++ ) { - int iOld = idCellsNewToOld[ iNew ]; + vtkIdType iOld = idCellsNewToOld[ iNew ]; newTypes->SetValue( iNew, this->Types->GetValue( iOld )); vtkIdType oldLoc = ((vtkIdTypeArray *)(this->Connectivity->GetOffsetsArray()))->GetValue( iOld ); @@ -371,25 +371,25 @@ void SMDS_UnstructuredGrid::copyBloc(vtkUnsignedCharArray * newTypes, pointsCell.resize( nbpts ); for ( int l = 0; l < nbpts; l++ ) { - int oldval = oldPtsCell[l]; + vtkIdType oldval = oldPtsCell[l]; pointsCell[l] = idNodesOldToNew[oldval]; } - /*int newcnt = */newConnectivity->InsertNextCell( nbpts, pointsCell.data() ); - int newLoc = newConnectivity->GetInsertLocation( nbpts ); + /*vtkIdType newcnt = */newConnectivity->InsertNextCell( nbpts, pointsCell.data() ); + vtkIdType newLoc = newConnectivity->GetInsertLocation( nbpts ); newLocations->SetValue( iNew, newLoc ); } } -int SMDS_UnstructuredGrid::CellIdToDownId(int vtkCellId) +int SMDS_UnstructuredGrid::CellIdToDownId(vtkIdType vtkCellId) { - if ((vtkCellId < 0) || (vtkCellId >= (int)_cellIdToDownId.size())) + if ((vtkCellId < 0) || (vtkCellId >= (vtkIdType)_cellIdToDownId.size())) { return -1; } return _cellIdToDownId[vtkCellId]; } -void SMDS_UnstructuredGrid::setCellIdToDownId(int vtkCellId, int downId) +void SMDS_UnstructuredGrid::setCellIdToDownId(vtkIdType vtkCellId, int downId) { // ASSERT((vtkCellId >= 0) && (vtkCellId < _cellIdToDownId.size())); _cellIdToDownId[vtkCellId] = downId; @@ -446,15 +446,15 @@ void SMDS_UnstructuredGrid::BuildDownwardConnectivity(bool /*withEdges*/) const SMDS_MeshInfo &meshInfo = _mesh->GetMeshInfo(); - int nbLinTetra = meshInfo.NbTetras (ORDER_LINEAR); - int nbQuadTetra = meshInfo.NbTetras (ORDER_QUADRATIC); - int nbLinPyra = meshInfo.NbPyramids(ORDER_LINEAR); - int nbQuadPyra = meshInfo.NbPyramids(ORDER_QUADRATIC); - int nbLinPrism = meshInfo.NbPrisms (ORDER_LINEAR); - int nbQuadPrism = meshInfo.NbPrisms (ORDER_QUADRATIC); - int nbLinHexa = meshInfo.NbHexas (ORDER_LINEAR); - int nbQuadHexa = meshInfo.NbHexas (ORDER_QUADRATIC); - int nbHexPrism = meshInfo.NbHexPrisms(); + int nbLinTetra = FromIdType(meshInfo.NbTetras (ORDER_LINEAR)); + int nbQuadTetra = FromIdType(meshInfo.NbTetras (ORDER_QUADRATIC)); + int nbLinPyra = FromIdType(meshInfo.NbPyramids(ORDER_LINEAR)); + int nbQuadPyra = FromIdType(meshInfo.NbPyramids(ORDER_QUADRATIC)); + int nbLinPrism = FromIdType(meshInfo.NbPrisms (ORDER_LINEAR)); + int nbQuadPrism = FromIdType(meshInfo.NbPrisms (ORDER_QUADRATIC)); + int nbLinHexa = FromIdType(meshInfo.NbHexas (ORDER_LINEAR)); + int nbQuadHexa = FromIdType(meshInfo.NbHexas (ORDER_QUADRATIC)); + int nbHexPrism = FromIdType(meshInfo.NbHexPrisms()); int nbLineGuess = int((4.0 / 3.0) * nbLinTetra + 2 * nbLinPrism + 2.5 * nbLinPyra + 3 * nbLinHexa); int nbQuadEdgeGuess = int((4.0 / 3.0) * nbQuadTetra + 2 * nbQuadPrism + 2.5 * nbQuadPyra + 3 * nbQuadHexa); diff --git a/src/SMDS/SMDS_UnstructuredGrid.hxx b/src/SMDS/SMDS_UnstructuredGrid.hxx index e7ed86930..4d819c76d 100644 --- a/src/SMDS/SMDS_UnstructuredGrid.hxx +++ b/src/SMDS/SMDS_UnstructuredGrid.hxx @@ -28,6 +28,7 @@ #include #include +#include #include #include @@ -73,17 +74,17 @@ class SMDS_EXPORT SMDS_UnstructuredGrid: public vtkUnstructuredGrid { public: void setSMDS_mesh(SMDS_Mesh *mesh); - void compactGrid(std::vector& idNodesOldToNew, - int newNodeSize, - std::vector& idCellsOldToNew, - int newCellSize); + void compactGrid(std::vector& idNodesOldToNew, + smIdType newNodeSize, + std::vector& idCellsOldToNew, + smIdType newCellSize); virtual vtkMTimeType GetMTime(); virtual vtkPoints *GetPoints(); - int InsertNextLinkedCell(int type, int npts, vtkIdType *pts); + vtkIdType InsertNextLinkedCell(int type, int npts, vtkIdType *pts); - int CellIdToDownId(int vtkCellId); - void setCellIdToDownId(int vtkCellId, int downId); + int CellIdToDownId(vtkIdType vtkCellId); + void setCellIdToDownId(vtkIdType vtkCellId, int downId); void CleanDownwardConnectivity(); void BuildDownwardConnectivity(bool withEdges); int GetNeighbors(int* neighborsVtkIds, int* downIds, unsigned char* downTypes, int vtkId, bool getSkin=false); @@ -115,10 +116,10 @@ public: protected: SMDS_UnstructuredGrid(); ~SMDS_UnstructuredGrid(); - void copyNodes(vtkPoints *newPoints, std::vector& idNodesOldToNew, int& alreadyCopied, int start, int end); + void copyNodes(vtkPoints *newPoints, std::vector& idNodesOldToNew, vtkIdType& alreadyCopied, vtkIdType start, vtkIdType end); void copyBloc(vtkUnsignedCharArray *newTypes, - const std::vector& idCellsOldToNew, - const std::vector& idNodesOldToNew, + const std::vector& idCellsOldToNew, + const std::vector& idNodesOldToNew, vtkCellArray* newConnectivity, vtkIdTypeArray* newLocations, std::vector& pointsCell); diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index 57f4bda6e..a97d7d143 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -969,7 +969,7 @@ bool SMDS_VolumeTool::GetFaceNodes (int faceIndex, namespace { - struct NLink : public std::pair + struct NLink : public std::pair { int myOri; NLink(const SMDS_MeshNode* n1=0, const SMDS_MeshNode* n2=0, int ori=1 ) @@ -2210,7 +2210,7 @@ const SMDS_MeshVolume* SMDS_VolumeTool::Element() const //purpose : return element ID //======================================================================= -int SMDS_VolumeTool::ID() const +smIdType SMDS_VolumeTool::ID() const { return myVolume ? myVolume->GetID() : 0; } diff --git a/src/SMDS/SMDS_VolumeTool.hxx b/src/SMDS/SMDS_VolumeTool.hxx index f33d68f24..9f566325d 100644 --- a/src/SMDS/SMDS_VolumeTool.hxx +++ b/src/SMDS/SMDS_VolumeTool.hxx @@ -31,6 +31,8 @@ #include "SMESH_SMDS.hxx" +#include + class SMDS_MeshElement; class SMDS_MeshNode; class SMDS_MeshVolume; @@ -72,7 +74,7 @@ class SMDS_EXPORT SMDS_VolumeTool const SMDS_MeshVolume* Element() const; // return element - int ID() const; + smIdType ID() const; // return element ID bool IsPoly() const { return myPolyedre; } @@ -95,7 +97,7 @@ class SMDS_EXPORT SMDS_VolumeTool const SMDS_MeshNode** GetNodes() const { return (const SMDS_MeshNode**) &myVolumeNodes[0]; } // Return array of volume nodes - int NbNodes() const { return myVolumeNodes.size(); } + int NbNodes() const { return (int) myVolumeNodes.size(); } // Return array of volume nodes double GetSize() const; @@ -261,7 +263,7 @@ class SMDS_EXPORT SMDS_VolumeTool int myNbFaces; std::vector myVolumeNodes; std::vector< int > myPolyIndices; // of a myCurFace - std::vector< int > myPolyQuantities; + std::vector myPolyQuantities; std::vector< int > myPolyFacetOri; // -1-in, +1-out, 0-undef typedef std::pair Link; diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 44555e3d9..f5acfca04 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -1038,12 +1038,12 @@ void SMESH_Algo::addBadInputElements(const SMESHDS_SubMesh* sm, */ //============================================================================= -int SMESH_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W) +smIdType SMESH_Algo::NumberOfPoints(SMESH_Mesh& aMesh, const TopoDS_Wire& W) { - int nbPoints = 0; + smIdType nbPoints = 0; for (TopExp_Explorer exp(W,TopAbs_EDGE); exp.More(); exp.Next()) { const TopoDS_Edge& E = TopoDS::Edge(exp.Current()); - int nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); + smIdType nb = aMesh.GetSubMesh(E)->GetSubMeshDS()->NbNodes(); if(_quadraticMesh) nb = nb/2; nbPoints += nb + 1; // internal points plus 1 vertex of 2 (last point ?) diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index 72c17b7f9..2bf89414c 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -60,8 +60,8 @@ class TopoDS_Vertex; class TopoDS_Wire; class gp_XYZ; -typedef std::map< SMESH_subMesh*, std::vector > MapShapeNbElems; -typedef std::map< SMESH_subMesh*, std::vector >::iterator MapShapeNbElemsItr; +typedef std::map< SMESH_subMesh*, std::vector > MapShapeNbElems; +typedef std::map< SMESH_subMesh*, std::vector >::iterator MapShapeNbElemsItr; // ================================================================================== /*! @@ -339,7 +339,7 @@ public: */ static double EdgeLength(const TopoDS_Edge & E); - int NumberOfPoints(SMESH_Mesh& aMesh,const TopoDS_Wire& W); + smIdType NumberOfPoints(SMESH_Mesh& aMesh,const TopoDS_Wire& W); /*! * \brief Return continuity of two edges diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index 9ed363a17..094168968 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -1183,7 +1183,7 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h if ( !GetMeshDS()->IsUsedHypothesis( hyp )) return; - int nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() ); + smIdType nbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() ); if ( hyp && _callUp && !_callUp->IsLoaded() ) // for not loaded mesh (#16648) { _callUp->HypothesisModified( hyp->GetID(), /*updateIcons=*/true ); @@ -1257,7 +1257,7 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* h HasModificationsToDiscard(); // to reset _isModified flag if mesh becomes empty GetMeshDS()->Modified(); - int newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() ); + smIdType newNbEntities = ( _myMeshDS->NbNodes() + _myMeshDS->NbElements() ); if ( hyp && _callUp ) _callUp->HypothesisModified( hyp->GetID(), newNbEntities != nbEntities ); } @@ -1428,6 +1428,8 @@ void SMESH_Mesh::ExportMED(const char * file, bool theAllElemsToGroup) { MESSAGE("MED_VERSION:"<< theVersion); + + Driver_Mesh::Status status; SMESH_TRY; DriverMED_W_SMESHDS_Mesh myWriter; @@ -1482,9 +1484,12 @@ void SMESH_Mesh::ExportMED(const char * file, } } // Perform export - myWriter.Perform(); + status = myWriter.Perform(); SMESH_CATCH( SMESH::throwSalomeEx ); + + if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH ) + throw TooLargeForExport("MED"); } //================================================================================ @@ -1509,9 +1514,15 @@ void SMESH_Mesh::ExportSAUV(const char *file, cmd += "from medutilities import my_remove ; my_remove(r'" + medfilename + "')"; cmd += "\""; system(cmd.c_str()); - ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1, - /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false, - /*zTol=*/-1, /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413 + try { + ExportMED(medfilename.c_str(), theMeshName, theAutoGroups, /*minor=*/-1, + /*meshPart=*/NULL, /*theAutoDimension=*/false, /*theAddODOnVertices=*/false, + /*zTol=*/-1, /*theAllElemsToGroup=*/true ); // theAllElemsToGroup is for PAL0023413 + } + catch ( TooLargeForExport ) + { + throw TooLargeForExport("SAUV"); + } #ifdef WIN32 cmd = "%PYTHONBIN% "; #else @@ -1541,12 +1552,19 @@ void SMESH_Mesh::ExportSAUV(const char *file, void SMESH_Mesh::ExportDAT(const char * file, const SMESHDS_Mesh* meshPart) { - Unexpect aCatch(SalomeException); + Driver_Mesh::Status status; + SMESH_TRY; + DriverDAT_W_SMDS_Mesh myWriter; myWriter.SetFile( file ); myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS ); myWriter.SetMeshId(_id); - myWriter.Perform(); + status = myWriter.Perform(); + + SMESH_CATCH( SMESH::throwSalomeEx ); + + if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH ) + throw TooLargeForExport("DAT"); } //================================================================================ @@ -1558,7 +1576,9 @@ void SMESH_Mesh::ExportDAT(const char * file, void SMESH_Mesh::ExportUNV(const char * file, const SMESHDS_Mesh* meshPart) { - Unexpect aCatch(SalomeException); + Driver_Mesh::Status status; + + SMESH_TRY; DriverUNV_W_SMDS_Mesh myWriter; myWriter.SetFile( file ); myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS ); @@ -1579,7 +1599,12 @@ void SMESH_Mesh::ExportUNV(const char * file, } } } - myWriter.Perform(); + status = myWriter.Perform(); + + SMESH_CATCH( SMESH::throwSalomeEx ); + + if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH ) + throw TooLargeForExport("UNV"); } //================================================================================ @@ -1593,14 +1618,21 @@ void SMESH_Mesh::ExportSTL(const char * file, const char * name, const SMESHDS_Mesh* meshPart) { - Unexpect aCatch(SalomeException); + Driver_Mesh::Status status; + SMESH_TRY; + DriverSTL_W_SMDS_Mesh myWriter; myWriter.SetFile( file ); myWriter.SetIsAscii( isascii ); myWriter.SetMesh( meshPart ? (SMESHDS_Mesh*) meshPart : _myMeshDS); myWriter.SetMeshId(_id); if ( name ) myWriter.SetName( name ); - myWriter.Perform(); + status = myWriter.Perform(); + + SMESH_CATCH( SMESH::throwSalomeEx ); + + if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH ) + throw TooLargeForExport("STL"); } //================================================================================ @@ -1614,7 +1646,9 @@ void SMESH_Mesh::ExportCGNS(const char * file, const char * meshName, const bool groupElemsByType) { + int res = Driver_Mesh::DRS_FAIL; + SMESH_TRY; // pass group names to SMESHDS std::map::iterator it = _mapGroup.begin(); @@ -1644,6 +1678,11 @@ void SMESH_Mesh::ExportCGNS(const char * file, } #endif + SMESH_CATCH( SMESH::throwSalomeEx ); + + if ( res == Driver_Mesh::DRS_TOO_LARGE_MESH ) + throw TooLargeForExport("CGNS"); + if ( res != Driver_Mesh::DRS_OK ) throw SALOME_Exception("Export failed"); } @@ -1658,12 +1697,20 @@ void SMESH_Mesh::ExportGMF(const char * file, const SMESHDS_Mesh* meshDS, bool withRequiredGroups) { + Driver_Mesh::Status status; + SMESH_TRY; + DriverGMF_Write myWriter; myWriter.SetFile( file ); myWriter.SetMesh( const_cast( meshDS )); myWriter.SetExportRequiredGroups( withRequiredGroups ); - myWriter.Perform(); + status = myWriter.Perform(); + + SMESH_CATCH( SMESH::throwSalomeEx ); + + if ( status == Driver_Mesh::DRS_TOO_LARGE_MESH ) + throw TooLargeForExport("GMF"); } //================================================================================ @@ -1746,7 +1793,7 @@ double SMESH_Mesh::GetComputeProgress() const */ //================================================================================ -int SMESH_Mesh::NbNodes() const +smIdType SMESH_Mesh::NbNodes() const { Unexpect aCatch(SalomeException); return _myMeshDS->NbNodes(); @@ -1758,7 +1805,7 @@ int SMESH_Mesh::NbNodes() const */ //================================================================================ -int SMESH_Mesh::Nb0DElements() const +smIdType SMESH_Mesh::Nb0DElements() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().Nb0DElements(); @@ -1770,7 +1817,7 @@ int SMESH_Mesh::Nb0DElements() const */ //================================================================================ -int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbEdges(order); @@ -1782,7 +1829,7 @@ int SMESH_Mesh::NbEdges(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbFaces(order); @@ -1794,7 +1841,7 @@ int SMESH_Mesh::NbFaces(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbTriangles(order); @@ -1806,7 +1853,7 @@ int SMESH_Mesh::NbTriangles(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbBiQuadTriangles() const +smIdType SMESH_Mesh::NbBiQuadTriangles() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbBiQuadTriangles(); @@ -1818,7 +1865,7 @@ int SMESH_Mesh::NbBiQuadTriangles() const */ //================================================================================ -int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbQuadrangles(order); @@ -1830,7 +1877,7 @@ int SMESH_Mesh::NbQuadrangles(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbBiQuadQuadrangles() const +smIdType SMESH_Mesh::NbBiQuadQuadrangles() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbBiQuadQuadrangles(); @@ -1842,7 +1889,7 @@ int SMESH_Mesh::NbBiQuadQuadrangles() const */ //================================================================================ -int SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbPolygons(order); @@ -1854,7 +1901,7 @@ int SMESH_Mesh::NbPolygons(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbVolumes(order); @@ -1866,7 +1913,7 @@ int SMESH_Mesh::NbVolumes(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbTetras(order); @@ -1878,7 +1925,7 @@ int SMESH_Mesh::NbTetras(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbHexas(order); @@ -1890,7 +1937,7 @@ int SMESH_Mesh::NbHexas(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbTriQuadraticHexas() const +smIdType SMESH_Mesh::NbTriQuadraticHexas() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbTriQuadHexas(); @@ -1902,7 +1949,7 @@ int SMESH_Mesh::NbTriQuadraticHexas() const */ //================================================================================ -int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbPyramids(order); @@ -1914,19 +1961,19 @@ int SMESH_Mesh::NbPyramids(SMDSAbs_ElementOrder order) const */ //================================================================================ -int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const +smIdType SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbPrisms(order); } -int SMESH_Mesh::NbQuadPrisms() const +smIdType SMESH_Mesh::NbQuadPrisms() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbQuadPrisms(); } -int SMESH_Mesh::NbBiQuadPrisms() const +smIdType SMESH_Mesh::NbBiQuadPrisms() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbBiQuadPrisms(); @@ -1939,7 +1986,7 @@ int SMESH_Mesh::NbBiQuadPrisms() const */ //================================================================================ -int SMESH_Mesh::NbHexagonalPrisms() const +smIdType SMESH_Mesh::NbHexagonalPrisms() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbHexPrisms(); @@ -1951,7 +1998,7 @@ int SMESH_Mesh::NbHexagonalPrisms() const */ //================================================================================ -int SMESH_Mesh::NbPolyhedrons() const +smIdType SMESH_Mesh::NbPolyhedrons() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbPolyhedrons(); @@ -1963,7 +2010,7 @@ int SMESH_Mesh::NbPolyhedrons() const */ //================================================================================ -int SMESH_Mesh::NbBalls() const +smIdType SMESH_Mesh::NbBalls() const { Unexpect aCatch(SalomeException); return _myMeshDS->GetMeshInfo().NbBalls(); @@ -1975,7 +2022,7 @@ int SMESH_Mesh::NbBalls() const */ //================================================================================ -int SMESH_Mesh::NbSubMesh() const +smIdType SMESH_Mesh::NbSubMesh() const { Unexpect aCatch(SalomeException); return _myMeshDS->NbSubMesh(); @@ -2215,8 +2262,8 @@ ostream& SMESH_Mesh::Dump(ostream& save) save << ++clause << ") Total number of " << orderStr << " edges:\t" << NbEdges(order) << endl; save << ++clause << ") Total number of " << orderStr << " faces:\t" << NbFaces(order) << endl; if ( NbFaces(order) > 0 ) { - int nb3 = NbTriangles(order); - int nb4 = NbQuadrangles(order); + smIdType nb3 = NbTriangles(order); + smIdType nb4 = NbQuadrangles(order); save << clause << ".1) Number of " << orderStr << " triangles: \t" << nb3 << endl; save << clause << ".2) Number of " << orderStr << " quadrangles:\t" << nb4 << endl; if ( nb3 + nb4 != NbFaces(order) ) { @@ -2236,10 +2283,10 @@ ostream& SMESH_Mesh::Dump(ostream& save) } save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl; if ( NbVolumes(order) > 0 ) { - int nb8 = NbHexas(order); - int nb4 = NbTetras(order); - int nb5 = NbPyramids(order); - int nb6 = NbPrisms(order); + smIdType nb8 = NbHexas(order); + smIdType nb4 = NbTetras(order); + smIdType nb5 = NbPyramids(order); + smIdType nb6 = NbPrisms(order); save << clause << ".1) Number of " << orderStr << " hexahedrons: \t" << nb8 << endl; save << clause << ".2) Number of " << orderStr << " tetrahedrons:\t" << nb4 << endl; save << clause << ".3) Number of " << orderStr << " prisms: \t" << nb6 << endl; @@ -2270,7 +2317,7 @@ ostream& SMESH_Mesh::Dump(ostream& save) //purpose : Returns type of mesh element with certain id //======================================================================= -SMDSAbs_ElementType SMESH_Mesh::GetElementType( const int id, const bool iselem ) +SMDSAbs_ElementType SMESH_Mesh::GetElementType( const smIdType id, const bool iselem ) { return _myMeshDS->GetElementType( id, iselem ); } diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index 4f9a3179d..e93fda65e 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -245,12 +245,22 @@ class SMESH_EXPORT SMESH_Mesh */ typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap; const TAncestorMap& GetAncestorMap() const { return _mapAncestors; } + /*! * \brief Check group names for duplications. * Consider maximum group name length stored in MED file */ bool HasDuplicatedGroupNamesMED(); + /*! + * \brief Exception thrown by Export*() in case if a mesh is too large for export + * due to limitation of a format + */ + struct TooLargeForExport : public std::runtime_error + { + TooLargeForExport(const char* format):runtime_error(format) {} + }; + void ExportMED(const char * theFile, const char* theMeshName = NULL, bool theAutoGroups = true, @@ -282,33 +292,33 @@ class SMESH_EXPORT SMESH_Mesh double GetComputeProgress() const; - int NbNodes() const; - int Nb0DElements() const; - int NbBalls() const; + smIdType NbNodes() const; + smIdType Nb0DElements() const; + smIdType NbBalls() const; - int NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbEdges(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbBiQuadQuadrangles() const; - int NbBiQuadTriangles() const; - int NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbFaces(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbTriangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbQuadrangles(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbBiQuadQuadrangles() const; + smIdType NbBiQuadTriangles() const; + smIdType NbPolygons(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbTriQuadraticHexas() const; - int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const; - int NbQuadPrisms() const; - int NbBiQuadPrisms() const; - int NbHexagonalPrisms() const; - int NbPolyhedrons() const; + smIdType NbVolumes(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbTetras(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbHexas(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbTriQuadraticHexas() const; + smIdType NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const; + smIdType NbQuadPrisms() const; + smIdType NbBiQuadPrisms() const; + smIdType NbHexagonalPrisms() const; + smIdType NbPolyhedrons() const; - int NbSubMesh() const; + smIdType NbSubMesh() const; - int NbGroup() const { return _mapGroup.size(); } + size_t NbGroup() const { return _mapGroup.size(); } int NbMeshes() const; // nb meshes in the Study @@ -345,7 +355,7 @@ class SMESH_EXPORT SMESH_Mesh bool SynchronizeGroups(); - SMDSAbs_ElementType GetElementType( const int id, const bool iselem ); + SMDSAbs_ElementType GetElementType( const smIdType id, const bool iselem ); void ClearMeshOrder(); void SetMeshOrder(const TListOfListOfInt& theOrder ); diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index e9c672c1e..3cb125ff2 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -100,6 +100,8 @@ #include "SMESH_TryCatch.hxx" // include after OCCT headers! +#include + #define cast2Node(elem) static_cast( elem ) using namespace std; @@ -186,7 +188,7 @@ SMESH_MeshEditor::AddElement(const vector & node, SMDS_MeshElement* e = 0; int nbnode = node.size(); SMESHDS_Mesh* mesh = GetMeshDS(); - const int ID = features.myID; + const smIdType ID = features.myID; switch ( features.myType ) { case SMDSAbs_Face: @@ -389,12 +391,12 @@ SMESH_MeshEditor::AddElement(const vector & node, */ //======================================================================= -SMDS_MeshElement* SMESH_MeshEditor::AddElement(const vector & nodeIDs, - const ElemFeatures& features) +SMDS_MeshElement* SMESH_MeshEditor::AddElement(const vector & nodeIDs, + const ElemFeatures& features) { vector nodes; nodes.reserve( nodeIDs.size() ); - vector::const_iterator id = nodeIDs.begin(); + vector::const_iterator id = nodeIDs.begin(); while ( id != nodeIDs.end() ) { if ( const SMDS_MeshNode* node = GetMeshDS()->FindNode( *id++ )) nodes.push_back( node ); @@ -410,7 +412,7 @@ SMDS_MeshElement* SMESH_MeshEditor::AddElement(const vector & nodeIDs, // Modify a compute state of sub-meshes which become empty //======================================================================= -int SMESH_MeshEditor::Remove (const list< int >& theIDs, +smIdType SMESH_MeshEditor::Remove (const list< smIdType >& theIDs, const bool isNodes ) { ClearLastCreated(); @@ -418,8 +420,8 @@ int SMESH_MeshEditor::Remove (const list< int >& theIDs, SMESHDS_Mesh* aMesh = GetMeshDS(); set< SMESH_subMesh *> smmap; - int removed = 0; - list::const_iterator it = theIDs.begin(); + smIdType removed = 0; + list::const_iterator it = theIDs.begin(); for ( ; it != theIDs.end(); it++ ) { const SMDS_MeshElement * elem; if ( isNodes ) @@ -2205,7 +2207,7 @@ namespace */ //======================================================================= - struct TVolumeFaceKey: pair< pair< int, int>, pair< int, int> > + struct TVolumeFaceKey: pair< pair< smIdType, smIdType>, pair< smIdType, smIdType> > { TVolumeFaceKey( SMDS_VolumeTool& vol, int iF ) { @@ -3119,10 +3121,10 @@ public: :myMesh( theMesh ), myMaxID( theMesh->MaxNodeID() + 1) {} - long GetLinkID (const SMDS_MeshNode * n1, + smIdType GetLinkID (const SMDS_MeshNode * n1, const SMDS_MeshNode * n2) const { - return ( Min(n1->GetID(),n2->GetID()) * myMaxID + Max(n1->GetID(),n2->GetID())); + return ( std::min(n1->GetID(),n2->GetID()) * myMaxID + std::max(n1->GetID(),n2->GetID())); } bool GetNodes (const long theLinkID, @@ -6468,7 +6470,7 @@ SMESH_MeshEditor::PGroupIDs SMESH_MeshEditor::Offset( TIDSortedElemSet & theElem // copy offsetMesh to theTgtMesh - int idShift = meshDS->MaxNodeID(); + smIdType idShift = meshDS->MaxNodeID(); for ( size_t i = 0; i < new2OldNodes.size(); ++i ) if ( const SMDS_MeshNode* n = new2OldNodes[ i ].first ) { @@ -6838,7 +6840,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes, TNodeNodeMap nodeNodeMap; // node to replace - new node set elems; // all elements with changed nodes - list< int > rmElemIds, rmNodeIds; + list< smIdType > rmElemIds, rmNodeIds; vector< ElemFeatures > newElemDefs; // Fill nodeNodeMap and elems @@ -7433,12 +7435,12 @@ bool SMESH_MeshEditor::applyMerge( const SMDS_MeshElement* elem, // purpose : allow comparing elements basing on their nodes // ======================================================== -class ComparableElement : public boost::container::flat_set< int > +class ComparableElement : public boost::container::flat_set< smIdType > { - typedef boost::container::flat_set< int > int_set; + typedef boost::container::flat_set< smIdType > int_set; const SMDS_MeshElement* myElem; - int mySumID; + smIdType mySumID; mutable int myGroupID; public: @@ -7449,7 +7451,7 @@ public: this->reserve( theElem->NbNodes() ); for ( SMDS_ElemIteratorPtr nodeIt = theElem->nodesIterator(); nodeIt->more(); ) { - int id = nodeIt->next()->GetID(); + smIdType id = nodeIt->next()->GetID(); mySumID += id; this->insert( id ); } @@ -7472,7 +7474,7 @@ public: static int HashCode(const ComparableElement& se, int limit ) { - return ::HashCode( se.mySumID, limit ); + return ::HashCode( FromIdType(se.mySumID), limit ); } static Standard_Boolean IsEqual(const ComparableElement& se1, const ComparableElement& se2 ) { @@ -7497,7 +7499,7 @@ void SMESH_MeshEditor::FindEqualElements( TIDSortedElemSet & theElements, else elemIt = SMESHUtils::elemSetIterator( theElements ); typedef NCollection_Map< ComparableElement, ComparableElement > TMapOfElements; - typedef std::list TGroupOfElems; + typedef std::list TGroupOfElems; TMapOfElements mapOfElements; std::vector< TGroupOfElems > arrayOfGroups; TGroupOfElems groupOfElems; @@ -7543,7 +7545,7 @@ void SMESH_MeshEditor::MergeElements(TListOfListOfElementsID & theGroupsOfElemen { ClearLastCreated(); - typedef list TListOfIDs; + typedef list TListOfIDs; TListOfIDs rmElemIds; // IDs of elems to remove SMESHDS_Mesh* aMesh = GetMeshDS(); @@ -8258,8 +8260,8 @@ SMESH_MeshEditor::SewFreeBorder (const SMDS_MeshNode* theBordFirstNode, TListOfListOfElementsID::iterator itGroups = equalGroups.begin(); for ( ; itGroups != equalGroups.end(); ++itGroups ) { - list< int >& group = *itGroups; - list< int >::iterator id = group.begin(); + list< smIdType >& group = *itGroups; + list< smIdType >::iterator id = group.begin(); for ( ++id; id != group.end(); ++id ) if ( const SMDS_MeshElement* seg = GetMeshDS()->FindElement( *id )) segments.erase( seg ); @@ -8691,12 +8693,12 @@ namespace */ //======================================================================= -int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm, - SMESH_MesherHelper& theHelper, - const bool theForce3d) +smIdType SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm, + SMESH_MesherHelper& theHelper, + const bool theForce3d) { //MESSAGE("convertElemToQuadratic"); - int nbElem = 0; + smIdType nbElem = 0; if( !theSm ) return nbElem; vector nbNodeInFaces; @@ -8749,7 +8751,7 @@ int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm, } // get elem data needed to re-create it // - const int id = elem->GetID(); + const smIdType id = elem->GetID(); const int nbNodes = elem->NbCornerNodes(); nodes.assign(elem->begin_nodes(), elem->end_nodes()); if ( aGeomType == SMDSEntity_Polyhedra ) @@ -8844,7 +8846,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT aHelper.ToFixNodeParameters( true ); // convert elements assigned to sub-meshes - int nbCheckedElems = 0; + smIdType nbCheckedElems = 0; if ( myMesh->HasShapeToMesh() ) { if ( SMESH_subMesh *aSubMesh = myMesh->GetSubMeshContaining(myMesh->GetShapeToMesh())) @@ -8861,7 +8863,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT } // convert elements NOT assigned to sub-meshes - int totalNbElems = meshDS->NbEdges() + meshDS->NbFaces() + meshDS->NbVolumes(); + smIdType totalNbElems = meshDS->NbEdges() + meshDS->NbFaces() + meshDS->NbVolumes(); if ( nbCheckedElems < totalNbElems ) // not all elements are in sub-meshes { aHelper.SetElementsOnShape(false); @@ -8874,7 +8876,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT const SMDS_MeshEdge* edge = aEdgeItr->next(); if ( !edge->IsQuadratic() ) { - int id = edge->GetID(); + smIdType id = edge->GetID(); const SMDS_MeshNode* n1 = edge->GetNode(0); const SMDS_MeshNode* n2 = edge->GetNode(1); @@ -8915,7 +8917,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT if ( alreadyOK ) continue; - const int id = face->GetID(); + const smIdType id = face->GetID(); vector nodes ( face->begin_nodes(), face->end_nodes()); meshDS->RemoveFreeElement(face, smDS, /*fromGroups=*/false); @@ -8971,7 +8973,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT continue; } } - const int id = volume->GetID(); + const smIdType id = volume->GetID(); vector nodes (volume->begin_nodes(), volume->end_nodes()); if ( type == SMDSEntity_Polyhedra ) nbNodeInFaces = static_cast(volume)->GetQuantities(); @@ -9151,7 +9153,7 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, if ( alreadyOK ) continue; const SMDSAbs_ElementType type = elem->GetType(); - const int id = elem->GetID(); + const smIdType id = elem->GetID(); const int nbNodes = elem->NbCornerNodes(); vector nodes ( elem->begin_nodes(), elem->end_nodes()); @@ -9212,15 +9214,15 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, //======================================================================= /*! * \brief Convert quadratic elements to linear ones and remove quadratic nodes - * \return int - nb of checked elements + * \return smIdType - nb of checked elements */ //======================================================================= -int SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm, - SMDS_ElemIteratorPtr theItr, - const int /*theShapeID*/) +smIdType SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm, + SMDS_ElemIteratorPtr theItr, + const int /*theShapeID*/) { - int nbElem = 0; + smIdType nbElem = 0; SMESHDS_Mesh* meshDS = GetMeshDS(); ElemFeatures elemType; vector nodes; @@ -9265,7 +9267,7 @@ int SMESH_MeshEditor::removeQuadElem(SMESHDS_SubMesh * theSm, bool SMESH_MeshEditor::ConvertFromQuadratic() { - int nbCheckedElems = 0; + smIdType nbCheckedElems = 0; if ( myMesh->HasShapeToMesh() ) { if ( SMESH_subMesh *aSubMesh = myMesh->GetSubMeshContaining(myMesh->GetShapeToMesh())) @@ -9279,7 +9281,7 @@ bool SMESH_MeshEditor::ConvertFromQuadratic() } } - int totalNbElems = + smIdType totalNbElems = GetMeshDS()->NbEdges() + GetMeshDS()->NbFaces() + GetMeshDS()->NbVolumes(); if ( nbCheckedElems < totalNbElems ) // not all elements are in submeshes { @@ -9318,7 +9320,7 @@ void SMESH_MeshEditor::ConvertFromQuadratic(TIDSortedElemSet& theElements) if ( theElements.empty() ) return; // collect IDs of medium nodes of theElements; some of these nodes will be removed - set mediumNodeIDs; + set mediumNodeIDs; TIDSortedElemSet::iterator eIt = theElements.begin(); for ( ; eIt != theElements.end(); ++eIt ) { @@ -9337,7 +9339,7 @@ void SMESH_MeshEditor::ConvertFromQuadratic(TIDSortedElemSet& theElements) // get remaining medium nodes TIDSortedNodeSet mediumNodes; - set::iterator nIdsIt = mediumNodeIDs.begin(); + set::iterator nIdsIt = mediumNodeIDs.begin(); for ( ; nIdsIt != mediumNodeIDs.end(); ++nIdsIt ) if ( const SMDS_MeshNode* n = GetMeshDS()->FindNode( *nIdsIt )) mediumNodes.insert( mediumNodes.end(), n ); @@ -9826,7 +9828,7 @@ SMESH_MeshEditor::SewSideElements (TIDSortedElemSet& theSide1, if ( aResult != SEW_OK) return aResult; - list< int > nodeIDsToRemove; + list< smIdType > nodeIDsToRemove; vector< const SMDS_MeshNode*> nodes; ElemFeatures elemType; @@ -11146,7 +11148,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vectorGetVtkID(); + vtkIdType vtkId = anElem->GetVtkID(); //MESSAGE(" vtkId " << vtkId << " smdsId " << anElem->GetID()); int neighborsVtkIds[NBMAXNEIGHBORS]; int downIds[NBMAXNEIGHBORS]; @@ -11154,7 +11156,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vectorGetNeighbors(neighborsVtkIds, downIds, downTypes, vtkId); for (int n = 0; n < nbNeighbors; n++) { - int smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]); + smIdType smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]); const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); if (elem && ! domain.count(elem)) // neighbor is in another domain : face is shared { @@ -11383,7 +11385,7 @@ bool SMESH_MeshEditor::DoubleNodesOnGroupBoundaries( const std::vectorFromVtkToSmds(vtkVolIds[ivol]); + smIdType smdsId = meshDS->FromVtkToSmds(vtkVolIds[ivol]); const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); if (domain.count(elem)) { @@ -12239,7 +12241,7 @@ void SMESH_MeshEditor::CreateHoleSkin(double radius, { if (neighborsVtkIds[n]<0) // only smds faces are considered as neighbors here continue; - int smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]); + smIdType smdsId = meshDS->FromVtkToSmds(neighborsVtkIds[n]); const SMDS_MeshElement* elem = meshDS->FindElement(smdsId); if ( shapeIds.count(elem->getshapeId()) && !sgrps->Contains(elem)) // edge : neighbor in the set of shape, not in the group { diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 3a50a629a..d719ec99a 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -87,7 +87,7 @@ public: { SMDSAbs_ElementType myType; bool myIsPoly, myIsQuad; - int myID; + smIdType myID; double myBallDiameter; std::vector myPolyhedQuantities; std::vector myNodes; // not managed by ElemFeatures @@ -113,7 +113,7 @@ public: SMESH_EXPORT ElemFeatures& SetPoly(bool isPoly) { myIsPoly = isPoly; return *this; } SMESH_EXPORT ElemFeatures& SetQuad(bool isQuad) { myIsQuad = isQuad; return *this; } - SMESH_EXPORT ElemFeatures& SetID (int ID) { myID = ID; return *this; } + SMESH_EXPORT ElemFeatures& SetID (smIdType ID) { myID = ID; return *this; } }; /*! @@ -124,10 +124,10 @@ public: /*! * \brief Add element */ - SMDS_MeshElement* AddElement(const std::vector & nodeIDs, - const ElemFeatures& features); + SMDS_MeshElement* AddElement(const std::vector & nodeIDs, + const ElemFeatures& features); - int Remove (const std::list< int >& theElemIDs, const bool isNodes); + smIdType Remove (const std::list< smIdType >& theElemIDs, const bool isNodes); // Remove a node or an element. // Modify a compute state of sub-meshes which become empty @@ -352,7 +352,7 @@ public: bool IsScaleVariation() const { return myFlags & EXTRUSION_FLAG_SCALE_LINEAR_VARIATION; } bool IsAngleVariation() const { return myFlags & EXTRUSION_FLAG_ANGLE_LINEAR_VARIATION; } int NbSteps() const { - return mySteps.IsNull() ? myPathPoints.size() - 1: mySteps->Length(); + return mySteps.IsNull() ? (int)myPathPoints.size() - 1: mySteps->Length(); } // stores elements to use for extrusion by normal, depending on // state of EXTRUSION_FLAG_USE_INPUT_ELEMS_ONLY flag; @@ -501,7 +501,7 @@ public: // In each group, the cdr of nodes are substituted by the first one // in all elements. - typedef std::list< std::list< int > > TListOfListOfElementsID; + typedef std::list< std::list< smIdType > > TListOfListOfElementsID; void FindEqualElements(TIDSortedElemSet & theElements, TListOfListOfElementsID & theGroupsOfElementsID); @@ -735,19 +735,19 @@ public: /*! * \brief Convert elements contained in a submesh to quadratic - * \return int - nb of checked elements + * \return smIdType - nb of checked elements */ - int convertElemToQuadratic(SMESHDS_SubMesh * theSm, - SMESH_MesherHelper& theHelper, - const bool theForce3d); + smIdType convertElemToQuadratic(SMESHDS_SubMesh * theSm, + SMESH_MesherHelper& theHelper, + const bool theForce3d); /*! * \brief Convert quadratic elements to linear ones and remove quadratic nodes * \return nb of checked elements */ - int removeQuadElem( SMESHDS_SubMesh * theSm, - SMDS_ElemIteratorPtr theItr, - const int theShapeID); + smIdType removeQuadElem( SMESHDS_SubMesh * theSm, + SMDS_ElemIteratorPtr theItr, + const int theShapeID); /*! * \brief Create groups of elements made during transformation * \param nodeGens - nodes making corresponding myLastCreatedNodes diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index ed97f5cc2..28e4b9ac0 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -1924,7 +1924,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::getMediumNodeOnComposedWire(const SMDS_ //purpose : Creates a node //======================================================================= -SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID, +SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, smIdType ID, double u, double v) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -1953,7 +1953,7 @@ SMDS_MeshNode* SMESH_MesherHelper::AddNode(double x, double y, double z, int ID, SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, - const int id, + const smIdType id, const bool force3d) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -1987,7 +1987,7 @@ SMDS_MeshEdge* SMESH_MesherHelper::AddEdge(const SMDS_MeshNode* n1, SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, const SMDS_MeshNode* n3, - const int id, + const smIdType id, const bool force3d) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -2037,7 +2037,7 @@ SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, const SMDS_MeshNode* n3, const SMDS_MeshNode* n4, - const int id, + const smIdType id, const bool force3d) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -2101,7 +2101,7 @@ SMDS_MeshFace* SMESH_MesherHelper::AddFace(const SMDS_MeshNode* n1, //======================================================================= SMDS_MeshFace* SMESH_MesherHelper::AddPolygonalFace (const vector& nodes, - const int id, + const smIdType id, const bool force3d) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -2147,7 +2147,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, const SMDS_MeshNode* n4, const SMDS_MeshNode* n5, const SMDS_MeshNode* n6, - const int id, + const smIdType id, const bool force3d) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -2210,7 +2210,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, const SMDS_MeshNode* n3, const SMDS_MeshNode* n4, - const int id, + const smIdType id, const bool force3d) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -2251,7 +2251,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, const SMDS_MeshNode* n3, const SMDS_MeshNode* n4, const SMDS_MeshNode* n5, - const int id, + const smIdType id, const bool force3d) { SMDS_MeshVolume* elem = 0; @@ -2301,7 +2301,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, const SMDS_MeshNode* n6, const SMDS_MeshNode* n7, const SMDS_MeshNode* n8, - const int id, + const smIdType id, const bool force3d) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -2420,7 +2420,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, const SMDS_MeshNode* n10, const SMDS_MeshNode* n11, const SMDS_MeshNode* n12, - const int id, + const smIdType id, bool /*force3d*/) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -2442,7 +2442,7 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, SMDS_MeshVolume* SMESH_MesherHelper::AddPolyhedralVolume (const std::vector& nodes, const std::vector& quantities, - const int id, + const smIdType id, const bool force3d) { SMESHDS_Mesh * meshDS = GetMeshDS(); @@ -3413,9 +3413,9 @@ TopoDS_Shape SMESH_MesherHelper::GetShapeOfHypothesis( const SMESHDS_Hypothesis SMESH_MesherHelper:: MType SMESH_MesherHelper::IsQuadraticMesh() { - int NbAllEdgsAndFaces=0; - int NbQuadFacesAndEdgs=0; - int NbFacesAndEdges=0; + smIdType NbAllEdgsAndFaces=0; + smIdType NbQuadFacesAndEdgs=0; + smIdType NbFacesAndEdges=0; //All faces and edges NbAllEdgsAndFaces = myMesh->NbEdges() + myMesh->NbFaces(); if ( NbAllEdgsAndFaces == 0 ) diff --git a/src/SMESH/SMESH_MesherHelper.hxx b/src/SMESH/SMESH_MesherHelper.hxx index b95092a68..9ee8f2f44 100644 --- a/src/SMESH/SMESH_MesherHelper.hxx +++ b/src/SMESH/SMESH_MesherHelper.hxx @@ -343,13 +343,13 @@ public: /*! * Creates a node (!Note ID before u=0.,v0.) */ - SMDS_MeshNode* AddNode(double x, double y, double z, int ID = 0, double u=0., double v=0.); + SMDS_MeshNode* AddNode(double x, double y, double z, smIdType ID = 0, double u=0., double v=0.); /*! * Creates quadratic or linear edge */ SMDS_MeshEdge* AddEdge(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, - const int id = 0, + const smIdType id = 0, const bool force3d = true); /*! * Creates quadratic or linear triangle @@ -357,7 +357,7 @@ public: SMDS_MeshFace* AddFace(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, const SMDS_MeshNode* n3, - const int id=0, + const smIdType id=0, const bool force3d = false); /*! * Creates bi-quadratic, quadratic or linear quadrangle @@ -366,13 +366,13 @@ public: const SMDS_MeshNode* n2, const SMDS_MeshNode* n3, const SMDS_MeshNode* n4, - const int id = 0, + const smIdType id = 0, const bool force3d = false); /*! * Creates polygon, with additional nodes in quadratic mesh */ SMDS_MeshFace* AddPolygonalFace (const std::vector& nodes, - const int id = 0, + const smIdType id = 0, const bool force3d = false); /*! * Creates quadratic or linear tetrahedron @@ -381,7 +381,7 @@ public: const SMDS_MeshNode* n2, const SMDS_MeshNode* n3, const SMDS_MeshNode* n4, - const int id = 0, + const smIdType id = 0, const bool force3d = true); /*! * Creates quadratic or linear pyramid @@ -391,7 +391,7 @@ public: const SMDS_MeshNode* n3, const SMDS_MeshNode* n4, const SMDS_MeshNode* n5, - const int id = 0, + const smIdType id = 0, const bool force3d = true); /*! * Creates quadratic or linear pentahedron @@ -402,7 +402,7 @@ public: const SMDS_MeshNode* n4, const SMDS_MeshNode* n5, const SMDS_MeshNode* n6, - const int id = 0, + const smIdType id = 0, const bool force3d = true); /*! * Creates bi-quadratic, quadratic or linear hexahedron @@ -415,7 +415,7 @@ public: const SMDS_MeshNode* n6, const SMDS_MeshNode* n7, const SMDS_MeshNode* n8, - const int id = 0, + const smIdType id = 0, bool force3d = true); /*! @@ -433,7 +433,7 @@ public: const SMDS_MeshNode* n10, const SMDS_MeshNode* n11, const SMDS_MeshNode* n12, - const int id = 0, + const smIdType id = 0, bool force3d = true); /*! @@ -441,7 +441,7 @@ public: */ SMDS_MeshVolume* AddPolyhedralVolume (const std::vector& nodes, const std::vector& quantities, - const int ID=0, + const smIdType ID=0, const bool force3d = true); /*! * \brief Enables fixing node parameters on EDGEs and FACEs by @@ -753,7 +753,7 @@ public: SMESH_MesherHelper (const SMESH_MesherHelper& theOther); // key of a map of bi-quadratic face to it's central node - struct TBiQuad: public std::pair > + struct TBiQuad: public std::pair > { TBiQuad(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index a6e36e0d7..6f06b9ff4 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -574,8 +574,8 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, SMESH_MesherHelper helper( *theMesh ); helper.SetSubShape( theFace ); - int nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() ); - int nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() ); + smIdType nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() ); + smIdType nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() ); if ( nbElems == 0 && aMeshDS->NbFaces() == 0 ) { MESSAGE( "No elements bound to the face"); @@ -3231,7 +3231,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, return setErrorCode( ERR_LOADV_BAD_SHAPE ); // count nodes - int nbNodes = 0, shapeID; + smIdType nbNodes = 0; int shapeID; for ( shapeID = 1; shapeID <= myShapeIDMap.Extent(); shapeID++ ) { const TopoDS_Shape& S = myShapeIDMap( shapeID ); @@ -4366,7 +4366,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh* theMes subMesh->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); } if ( onMeshElements ) { - list< int > elemIDs; + list< smIdType > elemIDs; for ( size_t i = 0; i < theElements.size(); i++ ) { subMesh = theMesh->GetSubMeshContaining( shapeIDs[ i ] ); diff --git a/src/SMESH/SMESH_ProxyMesh.cxx b/src/SMESH/SMESH_ProxyMesh.cxx index 22635c083..670e225dc 100644 --- a/src/SMESH/SMESH_ProxyMesh.cxx +++ b/src/SMESH/SMESH_ProxyMesh.cxx @@ -402,9 +402,9 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::GetFaces() const */ //================================================================================ -int SMESH_ProxyMesh::NbFaces() const +smIdType SMESH_ProxyMesh::NbFaces() const { - int nb = 0; + smIdType nb = 0; if ( _mesh->HasShapeToMesh() ) { TopTools_IndexedMapOfShape FF; @@ -715,7 +715,7 @@ void SMESH_ProxyMesh::SubMesh::Clear() */ //================================================================================ -int SMESH_ProxyMesh::SubMesh::NbElements() const +smIdType SMESH_ProxyMesh::SubMesh::NbElements() const { return _uvPtStructVec.empty() ? _elements.size() : _uvPtStructVec.size() - 1; } @@ -740,7 +740,7 @@ SMDS_ElemIteratorPtr SMESH_ProxyMesh::SubMesh::GetElements() const */ //================================================================================ -int SMESH_ProxyMesh::SubMesh::NbNodes() const +smIdType SMESH_ProxyMesh::SubMesh::NbNodes() const { return _uvPtStructVec.size(); } diff --git a/src/SMESH/SMESH_ProxyMesh.hxx b/src/SMESH/SMESH_ProxyMesh.hxx index fc2e9b201..1f88b85de 100644 --- a/src/SMESH/SMESH_ProxyMesh.hxx +++ b/src/SMESH/SMESH_ProxyMesh.hxx @@ -32,6 +32,7 @@ #include #include +#include #include #include @@ -66,8 +67,8 @@ public: const SMDS_MeshNode* GetProxyNode( const SMDS_MeshNode* n ) const; const UVPtStructVec& GetUVPtStructVec() const { return _uvPtStructVec; } virtual void AddElement(const SMDS_MeshElement * e); - virtual int NbElements() const; - virtual int NbNodes() const; + virtual smIdType NbElements() const; + virtual smIdType NbNodes() const; virtual SMDS_ElemIteratorPtr GetElements() const; virtual SMDS_NodeIteratorPtr GetNodes() const; virtual void Clear(); @@ -127,7 +128,7 @@ public: SMDS_ElemIteratorPtr GetFaces(const TopoDS_Shape& face) const; // Return total nb of faces taking into account substitutions - int NbFaces() const; + smIdType NbFaces() const; bool IsTemporary(const SMDS_MeshElement* elem ) const; diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index eed10525b..d9493b3c1 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -1331,12 +1331,12 @@ static void cleanSubMesh( SMESH_subMesh * subMesh ) if (SMESHDS_SubMesh * subMeshDS = subMesh->GetSubMeshDS()) { SMESHDS_Mesh * meshDS = subMesh->GetFather()->GetMeshDS(); - int nbElems = subMeshDS->NbElements(); + smIdType nbElems = subMeshDS->NbElements(); if ( nbElems > 0 ) for ( SMDS_ElemIteratorPtr ite = subMeshDS->GetElements(); ite->more(); ) meshDS->RemoveFreeElement( ite->next(), subMeshDS ); - int nbNodes = subMeshDS->NbNodes(); + smIdType nbNodes = subMeshDS->NbNodes(); if ( nbNodes > 0 ) for ( SMDS_NodeIteratorPtr itn = subMeshDS->GetNodes(); itn->more() ; ) { @@ -1917,7 +1917,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) bool ret = true; if (_subShape.ShapeType() == TopAbs_VERTEX) { - vector aVec(SMDSEntity_Last,0); + vector aVec(SMDSEntity_Last,0); aVec[SMDSEntity_Node] = 1; aResMap.insert(make_pair(this,aVec)); return ret; @@ -1944,7 +1944,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) SMESH_subMesh* sm = smIt->next(); int dim = SMESH_Gen::GetShapeDim( sm->GetSubShape() ); if (dim < dimToCheck) break; // the rest subMeshes are all of less dimension - const vector & nbs = aResMap[ sm ]; + const vector & nbs = aResMap[ sm ]; subMeshEvaluated = (std::accumulate( nbs.begin(), nbs.end(), 0 ) > 0 ); } if ( !subMeshEvaluated ) @@ -1954,7 +1954,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) if ( IsMeshComputed() ) { - vector & nbEntities = aResMap[ this ]; + vector & nbEntities = aResMap[ this ]; nbEntities.resize( SMDSEntity_Last, 0 ); if ( SMESHDS_SubMesh* sm = GetSubMeshDS() ) { @@ -1968,7 +1968,7 @@ bool SMESH_subMesh::Evaluate(MapShapeNbElems& aResMap) { ret = algo->Evaluate((*_father), _subShape, aResMap); } - aResMap.insert( make_pair( this,vector(0))); + aResMap.insert( make_pair( this,vector(0))); } return ret; diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index 66d071a07..87181805a 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -34,6 +34,7 @@ #include "SALOME_LifeCycleCORBA.hxx" #include +#include #include CORBA_SERVER_HEADER(SALOME_Component) #include CORBA_SERVER_HEADER(SALOME_Exception) @@ -89,14 +90,14 @@ namespace //======================================================================= inline void AddNodesWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::double_array& aCoords = theSeq[theId].coords; const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(3*aNbElems != (CORBA::Long) aCoords.length()) + SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number; + if(3*aNbElems != (SMESH::smIdType) aCoords.length()) EXCEPTION(runtime_error,"AddNodesWithID - 3*aNbElems != aCoords.length()"); - for(CORBA::Long aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){ + for(SMESH::smIdType aCoordId = 0; anElemId < aNbElems; anElemId++, aCoordId+=3){ SMDS_MeshElement* anElem = theMesh->AddNodeWithID(aCoords[aCoordId], aCoords[aCoordId+1], aCoords[aCoordId+2], @@ -112,13 +113,13 @@ namespace //======================================================================= inline void Add0DElementsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if (2*aNbElems != (CORBA::Long) anIndexes.length()) + SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number; + if (2*aNbElems != (SMESH::smIdType) anIndexes.length()) EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != aCoords.length()"); - CORBA::Long anIndexId = 0; + SMESH::smIdType anIndexId = 0; for (; anElemId < aNbElems; anElemId++, anIndexId+=2) { SMDS_MeshElement* anElem = theMesh->Add0DElementWithID(anIndexes[anIndexId+1], @@ -134,16 +135,16 @@ namespace //======================================================================= inline void AddBallsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::double_array& aDiameter = theSeq[theId].coords; const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if (2*aNbElems != (CORBA::Long) anIndexes.length() ) + SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number; + if (2*aNbElems != (SMESH::smIdType) anIndexes.length() ) EXCEPTION(runtime_error,"AddEdgeWithID - 2*aNbElems != anIndexes.length()"); - if (aNbElems != (CORBA::Long) aDiameter.length()) + if (aNbElems != (SMESH::smIdType) aDiameter.length()) EXCEPTION(runtime_error,"AddEdgeWithID - aNbElems != aDiameter.length()"); - CORBA::Long anIndexId = 0; + SMESH::smIdType anIndexId = 0; for (; anElemId < aNbElems; anElemId++, anIndexId+=2) { SMDS_MeshElement* anElem = theMesh->AddBallWithID(anIndexes[anIndexId+1], @@ -160,13 +161,13 @@ namespace //======================================================================= inline void AddEdgesWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(3*aNbElems != (CORBA::Long) anIndexes.length()) + SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number; + if(3*aNbElems != (SMESH::smIdType) anIndexes.length()) EXCEPTION(runtime_error,"AddEdgeWithID - 3*aNbElems != aCoords.length()"); - for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){ + for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=3){ SMDS_MeshElement* anElem = theMesh->AddEdgeWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], anIndexes[anIndexId]); @@ -181,13 +182,13 @@ namespace //======================================================================= inline void AddTriasWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(4*aNbElems != (CORBA::Long) anIndexes.length()) + SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number; + if(4*aNbElems != (SMESH::smIdType) anIndexes.length()) EXCEPTION(runtime_error,"AddTriasWithID - 4*aNbElems != anIndexes.length()"); - for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){ + for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=4){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], anIndexes[anIndexId+3], @@ -203,13 +204,13 @@ namespace //======================================================================= inline void AddQuadsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(5*aNbElems != (CORBA::Long) anIndexes.length()) + SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number; + if(5*aNbElems != (SMESH::smIdType) anIndexes.length()) EXCEPTION(runtime_error,"AddQuadsWithID - 4*aNbElems != anIndexes.length()"); - for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ + for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ SMDS_MeshElement* anElem = theMesh->AddFaceWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], anIndexes[anIndexId+3], @@ -226,16 +227,16 @@ namespace //======================================================================= inline void AddPolygonsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; + SMESH::smIdType anIndexId = 0, aNbElems = theSeq[theId].number; - for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { - int aFaceId = anIndexes[anIndexId++]; + for (SMESH::smIdType anElemId = 0; anElemId < aNbElems; anElemId++) { + smIdType aFaceId = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++]; - std::vector nodes_ids (aNbNodes); + std::vector nodes_ids (aNbNodes); for (int i = 0; i < aNbNodes; i++) { nodes_ids[i] = anIndexes[anIndexId++]; } @@ -253,16 +254,16 @@ namespace //======================================================================= inline void AddQuadPolygonsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; + SMESH::smIdType anIndexId = 0, aNbElems = theSeq[theId].number; - for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { - int aFaceId = anIndexes[anIndexId++]; + for (SMESH::smIdType anElemId = 0; anElemId < aNbElems; anElemId++) { + smIdType aFaceId = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++]; - std::vector nodes_ids (aNbNodes); + std::vector nodes_ids (aNbNodes); for (int i = 0; i < aNbNodes; i++) { nodes_ids[i] = anIndexes[anIndexId++]; } @@ -280,13 +281,13 @@ namespace //======================================================================= inline void AddTetrasWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(5*aNbElems != (CORBA::Long) anIndexes.length()) + SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number; + if(5*aNbElems != (SMESH::smIdType) anIndexes.length()) EXCEPTION(runtime_error,"AddTetrasWithID - 5*aNbElems != anIndexes.length()"); - for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ + for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=5){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], anIndexes[anIndexId+3], @@ -303,13 +304,13 @@ namespace //======================================================================= inline void AddPiramidsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; - CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; - if(6*aNbElems != (CORBA::Long) anIndexes.length()) + SMESH::smIdType anElemId = 0, aNbElems = theSeq[theId].number; + if(6*aNbElems != (SMESH::smIdType) anIndexes.length()) EXCEPTION(runtime_error,"AddPiramidsWithID - 6*aNbElems != anIndexes.length()"); - for(CORBA::Long anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){ + for(SMESH::smIdType anIndexId = 0; anElemId < aNbElems; anElemId++, anIndexId+=6){ SMDS_MeshElement* anElem = theMesh->AddVolumeWithID(anIndexes[anIndexId+1], anIndexes[anIndexId+2], anIndexes[anIndexId+3], @@ -327,7 +328,7 @@ namespace //======================================================================= inline void AddPrismsWithID(SMDS_Mesh* theMesh, SMESH::log_array_var& theSeq, - CORBA::Long theId) + SMESH::smIdType theId) { const SMESH::long_array& anIndexes = theSeq[theId].indexes; CORBA::Long anElemId = 0, aNbElems = theSeq[theId].number; @@ -415,10 +416,10 @@ namespace CORBA::Long anIndexId = 0, aNbElems = theSeq[theId].number; for (CORBA::Long anElemId = 0; anElemId < aNbElems; anElemId++) { - int aFaceId = anIndexes[anIndexId++]; + smIdType aFaceId = anIndexes[anIndexId++]; int aNbNodes = anIndexes[anIndexId++]; - std::vector nodes_ids (aNbNodes); + std::vector nodes_ids (aNbNodes); for (int i = 0; i < aNbNodes; i++) { nodes_ids[i] = anIndexes[anIndexId++]; } diff --git a/src/SMESHDS/SMESHDS_Command.cxx b/src/SMESHDS/SMESHDS_Command.cxx index e5e4002c8..371515ab6 100644 --- a/src/SMESHDS/SMESHDS_Command.cxx +++ b/src/SMESHDS/SMESHDS_Command.cxx @@ -52,7 +52,7 @@ SMESHDS_Command::~SMESHDS_Command() //function : //purpose : //======================================================================= -void SMESHDS_Command::AddNode(int NewNodeID, double x, double y, double z) +void SMESHDS_Command::AddNode(smIdType NewNodeID, double x, double y, double z) { if ( myType != SMESHDS_AddNode) { @@ -70,7 +70,7 @@ void SMESHDS_Command::AddNode(int NewNodeID, double x, double y, double z) //function : //purpose : //======================================================================= -void SMESHDS_Command::MoveNode(int NodeID, double x, double y, double z) +void SMESHDS_Command::MoveNode(smIdType NodeID, double x, double y, double z) { if ( myType != SMESHDS_MoveNode) { @@ -88,7 +88,7 @@ void SMESHDS_Command::MoveNode(int NodeID, double x, double y, double z) //function : //purpose : //======================================================================= -void SMESHDS_Command::Add0DElement(int New0DElementID, int idnode) +void SMESHDS_Command::Add0DElement(smIdType New0DElementID, smIdType idnode) { if ( myType != SMESHDS_Add0DElement) { @@ -104,7 +104,7 @@ void SMESHDS_Command::Add0DElement(int New0DElementID, int idnode) //function : //purpose : //======================================================================= -void SMESHDS_Command::AddEdge(int NewEdgeID, int idnode1, int idnode2) +void SMESHDS_Command::AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2) { if ( myType != SMESHDS_AddEdge) { @@ -121,8 +121,8 @@ void SMESHDS_Command::AddEdge(int NewEdgeID, int idnode1, int idnode2) //function : //purpose : //======================================================================= -void SMESHDS_Command::AddFace(int NewFaceID, - int idnode1, int idnode2, int idnode3) +void SMESHDS_Command::AddFace(smIdType NewFaceID, + smIdType idnode1, smIdType idnode2, smIdType idnode3) { if ( myType != SMESHDS_AddTriangle) { @@ -140,8 +140,8 @@ void SMESHDS_Command::AddFace(int NewFaceID, //function : //purpose : //======================================================================= -void SMESHDS_Command::AddFace(int NewFaceID, - int idnode1, int idnode2, int idnode3, int idnode4) +void SMESHDS_Command::AddFace(smIdType NewFaceID, + smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4) { if ( myType != SMESHDS_AddQuadrangle) { @@ -160,8 +160,8 @@ void SMESHDS_Command::AddFace(int NewFaceID, //function : //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, - int idnode1, int idnode2, int idnode3, int idnode4) +void SMESHDS_Command::AddVolume(smIdType NewVolID, + smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4) { if ( myType != SMESHDS_AddTetrahedron) { @@ -180,8 +180,8 @@ void SMESHDS_Command::AddVolume(int NewVolID, //function : //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, - int idnode1, int idnode2, int idnode3, int idnode4, int idnode5) +void SMESHDS_Command::AddVolume(smIdType NewVolID, + smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4, smIdType idnode5) { if ( myType != SMESHDS_AddPyramid) { @@ -201,9 +201,9 @@ void SMESHDS_Command::AddVolume(int NewVolID, //function : //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, - int idnode1, - int idnode2, int idnode3, int idnode4, int idnode5, int idnode6) +void SMESHDS_Command::AddVolume(smIdType NewVolID, + smIdType idnode1, + smIdType idnode2, smIdType idnode3, smIdType idnode4, smIdType idnode5, smIdType idnode6) { if ( myType != SMESHDS_AddPrism) { @@ -224,11 +224,11 @@ void SMESHDS_Command::AddVolume(int NewVolID, //function : //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, - int idnode1, - int idnode2, - int idnode3, - int idnode4, int idnode5, int idnode6, int idnode7, int idnode8) +void SMESHDS_Command::AddVolume(smIdType NewVolID, + smIdType idnode1, + smIdType idnode2, + smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8) { if ( myType != SMESHDS_AddHexahedron) { @@ -247,10 +247,10 @@ void SMESHDS_Command::AddVolume(int NewVolID, myNumber++; } -void SMESHDS_Command::AddVolume(int NewVolID, - int idnode1,int idnode2,int idnode3,int idnode4, - int idnode5, int idnode6, int idnode7, int idnode8, - int idnode9, int idnode10, int idnode11, int idnode12) +void SMESHDS_Command::AddVolume(smIdType NewVolID, + smIdType idnode1,smIdType idnode2,smIdType idnode3,smIdType idnode4, + smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8, + smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12) { if (myType != SMESHDS_AddHexagonalPrism) { @@ -277,8 +277,8 @@ void SMESHDS_Command::AddVolume(int NewVolID, //function : AddPolygonalFace //purpose : //======================================================================= -void SMESHDS_Command::AddPolygonalFace (const int ElementID, - const std::vector& nodes_ids) +void SMESHDS_Command::AddPolygonalFace (const smIdType ElementID, + const std::vector& nodes_ids) { if ( myType != SMESHDS_AddPolygon) { MESSAGE("SMESHDS_Command::AddPolygonalFace : Bad Type"); @@ -286,7 +286,7 @@ void SMESHDS_Command::AddPolygonalFace (const int ElementID, } myIntegers.push_back(ElementID); - int i, nbNodes = nodes_ids.size(); + smIdType i, nbNodes = nodes_ids.size(); myIntegers.push_back(nbNodes); for (i = 0; i < nbNodes; i++) { myIntegers.push_back(nodes_ids[i]); @@ -299,8 +299,8 @@ void SMESHDS_Command::AddPolygonalFace (const int ElementID, //function : AddQuadPolygonalFace //purpose : //======================================================================= -void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID, - const std::vector& nodes_ids) +void SMESHDS_Command::AddQuadPolygonalFace (const smIdType ElementID, + const std::vector& nodes_ids) { if ( myType != SMESHDS_AddQuadPolygon) { MESSAGE("SMESHDS_Command::AddQuadraticPolygonalFace : Bad Type"); @@ -308,7 +308,7 @@ void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID, } myIntegers.push_back(ElementID); - int i, nbNodes = nodes_ids.size(); + smIdType i, nbNodes = nodes_ids.size(); myIntegers.push_back(nbNodes); for (i = 0; i < nbNodes; i++) { myIntegers.push_back(nodes_ids[i]); @@ -321,9 +321,9 @@ void SMESHDS_Command::AddQuadPolygonalFace (const int ElementID, //function : AddPolyhedralVolume //purpose : //======================================================================= -void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, - const std::vector& nodes_ids, - const std::vector& quantities) +void SMESHDS_Command::AddPolyhedralVolume (const smIdType ElementID, + const std::vector& nodes_ids, + const std::vector& quantities) { if ( myType != SMESHDS_AddPolyhedron) { MESSAGE("SMESHDS_Command::AddPolyhedralVolume : Bad Type"); @@ -331,13 +331,13 @@ void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, } myIntegers.push_back(ElementID); - int i, nbNodes = nodes_ids.size(); + smIdType i, nbNodes = nodes_ids.size(); myIntegers.push_back(nbNodes); for (i = 0; i < nbNodes; i++) { myIntegers.push_back(nodes_ids[i]); } - int nbFaces = quantities.size(); + smIdType nbFaces = quantities.size(); myIntegers.push_back(nbFaces); for (i = 0; i < nbFaces; i++) { myIntegers.push_back(quantities[i]); @@ -350,7 +350,7 @@ void SMESHDS_Command::AddPolyhedralVolume (const int ElementID, //function : //purpose : //======================================================================= -void SMESHDS_Command::RemoveNode(int NodeID) +void SMESHDS_Command::RemoveNode(smIdType NodeID) { if ( myType != SMESHDS_RemoveNode) { @@ -365,7 +365,7 @@ void SMESHDS_Command::RemoveNode(int NodeID) //function : //purpose : //======================================================================= -void SMESHDS_Command::RemoveElement(int ElementID) +void SMESHDS_Command::RemoveElement(smIdType ElementID) { if ( myType != SMESHDS_RemoveElement) { @@ -381,7 +381,7 @@ void SMESHDS_Command::RemoveElement(int ElementID) //purpose : //======================================================================= -void SMESHDS_Command::ChangeElementNodes(int ElementID, int nodes[], int nbnodes) +void SMESHDS_Command::ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes) { if ( myType != SMESHDS_ChangeElementNodes) { @@ -390,7 +390,7 @@ void SMESHDS_Command::ChangeElementNodes(int ElementID, int nodes[], int nbnodes } myIntegers.push_back(ElementID); myIntegers.push_back(nbnodes); - for ( int i = 0; i < nbnodes; i++ ) + for ( smIdType i = 0; i < nbnodes; i++ ) myIntegers.push_back( nodes[ i ] ); myNumber++; @@ -400,8 +400,8 @@ void SMESHDS_Command::ChangeElementNodes(int ElementID, int nodes[], int nbnodes //function : ChangePolyhedronNodes //purpose : //======================================================================= -void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID, - const std::vector& nodes_ids, +void SMESHDS_Command::ChangePolyhedronNodes (const smIdType ElementID, + const std::vector& nodes_ids, const std::vector& quantities) { if (myType != SMESHDS_ChangePolyhedronNodes) @@ -411,7 +411,7 @@ void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID, } myIntegers.push_back(ElementID); - int i, nbNodes = nodes_ids.size(); + smIdType i, nbNodes = nodes_ids.size(); myIntegers.push_back(nbNodes); for (i = 0; i < nbNodes; i++) { myIntegers.push_back(nodes_ids[i]); @@ -431,7 +431,7 @@ void SMESHDS_Command::ChangePolyhedronNodes (const int ElementID, //purpose : //======================================================================= -void SMESHDS_Command::Renumber (const bool isNodes, const int startID, const int deltaID) +void SMESHDS_Command::Renumber (const bool isNodes, const smIdType startID, const smIdType deltaID) { if ( myType != SMESHDS_Renumber) { @@ -457,7 +457,7 @@ SMESHDS_CommandType SMESHDS_Command::GetType() //function : //purpose : //======================================================================= -int SMESHDS_Command::GetNumber() +smIdType SMESHDS_Command::GetNumber() { return myNumber; } @@ -466,7 +466,7 @@ int SMESHDS_Command::GetNumber() //function : //purpose : //======================================================================= -const list < int >&SMESHDS_Command::GetIndexes() +const list < smIdType >&SMESHDS_Command::GetIndexes() { return myIntegers; } @@ -489,7 +489,7 @@ const list < double >&SMESHDS_Command::GetCoords() //function : AddEdge //purpose : //======================================================================= -void SMESHDS_Command::AddEdge(int NewEdgeID, int n1, int n2, int n12) +void SMESHDS_Command::AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12) { if ( myType != SMESHDS_AddQuadEdge) { MESSAGE("SMESHDS_Command::AddEdge : Bad Type"); @@ -506,9 +506,9 @@ void SMESHDS_Command::AddEdge(int NewEdgeID, int n1, int n2, int n12) //function : AddFace //purpose : //======================================================================= -void SMESHDS_Command::AddFace(int NewFaceID, - int n1, int n2, int n3, - int n12, int n23, int n31) +void SMESHDS_Command::AddFace(smIdType NewFaceID, + smIdType n1, smIdType n2, smIdType n3, + smIdType n12, smIdType n23, smIdType n31) { if ( myType != SMESHDS_AddQuadTriangle) { MESSAGE("SMESHDS_Command::AddFace : Bad Type"); @@ -528,9 +528,9 @@ void SMESHDS_Command::AddFace(int NewFaceID, //function : AddFace //purpose : //======================================================================= -void SMESHDS_Command::AddFace(int NewFaceID, - int n1, int n2, int n3, - int n12, int n23, int n31, int nCenter) +void SMESHDS_Command::AddFace(smIdType NewFaceID, + smIdType n1, smIdType n2, smIdType n3, + smIdType n12, smIdType n23, smIdType n31, smIdType nCenter) { if ( myType != SMESHDS_AddBiQuadTriangle) { MESSAGE("SMESHDS_Command::AddFace : Bad Type"); @@ -551,9 +551,9 @@ void SMESHDS_Command::AddFace(int NewFaceID, //function : AddFace //purpose : //======================================================================= -void SMESHDS_Command::AddFace(int NewFaceID, - int n1, int n2, int n3, int n4, - int n12, int n23, int n34, int n41) +void SMESHDS_Command::AddFace(smIdType NewFaceID, + smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n34, smIdType n41) { if ( myType != SMESHDS_AddQuadQuadrangle) { MESSAGE("SMESHDS_Command::AddFace : Bad Type"); @@ -575,9 +575,9 @@ void SMESHDS_Command::AddFace(int NewFaceID, //function : AddFace //purpose : //======================================================================= -void SMESHDS_Command::AddFace(int NewFaceID, - int n1, int n2, int n3, int n4, - int n12, int n23, int n34, int n41, int nCenter) +void SMESHDS_Command::AddFace(smIdType NewFaceID, + smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter) { if (myType != SMESHDS_AddBiQuadQuadrangle) { MESSAGE("SMESHDS_Command::AddFace : Bad Type"); @@ -600,9 +600,9 @@ void SMESHDS_Command::AddFace(int NewFaceID, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n12, int n23, int n31, - int n14, int n24, int n34) +void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n31, + smIdType n14, smIdType n24, smIdType n34) { if ( myType != SMESHDS_AddQuadTetrahedron) { MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); @@ -626,10 +626,10 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, - int n3, int n4, int n5, - int n12, int n23, int n34, int n41, - int n15, int n25, int n35, int n45) +void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, + smIdType n3, smIdType n4, smIdType n5, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n15, smIdType n25, smIdType n35, smIdType n45) { if ( myType != SMESHDS_AddQuadPyramid) { MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); @@ -656,11 +656,11 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, - int n3, int n4, int n5,int n6, - int n12, int n23, int n31, - int n45, int n56, int n64, - int n14, int n25, int n36) +void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, + smIdType n3, smIdType n4, smIdType n5,smIdType n6, + smIdType n12, smIdType n23, smIdType n31, + smIdType n45, smIdType n56, smIdType n64, + smIdType n14, smIdType n25, smIdType n36) { if ( myType != SMESHDS_AddQuadPentahedron) { MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); @@ -688,12 +688,12 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, - int n3, int n4, int n5,int n6, - int n12, int n23, int n31, - int n45, int n56, int n64, - int n14, int n25, int n36, - int n1245, int n2356, int n1346) +void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, + smIdType n3, smIdType n4, smIdType n5,smIdType n6, + smIdType n12, smIdType n23, smIdType n31, + smIdType n45, smIdType n56, smIdType n64, + smIdType n14, smIdType n25, smIdType n36, + smIdType n1245, smIdType n2356, smIdType n1346) { if ( myType != SMESHDS_AddBiQuadPentahedron) { MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); @@ -726,11 +726,11 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, - int n4, int n5, int n6, int n7, int n8, - int n12, int n23, int n34, int n41, - int n56, int n67, int n78, int n85, - int n15, int n26, int n37, int n48) +void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n56, smIdType n67, smIdType n78, smIdType n85, + smIdType n15, smIdType n26, smIdType n37, smIdType n48) { if ( myType != SMESHDS_AddQuadHexahedron) { MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); @@ -764,13 +764,13 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, - int n4, int n5, int n6, int n7, int n8, - int n12, int n23, int n34, int n41, - int n56, int n67, int n78, int n85, - int n15, int n26, int n37, int n48, - int n1234,int n1256,int n2367,int n3478, - int n1458,int n5678,int nCenter) +void SMESHDS_Command::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n56, smIdType n67, smIdType n78, smIdType n85, + smIdType n15, smIdType n26, smIdType n37, smIdType n48, + smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478, + smIdType n1458,smIdType n5678,smIdType nCenter) { if ( myType != SMESHDS_AddTriQuadHexa) { MESSAGE("SMESHDS_Command::AddVolume : Bad Type"); @@ -813,7 +813,7 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3, */ //================================================================================ -void SMESHDS_Command::AddBall(int NewBallID, int node, double diameter) +void SMESHDS_Command::AddBall(smIdType NewBallID, smIdType node, double diameter) { if ( myType != SMESHDS_AddBall) { diff --git a/src/SMESHDS/SMESHDS_Command.hxx b/src/SMESHDS/SMESHDS_Command.hxx index 8c0c3a81b..c89471140 100644 --- a/src/SMESHDS/SMESHDS_Command.hxx +++ b/src/SMESHDS/SMESHDS_Command.hxx @@ -30,6 +30,7 @@ #include "SMESH_SMESHDS.hxx" #include "SMESHDS_CommandType.hxx" +#include #include #include @@ -38,87 +39,87 @@ class SMESHDS_EXPORT SMESHDS_Command public: SMESHDS_Command(const SMESHDS_CommandType aType); - void AddNode(int NewNodeID, double x, double y, double z); - void Add0DElement(int New0DElementID, int idnode); - void AddEdge(int NewEdgeID, int idnode1, int idnode2); - void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3); - void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3, - int idnode4); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6, int idnode7, int idnode8); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, - int idnode9, int idnode10, int idnode11, int idnode12); - void AddPolygonalFace (const int ElementID, - const std::vector& nodes_ids); - void AddQuadPolygonalFace (const int ElementID, - const std::vector& nodes_ids); - void AddPolyhedralVolume (const int ElementID, - const std::vector& nodes_ids, - const std::vector& quantities); - void AddBall(int NewBallID, int node, double diameter); + void AddNode(smIdType NewNodeID, double x, double y, double z); + void Add0DElement(smIdType New0DElementID, smIdType idnode); + void AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2); + void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3); + void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8, + smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12); + void AddPolygonalFace (const smIdType ElementID, + const std::vector& nodes_ids); + void AddQuadPolygonalFace (const smIdType ElementID, + const std::vector& nodes_ids); + void AddPolyhedralVolume (const smIdType ElementID, + const std::vector& nodes_ids, + const std::vector& quantities); + void AddBall(smIdType NewBallID, smIdType node, double diameter); // special methods for quadratic elements - void AddEdge(int NewEdgeID, int n1, int n2, int n12); - void AddFace(int NewFaceID, int n1, int n2, int n3, - int n12, int n23, int n31); - void AddFace(int NewFaceID, int n1, int n2, int n3, - int n12, int n23, int n31, int nCenter); - void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, - int n12, int n23, int n34, int n41); - void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, - int n12, int n23, int n34, int n41, int nCenter); - void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n12, int n23, int n31, int n14, int n24, int n34); - void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5, - int n12, int n23, int n34, int n41, - int n15, int n25, int n35, int n45); - void AddVolume(int NewVolID, int n1, int n2, int n3, - int n4, int n5, int n6, - int n12, int n23, int n31, - int n45, int n56, int n64, - int n14, int n25, int n36); - void AddVolume(int NewVolID, int n1, int n2, int n3, - int n4, int n5, int n6, - int n12, int n23, int n31, - int n45, int n56, int n64, - int n14, int n25, int n36, - int n1245, int n2356, int n1346); - void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12, int n23, int n34, int n41, - int n56, int n67, int n78, int n85, - int n15, int n26, int n37, int n48); - void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12, int n23, int n34, int n41, - int n56, int n67, int n78, int n85, - int n15, int n26, int n37, int n48, - int n1234,int n1256,int n2367,int n3478, - int n1458,int n5678,int nCenter); + void AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12); + void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, + smIdType n12, smIdType n23, smIdType n31); + void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, + smIdType n12, smIdType n23, smIdType n31, smIdType nCenter); + void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n34, smIdType n41); + void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n31, smIdType n14, smIdType n24, smIdType n34); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n15, smIdType n25, smIdType n35, smIdType n45); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12, smIdType n23, smIdType n31, + smIdType n45, smIdType n56, smIdType n64, + smIdType n14, smIdType n25, smIdType n36); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12, smIdType n23, smIdType n31, + smIdType n45, smIdType n56, smIdType n64, + smIdType n14, smIdType n25, smIdType n36, + smIdType n1245, smIdType n2356, smIdType n1346); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n56, smIdType n67, smIdType n78, smIdType n85, + smIdType n15, smIdType n26, smIdType n37, smIdType n48); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n56, smIdType n67, smIdType n78, smIdType n85, + smIdType n15, smIdType n26, smIdType n37, smIdType n48, + smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478, + smIdType n1458,smIdType n5678,smIdType nCenter); - void MoveNode(int NewNodeID, double x, double y, double z); - void RemoveNode(int NodeID); - void RemoveElement(int ElementID); - void ChangeElementNodes(int ElementID, int nodes[], int nbnodes); - void ChangePolyhedronNodes(const int ElementID, - const std::vector& nodes_ids, + void MoveNode(smIdType NewNodeID, double x, double y, double z); + void RemoveNode(smIdType NodeID); + void RemoveElement(smIdType ElementID); + void ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes); + void ChangePolyhedronNodes(const smIdType ElementID, + const std::vector& nodes_ids, const std::vector& quantities); - void Renumber (const bool isNodes, const int startID, const int deltaID); + void Renumber (const bool isNodes, const smIdType startID, const smIdType deltaID); SMESHDS_CommandType GetType(); - int GetNumber(); - const std::list & GetIndexes(); + smIdType GetNumber(); + const std::list & GetIndexes(); const std::list & GetCoords(); ~SMESHDS_Command(); private: SMESHDS_CommandType myType; int myNumber; std::list myReals; - std::list myIntegers; + std::list myIntegers; }; #endif diff --git a/src/SMESHDS/SMESHDS_Group.cxx b/src/SMESHDS/SMESHDS_Group.cxx index 4554e5adc..6783d14bd 100644 --- a/src/SMESHDS/SMESHDS_Group.cxx +++ b/src/SMESHDS/SMESHDS_Group.cxx @@ -45,7 +45,7 @@ SMESHDS_Group::SMESHDS_Group (const int theID, //purpose : //======================================================================= -int SMESHDS_Group::Extent() const +smIdType SMESHDS_Group::Extent() const { return myGroup.Extent(); } @@ -66,7 +66,7 @@ bool SMESHDS_Group::IsEmpty() */ //============================================================================= -bool SMESHDS_Group::Contains (const int theID) +bool SMESHDS_Group::Contains (const smIdType theID) { const SMDS_MeshElement* aElem = findInMesh (theID); if (aElem) @@ -92,7 +92,7 @@ bool SMESHDS_Group::Contains (const SMDS_MeshElement* elem) */ //============================================================================= -bool SMESHDS_Group::Add (const int theID) +bool SMESHDS_Group::Add (const smIdType theID) { return Add( findInMesh( theID )); } @@ -121,7 +121,7 @@ bool SMESHDS_Group::Add (const SMDS_MeshElement* aElem ) */ //============================================================================= -bool SMESHDS_Group::Remove (const int theID) +bool SMESHDS_Group::Remove (const smIdType theID) { bool removed = false; if ( const SMDS_MeshElement* aElem = findInMesh( theID )) diff --git a/src/SMESHDS/SMESHDS_Group.hxx b/src/SMESHDS/SMESHDS_Group.hxx index c17705ab8..9fa9a7b48 100644 --- a/src/SMESHDS/SMESHDS_Group.hxx +++ b/src/SMESHDS/SMESHDS_Group.hxx @@ -46,11 +46,11 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase virtual void SetType(SMDSAbs_ElementType theType); - virtual int Extent() const; + virtual smIdType Extent() const; virtual bool IsEmpty(); - virtual bool Contains (const int theID); + virtual bool Contains (const smIdType theID); virtual bool Contains (const SMDS_MeshElement* elem); @@ -58,11 +58,11 @@ class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase virtual int GetTic() const; - bool Add (const int theID); + bool Add (const smIdType theID); bool Add (const SMDS_MeshElement* theElem ); - bool Remove (const int theID); + bool Remove (const smIdType theID); void Clear(); diff --git a/src/SMESHDS/SMESHDS_GroupBase.cxx b/src/SMESHDS/SMESHDS_GroupBase.cxx index 50ac2ee74..d594b9bfa 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.cxx +++ b/src/SMESHDS/SMESHDS_GroupBase.cxx @@ -55,7 +55,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int theID, */ //============================================================================= -int SMESHDS_GroupBase::GetID (const int theIndex) +smIdType SMESHDS_GroupBase::GetID (const int theIndex) { if (myCurIndex < 1 || myCurIndex > theIndex) { myIterator = GetElements(); @@ -75,7 +75,7 @@ int SMESHDS_GroupBase::GetID (const int theIndex) */ //============================================================================= -const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const int theID) const +const SMDS_MeshElement* SMESHDS_GroupBase::findInMesh (const smIdType theID) const { SMDSAbs_ElementType aType = GetType(); const SMDS_MeshElement* aElem = NULL; @@ -107,10 +107,10 @@ void SMESHDS_GroupBase::resetIterator() //purpose : //======================================================================= -int SMESHDS_GroupBase::Extent() const +smIdType SMESHDS_GroupBase::Extent() const { SMDS_ElemIteratorPtr it = GetElements(); - int nb = 0; + smIdType nb = 0; if ( it ) for ( ; it->more(); it->next() ) nb++; @@ -136,7 +136,7 @@ bool SMESHDS_GroupBase::IsEmpty() //purpose : //======================================================================= -bool SMESHDS_GroupBase::Contains (const int theID) +bool SMESHDS_GroupBase::Contains (const smIdType theID) { if ( SMDS_ElemIteratorPtr it = GetElements() ) { while ( it->more() ) diff --git a/src/SMESHDS/SMESHDS_GroupBase.hxx b/src/SMESHDS/SMESHDS_GroupBase.hxx index f08b8a289..c57fc95fb 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.hxx +++ b/src/SMESHDS/SMESHDS_GroupBase.hxx @@ -58,17 +58,17 @@ class SMESHDS_EXPORT SMESHDS_GroupBase const char* GetStoreName () const { return myStoreName.c_str(); } - virtual int Extent() const; + virtual smIdType Extent() const; virtual bool IsEmpty(); - virtual bool Contains (const int theID); + virtual bool Contains (const smIdType theID); virtual bool Contains (const SMDS_MeshElement* elem); virtual SMDS_ElemIteratorPtr GetElements() const = 0; - virtual int GetID (const int theIndex); + virtual smIdType GetID (const int theIndex); // DON'T use it for iterations 1..Extent() virtual int GetTic() const = 0; @@ -89,7 +89,7 @@ class SMESHDS_EXPORT SMESHDS_GroupBase { myDefaultColor = theColor;} protected: - const SMDS_MeshElement* findInMesh (const int theID) const; + const SMDS_MeshElement* findInMesh (const smIdType theID) const; void resetIterator(); private: @@ -105,8 +105,8 @@ class SMESHDS_EXPORT SMESHDS_GroupBase Quantity_Color myColor; // for GetID() - int myCurIndex; - int myCurID; + smIdType myCurIndex; + smIdType myCurID; SMDS_ElemIteratorPtr myIterator; static Quantity_Color myDefaultColor; diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx index 3d8f98fc9..1343f8864 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.cxx @@ -79,7 +79,7 @@ void SMESHDS_GroupOnFilter::SetPredicate( const SMESH_PredicatePtr& thePredicate */ //================================================================================ -int SMESHDS_GroupOnFilter::Extent() const +smIdType SMESHDS_GroupOnFilter::Extent() const { update(); return std::accumulate( myMeshInfo.begin(), myMeshInfo.end(), 0 ); @@ -120,7 +120,7 @@ bool SMESHDS_GroupOnFilter::IsEmpty() */ //================================================================================ -bool SMESHDS_GroupOnFilter::Contains (const int theID) +bool SMESHDS_GroupOnFilter::Contains (const smIdType theID) { return myPredicate && myPredicate->IsSatisfy( theID ); } @@ -288,7 +288,7 @@ SMDS_ElemIteratorPtr SMESHDS_GroupOnFilter::GetElements() const */ //================================================================================ -std::vector< int > SMESHDS_GroupOnFilter::GetMeshInfo() const +std::vector< smIdType > SMESHDS_GroupOnFilter::GetMeshInfo() const { update(); return myMeshInfo; @@ -315,7 +315,7 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const if ( IsUpToDate() ) { for ( ; elIt->more(); curID += idSize ) - (*(int*) curID) = elIt->next()->GetID(); + (*(smIdType*) curID) = elIt->next()->GetID(); } else { @@ -325,11 +325,11 @@ int SMESHDS_GroupOnFilter::getElementIds( void* ids, size_t idSize ) const me->myMeshInfo.assign( SMDSEntity_Last, 0 ); me->myMeshInfo[ firstOkElem->GetEntityType() ]++; - (*(int*) curID) = firstOkElem->GetID(); + (*(smIdType*) curID) = firstOkElem->GetID(); for ( curID += idSize; elIt->more(); curID += idSize ) { const SMDS_MeshElement* e = elIt->next(); - (*(int*) curID) = e->GetID(); + (*(smIdType*) curID) = e->GetID(); me->myMeshInfo[ e->GetEntityType() ]++; } } @@ -443,7 +443,7 @@ bool SMESHDS_GroupOnFilter::updateParallel() const return false; // no sense in parallel work SMDS_ElemIteratorPtr elemIt = GetMesh()->elementsIterator( GetType() ); - const int minID = elemIt->next()->GetID(); + const smIdType minID = elemIt->next()->GetID(); myPredicate->IsSatisfy( minID ); // make myPredicate fully initialized for clone() SMESH_PredicatePtr clone( myPredicate->clone() ); if ( !clone ) @@ -452,7 +452,7 @@ bool SMESHDS_GroupOnFilter::updateParallel() const TLocalPredicat threadPredicates; threadPredicates.local() = clone; - int maxID = ( GetType() == SMDSAbs_Node ) ? GetMesh()->MaxNodeID() : GetMesh()->MaxElementID(); + smIdType maxID = ( GetType() == SMDSAbs_Node ) ? GetMesh()->MaxNodeID() : GetMesh()->MaxElementID(); vector< char > isElemOK( 1 + maxID ); tbb::parallel_for ( tbb::blocked_range( 0, isElemOK.size() ), diff --git a/src/SMESHDS/SMESHDS_GroupOnFilter.hxx b/src/SMESHDS/SMESHDS_GroupOnFilter.hxx index 9b729bebd..887a0c1cf 100644 --- a/src/SMESHDS/SMESHDS_GroupOnFilter.hxx +++ b/src/SMESHDS/SMESHDS_GroupOnFilter.hxx @@ -47,20 +47,20 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme SMESH_PredicatePtr GetPredicate() const { return myPredicate; } - std::vector< int > GetMeshInfo() const; + std::vector< smIdType > GetMeshInfo() const; template< typename IDTYPE > - int GetElementIds( IDTYPE* ids ) const + smIdType GetElementIds( IDTYPE* ids ) const { return getElementIds( (void*)ids, sizeof(IDTYPE)); } - virtual int Extent() const; + virtual smIdType Extent() const; virtual bool IsEmpty(); - virtual bool Contains (const int theID); + virtual bool Contains (const smIdType theID); virtual bool Contains (const SMDS_MeshElement* elem); @@ -92,7 +92,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnFilter: public SMESHDS_GroupBase, SMDS_Eleme // 2) The case of enough free memory. Remember all OK elements (myElements). SMESH_PredicatePtr myPredicate; - std::vector< int > myMeshInfo; + std::vector< smIdType > myMeshInfo; std::vector< const SMDS_MeshElement*> myElements; bool myElementsOK; size_t myMeshModifTime; // when myMeshInfo was updated diff --git a/src/SMESHDS/SMESHDS_GroupOnGeom.cxx b/src/SMESHDS/SMESHDS_GroupOnGeom.cxx index 8107798c1..3e3d15fab 100644 --- a/src/SMESHDS/SMESHDS_GroupOnGeom.cxx +++ b/src/SMESHDS/SMESHDS_GroupOnGeom.cxx @@ -132,7 +132,7 @@ SMDS_ElemIteratorPtr SMESHDS_GroupOnGeom::GetElements() const //purpose : //======================================================================= -bool SMESHDS_GroupOnGeom::Contains (const int theID) +bool SMESHDS_GroupOnGeom::Contains (const smIdType theID) { return mySubMesh->Contains( findInMesh( theID )); } diff --git a/src/SMESHDS/SMESHDS_GroupOnGeom.hxx b/src/SMESHDS/SMESHDS_GroupOnGeom.hxx index 3ea23e1e7..e81e8d617 100644 --- a/src/SMESHDS/SMESHDS_GroupOnGeom.hxx +++ b/src/SMESHDS/SMESHDS_GroupOnGeom.hxx @@ -47,7 +47,7 @@ class SMESHDS_EXPORT SMESHDS_GroupOnGeom: public SMESHDS_GroupBase TopoDS_Shape GetShape() const { return myShape; } - virtual bool Contains (const int theID); + virtual bool Contains (const smIdType theID); virtual bool Contains (const SMDS_MeshElement* elem); diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index e7429e5a2..ae3322a8b 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -194,7 +194,7 @@ SMDS_MeshNode* SMESHDS_Mesh::AddNode(double x, double y, double z){ return node; } -SMDS_MeshNode* SMESHDS_Mesh::AddNodeWithID(double x, double y, double z, int ID){ +SMDS_MeshNode* SMESHDS_Mesh::AddNodeWithID(double x, double y, double z, smIdType ID){ SMDS_MeshNode* node = SMDS_Mesh::AddNodeWithID(x,y,z,ID); if(node!=NULL) myScript->AddNode(node->GetID(), x, y, z); return node; @@ -223,8 +223,8 @@ bool SMESHDS_Mesh::ChangeElementNodes(const SMDS_MeshElement * elem, if ( ! SMDS_Mesh::ChangeElementNodes( elem, nodes, nbnodes )) return false; - std::vector IDs( nbnodes ); - for ( int i = 0; i < nbnodes; i++ ) + std::vector IDs( nbnodes ); + for ( smIdType i = 0; i < nbnodes; i++ ) IDs [ i ] = nodes[ i ]->GetID(); myScript->ChangeElementNodes( elem->GetID(), &IDs[0], nbnodes); @@ -258,8 +258,8 @@ bool SMESHDS_Mesh if ( !SMDS_Mesh::ChangePolyhedronNodes( elem, nodes, quantities )) return false; - int i, len = nodes.size(); - std::vector nodes_ids (len); + smIdType i, len = nodes.size(); + std::vector nodes_ids (len); for (i = 0; i < len; i++) { nodes_ids[i] = nodes[i]->GetID(); } @@ -273,7 +273,7 @@ bool SMESHDS_Mesh //purpose : //======================================================================= -void SMESHDS_Mesh::Renumber (const bool /*isNodes*/, const int /*startID*/, const int /*deltaID*/) +void SMESHDS_Mesh::Renumber (const bool /*isNodes*/, const smIdType /*startID*/, const smIdType /*deltaID*/) { // TODO not possible yet to have node numbers not starting to O and continuous. if ( !this->IsCompacted() ) @@ -286,7 +286,7 @@ void SMESHDS_Mesh::Renumber (const bool /*isNodes*/, const int /*startID*/, cons //function : Add0DElement //purpose : //======================================================================= -SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID(int nodeID, int ID) +SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID(smIdType nodeID, smIdType ID) { SMDS_Mesh0DElement* anElem = SMDS_Mesh::Add0DElementWithID(nodeID, ID); if (anElem) myScript->Add0DElement(ID, nodeID); @@ -294,7 +294,7 @@ SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID(int nodeID, int ID) } SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElementWithID -(const SMDS_MeshNode * node, int ID) +(const SMDS_MeshNode * node, smIdType ID) { return Add0DElementWithID(node->GetID(), ID); } @@ -311,7 +311,7 @@ SMDS_Mesh0DElement* SMESHDS_Mesh::Add0DElement(const SMDS_MeshNode * node) //purpose : //======================================================================= -SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(int node, double diameter, int ID) +SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(smIdType node, double diameter, smIdType ID) { SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID); if (anElem) myScript->AddBall(anElem->GetID(), node, diameter); @@ -320,7 +320,7 @@ SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(int node, double diameter, int ID) SMDS_BallElement* SMESHDS_Mesh::AddBallWithID(const SMDS_MeshNode * node, double diameter, - int ID) + smIdType ID) { SMDS_BallElement* anElem = SMDS_Mesh::AddBallWithID(node,diameter,ID); if (anElem) myScript->AddBall(anElem->GetID(), node->GetID(), diameter); @@ -340,7 +340,7 @@ SMDS_BallElement* SMESHDS_Mesh::AddBall (const SMDS_MeshNode * node, //purpose : //======================================================================= -SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int ID) +SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(smIdType n1, smIdType n2, smIdType ID) { SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,ID); if(anElem) myScript->AddEdge(ID,n1,n2); @@ -349,7 +349,7 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int ID) SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, - int ID) + smIdType ID) { return AddEdgeWithID(n1->GetID(), n2->GetID(), @@ -370,7 +370,7 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdge(const SMDS_MeshNode * n1, //function :AddFace //purpose : //======================================================================= -SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int ID) +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1, n2, n3, ID); if(anElem) myScript->AddFace(ID,n1,n2,n3); @@ -380,7 +380,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int ID) SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, - int ID) + smIdType ID) { return AddFaceWithID(n1->GetID(), n2->GetID(), @@ -404,7 +404,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace( const SMDS_MeshNode * n1, //function :AddFace //purpose : //======================================================================= -SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, int ID) +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1, n2, n3, n4, ID); if(anElem) myScript->AddFace(ID, n1, n2, n3, n4); @@ -415,7 +415,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, - int ID) + smIdType ID) { return AddFaceWithID(n1->GetID(), n2->GetID(), @@ -442,7 +442,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function :AddVolume //purpose : //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, ID); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4); @@ -453,7 +453,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), @@ -480,7 +480,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function :AddVolume //purpose : //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, ID); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5); @@ -492,7 +492,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), @@ -522,7 +522,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function :AddVolume //purpose : //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType ID) { SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, ID); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6); @@ -535,7 +535,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5, const SMDS_MeshNode * n6, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), @@ -568,7 +568,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function :AddVolume //purpose : //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, smIdType ID) { SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, ID); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8); @@ -583,7 +583,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n6, const SMDS_MeshNode * n7, const SMDS_MeshNode * n8, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), @@ -623,10 +623,10 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function :AddVolume //purpose : add hexagonal prism //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n9, int n10, int n11, int n12, - int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n9, smIdType n10, smIdType n11, smIdType n12, + smIdType ID) { SMDS_MeshVolume *anElem= SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, ID); if(anElem) myScript->AddVolume(ID, n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12); @@ -645,7 +645,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n10, const SMDS_MeshNode * n11, const SMDS_MeshNode * n12, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), @@ -697,8 +697,8 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddPolygonalFace //purpose : //======================================================================= -SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector& nodes_ids, - const int ID) +SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector& nodes_ids, + const smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes_ids, ID); if (anElem) { @@ -709,12 +709,12 @@ SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector& nod SMDS_MeshFace* SMESHDS_Mesh::AddPolygonalFaceWithID (const std::vector& nodes, - const int ID) + const smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFaceWithID(nodes, ID); if (anElem) { - int i, len = nodes.size(); - std::vector nodes_ids (len); + smIdType i, len = nodes.size(); + std::vector nodes_ids (len); for (i = 0; i < len; i++) { nodes_ids[i] = nodes[i]->GetID(); } @@ -728,8 +728,8 @@ SMESHDS_Mesh::AddPolygonalFace (const std::vector& nodes) { SMDS_MeshFace *anElem = SMDS_Mesh::AddPolygonalFace(nodes); if (anElem) { - int i, len = nodes.size(); - std::vector nodes_ids (len); + smIdType i, len = nodes.size(); + std::vector nodes_ids (len); for (i = 0; i < len; i++) { nodes_ids[i] = nodes[i]->GetID(); } @@ -743,8 +743,8 @@ SMESHDS_Mesh::AddPolygonalFace (const std::vector& nodes) //function : AddQuadPolygonalFace //purpose : //======================================================================= -SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector& nodes_ids, - const int ID) +SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector& nodes_ids, + const smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes_ids, ID); if (anElem) { @@ -755,12 +755,12 @@ SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector& SMDS_MeshFace* SMESHDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector& nodes, - const int ID) + const smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFaceWithID(nodes, ID); if (anElem) { - int i, len = nodes.size(); - std::vector nodes_ids (len); + smIdType i, len = nodes.size(); + std::vector nodes_ids (len); for (i = 0; i < len; i++) { nodes_ids[i] = nodes[i]->GetID(); } @@ -774,8 +774,8 @@ SMESHDS_Mesh::AddQuadPolygonalFace (const std::vector& nod { SMDS_MeshFace *anElem = SMDS_Mesh::AddQuadPolygonalFace(nodes); if (anElem) { - int i, len = nodes.size(); - std::vector nodes_ids (len); + smIdType i, len = nodes.size(); + std::vector nodes_ids (len); for (i = 0; i < len; i++) { nodes_ids[i] = nodes[i]->GetID(); } @@ -789,9 +789,9 @@ SMESHDS_Mesh::AddQuadPolygonalFace (const std::vector& nod //function : AddPolyhedralVolume //purpose : //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector& nodes_ids, - const std::vector& quantities, - const int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector& nodes_ids, + const std::vector& quantities, + const smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes_ids, quantities, ID); if (anElem) { @@ -803,12 +803,12 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolumeWithID (const std::vector& nodes, const std::vector& quantities, - const int ID) + const smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolumeWithID(nodes, quantities, ID); if (anElem) { - int i, len = nodes.size(); - std::vector nodes_ids (len); + smIdType i, len = nodes.size(); + std::vector nodes_ids (len); for (i = 0; i < len; i++) { nodes_ids[i] = nodes[i]->GetID(); } @@ -823,8 +823,8 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddPolyhedralVolume { SMDS_MeshVolume *anElem = SMDS_Mesh::AddPolyhedralVolume(nodes, quantities); if (anElem) { - int i, len = nodes.size(); - std::vector nodes_ids (len); + smIdType i, len = nodes.size(); + std::vector nodes_ids (len); for (i = 0; i < len; i++) { nodes_ids[i] = nodes[i]->GetID(); } @@ -1489,7 +1489,7 @@ SMESHDS_Mesh::~SMESHDS_Mesh() //function : AddEdgeWithID //purpose : //======================================================================= -SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(int n1, int n2, int n12, int ID) +SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(smIdType n1, smIdType n2, smIdType n12, smIdType ID) { SMDS_MeshEdge* anElem = SMDS_Mesh::AddEdgeWithID(n1,n2,n12,ID); if(anElem) myScript->AddEdge(ID,n1,n2,n12); @@ -1519,7 +1519,7 @@ SMDS_MeshEdge* SMESHDS_Mesh::AddEdge(const SMDS_MeshNode* n1, SMDS_MeshEdge* SMESHDS_Mesh::AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n12, - int ID) + smIdType ID) { return AddEdgeWithID(n1->GetID(), n2->GetID(), @@ -1550,8 +1550,8 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function : AddFaceWithID //purpose : //======================================================================= -SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, - int n12,int n23,int n31, int ID) +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n12,smIdType n23,smIdType n31, smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,ID); if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31); @@ -1568,7 +1568,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n12, const SMDS_MeshNode * n23, const SMDS_MeshNode * n31, - int ID) + smIdType ID) { return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n12->GetID(), n23->GetID(), n31->GetID(), @@ -1599,8 +1599,8 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function : AddFaceWithID //purpose : //======================================================================= -SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, - int n12,int n23,int n31, int nCenter, int ID) +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n12,n23,n31,nCenter,ID); if(anElem) myScript->AddFace(ID,n1,n2,n3,n12,n23,n31,nCenter); @@ -1618,7 +1618,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n23, const SMDS_MeshNode * n31, const SMDS_MeshNode * nCenter, - int ID) + smIdType ID) { return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n12->GetID(), n23->GetID(), n31->GetID(), @@ -1650,8 +1650,8 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function : AddFaceWithID //purpose : //======================================================================= -SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n34,int n41, int ID) +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,ID); if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41); @@ -1670,7 +1670,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n23, const SMDS_MeshNode * n34, const SMDS_MeshNode * n41, - int ID) + smIdType ID) { return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), @@ -1704,9 +1704,9 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFace(const SMDS_MeshNode * n1, //function : AddFaceWithID //purpose : //======================================================================= -SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n34,int n41, - int nCenter, int ID) +SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType nCenter, smIdType ID) { SMDS_MeshFace *anElem = SMDS_Mesh::AddFaceWithID(n1,n2,n3,n4,n12,n23,n34,n41,nCenter,ID); if(anElem) myScript->AddFace(ID,n1,n2,n3,n4,n12,n23,n34,n41,nCenter); @@ -1726,7 +1726,7 @@ SMDS_MeshFace* SMESHDS_Mesh::AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n34, const SMDS_MeshNode * n41, const SMDS_MeshNode * nCenter, - int ID) + smIdType ID) { return AddFaceWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), n12->GetID(), n23->GetID(), n34->GetID(), n41->GetID(), @@ -1761,9 +1761,9 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n31, - int n14,int n24,int n34, int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n31, + smIdType n14,smIdType n24,smIdType n34, smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n12,n23, n31,n14,n24,n34,ID); @@ -1785,7 +1785,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n14, const SMDS_MeshNode * n24, const SMDS_MeshNode * n34, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), n12->GetID(), n23->GetID(), n31->GetID(), @@ -1825,9 +1825,9 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, - int n12,int n23,int n34,int n41, - int n15,int n25,int n35,int n45, int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n15,smIdType n25,smIdType n35,smIdType n45, smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5, n12,n23,n34,n41, @@ -1854,7 +1854,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n25, const SMDS_MeshNode * n35, const SMDS_MeshNode * n45, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), n5->GetID(), @@ -1899,11 +1899,11 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : 2nd order pentahedron (prism) with 15 nodes //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, - int n4, int n5, int n6, - int n12,int n23,int n31, - int n45,int n56,int n64, - int n14,int n25,int n36, int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12,smIdType n23,smIdType n31, + smIdType n45,smIdType n56,smIdType n64, + smIdType n14,smIdType n25,smIdType n36, smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6, n12,n23,n31, @@ -1933,7 +1933,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n14, const SMDS_MeshNode * n25, const SMDS_MeshNode * n36, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), n5->GetID(), n6->GetID(), @@ -1982,13 +1982,13 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : 2nd order pentahedron (prism) with 18 nodes //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, - int n4, int n5, int n6, - int n12,int n23,int n31, - int n45,int n56,int n64, - int n14,int n25,int n36, - int n1245, int n2356, int n1346, - int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12,smIdType n23,smIdType n31, + smIdType n45,smIdType n56,smIdType n64, + smIdType n14,smIdType n25,smIdType n36, + smIdType n1245, smIdType n2356, smIdType n1346, + smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6, n12,n23,n31, @@ -2022,7 +2022,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n1245, const SMDS_MeshNode * n2356, const SMDS_MeshNode * n1346, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), n5->GetID(), n6->GetID(), @@ -2076,11 +2076,11 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, //function : AddVolumeWithID //purpose : //======================================================================= -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12,int n23,int n34,int n41, - int n56,int n67,int n78,int n85, - int n15,int n26,int n37,int n48, int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n56,smIdType n67,smIdType n78,smIdType n85, + smIdType n15,smIdType n26,smIdType n37,smIdType n48, smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8, n12,n23,n34,n41, @@ -2115,7 +2115,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n26, const SMDS_MeshNode * n37, const SMDS_MeshNode * n48, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(), @@ -2175,14 +2175,14 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1, return anElem; } -SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12,int n23,int n34,int n41, - int n56,int n67,int n78,int n85, - int n15,int n26,int n37,int n48, - int n1234,int n1256,int n2367,int n3478, - int n1458,int n5678,int nCenter, - int ID) +SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n56,smIdType n67,smIdType n78,smIdType n85, + smIdType n15,smIdType n26,smIdType n37,smIdType n48, + smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478, + smIdType n1458,smIdType n5678,smIdType nCenter, + smIdType ID) { SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,n7,n8, n12,n23,n34,n41, @@ -2225,7 +2225,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n1458, const SMDS_MeshNode * n5678, const SMDS_MeshNode * nCenter, - int ID) + smIdType ID) { return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(), n4->GetID(), n5->GetID(), n6->GetID(), n7->GetID(), n8->GetID(), @@ -2262,7 +2262,7 @@ void SMESHDS_Mesh::BuildDownWardConnectivity(bool withEdges) * @param localClonedNodeIds map old node id to new node id. * @return ok if success. */ -bool SMESHDS_Mesh::ModifyCellNodes(int vtkVolId, std::map localClonedNodeIds) +bool SMESHDS_Mesh::ModifyCellNodes(vtkIdType vtkVolId, std::map localClonedNodeIds) { myGrid->ModifyCellNodes(vtkVolId, localClonedNodeIds); return true; diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index cc31bda83..b7e0f1f1b 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -77,64 +77,64 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh bool AddHypothesis(const TopoDS_Shape & SS, const SMESHDS_Hypothesis * H); bool RemoveHypothesis(const TopoDS_Shape & S, const SMESHDS_Hypothesis * H); - virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, int ID); + virtual SMDS_MeshNode* AddNodeWithID(double x, double y, double z, smIdType ID); virtual SMDS_MeshNode* AddNode(double x, double y, double z); - virtual SMDS_Mesh0DElement* Add0DElementWithID(int nodeID, int ID); - virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * node, int ID); + virtual SMDS_Mesh0DElement* Add0DElementWithID(smIdType nodeID, smIdType ID); + virtual SMDS_Mesh0DElement* Add0DElementWithID(const SMDS_MeshNode * node, smIdType ID); virtual SMDS_Mesh0DElement* Add0DElement (const SMDS_MeshNode * node); - virtual SMDS_BallElement* AddBallWithID(int n, double diameter, int ID); - virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, int ID); + virtual SMDS_BallElement* AddBallWithID(smIdType n, double diameter, smIdType ID); + virtual SMDS_BallElement* AddBallWithID(const SMDS_MeshNode * n, double diameter, smIdType ID); virtual SMDS_BallElement* AddBall (const SMDS_MeshNode * n, double diameter); - virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID); + virtual SMDS_MeshEdge* AddEdgeWithID(smIdType n1, smIdType n2, smIdType ID); virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, - int ID); + smIdType ID); virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2); // 2d order edge with 3 nodes: n12 - node between n1 and n2 - virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID); + virtual SMDS_MeshEdge* AddEdgeWithID(smIdType n1, smIdType n2, smIdType n12, smIdType ID); virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n12, - int ID); + smIdType ID); virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n12); // tria 3 - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3); // quad 4 - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4); // 2d order triangle of 6 nodes - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, - int n12,int n23,int n31, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n12,smIdType n23,smIdType n31, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n12, const SMDS_MeshNode * n23, const SMDS_MeshNode * n31, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -143,8 +143,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n31); // biquadratic triangle of 7 nodes - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, - int n12,int n23,int n31, int nCenter, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n12,smIdType n23,smIdType n31, smIdType nCenter, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -152,7 +152,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n23, const SMDS_MeshNode * n31, const SMDS_MeshNode * nCenter, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -162,8 +162,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * nCenter); // 2d order quadrangle - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n34,int n41, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -172,7 +172,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n23, const SMDS_MeshNode * n34, const SMDS_MeshNode * n41, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -183,8 +183,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n41); // biquadratic quadrangle of 9 nodes - virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n34,int n41, int nCenter, int ID); + virtual SMDS_MeshFace* AddFaceWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, smIdType nCenter, smIdType ID); virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -194,7 +194,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n34, const SMDS_MeshNode * n41, const SMDS_MeshNode * nCenter, - int ID); + smIdType ID); virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -205,38 +205,38 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n41, const SMDS_MeshNode * nCenter); // tetra 4 - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4); // pyra 5 - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5); // penta 6 - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, const SMDS_MeshNode * n4, const SMDS_MeshNode * n5, const SMDS_MeshNode * n6, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -244,7 +244,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n5, const SMDS_MeshNode * n6); // hexa 8 - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, int n7, int n8, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -253,7 +253,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n6, const SMDS_MeshNode * n7, const SMDS_MeshNode * n8, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -263,8 +263,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n7, const SMDS_MeshNode * n8); // hexagonal prism of 12 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, int n6, - int n7, int n8, int n9, int n10, int n11, int n12, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, smIdType n6, + smIdType n7, smIdType n8, smIdType n9, smIdType n10, smIdType n11, smIdType n12, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -277,7 +277,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n10, const SMDS_MeshNode * n11, const SMDS_MeshNode * n12, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -292,9 +292,9 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n12); // 2d order tetrahedron of 10 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n12,int n23,int n31, - int n14,int n24,int n34, int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12,smIdType n23,smIdType n31, + smIdType n14,smIdType n24,smIdType n34, smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -305,7 +305,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n14, const SMDS_MeshNode * n24, const SMDS_MeshNode * n34, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -318,10 +318,10 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n34); // 2d order pyramid of 13 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int n5, - int n12,int n23,int n34,int n41, - int n15,int n25,int n35,int n45, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n15,smIdType n25,smIdType n35,smIdType n45, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -335,7 +335,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n25, const SMDS_MeshNode * n35, const SMDS_MeshNode * n45, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -351,12 +351,12 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n45); // 2d order Pentahedron with 15 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, - int n4, int n5, int n6, - int n12,int n23,int n31, - int n45,int n56,int n64, - int n14,int n25,int n36, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12,smIdType n23,smIdType n31, + smIdType n45,smIdType n56,smIdType n64, + smIdType n14,smIdType n25,smIdType n36, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -372,7 +372,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n14, const SMDS_MeshNode * n25, const SMDS_MeshNode * n36, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -390,13 +390,13 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n36); // 2d order Pentahedron with 18 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, - int n4, int n5, int n6, - int n12,int n23,int n31, - int n45,int n56,int n64, - int n14,int n25,int n36, - int n1245, int n2356, int n1346, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12,smIdType n23,smIdType n31, + smIdType n45,smIdType n56,smIdType n64, + smIdType n14,smIdType n25,smIdType n36, + smIdType n1245, smIdType n2356, smIdType n1346, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -415,7 +415,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n1245, const SMDS_MeshNode * n2356, const SMDS_MeshNode * n1346, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -436,12 +436,12 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n1346); // 2d order Hexahedrons with 20 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12,int n23,int n34,int n41, - int n56,int n67,int n78,int n85, - int n15,int n26,int n37,int n48, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n56,smIdType n67,smIdType n78,smIdType n85, + smIdType n15,smIdType n26,smIdType n37,smIdType n48, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -462,7 +462,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n26, const SMDS_MeshNode * n37, const SMDS_MeshNode * n48, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -485,14 +485,14 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n48); // 2d order Hexahedrons with 27 nodes - virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12,int n23,int n34,int n41, - int n56,int n67,int n78,int n85, - int n15,int n26,int n37,int n48, - int n1234,int n1256,int n2367,int n3478, - int n1458,int n5678,int nCenter, - int ID); + virtual SMDS_MeshVolume* AddVolumeWithID(smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12,smIdType n23,smIdType n34,smIdType n41, + smIdType n56,smIdType n67,smIdType n78,smIdType n85, + smIdType n15,smIdType n26,smIdType n37,smIdType n48, + smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478, + smIdType n1458,smIdType n5678,smIdType nCenter, + smIdType ID); virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -520,7 +520,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n1458, const SMDS_MeshNode * n5678, const SMDS_MeshNode * nCenter, - int ID); + smIdType ID); virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1, const SMDS_MeshNode * n2, const SMDS_MeshNode * n3, @@ -549,31 +549,31 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh const SMDS_MeshNode * n5678, const SMDS_MeshNode * nCenter); - virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector& nodes_ids, - const int ID); + virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector& nodes_ids, + const smIdType ID); virtual SMDS_MeshFace* AddPolygonalFaceWithID (const std::vector& nodes, - const int ID); + const smIdType ID); virtual SMDS_MeshFace* AddPolygonalFace (const std::vector& nodes); - virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector & nodes_ids, - const int ID); + virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector & nodes_ids, + const smIdType ID); virtual SMDS_MeshFace* AddQuadPolygonalFaceWithID(const std::vector & nodes, - const int ID); + const smIdType ID); virtual SMDS_MeshFace* AddQuadPolygonalFace(const std::vector & nodes); virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID - (const std::vector& nodes_ids, - const std::vector& quantities, - const int ID); + (const std::vector& nodes_ids, + const std::vector& quantities, + const smIdType ID); virtual SMDS_MeshVolume* AddPolyhedralVolumeWithID (const std::vector& nodes, const std::vector& quantities, - const int ID); + const smIdType ID); virtual SMDS_MeshVolume* AddPolyhedralVolume (const std::vector& nodes, @@ -600,8 +600,8 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh bool ChangePolyhedronNodes(const SMDS_MeshElement * elem, const std::vector& nodes, const std::vector& quantities); - bool ModifyCellNodes(int smdsVolId, std::map localClonedNodeIds); - void Renumber (const bool isNodes, const int startID=1, const int deltaID=1); + bool ModifyCellNodes(vtkIdType smdsVolId, std::map localClonedNodeIds); + void Renumber (const bool isNodes, const smIdType startID=1, const smIdType deltaID=1); void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Shell & S); void SetNodeInVolume(const SMDS_MeshNode * aNode, const TopoDS_Solid & S); @@ -641,7 +641,7 @@ class SMESHDS_EXPORT SMESHDS_Mesh : public SMDS_Mesh // Groups. SMESHDS_Mesh is not an owner of groups void AddGroup (SMESHDS_GroupBase* theGroup) { myGroups.insert(theGroup); } void RemoveGroup (SMESHDS_GroupBase* theGroup) { myGroups.erase(theGroup); } - int GetNbGroups() const { return myGroups.size(); } + size_t GetNbGroups() const { return myGroups.size(); } const std::set& GetGroups() const { return myGroups; } bool IsGroupOfSubShapes (const TopoDS_Shape& aSubShape) const; diff --git a/src/SMESHDS/SMESHDS_Script.cxx b/src/SMESHDS/SMESHDS_Script.cxx index 1250ddcf9..a30aa8de3 100644 --- a/src/SMESHDS/SMESHDS_Script.cxx +++ b/src/SMESHDS/SMESHDS_Script.cxx @@ -89,7 +89,7 @@ SMESHDS_Command* SMESHDS_Script::getCommand(const SMESHDS_CommandType aType) //function : //purpose : //======================================================================= -void SMESHDS_Script::AddNode(int NewNodeID, double x, double y, double z) +void SMESHDS_Script::AddNode(smIdType NewNodeID, double x, double y, double z) { if(myIsEmbeddedMode){ myIsModified = true; @@ -102,7 +102,7 @@ void SMESHDS_Script::AddNode(int NewNodeID, double x, double y, double z) //function : //purpose : //======================================================================= -void SMESHDS_Script::Add0DElement (int New0DElementID, int idnode) +void SMESHDS_Script::Add0DElement (smIdType New0DElementID, smIdType idnode) { if (myIsEmbeddedMode) { myIsModified = true; @@ -115,7 +115,7 @@ void SMESHDS_Script::Add0DElement (int New0DElementID, int idnode) //function : //purpose : //======================================================================= -void SMESHDS_Script::AddEdge(int NewEdgeID, int idnode1, int idnode2) +void SMESHDS_Script::AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2) { if(myIsEmbeddedMode){ myIsModified = true; @@ -128,8 +128,8 @@ void SMESHDS_Script::AddEdge(int NewEdgeID, int idnode1, int idnode2) //function : //purpose : //======================================================================= -void SMESHDS_Script::AddFace(int NewFaceID, - int idnode1, int idnode2, int idnode3) +void SMESHDS_Script::AddFace(smIdType NewFaceID, + smIdType idnode1, smIdType idnode2, smIdType idnode3) { if(myIsEmbeddedMode){ myIsModified = true; @@ -143,9 +143,9 @@ void SMESHDS_Script::AddFace(int NewFaceID, //function : //purpose : //======================================================================= -void SMESHDS_Script::AddFace(int NewFaceID, - int idnode1, int idnode2, - int idnode3, int idnode4) +void SMESHDS_Script::AddFace(smIdType NewFaceID, + smIdType idnode1, smIdType idnode2, + smIdType idnode3, smIdType idnode4) { if(myIsEmbeddedMode){ myIsModified = true; @@ -160,9 +160,9 @@ void SMESHDS_Script::AddFace(int NewFaceID, //function : //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewID, - int idnode1, int idnode2, - int idnode3, int idnode4) +void SMESHDS_Script::AddVolume(smIdType NewID, + smIdType idnode1, smIdType idnode2, + smIdType idnode3, smIdType idnode4) { if(myIsEmbeddedMode){ myIsModified = true; @@ -177,9 +177,9 @@ void SMESHDS_Script::AddVolume(int NewID, //function : //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewID, - int idnode1, int idnode2, - int idnode3, int idnode4, int idnode5) +void SMESHDS_Script::AddVolume(smIdType NewID, + smIdType idnode1, smIdType idnode2, + smIdType idnode3, smIdType idnode4, smIdType idnode5) { if(myIsEmbeddedMode){ myIsModified = true; @@ -194,9 +194,9 @@ void SMESHDS_Script::AddVolume(int NewID, //function : //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewID, - int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6) +void SMESHDS_Script::AddVolume(smIdType NewID, + smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6) { if(myIsEmbeddedMode){ myIsModified = true; @@ -211,9 +211,9 @@ void SMESHDS_Script::AddVolume(int NewID, //function : //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewID, - int idnode1, int idnode2, int idnode3, int idnode4, - int idnode5, int idnode6, int idnode7, int idnode8) +void SMESHDS_Script::AddVolume(smIdType NewID, + smIdType idnode1, smIdType idnode2, smIdType idnode3, smIdType idnode4, + smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8) { if(myIsEmbeddedMode){ myIsModified = true; @@ -228,9 +228,9 @@ void SMESHDS_Script::AddVolume(int NewID, //function : //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, - int idnode9, int idnode10, int idnode11, int idnode12) +void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8, + smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12) { if(myIsEmbeddedMode){ myIsModified = true; @@ -246,7 +246,7 @@ void SMESHDS_Script::AddVolume(int NewVolID, int idnode1, int idnode2, int idnod //function : AddPolygonalFace //purpose : //======================================================================= -void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector& nodes_ids) +void SMESHDS_Script::AddPolygonalFace (smIdType NewFaceID, const std::vector& nodes_ids) { if(myIsEmbeddedMode){ myIsModified = true; @@ -259,7 +259,7 @@ void SMESHDS_Script::AddPolygonalFace (int NewFaceID, const std::vector& no //function : AddQuadPolygonalFace //purpose : //======================================================================= -void SMESHDS_Script::AddQuadPolygonalFace(int NewFaceID, const std::vector& nodes_ids) +void SMESHDS_Script::AddQuadPolygonalFace(smIdType NewFaceID, const std::vector& nodes_ids) { if(myIsEmbeddedMode){ myIsModified = true; @@ -272,9 +272,9 @@ void SMESHDS_Script::AddQuadPolygonalFace(int NewFaceID, const std::vector& //function : AddPolyhedralVolume //purpose : //======================================================================= -void SMESHDS_Script::AddPolyhedralVolume (int NewID, - const std::vector& nodes_ids, - const std::vector& quantities) +void SMESHDS_Script::AddPolyhedralVolume (smIdType NewID, + const std::vector& nodes_ids, + const std::vector& quantities) { if(myIsEmbeddedMode){ myIsModified = true; @@ -289,7 +289,7 @@ void SMESHDS_Script::AddPolyhedralVolume (int NewID, //purpose : Record adding a Ball //======================================================================= -void SMESHDS_Script::AddBall(int NewBallID, int node, double diameter) +void SMESHDS_Script::AddBall(smIdType NewBallID, smIdType node, double diameter) { if ( myIsEmbeddedMode ) myIsModified = true; @@ -301,7 +301,7 @@ void SMESHDS_Script::AddBall(int NewBallID, int node, double diameter) //function : //purpose : //======================================================================= -void SMESHDS_Script::MoveNode(int NewNodeID, double x, double y, double z) +void SMESHDS_Script::MoveNode(smIdType NewNodeID, double x, double y, double z) { if(myIsEmbeddedMode){ myIsModified = true; @@ -314,7 +314,7 @@ void SMESHDS_Script::MoveNode(int NewNodeID, double x, double y, double z) //function : //purpose : //======================================================================= -void SMESHDS_Script::RemoveNode(int ID) +void SMESHDS_Script::RemoveNode(smIdType ID) { if(myIsEmbeddedMode){ myIsModified = true; @@ -327,7 +327,7 @@ void SMESHDS_Script::RemoveNode(int ID) //function : //purpose : //======================================================================= -void SMESHDS_Script::RemoveElement(int ElementID) +void SMESHDS_Script::RemoveElement(smIdType ElementID) { if(myIsEmbeddedMode){ myIsModified = true; @@ -341,7 +341,7 @@ void SMESHDS_Script::RemoveElement(int ElementID) //purpose : //======================================================================= -void SMESHDS_Script::ChangeElementNodes(int ElementID, int nodes[], int nbnodes) +void SMESHDS_Script::ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes) { if(myIsEmbeddedMode){ myIsModified = true; @@ -354,8 +354,8 @@ void SMESHDS_Script::ChangeElementNodes(int ElementID, int nodes[], int nbnodes) //function : ChangePolyhedronNodes //purpose : //======================================================================= -void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID, - const std::vector& nodes_ids, +void SMESHDS_Script::ChangePolyhedronNodes (const smIdType ElementID, + const std::vector& nodes_ids, const std::vector& quantities) { if(myIsEmbeddedMode){ @@ -370,7 +370,7 @@ void SMESHDS_Script::ChangePolyhedronNodes (const int ElementID, //function : Renumber //purpose : //======================================================================= -void SMESHDS_Script::Renumber (const bool isNodes, const int startID, const int deltaID) +void SMESHDS_Script::Renumber (const bool isNodes, const smIdType startID, const smIdType deltaID) { if(myIsEmbeddedMode){ myIsModified = true; @@ -424,7 +424,7 @@ const list& SMESHDS_Script::GetCommands() //function : AddEdge //purpose : //======================================================================= -void SMESHDS_Script::AddEdge(int NewEdgeID, int n1, int n2, int n12) +void SMESHDS_Script::AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12) { if(myIsEmbeddedMode){ myIsModified = true; @@ -437,8 +437,8 @@ void SMESHDS_Script::AddEdge(int NewEdgeID, int n1, int n2, int n12) //function : AddFace //purpose : //======================================================================= -void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, - int n12, int n23, int n31) +void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, + smIdType n12, smIdType n23, smIdType n31) { if(myIsEmbeddedMode){ myIsModified = true; @@ -452,8 +452,8 @@ void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, //function : AddFace //purpose : //======================================================================= -void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, - int n12, int n23, int n31, int nCenter) +void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, + smIdType n12, smIdType n23, smIdType n31, smIdType nCenter) { if(myIsEmbeddedMode){ myIsModified = true; @@ -467,8 +467,8 @@ void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, //function : AddFace //purpose : //======================================================================= -void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4, - int n12, int n23, int n34, int n41) +void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n34, smIdType n41) { if(myIsEmbeddedMode){ myIsModified = true; @@ -482,8 +482,8 @@ void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4, //function : AddFace //purpose : //======================================================================= -void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4, - int n12, int n23, int n34, int n41, int nCenter) +void SMESHDS_Script::AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter) { if(myIsEmbeddedMode){ myIsModified = true; @@ -497,9 +497,9 @@ void SMESHDS_Script::AddFace(int NewFaceID, int n1, int n2, int n3, int n4, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n12, int n23, int n31, - int n14, int n24, int n34) +void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n31, + smIdType n14, smIdType n24, smIdType n34) { if(myIsEmbeddedMode){ myIsModified = true; @@ -514,9 +514,9 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n5, int n12, int n23, int n34, int n41, - int n15, int n25, int n35, int n45) +void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n15, smIdType n25, smIdType n35, smIdType n45) { if(myIsEmbeddedMode){ myIsModified = true; @@ -531,10 +531,10 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n5,int n6, int n12, int n23, int n31, - int n45, int n56, int n64, - int n14, int n25, int n36) +void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5,smIdType n6, smIdType n12, smIdType n23, smIdType n31, + smIdType n45, smIdType n56, smIdType n64, + smIdType n14, smIdType n25, smIdType n36) { if(myIsEmbeddedMode){ myIsModified = true; @@ -550,11 +550,11 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n5,int n6, int n12, int n23, int n31, - int n45, int n56, int n64, - int n14, int n25, int n36, - int n1245, int n2356, int n1346) +void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5,smIdType n6, smIdType n12, smIdType n23, smIdType n31, + smIdType n45, smIdType n56, smIdType n64, + smIdType n14, smIdType n25, smIdType n36, + smIdType n1245, smIdType n2356, smIdType n1346) { if(myIsEmbeddedMode){ myIsModified = true; @@ -571,11 +571,11 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, - int n4, int n5, int n6, int n7, int n8, - int n12, int n23, int n34, int n41, - int n56, int n67, int n78, int n85, - int n15, int n26, int n37, int n48) +void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n56, smIdType n67, smIdType n78, smIdType n85, + smIdType n15, smIdType n26, smIdType n37, smIdType n48) { if(myIsEmbeddedMode){ myIsModified = true; @@ -592,13 +592,13 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, //function : AddVolume //purpose : //======================================================================= -void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, - int n4, int n5, int n6, int n7, int n8, - int n12, int n23, int n34, int n41, - int n56, int n67, int n78, int n85, - int n15, int n26, int n37, int n48, - int n1234,int n1256,int n2367,int n3478, - int n1458,int n5678,int nCenter) +void SMESHDS_Script::AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n56, smIdType n67, smIdType n78, smIdType n85, + smIdType n15, smIdType n26, smIdType n37, smIdType n48, + smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478, + smIdType n1458,smIdType n5678,smIdType nCenter) { if(myIsEmbeddedMode){ myIsModified = true; diff --git a/src/SMESHDS/SMESHDS_Script.hxx b/src/SMESHDS/SMESHDS_Script.hxx index 0bf0f8626..a50d919fe 100644 --- a/src/SMESHDS/SMESHDS_Script.hxx +++ b/src/SMESHDS/SMESHDS_Script.hxx @@ -31,6 +31,8 @@ #include "SMESHDS_Command.hxx" +#include + #include #include @@ -44,79 +46,79 @@ class SMESHDS_EXPORT SMESHDS_Script void SetModified(bool theModified); bool IsModified(); - void AddNode(int NewNodeID, double x, double y, double z); - void Add0DElement(int New0DElementID, int idnode); - void AddEdge(int NewEdgeID, int idnode1, int idnode2); - void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3); - void AddFace(int NewFaceID, int idnode1, int idnode2, int idnode3, - int idnode4); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6, int idnode7, int idnode8); - void AddVolume(int NewVolID, int idnode1, int idnode2, int idnode3, - int idnode4, int idnode5, int idnode6, int idnode7, int idnode8, - int idnode9, int idnode10, int idnode11, int idnode12); + void AddNode(smIdType NewNodeID, double x, double y, double z); + void Add0DElement(smIdType New0DElementID, smIdType idnode); + void AddEdge(smIdType NewEdgeID, smIdType idnode1, smIdType idnode2); + void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3); + void AddFace(smIdType NewFaceID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8); + void AddVolume(smIdType NewVolID, smIdType idnode1, smIdType idnode2, smIdType idnode3, + smIdType idnode4, smIdType idnode5, smIdType idnode6, smIdType idnode7, smIdType idnode8, + smIdType idnode9, smIdType idnode10, smIdType idnode11, smIdType idnode12); - void AddPolygonalFace (const int NewFaceID, - const std::vector& nodes_ids); - void AddQuadPolygonalFace (const int NewFaceID, - const std::vector& nodes_ids); - void AddPolyhedralVolume (const int NewVolID, - const std::vector& nodes_ids, - const std::vector& quantities); - void AddBall(int NewBallID, int node, double diameter); + void AddPolygonalFace (const smIdType NewFaceID, + const std::vector& nodes_ids); + void AddQuadPolygonalFace (const smIdType NewFaceID, + const std::vector& nodes_ids); + void AddPolyhedralVolume (const smIdType NewVolID, + const std::vector& nodes_ids, + const std::vector& quantities); + void AddBall(smIdType NewBallID, smIdType node, double diameter); // special methods for quadratic elements - void AddEdge(int NewEdgeID, int n1, int n2, int n12); - void AddFace(int NewFaceID, int n1, int n2, int n3, - int n12, int n23, int n31); - void AddFace(int NewFaceID, int n1, int n2, int n3, - int n12, int n23, int n31, int nCenter); - void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, - int n12, int n23, int n34, int n41); - void AddFace(int NewFaceID, int n1, int n2, int n3, int n4, - int n12, int n23, int n34, int n41, int nCenter); - void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n12, int n23, int n31, int n14, int n24, int n34); - void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, int n5, - int n12, int n23, int n34, int n41, - int n15, int n25, int n35, int n45); - void AddVolume(int NewVolID, int n1, int n2, int n3, - int n4, int n5, int n6, - int n12, int n23, int n31, - int n45, int n56, int n64, - int n14, int n25, int n36); - void AddVolume(int NewVolID, int n1, int n2, int n3, - int n4, int n5, int n6, - int n12, int n23, int n31, - int n45, int n56, int n64, - int n14, int n25, int n36, - int n1245, int n2356, int n1346); - void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12, int n23, int n34, int n41, - int n56, int n67, int n78, int n85, - int n15, int n26, int n37, int n48); - void AddVolume(int NewVolID, int n1, int n2, int n3, int n4, - int n5, int n6, int n7, int n8, - int n12, int n23, int n34, int n41, - int n56, int n67, int n78, int n85, - int n15, int n26, int n37, int n48, - int n1234,int n1256,int n2367,int n3478, - int n1458,int n5678,int nCenter); - void MoveNode(int NewNodeID, double x, double y, double z); - void RemoveNode(int NodeID); - void RemoveElement(int ElementID); - void ChangeElementNodes(int ElementID, int nodes[], int nbnodes); - void ChangePolyhedronNodes(const int ElementID, - const std::vector& nodes_ids, + void AddEdge(smIdType NewEdgeID, smIdType n1, smIdType n2, smIdType n12); + void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, + smIdType n12, smIdType n23, smIdType n31); + void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, + smIdType n12, smIdType n23, smIdType n31, smIdType nCenter); + void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n34, smIdType n41); + void AddFace(smIdType NewFaceID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, smIdType nCenter); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n12, smIdType n23, smIdType n31, smIdType n14, smIdType n24, smIdType n34); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, smIdType n5, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n15, smIdType n25, smIdType n35, smIdType n45); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12, smIdType n23, smIdType n31, + smIdType n45, smIdType n56, smIdType n64, + smIdType n14, smIdType n25, smIdType n36); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, + smIdType n4, smIdType n5, smIdType n6, + smIdType n12, smIdType n23, smIdType n31, + smIdType n45, smIdType n56, smIdType n64, + smIdType n14, smIdType n25, smIdType n36, + smIdType n1245, smIdType n2356, smIdType n1346); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n56, smIdType n67, smIdType n78, smIdType n85, + smIdType n15, smIdType n26, smIdType n37, smIdType n48); + void AddVolume(smIdType NewVolID, smIdType n1, smIdType n2, smIdType n3, smIdType n4, + smIdType n5, smIdType n6, smIdType n7, smIdType n8, + smIdType n12, smIdType n23, smIdType n34, smIdType n41, + smIdType n56, smIdType n67, smIdType n78, smIdType n85, + smIdType n15, smIdType n26, smIdType n37, smIdType n48, + smIdType n1234,smIdType n1256,smIdType n2367,smIdType n3478, + smIdType n1458,smIdType n5678,smIdType nCenter); + void MoveNode(smIdType NewNodeID, double x, double y, double z); + void RemoveNode(smIdType NodeID); + void RemoveElement(smIdType ElementID); + void ChangeElementNodes(smIdType ElementID, smIdType nodes[], smIdType nbnodes); + void ChangePolyhedronNodes(const smIdType ElementID, + const std::vector& nodes_ids, const std::vector& quantities); - void Renumber (const bool isNodes, const int startID, const int deltaID); + void Renumber (const bool isNodes, const smIdType startID, const smIdType deltaID); void ClearMesh(); void Clear(); const std::list & GetCommands(); diff --git a/src/SMESHDS/SMESHDS_SubMesh.cxx b/src/SMESHDS/SMESHDS_SubMesh.cxx index 35746f138..76a162623 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.cxx +++ b/src/SMESHDS/SMESHDS_SubMesh.cxx @@ -235,12 +235,12 @@ bool SMESHDS_SubMesh::RemoveNode(const SMDS_MeshNode * N) //purpose : //======================================================================= -int SMESHDS_SubMesh::NbElements() const +smIdType SMESHDS_SubMesh::NbElements() const { if ( !IsComplexSubmesh() ) return myNbElements; - int nbElems = 0; + smIdType nbElems = 0; TSubMeshSet::const_iterator it = mySubMeshes.begin(); for ( ; it != mySubMeshes.end(); it++ ) nbElems += (*it)->NbElements(); @@ -253,12 +253,12 @@ int SMESHDS_SubMesh::NbElements() const //purpose : //======================================================================= -int SMESHDS_SubMesh::NbNodes() const +smIdType SMESHDS_SubMesh::NbNodes() const { if ( !IsComplexSubmesh() ) return myNbNodes; - int nbElems = 0; + smIdType nbElems = 0; TSubMeshSet::const_iterator it = mySubMeshes.begin(); for ( ; it != mySubMeshes.end(); it++ ) nbElems += (*it)->NbNodes(); diff --git a/src/SMESHDS/SMESHDS_SubMesh.hxx b/src/SMESHDS/SMESHDS_SubMesh.hxx index 902b65daf..bf392b7a0 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.hxx +++ b/src/SMESHDS/SMESHDS_SubMesh.hxx @@ -31,6 +31,7 @@ #include "SMDS_ElementHolder.hxx" #include "SMDS_Mesh.hxx" +#include #include #include @@ -62,12 +63,12 @@ class SMESHDS_EXPORT SMESHDS_SubMesh : public SMDS_ElementHolder bool RemoveSubMesh( const SMESHDS_SubMesh* theSubMesh ); void RemoveAllSubmeshes(); bool ContainsSubMesh( const SMESHDS_SubMesh* theSubMesh ) const; - int NbSubMeshes() const { return mySubMeshes.size(); } + size_t NbSubMeshes() const { return mySubMeshes.size(); } SMESHDS_SubMeshIteratorPtr GetSubMeshIterator() const; // for both types - virtual int NbElements() const; - virtual int NbNodes() const; + virtual smIdType NbElements() const; + virtual smIdType NbNodes() const; virtual SMDS_ElemIteratorPtr GetElements() const; virtual SMDS_NodeIteratorPtr GetNodes() const; virtual bool Contains(const SMDS_MeshElement * ME) const; // check if elem or node is in @@ -89,8 +90,8 @@ class SMESHDS_EXPORT SMESHDS_SubMesh : public SMDS_ElementHolder private: int myIndex; - int myNbElements; - int myNbNodes; + smIdType myNbElements; + smIdType myNbNodes; const SMDS_MeshElement* my1stElemNode[2]; // elem and node with least ID, to optimize iteration const SMESHDS_Mesh * myParent; TSubMeshSet mySubMeshes; diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index e96570c1f..fb9aaf7f3 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -607,7 +607,7 @@ namespace } if ( ! notSupportedElemTypes.empty() ) { - SMESH::long_array_var nbElems = aMeshOrGroup->GetMeshInfo(); + SMESH::smIdType_array_var nbElems = aMeshOrGroup->GetMeshInfo(); for ( size_t iType = 0; iType < notSupportedElemTypes.size(); ++iType ) if ( nbElems[ notSupportedElemTypes[ iType ]] > 0 ) presentNotSupported.push_back( notSupportedElemTypes[ iType ]); @@ -993,11 +993,19 @@ namespace aMesh->ExportGMF( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups ); } } - catch (const SALOME::SALOME_Exception& S_ex){ + catch (const SALOME::SALOME_Exception& S_ex) + { wc.suspend(); - SUIT_MessageBox::warning(SMESHGUI::desktop(), - QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_EXPORT_FAILED") + SalomeApp_Tools::ExceptionToString(S_ex)); + if ( S_ex.details.type == SALOME::COMM && // communicate about too large mesh + strncmp( "format=", S_ex.details.sourceFile.in(), 7 ) == 0 ) + + SUIT_MessageBox::critical(SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr(S_ex.details.text.in() )); + else + SUIT_MessageBox::warning(SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_EXPORT_FAILED") + SalomeApp_Tools::ExceptionToString(S_ex)); wc.resume(); } } @@ -1217,14 +1225,14 @@ namespace SMESH::Controls::NumericalFunctor* aNumFun = dynamic_cast( aFunctor.get() ); if ( aNumFun ) { - std::vector elements; + std::vector elements; SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface(anIO); if ( mesh->_is_nil() ) { SMESH::SMESH_IDSource_var idSource = SMESH::IObjectToInterface(anIO); if ( !idSource->_is_nil() ) { - SMESH::long_array_var ids = idSource->GetIDs(); + SMESH::smIdType_array_var ids = idSource->GetIDs(); elements.resize( ids->length() ); for ( unsigned i = 0; i < elements.size(); ++i ) elements[i] = ids[i]; @@ -1852,7 +1860,7 @@ namespace if ( anActor->GetControlMode() != aControl ) anActor->SetControlMode( aControl ); QString functorName = functorToString( anActor->GetFunctor() ); - int anEntitiesCount = anActor->GetNumberControlEntities(); + smIdType anEntitiesCount = anActor->GetNumberControlEntities(); if (anEntitiesCount >= 0) functorName = functorName + ": " + QString::number(anEntitiesCount); anActor->GetScalarBarActor()->SetTitle( functorName.toUtf8().constData() ); @@ -2260,7 +2268,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_IDSource_ptr theMesh, long updateLimit = resMgr->integerValue( "SMESH", "update_limit", 500000 ); bool incrementalLimit = resMgr->booleanValue( "SMESH", "incremental_limit", false ); - SMESH::long_array_var info = theMesh->GetMeshInfo(); + SMESH::smIdType_array_var info = theMesh->GetMeshInfo(); long nbOdElems = info[SMDSEntity_0D]; long nbEdges = info[SMDSEntity_Edge] + info[SMDSEntity_Quad_Edge]; long nbFaces = info[SMDSEntity_Triangle] + info[SMDSEntity_Quad_Triangle] + info[SMDSEntity_BiQuad_Triangle] + @@ -3112,10 +3120,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) try { SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather(); // get submesh elements list by types - SMESH::long_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE); - SMESH::long_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE); - SMESH::long_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE); - SMESH::long_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME); + SMESH::smIdType_array_var aNodes = aSubMesh->GetElementsByType(SMESH::NODE); + SMESH::smIdType_array_var aEdges = aSubMesh->GetElementsByType(SMESH::EDGE); + SMESH::smIdType_array_var aFaces = aSubMesh->GetElementsByType(SMESH::FACE); + SMESH::smIdType_array_var aVolumes = aSubMesh->GetElementsByType(SMESH::VOLUME); // create group for each type o elements QString aName = IObject->getName(); QStringList anEntryList; @@ -3623,7 +3631,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) try { SUIT_OverrideCursor wc; SMESH::SMESH_MeshEditor_var aMeshEditor = aMesh->GetMeshEditor(); - int removed = aMeshEditor->RemoveOrphanNodes(); + smIdType removed = aMeshEditor->RemoveOrphanNodes(); SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"), tr("NB_NODES_REMOVED").arg(removed)); @@ -5139,7 +5147,7 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) lab = lab + tr("INFO_COMPUTE") + "
"; lab = lab + tr("INFO_REFINE") + ":"; items << wrap(tr("INFO_REFINE_LOCAL_SIZE"), "li") - << wrap(tr("INFO_REFINE_SUBMESH"), "li"); + << wrap(tr("INFO_REFINE_SUBMESH"), "li"); lab = lab + wrap(items.join(""), "ul"); items.clear(); @@ -5147,22 +5155,22 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) gb = app->infoPanel()->addGroup(tr("INFO_GRP_IMPORT_MESH")); items << wrap("UNV", "li") - << wrap("MED", "li") - << wrap("STL", "li") - << wrap("CGNS", "li") - << wrap("SAUV", "li") - << wrap("GMF", "li"); + << wrap("MED", "li") + << wrap("STL", "li") + << wrap("CGNS", "li") + << wrap("SAUV", "li") + << wrap("GMF", "li"); lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul"); items.clear(); - + app->infoPanel()->addLabel(lab, gb); gb = app->infoPanel()->addGroup(tr("INFO_GRP_CHECK_MESH")); lab = tr("INFO_DISPLAY") + "
"; items << wrap(tr("INFO_QUALITY_AREA"), "li") - << wrap(tr("INFO_QUALITY_VOLUME"), "li") - << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li") - << wrap("...", "li"); + << wrap(tr("INFO_QUALITY_VOLUME"), "li") + << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li") + << wrap("...", "li"); lab = lab + tr("INFO_QUALITY_INFO") + ":" + wrap(items.join(""), "ul"); items.clear(); lab = lab + tr("INFO_CLIPPING"); @@ -5586,23 +5594,23 @@ void SMESHGUI::createPreferences() int size0d = addPreference(tr("PREF_SIZE_0D"), elemGroup, LightApp_Preferences::IntSpin, "SMESH", "elem0d_size"); /* int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup, - LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size"); */ - double ballDiameter = addPreference(tr("PREF_BALL_DIAMETER"), elemGroup, - LightApp_Preferences::DblSpin, "SMESH", "ball_elem_diameter"); - double ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup, - LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale"); - int elemW = addPreference(tr("PREF_WIDTH"), elemGroup, - LightApp_Preferences::IntSpin, "SMESH", "element_width"); - int outW = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup, - LightApp_Preferences::IntSpin, "SMESH", "outline_width"); - int shrink = addPreference(tr("PREF_SHRINK_COEFF"), elemGroup, - LightApp_Preferences::IntSpin, "SMESH", "shrink_coeff"); + LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size"); */ + int ballDiameter = addPreference(tr("PREF_BALL_DIAMETER"), elemGroup, + LightApp_Preferences::DblSpin, "SMESH", "ball_elem_diameter"); + int ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup, + LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale"); + int elemW = addPreference(tr("PREF_WIDTH"), elemGroup, + LightApp_Preferences::IntSpin, "SMESH", "element_width"); + int outW = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup, + LightApp_Preferences::IntSpin, "SMESH", "outline_width"); + int shrink = addPreference(tr("PREF_SHRINK_COEFF"), elemGroup, + LightApp_Preferences::IntSpin, "SMESH", "shrink_coeff"); setPreferenceProperty( size0d, "min", 1 ); setPreferenceProperty( size0d, "max", 10 ); - // setPreferenceProperty( ballSize, "min", 1 ); - // setPreferenceProperty( ballSize, "max", 10 ); + // setPreferenceProperty( ballSize, "min", 1 ); + // setPreferenceProperty( ballSize, "max", 10 ); setPreferenceProperty( ballDiameter, "min", 1e-7 ); setPreferenceProperty( ballDiameter, "max", 1e9 ); @@ -5756,8 +5764,8 @@ void SMESHGUI::createPreferences() void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) { if ( sect=="SMESH" ) { - float sbX1 = 0.01, sbY1 = 0.01, sbW = 0.08, sbH = 0.08; - float aTol = 1.00000009999999; + double sbX1 = 0.01, sbY1 = 0.01, sbW = 0.08, sbH = 0.08; + double aTol = 1.00000009999999; std::string aWarning; SUIT_ResourceMgr* aResourceMgr = SMESH::GetResourceMgr(this); diff --git a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx index 39ad8f990..82902c131 100644 --- a/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_Add0DElemsOnAllNodesDlg.cxx @@ -40,6 +40,7 @@ #include #include #include +#include // Qt includes #include @@ -426,7 +427,7 @@ bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply() SUIT_MessageBox::warning( myDlg, tr( "SMESH_WRN_WARNING" ), tr( "SMESH_BAD_SELECTION" ) ); return false; } - SMESH::long_array_var idArray = new SMESH::long_array; + SMESH::smIdType_array_var idArray = new SMESH::smIdType_array; idArray->length( idList.count() ); QStringList::iterator idIt = idList.begin(); for ( int i = 0; idIt != idList.end(); ++idIt, ++i ) @@ -438,14 +439,14 @@ bool SMESHGUI_Add0DElemsOnAllNodesOp::onApply() // Create 0D elements - int prevNb0D = mesh->Nb0DElements(); + smIdType prevNb0D = mesh->Nb0DElements(); QString groupName = myDlg->myGroupListCmBox->currentText(); SMESH::SMESH_IDSource_var newObj = editor->Create0DElementsOnAllNodes( meshObject, groupName.toUtf8().data(), myDlg->myDuplicateElemsChkBox->isChecked() ); - int newNb0D = mesh->Nb0DElements() - prevNb0D; + smIdType newNb0D = mesh->Nb0DElements() - prevNb0D; SUIT_MessageBox::information( myDlg, tr( "SMESH_INFORMATION" ), tr( "NB_NEW_0D" ).arg( newNb0D ), SUIT_MessageBox::Ok, SUIT_MessageBox::Ok); diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 165b1487c..94f8fb565 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -553,7 +553,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() if (myNbOkNodes && !SMESHGUI::isStudyLocked()) { myBusy = true; QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anArrayOfIndices = new SMESH::long_array; + SMESH::smIdType_array_var anArrayOfIndices = new SMESH::smIdType_array; anArrayOfIndices->length(aListId.count()); const std::vector& revIndex = SMDS_MeshCell::reverseSmdsOrder( myGeomType ); if ( ReverseOrDulicate && ReverseOrDulicate->isChecked() && (int)revIndex.size() == aListId.count() ) @@ -598,10 +598,10 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() } SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); - SMESH::long_array_var anIdList = new SMESH::long_array; + SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array; anIdList->length( 1 ); anIdList[0] = -1; - int nbElemsBefore = 0; + smIdType nbElemsBefore = 0; switch (myElementType) { case SMDSAbs_0DElement: { @@ -611,7 +611,7 @@ void SMESHGUI_AddMeshElementDlg::ClickOnApply() for ( size_t i = 0; i < anArrayOfIndices->length(); ++i ) anIdList[i] = aMeshEditor->Add0DElement(anArrayOfIndices[i], duplicateElements); - CORBA::ULong nbAdded = myMesh->Nb0DElements() - nbElemsBefore; + SMESH::smIdType nbAdded = myMesh->Nb0DElements() - nbElemsBefore; if ( !duplicateElements && nbAdded < anArrayOfIndices->length() ) SUIT_MessageBox::information(SMESHGUI::desktop(), tr("SMESH_INFORMATION"), @@ -784,7 +784,7 @@ void SMESHGUI_AddMeshElementDlg::onTextChange (const QString& theNewText) aMesh = myActor->GetObject()->GetMesh(); if (aMesh) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); bool allOk = true; diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index cc158fb1d..318731e4d 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -741,7 +741,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply() ReverseConnectivity( anIds, myGeomType, /*toReverse=*/true, /*toVtkOrder=*/false ); int aNumberOfIds = anIds.size(); - SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array; + SMESH::smIdType_array_var anArrayOfIdeces = new SMESH::smIdType_array; anArrayOfIdeces->length( aNumberOfIds ); for (int i = 0; i < aNumberOfIds; i++) @@ -841,7 +841,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply() } if ( !aGroupUsed->_is_nil() ) { - SMESH::long_array_var anIdList = new SMESH::long_array; + SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array; anIdList->length( 1 ); anIdList[0] = anElemId; aGroupUsed->Add( anIdList.inout() ); @@ -989,7 +989,7 @@ void SMESHGUI_AddQuadraticElementDlg::onTextChange (const QString& theNewText) myCurrentLineEdit = send; if (aMesh) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); bool allOk = true; diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx index a7cb0d0dc..f84027be1 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.cxx @@ -1147,7 +1147,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack, } else if ( theNoCompError && theNoHypoError ) { - SMESH::long_array_var aRes = myMesh->GetMeshInfo(); + SMESH::smIdType_array_var aRes = myMesh->GetMeshInfo(); aCompDlg->myFullInfo->SetMeshInfo( aRes ); aCompDlg->myFullInfo->show(); aCompDlg->myBriefInfo->hide(); @@ -1162,7 +1162,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack, theCompErrors[ i ].code == SMESH::COMPERR_NO_MESH_ON_SHAPE ); // full or brief mesh info - SMESH::long_array_var aRes = myMesh->GetMeshInfo(); + SMESH::smIdType_array_var aRes = myMesh->GetMeshInfo(); if ( onlyWarnings ) { aCompDlg->myFullInfo->SetMeshInfo( aRes ); aCompDlg->myFullInfo->show(); @@ -2211,7 +2211,7 @@ void SMESHGUI_BaseComputeOp::evaluateMesh() QString aHypErrors; bool evaluateFailed = true, memoryLack = false; - SMESH::long_array_var aRes; + SMESH::smIdType_array_var aRes; _PTR(SObject) aMeshSObj = SMESH::FindSObject(myMesh); if ( !aMeshSObj ) // IPAL21340 @@ -2286,7 +2286,7 @@ void SMESHGUI_BaseComputeOp::evaluateMesh() } -void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes, +void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::smIdType_array& theRes, const bool theMemoryLack, const bool theNoCompError, SMESH::compute_error_array_var& theCompErrors, diff --git a/src/SMESHGUI/SMESHGUI_ComputeDlg.h b/src/SMESHGUI/SMESHGUI_ComputeDlg.h index c72fb097b..6c95f91d9 100644 --- a/src/SMESHGUI/SMESHGUI_ComputeDlg.h +++ b/src/SMESHGUI/SMESHGUI_ComputeDlg.h @@ -87,7 +87,7 @@ protected: const QString& ); SMESHGUI_ComputeDlg* evaluateDlg() const; void evaluateMesh(); - void showEvaluateResult(const SMESH::long_array& theRes, + void showEvaluateResult(const SMESH::smIdType_array& theRes, const bool, const bool, SMESH::compute_error_array_var&, diff --git a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx index e2989aeb2..d15ec45e7 100644 --- a/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx +++ b/src/SMESHGUI/SMESHGUI_ConvToQuadOp.cxx @@ -328,7 +328,7 @@ SMESHGUI_ConvToQuadOp::MeshDestinationType SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSource, bool* isMixOrder) { - SMESH::long_array_var nbElemOfType = idSource->GetMeshInfo(); + SMESH::smIdType_array_var nbElemOfType = idSource->GetMeshInfo(); bool hasBiQuad = ( nbElemOfType[SMDSEntity_BiQuad_Triangle ] || nbElemOfType[SMDSEntity_BiQuad_Quadrangle ] || diff --git a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx index 9af0d8a42..50052045c 100644 --- a/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CopyMeshDlg.cxx @@ -439,7 +439,7 @@ bool SMESHGUI_CopyMeshDlg::ClickOnApply() else { QStringList aListElementsId = myLineEditElements->text().split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) anElementsId[i] = aListElementsId[i].toInt(); @@ -614,7 +614,7 @@ void SMESHGUI_CopyMeshDlg::onTextChange (const QString& theNewText) QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); if (myActor && aMesh) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; if (send == myLineEditElements) { for (int i = 0; i < aListId.count(); i++) if ( const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt())) diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index faffadb33..435624e63 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -480,7 +480,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() if (GetConstructorId() == 0) { - SMESH::long_array_var anIdsOfNodes = new SMESH::long_array; + SMESH::smIdType_array_var anIdsOfNodes = new SMESH::smIdType_array; SMESH::long_array_var aQuantities = new SMESH::long_array; aQuantities->length( myFacesByNodes->count() ); @@ -518,7 +518,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() } else if (GetConstructorId() == 1) { - SMESH::long_array_var anIdsOfFaces = new SMESH::long_array; + SMESH::smIdType_array_var anIdsOfFaces = new SMESH::smIdType_array; QStringList aListId = myEditCurrentArgument->text().split( " ", QString::SkipEmptyParts ); anIdsOfFaces->length(aListId.count()); @@ -562,7 +562,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnApply() } if ( !aGroupUsed->_is_nil() ) { - SMESH::long_array_var anIdList = new SMESH::long_array; + SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array; anIdList->length( 1 ); anIdList[0] = anElemId; aGroupUsed->Add( anIdList.inout() ); @@ -688,7 +688,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText) if (GetConstructorId() == 0) { if ( aMesh ) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts ); for ( int i = 0; i < aListId.count(); i++ ) { @@ -720,7 +720,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onTextChange(const QString& theNewText) // check entered ids of faces and highlight them QStringList aListId; if ( aMesh ) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; aListId = theNewText.split( " ", QString::SkipEmptyParts ); @@ -1147,7 +1147,7 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::onListSelectionChanged() SALOME_ListIO aList; mySelectionMgr->setSelectedObjects( aList ); - TColStd_MapOfInteger aIndexes; + SVTK_TVtkIDsMap aIndexes; QList selItems = myFacesByNodes->selectedItems(); QListWidgetItem* anItem; diff --git a/src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx b/src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx index 378e2ae0d..2bebd14bb 100644 --- a/src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DisplayEntitiesDlg.cxx @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -81,7 +82,7 @@ SMESHGUI_DisplayEntitiesDlg::SMESHGUI_DisplayEntitiesDlg( QWidget* parent ) QGridLayout* hl = new QGridLayout( anEntitiesGrp ); hl->setMargin( MARGIN ); hl->setSpacing( SPACING ); - int nbElements; + smIdType nbElements; // 0DElements nbElements = myActor ? myActor->GetObject()->GetNbEntities( SMDSAbs_0DElement ) : aMesh->Nb0DElements(); diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index bd2cb645a..30c2e472c 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -688,7 +688,7 @@ void SMESHGUI_ExtrusionAlongPathDlg::onTextChange (const QString& theNewText) if (bOk) { const SMDS_MeshNode* n = aMesh->FindNode(ind); if (n) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; newIndices.Add(n->GetID()); mySelector->AddOrRemoveIndex( aPathActor->getIO(), newIndices, false ); if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) @@ -1147,7 +1147,7 @@ bool SMESHGUI_ExtrusionAlongPathDlg::isValuesValid() } else { - SMESH::long_array_var elems = mesh->GetNodeInverseElements( aNodeStart, SMESH::ALL ); + SMESH::smIdType_array_var elems = mesh->GetNodeInverseElements( aNodeStart, SMESH::ALL ); if ( elems->length() != 1 || mesh->GetElementType( elems[0], true ) != SMESH::EDGE ) return false; diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index 3189a52c0..a65572de1 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -289,12 +289,12 @@ void SMESHGUI_3TypesSelector::selectionIntoArgument() } else // get indices of selected elements { - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; mySelector->GetIndex(IO,aMapIndex); int nbElements = aMapIndex.Extent(); if ( nbElements > 0 ) { - SMESH::long_array_var ids = new SMESH::long_array; + SMESH::smIdType_array_var ids = new SMESH::smIdType_array; ids->length( nbElements ); for ( int i = 0; i < nbElements; ++i ) aString += QString(" %1").arg( ids[ i ] = aMapIndex( i+1 )); @@ -352,9 +352,9 @@ void SMESHGUI_3TypesSelector::onTextChange( const QString& theNewText ) SMDSAbs_ElementType SMDSType = SMDSAbs_ElementType( iType+1 ); const bool isNode = ( SMDSType == SMDSAbs_Node ); - SMESH::long_array_var ids = new SMESH::long_array; + SMESH::smIdType_array_var ids = new SMESH::smIdType_array; ids->length( aListId.count() ); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; for (int i = 0; i < aListId.count(); i++) { int id = aListId[ i ].toInt(); bool validId = false; @@ -392,7 +392,7 @@ void SMESHGUI_3TypesSelector::onTextChange( const QString& theNewText ) */ //================================================================================ -void SMESHGUI_3TypesSelector::addTmpIdSource( SMESH::long_array_var& ids, int iType, int index ) +void SMESHGUI_3TypesSelector::addTmpIdSource( SMESH::smIdType_array_var& ids, int iType, int index ) { SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor(); SMESH::SMESH_IDSource_var idSrc = @@ -1368,7 +1368,7 @@ void SMESHGUI_ExtrusionDlg::SelectionIntoArgument() if ( SelectVectorButton->isChecked() ) { Handle(SALOME_InteractiveObject) IO = aList.First(); - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; mySelector->GetIndex(IO,aMapIndex); if ( aMapIndex.Extent() != 1 ) return; diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h index f2be813ac..966e48a5f 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h @@ -100,7 +100,7 @@ class SMESHGUI_EXPORT SMESHGUI_3TypesSelector : public QWidget private: - void addTmpIdSource( SMESH::long_array_var& ids, + void addTmpIdSource( SMESH::smIdType_array_var& ids, int iType, int index); QGroupBox* myGroups [3]; diff --git a/src/SMESHGUI/SMESHGUI_Filter.cxx b/src/SMESHGUI/SMESHGUI_Filter.cxx index b9b27de54..c94bf8f14 100644 --- a/src/SMESHGUI/SMESHGUI_Filter.cxx +++ b/src/SMESHGUI/SMESHGUI_Filter.cxx @@ -63,7 +63,7 @@ SMESHGUI_PredicateFilter::~SMESHGUI_PredicateFilter() // name : SMESHGUI_PredicateFilter::IsValid // Purpose : Verify whether entry id satisfies to criterion of the filter //======================================================================= -bool SMESHGUI_PredicateFilter::IsValid( const int theCellId ) const +bool SMESHGUI_PredicateFilter::IsValid( const vtkIdType theCellId ) const { if ( myActor == 0 || myPred->_is_nil() ) return false; @@ -196,7 +196,7 @@ SMESHGUI_QuadrangleFilter::~SMESHGUI_QuadrangleFilter() // name : SMESHGUI_QuadrangleFilter::IsValid // Purpose : Verify whether selected cell is quadrangle //======================================================================= -bool SMESHGUI_QuadrangleFilter::IsValid( const int theCellId ) const +bool SMESHGUI_QuadrangleFilter::IsValid( const vtkIdType theCellId ) const { if ( myActor == 0 ) return false; @@ -275,7 +275,7 @@ SMESHGUI_TriangleFilter::~SMESHGUI_TriangleFilter() // name : SMESHGUI_TriangleFilter::IsValid // Purpose : Verify whether selected cell is triangle //======================================================================= -bool SMESHGUI_TriangleFilter::IsValid( const int theCellId ) const +bool SMESHGUI_TriangleFilter::IsValid( const vtkIdType theCellId ) const { if ( myActor == 0 ) return false; @@ -353,7 +353,7 @@ SMESHGUI_FacesFilter::~SMESHGUI_FacesFilter() // name : SMESHGUI_FacesFilter::IsValid // Purpose : Verify whether selected cell is face //======================================================================= -bool SMESHGUI_FacesFilter::IsValid( const int theCellId ) const +bool SMESHGUI_FacesFilter::IsValid( const vtkIdType theCellId ) const { if ( myActor == 0 ) return false; @@ -430,7 +430,7 @@ SMESHGUI_VolumesFilter::~SMESHGUI_VolumesFilter() // name : SMESHGUI_VolumesFilter::IsValid // Purpose : Verify whether selected cell is volume //======================================================================= -bool SMESHGUI_VolumesFilter::IsValid( const int theCellId ) const +bool SMESHGUI_VolumesFilter::IsValid( const vtkIdType theCellId ) const { if ( myActor == 0 || theCellId < 1 ) return false; @@ -503,7 +503,7 @@ SMESHGUI_VolumeShapeFilter::SMESHGUI_VolumeShapeFilter(const SMDSAbs_GeometryTyp // name : SMESHGUI_VolumeShapeFilter::IsValid // Purpose : Verify whether selected cell is a volume of a certain shape //======================================================================= -bool SMESHGUI_VolumeShapeFilter::IsValid( const int theCellId ) const +bool SMESHGUI_VolumeShapeFilter::IsValid( const vtkIdType theCellId ) const { if ( myActor == 0 || theCellId < 1 ) return false; diff --git a/src/SMESHGUI/SMESHGUI_Filter.h b/src/SMESHGUI/SMESHGUI_Filter.h index 1a9ef3143..42d668387 100644 --- a/src/SMESHGUI/SMESHGUI_Filter.h +++ b/src/SMESHGUI/SMESHGUI_Filter.h @@ -87,7 +87,7 @@ public: Standard_EXPORT SMESHGUI_PredicateFilter(); Standard_EXPORT virtual ~SMESHGUI_PredicateFilter(); - Standard_EXPORT virtual bool IsValid( const int ) const; + Standard_EXPORT virtual bool IsValid( const vtkIdType ) const; Standard_EXPORT virtual bool IsObjValid( const int ) const; Standard_EXPORT virtual int GetId() const; Standard_EXPORT virtual bool IsNodeFilter() const; @@ -115,7 +115,7 @@ public: Standard_EXPORT SMESHGUI_QuadrangleFilter(); Standard_EXPORT virtual ~SMESHGUI_QuadrangleFilter(); - Standard_EXPORT virtual bool IsValid( const int ) const; + Standard_EXPORT virtual bool IsValid( const vtkIdType ) const; Standard_EXPORT virtual bool IsObjValid( const int ) const; Standard_EXPORT virtual int GetId() const; Standard_EXPORT virtual bool IsNodeFilter() const; @@ -137,7 +137,7 @@ public: Standard_EXPORT SMESHGUI_TriangleFilter(); Standard_EXPORT virtual ~SMESHGUI_TriangleFilter(); - Standard_EXPORT virtual bool IsValid( const int ) const; + Standard_EXPORT virtual bool IsValid( const vtkIdType ) const; Standard_EXPORT virtual bool IsObjValid( const int ) const; Standard_EXPORT virtual int GetId() const; Standard_EXPORT virtual bool IsNodeFilter() const; @@ -159,7 +159,7 @@ public: Standard_EXPORT SMESHGUI_FacesFilter(); Standard_EXPORT virtual ~SMESHGUI_FacesFilter(); - Standard_EXPORT virtual bool IsValid( const int ) const; + Standard_EXPORT virtual bool IsValid( const vtkIdType ) const; Standard_EXPORT virtual bool IsObjValid( const int ) const; Standard_EXPORT virtual int GetId() const; Standard_EXPORT virtual bool IsNodeFilter() const; @@ -181,7 +181,7 @@ public: Standard_EXPORT SMESHGUI_VolumesFilter(); Standard_EXPORT virtual ~SMESHGUI_VolumesFilter(); - Standard_EXPORT virtual bool IsValid( const int ) const; + Standard_EXPORT virtual bool IsValid( const vtkIdType ) const; Standard_EXPORT virtual bool IsObjValid( const int ) const; Standard_EXPORT virtual int GetId() const; Standard_EXPORT virtual bool IsNodeFilter() const; @@ -203,7 +203,7 @@ class SMESHGUI_VolumeShapeFilter : public SMESHGUI_Filter public: Standard_EXPORT SMESHGUI_VolumeShapeFilter(const SMDSAbs_GeometryType shape); - Standard_EXPORT virtual bool IsValid( const int ) const; + Standard_EXPORT virtual bool IsValid( const vtkIdType ) const; Standard_EXPORT virtual bool IsObjValid( const int ) const; Standard_EXPORT virtual int GetId() const; Standard_EXPORT virtual bool IsNodeFilter() const; diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 564e2f903..79e415e44 100644 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -69,6 +69,7 @@ // SALOME KERNEL includes #include #include +#include // OCCT includes #include @@ -3005,13 +3006,13 @@ void SMESHGUI_FilterDlg::reject() SALOME_ListIO aList; mySelectionMgr->clearFilters(); mySelectionMgr->clearSelected(); - SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter (myIObjects); + SALOME_DataMapIteratorOfIOMapOfVtk anIter (myIObjects); for ( ; anIter.More(); anIter.Next()) { aList.Append(anIter.Key()); - TColStd_MapOfInteger aResMap; - const TColStd_IndexedMapOfInteger& anIndMap = anIter.Value(); + SVTK_TVtkIDsMap aResMap; + const SVTK_TIndexedMapOfVtkId& anIndMap = anIter.Value(); for (int i = 1, n = anIndMap.Extent(); i <= n; i++) aResMap.Add(anIndMap(i)); @@ -3342,7 +3343,7 @@ void SMESHGUI_FilterDlg::SetSelection() const SALOME_ListIO& anObjs = mySelector->StoredIObjects(); SALOME_ListIteratorOfListIO anIter (anObjs); for ( ; anIter.More(); anIter.Next()) { - TColStd_IndexedMapOfInteger aMap; + SVTK_TIndexedMapOfVtkId aMap; mySelector->GetIndex(anIter.Value(), aMap); myIObjects.Bind(anIter.Value(), aMap); } @@ -3536,9 +3537,9 @@ void SMESHGUI_FilterDlg::filterSource (const int theType, { if (myMesh->_is_nil()) return; - SMESH::long_array_var anIds = myFilter[ theType ]->GetElementsId(myMesh); + SMESH::smIdType_array_var anIds = myFilter[ theType ]->GetElementsId(myMesh); for (int i = 0, n = anIds->length(); i < n; i++) - theResIds.append(anIds[ i ]); + theResIds.append(FromIdType(anIds[ i ])); } else if (aSourceId == Selection) { @@ -3579,7 +3580,7 @@ void SMESHGUI_FilterDlg::filterSelectionSource (const int theType, // Create map of entities to be filtered TColStd_MapOfInteger aToBeFiltered; - SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter(myIObjects); + SALOME_DataMapIteratorOfIOMapOfVtk anIter(myIObjects); for ( ; anIter.More(); anIter.Next()) { @@ -3589,10 +3590,10 @@ void SMESHGUI_FilterDlg::filterSelectionSource (const int theType, { if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anIds = + SMESH::smIdType_array_var anIds = theType == SMESH::NODE ? aSubMesh->GetNodesId() : aSubMesh->GetElementsId(); for (int i = 0, n = anIds->length(); i < n; i++) - aToBeFiltered.Add(anIds[ i ]); + aToBeFiltered.Add(FromIdType(anIds[ i ])); } } @@ -3603,9 +3604,9 @@ void SMESHGUI_FilterDlg::filterSelectionSource (const int theType, { if (aGroup->GetType() == theType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anIds = aGroup->GetListOfID(); + SMESH::smIdType_array_var anIds = aGroup->GetListOfID(); for (int i = 0, n = anIds->length(); i < n; i++) - aToBeFiltered.Add(anIds[ i ]); + aToBeFiltered.Add(FromIdType(anIds[ i ])); } } @@ -3613,7 +3614,7 @@ void SMESHGUI_FilterDlg::filterSelectionSource (const int theType, SMESH::SMESH_Mesh_var aMeshPtr = SMESH::IObjectToInterface(anIter.Key()); if (!aMeshPtr->_is_nil() && aMeshPtr->GetId() == myMesh->GetId()) { - const TColStd_IndexedMapOfInteger& aSelMap = anIter.Value(); + const SVTK_TIndexedMapOfVtkId& aSelMap = anIter.Value(); if (aSelMap.Extent() > 0) { @@ -3646,7 +3647,7 @@ SMESH_Actor* SMESHGUI_FilterDlg::getActor() if ( meshActor && meshActor->GetVisibility() ) return meshActor; - SALOME_DataMapIteratorOfDataMapOfIOMapOfInteger anIter(myIObjects); + SALOME_DataMapIteratorOfIOMapOfVtk anIter(myIObjects); for ( ; anIter.More(); anIter.Next()) { Handle(SALOME_InteractiveObject) io = anIter.Key(); @@ -3706,7 +3707,7 @@ void SMESHGUI_FilterDlg::selectInViewer (const int theType, const QList& th SMESH::RemoveFilter(aFilterId); // get vtk ids - TColStd_MapOfInteger aMap; + SVTK_TVtkIDsMap aMap; QList::const_iterator anIter; for (anIter = theIds.begin(); anIter != theIds.end(); ++anIter) { aMap.Add(*anIter); diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.h b/src/SMESHGUI/SMESHGUI_FilterDlg.h index 1240b7e72..dc0c475be 100644 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.h @@ -39,6 +39,7 @@ // SALOME GUI includes #include #include +#include // IDL includes #include @@ -59,6 +60,9 @@ class SMESHGUI_FilterLibraryDlg; class SMESH_Actor; class SVTK_Selector; +typedef NCollection_DataMap SALOME_DataMapOfIOMapOfVtk; +typedef SALOME_DataMapOfIOMapOfVtk::Iterator SALOME_DataMapIteratorOfIOMapOfVtk; + /*! * Class : SMESHGUI_FilterTable * Description : Frame containing @@ -308,7 +312,7 @@ private: bool myDiffSourcesEnabled; QWidget* mySourceWg; - SALOME_DataMapOfIOMapOfInteger myIObjects; + SALOME_DataMapOfIOMapOfVtk myIObjects; bool myIsSelectionChanged; QMap< int, SMESH::Filter_var > myFilter; QMap< int, bool > myInsertState; diff --git a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx index aeaeb5bba..91b913fdd 100644 --- a/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FindElemByPointDlg.cxx @@ -361,7 +361,7 @@ void SMESHGUI_FindElemByPointOp::onElemSelected() QList ids = myDlg->myFoundList->selectedItems(); QList::iterator id = ids.begin(); - TColStd_MapOfInteger idMap; + SVTK_TVtkIDsMap idMap; for ( ; id != ids.end(); ++id ) idMap.Add( (*id)->text().toInt() ); @@ -434,7 +434,7 @@ void SMESHGUI_FindElemByPointOp::onFind() if (aMeshEditor->_is_nil()) return; - SMESH::long_array_var foundIds; + SMESH::smIdType_array_var foundIds; if ( aMesh->_is_equivalent( myMeshOrPart ) ) foundIds = aMeshEditor->FindElementsByPoint( myDlg->myX->GetValue(), diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index d3438261a..f1355af04 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -668,7 +668,7 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup, myIdList.clear(); if (!theGroup->IsEmpty()) { - SMESH::long_array_var anElements = theGroup->GetListOfID(); + SMESH::smIdType_array_var anElements = theGroup->GetListOfID(); int k = anElements->length(); for (int i = 0; i < k; i++) { myIdList.append(anElements[i]); @@ -1003,7 +1003,7 @@ bool SMESHGUI_GroupDlg::onApply() } else { - SMESH::long_array_var anIdList = new SMESH::long_array; + SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array; int i, k = myElements->count(); anIdList->length(k); for (i = 0; i < k; i++) { @@ -1037,7 +1037,7 @@ bool SMESHGUI_GroupDlg::onApply() myIdList.removeAt(idx); } if (!aAddList.empty()) { - SMESH::long_array_var anIdList = new SMESH::long_array; + SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array; int added = aAddList.count(); anIdList->length(added); for (i = 0; i < added; i++) @@ -1045,7 +1045,7 @@ bool SMESHGUI_GroupDlg::onApply() myGroup->Add(anIdList.inout()); } if (!myIdList.empty()) { - SMESH::long_array_var anIdList = new SMESH::long_array; + SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array; int removed = myIdList.count(); anIdList->length(removed); for (i = 0; i < removed; i++) @@ -1263,7 +1263,7 @@ void SMESHGUI_GroupDlg::onListSelectionChanged() if (myCurrentLineEdit == 0) { mySelectionMgr->clearSelected(); - TColStd_MapOfInteger aIndexes; + SVTK_TVtkIDsMap aIndexes; QList selItems = myElements->selectedItems(); QListWidgetItem* anItem; foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt()); @@ -1956,7 +1956,7 @@ void SMESHGUI_GroupDlg::onAdd() // check if mesh is the same if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { try { - SMESH::long_array_var anElements = aSubMesh->GetElementsByType(aType); + SMESH::smIdType_array_var anElements = aSubMesh->GetElementsByType(aType); int k = anElements->length(); for (int i = 0; i < k; i++) { QString aText = QString::number(anElements[i]); @@ -2004,7 +2004,7 @@ void SMESHGUI_GroupDlg::onAdd() if (!aGroup->_is_nil()) { // check if mesh is the same if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anElements = aGroup->GetListOfID(); + SMESH::smIdType_array_var anElements = aGroup->GetListOfID(); int k = anElements->length(); for (int i = 0; i < k; i++) { QString aText = QString::number(anElements[i]); @@ -2062,7 +2062,7 @@ void SMESHGUI_GroupDlg::onAdd() aBelongToGeom->SetElementType(aType); aFilter->SetPredicate(aBelongToGeom); - SMESH::long_array_var anElements = aFilter->GetElementsId(myMesh); + SMESH::smIdType_array_var anElements = aFilter->GetElementsId(myMesh); int k = anElements->length(); for (int i = 0; i < k; i++) { @@ -2143,7 +2143,7 @@ void SMESHGUI_GroupDlg::onRemove() if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { if (aType == SMESH::NODE) { try { - SMESH::long_array_var anElements = aSubMesh->GetNodesId(); + SMESH::smIdType_array_var anElements = aSubMesh->GetNodesId(); int k = anElements->length(); for (int i = 0; i < k; i++) { QList found = @@ -2158,7 +2158,7 @@ void SMESHGUI_GroupDlg::onRemove() } else { try { - SMESH::long_array_var anElements = aSubMesh->GetElementsId(); + SMESH::smIdType_array_var anElements = aSubMesh->GetElementsId(); int k = anElements->length(); for (int i = 0; i < k; i++) { QList found = @@ -2185,7 +2185,7 @@ void SMESHGUI_GroupDlg::onRemove() if (!aGroup->_is_nil()) { // check if mesh is the same if (aGroup->GetType() == aType && aGroup->GetMesh()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anElements = aGroup->GetListOfID(); + SMESH::smIdType_array_var anElements = aGroup->GetListOfID(); int k = anElements->length(); for (int i = 0; i < k; i++) { QList found = @@ -2213,15 +2213,19 @@ void SMESHGUI_GroupDlg::onSort() // PAL5412: sorts items in ascending by "string" value // myElements->sort(true); // myElements->update(); - int i, k = myElements->count(); + vtkIdType i, k = myElements->count(); if (k > 0) { myIsBusy = true; - QList aSelected; - std::vector anArray(k); + QList aSelected; + std::vector anArray(k); // QMemArray anArray(k); // fill the array for (i = 0; i < k; i++) { - int id = myElements->item(i)->text().toInt(); + vtkIdType id; + if (sizeof(vtkIdType)==8) + id = myElements->item(i)->text().toLongLong(); + else + id = myElements->item(i)->text().toInt(); anArray[i] = id; if (myElements->item(i)->isSelected()) aSelected.append(id); diff --git a/src/SMESHGUI/SMESHGUI_IdPreview.cxx b/src/SMESHGUI/SMESHGUI_IdPreview.cxx index baa1a7314..083f6ff2f 100644 --- a/src/SMESHGUI/SMESHGUI_IdPreview.cxx +++ b/src/SMESHGUI/SMESHGUI_IdPreview.cxx @@ -97,13 +97,13 @@ SMESHGUI_IdPreview::SMESHGUI_IdPreview(SVTK_ViewWindow* theViewWindow): } void SMESHGUI_IdPreview::SetPointsData ( SMDS_Mesh* theMesh, - const TColStd_MapOfInteger & theNodesIdMap ) + const SVTK_TVtkIDsMap & theNodesIdMap ) { vtkPoints* aPoints = vtkPoints::New(); aPoints->SetNumberOfPoints(theNodesIdMap.Extent()); myIDs.clear(); - TColStd_MapIteratorOfMapOfInteger idIter( theNodesIdMap ); + SVTK_TVtkIDsMapIterator idIter( theNodesIdMap ); for( int i = 0; idIter.More(); idIter.Next(), i++ ) { const SMDS_MeshNode* aNode = theMesh->FindNode(idIter.Key()); diff --git a/src/SMESHGUI/SMESHGUI_IdPreview.h b/src/SMESHGUI/SMESHGUI_IdPreview.h index 6f1e14b44..e7c85e859 100644 --- a/src/SMESHGUI/SMESHGUI_IdPreview.h +++ b/src/SMESHGUI/SMESHGUI_IdPreview.h @@ -29,6 +29,7 @@ #include #include +#include #include @@ -52,7 +53,7 @@ public: SMESHGUI_IdPreview(SVTK_ViewWindow* theViewWindow); ~SMESHGUI_IdPreview(); - void SetPointsData( SMDS_Mesh* theMesh, const TColStd_MapOfInteger & theNodesIdMap ); + void SetPointsData( SMDS_Mesh* theMesh, const SVTK_TVtkIDsMap & theNodesIdMap ); void SetElemsData ( const std::vector & theElemsIdMap, const std::list & theGrCentersXYZ ); template< class INT_ITER, class XYZ_ITER > diff --git a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx index 5c06fe86f..6febe32b6 100644 --- a/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MakeNodeAtPointDlg.cxx @@ -533,9 +533,9 @@ bool SMESHGUI_MakeNodeAtPointOp::onApply() bool ok; int anId = myDlg->myId->text().toInt( &ok ); if( !ok || anId < 1 ) - anId = aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(), - myDlg->myDestinationY->GetValue(), - myDlg->myDestinationZ->GetValue()); + anId = FromIdType(aMeshEditor->FindNodeClosestTo(myDlg->myDestinationX->GetValue(), + myDlg->myDestinationY->GetValue(), + myDlg->myDestinationZ->GetValue())); int aResult = aMeshEditor->MoveNode(anId, myDlg->myDestinationX->GetValue(), @@ -770,9 +770,9 @@ void SMESHGUI_MakeNodeAtPointOp::redisplayPreview() myDlg->myDestDZ->setReadOnly(true); } if ( isPreview && isMoveNode && anId == 0 ) - anId = aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(), - myDlg->myDestinationY->GetValue(), - myDlg->myDestinationZ->GetValue()); + anId = FromIdType(aPreviewer->FindNodeClosestTo(myDlg->myDestinationX->GetValue(), + myDlg->myDestinationY->GetValue(), + myDlg->myDestinationZ->GetValue())); // find id and/or just compute preview aPreviewer->MoveNode(anId, myDlg->myDestinationX->GetValue(), @@ -869,8 +869,8 @@ void SMESHGUI_MakeNodeAtPointOp::onTextChange( const QString& theText ) if( const SMDS_MeshNode* aNode = aMesh->FindNode( theText.toInt() ) ) { - TColStd_MapOfInteger aListInd; - aListInd.Add( aNode->GetID() ); + SVTK_TVtkIDsMap aListInd; + aListInd.Add( FromIdType(aNode->GetID()) ); selector()->AddOrRemoveIndex( anIO, aListInd, false ); if( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( SMESHGUI::GetSMESHGUI() ) ) aViewWindow->highlight( anIO, true, true ); diff --git a/src/SMESHGUI/SMESHGUI_Measurements.cxx b/src/SMESHGUI/SMESHGUI_Measurements.cxx index a2373378e..8d3e72146 100644 --- a/src/SMESHGUI/SMESHGUI_Measurements.cxx +++ b/src/SMESHGUI/SMESHGUI_Measurements.cxx @@ -60,7 +60,7 @@ #include #include #include -#include +//#include #include #include @@ -357,7 +357,7 @@ void SMESHGUI_MinDistance::createPreview( double x1, double y1, double z1, doubl aCells->InsertNextCell( anIdList ); aCellTypesArray->InsertNextValue( VTK_LINE ); anIdList->Delete(); - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( 1 ); aCells->InitTraversal(); @@ -492,7 +492,7 @@ void SMESHGUI_MinDistance::firstEdited() if ( myFirstActor && selector ) { Handle(SALOME_InteractiveObject) IO = myFirstActor->getIO(); if ( myFirst->checkedId() == NodeTgt || myFirst->checkedId() == ElementTgt ) { - TColStd_MapOfInteger ID; + SVTK_TVtkIDsMap ID; ID.Add( myFirstTgt->text().toLong() ); selector->AddOrRemoveIndex( IO, ID, false ); } @@ -520,7 +520,7 @@ void SMESHGUI_MinDistance::secondEdited() Handle(SALOME_InteractiveObject) IO = mySecondActor->getIO(); if ( mySecond->checkedId() == NodeTgt || mySecond->checkedId() == ElementTgt ) { if ( !text.isEmpty() ) { - TColStd_MapOfInteger ID; + SVTK_TVtkIDsMap ID; ID.Add( text.toLong() ); selector->AddOrRemoveIndex( IO, ID, false ); } @@ -546,7 +546,7 @@ void SMESHGUI_MinDistance::compute() SMESH::SMESH_Mesh_var m = myFirstSrc->GetMesh(); long id = myFirstTgt->text().toLong(); if ( !CORBA::is_nil( m ) && id ) { - SMESH::long_array_var ids = new SMESH::long_array(); + SMESH::smIdType_array_var ids = new SMESH::smIdType_array(); ids->length( 1 ); ids[0] = id; SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor(); @@ -565,7 +565,7 @@ void SMESHGUI_MinDistance::compute() SMESH::SMESH_Mesh_var m = mySecondSrc->GetMesh(); long id = mySecondTgt->text().toLong(); if ( !CORBA::is_nil( m ) && id ) { - SMESH::long_array_var ids = new SMESH::long_array(); + SMESH::smIdType_array_var ids = new SMESH::smIdType_array(); ids->length( 1 ); ids[0] = id; SMESH::SMESH_MeshEditor_var me = m->GetMeshEditor(); @@ -891,7 +891,7 @@ void SMESHGUI_BoundingBox::createPreview( double minX, double maxX, double minY, aCells->InsertNextCell( anIdList ); aCellTypesArray->InsertNextValue( VTK_LINE ); anIdList->Delete(); - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( 12 ); aCells->InitTraversal(); @@ -1022,7 +1022,7 @@ void SMESHGUI_BoundingBox::sourceEdited() if ( myActor && selector ) { Handle(SALOME_InteractiveObject) IO = myActor->getIO(); if ( mySourceMode->checkedId() == NodesSrc || mySourceMode->checkedId() == ElementsSrc ) { - TColStd_MapOfInteger ID; + SVTK_TVtkIDsMap ID; if ( !mySource->isReadOnly() ) myIDs = mySource->text(); QStringList ids = myIDs.split( " ", QString::SkipEmptyParts ); @@ -1047,7 +1047,7 @@ void SMESHGUI_BoundingBox::compute() SMESH::SMESH_Mesh_var m = mySrc[0]->GetMesh(); QStringList ids = myIDs.split( " ", QString::SkipEmptyParts ); if ( !CORBA::is_nil( m ) && ids.count() > 0 ) { - SMESH::long_array_var ids_in = new SMESH::long_array(); + SMESH::smIdType_array_var ids_in = new SMESH::smIdType_array(); ids_in->length( ids.count() ); for( int i = 0; i < ids.count(); i++ ) ids_in[i] = ids[i].trimmed().toLong(); @@ -1420,7 +1420,7 @@ void SMESHGUI_Angle::selectionChanged() clear(); QString nodesString; - TColStd_IndexedMapOfInteger idsMap; + SVTK_TIndexedMapOfVtkId idsMap; SALOME_ListIO selected; SMESHGUI::selectionMgr()->selectedObjects( selected ); selected.Reverse(); // to keep order of selection @@ -1528,7 +1528,7 @@ void SMESHGUI_Angle::nodesEdited() { clear(); - TColStd_MapOfInteger ID; + SVTK_TVtkIDsMap ID; QStringList ids = myNodes->text().split( " ", QString::SkipEmptyParts ); foreach ( QString idStr, ids ) { diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx index 63d4b9d30..9ea3045d2 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.cxx @@ -469,7 +469,7 @@ void SMESHGUI_MergeDlg::Init() // function : FindGravityCenter() // purpose : //================================================================================= -void SMESHGUI_MergeDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap, +void SMESHGUI_MergeDlg::FindGravityCenter(SVTK_TVtkIDsMap & theElemsIdMap, std::vector& theIDs, std::list< gp_XYZ > & theGrCentersXYZ) { @@ -484,7 +484,7 @@ void SMESHGUI_MergeDlg::FindGravityCenter(TColStd_MapOfInteger & theElemsIdMap, int nbNodes; theIDs.reserve( theElemsIdMap.Extent() ); - TColStd_MapIteratorOfMapOfInteger idIter( theElemsIdMap ); + SVTK_TVtkIDsMapIterator idIter( theElemsIdMap ); for( ; idIter.More(); idIter.Next() ) { const SMDS_MeshElement* anElem = aMesh->FindElement(idIter.Key()); if ( !anElem ) @@ -556,7 +556,7 @@ bool SMESHGUI_MergeDlg::ClickOnApply() int i, nb = KeepList->count(); if ( isKeepIDsSelection() ) { - SMESH::long_array_var anIdList = new SMESH::long_array(); + SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array(); anIdList->length(nb); for (i = 0; i < nb; i++) anIdList[i] = KeepList->item(i)->text().toInt(); @@ -845,7 +845,7 @@ void SMESHGUI_MergeDlg::onSelectGroup() myIsBusy = true; ListEdit->clear(); - TColStd_MapOfInteger anIndices; + SVTK_TVtkIDsMap anIndices; QList selItems = ListCoincident->selectedItems(); QListWidgetItem* anItem; QStringList aListIds; @@ -908,7 +908,7 @@ void SMESHGUI_MergeDlg::onSelectElementFromGroup() if (myIsBusy || !myActor) return; - TColStd_MapOfInteger anIndices; + SVTK_TVtkIDsMap anIndices; QList selItems = ListEdit->selectedItems(); QListWidgetItem* anItem; @@ -1595,7 +1595,7 @@ void SMESHGUI_MergeDlg::onSelectKeep() if ( myActor ) { mySelectionMgr->clearSelected(); - TColStd_MapOfInteger aIndexes; + SVTK_TVtkIDsMap aIndexes; QList selItems = KeepList->selectedItems(); QListWidgetItem* anItem; foreach(anItem, selItems) aIndexes.Add(anItem->text().toInt()); diff --git a/src/SMESHGUI/SMESHGUI_MergeDlg.h b/src/SMESHGUI/SMESHGUI_MergeDlg.h index 5cecfd2f6..e421671e8 100644 --- a/src/SMESHGUI/SMESHGUI_MergeDlg.h +++ b/src/SMESHGUI/SMESHGUI_MergeDlg.h @@ -30,8 +30,9 @@ // SMESH includes #include "SMESH_SMESHGUI.hxx" -// Qt includes +// GUI and Qt includes #include +#include // OCCT includes #include @@ -88,7 +89,7 @@ private: bool isKeepIDsSelection(); bool isNewKeepGroup( const char* entry ); - void FindGravityCenter( TColStd_MapOfInteger&, + void FindGravityCenter( SVTK_TVtkIDsMap&, std::vector& , std::list& ); // add the centers of gravity of ElemsIdMap elements to the GrCentersXYZ list diff --git a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx index 878819bf6..cefb4f30c 100644 --- a/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshEditPreview.cxx @@ -34,7 +34,7 @@ // SALOME GUI includes #include #include -#include +//#include // VTK includes #include @@ -217,7 +217,7 @@ void SMESHGUI_MeshEditPreview::SetData (const SMESH::MeshPreviewStruct& previewD anIdList->Delete(); // Insert cells in grid - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( aNbCells ); diff --git a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx index 66db3c27f..57b76a490 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfo.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfo.cxx @@ -3315,7 +3315,7 @@ void SMESHGUI_MeshInfoDlg::idChanged() myIDPreview->SetPointsLabeled( false ); if ( myProxy ) { - TColStd_MapOfInteger ID; + SVTK_TVtkIDsMap ID; QSet ids; std::vector idVec; std::list< gp_XYZ > aGrCentersXYZ; @@ -3646,14 +3646,14 @@ void SMESHGUI_CtrlInfo::showInfo( const SMESH::SelectionProxy& proxy ) for ( int i = 0; i < myButtons.count(); ++i ) myButtons[i]->setEnabled( true ); - SMESH::long_array_var nbElemsByType = obj->GetNbElementsByType(); + SMESH::smIdType_array_var nbElemsByType = obj->GetNbElementsByType(); if ( ! &nbElemsByType.in() ) return; const CORBA::Long ctrlLimit = meshLoaded ? SMESHGUI::resourceMgr()->integerValue( "SMESH", "info_controls_limit", 3000 ) : -1; // nodes info - const CORBA::Long nbNodes = nbElemsByType[ SMESH::NODE ]; + const SMESH::smIdType nbNodes = nbElemsByType[ SMESH::NODE ]; // const CORBA::Long nbElems = ( nbElemsByType[ SMESH::EDGE ] + // nbElemsByType[ SMESH::FACE ] + // nbElemsByType[ SMESH::VOLUME ] ); diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx b/src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx index 72daba57a..c1a3e8cc4 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfosBox.cxx @@ -418,7 +418,7 @@ SMESHGUI_MeshInfosBox::SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent */ // ========================================================================================= -void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo) +void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::smIdType_array& theInfo) { // nodes myNbNode ->setText( QString("%1").arg( theInfo[SMDSEntity_Node] )); diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosBox.h b/src/SMESHGUI/SMESHGUI_MeshInfosBox.h index 832001359..71448bd2a 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosBox.h +++ b/src/SMESHGUI/SMESHGUI_MeshInfosBox.h @@ -46,7 +46,7 @@ class SMESHGUI_EXPORT SMESHGUI_MeshInfosBox : public QGroupBox public: SMESHGUI_MeshInfosBox( const bool, QWidget* ); - void SetMeshInfo( const SMESH::long_array& theInfo ); + void SetMeshInfo( const SMESH::smIdType_array& theInfo ); private: bool myFull; diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx index aabcb6020..44c8944c8 100644 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx @@ -58,7 +58,7 @@ #include #include -#include +//#include // SALOME KERNEL includes #include @@ -479,9 +479,9 @@ bool SMESHGUI_MeshPatternDlg::onApply() } QList ids; getIds(ids); - SMESH::long_array_var varIds = new SMESH::long_array(); + SMESH::smIdType_array_var varIds = new SMESH::smIdType_array(); varIds->length(ids.count()); - int i = 0; + CORBA::ULong i = 0; for (QList::iterator it = ids.begin(); it != ids.end(); ++it) varIds[i++] = *it; myType == Type_2d @@ -1258,9 +1258,9 @@ vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid() SMESH::point_array_var pnts; QList ids; if (isRefine() && getIds(ids)) { - SMESH::long_array_var varIds = new SMESH::long_array(); + SMESH::smIdType_array_var varIds = new SMESH::smIdType_array(); varIds->length(ids.count()); - int i = 0; + CORBA::ULong i = 0; for (QList::iterator it = ids.begin(); it != ids.end(); ++it) varIds[i++] = *it; pnts = myType == Type_2d @@ -1339,7 +1339,7 @@ vtkUnstructuredGrid* SMESHGUI_MeshPatternDlg::getGrid() else aCellTypesArray->InsertNextValue(VTK_EMPTY_CELL); } - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); @@ -1411,7 +1411,7 @@ void SMESHGUI_MeshPatternDlg::onTextChanged (const QString& theNewText) if (aMesh) { QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; for (int i = 0; i < aListId.count(); i++) { const SMDS_MeshElement * e = aMesh->FindElement(aListId[ i ].toInt()); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index d6ff130e1..34ba6a13a 100644 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -57,7 +57,7 @@ #include #include -#include +//#include // OCCT includes #include @@ -437,9 +437,9 @@ void SMESHGUI_MultiEditDlg::onOk() // Purpose : Retrieve identifiers from list box or the whole object //======================================================================= -SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj) +SMESH::smIdType_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj) { - SMESH::long_array_var anIds = new SMESH::long_array; + SMESH::smIdType_array_var anIds = new SMESH::smIdType_array; if (myToAllChk->isChecked()) { @@ -697,7 +697,7 @@ void SMESHGUI_MultiEditDlg::onAddBtn() if (nbSelected == 0) return; - TColStd_IndexedMapOfInteger toBeAdded; + SVTK_TIndexedMapOfVtkId toBeAdded; if (!mySubmeshChk->isChecked() && !myGroupChk->isChecked()) { if (nbSelected > 0) @@ -709,9 +709,9 @@ void SMESHGUI_MultiEditDlg::onAddBtn() SMESH::IObjectToInterface(anIter.Value()); if (!aSubMesh->_is_nil()) { if (aSubMesh->GetFather()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anIds = aSubMesh->GetElementsId(); + SMESH::smIdType_array_var anIds = aSubMesh->GetElementsId(); for (int i = 0, n = anIds->length(); i < n; i++) { - if (isIdValid(anIds[ i ])) + if (isIdValid(FromIdType(anIds[ i ]))) toBeAdded.Add(anIds[ i ]); } } @@ -725,9 +725,9 @@ void SMESHGUI_MultiEditDlg::onAddBtn() if (!aGroup->_is_nil() && ((aGroup->GetType() == SMESH::FACE && entityType() == 0) || (aGroup->GetType() == SMESH::VOLUME && entityType() == 1))) { if (aGroup->GetMesh()->GetId() == myMesh->GetId()) { - SMESH::long_array_var anIds = aGroup->GetListOfID(); + SMESH::smIdType_array_var anIds = aGroup->GetListOfID(); for (int i = 0, n = anIds->length(); i < n; i++) { - if (isIdValid(anIds[ i ])) + if (isIdValid(FromIdType(anIds[ i ]))) toBeAdded.Add(anIds[ i ]); } } @@ -875,7 +875,7 @@ void SMESHGUI_MultiEditDlg::onListSelectionChanged() anActor = myActor; TVisualObjPtr anObj = anActor->GetObject(); - TColStd_MapOfInteger anIndexes; + SVTK_TVtkIDsMap anIndexes; int total = myListBox->count(); for (int i = 0; i < total; i++) { @@ -1008,7 +1008,7 @@ bool SMESHGUI_MultiEditDlg::onApply() SUIT_OverrideCursor aWaitCursor; SMESH::SMESH_IDSource_var obj; - SMESH::long_array_var anIds = getIds(obj); + SMESH::smIdType_array_var anIds = getIds(obj); bool aResult = process(aMeshEditor, anIds.inout(), obj); if (aResult) { @@ -1099,9 +1099,9 @@ SMESHGUI_ChangeOrientationDlg::~SMESHGUI_ChangeOrientationDlg() { } -bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, - const SMESH::long_array& theIds, - SMESH::SMESH_IDSource_ptr obj) +bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, + const SMESH::smIdType_array& theIds, + SMESH::SMESH_IDSource_ptr obj) { if ( CORBA::is_nil( obj )) return theEditor->Reorient(theIds); @@ -1111,7 +1111,7 @@ bool SMESHGUI_ChangeOrientationDlg::process (SMESH::SMESH_MeshEditor_ptr theEdit int SMESHGUI_ChangeOrientationDlg::nbElemsInMesh() { - return ( myFilterType == SMESH::FaceFilter ) ? myMesh->NbFaces() : myMesh->NbVolumes(); + return ( myFilterType == SMESH::FaceFilter ) ? FromIdType(myMesh->NbFaces()) : FromIdType(myMesh->NbVolumes()); } /*! @@ -1189,7 +1189,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::isValid (const bool theMess) } bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, - const SMESH::long_array& theIds, + const SMESH::smIdType_array& theIds, SMESH::SMESH_IDSource_ptr obj) { { @@ -1209,7 +1209,7 @@ bool SMESHGUI_UnionOfTrianglesDlg::process (SMESH::SMESH_MeshEditor_ptr theEdito int SMESHGUI_UnionOfTrianglesDlg::nbElemsInMesh() { - return myMesh->NbTriangles(); + return FromIdType(myMesh->NbTriangles()); } void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview ) @@ -1220,7 +1220,7 @@ void SMESHGUI_UnionOfTrianglesDlg::onDisplaySimulation( bool toDisplayPreview ) SUIT_OverrideCursor aWaitCursor; // get Ids of elements SMESH::SMESH_IDSource_var obj; - SMESH::long_array_var anElemIds = getIds( obj ); + SMESH::smIdType_array_var anElemIds = getIds( obj ); SMESH::NumericalFunctor_var aCriterion = getNumericalFunctor(); SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditPreviewer(); @@ -1302,7 +1302,7 @@ void SMESHGUI_CuttingOfQuadsDlg::reject() } bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, - const SMESH::long_array& theIds, + const SMESH::smIdType_array& theIds, SMESH::SMESH_IDSource_ptr obj) { bool hasObj = (! CORBA::is_nil( obj )); @@ -1329,7 +1329,7 @@ bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, int SMESHGUI_CuttingOfQuadsDlg::nbElemsInMesh() { - return myMesh->NbQuadrangles(); + return FromIdType(myMesh->NbQuadrangles()); } @@ -1382,7 +1382,7 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview() SUIT_OverrideCursor aWaitCursor; // get Ids of elements SMESH::SMESH_IDSource_var obj; - SMESH::long_array_var anElemIds = getIds(obj); + SMESH::smIdType_array_var anElemIds = getIds(obj); if (anElemIds->length() == 0 && obj->_is_nil() ) return; @@ -1439,13 +1439,13 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview() const SMDS_MeshNode* aNode = static_cast(anIter->next()); if (aNode) { - if (!anIdToVtk.IsBound(aNode->GetID())) + if (!anIdToVtk.IsBound(FromIdType(aNode->GetID()))) { aPoints->SetPoint(++nbPoints, aNode->X(), aNode->Y(), aNode->Z()); - anIdToVtk.Bind(aNode->GetID(), nbPoints); + anIdToVtk.Bind(FromIdType(aNode->GetID()), nbPoints); } - aNodes[ k++ ] = aNode->GetID(); + aNodes[ k++ ] = FromIdType(aNode->GetID()); } } @@ -1464,7 +1464,7 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview() else // use numerical functor { // compare two sets of possible triangles - int diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion); + smIdType diag = aMeshEditor->BestSplit(anElemIds[i], aCriterion); if (diag == 1) // 1-3 isDiag13 = true; else if (diag == 2) // 2-4 @@ -1503,7 +1503,7 @@ void SMESHGUI_CuttingOfQuadsDlg::displayPreview() } } - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents(1); aCellLocationsArray->SetNumberOfTuples(aNbCells); @@ -1648,7 +1648,7 @@ SMESHGUI_SplitVolumesDlg::~SMESHGUI_SplitVolumesDlg() } bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, - const SMESH::long_array& theIds, + const SMESH::smIdType_array& theIds, SMESH::SMESH_IDSource_ptr theObj) { SMESH::IDSource_wrap obj = theObj; @@ -1698,7 +1698,7 @@ bool SMESHGUI_SplitVolumesDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor, int SMESHGUI_SplitVolumesDlg::nbElemsInMesh() { - return isIntoPrisms() ? myMesh->NbHexas() : myMesh->NbVolumes() - myMesh->NbTetras(); + return isIntoPrisms() ? FromIdType(myMesh->NbHexas()) : FromIdType(myMesh->NbVolumes() - myMesh->NbTetras()); } bool SMESHGUI_SplitVolumesDlg::isIntoPrisms() @@ -1818,7 +1818,7 @@ void SMESHGUI_SplitVolumesDlg::onSelectionDone() if (!aSelMesh->_is_nil()) myMesh = aSelMesh; - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; mySelector->GetIndex( anIO, aMapIndex ); if ( !aMapIndex.IsEmpty() ) showFacetByElement( aMapIndex(1) ); diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h index 019afa885..e62901bfe 100644 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h @@ -113,12 +113,12 @@ protected: QWidget* createButtonFrame( QWidget* ); QWidget* createMainFrame( QWidget*, const bool ); virtual bool isValid( const bool ); - SMESH::long_array_var getIds(SMESH::SMESH_IDSource_var& obj); + SMESH::smIdType_array_var getIds(SMESH::SMESH_IDSource_var& obj); void updateButtons(); virtual void setSelectionMode(); virtual bool isIdValid( const int ) const; virtual bool process( SMESH::SMESH_MeshEditor_ptr, - const SMESH::long_array& , + const SMESH::smIdType_array& , SMESH::SMESH_IDSource_ptr obj) = 0; virtual int nbElemsInMesh() = 0; int entityType(); @@ -182,7 +182,7 @@ public: protected: virtual bool process( SMESH::SMESH_MeshEditor_ptr, - const SMESH::long_array& , + const SMESH::smIdType_array& , SMESH::SMESH_IDSource_ptr obj); virtual int nbElemsInMesh(); }; @@ -202,7 +202,7 @@ public: protected: virtual bool isValid( const bool ); virtual bool process( SMESH::SMESH_MeshEditor_ptr, - const SMESH::long_array&, + const SMESH::smIdType_array&, SMESH::SMESH_IDSource_ptr obj ); virtual int nbElemsInMesh(); @@ -227,7 +227,7 @@ public: protected: virtual bool process( SMESH::SMESH_MeshEditor_ptr, - const SMESH::long_array& , + const SMESH::smIdType_array& , SMESH::SMESH_IDSource_ptr obj); virtual int nbElemsInMesh(); @@ -269,7 +269,7 @@ protected slots: protected: virtual bool process( SMESH::SMESH_MeshEditor_ptr, - const SMESH::long_array&, + const SMESH::smIdType_array&, SMESH::SMESH_IDSource_ptr obj ); virtual int nbElemsInMesh(); diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index fe21898a1..676bce318 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -55,7 +55,7 @@ #include #include -#include +//#include // SALOME KERNEL includes #include @@ -152,7 +152,7 @@ namespace SMESH aCells->InsertNextCell( anIdList ); aCellTypesArray->InsertNextValue( VTK_VERTEX ); - VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New(); + vtkIdTypeArray* aCellLocationsArray = vtkIdTypeArray::New(); aCellLocationsArray->SetNumberOfComponents( 1 ); aCellLocationsArray->SetNumberOfTuples( 1 ); @@ -497,7 +497,7 @@ bool SMESHGUI_NodesDlg::ClickOnApply() } if ( !aGroupUsed->_is_nil() ) { - SMESH::long_array_var anIdList = new SMESH::long_array; + SMESH::smIdType_array_var anIdList = new SMESH::smIdType_array; anIdList->length( 1 ); anIdList[0] = aNodeId; aGroupUsed->Add( anIdList.inout() ); diff --git a/src/SMESHGUI/SMESHGUI_OffsetDlg.cxx b/src/SMESHGUI/SMESHGUI_OffsetDlg.cxx index 2eb920369..ee7716ee6 100644 --- a/src/SMESHGUI/SMESHGUI_OffsetDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_OffsetDlg.cxx @@ -340,7 +340,7 @@ bool SMESHGUI_OffsetDlg::ClickOnApply() { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) anElementsId[i] = aListElementsId[i].toInt(); @@ -552,7 +552,7 @@ void SMESHGUI_OffsetDlg::onTextChange (const QString& theNewText) if (aMesh) { Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); for (int i = 0; i < aListId.count(); i++) @@ -918,7 +918,7 @@ void SMESHGUI_OffsetDlg::onDisplaySimulation( bool toDisplayPreview ) } else { - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) diff --git a/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx b/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx index 6f329dd13..71fa59799 100644 --- a/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx +++ b/src/SMESHGUI/SMESHGUI_PreVisualObj.cxx @@ -45,7 +45,7 @@ void SMESHGUI_PreVisualObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& th if ( theFunctor ) theFunctor->SetMesh( GetMesh() ); } -int SMESHGUI_PreVisualObj::GetElemDimension( const int theObjId ) +int SMESHGUI_PreVisualObj::GetElemDimension( const smIdType theObjId ) { if ( const SMDS_MeshElement* anElem = myMesh->FindElement( theObjId )) { @@ -62,7 +62,7 @@ int SMESHGUI_PreVisualObj::GetElemDimension( const int theObjId ) return -1; } -int SMESHGUI_PreVisualObj::GetNbEntities( const SMDSAbs_ElementType theType ) const +smIdType SMESHGUI_PreVisualObj::GetNbEntities( const SMDSAbs_ElementType theType ) const { return myMesh->GetMeshInfo().NbElements( theType ); } @@ -77,10 +77,10 @@ SMESH::SMESH_Mesh_ptr SMESHGUI_PreVisualObj::GetMeshServer() // purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 1 ) //================================================================================= -bool SMESHGUI_PreVisualObj::GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const +bool SMESHGUI_PreVisualObj::GetEdgeNodes( const smIdType theElemId, + const int theEdgeNum, + smIdType& theNodeId1, + smIdType& theNodeId2 ) const { const SMDS_MeshElement* e = myMesh->FindElement( theElemId ); if ( !e || e->GetType() != SMDSAbs_Face ) @@ -107,24 +107,24 @@ vtkUnstructuredGrid* SMESHGUI_PreVisualObj::GetUnstructuredGrid() } -vtkIdType SMESHGUI_PreVisualObj::GetNodeObjId( int theVTKID ) +vtkIdType SMESHGUI_PreVisualObj::GetNodeObjId( vtkIdType theVTKID ) { const SMDS_MeshNode* aNode = myMesh->FindNodeVtk( theVTKID ); return aNode ? aNode->GetID() : -1; } -vtkIdType SMESHGUI_PreVisualObj::GetNodeVTKId( int theObjID ) +vtkIdType SMESHGUI_PreVisualObj::GetNodeVTKId( vtkIdType theObjID ) { const SMDS_MeshNode* aNode = myMesh->FindNode( theObjID ); return aNode ? aNode->GetID() : -1; } -vtkIdType SMESHGUI_PreVisualObj::GetElemObjId( int theVTKID ) +vtkIdType SMESHGUI_PreVisualObj::GetElemObjId( vtkIdType theVTKID ) { return this->GetMesh()->FromVtkToSmds(theVTKID); } -vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( int theObjID ) +vtkIdType SMESHGUI_PreVisualObj::GetElemVTKId( vtkIdType theObjID ) { const SMDS_MeshElement* e = myMesh->FindElement(theObjID); return e ? e->GetVtkID() : -1; diff --git a/src/SMESHGUI/SMESHGUI_PreVisualObj.h b/src/SMESHGUI/SMESHGUI_PreVisualObj.h index 9cd8e4ef5..321bc8f49 100644 --- a/src/SMESHGUI/SMESHGUI_PreVisualObj.h +++ b/src/SMESHGUI/SMESHGUI_PreVisualObj.h @@ -51,18 +51,18 @@ class SMESHGUI_EXPORT SMESHGUI_PreVisualObj : public SMESH_VisualObj virtual bool Update( int theIsClear ); virtual bool NulData() { return false; } virtual void UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor ); - virtual int GetElemDimension( const int theObjId ); - virtual int GetNbEntities( const SMDSAbs_ElementType theType) const; + virtual int GetElemDimension( const smIdType theObjId ); + virtual smIdType GetNbEntities( const SMDSAbs_ElementType theType) const; virtual bool IsValid() const; - virtual bool GetEdgeNodes( const int theElemId, - const int theEdgeNum, - int& theNodeId1, - int& theNodeId2 ) const; + virtual bool GetEdgeNodes( const smIdType theElemId, + const int theEdgeNum, + smIdType& theNodeId1, + smIdType& theNodeId2 ) const; - virtual vtkIdType GetNodeObjId( int theVTKID ); - virtual vtkIdType GetNodeVTKId( int theObjID ); - virtual vtkIdType GetElemObjId( int theVTKID ); - virtual vtkIdType GetElemVTKId( int theObjID ); + virtual vtkIdType GetNodeObjId( vtkIdType theVTKID ); + virtual vtkIdType GetNodeVTKId( vtkIdType theObjID ); + virtual vtkIdType GetElemObjId( vtkIdType theVTKID ); + virtual vtkIdType GetElemVTKId( vtkIdType theObjID ); virtual void ClearEntitiesFlags(); virtual bool GetEntitiesFlag(); virtual unsigned int GetEntitiesState(); diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index e8b27479e..7ef8401c4 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -231,7 +231,7 @@ void SMESHGUI_RemoveElementsDlg::ClickOnApply() SUIT_OverrideCursor wc; QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array; + SMESH::smIdType_array_var anArrayOfIdeces = new SMESH::smIdType_array; anArrayOfIdeces->length(aListId.count()); for (int i = 0; i < aListId.count(); i++) anArrayOfIdeces[i] = aListId[ i ].toInt(); @@ -348,7 +348,7 @@ void SMESHGUI_RemoveElementsDlg::onTextChange(const QString& theNewText) if(SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh()){ Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); for (int i = 0; i < aListId.count(); i++) { diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx index c86b24a78..fe0fe6cbc 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx @@ -234,7 +234,7 @@ void SMESHGUI_RemoveNodesDlg::ClickOnApply() if (myNbOkNodes) { QStringList aListId = myEditCurrentArgument->text().split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anArrayOfIdeces = new SMESH::long_array; + SMESH::smIdType_array_var anArrayOfIdeces = new SMESH::smIdType_array; anArrayOfIdeces->length(aListId.count()); for (int i = 0; i < aListId.count(); i++) anArrayOfIdeces[i] = aListId[ i ].toInt(); @@ -356,7 +356,7 @@ void SMESHGUI_RemoveNodesDlg::onTextChange(const QString& theNewText) if(SMDS_Mesh* aMesh = myActor->GetObject()->GetMesh()){ Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); for (int i = 0; i < aListId.count(); i++) { diff --git a/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx b/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx index 8c6d52952..620802fe8 100644 --- a/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ReorientFacesDlg.cxx @@ -518,7 +518,7 @@ void SMESHGUI_ReorientFacesOp::selectionDone() if ( nbSelected == 1 ) { - TColStd_IndexedMapOfInteger faceIndices; + SVTK_TIndexedMapOfVtkId faceIndices; selector()->GetIndex( anIO, faceIndices ); if ( faceIndices.Extent() == 1 ) { @@ -558,7 +558,7 @@ void SMESHGUI_ReorientFacesOp::selectionDone() } else { - TColStd_IndexedMapOfInteger nodeIndices; + SVTK_TIndexedMapOfVtkId nodeIndices; selector()->GetIndex( anIO, nodeIndices ); if ( nodeIndices.Extent() > 0 && nodeIndices.Extent() <=2 ) { @@ -620,7 +620,7 @@ void SMESHGUI_ReorientFacesOp::onTextChange( const QString& theText ) myDlg->activateObject( EFace ); myDlg->setObjectText( EFace, theText ); } - TColStd_MapOfInteger ids; + SVTK_TVtkIDsMap ids; if ( !theText.isEmpty() && theText.toInt() > 0 ) ids.Add( theText.toInt() ); diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index b9b21708f..3b21f38b1 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -57,7 +57,7 @@ #include #include #include -#include +//#include // OCCT includes #include @@ -602,7 +602,7 @@ void SMESHGUI_RevolutionDlg::SelectionIntoArgument() return; Handle(SALOME_InteractiveObject) IO = aList.First(); - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; mySelector->GetIndex(IO,aMapIndex); if ( aMapIndex.Extent() != 1 ) return; diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 249cc98e1..b0e12148f 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -409,7 +409,7 @@ bool SMESHGUI_RotationDlg::ClickOnApply() if (myNbOkElements && IsAxisOk()) { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) @@ -644,7 +644,7 @@ void SMESHGUI_RotationDlg::onTextChange (const QString& theNewText) if (send == LineEditElements) { Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); for (int i = 0; i < aListId.count(); i++) { @@ -1135,7 +1135,7 @@ void SMESHGUI_RotationDlg::onDisplaySimulation( bool toDisplayPreview ) { if (myPreviewCheckBox->isChecked() && toDisplayPreview) { if(myNbOkElements && isValid() && IsAxisOk()) { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) diff --git a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx index 5d17c49dd..c71d28d16 100644 --- a/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ScaleDlg.cxx @@ -448,7 +448,7 @@ bool SMESHGUI_ScaleDlg::ClickOnApply() if (myNbOkElements) { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) @@ -682,7 +682,7 @@ void SMESHGUI_ScaleDlg::onTextChange (const QString& theNewText) if (aMesh) { Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); @@ -1145,7 +1145,7 @@ void SMESHGUI_ScaleDlg::onDisplaySimulation( bool toDisplayPreview ) { if ( myNbOkElements && isValid() ) { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx index c84dd447e..45d111e98 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.cxx @@ -262,7 +262,7 @@ void SMESHGUI_SelectionOp::highlight( const Handle( SALOME_InteractiveObject )& // Purpose : Select/deselect cells of mesh //======================================================================= void SMESHGUI_SelectionOp::addOrRemoveIndex( const Handle( SALOME_InteractiveObject )& obj, - const TColStd_MapOfInteger& indices, + const SVTK_TVtkIDsMap& indices, const bool isModeShift ) { SVTK_Selector* sel = selector(); @@ -468,7 +468,7 @@ void SMESHGUI_SelectionOp::onTextChanged( int, const QStringList& list ) if( !dlg() ) return; - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; SALOME_ListIO sel; selectionMgr()->selectedObjects( sel ); SMESH_Actor* anActor = actor(); diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.h b/src/SMESHGUI/SMESHGUI_SelectionOp.h index de37e058f..1d265b3bd 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.h +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.h @@ -34,6 +34,7 @@ // SALOME GUI includes #include +#include #include // IDL includes @@ -110,7 +111,7 @@ protected: //! Select some nodes or elements in VTK void addOrRemoveIndex( const Handle( SALOME_InteractiveObject )&, - const TColStd_MapOfInteger&, const bool isModeShift); + const SVTK_TVtkIDsMap&, const bool isModeShift); SVTK_ViewWindow* viewWindow() const; SVTK_Selector* selector() const; diff --git a/src/SMESHGUI/SMESHGUI_SelectionProxy.cxx b/src/SMESHGUI/SMESHGUI_SelectionProxy.cxx index 38cde8a4d..bee62cff4 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionProxy.cxx +++ b/src/SMESHGUI/SMESHGUI_SelectionProxy.cxx @@ -276,7 +276,7 @@ SMESH::MeshInfo SMESH::SelectionProxy::meshInfo() const SMESH::MeshInfo info; if ( !isNull() ) { - SMESH::long_array_var data = myObject->GetMeshInfo(); + SMESH::smIdType_array_var data = myObject->GetMeshInfo(); for ( uint type = SMESH::Entity_Node; type < SMESH::Entity_Last; type++ ) { if ( type < data->length() ) @@ -494,7 +494,7 @@ bool SMESH::SelectionProxy::nodeConnectivity( int id, SMESH::Connectivity& conne SMESH::SMESH_Mesh_var mesh = myObject->GetMesh(); if ( !CORBA::is_nil( mesh ) ) { - SMESH::long_array_var elements = mesh->GetNodeInverseElements( id, SMESH::ALL ); + SMESH::smIdType_array_var elements = mesh->GetNodeInverseElements( id, SMESH::ALL ); for ( int i = 0, n = elements->length(); i < n; i++ ) { SMESH::ElementType type = mesh->GetElementType( elements[i], true ); @@ -589,7 +589,7 @@ bool SMESH::SelectionProxy::hasElement( int id ) SMESH::SMESH_Mesh_var mesh = myObject->GetMesh(); if ( !CORBA::is_nil( mesh ) ) { - SMESH::long_array_var nodes = mesh->GetElemNodes( id ); + SMESH::smIdType_array_var nodes = mesh->GetElemNodes( id ); result = nodes->length() > 0; } } @@ -663,13 +663,13 @@ int SMESH::SelectionProxy::elementEntityType( int id ) const \param connectivity Return element connectivity. \return \c true if result is valid; \c false otherwise. */ -bool SMESH::SelectionProxy::elementConnectivity( int id, Connectivity& connectivity ) +bool SMESH::SelectionProxy::elementConnectivity( SMESH::smIdType id, Connectivity& connectivity ) { bool result = false; connectivity.clear(); if ( !isNull() ) { - QSet nodes; // order of nodes is important + QSet nodes; // order of nodes is important if ( actor() ) { const SMDS_MeshElement* element = actor()->GetObject()->GetMesh()->FindElement( id ); @@ -678,7 +678,7 @@ bool SMESH::SelectionProxy::elementConnectivity( int id, Connectivity& connectiv { while ( it->more() ) { - int n = it->next()->GetID(); + SMESH::smIdType n = it->next()->GetID(); if ( !nodes.contains( n )) { connectivity[ SMDSAbs_Node ] << n; @@ -693,7 +693,7 @@ bool SMESH::SelectionProxy::elementConnectivity( int id, Connectivity& connectiv SMESH::SMESH_Mesh_var mesh = myObject->GetMesh(); if ( !CORBA::is_nil( mesh ) ) { - SMESH::long_array_var nn = mesh->GetElemNodes( id ); + SMESH::smIdType_array_var nn = mesh->GetElemNodes( id ); for ( int i = 0, nb = nn->length(); i < nb; i++ ) { if ( !nodes.contains( nn[i] )) @@ -751,7 +751,7 @@ bool SMESH::SelectionProxy::perFaceConnectivity( int id, Connectivity& connectiv CORBA::Long nbFaces = mesh->ElemNbFaces( id ); for ( CORBA::Long iF = 0; iF < nbFaces; ++iF ) { - SMESH::long_array_var nodes = mesh->GetElemFaceNodes( id, iF ); + SMESH::smIdType_array_var nodes = mesh->GetElemFaceNodes( id, iF ); for ( CORBA::ULong iN = 0; iN < nodes->length(); ++iN ) { connectivity[ iF+1 ] << nodes[iN]; @@ -825,7 +825,7 @@ bool SMESH::SelectionProxy::elementGravityCenter( int id, SMESH::XYZ& xyz ) SMESH::SMESH_Mesh_var mesh = myObject->GetMesh(); if ( !CORBA::is_nil( mesh ) ) { - SMESH::long_array_var nodes = mesh->GetElemNodes( id ); + SMESH::smIdType_array_var nodes = mesh->GetElemNodes( id ); for ( int i = 0, n = nodes->length(); i < n; i++ ) { SMESH::double_array_var coords = mesh->GetNodeXYZ( nodes[i] ); @@ -1159,10 +1159,10 @@ QColor SMESH::SelectionProxy::color() const \param autoCompute Compute size if it is unavailable. Defaults to \c false. \return Group's size. */ -int SMESH::SelectionProxy::size( bool autoCompute ) const +SMESH::smIdType SMESH::SelectionProxy::size( bool autoCompute ) const { // note: size is not computed for group on filter for performance reasons, see IPAL52831 - int result = -1; + SMESH::smIdType result = -1; if ( !isNull() ) { SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow( myObject ); @@ -1187,10 +1187,10 @@ int SMESH::SelectionProxy::size( bool autoCompute ) const \param autoCompute Compute size if it is unavailable. Defaults to \c false. \return Number of nodes contained in group. */ -int SMESH::SelectionProxy::nbNodes( bool autoCompute ) const +SMESH::smIdType SMESH::SelectionProxy::nbNodes( bool autoCompute ) const { // note: nb of nodes is not computed automatically for performance reasons - int result = -1; + SMESH::smIdType result = -1; if ( !isNull() ) { SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow( myObject ); @@ -1220,7 +1220,7 @@ QSet SMESH::SelectionProxy::ids() const SMESH::SMESH_GroupBase_var group = SMESH::SMESH_GroupBase::_narrow( myObject ); if ( !CORBA::is_nil( group ) ) { - SMESH::long_array_var seq = group->GetListOfID(); + SMESH::smIdType_array_var seq = group->GetListOfID(); for ( int i = 0, n = seq->length(); i < n; i++ ) result << (uint)seq[i]; } diff --git a/src/SMESHGUI/SMESHGUI_SelectionProxy.h b/src/SMESHGUI/SMESHGUI_SelectionProxy.h index 3804df553..b9f8e9fa6 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionProxy.h +++ b/src/SMESHGUI/SMESHGUI_SelectionProxy.h @@ -176,7 +176,7 @@ namespace SMESH bool hasElement( int ); SMESH::ElementType elementType( int ) const; int elementEntityType( int ) const; - bool elementConnectivity( int, Connectivity& ); + bool elementConnectivity( SMESH::smIdType, Connectivity& ); bool perFaceConnectivity( int, Connectivity&, int& ); bool elementPosition( int, Position& ); bool elementGravityCenter( int, XYZ& ); @@ -192,8 +192,8 @@ namespace SMESH // methods that work for group only SMESH::ElementType groupElementType() const; QColor color() const; - int size( bool = false ) const; - int nbNodes( bool = false ) const; + SMESH::smIdType size( bool = false ) const; + SMESH::smIdType nbNodes( bool = false ) const; QSet ids() const; private: diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx index 721995c17..b80e0f998 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx @@ -1368,8 +1368,8 @@ bool SMESHGUI_SewingDlg::ClickOnApply() QStringList aListElementsId1 = LineEdit1->text().split(" ", QString::SkipEmptyParts); QStringList aListElementsId2 = LineEdit4->text().split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId1 = new SMESH::long_array; - SMESH::long_array_var anElementsId2 = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId1 = new SMESH::smIdType_array; + SMESH::smIdType_array_var anElementsId2 = new SMESH::smIdType_array; anElementsId1->length(aListElementsId1.count()); anElementsId2->length(aListElementsId2.count()); @@ -1541,7 +1541,7 @@ void SMESHGUI_SewingDlg::onTextChange (const QString& theNewText) send->clear(); if (aMesh) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; if (GetConstructorId() != 3 || (send != LineEdit1 && send != LineEdit4)) { SMESH::SetPointRepresentation(true); diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx index f761912cc..864f31115 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx @@ -498,7 +498,7 @@ void SMESHGUI_ShapeByMeshOp::onElemIdChanged(const QString& theNewText) case VOLUME: type = SMDSAbs_Volume; break; default: return; } - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split( " ", QString::SkipEmptyParts); for ( int i = 0; i < aListId.count(); i++ ) { if ( const SMDS_MeshElement * e = aMesh->FindElement( aListId[ i ].toInt() )) diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index ee532a7e0..8ff55cbf5 100644 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -349,8 +349,8 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& /*theNewText*/) aList.Append(anIO); mySelectionMgr->setSelectedObjects(aList,false); - SVTK_IndexedMapOfIds selectedIndices; - SVTK_ListOfInteger newIndices; + SVTK_IndexedMapOfVtkIds selectedIndices; + SVTK_ListOfVtk newIndices; mySelector->GetCompositeIndex(anIO,selectedIndices); int id1, id2; @@ -369,9 +369,9 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& /*theNewText*/) if ( findTriangles(aNode1,aNode2,tria1,tria2) ) { - newIndices.push_back( aNode1->GetID() ); - newIndices.push_back( aNode2->GetID() ); - + newIndices.push_back( aNode1->GetID() ); + newIndices.push_back( aNode2->GetID() ); + myOkBtn->setEnabled(true); myApplyBtn->setEnabled(true); } @@ -410,22 +410,22 @@ void SMESHGUI_SingleEditDlg::onSelectionDone() if(SMDS_Mesh* aMesh = aVisualObj->GetMesh()) { const SMDS_MeshElement* tria[2]; - - bool valid = false; - SVTK_IndexedMapOfIds anIds; + + bool valid = false; + SVTK_IndexedMapOfVtkIds anIds; mySelector->GetCompositeIndex(anIO,anIds); if( anIds.Extent() == 1 && anIds(1).size() == 2 ) { - anId1 = anIds(1)[0]; - anId2 = anIds(1)[1]; - valid = true; + anId1 = anIds(1)[0]; + anId2 = anIds(1)[1]; + valid = true; } - + if( valid && findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) ) { QString aText = QString("%1-%2").arg(anId1).arg(anId2); myEdge->setText(aText); - + myOkBtn->setEnabled(true); myApplyBtn->setEnabled(true); } diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index bea37c884..d46cb7554 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -351,8 +351,8 @@ bool SMESHGUI_SmoothingDlg::ClickOnApply() QStringList aListElementsId = LineEditElements->text().split(" ", QString::SkipEmptyParts); QStringList aListNodesId = LineEditNodes->text().split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; - SMESH::long_array_var aNodesId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; + SMESH::smIdType_array_var aNodesId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) @@ -523,7 +523,7 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText) QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); if (send == LineEditElements) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; for (int i = 0; i < aListId.count(); i++) { int id = aListId[ i ].toInt(); if ( id > 0 ) { @@ -538,7 +538,7 @@ void SMESHGUI_SmoothingDlg::onTextChange (const QString& theNewText) } } else if (send == LineEditNodes) { - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; for (int i = 0; i < aListId.count(); i++) { int id = aListId[ i ].toInt(); if ( id > 0 ) { @@ -619,7 +619,7 @@ void SMESHGUI_SmoothingDlg::SelectionIntoArgument() myNbOkElements = true; } else { // get indices of selected elements - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; mySelector->GetIndex(IO,aMapIndex); myNbOkElements = aMapIndex.Extent(); diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 2b9f39c9b..e5c429799 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -483,7 +483,7 @@ bool SMESHGUI_SymmetryDlg::ClickOnApply() if (myNbOkElements && IsMirrorOk()) { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) @@ -701,7 +701,7 @@ void SMESHGUI_SymmetryDlg::onTextChange (const QString& theNewText) if (aMesh) { Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); @@ -1202,7 +1202,7 @@ void SMESHGUI_SymmetryDlg::onDisplaySimulation( bool toDisplayPreview ) if ( myNbOkElements && isValid() && IsMirrorOk() ) { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 92c21c63a..f5546fd44 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -484,7 +484,7 @@ bool SMESHGUI_TranslationDlg::ClickOnApply() if (myNbOkElements) { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) @@ -713,7 +713,7 @@ void SMESHGUI_TranslationDlg::onTextChange (const QString& theNewText) if (aMesh) { Handle(SALOME_InteractiveObject) anIO = myActor->getIO(); - TColStd_MapOfInteger newIndices; + SVTK_TVtkIDsMap newIndices; QStringList aListId = theNewText.split(" ", QString::SkipEmptyParts); @@ -1182,7 +1182,7 @@ void SMESHGUI_TranslationDlg::onDisplaySimulation( bool toDisplayPreview ) { QStringList aListElementsId = myElementsId.split(" ", QString::SkipEmptyParts); - SMESH::long_array_var anElementsId = new SMESH::long_array; + SMESH::smIdType_array_var anElementsId = new SMESH::smIdType_array; anElementsId->length(aListElementsId.count()); for (int i = 0; i < aListElementsId.count(); i++) diff --git a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx index db7d0bdde..259e8b660 100644 --- a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx @@ -197,7 +197,8 @@ void SMESHGUI_TransparencyDlg::SetTransparency() { if ( myViewWindow ) { SUIT_OverrideCursor wc; - float opacity = ( 100 - Slider1->value() ) / 100.; + //float opacity = ( 100.f - Slider1->value() ) / 100.; + float opacity = float( 100 - Slider1->value() ) / 100.; SALOME_ListIO aList; mySelectionMgr->selectedObjects( aList ); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 39966b6d6..865f10a65 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -1194,7 +1194,7 @@ namespace SMESH QString& theName) { theName = ""; - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; theSelector->GetIndex(theIO,aMapIndex); for(int i = 1; i <= aMapIndex.Extent(); i++) @@ -1208,10 +1208,10 @@ namespace SMESH QString& theName) { theName = ""; - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; theSelector->GetIndex(theIO,aMapIndex); - typedef std::set TIdContainer; + typedef std::set TIdContainer; TIdContainer anIdContainer; for( int i = 1; i <= aMapIndex.Extent(); i++) anIdContainer.insert(aMapIndex(i)); @@ -1226,8 +1226,8 @@ namespace SMESH int GetEdgeNodes(SVTK_Selector* theSelector, const TVisualObjPtr& theVisualObject, - int& theId1, - int& theId2) + smIdType& theId1, + smIdType& theId2) { const SALOME_ListIO& selected = theSelector->StoredIObjects(); @@ -1238,14 +1238,14 @@ namespace SMESH if ( anIO.IsNull() || !anIO->hasEntry() ) return -1; - TColStd_IndexedMapOfInteger aMapIndex; + SVTK_TIndexedMapOfVtkId aMapIndex; theSelector->GetIndex( anIO, aMapIndex ); if ( aMapIndex.Extent() != 2 ) return -1; - int anObjId = -1, anEdgeNum = -1; - for ( int i = 1; i <= aMapIndex.Extent(); i++ ) { - int aVal = aMapIndex( i ); + smIdType anObjId = -1, anEdgeNum = -1; + for ( smIdType i = 1; i <= aMapIndex.Extent(); i++ ) { + smIdType aVal = aMapIndex( i ); if ( aVal > 0 ) anObjId = aVal; else @@ -1343,7 +1343,7 @@ namespace SMESH } - int GetEdgeNodes( LightApp_SelectionMgr* theMgr, int& theId1, int& theId2 ) + int GetEdgeNodes( LightApp_SelectionMgr* theMgr, smIdType& theId1, smIdType& theId2 ) { SALOME_ListIO selected; theMgr->selectedObjects( selected ); @@ -1363,9 +1363,9 @@ namespace SMESH if ( aMapIndex.Extent() != 2 ) return -1; - int anObjId = -1, anEdgeNum = -1; - for ( int i = 1; i <= aMapIndex.Extent(); i++ ) { - int aVal = aMapIndex( i ); + smIdType anObjId = -1, anEdgeNum = -1; + for ( smIdType i = 1; i <= aMapIndex.Extent(); i++ ) { + smIdType aVal = aMapIndex( i ); if ( aVal > 0 ) anObjId = aVal; else diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.h b/src/SMESHGUI/SMESHGUI_VTKUtils.h index 756f6b7c9..76a68149b 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.h +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.h @@ -169,7 +169,7 @@ SMESHGUI_EXPORT const Handle(SALOME_InteractiveObject)&, QString& ); SMESHGUI_EXPORT - int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& ); + int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, smIdType&, smIdType& ); //---------------------------------------------------------------------------- SMESHGUI_EXPORT @@ -189,7 +189,7 @@ SMESHGUI_EXPORT const bool = true ); SMESHGUI_EXPORT - int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& ); + int GetEdgeNodes( LightApp_SelectionMgr*, smIdType&, smIdType& ); SMESHGUI_EXPORT void SetControlsPrecision( const long ); diff --git a/src/SMESHUtils/SMESH_Delaunay.hxx b/src/SMESHUtils/SMESH_Delaunay.hxx index 9e7e33f79..e1c129215 100644 --- a/src/SMESHUtils/SMESH_Delaunay.hxx +++ b/src/SMESHUtils/SMESH_Delaunay.hxx @@ -61,7 +61,7 @@ class SMESHUtils_EXPORT SMESH_Delaunay const SMDS_MeshNode* NextNode( double bc[3], int triaNodes[3] ); // return nb of nodes returned by NextNode() - int NbVisitedNodes() const { return _nbVisitedNodes; } + size_t NbVisitedNodes() const { return _nbVisitedNodes; } // find a triangle containing an UV, starting from a given triangle; diff --git a/src/SMESHUtils/SMESH_MeshAlgos.cxx b/src/SMESHUtils/SMESH_MeshAlgos.cxx index 7a4a0a481..9a6a42750 100644 --- a/src/SMESHUtils/SMESH_MeshAlgos.cxx +++ b/src/SMESHUtils/SMESH_MeshAlgos.cxx @@ -281,7 +281,7 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint() double tolerance) :SMESH_Octree( new LimitAndPool() ) { - int nbElems = mesh.GetMeshInfo().NbElements( elemType ); + smIdType nbElems = mesh.GetMeshInfo().NbElements( elemType ); _elements.reserve( nbElems ); TElementBoxPool& elBoPool = getLimitAndPool()->_elBoPool; @@ -1984,7 +1984,11 @@ SMESH_MeshAlgos::FindSharpEdges( SMDS_Mesh* theMesh, typedef std::pair< bool, const SMDS_MeshNode* > TIsSharpAndMedium; typedef NCollection_DataMap< SMESH_TLink, TIsSharpAndMedium, SMESH_TLink > TLinkSharpMap; - TLinkSharpMap linkIsSharp( theMesh->NbFaces() ); + TLinkSharpMap linkIsSharp; + Standard_Integer nbBuckets = FromIdType( theMesh->NbFaces() ); + if ( nbBuckets > 0 ) + linkIsSharp.ReSize( nbBuckets ); + TIsSharpAndMedium sharpMedium( true, 0 ); bool & isSharp = sharpMedium.first; const SMDS_MeshNode* & nMedium = sharpMedium.second; @@ -2091,7 +2095,10 @@ SMESH_MeshAlgos::SeparateFacesByEdges( SMDS_Mesh* theMesh, const std::vector< Ed typedef std::vector< const SMDS_MeshElement* > TFaceVec; typedef NCollection_DataMap< SMESH_TLink, TFaceVec, SMESH_TLink > TFacesByLinks; - TFacesByLinks facesByLink( theMesh->NbFaces() ); + TFacesByLinks facesByLink; + Standard_Integer nbBuckets = FromIdType( theMesh->NbFaces() ); + if ( nbBuckets > 0 ) + facesByLink.ReSize( nbBuckets ); std::vector< const SMDS_MeshNode* > faceNodes; for ( SMDS_FaceIteratorPtr faceIt = theMesh->facesIterator(); faceIt->more(); ) diff --git a/src/SMESHUtils/SMESH_OctreeNode.hxx b/src/SMESHUtils/SMESH_OctreeNode.hxx index 670843c9e..880f373f5 100644 --- a/src/SMESHUtils/SMESH_OctreeNode.hxx +++ b/src/SMESHUtils/SMESH_OctreeNode.hxx @@ -108,7 +108,7 @@ class SMESHUtils_EXPORT SMESH_OctreeNode : public SMESH_Octree /*! * \brief Return nb nodes in a tree */ - int NbNodes() const { return myNodes.size(); } + size_t NbNodes() const { return myNodes.size(); } protected: diff --git a/src/SMESHUtils/SMESH_Offset.cxx b/src/SMESHUtils/SMESH_Offset.cxx index 01552f584..cd886ee58 100644 --- a/src/SMESHUtils/SMESH_Offset.cxx +++ b/src/SMESHUtils/SMESH_Offset.cxx @@ -277,7 +277,7 @@ namespace static Standard_Integer HashCode(const CutFace& f, const Standard_Integer upper) { - return ::HashCode( f.myInitFace->GetID(), upper ); + return ::HashCode( FromIdType(f.myInitFace->GetID()), upper ); } static Standard_Boolean IsEqual(const CutFace& f1, const CutFace& f2 ) { @@ -1933,8 +1933,8 @@ namespace SMESH_MeshAlgos for ( ; cutFacesIt != myCutFaces.cend(); ++cutFacesIt ) { const CutFace& cf = *cutFacesIt; - int index = cf.myInitFace->GetID(); // index in theNew2OldFaces - if ((int) theNew2OldFaces.size() <= index ) + smIdType index = cf.myInitFace->GetID(); // index in theNew2OldFaces + if ((smIdType) theNew2OldFaces.size() <= index ) theNew2OldFaces.resize( index + 1 ); theNew2OldFaces[ index ] = std::make_pair( cf.myInitFace, index ); } @@ -2004,7 +2004,7 @@ namespace SMESH_MeshAlgos // erase loops that are cut off by face intersections cf.CutOffLoops( loopSet, theSign, myNormals, cutOffLinks, cutOffCoplanarLinks ); - int index = cf.myInitFace->GetID(); // index in theNew2OldFaces + smIdType index = cf.myInitFace->GetID(); // index in theNew2OldFaces const SMDS_MeshElement* tria; for ( size_t iL = 0; iL < loopSet.myNbLoops; ++iL ) @@ -2094,7 +2094,7 @@ namespace SMESH_MeshAlgos continue; for ( size_t iF = 0; iF < faces.size(); ++iF ) { - int index = faces[iF]->GetID(); + smIdType index = faces[iF]->GetID(); // if ( //faces[iF]->isMarked() || // kept part of cutFace // !theNew2OldFaces[ index ].first ) // already removed // continue; @@ -2126,7 +2126,7 @@ namespace SMESH_MeshAlgos if ( cf.myInitFace->IsNull() ) continue; - int index = cf.myInitFace->GetID(); // index in theNew2OldFaces + smIdType index = cf.myInitFace->GetID(); // index in theNew2OldFaces if ( !theNew2OldFaces[ index ].first ) continue; // already cut off @@ -3226,7 +3226,7 @@ SMDS_Mesh* SMESH_MeshAlgos::MakeOffset( SMDS_ElemIteratorPtr theFaceIt, for ( SMDS_ElemIteratorPtr fIt = newNode->GetInverseElementIterator(); fIt->more(); ) { const SMDS_MeshElement* newFace = fIt->next(); - const int faceIndex = newFace->GetID(); + const smIdType faceIndex = newFace->GetID(); const gp_XYZ& oldNorm = normals[ faceIndex ]; const gp_XYZ newXYZ = oldXYZ + oldNorm * theOffset; if ( multiPos.empty() ) @@ -3275,7 +3275,7 @@ SMDS_Mesh* SMESH_MeshAlgos::MakeOffset( SMDS_ElemIteratorPtr theFaceIt, for ( SMDS_ElemIteratorPtr fIt = newNode->GetInverseElementIterator(); fIt->more(); ) { const SMDS_MeshElement* newFace = fIt->next(); - const int faceIndex = newFace->GetID(); + const smIdType faceIndex = newFace->GetID(); const gp_XYZ& oldNorm = normals[ faceIndex ]; if ( !SMESH_MeshAlgos::FaceNormal( newFace, faceNorm, /*normalize=*/false ) || //faceNorm * moveVec < 0 ) diff --git a/src/SMESHUtils/SMESH_Slot.cxx b/src/SMESHUtils/SMESH_Slot.cxx index 33c16aa27..1b6e5d246 100644 --- a/src/SMESHUtils/SMESH_Slot.cxx +++ b/src/SMESHUtils/SMESH_Slot.cxx @@ -380,10 +380,10 @@ namespace */ //================================================================================ - void findGroups( const SMDS_MeshElement * theFace, - TGroupVec & theGroupsToUpdate, - NCollection_DataMap< int, TGroupVec > & theFaceID2Groups, - TGroupVec & theWorkGroups ) + void findGroups( const SMDS_MeshElement * theFace, + TGroupVec & theGroupsToUpdate, + NCollection_DataMap< smIdType, TGroupVec, smIdHasher > & theFaceID2Groups, + TGroupVec & theWorkGroups ) { theWorkGroups.clear(); for ( size_t i = 0; i < theGroupsToUpdate.size(); ++i ) @@ -583,7 +583,7 @@ SMESH_MeshAlgos::MakeSlot( SMDS_ElemIteratorPtr theSegmentIt, std::vector< SMESH_NodeXYZ > facePoints(4); std::vector< Intersector::TFace > cutFacePoints; - NCollection_DataMap< int, TGroupVec > faceID2Groups; + NCollection_DataMap< smIdType, TGroupVec, smIdHasher > faceID2Groups; TGroupVec groupVec; std::vector< gp_Ax1 > planeNormalVec(2); diff --git a/src/SMESHUtils/SMESH_TryCatch.hxx b/src/SMESHUtils/SMESH_TryCatch.hxx index eacb39a85..a718eac92 100644 --- a/src/SMESHUtils/SMESH_TryCatch.hxx +++ b/src/SMESHUtils/SMESH_TryCatch.hxx @@ -65,11 +65,14 @@ //------------------------------------------------------------------------------------- // A macro makes description of a caught exception and calls onExceptionFun(const char*). -// Two onExceptionFun() are defined here: SMESH::throwSalomeEx() and SMESH::doNothing(). +// Several onExceptionFun() are defined here: throwSalomeEx(), doNothing() and returnError(). // To add your own catch close, define SMY_OWN_CATCH macro before including this file. #define SMESH_CATCH( onExceptionFun ) \ } \ + \ + SMY_OWN_CATCH \ + \ catch (Standard_Failure& ex) \ { \ SMESH_Comment text("OCCT Exception: "); \ @@ -92,9 +95,6 @@ { \ SMESH_CAUGHT onExceptionFun( ex.what() ); \ } \ - \ - SMY_OWN_CATCH \ - \ catch (...) \ { \ SMESH_CAUGHT onExceptionFun("Unknown Exception caught"); \ diff --git a/src/SMESHUtils/SMESH_TypeDefs.hxx b/src/SMESHUtils/SMESH_TypeDefs.hxx index ddca90c81..f6cb1d3ed 100644 --- a/src/SMESHUtils/SMESH_TypeDefs.hxx +++ b/src/SMESHUtils/SMESH_TypeDefs.hxx @@ -32,6 +32,8 @@ #include "SMDS_SetIterator.hxx" #include "SMDS_MeshNode.hxx" +#include + #include #include @@ -154,7 +156,7 @@ struct SMESH_TLink: public NLink // methods for usage of SMESH_TLink as a hasher in NCollection maps static int HashCode(const SMESH_TLink& link, int aLimit) { - return ::HashCode( link.node1()->GetID() + link.node2()->GetID(), aLimit ); + return ::HashCode( FromIdType(link.node1()->GetID() + link.node2()->GetID()), aLimit ); } static Standard_Boolean IsEqual(const SMESH_TLink& l1, const SMESH_TLink& l2) { @@ -215,7 +217,7 @@ struct SMESH_Hasher { static Standard_Integer HashCode(const SMDS_MeshElement* e, const Standard_Integer upper) { - return ::HashCode( e->GetID(), upper ); + return ::HashCode( FromIdType(e->GetID()), upper ); } static Standard_Boolean IsEqual( const SMDS_MeshElement* e1, const SMDS_MeshElement* e2 ) { diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index e28427995..06cec8f94 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -214,12 +214,12 @@ ElementType Functor_i::GetElementType() Class : NumericalFunctor_i Description : Base class for numerical functors */ -CORBA::Double NumericalFunctor_i::GetValue( CORBA::Long theId ) +CORBA::Double NumericalFunctor_i::GetValue( SMESH::smIdType theId ) { return myNumericalFunctorPtr->GetValue( theId ); } -CORBA::Boolean NumericalFunctor_i::IsApplicable( CORBA::Long theElementId ) +CORBA::Boolean NumericalFunctor_i::IsApplicable( SMESH::smIdType theElementId ) { return myNumericalFunctorPtr->IsApplicable( theElementId ); } @@ -228,7 +228,7 @@ SMESH::Histogram* NumericalFunctor_i::GetHistogram(CORBA::Short nbIntervals, COR { std::vector nbEvents; std::vector funValues; - std::vector elements; + std::vector elements; myNumericalFunctorPtr->GetHistogram(nbIntervals,nbEvents,funValues,elements,0,isLogarithmic); SMESH::Histogram_var histogram = new SMESH::Histogram; @@ -255,9 +255,9 @@ SMESH::Histogram* NumericalFunctor_i::GetLocalHistogram(CORBA::Short { SMESH::Histogram_var histogram = new SMESH::Histogram; - std::vector nbEvents; - std::vector funValues; - std::vector elements; + std::vector nbEvents; + std::vector funValues; + std::vector elements; SMDS_ElemIteratorPtr elemIt; if ( SMESH::DownCast< SMESH_GroupOnFilter_i* >( object ) || @@ -268,9 +268,9 @@ SMESH::Histogram* NumericalFunctor_i::GetLocalHistogram(CORBA::Short } else { - SMESH::SMESH_Mesh_var mesh = object->GetMesh(); - SMESH::long_array_var objNbElems = object->GetNbElementsByType(); - SMESH::long_array_var meshNbElems = mesh-> GetNbElementsByType(); + SMESH::SMESH_Mesh_var mesh = object->GetMesh(); + SMESH::smIdType_array_var objNbElems = object->GetNbElementsByType(); + SMESH::smIdType_array_var meshNbElems = mesh-> GetNbElementsByType(); if ( meshNbElems[ GetElementType() ] != objNbElems [ GetElementType() ] ) { @@ -1412,10 +1412,10 @@ RangeOfIds_i::RangeOfIds_i() myFunctorPtr = myPredicatePtr = myRangeOfIdsPtr; } -void RangeOfIds_i::SetRange( const SMESH::long_array& theIds ) +void RangeOfIds_i::SetRange( const SMESH::smIdType_array& theIds ) { - CORBA::Long iEnd = theIds.length(); - for ( CORBA::Long i = 0; i < iEnd; i++ ) + SMESH::smIdType iEnd = theIds.length(); + for ( SMESH::smIdType i = 0; i < iEnd; i++ ) myRangeOfIdsPtr->AddToRange( theIds[ i ] ); TPythonDump()< 0", @@ -2574,7 +2574,7 @@ SetMesh( SMESH_Mesh_ptr theMesh ) myPredicate->GetPredicate()->SetMesh( aMesh ); } -SMESH::long_array* +SMESH::smIdType_array* Filter_i:: GetIDs() { @@ -2606,11 +2606,11 @@ GetElementsId( Predicate_i* thePredicate, Controls::Filter::GetElementsId(aMesh,thePredicate->GetPredicate(),theSequence); } -SMESH::long_array* +SMESH::smIdType_array* Filter_i:: GetElementsId( SMESH_Mesh_ptr theMesh ) { - SMESH::long_array_var anArray = new SMESH::long_array; + SMESH::smIdType_array_var anArray = new SMESH::smIdType_array; if(!CORBA::is_nil(theMesh) && myPredicate){ theMesh->Load(); Controls::Filter::TIdSequence aSequence; @@ -2623,11 +2623,11 @@ GetElementsId( SMESH_Mesh_ptr theMesh ) return anArray._retn(); } -SMESH::long_array* +SMESH::smIdType_array* Filter_i:: GetElementsIdFromParts( const ListOfIDSources& theParts ) { - SMESH::long_array_var array = new SMESH::long_array; + SMESH::smIdType_array_var array = new SMESH::smIdType_array; if ( theParts.length() > 0 && myPredicate ) { SMESH_Mesh_ptr mesh = theParts[0]->GetMesh(); @@ -2659,9 +2659,9 @@ GetElementsIdFromParts( const ListOfIDSources& theParts ) */ //============================================================================= -SMESH::long_array* ::Filter_i::GetMeshInfo() +SMESH::smIdType_array* ::Filter_i::GetMeshInfo() { - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::Entity_Last); for (int i = 0; i < SMESH::Entity_Last; i++) aRes[i] = 0; @@ -2687,9 +2687,9 @@ SMESH::long_array* ::Filter_i::GetMeshInfo() */ //============================================================================= -SMESH::long_array* ::Filter_i::GetNbElementsByType() +SMESH::smIdType_array* ::Filter_i::GetNbElementsByType() { - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::NB_ELEMENT_TYPES); for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) aRes[i] = 0; @@ -2697,7 +2697,7 @@ SMESH::long_array* ::Filter_i::GetNbElementsByType() if ( !CORBA::is_nil(myMesh) && myPredicate ) { const SMDS_Mesh* aMesh = MeshPtr2SMDSMesh(myMesh); SMDS_ElemIteratorPtr it = aMesh->elementsIterator( SMDSAbs_ElementType( GetElementType() )); - CORBA::Long& nbElems = aRes[ GetElementType() ]; + SMESH::smIdType& nbElems = aRes[ GetElementType() ]; while ( it->more() ) { const SMDS_MeshElement* anElem = it->next(); diff --git a/src/SMESH_I/SMESH_Filter_i.hxx b/src/SMESH_I/SMESH_Filter_i.hxx index 3f786cd83..837bdff71 100644 --- a/src/SMESH_I/SMESH_Filter_i.hxx +++ b/src/SMESH_I/SMESH_Filter_i.hxx @@ -98,8 +98,8 @@ namespace SMESH public virtual Functor_i { public: - CORBA::Double GetValue( CORBA::Long theElementId ); - CORBA::Boolean IsApplicable( CORBA::Long theElementId ); + CORBA::Double GetValue( SMESH::smIdType theElementId ); + CORBA::Boolean IsApplicable( SMESH::smIdType theElementId ); SMESH::Histogram* GetHistogram(CORBA::Short nbIntervals, CORBA::Boolean isLogarithmic); SMESH::Histogram* GetLocalHistogram(CORBA::Short nbIntervals, @@ -704,7 +704,7 @@ namespace SMESH { public: RangeOfIds_i(); - void SetRange( const SMESH::long_array& theIds ); + void SetRange( const SMESH::smIdType_array& theIds ); CORBA::Boolean SetRangeStr( const char* theRange ); char* GetRangeStr(); @@ -823,7 +823,7 @@ namespace SMESH void SetElementType( ElementType theType ); void SetPoint( CORBA::Double x, CORBA::Double y, CORBA::Double z ); void SetVertex( GEOM::GEOM_Object_ptr vertex ); - void SetNode ( CORBA::Long nodeID ); + void SetNode ( SMESH::smIdType nodeID ); void SetThreshold ( const char* threshold, SMESH::ConnectedElements::ThresholdType type ); char* GetThreshold ( SMESH::ConnectedElements::ThresholdType& type ); @@ -1006,11 +1006,11 @@ namespace SMESH Controls::Filter::TIdSequence& ); virtual - long_array* + smIdType_array* GetElementsId( SMESH_Mesh_ptr ); virtual - long_array* + smIdType_array* GetElementsIdFromParts( const ListOfIDSources& theParts ); virtual @@ -1040,9 +1040,9 @@ namespace SMESH // ========================= // SMESH_IDSource interface // ========================= - virtual SMESH::long_array* GetIDs(); - virtual SMESH::long_array* GetMeshInfo(); - virtual SMESH::long_array* GetNbElementsByType(); + virtual SMESH::smIdType_array* GetIDs(); + virtual SMESH::smIdType_array* GetMeshInfo(); + virtual SMESH::smIdType_array* GetNbElementsByType(); virtual SMESH::array_of_ElementType* GetTypes(); virtual SMESH::SMESH_Mesh_ptr GetMesh(); virtual bool IsMeshInfoCorrect() { return true; } diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index e89466cfb..fa662a43c 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -2315,9 +2315,8 @@ SMESH::MeshPreviewStruct* SMESH_Gen_i::Precompute( SMESH::SMESH_Mesh_ptr theMesh */ //============================================================================= -SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, - GEOM::GEOM_Object_ptr theShapeObject) -// SMESH::long_array& theNbElems) +SMESH::smIdType_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, + GEOM::GEOM_Object_ptr theShapeObject) { Unexpect aCatch(SALOME_SalomeException); if(MYDEBUG) MESSAGE( "SMESH_Gen_i::Evaluate" ); @@ -2328,7 +2327,7 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, if ( CORBA::is_nil( theMesh ) ) THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM ); - SMESH::long_array_var nbels = new SMESH::long_array; + SMESH::smIdType_array_var nbels = new SMESH::smIdType_array; nbels->length(SMESH::Entity_Last); int i = SMESH::Entity_Node; for (; i < SMESH::Entity_Last; i++) @@ -2358,9 +2357,9 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, /*CORBA::Boolean ret =*/ myGen.Evaluate( myLocMesh, myLocShape, aResMap); MapShapeNbElemsItr anIt = aResMap.begin(); for(; anIt!=aResMap.end(); anIt++) { - const vector& aVec = (*anIt).second; + const vector& aVec = (*anIt).second; for ( i = SMESH::Entity_Node; i < (int)aVec.size(); i++ ) { - int nbElem = aVec[i]; + smIdType nbElem = aVec[i]; if ( nbElem < 0 ) // algo failed, check that it has reported a message { SMESH_subMesh* sm = anIt->first; @@ -2403,7 +2402,7 @@ SMESH::long_array* SMESH_Gen_i::Evaluate(SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, - CORBA::Long theElementID, + SMESH::smIdType theElementID, const char* theGeomName) { Unexpect aCatch(SALOME_SalomeException); @@ -2467,7 +2466,7 @@ SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, - CORBA::Long theElementID) + SMESH::smIdType theElementID) { Unexpect aCatch(SALOME_SalomeException); if ( CORBA::is_nil( theMesh ) ) @@ -2655,7 +2654,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, } // remember nb of elements before filling in - SMESH::long_array_var prevState = newMesh->GetNbElementsByType(); + SMESH::smIdType_array_var prevState = newMesh->GetNbElementsByType(); // copy nodes @@ -2705,7 +2704,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, int _assert[( nbNames == SMESH::NB_ELEMENT_TYPES ) ? 2 : -1 ]; _assert[0]=_assert[1]=0; } - SMESH::long_array_var curState = newMesh->GetNbElementsByType(); + SMESH::smIdType_array_var curState = newMesh->GetNbElementsByType(); for( groupType = SMESH::NODE; groupType < SMESH::NB_ELEMENT_TYPES; @@ -2752,7 +2751,7 @@ SMESH_Gen_i::ConcatenateCommon(const SMESH::ListOfIDSources& theMeshesArray, SMESH::SMESH_GroupBase_ptr group; CORBA::String_var groupName; - SMESH::long_array_var newIDs = new SMESH::long_array(); + SMESH::smIdType_array_var newIDs = new SMESH::smIdType_array(); // loop on groups of a source mesh SMESH::ListOfGroups_var listOfGroups = initImpl->GetGroups(); @@ -2917,7 +2916,7 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, } else { - SMESH::long_array_var ids = meshPart->GetIDs(); + SMESH::smIdType_array_var ids = meshPart->GetIDs(); if ( srcElemTypes->length() == 1 && srcElemTypes[0] == SMESH::NODE ) // group of nodes { for ( CORBA::ULong i=0; i < ids->length(); i++ ) @@ -3040,8 +3039,8 @@ SMESH::SMESH_Mesh_ptr SMESH_Gen_i::CopyMesh(SMESH::SMESH_IDSource_ptr meshPart, { TE2EMap & e2eMap = e2eMapByType[ groupDS->GetType() ]; if ( e2eMap.empty() ) continue; - int minID = e2eMap.begin()->first->GetID(); - int maxID = e2eMap.rbegin()->first->GetID(); + smIdType minID = e2eMap.begin()->first->GetID(); + smIdType maxID = e2eMap.rbegin()->first->GetID(); TE2EMap::iterator e2e; while ( eIt->more() && groupElems.size() < e2eMap.size()) { @@ -3872,7 +3871,7 @@ CORBA::Boolean SMESH_Gen_i::CopyMeshWithGeom( SMESH::SMESH_Mesh_ptr theSou { if ( newMeshDS->GetMeshInfo().NbElements( SMDSAbs_ElementType( elemType )) > 0 ) { - SMESH::long_array_var elemIDs = stdlGroup->GetIDs(); + SMESH::smIdType_array_var elemIDs = stdlGroup->GetIDs(); const bool isElem = ( elemType != SMESH::NODE ); CORBA::ULong iE = 0; for ( ; iE < elemIDs->length(); ++iE ) // check if any element has been copied @@ -4456,7 +4455,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, // write reference on a shape if exists SALOMEDS::SObject_wrap myRef; bool shapeRefFound = false; - bool found = gotBranch->FindSubObject( GetRefOnShapeTag(), myRef.inout() ); + bool found = gotBranch->FindSubObject( (CORBA::Long)GetRefOnShapeTag(), myRef.inout() ); if ( found ) { SALOMEDS::SObject_wrap myShape; bool ok = myRef->ReferencedObject( myShape.inout() ); @@ -4487,7 +4486,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, // write applied hypotheses if exist SALOMEDS::SObject_wrap myHypBranch; - found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch.inout() ); + found = gotBranch->FindSubObject( (CORBA::Long)GetRefOnAppliedHypothesisTag(), myHypBranch.inout() ); if ( found && !shapeRefFound && hasShape ) { // remove applied hyps aStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch ); } @@ -4957,7 +4956,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, { SMDS_ElemIteratorPtr eIt = mySMESHDSMesh->elementsIterator( isNode ? SMDSAbs_Node : SMDSAbs_All ); - int nbElems = isNode ? mySMESHDSMesh->NbNodes() : mySMESHDSMesh->GetMeshInfo().NbElements(); + smIdType nbElems = isNode ? mySMESHDSMesh->NbNodes() : mySMESHDSMesh->GetMeshInfo().NbElements(); if ( nbElems < 1 ) continue; std::vector smIDs; smIDs.reserve( nbElems ); @@ -4998,7 +4997,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, SMESHDS_SubMesh* aSubMesh = const_cast< SMESHDS_SubMesh* >( smIt->next() ); if ( aSubMesh->IsComplexSubmesh() ) continue; // submesh containing other submeshs - int nbNodes = aSubMesh->NbNodes(); + smIdType nbNodes = aSubMesh->NbNodes(); if ( nbNodes == 0 ) continue; int aShapeID = aSubMesh->GetID(); @@ -5716,7 +5715,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, if ( aSubMesh->_is_nil() ) continue; string iorSubString = GetORB()->object_to_string( aSubMesh ); - int newSubId = myStudyContext->findId( iorSubString ); + int newSubId = myStudyContext->findId( iorSubString ); myStudyContext->mapOldToNew( subid, newSubId ); } } @@ -6233,7 +6232,7 @@ int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject) */ //================================================================================ -CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject) +CORBA::Long SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject) { if ( myStudyContext && !CORBA::is_nil( theObject )) { string iorString = GetORB()->object_to_string( theObject ); @@ -6533,7 +6532,7 @@ std::vector SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart, SMESH::SMESH_Group_var gsource = SMESH::SMESH_Group::_narrow(meshPart); if ( !gsource->_is_nil() ) { if(theElemType == SMESH::NODE) { - SMESH::long_array_var nodes = gsource->GetNodeIDs(); + SMESH::smIdType_array_var nodes = gsource->GetNodeIDs(); for ( CORBA::ULong i = 0; i < nodes->length(); ++i ) { if ( const SMDS_MeshNode* node = meshDS->FindNode( nodes[i] )) { long anId = node->GetID(); @@ -6542,7 +6541,7 @@ std::vector SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart, } } } else if (gsource->GetType() == theElemType || theElemType == SMESH::ALL ) { - SMESH::long_array_var elems = gsource->GetListOfID(); + SMESH::smIdType_array_var elems = gsource->GetListOfID(); for ( CORBA::ULong i = 0; i < elems->length(); ++i ) { if ( const SMDS_MeshElement* elem = meshDS->FindElement( elems[i] )) { long anId = elem->GetID(); @@ -6554,7 +6553,7 @@ std::vector SMESH_Gen_i::_GetInside( SMESH::SMESH_IDSource_ptr meshPart, } SMESH::SMESH_subMesh_var smsource = SMESH::SMESH_subMesh::_narrow(meshPart); if ( !smsource->_is_nil() ) { - SMESH::long_array_var elems = smsource->GetElementsByType( theElemType ); + SMESH::smIdType_array_var elems = smsource->GetElementsByType( theElemType ); for ( CORBA::ULong i = 0; i < elems->length(); ++i ) { const SMDS_MeshElement* elem = ( theElemType == SMESH::NODE ) ? meshDS->FindNode( elems[i] ) : meshDS->FindElement( elems[i] ); if (elem) { diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 5a5ba6fad..2d84f3e4e 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -46,6 +46,7 @@ #include #include +#include #include #include @@ -292,7 +293,7 @@ public: * returns statistic of mesh elements * Result array of number enityties */ - SMESH::long_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh, + SMESH::smIdType_array* Evaluate(SMESH::SMESH_Mesh_ptr theMesh, GEOM::GEOM_Object_ptr theShapeObject); // Returns true if mesh contains enough data to be computed @@ -328,12 +329,12 @@ public: // Return geometrical object the given element is built on. Publish it in study. GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, - CORBA::Long theElementID, + SMESH::smIdType theElementID, const char* theGeomName); // Return geometrical object the given element is built on. Don't publish it in study. GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, - CORBA::Long theElementID); + SMESH::smIdType theElementID); // Concatenate the given meshes into one mesh SMESH::SMESH_Mesh_ptr ConcatenateCommon(const SMESH::ListOfIDSources& meshesArray, diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 672477ccc..510394485 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -988,7 +988,7 @@ void SMESH_Gen_i::UpdateIcons( SMESH::SMESH_Mesh_ptr theMesh ) { if ( isGroupOnFilter ) // GetTypes() can be very long on GroupOnFilter! { - SMESH::long_array_var nbByType = mesh_i->GetNbElementsByType(); + SMESH::smIdType_array_var nbByType = mesh_i->GetNbElementsByType(); isEmpty = ( nbByType[ grp->GetType() ] == 0 ); } else diff --git a/src/SMESH_I/SMESH_Group_i.cxx b/src/SMESH_I/SMESH_Group_i.cxx index d3fbdc742..d1f82134c 100644 --- a/src/SMESH_I/SMESH_Group_i.cxx +++ b/src/SMESH_I/SMESH_Group_i.cxx @@ -209,7 +209,7 @@ SMESH::ElementType SMESH_GroupBase_i::GetType() */ //============================================================================= -CORBA::Long SMESH_GroupBase_i::Size() +SMESH::smIdType SMESH_GroupBase_i::Size() { if ( myPreMeshInfo ) return GetType() == SMESH::NODE ? myPreMeshInfo->NbNodes() : myPreMeshInfo->NbElements(); @@ -281,7 +281,7 @@ void SMESH_Group_i::Clear() */ //============================================================================= -CORBA::Boolean SMESH_GroupBase_i::Contains( CORBA::Long theID ) +CORBA::Boolean SMESH_GroupBase_i::Contains( SMESH::smIdType theID ) { if ( myPreMeshInfo ) myPreMeshInfo->FullLoadFromFile(); @@ -298,7 +298,7 @@ CORBA::Boolean SMESH_GroupBase_i::Contains( CORBA::Long theID ) */ //============================================================================= -CORBA::Long SMESH_Group_i::Add( const SMESH::long_array& theIDs ) +SMESH::smIdType SMESH_Group_i::Add( const SMESH::smIdType_array& theIDs ) { if ( myPreMeshInfo ) myPreMeshInfo->FullLoadFromFile(); @@ -329,7 +329,7 @@ CORBA::Long SMESH_Group_i::Add( const SMESH::long_array& theIDs ) */ //============================================================================= -CORBA::Long SMESH_Group_i::Remove( const SMESH::long_array& theIDs ) +SMESH::smIdType SMESH_Group_i::Remove( const SMESH::smIdType_array& theIDs ) { if ( myPreMeshInfo ) myPreMeshInfo->FullLoadFromFile(); @@ -361,7 +361,7 @@ CORBA::Long SMESH_Group_i::Remove( const SMESH::long_array& theIDs ) */ //============================================================================= -typedef bool (SMESHDS_Group::*TFunChangeGroup)(const int); +typedef bool (SMESHDS_Group::*TFunChangeGroup)(const smIdType); CORBA::Long ChangeByPredicate( SMESH::Predicate_i* thePredicate, @@ -386,7 +386,7 @@ ChangeByPredicate( SMESH::Predicate_i* thePredicate, return aNb; } -CORBA::Long +SMESH::smIdType SMESH_Group_i:: AddByPredicate( SMESH::Predicate_ptr thePredicate ) { @@ -401,7 +401,7 @@ AddByPredicate( SMESH::Predicate_ptr thePredicate ) return 0; } -CORBA::Long +SMESH::smIdType SMESH_Group_i:: RemoveByPredicate( SMESH::Predicate_ptr thePredicate ) { @@ -416,7 +416,7 @@ RemoveByPredicate( SMESH::Predicate_ptr thePredicate ) return 0; } -CORBA::Long SMESH_Group_i::AddFrom( SMESH::SMESH_IDSource_ptr theSource ) +SMESH::smIdType SMESH_Group_i::AddFrom( SMESH::SMESH_IDSource_ptr theSource ) { if ( myPreMeshInfo ) myPreMeshInfo->FullLoadFromFile(); @@ -445,7 +445,7 @@ CORBA::Long SMESH_Group_i::AddFrom( SMESH::SMESH_IDSource_ptr theSource ) */ //============================================================================= -CORBA::Long SMESH_GroupBase_i::GetID( CORBA::Long theIndex ) +SMESH::smIdType SMESH_GroupBase_i::GetID( SMESH::smIdType theIndex ) { if ( myPreMeshInfo ) myPreMeshInfo->FullLoadFromFile(); @@ -463,19 +463,19 @@ CORBA::Long SMESH_GroupBase_i::GetID( CORBA::Long theIndex ) */ //============================================================================= -SMESH::long_array* SMESH_GroupBase_i::GetListOfID() +SMESH::smIdType_array* SMESH_GroupBase_i::GetListOfID() { if ( myPreMeshInfo ) myPreMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); SMESHDS_GroupBase* aGroupDS = GetGroupDS(); if (aGroupDS) { - int aSize = aGroupDS->Extent(); + smIdType aSize = aGroupDS->Extent(); aRes->length(aSize); SMDS_ElemIteratorPtr it = aGroupDS->GetElements(); - for (int i = 0; it->more(); i++) + for (smIdType i = 0; it->more(); i++) aRes[i] = it->next()->GetID(); if ( 0 < aSize && aSize < 100 ) // for comfortable testing ;) @@ -509,7 +509,7 @@ namespace */ //================================================================================ -CORBA::Long SMESH_GroupBase_i::GetNumberOfNodes() +SMESH::smIdType SMESH_GroupBase_i::GetNumberOfNodes() { if ( GetType() == SMESH::NODE ) return Size(); @@ -553,7 +553,7 @@ CORBA::Boolean SMESH_GroupBase_i::IsNodeInfoAvailable() */ //================================================================================ -SMESH::long_array* SMESH_GroupBase_i::GetNodeIDs() +SMESH::smIdType_array* SMESH_GroupBase_i::GetNodeIDs() { if ( GetType() == SMESH::NODE ) return GetListOfID(); @@ -561,7 +561,7 @@ SMESH::long_array* SMESH_GroupBase_i::GetNodeIDs() if ( myPreMeshInfo ) myPreMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); if ( SMESHDS_GroupBase* g = GetGroupDS()) { std::set nodes; @@ -651,7 +651,7 @@ void SMESH_GroupBase_i::SetColor(const SALOMEDS::Color& color) * */ //============================================================================= -CORBA::Long SMESH_GroupBase_i::GetColorNumber() +CORBA::Long SMESH_GroupBase_i::GetColorNumber() { SMESHDS_GroupBase* aGroupDS = GetGroupDS(); if (aGroupDS) @@ -684,12 +684,12 @@ void SMESH_GroupBase_i::SetColorNumber(CORBA::Long color) */ //============================================================================= -SMESH::long_array* SMESH_GroupBase_i::GetMeshInfo() +SMESH::smIdType_array* SMESH_GroupBase_i::GetMeshInfo() { if ( myPreMeshInfo ) return myPreMeshInfo->GetMeshInfo(); - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::Entity_Last); for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) aRes[i] = 0; @@ -712,9 +712,9 @@ SMESH::long_array* SMESH_GroupBase_i::GetMeshInfo() */ //============================================================================= -SMESH::long_array* SMESH_GroupBase_i::GetNbElementsByType() +SMESH::smIdType_array* SMESH_GroupBase_i::GetNbElementsByType() { - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::NB_ELEMENT_TYPES); for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) aRes[ i ] = 0; @@ -732,7 +732,7 @@ SMESH::long_array* SMESH_GroupBase_i::GetNbElementsByType() //purpose : Return ids of members //======================================================================= -SMESH::long_array* SMESH_GroupBase_i::GetIDs() +SMESH::smIdType_array* SMESH_GroupBase_i::GetIDs() { return GetListOfID(); } @@ -893,12 +893,12 @@ bool SMESH_GroupOnFilter_i::IsMeshInfoCorrect() //purpose : Return ids of members //======================================================================= -SMESH::long_array* SMESH_GroupOnFilter_i::GetListOfID() +SMESH::smIdType_array* SMESH_GroupOnFilter_i::GetListOfID() { if ( myPreMeshInfo ) myPreMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); SMESHDS_GroupBase* aGroupDS = GetGroupDS(); if ( SMESHDS_GroupOnFilter* grDS = dynamic_cast< SMESHDS_GroupOnFilter*>( GetGroupDS() )) { @@ -921,12 +921,12 @@ SMESH::long_array* SMESH_GroupOnFilter_i::GetListOfID() */ //============================================================================= -SMESH::long_array* SMESH_GroupOnFilter_i::GetMeshInfo() +SMESH::smIdType_array* SMESH_GroupOnFilter_i::GetMeshInfo() { if ( myPreMeshInfo ) return myPreMeshInfo->GetMeshInfo(); - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::Entity_Last); for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) aRes[i] = 0; @@ -938,7 +938,7 @@ SMESH::long_array* SMESH_GroupOnFilter_i::GetMeshInfo() if ( g->GetType() != SMDSAbs_Node ) { - std::vector< int > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo(); + std::vector< SMESH::smIdType > nbElems = static_cast< SMESHDS_GroupOnFilter* >( g )->GetMeshInfo(); for ( size_t i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) if ( i < nbElems.size() ) aRes[i] = nbElems[ i ]; diff --git a/src/SMESH_I/SMESH_Group_i.hxx b/src/SMESH_I/SMESH_Group_i.hxx index 92a34a248..e98d9e775 100644 --- a/src/SMESH_I/SMESH_Group_i.hxx +++ b/src/SMESH_I/SMESH_Group_i.hxx @@ -61,13 +61,13 @@ class SMESH_I_EXPORT SMESH_GroupBase_i: void SetName(const char* name); char* GetName(); SMESH::ElementType GetType(); - CORBA::Long Size(); + SMESH::smIdType Size(); CORBA::Boolean IsEmpty(); - CORBA::Boolean Contains(CORBA::Long elem_id); - CORBA::Long GetID(CORBA::Long elem_index); - SMESH::long_array* GetListOfID(); - SMESH::long_array* GetNodeIDs(); - CORBA::Long GetNumberOfNodes(); + CORBA::Boolean Contains(SMESH::smIdType elem_id); + SMESH::smIdType GetID(SMESH::smIdType elem_index); + SMESH::smIdType_array* GetListOfID(); + SMESH::smIdType_array* GetNodeIDs(); + SMESH::smIdType GetNumberOfNodes(); CORBA::Boolean IsNodeInfoAvailable(); // for gui virtual SMESH::SMESH_Mesh_ptr GetMesh(); @@ -77,15 +77,15 @@ class SMESH_I_EXPORT SMESH_GroupBase_i: * Result array of number of elements per \a EntityType * Inherited from SMESH_IDSource */ - virtual SMESH::long_array* GetMeshInfo(); + virtual SMESH::smIdType_array* GetMeshInfo(); /*! * Returns number of mesh elements of each \a ElementType */ - virtual SMESH::long_array* GetNbElementsByType(); + virtual SMESH::smIdType_array* GetNbElementsByType(); /*! * Returns a sequence of all element IDs */ - virtual SMESH::long_array* GetIDs(); + virtual SMESH::smIdType_array* GetIDs(); /*! * Returns types of elements it contains * Inherited from SMESH_IDSource interface @@ -150,13 +150,13 @@ class SMESH_I_EXPORT SMESH_Group_i: const int theLocalID ); // CORBA interface implementation void Clear(); - CORBA::Long Add( const SMESH::long_array& theIDs ); - CORBA::Long Remove( const SMESH::long_array& theIDs ); + SMESH::smIdType Add( const SMESH::smIdType_array& theIDs ); + SMESH::smIdType Remove( const SMESH::smIdType_array& theIDs ); - CORBA::Long AddByPredicate( SMESH::Predicate_ptr thePredicate ); - CORBA::Long RemoveByPredicate( SMESH::Predicate_ptr thePredicate ); + SMESH::smIdType AddByPredicate( SMESH::Predicate_ptr thePredicate ); + SMESH::smIdType RemoveByPredicate( SMESH::Predicate_ptr thePredicate ); - CORBA::Long AddFrom( SMESH::SMESH_IDSource_ptr theSource ); + SMESH::smIdType AddFrom( SMESH::SMESH_IDSource_ptr theSource ); }; // ========================= @@ -199,8 +199,8 @@ class SMESH_I_EXPORT SMESH_GroupOnFilter_i: void SetFilter(SMESH::Filter_ptr theFilter); SMESH::Filter_ptr GetFilter(); virtual CORBA::Boolean IsUpToDate(); - virtual SMESH::long_array* GetListOfID(); - virtual SMESH::long_array* GetMeshInfo(); + virtual SMESH::smIdType_array* GetListOfID(); + virtual SMESH::smIdType_array* GetMeshInfo(); //! @return false in two cases: 1) if mesh not loaded and GetMeshInfo() returns //! incorrect information 2) mesh loaded but group contents is not computed. virtual bool IsMeshInfoCorrect(); diff --git a/src/SMESH_I/SMESH_Hypothesis_i.cxx b/src/SMESH_I/SMESH_Hypothesis_i.cxx index dc41602a9..ffae4e435 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.cxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.cxx @@ -114,7 +114,7 @@ void SMESH_Hypothesis_i::SetLibName(const char* theLibName) */ //============================================================================= -CORBA::Long SMESH_Hypothesis_i::GetId() +CORBA::Short SMESH_Hypothesis_i::GetId() { return myBaseImpl->GetID(); } diff --git a/src/SMESH_I/SMESH_Hypothesis_i.hxx b/src/SMESH_I/SMESH_Hypothesis_i.hxx index 0fcc83ca8..9fa6d8113 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.hxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.hxx @@ -69,7 +69,7 @@ public: void SetLibName( const char* theLibName ); // Get unique id of hypothesis - virtual CORBA::Long GetId(); + virtual CORBA::Short GetId(); // Return true if a hypothesis has parameters virtual CORBA::Boolean HasParameters(); diff --git a/src/SMESH_I/SMESH_Measurements_i.cxx b/src/SMESH_I/SMESH_Measurements_i.cxx index 20f62446e..3b6f85e70 100644 --- a/src/SMESH_I/SMESH_Measurements_i.cxx +++ b/src/SMESH_I/SMESH_Measurements_i.cxx @@ -174,7 +174,7 @@ static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, if ( aMesh ) { theFunctor->SetMesh( aMesh ); - SMESH::long_array_var anElementsId = theSource->GetIDs(); + SMESH::smIdType_array_var anElementsId = theSource->GetIDs(); for ( CORBA::ULong i = 0; i < anElementsId->length(); i++) { value += theFunctor->GetValue( anElementsId[i] ); } @@ -209,8 +209,8 @@ SMESH::Measure Measurements_i::MinDistance bool isNode1 = isNodeType(types1); bool isNode2 = isOrigin || isNodeType(types2); - SMESH::long_array_var aElementsId1 = theSource1->GetIDs(); - SMESH::long_array_var aElementsId2; + SMESH::smIdType_array_var aElementsId1 = theSource1->GetIDs(); + SMESH::smIdType_array_var aElementsId2; // compute distance between two entities /* NOTE: currently only node-to-node case is implemented @@ -297,7 +297,7 @@ static void enlargeBoundingBox(const SMESH::SMESH_IDSource_ptr theObject, else { SMESH::array_of_ElementType_var types = theObject->GetTypes(); - SMESH::long_array_var aElementsId = theObject->GetIDs(); + SMESH::smIdType_array_var aElementsId = theObject->GetIDs(); // here we assume that type of all IDs defined by first type in array const bool isNode = isNodeType( types ); for(int i = 0, n = aElementsId->length(); i < n; i++) diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 8befed7a4..668b57cc8 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -135,9 +135,9 @@ namespace MeshEditor_I { { // copy element nodes int anElemNbNodes = anElem->NbNodes(); - vector< int > anElemNodesID( anElemNbNodes ) ; + vector< smIdType > anElemNodesID( anElemNbNodes ) ; SMDS_ElemIteratorPtr itElemNodes = anElem->nodesIterator(); - for ( int i = 0; itElemNodes->more(); i++) + for ( smIdType i = 0; itElemNodes->more(); i++) { const SMDS_MeshNode* anElemNode = cast2Node( itElemNodes->next() ); Copy( anElemNode ); @@ -264,11 +264,11 @@ namespace MeshEditor_I { */ //================================================================================ - void arrayToSet(const SMESH::long_array & IDs, - const SMESHDS_Mesh* aMesh, - TIDSortedElemSet& aMap, - const SMDSAbs_ElementType aType = SMDSAbs_All, - SMDS_MeshElement::Filter* aFilter = NULL) + void arrayToSet(const SMESH::smIdType_array & IDs, + const SMESHDS_Mesh* aMesh, + TIDSortedElemSet& aMap, + const SMDSAbs_ElementType aType = SMDSAbs_All, + SMDS_MeshElement::Filter* aFilter = NULL) { SMDS_MeshElement::NonNullFilter filter1; SMDS_MeshElement::TypeFilter filter2( aType ); @@ -279,13 +279,13 @@ namespace MeshEditor_I { SMDS_MeshElement::Filter & filter = *aFilter; if ( aType == SMDSAbs_Node ) - for ( CORBA::ULong i = 0; i < IDs.length(); i++ ) { + for ( SMESH::smIdType i = 0; i < IDs.length(); i++ ) { const SMDS_MeshElement * elem = aMesh->FindNode( IDs[i] ); if ( filter( elem )) aMap.insert( aMap.end(), elem ); } else - for ( CORBA::ULong i = 0; iFindElement( IDs[i] ); if ( filter( elem )) aMap.insert( aMap.end(), elem ); @@ -314,7 +314,7 @@ namespace MeshEditor_I { else { SMESH::array_of_ElementType_var types = theObject->GetTypes(); - SMESH::long_array_var aElementsId = theObject->GetIDs(); + SMESH::smIdType_array_var aElementsId = theObject->GetIDs(); if ( types->length() == 1 && types[0] == SMESH::NODE) { for ( CORBA::ULong i = 0; i < aElementsId->length(); i++ ) @@ -573,7 +573,7 @@ SMESH::MeshPreviewStruct* SMESH_MeshEditor_i::GetPreviewData() aMeshElem->nodeIterator() ); while ( itElemNodes->more() ) { const SMDS_MeshNode* aMeshNode = itElemNodes->next(); - int aNodeID = aMeshNode->GetID(); + smIdType aNodeID = aMeshNode->GetID(); TNodesMap::iterator anIter = nodesMap.find(aNodeID); if ( anIter == nodesMap.end() ) { // filling the nodes coordinates @@ -615,10 +615,10 @@ SMESH::MeshPreviewStruct* SMESH_MeshEditor_i::GetPreviewData() */ //================================================================================ -SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedNodes() +SMESH::smIdType_array* SMESH_MeshEditor_i::GetLastCreatedNodes() { SMESH_TRY; - SMESH::long_array_var myLastCreatedNodes = new SMESH::long_array(); + SMESH::smIdType_array_var myLastCreatedNodes = new SMESH::smIdType_array(); const SMESH_SequenceOfElemPtr& aSeq = getEditor().GetLastCreatedNodes(); myLastCreatedNodes->length( aSeq.size() ); @@ -637,10 +637,10 @@ SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedNodes() */ //================================================================================ -SMESH::long_array* SMESH_MeshEditor_i::GetLastCreatedElems() +SMESH::smIdType_array* SMESH_MeshEditor_i::GetLastCreatedElems() { SMESH_TRY; - SMESH::long_array_var myLastCreatedElems = new SMESH::long_array(); + SMESH::smIdType_array_var myLastCreatedElems = new SMESH::smIdType_array(); const SMESH_SequenceOfElemPtr& aSeq = getEditor().GetLastCreatedElems(); myLastCreatedElems->length( aSeq.size() ); @@ -704,16 +704,16 @@ SMESH::ComputeError* SMESH_MeshEditor_i::GetLastError() struct SMESH_MeshEditor_i::_IDSource : public virtual POA_SMESH::SMESH_IDSource, public virtual SALOME::GenericObj_i { - SMESH::long_array _ids; - SMESH::ElementType _type; - SMESH::SMESH_Mesh_ptr _mesh; - SMESH::long_array* GetIDs() { return new SMESH::long_array( _ids ); } - SMESH::long_array* GetMeshInfo() { return 0; } - SMESH::long_array* GetNbElementsByType() + SMESH::smIdType_array _ids; + SMESH::ElementType _type; + SMESH::SMESH_Mesh_ptr _mesh; + SMESH::smIdType_array* GetIDs() { return new SMESH::smIdType_array( _ids ); } + SMESH::smIdType_array* GetMeshInfo() { return 0; } + SMESH::smIdType_array* GetNbElementsByType() { - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::NB_ELEMENT_TYPES); - for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) + for (smIdType i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) aRes[ i ] = ( i == _type ) ? _ids.length() : 0; return aRes._retn(); } @@ -735,8 +735,8 @@ struct SMESH_MeshEditor_i::_IDSource : public virtual POA_SMESH::SMESH_IDSource, } }; -SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids, - SMESH::ElementType type) +SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::smIdType_array& ids, + SMESH::ElementType type) { _IDSource* idSrc = new _IDSource; idSrc->_mesh = myMesh_i->_this(); @@ -755,12 +755,12 @@ bool SMESH_MeshEditor_i::IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSourc return SMESH::DownCast( idSource ); } -CORBA::Long* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, - int& nbIds) +SMESH::smIdType* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, + SMESH::smIdType& nbIds) { if ( _IDSource* tmpIdSource = SMESH::DownCast( idSource )) { - nbIds = (int) tmpIdSource->_ids.length(); + nbIds = (SMESH::smIdType) tmpIdSource->_ids.length(); return & tmpIdSource->_ids[0]; } nbIds = 0; @@ -782,14 +782,14 @@ CORBA::Long* SMESH_MeshEditor_i::GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idS //============================================================================= CORBA::Boolean -SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements) +SMESH_MeshEditor_i::RemoveElements(const SMESH::smIdType_array & IDsOfElements) { SMESH_TRY; initData(); - list< int > IdList; + list< smIdType > IdList; - for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ ) + for ( SMESH::smIdType i = 0; i < IDsOfElements.length(); i++ ) IdList.push_back( IDsOfElements[i] ); // Update Python script @@ -811,13 +811,13 @@ SMESH_MeshEditor_i::RemoveElements(const SMESH::long_array & IDsOfElements) */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNodes) +CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::smIdType_array & IDsOfNodes) { SMESH_TRY; initData(); - list< int > IdList; - for ( CORBA::ULong i = 0; i < IDsOfNodes.length(); i++) + list< smIdType > IdList; + for ( SMESH::smIdType i = 0; i < IDsOfNodes.length(); i++) IdList.push_back( IDsOfNodes[i] ); // Update Python script @@ -838,7 +838,7 @@ CORBA::Boolean SMESH_MeshEditor_i::RemoveNodes(const SMESH::long_array & IDsOfNo */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes() +SMESH::smIdType SMESH_MeshEditor_i::RemoveOrphanNodes() { SMESH_TRY; initData(); @@ -852,11 +852,11 @@ CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes() SMESH::Controls::Filter::GetElementsId( getMeshDS(), predicate, seq ); // remove orphan nodes (if there are any) - list< int > IdList( seq.begin(), seq.end() ); + list< smIdType > IdList( seq.begin(), seq.end() ); - int nbNodesBefore = myMesh->NbNodes(); + SMESH::smIdType nbNodesBefore = myMesh->NbNodes(); getEditor().Remove( IdList, true ); - int nbNodesAfter = myMesh->NbNodes(); + SMESH::smIdType nbNodesAfter = myMesh->NbNodes(); declareMeshModified( /*isReComputeSafe=*/ IdList.size() == 0 ); // issue 0020693 return nbNodesBefore - nbNodesAfter; @@ -871,7 +871,7 @@ CORBA::Long SMESH_MeshEditor_i::RemoveOrphanNodes() */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddNode(CORBA::Double x,CORBA::Double y, CORBA::Double z) +SMESH::smIdType SMESH_MeshEditor_i::AddNode(CORBA::Double x,CORBA::Double y, CORBA::Double z) { SMESH_TRY; initData(); @@ -895,8 +895,8 @@ CORBA::Long SMESH_MeshEditor_i::AddNode(CORBA::Double x,CORBA::Double y, CORBA:: */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::Add0DElement(CORBA::Long IDOfNode, - CORBA::Boolean DuplicateElements) +SMESH::smIdType SMESH_MeshEditor_i::Add0DElement(SMESH::smIdType IDOfNode, + CORBA::Boolean DuplicateElements) { SMESH_TRY; initData(); @@ -925,7 +925,7 @@ CORBA::Long SMESH_MeshEditor_i::Add0DElement(CORBA::Long IDOfNode, */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddBall(CORBA::Long IDOfNode, CORBA::Double diameter) +SMESH::smIdType SMESH_MeshEditor_i::AddBall(SMESH::smIdType IDOfNode, CORBA::Double diameter) { SMESH_TRY; initData(); @@ -954,17 +954,17 @@ CORBA::Long SMESH_MeshEditor_i::AddBall(CORBA::Long IDOfNode, CORBA::Double diam */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes) +SMESH::smIdType SMESH_MeshEditor_i::AddEdge(const SMESH::smIdType_array & IDsOfNodes) { SMESH_TRY; initData(); - int NbNodes = IDsOfNodes.length(); + SMESH::smIdType NbNodes = IDsOfNodes.length(); SMDS_MeshElement* elem = 0; if (NbNodes == 2) { - CORBA::Long index1 = IDsOfNodes[0]; - CORBA::Long index2 = IDsOfNodes[1]; + SMESH::smIdType index1 = IDsOfNodes[0]; + SMESH::smIdType index2 = IDsOfNodes[1]; elem = getMeshDS()->AddEdge( getMeshDS()->FindNode(index1), getMeshDS()->FindNode(index2)); @@ -973,9 +973,9 @@ CORBA::Long SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes) << index1 << ", " << index2 <<" ])"; } if (NbNodes == 3) { - CORBA::Long n1 = IDsOfNodes[0]; - CORBA::Long n2 = IDsOfNodes[1]; - CORBA::Long n12 = IDsOfNodes[2]; + SMESH::smIdType n1 = IDsOfNodes[0]; + SMESH::smIdType n2 = IDsOfNodes[1]; + SMESH::smIdType n12 = IDsOfNodes[2]; elem = getMeshDS()->AddEdge( getMeshDS()->FindNode(n1), getMeshDS()->FindNode(n2), getMeshDS()->FindNode(n12)); @@ -997,7 +997,7 @@ CORBA::Long SMESH_MeshEditor_i::AddEdge(const SMESH::long_array & IDsOfNodes) */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes) +SMESH::smIdType SMESH_MeshEditor_i::AddFace(const SMESH::smIdType_array & IDsOfNodes) { SMESH_TRY; initData(); @@ -1045,7 +1045,7 @@ CORBA::Long SMESH_MeshEditor_i::AddFace(const SMESH::long_array & IDsOfNodes) */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::long_array & IDsOfNodes) +SMESH::smIdType SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::smIdType_array & IDsOfNodes) { SMESH_TRY; initData(); @@ -1080,7 +1080,7 @@ CORBA::Long SMESH_MeshEditor_i::AddPolygonalFace (const SMESH::long_array & IDsO */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddQuadPolygonalFace (const SMESH::long_array & IDsOfNodes) +SMESH::smIdType SMESH_MeshEditor_i::AddQuadPolygonalFace (const SMESH::smIdType_array & IDsOfNodes) { SMESH_TRY; initData(); @@ -1115,7 +1115,7 @@ CORBA::Long SMESH_MeshEditor_i::AddQuadPolygonalFace (const SMESH::long_array & */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes) +SMESH::smIdType SMESH_MeshEditor_i::AddVolume(const SMESH::smIdType_array & IDsOfNodes) { SMESH_TRY; initData(); @@ -1174,7 +1174,7 @@ CORBA::Long SMESH_MeshEditor_i::AddVolume(const SMESH::long_array & IDsOfNodes) * AddPolyhedralVolume */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::long_array & IDsOfNodes, +SMESH::smIdType SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::smIdType_array & IDsOfNodes, const SMESH::long_array & Quantities) { SMESH_TRY; @@ -1213,7 +1213,7 @@ CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolume (const SMESH::long_array & I */ //============================================================================= -CORBA::Long SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces (const SMESH::long_array & IdsOfFaces) +SMESH::smIdType SMESH_MeshEditor_i::AddPolyhedralVolumeByFaces (const SMESH::smIdType_array & IdsOfFaces) { SMESH_TRY; initData(); @@ -1272,7 +1272,7 @@ SMESH_MeshEditor_i::Create0DElementsOnAllNodes(SMESH::SMESH_IDSource_ptr theObje if ( idSourceToSet( theObject, getMeshDS(), elements, SMDSAbs_All, /*emptyIfIsMesh=*/1)) getEditor().Create0DElementsOnAllNodes( elements, elems0D, theDuplicateElements ); - SMESH::long_array_var newElems = new SMESH::long_array; + SMESH::smIdType_array_var newElems = new SMESH::smIdType_array; newElems->length( elems0D.size() ); TIDSortedElemSet::iterator eIt = elems0D.begin(); for ( size_t i = 0; i < elems0D.size(); ++i, ++eIt ) @@ -1329,7 +1329,7 @@ SMESH_MeshEditor_i::Create0DElementsOnAllNodes(SMESH::SMESH_IDSource_ptr theObje */ //============================================================================= -void SMESH_MeshEditor_i::SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID) +void SMESH_MeshEditor_i::SetNodeOnVertex(SMESH::smIdType NodeID, CORBA::Long VertexID) { SMESH_TRY; @@ -1362,7 +1362,7 @@ void SMESH_MeshEditor_i::SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexI */ //============================================================================= -void SMESH_MeshEditor_i::SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID, +void SMESH_MeshEditor_i::SetNodeOnEdge(SMESH::smIdType NodeID, CORBA::Long EdgeID, CORBA::Double paramOnEdge) { SMESH_TRY; @@ -1405,7 +1405,7 @@ void SMESH_MeshEditor_i::SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID, */ //============================================================================= -void SMESH_MeshEditor_i::SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID, +void SMESH_MeshEditor_i::SetNodeOnFace(SMESH::smIdType NodeID, CORBA::Long FaceID, CORBA::Double u, CORBA::Double v) { SMESH_TRY; @@ -1450,7 +1450,7 @@ void SMESH_MeshEditor_i::SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID, */ //============================================================================= -void SMESH_MeshEditor_i::SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID) +void SMESH_MeshEditor_i::SetNodeInVolume(SMESH::smIdType NodeID, CORBA::Long SolidID) { SMESH_TRY; SMESHDS_Mesh * mesh = getMeshDS(); @@ -1479,7 +1479,7 @@ void SMESH_MeshEditor_i::SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID */ //============================================================================= -void SMESH_MeshEditor_i::SetMeshElementOnShape(CORBA::Long ElementID, +void SMESH_MeshEditor_i::SetMeshElementOnShape(SMESH::smIdType ElementID, CORBA::Long ShapeID) { SMESH_TRY; @@ -1511,8 +1511,8 @@ void SMESH_MeshEditor_i::SetMeshElementOnShape(CORBA::Long ElementID, */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(CORBA::Long NodeID1, - CORBA::Long NodeID2) +CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(SMESH::smIdType NodeID1, + SMESH::smIdType NodeID2) { SMESH_TRY; initData(); @@ -1541,8 +1541,8 @@ CORBA::Boolean SMESH_MeshEditor_i::InverseDiag(CORBA::Long NodeID1, */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1, - CORBA::Long NodeID2) +CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(SMESH::smIdType NodeID1, + SMESH::smIdType NodeID2) { SMESH_TRY; initData(); @@ -1573,14 +1573,14 @@ CORBA::Boolean SMESH_MeshEditor_i::DeleteDiag(CORBA::Long NodeID1, */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::long_array & IDsOfElements) +CORBA::Boolean SMESH_MeshEditor_i::Reorient(const SMESH::smIdType_array & IDsOfElements) { SMESH_TRY; initData(); - for ( CORBA::ULong i = 0; i < IDsOfElements.length(); i++ ) + for ( SMESH::smIdType i = 0; i < IDsOfElements.length(); i++ ) { - CORBA::Long index = IDsOfElements[i]; + SMESH::smIdType index = IDsOfElements[i]; const SMDS_MeshElement * elem = getMeshDS()->FindElement(index); if ( elem ) getEditor().Reorient( elem ); @@ -1610,7 +1610,7 @@ CORBA::Boolean SMESH_MeshEditor_i::ReorientObject(SMESH::SMESH_IDSource_ptr theO prepareIdSource( theObject ); - SMESH::long_array_var anElementsId = theObject->GetIDs(); + SMESH::smIdType_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = Reorient(anElementsId); // Update Python script @@ -1768,7 +1768,7 @@ CORBA::Long SMESH_MeshEditor_i::Reorient2DBy3D(const SMESH::ListOfIDSources& fac */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::long_array & IDsOfElements, +CORBA::Boolean SMESH_MeshEditor_i::TriToQuad (const SMESH::smIdType_array & IDsOfElements, SMESH::NumericalFunctor_ptr Criterion, CORBA::Double MaxAngle) { @@ -1826,7 +1826,7 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr TPythonDump aTPythonDump; // suppress dump in TriToQuad() prepareIdSource( theObject ); - SMESH::long_array_var anElementsId = theObject->GetIDs(); + SMESH::smIdType_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = TriToQuad(anElementsId, Criterion, MaxAngle); if ( !myIsPreviewMode ) { @@ -1850,7 +1850,7 @@ CORBA::Boolean SMESH_MeshEditor_i::TriToQuadObject (SMESH::SMESH_IDSource_ptr */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::long_array & IDsOfElements, +CORBA::Boolean SMESH_MeshEditor_i::QuadToTri (const SMESH::smIdType_array & IDsOfElements, SMESH::NumericalFunctor_ptr Criterion) { SMESH_TRY; @@ -1896,7 +1896,7 @@ CORBA::Boolean SMESH_MeshEditor_i::QuadToTriObject (SMESH::SMESH_IDSource_ptr TPythonDump aTPythonDump; // suppress dump in QuadToTri() prepareIdSource( theObject ); - SMESH::long_array_var anElementsId = theObject->GetIDs(); + SMESH::smIdType_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = QuadToTri(anElementsId, Criterion); SMESH::NumericalFunctor_i* aNumericalFunctor = @@ -1943,7 +1943,7 @@ void SMESH_MeshEditor_i::QuadTo4Tri (SMESH::SMESH_IDSource_ptr theObject) */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::long_array & IDsOfElements, +CORBA::Boolean SMESH_MeshEditor_i::SplitQuad (const SMESH::smIdType_array & IDsOfElements, CORBA::Boolean Diag13) { SMESH_TRY; @@ -1981,7 +1981,7 @@ CORBA::Boolean SMESH_MeshEditor_i::SplitQuadObject (SMESH::SMESH_IDSource_ptr th TPythonDump aTPythonDump; // suppress dump in SplitQuad() prepareIdSource( theObject ); - SMESH::long_array_var anElementsId = theObject->GetIDs(); + SMESH::smIdType_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = SplitQuad(anElementsId, Diag13); // Update Python script @@ -2090,7 +2090,7 @@ void SMESH_MeshEditor_i::SplitHexahedraIntoPrisms( SMESH::SMESH_IDSource_ptr el facetToSplitNormal.PS.z )); TIDSortedElemSet elemSet; prepareIdSource( elems ); - SMESH::long_array_var anElementsId = elems->GetIDs(); + SMESH::smIdType_array_var anElementsId = elems->GetIDs(); SMDS_MeshElement::GeomFilter filter( SMDSGeom_HEXA ); arrayToSet( anElementsId, getMeshDS(), elemSet, SMDSAbs_Volume, &filter ); @@ -2167,9 +2167,9 @@ void SMESH_MeshEditor_i::SplitBiQuadraticIntoLinear(const SMESH::ListOfIDSources //======================================================================= CORBA::Boolean -SMESH_MeshEditor_i::Smooth(const SMESH::long_array & IDsOfElements, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, +SMESH_MeshEditor_i::Smooth(const SMESH::smIdType_array & IDsOfElements, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method) { @@ -2184,9 +2184,9 @@ SMESH_MeshEditor_i::Smooth(const SMESH::long_array & IDsOfElements, //======================================================================= CORBA::Boolean -SMESH_MeshEditor_i::SmoothParametric(const SMESH::long_array & IDsOfElements, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, +SMESH_MeshEditor_i::SmoothParametric(const SMESH::smIdType_array & IDsOfElements, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method) { @@ -2202,8 +2202,8 @@ SMESH_MeshEditor_i::SmoothParametric(const SMESH::long_array & IDsO CORBA::Boolean SMESH_MeshEditor_i::SmoothObject(SMESH::SMESH_IDSource_ptr theObject, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method) { @@ -2219,8 +2219,8 @@ SMESH_MeshEditor_i::SmoothObject(SMESH::SMESH_IDSource_ptr theObjec CORBA::Boolean SMESH_MeshEditor_i::SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method) { @@ -2236,9 +2236,9 @@ SMESH_MeshEditor_i::SmoothParametricObject(SMESH::SMESH_IDSource_ptr //============================================================================= CORBA::Boolean -SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, +SMESH_MeshEditor_i::smooth(const SMESH::smIdType_array & IDsOfElements, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method, bool IsParametric) @@ -2252,8 +2252,8 @@ SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements, arrayToSet(IDsOfElements, aMesh, elements, SMDSAbs_Face); set fixedNodes; - for ( CORBA::ULong i = 0; i < IDsOfFixedNodes.length(); i++) { - CORBA::Long index = IDsOfFixedNodes[i]; + for ( SMESH::smIdType i = 0; i < IDsOfFixedNodes.length(); i++) { + SMESH::smIdType index = IDsOfFixedNodes[i]; const SMDS_MeshNode * node = aMesh->FindNode(index); if ( node ) fixedNodes.insert( node ); @@ -2290,8 +2290,8 @@ SMESH_MeshEditor_i::smooth(const SMESH::long_array & IDsOfElements, CORBA::Boolean SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObject, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method, bool IsParametric) @@ -2302,7 +2302,7 @@ SMESH_MeshEditor_i::smoothObject(SMESH::SMESH_IDSource_ptr theObjec TPythonDump aTPythonDump; // suppress dump in smooth() prepareIdSource( theObject ); - SMESH::long_array_var anElementsId = theObject->GetIDs(); + SMESH::smIdType_array_var anElementsId = theObject->GetIDs(); CORBA::Boolean isDone = smooth (anElementsId, IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method, IsParametric); @@ -2741,12 +2741,12 @@ SMESH_MeshEditor_i::ExtrusionByNormal(const SMESH::ListOfIDSources& objects, //======================================================================= SMESH::ListOfGroups* -SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::long_array & theIDsOfElements, - const SMESH::DirStruct & theStepVector, - CORBA::Long theNbOfSteps, - CORBA::Long theExtrFlags, - CORBA::Double theSewTolerance, - CORBA::Boolean theMakeGroups) +SMESH_MeshEditor_i::AdvancedExtrusion(const SMESH::smIdType_array & theIDsOfElements, + const SMESH::DirStruct & theStepVector, + CORBA::Long theNbOfSteps, + CORBA::Long theExtrFlags, + CORBA::Double theSewTolerance, + CORBA::Boolean theMakeGroups) { SMESH_TRY; initData(); @@ -2823,7 +2823,7 @@ SMESH_MeshEditor_i::ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & the const SMESH::ListOfIDSources & theFaces, SMESH::SMESH_IDSource_ptr thePathObject, GEOM::GEOM_Object_ptr thePathShape, - CORBA::Long theNodeStart, + SMESH::smIdType theNodeStart, CORBA::Boolean theHasAngles, const SMESH::double_array & theAngles, CORBA::Boolean theAnglesVariation, @@ -2999,7 +2999,7 @@ SMESH_MeshEditor_i::LinearAnglesVariation(SMESH::SMESH_Mesh_ptr thePathMes SMESH_subMesh* aSubMesh = aMeshImp->GetImpl().GetSubMesh( aShape ); if ( !aSubMesh || !aSubMesh->GetSubMeshDS()) return aResult._retn(); - int nbSteps = aSubMesh->GetSubMeshDS()->NbElements(); + smIdType nbSteps = aSubMesh->GetSubMeshDS()->NbElements(); if ( nbSteps == nbAngles ) { aResult.inout() = theAngles; @@ -3118,7 +3118,7 @@ SMESH_MeshEditor_i::mirror(TIDSortedElemSet & theElements, //purpose : //======================================================================= -void SMESH_MeshEditor_i::Mirror(const SMESH::long_array & theIDsOfElements, +void SMESH_MeshEditor_i::Mirror(const SMESH::smIdType_array & theIDsOfElements, const SMESH::AxisStruct & theAxis, SMESH::SMESH_MeshEditor::MirrorType theMirrorType, CORBA::Boolean theCopy) @@ -3170,7 +3170,7 @@ void SMESH_MeshEditor_i::MirrorObject(SMESH::SMESH_IDSource_ptr theObj //======================================================================= SMESH::ListOfGroups* -SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::long_array& theIDsOfElements, +SMESH_MeshEditor_i::MirrorMakeGroups(const SMESH::smIdType_array& theIDsOfElements, const SMESH::AxisStruct& theMirror, SMESH::SMESH_MeshEditor::MirrorType theMirrorType) { @@ -3227,7 +3227,7 @@ SMESH_MeshEditor_i::MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr t //======================================================================= SMESH::SMESH_Mesh_ptr -SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::long_array& theIDsOfElements, +SMESH_MeshEditor_i::MirrorMakeMesh(const SMESH::smIdType_array& theIDsOfElements, const SMESH::AxisStruct& theMirror, SMESH::SMESH_MeshEditor::MirrorType theMirrorType, CORBA::Boolean theCopyGroups, @@ -3375,9 +3375,9 @@ SMESH_MeshEditor_i::translate(TIDSortedElemSet & theElements, //purpose : //======================================================================= -void SMESH_MeshEditor_i::Translate(const SMESH::long_array & theIDsOfElements, - const SMESH::DirStruct & theVector, - CORBA::Boolean theCopy) +void SMESH_MeshEditor_i::Translate(const SMESH::smIdType_array & theIDsOfElements, + const SMESH::DirStruct & theVector, + CORBA::Boolean theCopy) { if (!myIsPreviewMode) { TPythonDump() << this << ".Translate( " @@ -3421,8 +3421,8 @@ void SMESH_MeshEditor_i::TranslateObject(SMESH::SMESH_IDSource_ptr theObject, //======================================================================= SMESH::ListOfGroups* -SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::long_array& theIDsOfElements, - const SMESH::DirStruct& theVector) +SMESH_MeshEditor_i::TranslateMakeGroups(const SMESH::smIdType_array& theIDsOfElements, + const SMESH::DirStruct& theVector) { TPythonDump aPythonDump; // it is here to prevent dump of GetGroups() @@ -3472,10 +3472,10 @@ SMESH_MeshEditor_i::TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObjec //======================================================================= SMESH::SMESH_Mesh_ptr -SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::long_array& theIDsOfElements, - const SMESH::DirStruct& theVector, - CORBA::Boolean theCopyGroups, - const char* theMeshName) +SMESH_MeshEditor_i::TranslateMakeMesh(const SMESH::smIdType_array& theIDsOfElements, + const SMESH::DirStruct& theVector, + CORBA::Boolean theCopyGroups, + const char* theMeshName) { SMESH_Mesh_i* mesh_i; SMESH::SMESH_Mesh_var mesh; @@ -3619,10 +3619,10 @@ SMESH_MeshEditor_i::rotate(TIDSortedElemSet & theElements, //purpose : //======================================================================= -void SMESH_MeshEditor_i::Rotate(const SMESH::long_array & theIDsOfElements, - const SMESH::AxisStruct & theAxis, - CORBA::Double theAngle, - CORBA::Boolean theCopy) +void SMESH_MeshEditor_i::Rotate(const SMESH::smIdType_array & theIDsOfElements, + const SMESH::AxisStruct & theAxis, + CORBA::Double theAngle, + CORBA::Boolean theCopy) { if (!myIsPreviewMode) { TPythonDump() << this << ".Rotate( " @@ -3668,9 +3668,9 @@ void SMESH_MeshEditor_i::RotateObject(SMESH::SMESH_IDSource_ptr theObject, //======================================================================= SMESH::ListOfGroups* -SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::long_array& theIDsOfElements, - const SMESH::AxisStruct& theAxis, - CORBA::Double theAngle) +SMESH_MeshEditor_i::RotateMakeGroups(const SMESH::smIdType_array& theIDsOfElements, + const SMESH::AxisStruct& theAxis, + CORBA::Double theAngle) { TPythonDump aPythonDump; // it is here to prevent dump of GetGroups() @@ -3724,11 +3724,11 @@ SMESH_MeshEditor_i::RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr theObject, //======================================================================= SMESH::SMESH_Mesh_ptr -SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::long_array& theIDsOfElements, - const SMESH::AxisStruct& theAxis, - CORBA::Double theAngleInRadians, - CORBA::Boolean theCopyGroups, - const char* theMeshName) +SMESH_MeshEditor_i::RotateMakeMesh(const SMESH::smIdType_array& theIDsOfElements, + const SMESH::AxisStruct& theAxis, + CORBA::Double theAngleInRadians, + CORBA::Boolean theCopyGroups, + const char* theMeshName) { SMESH_TRY; SMESH::SMESH_Mesh_var mesh; @@ -4304,10 +4304,10 @@ void SMESH_MeshEditor_i::FindEqualElements(const SMESH::ListOfIDSources& theObj for (CORBA::Long j = 0; arraysIt != aListOfListOfElementsID.end(); ++arraysIt, ++j) { SMESH::long_array& aGroup = (*theGroupsOfElementsID)[ j ]; - list& listOfIDs = *arraysIt; + list& listOfIDs = *arraysIt; aGroup.length( listOfIDs.size() ); - list::iterator idIt = listOfIDs.begin(); - for (int k = 0; idIt != listOfIDs.end(); ++idIt, ++k ) + list::iterator idIt = listOfIDs.begin(); + for (smIdType k = 0; idIt != listOfIDs.end(); ++idIt, ++k ) aGroup[ k ] = *idIt; } @@ -4341,8 +4341,8 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& theGrou SMESH::array_of_ElementType_var elemTypes = theElementsToKeep[i]->GetTypes(); if ( elemTypes->length() == 1 && elemTypes[0] == SMESH::NODE ) continue; - SMESH::long_array_var elementsId = theElementsToKeep[i]->GetIDs(); - for ( CORBA::ULong j = 0; j < elementsId->length(); ++j ) + SMESH::smIdType_array_var elementsId = theElementsToKeep[i]->GetIDs(); + for ( SMESH::smIdType j = 0; j < elementsId->length(); ++j ) idsToKeep.Add( elementsId[ j ]); } @@ -4351,11 +4351,11 @@ void SMESH_MeshEditor_i::MergeElements(const SMESH::array_of_long_array& theGrou for ( CORBA::ULong i = 0; i < theGroupsOfElementsID.length(); i++ ) { const SMESH::long_array& anElemsIDGroup = theGroupsOfElementsID[ i ]; - aListOfListOfElementsID.push_back( list< int >() ); - list< int >& aListOfElemsID = aListOfListOfElementsID.back(); - for ( CORBA::ULong j = 0; j < anElemsIDGroup.length(); j++ ) + aListOfListOfElementsID.push_back( list< smIdType >() ); + list< smIdType >& aListOfElemsID = aListOfListOfElementsID.back(); + for ( SMESH::smIdType j = 0; j < anElemsIDGroup.length(); j++ ) { - CORBA::Long id = anElemsIDGroup[ j ]; + SMESH::smIdType id = anElemsIDGroup[ j ]; if ( idsToKeep.Contains( id )) aListOfElemsID.push_front( id ); else aListOfElemsID.push_back( id ); } @@ -4399,10 +4399,10 @@ void SMESH_MeshEditor_i::MergeEqualElements() */ //============================================================================= -CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long NodeID, - CORBA::Double x, - CORBA::Double y, - CORBA::Double z) +CORBA::Boolean SMESH_MeshEditor_i::MoveNode(SMESH::smIdType NodeID, + CORBA::Double x, + CORBA::Double y, + CORBA::Double z) { SMESH_TRY; initData(/*deleteSearchers=*/false); @@ -4456,7 +4456,7 @@ CORBA::Boolean SMESH_MeshEditor_i::MoveNode(CORBA::Long NodeID, */ //================================================================================ -CORBA::Long SMESH_MeshEditor_i::FindNodeClosestTo(CORBA::Double x, +SMESH::smIdType SMESH_MeshEditor_i::FindNodeClosestTo(CORBA::Double x, CORBA::Double y, CORBA::Double z) { @@ -4481,10 +4481,10 @@ CORBA::Long SMESH_MeshEditor_i::FindNodeClosestTo(CORBA::Double x, */ //================================================================================ -CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x, - CORBA::Double y, - CORBA::Double z, - CORBA::Long theNodeID) +SMESH::smIdType SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x, + CORBA::Double y, + CORBA::Double z, + SMESH::smIdType theNodeID) { SMESH_TRY; // We keep theNodeSearcher until any mesh modification: @@ -4495,7 +4495,7 @@ CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x, theSearchersDeleter.Set( myMesh ); // remove theNodeSearcher if mesh is other - int nodeID = theNodeID; + smIdType nodeID = theNodeID; const SMDS_MeshNode* node = getMeshDS()->FindNode( nodeID ); if ( !node ) // preview moving node { @@ -4558,13 +4558,13 @@ CORBA::Long SMESH_MeshEditor_i::MoveClosestNodeToPoint(CORBA::Double x, */ //======================================================================= -SMESH::long_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double x, +SMESH::smIdType_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double x, CORBA::Double y, CORBA::Double z, SMESH::ElementType type) { SMESH_TRY; - SMESH::long_array_var res = new SMESH::long_array; + SMESH::smIdType_array_var res = new SMESH::smIdType_array; vector< const SMDS_MeshElement* > foundElems; theSearchersDeleter.Set( myMesh ); @@ -4591,7 +4591,7 @@ SMESH::long_array* SMESH_MeshEditor_i::FindElementsByPoint(CORBA::Double x, // 'ALL' type means elements of any type excluding nodes //======================================================================= -SMESH::long_array* +SMESH::smIdType_array* SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementIDs, CORBA::Double x, CORBA::Double y, @@ -4599,7 +4599,7 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID SMESH::ElementType type) { SMESH_TRY; - SMESH::long_array_var res = new SMESH::long_array; + SMESH::smIdType_array_var res = new SMESH::smIdType_array; prepareIdSource( elementIDs ); if ( type != SMESH::NODE ) @@ -4663,7 +4663,7 @@ SMESH_MeshEditor_i::FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elementID // In the case if nothing found, return -1 and [] //======================================================================= -CORBA::Long SMESH_MeshEditor_i::ProjectPoint(CORBA::Double x, +SMESH::smIdType SMESH_MeshEditor_i::ProjectPoint(CORBA::Double x, CORBA::Double y, CORBA::Double z, SMESH::ElementType type, @@ -4793,7 +4793,7 @@ CORBA::Boolean SMESH_MeshEditor_i::IsCoherentOrientation2D() SMESH::array_of_long_array* SMESH_MeshEditor_i::Get1DBranches( SMESH::SMESH_IDSource_ptr theEdges, - CORBA::Long theStartNode, + SMESH::smIdType theStartNode, SMESH::array_of_long_array_out theNodeGroups ) { if ( CORBA::is_nil( theEdges )) @@ -5276,14 +5276,14 @@ SewCoincidentFreeBorders(const SMESH::CoincidentFreeBorders& freeBorders, //======================================================================= SMESH::SMESH_MeshEditor::Sew_Error -SMESH_MeshEditor_i::SewFreeBorders(CORBA::Long FirstNodeID1, - CORBA::Long SecondNodeID1, - CORBA::Long LastNodeID1, - CORBA::Long FirstNodeID2, - CORBA::Long SecondNodeID2, - CORBA::Long LastNodeID2, - CORBA::Boolean CreatePolygons, - CORBA::Boolean CreatePolyedrs) +SMESH_MeshEditor_i::SewFreeBorders(SMESH::smIdType FirstNodeID1, + SMESH::smIdType SecondNodeID1, + SMESH::smIdType LastNodeID1, + SMESH::smIdType FirstNodeID2, + SMESH::smIdType SecondNodeID2, + SMESH::smIdType LastNodeID2, + CORBA::Boolean CreatePolygons, + CORBA::Boolean CreatePolyedrs) { SMESH_TRY; initData(); @@ -5342,11 +5342,11 @@ SMESH_MeshEditor_i::SewFreeBorders(CORBA::Long FirstNodeID1, //======================================================================= SMESH::SMESH_MeshEditor::Sew_Error -SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1, - CORBA::Long SecondNodeID1, - CORBA::Long LastNodeID1, - CORBA::Long FirstNodeID2, - CORBA::Long SecondNodeID2) +SMESH_MeshEditor_i::SewConformFreeBorders(SMESH::smIdType FirstNodeID1, + SMESH::smIdType SecondNodeID1, + SMESH::smIdType LastNodeID1, + SMESH::smIdType FirstNodeID2, + SMESH::smIdType SecondNodeID2) { SMESH_TRY; initData(); @@ -5399,13 +5399,13 @@ SMESH_MeshEditor_i::SewConformFreeBorders(CORBA::Long FirstNodeID1, //======================================================================= SMESH::SMESH_MeshEditor::Sew_Error -SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder, - CORBA::Long SecondNodeIDOnFreeBorder, - CORBA::Long LastNodeIDOnFreeBorder, - CORBA::Long FirstNodeIDOnSide, - CORBA::Long LastNodeIDOnSide, - CORBA::Boolean CreatePolygons, - CORBA::Boolean CreatePolyedrs) +SMESH_MeshEditor_i::SewBorderToSide(SMESH::smIdType FirstNodeIDOnFreeBorder, + SMESH::smIdType SecondNodeIDOnFreeBorder, + SMESH::smIdType LastNodeIDOnFreeBorder, + SMESH::smIdType FirstNodeIDOnSide, + SMESH::smIdType LastNodeIDOnSide, + CORBA::Boolean CreatePolygons, + CORBA::Boolean CreatePolyedrs) { SMESH_TRY; initData(); @@ -5461,12 +5461,12 @@ SMESH_MeshEditor_i::SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder, //======================================================================= SMESH::SMESH_MeshEditor::Sew_Error -SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements, - const SMESH::long_array& IDsOfSide2Elements, - CORBA::Long NodeID1OfSide1ToMerge, - CORBA::Long NodeID1OfSide2ToMerge, - CORBA::Long NodeID2OfSide1ToMerge, - CORBA::Long NodeID2OfSide2ToMerge) +SMESH_MeshEditor_i::SewSideElements(const SMESH::smIdType_array& IDsOfSide1Elements, + const SMESH::smIdType_array& IDsOfSide2Elements, + SMESH::smIdType NodeID1OfSide1ToMerge, + SMESH::smIdType NodeID1OfSide2ToMerge, + SMESH::smIdType NodeID2OfSide1ToMerge, + SMESH::smIdType NodeID2OfSide2ToMerge) { SMESH_TRY; initData(); @@ -5520,8 +5520,8 @@ SMESH_MeshEditor_i::SewSideElements(const SMESH::long_array& IDsOfSide1Elements, */ //================================================================================ -CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide, - const SMESH::long_array& newIDs) +CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(SMESH::smIdType ide, + const SMESH::smIdType_array& newIDs) { SMESH_TRY; initData(); @@ -5791,7 +5791,7 @@ bool SMESH_MeshEditor_i::idSourceToSet(SMESH::SMESH_IDSource_ptr theIDSource, } } prepareIdSource( theIDSource ); - SMESH::long_array_var anIDs = theIDSource->GetIDs(); + SMESH::smIdType_array_var anIDs = theIDSource->GetIDs(); if ( anIDs->length() == 0 ) { if ( error ) *error = IDSource_EMPTY; @@ -5905,8 +5905,8 @@ SMESH_MeshEditor_i::DoubleElements(SMESH::SMESH_IDSource_ptr theElements, */ //================================================================================ -CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNodes, - const SMESH::long_array& theModifiedElems ) +CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::smIdType_array& theNodes, + const SMESH::smIdType_array& theModifiedElems ) { SMESH_TRY; initData(); @@ -5944,11 +5944,11 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodes( const SMESH::long_array& theNode */ //================================================================================ -CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( CORBA::Long theNodeId, - const SMESH::long_array& theModifiedElems ) +CORBA::Boolean SMESH_MeshEditor_i::DoubleNode( SMESH::smIdType theNodeId, + const SMESH::smIdType_array& theModifiedElems ) { SMESH_TRY; - SMESH::long_array_var aNodes = new SMESH::long_array; + SMESH::smIdType_array_var aNodes = new SMESH::smIdType_array; aNodes->length( 1 ); aNodes[ 0 ] = theNodeId; @@ -5982,12 +5982,12 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroup(SMESH::SMESH_GroupBase_ptr th if ( CORBA::is_nil( theNodes ) && theNodes->GetType() != SMESH::NODE ) return false; - SMESH::long_array_var aNodes = theNodes->GetListOfID(); - SMESH::long_array_var aModifiedElems; + SMESH::smIdType_array_var aNodes = theNodes->GetListOfID(); + SMESH::smIdType_array_var aModifiedElems; if ( !CORBA::is_nil( theModifiedElems ) ) aModifiedElems = theModifiedElems->GetListOfID(); else - aModifiedElems = new SMESH::long_array; + aModifiedElems = new SMESH::smIdType_array; TPythonDump pyDump; // suppress dump by the next line @@ -6023,12 +6023,12 @@ SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes, return aNewGroup._retn(); // Duplicate nodes - SMESH::long_array_var aNodes = theNodes->GetListOfID(); - SMESH::long_array_var aModifiedElems; + SMESH::smIdType_array_var aNodes = theNodes->GetListOfID(); + SMESH::smIdType_array_var aModifiedElems; if ( !CORBA::is_nil( theModifiedElems ) ) aModifiedElems = theModifiedElems->GetListOfID(); else { - aModifiedElems = new SMESH::long_array; + aModifiedElems = new SMESH::smIdType_array; aModifiedElems->length( 0 ); } @@ -6038,7 +6038,7 @@ SMESH_MeshEditor_i::DoubleNodeGroupNew( SMESH::SMESH_GroupBase_ptr theNodes, if ( aResult ) { // Create group with newly created nodes - SMESH::long_array_var anIds = GetLastCreatedNodes(); + SMESH::smIdType_array_var anIds = GetLastCreatedNodes(); if (anIds->length() > 0) { std::string anUnindexedName (theNodes->GetName()); std::string aNewName = GenerateGroupName(anUnindexedName + "_double"); @@ -6075,13 +6075,13 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups(const SMESH::ListOfGroups& t initData(); std::list< int > aNodes; - int i, n, j, m; + smIdType i, n, j, m; for ( i = 0, n = theNodes.length(); i < n; i++ ) { SMESH::SMESH_GroupBase_var aGrp = theNodes[ i ]; if ( !CORBA::is_nil( aGrp ) && aGrp->GetType() == SMESH::NODE ) { - SMESH::long_array_var aCurr = aGrp->GetListOfID(); + SMESH::smIdType_array_var aCurr = aGrp->GetListOfID(); for ( j = 0, m = aCurr->length(); j < m; j++ ) aNodes.push_back( aCurr[ j ] ); } @@ -6093,7 +6093,7 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeGroups(const SMESH::ListOfGroups& t SMESH::SMESH_GroupBase_var aGrp = theModifiedElems[ i ]; if ( !CORBA::is_nil( aGrp ) && aGrp->GetType() != SMESH::NODE ) { - SMESH::long_array_var aCurr = aGrp->GetListOfID(); + SMESH::smIdType_array_var aCurr = aGrp->GetListOfID(); for ( j = 0, m = aCurr->length(); j < m; j++ ) anElems.push_back( aCurr[ j ] ); } @@ -6135,7 +6135,7 @@ SMESH_MeshEditor_i::DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes, if ( aResult ) { // Create group with newly created nodes - SMESH::long_array_var anIds = GetLastCreatedNodes(); + SMESH::smIdType_array_var anIds = GetLastCreatedNodes(); if (anIds->length() > 0) { std::string anUnindexedName (theNodes[0]->GetName()); std::string aNewName = GenerateGroupName(anUnindexedName + "_double"); @@ -6165,9 +6165,9 @@ SMESH_MeshEditor_i::DoubleNodeGroupsNew( const SMESH::ListOfGroups& theNodes, */ //================================================================================ -CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theElems, - const SMESH::long_array& theNodesNot, - const SMESH::long_array& theAffectedElems ) +CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::smIdType_array& theElems, + const SMESH::smIdType_array& theNodesNot, + const SMESH::smIdType_array& theAffectedElems ) { SMESH_TRY; initData(); @@ -6205,9 +6205,9 @@ CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElem( const SMESH::long_array& theE */ //================================================================================ -CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::long_array& theElems, - const SMESH::long_array& theNodesNot, - GEOM::GEOM_Object_ptr theShape ) +CORBA::Boolean SMESH_MeshEditor_i::DoubleNodeElemInRegion ( const SMESH::smIdType_array& theElems, + const SMESH::smIdType_array& theNodesNot, + GEOM::GEOM_Object_ptr theShape ) { SMESH_TRY; initData(); @@ -6360,14 +6360,14 @@ SMESH_MeshEditor_i::DoubleNodeElemGroup2New(SMESH::SMESH_GroupBase_ptr theElems, std::string aNewName = GenerateGroupName( std::string(elemGroupName.in()) + "_double"); if ( !getEditor().GetLastCreatedElems().empty() && theElemGroupNeeded ) { - SMESH::long_array_var anIds = GetLastCreatedElems(); + SMESH::smIdType_array_var anIds = GetLastCreatedElems(); SMESH::ElementType aGroupType = myMesh_i->GetElementType(anIds[0], true); aNewElemGroup = myMesh_i->CreateGroup(aGroupType, aNewName.c_str()); aNewElemGroup->Add(anIds); } if ( !getEditor().GetLastCreatedNodes().empty() && theNodeGroupNeeded ) { - SMESH::long_array_var anIds = GetLastCreatedNodes(); + SMESH::smIdType_array_var anIds = GetLastCreatedNodes(); aNewNodeGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str()); aNewNodeGroup->Add(anIds); } @@ -6461,7 +6461,7 @@ static void listOfGroupToSet(const SMESH::ListOfGroups& theGrpList, if ( !CORBA::is_nil( aGrp ) && (theIsNodeGrp ? aGrp->GetType() == SMESH::NODE : aGrp->GetType() != SMESH::NODE ) ) { - SMESH::long_array_var anIDs = aGrp->GetIDs(); + SMESH::smIdType_array_var anIDs = aGrp->GetIDs(); arrayToSet( anIDs, theMeshDS, theElemSet, theIsNodeGrp ? SMDSAbs_Node : SMDSAbs_All ); } } @@ -6588,14 +6588,14 @@ SMESH_MeshEditor_i::DoubleNodeElemGroups2New(const SMESH::ListOfGroups& theElems std::string aNewName = GenerateGroupName( std::string(elemGroupName.in()) + "_double"); if ( !getEditor().GetLastCreatedElems().empty() && theElemGroupNeeded ) { - SMESH::long_array_var anIds = GetLastCreatedElems(); + SMESH::smIdType_array_var anIds = GetLastCreatedElems(); SMESH::ElementType aGroupType = myMesh_i->GetElementType(anIds[0], true); aNewElemGroup = myMesh_i->CreateGroup(aGroupType, aNewName.c_str()); aNewElemGroup->Add(anIds); } if ( !getEditor().GetLastCreatedNodes().empty() && theNodeGroupNeeded ) { - SMESH::long_array_var anIds = GetLastCreatedNodes(); + SMESH::smIdType_array_var anIds = GetLastCreatedNodes(); aNewNodeGroup = myMesh_i->CreateGroup(SMESH::NODE, aNewName.c_str()); aNewNodeGroup->Add(anIds); } @@ -6709,9 +6709,9 @@ SMESH_MeshEditor_i::AffectedElemGroupsInRegion( const SMESH::ListOfGroups& theEl TPythonDump pyDump; if ( aResult && anAffected.size() > 0 ) { - SMESH::long_array_var volumeIds = new SMESH::long_array; - SMESH::long_array_var faceIds = new SMESH::long_array; - SMESH::long_array_var edgeIds = new SMESH::long_array; + SMESH::smIdType_array_var volumeIds = new SMESH::smIdType_array; + SMESH::smIdType_array_var faceIds = new SMESH::smIdType_array; + SMESH::smIdType_array_var edgeIds = new SMESH::smIdType_array; volumeIds->length( anAffected.size() ); faceIds ->length( anAffected.size() ); edgeIds ->length( anAffected.size() ); @@ -6723,7 +6723,7 @@ SMESH_MeshEditor_i::AffectedElemGroupsInRegion( const SMESH::ListOfGroups& theEl for (; eIt != anAffected.end(); ++eIt) { const SMDS_MeshElement* anElem = *eIt; - int elemId = anElem->GetID(); + smIdType elemId = anElem->GetID(); switch ( anElem->GetType() ) { case SMDSAbs_Volume: volumeIds[ivol++] = elemId; break; case SMDSAbs_Face: faceIds[iface++] = elemId; break; @@ -6845,7 +6845,7 @@ SMESH_MeshEditor_i::DoubleNodesOnGroupBoundaries( const SMESH::ListOfGroups& the { // if ( aGrp->GetType() != SMESH::VOLUME ) // THROW_SALOME_CORBA_EXCEPTION("Not a volume group", SALOME::BAD_PARAM); - SMESH::long_array_var anIDs = aGrp->GetIDs(); + SMESH::smIdType_array_var anIDs = aGrp->GetIDs(); arrayToSet( anIDs, aMeshDS, domains[ i ], SMDSAbs_All ); } } @@ -6897,7 +6897,7 @@ SMESH_MeshEditor_i::CreateFlatElementsOnFacesGroups( const SMESH::ListOfGroups& TIDSortedElemSet faceGroup; faceGroup.clear(); faceGroups.push_back(faceGroup); - SMESH::long_array_var anIDs = aGrp->GetIDs(); + SMESH::smIdType_array_var anIDs = aGrp->GetIDs(); arrayToSet( anIDs, aMeshDS, faceGroups[ i ], SMDSAbs_All ); } } diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index b0b9dd270..b96233569 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -71,13 +71,13 @@ public: * created this method returns list of their IDs, if new nodes * not created - returns an empty list */ - SMESH::long_array* GetLastCreatedNodes(); + SMESH::smIdType_array* GetLastCreatedNodes(); /*! * If during last operation of MeshEditor some elements were * created this method returns list of their IDs, if new elements * not created - returns an empty list */ - SMESH::long_array* GetLastCreatedElems(); + SMESH::smIdType_array* GetLastCreatedElems(); /*! * \brief Clears sequences of last created elements and nodes */ @@ -90,35 +90,35 @@ public: /*! * \brief Wrap a sequence of ids in a SMESH_IDSource */ - SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements, - SMESH::ElementType type); + SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::smIdType_array& IDsOfElements, + SMESH::ElementType type); static bool IsTemporaryIDSource( SMESH::SMESH_IDSource_ptr& idSource ); - static CORBA::Long* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, int& nbIds ); + static SMESH::smIdType* GetTemporaryIDs( SMESH::SMESH_IDSource_ptr& idSource, smIdType& nbIds ); /*! * \brief Generates the unique group name */ std::string GenerateGroupName(const std::string& thePrefix); - CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements); - CORBA::Boolean RemoveNodes (const SMESH::long_array & IDsOfNodes); - CORBA::Long RemoveOrphanNodes(); + CORBA::Boolean RemoveElements(const SMESH::smIdType_array & IDsOfElements); + CORBA::Boolean RemoveNodes (const SMESH::smIdType_array & IDsOfNodes); + SMESH::smIdType RemoveOrphanNodes(); /*! * Methods for creation new elements. * Returns ID of created element or 0 if element not created */ - CORBA::Long AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z); - CORBA::Long Add0DElement(CORBA::Long IDOfNode, CORBA::Boolean DuplicateElements); - CORBA::Long AddBall(CORBA::Long IDOfNodem, CORBA::Double diameter); - CORBA::Long AddEdge(const SMESH::long_array & IDsOfNodes); - CORBA::Long AddFace(const SMESH::long_array & IDsOfNodes); - CORBA::Long AddPolygonalFace(const SMESH::long_array & IDsOfNodes); - CORBA::Long AddQuadPolygonalFace(const SMESH::long_array & IDsOfNodes); - CORBA::Long AddVolume(const SMESH::long_array & IDsOfNodes); - CORBA::Long AddPolyhedralVolume(const SMESH::long_array & IDsOfNodes, + SMESH::smIdType AddNode(CORBA::Double x, CORBA::Double y, CORBA::Double z); + SMESH::smIdType Add0DElement(SMESH::smIdType IDOfNode, CORBA::Boolean DuplicateElements); + SMESH::smIdType AddBall(SMESH::smIdType IDOfNodem, CORBA::Double diameter); + SMESH::smIdType AddEdge(const SMESH::smIdType_array & IDsOfNodes); + SMESH::smIdType AddFace(const SMESH::smIdType_array & IDsOfNodes); + SMESH::smIdType AddPolygonalFace(const SMESH::smIdType_array & IDsOfNodes); + SMESH::smIdType AddQuadPolygonalFace(const SMESH::smIdType_array & IDsOfNodes); + SMESH::smIdType AddVolume(const SMESH::smIdType_array & IDsOfNodes); + SMESH::smIdType AddPolyhedralVolume(const SMESH::smIdType_array & IDsOfNodes, const SMESH::long_array & Quantities); - CORBA::Long AddPolyhedralVolumeByFaces(const SMESH::long_array & IdsOfFaces); + SMESH::smIdType AddPolyhedralVolumeByFaces(const SMESH::smIdType_array & IdsOfFaces); /*! * \brief Create 0D elements on all nodes of the given object except those @@ -139,14 +139,14 @@ public: * \param NodeID - node ID * \param VertexID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0] */ - void SetNodeOnVertex(CORBA::Long NodeID, CORBA::Long VertexID); + void SetNodeOnVertex(SMESH::smIdType NodeID, CORBA::Long VertexID); /*! * \brief Store node position on an edge * \param NodeID - node ID * \param EdgeID - edge ID available through GEOM_Object.GetSubShapeIndices()[0] * \param paramOnEdge - parameter on edge where the node is located */ - void SetNodeOnEdge(CORBA::Long NodeID, CORBA::Long EdgeID, + void SetNodeOnEdge(SMESH::smIdType NodeID, CORBA::Long EdgeID, CORBA::Double paramOnEdge); /*! * \brief Store node position on a face @@ -155,28 +155,28 @@ public: * \param u - U parameter on face where the node is located * \param v - V parameter on face where the node is located */ - void SetNodeOnFace(CORBA::Long NodeID, CORBA::Long FaceID, + void SetNodeOnFace(SMESH::smIdType NodeID, CORBA::Long FaceID, CORBA::Double u, CORBA::Double v); /*! * \brief Bind a node to a solid * \param NodeID - node ID * \param SolidID - vertex ID available through GEOM_Object.GetSubShapeIndices()[0] */ - void SetNodeInVolume(CORBA::Long NodeID, CORBA::Long SolidID); + void SetNodeInVolume(SMESH::smIdType NodeID, CORBA::Long SolidID); /*! * \brief Bind an element to a shape * \param ElementID - element ID * \param ShapeID - shape ID available through GEOM_Object.GetSubShapeIndices()[0] */ - void SetMeshElementOnShape(CORBA::Long ElementID, CORBA::Long ShapeID); + void SetMeshElementOnShape(SMESH::smIdType ElementID, CORBA::Long ShapeID); - CORBA::Boolean MoveNode(CORBA::Long NodeID, + CORBA::Boolean MoveNode(SMESH::smIdType NodeID, CORBA::Double x, CORBA::Double y, CORBA::Double z); - CORBA::Boolean InverseDiag(CORBA::Long NodeID1, CORBA::Long NodeID2); - CORBA::Boolean DeleteDiag(CORBA::Long NodeID1, CORBA::Long NodeID2); - CORBA::Boolean Reorient(const SMESH::long_array & IDsOfElements); + CORBA::Boolean InverseDiag(SMESH::smIdType NodeID1, SMESH::smIdType NodeID2); + CORBA::Boolean DeleteDiag(SMESH::smIdType NodeID1, SMESH::smIdType NodeID2); + CORBA::Boolean Reorient(const SMESH::smIdType_array & IDsOfElements); CORBA::Boolean ReorientObject(SMESH::SMESH_IDSource_ptr theObject); /*! @@ -205,23 +205,23 @@ public: CORBA::Boolean outsideNormal); // Split/Join - CORBA::Boolean TriToQuad (const SMESH::long_array & IDsOfElements, - SMESH::NumericalFunctor_ptr Criterion, - CORBA::Double MaxAngle); - CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject, - SMESH::NumericalFunctor_ptr Criterion, - CORBA::Double MaxAngle); - CORBA::Boolean QuadToTri (const SMESH::long_array & IDsOfElements, - SMESH::NumericalFunctor_ptr Criterion); - CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject, - SMESH::NumericalFunctor_ptr Criterion); - void QuadTo4Tri (SMESH::SMESH_IDSource_ptr theObject); - CORBA::Boolean SplitQuad (const SMESH::long_array & IDsOfElements, - CORBA::Boolean Diag13); - CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject, - CORBA::Boolean Diag13); - CORBA::Long BestSplit (CORBA::Long IDOfQuad, - SMESH::NumericalFunctor_ptr Criterion); + CORBA::Boolean TriToQuad (const SMESH::smIdType_array & IDsOfElements, + SMESH::NumericalFunctor_ptr Criterion, + CORBA::Double MaxAngle); + CORBA::Boolean TriToQuadObject (SMESH::SMESH_IDSource_ptr theObject, + SMESH::NumericalFunctor_ptr Criterion, + CORBA::Double MaxAngle); + CORBA::Boolean QuadToTri (const SMESH::smIdType_array & IDsOfElements, + SMESH::NumericalFunctor_ptr Criterion); + CORBA::Boolean QuadToTriObject (SMESH::SMESH_IDSource_ptr theObject, + SMESH::NumericalFunctor_ptr Criterion); + void QuadTo4Tri (SMESH::SMESH_IDSource_ptr theObject); + CORBA::Boolean SplitQuad (const SMESH::smIdType_array & IDsOfElements, + CORBA::Boolean Diag13); + CORBA::Boolean SplitQuadObject (SMESH::SMESH_IDSource_ptr theObject, + CORBA::Boolean Diag13); + CORBA::Long BestSplit (CORBA::Long IDOfQuad, + SMESH::NumericalFunctor_ptr Criterion); void SplitVolumesIntoTetra(SMESH::SMESH_IDSource_ptr elems, CORBA::Short methodFlags); void SplitHexahedraIntoPrisms(SMESH::SMESH_IDSource_ptr elems, @@ -231,35 +231,35 @@ public: CORBA::Boolean allDomains); void SplitBiQuadraticIntoLinear(const SMESH::ListOfIDSources& elems); - CORBA::Boolean Smooth(const SMESH::long_array & IDsOfElements, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + CORBA::Boolean Smooth(const SMESH::smIdType_array & IDsOfElements, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method); CORBA::Boolean SmoothObject(SMESH::SMESH_IDSource_ptr theObject, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method); - CORBA::Boolean SmoothParametric(const SMESH::long_array & IDsOfElements, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + CORBA::Boolean SmoothParametric(const SMESH::smIdType_array & IDsOfElements, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method) ; CORBA::Boolean SmoothParametricObject(SMESH::SMESH_IDSource_ptr theObject, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method); - CORBA::Boolean smooth(const SMESH::long_array & IDsOfElements, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + CORBA::Boolean smooth(const SMESH::smIdType_array & IDsOfElements, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method, bool IsParametric); CORBA::Boolean smoothObject(SMESH::SMESH_IDSource_ptr theObject, - const SMESH::long_array & IDsOfFixedNodes, - CORBA::Long MaxNbOfIterations, + const SMESH::smIdType_array & IDsOfFixedNodes, + CORBA::Short MaxNbOfIterations, CORBA::Double MaxAspectRatio, SMESH::SMESH_MeshEditor::Smooth_Method Method, bool IsParametric); @@ -303,12 +303,12 @@ public: CORBA::Boolean useInputElemsOnly, CORBA::Boolean makeGroups, CORBA::Short dim); - SMESH::ListOfGroups* AdvancedExtrusion(const SMESH::long_array & theIDsOfElements, - const SMESH::DirStruct & theStepVector, - CORBA::Long theNbOfSteps, - CORBA::Long theExtrFlags, - CORBA::Double theSewTolerance, - CORBA::Boolean theMakeGroups); + SMESH::ListOfGroups* AdvancedExtrusion(const SMESH::smIdType_array & theIDsOfElements, + const SMESH::DirStruct & theStepVector, + CORBA::Long theNbOfSteps, + CORBA::Long theExtrFlags, + CORBA::Double theSewTolerance, + CORBA::Boolean theMakeGroups); SMESH::ListOfGroups* ExtrusionAlongPathObjects(const SMESH::ListOfIDSources & Nodes, @@ -316,7 +316,7 @@ public: const SMESH::ListOfIDSources & Faces, SMESH::SMESH_IDSource_ptr PathMesh, GEOM::GEOM_Object_ptr PathShape, - CORBA::Long NodeStart, + SMESH::smIdType NodeStart, CORBA::Boolean HasAngles, const SMESH::double_array & Angles, CORBA::Boolean AnglesVariation, @@ -331,7 +331,7 @@ public: GEOM::GEOM_Object_ptr PathShape, const SMESH::double_array & Angles); - void Mirror(const SMESH::long_array & IDsOfElements, + void Mirror(const SMESH::smIdType_array & IDsOfElements, const SMESH::AxisStruct & Axis, SMESH::SMESH_MeshEditor::MirrorType MirrorType, CORBA::Boolean Copy); @@ -339,39 +339,39 @@ public: const SMESH::AxisStruct & Axis, SMESH::SMESH_MeshEditor::MirrorType MirrorType, CORBA::Boolean Copy); - void Translate(const SMESH::long_array & IDsOfElements, - const SMESH::DirStruct & Vector, - CORBA::Boolean Copy); + void Translate(const SMESH::smIdType_array & IDsOfElements, + const SMESH::DirStruct & Vector, + CORBA::Boolean Copy); void TranslateObject(SMESH::SMESH_IDSource_ptr theObject, const SMESH::DirStruct & Vector, CORBA::Boolean Copy); - void Rotate(const SMESH::long_array & IDsOfElements, - const SMESH::AxisStruct & Axis, - CORBA::Double Angle, - CORBA::Boolean Copy); + void Rotate(const SMESH::smIdType_array & IDsOfElements, + const SMESH::AxisStruct & Axis, + CORBA::Double Angle, + CORBA::Boolean Copy); void RotateObject(SMESH::SMESH_IDSource_ptr theObject, const SMESH::AxisStruct & Axis, CORBA::Double Angle, CORBA::Boolean Copy); - SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::long_array& IDsOfElements, + SMESH::ListOfGroups* MirrorMakeGroups(const SMESH::smIdType_array& IDsOfElements, const SMESH::AxisStruct& Mirror, SMESH::SMESH_MeshEditor::MirrorType MirrorType); SMESH::ListOfGroups* MirrorObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object, const SMESH::AxisStruct& Mirror, SMESH::SMESH_MeshEditor::MirrorType MirrorType); - SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::long_array& IDsOfElements, - const SMESH::DirStruct& Vector); + SMESH::ListOfGroups* TranslateMakeGroups(const SMESH::smIdType_array& IDsOfElements, + const SMESH::DirStruct& Vector); SMESH::ListOfGroups* TranslateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object, const SMESH::DirStruct& Vector); - SMESH::ListOfGroups* RotateMakeGroups(const SMESH::long_array& IDsOfElements, - const SMESH::AxisStruct& Axis, - CORBA::Double AngleInRadians); + SMESH::ListOfGroups* RotateMakeGroups(const SMESH::smIdType_array& IDsOfElements, + const SMESH::AxisStruct& Axis, + CORBA::Double AngleInRadians); SMESH::ListOfGroups* RotateObjectMakeGroups(SMESH::SMESH_IDSource_ptr Object, const SMESH::AxisStruct& Axis, CORBA::Double AngleInRadians); - SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::long_array& IDsOfElements, + SMESH::SMESH_Mesh_ptr MirrorMakeMesh(const SMESH::smIdType_array& IDsOfElements, const SMESH::AxisStruct& Mirror, SMESH::SMESH_MeshEditor::MirrorType MirrorType, CORBA::Boolean CopyGroups, @@ -381,19 +381,19 @@ public: SMESH::SMESH_MeshEditor::MirrorType MirrorType, CORBA::Boolean CopyGroups, const char* MeshName); - SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::long_array& IDsOfElements, - const SMESH::DirStruct& Vector, - CORBA::Boolean CopyGroups, - const char* MeshName); + SMESH::SMESH_Mesh_ptr TranslateMakeMesh(const SMESH::smIdType_array& IDsOfElements, + const SMESH::DirStruct& Vector, + CORBA::Boolean CopyGroups, + const char* MeshName); SMESH::SMESH_Mesh_ptr TranslateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object, const SMESH::DirStruct& Vector, CORBA::Boolean CopyGroups, const char* MeshName); - SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::long_array& IDsOfElements, - const SMESH::AxisStruct& Axis, - CORBA::Double AngleInRadians, - CORBA::Boolean CopyGroups, - const char* MeshName); + SMESH::SMESH_Mesh_ptr RotateMakeMesh(const SMESH::smIdType_array& IDsOfElements, + const SMESH::AxisStruct& Axis, + CORBA::Double AngleInRadians, + CORBA::Boolean CopyGroups, + const char* MeshName); SMESH::SMESH_Mesh_ptr RotateObjectMakeMesh(SMESH::SMESH_IDSource_ptr Object, const SMESH::AxisStruct& Axis, CORBA::Double AngleInRadians, @@ -443,21 +443,21 @@ public: void MergeElements(const SMESH::array_of_long_array& GroupsOfElementsID, const SMESH::ListOfIDSources& ElementsToKeep); void MergeEqualElements(); - CORBA::Long MoveClosestNodeToPoint(CORBA::Double x, - CORBA::Double y, - CORBA::Double z, - CORBA::Long nodeID); + SMESH::smIdType MoveClosestNodeToPoint(CORBA::Double x, + CORBA::Double y, + CORBA::Double z, + SMESH::smIdType nodeID); /*! * \brief Return ID of node closest to a given point */ - CORBA::Long FindNodeClosestTo(CORBA::Double x, + SMESH::smIdType FindNodeClosestTo(CORBA::Double x, CORBA::Double y, CORBA::Double z); /*! * Return elements of given type where the given point is IN or ON. * 'ALL' type means elements of any type excluding nodes */ - SMESH::long_array* FindElementsByPoint(CORBA::Double x, + SMESH::smIdType_array* FindElementsByPoint(CORBA::Double x, CORBA::Double y, CORBA::Double z, SMESH::ElementType type); @@ -466,7 +466,7 @@ public: * where the given point is IN or ON. * 'ALL' type means elements of any type excluding nodes */ - SMESH::long_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements, + SMESH::smIdType_array* FindAmongElementsByPoint(SMESH::SMESH_IDSource_ptr elements, CORBA::Double x, CORBA::Double y, CORBA::Double z, @@ -478,7 +478,7 @@ public: * and coordinates of the projection point. * In the case if nothing found, return -1 and [] */ - CORBA::Long ProjectPoint(CORBA::Double x, + SMESH::smIdType ProjectPoint(CORBA::Double x, CORBA::Double y, CORBA::Double z, SMESH::ElementType type, @@ -509,7 +509,7 @@ public: * If a group is closed, the first and last nodes of the group are same. */ SMESH::array_of_long_array* Get1DBranches( SMESH::SMESH_IDSource_ptr edges, - CORBA::Long startNode, + SMESH::smIdType startNode, SMESH::array_of_long_array_out nodeGroups); /*! @@ -535,51 +535,51 @@ public: CORBA::Boolean createPolyedrs); SMESH::SMESH_MeshEditor::Sew_Error - SewFreeBorders(CORBA::Long FirstNodeID1, - CORBA::Long SecondNodeID1, - CORBA::Long LastNodeID1, - CORBA::Long FirstNodeID2, - CORBA::Long SecondNodeID2, - CORBA::Long LastNodeID2, - CORBA::Boolean CreatePolygons, - CORBA::Boolean CreatePolyedrs); + SewFreeBorders(SMESH::smIdType FirstNodeID1, + SMESH::smIdType SecondNodeID1, + SMESH::smIdType LastNodeID1, + SMESH::smIdType FirstNodeID2, + SMESH::smIdType SecondNodeID2, + SMESH::smIdType LastNodeID2, + CORBA::Boolean CreatePolygons, + CORBA::Boolean CreatePolyedrs); SMESH::SMESH_MeshEditor::Sew_Error - SewConformFreeBorders(CORBA::Long FirstNodeID1, - CORBA::Long SecondNodeID1, - CORBA::Long LastNodeID1, - CORBA::Long FirstNodeID2, - CORBA::Long SecondNodeID2); + SewConformFreeBorders(SMESH::smIdType FirstNodeID1, + SMESH::smIdType SecondNodeID1, + SMESH::smIdType LastNodeID1, + SMESH::smIdType FirstNodeID2, + SMESH::smIdType SecondNodeID2); SMESH::SMESH_MeshEditor::Sew_Error - SewBorderToSide(CORBA::Long FirstNodeIDOnFreeBorder, - CORBA::Long SecondNodeIDOnFreeBorder, - CORBA::Long LastNodeIDOnFreeBorder, - CORBA::Long FirstNodeIDOnSide, - CORBA::Long LastNodeIDOnSide, + SewBorderToSide(SMESH::smIdType FirstNodeIDOnFreeBorder, + SMESH::smIdType SecondNodeIDOnFreeBorder, + SMESH::smIdType LastNodeIDOnFreeBorder, + SMESH::smIdType FirstNodeIDOnSide, + SMESH::smIdType LastNodeIDOnSide, CORBA::Boolean CreatePolygons, CORBA::Boolean CreatePolyedrs); SMESH::SMESH_MeshEditor::Sew_Error - SewSideElements(const SMESH::long_array& IDsOfSide1Elements, - const SMESH::long_array& IDsOfSide2Elements, - CORBA::Long NodeID1OfSide1ToMerge, - CORBA::Long NodeID1OfSide2ToMerge, - CORBA::Long NodeID2OfSide1ToMerge, - CORBA::Long NodeID2OfSide2ToMerge); + SewSideElements(const SMESH::smIdType_array& IDsOfSide1Elements, + const SMESH::smIdType_array& IDsOfSide2Elements, + SMESH::smIdType NodeID1OfSide1ToMerge, + SMESH::smIdType NodeID1OfSide2ToMerge, + SMESH::smIdType NodeID2OfSide1ToMerge, + SMESH::smIdType NodeID2OfSide2ToMerge); /*! * Set new nodes for given element. * If number of nodes is not corresponded to type of * element - returns false */ - CORBA::Boolean ChangeElemNodes(CORBA::Long ide, const SMESH::long_array& newIDs); + CORBA::Boolean ChangeElemNodes(SMESH::smIdType ide, const SMESH::smIdType_array& newIDs); SMESH::SMESH_Group_ptr DoubleElements(SMESH::SMESH_IDSource_ptr theElements, const char* theGroupName); - CORBA::Boolean DoubleNodes( const SMESH::long_array& theNodes, - const SMESH::long_array& theModifiedElems ); + CORBA::Boolean DoubleNodes( const SMESH::smIdType_array& theNodes, + const SMESH::smIdType_array& theModifiedElems ); - CORBA::Boolean DoubleNode( CORBA::Long theNodeId, - const SMESH::long_array& theModifiedElems ); + CORBA::Boolean DoubleNode( SMESH::smIdType theNodeId, + const SMESH::smIdType_array& theModifiedElems ); CORBA::Boolean DoubleNodeGroup( SMESH::SMESH_GroupBase_ptr theNodes, SMESH::SMESH_GroupBase_ptr theModifiedElems ); @@ -611,9 +611,9 @@ public: * \return TRUE if operation has been completed successfully, FALSE otherwise * \sa DoubleNodeGroup(), DoubleNodeGroups() */ - CORBA::Boolean DoubleNodeElem( const SMESH::long_array& theElems, - const SMESH::long_array& theNodesNot, - const SMESH::long_array& theAffectedElems ); + CORBA::Boolean DoubleNodeElem( const SMESH::smIdType_array& theElems, + const SMESH::smIdType_array& theNodesNot, + const SMESH::smIdType_array& theAffectedElems ); /*! * \brief Creates a hole in a mesh by doubling the nodes of some particular elements @@ -626,9 +626,9 @@ public: * \return TRUE if operation has been completed successfully, FALSE otherwise * \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion() */ - CORBA::Boolean DoubleNodeElemInRegion( const SMESH::long_array& theElems, - const SMESH::long_array& theNodesNot, - GEOM::GEOM_Object_ptr theShape ); + CORBA::Boolean DoubleNodeElemInRegion( const SMESH::smIdType_array& theElems, + const SMESH::smIdType_array& theNodesNot, + GEOM::GEOM_Object_ptr theShape ); /*! * \brief Creates a hole in a mesh by doubling the nodes of some particular elements diff --git a/src/SMESH_I/SMESH_MeshPartDS.hxx b/src/SMESH_I/SMESH_MeshPartDS.hxx index 07ce97706..0de1d7e19 100644 --- a/src/SMESH_I/SMESH_MeshPartDS.hxx +++ b/src/SMESH_I/SMESH_MeshPartDS.hxx @@ -28,6 +28,7 @@ #include "SMESHDS_Mesh.hxx" #include "SMESH_TypeDefs.hxx" +#include #include #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -59,10 +60,10 @@ public: virtual const SMDS_MeshElement *FindElement(int IDelem) const; virtual bool HasNumerationHoles(); - virtual int MaxNodeID() const; - virtual int MinNodeID() const; - virtual int MaxElementID() const; - virtual int MinElementID() const; + virtual smIdType MaxNodeID() const; + virtual smIdType MinNodeID() const; + virtual smIdType MaxElementID() const; + virtual smIdType MinElementID() const; private: TIDSortedElemSet _elements[ SMDSAbs_NbElementTypes ]; diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index c03151e8b..a7c67171c 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -84,8 +84,15 @@ #include -// to pass CORBA exception through SMESH_TRY -#define SMY_OWN_CATCH catch( SALOME::SALOME_Exception& se ) { throw se; } +// to pass CORBA exception and TooLargeForExport exception through SMESH_TRY +#define SMY_OWN_CATCH \ + catch( SALOME::SALOME_Exception& se ) { throw se; } \ + catch( ::SMESH_Mesh::TooLargeForExport& ex ) \ + { SALOME::ExceptionStruct se = { \ + SALOME::COMM, \ + CORBA::string_dup(SMESH_Comment("Mesh is too large for export in format ") << ex.what()), \ + CORBA::string_dup(SMESH_Comment("format=") << ex.what() ), 0 }; \ + throw SALOME::SALOME_Exception( se ); } #include "SMESH_TryCatch.hxx" // include after OCCT headers! @@ -461,8 +468,7 @@ SMESH::DriverMED_ReadStatus SMESH_Mesh_i::ImportCGNSFile( const char* theFileNa char* SMESH_Mesh_i::GetVersionString(CORBA::Long minor, CORBA::Short nbDigits) { - string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(minor, - nbDigits); + string ver = DriverMED_W_SMESHDS_Mesh::GetVersionString(minor, nbDigits); return CORBA::string_dup( ver.c_str() ); } @@ -640,7 +646,7 @@ SMESH_Mesh_i::AddHypothesis(GEOM::GEOM_Object_ptr aSubShape, { Unexpect aCatch(SALOME_SalomeException); - const int prevNbMeshEnt = NbNodes() + NbElements(); + const smIdType prevNbMeshEnt = NbNodes() + NbElements(); if ( _preMeshInfo ) _preMeshInfo->ForgetOrLoad(); @@ -1148,11 +1154,11 @@ void SMESH_Mesh_i::RemoveGroupWithContents( SMESH::SMESH_GroupBase_ptr theGroup THROW_SALOME_CORBA_EXCEPTION( "RemoveGroupWithContents(): group does not belong to this mesh", SALOME::BAD_PARAM); - vector nodeIds; // to remove nodes becoming free + vector nodeIds; // to remove nodes becoming free bool isNodal = ( theGroup->GetType() == SMESH::NODE ); if ( !isNodal && !theGroup->IsEmpty() ) { - CORBA::Long elemID = theGroup->GetID( 1 ); + SMESH::smIdType elemID = theGroup->GetID( 1 ); int nbElemNodes = GetElemNbNodes( elemID ); if ( nbElemNodes > 0 ) nodeIds.reserve( theGroup->Size() * nbElemNodes ); @@ -1857,7 +1863,7 @@ SMESH_Mesh_i::CreateDimGroup(const SMESH::ListOfIDSources& theGroups, SMDS_ElemIteratorPtr nIt = elOfType->nodesIterator(); for ( nbChecked = 1; nIt->more() && !toStopChecking; ++nbChecked ) { - const int nID = nIt->next()->GetID(); + const smIdType nID = nIt->next()->GetID(); if ( nID < isNodeInGroupsSize && isNodeInGroups[ nID ] && isToInclude( nbChecked, ++nbCommon, nbNodes, nbCorners, toStopChecking )) { @@ -2090,12 +2096,12 @@ void SMESH_Mesh_i::ReplaceShape(GEOM::GEOM_Object_ptr theNewGeom) while ( elemIt->more() ) { const SMDS_MeshElement* e = elemIt->next(); - const int elemID = e->GetID(); + const smIdType elemID = e->GetID(); const int shapeID = e->GetShapeID(); TRange & lastRange = ranges.back(); if ( lastRange.shapeID != shapeID || lastRange.toID != elemID ) - ranges.push_back( TRange{ shapeID, elemID, elemID + 1 }); + ranges.push_back( TRange{ shapeID, FromIdType(elemID), FromIdType(elemID + 1) }); else lastRange.toID = elemID + 1; @@ -2407,7 +2413,7 @@ void SMESH_Mesh_i::CheckGeomModif( bool theIsBreakLink ) if ( !theIsBreakLink ) if ( mainGO->GetType() == GEOM_GROUP || !geomChanged ) // is group or not modified { - int nb = NbNodes() + NbElements(); + smIdType nb = NbNodes() + NbElements(); CheckGeomGroupModif(); if ( nb != NbNodes() + NbElements() ) // something removed due to hypotheses change _gen_i->UpdateIcons( me ); @@ -2795,7 +2801,7 @@ void SMESH_Mesh_i::CheckGeomGroupModif() if ( !_impl->HasShapeToMesh() ) return; - CORBA::Long nbEntities = NbNodes() + NbElements(); + SMESH::smIdType nbEntities = NbNodes() + NbElements(); // Check if group contents changed @@ -2997,7 +3003,7 @@ void SMESH_Mesh_i::CheckGeomGroupModif() // Update icons - CORBA::Long newNbEntities = NbNodes() + NbElements(); + SMESH::smIdType newNbEntities = NbNodes() + NbElements(); list< SALOMEDS::SObject_wrap > soToUpdateIcons; if ( newNbEntities != nbEntities ) { @@ -3342,10 +3348,10 @@ SMESH::log_array * SMESH_Mesh_i::GetLog(CORBA::Boolean clearAfterGet) while(its != logDS.end()){ SMESHDS_Command *com = *its; int comType = com->GetType(); - int lgcom = com->GetNumber(); - const list < int >&intList = com->GetIndexes(); + smIdType lgcom = com->GetNumber(); + const list < smIdType >&intList = com->GetIndexes(); int inum = intList.size(); - list < int >::const_iterator ii = intList.begin(); + list < smIdType >::const_iterator ii = intList.begin(); const list < double >&coordList = com->GetCoords(); int rnum = coordList.size(); list < double >::const_iterator ir = coordList.begin(); @@ -3732,11 +3738,11 @@ string SMESH_Mesh_i::prepareMeshNameAndGroups(const char* file, */ //================================================================================ -void SMESH_Mesh_i::ExportMED(const char* file, - CORBA::Boolean auto_groups, - CORBA::Long version, - CORBA::Boolean overwrite, - CORBA::Boolean autoDimension) +void SMESH_Mesh_i::ExportMED(const char* file, + CORBA::Boolean auto_groups, + CORBA::Long version, + CORBA::Boolean overwrite, + CORBA::Boolean autoDimension) { //MESSAGE("MED minor version: "<< minor); SMESH_TRY; @@ -3763,10 +3769,9 @@ void SMESH_Mesh_i::ExportMED(const char* file, */ //================================================================================ -void SMESH_Mesh_i::ExportSAUV (const char* file, - CORBA::Boolean auto_groups) +void SMESH_Mesh_i::ExportSAUV( const char* file, CORBA::Boolean auto_groups ) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -3774,6 +3779,8 @@ void SMESH_Mesh_i::ExportSAUV (const char* file, TPythonDump() << SMESH::SMESH_Mesh_var( _this()) << ".ExportSAUV( r'" << file << "', " << auto_groups << " )"; _impl->ExportSAUV(file, aMeshName.c_str(), auto_groups); + + SMESH_CATCH( SMESH::throwCorbaException ); } @@ -3785,18 +3792,20 @@ void SMESH_Mesh_i::ExportSAUV (const char* file, void SMESH_Mesh_i::ExportDAT (const char *file) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - // Update Python script // check names of groups checkGroupNames(); + // Update Python script TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportDAT( r'" << file << "' )"; // Perform Export PrepareForWriting(file); _impl->ExportDAT(file); + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -3807,18 +3816,20 @@ void SMESH_Mesh_i::ExportDAT (const char *file) void SMESH_Mesh_i::ExportUNV (const char *file) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - // Update Python script // check names of groups checkGroupNames(); + // Update Python script TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportUNV( r'" << file << "' )"; // Perform Export PrepareForWriting(file); _impl->ExportUNV(file); + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -3829,13 +3840,13 @@ void SMESH_Mesh_i::ExportUNV (const char *file) void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - // Update Python script // check names of groups checkGroupNames(); + // Update Python script TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportSTL( r'" << file << "', " << isascii << " )"; @@ -3847,6 +3858,8 @@ void SMESH_Mesh_i::ExportSTL (const char *file, const bool isascii) // Perform Export PrepareForWriting( file ); _impl->ExportSTL( file, isascii, name.in() ); + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -4249,7 +4262,7 @@ void SMESH_Mesh_i::exportMEDFields( DriverMED_W_Field& fieldWriter, void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart, const char* file) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4260,6 +4273,8 @@ void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToDAT( " << meshPart << ", r'" << file << "' )"; + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ /*! @@ -4270,7 +4285,7 @@ void SMESH_Mesh_i::ExportPartToDAT(::SMESH::SMESH_IDSource_ptr meshPart, void SMESH_Mesh_i::ExportPartToUNV(::SMESH::SMESH_IDSource_ptr meshPart, const char* file) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4281,6 +4296,8 @@ void SMESH_Mesh_i::ExportPartToUNV(::SMESH::SMESH_IDSource_ptr meshPart, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToUNV( " << meshPart<< ", r'" << file << "' )"; + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ /*! @@ -4292,7 +4309,7 @@ void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart, const char* file, ::CORBA::Boolean isascii) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4308,6 +4325,8 @@ void SMESH_Mesh_i::ExportPartToSTL(::SMESH::SMESH_IDSource_ptr meshPart, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportPartToSTL( " << meshPart<< ", r'" << file << "', " << isascii << ")"; + + SMESH_CATCH( SMESH::throwCorbaException ); } //================================================================================ @@ -4322,7 +4341,7 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart, CORBA::Boolean groupElemsByType) { #ifdef WITH_CGNS - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4344,6 +4363,9 @@ void SMESH_Mesh_i::ExportCGNS(::SMESH::SMESH_IDSource_ptr meshPart, TPythonDump() << SMESH::SMESH_Mesh_var(_this()) << ".ExportCGNS( " << meshPart<< ", r'" << file << "', " << overwrite << ")"; + + SMESH_CATCH( SMESH::throwCorbaException ); + #else THROW_SALOME_CORBA_EXCEPTION("CGNS library is unavailable", SALOME::INTERNAL_ERROR); #endif @@ -4359,7 +4381,7 @@ void SMESH_Mesh_i::ExportGMF(::SMESH::SMESH_IDSource_ptr meshPart, const char* file, bool withRequiredGroups) { - Unexpect aCatch(SALOME_SalomeException); + SMESH_TRY; if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4372,6 +4394,8 @@ void SMESH_Mesh_i::ExportGMF(::SMESH::SMESH_IDSource_ptr meshPart, << meshPart<< ", r'" << file << "', " << withRequiredGroups << ")"; + + SMESH_CATCH( SMESH::throwCorbaException ); } //============================================================================= @@ -4396,7 +4420,7 @@ CORBA::Double SMESH_Mesh_i::GetComputeProgress() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbNodes() +SMESH::smIdType SMESH_Mesh_i::NbNodes() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4411,7 +4435,7 @@ CORBA::Long SMESH_Mesh_i::NbNodes() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbElements() +SMESH::smIdType SMESH_Mesh_i::NbElements() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4426,7 +4450,7 @@ CORBA::Long SMESH_Mesh_i::NbElements() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::Nb0DElements() +SMESH::smIdType SMESH_Mesh_i::Nb0DElements() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4441,7 +4465,7 @@ CORBA::Long SMESH_Mesh_i::Nb0DElements() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbBalls() +SMESH::smIdType SMESH_Mesh_i::NbBalls() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4456,7 +4480,7 @@ CORBA::Long SMESH_Mesh_i::NbBalls() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbEdges() +SMESH::smIdType SMESH_Mesh_i::NbEdges() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4471,7 +4495,7 @@ CORBA::Long SMESH_Mesh_i::NbEdges() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4486,7 +4510,7 @@ CORBA::Long SMESH_Mesh_i::NbEdgesOfOrder(SMESH::ElementOrder order) */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbFaces() +SMESH::smIdType SMESH_Mesh_i::NbFaces() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4501,7 +4525,7 @@ CORBA::Long SMESH_Mesh_i::NbFaces() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbTriangles() +SMESH::smIdType SMESH_Mesh_i::NbTriangles() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4516,7 +4540,7 @@ CORBA::Long SMESH_Mesh_i::NbTriangles() */ //================================================================================ -CORBA::Long SMESH_Mesh_i::NbBiQuadTriangles() +SMESH::smIdType SMESH_Mesh_i::NbBiQuadTriangles() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4525,7 +4549,7 @@ CORBA::Long SMESH_Mesh_i::NbBiQuadTriangles() return _impl->NbBiQuadTriangles(); } -CORBA::Long SMESH_Mesh_i::NbQuadrangles() +SMESH::smIdType SMESH_Mesh_i::NbQuadrangles() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4534,7 +4558,7 @@ CORBA::Long SMESH_Mesh_i::NbQuadrangles() return _impl->NbQuadrangles(); } -CORBA::Long SMESH_Mesh_i::NbBiQuadQuadrangles() +SMESH::smIdType SMESH_Mesh_i::NbBiQuadQuadrangles() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4543,7 +4567,7 @@ CORBA::Long SMESH_Mesh_i::NbBiQuadQuadrangles() return _impl->NbBiQuadQuadrangles(); } -CORBA::Long SMESH_Mesh_i::NbPolygons() +SMESH::smIdType SMESH_Mesh_i::NbPolygons() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4552,7 +4576,7 @@ CORBA::Long SMESH_Mesh_i::NbPolygons() return _impl->NbPolygons(); } -CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4561,7 +4585,7 @@ CORBA::Long SMESH_Mesh_i::NbPolygonsOfOrder(SMESH::ElementOrder order) return _impl->NbPolygons((SMDSAbs_ElementOrder)order); } -CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4570,7 +4594,7 @@ CORBA::Long SMESH_Mesh_i::NbFacesOfOrder(SMESH::ElementOrder order) return _impl->NbFaces( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4579,7 +4603,7 @@ CORBA::Long SMESH_Mesh_i::NbTrianglesOfOrder(SMESH::ElementOrder order) return _impl->NbTriangles( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4590,7 +4614,7 @@ CORBA::Long SMESH_Mesh_i::NbQuadranglesOfOrder(SMESH::ElementOrder order) //============================================================================= -CORBA::Long SMESH_Mesh_i::NbVolumes() +SMESH::smIdType SMESH_Mesh_i::NbVolumes() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4599,7 +4623,7 @@ CORBA::Long SMESH_Mesh_i::NbVolumes() return _impl->NbVolumes(); } -CORBA::Long SMESH_Mesh_i::NbTetras() +SMESH::smIdType SMESH_Mesh_i::NbTetras() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4608,7 +4632,7 @@ CORBA::Long SMESH_Mesh_i::NbTetras() return _impl->NbTetras(); } -CORBA::Long SMESH_Mesh_i::NbHexas() +SMESH::smIdType SMESH_Mesh_i::NbHexas() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4617,7 +4641,7 @@ CORBA::Long SMESH_Mesh_i::NbHexas() return _impl->NbHexas(); } -CORBA::Long SMESH_Mesh_i::NbTriQuadraticHexas() +SMESH::smIdType SMESH_Mesh_i::NbTriQuadraticHexas() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4626,7 +4650,7 @@ CORBA::Long SMESH_Mesh_i::NbTriQuadraticHexas() return _impl->NbTriQuadraticHexas(); } -CORBA::Long SMESH_Mesh_i::NbPyramids() +SMESH::smIdType SMESH_Mesh_i::NbPyramids() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4635,7 +4659,7 @@ CORBA::Long SMESH_Mesh_i::NbPyramids() return _impl->NbPyramids(); } -CORBA::Long SMESH_Mesh_i::NbPrisms() +SMESH::smIdType SMESH_Mesh_i::NbPrisms() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4644,7 +4668,7 @@ CORBA::Long SMESH_Mesh_i::NbPrisms() return _impl->NbPrisms(); } -CORBA::Long SMESH_Mesh_i::NbHexagonalPrisms() +SMESH::smIdType SMESH_Mesh_i::NbHexagonalPrisms() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4653,7 +4677,7 @@ CORBA::Long SMESH_Mesh_i::NbHexagonalPrisms() return _impl->NbHexagonalPrisms(); } -CORBA::Long SMESH_Mesh_i::NbPolyhedrons() +SMESH::smIdType SMESH_Mesh_i::NbPolyhedrons() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4662,7 +4686,7 @@ CORBA::Long SMESH_Mesh_i::NbPolyhedrons() return _impl->NbPolyhedrons(); } -CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4671,7 +4695,7 @@ CORBA::Long SMESH_Mesh_i::NbVolumesOfOrder(SMESH::ElementOrder order) return _impl->NbVolumes( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4680,7 +4704,7 @@ CORBA::Long SMESH_Mesh_i::NbTetrasOfOrder(SMESH::ElementOrder order) return _impl->NbTetras( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4689,7 +4713,7 @@ CORBA::Long SMESH_Mesh_i::NbHexasOfOrder(SMESH::ElementOrder order) return _impl->NbHexas( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4698,7 +4722,7 @@ CORBA::Long SMESH_Mesh_i::NbPyramidsOfOrder(SMESH::ElementOrder order) return _impl->NbPyramids( (SMDSAbs_ElementOrder) order); } -CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order) +SMESH::smIdType SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) @@ -4713,7 +4737,7 @@ CORBA::Long SMESH_Mesh_i::NbPrismsOfOrder(SMESH::ElementOrder order) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::NbSubMesh() +SMESH::smIdType SMESH_Mesh_i::NbSubMesh() { Unexpect aCatch(SALOME_SalomeException); return _mapSubMesh_i.size(); @@ -4738,7 +4762,7 @@ char* SMESH_Mesh_i::Dump() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetIDs() +SMESH::smIdType_array* SMESH_Mesh_i::GetIDs() { return GetElementsId(); } @@ -4749,22 +4773,22 @@ SMESH::long_array* SMESH_Mesh_i::GetIDs() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetElementsId() +SMESH::smIdType_array* SMESH_Mesh_i::GetElementsId() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); if ( aSMESHDS_Mesh == NULL ) return aResult._retn(); - long nbElements = NbElements(); + smIdType nbElements = NbElements(); aResult->length( nbElements ); SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator(); - for ( int i = 0, n = nbElements; i < n && anIt->more(); i++ ) + for ( smIdType i = 0, n = nbElements; i < n && anIt->more(); i++ ) aResult[i] = anIt->next()->GetID(); return aResult._retn(); @@ -4777,19 +4801,19 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsId() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemType ) +SMESH::smIdType_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemType ) { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); if ( aSMESHDS_Mesh == NULL ) return aResult._retn(); - long nbElements = NbElements(); + smIdType nbElements = NbElements(); // No sense in returning ids of elements along with ids of nodes: // when theElemType == SMESH::ALL, return node ids only if @@ -4799,7 +4823,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemTy aResult->length( nbElements ); - int i = 0; + smIdType i = 0; SMDS_ElemIteratorPtr anIt = aSMESHDS_Mesh->elementsIterator( (SMDSAbs_ElementType)theElemType ); while ( i < nbElements && anIt->more() ) @@ -4816,22 +4840,22 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsByType( SMESH::ElementType theElemTy */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetNodesId() +SMESH::smIdType_array* SMESH_Mesh_i::GetNodesId() { Unexpect aCatch(SALOME_SalomeException); if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS(); if ( aMeshDS == NULL ) return aResult._retn(); - long nbNodes = NbNodes(); + smIdType nbNodes = NbNodes(); aResult->length( nbNodes ); SMDS_NodeIteratorPtr anIt = aMeshDS->nodesIterator(); - for ( int i = 0, n = nbNodes; i < n && anIt->more(); i++ ) + for ( smIdType i = 0, n = nbNodes; i < n && anIt->more(); i++ ) aResult[i] = anIt->next()->GetID(); return aResult._retn(); @@ -4843,7 +4867,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodesId() */ //============================================================================= -SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const bool iselem ) +SMESH::ElementType SMESH_Mesh_i::GetElementType( const SMESH::smIdType id, const bool iselem ) { SMESH::ElementType type = SMESH::ALL; SMESH_TRY; @@ -4864,7 +4888,7 @@ SMESH::ElementType SMESH_Mesh_i::GetElementType( const CORBA::Long id, const boo */ //============================================================================= -SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id ) +SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const SMESH::smIdType id ) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4882,7 +4906,7 @@ SMESH::EntityType SMESH_Mesh_i::GetElementGeomType( const CORBA::Long id ) */ //============================================================================= -SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const CORBA::Long id ) +SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const SMESH::smIdType id ) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -4900,9 +4924,9 @@ SMESH::GeometryType SMESH_Mesh_i::GetElementShape( const CORBA::Long id ) */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) +SMESH::smIdType_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) { - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESH_TRY; if ( _preMeshInfo ) @@ -4917,7 +4941,7 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) aResult->length(SDSM->NbElements()); SMDS_ElemIteratorPtr eIt = SDSM->GetElements(); - int i = 0; + smIdType i = 0; while ( eIt->more() ) { aResult[i++] = eIt->next()->GetID(); } @@ -4935,10 +4959,10 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshElementsId(const CORBA::Long ShapeID) */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, +SMESH::smIdType_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, CORBA::Boolean all) { - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESH_TRY; if ( _preMeshInfo ) @@ -4950,7 +4974,7 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, SMESHDS_SubMesh* SDSM = SM->GetSubMeshDS(); if(!SDSM) return aResult._retn(); - set theElems; + set theElems; if( !all || (SDSM->NbElements()==0) ) { // internal nodes or vertex submesh SMDS_NodeIteratorPtr nIt = SDSM->GetNodes(); while ( nIt->more() ) { @@ -4971,8 +4995,8 @@ SMESH::long_array* SMESH_Mesh_i::GetSubMeshNodesId(const CORBA::Long ShapeID, } aResult->length(theElems.size()); - set::iterator itElem; - int i = 0; + set::iterator itElem; + smIdType i = 0; for ( itElem = theElems.begin(); itElem != theElems.end(); itElem++ ) aResult[i++] = *itElem; @@ -5039,7 +5063,7 @@ CORBA::LongLong SMESH_Mesh_i::GetMeshPtr() */ //============================================================================= -SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const CORBA::Long id) +SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5070,13 +5094,13 @@ SMESH::double_array* SMESH_Mesh_i::GetNodeXYZ(const CORBA::Long id) */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id, - SMESH::ElementType elemType) +SMESH::smIdType_array* SMESH_Mesh_i::GetNodeInverseElements(const SMESH::smIdType id, + SMESH::ElementType elemType) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS(); if ( aMeshDS == NULL ) return aResult._retn(); @@ -5090,7 +5114,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id, SMDSAbs_ElementType type = SMDSAbs_ElementType( elemType ); SMDS_ElemIteratorPtr eIt = aNode->GetInverseElementIterator( type ); aResult->length( aNode->NbInverseElements( type )); - for( int i = 0; eIt->more(); ++i ) + for( smIdType i = 0; eIt->more(); ++i ) { const SMDS_MeshElement* elem = eIt->next(); aResult[ i ] = elem->GetID(); @@ -5104,7 +5128,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id, */ //============================================================================= -SMESH::NodePosition* SMESH_Mesh_i::GetNodePosition(CORBA::Long NodeID) +SMESH::NodePosition* SMESH_Mesh_i::GetNodePosition(SMESH::smIdType NodeID) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5157,7 +5181,7 @@ SMESH::NodePosition* SMESH_Mesh_i::GetNodePosition(CORBA::Long NodeID) */ //============================================================================= -SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(CORBA::Long ElemID) +SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(SMESH::smIdType ElemID) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5204,7 +5228,7 @@ SMESH::ElementPosition SMESH_Mesh_i::GetElementPosition(CORBA::Long ElemID) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::GetShapeID(const CORBA::Long id) +CORBA::Long SMESH_Mesh_i::GetShapeID(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5231,7 +5255,7 @@ CORBA::Long SMESH_Mesh_i::GetShapeID(const CORBA::Long id) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const CORBA::Long id) +CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5261,7 +5285,7 @@ CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const CORBA::Long id) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::GetElemNbNodes(const CORBA::Long id) +CORBA::Short SMESH_Mesh_i::GetElemNbNodes(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5283,7 +5307,7 @@ CORBA::Long SMESH_Mesh_i::GetElemNbNodes(const CORBA::Long id) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::GetElemNode(const CORBA::Long id, const CORBA::Long index) +SMESH::smIdType SMESH_Mesh_i::GetElemNode(const SMESH::smIdType id, const CORBA::Short index) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5302,18 +5326,18 @@ CORBA::Long SMESH_Mesh_i::GetElemNode(const CORBA::Long id, const CORBA::Long in */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetElemNodes(const CORBA::Long id) +SMESH::smIdType_array* SMESH_Mesh_i::GetElemNodes(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() ) { if ( const SMDS_MeshElement* elem = aMeshDS->FindElement(id) ) { aResult->length( elem->NbNodes() ); - for ( CORBA::ULong i = 0; i < aResult->length(); ++i ) + for ( SMESH::smIdType i = 0; i < aResult->length(); ++i ) if ( const SMDS_MeshNode* n = elem->GetNode( i )) aResult[ i ] = n->GetID(); } @@ -5328,7 +5352,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElemNodes(const CORBA::Long id) */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const CORBA::Long ide, const CORBA::Long idn) +CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const SMESH::smIdType ide, const SMESH::smIdType idn) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5353,7 +5377,7 @@ CORBA::Boolean SMESH_Mesh_i::IsMediumNode(const CORBA::Long ide, const CORBA::Lo */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const CORBA::Long idn, +CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const SMESH::smIdType idn, SMESH::ElementType theElemType) { if ( _preMeshInfo ) @@ -5384,7 +5408,7 @@ CORBA::Boolean SMESH_Mesh_i::IsMediumNodeOfAnyElem(const CORBA::Long idn, */ //============================================================================= -CORBA::Long SMESH_Mesh_i::ElemNbEdges(const CORBA::Long id) +CORBA::Long SMESH_Mesh_i::ElemNbEdges(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5403,7 +5427,7 @@ CORBA::Long SMESH_Mesh_i::ElemNbEdges(const CORBA::Long id) */ //============================================================================= -CORBA::Long SMESH_Mesh_i::ElemNbFaces(const CORBA::Long id) +CORBA::Long SMESH_Mesh_i::ElemNbFaces(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5421,13 +5445,13 @@ CORBA::Long SMESH_Mesh_i::ElemNbFaces(const CORBA::Long id) */ //================================================================================ -SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId, - CORBA::Short faceIndex) +SMESH::smIdType_array* SMESH_Mesh_i::GetElemFaceNodes(SMESH::smIdType elemId, + CORBA::Short faceIndex) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); if ( SMESHDS_Mesh* aMeshDS = _impl->GetMeshDS() ) { if ( const SMDS_MeshElement* elem = aMeshDS->FindElement(elemId) ) @@ -5437,7 +5461,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElemFaceNodes(CORBA::Long elemId, { aResult->length( vtool.NbFaceNodes( faceIndex )); const SMDS_MeshNode** nn = vtool.GetFaceNodes( faceIndex ); - for ( CORBA::ULong i = 0; i < aResult->length(); ++i ) + for ( SMESH::smIdType i = 0; i < aResult->length(); ++i ) aResult[ i ] = nn[ i ]->GetID(); } } @@ -5479,7 +5503,7 @@ SMESH::double_array* SMESH_Mesh_i::GetFaceNormal(CORBA::Long elemId, */ //================================================================================ -CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes) +SMESH::smIdType SMESH_Mesh_i::FindElementByNodes(const SMESH::smIdType_array& nodes) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5509,18 +5533,18 @@ CORBA::Long SMESH_Mesh_i::FindElementByNodes(const SMESH::long_array& nodes) */ //================================================================================ -SMESH::long_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::long_array& nodes, - SMESH::ElementType elemType) +SMESH::smIdType_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::smIdType_array& nodes, + SMESH::ElementType elemType) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); - SMESH::long_array_var result = new SMESH::long_array(); + SMESH::smIdType_array_var result = new SMESH::smIdType_array(); if ( SMESHDS_Mesh* mesh = _impl->GetMeshDS() ) { vector< const SMDS_MeshNode * > nn( nodes.length() ); - for ( CORBA::ULong i = 0; i < nodes.length(); ++i ) + for ( SMESH::smIdType i = 0; i < nodes.length(); ++i ) nn[i] = mesh->FindNode( nodes[i] ); std::vector elems; @@ -5538,7 +5562,7 @@ SMESH::long_array* SMESH_Mesh_i::GetElementsByNodes(const SMESH::long_array& nod */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::IsPoly(const CORBA::Long id) +CORBA::Boolean SMESH_Mesh_i::IsPoly(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5557,7 +5581,7 @@ CORBA::Boolean SMESH_Mesh_i::IsPoly(const CORBA::Long id) */ //============================================================================= -CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const CORBA::Long id) +CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5575,7 +5599,7 @@ CORBA::Boolean SMESH_Mesh_i::IsQuadratic(const CORBA::Long id) */ //============================================================================= -CORBA::Double SMESH_Mesh_i::GetBallDiameter(CORBA::Long id) +CORBA::Double SMESH_Mesh_i::GetBallDiameter(SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -5593,7 +5617,7 @@ CORBA::Double SMESH_Mesh_i::GetBallDiameter(CORBA::Long id) */ //============================================================================= -SMESH::double_array* SMESH_Mesh_i::BaryCenter(const CORBA::Long id) +SMESH::double_array* SMESH_Mesh_i::BaryCenter(const SMESH::smIdType id) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -6024,12 +6048,12 @@ bool SMESH_Mesh_i::IsMeshInfoCorrect() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetMeshInfo() +SMESH::smIdType_array* SMESH_Mesh_i::GetMeshInfo() { if ( _preMeshInfo ) return _preMeshInfo->GetMeshInfo(); - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::Entity_Last); for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) aRes[i] = 0; @@ -6048,11 +6072,11 @@ SMESH::long_array* SMESH_Mesh_i::GetMeshInfo() */ //============================================================================= -SMESH::long_array* SMESH_Mesh_i::GetNbElementsByType() +SMESH::smIdType_array* SMESH_Mesh_i::GetNbElementsByType() { - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::NB_ELEMENT_TYPES); - for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) + for (smIdType i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) aRes[ i ] = 0; const SMDS_MeshInfo* meshInfo = 0; @@ -6062,7 +6086,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNbElementsByType() meshInfo = & meshDS->GetMeshInfo(); if (meshInfo) - for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) + for (smIdType i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) aRes[i] = meshInfo->NbElements((SMDSAbs_ElementType)i); return aRes._retn(); @@ -6075,7 +6099,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNbElementsByType() //============================================================================= void SMESH_Mesh_i::CollectMeshInfo(const SMDS_ElemIteratorPtr theItr, - SMESH::long_array& theInfo) + SMESH::smIdType_array& theInfo) { if (!theItr) return; while (theItr->more()) @@ -6155,25 +6179,25 @@ namespace /* Iterators used in SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_v //----------------------------------------------------------------------------- struct IDSourceIterator : public SMDS_ElemIterator { - const CORBA::Long* _idPtr; - const CORBA::Long* _idEndPtr; - SMESH::long_array_var _idArray; - const SMDS_Mesh* _mesh; - const SMDSAbs_ElementType _type; - const SMDS_MeshElement* _elem; - - IDSourceIterator( const SMDS_Mesh* mesh, - const CORBA::Long* ids, - const int nbIds, - SMDSAbs_ElementType type): + const SMESH::smIdType* _idPtr; + const SMESH::smIdType* _idEndPtr; + SMESH::smIdType_array_var _idArray; + const SMDS_Mesh* _mesh; + const SMDSAbs_ElementType _type; + const SMDS_MeshElement* _elem; + + IDSourceIterator( const SMDS_Mesh* mesh, + const SMESH::smIdType* ids, + const smIdType nbIds, + SMDSAbs_ElementType type): _idPtr( ids ), _idEndPtr( ids + nbIds ), _mesh( mesh ), _type( type ), _elem( 0 ) { if ( _idPtr && nbIds && _mesh ) next(); } - IDSourceIterator( const SMDS_Mesh* mesh, - SMESH::long_array* idArray, - SMDSAbs_ElementType type): + IDSourceIterator( const SMDS_Mesh* mesh, + SMESH::smIdType_array* idArray, + SMDSAbs_ElementType type): _idPtr( 0 ), _idEndPtr( 0 ), _idArray( idArray), _mesh( mesh ), _type( type ), _elem( 0 ) { if ( idArray && _mesh ) @@ -6324,13 +6348,13 @@ SMDS_ElemIteratorPtr SMESH_Mesh_i::GetElements(SMESH::SMESH_IDSource_ptr theObje SMDSAbs_ElementType iterType = isNodes ? SMDSAbs_Node : elemType; if ( SMESH_MeshEditor_i::IsTemporaryIDSource( theObject )) { - int nbIds; - if ( CORBA::Long* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds )) + SMESH::smIdType nbIds; + if ( SMESH::smIdType* ids = SMESH_MeshEditor_i::GetTemporaryIDs( theObject, nbIds )) elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids, nbIds, iterType )); } else { - SMESH::long_array_var ids = theObject->GetIDs(); + SMESH::smIdType_array_var ids = theObject->GetIDs(); elemIt = SMDS_ElemIteratorPtr( new IDSourceIterator( meshDS, ids._retn(), iterType )); } typeOK = ( isNodes == ( elemType == SMDSAbs_Node )) || ( elemType == SMDSAbs_All ); @@ -6978,7 +7002,7 @@ SMESH_MeshPartDS::SMESH_MeshPartDS(SMESH::SMESH_IDSource_ptr meshPart): else { TMeshInfo tmpInfo; - SMESH::long_array_var anIDs = meshPart->GetIDs(); + SMESH::smIdType_array_var anIDs = meshPart->GetIDs(); SMESH::array_of_ElementType_var types = meshPart->GetTypes(); if ( types->length() == 1 && types[0] == SMESH::NODE ) // group of nodes { @@ -7057,35 +7081,35 @@ bool SMESH_MeshPartDS::HasNumerationHoles() MaxElementID() != NbElements() ); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MaxNodeID() const +smIdType SMESH_MeshPartDS::MaxNodeID() const { if ( _meshDS ) return _meshDS->MaxNodeID(); return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].rbegin())->GetID(); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MinNodeID() const +smIdType SMESH_MeshPartDS::MinNodeID() const { if ( _meshDS ) return _meshDS->MinNodeID(); return NbNodes() == 0 ? 0 : (*_elements[ SMDSAbs_Node ].begin())->GetID(); } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MaxElementID() const +smIdType SMESH_MeshPartDS::MaxElementID() const { if ( _meshDS ) return _meshDS->MaxElementID(); - int maxID = 0; + smIdType maxID = 0; for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType ) if ( !_elements[ iType ].empty() ) - maxID = Max( maxID, (*_elements[ iType ].rbegin())->GetID() ); + maxID = std::max( maxID, (*_elements[ iType ].rbegin())->GetID() ); return maxID; } // ------------------------------------------------------------------------------------- -int SMESH_MeshPartDS::MinElementID() const +smIdType SMESH_MeshPartDS::MinElementID() const { if ( _meshDS ) return _meshDS->MinElementID(); - int minID = 0; + smIdType minID = 0; for ( int iType = SMDSAbs_Edge; iType < SMDSAbs_NbElementTypes; ++iType ) if ( !_elements[ iType ].empty() ) - minID = Min( minID, (*_elements[ iType ].begin())->GetID() ); + minID = std::min( minID, (*_elements[ iType ].begin())->GetID() ); return minID; } // ------------------------------------------------------------------------------------- diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index 56edeee76..56b0f6b6b 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -244,89 +244,89 @@ public: CORBA::Double GetComputeProgress(); - CORBA::Long NbNodes(); + SMESH::smIdType NbNodes(); - CORBA::Long NbElements(); + SMESH::smIdType NbElements(); - CORBA::Long Nb0DElements(); + SMESH::smIdType Nb0DElements(); - CORBA::Long NbBalls(); + SMESH::smIdType NbBalls(); - CORBA::Long NbEdges(); + SMESH::smIdType NbEdges(); - CORBA::Long NbEdgesOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbEdgesOfOrder(SMESH::ElementOrder order); - CORBA::Long NbFaces(); + SMESH::smIdType NbFaces(); - CORBA::Long NbFacesOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbFacesOfOrder(SMESH::ElementOrder order); - CORBA::Long NbTriangles(); + SMESH::smIdType NbTriangles(); - CORBA::Long NbTrianglesOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbTrianglesOfOrder(SMESH::ElementOrder order); - CORBA::Long NbBiQuadTriangles(); + SMESH::smIdType NbBiQuadTriangles(); - CORBA::Long NbQuadrangles(); + SMESH::smIdType NbQuadrangles(); - CORBA::Long NbQuadranglesOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbQuadranglesOfOrder(SMESH::ElementOrder order); - CORBA::Long NbBiQuadQuadrangles(); + SMESH::smIdType NbBiQuadQuadrangles(); - CORBA::Long NbPolygons(); + SMESH::smIdType NbPolygons(); - CORBA::Long NbPolygonsOfOrder(SMESH::ElementOrder order = SMESH::ORDER_ANY); + SMESH::smIdType NbPolygonsOfOrder(SMESH::ElementOrder order = SMESH::ORDER_ANY); - CORBA::Long NbVolumes(); + SMESH::smIdType NbVolumes(); - CORBA::Long NbVolumesOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbVolumesOfOrder(SMESH::ElementOrder order); - CORBA::Long NbTetras(); + SMESH::smIdType NbTetras(); - CORBA::Long NbTetrasOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbTetrasOfOrder(SMESH::ElementOrder order); - CORBA::Long NbHexas(); + SMESH::smIdType NbHexas(); - CORBA::Long NbHexasOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbHexasOfOrder(SMESH::ElementOrder order); - CORBA::Long NbTriQuadraticHexas(); + SMESH::smIdType NbTriQuadraticHexas(); - CORBA::Long NbPyramids(); + SMESH::smIdType NbPyramids(); - CORBA::Long NbPyramidsOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbPyramidsOfOrder(SMESH::ElementOrder order); - CORBA::Long NbPrisms(); + SMESH::smIdType NbPrisms(); - CORBA::Long NbPrismsOfOrder(SMESH::ElementOrder order); + SMESH::smIdType NbPrismsOfOrder(SMESH::ElementOrder order); - CORBA::Long NbHexagonalPrisms(); + SMESH::smIdType NbHexagonalPrisms(); - CORBA::Long NbPolyhedrons(); + SMESH::smIdType NbPolyhedrons(); - CORBA::Long NbSubMesh(); + SMESH::smIdType NbSubMesh(); - SMESH::long_array* GetElementsId(); + SMESH::smIdType_array* GetElementsId(); - SMESH::long_array* GetElementsByType( SMESH::ElementType theElemType ); + SMESH::smIdType_array* GetElementsByType( SMESH::ElementType theElemType ); - SMESH::long_array* GetNodesId(); + SMESH::smIdType_array* GetNodesId(); - SMESH::ElementType GetElementType( CORBA::Long id, bool iselem ); + SMESH::ElementType GetElementType( SMESH::smIdType id, bool iselem ); - SMESH::EntityType GetElementGeomType( CORBA::Long id ); + SMESH::EntityType GetElementGeomType( SMESH::smIdType id ); - SMESH::GeometryType GetElementShape( CORBA::Long id ); + SMESH::GeometryType GetElementShape( SMESH::smIdType id ); /*! * Returns ID of elements for given submesh */ - SMESH::long_array* GetSubMeshElementsId(CORBA::Long ShapeID); + SMESH::smIdType_array* GetSubMeshElementsId(CORBA::Long ShapeID); /*! * Returns ID of nodes for given submesh * If param all==true - returns all nodes, else - * returns only nodes on shapes. */ - SMESH::long_array* GetSubMeshNodesId(CORBA::Long ShapeID, CORBA::Boolean all); + SMESH::smIdType_array* GetSubMeshNodesId(CORBA::Long ShapeID, CORBA::Boolean all); /*! * Returns type of elements for given submesh @@ -419,82 +419,82 @@ public: * Get XYZ coordinates of node as list of double * If there is not node for given ID - returns empty list */ - SMESH::double_array* GetNodeXYZ(CORBA::Long id); + SMESH::double_array* GetNodeXYZ(SMESH::smIdType id); /*! * For given node returns list of IDs of inverse elements * If there is not node for given ID - returns empty list */ - SMESH::long_array* GetNodeInverseElements(CORBA::Long id, + SMESH::smIdType_array* GetNodeInverseElements(SMESH::smIdType id, SMESH::ElementType elemType); /*! * \brief Return position of a node on shape */ - SMESH::NodePosition* GetNodePosition(CORBA::Long NodeID); + SMESH::NodePosition* GetNodePosition(SMESH::smIdType NodeID); /*! * \brief Return position of an element on shape */ - SMESH::ElementPosition GetElementPosition(CORBA::Long ElemID); + SMESH::ElementPosition GetElementPosition(SMESH::smIdType ElemID); /*! * If given element is node returns IDs of shape from position * If there is not node for given ID - returns -1 */ - CORBA::Long GetShapeID(CORBA::Long id); + CORBA::Long GetShapeID(SMESH::smIdType id); /*! * For given element returns ID of result shape after * ::FindShape() from SMESH_MeshEditor * If there is not element for given ID - returns -1 */ - CORBA::Long GetShapeIDForElem(CORBA::Long id); + CORBA::Long GetShapeIDForElem(SMESH::smIdType id); /*! * Returns number of nodes for given element * If there is not element for given ID - returns -1 */ - CORBA::Long GetElemNbNodes(CORBA::Long id); + CORBA::Short GetElemNbNodes(SMESH::smIdType id); /*! * Returns IDs of nodes of given element */ - SMESH::long_array* GetElemNodes(CORBA::Long id); + SMESH::smIdType_array* GetElemNodes(SMESH::smIdType id); /*! * Returns ID of node by given index for given element * If there is not element for given ID - returns -1 * If there is not node for given index - returns -2 */ - CORBA::Long GetElemNode(CORBA::Long id, CORBA::Long index); + SMESH::smIdType GetElemNode(SMESH::smIdType id, CORBA::Short index); /*! * Returns true if given node is medium node * in given quadratic element */ - CORBA::Boolean IsMediumNode(CORBA::Long ide, CORBA::Long idn); + CORBA::Boolean IsMediumNode(SMESH::smIdType ide, SMESH::smIdType idn); /*! * Returns true if given node is medium node * in one of quadratic elements */ - CORBA::Boolean IsMediumNodeOfAnyElem(CORBA::Long idn, + CORBA::Boolean IsMediumNodeOfAnyElem(SMESH::smIdType idn, SMESH::ElementType elemType); /*! * Returns number of edges for given element */ - CORBA::Long ElemNbEdges(CORBA::Long id); + CORBA::Long ElemNbEdges(SMESH::smIdType id); /*! * Returns number of faces for given element */ - CORBA::Long ElemNbFaces(CORBA::Long id); + CORBA::Long ElemNbFaces(SMESH::smIdType id); /*! * Returns nodes of given face (counted from zero) for given element. */ - SMESH::long_array* GetElemFaceNodes(CORBA::Long elemId, CORBA::Short faceIndex); + SMESH::smIdType_array* GetElemFaceNodes(SMESH::smIdType elemId, CORBA::Short faceIndex); /*! * Returns three components of normal of given mesh face (or an empty array in KO case) @@ -504,33 +504,33 @@ public: /*! * Returns an element based on all given nodes. */ - CORBA::Long FindElementByNodes(const SMESH::long_array& nodes); + SMESH::smIdType FindElementByNodes(const SMESH::smIdType_array& nodes); /*! * Return elements including all given nodes. */ - SMESH::long_array* GetElementsByNodes(const SMESH::long_array& nodes, + SMESH::smIdType_array* GetElementsByNodes(const SMESH::smIdType_array& nodes, SMESH::ElementType elemType); /*! * Returns true if given element is polygon */ - CORBA::Boolean IsPoly(CORBA::Long id); + CORBA::Boolean IsPoly(SMESH::smIdType id); /*! * Returns true if given element is quadratic */ - CORBA::Boolean IsQuadratic(CORBA::Long id); + CORBA::Boolean IsQuadratic(SMESH::smIdType id); /*! * Returns diameter of ball discrete element or zero in case of an invalid \a id */ - CORBA::Double GetBallDiameter(CORBA::Long id); + CORBA::Double GetBallDiameter(SMESH::smIdType id); /*! * Returns bary center for given element */ - SMESH::double_array* BaryCenter(CORBA::Long id); + SMESH::double_array* BaryCenter(SMESH::smIdType id); /*! * Returns information about imported MED file @@ -582,7 +582,7 @@ public: * Collect statistic of mesh elements given by iterator */ static void CollectMeshInfo(const SMDS_ElemIteratorPtr theItr, - SMESH::long_array& theInfo); + SMESH::smIdType_array& theInfo); /*! * \brief Return iterator on elements of given type in given object */ @@ -593,17 +593,17 @@ public: // SMESH_IDSource interface // ========================= - virtual SMESH::long_array* GetIDs(); + virtual SMESH::smIdType_array* GetIDs(); /*! * Returns number of mesh elements of each \a EntityType * Result array of number of elements per \a EntityType * Inherited from SMESH_IDSource */ - virtual SMESH::long_array* GetMeshInfo(); + virtual SMESH::smIdType_array* GetMeshInfo(); /*! * Returns number of mesh elements of each \a ElementType */ - virtual SMESH::long_array* GetNbElementsByType(); + virtual SMESH::smIdType_array* GetNbElementsByType(); /*! * Returns types of elements it contains */ diff --git a/src/SMESH_I/SMESH_Pattern_i.cxx b/src/SMESH_I/SMESH_Pattern_i.cxx index f540e358d..cc23988aa 100644 --- a/src/SMESH_I/SMESH_Pattern_i.cxx +++ b/src/SMESH_I/SMESH_Pattern_i.cxx @@ -273,10 +273,10 @@ SMESH::point_array* SMESH_Pattern_i::ApplyTo3DBlock(GEOM::GEOM_Object_ptr theBlo //======================================================================= SMESH::point_array* - SMESH_Pattern_i::ApplyToMeshFaces(SMESH::SMESH_Mesh_ptr theMesh, - const SMESH::long_array& theFacesIDs, - CORBA::Long theNodeIndexOnKeyPoint1, - CORBA::Boolean theReverse) + SMESH_Pattern_i::ApplyToMeshFaces(SMESH::SMESH_Mesh_ptr theMesh, + const SMESH::smIdType_array& theFacesIDs, + CORBA::Short theNodeIndexOnKeyPoint1, + CORBA::Boolean theReverse) { SMESH::point_array_var points = new SMESH::point_array; @@ -286,9 +286,9 @@ SMESH::point_array* list xyzList; set fset; - for ( CORBA::ULong i = 0; i < theFacesIDs.length(); i++) + for ( SMESH::smIdType i = 0; i < theFacesIDs.length(); i++) { - CORBA::Long index = theFacesIDs[i]; + SMESH::smIdType index = theFacesIDs[i]; const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index); if ( elem && elem->GetType() == SMDSAbs_Face ) fset.insert( static_cast( elem )); @@ -332,10 +332,10 @@ SMESH::point_array* //======================================================================= SMESH::point_array* - SMESH_Pattern_i::ApplyToHexahedrons(SMESH::SMESH_Mesh_ptr theMesh, - const SMESH::long_array& theVolumesIDs, - CORBA::Long theNode000Index, - CORBA::Long theNode001Index) + SMESH_Pattern_i::ApplyToHexahedrons(SMESH::SMESH_Mesh_ptr theMesh, + const SMESH::smIdType_array& theVolumesIDs, + CORBA::Short theNode000Index, + CORBA::Short theNode001Index) { SMESH::point_array_var points = new SMESH::point_array; @@ -345,9 +345,9 @@ SMESH::point_array* list xyzList; set vset; - for ( CORBA::ULong i = 0; i < theVolumesIDs.length(); i++) + for ( SMESH::smIdType i = 0; i < theVolumesIDs.length(); i++) { - CORBA::Long index = theVolumesIDs[i]; + SMESH::smIdType index = theVolumesIDs[i]; const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index); if ( elem && elem->GetType() == SMDSAbs_Volume && elem->NbNodes() == 8 ) vset.insert( static_cast( elem )); @@ -389,7 +389,7 @@ CORBA::Boolean SMESH_Pattern_i::MakeMesh (SMESH::SMESH_Mesh_ptr theMesh, << CreatePolygons << ", " << CreatePolyedrs << " )"; addErrorCode( "MakeMesh" ); - int nb = aMesh->NbNodes() + aMesh->NbEdges() + aMesh->NbFaces() + aMesh->NbVolumes(); + smIdType nb = aMesh->NbNodes() + aMesh->NbEdges() + aMesh->NbFaces() + aMesh->NbVolumes(); bool res = myPattern.MakeMesh( aMesh, CreatePolygons, CreatePolyedrs ); diff --git a/src/SMESH_I/SMESH_Pattern_i.hxx b/src/SMESH_I/SMESH_Pattern_i.hxx index 7ab6c9683..70edc552c 100644 --- a/src/SMESH_I/SMESH_Pattern_i.hxx +++ b/src/SMESH_I/SMESH_Pattern_i.hxx @@ -66,15 +66,15 @@ class SMESH_I_EXPORT SMESH_Pattern_i: GEOM::GEOM_Object_ptr theVertex000, GEOM::GEOM_Object_ptr theVertex001); - SMESH::point_array* ApplyToMeshFaces(SMESH::SMESH_Mesh_ptr theMesh, - const SMESH::long_array& theFacesIDs, - CORBA::Long theNodeIndexOnKeyPoint1, - CORBA::Boolean theReverse); - - SMESH::point_array* ApplyToHexahedrons(SMESH::SMESH_Mesh_ptr theMesh, - const SMESH::long_array& theVolumesIDs, - CORBA::Long theNode000Index, - CORBA::Long theNode001Index); + SMESH::point_array* ApplyToMeshFaces(SMESH::SMESH_Mesh_ptr theMesh, + const SMESH::smIdType_array& theFacesIDs, + CORBA::Short theNodeIndexOnKeyPoint1, + CORBA::Boolean theReverse); + + SMESH::point_array* ApplyToHexahedrons(SMESH::SMESH_Mesh_ptr theMesh, + const SMESH::smIdType_array& theVolumesIDs, + CORBA::Short theNode000Index, + CORBA::Short theNode001Index); //for omniORB conflict compilation /*CORBA::Boolean MakeMesh (SMESH::SMESH_Mesh_ptr theMesh, diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index b3eaa31f3..3671df2ae 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -242,9 +242,9 @@ namespace */ //================================================================================ - void meshInfo2hdf( SMESH::long_array_var meshInfo, - const std::string& name, - HDFgroup* hdfGroup) + void meshInfo2hdf( SMESH::smIdType_array_var meshInfo, + const std::string& name, + HDFgroup* hdfGroup) { // we use med identification of element (MED::EGeometrieElement) types // but not enum SMDSAbs_EntityType because values of SMDSAbs_EntityType may @@ -1198,9 +1198,9 @@ SMESH::array_of_ElementType* SMESH_PreMeshInfo::GetTypes() const */ //================================================================================ -SMESH::long_array* SMESH_PreMeshInfo::GetMeshInfo() const +SMESH::smIdType_array* SMESH_PreMeshInfo::GetMeshInfo() const { - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::Entity_Last); for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) aRes[i] = 0; diff --git a/src/SMESH_I/SMESH_PreMeshInfo.hxx b/src/SMESH_I/SMESH_PreMeshInfo.hxx index b27b965fa..6e1b162e2 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.hxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.hxx @@ -80,7 +80,7 @@ public: // meshods of SMESH_IDSource interface SMESH::array_of_ElementType* GetTypes() const; - SMESH::long_array* GetMeshInfo() const; + SMESH::smIdType_array* GetMeshInfo() const; bool IsMeshInfoCorrect() const; ~SMESH_PreMeshInfo(); diff --git a/src/SMESH_I/SMESH_PythonDump.cxx b/src/SMESH_I/SMESH_PythonDump.cxx index e741f51f2..2dacb2da4 100644 --- a/src/SMESH_I/SMESH_PythonDump.cxx +++ b/src/SMESH_I/SMESH_PythonDump.cxx @@ -60,9 +60,10 @@ namespace SMESH size_t TPythonDump::myCounter = 0; const char theNotPublishedObjectName[] = "__NOT__Published__Object__"; - TVar::TVar(CORBA::Double value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); } - TVar::TVar(CORBA::Long value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); } - TVar::TVar(CORBA::Short value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); } + TVar::TVar(CORBA::Double value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); } + TVar::TVar(CORBA::Long value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); } + TVar::TVar(SMESH::smIdType value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); } + TVar::TVar(CORBA::Short value):myVals(1), myIsList(false) { myVals[0] = SMESH_Comment(value); } TVar::TVar(const SMESH::double_array& value):myVals(value.length()), myIsList(true) { for ( size_t i = 0; i < value.length(); i++) @@ -143,6 +144,13 @@ namespace SMESH return *this; } + TPythonDump& + TPythonDump:: + operator<<(long long theArg){ + myStream<GetMesh(); - SMESH::long_array_var anElementsId = theArg->GetIDs(); - SMESH::array_of_ElementType_var types = theArg->GetTypes(); - SMESH::ElementType type = types->length() ? types[0] : SMESH::ALL; - SALOMEDS::SObject_wrap meshSO = mySmesh->ObjectToSObject(mesh); + SMESH::SMESH_Mesh_var mesh = theArg->GetMesh(); + SMESH::smIdType_array_var anElementsId = theArg->GetIDs(); + SMESH::array_of_ElementType_var types = theArg->GetTypes(); + SMESH::ElementType type = types->length() ? types[0] : SMESH::ALL; + SALOMEDS::SObject_wrap meshSO = mySmesh->ObjectToSObject(mesh); + if ( meshSO->_is_nil() ) // don't waste memory for dumping not published objects return *this << mesh << ".GetIDSource([], " << type << ")"; else diff --git a/src/SMESH_I/SMESH_PythonDump.hxx b/src/SMESH_I/SMESH_PythonDump.hxx index 59a5df790..a17cf643e 100644 --- a/src/SMESH_I/SMESH_PythonDump.hxx +++ b/src/SMESH_I/SMESH_PythonDump.hxx @@ -99,9 +99,10 @@ namespace SMESH { std::vector< std::string > myVals; bool myIsList; - TVar(CORBA::Double value); - TVar(CORBA::Long value); - TVar(CORBA::Short value); + TVar(CORBA::Double value); + TVar(CORBA::Long value); + TVar(SMESH::smIdType value); + TVar(CORBA::Short value); TVar(const SMESH::double_array& value); // string used to temporary quote variable names in order // not to confuse variables with string arguments @@ -136,6 +137,9 @@ namespace SMESH TPythonDump& operator<<(int theArg); + TPythonDump& + operator<<(long long theArg); + TPythonDump& operator<<(double theArg); @@ -160,6 +164,9 @@ namespace SMESH TPythonDump& operator<<(const SMESH::long_array& theArg); + TPythonDump& + operator<<(const SMESH::smIdType_array& theArg); + TPythonDump& operator<<(const SMESH::double_array& theArg); diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 5982ff089..52a839a5e 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -140,7 +140,7 @@ bool getSubMeshes(::SMESH_subMesh* theSubMesh, */ //============================================================================= -CORBA::Long SMESH_subMesh_i::GetNumberOfElements() +SMESH::smIdType SMESH_subMesh_i::GetNumberOfElements() { Unexpect aCatch(SALOME_SalomeException); @@ -152,7 +152,7 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfElements() ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; - int nbElems = 0; + SMESH::smIdType nbElems = 0; TListOfSubMeshes smList; if ( getSubMeshes( aSubMesh, smList )) @@ -170,7 +170,7 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfElements() */ //============================================================================= -CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all) +SMESH::smIdType SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all) { Unexpect aCatch(SALOME_SalomeException); @@ -197,7 +197,7 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all) } if ( all ) // get nodes from aSubMesh and all child sub-meshes { - int nbNodes = 0; + SMESH::smIdType nbNodes = 0; SMESH_subMeshIteratorPtr smIt = aSubMesh->getDependsOnIterator( /*includeSelf=*/true ); while ( smIt->more() ) { @@ -217,11 +217,11 @@ CORBA::Long SMESH_subMesh_i::GetNumberOfNodes(CORBA::Boolean all) */ //============================================================================= -SMESH::long_array* SMESH_subMesh_i::GetElementsId() +SMESH::smIdType_array* SMESH_subMesh_i::GetElementsId() { Unexpect aCatch(SALOME_SalomeException); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); if ( _mesh_i->_mapSubMesh.find( _localId ) == _mesh_i->_mapSubMesh.end() ) return aResult._retn(); @@ -231,7 +231,7 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsId() ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; - int nbElems = 0; + SMESH::smIdType nbElems = 0; TListOfSubMeshes smList; if ( getSubMeshes( aSubMesh, smList )) { @@ -261,11 +261,11 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsId() */ //============================================================================= -SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theElemType ) +SMESH::smIdType_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theElemType ) { Unexpect aCatch(SALOME_SalomeException); - SMESH::long_array_var aResult = new SMESH::long_array(); + SMESH::smIdType_array_var aResult = new SMESH::smIdType_array(); if ( _mesh_i->_mapSubMesh.find( _localId ) == _mesh_i->_mapSubMesh.end() ) return aResult._retn(); @@ -276,8 +276,8 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle ::SMESH_subMesh* aSubMesh = _mesh_i->_mapSubMesh[_localId]; // PAL5440, return all nodes belonging to elements of the sub-mesh - set nodeIds; - int nbElems = 0; + set nodeIds; + smIdType nbElems = 0; // volumes may be bound to shell instead of solid TListOfSubMeshes smList; @@ -317,7 +317,7 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle int i = 0, n = aResult->length(); if ( theElemType == SMESH::NODE && !nodeIds.empty() ) { - set::iterator idIt = nodeIds.begin(); + set::iterator idIt = nodeIds.begin(); for ( ; i < n && idIt != nodeIds.end() ; i++, idIt++ ) aResult[i] = *idIt; } @@ -346,11 +346,11 @@ SMESH::long_array* SMESH_subMesh_i::GetElementsByType( SMESH::ElementType theEle */ //============================================================================= -SMESH::long_array* SMESH_subMesh_i::GetNodesId() +SMESH::smIdType_array* SMESH_subMesh_i::GetNodesId() { Unexpect aCatch(SALOME_SalomeException); - SMESH::long_array_var aResult = GetElementsByType( SMESH::NODE ); + SMESH::smIdType_array_var aResult = GetElementsByType( SMESH::NODE ); return aResult._retn(); } @@ -358,7 +358,7 @@ SMESH::long_array* SMESH_subMesh_i::GetNodesId() /*! * */ -//============================================================================= +//========error:===================================================================== SMESH::SMESH_Mesh_ptr SMESH_subMesh_i::GetFather() { @@ -410,7 +410,7 @@ GEOM::GEOM_Object_ptr SMESH_subMesh_i::GetSubShape() * */ //============================================================================= -SMESH::long_array* SMESH_subMesh_i::GetIDs() +SMESH::smIdType_array* SMESH_subMesh_i::GetIDs() { return GetElementsId(); } @@ -420,7 +420,7 @@ SMESH::long_array* SMESH_subMesh_i::GetIDs() * */ //============================================================================= -SMESH::ElementType SMESH_subMesh_i::GetElementType( const CORBA::Long id, const bool iselem ) +SMESH::ElementType SMESH_subMesh_i::GetElementType( const SMESH::smIdType id, const bool iselem ) { if ( _preMeshInfo ) _preMeshInfo->FullLoadFromFile(); @@ -434,12 +434,12 @@ SMESH::ElementType SMESH_subMesh_i::GetElementType( const CORBA::Long id, const */ //============================================================================= -SMESH::long_array* SMESH_subMesh_i::GetMeshInfo() +SMESH::smIdType_array* SMESH_subMesh_i::GetMeshInfo() { if ( _preMeshInfo ) return _preMeshInfo->GetMeshInfo(); - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::Entity_Last); for (int i = SMESH::Entity_Node; i < SMESH::Entity_Last; i++) aRes[i] = 0; @@ -464,9 +464,9 @@ SMESH::long_array* SMESH_subMesh_i::GetMeshInfo() */ //======================================================================= -SMESH::long_array* SMESH_subMesh_i::GetNbElementsByType() +SMESH::smIdType_array* SMESH_subMesh_i::GetNbElementsByType() { - SMESH::long_array_var aRes = new SMESH::long_array(); + SMESH::smIdType_array_var aRes = new SMESH::smIdType_array(); aRes->length(SMESH::NB_ELEMENT_TYPES); for (int i = 0; i < SMESH::NB_ELEMENT_TYPES; i++) if ( _preMeshInfo ) diff --git a/src/SMESH_I/SMESH_subMesh_i.hxx b/src/SMESH_I/SMESH_subMesh_i.hxx index 97c940b99..05a319bc0 100644 --- a/src/SMESH_I/SMESH_subMesh_i.hxx +++ b/src/SMESH_I/SMESH_subMesh_i.hxx @@ -53,17 +53,17 @@ public: int localId ); ~SMESH_subMesh_i(); - CORBA::Long GetNumberOfElements(); + SMESH::smIdType GetNumberOfElements(); - CORBA::Long GetNumberOfNodes( CORBA::Boolean all ); + SMESH::smIdType GetNumberOfNodes( CORBA::Boolean all ); - SMESH::long_array* GetElementsId(); + SMESH::smIdType_array* GetElementsId(); - SMESH::long_array* GetElementsByType( SMESH::ElementType theElemType ); + SMESH::smIdType_array* GetElementsByType( SMESH::ElementType theElemType ); - SMESH::ElementType GetElementType( CORBA::Long id, bool iselem ); + SMESH::ElementType GetElementType( SMESH::smIdType id, bool iselem ); - SMESH::long_array* GetNodesId(); + SMESH::smIdType_array* GetNodesId(); SMESH::SMESH_Mesh_ptr GetFather(); @@ -78,17 +78,17 @@ public: /*! * Returns a sequence of all element IDs */ - virtual SMESH::long_array* GetIDs(); + virtual SMESH::smIdType_array* GetIDs(); /*! * Returns number of mesh elements of each \a EntityType * Result array of number of elements per \a EntityType * Inherited from SMESH_IDSource */ - virtual SMESH::long_array* GetMeshInfo(); + virtual SMESH::smIdType_array* GetMeshInfo(); /*! * Returns number of mesh elements of each \a ElementType */ - virtual SMESH::long_array* GetNbElementsByType(); + virtual SMESH::smIdType_array* GetNbElementsByType(); /*! * Returns types of elements it contains */ diff --git a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx index 3d9a9a157..3ed78695b 100644 --- a/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx +++ b/src/SMESH_SWIG_WITHIHM/libSMESH_Swig.cxx @@ -1739,7 +1739,7 @@ public: if ( vw->SelectionMode() == ActorSelection ) return; - TColStd_MapOfInteger idMap; + SVTK_TVtkIDsMap idMap; std::vector::const_iterator it; for ( it = myIds.begin(); it != myIds.end(); ++it ) { @@ -1834,11 +1834,11 @@ public: if ( vw->SelectionMode() != EdgeOfCellSelection ) return; - SVTK_IndexedMapOfIds idMap; + SVTK_IndexedMapOfVtkIds idMap; std::vector >::const_iterator it; for ( it = myIds.begin(); it != myIds.end(); ++it ) { - std::vector pair; + std::vector pair; pair.push_back( (*it).first ); pair.push_back( (*it).second ); idMap.Add( pair ); @@ -1991,11 +1991,11 @@ public: if ( !actor || !actor->hasIO() ) return; - TColStd_IndexedMapOfInteger idMap; + SVTK_TIndexedMapOfVtkId idMap; selector->GetIndex( actor->getIO(), idMap ); for ( int i = 1; i <= idMap.Extent(); i++ ) - myResult.push_back( idMap( i ) ); + myResult.push_back( (int)idMap( i ) ); } }; @@ -2047,12 +2047,12 @@ public: if ( !actor || !actor->hasIO() ) return; - SVTK_IndexedMapOfIds idMap; + SVTK_IndexedMapOfVtkIds idMap; selector->GetCompositeIndex( actor->getIO(), idMap ); for ( int i = 1; i <= idMap.Extent(); i++ ) { myResult.push_back( std::make_pair( (int)idMap(i)[0], (int)idMap(i)[1]) ); - } + } } }; diff --git a/src/StdMeshers/StdMeshers_AutomaticLength.cxx b/src/StdMeshers/StdMeshers_AutomaticLength.cxx index b9964faef..e5a89e7a9 100644 --- a/src/StdMeshers/StdMeshers_AutomaticLength.cxx +++ b/src/StdMeshers/StdMeshers_AutomaticLength.cxx @@ -365,7 +365,7 @@ bool StdMeshers_AutomaticLength::SetParametersByMesh(const SMESH_Mesh* theMesh SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edge ); if ( !eSubMesh ) return false; - int nbSeg = eSubMesh->NbElements(); + smIdType nbSeg = eSubMesh->NbElements(); if ( nbSeg < 1 ) continue; double segLen = L / nbSeg; diff --git a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx index 6b3e24ed4..cfca58a17 100644 --- a/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx +++ b/src/StdMeshers/StdMeshers_CartesianParameters3D.cxx @@ -331,13 +331,13 @@ void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double x0, const double p1 = x0 * ( 1. - points[i+1]) + x1 * points[i+1]; const double length = p1 - p0; - const size_t nbSections = 1000; + const int nbSections = 1000; const double sectionLen = ( p1 - p0 ) / nbSections; vector< double > nbSegments( nbSections + 1 ); nbSegments[ 0 ] = 0.; double t, spacing = 0; - for ( size_t i = 1; i <= nbSections; ++i ) + for ( int i = 1; i <= nbSections; ++i ) { t = double( i ) / nbSections; if ( !fun.value( t, spacing ) || spacing < std::numeric_limits::min() ) @@ -350,11 +350,11 @@ void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double x0, if ( coords.empty() ) coords.push_back( p0 ); - for ( size_t iCell = 1, i = 1; i <= nbSections; ++i ) + for ( int iCell = 1, j = 1; j <= nbSections; ++j ) { - if ( nbSegments[i]*corr >= iCell ) + if ( nbSegments[j]*corr >= iCell ) { - t = (i - ( nbSegments[i] - iCell/corr )/( nbSegments[i] - nbSegments[i-1] )) / nbSections; + t = (j - ( nbSegments[j] - iCell/corr )/( nbSegments[j] - nbSegments[j-1] )) / nbSections; coords.push_back( p0 + t * length ); ++iCell; } @@ -379,9 +379,9 @@ void StdMeshers_CartesianParameters3D::ComputeCoordinates(const double x0, const double tol = minLen * 1e-3; int iRem = -1; if (( iF > 1 ) && ( coords[iF] - coords[iF-1] < tol )) - iRem = iF-1; + iRem = (int) iF-1; else if (( iF < coords.size()-2 ) && ( coords[iF+1] - coords[iF] < tol )) - iRem = iF+1; + iRem = (int) iF+1; if ( iRem > 0 ) coords.erase( coords.begin() + iRem ); } diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index a741b0f01..223fb04d6 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -818,7 +818,7 @@ namespace }; vector< _nodeDef > _nodes; - vector< int > _quantities; + vector< int > _quantities; _volumeDef* _next; // to store several _volumeDefs in a chain TGeomID _solidID; const SMDS_MeshElement* _volume; // new volume @@ -5257,7 +5257,7 @@ namespace if ( loopsJoined ) { // set unchanged polygons - std::vector< int > newQuantities; + std::vector< int > newQuantities; std::vector< _volumeDef::_nodeDef > newNodes; vector< SMESH_Block::TShapeID > newNames; newQuantities.reserve( volDef->_quantities.size() ); diff --git a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx index 0324fc92a..26c4f3204 100644 --- a/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeHexa_3D.cxx @@ -124,7 +124,7 @@ public: bool Contain( const TopoDS_Vertex& vertex ) const; void AppendSide( const _FaceSide& side ); void SetBottomSide( int i ); - int GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges=0) const; + smIdType GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges=0) const; bool StoreNodes(SMESH_ProxyMesh& mesh, vector& myGrid, bool reverse, bool isProxy, const SMESHDS_SubMesh* smToCheckEdges=0 ); void SetID(EQuadSides id) { myID = id; } @@ -1121,32 +1121,32 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh& theMesh, lessComplexSide = & *face; // Get an 1D size of lessComplexSide - int nbSeg1 = 0; + smIdType nbSeg1 = 0; vector edges; if ( !lessComplexSide->GetHoriEdges(edges) ) return false; for ( size_t i = 0; i < edges.size(); ++i ) { - const vector& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )]; + const vector& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )]; if ( !nbElems.empty() ) - nbSeg1 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]); + nbSeg1 += std::max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]); } // Get an 1D size of a box side orthogonal to lessComplexSide - int nbSeg2 = 0; + smIdType nbSeg2 = 0; _QuadFaceGrid* ortoSide = lessComplexSide->FindAdjacentForSide( Q_LEFT, boxFaceContainer, B_UNDEFINED ); edges.clear(); if ( !ortoSide || !ortoSide->GetHoriEdges(edges) ) return false; for ( size_t i = 0; i < edges.size(); ++i ) { - const vector& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )]; + const vector& nbElems = aResMap[ theMesh.GetSubMesh( edges[i] )]; if ( !nbElems.empty() ) - nbSeg2 += Max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]); + nbSeg2 += std::max( nbElems[ SMDSEntity_Edge ], nbElems[ SMDSEntity_Quad_Edge ]); } // Get an 2D size of a box side orthogonal to lessComplexSide - int nbFaces = 0, nbQuadFace = 0; + smIdType nbFaces = 0, nbQuadFace = 0; list< TopoDS_Face > sideFaces; if ( ortoSide->IsComplex() ) for ( _QuadFaceGrid::TChildIterator child = ortoSide->GetChildren(); child.more(); ) @@ -1157,7 +1157,7 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh& theMesh, list< TopoDS_Face >::iterator f = sideFaces.begin(); for ( ; f != sideFaces.end(); ++f ) { - const vector& nbElems = aResMap[ theMesh.GetSubMesh( *f )]; + const vector& nbElems = aResMap[ theMesh.GetSubMesh( *f )]; if ( !nbElems.empty() ) { nbFaces = nbElems[ SMDSEntity_Quadrangle ]; @@ -1166,8 +1166,8 @@ bool StdMeshers_CompositeHexa_3D::Evaluate(SMESH_Mesh& theMesh, } // Fill nb of elements - vector aResVec(SMDSEntity_Last,0); - int nbSeg3 = ( nbFaces + nbQuadFace ) / nbSeg2; + vector aResVec(SMDSEntity_Last,0); + smIdType nbSeg3 = ( nbFaces + nbQuadFace ) / nbSeg2; aResVec[SMDSEntity_Node] = (nbSeg1-1) * (nbSeg2-1) * (nbSeg3-1); aResVec[SMDSEntity_Hexa] = nbSeg1 * nbFaces; aResVec[SMDSEntity_Quad_Hexa] = nbSeg1 * nbQuadFace; @@ -2229,9 +2229,9 @@ void _FaceSide::SetBottomSide( int i ) //purpose : //======================================================================= -int _FaceSide::GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges) const +smIdType _FaceSide::GetNbSegments(SMESH_ProxyMesh& mesh, const SMESHDS_SubMesh* smToCheckEdges) const { - int nb = 0; + smIdType nb = 0; if ( myChildren.empty() ) { nb = mesh.GetSubMesh(myEdge)->NbElements(); diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index 51907cd9d..e01cc1c00 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -156,7 +156,7 @@ double FunctionTable::integral( const double a, const double b ) const bool FunctionTable::findBounds( const double x, int& x_ind_1, int& x_ind_2 ) const { - int n = myData.size() / 2; + int n = (int) myData.size() / 2; if( n==0 || x& data, const double eps ) + const smIdType nbSeg, vector& data, const double eps ) { FunctionExpr F( f.ToCString(), conv ); return buildDistribution( F, start, end, nbSeg, data, eps ); } bool buildDistribution( const std::vector& f, const int conv, const double start, const double end, - const int nbSeg, vector& data, const double eps ) + const smIdType nbSeg, vector& data, const double eps ) { FunctionTable F( f, conv ); return buildDistribution( F, start, end, nbSeg, data, eps ); } -bool buildDistribution( const Function& func, const double start, const double end, const int nbSeg, - vector& data, const double eps ) +bool buildDistribution( const Function& func, const double start, const double end, + const smIdType nbSeg, vector& data, const double eps ) { if( nbSeg<=0 ) return false; data.resize( nbSeg+1 ); data[0] = start; - double J = func.integral( start, end ) / nbSeg; + double J = func.integral( start, end ) / double( nbSeg ); if( J<1E-10 ) return false; bool ok; //MESSAGE( "distribution:" ); //char buf[1024]; - for( int i=1; i #include +#include + namespace StdMeshers { class STDMESHERS_EXPORT Function @@ -105,15 +107,15 @@ private: STDMESHERS_EXPORT bool buildDistribution( const Function& f, const double start, const double end, - const int nbSeg, + const smIdType nbSeg, std::vector& data, const double eps ); STDMESHERS_EXPORT bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end, - const int nbSeg, std::vector& data, const double eps ); + const smIdType nbSeg, std::vector& data, const double eps ); STDMESHERS_EXPORT bool buildDistribution( const std::vector& f, const int conv, const double start, const double end, - const int nbSeg, std::vector& data, const double eps ); + const smIdType nbSeg, std::vector& data, const double eps ); } #endif diff --git a/src/StdMeshers/StdMeshers_FaceSide.cxx b/src/StdMeshers/StdMeshers_FaceSide.cxx index 0ebea3740..f18ed620d 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.cxx +++ b/src/StdMeshers/StdMeshers_FaceSide.cxx @@ -835,7 +835,7 @@ bool StdMeshers_FaceSide::GetEdgeNodes(size_t i, if ( mesh->HasModificationsToDiscard() ) // check nb of nodes on the EDGE sub-mesh { int iQuad = sm->NbElements() ? sm->GetElements()->next()->IsQuadratic() : 0; - int nbExpect = sm->NbElements() - 1 + iQuad * sm->NbElements(); + smIdType nbExpect = sm->NbElements() - 1 + iQuad * sm->NbElements(); if ( nbExpect != sm->NbNodes() ) // some nodes are moved from the EDGE by MergeNodes() { // add nodes of all segments @@ -1045,7 +1045,7 @@ void StdMeshers_FaceSide::SetIgnoreMediumNodes(bool toIgnore) // since creation of this side //======================================================================= -int StdMeshers_FaceSide::NbPoints(const bool update) const +smIdType StdMeshers_FaceSide::NbPoints(const bool update) const { if ( !myPoints.empty() ) return myPoints.size(); @@ -1112,7 +1112,7 @@ int StdMeshers_FaceSide::NbPoints(const bool update) const // since creation of this side //======================================================================= -int StdMeshers_FaceSide::NbSegments(const bool update) const +smIdType StdMeshers_FaceSide::NbSegments(const bool update) const { return NbPoints( update ), myNbSegments; } diff --git a/src/StdMeshers/StdMeshers_FaceSide.hxx b/src/StdMeshers/StdMeshers_FaceSide.hxx index 6f08cc57d..4ce9f6405 100644 --- a/src/StdMeshers/StdMeshers_FaceSide.hxx +++ b/src/StdMeshers/StdMeshers_FaceSide.hxx @@ -172,13 +172,13 @@ public: * Call it with update == true if mesh of this side can be recomputed * since creation of this side */ - int NbPoints(const bool update = false) const; + smIdType NbPoints(const bool update = false) const; /*! * \brief Return nb edges * Call it with update == true if mesh of this side can be recomputed * since creation of this side */ - int NbSegments(const bool update = false) const; + smIdType NbSegments(const bool update = false) const; /*! * \brief Return mesh */ @@ -255,7 +255,7 @@ public: /*! * \brief Return nb of wrapped edges */ - int NbEdges() const { return myEdge.size(); } + int NbEdges() const { return (int)myEdge.size(); } /*! * \brief Return i-th edge (count starts from zero) */ @@ -346,7 +346,7 @@ protected: std::vector myEdgeLength; std::vector myIsUniform; double myLength; - int myNbPonits, myNbSegments; + smIdType myNbPonits, myNbSegments; SMESH_ProxyMesh::Ptr myProxyMesh; bool myMissingVertexNodes, myIgnoreMediumNodes; gp_Pnt2d myDefaultPnt2d; @@ -364,7 +364,7 @@ protected: inline int StdMeshers_FaceSide::EdgeIndex( double U ) const { - int i = myNormPar.size() - 1; + int i = (int)myNormPar.size() - 1; while ( i > 0 && U < myNormPar[ i-1 ] ) --i; return i; } diff --git a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx index 9a1343e5f..d7ea1d2ae 100644 --- a/src/StdMeshers/StdMeshers_FixedPoints1D.cxx +++ b/src/StdMeshers/StdMeshers_FixedPoints1D.cxx @@ -62,20 +62,26 @@ StdMeshers_FixedPoints1D::~StdMeshers_FixedPoints1D() void StdMeshers_FixedPoints1D::SetPoints(const std::vector& listParams) { - _params = listParams; - NotifySubMeshesHypothesisModification(); + if ( _params != listParams ) + { + _params = listParams; + NotifySubMeshesHypothesisModification(); + } } //============================================================================= /*! - * + * */ //============================================================================= -void StdMeshers_FixedPoints1D::SetNbSegments(const std::vector& listNbSeg) +void StdMeshers_FixedPoints1D::SetNbSegments(const std::vector& listNbSeg) { - _nbsegs = listNbSeg; - NotifySubMeshesHypothesisModification(); + if ( _nbsegs != listNbSeg ) + { + _nbsegs = listNbSeg; + NotifySubMeshesHypothesisModification(); + } } ostream & StdMeshers_FixedPoints1D::SaveTo(ostream & save) @@ -113,7 +119,7 @@ ostream & StdMeshers_FixedPoints1D::SaveTo(ostream & save) istream & StdMeshers_FixedPoints1D::LoadFrom(istream & load) { bool isOK = true; - int intVal; + smIdType intVal; double dblVal; isOK = static_cast(load >> intVal); diff --git a/src/StdMeshers/StdMeshers_FixedPoints1D.hxx b/src/StdMeshers/StdMeshers_FixedPoints1D.hxx index 431ef1e9e..d7540a64c 100644 --- a/src/StdMeshers/StdMeshers_FixedPoints1D.hxx +++ b/src/StdMeshers/StdMeshers_FixedPoints1D.hxx @@ -25,13 +25,12 @@ #ifndef _SMESH_FIXEDPOINTS1D_HXX_ #define _SMESH_FIXEDPOINTS1D_HXX_ - - #include "SMESH_StdMeshers.hxx" #include "StdMeshers_Reversible1D.hxx" #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" +#include #include @@ -43,11 +42,11 @@ public: void SetPoints(const std::vector& listParams); - void SetNbSegments(const std::vector& listNbSeg) ; + void SetNbSegments(const std::vector& listNbSeg) ; const std::vector& GetPoints() const { return _params; } - const std::vector& GetNbSegments() const { return _nbsegs; } + const std::vector& GetNbSegments() const { return _nbsegs; } virtual std::ostream & SaveTo(std::ostream & save); virtual std::istream & LoadFrom(std::istream & load); @@ -66,9 +65,9 @@ public: */ virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); -protected: - std::vector _params; - std::vector _nbsegs; + protected: + std::vector _params; + std::vector _nbsegs; }; #endif diff --git a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx index bc1a2c98e..c34d7e88d 100644 --- a/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx +++ b/src/StdMeshers/StdMeshers_HexaFromSkin_3D.cxx @@ -349,7 +349,7 @@ namespace // Find all block sides starting from mesh faces sharing the corner node // -------------------------------------------------------------------- - int nbFacesOnSides = 0; + smIdType nbFacesOnSides = 0; TIDSortedElemSet cornerFaces; // corner faces of found _BlockSide's list< const SMDS_MeshNode* > corners( 1, nCorner ); list< const SMDS_MeshNode* >::iterator corner = corners.begin(); @@ -1200,7 +1200,7 @@ bool StdMeshers_HexaFromSkin_3D::Evaluate(SMESH_Mesh & aMesh, bool secondOrder = aMesh.NbFaces( ORDER_QUADRATIC ); int entity = secondOrder ? SMDSEntity_Quad_Hexa : SMDSEntity_Hexa; - vector& nbByType = aResMap[ aMesh.GetSubMesh( aShape )]; + vector& nbByType = aResMap[ aMesh.GetSubMesh( aShape )]; if ( entity >= (int) nbByType.size() ) nbByType.resize( SMDSEntity_Last, 0 ); diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 43e013377..0bef7040f 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -689,7 +689,7 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh & aMesh, // check if the loaded grid corresponds to nb of quadrangles on the FACE const SMESHDS_SubMesh* faceSubMesh = proxymesh ? proxymesh->GetSubMesh( F ) : meshDS->MeshElements( F ); - const int nbQuads = faceSubMesh->NbElements(); + const smIdType nbQuads = faceSubMesh->NbElements(); const int nbHor = aCubeSide[i]._u2nodesMap.size() - 1; const int nbVer = aCubeSide[i]._u2nodesMap.begin()->second.size() - 1; ok = ( nbQuads == nbHor * nbVer ); @@ -988,7 +988,7 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh, TopoDS_Shape aFace = aFaces.Value(i+1); SMESH_Algo *algo = _gen->GetAlgo(aMesh, aFace); if( !algo ) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec = (*anIt).second; - int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + std::vector aVec = (*anIt).second; + smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); if( nbtri == 0 ) isAllQuad = true; } @@ -1022,8 +1022,8 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh, if( sm ) { MapShapeNbElemsItr anIt = aResMap.find(sm); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + std::vector aVec = (*anIt).second; + nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); if(IsFirst) { IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]); IsFirst = false; @@ -1051,20 +1051,20 @@ bool StdMeshers_Hexa_3D::Evaluate(SMESH_Mesh & aMesh, if( i == OppNum ) continue; MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] ); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } MapShapeNbElemsItr anIt = aResMap.find( meshFaces[0] ); - std::vector aVec = (*anIt).second; - int nb2d_face0 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); - int nb0d_face0 = aVec[SMDSEntity_Node]; + std::vector aVec = (*anIt).second; + smIdType nb2d_face0 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + smIdType nb0d_face0 = aVec[SMDSEntity_Node]; - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec(SMDSEntity_Last,0); + vector aVec(SMDSEntity_Last,0); bool toCopyMesh, toCopyGroups; _sourceHyp->GetCopySourceMesh(toCopyMesh, toCopyGroups); diff --git a/src/StdMeshers/StdMeshers_Import_1D2D.cxx b/src/StdMeshers/StdMeshers_Import_1D2D.cxx index 30f3d163c..4d8849cf3 100644 --- a/src/StdMeshers/StdMeshers_Import_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D2D.cxx @@ -823,7 +823,7 @@ bool StdMeshers_Import_1D2D::Evaluate(SMESH_Mesh & theMesh, if ( srcGroups.empty() ) return error("Invalid source groups"); - vector aVec(SMDSEntity_Last,0); + vector aVec(SMDSEntity_Last,0); bool toCopyMesh, toCopyGroups; _sourceHyp->GetCopySourceMesh(toCopyMesh, toCopyGroups); @@ -913,7 +913,7 @@ bool StdMeshers_Import_1D2D::Evaluate(SMESH_Mesh & theMesh, { TopoDS_Edge geomEdge = TopoDS::Edge( exp.Current() ); SMESH_subMesh* sm = theMesh.GetSubMesh( geomEdge ); - vector& edgeVec = aResMap[sm]; + vector& edgeVec = aResMap[sm]; if ( edgeVec.empty() ) { edgeVec.resize(SMDSEntity_Last,0); diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx index 0e0c0beea..fe2afe3ef 100644 --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx @@ -318,7 +318,7 @@ bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh, TopoDS_Edge E = TopoDS::Edge(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find( aMesh.GetSubMesh(E) ); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; int nbe = Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); NbSeg += nbe; if(IsFirst) { @@ -339,7 +339,7 @@ bool StdMeshers_MEFISTO_2D::Evaluate(SMESH_Mesh & aMesh, } } if(NbSeg<1) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec(SMDSEntity_Last); + std::vector aVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i& tab, */ //============================================================================= -void StdMeshers_NumberOfSegments::SetNumberOfSegments(int segmentsNumber) +void StdMeshers_NumberOfSegments::SetNumberOfSegments(smIdType segmentsNumber) { - int oldNumberOfSegments = _numberOfSegments; + smIdType oldNumberOfSegments = _numberOfSegments; if (segmentsNumber <= 0) throw SALOME_Exception(LOCALIZED("number of segments must be positive")); _numberOfSegments = segmentsNumber; @@ -126,7 +126,7 @@ void StdMeshers_NumberOfSegments::SetNumberOfSegments(int segmentsNumber) */ //============================================================================= -int StdMeshers_NumberOfSegments::GetNumberOfSegments() const +smIdType StdMeshers_NumberOfSegments::GetNumberOfSegments() const { return _numberOfSegments; } @@ -477,7 +477,7 @@ int StdMeshers_NumberOfSegments::ConversionMode() const ostream & StdMeshers_NumberOfSegments::SaveTo(ostream & save) { - int listSize = _edgeIDs.size(); + size_t listSize = _edgeIDs.size(); save << _numberOfSegments << " " << (int)_distrType; switch (_distrType) { @@ -502,7 +502,7 @@ ostream & StdMeshers_NumberOfSegments::SaveTo(ostream & save) if ( _distrType != DT_Regular && listSize > 0 ) { save << " " << listSize; - for ( int i = 0; i < listSize; i++ ) + for ( size_t i = 0; i < listSize; i++ ) save << " " << _edgeIDs[i]; save << " " << _objEntry; } diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx index c726488ea..80becbbbc 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx @@ -33,6 +33,8 @@ #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" +#include + #include /*! @@ -55,12 +57,12 @@ public: * \brief Set the number of segments * \param segmentsNumber - must be greater than zero */ - void SetNumberOfSegments(int segmentsNumber); + void SetNumberOfSegments(smIdType segmentsNumber); /*! * \brief Get the number of segments */ - int GetNumberOfSegments() const; + smIdType GetNumberOfSegments() const; /*! * \brief This enumeration presents available types of distribution @@ -179,7 +181,7 @@ public: friend std::istream& operator >> (std::istream & load, StdMeshers_NumberOfSegments & hyp); protected: - int _numberOfSegments; //!< an edge will be split on to this number of segments + smIdType _numberOfSegments; //!< an edge will be split on to this number of segments DistrType _distrType; //!< the type of distribution of density function double _scaleFactor; //!< the scale parameter for DT_Scale std::vector _table, _distr; //!< the table for DT_TabFunc, a sequence of pairs of numbers diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index 7dd933b0d..2b5132de2 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -147,7 +147,8 @@ bool StdMeshers_Penta_3D::Compute(SMESH_Mesh& aMesh, void StdMeshers_Penta_3D::MakeNodes() { const int aNbSIDs=9; - int i, j, k, ij, iNbN, aNodeID, aSize, iErr; + int i, j, k, ij, aSize, iErr; + smIdType iNbN, aNodeID; double aX, aY, aZ; SMESH_Block::TShapeID aSID, aSIDs[aNbSIDs]={ SMESH_Block::ID_V000, SMESH_Block::ID_V100, @@ -655,7 +656,8 @@ void StdMeshers_Penta_3D::MakeVolumeMesh() } // // 2. Make pentahedrons - int aID0, k , aJ[4]; + smIdType aID0; + int k , aJ[4]; vector aN; // SMDS_ElemIteratorPtr itf, aItNodes; @@ -766,7 +768,8 @@ void StdMeshers_Penta_3D::MakeVolumeMesh() //======================================================================= void StdMeshers_Penta_3D::MakeMeshOnFxy1() { - int aID0, aJ, aLevel, ij, aNbNodes, k; + int aJ, aLevel, ij, k; + smIdType aID0, aNbNodes; // SMDS_NodeIteratorPtr itn; SMDS_ElemIteratorPtr itf, aItNodes; @@ -1109,12 +1112,12 @@ void StdMeshers_Penta_3D::MakeBlock() int iNbF = aM.Extent(); if (iNbF == 6) { // - int nb_f1 = pMesh->GetSubMeshContaining(aM(1))->GetSubMeshDS()->NbElements(); - int nb_f2 = pMesh->GetSubMeshContaining(aM(2))->GetSubMeshDS()->NbElements(); - int nb_f3 = pMesh->GetSubMeshContaining(aM(3))->GetSubMeshDS()->NbElements(); - int nb_f4 = pMesh->GetSubMeshContaining(aM(4))->GetSubMeshDS()->NbElements(); - int nb_f5 = pMesh->GetSubMeshContaining(aM(5))->GetSubMeshDS()->NbElements(); - int nb_f6 = pMesh->GetSubMeshContaining(aM(6))->GetSubMeshDS()->NbElements(); + smIdType nb_f1 = pMesh->GetSubMeshContaining(aM(1))->GetSubMeshDS()->NbElements(); + smIdType nb_f2 = pMesh->GetSubMeshContaining(aM(2))->GetSubMeshDS()->NbElements(); + smIdType nb_f3 = pMesh->GetSubMeshContaining(aM(3))->GetSubMeshDS()->NbElements(); + smIdType nb_f4 = pMesh->GetSubMeshContaining(aM(4))->GetSubMeshDS()->NbElements(); + smIdType nb_f5 = pMesh->GetSubMeshContaining(aM(5))->GetSubMeshDS()->NbElements(); + smIdType nb_f6 = pMesh->GetSubMeshContaining(aM(6))->GetSubMeshDS()->NbElements(); // int has_only_quad_f1 = 1; int has_only_quad_f2 = 1; @@ -1153,18 +1156,18 @@ void StdMeshers_Penta_3D::MakeBlock() int iNbE = aE.Extent(); if (iNbE == 12) { // - int nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements(); - int nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements(); - int nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements(); - int nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements(); - int nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements(); - int nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements(); - int nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements(); - int nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements(); - int nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements(); - int nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements(); - int nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements(); - int nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements(); + smIdType nb_e01 = pMesh->GetSubMeshContaining(aE(1))->GetSubMeshDS()->NbElements(); + smIdType nb_e02 = pMesh->GetSubMeshContaining(aE(2))->GetSubMeshDS()->NbElements(); + smIdType nb_e03 = pMesh->GetSubMeshContaining(aE(3))->GetSubMeshDS()->NbElements(); + smIdType nb_e04 = pMesh->GetSubMeshContaining(aE(4))->GetSubMeshDS()->NbElements(); + smIdType nb_e05 = pMesh->GetSubMeshContaining(aE(5))->GetSubMeshDS()->NbElements(); + smIdType nb_e06 = pMesh->GetSubMeshContaining(aE(6))->GetSubMeshDS()->NbElements(); + smIdType nb_e07 = pMesh->GetSubMeshContaining(aE(7))->GetSubMeshDS()->NbElements(); + smIdType nb_e08 = pMesh->GetSubMeshContaining(aE(8))->GetSubMeshDS()->NbElements(); + smIdType nb_e09 = pMesh->GetSubMeshContaining(aE(9))->GetSubMeshDS()->NbElements(); + smIdType nb_e10 = pMesh->GetSubMeshContaining(aE(10))->GetSubMeshDS()->NbElements(); + smIdType nb_e11 = pMesh->GetSubMeshContaining(aE(11))->GetSubMeshDS()->NbElements(); + smIdType nb_e12 = pMesh->GetSubMeshContaining(aE(12))->GetSubMeshDS()->NbElements(); // int nb_ok = 0 ; // @@ -1417,11 +1420,11 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, if ( sm1->NbNodes() * smb->NbNodes() != smFace->NbNodes() ) { // check quadratic case if ( myCreateQuadratic ) { - int n1 = sm1->NbNodes()/2; - int n2 = smb->NbNodes()/2; - int n3 = sm1->NbNodes() - n1; - int n4 = smb->NbNodes() - n2; - int nf = sm1->NbNodes()*smb->NbNodes() - n3*n4; + smIdType n1 = sm1->NbNodes()/2; + smIdType n2 = smb->NbNodes()/2; + smIdType n3 = sm1->NbNodes() - n1; + smIdType n4 = smb->NbNodes() - n2; + smIdType nf = sm1->NbNodes()*smb->NbNodes() - n3*n4; if( nf != smFace->NbNodes() ) { MESSAGE( "Wrong nb face nodes: " << sm1->NbNodes()<<" "<NbNodes()<<" "<NbNodes()); @@ -1435,8 +1438,8 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, } } // IJ size - int vsize = sm1->NbNodes() + 2; - int hsize = smb->NbNodes() + 2; + smIdType vsize = sm1->NbNodes() + 2; + smIdType hsize = smb->NbNodes() + 2; if(myCreateQuadratic) { vsize = vsize - sm1->NbNodes()/2 -1; hsize = hsize - smb->NbNodes()/2 -1; @@ -1870,16 +1873,16 @@ bool StdMeshers_Penta_3D::Evaluate(SMESH_Mesh& aMesh, NumBase = 0; break; } - std::vector aVec = (*anIt).second; - int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - int nbqua = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + smIdType nbqua = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); if( nbtri>0 && nbqua==0 ) { NumBase = i; } } if(NumBase==0) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec = (*anIt).second; - nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + std::vector aVec = (*anIt).second; + nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); } } // find face opposite to base face @@ -1923,14 +1926,14 @@ bool StdMeshers_Penta_3D::Evaluate(SMESH_Mesh& aMesh, if( i==OppNum || i==NumBase ) continue; MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] ); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] ); - std::vector aVec = (*anIt).second; - int nb2d_face0 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); - int nb0d_face0 = aVec[SMDSEntity_Node]; + std::vector aVec = (*anIt).second; + smIdType nb2d_face0 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + smIdType nb0d_face0 = aVec[SMDSEntity_Node]; anIt = aResMap.find( meshFaces[OppNum-1] ); for(i=SMDSEntity_Node; i aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; isecond.at( SMDSEntity_Quad_Edge ); } - std::vector aVec( SMDSEntity_Last, 0 ); + std::vector aVec( SMDSEntity_Last, 0 ); switch ( nbLinSegs + nbQuadSegs ) { case 3: aVec[ nbQuadSegs ? SMDSEntity_Quad_Triangle : SMDSEntity_Triangle ] = 1; diff --git a/src/StdMeshers/StdMeshers_PolyhedronPerSolid_3D.cxx b/src/StdMeshers/StdMeshers_PolyhedronPerSolid_3D.cxx index b8e108958..f95224b1e 100644 --- a/src/StdMeshers/StdMeshers_PolyhedronPerSolid_3D.cxx +++ b/src/StdMeshers/StdMeshers_PolyhedronPerSolid_3D.cxx @@ -576,7 +576,7 @@ bool StdMeshers_PolyhedronPerSolid_3D::Evaluate(SMESH_Mesh& theMesh, case TopAbs_FACE: { myFaceMesher->Evaluate( theMesh, shape, theResMap ); - std::vector & quantities = theResMap[ sm ]; + std::vector & quantities = theResMap[ sm ]; _quadraticMesh = ( !quantities.empty() && ( quantities[ SMDSEntity_Quad_Triangle ] + quantities[ SMDSEntity_Quad_Quadrangle ] + @@ -586,7 +586,7 @@ bool StdMeshers_PolyhedronPerSolid_3D::Evaluate(SMESH_Mesh& theMesh, case TopAbs_SOLID: { - std::vector & quantities = theResMap[ sm ]; + std::vector & quantities = theResMap[ sm ]; quantities.resize( SMDSEntity_Last, 0 ); SMESH_MesherHelper helper( theMesh ); diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx index 2cc5ae67a..9f800693e 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.cxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -554,7 +554,7 @@ namespace { SMESH_subMesh* faceSm = *smIt; SMESHDS_SubMesh* faceSmDS = faceSm->GetSubMeshDS(); - int nbQuads = faceSmDS ? faceSmDS->NbElements() : 0; + smIdType nbQuads = faceSmDS ? faceSmDS->NbElements() : 0; bool toRemove; if ( nbQuads > 0 ) toRemove = helper->IsStructured( faceSm ); @@ -1025,7 +1025,7 @@ bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theSh SMESH_subMesh* faceSM = theMesh.GetSubMesh( face ); if ( !faceSM->IsEmpty() ) { - int nbFaces = faceSM->GetSubMeshDS()->NbElements(); + smIdType nbFaces = faceSM->GetSubMeshDS()->NbElements(); if ( prevNbFaces < nbFaces ) { if ( !meshedFaces.empty() ) meshedFaces.pop_back(); @@ -1749,7 +1749,7 @@ bool StdMeshers_Prism_3D::computeWalls(const Prism_3D::TPrismTopo& thePrism) } // assure that all the source (left) EDGEs are meshed - int nbSrcSegments = 0; + smIdType nbSrcSegments = 0; for ( int i = 0; i < lftSide->NbEdges(); ++i ) { if ( isArtificialQuad ) @@ -2146,9 +2146,9 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, if( anIt==aResMap.end() ) return toSM( error( "Submesh can not be evaluated")); - std::vector aVec = (*anIt).second; - int nbtri = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - int nbqua = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + smIdType nbtri = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + smIdType nbqua = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); if( nbtri==0 && nbqua>0 ) { NbQFs++; } @@ -2158,7 +2158,7 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, } if(NbQFs<4) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i set 1 faces as base // find number of 1d elems for base face - int nb1d = 0; + smIdType nb1d = 0; TopTools_MapOfShape Edges1; for (TopExp_Explorer exp(aFaces.Value(NumBase), TopAbs_EDGE); exp.More(); exp.Next()) { Edges1.Add(exp.Current()); @@ -2176,8 +2176,8 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, if( sm ) { MapShapeNbElemsItr anIt = aResMap.find(sm); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb1d += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + std::vector aVec = (*anIt).second; + nb1d += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); } } // find face opposite to base face @@ -2197,25 +2197,25 @@ bool StdMeshers_Prism_3D::Evaluate(SMESH_Mesh& theMesh, } } // find number of 2d elems on side faces - int nb2d = 0; + smIdType nb2d = 0; for(i=1; i<=6; i++) { if( i==OppNum || i==NumBase ) continue; MapShapeNbElemsItr anIt = aResMap.find( meshFaces[i-1] ); if( anIt == aResMap.end() ) continue; - std::vector aVec = (*anIt).second; - nb2d += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + std::vector aVec = (*anIt).second; + nb2d += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } MapShapeNbElemsItr anIt = aResMap.find( meshFaces[NumBase-1] ); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; bool IsQuadratic = (aVec[SMDSEntity_Quad_Triangle]>aVec[SMDSEntity_Triangle]) || (aVec[SMDSEntity_Quad_Quadrangle]>aVec[SMDSEntity_Quadrangle]); - int nb2d_face0_3 = Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - int nb2d_face0_4 = Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); - int nb0d_face0 = aVec[SMDSEntity_Node]; - int nb1d_face0_int = ( nb2d_face0_3*3 + nb2d_face0_4*4 - nb1d ) / 2; + smIdType nb2d_face0_3 = std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + smIdType nb2d_face0_4 = std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + smIdType nb0d_face0 = aVec[SMDSEntity_Node]; + smIdType nb1d_face0_int = ( nb2d_face0_3*3 + nb2d_face0_4*4 - nb1d ) / 2; - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; ibegin(); for ( ; bN_tN != n2nMapPtr->end(); ++bN_tN ) { @@ -2556,7 +2556,7 @@ bool StdMeshers_Prism_3D::projectBottomToTop( const gp_Trsf & bottom // Fill myBotToColumnMap - int zSize = myBlock.VerticalSize(); + size_t zSize = myBlock.VerticalSize(); Prism_3D::TNode prevTNode; SMDS_NodeIteratorPtr nIt = botSMDS->GetNodes(); while ( nIt->more() ) @@ -3911,7 +3911,7 @@ bool StdMeshers_PrismAsBlock::Init(SMESH_MesherHelper* helper, return error(COMPERR_BAD_INPUT_MESH, TCom("Can't find regular quadrangle mesh ") << "on a side face #" << MeshDS()->ShapeToIndex( (*quad)->face )); } - if ( !faceColumns.empty() && (int)faceColumns.begin()->second.size() != VerticalSize() ) + if ( !faceColumns.empty() && faceColumns.begin()->second.size() != VerticalSize() ) return error(COMPERR_BAD_INPUT_MESH, "Different 'vertical' discretization"); // edge columns @@ -4227,7 +4227,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector & const Prism_3D::TPrismTopo& prism) const { const bool itTopMeshed = !SubMesh( ID_BOT_FACE )->IsEmpty(); - const int zSize = VerticalSize(); + const size_t zSize = VerticalSize(); if ( zSize < 3 && !itTopMeshed ) return true; trsf.resize( zSize - 1 ); @@ -4274,7 +4274,7 @@ bool StdMeshers_PrismAsBlock::GetLayersTransformation(vector & gp_Ax3 cs0 = getLayerCoordSys(0, columns, xCol ); //double dist0 = cs0.Location().Distance( gpXYZ( (*columns[0])[0])); toCs0.SetTransformation( cs0 ); - for ( int z = 1; z < zSize; ++z ) + for ( size_t z = 1; z < zSize; ++z ) { gp_Ax3 csZ = getLayerCoordSys(z, columns, xCol ); //double distZ = csZ.Location().Distance( gpXYZ( (*columns[0])[z])); @@ -5615,7 +5615,7 @@ bool StdMeshers_Sweeper::ComputeNodesOnStraight() int botTriaNodes[3], topTriaNodes[3]; bool checkUV = true; - int nbInternalNodes = myIntColumns.size(); + size_t nbInternalNodes = myIntColumns.size(); myBotDelaunay->InitTraversal( nbInternalNodes ); while (( botNode = myBotDelaunay->NextNode( botBC, botTriaNodes ))) @@ -5764,7 +5764,7 @@ bool StdMeshers_Sweeper::findDelaunayTriangles() TopBotTriangles tbTrias; bool checkUV = true; - int nbInternalNodes = myIntColumns.size(); + size_t nbInternalNodes = myIntColumns.size(); myTopBotTriangles.resize( nbInternalNodes ); myBotDelaunay->InitTraversal( nbInternalNodes ); diff --git a/src/StdMeshers/StdMeshers_Prism_3D.hxx b/src/StdMeshers/StdMeshers_Prism_3D.hxx index 850e01ee0..35b7f422f 100644 --- a/src/StdMeshers/StdMeshers_Prism_3D.hxx +++ b/src/StdMeshers/StdMeshers_Prism_3D.hxx @@ -154,7 +154,7 @@ class STDMESHERS_EXPORT StdMeshers_PrismAsBlock: public SMESH_Block * \brief Return number of nodes on every vertical edge * \retval int - number of nodes including end nodes */ - int VerticalSize() const { return myParam2ColumnMaps[0].begin()->second.size(); } + size_t VerticalSize() const { return myParam2ColumnMaps[0].begin()->second.size(); } bool HasNotQuadElemOnTop() const { return myNotQuadOnTop; } diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 7760791b5..10118e920 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -2873,7 +2873,7 @@ namespace StdMeshers_ProjectionUtils const SMDS_MeshNode *srcNode, *tgtNode; // un-mark internal src nodes in order iterate them using _delaunay - int nbSrcNodes = 0; + smIdType nbSrcNodes = 0; SMDS_NodeIteratorPtr nIt = _srcSubMesh->GetSubMeshDS()->GetNodes(); if ( !nIt || !nIt->more() ) return true; if ( moveAll ) diff --git a/src/StdMeshers/StdMeshers_Projection_1D.cxx b/src/StdMeshers/StdMeshers_Projection_1D.cxx index 143820ee6..177434b15 100644 --- a/src/StdMeshers/StdMeshers_Projection_1D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_1D.cxx @@ -448,7 +448,7 @@ bool StdMeshers_Projection_1D::Evaluate(SMESH_Mesh& theMesh, int nbNodes = params.size(); - std::vector aVec(SMDSEntity_Last); + std::vector aVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; iGetSubShape().ShapeType(); if ( shapeType == TopAbs_EDGE ) { - std::vector aVec; + std::vector aVec; SMESHDS_SubMesh* srcSubMeshDS = srcSM->GetSubMeshDS(); if ( srcSubMeshDS && srcSubMeshDS->NbElements() ) { diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx index cbf06a4f2..da00f937e 100644 --- a/src/StdMeshers/StdMeshers_Projection_2D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -1216,7 +1216,7 @@ namespace { tgtNbEW.front() != 4 || srcNbEW.front() != 4 ) return; // not quads - int srcNbSeg[4]; + smIdType srcNbSeg[4]; list< TopoDS_Edge >::iterator edgeS = srcEdges.begin(), edgeT = tgtEdges.begin(); for ( int i = 0; edgeS != srcEdges.end(); ++i, ++edgeS ) if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( *edgeS )) @@ -1891,7 +1891,7 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& // compare nb nodes on srcEdge1 and srcEdge2 if ( srcEdge2 != srcEdges.end() ) { - int nbN1 = 0, nbN2 = 0; + smIdType nbN1 = 0, nbN2 = 0; if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( srcEdge1 )) nbN1 = sm->NbNodes(); if ( SMESHDS_SubMesh* sm = srcMesh->GetMeshDS()->MeshElements( *srcEdge2 )) @@ -2113,9 +2113,9 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& // Merge SMESH_MeshEditor editor( tgtMesh ); - int nbFaceBeforeMerge = tgtSubMesh->GetSubMeshDS()->NbElements(); + smIdType nbFaceBeforeMerge = tgtSubMesh->GetSubMeshDS()->NbElements(); editor.MergeNodes( groupsOfNodes ); - int nbFaceAtferMerge = tgtSubMesh->GetSubMeshDS()->NbElements(); + smIdType nbFaceAtferMerge = tgtSubMesh->GetSubMeshDS()->NbElements(); if ( nbFaceBeforeMerge != nbFaceAtferMerge && !helper.HasDegeneratedEdges() ) return error(COMPERR_BAD_INPUT_MESH, "Probably invalid node parameters on geom faces"); @@ -2243,7 +2243,7 @@ bool StdMeshers_Projection_2D::Evaluate(SMESH_Mesh& theMesh, // Assure that mesh on a source Face is computed/evaluated // ------------------------------------------------------- - std::vector aVec; + std::vector aVec; SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcFace ); if ( srcSubMesh->IsMeshComputed() ) diff --git a/src/StdMeshers/StdMeshers_Projection_3D.cxx b/src/StdMeshers/StdMeshers_Projection_3D.cxx index 7ba244c2b..a19676529 100644 --- a/src/StdMeshers/StdMeshers_Projection_3D.cxx +++ b/src/StdMeshers/StdMeshers_Projection_3D.cxx @@ -475,7 +475,7 @@ bool StdMeshers_Projection_3D::Evaluate(SMESH_Mesh& aMesh, return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed"); - std::vector aVec(SMDSEntity_Last); + std::vector aVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; iGetSubMeshDS()->NbNodes(); diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx index fe4fc5c35..095473c52 100644 --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx @@ -1720,8 +1720,8 @@ namespace if ( isComputed[ edgeIDs1[i]] && isComputed[ edgeIDs2[i]] ) { - int nbNodes1 = meshDS->MeshElements(edgeIDs[ edgeIDs1[i]] )->NbNodes(); - int nbNodes2 = meshDS->MeshElements(edgeIDs[ edgeIDs2[i]] )->NbNodes(); + smIdType nbNodes1 = meshDS->MeshElements(edgeIDs[ edgeIDs1[i]] )->NbNodes(); + smIdType nbNodes2 = meshDS->MeshElements(edgeIDs[ edgeIDs2[i]] )->NbNodes(); if ( nbNodes1 != nbNodes2 ) return false; if (( int(i)-1 >= 0 ) && diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index 5f4796266..cc392f692 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -917,7 +917,7 @@ bool StdMeshers_Quadrangle_2D::Evaluate(SMESH_Mesh& aMesh, std::vector aNbNodes(4); bool IsQuadratic = false; if (!checkNbEdgesForEvaluate(aMesh, aFace, aResMap, aNbNodes, IsQuadratic)) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for (int i=SMDSEntity_Node; i aVec(SMDSEntity_Last,0); + std::vector aVec(SMDSEntity_Last,0); if (IsQuadratic) { aVec[SMDSEntity_Quad_Triangle] = nbFaces3; aVec[SMDSEntity_Quad_Quadrangle] = nbFaces4; @@ -1531,7 +1531,7 @@ int StdMeshers_Quadrangle_2D::getCorners(const TopoDS_Face& theFace, if ( theConsiderMesh ) { - const int nbSegments = Max( faceSide.NbPoints()-1, faceSide.NbSegments() ); + const smIdType nbSegments = std::max( faceSide.NbPoints()-1, faceSide.NbSegments() ); if ( nbSegments < nbCorners ) return error(COMPERR_BAD_INPUT_MESH, TComm("Too few boundary nodes: ") << nbSegments); } @@ -1768,7 +1768,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes if (anIt==aResMap.end()) { return false; } - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]); if (nbEdgesInWire.front() == 3) { // exactly 3 edges if (myTriaVertexID>0) { @@ -1790,7 +1790,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes SMESH_subMesh * sm = aMesh.GetSubMesh(E1); MapShapeNbElemsItr anIt = aResMap.find(sm); if (anIt==aResMap.end()) return false; - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; if (IsQuadratic) aNbNodes[0] = (aVec[SMDSEntity_Node]-1)/2 + 2; else @@ -1824,7 +1824,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes if (anIt==aResMap.end()) { return false; } - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; if (IsQuadratic) aNbNodes[nbSides] = (aVec[SMDSEntity_Node]-1)/2 + 2; else @@ -1861,7 +1861,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes if (anIt==aResMap.end()) { return false; } - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; if (IsQuadratic) aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1; else @@ -1902,7 +1902,7 @@ bool StdMeshers_Quadrangle_2D::checkNbEdgesForEvaluate(SMESH_Mesh& aMes if (anIt==aResMap.end()) { return false; } - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; if (IsQuadratic) aNbNodes[nbSides] += (aVec[SMDSEntity_Node]-1)/2 + 1; else @@ -3179,7 +3179,7 @@ bool StdMeshers_Quadrangle_2D::evaluateQuadPref(SMESH_Mesh & aMesh, nbFaces += (drl+addv)*(nb-1) + (nt-1); } // end new version implementation - std::vector aVec(SMDSEntity_Last); + std::vector aVec(SMDSEntity_Last); for (int i=SMDSEntity_Node; i aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_Out += aVec[SMDSEntity_Node]; - nb2d_3_Out += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - nb2d_4_Out += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + nb2d_3_Out += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + nb2d_4_Out += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } - int nb1d_Out = 0; + smIdType nb1d_Out = 0; TopTools_MapOfShape tmpMap; for (TopExp_Explorer exp(outerShell, TopAbs_EDGE); exp.More(); exp.Next()) { if( tmpMap.Contains( exp.Current() ) ) @@ -479,9 +479,9 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, tmpMap.Add( exp.Current() ); SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find(aSubMesh); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_Out += aVec[SMDSEntity_Node]; - nb1d_Out += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + nb1d_Out += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); } tmpMap.Clear(); for (TopExp_Explorer exp(outerShell, TopAbs_VERTEX); exp.More(); exp.Next()) { @@ -492,18 +492,18 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, } // get info for inner shell - int nb0d_In=0, nb2d_3_In=0, nb2d_4_In=0; + smIdType nb0d_In=0, nb2d_3_In=0, nb2d_4_In=0; //TopTools_SequenceOfShape FacesIn; for (TopExp_Explorer exp(innerShell, TopAbs_FACE); exp.More(); exp.Next()) { //FacesIn.Append(exp.Current()); SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find(aSubMesh); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_In += aVec[SMDSEntity_Node]; - nb2d_3_In += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); - nb2d_4_In += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); + nb2d_3_In += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]); + nb2d_4_In += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]); } - int nb1d_In = 0; + smIdType nb1d_In = 0; tmpMap.Clear(); bool IsQuadratic = false; bool IsFirst = true; @@ -513,9 +513,9 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, tmpMap.Add( exp.Current() ); SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current()); MapShapeNbElemsItr anIt = aResMap.find(aSubMesh); - std::vector aVec = (*anIt).second; + std::vector aVec = (*anIt).second; nb0d_In += aVec[SMDSEntity_Node]; - nb1d_In += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); + nb1d_In += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]); if(IsFirst) { IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]); IsFirst = false; @@ -532,7 +532,7 @@ bool StdMeshers_RadialPrism_3D::Evaluate(SMESH_Mesh& aMesh, bool IsOK = (nb0d_Out==nb0d_In) && (nb1d_Out==nb1d_In) && (nb2d_3_Out==nb2d_3_In) && (nb2d_4_Out==nb2d_4_In); if(!IsOK) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; iGetLayerDistribution() ) { - std::vector aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i aResVec(SMDSEntity_Last); + std::vector aResVec(SMDSEntity_Last); for(int i=SMDSEntity_Node; i& aResVec = - aResMap.insert( make_pair(sm, vector(SMDSEntity_Last,0))).first->second; + vector& aResVec = + aResMap.insert( make_pair(sm, vector(SMDSEntity_Last,0))).first->second; myHelper = new SMESH_MesherHelper( aMesh ); myHelper->SetSubShape( aShape ); @@ -1204,23 +1204,23 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, for ( TopExp_Explorer edge( aShape, TopAbs_EDGE ); edge.More() && !isQuadratic ; edge.Next() ) { sm = aMesh.GetSubMesh( edge.Current() ); - vector& nbElems = aResMap[ sm ]; + vector& nbElems = aResMap[ sm ]; if ( SMDSEntity_Quad_Edge < (int) nbElems.size() ) isQuadratic = nbElems[ SMDSEntity_Quad_Edge ]; } - int nbCircSegments = 0; + smIdType nbCircSegments = 0; for ( int iE = 0; iE < circSide->NbEdges(); ++iE ) { sm = aMesh.GetSubMesh( circSide->Edge( iE )); - vector& nbElems = aResMap[ sm ]; + vector& nbElems = aResMap[ sm ]; if ( SMDSEntity_Quad_Edge < (int) nbElems.size() ) nbCircSegments += ( nbElems[ SMDSEntity_Edge ] + nbElems[ SMDSEntity_Quad_Edge ]); } - int nbQuads = nbCircSegments * ( layerPositions.size() - 1 ); - int nbTria = nbCircSegments; - int nbNodes = ( nbCircSegments - 1 ) * ( layerPositions.size() - 2 ); + smIdType nbQuads = nbCircSegments * ( layerPositions.size() - 1 ); + smIdType nbTria = nbCircSegments; + smIdType nbNodes = ( nbCircSegments - 1 ) * ( layerPositions.size() - 2 ); if ( isQuadratic ) { nbNodes += (( nbCircSegments - 1 ) * ( layerPositions.size() - 1 ) + // radial @@ -1238,7 +1238,7 @@ bool StdMeshers_RadialQuadrangle_1D2D::Evaluate(SMESH_Mesh& aMesh, if ( linSide1 ) { // evaluation for linSides - vector aResVec(SMDSEntity_Last, 0); + vector aResVec(SMDSEntity_Last, 0); if ( isQuadratic ) { aResVec[SMDSEntity_Node ] = 2 * ( layerPositions.size() - 1 ) + 1; aResVec[SMDSEntity_Quad_Edge] = layerPositions.size() - 1; diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index c6e41cbb2..ed0d0d294 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -350,7 +350,7 @@ bool StdMeshers_Regular_1D::CheckHypothesis( SMESH_Mesh& aMesh, static bool computeParamByFunc(Adaptor3d_Curve& C3d, double first, double last, double length, - bool theReverse, int nbSeg, Function& func, + bool theReverse, smIdType nbSeg, Function& func, list& theParams) { // never do this way @@ -359,11 +359,11 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d, if ( nbSeg <= 0 ) return false; - int nbPnt = 1 + nbSeg; + smIdType nbPnt = 1 + nbSeg; vector x( nbPnt, 0. ); - const double eps = Min( 1E-4, 1./nbSeg/100. ); + const double eps = Min( 1E-4, 0.01 / double( nbSeg )); if ( !buildDistribution( func, 0.0, 1.0, nbSeg, x, eps )) return false; @@ -377,7 +377,7 @@ static bool computeParamByFunc(Adaptor3d_Curve& C3d, sign = -1.; } - for ( int i = 1; i < nbSeg; i++ ) + for ( smIdType i = 1; i < nbSeg; i++ ) { double curvLength = length * (x[i] - x[i-1]) * sign; double tol = Min( Precision::Confusion(), curvLength / 100. ); @@ -420,7 +420,7 @@ static void compensateError(double a1, double an, list & theParams, bool adjustNeighbors2an = false) { - int i, nPar = theParams.size(); + smIdType i, nPar = theParams.size(); if ( a1 + an <= length && nPar > 1 ) { bool reverse = ( U1 > Un ); @@ -459,7 +459,7 @@ static void compensateError(double a1, double an, } else { - double q = dUn / ( nPar - 1 ); + double q = dUn / double( nPar - 1 ); theParams.back() += dUn; double sign = reverse ? -1 : 1; double prevU = theParams.back(); @@ -565,14 +565,68 @@ StdMeshers_Regular_1D::getVertexHyp(SMESH_Mesh & theMesh, return 0; } +//================================================================================ +/*! + * \brief Divide a curve into equal segments + */ +//================================================================================ + +bool StdMeshers_Regular_1D::divideIntoEqualSegments( SMESH_Mesh & theMesh, + Adaptor3d_Curve & theC3d, + smIdType theNbPoints, + double theTol, + double theLength, + double theFirstU, + double theLastU, + std::list & theParameters ) +{ + bool ok = false; + if ( theNbPoints < IntegerLast() ) + { + int nbPnt = FromIdType( theNbPoints ); + GCPnts_UniformAbscissa discret(theC3d, nbPnt, theFirstU, theLastU, theTol ); + if ( !discret.IsDone() ) + return error( "GCPnts_UniformAbscissa failed"); + if ( discret.NbPoints() < nbPnt ) + discret.Initialize(theC3d, nbPnt + 1, theFirstU, theLastU, theTol ); + + int nbPoints = Min( discret.NbPoints(), nbPnt ); + for ( int i = 2; i < nbPoints; i++ ) // skip 1st and last points + { + double param = discret.Parameter(i); + theParameters.push_back( param ); + } + ok = true; + } + else // huge nb segments + { + // use FIXED_POINTS_1D method + StdMeshers_FixedPoints1D fixedPointsHyp( GetGen()->GetANewId(), GetGen() ); + _fpHyp = &fixedPointsHyp; + std::vector params = { 0., 1. }; + std::vector nbSegs = { theNbPoints - 1 }; + fixedPointsHyp.SetPoints( params ); + fixedPointsHyp.SetNbSegments( nbSegs ); + + HypothesisType curType = _hypType; + _hypType = FIXED_POINTS_1D; + + ok = computeInternalParameters( theMesh, theC3d, theLength, theFirstU, theLastU, + theParameters, /*reverse=*/false ); + _hypType = curType; + _fpHyp = 0; + } + return ok; +} + //================================================================================ /*! * \brief Tune parameters to fit "SegmentLengthAroundVertex" hypothesis - * \param theC3d - wire curve - * \param theLength - curve length - * \param theParameters - internal nodes parameters to modify - * \param theVf - 1st vertex - * \param theVl - 2nd vertex + * \param theC3d - wire curve + * \param theLength - curve length + * \param theParameters - internal nodes parameters to modify + * \param theVf - 1st vertex + * \param theVl - 2nd vertex */ //================================================================================ @@ -584,7 +638,7 @@ void StdMeshers_Regular_1D::redistributeNearVertices (SMESH_Mesh & theM const TopoDS_Vertex & theVl) { double f = theC3d.FirstParameter(), l = theC3d.LastParameter(); - int nPar = theParameters.size(); + size_t nPar = theParameters.size(); for ( int isEnd1 = 0; isEnd1 < 2; ++isEnd1 ) { const TopoDS_Vertex & V = isEnd1 ? theVf : theVl; @@ -623,7 +677,7 @@ void StdMeshers_Regular_1D::redistributeNearVertices (SMESH_Mesh & theM { // recompute params between the last segment and a middle one. // find size of a middle segment - int nHalf = ( nPar-1 ) / 2; + smIdType nHalf = ( nPar-1 ) / 2; list< double >::reverse_iterator itU = theParameters.rbegin(); std::advance( itU, nHalf ); double Um = *itU++; @@ -714,7 +768,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, size_t dSeg = theReverse ? -1 : +1; double param = theFirstU; size_t nbParams = 0; - for ( int i = 0, nb = segLen.size()-1; i < nb; ++i, iSeg += dSeg ) + for ( size_t i = 1; i < segLen.size(); ++i, iSeg += dSeg ) { double tol = Min( Precision::Confusion(), 0.01 * segLen[ iSeg ]); GCPnts_AbscissaPoint Discret( tol, theC3d, segLen[ iSeg ], param ); @@ -740,14 +794,14 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, case NB_SEGMENTS: { double eltSize = 1; - int nbSegments; + smIdType nbSegments; if ( _hypType == MAX_LENGTH ) { double nbseg = ceil(theLength / _value[ BEG_LENGTH_IND ]); // integer sup if (nbseg <= 0) nbseg = 1; // degenerated edge eltSize = theLength / nbseg * ( 1. - 1e-9 ); - nbSegments = (int) nbseg; + nbSegments = ToIdType( nbseg ); } else if ( _hypType == LOCAL_LENGTH ) { @@ -770,10 +824,10 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, } if (computed) { SMESHDS_SubMesh* smds = sm->GetSubMeshDS(); - int nb_segments = smds->NbElements(); + smIdType nb_segments = smds->NbElements(); if (nbseg - 1 <= nb_segments && nb_segments <= nbseg + 1) { isFound = true; - nbseg = nb_segments; + nbseg = FromIdType( nb_segments ); } } } @@ -788,7 +842,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if (nbseg <= 0) nbseg = 1; // degenerated edge eltSize = theLength / nbseg; - nbSegments = (int) nbseg; + nbSegments = ToIdType( nbseg ); } else { @@ -805,19 +859,19 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, if (fabs(scale - 1.0) < Precision::Confusion()) { // special case to avoid division by zero - for (int i = 1; i < nbSegments; i++) { - double param = f + (l - f) * i / nbSegments; + for ( smIdType i = 1; i < nbSegments; i++) { + double param = f + (l - f) * double( i ) / double( nbSegments ); theParams.push_back( param ); } - } else { - // general case of scale distribution + } + else { // general case of scale distribution if ( theReverse ) scale = 1.0 / scale; - double alpha = pow(scale, 1.0 / (nbSegments - 1)); + double alpha = pow(scale, 1.0 / double( nbSegments - 1 )); double factor = (l - f) / (1.0 - pow(alpha, nbSegments)); - for (int i = 1; i < nbSegments; i++) { + for ( smIdType i = 1; i < nbSegments; i++) { double param = f + factor * (1.0 - pow(alpha, i)); theParams.push_back( param ); } @@ -837,7 +891,7 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, break; case StdMeshers_NumberOfSegments::DT_TabFunc: { - FunctionTable func(_vvalue[ TAB_FUNC_IND ], _ivalue[ CONV_MODE_IND ]); + FunctionTable func(_vvalue[ TAB_FUNC_IND ], FromIdType( _ivalue[ CONV_MODE_IND ])); return computeParamByFunc(theC3d, f, l, theLength, theReverse, _ivalue[ NB_SEGMENTS_IND ], func, theParams); @@ -845,14 +899,15 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, break; case StdMeshers_NumberOfSegments::DT_ExprFunc: { - FunctionExpr func(_svalue[ EXPR_FUNC_IND ].c_str(), _ivalue[ CONV_MODE_IND ]); + FunctionExpr func(_svalue[ EXPR_FUNC_IND ].c_str(), + FromIdType( _ivalue[ CONV_MODE_IND ])); return computeParamByFunc(theC3d, f, l, theLength, theReverse, _ivalue[ NB_SEGMENTS_IND ], func, theParams); } break; case StdMeshers_NumberOfSegments::DT_Regular: - eltSize = theLength / nbSegments; + eltSize = theLength / double( nbSegments ); break; default: return false; @@ -860,18 +915,9 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, } double tol = Min( Precision::Confusion(), 0.01 * eltSize ); - GCPnts_UniformAbscissa Discret(theC3d, nbSegments + 1, f, l, tol ); - if ( !Discret.IsDone() ) - return error( "GCPnts_UniformAbscissa failed"); - if ( Discret.NbPoints() < nbSegments + 1 ) - Discret.Initialize(theC3d, nbSegments + 2, f, l, tol ); + divideIntoEqualSegments( theMesh, theC3d, nbSegments + 1, tol, + theLength, theFirstU, theLastU, theParams ); - int NbPoints = Min( Discret.NbPoints(), nbSegments + 1 ); - for ( int i = 2; i < NbPoints; i++ ) // skip 1st and last points - { - double param = Discret.Parameter(i); - theParams.push_back( param ); - } compensateError( eltSize, eltSize, f, l, theLength, theC3d, theParams, true ); // for PAL9899 return true; } @@ -1001,11 +1047,11 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, case FIXED_POINTS_1D: { const std::vector& aPnts = _fpHyp->GetPoints(); - std::vector nbsegs = _fpHyp->GetNbSegments(); + std::vector nbsegs = _fpHyp->GetNbSegments(); // sort normalized params, taking into account theReverse TColStd_SequenceOfReal Params; - double tol = 1e-7 / theLength; // GCPnts_UniformAbscissa allows u2-u1 > 1e-7 + double tol = 1e-7; for ( size_t i = 0; i < aPnts.size(); i++ ) { if( aPnts[i] < tol || aPnts[i] > 1 - tol ) @@ -1013,72 +1059,82 @@ bool StdMeshers_Regular_1D::computeInternalParameters(SMESH_Mesh & theMesh, double u = theReverse ? ( 1 - aPnts[i] ) : aPnts[i]; int j = 1; bool IsExist = false; - for ( ; j <= Params.Length(); j++ ) { - if ( Abs( u - Params.Value(j) ) < tol ) { - IsExist = true; - break; - } + for ( ; j <= Params.Length() && !IsExist; j++ ) + { + IsExist = ( Abs( u - Params.Value(j) ) < tol ); if ( u < Params.Value(j) ) break; } if ( !IsExist ) Params.InsertBefore( j, u ); } + Params.InsertBefore( 1, 0.0 ); + Params.Append( 1.0 ); + + if ( theReverse ) + { + if ((int) nbsegs.size() > Params.Length() - 1 ) + nbsegs.resize( Params.Length() - 1 ); + std::reverse( nbsegs.begin(), nbsegs.end() ); + } + if ( nbsegs.empty() ) + { + nbsegs.push_back( 1 ); + } + if ((int) nbsegs.size() < Params.Length() - 1 ) + nbsegs.resize( Params.Length() - 1, nbsegs[0] ); + + // care of huge nbsegs - additionally divide diapasons + for ( int i = 2; i <= Params.Length(); i++ ) + { + smIdType nbTot = nbsegs[ i-2 ]; + if ( nbTot <= IntegerLast() ) + continue; + smIdType nbDiapason = nbTot / IntegerLast() + 1; + smIdType nbSegPerDiap = nbTot / nbDiapason; + double par0 = Params( i - 1 ), par1 = Params( i ); + for ( smIdType iDiap = 0; iDiap < nbDiapason - 1; ++iDiap ) + { + double r = double( nbSegPerDiap * ( iDiap + 1 )) / double( nbTot ); + double parI = par0 + ( par1 - par0 ) * r; + Params.InsertBefore( i, parI ); + auto it = nbsegs.begin(); + smIdType incr_it = i - 2 + iDiap; + nbsegs.insert( it + incr_it, nbSegPerDiap ); + } + nbsegs[ i-2 + nbDiapason - 1 ] = nbSegPerDiap + nbTot % nbDiapason; + } // transform normalized Params into real ones - std::vector< double > uVec( Params.Length() + 2 ); + std::vector< double > uVec( Params.Length() ); uVec[ 0 ] = theFirstU; double abscissa; - for ( int i = 1; i <= Params.Length(); i++ ) + for ( int i = 2; i < Params.Length(); i++ ) { abscissa = Params( i ) * theLength; tol = Min( Precision::Confusion(), 0.01 * abscissa ); GCPnts_AbscissaPoint APnt( tol, theC3d, abscissa, theFirstU ); if ( !APnt.IsDone() ) return error( "GCPnts_AbscissaPoint failed"); - uVec[ i ] = APnt.Parameter(); + uVec[ i-1 ] = APnt.Parameter(); } uVec.back() = theLastU; // divide segments - if ( theReverse ) - { - if ((int) nbsegs.size() > Params.Length() + 1 ) - nbsegs.resize( Params.Length() + 1 ); - std::reverse( nbsegs.begin(), nbsegs.end() ); - } - if ( nbsegs.empty() ) - { - nbsegs.push_back( 1 ); - } - Params.InsertBefore( 1, 0.0 ); - Params.Append( 1.0 ); double eltSize, segmentSize, par1, par2; - for ( size_t i = 0; i < uVec.size()-1; i++ ) + for ( int i = 0; i < (int)uVec.size()-1; i++ ) { par1 = uVec[ i ]; par2 = uVec[ i+1 ]; - int nbseg = ( i < nbsegs.size() ) ? nbsegs[i] : nbsegs[0]; - if ( nbseg == 1 ) - { - theParams.push_back( par2 ); - } - else + smIdType nbseg = ( i < (int) nbsegs.size() ) ? nbsegs[i] : nbsegs[0]; + if ( nbseg > 1 ) { segmentSize = ( Params( i+2 ) - Params( i+1 )) * theLength; - eltSize = segmentSize / nbseg; + eltSize = segmentSize / double( nbseg ); tol = Min( Precision::Confusion(), 0.01 * eltSize ); - GCPnts_UniformAbscissa Discret( theC3d, eltSize, par1, par2, tol ); - if ( !Discret.IsDone() ) - return error( "GCPnts_UniformAbscissa failed"); - if ( Discret.NbPoints() < nbseg + 1 ) { - eltSize = segmentSize / ( nbseg + 0.5 ); - Discret.Initialize( theC3d, eltSize, par1, par2, tol ); - } - int NbPoints = Discret.NbPoints(); - for ( int i = 2; i <= NbPoints; i++ ) { - double param = Discret.Parameter(i); - theParams.push_back( param ); - } + if ( !divideIntoEqualSegments( theMesh, theC3d, nbseg + 1, tol, + segmentSize, par1, par2, theParams )) + return false; } + theParams.push_back( par2 ); } theParams.pop_back(); @@ -1312,7 +1368,7 @@ bool StdMeshers_Regular_1D::Evaluate(SMESH_Mesh & theMesh, ASSERT(!VFirst.IsNull()); ASSERT(!VLast.IsNull()); - std::vector aVec(SMDSEntity_Last,0); + std::vector aVec(SMDSEntity_Last,0); double length = EdgeLength( E ); if ( !Curve.IsNull() && length > 0 ) @@ -1396,7 +1452,7 @@ StdMeshers_Regular_1D::GetUsedHypothesis(SMESH_Mesh & aMesh, if (nbHyp == 0) // nothing propagated nor assigned to aShape { SMESH_Algo::GetUsedHypothesis( aMesh, aShape, ignoreAuxiliary ); - nbHyp = _usedHypList.size(); + nbHyp = (int)_usedHypList.size(); } else { diff --git a/src/StdMeshers/StdMeshers_Regular_1D.hxx b/src/StdMeshers/StdMeshers_Regular_1D.hxx index af6921ebc..2d7bf956f 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.hxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.hxx @@ -95,7 +95,16 @@ protected: double theLength, std::list< double > & theParameters, const TopoDS_Vertex & theVf, - const TopoDS_Vertex & theVl); + const TopoDS_Vertex & thieve); + + bool divideIntoEqualSegments( SMESH_Mesh & theMesh, + Adaptor3d_Curve & theC3d, + smIdType theNbPoints, + double theTol, + double theLength, + double theFirstU, + double theLastU, + std::list & theParameters ); /*! * \brief Return StdMeshers_SegmentLengthAroundVertex assigned to vertex @@ -133,8 +142,8 @@ protected: const StdMeshers_FixedPoints1D* _fpHyp; const StdMeshers_Adaptive1D* _adaptiveHyp; - double _value[2]; - int _ivalue[3]; + double _value [2]; + smIdType _ivalue[3]; std::vector _vvalue[1]; std::string _svalue[1]; std::vector _revEdgesIDs; diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 822f1742c..99fc892ec 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -10752,7 +10752,7 @@ namespace VISCOUS_3D { points.reserve( _boundarySize ); size_t nb = _boundary.rbegin()->_nodes.size(); - int lastID = _boundary.rbegin()->Node( nb - 1 )->GetID(); + smIdType lastID = _boundary.rbegin()->Node( nb - 1 )->GetID(); std::list< BndPart >::const_iterator part = _boundary.begin(); for ( ; part != _boundary.end(); ++part ) { @@ -12114,7 +12114,7 @@ void _Shrinker1D::AddEdge( const _LayerEdge* e, GeomAdaptor_Curve aCurve(C, f,l); const double totLen = GCPnts_AbscissaPoint::Length(aCurve, f, l); - int nbExpectNodes = eSubMesh->NbNodes(); + smIdType nbExpectNodes = eSubMesh->NbNodes(); _initU .reserve( nbExpectNodes ); _normPar.reserve( nbExpectNodes ); _nodes .reserve( nbExpectNodes ); diff --git a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx index 4b4294cd5..3a8dbc2cc 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers2D.cxx @@ -83,6 +83,7 @@ #include #include #include +#include #include #include @@ -113,7 +114,7 @@ namespace VISCOUS_2D { _EdgeSubMesh(const SMDS_Mesh* mesh, int index=0): SubMesh(mesh,index) {} //virtual int NbElements() const { return _elements.size()+1; } - virtual int NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); } + virtual smIdType NbNodes() const { return Max( 0, _uvPtStructVec.size()-2 ); } void SetUVPtStructVec(UVPtStructVec& vec) { _uvPtStructVec.swap( vec ); } UVPtStructVec& GetUVPtStructVec() { return _uvPtStructVec; } }; diff --git a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx index e61e5d369..8793f3bce 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.cxx @@ -301,17 +301,18 @@ double StdMeshersGUI_FixedPointsParamWdg::point( int idx ) const return idx >= 0 && idx < myListWidget->count() ? myListWidget->item( idx )->data( Qt::UserRole ).toDouble() : 0.; } -void StdMeshersGUI_FixedPointsParamWdg::setNbSegments( int idx, int val ) +void StdMeshersGUI_FixedPointsParamWdg::setNbSegments( int idx, SMESH::smIdType val ) { - if ( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ) { - myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, val ); + if ( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ) + { + myTreeWidget->topLevelItem( idx )->setData( 1, Qt::UserRole, FromIdType( val )); myTreeWidget->topLevelItem( idx )->setText( 1, idx > 0 && mySameValues->isChecked() ? QString( SAME_TEXT ) : QString::number( val ) ); } } -int StdMeshersGUI_FixedPointsParamWdg::nbSegments( int idx ) const +smIdType StdMeshersGUI_FixedPointsParamWdg::nbSegments( int idx ) const { - return idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toInt() : 1; + return ToIdType( idx >= 0 && idx < myTreeWidget->topLevelItemCount() ? myTreeWidget->topLevelItem( idx )->data( 1, Qt::UserRole ).toInt() : 1 ); } //================================================================================= @@ -369,9 +370,9 @@ void StdMeshersGUI_FixedPointsParamWdg::SetListOfPoints( SMESH::double_array_var // function : GetListOfSegments // purpose : Called to get the list Number of Segments //================================================================================= -SMESH::long_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfSegments() +SMESH::smIdType_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfSegments() { - SMESH::long_array_var anArray = new SMESH::long_array; + SMESH::smIdType_array_var anArray = new SMESH::smIdType_array; int size = mySameValues->isChecked() ? 1 : myTreeWidget->topLevelItemCount(); anArray->length( size ); for (int i = 0; i < size; i++) { @@ -384,7 +385,7 @@ SMESH::long_array_var StdMeshersGUI_FixedPointsParamWdg::GetListOfSegments() // function : SetListOfPoints // purpose : Called to set the list of Points //================================================================================= -void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::long_array_var theSegments) +void StdMeshersGUI_FixedPointsParamWdg::SetListOfSegments( SMESH::smIdType_array_var theSegments) { if ( myListWidget->count() > 0 && theSegments->length() == 1) mySameValues->setChecked(true); diff --git a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.h b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.h index 2fabeb02d..e55ce992c 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.h +++ b/src/StdMeshersGUI/StdMeshersGUI_FixedPointsParamWdg.h @@ -27,6 +27,8 @@ #include #include "SMESH_StdMeshersGUI.hxx" +#include + // Qt includes #include #include @@ -56,8 +58,8 @@ public: SMESH::double_array_var GetListOfPoints(); void SetListOfPoints( SMESH::double_array_var ); - SMESH::long_array_var GetListOfSegments(); - void SetListOfSegments( SMESH::long_array_var ); + SMESH::smIdType_array_var GetListOfSegments(); + void SetListOfSegments( SMESH::smIdType_array_var ); QString GetValue() const { return myParamValue; } @@ -72,8 +74,8 @@ private: void addPoint( double ); void removePoints(); double point( int ) const; - void setNbSegments( int, int ); - int nbSegments( int ) const; + void setNbSegments( int, SMESH::smIdType ); + smIdType nbSegments( int ) const; static QTreeWidgetItem* newTreeItem( double v1, double v2 ); static QListWidgetItem* newListItem( double v1 ); diff --git a/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.h b/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.h index 2400dd8ab..a35610402 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.h +++ b/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.h @@ -68,16 +68,16 @@ public: void SetObjects(SMESH::string_array_var& objEntries); template - typename TInterface::_var_type GetObject(unsigned i=0) const { + typename TInterface::_var_type GetObject(size_t i=0) const { if ( IsObjectSelected(i) ) return TInterface::_narrow(myObjects[i]); return TInterface::_nil(); } - int NbObjects() const { return myObjects.size(); } + size_t NbObjects() const { return myObjects.size(); } QString GetValue() const { return myParamValue; } - bool IsObjectSelected(unsigned i=0) const + bool IsObjectSelected(size_t i=0) const { return i < myObjects.size() && !CORBA::is_nil(myObjects[i]); } /*! diff --git a/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx index 90d92443b..75eb3eb0a 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_QuadrangleParamWdg.cxx @@ -226,7 +226,7 @@ void StdMeshersGUI_QuadrangleParamCreator::retrieveParams() const GEOM::ListOfGO_var shapes; SMESH::nodes_array_var points; h->GetEnforcedNodes( shapes, points ); - for ( size_t i = 0; i < shapes->length(); ++i ) + for ( CORBA::ULong i = 0; i < shapes->length(); ++i ) { CORBA::String_var name = shapes[i]->GetName(); CORBA::String_var entry = shapes[i]->GetStudyEntry(); @@ -234,7 +234,7 @@ void StdMeshersGUI_QuadrangleParamCreator::retrieveParams() const item->setData( Qt::UserRole, entry.in() ); myShapesList->addItem( item ); } - for ( size_t i = 0; i < points->length(); ++i ) + for ( CORBA::ULong i = 0; i < points->length(); ++i ) { QTreeWidgetItem* item = new QTreeWidgetItem ( QStringList() diff --git a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx index 7829c7ec0..8fdbf7ce9 100644 --- a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx @@ -71,14 +71,14 @@ StdMeshers_FixedPoints1D_i::~StdMeshers_FixedPoints1D_i() */ //============================================================================= -void StdMeshers_FixedPoints1D_i::SetNbSegments(const SMESH::long_array& listNbSeg) - +void StdMeshers_FixedPoints1D_i::SetNbSegments(const SMESH::smIdType_array& listNbSeg) + { ASSERT( myBaseImpl ); try { - std::vector nbsegs( listNbSeg.length() ); - CORBA::Long iEnd = listNbSeg.length(); - for ( CORBA::Long i = 0; i < iEnd; i++ ) + std::vector nbsegs( listNbSeg.length() ); + CORBA::ULong iEnd = listNbSeg.length(); + for ( CORBA::ULong i = 0; i < iEnd; i++ ) nbsegs[ i ] = listNbSeg[ i ]; this->GetImpl()->SetNbSegments( nbsegs ); } @@ -130,7 +130,7 @@ SMESH::double_array* StdMeshers_FixedPoints1D_i::GetPoints() ASSERT( myBaseImpl ); SMESH::double_array_var anArray = new SMESH::double_array; std::vector params = this->GetImpl()->GetPoints(); - anArray->length( params.size() ); + anArray->length( static_cast( params.size() )); for ( CORBA::ULong i = 0; i < params.size(); i++) anArray [ i ] = params [ i ]; @@ -145,12 +145,12 @@ SMESH::double_array* StdMeshers_FixedPoints1D_i::GetPoints() */ //============================================================================= -SMESH::long_array* StdMeshers_FixedPoints1D_i::GetNbSegments() +SMESH::smIdType_array* StdMeshers_FixedPoints1D_i::GetNbSegments() { ASSERT( myBaseImpl ); - SMESH::long_array_var anArray = new SMESH::long_array; - std::vector nbsegs = this->GetImpl()->GetNbSegments(); - anArray->length( nbsegs.size() ); + SMESH::smIdType_array_var anArray = new SMESH::smIdType_array; + std::vector nbsegs = this->GetImpl()->GetNbSegments(); + anArray->length( static_cast( nbsegs.size() )); for ( CORBA::ULong i = 0; i < nbsegs.size(); i++) anArray [ i ] = nbsegs [ i ]; diff --git a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx index 92a824568..5d76fd3d8 100644 --- a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.hxx @@ -53,13 +53,13 @@ public: // create list of reversed edges if it is needed) and sets numbers // of segments between given points (default values are equals 1) void SetPoints(const SMESH::double_array& listParams); - void SetNbSegments(const SMESH::long_array& listNbSeg); + void SetNbSegments(const SMESH::smIdType_array& listNbSeg); // Returns list of point's parameters SMESH::double_array* GetPoints(); // Returns list of numbers of segments - SMESH::long_array* GetNbSegments(); + SMESH::smIdType_array* GetNbSegments(); // Get implementation ::StdMeshers_FixedPoints1D* GetImpl(); diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index 1d1687253..749e2bc38 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -127,7 +127,7 @@ StdMeshers_NumberOfSegments_i::BuildDistributionTab( const SMESH::double_array& */ //============================================================================= -void StdMeshers_NumberOfSegments_i::SetNumberOfSegments( CORBA::Long theSegmentsNumber ) +void StdMeshers_NumberOfSegments_i::SetNumberOfSegments( SMESH::smIdType theSegmentsNumber ) { ASSERT( myBaseImpl ); try { diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx index 5f00a8fb9..5d1efb29c 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx @@ -58,7 +58,7 @@ public: SMESH::double_array* BuildDistributionTab( const SMESH::double_array&, CORBA::Long, CORBA::Long ); // Set number of segments - void SetNumberOfSegments( CORBA::Long theSegmentsNumber ); + void SetNumberOfSegments( SMESH::smIdType theSegmentsNumber ); // Get number of segments CORBA::Long GetNumberOfSegments(); -- 2.39.2