1 // Created on: 1994-09-01
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 _IGESConvGeom_HeaderFile
18 #define _IGESConvGeom_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Integer.hxx>
25 #include <Standard_Real.hxx>
26 class IGESGeom_SplineCurve;
27 class Geom_BSplineCurve;
28 class Geom2d_BSplineCurve;
29 class IGESGeom_SplineSurface;
30 class Geom_BSplineSurface;
31 class IGESConvGeom_GeomBuilder;
34 //! This package is intended to gather geometric conversion which
35 //! are not immediate but can be used for several purposes :
36 //! mainly, standard conversion to and from CasCade geometric and
37 //! topologic data, and adaptations of IGES files as required
38 //! (as replacing Spline entities to BSpline equivalents).
46 //! basic tool to build curves from IGESGeom (arrays of points,
47 //! Transformations, evaluation of points in a datum)
48 //! Converts a SplineCurve from IGES to a BSplineCurve from CasCade
49 //! <epscoef> gives tolerance to consider coefficient to be nul
50 //! <epsgeom> gives tolerance to consider poles to be equal
51 //! The returned value is a status with these possible values :
53 //! - 1 the result is not guaranteed to be C0 (with <epsgeom>)
54 //! - 2 SplineType not processed (allowed : max 3)
55 //! (no result produced)
56 //! - 3 error during creation of control points
57 //! (no result produced)
58 //! - 4 polynomial equation is not correct (no result produced)
59 //! - 5 less than one segment (no result produced)
60 Standard_EXPORT static Standard_Integer SplineCurveFromIGES (const Handle(IGESGeom_SplineCurve)& igesent, const Standard_Real epscoef, const Standard_Real epsgeom, Handle(Geom_BSplineCurve)& result);
62 //! Tries to increase curve continuity with tolerance <epsgeom>
63 //! <continuity> is the new desired continuity, can be 1 or 2
64 //! (more than 2 is considered as 2).
65 //! Returns the new maximum continuity obtained on all knots.
66 //! Remark that, for instance with <continuity> = 2, even if not
67 //! all the knots can be passed to C2, all knots which can be are.
68 Standard_EXPORT static Standard_Integer IncreaseCurveContinuity (const Handle(Geom_BSplineCurve)& curve, const Standard_Real epsgeom, const Standard_Integer continuity = 2);
70 Standard_EXPORT static Standard_Integer IncreaseCurveContinuity (const Handle(Geom2d_BSplineCurve)& curve, const Standard_Real epsgeom, const Standard_Integer continuity = 2);
72 //! Converts a SplineSurface from IGES to a BSplineSurface from CasCade
73 //! <epscoef> gives tolerance to consider coefficient to be nul
74 //! <epsgeom> gives tolerance to consider poles to be equal
75 //! The returned value is a status with these possible values :
77 //! - 1 the result is not guaranteed to be C0 (with <epsgeom>)
78 //! - 2 degree is not compatible with code boundary type
79 //! (warning) but C0 is OK
80 //! - 3 idem but C0 is not guaranteed (warning)
81 //! - 4 degree has been determined to be nul, either in U or V
82 //! (no result produced)
83 //! - 5 less than one segment in U or V (no result produced)
84 Standard_EXPORT static Standard_Integer SplineSurfaceFromIGES (const Handle(IGESGeom_SplineSurface)& igesent, const Standard_Real epscoef, const Standard_Real epsgeom, Handle(Geom_BSplineSurface)& result);
86 //! Tries to increase Surface continuity with tolerance <epsgeom>
87 //! <continuity> is the new desired continuity, can be 1 or 2
88 //! (more than 2 is considered as 2).
89 //! Returns the new maximum continuity obtained on all knots.
90 //! Remark that, for instance with <continuity> = 2, even if not
91 //! all the knots can be passed to C2, all knots which can be are.
92 Standard_EXPORT static Standard_Integer IncreaseSurfaceContinuity (const Handle(Geom_BSplineSurface)& surface, const Standard_Real epsgeom, const Standard_Integer continuity = 2);
108 friend class IGESConvGeom_GeomBuilder;
118 #endif // _IGESConvGeom_HeaderFile