00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef EGGNURBSCURVE_H
00020 #define EGGNURBSCURVE_H
00021
00022 #include <pandabase.h>
00023
00024 #include "eggCurve.h"
00025
00026 #include <vector_double.h>
00027
00028
00029
00030
00031
00032 class EXPCL_PANDAEGG EggNurbsCurve : public EggCurve {
00033 public:
00034 INLINE EggNurbsCurve(const string &name = "");
00035 INLINE EggNurbsCurve(const EggNurbsCurve ©);
00036 INLINE EggNurbsCurve &operator = (const EggNurbsCurve ©);
00037
00038 void setup(int order, int num_knots);
00039
00040 INLINE void set_order(int order);
00041 void set_num_knots(int num);
00042
00043 INLINE void set_knot(int k, double value);
00044
00045 bool is_valid() const;
00046
00047 INLINE int get_order() const;
00048 INLINE int get_degree() const;
00049 INLINE int get_num_knots() const;
00050 INLINE int get_num_cvs() const;
00051
00052 bool is_closed() const;
00053
00054 INLINE double get_knot(int k) const;
00055
00056 virtual void write(ostream &out, int indent_level) const;
00057
00058 private:
00059 typedef vector_double Knots;
00060 Knots _knots;
00061 int _order;
00062
00063 public:
00064
00065 static TypeHandle get_class_type() {
00066 return _type_handle;
00067 }
00068 static void init_type() {
00069 EggPrimitive::init_type();
00070 register_type(_type_handle, "EggNurbsCurve",
00071 EggPrimitive::get_class_type());
00072 }
00073 virtual TypeHandle get_type() const {
00074 return get_class_type();
00075 }
00076 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00077
00078 private:
00079 static TypeHandle _type_handle;
00080
00081 };
00082
00083 #include "eggNurbsCurve.I"
00084
00085 #endif