Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

ClassicNurbsCurve Class Reference

A Nonuniform Rational B-Spline. More...

#include <classicNurbsCurve.h>

Inheritance diagram for ClassicNurbsCurve:

PiecewiseCurve NurbsCurveInterface ParametricCurve PandaNode TypedWritable Namable BoundedObject ReferenceCount TypedObject List of all members.

Public Types

typedef pvector< BezierSeg > BezierSegs
enum  BoundingVolumeType { BVT_static, BVT_dynamic_sphere }

Public Member Functions

 ClassicNurbsCurve ()
 ClassicNurbsCurve (const ParametricCurve &pc)
 Constructs a NURBS curve equivalent to the indicated (possibly non-NURBS) curve.

 ClassicNurbsCurve (int order, int num_cvs, const float knots[], const LVecBase4f cvs[])
 Constructs a NURBS curve according to the indicated NURBS parameters.

virtual ~ClassicNurbsCurve ()
virtual void set_order (int order)
 Changes the order of the curve.

virtual int get_order () const
virtual int get_num_cvs () const
virtual int get_num_knots () const
 Returns the number of knots on the curve.

virtual bool insert_cv (float t)
 Inserts a new CV into the middle of the curve at the indicated parametric value.

virtual bool remove_cv (int n)
 Removes the indicated CV from the curve.

virtual void remove_all_cvs ()
 Removes all CV's from the curve.

virtual bool set_cv (int n, const LVecBase4f &v)
 Repositions the indicated CV.

virtual LVecBase4f get_cv (int n) const
 Returns the position in homogeneous space of the indicated CV.

virtual bool set_knot (int n, float t)
 Sets the value of the indicated knot.

virtual float get_knot (int n) const
 Retrieves the value of the indicated knot.

virtual bool recompute ()
 Recalculates the curve basis according to the latest position of the CV's, knots, etc.

virtual bool rebuild_curveseg (int rtype0, float t0, const LVecBase4f &v0, int rtype1, float t1, const LVecBase4f &v1, int rtype2, float t2, const LVecBase4f &v2, int rtype3, float t3, const LVecBase4f &v3)
 Rebuilds the current curve segment (as selected by the most recent call to find_curve()) according to the specified properties (see CubicCurveseg::compute_seg).

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.

CubicCurvesegget_curveseg (int ti)
 Returns the curve segment corresponding to the given index.

virtual NurbsCurveInterfaceget_nurbs_interface ()
 Returns a pointer to the object as a NurbsCurveInterface object if it happens to be a NURBS-style curve; otherwise, returns NULL.

virtual bool convert_to_nurbs (ParametricCurve *nc) const
 Stores in the indicated NurbsCurve a NURBS representation of an equivalent curve.

virtual void write (ostream &out, int indent_level=0) const
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
virtual bool is_valid () const
 Returns true if the curve is defined.

virtual float get_max_t () const
 Returns the upper bound of t for the entire curve.

virtual bool get_point (float t, LVecBase3f &point) const
 Returns the point of the curve at a given parametric point t.

virtual bool get_tangent (float t, LVecBase3f &tangent) const
 Returns the tangent of the curve at a given parametric point t.

virtual bool get_pt (float t, LVecBase3f &point, LVecBase3f &tangent) const
 Simultaneously returns the point and tangent of the curve at a given parametric point t.

virtual bool get_2ndtangent (float t, LVecBase3f &tangent2) const
 Returns the tangent of the first derivative of the curve at the point t.

virtual bool adjust_point (float t, float px, float py, float pz)
 Recomputes the curve such that it passes through the point (px, py, pz) at time t, but keeps the same tangent value at that point.

virtual bool adjust_tangent (float t, float tx, float ty, float tz)
 Recomputes the curve such that it has the tangent (tx, ty, tz) at time t, but keeps the same position at the point.

virtual bool adjust_pt (float t, float px, float py, float pz, float tx, float ty, float tz)
 Recomputes the curve such that it passes through the point (px, py, pz) with the tangent (tx, ty, tz).

int get_num_segs () const
 Returns the number of curve segments that make up the Piecewise curve.

bool insert_curveseg (int ti, ParametricCurve *seg, float tlength)
 Inserts a new curve segment at the indicated index.

bool remove_curveseg (int ti)
 Removes the given curve segment from the curve and frees it.

void remove_all_curvesegs ()
 Removes all curve segments from the curve.

float get_tlength (int ti) const
 Returns the parametric length of the given segment of the curve.

float get_tstart (int ti) const
 Returns the parametric start of the given segment of the curve.

float get_tend (int ti) const
 Returns the parametric end of the given segment of the curve.

bool set_tlength (int ti, float tlength)
 Sets the parametric length of the given segment of the curve.

void make_nurbs (int order, int num_cvs, const float knots[], const LVecBase4f cvs[])
 Defines the curve as a general NURBS curve.

virtual bool get_bezier_segs (BezierSegs &bz_segs) const
 Fills up the indicated vector with a list of BezierSeg structs that describe the curve.

virtual bool get_bezier_segs (BezierSegs &) const
 Fills up the indicated vector with a list of BezierSeg structs that describe the curve.

virtual bool safe_to_flatten () const
 Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating instances, false otherwise (for instance, a Camera cannot be safely flattened, because the Camera pointer itself is meaningful).

virtual bool safe_to_transform () const
 Returns true if it is generally safe to transform this particular kind of PandaNode by calling the xform() method, false otherwise.

void set_curve_type (int type)
 Sets the flag indicating the use to which the curve is intended to be put.

int get_curve_type () const
 Returns the flag indicating the use to which the curve is intended to be put.

void set_num_dimensions (int num)
 Specifies the number of significant dimensions in the curve's vertices.

int get_num_dimensions () const
 Returns the number of significant dimensions in the curve's vertices, as set by a previous call to set_num_dimensions().

float calc_length () const
 Approximates the length of the entire curve to within a few decimal places.

float calc_length (float from, float to) const
 Approximates the length of the curve segment from parametric time 'from' to time 'to'.

float find_length (float start_t, float length_offset) const
 Returns the parametric value corresponding to the indicated distance along the curve from the starting parametric value.

bool write_egg (Filename filename, CoordinateSystem cs=CS_default)
 Writes an egg description of the nurbs curve to the specified output file.

bool write_egg (ostream &out, const Filename &filename, CoordinateSystem cs)
 Writes an egg description of the nurbs curve to the specified output stream.

virtual bool get_bezier_seg (BezierSeg &) const
 Fills the BezierSeg structure with a description of the curve segment as a Bezier, if possible, but does not change the _t member of the structure.

virtual bool convert_to_hermite (HermiteCurve *hc) const
 Stores an equivalent curve representation in the indicated Hermite curve, if possible.

void register_drawer (ParametricCurveDrawer *drawer)
 Registers a Drawer with this curve that will automatically be updated whenever the curve is modified, so that the visible representation of the curve is kept up to date.

void unregister_drawer (ParametricCurveDrawer *drawer)
 Removes a previously registered drawer from the list of automatically-refreshed drawers.

virtual PandaNodemake_copy () const
 Returns a newly-allocated PandaNode that is a shallow copy of this one.

virtual bool safe_to_modify_transform () const
 Returns true if it is safe to automatically adjust the transform on this kind of node.

virtual bool safe_to_combine () const
 Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of PandaNodes, adding children or whatever.

virtual bool safe_to_flatten_below () const
 Returns true if a flatten operation may safely continue past this node, or false if it should drop all attributes here and stop.

virtual bool preserve_name () const
 Returns true if the node's name has extrinsic meaning and must be preserved across a flatten operation, false otherwise.

virtual int get_unsafe_to_apply_attribs () const
 Returns the union of all attributes from SceneGraphReducer::AttribTypes that may not safely be applied to the vertices of this node.

virtual void apply_attribs_to_vertices (const AccumulatedAttribs &attribs, int attrib_types, GeomTransformer &transformer)
 Applies whatever attributes are specified in the AccumulatedAttribs object (and by the attrib_types bitmask) to the vertices on this node, if appropriate.

virtual void xform (const LMatrix4f &mat)
 Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so.

virtual PandaNodecombine_with (PandaNode *other)
 Collapses this PandaNode with the other PandaNode, if possible, and returns a pointer to the combined PandaNode, or NULL if the two PandaNodes cannot safely be combined.

virtual ConstPointerTo< TransformStatecalc_tight_bounds (LPoint3f &min_point, LPoint3f &max_point, bool &found_any, const TransformState *transform) const
 This is used to support NodePath::calc_tight_bounds().

virtual bool has_cull_callback () const
 Should be overridden by derived classes to return true if cull_callback() has been defined.

virtual bool cull_callback (CullTraverser *trav, CullTraverserData &data)
 If has_cull_callback() returns true, this function will be called during the cull traversal to perform any additional operations that should be performed at cull time.

virtual bool has_selective_visibility () const
 Should be overridden by derived classes to return true if this kind of node has some restrictions on the set of children that should be rendered.

virtual int get_first_visible_child () const
 Returns the index number of the first visible child of this node, or a number >= get_num_children() if there are no visible children of this node.

virtual int get_next_visible_child (int n) const
 Returns the index number of the next visible child of this node following the indicated child, or a number >= get_num_children() if there are no more visible children of this node.

virtual bool has_single_child_visibility () const
 Should be overridden by derived classes to return true if this kind of node has the special property that just one of its children is visible at any given time, and furthermore that the particular visible child can be determined without reference to any external information (such as a camera).

virtual int get_visible_child () const
 Returns the index number of the currently visible child of this node.

PointerTo< PandaNodecopy_subgraph () const
 Allocates and returns a complete copy of this PandaNode and the entire scene graph rooted at this PandaNode.

int get_num_parents () const
 Returns the number of parent nodes this node has.

PandaNodeget_parent (int n) const
 Returns the nth parent node of this node.

int find_parent (PandaNode *node) const
 Returns the index of the indicated parent node, if it is a parent, or -1 if it is not.

int get_num_children () const
 Returns the number of child nodes this node has.

PandaNodeget_child (int n) const
 Returns the nth child node of this node.

int get_child_sort (int n) const
 Returns the sort index of the nth child node of this node (that is, the number that was passed to add_child()).

int find_child (PandaNode *node) const
 Returns the index of the indicated child node, if it is a child, or -1 if it is not.

void add_child (PandaNode *child_node, int sort=0)
 Adds a new child to the node.

void remove_child (int n)
 Removes the nth child from the node.

bool remove_child (PandaNode *child_node)
 Removes the indicated child from the node.

bool replace_child (PandaNode *orig_child, PandaNode *new_child)
 Searches for the orig_child node in the node's list of children, and replaces it with the new_child instead.

bool stash_child (PandaNode *child_node)
 Stashes the indicated child node.

void stash_child (int child_index)
 Stashes the indicated child node.

bool unstash_child (PandaNode *child_node)
 Returns the indicated stashed node to normal child status.

void unstash_child (int stashed_index)
 Returns the indicated stashed node to normal child status.

int get_num_stashed () const
 Returns the number of stashed nodes this node has.

PandaNodeget_stashed (int n) const
 Returns the nth stashed node of this node.

int get_stashed_sort (int n) const
 Returns the sort index of the nth stashed node of this node (that is, the number that was passed to add_child()).

int find_stashed (PandaNode *node) const
 Returns the index of the indicated stashed node, if it is a stashed child, or -1 if it is not.

void add_stashed (PandaNode *child_node, int sort=0)
 Adds a new child to the node, directly as a stashed child.

void remove_stashed (int n)
 Removes the nth stashed child from the node.

void remove_all_children ()
 Removes all the children from the node at once, including stashed children.

void steal_children (PandaNode *other)
 Moves all the children from the other node onto this node.

void copy_children (PandaNode *other)
 Makes another instance of all the children of the other node, copying them to this node.

