1 // Created on: 1996-03-05 2 // Created by: Joelle CHAUVET 3 // Copyright (c) 1996-1999 Matra Datavision 4 // Copyright (c) 1999-2014 OPEN CASCADE SAS 5 // 6 // This file is part of Open CASCADE Technology software library. 7 // 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. 13 // 14 // Alternatively, this file may be used under the terms of Open CASCADE 15 // commercial license or contractual agreement. 16 17 #ifndef _GeomPlate_MakeApprox_HeaderFile 18 #define _GeomPlate_MakeApprox_HeaderFile 19 20 #include <Standard.hxx> 21 #include <Standard_DefineAlloc.hxx> 22 #include <Standard_Handle.hxx> 23 24 #include <Standard_Real.hxx> 25 #include <Standard_Integer.hxx> 26 #include <GeomAbs_Shape.hxx> 27 class GeomPlate_Surface; 28 class Geom_BSplineSurface; 29 class AdvApp2Var_Criterion; 30 31 32 33 //! Allows you to convert a GeomPlate surface into a BSpline. 34 class GeomPlate_MakeApprox 35 { 36 public: 37 38 DEFINE_STANDARD_ALLOC 39 40 41 //! Converts SurfPlate into a Geom_BSplineSurface with 42 //! n Bezier pieces (n<=Nbmax) of degree <= dgmax 43 //! and an approximation error < Tol3d if possible 44 //! the criterion CritPlate is satisfied if possible 45 Standard_EXPORT GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& SurfPlate, const AdvApp2Var_Criterion& PlateCrit, const Standard_Real Tol3d, const Standard_Integer Nbmax, const Standard_Integer dgmax, const GeomAbs_Shape Continuity = GeomAbs_C1, const Standard_Real EnlargeCoeff = 1.1); 46 47 //! Converts SurfPlate into a Geom_BSplineSurface with 48 //! n Bezier pieces (n<=Nbmax) of degree <= dgmax 49 //! and an approximation error < Tol3d if possible 50 //! if CritOrder = -1 , no criterion is used 51 //! if CritOrder = 0 , a PlateG0Criterion is used with max value > 10*dmax 52 //! if CritOrder = 1 , a PlateG1Criterion is used with max value > 10*dmax 53 //! WARNING : for CritOrder = 0 or 1, only the constraints points of SurfPlate 54 //! are used to evaluate the value of the criterion 55 Standard_EXPORT GeomPlate_MakeApprox(const Handle(GeomPlate_Surface)& SurfPlate, const Standard_Real Tol3d, const Standard_Integer Nbmax, const Standard_Integer dgmax, const Standard_Real dmax, const Standard_Integer CritOrder = 0, const GeomAbs_Shape Continuity = GeomAbs_C1, const Standard_Real EnlargeCoeff = 1.1); 56 57 //! Returns the BSpline surface extracted from the 58 //! GeomPlate_MakeApprox object. 59 Standard_EXPORT Handle(Geom_BSplineSurface) Surface() const; 60 61 //! Returns the error in computation of the approximation 62 //! surface. This is the distance between the entire target 63 //! BSpline surface and the entire original surface 64 //! generated by BuildPlateSurface and converted by GeomPlate_Surface. 65 Standard_EXPORT Standard_Real ApproxError() const; 66 67 //! Returns the criterion error in computation of the 68 //! approximation surface. This is estimated relative to the 69 //! curve and point constraints only. 70 Standard_EXPORT Standard_Real CriterionError() const; 71 72 73 74 75 protected: 76 77 78 79 80 81 private: 82 83 84 85 Handle(GeomPlate_Surface) myPlate; 86 Handle(Geom_BSplineSurface) mySurface; 87 Standard_Real myAppError; 88 Standard_Real myCritError; 89 90 91 }; 92 93 94 95 96 97 98 99 #endif // _GeomPlate_MakeApprox_HeaderFile 100