#include <nurbsCurveDrawer.h>
Inheritance diagram for NurbsCurveDrawer:
Public Member Functions | |
NurbsCurveDrawer () | |
virtual | ~NurbsCurveDrawer () |
void | set_cv_color (float r, float g, float b) |
Specifies the color of the CV's. | |
void | set_hull_color (float r, float g, float b) |
Specifies the color of the convex hull. | |
void | set_knot_color (float r, float g, float b) |
Specifies the color of the knots. | |
virtual bool | draw () |
Creates a series of line segments that approximates the curve. | |
virtual bool | recompute (float t1, float t2, ParametricCurve *curve=NULL) |
void | set_show_cvs (bool flag) |
Sets the flag that hides or shows the CV's. | |
bool | get_show_cvs () const |
Returns the current state of the show-CV's flag. | |
void | set_show_hull (bool flag) |
Sets the flag that hides or shows the convex hull. | |
bool | get_show_hull () const |
Returns the current state of the show-hull flag. | |
void | set_show_knots (bool flag) |
Sets the flag that hides or shows the knots. | |
bool | get_show_knots () const |
Returns the current state of the show-knots flag. | |
bool | hilight (int n) |
Hilights a particular CV by showing it and its knot in a different color. | |
bool | hilight (int n, float hr, float hg, float hb) |
Hilights a particular CV by showing it and its knot in a different color. | |
bool | unhilight (int n) |
Removes the hilight previously set on a CV. | |
virtual TypeHandle | get_type () const |
virtual TypeHandle | force_init_type () |
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. | |
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. | |
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 | |
LVecBase3f | _cv_color |
LVecBase3f | _hull_color |
LVecBase3f | _knot_color |
int | _num_cvs |
int | _num_hull |
int | _num_knots |
LineSegs | _hull |
LineSegs | _knots |
LineSegs | _cvs |
pvector< int > | _knotnums |
bool | _show_cvs |
bool | _show_hull |
bool | _show_knots |
PointerTo< GeomNode > | _geom_node |
PointerTo< ParametricCurveCollection > | _curves |
bool | _frame_accurate |
Static Private Attributes | |
TypeHandle | _type_handle |
Definition at line 40 of file nurbsCurveDrawer.h.
|
Definition at line 38 of file nurbsCurveDrawer.cxx. References _cvs, _hull, _knots, _show_cvs, _show_hull, and _show_knots. |
|
Definition at line 61 of file nurbsCurveDrawer.cxx. References _cv_color, _cvs, ParametricCurveDrawer::redraw(), and LineSegs::set_color(). |
|
Empties the list of curves the drawer will update. It will draw nothing. Definition at line 125 of file parametricCurveDrawer.cxx. References ParametricCurveDrawer::_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 ParametricCurveDrawer::_num_ticks, and ParametricCurveDrawer::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 from ParametricCurveDrawer. Definition at line 124 of file nurbsCurveDrawer.cxx. |
|
Reimplemented from ParametricCurveDrawer. Definition at line 84 of file nurbsCurveDrawer.h. |
|
Reimplemented from ParametricCurveDrawer. Definition at line 73 of file nurbsCurveDrawer.h. |
|
Definition at line 137 of file parametricCurveDrawer.cxx. References ParametricCurveDrawer::_drawn, ParametricCurveDrawer::_geom_node, ParametricCurveDrawer::draw(), and PT. |
|
Returns whether the curve is drawn in frame-accurate mode.
Definition at line 350 of file parametricCurveDrawer.cxx. References ParametricCurveDrawer::_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. References ParametricCurveDrawer::_num_segs, and ParametricCurveDrawer::redraw(). |
|
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 ParametricCurveDrawer::_frame_accurate, and ParametricCurveDrawer::redraw(). |
|
Returns the number of time tick marks per unit of time drawn.
Definition at line 277 of file parametricCurveDrawer.cxx. References ParametricCurveDrawer::_curves, ParametricCurveDrawer::_drawn, ParametricCurveDrawer::hide(), and NULL. |
|
Returns the current state of the show-CV's flag.
Definition at line 227 of file nurbsCurveDrawer.cxx. References _show_knots, and ParametricCurveDrawer::redraw(). |
|
Returns the current state of the show-hull flag.
Definition at line 254 of file nurbsCurveDrawer.cxx. References _cvs, _knotnums, _knots, LineSegs::get_num_vertices(), nassertr, and LineSegs::set_vertex_color(). |
|
Returns the current state of the show-knots flag.
Definition at line 281 of file nurbsCurveDrawer.cxx. References _cvs. |
|
Returns the size of the time tick marks or geometry.
Definition at line 497 of file parametricCurveDrawer.cxx. |
|
Reimplemented from ParametricCurveDrawer. Definition at line 81 of file nurbsCurveDrawer.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 ParametricCurveDrawer::get_num_ticks(). |
|
Hilights a particular CV by showing it and its knot in a different color. Returns true if the CV exists and has been drawn, false otherwise. Definition at line 299 of file nurbsCurveDrawer.cxx. |
|
Hilights a particular CV by showing it and its knot in a different color. Returns true if the CV exists and has been drawn, false otherwise. Definition at line 36 of file nurbsCurveDrawer.I. |
|
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 ParametricCurveDrawer. Definition at line 76 of file nurbsCurveDrawer.h. |
|
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(). |
|
|
Definition at line 199 of file nurbsCurveDrawer.cxx. References _show_cvs. |
|
Redraws the curve if it is currently visible.
Definition at line 48 of file parametricCurveDrawer.I. Referenced by ParametricCurveDrawer::detach_geom_node(), ParametricCurveDrawer::get_geom_node(), ParametricCurveDrawer::get_num_segs(), get_show_cvs(), ParametricCurveDrawer::set_curve(), set_cv_color(), set_knot_color(), and ~NurbsCurveDrawer(). |
|
Specifies the color of the curve when it is drawn. The default is white. Definition at line 294 of file parametricCurveDrawer.cxx. References ParametricCurveDrawer::_curves, ParametricCurveDrawer::_num_segs, and t. |
|
Sets the drawer up to draw just the one curve.
Definition at line 73 of file parametricCurveDrawer.cxx. References ParametricCurveDrawer::_curves, NULL, and ParametricCurveDrawer::redraw(). |
|
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::~ParametricCurveDrawer(). |
|
Specifies the color of the CV's.
Definition at line 75 of file nurbsCurveDrawer.cxx. References _knot_color, _knots, ParametricCurveDrawer::redraw(), and LineSegs::set_color(). |
|
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 ParametricCurveDrawer::_curves, ParametricCurveDrawer::_tick_scale, ParametricCurveDrawer::_ticks, LineSegs::draw_to(), ParametricCurve::get_pt(), ParametricCurveDrawer::get_tick_marks(), LineSegs::move_to(), and t. |
|
Specifies the color of the convex hull.
Definition at line 107 of file nurbsCurveDrawer.cxx. |
|
Specifies the color of the knots.
Definition at line 91 of file nurbsCurveDrawer.cxx. References _hull, _hull_color, ParametricCurveDrawer::redraw(), and LineSegs::set_color(). |
|
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 ParametricCurveDrawer::_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 ParametricCurveDrawer::_frame_accurate. |
|
Sets the flag that hides or shows the CV's.
Definition at line 213 of file nurbsCurveDrawer.cxx. |
|
Sets the flag that hides or shows the convex hull.
Definition at line 240 of file nurbsCurveDrawer.cxx. References _show_knots. |
|
Sets the flag that hides or shows the knots.
Definition at line 267 of file nurbsCurveDrawer.cxx. References _knots. |
|
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 ParametricCurveDrawer::_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. |
|
Removes the hilight previously set on a CV.
Definition at line 326 of file nurbsCurveDrawer.cxx. |
|
Definition at line 81 of file parametricCurveDrawer.h. Referenced by ParametricCurveDrawer::get_num_ticks(), ParametricCurveDrawer::set_color(), ParametricCurveDrawer::set_curve(), and ParametricCurveDrawer::set_frame_accurate(). |
|
Definition at line 64 of file nurbsCurveDrawer.h. Referenced by ~NurbsCurveDrawer(). |
|
Definition at line 66 of file nurbsCurveDrawer.h. Referenced by get_show_hull(), get_show_knots(), NurbsCurveDrawer(), and ~NurbsCurveDrawer(). |
|
Definition at line 82 of file parametricCurveDrawer.h. Referenced by ParametricCurveDrawer::get_num_segs(), ParametricCurveDrawer::ParametricCurveDrawer(), and ParametricCurveDrawer::set_num_ticks(). |
|
Definition at line 80 of file parametricCurveDrawer.h. Referenced by ParametricCurveDrawer::clear_curves(), ParametricCurveDrawer::get_curves(), and ParametricCurveDrawer::ParametricCurveDrawer(). |
|
Definition at line 66 of file nurbsCurveDrawer.h. Referenced by NurbsCurveDrawer(), and set_knot_color(). |
|
Definition at line 64 of file nurbsCurveDrawer.h. Referenced by set_knot_color(). |
|
Definition at line 64 of file nurbsCurveDrawer.h. Referenced by set_cv_color(). |
|
Definition at line 67 of file nurbsCurveDrawer.h. Referenced by get_show_hull(). |
|
Definition at line 66 of file nurbsCurveDrawer.h. Referenced by get_show_hull(), NurbsCurveDrawer(), set_cv_color(), and set_show_knots(). |
|
Definition at line 65 of file nurbsCurveDrawer.h. |
|
Definition at line 65 of file nurbsCurveDrawer.h. |
|
Definition at line 65 of file nurbsCurveDrawer.h. |
|
Definition at line 69 of file nurbsCurveDrawer.h. Referenced by NurbsCurveDrawer(), and recompute(). |
|
Definition at line 69 of file nurbsCurveDrawer.h. Referenced by NurbsCurveDrawer(). |
|
Definition at line 69 of file nurbsCurveDrawer.h. Referenced by get_show_cvs(), NurbsCurveDrawer(), and set_show_hull(). |
|
Reimplemented from ParametricCurveDrawer. Definition at line 27 of file nurbsCurveDrawer.cxx. |