void set_attrib (const RenderAttrib *attrib, int override=0)
 Adds the indicated render attribute to the scene graph on this node.

const RenderAttribget_attrib (TypeHandle type) const
 Returns the render attribute of the indicated type, if it is defined on the node, or NULL if it is not.

bool has_attrib (TypeHandle type) const
 Returns true if there is a render attribute of the indicated type defined on this node, or false if there is not.

void clear_attrib (TypeHandle type)
 Removes the render attribute of the given type from this node.

void set_effect (const RenderEffect *effect)
 Adds the indicated render effect to the scene graph on this node.

const RenderEffectget_effect (TypeHandle type) const
 Returns the render effect of the indicated type, if it is defined on the node, or NULL if it is not.

bool has_effect (TypeHandle type) const
 Returns true if there is a render effect of the indicated type defined on this node, or false if there is not.

void clear_effect (TypeHandle type)
 Removes the render effect of the given type from this node.

void set_state (const RenderState *state)
 Sets the complete RenderState that will be applied to all nodes at this level and below.

const RenderStateget_state () const
 Returns the complete RenderState that will be applied to all nodes at this level and below, as set on this node.

void clear_state ()
 Resets this node to leave the render state alone.

void set_effects (const RenderEffects *effects)
 Sets the complete RenderEffects that will be applied this node.

const RenderEffectsget_effects () const
 Returns the complete RenderEffects that will be applied to this node.

void clear_effects ()
 Resets this node to have no render effects.

void set_transform (const TransformState *transform)
 Sets the transform that will be applied to this node and below.

const TransformStateget_transform () const
 Returns the transform that has been set on this particular node.

void clear_transform ()
 Resets the transform on this node to the identity transform.

void set_draw_mask (DrawMask mask)
 Sets the hide/show bits of this particular node.

DrawMask get_draw_mask () const
 Returns the hide/show bits of this particular node.

CollideMask get_net_collide_mask () const
 Returns the union of all into_collide_mask() values set at CollisionNodes at this level and below.

virtual void output (ostream &out) const
 Outputs the Namable.

void ls (ostream &out, int indent_level) const
 Lists all the nodes at and below the current path hierarchically.

void set_bound (BoundingVolumeType type)
 Sets the type of the external bounding volume that is placed around this node and all of its children.

void set_bound (const BoundingVolume &volume)
 Resets the internal bounding volume so that it is the indicated volume.

void set_bound (BoundingVolumeType type)
 Sets the type of the bounding volume that will be dynamically computed for this particular node.

const BoundingVolumeget_bound () const
 Returns the node's external bounding volume.

const BoundingVolumeget_internal_bound () const
 Returns the node's internal bounding volume.

virtual bool is_geom_node () const
 A simple downcast check.

virtual Lightas_light ()
 Cross-casts the node to a Light pointer, if it is one of the four kinds of Light nodes, or returns NULL if it is not.

virtual void set_velocity (const LVector3f &vel)
 Indicates the instantaneous velocity of this node.

Children get_children () const
 Returns an object that can be used to walk through the list of children of the node.

ChildrenCopy get_children_copy () const
 Returns an object that can be used to walk through the list of children of the node.

virtual void finalize ()
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.

int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.

bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.

void set_name (const string &name)
void clear_name ()
 Resets the Namable's name to empty.

bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.

const string & get_name () const
bool mark_bound_stale ()
 Marks the current bounding volume as stale, so that it will be recomputed later.

void force_bound_stale ()
 Marks the current volume as stale and propagates the effect at least one level, even if it had already been marked stale.

bool is_bound_stale () const
 Returns true if the bound is currently marked stale and will be recomputed the next time get_bound() is called.

void set_final (bool flag)
 Sets the "final" flag on this BoundedObject.

bool is_final () const
 Returns the current state of the "final" flag.

int get_ref_count () const
 Returns the current reference count.

int ref () const
 Explicitly increments the reference count.

int unref () const
 Explicitly decrements the reference count.

void test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.

int append_cv (float x, float y, float z)
int append_cv (const LVecBase3f &v)
int append_cv (const LVecBase4f &v)
bool set_cv_point (int n, float x, float y, float z)
 Repositions the indicated CV.

bool set_cv_point (int n, const LVecBase3f &v)
 Repositions the indicated CV.

LVecBase3f get_cv_point (int n) const
 Returns the position of the indicated CV.

bool set_cv_weight (int n, float w)
 Sets the weight of the indicated CV without affecting its position in 3-d space.

float get_cv_weight (int n) const
 Returns the weight of the indicated CV.

void write_cv (ostream &out, int n) const

Static Public Member Functions

void register_with_read_factory ()
 Initializes the factory for reading these things from Bam files.

TypeHandle get_class_type ()
void init_type ()

Static Public Attributes

TypedWritable *const Null = (TypedWritable*)0L

Protected Types

typedef pmap< PandaNode *,
PandaNode * > 
InstanceMap

Protected Member Functions

virtual int append_cv_impl (const LVecBase4f &v)
 Adds a new CV to the end of the curve.

virtual bool format_egg (ostream &out, const string &name, const string &curve_type, int indent_level) const
 Formats the curve as an egg structure to write to the indicated stream.

int find_cv (float t)
 Finds the first knot whose value is >= t, or -1 if t is beyond the end of the curve.

virtual void write_datagram (BamWriter *manager, Datagram &me)
 Function to write the important information in the particular object to a Datagram.

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 re-create this object and stores it in the appropiate place.

bool find_curve (const ParametricCurve *&curve, float &t) const
 Finds the curve corresponding to the given value of t.

float current_seg_range (float t) const
 Returns a number in the range [0,1], representing the conversion of t into the current segment's coordinate system (the segment last returned by find_curve).

virtual int complete_pointers (TypedWritable **plist, BamReader *manager)
 Takes in a vector of pointes to TypedWritable objects that correspond to all the requests for pointers that this object made to BamReader.

void invalidate (float t1, float t2)
 Called from a base class to mark a section of the curve that has been modified and must be redrawn or recomputed in some way.

void invalidate_all ()
 Called from a base class to indicate that the curve has changed in some substantial way and must be entirely redrawn.

virtual void propagate_stale_bound ()
 Called by BoundedObject::mark_bound_stale(), this should make sure that all bounding volumes that depend on this one are marked stale also.

virtual BoundingVolumerecompute_bound ()
 Recomputes the dynamic bounding volume for this object.

virtual BoundingVolumerecompute_internal_bound ()
 Called when needed to recompute the node's _internal_bound object.

void changed_internal_bound ()
 Should be called whenever you adjust the _internal_bound member, to force the external bounding volume to be recomputed.

virtual void parents_changed ()
 Called after a scene graph update that either adds or remove parents from this node, this just provides a hook for derived PandaNode objects that need to update themselves based on the set of parents the node has.

virtual void children_changed ()
 Called after a scene graph update that either adds or remove children from this node, this just provides a hook for derived PandaNode objects that need to update themselves based on the set of children the node has.

virtual void transform_changed ()
 Called after the node's transform has been changed for any reason, this just provides a hook so derived classes can do something special in this case.

void add_net_collide_mask (CollideMask mask)
 Adds the indicated bits into the net_collide_mask for this node.

virtual PointerTo< PandaNoder_copy_subgraph (InstanceMap &inst_map) const
 This is the recursive implementation of copy_subgraph().

virtual void r_copy_children (const PandaNode *from, InstanceMap &inst_map)
 This is called by r_copy_subgraph(); the copy has already been made of this particular node (and this is the copy); this function's job is to copy all of the children from the original.

const BoundingVolumeget_bound_ptr () const
 Returns the state of the _bound pointer.

BoundingVolumeset_bound_ptr (BoundingVolume *bound)
 Changes the _bound pointer.


Static Protected Member Functions

TypedWritablemake_ClassicNurbsCurve (const FactoryParams &params)
 Factory method to generate an object of this type.

TypedWritablemake_from_bam (const FactoryParams &params)
 This function is called by the BamReader's factory when a new object of type PandaNode is encountered in the Bam file.


Protected Attributes

int _order
pvector< CV_cvs
pvector< Curveseg > _segs
int _last_ti
int _curve_type
int _num_dimensions
BoundedObject _internal_bound

Static Private Attributes

TypeHandle _type_handle
TypeHandle _orig_type_handle

Friends

class PandaNode::Children

Detailed Description

A Nonuniform Rational B-Spline.

This class is actually implemented as a PiecewiseCurve made up of several CubicCurvesegs, each of which is created using the nurbs_basis() method. The list of CV's and knots is kept here, within the ClassicNurbsCurve class.

This class is the original Panda-native implementation of a NURBS curve. It is typedeffed as "NurbsCurve" and performs all NURBS curve functions if we do not have the NURBS++ library available.

However, if we *do* have the NURBS++ library, another class exists, the NurbsPPCurve, which is a wrapper around that library and provides some additional functionality. In that case, the other class is typedeffed to "NurbsCurve" instead of this one, and performs most of the NURBS curve functions. This class then becomes vestigial.

Definition at line 76 of file classicNurbsCurve.h.


Member Typedef Documentation

typedef pvector<BezierSeg> ParametricCurve::BezierSegs [inherited]
 

Definition at line 120 of file parametricCurve.h.

typedef pmap<PandaNode *, PandaNode *> PandaNode::InstanceMap [protected, inherited]
 

Definition at line 206 of file pandaNode.h.


Member Enumeration Documentation

enum BoundedObject::BoundingVolumeType [inherited]
 

Enumeration values:
BVT_static 
BVT_dynamic_sphere 

Definition at line 58 of file boundedObject.h.


Constructor & Destructor Documentation

ClassicNurbsCurve::ClassicNurbsCurve  ) 
 

Definition at line 53 of file classicNurbsCurve.cxx.

References _order, and ParametricCurve::convert_to_nurbs().

ClassicNurbsCurve::ClassicNurbsCurve const ParametricCurve pc  ) 
 

Constructs a NURBS curve equivalent to the indicated (possibly non-NURBS) curve.

Definition at line 68 of file classicNurbsCurve.cxx.

References _cvs, _order, NurbsCurveInterface::append_cv(), and set_knot().

ClassicNurbsCurve::ClassicNurbsCurve int  order,
int  num_cvs,
const float  knots[],
const LVecBase4f  cvs[]
 

Constructs a NURBS curve according to the indicated NURBS parameters.

Definition at line 88 of file classicNurbsCurve.cxx.

ClassicNurbsCurve::~ClassicNurbsCurve  )  [virtual]
 

Definition at line 114 of file classicNurbsCurve.cxx.

References _order.


Member Function Documentation

void PandaNode::add_child PandaNode child_node,
int  sort = 0
[inherited]
 

Adds a new child to the node.

The child is added in the relative position indicated by sort; if all children have the same sort index, the child is added at the end.

If the same child is added to a node more than once, the previous instance is first removed.

Definition at line 1090 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::children_changed(), PandaNode::new_connection(), PT, and PandaNode::remove_child().

Referenced by PandaNode::replace_child(), and PandaNode::steal_children().

void PandaNode::add_net_collide_mask CollideMask  mask  )  [inline, protected, inherited]
 

Adds the indicated bits into the net_collide_mask for this node.

This is normally called only by CollisionNode::recompute_bound().

Definition at line 1071 of file pandaNode.I.

void PandaNode::add_stashed PandaNode child_node,
int  sort = 0
[inherited]
 

Adds a new child to the node, directly as a stashed child.

The child is not added in the normal sense, but will be revealed if unstash_child() is called on it later.

If the same child is added to a node more than once, the previous instance is first removed.

Definition at line 1406 of file pandaNode.cxx.

bool PiecewiseCurve::adjust_point float  t,
float  px,
float  py,
float  pz
[virtual, inherited]
 

Recomputes the curve such that it passes through the point (px, py, pz) at time t, but keeps the same tangent value at that point.

Reimplemented from ParametricCurve.

