From c73dc0e564fcb96bb44f00a053861b48ec89450b Mon Sep 17 00:00:00 2001 From: eap Date: Fri, 26 Feb 2010 08:15:02 +0000 Subject: [PATCH] + /*! + * \brief Wrap a sequence of ids in a SMESH_IDSource + */ + SMESH_IDSource MakeIDSource(in long_array IDsOfElements); --- idl/SMESH_MeshEditor.idl | 16 ++++++++++++++++ src/SMESH_I/SMESH_MeshEditor_i.cxx | 21 +++++++++++++++++++++ src/SMESH_I/SMESH_MeshEditor_i.hxx | 8 +++++++- 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/idl/SMESH_MeshEditor.idl b/idl/SMESH_MeshEditor.idl index 62623567a..eb2715b4e 100644 --- a/idl/SMESH_MeshEditor.idl +++ b/idl/SMESH_MeshEditor.idl @@ -35,6 +35,11 @@ module SMESH interface NumericalFunctor; interface SMESH_MeshEditor { + /*! + * \brief Wrap a sequence of ids in a SMESH_IDSource + */ + SMESH_IDSource MakeIDSource(in long_array IDsOfElements); + boolean RemoveElements(in long_array IDsOfElements); boolean RemoveNodes(in long_array IDsOfNodes); @@ -211,6 +216,17 @@ module SMESH long BestSplit (in long IDOfQuad, in NumericalFunctor Criterion); + /*! + * \brief Split volumic elements into tetrahedrons + * \param elems - elements to split + * \param methodFlags - flags passing splitting method: + * 1 - split the hexahedron into 5 tetrahedrons + * 2 - split the hexahedron into 6 tetrahedrons + */ + //void SplitVolumesIntoTetra(in SMESH_IDSource elems, in short methodFlags) + //raises (SALOME::SALOME_Exception); + + enum Smooth_Method { LAPLACIAN_SMOOTH, CENTROIDAL_SMOOTH }; boolean Smooth(in long_array IDsOfElements, diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 000bc95e8..7ea5df70b 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -271,6 +271,27 @@ void SMESH_MeshEditor_i::initData(bool deleteSearchers) } } +//======================================================================= +//function : MakeIDSource +//purpose : Wrap a sequence of ids in a SMESH_IDSource +//======================================================================= + +struct _IDSource : public POA_SMESH::SMESH_IDSource +{ + SMESH::long_array _ids; + SMESH::long_array* GetIDs() { return & _ids; } + SMESH::long_array* GetMeshInfo() { return 0; } +}; + +SMESH::SMESH_IDSource_ptr SMESH_MeshEditor_i::MakeIDSource(const SMESH::long_array& ids) +{ + _IDSource* anIDSource = new _IDSource; + anIDSource->_ids = ids; + SMESH::SMESH_IDSource_var anIDSourceVar = anIDSource->_this(); + + return anIDSourceVar._retn(); +} + //============================================================================= /*! * diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index 5c4dd85ca..bf0a3540b 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -41,12 +41,18 @@ class SMESH_Mesh_i; class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor { - public: +public: SMESH_MeshEditor_i(SMESH_Mesh_i * theMesh, bool isPreview); virtual ~ SMESH_MeshEditor_i(); // --- CORBA + + /*! + * \brief Wrap a sequence of ids in a SMESH_IDSource + */ + SMESH::SMESH_IDSource_ptr MakeIDSource(const SMESH::long_array& IDsOfElements); + CORBA::Boolean RemoveElements(const SMESH::long_array & IDsOfElements); CORBA::Boolean RemoveNodes(const SMESH::long_array & IDsOfNodes); -- 2.39.2