Salome HOME
yfr : Merge with v1.2
[modules/smesh.git] / src / SMDS / SMDS_MeshGroup.cdl
1 --  SMESH SMDS : implementaion of Salome mesh data structure
2 --
3 --  Copyright (C) 2003  OPEN CASCADE
4 -- 
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. 
9 -- 
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. 
14 -- 
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 
18 -- 
19 --  See http://www.opencascade.org or email : webmaster@opencascade.org 
20 --
21 --
22 --
23 --  File   : SMDS_MeshGroup.cdl
24 --  Author : Jean-Michel BOULCOURT
25 --  Module : SMESH
26
27 class MeshGroup from SMDS inherits MeshObject from SMDS
28
29         ---Purpose: 
30
31 uses
32     Mesh from SMDS,
33     MeshElement from SMDS,
34     ElementType from SMDSAbs,
35     ListOfMeshGroup from SMDS,
36     MapOfMeshElement from SMDS
37
38 raises
39
40     NoSuchObject from Standard,
41     TypeMismatch from Standard
42
43 is
44
45     ---=====================================
46     ---Category: public API methods
47     --           Group creation and deletion
48     --======================================
49
50     Create(aMesh: Mesh from SMDS) returns MeshGroup from SMDS;
51     ---Purpose: constructor
52         
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.
57     
58     RemoveSubGroup(me: mutable; aGroup: MeshGroup from SMDS)
59     returns Boolean
60     ---Purpose: remove aGroup from the list of Children
61     --          if the subgroup does not belong to this, it returns False
62     --          (True otherwise)
63     is virtual;
64     
65     RemoveFromParent(me: mutable)
66     returns Boolean
67     ---Purpose: remove this from its parent
68     --          if this has no parent then it returns False (True otherwise)
69     is virtual;
70     
71
72
73     ---=====================================
74     ---Category: public API methods
75     --           Group contents edition
76     --======================================
77
78     Clear(me: mutable);
79     ---Purpose: clear the group
80     --          once the group is cleared, the type is set to All
81     --          but the referenced mesh remains.
82
83     Add(me: mutable; ME: MeshElement from SMDS)
84     raises TypeMismatch from Standard;
85     ---Purpose: add an element to the group
86
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
91
92     ---=====================================
93     ---Category: public API methods
94     --           Group contents exploration
95     --======================================
96
97     IsEmpty(me)
98     returns Boolean from Standard;
99     ---Purpose: check if the group is empty
100
101     Extent(me) returns Integer from Standard;
102     ---Purpose: return numner of elements in the group
103
104     Type(me) returns ElementType from SMDSAbs;
105     ---Purpose: return current element type
106     --          if the group is empty, returns All
107
108     Contains(me; ME : MeshElement from SMDS)
109     returns Boolean from Standard;
110     ---Purpose: check if the group contains the mesh element
111
112     Elements(me) returns MapOfMeshElement from SMDS;
113     ---Purpose: check if the group contains the mesh element
114     ---C++: return const &
115     ---C++: inline
116     
117     ---===========================================
118     ---Category: private or protected API methods
119     --           
120     --============================================
121
122     Create(parent: MeshGroup) returns mutable MeshGroup
123     ---Purpose: constructor used internally to create subgroup
124     --          
125     is private;
126     
127
128 fields
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;
134     
135 end MeshGroup;