Definition at line 171 of file piecewiseCurve.cxx.

References t.

bool PiecewiseCurve::adjust_pt float  t,
float  px,
float  py,
float  pz,
float  tx,
float  ty,
float  tz
[virtual, inherited]
 

Recomputes the curve such that it passes through the point (px, py, pz) with the tangent (tx, ty, tz).

Reimplemented from ParametricCurve.

Definition at line 235 of file piecewiseCurve.cxx.

References PiecewiseCurve::_segs.

bool PiecewiseCurve::adjust_tangent float  t,
float  tx,
float  ty,
float  tz
[virtual, inherited]
 

Recomputes the curve such that it has the tangent (tx, ty, tz) at time t, but keeps the same position at the point.

Reimplemented from ParametricCurve.

Definition at line 207 of file piecewiseCurve.cxx.

References PiecewiseCurve::find_curve(), ParametricCurve::get_pt(), and t.

int NurbsCurveInterface::append_cv const LVecBase4f &  v  )  [inline, inherited]
 

Definition at line 55 of file nurbsCurveInterface.I.

References INLINE, NurbsCurveInterface::set_cv_point(), x, and y.

int NurbsCurveInterface::append_cv const LVecBase3f &  v  )  [inline, inherited]
 

Definition at line 43 of file nurbsCurveInterface.I.

References NurbsCurveInterface::append_cv_impl(), and INLINE.

int NurbsCurveInterface::append_cv float  x,
float  y,
float  z
[inline, inherited]
 

Definition at line 31 of file nurbsCurveInterface.I.

References INLINE.

Referenced by ClassicNurbsCurve(), ParametricCurve::get_bezier_segs(), get_num_cvs(), and get_num_knots().

int ClassicNurbsCurve::append_cv_impl const LVecBase4f &  v  )  [protected, virtual]
 

Adds a new CV to the end of the curve.

Creates a new knot value by adding 1 to the last knot value. Returns the index of the new CV.

Implements NurbsCurveInterface.

Definition at line 617 of file classicNurbsCurve.cxx.

References _cvs, and size_t.

void PandaNode::apply_attribs_to_vertices const AccumulatedAttribs attribs,
int  attrib_types,
GeomTransformer transformer
[virtual, inherited]
 

Applies whatever attributes are specified in the AccumulatedAttribs object (and by the attrib_types bitmask) to the vertices on this node, if appropriate.

If this node uses geom arrays like a GeomNode, the supplied GeomTransformer may be used to unify shared arrays across multiple different nodes.

This is a generalization of xform().

Reimplemented in GeomNode, and TextNode.

Definition at line 687 of file pandaNode.cxx.

Light * PandaNode::as_light  )  [virtual, inherited]
 

Cross-casts the node to a Light pointer, if it is one of the four kinds of Light nodes, or returns NULL if it is not.

Reimplemented in LightLensNode, and LightNode.

Definition at line 1641 of file pandaNode.cxx.

float ParametricCurve::calc_length float  from,
float  to
const [inherited]
 

Approximates the length of the curve segment from parametric time 'from' to time 'to'.

Definition at line 284 of file parametricCurve.cxx.

float ParametricCurve::calc_length  )  const [inherited]
 

Approximates the length of the entire curve to within a few decimal places.

Definition at line 269 of file parametricCurve.cxx.

ConstPointerTo< TransformState > PandaNode::calc_tight_bounds LPoint3f &  min_point,
LPoint3f &  max_point,
bool &  found_any,
const TransformState transform
const [virtual, inherited]
 

This is used to support NodePath::calc_tight_bounds().

It is not intended to be called directly, and it has nothing to do with the normal Panda bounding-volume computation.

If the node contains any geometry, this updates min_point and max_point to enclose its bounding box. found_any is to be set true if the node has any geometry at all, or left alone if it has none. This method may be called over several nodes, so it may enter with min_point, max_point, and found_any already set.

This function is recursive, and the return value is the transform after it has been modified by this node's transform.

Reimplemented in GeomNode, and TextNode.

Definition at line 807 of file pandaNode.cxx.

Referenced by NodePath::clear_depth_test().

void PandaNode::changed_internal_bound  )  [inline, protected, inherited]
 

Should be called whenever you adjust the _internal_bound member, to force the external bounding volume to be recomputed.

Definition at line 1054 of file pandaNode.I.

void PandaNode::children_changed  )  [protected, virtual, inherited]
 

Called after a scene graph update that either adds or remove children from this node, this just provides a hook for derived PandaNode objects that need to update themselves based on the set of children the node has.

Definition at line 1840 of file pandaNode.cxx.

Referenced by PandaNode::add_child(), and PandaNode::remove_child().

void PandaNode::clear_attrib TypeHandle  type  )  [inline, inherited]
 

Removes the render attribute of the given type from this node.

This node, and the subgraph below, will now inherit the indicated render attribute from the nodes above this one.

Definition at line 630 of file pandaNode.I.

Referenced by NodePath::clear_bin(), NodePath::clear_render_mode(), NodePath::has_texture(), and NodePath::set_texture_off().

void PandaNode::clear_effect TypeHandle  type  )  [inline, inherited]
 

Removes the render effect of the given type from this node.

Definition at line 703 of file pandaNode.I.

References PandaNode::_cycler, BoundedObject::get_bound(), and INLINE.

void PandaNode::clear_effects  )  [inline, inherited]
 

Resets this node to have no render effects.

Definition at line 819 of file pandaNode.I.

References PandaNode::_cycler, and INLINE.

void Namable::clear_name  )  [inline, inherited]
 

Resets the Namable's name to empty.

Definition at line 82 of file namable.I.

References Namable::_name, and INLINE.

void PandaNode::clear_state  )  [inline, inherited]
 

Resets this node to leave the render state alone.

Nodes at this level and below will once again inherit their render state unchanged from the nodes above this level.

Definition at line 769 of file pandaNode.I.

References PandaNode::_internal_bound.

void PandaNode::clear_transform  )  [inline, inherited]
 

Resets the transform on this node to the identity transform.

Definition at line 875 of file pandaNode.I.

Referenced by NodePath::get_transform().

PandaNode * PandaNode::combine_with PandaNode other  )  [virtual, inherited]
 

Collapses this PandaNode with the other PandaNode, if possible, and returns a pointer to the combined PandaNode, or NULL if the two PandaNodes cannot safely be combined.

The return value may be this, other, or a new PandaNode altogether.

This function is called from GraphReducer::flatten(), and need not deal with children; its job is just to decide whether to collapse the two PandaNodes and what the collapsed PandaNode should look like.

Reimplemented in CollisionNode, and GeomNode.

Definition at line 741 of file pandaNode.cxx.

Referenced by CollisionNode::xform().

int PiecewiseCurve::complete_pointers TypedWritable **  plist,
BamReader manager
[protected, virtual, inherited]
 

Takes in a vector of pointes to TypedWritable objects that correspond to all the requests for pointers that this object made to BamReader.

Reimplemented from TypedWritable.

Definition at line 786 of file piecewiseCurve.cxx.

bool ParametricCurve::convert_to_hermite HermiteCurve hc  )  const [virtual, inherited]
 

Stores an equivalent curve representation in the indicated Hermite curve, if possible.

Returns true if successful, false otherwise.

Definition at line 654 of file parametricCurve.cxx.

References ParametricCurve::_drawers.

Referenced by HermiteCurveCV::write_datagram().

bool ClassicNurbsCurve::convert_to_nurbs ParametricCurve nc  )  const [virtual]
 

Stores in the indicated NurbsCurve a NURBS representation of an equivalent curve.

Returns true if successful, false otherwise.

Reimplemented from NurbsCurveInterface.

Definition at line 587 of file classicNurbsCurve.cxx.

References _cvs, _order, ClassicNurbsCurve::CV::_p, ClassicNurbsCurve::CV::_t, Datagram::add_float64(), Datagram::add_int8(), Datagram::add_uint32(), size_t, and PiecewiseCurve::write_datagram().

void PandaNode::copy_children PandaNode other  )  [inherited]
 

Makes another instance of all the children of the other node, copying them to this node.

Definition at line 1546 of file pandaNode.cxx.

References NULL.

PointerTo< PandaNode > PandaNode::copy_subgraph  )  const [inherited]
 

Allocates and returns a complete copy of this PandaNode and the entire scene graph rooted at this PandaNode.

Some data may still be shared from the original (e.g. vertex index tables), but nothing that will impede normal use of the PandaNode.

Definition at line 1037 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::get_num_stashed(), PandaNode::get_stashed(), PandaNode::get_stashed_sort(), nassertv, PT, and PandaNode::remove_stashed().

bool PandaNode::cull_callback CullTraverser trav,
CullTraverserData data
[virtual, inherited]
 

If has_cull_callback() returns true, this function will be called during the cull traversal to perform any additional operations that should be performed at cull time.

This may include additional manipulation of render state or additional visible/invisible decisions, or any other arbitrary operation.

By the time this function is called, the node has already passed the bounding-volume test for the viewing frustum, and the node's transform and state have already been applied to the indicated CullTraverserData object.

The return value is true if this node should be visible, or false if it should be culled.

Reimplemented in Character, CollisionNode, ProjectionScreen, RopeNode, LODNode, SequenceNode, SwitchNode, PGEntry, PGItem, PGTop, PGWaitBar, and TextNode.

Definition at line 879 of file pandaNode.cxx.

References PandaNode::find_child(), PandaNode::find_parent(), PandaNode::find_stashed(), nassertr, NULL, PandaNode::remove_child(), and PandaNode::remove_stashed().

float PiecewiseCurve::current_seg_range float  t  )  const [protected, inherited]
 

Returns a number in the range [0,1], representing the conversion of t into the current segment's coordinate system (the segment last returned by find_curve).

This operation is already performed automatically on the t passed into find_seg; this function is useful only to adjust a different value into the same range.

It is an error to call this function if find_curve() has not yet been called, or if find_curve() returned false from its previous call.

Definition at line 703 of file piecewiseCurve.cxx.

void ClassicNurbsCurve::fillin DatagramIterator scan,
BamReader manager
[protected]
 

Function that reads out of the datagram (or asks manager to read) all of the data that is needed to re-create this object and stores it in the appropiate place.

Reimplemented from PiecewiseCurve.

Definition at line 737 of file classicNurbsCurve.cxx.

Referenced by get_nurbs_interface().

void TypedWritable::finalize void   )  [virtual, inherited]
 

Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.

Reimplemented in PartBundle, RenderAttrib, RenderEffect, RenderEffects, RenderState, and TransformState.

Definition at line 112 of file typedWritable.cxx.

Referenced by BamReader::skip_pointer().

int PandaNode::find_child PandaNode node  )  const [inherited]
 

Returns the index of the indicated child node, if it is a child, or -1 if it is not.

Definition at line 1053 of file pandaNode.cxx.

Referenced by PandaNode::cull_callback(), PandaFramework::event_i(), PandaFramework::event_l(), and PandaNode::get_parent().

bool PiecewiseCurve::find_curve const ParametricCurve *&  curve,
float &  t
const [protected, inherited]
 

Finds the curve corresponding to the given value of t.

If t is inside the curve's defined range, sets curve to the appropriate segment, translates t to [0,1] to index into the segment's coordinate system, and returns true. If t is outside the curve's defined range, sets curve to the nearest segment and t to the nearest point on this segment, and returns false.

Definition at line 596 of file piecewiseCurve.cxx.

References PiecewiseCurve::Curveseg::_curve, PiecewiseCurve::_segs, PiecewiseCurve::Curveseg::_tend, ParametricCurve::fillin(), DatagramIterator::get_float64(), DatagramIterator::get_uint32(), NULL, BamReader::read_pointer(), and size_t.

Referenced by PiecewiseCurve::adjust_tangent(), PiecewiseCurve::get_point(), and PiecewiseCurve::get_tangent().

