summaryrefslogtreecommitdiff
path: root/inc/GeomPlate_BuildAveragePlane.hxx
blob: 79a34d4febae1f836216cf76521bf7e543031adc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _GeomPlate_BuildAveragePlane_HeaderFile
#define _GeomPlate_BuildAveragePlane_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_Macro_HeaderFile
#include <Standard_Macro.hxx>
#endif

#ifndef _Handle_TColgp_HArray1OfPnt_HeaderFile
#include <Handle_TColgp_HArray1OfPnt.hxx>
#endif
#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_Geom_Plane_HeaderFile
#include <Handle_Geom_Plane.hxx>
#endif
#ifndef _Handle_Geom_Line_HeaderFile
#include <Handle_Geom_Line.hxx>
#endif
#ifndef _gp_Vec_HeaderFile
#include <gp_Vec.hxx>
#endif
#ifndef _gp_Pnt_HeaderFile
#include <gp_Pnt.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
class TColgp_HArray1OfPnt;
class Geom_Plane;
class Geom_Line;
class Standard_NoSuchObject;
class TColgp_SequenceOfVec;
class gp_Vec;
class GeomPlate_SequenceOfAij;


//! This class computes an average inertial plane with an <br>
//!          array of points. <br>
class GeomPlate_BuildAveragePlane  {
public:

  void* operator new(size_t,void* anAddress) 
  {
    return anAddress;
  }
  void* operator new(size_t size) 
  {
    return Standard::Allocate(size); 
  }
  void  operator delete(void *anAddress) 
  {
    if (anAddress) Standard::Free((Standard_Address&)anAddress); 
  }

  //! Tol is a  Tolerance to make the difference between <br>
//!           the result plane and the result line. <br>
//! if POption = 1 : automatical parametrisation <br>
//! if POption = 2 : parametrisation by eigen vectors <br>
//! if NOption = 1 : the average plane is the inertial plane. <br>
//! if NOption = 2 : the average plane is the plane of max. flux. <br>
  Standard_EXPORT   GeomPlate_BuildAveragePlane(const Handle(TColgp_HArray1OfPnt)& Pts,const Standard_Integer NbBoundPoints,const Standard_Real Tol,const Standard_Integer POption,const Standard_Integer NOption);
  //! Creates the plane from the "best vector" <br>
  Standard_EXPORT   GeomPlate_BuildAveragePlane(const TColgp_SequenceOfVec& Normals,const Handle(TColgp_HArray1OfPnt)& Pts);
  
//! Return the average Plane. <br>
  Standard_EXPORT     Handle_Geom_Plane Plane() const;
  
//! Return a Line when 2 eigenvalues are null. <br>
  Standard_EXPORT     Handle_Geom_Line Line() const;
  //! return OK if is a plane. <br>
  Standard_EXPORT     Standard_Boolean IsPlane() const;
  //! return OK if is a line. <br>
  Standard_EXPORT     Standard_Boolean IsLine() const;
  //! computes the   minimal box  to include  all normal <br>
//!          projection points of the initial array  on the plane. <br>
  Standard_EXPORT     void MinMaxBox(Standard_Real& Umin,Standard_Real& Umax,Standard_Real& Vmin,Standard_Real& Vmax) const;
  
  Standard_EXPORT   static  Standard_Boolean HalfSpace(const TColgp_SequenceOfVec& NewNormals,TColgp_SequenceOfVec& Normals,GeomPlate_SequenceOfAij& Bset,const Standard_Real LinTol,const Standard_Real AngTol) ;





protected:





private:

  //! Computes a base of the average plane defined by (myG,N) <br>
//! using eigen vectors <br>
  Standard_EXPORT     void BasePlan(const gp_Vec& N) ;
  //! Defines the average plane. <br>
//! if NOption = 1 : the average plane is the inertial plane. <br>
//! if NOption = 2 : the average plane is the plane of max. flux. <br>
  Standard_EXPORT     gp_Vec DefPlan(const Standard_Integer NOption) ;


Handle_TColgp_HArray1OfPnt myPts;
Standard_Real myUmax;
Standard_Real myVmax;
Standard_Real myVmin;
Standard_Real myUmin;
Handle_Geom_Plane myPlane;
Standard_Real myTol;
Handle_Geom_Line myLine;
gp_Vec myOX;
gp_Vec myOY;
gp_Pnt myG;
Standard_Integer myNbBoundPoints;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif