summaryrefslogtreecommitdiff
path: root/inc/ShapeAnalysis_Curve.hxx
blob: 967cf308688e1959e2ed5dd6b3e356704074ec71 (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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// 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 _ShapeAnalysis_Curve_HeaderFile
#define _ShapeAnalysis_Curve_HeaderFile

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

#ifndef _Standard_Real_HeaderFile
#include <Standard_Real.hxx>
#endif
#ifndef _Handle_Geom_Curve_HeaderFile
#include <Handle_Geom_Curve.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Handle_Geom2d_Curve_HeaderFile
#include <Handle_Geom2d_Curve.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
class Geom_Curve;
class gp_Pnt;
class Adaptor3d_Curve;
class Geom2d_Curve;
class Bnd_Box2d;
class TColgp_Array1OfPnt;
class gp_XYZ;
class TColgp_SequenceOfPnt2d;
class TColgp_SequenceOfPnt;


//! Analyzing tool for 2d or 3d curve. <br>
//!          Computes parameters of projected point onto a curve. <br>
class ShapeAnalysis_Curve  {
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); 
  }

  //! Projects a Point on a Curve. <br>
//!           Computes the projected point and its parameter on the curve. <br>
//!           <preci> is used as 3d precision (hence, 0 will produce <br>
//!           reject unless exact confusion). <br>
//!           The number of iterations is limited. <br>
//!           If AdjustToEnds is True, point will be adjusted to the end <br>
//!           of the curve if distance is less than <preci> <br>
//! <br>
//!           Returned value is the distance between the given point and <br>
//!           computed one. <br>
  Standard_EXPORT     Standard_Real Project(const Handle(Geom_Curve)& C3D,const gp_Pnt& P3D,const Standard_Real preci,gp_Pnt& proj,Standard_Real& param,const Standard_Boolean AdjustToEnds = Standard_True) const;
  //! Projects a Point on a Curve. <br>
//!           Computes the projected point and its parameter on the curve. <br>
//!           <preci> is used as 3d precision (hence, 0 will produce <br>
//!           reject unless exact confusion). <br>
//!           The number of iterations is limited. <br>
//! <br>
//!           Returned value is the distance between the given point and <br>
//!           computed one. <br>
  Standard_EXPORT     Standard_Real Project(const Adaptor3d_Curve& C3D,const gp_Pnt& P3D,const Standard_Real preci,gp_Pnt& proj,Standard_Real& param,const Standard_Boolean AdjustToEnds = Standard_True) const;
  //! Projects a Point on a Curve, but parameters are limited <br>
//!           between <cf> and <cl>. <br>
//!           The range [cf, cl] is extended with help of Adaptor3d on the <br>
//!           basis of 3d precision <preci>. <br>
//!           If AdjustToEnds is True, point will be adjusted to the end <br>
//!           of the curve if distance is less than <preci> <br>
  Standard_EXPORT     Standard_Real Project(const Handle(Geom_Curve)& C3D,const gp_Pnt& P3D,const Standard_Real preci,gp_Pnt& proj,Standard_Real& param,const Standard_Real cf,const Standard_Real cl,const Standard_Boolean AdjustToEnds = Standard_True) const;
  
  Standard_EXPORT     Standard_Real ProjectAct(const Adaptor3d_Curve& C3D,const gp_Pnt& P3D,const Standard_Real preci,gp_Pnt& proj,Standard_Real& param) const;
  //! Projects a Point on a Curve using Newton method. <br>
//!          <paramPrev> is taken as the first approximation of solution. <br>
//!          If Newton algorithm fails the method Project() is used. <br>
//!          If AdjustToEnds is True, point will be adjusted to the end <br>
//!          of the curve if distance is less than <preci> <br>
  Standard_EXPORT     Standard_Real NextProject(const Standard_Real paramPrev,const Handle(Geom_Curve)& C3D,const gp_Pnt& P3D,const Standard_Real preci,gp_Pnt& proj,Standard_Real& param,const Standard_Real cf,const Standard_Real cl,const Standard_Boolean AdjustToEnds = Standard_True) const;
  //! Projects a Point on a Curve using Newton method. <br>
