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>
30 class Standard_NoSuchObject;
37 //! A framework to analyze a collection - or cloud
38 //! - of points and to verify if they are coincident,
39 //! collinear or coplanar within a given precision. If
40 //! so, it also computes the mean point, the mean
41 //! line or the mean plane of the points. If not, it
42 //! computes the minimal box which includes all the points.
50 //! Constructs a framework to analyze the
51 //! collection of points Pnts and computes:
52 //! - the mean point if the points in question are
53 //! considered to be coincident within the precision Tol, or
54 //! - the mean line if they are considered to be
55 //! collinear within the precision Tol, or
56 //! - the mean plane if they are considered to be
57 //! coplanar within the precision Tol, or
58 //! - the minimal box which contains all the points. Use :
59 //! - the functions IsPoint, IsLinear, IsPlanar
60 //! and IsSpace to find the result of the analysis, and
61 //! - the function Point, Line, Plane or Box to
62 //! access the computed result.
63 Standard_EXPORT GProp_PEquation(const TColgp_Array1OfPnt& Pnts, const Standard_Real Tol);
65 //! Returns true if, according to the given
66 //! tolerance, the points analyzed by this framework are coplanar.
67 //! Use the function Plane to access the computed result.
68 Standard_EXPORT Standard_Boolean IsPlanar() const;
70 //! Returns true if, according to the given
71 //! tolerance, the points analyzed by this framework are colinear.
72 //! Use the function Line to access the computed result.
73 Standard_EXPORT Standard_Boolean IsLinear() const;
75 //! Returns true if, according to the given
76 //! tolerance, the points analyzed by this framework are coincident.
77 //! Use the function Point to access the computed result.
78 Standard_EXPORT Standard_Boolean IsPoint() const;
80 //! Returns true if, according to the given
81 //! tolerance value, the points analyzed by this
82 //! framework are neither coincident, nor collinear, nor coplanar.
83 //! Use the function Box to query the smallest box
84 //! that includes the collection of points.
85 Standard_EXPORT Standard_Boolean IsSpace() const;
87 //! Returns the mean plane passing near all the
88 //! points analyzed by this framework if, according
89 //! to the given precision, the points are considered to be coplanar.
91 //! Standard_NoSuchObject if, according to the
92 //! given precision value, the points analyzed by
93 //! this framework are considered to be:
97 Standard_EXPORT gp_Pln Plane() const;
99 //! Returns the mean line passing near all the
100 //! points analyzed by this framework if, according
101 //! to the given precision value, the points are considered to be collinear.
103 //! Standard_NoSuchObject if, according to the
104 //! given precision, the points analyzed by this
105 //! framework are considered to be:
108 Standard_EXPORT gp_Lin Line() const;
110 //! Returns the mean point of all the points
111 //! analyzed by this framework if, according to the
112 //! given precision, the points are considered to be coincident.
114 //! Standard_NoSuchObject if, according to the
115 //! given precision, the points analyzed by this
116 //! framework are not considered to be coincident.
117 Standard_EXPORT gp_Pnt Point() const;
119 //! Returns the definition of the smallest box which
120 //! contains all the points analyzed by this
121 //! framework if, according to the given precision
122 //! value, the points are considered to be neither
123 //! coincident, nor collinear and nor coplanar.
124 //! This box is centered on the barycenter P of the
125 //! collection of points. Its sides are parallel to the
126 //! three vectors V1, V2 and V3, the length of
127 //! which is the length of the box in the corresponding direction.
128 //! Note: Vectors V1, V2 and V3 are parallel to
129 //! the three axes of principal inertia of the system
130 //! composed of the collection of points where each point is of equal mass.
132 //! Standard_NoSuchObject if, according to the given precision,
133 //! the points analyzed by this framework are considered to be coincident, collinear or coplanar.
134 Standard_EXPORT void Box (gp_Pnt& P, gp_Vec& V1, gp_Vec& V2, gp_Vec& V3) const;
164 #endif // _GProp_PEquation_HeaderFile