0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / BRepGProp / BRepGProp.cdl
CommitLineData
b311480e 1-- Created on: 1992-12-04
2-- Created by: Isabelle GRIGNON
3-- Copyright (c) 1992-1999 Matra Datavision
4-- Copyright (c) 1999-2012 OPEN CASCADE SAS
5--
6-- The content of this file is subject to the Open CASCADE Technology Public
7-- License Version 6.5 (the "License"). You may not use the content of this file
8-- except in compliance with the License. Please obtain a copy of the License
9-- at http://www.opencascade.org and read it completely before using this file.
10--
11-- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12-- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13--
14-- The Original Code and all software distributed under the License is
15-- distributed on an "AS IS" basis, without warranty of any kind, and the
16-- Initial Developer hereby disclaims all such warranties, including without
17-- limitation, any warranties of merchantability, fitness for a particular
18-- purpose or non-infringement. Please see the License for the specific terms
19-- and conditions governing the rights and limitations under the License.
20
7fd59977 21
22
23
24package BRepGProp
25
26 ---Purpose: Provides global functions to compute a shape's global
27-- properties for lines, surfaces or volumes, and bring
28-- them together with the global properties already
29-- computed for a geometric system.
30-- The global properties computed for a system are :
31-- - its mass,
32-- - its center of mass,
33-- - its matrix of inertia,
34-- - its moment about an axis,
35-- - its radius of gyration about an axis,
36-- - and its principal properties of inertia such as
37-- principal axis, principal moments, principal radius of gyration.
38
39uses GProp,
40 BRepAdaptor,
41 BRepTools,
42 BRep,
43 TopExp,
44 TopoDS,
45 Geom2dAdaptor,
46 gp,
47 GeomAbs,
48 TColStd
49
50is
51
52 class EdgeTool;
53
54 class Face;
55
56 class Domain;
57
58 class Cinert instantiates CGProps from GProp( Curve from BRepAdaptor,
59 EdgeTool from BRepGProp);
60
61 class Sinert instantiates SGProps from GProp( Edge from TopoDS,
62 Face from BRepGProp ,
63 Domain from BRepGProp);
64
65 class Vinert instantiates VGProps from GProp( Edge from TopoDS,
66 Face from BRepGProp,
67 Domain from BRepGProp);
68
69 class VinertGK instantiates VGPropsGK from GProp( Edge from TopoDS,
70 Face from BRepGProp,
71 Domain from BRepGProp);
72 --
73 -- Package methods to compute global properties.
74 --
75
76 LinearProperties(S : Shape from TopoDS; LProps : in out GProps from GProp);
77 ---Purpose: Computes the linear global properties of the shape S,
78-- i.e. the global properties induced by each edge of the
79-- shape S, and brings them together with the global
80-- properties still retained by the framework LProps. If
81-- the current system of LProps was empty, its global
82-- properties become equal to the linear global
83-- properties of S.
84-- For this computation no linear density is attached to
85-- the edges. So, for example, the added mass
86-- corresponds to the sum of the lengths of the edges of
87-- S. The density of the composed systems, i.e. that of
88-- each component of the current system of LProps, and
89-- that of S which is considered to be equal to 1, must be coherent.
90-- Note that this coherence cannot be checked. You are
91-- advised to use a separate framework for each
92-- density, and then to bring these frameworks together
93-- into a global one.
94-- The point relative to which the inertia of the system is
95-- computed is the reference point of the framework LProps.
96-- Note: if your programming ensures that the framework
97-- LProps retains only linear global properties (brought
98-- together for example, by the function
99-- LinearProperties) for objects the density of which is
100-- equal to 1 (or is not defined), the function Mass will
101-- return the total length of edges of the system analysed by LProps.
102-- Warning
103-- No check is performed to verify that the shape S
104-- retains truly linear properties. If S is simply a vertex, it
105-- is not considered to present any additional global properties.
106
107 SurfaceProperties(S : Shape from TopoDS; SProps : in out GProps from GProp);
108 ---Purpose: Computes the surface global properties of the
109-- shape S, i.e. the global properties induced by each
110-- face of the shape S, and brings them together with
111-- the global properties still retained by the framework
112-- SProps. If the current system of SProps was empty,
113-- its global properties become equal to the surface
114-- global properties of S.
115-- For this computation, no surface density is attached
116-- to the faces. Consequently, the added mass
117-- corresponds to the sum of the areas of the faces of
118-- S. The density of the component systems, i.e. that
119-- of each component of the current system of
120-- SProps, and that of S which is considered to be
121-- equal to 1, must be coherent.
122-- Note that this coherence cannot be checked. You
123-- are advised to use a framework for each different
124-- value of density, and then to bring these
125-- frameworks together into a global one.
126-- The point relative to which the inertia of the system
127-- is computed is the reference point of the framework SProps.
128-- Note : if your programming ensures that the
129-- framework SProps retains only surface global
130-- properties, brought together, for example, by the
131-- function SurfaceProperties, for objects the density
132-- of which is equal to 1 (or is not defined), the
133-- function Mass will return the total area of faces of
134-- the system analysed by SProps.
135-- Warning
136-- No check is performed to verify that the shape S
137-- retains truly surface properties. If S is simply a
138-- vertex, an edge or a wire, it is not considered to
139-- present any additional global properties.
140
141 SurfaceProperties(S : Shape from TopoDS; SProps : in out GProps from GProp;
142 Eps: Real) returns Real;
143 ---Purpose: Updates <SProps> with the shape <S>, that contains its pricipal properties.
144 -- The surface properties of all the faces in <S> are computed.
145 -- Adaptive 2D Gauss integration is used.
146 -- Parameter Eps sets maximal relative error of computed mass (area) for each 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 -- Method returns estimation of relative error reached for whole shape.
150 -- WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
151
152
153------------------------
154-- VolumeProperties --
155------------------------
156
157 ---Purpose:
158-- Computes the global volume properties of the solid
159-- S, and brings them together with the global
160-- properties still retained by the framework VProps. If
161-- the current system of VProps was empty, its global
162-- properties become equal to the global properties of S for volume.
163-- For this computation, no volume density is attached
164-- to the solid. Consequently, the added mass
165-- corresponds to the volume of S. The density of the
166-- component systems, i.e. that of each component of
167-- the current system of VProps, and that of S which
168-- is considered to be equal to 1, must be coherent to each other.
169-- Note that this coherence cannot be checked. You
170-- are advised to use a separate framework for each
171-- density, and then to bring these frameworks
172-- together into a global one.
173-- The point relative to which the inertia of the system
174-- is computed is the reference point of the framework VProps.
175-- Note: if your programming ensures that the
176-- framework VProps retains only global properties of
177-- volume (brought together for example, by the
178-- function VolumeProperties) for objects the density
179-- of which is equal to 1 (or is not defined), the
180-- function Mass will return the total volume of the
181-- solids of the system analysed by VProps.
182-- Warning
183-- The shape S must represent an object whose
184-- global volume properties can be computed. It may
185-- be a finite solid, or a series of finite solids all
186-- oriented in a coherent way. Nonetheless, S must be
187-- exempt of any free boundary. Note that these
188-- conditions of coherence are not checked by this
189-- algorithm, and results will be false if they are not respected.
190 VolumeProperties(S : Shape from TopoDS; VProps : in out GProps from GProp;
191 OnlyClosed: Boolean = Standard_False);
192
193 VolumeProperties(S : Shape from TopoDS; VProps : in out GProps from GProp;
194 Eps: Real; OnlyClosed: Boolean = Standard_False) returns Real;
195 ---Purpose: Updates <VProps> with the shape <S>, that contains its pricipal properties.
196 -- The volume properties of all the FORWARD and REVERSED faces in <S> are computed.
197 -- If OnlyClosed is True then computed faces must belong to closed Shells.
198 -- Adaptive 2D Gauss integration is used.
199 -- Parameter Eps sets maximal relative error of computed mass (volume) for each face.
200 -- Error is calculated as Abs((M(i+1)-M(i))/M(i+1)), M(i+1) and M(i) are values
201 -- for two successive steps of adaptive integration.
202 -- Method returns estimation of relative error reached for whole shape.
203 -- WARNING: if Eps > 0.001 algorithm performs non-adaptive integration.
204
205
206
207
208
209
210-- ----------------------------------------------------------------------------------------
211 VolumePropertiesGK(S : Shape from TopoDS;
212 VProps : in out GProps from GProp;
213 Eps : Real from Standard = 0.001;
214 OnlyClosed: Boolean from Standard = Standard_False;
215 IsUseSpan : Boolean from Standard = Standard_False;
216 CGFlag : Boolean from Standard = Standard_False;
217 IFlag : Boolean from Standard = Standard_False)
218
219 returns Real;
220 ---Purpose: Updates <VProps> with the shape <S>, that contains its pricipal properties.
221 -- The volume properties of all the FORWARD and REVERSED faces in <S> are computed.
222 -- If OnlyClosed is True then computed faces must belong to closed Shells.
223 -- Adaptive 2D Gauss integration is used.
224 -- Parameter IsUseSpan says if it is necessary to define spans on a face.
225 -- This option has an effect only for BSpline faces.
226 -- Parameter Eps sets maximal relative error of computed property for each face.
227 -- Error is delivered by the adaptive Gauss-Kronrod method of integral computation
228 -- that is used for properties computation.
229 -- Method returns estimation of relative error reached for whole shape.
230 -- Returns negative value if the computation is failed.
231 VolumePropertiesGK(S : Shape from TopoDS;
232 VProps : in out GProps from GProp;
233 thePln: Pln from gp;
234 Eps : Real from Standard = 0.001;
235 OnlyClosed: Boolean from Standard = Standard_False;
236 IsUseSpan : Boolean from Standard = Standard_False;
237 CGFlag : Boolean from Standard = Standard_False;
238 IFlag : Boolean from Standard = Standard_False)
239 returns Real;
240
241end BRepGProp;
242
243
244
245
246