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
8 class Mesh from SMDS inherits MeshObject from SMDS
13 MeshNodeIDFactory from SMDS,
14 MeshElementIDFactory from SMDS,
15 ListOfMeshElement from SMDS,
17 MapOfMeshOrientedElement from SMDS,
18 MeshElement from SMDS,
20 ListIteratorOfListOfMesh from SMDS
23 NoSuchObject from Standard
26 ---================================
27 ---Category: public API methods
29 --=================================
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
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.
46 ---================================
47 ---Category: public API methods
48 -- Mesh Element creation
49 --=================================
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.
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
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
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
81 AddEdgeWithID(me: mutable; idnode1, idnode2, ID : Integer) returns Boolean
82 ---Purpose: create an instance of MeshEdge and add it to the mesh
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
93 AddFaceWithID(me: mutable; idnode1, idnode2, idnode3, ID : Integer) returns Boolean
94 ---Purpose: create an instance of MeshFace and add it to the mesh
98 AddFace(me: mutable; idnode1, idnode2, idnode3, idnode4 : 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
104 AddFaceWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, ID : Integer)
106 ---Purpose: create an instance of MeshFace and add it to the mesh
111 -- *** Volumes *** --
113 AddVolume(me: mutable; idnode1, idnode2, idnode3, idnode4 : 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
119 AddVolumeWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, ID : Integer)
121 ---Purpose: create an instance of MeshVolume and add it to the mesh
124 AddVolume(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5 : 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
130 AddVolumeWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, ID : Integer)
132 ---Purpose: create an instance of MeshVolume and add it to the mesh
135 AddVolume(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, idnode6 : 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
141 AddVolumeWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, idnode6, ID : Integer)
143 ---Purpose: create an instance of MeshVolume and add it to the mesh
146 AddVolume(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, idnode6,
147 idnode7, idnode8 : 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
153 AddVolumeWithID(me: mutable; idnode1, idnode2, idnode3, idnode4, idnode5, idnode6,
154 idnode7, idnode8, ID : Integer)
156 ---Purpose: create an instance of MeshVolume and add it to the mesh
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
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
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
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
183 ---================================
184 ---Category: public API methods
185 -- Mesh Element deletion
186 --=================================
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
195 RemoveEdge(me: mutable; idnode1, idnode2 : Integer)
196 ---Purpose: remove the edge defined by idnode1,idnode2 in the mesh
199 RemoveFace(me: mutable; idnode1, idnode2, idnode3 : Integer)
200 ---Purpose: remove the face defined by idnode1,idnode2,idnode3 in the mesh
203 RemoveFace(me: mutable; idnode1, idnode2, idnode3, idnode4 : Integer)
204 ---Purpose: remove the face defined by idnode1,idnode2,idnode3,idnode4 in the mesh
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
213 RemoveElement(me: mutable; elem: MeshElement;removenodes : Boolean = Standard_False)
216 RemoveFromParent(me: mutable)
218 ---Purpose: remove this from its parent
219 -- if this has no parent then it returns False (True otherwise)
222 RemoveSubMesh(me: mutable; aMesh : Mesh from SMDS)
224 ---Purpose: remove aMesh from the list of Children
225 -- if the submesh does not belong to this, it returns False
229 ---================================
230 ---Category: public API methods
232 --=================================
234 GetNode(me; rank: Integer; ME: MeshElement) returns MeshNode from SMDS
237 FindNode(me; idnode: Integer) returns MeshElement from SMDS
238 ---Purpose: return the meshnode idnode in the mesh
241 FindEdge(me; idnode1, idnode2: Integer) returns MeshElement from SMDS
245 FindFace(me; idnode1, idnode2, idnode3: Integer) returns MeshElement from SMDS
249 FindFace(me; idnode1, idnode2, idnode3, idnode4: Integer) returns MeshElement from SMDS
253 FindElement(me; IDelem: Integer) returns MeshElement from SMDS
254 ---Purpose: returns the mesh element corresponding to IDelem
257 Contains(me; elem: MeshElement) returns Boolean
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
267 SubMeshIterator(me;itmsh: out ListIteratorOfListOfMesh from SMDS)
272 NbNodes(me) returns Integer;
275 NbEdges(me) returns Integer;
278 NbFaces(me) returns Integer;
281 NbVolumes(me) returns Integer;
284 NbSubMesh(me) returns Integer;
299 ---Category: private or protected methods
302 Create(parent: Mesh; nbnodes: Integer = 10) returns mutable Mesh
303 ---Purpose: constructor used internally to create submesh
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)
313 CreateEdge(me; ID, idnode1, idnode2 : Integer) returns MeshElement from SMDS;
315 CreateFace(me; ID, idnode1, idnode2, idnode3 : Integer) returns MeshElement from SMDS;
317 CreateFace(me; ID, idnode1, idnode2, idnode3, idnode4 : Integer)
318 returns MeshElement from SMDS;
320 CreateVolume(me; ID, idnode1, idnode2, idnode3, idnode4 : Integer)
321 returns MeshElement from SMDS;
323 CreateVolume(me; ID, idnode1, idnode2, idnode3, idnode4, idnode5 : Integer)
324 returns MeshElement from SMDS;
326 CreateVolume(me; ID, idnode1, idnode2, idnode3, idnode4, idnode5, idnode6 : Integer)
327 returns MeshElement from SMDS;
329 CreateVolume(me; ID, idnode1, idnode2, idnode3, idnode4, idnode5, idnode6, idnode7, idnode8 : Integer)
330 returns MeshElement from SMDS;
333 FindNode(me; node: MeshElement) returns MeshElement from SMDS
337 FindEdge(me; edge: MeshElement) returns MeshElement from SMDS
341 FindFace(me; face: MeshElement) returns MeshElement from SMDS
345 FindVolume(me; volume: MeshElement) returns MeshElement from SMDS
350 RemoveInverseElement(me; node,parent : MeshElement)
354 FreeNode(me: mutable; node: MeshElement)
357 RemoveNode(me: mutable; node: MeshElement) returns Boolean
360 RemoveEdge(me: mutable; edge: MeshElement)
363 RemoveFace(me: mutable; face: MeshElement)
366 RemoveVolume(me: mutable; volume: MeshElement)
371 GetNode(me; ID: Integer) returns MeshElement from SMDS
374 RemoveAncestors(me: mutable; ME: MeshElement from SMDS; map: MapOfMeshOrientedElement from SMDS)
377 BuildMapNodeAncestors(me; ME: MeshElement from SMDS;map: in out MapOfMeshOrientedElement from SMDS)
380 BuildMapEdgeAncestors(me; ME: MeshElement from SMDS;map: in out MapOfMeshOrientedElement from SMDS)
383 BuildMapFaceAncestors(me; ME: MeshElement from SMDS;map: in out MapOfMeshOrientedElement from SMDS)
386 RebuildInverseConnections(me: mutable)
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;
403 class MeshVolumesIterator from SMDS,
404 class MeshFacesIterator from SMDS,
405 class MeshEdgesIterator from SMDS,
406 class MeshNodesIterator from SMDS