1 // Created on: 1993-06-16
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1993-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
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.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _GProp_PEquation_HeaderFile
18 #define _GProp_PEquation_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <GProp_EquaType.hxx>
27 #include <TColgp_Array1OfPnt.hxx>
28 #include <Standard_Real.hxx>
29 #include <Standard_Boolean.hxx>
34 //! A framework to analyze a collection - or cloud
35 //! - of points and to verify if they are coincident,
36 //! collinear or coplanar within a given precision. If
37 //! so, it also computes the mean point, the mean
38 //! line or the mean plane of the points. If not, it
39 //! computes the minimal box which includes all the points.
47 //! Constructs a framework to analyze the
48 //! collection of points Pnts and computes:
49 //! - the mean point if the points in question are
50 //! considered to be coincident within the precision Tol, or
51 //! - the mean line if they are considered to be
52 //! collinear within the precision Tol, or
53 //! - the mean plane if they are considered to be
54 //! coplanar within the precision Tol, or
55 //! - the minimal box which contains all the points. Use :
56 //! - the functions IsPoint, IsLinear, IsPlanar
57 //! and IsSpace to find the result of the analysis, and
58 //! - the function Point, Line, Plane or Box to
59 //! access the computed result.
60 Standard_EXPORT GProp_PEquation(const TColgp_Array1OfPnt& Pnts, const Standard_Real Tol);
62 //! Returns true if, according to the given
63 //! tolerance, the points analyzed by this framework are coplanar.
64 //! Use the function Plane to access the computed result.
65 Standard_EXPORT Standard_Boolean IsPlanar() const;
67 //! Returns true if, according to the given
68 //! tolerance, the points analyzed by this framework are colinear.
69 //! Use the function Line to access the computed result.
70 Standard_EXPORT Standard_Boolean IsLinear() const;
72 //! Returns true if, according to the given
73 //! tolerance, the points analyzed by this framework are coincident.
74 //! Use the function Point to access the computed result.
75 Standard_EXPORT Standard_Boolean IsPoint() const;
77 //! Returns true if, according to the given
78 //! tolerance value, the points analyzed by this
79 //! framework are neither coincident, nor collinear, nor coplanar.
80 //! Use the function Box to query the smallest box
81 //! that includes the collection of points.
82 Standard_EXPORT Standard_Boolean IsSpace() const;
84 //! Returns the mean plane passing near all the
85 //! points analyzed by this framework if, according
86 //! to the given precision, the points are considered to be coplanar.
88 //! Standard_NoSuchObject if, according to the
89 //! given precision value, the points analyzed by
90 //! this framework are considered to be:
94 Standard_EXPORT gp_Pln Plane() const;
96 //! Returns the mean line passing near all the
97 //! points analyzed by this framework if, according
98 //! to the given precision value, the points are considered to be collinear.
100 //! Standard_NoSuchObject if, according to the
101 //! given precision, the points analyzed by this
102 //! framework are considered to be:
105 Standard_EXPORT gp_Lin Line() const;
107 //! Returns the mean point of all the points
108 //! analyzed by this framework if, according to the
109 //! given precision, the points are considered to be coincident.
111 //! Standard_NoSuchObject if, according to the
112 //! given precision, the points analyzed by this
113 //! framework are not considered to be coincident.
114 Standard_EXPORT gp_Pnt Point() const;
116 //! Returns the definition of the smallest box which
117 //! contains all the points analyzed by this
118 //! framework if, according to the given precision
119 //! value, the points are considered to be neither
120 //! coincident, nor collinear and nor coplanar.
121 //! This box is centered on the barycenter P of the
122 //! collection of points. Its sides are parallel to the
123 //! three vectors V1, V2 and V3, the length of
124 //! which is the length of the box in the corresponding direction.
125 //! Note: Vectors V1, V2 and V3 are parallel to
126 //! the three axes of principal inertia of the system
127 //! composed of the collection of points where each point is of equal mass.
129 //! Standard_NoSuchObject if, according to the given precision,
130 //! the points analyzed by this framework are considered to be coincident, collinear or coplanar.
131 Standard_EXPORT void Box (gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const;
161 #endif // _GProp_PEquation_HeaderFile