00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef NURBSCURVEINTERFACE_H
00020 #define NURBSCURVEINTERFACE_H
00021
00022 #include <pandabase.h>
00023
00024 #include <luse.h>
00025 #include <filename.h>
00026
00027 class ParametricCurve;
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class EXPCL_PANDA NurbsCurveInterface {
00039 PUBLISHED:
00040 virtual void set_order(int order)=0;
00041 virtual int get_order() const=0;
00042
00043 virtual int get_num_cvs() const=0;
00044 virtual int get_num_knots() const=0;
00045
00046 virtual bool insert_cv(float t)=0;
00047
00048 INLINE int append_cv(float x, float y, float z);
00049 INLINE int append_cv(const LVecBase3f &v);
00050 INLINE int append_cv(const LVecBase4f &v);
00051
00052 virtual bool remove_cv(int n)=0;
00053 virtual void remove_all_cvs()=0;
00054
00055 INLINE bool set_cv_point(int n, float x, float y, float z);
00056 INLINE bool set_cv_point(int n, const LVecBase3f &v);
00057 INLINE LVecBase3f get_cv_point(int n) const;
00058
00059 bool set_cv_weight(int n, float w);
00060 INLINE float get_cv_weight(int n) const;
00061
00062 virtual bool set_cv(int n, const LVecBase4f &v)=0;
00063 virtual LVecBase4f get_cv(int n) const=0;
00064
00065 virtual bool set_knot(int n, float t)=0;
00066 virtual float get_knot(int n) const=0;
00067
00068 void write_cv(ostream &out, int n) const;
00069
00070
00071 protected:
00072 virtual int append_cv_impl(const LVecBase4f &v)=0;
00073
00074 void write(ostream &out, int indent_level) const;
00075 bool format_egg(ostream &out, const string &name,
00076 const string &curve_type, int indent_level) const;
00077
00078 bool convert_to_nurbs(ParametricCurve *nc) const;
00079
00080 public:
00081 static TypeHandle get_class_type() {
00082 return _type_handle;
00083 }
00084 static void init_type() {
00085 register_type(_type_handle, "NurbsCurveInterface");
00086 }
00087
00088 private:
00089 static TypeHandle _type_handle;
00090 };
00091
00092 #include "nurbsCurveInterface.I"
00093
00094 #endif