Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:11

0001 // Created on: 1994-03-03
0002 // Created by: Joelle CHAUVET
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 _BRepFill_ComputeCLine_HeaderFile
0018 #define _BRepFill_ComputeCLine_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <AppParCurves_SequenceOfMultiCurve.hxx>
0024 #include <TColStd_SequenceOfReal.hxx>
0025 #include <AppParCurves_MultiCurve.hxx>
0026 #include <Standard_Integer.hxx>
0027 #include <AppParCurves_Constraint.hxx>
0028 #include <BRepFill_MultiLine.hxx>
0029 class AppParCurves_MultiCurve;
0030 
0031 
0032 
0033 class BRepFill_ComputeCLine 
0034 {
0035 public:
0036 
0037   DEFINE_STANDARD_ALLOC
0038 
0039   
0040   //! The MultiLine <Line> will be approximated until tolerances
0041   //! will be reached.
0042   //! The approximation will be done from degreemin to degreemax
0043   //! with a cutting if the corresponding boolean is True.
0044   Standard_EXPORT BRepFill_ComputeCLine(const BRepFill_MultiLine& Line, const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-5, const Standard_Real Tolerance2d = 1.0e-5, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint);
0045   
0046   //! Initializes the fields of the algorithm.
0047   Standard_EXPORT BRepFill_ComputeCLine(const Standard_Integer degreemin = 3, const Standard_Integer degreemax = 8, const Standard_Real Tolerance3d = 1.0e-05, const Standard_Real Tolerance2d = 1.0e-05, const Standard_Boolean cutting = Standard_False, const AppParCurves_Constraint FirstC = AppParCurves_TangencyPoint, const AppParCurves_Constraint LastC = AppParCurves_TangencyPoint);
0048   
0049   //! runs the algorithm after having initialized the fields.
0050   Standard_EXPORT void Perform (const BRepFill_MultiLine& Line);
0051   
0052   //! changes the degrees of the approximation.
0053   Standard_EXPORT void SetDegrees (const Standard_Integer degreemin, const Standard_Integer degreemax);
0054   
0055   //! Changes the tolerances of the approximation.
0056   Standard_EXPORT void SetTolerances (const Standard_Real Tolerance3d, const Standard_Real Tolerance2d);
0057   
0058   //! Changes the constraints of the approximation.
0059   Standard_EXPORT void SetConstraints (const AppParCurves_Constraint FirstC, const AppParCurves_Constraint LastC);
0060   
0061   //! Changes the max number of segments, which is allowed for cutting.
0062   Standard_EXPORT void SetMaxSegments (const Standard_Integer theMaxSegments);
0063 
0064   //! Set inverse order of degree selection:
0065   //! if theInvOrdr = true, current degree is chosen by inverse order -
0066   //! from maxdegree to mindegree.
0067   //! By default inverse order is used.
0068   Standard_EXPORT void SetInvOrder(const Standard_Boolean theInvOrder);
0069 
0070   //! Set value of hang checking flag
0071   //! if this flag = true, possible hang of algorithm is checked
0072   //! and algorithm is forced to stop.
0073   //! By default hang checking is used.
0074   Standard_EXPORT void SetHangChecking(const Standard_Boolean theHangChecking);
0075 
0076   //! returns False if at a moment of the approximation,
0077   //! the status NoApproximation has been sent by the user
0078   //! when more points were needed.
0079   Standard_EXPORT Standard_Boolean IsAllApproximated() const;
0080   
0081   //! returns False if the status NoPointsAdded has been sent.
0082   Standard_EXPORT Standard_Boolean IsToleranceReached() const;
0083   
0084   //! returns the tolerances 2d and 3d of the <Index> MultiCurve.
0085   Standard_EXPORT void Error (const Standard_Integer Index, Standard_Real& tol3d, Standard_Real& tol2d) const;
0086   
0087   //! Returns the number of MultiCurve doing the approximation
0088   //! of the MultiLine.
0089   Standard_EXPORT Standard_Integer NbMultiCurves() const;
0090   
0091   //! returns the approximation MultiCurve of range <Index>.
0092   Standard_EXPORT AppParCurves_MultiCurve Value (const Standard_Integer Index = 1) const;
0093   
0094   Standard_EXPORT void Parameters (const Standard_Integer Index, Standard_Real& firstp, Standard_Real& lastp) const;
0095 
0096 
0097 
0098 
0099 protected:
0100 
0101 
0102 
0103 
0104 
0105 private:
0106 
0107   
0108   //! is internally used by the algorithms.
0109   Standard_EXPORT Standard_Boolean Compute (const BRepFill_MultiLine& Line, const Standard_Real Ufirst, const Standard_Real Ulast, Standard_Real& TheTol3d, Standard_Real& TheTol2d);
0110 
0111 
0112   AppParCurves_SequenceOfMultiCurve myMultiCurves;
0113   TColStd_SequenceOfReal myfirstparam;
0114   TColStd_SequenceOfReal mylastparam;
0115   AppParCurves_MultiCurve TheMultiCurve;
0116   Standard_Boolean alldone;
0117   Standard_Boolean tolreached;
0118   TColStd_SequenceOfReal Tolers3d;
0119   TColStd_SequenceOfReal Tolers2d;
0120   Standard_Integer mydegremin;
0121   Standard_Integer mydegremax;
0122   Standard_Real mytol3d;
0123   Standard_Real mytol2d;
0124   Standard_Real currenttol3d;
0125   Standard_Real currenttol2d;
0126   Standard_Boolean mycut;
0127   AppParCurves_Constraint myfirstC;
0128   AppParCurves_Constraint mylastC;
0129   Standard_Integer myMaxSegments;
0130   Standard_Boolean myInvOrder;
0131   Standard_Boolean myHangChecking;
0132 
0133 };
0134 
0135 
0136 
0137 
0138 
0139 
0140 
0141 #endif // _BRepFill_ComputeCLine_HeaderFile