UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
u3d_bspl3_curve3d.hpp
1 // u3d_bspl3_curve3d.hpp
2 // $Id: u3d_bspl3_curve3d.hpp,v 1.11 2007/09/07 12:17:03 guser1 Exp $
3 #ifndef U3D_BSPL3_CURVE3D_
4 #define U3D_BSPL3_CURVE3D_
5 
6 #include <u3d_bspl3_family.hpp>
7 
11 class U3dBspl3Curve3d
12 {
13 public:
16  U3dBspl3Curve3d(const U3dBspl3AbstractMatrix &bm, const U3dPointsAr &ps);
17 
20 
21 
24  bool getPoint(double p, U3dPoint &point) const;
25 
28  bool getXYZp(double p, U3dPoint &point) const;
29 
32  bool getXYZpp(double p, U3dPoint &point) const;
33 
35  bool getCurvature(double p, double &c);
36 
38  int getControlPointsNum() const;
39 
42  bool getControlPoint(int ind, U3dPoint &point) const;
43 
44 
48  bool add(U3dPoint &point, int ind = -1);
49 
52  bool remove(int ind);
53 
56  bool move(int ind);
57 
58 
60  bool isReady() const
61  {return m_is_ready;}
62 
63 
67  bool getLineSegments(double ds, std::vector<double> &segs);
68 
70  bool getLineDeviations(double p1, double p2, double p, U3dPoint &dev);
71 
74  bool getMaxLineDeviation(double p1, double p2, double &md);
75 
76 
78  void info();
79 
80 protected:
81 
83  struct Bspl3dCurve
84  {
86  U3dSimpleBspl3Curve *x, *y, *z;
87  };
88 
90  std::vector<Bspl3dCurve> m_bspls;
91 
94 
96  U3dPointsAr m_ps;
97 
99  bool m_is_ready;
100 
102  void reconstruct();
103 
105  void clear();
106 
110  bool check_add_bps(const U3dPointsAr &ps);
111 
113  bool find_element(double p, int &nn, double &pp) const;
114 
116  bool get_line_distance(double pp, int nn, U3dPoint kP, U3dPoint bP, double p1, U3dPoint &dist);
117 
119  bool construct_isect_line(double p1, double p2, U3dPoint &kP, U3dPoint &bP);
120 
122  void devs_update(double p, int n, U3dPoint &kP, U3dPoint &bP, double p1,
123  U3dPoint &dev, double &smx, double &smy, double &smz) {
124  get_line_distance(p, n, kP, bP, p1, dev);
125  if (dev.getX() > smx)
126  smx = dev.getX();
127  if (dev.getY() > smy)
128  smy = dev.getY();
129  if (dev.getZ() > smz)
130  smz = dev.getZ();
131  }
132 
135  void next_segment (double p1, double p2, std::vector<double> &segs);
136 };
137 
138 #endif /* U3D_BSPL3_CURVE3D_ */
int getControlPointsNum() const
Definition: u3d_bspl3_curve3d.hpp:12
bool m_is_ready
Definition: u3d_bspl3_curve3d.hpp:139
bool getCurvature(double p, double &c)
bool move(int ind)
bool get_line_distance(double pp, int nn, U3dPoint kP, U3dPoint bP, double p1, U3dPoint &dist) const
bool getLineSegments(double ds, std::vector< double > &segs) const
bool getLineDeviations(double p1, double p2, double p, U3dPoint &dev) const
U3dBspl3Curve3d(const U3dBspl3AbstractMatrix &bm)
bool getXYZp(double p, U3dPoint &point) const
double getZ() const
Definition: u3d_point.hpp:141
Definition: u3d_bspl3_primitives.hpp:11
Definition: geometry.H:16
void add(const U3dPoint &point, int id=-1)
U3dBspl3AbstractMatrix * m_bm
Definition: u3d_bspl3_curve3d.hpp:133
double getY() const
Definition: u3d_point.hpp:135
bool construct_isect_line(double p1, double p2, U3dPoint &kP, U3dPoint &bP) const
Definition: u3d_point.hpp:16
std::vector< Bspl3dCurve > m_bspls
Definition: u3d_bspl3_curve3d.hpp:130
U3dSimpleBspl3Curve * x
Definition: u3d_bspl3_curve3d.hpp:126
void devs_update(double p, int n, U3dPoint &kP, U3dPoint &bP, double p1, U3dPoint &dev, double &smx, double &smy, double &smz)
Definition: u3d_bspl3_curve3d.hpp:122
bool check_add_bps(const U3dPointsAr &ps)
static void find_element(double p, int n, int &nn, double &pp)
void info() const
bool isReady() const
Definition: u3d_bspl3_curve3d.hpp:60
Definition: u3d_bspl3_matrices.hpp:24
void next_segment(double p1, double p2, std::vector< double > &segs)
bool getPoint(double p, U3dPoint &point) const
bool getXYZpp(double p, U3dPoint &point) const
U3dPointsAr m_ps
Definition: u3d_bspl3_curve3d.hpp:136
bool getMaxLineDeviation(double p1, double p2, double &md) const
double getX() const
Definition: u3d_point.hpp:129
bool getControlPoint(int ind, U3dPoint &point) const