1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
15 #include <IGESData_IGESEntity.hxx>
16 #include <IGESSelect_SplineToBSpline.hxx>
17 #include <Interface_Check.hxx>
18 #include <Interface_CheckIterator.hxx>
19 #include <Interface_CopyControl.hxx>
20 #include <Interface_Graph.hxx>
21 #include <Interface_InterfaceModel.hxx>
22 #include <Interface_Macros.hxx>
23 #include <Interface_Protocol.hxx>
24 #include <Standard_Transient.hxx>
25 #include <Standard_Type.hxx>
26 #include <TCollection_AsciiString.hxx>
28 IMPLEMENT_STANDARD_RTTIEXT(IGESSelect_SplineToBSpline,IFSelect_Transformer)
30 IGESSelect_SplineToBSpline::IGESSelect_SplineToBSpline
31 (const Standard_Boolean tryC2)
33 thetryc2 = tryC2; thefound = Standard_False;
36 Standard_Boolean IGESSelect_SplineToBSpline::OptionTryC2 () const
42 Standard_Boolean IGESSelect_SplineToBSpline::Perform
43 (const Interface_Graph& G, const Handle(Interface_Protocol)&,
44 Interface_CheckIterator& checks,
45 Handle(Interface_InterfaceModel)& newmod)
47 Standard_Integer nbe = G.Size();
48 thefound = Standard_False;
50 for (Standard_Integer i = 1; i <= nbe; i ++) {
51 DeclareAndCast(IGESData_IGESEntity,ent,G.Entity(i));
52 if (ent.IsNull()) continue;
53 Standard_Integer it = ent->TypeNumber();
54 if (it == 112 || it == 126) {
55 thefound = Standard_True;
57 std::cout<<"IGESSelect_SplineToBSpline : n0."<<i
58 << (it == 112 ? ", Curve" : ", Surface")<<" to convert"<<std::endl;
63 if (!thefound) return Standard_True;
65 // Il faudrait convertir ...
66 checks.CCheck(0)->AddFail("IGESSelect_SplineToBSpline : not yet implemented");
67 return Standard_False;
71 Standard_Boolean IGESSelect_SplineToBSpline::Updated
72 (const Handle(Standard_Transient)& entfrom,
73 Handle(Standard_Transient)& entto) const
79 if (themap.IsNull()) return Standard_False;
80 return themap->Search(entfrom,entto);
84 TCollection_AsciiString IGESSelect_SplineToBSpline::Label () const
86 if (thetryc2) return TCollection_AsciiString
87 ("Convert Spline Forms to BSpline, trying to recover C1-C2 continuity");
88 else return TCollection_AsciiString ("Convert Spline Forms to BSpline");