Free Electron
ConvergentSpline.h
Go to the documentation of this file.
1 /* Copyright (C) 2003-2021 Free Electron Organization
2  Any use of this software requires a license. If a valid license
3  was not distributed with this file, visit freeelectron.org. */
4 
5 /** @file */
6 
7 #ifndef __geometry_ConvergentSpline_h__
8 #define __geometry_ConvergentSpline_h__
9 
10 namespace fe
11 {
12 namespace ext
13 {
14 
15 /**************************************************************************//**
16  @brief Evaluate a stack of basis splines to approach the control points
17 
18  @ingroup geometry
19 *//***************************************************************************/
20 class FE_DL_EXPORT ConvergentSpline
21 {
22  public:
23  ConvergentSpline(void):
24  m_iterations(100),
25  m_threshold(1e-3),
26  m_count(0),
27  m_pKnots(NULL)
28  {
29  m_pControl[0]=NULL;
30  m_pControl[1]=NULL;
31  m_pControl[2]=NULL;
32  }
33 
34  ~ConvergentSpline(void)
35  { reset(); }
36 
37  void setIterations(I32 a_iterations)
38  { m_iterations=a_iterations; }
39  void setThreshold(Real a_threshold)
40  { m_threshold=a_threshold; }
41 
42  Real configure(I32 a_count,SpatialVector* a_pPoint,
43  SpatialVector* a_pNormal);
44 
45  SpatialVector solve(Real a_t);
46 
47  private:
48 
49  void reset(void)
50  {
51  m_count=0;
52  if(m_count)
53  {
54  delete m_pKnots;
55  delete m_pControl[0];
56  delete m_pControl[1];
57  delete m_pControl[2];
58 
59  m_pKnots=NULL;
60  m_pControl[0]=NULL;
61  m_pControl[1]=NULL;
62  m_pControl[2]=NULL;
63  }
64  }
65 
66  I32 m_iterations;
67  Real m_threshold;
68 
69  I32 m_count;
70  F64* m_pKnots;
71  F64* m_pControl[3];
72 };
73 
74 
75 } /* namespace ext */
76 } /* namespace fe */
77 
78 #endif /* __geometry_ConvergentSpline_h__ */
kernel
Definition: namespace.dox:3
Evaluate a stack of basis splines to approach the control points.
Definition: ConvergentSpline.h:20