46 NurbsCurve(
int order,
int num_cvs,
47 const PN_stdfloat knots[],
const LVecBase4 cvs[]);
49 virtual ~NurbsCurve();
57 virtual int get_order()
const;
59 virtual int get_num_cvs()
const;
67 virtual bool set_cv(
int n,
const LVecBase4 &v);
68 virtual LVecBase4
get_cv(
int n)
const;
70 virtual bool set_knot(
int n, PN_stdfloat t);
71 virtual PN_stdfloat
get_knot(
int n)
const;
78 int rtype1, PN_stdfloat t1,
const LVecBase4 &v1,
79 int rtype2, PN_stdfloat t2,
const LVecBase4 &v2,
80 int rtype3, PN_stdfloat t3,
const LVecBase4 &v3);
88 virtual void write(std::ostream &out,
int indent_level = 0)
const;
91 virtual int append_cv_impl(
const LVecBase4 &v);
92 virtual bool format_egg(std::ostream &out,
const std::string &name,
93 const std::string &curve_type,
int indent_level)
const;
95 int find_cv(PN_stdfloat t);
102 CV(
const LVecBase4 &p, PN_stdfloat t) : _p(p), _t(t) {}
122 static void init_type() {
123 PiecewiseCurve::init_type();
124 NurbsCurveInterface::init_type();
126 PiecewiseCurve::get_class_type(),
127 NurbsCurveInterface::get_class_type());
130 return get_class_type();
132 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...
This abstract class defines the interface only for a Nurbs-style curve, with knots and coordinates in...
virtual void set_order(int order)
Changes the order of the curve.
virtual PN_stdfloat get_knot(int n) const
Retrieves the value of the indicated knot.
virtual bool insert_cv(PN_stdfloat t)
Inserts a new CV into the middle of the curve at the indicated parametric value.
virtual void remove_all_cvs()
Removes all CV's from the curve.
virtual bool remove_cv(int n)
Removes the indicated CV from the curve.
virtual int get_num_knots() const
Returns the number of knots on the curve.
virtual LVecBase4 get_cv(int n) const
Returns the position in homogeneous space of the indicated CV.
virtual bool set_cv(int n, const LVecBase4 &v)
Repositions the indicated CV.
virtual bool set_knot(int n, PN_stdfloat t)
Sets the value of the indicated knot.
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
virtual bool recompute()
Recalculates the curve, if necessary.
virtual bool convert_to_nurbs(ParametricCurve *nc) const
Stores in the indicated NurbsCurve a NURBS representation of an equivalent curve.
virtual NurbsCurveInterface * get_nurbs_interface()
Returns a pointer to the object as a NurbsCurveInterface object if it happens to be a NURBS-style cur...
ParametricCurve()
This is a virtual base class.
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.
ParametricCurve * get_curveseg(int ti)
Returns the curve segment corresponding to the given index.
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...
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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(),...