b311480e |
1 | -- Created on: 1994-06-02 |
2 | -- Created by: Christian CAILLET |
3 | -- Copyright (c) 1994-1999 Matra Datavision |
973c2be1 |
4 | -- Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | -- |
973c2be1 |
6 | -- This file is part of Open CASCADE Technology software library. |
b311480e |
7 | -- |
d5f74e42 |
8 | -- This library is free software; you can redistribute it and/or modify it under |
9 | -- the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
10 | -- by the Free Software Foundation, with special exception defined in the file |
11 | -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
12 | -- distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
13 | -- |
973c2be1 |
14 | -- Alternatively, this file may be used under the terms of Open CASCADE |
15 | -- commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | class SplineToBSpline from IGESSelect inherits Transformer |
18 | |
19 | ---Purpose : This type of Transformer allows to convert Spline Curves (IGES |
20 | -- type 112) and Surfaces (IGES Type 126) to BSpline Curves (IGES |
21 | -- type 114) and Surfac (IGES Type 128). All other entities are |
22 | -- rebuilt as identical but on the basis of this conversion. |
23 | -- |
24 | -- It also gives an option to, either convert as such (i.e. each |
25 | -- starting part of the spline becomes a segment of the bspline, |
26 | -- with continuity C0 between segments), or try to increase |
27 | -- continuity as far as possible to C1 or to C2. |
28 | -- |
29 | -- It does nothing if the starting model contains no Spline |
30 | -- Curve (IGES Type 112) or Surface (IGES Type 126). Else, |
31 | -- converting and rebuilding implies copying of entities. |
32 | |
33 | uses AsciiString from TCollection, |
34 | CheckIterator, Graph, CopyControl, Protocol from Interface, InterfaceModel |
35 | |
36 | is |
37 | |
6e33d3ce |
38 | Create (tryC2 : Boolean) returns SplineToBSpline; |
7fd59977 |
39 | ---Purpose : Creates a Transformer SplineToBSpline. If <tryC2> is True, |
40 | -- it will in addition try to upgrade continuity up to C2. |
41 | |
42 | OptionTryC2 (me) returns Boolean; |
43 | ---Purpose : Returns the option TryC2 given at creation time |
44 | |
45 | Perform (me : mutable; G : Graph; protocol : Protocol from Interface; |
46 | checks : in out CheckIterator; |
6e33d3ce |
47 | newmod : out InterfaceModel) returns Boolean; |
7fd59977 |
48 | ---Purpose : Performs the transformation, if there is at least one Spline |
49 | -- Curve (112) or Surface (126). Does nothing if there is none. |
50 | |
6e33d3ce |
51 | Updated (me; entfrom : Transient; entto : out Transient) |
7fd59977 |
52 | returns Boolean; |
53 | ---Purpose : Returns the transformed entities. |
54 | -- If original data contained no Spline Curve or Surface, |
55 | -- the result is identity : <entto> = <entfrom> |
56 | -- Else, the copied counterpart is returned : for a Spline Curve |
57 | -- or Surface, it is a converted BSpline Curve or Surface. Else, |
58 | -- it is the result of general service Copy (rebuilt as necessary |
59 | -- by BSPlines replacing Splines). |
60 | |
61 | Label (me) returns AsciiString from TCollection; |
62 | ---Purpose : Returns a text which defines the way a Transformer works : |
63 | -- "Conversion Spline to BSpline" and as opted, |
64 | -- " trying to upgrade continuity" |
65 | |
66 | fields |
67 | |
68 | thetryc2 : Boolean; |
69 | thefound : Boolean; -- at least one Spline found and converted |
70 | themap : CopyControl; |
71 | |
72 | end SplineToBSpline; |