424cd6bb |
1 | -- Created on: 2005-12-21 |
2 | -- Created by: Sergey KHROMOV |
3 | -- Copyright (c) 2005-2014 OPEN CASCADE SAS |
4 | -- |
5 | -- This file is part of Open CASCADE Technology software library. |
6 | -- |
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. |
12 | -- |
13 | -- Alternatively, this file may be used under the terms of Open CASCADE |
14 | -- commercial license or contractual agreement. |
15 | |
16 | class UFunction from BRepGProp inherits Function from math |
17 | |
18 | ---Purpose: This class represents the integrand function for |
19 | -- computation of an inner integral. The returned value |
20 | -- depends on the value type and the flag IsByPoint. |
21 | -- |
22 | -- The type of returned value is the one of the following |
23 | -- values: |
24 | -- - GProp_Mass - volume computation. |
25 | -- - GProp_CenterMassX, GProp_CenterMassY, |
26 | -- GProp_CenterMassZ - X, Y and Z coordinates of center |
27 | -- of mass computation. |
28 | -- - GProp_InertiaXX, GProp_InertiaYY, GProp_InertiaZZ, |
29 | -- GProp_InertiaXY, GProp_InertiaXZ, GProp_InertiaYZ |
30 | -- - moments of inertia computation. |
31 | -- |
32 | -- If the flag IsByPoint is set to Standard_True, the value is |
33 | -- returned for the region of space that is delimited by a |
34 | -- surface and a point. Otherwise all computations are |
35 | -- performed for the region of space delimited by a surface |
36 | -- and a plane. |
37 | |
38 | uses |
39 | Pnt from gp, |
40 | XYZ from gp, |
41 | Address from Standard, |
42 | Boolean from Standard, |
43 | Real from Standard, |
44 | ValueType from GProp, |
45 | Face from BRepGProp |
46 | |
47 | is |
48 | |
49 | Create(theSurface: Face from BRepGProp; |
50 | theVertex : Pnt from gp; |
51 | IsByPoint : Boolean from Standard; |
52 | theCoeffs : Address from Standard) |
53 | ---Purpose: Constructor. Initializes the function with the face, the |
54 | -- location point, the flag IsByPoint and the coefficients |
55 | -- theCoeff that have different meaning depending on the value |
56 | -- of IsByPoint. |
57 | -- If IsByPoint is equal to Standard_True, the number of the |
58 | -- coefficients is equal to 3 and they represent X, Y and Z |
59 | -- coordinates (theCoeff[0], theCoeff[1] and theCoeff[2] |
60 | -- correspondingly) of the shift, if the inertia is computed |
61 | -- with respect to the point different then the location. |
62 | -- If IsByPoint is equal to Standard_False, the number of the |
63 | -- coefficients is 4 and they represent the combination of |
64 | -- plane parameters and shift values. |
65 | returns UFunction from BRepGProp; |
66 | |
67 | SetValueType(me: in out; theType: ValueType from GProp); |
68 | ---Purpose: Setting the type of the value to be returned. |
69 | ---C++: inline |
70 | |
71 | SetVParam(me: in out; theVParam: Real from Standard); |
72 | ---Purpose: Setting the V parameter that is constant during the |
73 | -- integral computation. |
74 | ---C++: inline |
75 | |
76 | Value(me: in out; X: Real from Standard; |
77 | F: out Real from Standard) |
78 | ---Purpose: Returns a value of the function. |
79 | returns Boolean from Standard |
80 | is redefined; |
81 | |
82 | ----------------------- |
83 | -- Private methods -- |
84 | ----------------------- |
85 | |
86 | VolumeValue(me: in out; X : Real from Standard; |
87 | thePMP0: out XYZ from gp; |
88 | theS : out Real from Standard; |
89 | theD1 : out Real from Standard) |
90 | ---Purpose: Private method. Returns the value for volume computation. |
91 | -- Other returned values are: |
92 | -- - thePMP0 - PSurf(X,Y) minus Location. |
93 | -- - theS and theD1 coeffitients that are computed and used |
94 | -- for computation of center of mass and inertia values |
95 | -- by plane. |
96 | returns Real from Standard |
97 | is private; |
98 | |
99 | CenterMassValue(me: in out; X: Real from Standard; |
100 | F: out Real from Standard) |
101 | ---Purpose: Private method. Returns a value for the center of mass |
102 | -- computation. If the value type other then GProp_CenterMassX, |
103 | -- GProp_CenterMassY or GProp_CenterMassZ this method returns |
104 | -- Standard_False. Returns Standard_True in case of successful |
105 | -- computation of a value. |
106 | returns Boolean from Standard |
107 | is private; |
108 | |
109 | InertiaValue(me: in out; X: Real from Standard; |
110 | F: out Real from Standard) |
111 | ---Purpose: Private method. Computes the value of intertia. The type of |
112 | -- a value returned is defined by the value type. If it is |
113 | -- other then GProp_InertiaXX, GProp_InertiaYY, |
114 | -- GProp_InertiaZZ, GProp_InertiaXY, GProp_InertiaXZ or |
115 | -- GProp_InertiaYZ, the method returns Standard_False. Returns |
116 | -- Standard_True in case of successful computation of a value |
117 | returns Boolean from Standard |
118 | is private; |
119 | |
120 | fields |
121 | |
122 | mySurface : Face from BRepGProp; |
123 | myVertex : Pnt from gp; |
124 | myCoeffs : Address from Standard; |
125 | myVParam : Real from Standard; |
126 | myValueType: ValueType from GProp; |
127 | myIsByPoint: Boolean from Standard; |
128 | |
129 | end UFunction; |