From: eap Date: Thu, 4 May 2006 14:23:21 +0000 (+0000) Subject: 1) SMESH_Mesh: add methods to get complete information of nodes, elements, submeshes X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f0faf58a38efbd9dd65b831ec21d18e00af5ac93;p=modules%2Fsmesh.git 1) SMESH_Mesh: add methods to get complete information of nodes, elements, submeshes 2) SMESH_MeshEditor: methods adding elements return their IDs; 3) SMESH_MeshEditor: add ChangeElemNodes() 4) SMESH_MeshEditor: add GetLastCreatedNodes() and GetLastCreatedElems() to get results of complex operation --- diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 2a5d4740d..8a72df14b 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -468,6 +468,15 @@ module SMESH ElementType GetElementType( in long id, in boolean iselem ) raises (SALOME::SALOME_Exception); + long_array GetSubMeshElementsId(in long ShapeID) + raises (SALOME::SALOME_Exception); + + long_array GetSubMeshNodesId(in long ShapeID, in boolean all ) + raises (SALOME::SALOME_Exception); + + ElementType GetSubMeshElementType(in long ShapeID) + raises (SALOME::SALOME_Exception); + /*! * Get mesh description */ @@ -478,6 +487,78 @@ module SMESH */ long GetMeshPtr(); + /*! + * 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); + + /*! + * 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); + + /*! + * If given element is node returns IDs of shape from position + * else - return ID of result shape after ::FindShape() + * from SMESH_MeshEditor + * If there is not element for given ID - returns -1 + */ + long GetShapeID(in long id); + + /*! + * Returns number of nodes for given element + * If there is not element for given ID - returns -1 + */ + long GetElemNbNodes(in long 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); + + /*! + * Returns true if given node is medium node + * in given quadratic element + */ + boolean IsMediumNode(in long ide, in long idn); + + /*! + * Returns true if given node is medium node + * in one of quadratic elements + */ + boolean IsMediumNodeOfAnyElem(in long idn, in ElementType elem_type); + + /*! + * Returns number of edges for given element + */ + long ElemNbEdges(in long id); + + /*! + * Returns number of faces for given element + */ + long ElemNbFaces(in long id); + + /*! + * Returns true if given element is polygon + */ + boolean IsPoly(in long id); + + /*! + * Returns true if given element is quadratic + */ + boolean IsQuadratic(in long 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); + }; interface SMESH_subMesh : SALOME::GenericObj, SMESH_IDSource @@ -552,15 +633,15 @@ module SMESH boolean RemoveNodes(in long_array IDsOfNodes); - boolean AddNode(in double x, in double y, in double z); + long AddNode(in double x, in double y, in double z); - boolean AddEdge(in long_array IDsOfNodes); + long AddEdge(in long_array IDsOfNodes); - boolean AddFace(in long_array IDsOfNodes); + long AddFace(in long_array IDsOfNodes); - boolean AddPolygonalFace(in long_array IdsOfNodes); + long AddPolygonalFace(in long_array IdsOfNodes); - boolean AddVolume(in long_array IDsOfNodes); + long AddVolume(in long_array IDsOfNodes); /*! * Create volume of many faces, giving nodes for each face. @@ -568,7 +649,7 @@ module SMESH * \param Quantities List of integer values, Quantities[i] * gives quantity of nodes in face number i. */ - boolean AddPolyhedralVolume (in long_array IdsOfNodes, + long AddPolyhedralVolume (in long_array IdsOfNodes, in long_array Quantities); /*! @@ -577,7 +658,7 @@ module SMESH * \note The created volume will refer only to nodes * of the given faces, not to the faces itself. */ - boolean AddPolyhedralVolumeByFaces (in long_array IdsOfFaces); + long AddPolyhedralVolumeByFaces (in long_array IdsOfFaces); boolean MoveNode(in long NodeID, in double x, in double y, in double z); @@ -838,6 +919,27 @@ module SMESH in long NodeID2OfSide1ToMerge, in long NodeID2OfSide2ToMerge); + /*! + * Set new nodes for given element. + * If number of nodes is not corresponded to type of + * element - returns false + */ + boolean ChangeElemNodes(in long ide, in long_array newIDs); + + /*! + * If during last operation of MeshEditor some nodes were + * created this method returns list of it's IDs, if new nodes + * not creared - returns empty list + */ + long_array GetLastCreatedNodes(); + + /*! + * If during last operation of MeshEditor some elements were + * created this method returns list of it's IDs, if new elements + * not creared - returns empty list + */ + long_array GetLastCreatedElems(); + }; };