int ClassicNurbsCurve::find_cv float  t  )  [protected]
 

Finds the first knot whose value is >= t, or -1 if t is beyond the end of the curve.

Definition at line 651 of file classicNurbsCurve.cxx.

Referenced by get_num_cvs().

float ParametricCurve::find_length float  start_t,
float  length_offset
const [inherited]
 

Returns the parametric value corresponding to the indicated distance along the curve from the starting parametric value.

This is the inverse of calc_length(): rather than determining the length along the curve between two parametric points, it determines the position in parametric time of a point n units along the curve.

The search distance must not be negative.

Definition at line 344 of file parametricCurve.cxx.

References ParametricCurve::get_type().

int PandaNode::find_parent PandaNode node  )  const [inline, inherited]
 

Returns the index of the indicated parent node, if it is a parent, or -1 if it is not.

Definition at line 350 of file pandaNode.I.

Referenced by PandaNode::cull_callback(), and PandaNode::has_selective_visibility().

int PandaNode::find_stashed PandaNode node  )  const [inherited]
 

Returns the index of the indicated stashed node, if it is a stashed child, or -1 if it is not.

Definition at line 1370 of file pandaNode.cxx.

Referenced by NodePath::clear_two_sided(), and PandaNode::cull_callback().

void BoundedObject::force_bound_stale  )  [inline, inherited]
 

Marks the current volume as stale and propagates the effect at least one level, even if it had already been marked stale.

Definition at line 188 of file boundedObject.I.

References BoundedObject::_cycler, BoundedObject::F_final, and INLINE.

Referenced by PandaNode::remove_child().

virtual TypeHandle ClassicNurbsCurve::force_init_type void   )  [inline, virtual]
 

Reimplemented from PiecewiseCurve.

Definition at line 169 of file classicNurbsCurve.h.

bool ClassicNurbsCurve::format_egg ostream &  out,
const string &  name,
const string &  curve_type,
int  indent_level
const [protected, virtual]
 

Formats the curve as an egg structure to write to the indicated stream.

Returns true on success, false on failure.

Reimplemented from NurbsCurveInterface.

Definition at line 635 of file classicNurbsCurve.cxx.

bool PiecewiseCurve::get_2ndtangent float  t,
LVecBase3f &  tangent2
const [virtual, inherited]
 

Returns the tangent of the first derivative of the curve at the point t.

Implements ParametricCurve.

Definition at line 150 of file piecewiseCurve.cxx.

const RenderAttrib * PandaNode::get_attrib TypeHandle  type  )  const [inline, inherited]
 

Returns the render attribute of the indicated type, if it is defined on the node, or NULL if it is not.

This checks only what is set on this particular node level, and has nothing to do with what render attributes may be inherited from parent nodes.

Definition at line 587 of file pandaNode.I.

References PandaNode::_cycler, and INLINE.

Referenced by NodePath::get_bin_draw_order(), NodePath::get_bin_name(), NodePath::get_color(), NodePath::get_quat(), NodePath::has_bin(), NodePath::has_material(), NodePath::has_texture_off(), NodePath::set_mat(), and NodePath::set_material().

bool ParametricCurve::get_bezier_seg ParametricCurve::BezierSeg  )  const [virtual, inherited]
 

Fills the BezierSeg structure with a description of the curve segment as a Bezier, if possible, but does not change the _t member of the structure.

Returns true if successful, false otherwise.

Definition at line 620 of file parametricCurve.cxx.

References NurbsCurveInterface::set_knot(), and t.

bool ParametricCurve::get_bezier_segs ParametricCurve::BezierSegs  )  const [virtual, inherited]
 

Fills up the indicated vector with a list of BezierSeg structs that describe the curve.

This assumes the curve is a PiecewiseCurve of CubicCurvesegs. Returns true if successful, false otherwise.

Definition at line 601 of file parametricCurve.cxx.

References NurbsCurveInterface::append_cv().

bool PiecewiseCurve::get_bezier_segs BezierSegs bz_segs  )  const [virtual, inherited]
 

Fills up the indicated vector with a list of BezierSeg structs that describe the curve.

This assumes the curve is a PiecewiseCurve of CubicCurvesegs. Returns true if successful, false otherwise.

Definition at line 533 of file piecewiseCurve.cxx.

References t.

const BoundingVolume & PandaNode::get_bound  )  const [inline, inherited]
 

Returns the node's external bounding volume.

This is the bounding volume around the node and all of its children.

Reimplemented from BoundedObject.

Definition at line 1015 of file pandaNode.I.

const BoundingVolume * BoundedObject::get_bound_ptr  )  const [inline, protected, inherited]
 

Returns the state of the _bound pointer.

To be used only internally by derived classes.

This returns a const pointer only; the bounding volume should not be modified directly, because that might interfere with pipelining. Instead, create a new copy with make_copy(), modify the copy, and set_bound_ptr() with the copy.

Alternatively, if you have just called recompute_bound(), which is guaranteed to reset the pointer, just use the return value from that as a non-const BoundingVolume pointer.

Definition at line 318 of file boundedObject.I.

PandaNode * PandaNode::get_child int  n  )  const [inline, inherited]
 

Returns the nth child node of this node.

See get_num_children().

Definition at line 390 of file pandaNode.I.

References PandaNode::_cycler, INLINE, nassertr, and NULL.

Referenced by PandaFramework::event_i(), PandaFramework::event_l(), PandaNode::has_single_child_visibility(), PT(), and PandaNode::replace_child().

int PandaNode::get_child_sort int  n  )  const [inline, inherited]
 

Returns the sort index of the nth child node of this node (that is, the number that was passed to add_child()).

See get_num_children().

Definition at line 409 of file pandaNode.I.

References PandaNode::_cycler, INLINE, and nassertr.

Referenced by PandaNode::has_single_child_visibility(), and PandaNode::replace_child().

PandaNode::Children PandaNode::get_children  )  const [inline, inherited]
 

Returns an object that can be used to walk through the list of children of the node.

When you intend to visit multiple children, using this is slightly faster than calling get_child() directly on the PandaNode, since this object keeps the PipelineCycler open the whole time.

However, this object does not protect you from self-modifying loops (e.g. adding or removing children during traversal).

Definition at line 1103 of file pandaNode.I.

Referenced by CullTraverser::get_bounds_inner_viz_state(), NodePath::get_top_node(), SortByState::operator()(), PandaNode::preserve_name(), NodePath::set_transparency(), and DataGraphTraverser::traverse().

PandaNode::ChildrenCopy PandaNode::get_children_copy  )  const [inline, inherited]
 

Returns an object that can be used to walk through the list of children of the node.

Unlike get_children(), this function actually returns an object that protects you from self-modifying loops, because it makes and returns a copy of the complete children list.

Definition at line 1127 of file pandaNode.I.

TypeHandle ClassicNurbsCurve::get_class_type void   )  [inline, static]
 

Reimplemented from NurbsCurveInterface.

Definition at line 153 of file classicNurbsCurve.h.

int ParametricCurve::get_curve_type  )  const [inherited]
 

Returns the flag indicating the use to which the curve is intended to be put.

Definition at line 209 of file parametricCurve.cxx.

References ParametricCurve::get_point().

Referenced by ParametricCurveCollection::has_curve(), and HermiteCurve::set_cv_name().

CubicCurveseg * ClassicNurbsCurve::get_curveseg int  ti  )  [inline]
 

Returns the curve segment corresponding to the given index.

Reimplemented from PiecewiseCurve.

Definition at line 31 of file classicNurbsCurve.I.

LVecBase4f ClassicNurbsCurve::get_cv int  n  )  const [virtual]
 

Returns the position in homogeneous space of the indicated CV.

Implements NurbsCurveInterface.

Definition at line 308 of file classicNurbsCurve.cxx.

References _cvs, _order, PiecewiseCurve::_segs, and get_knot().

LVecBase3f NurbsCurveInterface::get_cv_point int  n  )  const [inline, inherited]
 

Returns the position of the indicated CV.

Definition at line 99 of file nurbsCurveInterface.I.

float NurbsCurveInterface::get_cv_weight int  n  )  const [inline, inherited]
 

Returns the weight of the indicated CV.

Definition at line 115 of file nurbsCurveInterface.I.

DrawMask PandaNode::get_draw_mask  )  const [inline, inherited]
 

Returns the hide/show bits of this particular node.

See set_draw_mask().

Definition at line 938 of file pandaNode.I.

Referenced by CullTraverserData::~CullTraverserData().

const RenderEffect * PandaNode::get_effect TypeHandle  type  )  const [inline, inherited]
 

Returns the render effect of the indicated type, if it is defined on the node, or NULL if it is not.

Definition at line 664 of file pandaNode.I.

References INLINE, and PandaNode::r_list_descendants().

const RenderEffects * PandaNode::get_effects  )  const [inline, inherited]
 

Returns the complete RenderEffects that will be applied to this node.

Definition at line 805 of file pandaNode.I.

References PandaNode::_cycler, and INLINE.

Referenced by CullTraverser::traverse().

int PandaNode::get_first_visible_child  )  const [virtual, inherited]
 

Returns the index number of the first visible child of this node, or a number >= get_num_children() if there are no visible children of this node.

This is called during the cull traversal, but only if has_selective_visibility() has already returned true. See has_selective_visibility().

Reimplemented in SelectiveChildNode.

Definition at line 941 of file pandaNode.cxx.

Referenced by CullTraverser::get_bounds_inner_viz_state().

const BoundingVolume & PandaNode::get_internal_bound  )  const [inline, inherited]
 

Returns the node's internal bounding volume.

This is the bounding volume around the node alone, without including children.

Definition at line 1032 of file pandaNode.I.

float ClassicNurbsCurve::get_knot int  n  )  const [virtual]
 

Retrieves the value of the indicated knot.

Implements NurbsCurveInterface.

Definition at line 351 of file classicNurbsCurve.cxx.

References _cvs, PiecewiseCurve::_last_ti, _order, nassertr, and RT_KEEP_ORIG.

Referenced by get_cv(), CurveFitter::make_hermite(), and stitch().

float PiecewiseCurve::get_max_t  )  const [virtual, inherited]
 

Returns the upper bound of t for the entire curve.

The curve is defined in the range 0.0f <= t <= get_max_t().

Reimplemented from ParametricCurve.

Definition at line 88 of file piecewiseCurve.cxx.

Referenced by HermiteCurve::HermiteCurve().

const string & Namable::get_name  )  const [inline, inherited]
 

Definition at line 109 of file namable.I.

Referenced by ComputedVerticesMaker::add_normal(), GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::begin_bind_lights(), BuilderBucket::BuilderBucket(), EggVertex::clear_grefs(), AnimBundleMaker::create_xfm_channel(), SceneGraphReducer::do_flatten_siblings(), BuilderBucket::done_geom(), DXTextureContext8::DXTextureContext8(), PartGroup::find_child(), EggLoader::find_collision_geometry(), EggGroupUniquifier::get_category(), PartBundle::get_control_effect(), PartGroup::get_num_children(), EggMorph< Parameter >::get_offset(), AnimChannelBase::has_changed(), Namable::has_name(), EggMaterial::is_equivalent_to(), Texture::load(), EggLoader::make_node(), AnimBundleMaker::make_node(), FindApproxPath::Component::matches(), LineSegs::move_to(), MovingPartBase::MovingPartBase(), NodeMap::NodeMap(), EggMorph< Parameter >::operator<(), operator<<(), MouseWatcherRegion::output(), AnimGroup::output(), EggXfmSAnim::r_transform(), Texture::read(), MouseWatcherGroup::remove_region(), EggLoader::reparent_decals(), CRGraphicsStateGuardian::set_blend_mode(), NodePath::set_color(), GLGraphicsStateGuardian::set_draw_buffer(), AnimChannelScalarTable::set_table(), NodePath::set_transparency(), NodePathComponent::uncollapse(), Texture::unprepare(), TextNode::wordwrap_to(), MovingPartBase::write(), CollisionNode::xform(), and EggVertex::~EggVertex().

