1 // Created on: 1994-06-02
2 // Created by: Christian CAILLET
3 // Copyright (c) 1994-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _IGESSelect_SplineToBSpline_HeaderFile
18 #define _IGESSelect_SplineToBSpline_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Boolean.hxx>
24 #include <IFSelect_Transformer.hxx>
25 class Interface_CopyControl;
26 class Interface_Graph;
27 class Interface_Protocol;
28 class Interface_CheckIterator;
29 class Interface_InterfaceModel;
30 class Standard_Transient;
31 class TCollection_AsciiString;
34 class IGESSelect_SplineToBSpline;
35 DEFINE_STANDARD_HANDLE(IGESSelect_SplineToBSpline, IFSelect_Transformer)
37 //! This type of Transformer allows to convert Spline Curves (IGES
38 //! type 112) and Surfaces (IGES Type 126) to BSpline Curves (IGES
39 //! type 114) and Surfac (IGES Type 128). All other entities are
40 //! rebuilt as identical but on the basis of this conversion.
42 //! It also gives an option to, either convert as such (i.e. each
43 //! starting part of the spline becomes a segment of the bspline,
44 //! with continuity C0 between segments), or try to increase
45 //! continuity as far as possible to C1 or to C2.
47 //! It does nothing if the starting model contains no Spline
48 //! Curve (IGES Type 112) or Surface (IGES Type 126). Else,
49 //! converting and rebuilding implies copying of entities.
50 class IGESSelect_SplineToBSpline : public IFSelect_Transformer
56 //! Creates a Transformer SplineToBSpline. If <tryC2> is True,
57 //! it will in addition try to upgrade continuity up to C2.
58 Standard_EXPORT IGESSelect_SplineToBSpline(const Standard_Boolean tryC2);
60 //! Returns the option TryC2 given at creation time
61 Standard_EXPORT Standard_Boolean OptionTryC2() const;
63 //! Performs the transformation, if there is at least one Spline
64 //! Curve (112) or Surface (126). Does nothing if there is none.
65 Standard_EXPORT Standard_Boolean Perform (const Interface_Graph& G, const Handle(Interface_Protocol)& protocol, Interface_CheckIterator& checks, Handle(Interface_InterfaceModel)& newmod) Standard_OVERRIDE;
67 //! Returns the transformed entities.
68 //! If original data contained no Spline Curve or Surface,
69 //! the result is identity : <entto> = <entfrom>
70 //! Else, the copied counterpart is returned : for a Spline Curve
71 //! or Surface, it is a converted BSpline Curve or Surface. Else,
72 //! it is the result of general service Copy (rebuilt as necessary
73 //! by BSPlines replacing Splines).
74 Standard_EXPORT Standard_Boolean Updated (const Handle(Standard_Transient)& entfrom, Handle(Standard_Transient)& entto) const Standard_OVERRIDE;
76 //! Returns a text which defines the way a Transformer works :
77 //! "Conversion Spline to BSpline" and as opted,
78 //! " trying to upgrade continuity"
79 Standard_EXPORT TCollection_AsciiString Label() const Standard_OVERRIDE;
84 DEFINE_STANDARD_RTTI(IGESSelect_SplineToBSpline,IFSelect_Transformer)
94 Standard_Boolean thetryc2;
95 Standard_Boolean thefound;
96 Handle(Interface_CopyControl) themap;
107 #endif // _IGESSelect_SplineToBSpline_HeaderFile