42cf5bc1 |
1 | // Created on: 1994-02-28 |
2 | // Created by: Bruno DUMORTIER |
3 | // Copyright (c) 1994-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 _GeomFill_SweepSectionGenerator_HeaderFile |
18 | #define _GeomFill_SweepSectionGenerator_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <gp_Ax1.hxx> |
25 | #include <Standard_Real.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <Standard_Integer.hxx> |
28 | #include <GeomFill_SequenceOfTrsf.hxx> |
29 | #include <TColStd_Array1OfReal.hxx> |
30 | #include <TColStd_Array1OfInteger.hxx> |
31 | #include <TColgp_Array1OfPnt.hxx> |
32 | #include <TColgp_Array1OfVec.hxx> |
33 | #include <TColgp_Array1OfPnt2d.hxx> |
34 | #include <TColgp_Array1OfVec2d.hxx> |
35 | class Geom_BSplineCurve; |
36 | class Adaptor3d_HCurve; |
37 | class Standard_RangeError; |
38 | class Geom_Curve; |
39 | class gp_Trsf; |
40 | |
41 | |
42 | //! class for instantiation of AppBlend. |
43 | //! evaluate the sections of a sweep surface. |
44 | class GeomFill_SweepSectionGenerator |
45 | { |
46 | public: |
47 | |
48 | DEFINE_STANDARD_ALLOC |
49 | |
50 | |
51 | Standard_EXPORT GeomFill_SweepSectionGenerator(); |
52 | |
53 | //! Create a sweept surface with a constant radius. |
54 | Standard_EXPORT GeomFill_SweepSectionGenerator(const Handle(Geom_Curve)& Path, const Standard_Real Radius); |
55 | |
56 | //! Create a sweept surface with a constant section |
57 | Standard_EXPORT GeomFill_SweepSectionGenerator(const Handle(Geom_Curve)& Path, const Handle(Geom_Curve)& FirstSect); |
58 | |
59 | //! Create a sweept surface with an evolving section |
60 | //! The section evoluate from First to Last Section |
61 | Standard_EXPORT GeomFill_SweepSectionGenerator(const Handle(Geom_Curve)& Path, const Handle(Geom_Curve)& FirstSect, const Handle(Geom_Curve)& LastSect); |
62 | |
63 | //! Create a pipe with a constant radius with 2 |
64 | //! guide-line. |
65 | Standard_EXPORT GeomFill_SweepSectionGenerator(const Handle(Geom_Curve)& Path, const Handle(Geom_Curve)& Curve1, const Handle(Geom_Curve)& Curve2, const Standard_Real Radius); |
66 | |
67 | //! Create a pipe with a constant radius with 2 |
68 | //! guide-line. |
69 | Standard_EXPORT GeomFill_SweepSectionGenerator(const Handle(Adaptor3d_HCurve)& Path, const Handle(Adaptor3d_HCurve)& Curve1, const Handle(Adaptor3d_HCurve)& Curve2, const Standard_Real Radius); |
70 | |
71 | Standard_EXPORT void Init (const Handle(Geom_Curve)& Path, const Standard_Real Radius); |
72 | |
73 | Standard_EXPORT void Init (const Handle(Geom_Curve)& Path, const Handle(Geom_Curve)& FirstSect); |
74 | |
75 | Standard_EXPORT void Init (const Handle(Geom_Curve)& Path, const Handle(Geom_Curve)& FirstSect, const Handle(Geom_Curve)& LastSect); |
76 | |
77 | Standard_EXPORT void Init (const Handle(Geom_Curve)& Path, const Handle(Geom_Curve)& Curve1, const Handle(Geom_Curve)& Curve2, const Standard_Real Radius); |
78 | |
79 | Standard_EXPORT void Init (const Handle(Adaptor3d_HCurve)& Path, const Handle(Adaptor3d_HCurve)& Curve1, const Handle(Adaptor3d_HCurve)& Curve2, const Standard_Real Radius); |
80 | |
81 | Standard_EXPORT void Perform (const Standard_Boolean Polynomial = Standard_False); |
82 | |
83 | Standard_EXPORT void GetShape (Standard_Integer& NbPoles, Standard_Integer& NbKnots, Standard_Integer& Degree, Standard_Integer& NbPoles2d) const; |
84 | |
85 | Standard_EXPORT void Knots (TColStd_Array1OfReal& TKnots) const; |
86 | |
87 | Standard_EXPORT void Mults (TColStd_Array1OfInteger& TMults) const; |
88 | |
89 | Standard_Integer NbSections() const; |
90 | |
91 | //! Used for the first and last section |
92 | //! The method returns Standard_True if the derivatives |
93 | //! are computed, otherwise it returns Standard_False. |
94 | Standard_EXPORT Standard_Boolean Section (const Standard_Integer P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfVec& DPoles, TColgp_Array1OfPnt2d& Poles2d, TColgp_Array1OfVec2d& DPoles2d, TColStd_Array1OfReal& Weigths, TColStd_Array1OfReal& DWeigths) const; |
95 | |
96 | Standard_EXPORT void Section (const Standard_Integer P, TColgp_Array1OfPnt& Poles, TColgp_Array1OfPnt2d& Poles2d, TColStd_Array1OfReal& Weigths) const; |
97 | |
98 | //! raised if <Index> not in the range [1,NbSections()] |
99 | Standard_EXPORT const gp_Trsf& Transformation (const Standard_Integer Index) const; |
100 | |
101 | //! Returns the parameter of <P>, to impose it for the |
102 | //! approximation. |
103 | Standard_EXPORT Standard_Real Parameter (const Standard_Integer P) const; |
104 | |
105 | |
106 | |
107 | |
108 | protected: |
109 | |
110 | |
111 | |
112 | |
113 | |
114 | private: |
115 | |
116 | |
117 | |
118 | Handle(Geom_BSplineCurve) myPath; |
119 | Handle(Geom_BSplineCurve) myFirstSect; |
120 | Handle(Geom_BSplineCurve) myLastSect; |
121 | Handle(Adaptor3d_HCurve) myAdpPath; |
122 | Handle(Adaptor3d_HCurve) myAdpFirstSect; |
123 | Handle(Adaptor3d_HCurve) myAdpLastSect; |
124 | gp_Ax1 myCircPathAxis; |
125 | Standard_Real myRadius; |
126 | Standard_Boolean myIsDone; |
127 | Standard_Integer myNbSections; |
128 | GeomFill_SequenceOfTrsf myTrsfs; |
129 | Standard_Integer myType; |
130 | Standard_Boolean myPolynomial; |
131 | |
132 | |
133 | }; |
134 | |
135 | |
136 | #include <GeomFill_SweepSectionGenerator.lxx> |
137 | |
138 | |
139 | |
140 | |
141 | |
142 | #endif // _GeomFill_SweepSectionGenerator_HeaderFile |