Salome HOME
sources v1.2
[modules/smesh.git] / src / SMDS / SMDS_MeshElement.cdl
1 --  SMESH SMDS : implementaion of Salome mesh data structure
2 --
3 --  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 --  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 -- 
6 --  This library is free software; you can redistribute it and/or 
7 --  modify it under the terms of the GNU Lesser General Public 
8 --  License as published by the Free Software Foundation; either 
9 --  version 2.1 of the License. 
10 -- 
11 --  This library is distributed in the hope that it will be useful, 
12 --  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 --  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 --  Lesser General Public License for more details. 
15 -- 
16 --  You should have received a copy of the GNU Lesser General Public 
17 --  License along with this library; if not, write to the Free Software 
18 --  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 -- 
20 --  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 --
22 --
23 --
24 --  File   : SMDS_MeshElement.cdl
25 --  Author : Jean-Michel BOULCOURT
26 --  Module : SMESH
27
28 deferred class MeshElement from SMDS inherits MeshObject from SMDS
29
30         ---Purpose:  MeshElement  is the  base class  for  all mesh --
31         --           elements that  constitutes  a mesh.  The children
32         --          classes will include   elements like  Node,  Edge,
33         --          Face, and Volume.
34
35 uses
36    ListOfMeshElement from SMDS,
37    HArray1OfDir from TColgp,
38    Dir from gp,
39    Vec from gp,
40    ElementType from SMDSAbs
41
42 raises
43    OutOfRange from Standard
44    
45 is
46     
47     Initialize(ID: Integer; NbConnections : Integer;
48                Type: ElementType from SMDSAbs) 
49     returns mutable MeshElement;
50
51     HashCode (me; Upper : Integer) returns Integer is redefined static;
52             ---Purpose: Returns a hashed value denoting <me>. This value is in
53             --         the range 1..<Upper>.
54             ---C++: inline
55
56     IsSame(me; other : MeshElement) returns Boolean;
57         ---Purpose: Returns True if two mesh elements are same but not
58         --          necessary the same orientation
59         ---C++: inline
60
61
62     IsEqual(me; other : MeshElement) returns Boolean;
63         ---Purpose:  Returns True if  two mesh  elements are  same and
64         --          havesame orientation
65         ---C++: inline
66
67
68     IsNodeInElement(me; idnode: Integer) returns Boolean;
69     ---Purpose: returns true or false if idnode is in the list of the
70     --          direct connections
71     ---C++: inline
72     
73     GetEdgeDefinedByNodes(me; rank: Integer; idnode1, idnode2 : out Integer) is virtual;
74     ---Purpose: returns the idnodes of the ith edge (rank) of the face
75     --          rank must be comprised between 1 and myNbConnections included.
76     
77     GetFaceDefinedByNodes(me; rank: Integer; idnode : Address;nb: out Integer) is virtual;
78     ---Purpose: returns the idnodes of the ith edge (rank) of the face
79     --          rank must be comprised between 1 and myNbConnections included.
80     
81     GetConnections(me) returns Address 
82     is virtual protected;
83
84     GetConnection(me; rank: Integer) returns Integer is virtual;
85
86     AddInverseElement(me:mutable; ME: MeshElement from SMDS) is virtual;
87
88     InverseElements(me) returns ListOfMeshElement is virtual;
89     ---C++: return const &
90     
91     ClearInverseElements(me: mutable) is virtual;
92     
93     NbNodes(me) returns Integer;
94     ---C++: inline
95
96     NbEdges(me) returns Integer
97     is virtual;
98
99     NbFaces(me) returns Integer
100     is virtual;
101
102     GetID(me) returns Integer;
103     ---Purpose: returns identifier of node
104     ---C++: inline
105
106     GetKey(me) returns Integer is deferred;
107     ---Purpose: returns key for hashcode
108
109
110     SetNormal(me: mutable; rank: Integer; vx,vy,vz : Real) is virtual;
111     ---Purpose: set the rank th normal of the element
112
113     SetNormal(me: mutable; rank: Integer; v : Vec from gp) is virtual;
114     ---Purpose: set the rank th normal of the element
115
116     GetNormal(me:mutable; rank: Integer) returns Dir from gp is virtual;
117     ---Purpose: get the rank th normal of the element
118
119     Print(me; OS: in out OStream) is virtual;
120    ---Purpose: 
121     ---C++:  alias  "friend Standard_EXPORT Standard_OStream& operator << (Standard_OStream& OS, const Handle(SMDS_MeshElement)& );"
122
123     GetType(me) returns ElementType from SMDSAbs;
124     ---Purpose: return the mesh element type
125     ---C++: inline
126
127 fields
128
129     myID      : Integer is protected;
130     myType    : ElementType from SMDSAbs;
131     myNbNodes : Integer is protected;
132     myNormals : HArray1OfDir from TColgp is protected; 
133
134 end MeshElement;