Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:12

0001 // Created on: 2005-12-21
0002 // Created by: Sergey KHROMOV
0003 // Copyright (c) 2005-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 #ifndef _BRepGProp_UFunction_HeaderFile
0017 #define _BRepGProp_UFunction_HeaderFile
0018 
0019 #include <Standard.hxx>
0020 #include <Standard_DefineAlloc.hxx>
0021 #include <Standard_Handle.hxx>
0022 
0023 #include <BRepGProp_Face.hxx>
0024 #include <gp_Pnt.hxx>
0025 #include <GProp_ValueType.hxx>
0026 #include <Standard_Boolean.hxx>
0027 #include <math_Function.hxx>
0028 class gp_XYZ;
0029 
0030 
0031 //! This class represents the integrand function for
0032 //! computation of an inner integral. The returned value
0033 //! depends on the value type and the flag IsByPoint.
0034 //!
0035 //! The type of returned value is the one of the following
0036 //! values:
0037 //! -  GProp_Mass - volume computation.
0038 //! -  GProp_CenterMassX, GProp_CenterMassY,
0039 //! GProp_CenterMassZ - X, Y and Z coordinates of center
0040 //! of mass computation.
0041 //! -  GProp_InertiaXX, GProp_InertiaYY, GProp_InertiaZZ,
0042 //! GProp_InertiaXY, GProp_InertiaXZ, GProp_InertiaYZ
0043 //! - moments of inertia computation.
0044 //!
0045 //! If the flag IsByPoint is set to Standard_True, the value is
0046 //! returned for the region of space that is delimited by a
0047 //! surface and a point. Otherwise all computations are
0048 //! performed for the region of space delimited by a surface
0049 //! and a plane.
0050 class BRepGProp_UFunction  : public math_Function
0051 {
0052 public:
0053 
0054   DEFINE_STANDARD_ALLOC
0055 
0056   
0057   //! Constructor. Initializes the function with the face, the
0058   //! location point, the flag IsByPoint and the coefficients
0059   //! theCoeff that have different meaning depending on the value
0060   //! of IsByPoint.
0061   //! If IsByPoint is equal to Standard_True, the number of the
0062   //! coefficients is equal to 3 and they represent X, Y and Z
0063   //! coordinates (theCoeff[0], theCoeff[1] and theCoeff[2]
0064   //! correspondingly) of the shift, if the inertia is computed
0065   //! with respect to the point different then the location.
0066   //! If IsByPoint is equal to Standard_False, the number of the
0067   //! coefficients is 4 and they represent the combination of
0068   //! plane parameters and shift values.
0069   Standard_EXPORT BRepGProp_UFunction(const BRepGProp_Face& theSurface, const gp_Pnt& theVertex, const Standard_Boolean IsByPoint, const Standard_Real* theCoeffs);
0070   
0071   //! Setting the type of the value to be returned.
0072     void SetValueType (const GProp_ValueType theType);
0073   
0074   //! Setting the V parameter that is constant during the
0075   //! integral computation.
0076     void SetVParam (const Standard_Real theVParam);
0077   
0078   //! Returns a value of the function.
0079   Standard_EXPORT virtual Standard_Boolean Value (const Standard_Real X, Standard_Real& F) Standard_OVERRIDE;
0080 
0081 private:
0082 
0083   //! Private method. Returns the value for volume computation.
0084   //! Other returned values are:
0085   //! -  thePMP0 - PSurf(X,Y) minus Location.
0086   //! -  theS and theD1 coeffitients that are computed and used
0087   //! for computation of center of mass and inertia values
0088   //! by plane.
0089   Standard_EXPORT Standard_Real VolumeValue (const Standard_Real X, gp_XYZ& thePMP0, Standard_Real& theS, Standard_Real& theD1);
0090   
0091   //! Private method. Returns a value for the center of mass
0092   //! computation. If the value type other then GProp_CenterMassX,
0093   //! GProp_CenterMassY or GProp_CenterMassZ this method returns
0094   //! Standard_False. Returns Standard_True in case of successful
0095   //! computation of a value.
0096   Standard_EXPORT Standard_Boolean CenterMassValue (const Standard_Real X, Standard_Real& F);
0097   
0098   //! Private method. Computes the value of intertia. The type of
0099   //! a value returned is defined by the value type. If it is
0100   //! other then GProp_InertiaXX, GProp_InertiaYY,
0101   //! GProp_InertiaZZ, GProp_InertiaXY, GProp_InertiaXZ or
0102   //! GProp_InertiaYZ, the method returns Standard_False. Returns
0103   //! Standard_True in case of successful computation of a value
0104   Standard_EXPORT Standard_Boolean InertiaValue (const Standard_Real X, Standard_Real& F);
0105 
0106 
0107   BRepGProp_Face mySurface;
0108   gp_Pnt myVertex;
0109   const Standard_Real* myCoeffs;
0110   Standard_Real myVParam;
0111   GProp_ValueType myValueType;
0112   Standard_Boolean myIsByPoint;
0113 
0114 
0115 };
0116 
0117 
0118 #include <BRepGProp_UFunction.lxx>
0119 
0120 
0121 
0122 
0123 
0124 #endif // _BRepGProp_UFunction_HeaderFile