CollideMask PandaNode::get_net_collide_mask  )  const [inline, inherited]
 

Returns the union of all into_collide_mask() values set at CollisionNodes at this level and below.

Definition at line 954 of file pandaNode.I.

int PandaNode::get_next_visible_child int  n  )  const [virtual, inherited]
 

Returns the index number of the next visible child of this node following the indicated child, or a number >= get_num_children() if there are no more visible children of this node.

See has_selective_visibility() and get_first_visible_child().

Reimplemented in SelectiveChildNode.

Definition at line 964 of file pandaNode.cxx.

int PandaNode::get_num_children  )  const [inline, inherited]
 

Returns the number of child nodes this node has.

The order of the child nodes *is* meaningful and is based on the sort number that was passed to add_child(), and also on the order in which the nodes were added.

Definition at line 374 of file pandaNode.I.

Referenced by PandaFramework::event_l(), SelectiveChildNode::has_selective_visibility(), PandaNode::has_single_child_visibility(), PT(), and LODNode::xform().

int ClassicNurbsCurve::get_num_cvs  )  const [virtual]
 

Implements NurbsCurveInterface.

Definition at line 156 of file classicNurbsCurve.cxx.

References _cvs, NurbsCurveInterface::append_cv(), find_cv(), and t.

Referenced by remove_cv().

int ParametricCurve::get_num_dimensions  )  const [inherited]
 

Returns the number of significant dimensions in the curve's vertices, as set by a previous call to set_num_dimensions().

This is only a hint as to how the curve is intended to be used; the actual number of dimensions of any curve is always three.

Definition at line 253 of file parametricCurve.cxx.

References cfloor(), ParametricCurve::get_max_t(), and nassertr.

int ClassicNurbsCurve::get_num_knots  )  const [virtual]
 

Returns the number of knots on the curve.

Implements NurbsCurveInterface.

Definition at line 169 of file classicNurbsCurve.cxx.

References _cvs, and NurbsCurveInterface::append_cv().

Referenced by remove_all_cvs().

int PandaNode::get_num_parents  )  const [inline, inherited]
 

Returns the number of parent nodes this node has.

If this number is greater than 1, the node has been multiply instanced. The order of the parent nodes is not meaningful and is not related to the order in which the node was instanced to them.

Definition at line 317 of file pandaNode.I.

References PandaNode::_cycler, INLINE, and nassertr.

Referenced by ParticleSystem::birth_litter(), DataNode::define_output(), Fog::output(), PandaNode::transform_changed(), and DataGraphTraverser::traverse().

int PiecewiseCurve::get_num_segs  )  const [inherited]
 

Returns the number of curve segments that make up the Piecewise curve.

Definition at line 285 of file piecewiseCurve.cxx.

References PiecewiseCurve::_segs, and PiecewiseCurve::get_tlength().

Referenced by PiecewiseCurve::remove_all_curvesegs().

int PandaNode::get_num_stashed  )  const [inline, inherited]
 

Returns the number of stashed nodes this node has.

These are former children of the node that have been moved to the special stashed list via stash_child().

Definition at line 508 of file pandaNode.I.

References PandaNode::_cycler, and INLINE.

Referenced by PandaNode::copy_subgraph().

NurbsCurveInterface * ClassicNurbsCurve::get_nurbs_interface  )  [virtual]
 

Returns a pointer to the object as a NurbsCurveInterface object if it happens to be a NURBS-style curve; otherwise, returns NULL.

Reimplemented from ParametricCurve.

Definition at line 570 of file classicNurbsCurve.cxx.

References fillin(), and parse_params().

int ClassicNurbsCurve::get_order  )  const [virtual]
 

Implements NurbsCurveInterface.

Definition at line 144 of file classicNurbsCurve.cxx.

PandaNode * PandaNode::get_parent int  n  )  const [inline, inherited]
 

Returns the nth parent node of this node.

See get_num_parents().

Definition at line 333 of file pandaNode.I.

References PandaNode::find_child(), INLINE, and PandaNode::stash_child().

Referenced by ParticleSystem::birth_litter(), and DataNode::define_output().

bool PiecewiseCurve::get_point float  t,
LVecBase3f &  point
const [virtual, inherited]
 

Returns the point of the curve at a given parametric point t.

Returns true if t is in the valid range 0.0f <= t <= get_max_t(); if t is outside this range, sets point to the value of the curve at the beginning or end (whichever is nearer) and returns false.

Implements ParametricCurve.

Definition at line 110 of file piecewiseCurve.cxx.

References PiecewiseCurve::find_curve(), ParametricCurve::get_2ndtangent(), and t.

bool PiecewiseCurve::get_pt float  t,
LVecBase3f &  point,
LVecBase3f &  tangent
const [virtual, inherited]
 

Simultaneously returns the point and tangent of the curve at a given parametric point t.

Implements ParametricCurve.

Definition at line 265 of file piecewiseCurve.cxx.

Referenced by HermiteCurve::HermiteCurve().

int ReferenceCount::get_ref_count  )  const [inline, inherited]
 

Returns the current reference count.

Definition at line 183 of file referenceCount.I.

Referenced by RenderState::determine_bin_index(), RenderEffects::determine_show_bounds(), FontPool::ns_garbage_collect(), TexturePool::ns_garbage_collect(), MaterialPool::ns_get_material(), and TexturePool::ns_release_texture().

PandaNode * PandaNode::get_stashed int  n  )  const [inline, inherited]
 

Returns the nth stashed node of this node.

See get_num_stashed().

Definition at line 524 of file pandaNode.I.

References PandaNode::_cycler, and INLINE.

Referenced by PandaNode::copy_subgraph().

int PandaNode::get_stashed_sort int  n  )  const [inline, inherited]
 

Returns the sort index of the nth stashed node of this node (that is, the number that was passed to add_child()).

See get_num_stashed().

Definition at line 543 of file pandaNode.I.

References PandaNode::_cycler, and INLINE.

Referenced by PandaNode::copy_subgraph().

const RenderState * PandaNode::get_state  )  const [inline, inherited]
 

Returns the complete RenderState that will be applied to all nodes at this level and below, as set on this node.

This returns only the RenderState set on this particular node, and has nothing to do with state that might be inherited from above.

Reimplemented in PGItem.

Definition at line 749 of file pandaNode.I.

References BoundedObject::get_bound(), and INLINE.

Referenced by NodePath::do_billboard_point_eye().

bool PiecewiseCurve::get_tangent float  t,
LVecBase3f &  tangent
const [virtual, inherited]
 

Returns the tangent of the curve at a given parametric point t.

Implements ParametricCurve.

Definition at line 130 of file piecewiseCurve.cxx.

References PiecewiseCurve::find_curve(), and t.

float PiecewiseCurve::get_tend int  ti  )  const [inherited]
 

Returns the parametric end of the given segment of the curve.

Definition at line 441 of file piecewiseCurve.cxx.

float PiecewiseCurve::get_tlength int  ti  )  const [inherited]
 

Returns the parametric length of the given segment of the curve.

Definition at line 409 of file piecewiseCurve.cxx.

References PiecewiseCurve::_segs.

Referenced by HermiteCurve::get_cv_out(), PiecewiseCurve::get_num_segs(), and PiecewiseCurve::remove_curveseg().

const TransformState * PandaNode::get_transform  )  const [inline, inherited]
 

Returns the transform that has been set on this particular node.

This is not the net transform from the root, but simply the transform on this particular node.

Reimplemented in TrackerNode, and TextNode.

Definition at line 859 of file pandaNode.I.

Referenced by NodePath::do_billboard_point_world(), PandaNode::preserve_name(), NodePath::set_transform(), ActorNode::update_transform(), and CullTraverserData::~CullTraverserData().

float PiecewiseCurve::get_tstart int  ti  )  const [inherited]
 

Returns the parametric start of the given segment of the curve.

Definition at line 425 of file piecewiseCurve.cxx.

virtual TypeHandle ClassicNurbsCurve::get_type void   )  const [inline, virtual]
 

Reimplemented from PiecewiseCurve.

Definition at line 166 of file classicNurbsCurve.h.

int TypedObject::get_type_index  )  const [inline, inherited]
 

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 71 of file typedObject.I.

References TypeHandle::get_name(), TypedObject::get_type(), and INLINE.

int PandaNode::get_unsafe_to_apply_attribs  )  const [virtual, inherited]
 

Returns the union of all attributes from SceneGraphReducer::AttribTypes that may not safely be applied to the vertices of this node.

If this is nonzero, these attributes must be dropped at this node as a state change.

This is a generalization of safe_to_transform().

Reimplemented in TextNode.

Definition at line 660 of file pandaNode.cxx.

int PandaNode::get_visible_child  )  const [virtual, inherited]
 

Returns the index number of the currently visible child of this node.

This is only meaningful if has_single_child_visibility() has returned true.

Reimplemented in SequenceNode, and SwitchNode.

Definition at line 1016 of file pandaNode.cxx.

bool PandaNode::has_attrib TypeHandle  type  )  const [inline, inherited]
 

Returns true if there is a render attribute of the indicated type defined on this node, or false if there is not.

Definition at line 609 of file pandaNode.I.

References PandaNode::_cycler, INLINE, and RenderEffects::make_empty().

Referenced by NodePath::clear_material(), NodePath::get_hpr(), NodePath::set_hpr_scale(), and NodePath::set_sz().

bool PandaNode::has_cull_callback  )  const [virtual, inherited]
 

Should be overridden by derived classes to return true if cull_callback() has been defined.

Otherwise, returns false to indicate cull_callback() does not need to be called for this node during the cull traversal.

Reimplemented in Character, CollisionNode, ProjectionScreen, RopeNode, LODNode, SequenceNode, SwitchNode, PGEntry, PGItem, PGTop, PGWaitBar, and TextNode.

Definition at line 838 of file pandaNode.cxx.

bool PandaNode::has_effect TypeHandle  type  )  const [inline, inherited]
 

Returns true if there is a render effect of the indicated type defined on this node, or false if there is not.

Definition at line 686 of file pandaNode.I.

Referenced by NodePath::set_render_mode_wireframe().

bool Namable::has_name  )  const [inline, inherited]
 

Returns true if the Namable has a nonempty name set, false if the name is empty.

Definition at line 97 of file namable.I.

References Namable::get_name(), and INLINE.

Referenced by EggGroupUniquifier::EggGroupUniquifier(), Texture::read(), and Texture::Texture().

bool PandaNode::has_selective_visibility  )  const [virtual, inherited]
 

Should be overridden by derived classes to return true if this kind of node has some restrictions on the set of children that should be rendered.

Node with this property include LODNodes, SwitchNodes, and SequenceNodes.

If this function returns true, get_first_visible_child() and get_next_visible_child() will be called to walk through the list of children during cull, instead of iterating through the entire list. This method is called after cull_callback(), so cull_callback() may be responsible for the decisions as to which children are visible at the moment.

Reimplemented in SelectiveChildNode.

Definition at line 918 of file pandaNode.cxx.

References PandaNode::find_parent(), nassertr, and NULL.

Referenced by CullTraverser::get_bounds_inner_viz_state().

bool PandaNode::has_single_child_visibility  )  const [virtual, inherited]
 

Should be overridden by derived classes to return true if this kind of node has the special property that just one of its children is visible at any given time, and furthermore that the particular visible child can be determined without reference to any external information (such as a camera).

At present, only SequenceNodes and SwitchNodes fall into this category.

If this function returns true, get_visible_child() can be called to return the index of the currently-visible child.

Reimplemented in SequenceNode, and SwitchNode.

Definition at line 999 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::get_child(), PandaNode::get_child_sort(), PandaNode::get_num_children(), nassertv, PT, and PandaNode::remove_child().

void ClassicNurbsCurve::init_type void   )  [inline, static]
 

