Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-24 09:16:17

0001 // Created on: 1994-06-02
0002 // Created by: Christian CAILLET
0003 // Copyright (c) 1994-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _IGESSelect_SplineToBSpline_HeaderFile
0018 #define _IGESSelect_SplineToBSpline_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_Type.hxx>
0022 
0023 #include <IFSelect_Transformer.hxx>
0024 class Interface_CopyControl;
0025 class Interface_Graph;
0026 class Interface_Protocol;
0027 class Interface_CheckIterator;
0028 class Interface_InterfaceModel;
0029 class Standard_Transient;
0030 class TCollection_AsciiString;
0031 
0032 //! This type of Transformer allows to convert Spline Curves (IGES
0033 //! type 112) and Surfaces (IGES Type 126) to BSpline Curves (IGES
0034 //! type 114) and Surfac (IGES Type 128). All other entities are
0035 //! rebuilt as identical but on the basis of this conversion.
0036 //!
0037 //! It also gives an option to, either convert as such (i.e. each
0038 //! starting part of the spline becomes a segment of the bspline,
0039 //! with continuity C0 between segments), or try to increase
0040 //! continuity as far as possible to C1 or to C2.
0041 //!
0042 //! It does nothing if the starting model contains no Spline
0043 //! Curve (IGES Type 112) or Surface (IGES Type 126). Else,
0044 //! converting and rebuilding implies copying of entities.
0045 class IGESSelect_SplineToBSpline : public IFSelect_Transformer
0046 {
0047 
0048 public:
0049   //! Creates a Transformer SplineToBSpline. If <tryC2> is True,
0050   //! it will in addition try to upgrade continuity up to C2.
0051   Standard_EXPORT IGESSelect_SplineToBSpline(const bool tryC2);
0052 
0053   //! Returns the option TryC2 given at creation time
0054   Standard_EXPORT bool OptionTryC2() const;
0055 
0056   //! Performs the transformation, if there is at least one Spline
0057   //! Curve (112) or Surface (126). Does nothing if there is none.
0058   Standard_EXPORT bool Perform(const Interface_Graph&                 G,
0059                                const occ::handle<Interface_Protocol>& protocol,
0060                                Interface_CheckIterator&               checks,
0061                                occ::handle<Interface_InterfaceModel>& newmod) override;
0062 
0063   //! Returns the transformed entities.
0064   //! If original data contained no Spline Curve or Surface,
0065   //! the result is identity : <entto> = <entfrom>
0066   //! Else, the copied counterpart is returned : for a Spline Curve
0067   //! or Surface, it is a converted BSpline Curve or Surface. Else,
0068   //! it is the result of general service Copy (rebuilt as necessary
0069   //! by BSPlines replacing Splines).
0070   Standard_EXPORT bool Updated(const occ::handle<Standard_Transient>& entfrom,
0071                                occ::handle<Standard_Transient>&       entto) const override;
0072 
0073   //! Returns a text which defines the way a Transformer works :
0074   //! "Conversion Spline to BSpline" and as opted,
0075   //! " trying to upgrade continuity"
0076   Standard_EXPORT TCollection_AsciiString Label() const override;
0077 
0078   DEFINE_STANDARD_RTTIEXT(IGESSelect_SplineToBSpline, IFSelect_Transformer)
0079 
0080 private:
0081   bool                               thetryc2;
0082   bool                               thefound;
0083   occ::handle<Interface_CopyControl> themap;
0084 };
0085 
0086 #endif // _IGESSelect_SplineToBSpline_HeaderFile