1 // Created on: 1994-02-17
2 // Created by: Bruno DUMORTIER
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 _GeomFill_Profiler_HeaderFile
18 #define _GeomFill_Profiler_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <TColGeom_SequenceOfCurve.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Integer.hxx>
28 #include <TColgp_Array1OfPnt.hxx>
29 #include <TColStd_Array1OfReal.hxx>
30 #include <TColStd_Array1OfInteger.hxx>
34 //! Evaluation of the common BSplineProfile of a group
35 //! of curves from Geom. All the curves will have the
36 //! same degree, the same knot-vector, so the same
38 class GeomFill_Profiler
45 Standard_EXPORT GeomFill_Profiler();
46 Standard_EXPORT virtual ~GeomFill_Profiler();
48 Standard_EXPORT void AddCurve (const Handle(Geom_Curve)& Curve);
50 //! Converts all curves to BSplineCurves.
51 //! Set them to the common profile.
52 //! <PTol> is used to compare 2 knots.
53 Standard_EXPORT virtual void Perform (const Standard_Real PTol);
55 //! Raises if not yet perform
56 Standard_EXPORT Standard_Integer Degree() const;
58 Standard_Boolean IsPeriodic() const;
60 //! Raises if not yet perform
61 Standard_EXPORT Standard_Integer NbPoles() const;
63 //! returns in <Poles> the poles of the BSplineCurve
64 //! from index <Index> adjusting to the current profile.
65 //! Raises if not yet perform
66 //! Raises if <Index> not in the range [1,NbCurves]
67 //! if the length of <Poles> is not equal to
69 Standard_EXPORT void Poles (const Standard_Integer Index, TColgp_Array1OfPnt& Poles) const;
71 //! returns in <Weights> the weights of the BSplineCurve
72 //! from index <Index> adjusting to the current profile.
73 //! Raises if not yet perform
74 //! Raises if <Index> not in the range [1,NbCurves] or
75 //! if the length of <Weights> is not equal to
77 Standard_EXPORT void Weights (const Standard_Integer Index, TColStd_Array1OfReal& Weights) const;
79 //! Raises if not yet perform
80 Standard_EXPORT Standard_Integer NbKnots() const;
82 //! Raises if not yet perform
83 //! Raises if the lengths of <Knots> and <Mults> are
84 //! not equal to NbKnots().
85 Standard_EXPORT void KnotsAndMults (TColStd_Array1OfReal& Knots, TColStd_Array1OfInteger& Mults) const;
87 const Handle(Geom_Curve)& Curve (const Standard_Integer Index) const;
96 TColGeom_SequenceOfCurve mySequence;
97 Standard_Boolean myIsDone;
98 Standard_Boolean myIsPeriodic;
110 #include <GeomFill_Profiler.lxx>
116 #endif // _GeomFill_Profiler_HeaderFile