15 #ifndef HERMITECURVE_H
16 #define HERMITECURVE_H
18 #include "piecewiseCurve.h"
19 #include "cubicCurveseg.h"
58 void set_point(
const LVecBase3 &point) { _p = point; }
61 void set_type(
int type);
62 void set_name(
const string &name);
64 void format_egg(ostream &out,
int indent,
int num_dimensions,
65 bool show_in,
bool show_out,
66 PN_stdfloat scale_in, PN_stdfloat scale_out)
const;
94 int get_num_cvs()
const;
96 int insert_cv(PN_stdfloat t);
97 int append_cv(
int type, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
98 inline int append_cv(
int type,
const LVecBase3 &v) {
99 return append_cv(type, v[0], v[1], v[2]);
102 bool remove_cv(
int n);
103 void remove_all_cvs();
105 bool set_cv_type(
int n,
int type);
106 bool set_cv_point(
int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
107 inline bool set_cv_point(
int n,
const LVecBase3 &v) {
108 return set_cv_point(n, v[0], v[1], v[2]);
110 bool set_cv_in(
int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
111 inline bool set_cv_in(
int n,
const LVecBase3 &v) {
112 return set_cv_in(n, v[0], v[1], v[2]);
114 bool set_cv_out(
int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
115 inline bool set_cv_out(
int n,
const LVecBase3 &v) {
116 return set_cv_out(n, v[0], v[1], v[2]);
118 bool set_cv_tstart(
int n, PN_stdfloat tstart);
119 bool set_cv_name(
int n,
const char *name);
122 int get_cv_type(
int n)
const;
123 const LVecBase3 &get_cv_point(
int n)
const;
124 void get_cv_point(
int n,
LVecBase3 &v)
const;
126 void get_cv_in(
int n,
LVecBase3 &v)
const;
127 const LVecBase3 &get_cv_out(
int n)
const;
128 void get_cv_out(
int n,
LVecBase3 &v)
const;
129 PN_stdfloat get_cv_tstart(
int n)
const;
130 string get_cv_name(
int n)
const;
132 virtual void output(ostream &out)
const;
133 void write_cv(ostream &out,
int n)
const;
143 int rtype1, PN_stdfloat t1,
const LVecBase4 &v1,
144 int rtype2, PN_stdfloat t2,
const LVecBase4 &v2,
145 int rtype3, PN_stdfloat t3,
const LVecBase4 &v3);
148 virtual bool format_egg(ostream &out,
const string &name,
149 const string &curve_type,
int indent_level)
const;
151 void invalidate_cv(
int n,
bool redo_all);
152 int find_cv(PN_stdfloat t);
153 void recompute_basis();
170 static void init_type() {
171 register_type(_type_handle,
"HermiteCurve");
174 return get_class_type();
176 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
This is the base class for all three-component vectors and points.
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.
Base class for objects that can be written to and read from Bam files.
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...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
This is the base class for all three-component vectors and points.
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...