14 #ifndef HERMITECURVE_H
15 #define HERMITECURVE_H
56 void set_point(
const LVecBase3 &point) { _p = point; }
57 void set_in(
const LVecBase3 &in);
58 void set_out(
const LVecBase3 &out);
59 void set_type(
int type);
60 void set_name(
const std::string &name);
62 void format_egg(std::ostream &out,
int indent,
int num_dimensions,
63 bool show_in,
bool show_out,
64 PN_stdfloat scale_in, PN_stdfloat scale_out)
const;
69 LVecBase3 _p, _in, _out;
89 int get_num_cvs()
const;
91 int insert_cv(PN_stdfloat t);
92 int append_cv(
int type, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
93 inline int append_cv(
int type,
const LVecBase3 &v) {
94 return append_cv(type, v[0], v[1], v[2]);
97 bool remove_cv(
int n);
98 void remove_all_cvs();
100 bool set_cv_type(
int n,
int type);
101 bool set_cv_point(
int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
102 inline bool set_cv_point(
int n,
const LVecBase3 &v) {
103 return set_cv_point(n, v[0], v[1], v[2]);
105 bool set_cv_in(
int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
106 inline bool set_cv_in(
int n,
const LVecBase3 &v) {
107 return set_cv_in(n, v[0], v[1], v[2]);
109 bool set_cv_out(
int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
110 inline bool set_cv_out(
int n,
const LVecBase3 &v) {
111 return set_cv_out(n, v[0], v[1], v[2]);
113 bool set_cv_tstart(
int n, PN_stdfloat tstart);
114 bool set_cv_name(
int n,
const char *name);
117 int get_cv_type(
int n)
const;
118 const LVecBase3 &get_cv_point(
int n)
const;
119 void get_cv_point(
int n, LVecBase3 &v)
const;
120 const LVecBase3 &get_cv_in(
int n)
const;
121 void get_cv_in(
int n, LVecBase3 &v)
const;
122 const LVecBase3 &get_cv_out(
int n)
const;
123 void get_cv_out(
int n, LVecBase3 &v)
const;
124 PN_stdfloat get_cv_tstart(
int n)
const;
125 std::string get_cv_name(
int n)
const;
127 virtual void output(std::ostream &out)
const;
128 void write_cv(std::ostream &out,
int n)
const;
138 int rtype1, PN_stdfloat t1,
const LVecBase4 &v1,
139 int rtype2, PN_stdfloat t2,
const LVecBase4 &v2,
140 int rtype3, PN_stdfloat t3,
const LVecBase4 &v3);
143 virtual bool format_egg(std::ostream &out,
const std::string &name,
144 const std::string &curve_type,
int indent_level)
const;
146 void invalidate_cv(
int n,
bool redo_all);
147 int find_cv(PN_stdfloat t);
148 void recompute_basis();
165 static void init_type() {
166 PiecewiseCurve::init_type();
168 PiecewiseCurve::get_class_type());
171 return get_class_type();
173 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}