Reimplemented from NurbsCurveInterface.

Definition at line 156 of file classicNurbsCurve.h.

bool PiecewiseCurve::insert_curveseg int  ti,
ParametricCurve seg,
float  tlength
[inherited]
 

Inserts a new curve segment at the indicated index.

The curve segment must have been allocated via new; it will be freed using delete when it is removed or the PiecewiseCurve destructs.

If the curve segment is not inserted at the end, its tlength is subtracted from that of the following segment, so that the overall length of the curve is not changed.

Definition at line 331 of file piecewiseCurve.cxx.

Referenced by HermiteCurve::get_num_cvs(), and PiecewiseCurve::remove_all_curvesegs().

bool ClassicNurbsCurve::insert_cv float  t  )  [virtual]
 

Inserts a new CV into the middle of the curve at the indicated parametric value.

This doesn't change the shape or timing of the curve; however, it is irreversible: if the new CV is immediately removed, the curve will be changed. Returns true if successful, false otherwise.

Implements NurbsCurveInterface.

Definition at line 194 of file classicNurbsCurve.cxx.

References _cvs, and _order.

void ParametricCurve::invalidate float  t1,
float  t2
[protected, inherited]
 

Called from a base class to mark a section of the curve that has been modified and must be redrawn or recomputed in some way.

Definition at line 843 of file parametricCurve.cxx.

void ParametricCurve::invalidate_all  )  [protected, inherited]
 

Called from a base class to indicate that the curve has changed in some substantial way and must be entirely redrawn.

Definition at line 860 of file parametricCurve.cxx.

Referenced by HermiteCurve::get_num_cvs().

bool BoundedObject::is_bound_stale  )  const [inline, inherited]
 

Returns true if the bound is currently marked stale and will be recomputed the next time get_bound() is called.

This function is defined up at the top of this file, because several of the inline functions below reference it.

Definition at line 217 of file boundedObject.I.

References BoundedObject::_cycler, and INLINE.

Referenced by BoundedObject::~BoundedObject().

bool TypedObject::is_exact_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is the indicated type exactly.

Definition at line 101 of file typedObject.I.

Referenced by PT(), and CollisionNode::xform().

bool BoundedObject::is_final  )  const [inline, inherited]
 

Returns the current state of the "final" flag.

Initially, this flag is off (false), but it may be changed by an explicit call to set_final(). See set_final().

Definition at line 280 of file boundedObject.I.

bool PandaNode::is_geom_node  )  const [virtual, inherited]
 

A simple downcast check.

Returns true if this kind of node happens to inherit from GeomNode, false otherwise.

This is provided as a a faster alternative to calling is_of_type(GeomNode::get_class_type()), since this test is so important to rendering.

Reimplemented in GeomNode.

Definition at line 1624 of file pandaNode.cxx.

References PandaNode::detach(), NodePathComponent::get_node(), NodePathComponent::is_top_node(), nassertv, NULL, and NodePathComponent::set_next().

Referenced by CullTraverser::get_bounds_inner_viz_state(), NodePath::get_transparency(), PT(), and NodePath::set_transparency().

bool TypedObject::is_of_type TypeHandle  handle  )  const [inline, inherited]
 

Returns true if the current object is or derives from the indicated type.

Definition at line 86 of file typedObject.I.

Referenced by EggMaterialCollection::collapse_equivalent_materials(), EggTextureCollection::collapse_equivalent_textures(), DeferredNodeProperty::compose(), AnimBundleMaker::create_s_channel(), CharacterMaker::create_slider(), ProjectionScreen::cull_callback(), DataNode::define_output(), EggNode::determine_draw_order(), CharacterMaker::egg_to_index(), EggGroupUniquifier::EggGroupUniquifier(), EggPoolUniquifier::EggPoolUniquifier(), EggGroupNode::find_textures(), StaticTextFont::get_glyph(), EggMaterialCollection::insert_materials(), EggTextureCollection::insert_textures(), CharacterJoint::make_copy(), PT(), EggGroupNode::r_flatten_transforms(), EggGroupNode::r_transform_vertices(), EggGroupNode::recompute_polygon_normals(), CollisionLevelState::reserve(), PandaFramework::reset_frame_rate(), PandaFramework::set_texture(), EggGroupNode::steal_children(), and DataGraphTraverser::traverse().

bool PiecewiseCurve::is_valid  )  const [virtual, inherited]
 

Returns true if the curve is defined.

In the case of a PiecewiseCurve, this means we have at least one segment.

Reimplemented from ParametricCurve.

Definition at line 71 of file piecewiseCurve.cxx.

References PiecewiseCurve::_segs.

Referenced by HermiteCurve::HermiteCurve().

void PandaNode::ls ostream &  out,
int  indent_level
const [inline, inherited]
 

Lists all the nodes at and below the current path hierarchically.

Definition at line 893 of file pandaNode.I.

Referenced by PGEntry::erase().

TypedWritable * ClassicNurbsCurve::make_ClassicNurbsCurve const FactoryParams params  )  [static, protected]
 

Factory method to generate an object of this type.

Definition at line 687 of file classicNurbsCurve.cxx.

PandaNode * PandaNode::make_copy void   )  const [virtual, inherited]
 

Returns a newly-allocated PandaNode that is a shallow copy of this one.

It will be a different pointer, but its internal data may or may not be shared with that of the original PandaNode. No children will be copied.

Reimplemented in Character, CollisionNode, DataNode, ProjectionScreen, RopeNode, AmbientLight, Camera, DirectionalLight, Fog, GeomNode, LensNode, LODNode, ModelNode, ModelRoot, PlaneNode, PointLight, SequenceNode, Spotlight, SwitchNode, PGButton, PGEntry, PGItem, PGTop, PGWaitBar, ForceNode, and PhysicalNode.

Definition at line 511 of file pandaNode.cxx.

Referenced by Character::r_copy_char(), and PandaNode::remove_all_children().

TypedWritable * PandaNode::make_from_bam const FactoryParams params  )  [static, protected, inherited]
 

This function is called by the BamReader's factory when a new object of type PandaNode is encountered in the Bam file.

It should create the PandaNode and extract its information from the file.

Reimplemented in AnimBundleNode, Character, CollisionNode, RopeNode, AmbientLight, Camera, DirectionalLight, Fog, GeomNode, LensNode, LODNode, ModelNode, ModelRoot, PlaneNode, PointLight, SequenceNode, Spotlight, and SwitchNode.

Definition at line 2556 of file pandaNode.cxx.

void PiecewiseCurve::make_nurbs int  order,
int  num_cvs,
const float  knots[],
const LVecBase4f  cvs[]
[inherited]
 

Defines the curve as a general NURBS curve.

The order is the degree plus one and must be 1, 2, 3, or 4; cvs is an array of num_cvs points each with a homogeneous coordinate; knots is an array of num_cvs+order knot values.

This creates the individual curve segments and sets up the basis matrices, but does not store the CV's or knot values so the curve shape is not later modifiable.

Definition at line 500 of file piecewiseCurve.cxx.

References t.

bool BoundedObject::mark_bound_stale  )  [inline, inherited]
 

Marks the current bounding volume as stale, so that it will be recomputed later.

This may have a cascading effect up to the root of all graphs of which the node is a part. Returns true if the setting was changed, or false if it was already marked stale (or if it is a static bounding volume).

Definition at line 162 of file boundedObject.I.

References BoundedObject::_cycler, BoundedObject::F_bound_stale, and INLINE.

Referenced by CollisionSphere::CollisionSphere(), GeomNode::combine_with(), CollisionPlane::get_normal(), PGItem::instance_to_state_def(), CollisionPlane::make_copy(), PGItem::set_active(), CollisionSphere::set_center(), TextNode::set_coordinate_system(), PandaNode::set_effect(), CollisionNode::set_from_collide_mask(), GeomNode::set_geom_state(), CollisionRay::set_origin(), CollisionSegment::set_point_a(), CollisionSphere::test_intersection(), CollisionSegment::test_intersection(), CollisionRay::test_intersection(), and CollisionNode::xform().

void PandaNode::output ostream &  out  )  const [virtual, inherited]
 

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented from Namable.

Reimplemented in CollisionNode, ButtonNode, HermiteCurve, RopeNode, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, PlaneNode, and MouseWatcher.

Definition at line 1575 of file pandaNode.cxx.

Referenced by PlaneNode::make_copy(), HermiteCurve::set_cv_name(), DriveInterface::set_mat(), and ButtonNode::~ButtonNode().

void PandaNode::parents_changed  )  [protected, virtual, inherited]
 

Called after a scene graph update that either adds or remove parents from this node, this just provides a hook for derived PandaNode objects that need to update themselves based on the set of parents the node has.

Reimplemented in DataNode.

Definition at line 1820 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::CData::_paths, PipelineCyclerBase::get_num_stages(), PipelineCyclerBase::is_stage_unique(), PipelineCyclerBase::release_write_stage(), and PipelineCycler< CData >::write_stage().

bool PandaNode::preserve_name  )  const [virtual, inherited]
 

Returns true if the node's name has extrinsic meaning and must be preserved across a flatten operation, false otherwise.

Reimplemented in CollisionNode, and ModelNode.

Definition at line 635 of file pandaNode.cxx.

References TransformState::compose(), CPT, PandaNode::get_children(), and PandaNode::get_transform().

Referenced by SceneGraphReducer::do_flatten_siblings().

void PandaNode::propagate_stale_bound  )  [protected, virtual, inherited]
 

Called by BoundedObject::mark_bound_stale(), this should make sure that all bounding volumes that depend on this one are marked stale also.

Reimplemented from BoundedObject.

Definition at line 1690 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::NodePathComponent, and PT.

void PandaNode::r_copy_children const PandaNode from,
PandaNode::InstanceMap inst_map
[protected, virtual, inherited]
 

This is called by r_copy_subgraph(); the copy has already been made of this particular node (and this is the copy); this function's job is to copy all of the children from the original.

Note that it includes the parameter inst_map, which is a map type, and is not (and cannot be) exported from PANDA.DLL. Thus, any derivative of PandaNode that is not also a member of PANDA.DLL *cannot* access this map, and probably should not even override this function.

Reimplemented in Character.

Definition at line 1925 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::fix_path_lengths(), and PandaNode::get_generic_component().

PointerTo< PandaNode > PandaNode::r_copy_subgraph PandaNode::InstanceMap inst_map  )  const [protected, virtual, inherited]
 

This is the recursive implementation of copy_subgraph().

It returns a copy of the entire subgraph rooted at this node.

Note that it includes the parameter inst_map, which is a map type, and is not (and cannot be) exported from PANDA.DLL. Thus, any derivative of PandaNode that is not also a member of PANDA.DLL *cannot* access this map.

Definition at line 1884 of file pandaNode.cxx.

Referenced by PandaNode::steal_children().

bool ClassicNurbsCurve::rebuild_curveseg int  rtype0,
float  t0,
const LVecBase4f &  v0,
int  rtype1,
float  t1,
const LVecBase4f &  v1,
int  rtype2,
float  t2,
const LVecBase4f &  v2,
int  rtype3,
float  t3,
const LVecBase4f &  v3
[virtual]
 

Rebuilds the current curve segment (as selected by the most recent call to find_curve()) according to the specified properties (see CubicCurveseg::compute_seg).

Returns true if possible, false if something goes horribly wrong.

Reimplemented from PiecewiseCurve.

Definition at line 427 of file classicNurbsCurve.cxx.

bool ClassicNurbsCurve::recompute  )  [virtual]
 

Recalculates the curve basis according to the latest position of the CV's, knots, etc.

Until this function is called, adjusting the NURBS parameters will have no visible effect on the curve. Returns true if the resulting curve is valid, false otherwise.

Reimplemented from ParametricCurve.

Definition at line 381 of file classicNurbsCurve.cxx.

References _cvs, and _order.

