18 #include "pandabase.h" 20 #include "piecewiseCurve.h" 21 #include "nurbsCurveInterface.h" 22 #include "cubicCurveseg.h" 54 const PN_stdfloat knots[],
const LVecBase4 cvs[]);
63 virtual void set_order(
int order);
64 virtual int get_order()
const;
66 virtual int get_num_cvs()
const;
67 virtual int get_num_knots()
const;
69 virtual bool insert_cv(PN_stdfloat t);
71 virtual bool remove_cv(
int n);
72 virtual void remove_all_cvs();
74 virtual bool set_cv(
int n,
const LVecBase4 &v);
77 virtual bool set_knot(
int n, PN_stdfloat t);
78 virtual PN_stdfloat get_knot(
int n)
const;
85 int rtype1, PN_stdfloat t1,
const LVecBase4 &v1,
86 int rtype2, PN_stdfloat t2,
const LVecBase4 &v2,
87 int rtype3, PN_stdfloat t3,
const LVecBase4 &v3);
95 virtual void write(ostream &out,
int indent_level = 0)
const;
98 virtual int append_cv_impl(
const LVecBase4 &v);
99 virtual bool format_egg(ostream &out,
const string &name,
100 const string &curve_type,
int indent_level)
const;
102 int find_cv(PN_stdfloat t);
109 CV(
const LVecBase4 &p, PN_stdfloat t) : _p(p), _t(t) {}
118 static void register_with_read_factory();
129 static void init_type() {
130 PiecewiseCurve::init_type();
131 NurbsCurveInterface::init_type();
132 register_type(_type_handle,
"NurbsCurve",
133 PiecewiseCurve::get_class_type(),
134 NurbsCurveInterface::get_class_type());
137 return get_class_type();
139 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
145 #include "nurbsCurve.I" A basic node of the scene graph or data graph.
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.
virtual bool recompute()
Recalculates the curve, if necessary.
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 ...
This abstract class defines the interface only for a Nurbs-style curve, with knots and coordinates in...
virtual NurbsCurveInterface * get_nurbs_interface()
Returns a pointer to the object as a NurbsCurveInterface object if it happens to be a NURBS-style cur...
A CubicCurveseg is any curve that can be completely described by four 4-valued basis vectors...
virtual bool stitch(const ParametricCurve *a, const ParametricCurve *b)
Regenerates this curve as one long curve: the first curve connected end-to-end with the second one...
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...
A Nonuniform Rational B-Spline.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
This is the base class for all three-component vectors and points.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool convert_to_nurbs(ParametricCurve *nc) const
Stores in the indicated NurbsCurve a NURBS representation of an equivalent curve. ...
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...