Salome HOME
This commit was generated by cvs2git to create branch 'IMPORT'.
[modules/smesh.git] / src / SMDS / SMDS_Mesh.cdl
1 -- File:        SMDS_Mesh.cdl
2 -- Created:     Wed Jan 23 12:08:54 2002
3 -- Author:      Jean-Michel BOULCOURT
4 --              <jmb@coulox.paris1.matra-dtv.fr>
5 ---Copyright:    Matra Datavision 2002
6
7
8 class Mesh from SMDS inherits MeshObject from SMDS
9
10         ---Purpose: 
11
12 uses
13     MeshNodeIDFactory from SMDS,
14     MeshElementIDFactory from SMDS,
15     ListOfMeshElement from SMDS,
16     ListOfMesh from SMDS,
17     MapOfMeshOrientedElement from SMDS,
18     MeshElement from SMDS,
19     MeshNode from SMDS,
20     ListIteratorOfListOfMesh from SMDS   
21 raises
22
23     NoSuchObject from Standard
24 is
25
26     ---================================
27     ---Category: public API methods
28     --           Mesh creation
29     --=================================
30
31     Create(nbnodes: Integer = 10; nbedges : Integer = 10; 
32            nbfaces : Integer = 10; nbvolumes : Integer = 10) returns mutable Mesh;
33     ---Purpose:  create a  new mesh.   It is  possible to  specify the
34     --          initial size  of elements.   
35     --          It is recommended  to set the size of mesh elements
36     --          in the constructor to avoid too much resizing of data storage
37
38     AddSubMesh(me: mutable) returns Mesh from SMDS
39     ---Purpose: create an submesh.
40     --          uses a private constructor to create a instance of the submesh
41     --          and attach it to the mesh parent.
42     is static;
43
44
45
46     ---================================
47     ---Category: public API methods
48     --           Mesh Element creation
49     --=================================
50
51     -- *** Nodes *** --
52    
53    
54     AddNode(me: mutable; x,y,z : Real) returns Integer
55     ---Purpose: create an instance of  MeshNode and add it to the mesh
56     --          if the mesh  has a parent then the  node is also added
57     --          to the parent mesh.
58     --          Returns a generated ID for the created node.
59     is virtual;
60
61     AddNodeWithID(me: mutable; x,y,z : Real; ID: Integer) returns Boolean
62     ---Purpose: create an instance of  MeshNode and add it to the mesh
63     --          if the mesh  has a parent then the  node is also added
64     --          to the parent mesh.
65     --          returns False in case the ID already exists
66     is virtual;
67
68     AddNode(me: mutable; ID : Integer) returns Boolean
69     ---Purpose: add  an existing node in  the mesh. This  is useful to
70     --          add a node from a parent mesh to the submesh
71     is virtual;
72
73
74     -- *** Edges *** --
75    
76     AddEdge(me: mutable; idnode1, idnode2 : Integer) returns Integer
77     ---Purpose: create an instance of MeshEdge and add it to the mesh
78     --          returns the id of the element. Returns 0 if creation failed
79     is virtual;
80
81     AddEdgeWithID(me: mutable; idnode1, idnode2, ID : Integer) returns Boolean
82     ---Purpose: create an instance of MeshEdge and add it to the mesh
83     is virtual;
84
85
86     -- *** Faces *** --
87    
88     AddFace(me: mutable; idnode1, idnode2, idnode3 : Integer) returns Integer
89     ---Purpose: create an instance of MeshFace and add it to the mesh
90     --          returns the id of the element. Returns 0 if creation failed
91     is virtual;
92
93     AddFaceWithID(me: mutable; idnode1, idnode2, idnode3, ID : Integer) returns Boolean
94     ---Purpose: create an instance of MeshFace and add it to the mesh
95     is virtual;
96
97
98     AddFace(me: mutable; idnode1, idnode2, idnode3, idnode4 : Integer) 
99     returns Integer
100     ---Purpose: create an instance of MeshFace and add it to the mesh
101     --          returns the id of the element. Returns 0 if creation failed
102     is virtual;
103
104     AddFaceWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, ID : Integer) 
105     returns Boolean
106     ---Purpose: create an instance of MeshFace and add it to the mesh
107     is virtual;
108
109
110
111     -- *** Volumes *** --
112
113     AddVolume(me: mutable; idnode1, idnode2, idnode3, idnode4 : Integer) 
114     returns Integer
115     ---Purpose: create an instance of MeshVolume and add it to the mesh
116     --          returns the id of the element. Returns 0 if creation failed
117     is virtual;
118
119     AddVolumeWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, ID : Integer) 
120     returns Boolean
121     ---Purpose: create an instance of MeshVolume and add it to the mesh
122     is virtual;
123
124     AddVolume(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5 : Integer) 
125     returns Integer
126     ---Purpose: create an instance of MeshVolume and add it to the mesh
127     --          returns the id of the element. Returns 0 if creation failed
128     is virtual;
129
130     AddVolumeWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, ID : Integer) 
131     returns Boolean
132     ---Purpose: create an instance of MeshVolume and add it to the mesh
133     is virtual;
134
135     AddVolume(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, idnode6 : Integer) 
136     returns Integer
137     ---Purpose: create an instance of MeshVolume and add it to the mesh
138     --          returns the id of the element. Returns 0 if creation failed
139     is virtual;
140
141     AddVolumeWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, idnode6, ID : Integer) 
142     returns Boolean
143     ---Purpose: create an instance of MeshVolume and add it to the mesh
144     is virtual;
145
146     AddVolume(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, idnode6,
147                            idnode7, idnode8 : Integer) 
148     returns Integer
149     ---Purpose: create an instance of MeshVolume and add it to the mesh
150     --          returns the id of the element. Returns 0 if creation failed
151     is virtual;
152
153     AddVolumeWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, idnode6,
154                            idnode7, idnode8, ID : Integer) 
155     returns Boolean
156     ---Purpose: create an instance of MeshVolume and add it to the mesh
157     is virtual;
158
159
160     AddVolume(me: mutable; node1, node2, node3, node4 : MeshElement) 
161     returns MeshElement from SMDS
162     ---Purpose: create an instance of MeshVolume and add it to the mesh
163     is static;
164
165     AddVolume(me: mutable; node1, node2, node3, node4, node5 : MeshElement) 
166     returns MeshElement from SMDS
167     ---Purpose: create an instance of MeshVolume and add it to the mesh
168     is static;
169
170     AddVolume(me: mutable; node1, node2, node3, node4, node5, node6 : MeshElement) 
171     returns MeshElement from SMDS
172     ---Purpose: create an instance of MeshVolume and add it to the mesh
173     is static;
174
175     AddVolume(me: mutable; node1, node2, node3, node4, 
176                            node5, node6, node7, node8 : MeshElement) 
177     returns MeshElement from SMDS
178     ---Purpose: create an instance of MeshVolume and add it to the mesh
179     is static;
180
181
182
183     ---================================
184     ---Category: public API methods
185     --           Mesh Element deletion
186     --=================================
187
188
189     RemoveNode(me: mutable; IDnode: Integer)
190     ---Purpose: remove the node IDnode in the mesh and in all the children mesh
191     --          if it exists, it remains in the parent mesh
192     --          if the mesh has no parent, then ID is released
193     is virtual;
194     
195     RemoveEdge(me: mutable; idnode1, idnode2 : Integer)
196     ---Purpose: remove the edge defined by idnode1,idnode2 in the mesh
197     is virtual;
198     
199     RemoveFace(me: mutable; idnode1, idnode2, idnode3 : Integer)
200     ---Purpose: remove the face defined by idnode1,idnode2,idnode3 in the mesh
201     is virtual;
202     
203     RemoveFace(me: mutable; idnode1, idnode2, idnode3, idnode4 : Integer)
204     ---Purpose: remove the face defined by idnode1,idnode2,idnode3,idnode4 in the mesh
205     is virtual;
206
207     RemoveElement(me: mutable; IDelem : Integer;removenodes : Boolean = Standard_False)
208     ---Purpose: remove the mesh element IDelem
209     --          Caution : Cannot be used to remove nodes, instead
210     --          use method RemoveNode
211     is virtual;
212
213     RemoveElement(me: mutable; elem: MeshElement;removenodes : Boolean = Standard_False)
214     is static;
215
216     RemoveFromParent(me: mutable)
217     returns Boolean
218     ---Purpose: remove this from its parent
219     --          if this has no parent then it returns False (True otherwise)
220     is virtual;
221
222     RemoveSubMesh(me: mutable; aMesh : Mesh from SMDS)
223     returns Boolean
224     ---Purpose: remove aMesh from the list of Children
225     --          if the submesh does not belong to this, it returns False
226     --          (True otherwiswe)
227     is virtual;
228
229     ---================================
230     ---Category: public API methods
231     --           Mesh exploration
232     --=================================
233
234     GetNode(me; rank: Integer; ME: MeshElement) returns MeshNode from SMDS
235     is static;
236
237     FindNode(me; idnode: Integer) returns MeshElement from SMDS
238     ---Purpose: return the meshnode idnode in the mesh
239     is static;
240
241     FindEdge(me; idnode1, idnode2: Integer) returns MeshElement from SMDS
242     ---Purpose: 
243     is static;
244
245     FindFace(me; idnode1, idnode2, idnode3: Integer) returns MeshElement from SMDS
246     ---Purpose: 
247     is static;
248
249     FindFace(me; idnode1, idnode2, idnode3, idnode4: Integer) returns MeshElement from SMDS
250     ---Purpose: 
251     is static;
252
253     FindElement(me; IDelem: Integer) returns MeshElement from SMDS
254     ---Purpose:  returns the mesh element corresponding to IDelem
255     is static;
256
257     Contains(me; elem: MeshElement) returns Boolean
258     ---Purpose: 
259     is static;
260
261     RebuildAllInverseConnections(me: mutable)
262     ---Purpose: clean the inverse connections and rebuild them
263     --          completely. If the mesh has children, the 
264     --          inverse connections are also rebuilt
265     is static;
266
267     SubMeshIterator(me;itmsh: out ListIteratorOfListOfMesh from SMDS)
268     ---Purpose: 
269     is static;
270
271     
272     NbNodes(me) returns Integer;
273     ---C++: inline
274
275     NbEdges(me) returns Integer;
276     ---C++: inline
277
278     NbFaces(me) returns Integer;
279     ---C++: inline
280
281     NbVolumes(me) returns Integer;
282     ---C++: inline
283
284     NbSubMesh(me) returns Integer;
285     ---C++: inline
286
287     DumpNodes(me);
288
289     DumpEdges(me);
290
291     DumpFaces(me);
292
293     DumpVolumes(me);
294
295     DebugStats(me);
296
297
298
299     ---Category: private or protected methods
300     --           
301
302     Create(parent: Mesh; nbnodes: Integer = 10) returns mutable Mesh
303     ---Purpose: constructor used internally to create submesh
304     --          
305     is private;
306     
307     AddNode(me: mutable; node : MeshElement ) returns Boolean
308     ---Purpose: add a node in the mesh
309     --          if the mesh has parent, the node is also added to the parent.
310     --          returns False if the node is invalid ( null handle)
311     is private;
312
313     CreateEdge(me; ID, idnode1, idnode2 : Integer) returns MeshElement from SMDS;
314
315     CreateFace(me; ID, idnode1, idnode2, idnode3 : Integer) returns MeshElement from SMDS;
316
317     CreateFace(me; ID, idnode1, idnode2, idnode3, idnode4 : Integer) 
318     returns MeshElement from SMDS;
319
320     CreateVolume(me; ID, idnode1, idnode2, idnode3, idnode4 : Integer) 
321     returns MeshElement from SMDS;
322
323     CreateVolume(me; ID, idnode1, idnode2, idnode3, idnode4, idnode5 : Integer) 
324     returns MeshElement from SMDS;
325
326     CreateVolume(me; ID, idnode1, idnode2, idnode3, idnode4, idnode5, idnode6 : Integer) 
327     returns MeshElement from SMDS;
328
329     CreateVolume(me; ID, idnode1, idnode2, idnode3, idnode4, idnode5, idnode6, idnode7, idnode8 : Integer) 
330     returns MeshElement from SMDS;
331
332
333     FindNode(me; node: MeshElement) returns MeshElement from SMDS
334     ---Purpose: 
335     is protected;
336
337     FindEdge(me; edge: MeshElement) returns MeshElement from SMDS
338     ---Purpose: 
339     is protected;
340
341     FindFace(me; face: MeshElement) returns MeshElement from SMDS
342     ---Purpose: 
343     is protected;
344
345     FindVolume(me; volume: MeshElement) returns MeshElement from SMDS
346     ---Purpose: 
347     is protected;
348
349
350     RemoveInverseElement(me; node,parent : MeshElement)
351     ---Purpose: 
352     is protected;
353
354     FreeNode(me: mutable; node: MeshElement)
355     is private;
356
357     RemoveNode(me: mutable; node: MeshElement) returns Boolean
358     is protected;
359
360     RemoveEdge(me: mutable; edge: MeshElement)
361     is protected;
362     
363     RemoveFace(me: mutable; face: MeshElement)
364     is protected;
365
366     RemoveVolume(me: mutable; volume: MeshElement)
367     is protected;
368
369
370
371     GetNode(me; ID: Integer) returns MeshElement from SMDS
372     is protected;
373
374     RemoveAncestors(me: mutable; ME: MeshElement from SMDS; map: MapOfMeshOrientedElement from SMDS)
375     is protected;
376
377     BuildMapNodeAncestors(me; ME: MeshElement from SMDS;map: in out MapOfMeshOrientedElement from SMDS)
378     is private;
379
380     BuildMapEdgeAncestors(me; ME: MeshElement from SMDS;map: in out MapOfMeshOrientedElement from SMDS)
381     is private;
382
383     BuildMapFaceAncestors(me; ME: MeshElement from SMDS;map: in out MapOfMeshOrientedElement from SMDS)
384     is private;
385
386     RebuildInverseConnections(me: mutable)
387     ---Purpose: 
388     is private;
389
390
391 fields
392
393     myNodes     : MapOfMeshOrientedElement      from SMDS;
394     myEdges     : MapOfMeshOrientedElement      from SMDS;
395     myFaces     : MapOfMeshOrientedElement      from SMDS;
396     myVolumes   : MapOfMeshOrientedElement      from SMDS;
397     myParent    : Mesh from SMDS;
398     myChildren  : ListOfMesh from SMDS;
399     myNodeIDFactory : MeshNodeIDFactory from SMDS;
400     myElementIDFactory : MeshElementIDFactory from SMDS;
401     myHasInverse : Boolean;
402 friends
403      class MeshVolumesIterator from SMDS,
404      class MeshFacesIterator from SMDS,
405      class MeshEdgesIterator from SMDS,
406      class MeshNodesIterator from SMDS
407    
408 end Mesh;