From 80caa820d03a86f6c09c2d89ae73f5a65a4c00e0 Mon Sep 17 00:00:00 2001 From: eap Date: Thu, 19 Mar 2015 17:08:42 +0300 Subject: [PATCH] 23023: [CEA 1445] missing ExtrusionAlongPathObject function +class meshEditor(SMESH._objref_SMESH_MeshEditor): --- idl/SMESH_MeshEditor.idl | 5 +++++ src/SMESH_I/SMESH_2smeshpy.cxx | 4 ++-- src/SMESH_I/SMESH_MeshEditor_i.cxx | 11 +++++++++++ src/SMESH_I/SMESH_MeshEditor_i.hxx | 2 ++ src/SMESH_SWIG/smeshBuilder.py | 17 ++++++++++++++++- 5 files changed, 36 insertions(+), 3 deletions(-) diff --git a/idl/SMESH_MeshEditor.idl b/idl/SMESH_MeshEditor.idl index 699f63587..cc6dc0874 100644 --- a/idl/SMESH_MeshEditor.idl +++ b/idl/SMESH_MeshEditor.idl @@ -38,6 +38,11 @@ module SMESH interface SMESH_MeshEditor { + /*! + * Returns a mesh subject to edition + */ + SMESH_Mesh GetMesh(); + /*! * Return data of mesh edition preview which is computed provided * that the editor was obtained through SMESH_Mesh::GetMeshEditPreviewer() diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 572413800..a2d70b88b 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -2102,8 +2102,8 @@ bool _pyMesh::NeedMeshAccess( const Handle(_pyCommand)& theCommand ) if ( sameMethods.empty() ) { const char * names[] = { "ExportDAT","ExportUNV","ExportSTL","ExportSAUV", "RemoveGroup","RemoveGroupWithContents", - "GetGroups","UnionGroups","IntersectGroups","CutGroups","GetLog","GetId","ClearLog", - "GetStudyId","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements", + "GetGroups","UnionGroups","IntersectGroups","CutGroups","CreateDimGroup","GetLog","GetId", + "ClearLog","GetStudyId","HasDuplicatedGroupNamesMED","GetMEDMesh","NbNodes","NbElements", "NbEdges","NbEdgesOfOrder","NbFaces","NbFacesOfOrder","NbTriangles", "NbTrianglesOfOrder","NbQuadrangles","NbQuadranglesOfOrder","NbPolygons","NbVolumes", "NbVolumesOfOrder","NbTetras","NbTetrasOfOrder","NbHexas","NbHexasOfOrder", diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index accbde280..7b0ba25b8 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -439,6 +439,17 @@ SMESH_MeshEditor_i::~SMESH_MeshEditor_i() delete myPreviewEditor; myPreviewEditor = 0; } +//================================================================================ +/*! + * \brief Returns the mesh + */ +//================================================================================ + +SMESH::SMESH_Mesh_ptr SMESH_MeshEditor_i::GetMesh() +{ + return myMesh_i->_this(); +} + //================================================================================ /*! * \brief Clear members diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index bd914f3c3..ec9ae9861 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -57,6 +57,8 @@ public: */ int GetMeshId() const { return myMesh->GetId(); } + SMESH::SMESH_Mesh_ptr GetMesh(); + // --- CORBA /*! diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index d1887b597..0433e4602 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -1247,7 +1247,6 @@ class Mesh: for attrName in dir(self): attr = getattr( self, attrName ) if isinstance( attr, algoCreator ): - #print "algoCreator ", attrName setattr( self, attrName, attr.copy( self )) pass pass @@ -4735,6 +4734,22 @@ class Mesh: pass # end of Mesh class +## class used to add to SMESH_MeshEditor methods removed from its CORBA API +# +class meshEditor(SMESH._objref_SMESH_MeshEditor): + def __init__(self): + self.mesh = None + def __getattr__(self, name ): # method called if an attribute not found + if not self.mesh: + self.mesh = Mesh( None, None, SMESH._objref_SMESH_MeshEditor.GetMesh(self)) + if hasattr( self.mesh, name ): + return getattr( self.mesh, name ) + if name == "ExtrusionAlongPathObjX": + return getattr( self.mesh, "ExtrusionAlongPathX" ) + return None + pass +omniORB.registerObjref(SMESH._objref_SMESH_MeshEditor._NP_RepositoryId, meshEditor) + ## Helper class for wrapping of SMESH.SMESH_Pattern CORBA class # class Pattern(SMESH._objref_SMESH_Pattern): -- 2.39.2