BoundingVolume * PandaNode::recompute_bound  )  [protected, virtual, inherited]
 

Recomputes the dynamic bounding volume for this object.

The default behavior is the compute an empty bounding volume; this may be overridden to extend it to create a nonempty bounding volume. However, after calling this function, it is guaranteed that the _bound pointer will not be shared with any other stage of the pipeline, and this new pointer is returned.

Reimplemented from BoundedObject.

Reimplemented in CollisionNode.

Definition at line 1723 of file pandaNode.cxx.

BoundingVolume * PandaNode::recompute_internal_bound  )  [protected, virtual, inherited]
 

Called when needed to recompute the node's _internal_bound object.

Nodes that contain anything of substance should redefine this to do the right thing.

Reimplemented in CollisionNode, RopeNode, GeomNode, PGItem, and TextNode.

Definition at line 1798 of file pandaNode.cxx.

Referenced by GeomNode::add_geoms_from().

int ReferenceCount::ref  )  const [inline, inherited]
 

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is the new reference count.

Definition at line 225 of file referenceCount.I.

Referenced by ClientDevice::ClientDevice(), EggGroupNode::find_textures(), EggGroupNode::r_apply_texmats(), EggGroupNode::r_flatten_transforms(), and EggGroupNode::reverse_vertex_ordering().

void ParametricCurve::register_drawer ParametricCurveDrawer drawer  )  [inherited]
 

Registers a Drawer with this curve that will automatically be updated whenever the curve is modified, so that the visible representation of the curve is kept up to date.

This is called automatically by the ParametricCurveDrawer.

Any number of Drawers may be registered with a particular curve.

Definition at line 806 of file parametricCurve.cxx.

Referenced by ParametricCurveCollection::write().

void ClassicNurbsCurve::register_with_read_factory void   )  [static]
 

Initializes the factory for reading these things from Bam files.

Reimplemented from PandaNode.

Definition at line 673 of file classicNurbsCurve.cxx.

void PandaNode::remove_all_children  )  [inherited]
 

Removes all the children from the node at once, including stashed children.

Definition at line 1465 of file pandaNode.cxx.

References PandaNode::get_type(), PandaNode::make_copy(), nassertr, NULL, and PT.

void PiecewiseCurve::remove_all_curvesegs  )  [inherited]
 

Removes all curve segments from the curve.

Definition at line 393 of file piecewiseCurve.cxx.

References PiecewiseCurve::get_num_segs(), and PiecewiseCurve::insert_curveseg().

Referenced by PiecewiseCurve::PiecewiseCurve().

void ClassicNurbsCurve::remove_all_cvs  )  [virtual]
 

Removes all CV's from the curve.

Implements NurbsCurveInterface.

Definition at line 274 of file classicNurbsCurve.cxx.

References _cvs, _order, get_num_knots(), nassertr, and t.

bool PandaNode::remove_child PandaNode child_node  )  [inherited]
 

Removes the indicated child from the node.

Returns true if the child was removed, false if it was not already a child of the node. This will also successfully remove the child if it had been stashed.

Definition at line 1157 of file pandaNode.cxx.

void PandaNode::remove_child int  n  )  [inherited]
 

Removes the nth child from the node.

Definition at line 1121 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::children_changed(), BoundedObject::force_bound_stale(), nassertv, PT, and PandaNode::sever_connection().

Referenced by PandaNode::add_child(), PandaNode::cull_callback(), and PandaNode::has_single_child_visibility().

bool PiecewiseCurve::remove_curveseg int  ti  )  [inherited]
 

Removes the given curve segment from the curve and frees it.

Returns true if the segment was defined, false otherwise.

Definition at line 365 of file piecewiseCurve.cxx.

References PiecewiseCurve::_segs, and PiecewiseCurve::get_tlength().

Referenced by HermiteCurve::insert_cv().

bool ClassicNurbsCurve::remove_cv int  n  )  [virtual]
 

Removes the indicated CV from the curve.

Returns true if the CV index was valid, false otherwise.

Implements NurbsCurveInterface.

Definition at line 256 of file classicNurbsCurve.cxx.

References _cvs, get_num_cvs(), and nassertr.

void PandaNode::remove_stashed int  n  )  [inherited]
 

Removes the nth stashed child from the node.

Definition at line 1433 of file pandaNode.cxx.

Referenced by PandaNode::copy_subgraph(), and PandaNode::cull_callback().

bool PandaNode::replace_child PandaNode orig_child,
PandaNode new_child
[inherited]
 

Searches for the orig_child node in the node's list of children, and replaces it with the new_child instead.

Returns true if the replacement is made, or false if the node is not a child.

Definition at line 1203 of file pandaNode.cxx.

References PandaNode::add_child(), PandaNode::get_child(), and PandaNode::get_child_sort().

Referenced by SceneGraphReducer::consider_siblings().

bool PandaNode::safe_to_combine  )  const [virtual, inherited]
 

Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of PandaNodes, adding children or whatever.

For instance, an LODNode should not be combined with any other PandaNode, because its set of children is meaningful.

Reimplemented in LODNode, ModelNode, SequenceNode, and SwitchNode.

Definition at line 601 of file pandaNode.cxx.

Referenced by SortByState::operator()().

bool ParametricCurve::safe_to_flatten void   )  const [virtual, inherited]
 

Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating instances, false otherwise (for instance, a Camera cannot be safely flattened, because the Camera pointer itself is meaningful).

Reimplemented from PandaNode.

Definition at line 88 of file parametricCurve.cxx.

bool PandaNode::safe_to_flatten_below  )  const [virtual, inherited]
 

Returns true if a flatten operation may safely continue past this node, or false if it should drop all attributes here and stop.

Definition at line 618 of file pandaNode.cxx.

References NULL.

bool PandaNode::safe_to_modify_transform  )  const [virtual, inherited]
 

Returns true if it is safe to automatically adjust the transform on this kind of node.

Usually, this is only a bad idea if the user expects to find a particular transform on the node.

ModelNodes with the preserve_transform flag set are presently the only kinds of nodes that should not have their transform even adjusted.

Reimplemented in ModelNode.

Definition at line 578 of file pandaNode.cxx.

bool ParametricCurve::safe_to_transform  )  const [virtual, inherited]
 

Returns true if it is generally safe to transform this particular kind of PandaNode by calling the xform() method, false otherwise.

For instance, it's usually a bad idea to attempt to xform a Character.

Reimplemented from PandaNode.

Definition at line 107 of file parametricCurve.cxx.

void PandaNode::set_attrib const RenderAttrib attrib,
int  override = 0
[inline, inherited]
 

Adds the indicated render attribute to the scene graph on this node.

This attribute will now apply to this node and everything below. If there was already an attribute of the same type, it is replaced.

Definition at line 565 of file pandaNode.I.

References PandaNode::_cycler, INLINE, and RenderState::make_empty().

Referenced by NodePath::clear_texture(), NodePath::get_mat(), NodePath::set_bin(), NodePath::set_color_off(), NodePath::set_pos_hpr(), NodePath::set_render_mode_filled(), and NodePath::set_scale().

void BoundedObject::set_bound BoundedObject::BoundingVolumeType  type  )  [inline, inherited]
 

Sets the type of the bounding volume that will be dynamically computed for this particular node.

Presently, this should only be BVT_dynamic_sphere.

Definition at line 115 of file boundedObject.I.

void PandaNode::set_bound const BoundingVolume volume  )  [inline, inherited]
 

Resets the internal bounding volume so that it is the indicated volume.

The external bounding volume as returned by get_bound() (which includes all of the node's children) will be adjusted to include this internal volume.

Reimplemented from BoundedObject.

Definition at line 995 of file pandaNode.I.

void PandaNode::set_bound BoundingVolumeType  type  )  [inline, inherited]
 

Sets the type of the external bounding volume that is placed around this node and all of its children.

Definition at line 972 of file pandaNode.I.

BoundingVolume * BoundedObject::set_bound_ptr BoundingVolume bound  )  [inline, protected, inherited]
 

Changes the _bound pointer.

To be used only internally by derived classes, usually in recompute_bound(). The return value is the same pointer passed in, as a convenience (it will now be reference counted).

Definition at line 340 of file boundedObject.I.

void ParametricCurve::set_curve_type int  type  )  [inherited]
 

Sets the flag indicating the use to which the curve is intended to be put.

This flag is optional and only serves to provide a hint to the egg reader and writer code; it has no effect on the curve's behavior.

Setting the curve type also sets the num_dimensions to 3 or 1 according to the type.

THis flag may have one of the values PCT_XYZ, PCT_HPR, or PCT_T.

Definition at line 180 of file parametricCurve.cxx.

References ParametricCurve::_num_dimensions.

Referenced by CurveFitter::compute_tangents(), and ParametricCurveCollection::evaluate().

bool ClassicNurbsCurve::set_cv int  n,
const LVecBase4f &  v
[virtual]
 

Repositions the indicated CV.

Returns true if successful, false otherwise.

Implements NurbsCurveInterface.

Definition at line 290 of file classicNurbsCurve.cxx.

References _cvs, and _order.

bool NurbsCurveInterface::set_cv_point int  n,
const LVecBase3f &  v
[inline, inherited]
 

Repositions the indicated CV.

Returns true if successful, false otherwise.

Definition at line 85 of file nurbsCurveInterface.I.

References NurbsCurveInterface::get_cv(), and INLINE.

bool NurbsCurveInterface::set_cv_point int  n,
float  x,
float  y,
float  z
[inline, inherited]
 

Repositions the indicated CV.

Returns true if successful, false otherwise.

Definition at line 70 of file nurbsCurveInterface.I.

Referenced by NurbsCurveInterface::append_cv().

bool NurbsCurveInterface::set_cv_weight int  n,
float  w
[inherited]
 

Sets the weight of the indicated CV without affecting its position in 3-d space.

Definition at line 39 of file nurbsCurveInterface.cxx.

void PandaNode::set_draw_mask DrawMask  mask  )  [inline, inherited]
 

Sets the hide/show bits of this particular node.

During the cull traversal, a node is not visited if none of its draw mask bits intersect with the camera's draw mask bits. These masks can be used to selectively hide and show different parts of the scene graph from different cameras that are otherwise viewing the same scene. See Camera::set_camera_mask().

Definition at line 922 of file pandaNode.I.

Referenced by CollisionNode::CollisionNode(), NodePath::get_z(), NodePath::heads_up(), EggLoader::make_node(), and NodePath::set_pos().

void PandaNode::set_effect const RenderEffect effect  )  [inline, inherited]
 

Adds the indicated render effect to the scene graph on this node.

If there was already an effect of the same type, it is replaced.

Definition at line 648 of file pandaNode.I.

References PandaNode::_cycler, INLINE, TransformState::make_identity(), BoundedObject::mark_bound_stale(), and PandaNode::transform_changed().

Referenced by NodePath::get_fog(), and NodePath::has_fog().

void PandaNode::set_effects const RenderEffects effects  )  [inline, inherited]
 

Sets the complete RenderEffects that will be applied this node.

This completely replaces whatever has been set on this node via repeated calls to set_attrib().

Definition at line 789 of file pandaNode.I.

References PandaNode::_cycler, and INLINE.

void BoundedObject::set_final bool  flag  )  [inline, inherited]
 

Sets the "final" flag on this BoundedObject.

If this is true, than no bounding volume need be tested below it; a positive intersection with this bounding volume is deemed to be a positive intersection with all geometry inside.

This is useful to quickly force a larger bounding volume around a node when the GeomNodes themselves are inaccurate for some reason, without forcing a recompute of every nested bounding volume. It's also helpful when the bounding volume is tricked by some special properties, like billboards, that may move geometry out of its bounding volume otherwise.

Definition at line 256 of file boundedObject.I.

bool ClassicNurbsCurve::set_knot int  n,
float  t
[virtual]
 

Sets the value of the indicated knot.

