1 // Created on: 1991-04-12
2 // Created by: Michel CHAUVAT
3 // Copyright (c) 1991-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 _BRepGProp_Vinert_HeaderFile
18 #define _BRepGProp_Vinert_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Real.hxx>
25 #include <GProp_GProps.hxx>
29 class BRepGProp_Domain;
33 //! Computes the global properties of a geometric solid
34 //! (3D closed region of space) delimited with :
36 //! . a point and a surface
37 //! . a plane and a surface
39 //! The surface can be :
40 //! . a surface limited with its parametric values U-V,
41 //! . a surface limited in U-V space with its curves of restriction,
43 //! The surface 's requirements to evaluate the global properties
44 //! are defined in the template SurfaceTool from package GProp.
45 class BRepGProp_Vinert : public GProp_GProps
52 Standard_EXPORT BRepGProp_Vinert();
55 //! Computes the global properties of a region of 3D space
56 //! delimited with the surface <S> and the point VLocation. S can be closed
57 //! The method is quick and its precision is enough for many cases of analytical
59 //! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
60 //! is used. Numbers of points depend on types of surfaces and curves.
61 //! Errror of the computation is not calculated.
62 Standard_EXPORT BRepGProp_Vinert(const BRepGProp_Face& S, const gp_Pnt& VLocation);
65 //! Computes the global properties of a region of 3D space
66 //! delimited with the surface <S> and the point VLocation. S can be closed
67 //! Adaptive 2D Gauss integration is used.
68 //! Parameter Eps sets maximal relative error of computed mass (volume) for face.
69 //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
70 //! for two successive steps of adaptive integration.
71 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, const gp_Pnt& VLocation, const Standard_Real Eps);
74 //! Computes the global properties of the region of 3D space
75 //! delimited with the surface <S> and the point VLocation.
76 //! The method is quick and its precision is enough for many cases of analytical
78 //! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
79 //! is used. Numbers of points depend on types of surfaces and curves.
80 //! Error of the computation is not calculated.
81 Standard_EXPORT BRepGProp_Vinert(const BRepGProp_Face& S, const gp_Pnt& O, const gp_Pnt& VLocation);
84 //! Computes the global properties of the region of 3D space
85 //! delimited with the surface <S> and the point VLocation.
86 //! Adaptive 2D Gauss integration is used.
87 //! Parameter Eps sets maximal relative error of computed mass (volume) for face.
88 //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
89 //! for two successive steps of adaptive integration.
90 //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
91 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, const gp_Pnt& O, const gp_Pnt& VLocation, const Standard_Real Eps);
94 //! Computes the global properties of the region of 3D space
95 //! delimited with the surface <S> and the plane Pln.
96 //! The method is quick and its precision is enough for many cases of analytical
98 //! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
99 //! is used. Numbers of points depend on types of surfaces and curves.
100 //! Error of the computation is not calculated.
101 Standard_EXPORT BRepGProp_Vinert(const BRepGProp_Face& S, const gp_Pln& Pl, const gp_Pnt& VLocation);
104 //! Computes the global properties of the region of 3D space
105 //! delimited with the surface <S> and the plane Pln.
106 //! Adaptive 2D Gauss integration is used.
107 //! Parameter Eps sets maximal relative error of computed mass (volume) for face.
108 //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
109 //! for two successive steps of adaptive integration.
110 //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
111 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, const gp_Pln& Pl, const gp_Pnt& VLocation, const Standard_Real Eps);
114 //! Computes the global properties of a region of 3D space
115 //! delimited with the surface <S> and the point VLocation. S can be closed
116 //! The method is quick and its precision is enough for many cases of analytical
118 //! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
119 //! is used. Numbers of points depend on types of surfaces and curves.
120 //! Errror of the computation is not calculated.
121 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& VLocation);
124 //! Computes the global properties of a region of 3D space
125 //! delimited with the surface <S> and the point VLocation. S can be closed
126 //! Adaptive 2D Gauss integration is used.
127 //! Parameter Eps sets maximal relative error of computed mass (volume) for face.
128 //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
129 //! for two successive steps of adaptive integration.
130 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& VLocation, const Standard_Real Eps);
133 //! Computes the global properties of the region of 3D space
134 //! delimited with the surface <S> and the point VLocation.
135 //! The method is quick and its precision is enough for many cases of analytical
137 //! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
138 //! is used. Numbers of points depend on types of surfaces and curves.
139 //! Error of the computation is not calculated.
140 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& O, const gp_Pnt& VLocation);
143 //! Computes the global properties of the region of 3D space
144 //! delimited with the surface <S> and the point VLocation.
145 //! Adaptive 2D Gauss integration is used.
146 //! Parameter Eps sets maximal relative error of computed mass (volume) for face.
147 //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
148 //! for two successive steps of adaptive integration.
149 //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
150 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& O, const gp_Pnt& VLocation, const Standard_Real Eps);
153 //! Computes the global properties of the region of 3D space
154 //! delimited with the surface <S> and the plane Pln.
155 //! The method is quick and its precision is enough for many cases of analytical
157 //! Non-adaptive 2D Gauss integration with predefined numbers of Gauss points
158 //! is used. Numbers of points depend on types of surfaces and curves.
159 //! Error of the computation is not calculated.
160 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pln& Pl, const gp_Pnt& VLocation);
163 //! Computes the global properties of the region of 3D space
164 //! delimited with the surface <S> and the plane Pln.
165 //! Adaptive 2D Gauss integration is used.
166 //! Parameter Eps sets maximal relative error of computed mass (volume) for face.
167 //! Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
168 //! for two successive steps of adaptive integration.
169 //! WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
170 Standard_EXPORT BRepGProp_Vinert(BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pln& Pl, const gp_Pnt& VLocation, const Standard_Real Eps);
172 Standard_EXPORT void SetLocation (const gp_Pnt& VLocation);
174 Standard_EXPORT void Perform (const BRepGProp_Face& S);
176 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, const Standard_Real Eps);
178 Standard_EXPORT void Perform (const BRepGProp_Face& S, const gp_Pnt& O);
180 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, const gp_Pnt& O, const Standard_Real Eps);
182 Standard_EXPORT void Perform (const BRepGProp_Face& S, const gp_Pln& Pl);
184 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, const gp_Pln& Pl, const Standard_Real Eps);
186 Standard_EXPORT void Perform (BRepGProp_Face& S, BRepGProp_Domain& D);
188 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const Standard_Real Eps);
190 Standard_EXPORT void Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& O);
192 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pnt& O, const Standard_Real Eps);
194 Standard_EXPORT void Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pln& Pl);
196 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& S, BRepGProp_Domain& D, const gp_Pln& Pl, const Standard_Real Eps);
199 //! If previously used methods containe Eps parameter
200 //! gets actual relative error of the computation, else returns 1.0.
201 Standard_EXPORT Standard_Real GetEpsilon();
216 Standard_Real myEpsilon;
227 #endif // _BRepGProp_Vinert_HeaderFile