Replacing french comments by english one
[occt.git] / src / ChFi2d / ChFi2d_Builder.cdl
1 -- File:        ChFi2d_Builder.cdl
2 -- Created:     Mon Jun 12 13:53:51 1995
3 -- Author:      Philippe DERVIEUX
4 --              <phd@tlefon>
5 ---Copyright:    Matra Datavision 1995
6 -- Modified:    Tue Oct 22 09:23:11 1996
7 -- Author:      Joelle CHAUVET
8 --              <jct@sgi38>
9 --              add new method BuildNewEdge with special flag IsDegenerated (PRO4896)
10
11
12 class Builder from ChFi2d 
13
14         ---Purpose: This  class contains  the algorithm  used to build
15         --          fillet on planar wire.
16
17 uses
18     Face                from TopoDS,
19     Edge                from TopoDS,
20     Vertex              from TopoDS,
21     ConstructionError   from ChFi2d,
22     SequenceOfShape     from TopTools,
23     DataMapOfShapeShape from TopTools,
24     Pln                 from gp,
25     Real                from Standard,
26     Boolean             from Standard
27     
28 is
29
30     Create ;
31
32
33     Create ( F : Face );
34         ---Purpose: The face  <F> can be build  on a closed or an open
35         --          wire. 
36
37     
38     Init( me : in out; F : Face );
39
40
41     Init( me : in out; RefFace, ModFace : Face );
42     
43
44     AddFillet ( me : in out; V : Vertex; Radius : Real ) returns Edge;
45         ---Purpose: Add  a fillet  of   radius  <Radius> on  the  wire
46         --          between the two edges connected to the vertex <V>.
47         --          <AddFillet> returns the  fillet edge. The returned
48         --          edge has  sense only   if the status   <status> is
49         --          <IsDone> 
50
51
52     ModifyFillet ( me : in out; Fillet : Edge; Radius : Real) 
53     returns Edge;
54         ---Purpose: modify the fillet radius and return the new fillet
55         --          edge. this    edge has sense  only if   the status
56         --          <status> is <IsDone>.
57     
58
59     RemoveFillet( me : in out; Fillet : Edge)
60     returns Vertex;
61         ---Purpose: removes the fillet <Fillet> and returns the vertex
62         --          connecting the two adjacent edges to  this fillet. 
63
64     
65     AddChamfer ( me : in out; E1, E2 : Edge; D1, D2 : Real ) 
66     returns Edge;
67         ---Purpose: Add a chamfer on  the  wire between the two  edges
68         --          connected <E1> and  <E2>. <AddChamfer> returns the
69         --          chamfer  edge. This  edge  has  sense only if  the
70         --          status <status> is <IsDone>.
71
72
73     AddChamfer ( me : in out; E : Edge; V : Vertex; D, Ang  : Real ) 
74     returns Edge;
75         ---Purpose: Add  a chamfer on the   wire between the two edges
76         --          connected to the vertex <V>. The chamfer will make
77         --          an  angle <Ang> with the edge  <E>, and one of its
78         --          extremities  will be on  <E>  at distance <D>. The
79         --          returned   edge has sense   only   if the   status
80         --          <status> is <IsDone>.
81         --  Warning: The value of <Ang> must be expressed in Radian.
82
83
84     ModifyChamfer ( me : in out; Chamfer : Edge;
85                     E1 : Edge; E2 : Edge; D1, D2 : Real)
86     returns  Edge;
87         ---Purpose: modify the chamfer <Chamfer>  and returns  the new
88         --          chamfer edge. 
89         --          This edge as sense only  if the status <status> is
90         --          <IsDone>.
91
92
93
94     ModifyChamfer ( me : in out; Chamfer, E : Edge; D, Ang : Real)
95     returns  Edge;
96         ---Purpose: modify the  chamfer <Chamfer>  and returns the new
97         --          chamfer edge. This    edge as sense  only   if the
98         --          status <status>   is  <IsDone>.
99         --  Warning: The value of <Ang> must be expressed in Radian.
100     
101
102     RemoveChamfer( me : in out; Chamfer : Edge)
103     returns Vertex;
104         ---Purpose: removes   the chamfer  <Chamfer>   and returns the
105         --          vertex connecting  the two adjacent  edges to this
106         --          chamfer. 
107
108
109
110     Result( me ) returns Face;
111         ---Purpose: returns the modified face
112         ---C++:     inline 
113
114
115     IsModified( me; E : Edge ) returns Boolean;
116         ---C++:     inline 
117
118
119     FilletEdges( me ) returns SequenceOfShape; 
120         ---Purpose: returns the list of new edges
121         ---C++:     return const &
122         ---C++:     inline 
123
124
125     NbFillet( me ) returns Integer;
126         ---C++: inline 
127
128
129     ChamferEdges( me ) returns SequenceOfShape; 
130         ---Purpose: returns the list of new edges
131         ---C++:     return const &
132         ---C++:     inline 
133
134
135     NbChamfer( me ) returns Integer;
136         ---C++: inline 
137
138
139     HasDescendant( me; E : Edge) returns Boolean;
140         ---C++: inline 
141     
142     
143     DescendantEdge( me; E : Edge) returns Edge;
144         ---Purpose: returns the modified edge if <E> has descendant or
145         --          <E> in the other case.
146         ---C++:     return const &
147         ---C++:     inline 
148
149
150     BasisEdge( me; E : Edge) returns Edge;
151         ---Purpose: Returns the parent edge of  <E> 
152         --  Warning: If <E>is a basis edge,  the returned edge would be
153         --          equal to <E>
154         ---C++:     return const &
155
156
157     Status(me) returns ConstructionError from ChFi2d;
158         ---C++:     inline
159     
160
161     ComputeFillet ( me : in out; V : Vertex; E1, E2 : Edge; Radius : Real;
162                     TrimE1, TrimE2, Fillet : out Edge)
163     is private;
164         ---Purpose: Is internaly used by <AddFillet>. 
165         --  Warning: <TrimE1>, <TrimE2>, <Fillet> has sense only if the
166         --          status <status> is equal to <IsDone>
167     
168
169     ComputeChamfer ( me : in out; V : Vertex; E1, E2 : Edge; 
170                      D1, D2 : Real;
171                      TrimE1, TrimE2, Chamfer : out Edge)
172     is private;
173         ---Purpose: Is internaly used by  <AddChamfer>. The chamfer is
174         --          computed  from  a  vertex,   two  edges   and  two
175         --          distances   
176         --  Warning: <TrimE1>, <TrimE2> and <Chamfer> has sense only if
177         --          if the status <status> is equal to <IsDone>
178     
179
180     ComputeChamfer ( me : in out; V : Vertex; E1 : Edge; D, Ang : Real;
181                      E2 : Edge; TrimE1, TrimE2, Chamfer : out Edge)
182     is private;
183         ---Purpose: Is internaly used by <AddChamfer>.  The chamfer is
184         --          computed from   an  edge,  a  vertex,   a distance
185         --          and an angle
186         --  Warning: <TrimE1>,  <TrimE2>, and <Chamfer> has
187         --          sense only   if  the status <status> is   equal to
188         --          <IsDone>
189
190
191     BuildFilletEdge(me : in out; V : Vertex; AdjEdge1, AdjEdge2 : Edge; 
192                     Radius : Real;
193                     NewExtr1, NewExtr2 : out Vertex)
194     returns Edge
195     is private;
196         ---Purpose: Is   internaly  used     by  <ComputeFillet>.   
197         --          <NewExtr1> and  <NewExtr2>  will  contains the new 
198         --          extremities of <AdjEdge1> and <AdjEdge2>
199         --  Warning: The  returned  edge has sense   only if the status
200         --          <status> is equal to <IsDone>
201         --          or to one of those specific cases :
202         --              <FirstEdgeDegenerated>
203         --              <LastEdgeDegenerated>
204         --              <BothEdgesDegenerated>
205
206
207     BuildChamferEdge(me : in out; V : Vertex; AdjEdge1, AdjEdge2 : Edge; 
208                      D1, D2 : Real;
209                      NewExtr1, NewExtr2 : out Vertex)
210     returns Edge
211     is private;
212         ---Purpose: Is   internaly  used     by  <ComputeFillet>.   
213         --          <NewExtr1> and  <NewExtr2>  will  contains the new 
214         --          extremities of <AdjEdge1> and <AdjEdge2>
215         --  Warning: The  returned  edge has sense   only if the status
216         --          <status> is equal to <IsDone>
217
218
219     BuildChamferEdge(me : in out; V : Vertex; AdjEdge2 : Edge; 
220                      D, Ang : Real;
221                      AdjEdge1 : Edge; NewExtr1, NewExtr2 : out Vertex)
222     returns Edge
223     is private;
224         ---Purpose: Is   internaly  used     by  <ComputeFillet>.   
225         --          <NewExtr1> and  <NewExtr2>  will  contains the new 
226         --          extremities of <AdjEdge1> and <AdjEdge2>
227         --  Warning: The  returned  edge has sense   only if the status
228         --          <status> is equal to <IsDone>
229
230
231     BuildNewWire ( me : in out; OldE1, OldE2, E1, Fillet, E2 : Edge)
232     is private;
233         ---Purpose: replaces in  the  new face  <newFace> <OldE1>  and
234         --          <OldE2>  by <E1>, <Fillet> and <E2>
235         --          or by <Fillet> and <E2> if <E1> is degenerated
236         --          or by <E1> and <Fillet> if <E2> is degenerated
237         --          or by <Fillet> if <E1> and <E2> are degenerated .
238     
239     
240     BuildNewEdge ( me ; E1 : Edge; OldExtr, NewExtr : Vertex)
241     returns Edge
242     is private;
243         ---Purpose: Changes <OldExtr> of <E1> by <NewExtr>
244     
245     
246     BuildNewEdge ( me ; E1 : Edge; OldExtr, NewExtr : Vertex;
247                          IsDegenerated :  out Boolean)
248     returns Edge
249     is private;
250         ---Purpose: Changes <OldExtr> of <E1> by <NewExtr>
251         --          returns E1 and IsDegenerated = Standard_True
252         --          if the new edge is degenerated         
253     
254
255     UpDateHistory( me : in out; E1, E2, TrimE1, TrimE2, NewEdge : Edge; 
256                    Id : Integer)
257     is private;
258         ---Purpose: Writes <NewEdge> in  <fillets> if <Id> is equal to
259         --          1, or in <chamfers> if <Id> is Equal to 2.
260         --          Writes  the  modifications  in  <history> : 
261         --          <TrimE1> is given by <E1>, <TrimE2> by <E2>
262         --          if <TrimE1> and <TrimE2> are not degenerated.
263     
264
265     UpDateHistory( me : in out; E1, E2, TrimE1, TrimE2 : Edge)
266     is private;
267         ---Purpose: Writes the  modifications in  <history> . <TrimE1>
268         --          is given by <E1>, <TrimE2> by <E2>.
269
270
271     IsAFillet( me; E : Edge) returns Boolean is private;
272     
273     
274     IsAChamfer( me; E : Edge) returns Boolean is private;
275
276
277 fields
278
279     status      : ConstructionError   from ChFi2d;
280     refFace     : Face                from TopoDS;
281     newFace     : Face                from TopoDS;
282     fillets     : SequenceOfShape     from TopTools;
283     chamfers    : SequenceOfShape     from TopTools;
284     history     : DataMapOfShapeShape from TopTools;
285
286 end Builder;