1 -- SMESH SMDS : implementaion of Salome mesh data structure
3 -- Copyright (C) 2003 OPEN CASCADE
5 -- This library is free software; you can redistribute it and/or
6 -- modify it under the terms of the GNU Lesser General Public
7 -- License as published by the Free Software Foundation; either
8 -- version 2.1 of the License.
10 -- This library is distributed in the hope that it will be useful,
11 -- but WITHOUT ANY WARRANTY; without even the implied warranty of
12 -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 -- Lesser General Public License for more details.
15 -- You should have received a copy of the GNU Lesser General Public
16 -- License along with this library; if not, write to the Free Software
17 -- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 -- See http://www.opencascade.org or email : webmaster@opencascade.org
23 -- File : SMDS_MeshGroup.cdl
24 -- Author : Jean-Michel BOULCOURT
27 class MeshGroup from SMDS inherits MeshObject from SMDS
33 MeshElement from SMDS,
34 ElementType from SMDSAbs,
35 ListOfMeshGroup from SMDS,
36 MapOfMeshElement from SMDS
40 NoSuchObject from Standard,
41 TypeMismatch from Standard
45 ---=====================================
46 ---Category: public API methods
47 -- Group creation and deletion
48 --======================================
50 Create(aMesh: Mesh from SMDS) returns MeshGroup from SMDS;
51 ---Purpose: constructor
53 AddSubGroup(me: mutable) returns MeshGroup from SMDS;
54 ---Purpose: create a sub group.
55 -- uses a private constructor to create an instance of the
56 -- subgroup and attahc it the parent group.
58 RemoveSubGroup(me: mutable; aGroup: MeshGroup from SMDS)
60 ---Purpose: remove aGroup from the list of Children
61 -- if the subgroup does not belong to this, it returns False
65 RemoveFromParent(me: mutable)
67 ---Purpose: remove this from its parent
68 -- if this has no parent then it returns False (True otherwise)
73 ---=====================================
74 ---Category: public API methods
75 -- Group contents edition
76 --======================================
79 ---Purpose: clear the group
80 -- once the group is cleared, the type is set to All
81 -- but the referenced mesh remains.
83 Add(me: mutable; ME: MeshElement from SMDS)
84 raises TypeMismatch from Standard;
85 ---Purpose: add an element to the group
87 Remove(me: mutable; ME: MeshElement from SMDS)
88 raises NoSuchObject from Standard;
89 ---Purpose: remove an element from the group
90 -- raises if the element is not in the group
92 ---=====================================
93 ---Category: public API methods
94 -- Group contents exploration
95 --======================================
98 returns Boolean from Standard;
99 ---Purpose: check if the group is empty
101 Extent(me) returns Integer from Standard;
102 ---Purpose: return numner of elements in the group
104 Type(me) returns ElementType from SMDSAbs;
105 ---Purpose: return current element type
106 -- if the group is empty, returns All
108 Contains(me; ME : MeshElement from SMDS)
109 returns Boolean from Standard;
110 ---Purpose: check if the group contains the mesh element
112 Elements(me) returns MapOfMeshElement from SMDS;
113 ---Purpose: check if the group contains the mesh element
114 ---C++: return const &
117 ---===========================================
118 ---Category: private or protected API methods
120 --============================================
122 Create(parent: MeshGroup) returns mutable MeshGroup
123 ---Purpose: constructor used internally to create subgroup
129 myMesh : Mesh from SMDS;
130 myType : ElementType from SMDSAbs;
131 myElements : MapOfMeshElement from SMDS;
132 myParent : MeshGroup from SMDS;
133 myChildren : ListOfMeshGroup from SMDS;