42cf5bc1 |
1 | // Created on: 1995-07-20 |
2 | // Created by: Modelistation |
3 | // Copyright (c) 1995-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 _BRepApprox_SurfaceTool_HeaderFile |
18 | #define _BRepApprox_SurfaceTool_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 | #include <TColStd_Array1OfReal.hxx> |
28 | #include <Standard_Boolean.hxx> |
29 | #include <gp_Pnt.hxx> |
30 | #include <gp_Vec.hxx> |
31 | #include <GeomAbs_SurfaceType.hxx> |
32 | #include <gp_Pln.hxx> |
33 | #include <gp_Cylinder.hxx> |
34 | #include <gp_Cone.hxx> |
35 | #include <gp_Torus.hxx> |
36 | #include <gp_Sphere.hxx> |
37 | #include <gp_Ax1.hxx> |
38 | #include <gp_Dir.hxx> |
39 | class Standard_NoSuchObject; |
40 | class Standard_OutOfRange; |
41 | class BRepAdaptor_Surface; |
42 | class Adaptor3d_HSurface; |
43 | class gp_Pnt; |
44 | class gp_Vec; |
45 | class Geom_BezierSurface; |
46 | class Geom_BSplineSurface; |
47 | class Adaptor3d_HCurve; |
48 | |
49 | |
50 | |
51 | class BRepApprox_SurfaceTool |
52 | { |
53 | public: |
54 | |
55 | DEFINE_STANDARD_ALLOC |
56 | |
57 | |
58 | static Standard_Real FirstUParameter (const BRepAdaptor_Surface& S); |
59 | |
60 | static Standard_Real FirstVParameter (const BRepAdaptor_Surface& S); |
61 | |
62 | static Standard_Real LastUParameter (const BRepAdaptor_Surface& S); |
63 | |
64 | static Standard_Real LastVParameter (const BRepAdaptor_Surface& S); |
65 | |
66 | static Standard_Integer NbUIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh); |
67 | |
68 | static Standard_Integer NbVIntervals (const BRepAdaptor_Surface& S, const GeomAbs_Shape Sh); |
69 | |
70 | static void UIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh); |
71 | |
72 | static void VIntervals (const BRepAdaptor_Surface& S, TColStd_Array1OfReal& T, const GeomAbs_Shape Sh); |
73 | |
74 | //! If <First> >= <Last> |
75 | static Handle(Adaptor3d_HSurface) UTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol); |
76 | |
77 | //! If <First> >= <Last> |
78 | static Handle(Adaptor3d_HSurface) VTrim (const BRepAdaptor_Surface& S, const Standard_Real First, const Standard_Real Last, const Standard_Real Tol); |
79 | |
80 | static Standard_Boolean IsUClosed (const BRepAdaptor_Surface& S); |
81 | |
82 | static Standard_Boolean IsVClosed (const BRepAdaptor_Surface& S); |
83 | |
84 | static Standard_Boolean IsUPeriodic (const BRepAdaptor_Surface& S); |
85 | |
86 | static Standard_Real UPeriod (const BRepAdaptor_Surface& S); |
87 | |
88 | static Standard_Boolean IsVPeriodic (const BRepAdaptor_Surface& S); |
89 | |
90 | static Standard_Real VPeriod (const BRepAdaptor_Surface& S); |
91 | |
92 | static gp_Pnt Value (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v); |
93 | |
94 | static void D0 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P); |
95 | |
96 | static void D1 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1u, gp_Vec& D1v); |
97 | |
98 | static void D2 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV); |
99 | |
100 | static void D3 (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, gp_Pnt& P, gp_Vec& D1U, gp_Vec& D1V, gp_Vec& D2U, gp_Vec& D2V, gp_Vec& D2UV, gp_Vec& D3U, gp_Vec& D3V, gp_Vec& D3UUV, gp_Vec& D3UVV); |
101 | |
102 | static gp_Vec DN (const BRepAdaptor_Surface& S, const Standard_Real u, const Standard_Real v, const Standard_Integer Nu, const Standard_Integer Nv); |
103 | |
104 | static Standard_Real UResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d); |
105 | |
106 | static Standard_Real VResolution (const BRepAdaptor_Surface& S, const Standard_Real R3d); |
107 | |
108 | static GeomAbs_SurfaceType GetType (const BRepAdaptor_Surface& S); |
109 | |
110 | static gp_Pln Plane (const BRepAdaptor_Surface& S); |
111 | |
112 | static gp_Cylinder Cylinder (const BRepAdaptor_Surface& S); |
113 | |
114 | static gp_Cone Cone (const BRepAdaptor_Surface& S); |
115 | |
116 | static gp_Torus Torus (const BRepAdaptor_Surface& S); |
117 | |
118 | static gp_Sphere Sphere (const BRepAdaptor_Surface& S); |
119 | |
120 | static Handle(Geom_BezierSurface) Bezier (const BRepAdaptor_Surface& S); |
121 | |
122 | static Handle(Geom_BSplineSurface) BSpline (const BRepAdaptor_Surface& S); |
123 | |
124 | static gp_Ax1 AxeOfRevolution (const BRepAdaptor_Surface& S); |
125 | |
126 | static gp_Dir Direction (const BRepAdaptor_Surface& S); |
127 | |
128 | static Handle(Adaptor3d_HCurve) BasisCurve (const BRepAdaptor_Surface& S); |
129 | |
130 | Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S); |
131 | |
132 | Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S); |
133 | |
134 | Standard_EXPORT static Standard_Integer NbSamplesU (const BRepAdaptor_Surface& S, const Standard_Real u1, const Standard_Real u2); |
135 | |
136 | Standard_EXPORT static Standard_Integer NbSamplesV (const BRepAdaptor_Surface& S, const Standard_Real v1, const Standard_Real v2); |
137 | |
138 | |
139 | |
140 | |
141 | protected: |
142 | |
143 | |
144 | |
145 | |
146 | |
147 | private: |
148 | |
149 | |
150 | |
151 | |
152 | |
153 | }; |
154 | |
155 | |
156 | #include <BRepApprox_SurfaceTool.lxx> |
157 | |
158 | |
159 | |
160 | |
161 | |
162 | #endif // _BRepApprox_SurfaceTool_HeaderFile |