42cf5bc1 |
1 | // Created on: 1993-04-14 |
2 | // Created by: Isabelle GRIGNON |
3 | // Copyright (c) 1993-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 _BRepGProp_Face_HeaderFile |
18 | #define _BRepGProp_Face_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
22 | #include <Standard_Handle.hxx> |
23 | |
24 | #include <BRepAdaptor_Surface.hxx> |
25 | #include <Geom2dAdaptor_Curve.hxx> |
26 | #include <Standard_Boolean.hxx> |
27 | #include <Standard_Integer.hxx> |
28 | #include <gp_Pnt2d.hxx> |
29 | #include <Standard_Real.hxx> |
30 | #include <TColStd_Array1OfReal.hxx> |
31 | #include <GeomAbs_IsoType.hxx> |
32 | #include <TColStd_HArray1OfReal.hxx> |
33 | class TopoDS_Face; |
34 | class gp_Pnt; |
35 | class gp_Vec; |
36 | class TopoDS_Edge; |
37 | class gp_Pnt2d; |
38 | class gp_Vec2d; |
39 | |
40 | |
41 | |
42 | class BRepGProp_Face |
43 | { |
44 | public: |
45 | |
46 | DEFINE_STANDARD_ALLOC |
47 | |
48 | |
49 | //! Constructor. Initializes the object with a flag IsUseSpan |
50 | //! that says if it is necessary to define spans on a face. |
51 | //! This option has an effect only for BSpline faces. Spans |
52 | //! are returned by the methods GetUKnots and GetTKnots. |
53 | BRepGProp_Face(const Standard_Boolean IsUseSpan = Standard_False); |
54 | |
55 | //! Constructor. Initializes the object with the face and the |
56 | //! flag IsUseSpan that says if it is necessary to define |
57 | //! spans on a face. This option has an effect only for |
58 | //! BSpline faces. Spans are returned by the methods GetUKnots |
59 | //! and GetTKnots. |
60 | BRepGProp_Face(const TopoDS_Face& F, const Standard_Boolean IsUseSpan = Standard_False); |
61 | |
62 | Standard_EXPORT void Load (const TopoDS_Face& F); |
63 | |
64 | Standard_EXPORT Standard_Integer VIntegrationOrder() const; |
65 | |
66 | //! Returns Standard_True if the face is not trimmed. |
67 | Standard_Boolean NaturalRestriction() const; |
68 | |
69 | //! Returns the value of the boundary curve of the face. |
70 | gp_Pnt2d Value2d (const Standard_Real U) const; |
71 | |
72 | Standard_EXPORT Standard_Integer SIntOrder (const Standard_Real Eps) const; |
73 | |
74 | Standard_EXPORT Standard_Integer SVIntSubs() const; |
75 | |
76 | Standard_EXPORT Standard_Integer SUIntSubs() const; |
77 | |
78 | Standard_EXPORT void UKnots (TColStd_Array1OfReal& Knots) const; |
79 | |
80 | Standard_EXPORT void VKnots (TColStd_Array1OfReal& Knots) const; |
81 | |
82 | Standard_EXPORT Standard_Integer LIntOrder (const Standard_Real Eps) const; |
83 | |
84 | Standard_EXPORT Standard_Integer LIntSubs() const; |
85 | |
86 | Standard_EXPORT void LKnots (TColStd_Array1OfReal& Knots) const; |
87 | |
88 | //! Returns the number of points required to do the |
89 | //! integration in the U parametric direction with |
90 | //! a good accuracy. |
91 | Standard_EXPORT Standard_Integer UIntegrationOrder() const; |
92 | |
93 | //! Returns the parametric bounds of the Face. |
94 | Standard_EXPORT void Bounds (Standard_Real& U1, Standard_Real& U2, Standard_Real& V1, Standard_Real& V2) const; |
95 | |
96 | //! Computes the point of parameter U, V on the Face <S> and |
97 | //! the normal to the face at this point. |
98 | Standard_EXPORT void Normal (const Standard_Real U, const Standard_Real V, gp_Pnt& P, gp_Vec& VNor) const; |
99 | |
100 | //! Loading the boundary arc. |
101 | Standard_EXPORT void Load (const TopoDS_Edge& E); |
102 | |
103 | //! Returns the parametric value of the start point of |
104 | //! the current arc of curve. |
105 | Standard_Real FirstParameter() const; |
106 | |
107 | //! Returns the parametric value of the end point of |
108 | //! the current arc of curve. |
109 | Standard_Real LastParameter() const; |
110 | |
111 | //! Returns the number of points required to do the |
112 | //! integration along the parameter of curve. |
113 | Standard_EXPORT Standard_Integer IntegrationOrder() const; |
114 | |
115 | //! Returns the point of parameter U and the first derivative |
116 | //! at this point of a boundary curve. |
117 | void D12d (const Standard_Real U, gp_Pnt2d& P, gp_Vec2d& V1) const; |
118 | |
119 | //! Loading the boundary arc. This arc is either a top, bottom, |
120 | //! left or right bound of a UV rectangle in which the |
121 | //! parameters of surface are defined. |
122 | //! If IsFirstParam is equal to Standard_True, the face is |
123 | //! initialized by either left of bottom bound. Otherwise it is |
124 | //! initialized by the top or right one. |
125 | //! If theIsoType is equal to GeomAbs_IsoU, the face is |
126 | //! initialized with either left or right bound. Otherwise - |
127 | //! with either top or bottom one. |
128 | Standard_EXPORT void Load (const Standard_Boolean IsFirstParam, const GeomAbs_IsoType theIsoType); |
129 | |
130 | //! Returns an array of U knots of the face. The first and last |
131 | //! elements of the array will be theUMin and theUMax. The |
132 | //! middle elements will be the U Knots of the face greater |
133 | //! then theUMin and lower then theUMax in increasing order. |
134 | //! If the face is not a BSpline, the array initialized with |
135 | //! theUMin and theUMax only. |
136 | Standard_EXPORT void GetUKnots (const Standard_Real theUMin, const Standard_Real theUMax, Handle(TColStd_HArray1OfReal)& theUKnots) const; |
137 | |
138 | //! Returns an array of combination of T knots of the arc and |
139 | //! V knots of the face. The first and last elements of the |
140 | //! array will be theTMin and theTMax. The middle elements will |
141 | //! be the Knots of the arc and the values of parameters of |
142 | //! arc on which the value points have V coordinates close to V |
143 | //! knots of face. All the parameter will be greater then |
144 | //! theTMin and lower then theTMax in increasing order. |
145 | //! If the face is not a BSpline, the array initialized with |
146 | //! theTMin and theTMax only. |
147 | Standard_EXPORT void GetTKnots (const Standard_Real theTMin, const Standard_Real theTMax, Handle(TColStd_HArray1OfReal)& theTKnots) const; |
148 | |
149 | |
150 | |
151 | |
152 | protected: |
153 | |
154 | |
155 | |
156 | |
157 | |
158 | private: |
159 | |
160 | |
161 | |
162 | BRepAdaptor_Surface mySurface; |
163 | Geom2dAdaptor_Curve myCurve; |
164 | Standard_Boolean mySReverse; |
165 | Standard_Boolean myIsUseSpan; |
166 | |
167 | |
168 | }; |
169 | |
170 | |
171 | #include <BRepGProp_Face.lxx> |
172 | |
173 | |
174 | |
175 | |
176 | |
177 | #endif // _BRepGProp_Face_HeaderFile |