50class EXPCL_PANDA_PARAMETRICS HermiteCurveCV {
53 HermiteCurveCV(
const HermiteCurveCV &c);
56 void set_point(
const LVecBase3 &point) { _p = point; }
57 void set_in(
const LVecBase3 &in);
58 void set_out(
const LVecBase3 &out);
60 void set_name(
const std::string &name);
63 bool show_in,
bool show_out,
64 PN_stdfloat scale_in, PN_stdfloat scale_out)
const;
69 LVecBase3 _p, _in, _out;
83class EXPCL_PANDA_PARAMETRICS HermiteCurve :
public PiecewiseCurve {
87 virtual ~HermiteCurve();
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) {
101 bool set_cv_point(
int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
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) {
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) {
121 void get_cv_in(
int n, LVecBase3 &v)
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();
150 pvector<HermiteCurveCV> _points;
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();}
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
A CubicCurveseg is any curve that can be completely described by four 4-valued basis vectors,...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void write_datagram(BamWriter *manager, Datagram &me) const
Function to write the important information in the particular object to a Datagram.
void set_in(const LVecBase3 &in)
Sets the CV's in tangent.
void set_type(int type)
Sets the continuity type of the CV.
void format_egg(std::ostream &out, int indent, int num_dimensions, bool show_in, bool show_out, PN_stdfloat scale_in, PN_stdfloat scale_out) const
Formats the CV for output to an egg file.
void fillin(DatagramIterator &scan, BamReader *manager)
Function that reads out of the datagram (or asks manager to read) all of the data that is needed to r...
void set_out(const LVecBase3 &out)
Sets the CV's out tangent.
void set_name(const std::string &name)
Sets the name associated with the CV.
int append_cv(int type, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Adds a new CV to the end of the curve.
PN_stdfloat get_cv_tstart(int n) const
Returns the starting point in parametric space of the given CV.
bool set_cv_out(int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Changes the given CV's out tangent.
bool set_cv_tstart(int n, PN_stdfloat tstart)
Changes the given CV's parametric starting time.
const LVecBase3 & get_cv_point(int n) const
Returns the position of the given CV.
bool set_cv_name(int n, const char *name)
Changes the name associated with a particular CV.
int insert_cv(PN_stdfloat t)
Inserts a new CV at the given parametric point along the curve.
const LVecBase3 & get_cv_out(int n) const
Returns the out tangent of the given CV.
bool set_cv_point(int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Changes the given CV's position.
int get_num_cvs() const
Returns the number of CV's in the curve.
std::string get_cv_name(int n) const
Returns the name of the given CV, or NULL.
bool set_cv_in(int n, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Changes the given CV's in tangent.
int get_cv_type(int n) const
Returns the given CV's continuity type, HC_CUT, HC_FREE, HC_G1, or HC_SMOOTH, or 0 if there is no suc...
void remove_all_cvs()
Removes all CV's from the curve.
bool remove_cv(int n)
Removes the given CV from the curve.
static void register_with_read_factory()
Initializes the factory for reading these things from Bam files.
bool set_cv_type(int n, int type)
Changes the given CV's continuity type.
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...
const LVecBase3 & get_cv_in(int n) const
Returns the in tangent of the given CV.
ParametricCurve()
This is a virtual base class.
ParametricCurve * get_curveseg(int ti)
Returns the curve segment corresponding to the given index.
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
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(),...