0023024: Update headers of OCCT files
[occt.git] / src / BRepLib / BRepLib_MakeWire.cdl
1 -- Created on: 1993-07-08
2 -- Created by: Remi LEQUETTE
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22
23
24 class MakeWire from BRepLib inherits MakeShape from BRepLib 
25
26         ---Purpose: Provides methods to build wires.
27         --          
28         --          A wire may be built :
29         --          
30         --          * From a single edge.
31         --          
32         --          * From a wire and an edge.  
33         --          
34         --            - A new wire  is created with the edges  of  the
35         --            wire + the edge.
36         --          
37         --            - If the edge is not connnected  to the wire the
38         --            flag NotDone   is set and  the  method Wire will
39         --            raise an error.
40         --            
41         --            - The connection may be :
42         --              
43         --              . Through an existing vertex. The edge is shared.
44         --              
45         --              . Through a geometric coincidence of vertices.
46         --              The edge is  copied  and the vertices from the
47         --              edge are  replaced  by  the vertices from  the
48         --              wire.
49         --              
50         --              . The new edge and the connection vertices are
51         --              kept by the algorithm.
52         --              
53         --          
54         --          * From 2, 3, 4 edges.
55         --          
56         --              - A wire is  created from  the first edge, the
57         --              following edges are added.
58         --              
59         --          * From many edges.
60         --          
61         --              - The following syntax may be used :
62         --              
63         --                BRepLib_MakeWire MW;
64         --                
65         --                  // for all the edges ...
66         --                  MW.Add(anEdge);
67         --                
68         --                TopoDS_Wire W = MW;
69
70
71
72 uses
73     WireError   from BRepLib,
74     Wire        from TopoDS,
75     Edge        from TopoDS,
76     Vertex      from TopoDS,
77     MapOfShape  from TopTools,
78     ListOfShape from TopTools
79
80 raises
81     NotDone    from StdFail
82
83 is
84
85     Create                                              
86         ---Purpose: NotDone MakeWire.
87         ---Level: Public
88     returns MakeWire from BRepLib;
89     
90     ----------------------------------------------
91     -- From edges
92     ----------------------------------------------
93
94     Create(E : Edge from TopoDS)                        
95         ---Purpose: Make a Wire from an edge.
96         ---Level: Public
97     returns MakeWire from BRepLib;
98
99     Create(E1,E2 : Edge from TopoDS)                    
100         ---Purpose: Make a Wire from two edges.
101         ---Level: Public
102     returns MakeWire from BRepLib;
103
104     Create(E1,E2,E3 : Edge from TopoDS)                 
105         ---Purpose: Make a Wire from three edges.
106         ---Level: Public
107     returns MakeWire from BRepLib;
108
109     Create(E1,E2,E3,E4 : Edge from TopoDS)              
110         ---Purpose: Make a Wire from four edges.
111         ---Level: Public
112     returns MakeWire from BRepLib;
113
114     ----------------------------------------------
115     -- From wire and edge
116     ----------------------------------------------
117
118     Create(W : Wire from TopoDS)                        
119         ---Purpose: Make a Wire from a Wire. Usefull for adding later.
120         ---Level: Public
121     returns MakeWire from BRepLib;
122
123     Create(W : Wire from TopoDS; E : Edge from TopoDS)  
124         ---Purpose: Add an edge to a wire.
125         ---Level: Public
126     returns MakeWire from BRepLib;
127         
128     ----------------------------------------------
129     -- Auxiliary methods
130     ----------------------------------------------
131
132     Add(me : in out; E : Edge from TopoDS)
133         ---Purpose: Add the edge <E> to the current wire.
134         ---Level: Public
135     is static;
136     
137     Add(me : in out; W : Wire from TopoDS)
138         ---Purpose: Add the edges of <W> to the current wire.
139         ---Level: Public
140     is static;
141     
142     Add(me : in out; L : ListOfShape from TopTools)
143         ---Purpose: Add the edges of <L> to the current wire.
144         --          The edges are not to be consecutive.  But they are
145         --          to be all connected geometrically or topologically.
146         ---Level: Public
147     is static;
148     
149     ----------------------------------------------
150     -- Results
151     ----------------------------------------------
152
153     Error(me) returns WireError from BRepLib
154         ---Level: Public
155     is static;
156
157     Wire(me) returns Wire from TopoDS
158         ---Purpose: Returns the new wire.
159         --          
160         ---C++: return const &
161         ---C++: alias "Standard_EXPORT operator TopoDS_Wire() const;"
162         ---Level: Public
163     raises
164         NotDone from StdFail
165     is static;
166     
167     Edge(me) returns Edge from TopoDS
168         ---Purpose: Returns the last edge added to the wire.
169         --          
170         ---C++: return const &
171         ---Level: Public
172     raises
173         NotDone from StdFail
174     is static;
175     
176     Vertex(me) returns Vertex from TopoDS
177         ---Purpose: Returns the last connecting vertex.
178         --          
179         ---C++: return const &
180         ---Level: Public
181     raises
182         NotDone from StdFail
183     is static;
184      
185
186 fields
187     myError     : WireError   from BRepLib;
188     myEdge      : Edge        from TopoDS;
189     myVertex    : Vertex      from TopoDS;
190     myVertices  : MapOfShape  from TopTools; 
191     FirstVertex : Vertex      from TopoDS; 
192     VF,  VL     : Vertex      from TopoDS;
193
194 end MakeWire;