00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef NURBSBASISVECTOR_H
00016 #define NURBSBASISVECTOR_H
00017
00018 #include "pandabase.h"
00019 #include "luse.h"
00020 #include "pvector.h"
00021 #include "pmap.h"
00022
00023 class NurbsVertex;
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_PANDA_PARAMETRICS NurbsBasisVector {
00038 public:
00039 INLINE NurbsBasisVector();
00040 INLINE ~NurbsBasisVector();
00041
00042 INLINE int get_order() const;
00043
00044 INLINE int get_num_segments() const;
00045 INLINE PN_stdfloat get_start_t() const;
00046 INLINE PN_stdfloat get_end_t() const;
00047
00048 INLINE int get_vertex_index(int segment) const;
00049 INLINE PN_stdfloat get_from(int segment) const;
00050 INLINE PN_stdfloat get_to(int segment) const;
00051 INLINE const LMatrix4 &get_basis(int segment) const;
00052 INLINE PN_stdfloat scale_t(int segment, PN_stdfloat t) const;
00053
00054 void clear(int order);
00055 void append_segment(int vertex_index, const PN_stdfloat knots[]);
00056
00057 void transpose();
00058
00059 private:
00060 static LVecBase4 nurbs_blending_function(int order, int i, int j,
00061 const PN_stdfloat knots[]);
00062
00063 private:
00064 int _order;
00065
00066 class Segment {
00067 public:
00068 int _vertex_index;
00069 PN_stdfloat _from;
00070 PN_stdfloat _to;
00071 LMatrix4 _basis;
00072 };
00073
00074 typedef epvector<Segment> Segments;
00075 Segments _segments;
00076 };
00077
00078 #include "nurbsBasisVector.I"
00079
00080 #endif
00081