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 #ifndef _BRepGProp_VinertGK_HeaderFile
17 #define _BRepGProp_VinertGK_HeaderFile
19 #include <Standard.hxx>
20 #include <Standard_DefineAlloc.hxx>
21 #include <Standard_Handle.hxx>
23 #include <Standard_Real.hxx>
24 #include <GProp_GProps.hxx>
25 #include <Standard_Boolean.hxx>
26 #include <Standard_Address.hxx>
29 class BRepGProp_Domain;
33 //! Computes the global properties of a geometric solid
34 //! (3D closed region of space) delimited with :
35 //! - a point and a surface
36 //! - a plane and a surface
38 //! The surface can be :
39 //! - a surface limited with its parametric values U-V,
40 //! (naturally restricted)
41 //! - a surface limited in U-V space with its boundary
44 //! The surface's requirements to evaluate the global
45 //! properties are defined in the template FaceTool class from
46 //! the package GProp.
48 //! The adaptive 2D algorithm of Gauss-Kronrod integration of
49 //! double integral is used.
51 //! The inner integral is computed along U parameter of
52 //! surface. The integrand function is encapsulated in the
53 //! support class UFunction that is defined below.
55 //! The outer integral is computed along T parameter of a
56 //! bounding curve. The integrand function is encapsulated in
57 //! the support class TFunction that is defined below.
58 class BRepGProp_VinertGK : public GProp_GProps
65 //! Empty constructor.
67 : myErrorReached (0.), myAbsolutError (0.)
71 //! Constructor. Computes the global properties of a region of
72 //! 3D space delimited with the naturally restricted surface
73 //! and the point VLocation.
74 Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
76 //! Constructor. Computes the global properties of a region of
77 //! 3D space delimited with the naturally restricted surface
78 //! and the point VLocation. The inertia is computed with
79 //! respect to thePoint.
80 Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, const gp_Pnt& thePoint, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
82 //! Constructor. Computes the global properties of a region of
83 //! 3D space delimited with the surface bounded by the domain
84 //! and the point VLocation.
85 Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
87 //! Constructor. Computes the global properties of a region of
88 //! 3D space delimited with the surface bounded by the domain
89 //! and the point VLocation. The inertia is computed with
90 //! respect to thePoint.
91 Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pnt& thePoint, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
93 //! Constructor. Computes the global properties of a region of
94 //! 3D space delimited with the naturally restricted surface
96 Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, const gp_Pln& thePlane, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
98 //! Constructor. Computes the global properties of a region of
99 //! 3D space delimited with the surface bounded by the domain
101 Standard_EXPORT BRepGProp_VinertGK(BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pln& thePlane, const gp_Pnt& theLocation, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
103 //! Sets the vertex that delimit 3D closed region of space.
104 void SetLocation (const gp_Pnt& theLocation)
109 //! Computes the global properties of a region of 3D space
110 //! delimited with the naturally restricted surface and the
112 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
114 //! Computes the global properties of a region of 3D space
115 //! delimited with the naturally restricted surface and the
116 //! point VLocation. The inertia is computed with respect to
118 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, const gp_Pnt& thePoint, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
120 //! Computes the global properties of a region of 3D space
121 //! delimited with the surface bounded by the domain and the
123 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
125 //! Computes the global properties of a region of 3D space
126 //! delimited with the surface bounded by the domain and the
127 //! point VLocation. The inertia is computed with respect to
129 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pnt& thePoint, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
131 //! Computes the global properties of a region of 3D space
132 //! delimited with the naturally restricted surface and the
134 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, const gp_Pln& thePlane, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
136 //! Computes the global properties of a region of 3D space
137 //! delimited with the surface bounded by the domain and the
139 Standard_EXPORT Standard_Real Perform (BRepGProp_Face& theSurface, BRepGProp_Domain& theDomain, const gp_Pln& thePlane, const Standard_Real theTolerance = 0.001, const Standard_Boolean theCGFlag = Standard_False, const Standard_Boolean theIFlag = Standard_False);
141 //! Returns the relative reached computation error.
142 Standard_Real GetErrorReached () const
144 return myErrorReached;
147 //! Returns the absolut reached computation error.
148 Standard_Real GetAbsolutError() const;
162 //! Main method for computation of the global properties that
163 //! is invoked by each Perform method.
164 Standard_EXPORT Standard_Real PrivatePerform (BRepGProp_Face& theSurface, const Standard_Address thePtrDomain, const Standard_Boolean IsByPoint, const Standard_Address theCoeffs, const Standard_Real theTolerance, const Standard_Boolean theCGFlag, const Standard_Boolean theIFlag);
167 Standard_Real myErrorReached;
168 Standard_Real myAbsolutError;
172 #endif // _BRepGProp_VinertGK_HeaderFile