14 #ifndef NURBSCURVEINTERFACE_H 15 #define NURBSCURVEINTERFACE_H 33 virtual void set_order(
int order)=0;
34 virtual int get_order()
const=0;
36 virtual int get_num_cvs()
const=0;
37 virtual int get_num_knots()
const=0;
39 virtual bool insert_cv(PN_stdfloat t)=0;
41 INLINE
int append_cv(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
42 INLINE
int append_cv(
const LVecBase3 &v);
43 INLINE
int append_cv(
const LVecBase4 &v);
45 virtual bool remove_cv(
int n)=0;
46 virtual void remove_all_cvs()=0;
48 INLINE
bool set_cv_point(
int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
49 INLINE
bool set_cv_point(
int n,
const LVecBase3 &v);
50 INLINE LVecBase3 get_cv_point(
int n)
const;
52 bool set_cv_weight(
int n, PN_stdfloat w);
53 INLINE PN_stdfloat get_cv_weight(
int n)
const;
55 virtual bool set_cv(
int n,
const LVecBase4 &v)=0;
56 virtual LVecBase4 get_cv(
int n)
const=0;
58 virtual bool set_knot(
int n, PN_stdfloat t)=0;
59 virtual PN_stdfloat get_knot(
int n)
const=0;
61 MAKE_SEQ(get_cvs, get_num_cvs, get_cv);
62 MAKE_SEQ(get_knots, get_num_knots, get_knot);
64 void write_cv(std::ostream &out,
int n)
const;
67 virtual int append_cv_impl(
const LVecBase4 &v)=0;
69 void write(std::ostream &out,
int indent_level)
const;
70 bool format_egg(std::ostream &out,
const std::string &name,
71 const std::string &curve_type,
int indent_level)
const;
79 static void init_type() {
A virtual base class for parametric curves.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This abstract class defines the interface only for a Nurbs-style curve, with knots and coordinates in...
TypeHandle is the identifier used to differentiate C++ class types.