0032630: Coding - get rid of unsused forward declarations [BinMDF to IFSelect]
[occt.git] / src / GProp / GProp_PGProps.hxx
1 // Created on: 1992-02-14
2 // Created by: Jean Claude VAUTHIER
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _GProp_PGProps_HeaderFile
18 #define _GProp_PGProps_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <GProp_GProps.hxx>
25 #include <Standard_Real.hxx>
26 #include <TColgp_Array1OfPnt.hxx>
27 #include <TColgp_Array2OfPnt.hxx>
28 #include <TColStd_Array1OfReal.hxx>
29 #include <TColStd_Array2OfReal.hxx>
30 class gp_Pnt;
31
32
33 //! A framework for computing the global properties of a
34 //! set of points.
35 //! A point mass is attached to each point. The global
36 //! mass of the system is the sum of each individual
37 //! mass. By default, the point mass is equal to 1 and the
38 //! mass of a system composed of N points is equal to N.
39 //! Warning
40 //! A framework of this sort provides functions to handle
41 //! sets of points easily. But, like any GProp_GProps
42 //! object, by using the Add function, it can theoretically
43 //! bring together the computed global properties and
44 //! those of a system more complex than a set of points .
45 //! The mass of each point and the density of each
46 //! component of the composed system must be
47 //! coherent. Note that this coherence cannot be checked.
48 //! Nonetheless, you are advised to restrict your use of a
49 //! GProp_PGProps object to a set of points and to
50 //! create a GProp_GProps object in order to bring
51 //! together global properties of different systems.
52 class GProp_PGProps  : public GProp_GProps
53 {
54 public:
55
56   DEFINE_STANDARD_ALLOC
57
58   
59   //! Initializes a framework to compute global properties
60   //! on a set of points.
61   //! The point relative to which the inertia of the system is
62   //! computed will be the origin (0, 0, 0) of the
63   //! absolute Cartesian coordinate system.
64   //! At initialization, the framework is empty, i.e. it retains
65   //! no dimensional information such as mass and inertia.
66   //! It is, however, now able to keep global properties of a
67   //! set of points while new points are added using the
68   //! AddPoint function.
69   //! The set of points whose global properties are brought
70   //! together by this framework will then be referred to as
71   //! the current system. The current system is, however,
72   //! not kept by this framework, which only keeps that
73   //! system's global properties. Note that the current
74   //! system may be more complex than a set of points.
75   Standard_EXPORT GProp_PGProps();
76   
77   //! Brings together the global properties already
78   //! retained by this framework with those induced by
79   //! the point Pnt. Pnt may be the first point of the current system.
80   //! A point mass is attached to the point Pnt, it is either
81   //! equal to 1. or to Density.
82   Standard_EXPORT void AddPoint (const gp_Pnt& P);
83   
84
85   //! Adds a new point P with its density in the system of points
86   //! Exceptions
87   //! Standard_DomainError if the mass value Density
88   //! is less than gp::Resolution().
89   Standard_EXPORT void AddPoint (const gp_Pnt& P, const Standard_Real Density);
90   
91
92   //! computes the global properties of the system of points Pnts.
93   //! The density of the points are defaulted to all being 1
94   Standard_EXPORT GProp_PGProps(const TColgp_Array1OfPnt& Pnts);
95   
96
97   //! computes the global properties of the system of points Pnts.
98   //! The density of the points are defaulted to all being 1
99   Standard_EXPORT GProp_PGProps(const TColgp_Array2OfPnt& Pnts);
100   
101
102   //! computes the global properties of the system of points Pnts.
103   //! A density is associated with each point.
104   //!
105   //! raises if a density is lower or equal to Resolution from package
106   //! gp.
107   //!
108   //! raises if the length of Pnts and the length of Density
109   //! is not the same.
110   Standard_EXPORT GProp_PGProps(const TColgp_Array1OfPnt& Pnts, const TColStd_Array1OfReal& Density);
111   
112
113   //! computes the global properties of the system of points Pnts.
114   //! A density is associated with each point.
115   //!
116   //! Raised if a density is lower or equal to Resolution from package
117   //! gp.
118   //!
119   //! Raised if the length of Pnts and the length of Density
120   //! is not the same.
121   Standard_EXPORT GProp_PGProps(const TColgp_Array2OfPnt& Pnts, const TColStd_Array2OfReal& Density);
122   
123
124   //! Computes the barycentre of a set of points. The density of the
125   //! points is defaulted to 1.
126   Standard_EXPORT static gp_Pnt Barycentre (const TColgp_Array1OfPnt& Pnts);
127   
128
129   //! Computes the barycentre of a set of points. The density of the
130   //! points is defaulted to 1.
131   Standard_EXPORT static gp_Pnt Barycentre (const TColgp_Array2OfPnt& Pnts);
132   
133
134   //! Computes the barycentre of a set of points. A density is associated
135   //! with each point.
136   //!
137   //! raises if a density is lower or equal to Resolution from package
138   //! gp.
139   //!
140   //! Raised if the length of Pnts and the length of Density
141   //! is not the same.
142   Standard_EXPORT static void Barycentre (const TColgp_Array1OfPnt& Pnts, const TColStd_Array1OfReal& Density, Standard_Real& Mass, gp_Pnt& G);
143   
144
145   //! Computes the barycentre of a set of points. A density is associated
146   //! with each point.
147   //!
148   //! Raised if a density is lower or equal to Resolution from package
149   //! gp.
150   //!
151   //! Raised if the length of Pnts and the length of Density
152   //! is not the same.
153   Standard_EXPORT static void Barycentre (const TColgp_Array2OfPnt& Pnts, const TColStd_Array2OfReal& Density, Standard_Real& Mass, gp_Pnt& G);
154
155
156
157
158 protected:
159
160
161
162
163
164 private:
165
166
167
168
169
170 };
171
172
173
174
175
176
177
178 #endif // _GProp_PGProps_HeaderFile