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();}
ParametricCurve * get_curveseg(int ti)
Returns the curve segment corresponding to the given index.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
A virtual base class for parametric curves.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Base class for objects that can be written to and read from Bam files.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
A parametric curve defined by a sequence of control vertices, each with an in and out tangent.
A CubicCurveseg is any curve that can be completely described by four 4-valued basis vectors,...
A PiecewiseCurve is a curve made up of several curve segments, connected in a head-to-tail fashion.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single CV of a Hermite curve.
A class to retrieve the individual data elements previously stored in a Datagram.
TypeHandle is the identifier used to differentiate C++ class types.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
virtual bool rebuild_curveseg(int rtype0, PN_stdfloat t0, const LVecBase4 &v0, int rtype1, PN_stdfloat t1, const LVecBase4 &v1, int rtype2, PN_stdfloat t2, const LVecBase4 &v2, int rtype3, PN_stdfloat t3, const LVecBase4 &v3)
Rebuilds the current curve segment (as selected by the most recent call to find_curve()) according to...