1 -- Created on: 2005-12-21
2 -- Created by: Sergey KHROMOV
3 -- Copyright (c) 2005-2014 OPEN CASCADE SAS
5 -- This file is part of Open CASCADE Technology software library.
7 -- This library is free software; you can redistribute it and/or modify it under
8 -- the terms of the GNU Lesser General Public License version 2.1 as published
9 -- by the Free Software Foundation, with special exception defined in the file
10 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 -- distribution for complete text of the license and disclaimer of any warranty.
13 -- Alternatively, this file may be used under the terms of Open CASCADE
14 -- commercial license or contractual agreement.
16 class VinertGK from BRepGProp inherits GProps from GProp
18 ---Purpose: Computes the global properties of a geometric solid
19 -- (3D closed region of space) delimited with :
20 -- - a point and a surface
21 -- - a plane and a surface
23 -- The surface can be :
24 -- - a surface limited with its parametric values U-V,
25 -- (naturally restricted)
26 -- - a surface limited in U-V space with its boundary
29 -- The surface's requirements to evaluate the global
30 -- properties are defined in the template FaceTool class from
33 -- The adaptive 2D algorithm of Gauss-Kronrod integration of
34 -- double integral is used.
36 -- The inner integral is computed along U parameter of
37 -- surface. The integrand function is encapsulated in the
38 -- support class UFunction that is defined below.
40 -- The outer integral is computed along T parameter of a
41 -- bounding curve. The integrand function is encapsulated in
42 -- the support class TFunction that is defined below.
49 Address from Standard,
50 Boolean from Standard,
57 -- Template class functions. Used for integration. Begin
62 ---Purpose: Empty constructor.
66 Create(theSurface : in out Face from BRepGProp;
67 theLocation : Pnt from gp;
68 theTolerance: Real from Standard = 0.001;
69 theCGFlag: Boolean from Standard = Standard_False;
70 theIFlag: Boolean from Standard = Standard_False)
71 ---Purpose: Constructor. Computes the global properties of a region of
72 -- 3D space delimited with the naturally restricted surface
73 -- and the point VLocation.
76 Create(theSurface : in out Face from BRepGProp;
77 thePoint : Pnt from gp;
78 theLocation : Pnt from gp;
79 theTolerance: Real from Standard = 0.001;
80 theCGFlag: Boolean from Standard = Standard_False;
81 theIFlag: Boolean from Standard = Standard_False)
83 ---Purpose: Constructor. Computes the global properties of a region of
84 -- 3D space delimited with the naturally restricted surface
85 -- and the point VLocation. The inertia is computed with
86 -- respect to thePoint.
89 Create(theSurface : in out Face from BRepGProp;
90 theDomain : in out Domain from BRepGProp;
91 theLocation : Pnt from gp;
92 theTolerance: Real from Standard = 0.001;
93 theCGFlag: Boolean from Standard = Standard_False;
94 theIFlag: Boolean from Standard = Standard_False)
96 ---Purpose: Constructor. Computes the global properties of a region of
97 -- 3D space delimited with the surface bounded by the domain
98 -- and the point VLocation.
101 Create(theSurface : in out Face from BRepGProp;
102 theDomain : in out Domain from BRepGProp;
103 thePoint : Pnt from gp;
104 theLocation : Pnt from gp;
105 theTolerance: Real from Standard = 0.001;
106 theCGFlag: Boolean from Standard = Standard_False;
107 theIFlag: Boolean from Standard = Standard_False)
108 ---Purpose: Constructor. Computes the global properties of a region of
109 -- 3D space delimited with the surface bounded by the domain
110 -- and the point VLocation. The inertia is computed with
111 -- respect to thePoint.
114 Create(theSurface : in out Face from BRepGProp;
115 thePlane : Pln from gp;
116 theLocation : Pnt from gp;
117 theTolerance: Real from Standard = 0.001;
118 theCGFlag: Boolean from Standard = Standard_False;
119 theIFlag: Boolean from Standard = Standard_False)
121 ---Purpose: Constructor. Computes the global properties of a region of
122 -- 3D space delimited with the naturally restricted surface
126 Create(theSurface : in out Face from BRepGProp;
127 theDomain : in out Domain from BRepGProp;
128 thePlane : Pln from gp;
129 theLocation : Pnt from gp;
130 theTolerance: Real from Standard = 0.001;
131 theCGFlag: Boolean from Standard = Standard_False;
132 theIFlag: Boolean from Standard = Standard_False)
134 ---Purpose: Constructor. Computes the global properties of a region of
135 -- 3D space delimited with the surface bounded by the domain
139 SetLocation(me: in out; theLocation: Pnt from gp);
140 ---Purpose: Sets the vertex that delimit 3D closed region of space.
143 Perform(me: in out; theSurface : in out Face from BRepGProp;
144 theTolerance: Real from Standard = 0.001;
145 theCGFlag: Boolean from Standard = Standard_False;
146 theIFlag: Boolean from Standard = Standard_False)
148 ---Purpose: Computes the global properties of a region of 3D space
149 -- delimited with the naturally restricted surface and the
151 returns Real from Standard;
153 Perform(me: in out; theSurface : in out Face from BRepGProp;
154 thePoint : Pnt from gp;
155 theTolerance: Real from Standard = 0.001;
156 theCGFlag: Boolean from Standard = Standard_False;
157 theIFlag: Boolean from Standard = Standard_False)
159 ---Purpose: Computes the global properties of a region of 3D space
160 -- delimited with the naturally restricted surface and the
161 -- point VLocation. The inertia is computed with respect to
163 returns Real from Standard;
165 Perform(me: in out; theSurface : in out Face from BRepGProp;
166 theDomain : in out Domain from BRepGProp;
167 theTolerance: Real from Standard = 0.001;
168 theCGFlag: Boolean from Standard = Standard_False;
169 theIFlag: Boolean from Standard = Standard_False)
171 ---Purpose: Computes the global properties of a region of 3D space
172 -- delimited with the surface bounded by the domain and the
174 returns Real from Standard;
176 Perform(me: in out; theSurface : in out Face from BRepGProp;
177 theDomain : in out Domain from BRepGProp;
178 thePoint : Pnt from gp;
179 theTolerance: Real from Standard = 0.001;
180 theCGFlag: Boolean from Standard = Standard_False;
181 theIFlag: Boolean from Standard = Standard_False)
182 ---Purpose: Computes the global properties of a region of 3D space
183 -- delimited with the surface bounded by the domain and the
184 -- point VLocation. The inertia is computed with respect to
186 returns Real from Standard;
188 Perform(me: in out; theSurface : in out Face from BRepGProp;
189 thePlane : Pln from gp;
190 theTolerance: Real from Standard = 0.001;
191 theCGFlag: Boolean from Standard = Standard_False;
192 theIFlag: Boolean from Standard = Standard_False)
194 ---Purpose: Computes the global properties of a region of 3D space
195 -- delimited with the naturally restricted surface and the
197 returns Real from Standard;
199 Perform(me: in out; theSurface : in out Face from BRepGProp;
200 theDomain : in out Domain from BRepGProp;
201 thePlane : Pln from gp;
202 theTolerance: Real from Standard = 0.001;
203 theCGFlag: Boolean from Standard = Standard_False;
204 theIFlag: Boolean from Standard = Standard_False)
206 ---Purpose: Computes the global properties of a region of 3D space
207 -- delimited with the surface bounded by the domain and the
209 returns Real from Standard;
212 ---Purpose: Returns the relative reached computation error.
214 returns Real from Standard;
217 ---Purpose: Returns the absolut reached computation error.
219 returns Real from Standard;
221 -----------------------
222 -- Private methods --
223 -----------------------
225 PrivatePerform(me: in out;
226 theSurface : in out Face from BRepGProp;
227 thePtrDomain: Address from Standard; -- pointer to Domain from BRepGProp.
228 IsByPoint : Boolean from Standard;
229 theCoeffs : Address from Standard;
230 theTolerance: Real from Standard;
231 theCGFlag : Boolean from Standard;
232 theIFlag : Boolean from Standard)
234 ---Purpose: Main method for computation of the global properties that
235 -- is invoked by each Perform method.
236 returns Real from Standard
241 myErrorReached: Real from Standard;
242 myAbsolutError: Real from Standard;