0033661: Data Exchange, Step Import - Tessellated GDTs are not imported
[occt.git] / src / GProp / GProp_PGProps.hxx
CommitLineData
42cf5bc1 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>
42cf5bc1 25#include <TColgp_Array1OfPnt.hxx>
26#include <TColgp_Array2OfPnt.hxx>
27#include <TColStd_Array1OfReal.hxx>
28#include <TColStd_Array2OfReal.hxx>
42cf5bc1 29class gp_Pnt;
30
31
32//! A framework for computing the global properties of a
33//! set of points.
34//! A point mass is attached to each point. The global
35//! mass of the system is the sum of each individual
36//! mass. By default, the point mass is equal to 1 and the
37//! mass of a system composed of N points is equal to N.
38//! Warning
39//! A framework of this sort provides functions to handle
40//! sets of points easily. But, like any GProp_GProps
41//! object, by using the Add function, it can theoretically
42//! bring together the computed global properties and
43//! those of a system more complex than a set of points .
44//! The mass of each point and the density of each
45//! component of the composed system must be
46//! coherent. Note that this coherence cannot be checked.
47//! Nonetheless, you are advised to restrict your use of a
48//! GProp_PGProps object to a set of points and to
49//! create a GProp_GProps object in order to bring
50//! together global properties of different systems.
51class GProp_PGProps : public GProp_GProps
52{
53public:
54
55 DEFINE_STANDARD_ALLOC
56
57
58 //! Initializes a framework to compute global properties
59 //! on a set of points.
60 //! The point relative to which the inertia of the system is
61 //! computed will be the origin (0, 0, 0) of the
62 //! absolute Cartesian coordinate system.
63 //! At initialization, the framework is empty, i.e. it retains
64 //! no dimensional information such as mass and inertia.
65 //! It is, however, now able to keep global properties of a
66 //! set of points while new points are added using the
67 //! AddPoint function.
68 //! The set of points whose global properties are brought
69 //! together by this framework will then be referred to as
70 //! the current system. The current system is, however,
71 //! not kept by this framework, which only keeps that
72 //! system's global properties. Note that the current
73 //! system may be more complex than a set of points.
74 Standard_EXPORT GProp_PGProps();
75
76 //! Brings together the global properties already
77 //! retained by this framework with those induced by
78 //! the point Pnt. Pnt may be the first point of the current system.
79 //! A point mass is attached to the point Pnt, it is either
80 //! equal to 1. or to Density.
81 Standard_EXPORT void AddPoint (const gp_Pnt& P);
82
83
84 //! Adds a new point P with its density in the system of points
85 //! Exceptions
86 //! Standard_DomainError if the mass value Density
87 //! is less than gp::Resolution().
88 Standard_EXPORT void AddPoint (const gp_Pnt& P, const Standard_Real Density);
89
90
91 //! computes the global properties of the system of points Pnts.
92 //! The density of the points are defaulted to all being 1
93 Standard_EXPORT GProp_PGProps(const TColgp_Array1OfPnt& Pnts);
94
95
96 //! computes the global properties of the system of points Pnts.
97 //! The density of the points are defaulted to all being 1
98 Standard_EXPORT GProp_PGProps(const TColgp_Array2OfPnt& Pnts);
99
100
101 //! computes the global properties of the system of points Pnts.
102 //! A density is associated with each point.
103 //!
104 //! raises if a density is lower or equal to Resolution from package
105 //! gp.
106 //!
107 //! raises if the length of Pnts and the length of Density
108 //! is not the same.
109 Standard_EXPORT GProp_PGProps(const TColgp_Array1OfPnt& Pnts, const TColStd_Array1OfReal& Density);
110
111
112 //! computes the global properties of the system of points Pnts.
113 //! A density is associated with each point.
114 //!
115 //! Raised if a density is lower or equal to Resolution from package
116 //! gp.
117 //!
118 //! Raised if the length of Pnts and the length of Density
119 //! is not the same.
120 Standard_EXPORT GProp_PGProps(const TColgp_Array2OfPnt& Pnts, const TColStd_Array2OfReal& Density);
121
122
123 //! Computes the barycentre of a set of points. The density of the
124 //! points is defaulted to 1.
125 Standard_EXPORT static gp_Pnt Barycentre (const TColgp_Array1OfPnt& Pnts);
126
127
128 //! Computes the barycentre of a set of points. The density of the
129 //! points is defaulted to 1.
130 Standard_EXPORT static gp_Pnt Barycentre (const TColgp_Array2OfPnt& Pnts);
131
132
133 //! Computes the barycentre of a set of points. A density is associated
134 //! with each point.
135 //!
136 //! raises if a density is lower or equal to Resolution from package
137 //! gp.
138 //!
139 //! Raised if the length of Pnts and the length of Density
140 //! is not the same.
141 Standard_EXPORT static void Barycentre (const TColgp_Array1OfPnt& Pnts, const TColStd_Array1OfReal& Density, Standard_Real& Mass, gp_Pnt& G);
142
143
144 //! Computes the barycentre of a set of points. A density is associated
145 //! with each point.
146 //!
147 //! Raised if a density is lower or equal to Resolution from package
148 //! gp.
149 //!
150 //! Raised if the length of Pnts and the length of Density
151 //! is not the same.
152 Standard_EXPORT static void Barycentre (const TColgp_Array2OfPnt& Pnts, const TColStd_Array2OfReal& Density, Standard_Real& Mass, gp_Pnt& G);
153
154
155
156
157protected:
158
159
160
161
162
163private:
164
165
166
167
168
169};
170
171
172
173
174
175
176
177#endif // _GProp_PGProps_HeaderFile