//!          <paramPrev> is taken as the first approximation of solution. <br>
//!          If Newton algorithm fails the method Project() is used. <br>
  Standard_EXPORT     Standard_Real NextProject(const Standard_Real paramPrev,const Adaptor3d_Curve& C3D,const gp_Pnt& P3D,const Standard_Real preci,gp_Pnt& proj,Standard_Real& param) const;
  //! Validate parameters First and Last for the given curve <br>
//!          in order to make them valid for creation of edge. <br>
//!          This includes: <br>
//!          - limiting range [First,Last] by range of curve <br>
//!          - adjusting range [First,Last] for periodic (or closed) <br>
//!            curve if Last < First <br>
//!          Returns True if parameters are OK or are successfully <br>
//!          corrected, or False if parameters cannot be corrected. <br>
//!          In the latter case, parameters are reset to range of curve. <br>
  Standard_EXPORT     Standard_Boolean ValidateRange(const Handle(Geom_Curve)& Crv,Standard_Real& First,Standard_Real& Last,const Standard_Real prec) const;
  //! Computes a boundary box on segment of curve C2d from First <br>
//!          to Last. This is done by taking NPoints points from the <br>
//!          curve and, if Exact is True, by searching for exact <br>
//!          extrema. All these points are added to Box. <br>
  Standard_EXPORT     void FillBndBox(const Handle(Geom2d_Curve)& C2d,const Standard_Real First,const Standard_Real Last,const Standard_Integer NPoints,const Standard_Boolean Exact,Bnd_Box2d& Box) const;
  //! Defines which pcurve (C1 or C2) should be chosen for FORWARD <br>
//!          seam edge. <br>
  Standard_EXPORT     Standard_Integer SelectForwardSeam(const Handle(Geom2d_Curve)& C1,const Handle(Geom2d_Curve)& C2) const;
  //! Checks if points are planar with given preci. If Normal has not zero <br>
//!          modulus, checks with given normal <br>
  Standard_EXPORT   static  Standard_Boolean IsPlanar(const TColgp_Array1OfPnt& pnts,gp_XYZ& Normal,const Standard_Real preci = 0) ;
  //! Checks if curve is planar with given preci. If Normal has not zero <br>
//!          modulus, checks with given normal <br>
  Standard_EXPORT   static  Standard_Boolean IsPlanar(const Handle(Geom_Curve)& curve,gp_XYZ& Normal,const Standard_Real preci = 0) ;
  //! Returns sample points which will serve as linearisation <br>
//!          of the2d curve in range (first, last) <br>
//!          The distribution of sample points is consystent with <br>
//!          what is used by BRepTopAdaptor_FClass2d <br>
  Standard_EXPORT   static  Standard_Boolean GetSamplePoints(const Handle(Geom2d_Curve)& curve,const Standard_Real first,const Standard_Real last,TColgp_SequenceOfPnt2d& seq) ;
  //! Returns sample points which will serve as linearisation <br>
//!          of the curve in range (first, last) <br>
  Standard_EXPORT   static  Standard_Boolean GetSamplePoints(const Handle(Geom_Curve)& curve,const Standard_Real first,const Standard_Real last,TColgp_SequenceOfPnt& seq) ;
  //! Tells if the Curve is closed with given precision. <br>
//!          If <preci> < 0 then Precision::Confusion is used. <br>
  Standard_EXPORT   static  Standard_Boolean IsClosed(const Handle(Geom_Curve)& curve,const Standard_Real preci = -1) ;
  //! This method was implemented as fix for changes in trimmed curve <br>
//!          behaviour. For the moment trimmed curve returns false anyway. <br>
//!          So it is necessary to adapt all Data exchange tools for this behaviour. <br>
//!          Current implementation takes into account that curve may be offset. <br>
  Standard_EXPORT   static  Standard_Boolean IsPeriodic(const Handle(Geom_Curve)& curve) ;
  //! The same as for Curve3d. <br>
  Standard_EXPORT   static  Standard_Boolean IsPeriodic(const Handle(Geom2d_Curve)& curve) ;





protected:





private:





};





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


#endif