There are get_num_cvs() + _order knot values, but the first _order - 1 and the last 1 knot values cannot be changed. It is also an error to set a knot value outside the range of its neighbors.

Implements NurbsCurveInterface.

Definition at line 332 of file classicNurbsCurve.cxx.

References PiecewiseCurve::_segs.

Referenced by ClassicNurbsCurve(), and CurveFitter::make_hermite().

void Namable::set_name const string &  name  )  [inline, inherited]
 

Definition at line 69 of file namable.I.

References Namable::_name.

Referenced by BuilderBucket::BuilderBucket(), SceneGraphReducer::do_flatten_siblings(), Texture::read(), PandaNode::reparent(), and Texture::Texture().

void ParametricCurve::set_num_dimensions int  num  )  [inherited]
 

Specifies the number of significant dimensions in the curve's vertices.

This should be one of 1, 2, or 3. Normally, XYZ and HPR curves have three dimensions; time curves should always have one dimension. This only serves as a hint to the mopath editor, and also controls how the curve is written out.

Definition at line 232 of file parametricCurve.cxx.

void ClassicNurbsCurve::set_order int  order  )  [virtual]
 

Changes the order of the curve.

Must be a value from 1 to 4. Can only be done when there are no cv's.

Implements NurbsCurveInterface.

Definition at line 129 of file classicNurbsCurve.cxx.

References _cvs.

void PandaNode::set_state const RenderState state  )  [inline, inherited]
 

Sets the complete RenderState that will be applied to all nodes at this level and below.

(The actual state that will be applied to lower nodes is based on the composition of RenderStates from above this node as well). This completely replaces whatever has been set on this node via repeated calls to set_attrib().

Definition at line 727 of file pandaNode.I.

Referenced by NodePath::get_key(), and GeomParticleRenderer::kill_particle().

bool PiecewiseCurve::set_tlength int  ti,
float  tlength
[inherited]
 

Sets the parametric length of the given segment of the curve.

The length of the following segment is lengthened by the corresponding amount to keep the overall length of the curve the same.

Definition at line 462 of file piecewiseCurve.cxx.

References PiecewiseCurve::_last_ti, PiecewiseCurve::_segs, and t.

void PandaNode::set_transform const TransformState transform  )  [inline, inherited]
 

Sets the transform that will be applied to this node and below.

This defines a new coordinate space at this point in the scene graph and below.

Definition at line 837 of file pandaNode.I.

Referenced by NodePath::get_child().

void PandaNode::set_velocity const LVector3f &  vel  )  [virtual, inherited]
 

Indicates the instantaneous velocity of this node.

This function is meaningless to most kinds of nodes; it is implemented only for CollisionNodes and is intended to inform the collision system of velocity.

It is defined at this level only as an abstract interface to allow setting the velocity of a collision node without having to link with, or know anything about, the collision system.

See CollisionNode::set_velocity().

Reimplemented in CollisionNode.

Definition at line 1674 of file pandaNode.cxx.

void PandaNode::stash_child int  child_index  )  [inherited]
 

Stashes the indicated child node.

This removes the child from the list of active children and puts it on a special list of stashed children. This child node no longer contributes to the bounding volume of the PandaNode, and is not visited in normal traversals. It is invisible and uncollidable. The child may later be restored by calling unstash_child().

Definition at line 1292 of file pandaNode.cxx.

References NULL.

bool PandaNode::stash_child PandaNode child_node  )  [inline, inherited]
 

Stashes the indicated child node.

This removes the child from the list of active children and puts it on a special list of stashed children. This child node no longer contributes to the bounding volume of the PandaNode, and is not visited in normal traversals. It is invisible and uncollidable. The child may later be restored by calling unstash_child().

This function returns true if the child node was successfully stashed, or false if it was not a child of the node in the first place (e.g. it was previously stashed).

Definition at line 446 of file pandaNode.I.

Referenced by PandaNode::get_parent().

void PandaNode::steal_children PandaNode other  )  [inherited]
 

Moves all the children from the other node onto this node.

Definition at line 1504 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::add_child(), PT, and PandaNode::r_copy_subgraph().

bool ClassicNurbsCurve::stitch const ParametricCurve a,
const ParametricCurve b
[virtual]
 

Regenerates this curve as one long curve: the first curve connected end-to-end with the second one.

Either a or b may be the same as 'this'.

Returns true if successful, false on failure or if the curve type does not support stitching.

Reimplemented from ParametricCurve.

Definition at line 510 of file classicNurbsCurve.cxx.

References _cvs, and get_knot().

void ReferenceCount::test_ref_count_integrity  )  const [inline, inherited]
 

Does some easy checks to make sure that the reference count isn't completely bogus.

Definition at line 328 of file referenceCount.I.

References INLINE.

Referenced by EggNode::determine_bin(), and ReferenceCount::~ReferenceCount().

void PandaNode::transform_changed  )  [protected, virtual, inherited]
 

Called after the node's transform has been changed for any reason, this just provides a hook so derived classes can do something special in this case.

Reimplemented in ActorNode.

Definition at line 1856 of file pandaNode.cxx.

References PandaNode::_cycler, PandaNode::get_num_parents(), PandaNode::get_top_component(), NULL, and PT.

Referenced by PandaNode::set_effect().

int ReferenceCount::unref  )  const [inline, inherited]
 

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic; plus, we don't have a virtual destructor anyway.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is the new reference count.

Definition at line 293 of file referenceCount.I.

References INLINE.

Referenced by RenderState::determine_bin_index(), and RenderEffects::determine_show_bounds().

void ParametricCurve::unregister_drawer ParametricCurveDrawer drawer  )  [inherited]
 

Removes a previously registered drawer from the list of automatically-refreshed drawers.

This is called automatically by the ParametricCurveDrawer.

Definition at line 823 of file parametricCurve.cxx.

Referenced by ParametricCurveCollection::write_egg().

void PandaNode::unstash_child int  stashed_index  )  [inherited]
 

Returns the indicated stashed node to normal child status.

This removes the child from the list of stashed children and puts it on the normal list of active children. This child node once again contributes to the bounding volume of the PandaNode, and will be visited in normal traversals. It is visible and collidable.

Definition at line 1336 of file pandaNode.cxx.

bool PandaNode::unstash_child PandaNode child_node  )  [inline, inherited]
 

Returns the indicated stashed node to normal child status.

This removes the child from the list of stashed children and puts it on the normal list of active children. This child node once again contributes to the bounding volume of the PandaNode, and will be visited in normal traversals. It is visible and collidable.

This function returns true if the child node was successfully stashed, or false if it was not a child of the node in the first place (e.g. it was previously stashed).

Definition at line 486 of file pandaNode.I.

References PandaNode::_cycler, and INLINE.

void ClassicNurbsCurve::write ostream &  out,
int  indent_level = 0
const [virtual]
 

Reimplemented from NurbsCurveInterface.

Definition at line 600 of file classicNurbsCurve.cxx.

References _order, PiecewiseCurve::fillin(), DatagramIterator::get_int8(), DatagramIterator::get_uint32(), and size_t.

void NurbsCurveInterface::write_cv ostream &  out,
int  n
const [inherited]
 

Definition at line 58 of file nurbsCurveInterface.cxx.

References NurbsCurveInterface::get_knot(), NurbsCurveInterface::get_num_knots(), and indent().

void ClassicNurbsCurve::write_datagram BamWriter manager,
Datagram me
[protected, virtual]
 

Function to write the important information in the particular object to a Datagram.

Reimplemented from PiecewiseCurve.

Definition at line 708 of file classicNurbsCurve.cxx.

bool ParametricCurve::write_egg ostream &  out,
const Filename filename,
CoordinateSystem  cs
[inherited]
 

Writes an egg description of the nurbs curve to the specified output stream.

Returns true if the file is successfully written.

Definition at line 513 of file parametricCurve.cxx.

bool ParametricCurve::write_egg Filename  filename,
CoordinateSystem  cs = CS_default
[inherited]
 

Writes an egg description of the nurbs curve to the specified output file.

Returns true if the file is successfully written.

Definition at line 488 of file parametricCurve.cxx.

References NULL.

void PandaNode::xform const LMatrix4f &  mat  )  [virtual, inherited]
 

Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so.

For most kinds of PandaNodes, this does nothing.

Reimplemented in CollisionNode, DirectionalLight, Fog, GeomNode, LensNode, LODNode, PlaneNode, PointLight, Spotlight, and PGItem.

Definition at line 707 of file pandaNode.cxx.

Referenced by DirectionalLight::DirectionalLight(), LensNode::LensNode(), PlaneNode::PlaneNode(), PointLight::PointLight(), and PandaNode::safe_to_transform().


Friends And Related Function Documentation

friend class PandaNode::Children [friend, inherited]
 

Reimplemented in GeomNode.

Definition at line 392 of file pandaNode.h.


Member Data Documentation

int ParametricCurve::_curve_type [protected, inherited]
 

Definition at line 155 of file parametricCurve.h.

Referenced by HermiteCurve::format_egg(), and ParametricCurve::is_valid().

pvector<CV> ClassicNurbsCurve::_cvs [protected]
 

Definition at line 140 of file classicNurbsCurve.h.

Referenced by append_cv_impl(), ClassicNurbsCurve(), convert_to_nurbs(), get_cv(), get_knot(), get_num_cvs(), get_num_knots(), insert_cv(), recompute(), remove_all_cvs(), remove_cv(), set_cv(), set_order(), and stitch().

BoundedObject PandaNode::_internal_bound [protected, inherited]
 

Definition at line 213 of file pandaNode.h.

Referenced by PandaNode::clear_state().

int PiecewiseCurve::_last_ti [protected, inherited]
 

Definition at line 104 of file piecewiseCurve.h.

Referenced by get_knot(), and PiecewiseCurve::set_tlength().

int ParametricCurve::_num_dimensions [protected, inherited]
 

Definition at line 156 of file parametricCurve.h.

Referenced by HermiteCurve::get_cv_out(), ParametricCurve::is_valid(), and ParametricCurve::set_curve_type().

int ClassicNurbsCurve::_order [protected]
 

Definition at line 130 of file classicNurbsCurve.h.

Referenced by ClassicNurbsCurve(), convert_to_nurbs(), get_cv(), get_knot(), insert_cv(), recompute(), remove_all_cvs(), set_cv(), write(), and ~ClassicNurbsCurve().

TypeHandle ClassicNurbsCurve::_orig_type_handle [static, private]
 

Definition at line 38 of file classicNurbsCurve.cxx.

pvector<Curveseg> PiecewiseCurve::_segs [protected, inherited]
 

Definition at line 103 of file piecewiseCurve.h.

Referenced by PiecewiseCurve::adjust_pt(), PiecewiseCurve::find_curve(), PiecewiseCurve::get_curveseg(), get_cv(), HermiteCurve::get_num_cvs(), PiecewiseCurve::get_num_segs(), PiecewiseCurve::get_tlength(), HermiteCurve::insert_cv(), PiecewiseCurve::is_valid(), PiecewiseCurve::rebuild_curveseg(), HermiteCurve::rebuild_curveseg(), PiecewiseCurve::remove_curveseg(), set_knot(), PiecewiseCurve::set_tlength(), and PiecewiseCurve::~PiecewiseCurve().

TypeHandle ClassicNurbsCurve::_type_handle [static, private]
 

Reimplemented from NurbsCurveInterface.

Definition at line 37 of file classicNurbsCurve.cxx.

TypedWritable *const TypedWritable::Null = (TypedWritable*)0L [static, inherited]
 

Definition at line 25 of file typedWritable.cxx.

Referenced by Child::complete_pointers(), Parent::complete_pointers(), Person::complete_pointers(), LoaderFileTypeBam::get_extension(), PartGroup::pick_channel_index(), BamReader::read_pointer(), and AnimGroup::write_datagram().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:48:21 2003 for Panda by doxygen1.3