#include <parametricCurveDrawer.h>
Inheritance diagram for ParametricCurveDrawer:
Public Member Functions | |
ParametricCurveDrawer () | |
virtual | ~ParametricCurveDrawer () |
void | set_curve (ParametricCurve *curve) |
Sets the drawer up to draw just the one curve. | |
void | set_curves (ParametricCurveCollection *curves) |
Sets the drawer up to draw the curves in the indicated collection. | |
void | clear_curves () |
Empties the list of curves the drawer will update. | |
ParametricCurveCollection * | get_curves () |
GeomNode * | get_geom_node () |
Returns a pointer to the drawer's GeomNode. | |
PointerTo< GeomNode > | detach_geom_node () |
Detaches the GeomNode from the drawer so that the drawing will remain after the death of the drawer. | |
void | set_num_segs (float num_segs) |
Specifies the number of line segments used to approximate the curve for each parametric unit. | |
float | get_num_segs () const |
Returns the number of line segments used to approximate the curve for each parametric unit. | |
void | set_num_ticks (float num_ticks) |
Specifies the number of time tick marks drawn for each unit of time. | |
float | get_num_ticks () const |
Returns the number of time tick marks per unit of time drawn. | |
void | set_color (float r, float g, float b) |
Specifies the color of the curve when it is drawn. | |
void | set_tick_color (float r, float g, float b) |
Specifies the color of the time tick marks drawn on the curve. | |
void | set_frame_accurate (bool frame_accurate) |
Specifies whether the curve drawn is to be frame-accurate. | |
bool | get_frame_accurate () const |
Returns whether the curve is drawn in frame-accurate mode. | |
virtual bool | draw () |
Creates a series of line segments that approximates the curve. | |
void | hide () |
Removes the lines that were created by a previous call to draw(). | |
void | set_tick_scale (float scale) |
Sets the visible size of the time tick marks or geometry. | |
float | get_tick_scale () const |
Returns the size of the time tick marks or geometry. | |
float | get_max_t () const |
void | redraw () |
Redraws the curve if it is currently visible. | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
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. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. | |
Protected Attributes | |
PointerTo< GeomNode > | _geom_node |
PointerTo< ParametricCurveCollection > | _curves |
bool | _frame_accurate |
Static Private Member Functions | |
void | get_tick_marks (const LVecBase3f &tangent, LVecBase3f &t1, LVecBase3f &t2) |
Given a tangent vector, computes two vectors at right angles to the tangent and to each other, suitable for drawing as tick marks. | |
Private Attributes | |
float | _num_segs |
LineSegs | _lines |
LineSegs | _ticks |
bool | _drawn |
float | _num_ticks |
float | _tick_scale |
Static Private Attributes | |
TypeHandle | _type_handle |
Definition at line 41 of file parametricCurveDrawer.h.
|
Definition at line 37 of file parametricCurveDrawer.cxx. References _drawn, _frame_accurate, _geom_node, and _num_ticks. |
|
Definition at line 56 of file parametricCurveDrawer.cxx. References PT, and set_curves(). |
|
Empties the list of curves the drawer will update. It will draw nothing. Definition at line 125 of file parametricCurveDrawer.cxx. References _geom_node. |
|
Detaches the GeomNode from the drawer so that the drawing will remain after the death of the drawer. Returns the now-static GeomNode. A new, dynamic GeomNode is created for the drawer's future use; get_geom_node() will return this new GeomNode which will be empty until the next call to draw(). Definition at line 189 of file parametricCurveDrawer.cxx. References _num_ticks, and redraw(). |
|
Creates a series of line segments that approximates the curve. These line segments may be made visible by parenting the node returned by get_geom_node() into the scene graph. Reimplemented in NurbsCurveDrawer. Definition at line 371 of file parametricCurveDrawer.cxx. References _drawn. Referenced by get_curves(). |
|
Implements TypedObject. Reimplemented in NurbsCurveDrawer. Definition at line 102 of file parametricCurveDrawer.h. |
|
Reimplemented from TypedObject. Reimplemented in NurbsCurveDrawer. Definition at line 92 of file parametricCurveDrawer.h. References TypedObject::get_class_type(). |
|
Definition at line 137 of file parametricCurveDrawer.cxx. References _drawn, _geom_node, draw(), and PT. |
|
Returns whether the curve is drawn in frame-accurate mode.
Definition at line 350 of file parametricCurveDrawer.cxx. References _ticks. |
|
Returns a pointer to the drawer's GeomNode. This is where the drawer will build the visible representation of the curve. This GeomNode must be inserted into the scene graph to make the curve visible. The GeomNode remains connected to the drawer, so that future updates to the drawer will reflect in the GeomNode, and the GeomNode will be emptied when the drawer destructs. Also see detach_geom_node(). Definition at line 165 of file parametricCurveDrawer.cxx. |
|
Definition at line 31 of file parametricCurveDrawer.I. |
|
Returns the number of line segments used to approximate the curve for each parametric unit. This just affects the visual appearance of the curve as it is drawn. The total number of segments drawn for the curve will be get_max_t() * get_num_segs(). Definition at line 239 of file parametricCurveDrawer.cxx. References _frame_accurate, and redraw(). |
|
Returns the number of time tick marks per unit of time drawn.
Definition at line 277 of file parametricCurveDrawer.cxx. |
|
Given a tangent vector, computes two vectors at right angles to the tangent and to each other, suitable for drawing as tick marks.
Definition at line 514 of file parametricCurveDrawer.cxx. Referenced by set_frame_accurate(). |
|
Returns the size of the time tick marks or geometry.
Definition at line 497 of file parametricCurveDrawer.cxx. |
|
Implements TypedObject. Reimplemented in NurbsCurveDrawer. Definition at line 99 of file parametricCurveDrawer.h. |
|
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. |
|
Removes the lines that were created by a previous call to draw().
Definition at line 465 of file parametricCurveDrawer.cxx. Referenced by get_num_ticks(). |
|
This function is declared non-inline to work around a compiler bug in g++ 2.96. Making it inline seems to cause problems in the optimizer. Reimplemented from TypedObject. Reimplemented in NurbsCurveDrawer. Definition at line 95 of file parametricCurveDrawer.h. References TypedObject::get_class_type(), and TypedObject::init_type(). |
|
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(). |
|
|
Redraws the curve if it is currently visible.
Definition at line 48 of file parametricCurveDrawer.I. Referenced by detach_geom_node(), get_geom_node(), get_num_segs(), NurbsCurveDrawer::get_show_cvs(), set_curve(), NurbsCurveDrawer::set_cv_color(), NurbsCurveDrawer::set_knot_color(), and NurbsCurveDrawer::~NurbsCurveDrawer(). |
|
Specifies the color of the curve when it is drawn. The default is white. Definition at line 294 of file parametricCurveDrawer.cxx. |
|
Sets the drawer up to draw just the one curve.
Definition at line 73 of file parametricCurveDrawer.cxx. |
|
Sets the drawer up to draw the curves in the indicated collection. The drawer will actually draw just the first XYZ curve in the collection, but if one or more timewarps are present, this will affect the placement of tick marks. Definition at line 96 of file parametricCurveDrawer.cxx. References NULL. Referenced by ~ParametricCurveDrawer(). |
|
Specifies whether the curve drawn is to be frame-accurate. If true, then changes made to the curve dynamically after it has been drawn will be reflected correctly in the render window. If false, dynamic updates may be drawn before the rest of the scene has updated. Definition at line 334 of file parametricCurveDrawer.cxx. References _curves, _tick_scale, _ticks, LineSegs::draw_to(), ParametricCurve::get_pt(), get_tick_marks(), LineSegs::move_to(), and t. |
|
Specifies the number of line segments used to approximate the curve for each parametric unit. This just affects the visual appearance of the curve as it is drawn. The total number of segments drawn for the curve will be get_max_t() * get_num_segs(). Definition at line 217 of file parametricCurveDrawer.cxx. References _lines, and LineSegs::set_color(). |
|
Specifies the number of time tick marks drawn for each unit of time. These tick marks are drawn at equal increments in time to give a visual approximation of speed. Specify 0 to disable drawing of tick marks. Definition at line 261 of file parametricCurveDrawer.cxx. References _frame_accurate. |
|
Specifies the color of the time tick marks drawn on the curve. The default is red. Definition at line 310 of file parametricCurveDrawer.cxx. References _lines, LineSegs::draw_to(), ParametricCurve::get_point(), LineSegs::move_to(), and t. |
|
Sets the visible size of the time tick marks or geometry.
Definition at line 482 of file parametricCurveDrawer.cxx. |
|
Definition at line 81 of file parametricCurveDrawer.h. Referenced by get_num_ticks(), set_color(), set_curve(), and set_frame_accurate(). |
|
Definition at line 87 of file parametricCurveDrawer.h. Referenced by draw(), get_curves(), get_num_ticks(), and ParametricCurveDrawer(). |
|
Definition at line 82 of file parametricCurveDrawer.h. Referenced by get_num_segs(), ParametricCurveDrawer(), and set_num_ticks(). |
|
Definition at line 80 of file parametricCurveDrawer.h. Referenced by clear_curves(), get_curves(), and ParametricCurveDrawer(). |
|
Definition at line 86 of file parametricCurveDrawer.h. Referenced by set_num_segs(), and set_tick_color(). |
|
Definition at line 85 of file parametricCurveDrawer.h. Referenced by get_geom_node(), and set_color(). |
|
Definition at line 88 of file parametricCurveDrawer.h. Referenced by detach_geom_node(), and ParametricCurveDrawer(). |
|
Definition at line 89 of file parametricCurveDrawer.h. Referenced by set_frame_accurate(). |
|
Definition at line 86 of file parametricCurveDrawer.h. Referenced by get_frame_accurate(), and set_frame_accurate(). |
|
Reimplemented from TypedObject. Reimplemented in NurbsCurveDrawer. Definition at line 27 of file parametricCurveDrawer.cxx. |