UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
parspline.hpp
1 // parspline.hpp
2 // $Id: parspline.hpp,v 1.6 2008/08/18 08:19:18 sasha Exp $
3 //-------------------------------------------------------------------------
4 #ifndef ParSplineH
5 #define ParSplineH
6 //=========================================================================
7 #include "parspline_service.hpp"
8 //-------------------------------------------------------------------------
9 
10 const int S_DEBUG_MODE = 1;
11 
14 class ParSpline
15 {
16  public:
17 
18  /* Constructor for empty object */
19  ParSpline();
20 
22  ParSpline(double *xx, double *zz, double *ddx, double *ddz, double *ccurv,bool *flag, int nn);
23 
24  virtual ~ParSpline();
25 
27  void Interpolate(double *xx, double *zz, int nn, bool *flag, double rc, double sp,
28  double *xx1 = NULL, double *zz1 = NULL, int nn1 = 0, bool noInter = false);
29 
31  void GetXZ(double *xx, double *zz);
32 
33  void GetSPXZ(double_ar *sx, double_ar *sz);
34 
36  bool GetKnot(int kn, double &x, double &z);
37 
39  void GetDXDZ(double *ddx, double *ddz);
40 
42  void GetCurv(double *ccurv);
43 
45  void GetSPFlags(bool *flag);
46 
48  int GetN();
49 
50  bool GetPFlag(int index);
51 
53  bool GetPSpX(double z, double &x);
54 
56  bool GetPSpXs(double z, double *&xs, int &nx);
57 
59  bool GetPSpXs(double z, double *&xs, int &nx, double_ar *xx1, double_ar *zz1);
60 
62  bool GetPSpZ(double x, double &z);
63 
65  bool GetPSpZs(double x, double *&zs, int &nz);
66 
68  bool GetPSpZs(double x, double *&zs, int &nz, double_ar *xx1, double_ar *zz1);
69 
71  bool PSpInt(double x1, double z1, double x2, double z2, double &ix,
72  double &iz, int *nn=NULL);
73 
75  bool PSpInt1(double x1, double z1, double x2, double z2, double &ix,
76  double &iz, int *nn=NULL);
77 
79  bool PSpInts(double x1, double z1, double x2, double z2, double *ixs,
80  double *izs, int &in, int *inns=NULL);
81 
83  bool PSpI(double x1, double z1, double x2, double z2, int nn,
84  double &ix, double &iz, double &angle, double &curvity);
85 
87  bool PSpI1(double x1, double z1, double x2, double z2, int nn,
88  double &ix, double &iz, double &angle);
89 
91  bool PSpIs(double x1, double z1, double x2, double z2, int nn,
92  double *ixs, double *izs, int &in, double &angle);
93 
95  bool PSpCutMiddle(double x1, double z1, double x2, double z2,
96  double &ix, double &iz);
98  bool isPSpClean();
99 
101  void SetXZMinMax(double xmn, double xmx, double zmn, double zmx);
102 
103  void GetXZMinMax(double &xmn, double &xmx, double &zmn, double &zmx);
104 
105  bool CheckSplineStatus();
106 
107 protected:
108 
110  virtual int IntervalSmoothParSpline(int N1,double *x1,double *z1,bool *flag,int N2, double *xf,double *zf,
111  double rc, double sp, double_ar *xx1, double_ar *zz1, double_ar *dx, double_ar *dz,
112  double_ar *curvity,int_ar *NumNodeBreak);
113 
114 private:
115 
117  bool GetActiveKnotNs(double x1, double z1, int &n1, int &n2);
118 
119  bool GetKnots(int n1, int n2, double_ar *xx, double_ar *zz);
120 
121  bool PrepareKnots(double x1, double z1, double x2, double z2, double_ar *xx, double_ar *zz, bool fp=true);
122 
123  bool CheckPPos(double x1, double z1, double x2, double z2);
124 
125  bool CheckPPosX(double x1, double x2);
126 
127  bool CheckPPosZ(double z1, double z2);
128 
129  double_ar x, z, dx, dz, curv;
130  double_ar px, pz;
131  double_ar sx, sz;
132 
133  //AlgData3d ald;
134  //Gauss3dData gad;
135 
136  double_ar resXs;
137  double_ar resZs;
138  int_ar NumNode;
139  bool* s_p;
140  bool* sPoints;
141 
142  double xMin, xMax, zMin, zMax;
143 
144  bool clean;
145 
146  int n;
147  bool ready;
148 
149  ParSplineOneD *pSp;
150 };
151 
152 
153 
154 //=========================================================================
155 #endif
void SetXZMinMax(double xmn, double xmx, double zmn, double zmx)
bool isPSpClean()
void GetDXDZ(double *ddx, double *ddz)
void GetXZ(double *xx, double *zz)
bool PSpInts(double x1, double z1, double x2, double z2, double *ixs, double *izs, int &in, int *inns=NULL)
bool GetPSpX(double z, double &x)
bool PSpI(double x1, double z1, double x2, double z2, int nn, double &ix, double &iz, double &angle, double &curvity)
void GetSPFlags(bool *flag)
bool GetKnot(int kn, double &x, double &z)
int GetN()
bool GetPSpZs(double x, double *&zs, int &nz)
void Interpolate(double *xx, double *zz, int nn, bool *flag, double rc, double sp, double *xx1=NULL, double *zz1=NULL, int nn1=0, bool noInter=false)
bool GetPSpZ(double x, double &z)
void GetCurv(double *ccurv)
Definition: objectar.hpp:57
Definition: parspline_service.hpp:66
Definition: parspline.hpp:14
virtual int IntervalSmoothParSpline(int N1, double *x1, double *z1, bool *flag, int N2, double *xf, double *zf, double rc, double sp, double_ar *xx1, double_ar *zz1, double_ar *dx, double_ar *dz, double_ar *curvity, int_ar *NumNodeBreak)
bool PSpIs(double x1, double z1, double x2, double z2, int nn, double *ixs, double *izs, int &in, double &angle)
Definition: objectar.hpp:55
bool PSpCutMiddle(double x1, double z1, double x2, double z2, double &ix, double &iz)
bool GetPSpXs(double z, double *&xs, int &nx)
bool PSpInt(double x1, double z1, double x2, double z2, double &ix, double &iz, int *nn=NULL)
bool PSpI1(double x1, double z1, double x2, double z2, int nn, double &ix, double &iz, double &angle)
bool PSpInt1(double x1, double z1, double x2, double z2, double &ix, double &iz, int *nn=NULL)