#include <lineSegs.h>
Inheritance diagram for LineSegs:
Public Member Functions | |
LineSegs (const string &name="lines") | |
Constructs a LineSegs object, which can be used to create any number of disconnected lines or points of various thicknesses and colors through the visible scene. | |
~LineSegs () | |
void | reset () |
Removes any lines in progress and resets to the initial empty state. | |
void | set_color (float r, float g, float b, float a=1.0f) |
Establishes the color that will be assigned to all vertices created by future calls to move_to() and draw_to(). | |
void | set_color (const Colorf &color) |
Establishes the color that will be assigned to all vertices created by future calls to move_to() and draw_to(). | |
void | set_thickness (float thick) |
Establishes the line thickness or point size in pixels that will be assigned to all lines and points created by future calls to create(). | |
void | move_to (float x, float y, float z) |
Moves the pen to the given point without drawing a line. | |
void | move_to (const LVecBase3f &v) |
Moves the pen to the given point without drawing a line. | |
void | draw_to (float x, float y, float z) |
Draws a line segment from the pen's last position (the last call to move_to or draw_to) to the indicated point. | |
void | draw_to (const LVecBase3f &v) |
Draws a line segment from the pen's last position (the last call to move_to or draw_to) to the indicated point. | |
const Vertexf & | get_current_position () |
Returns the pen's current position. | |
bool | is_empty () |
Returns true if move_to() or draw_to() have not been called since the last reset() or create(), false otherwise. | |
GeomNode * | create (bool frame_accurate=false) |
Creates a new GeomNode that will render the series of line segments and points described via calls to move_to() and draw_to(). | |
GeomNode * | create (GeomNode *previous, bool frame_accurate=false) |
Appends to an existing GeomNode a new Geom that will render the series of line segments and points described via calls to move_to() and draw_to(). | |
int | get_num_vertices () const |
Returns the total number of line segment and point vertices generated by the last call to create(). | |
Vertexf | get_vertex (int vertex) const |
Returns the nth point or vertex of the line segment sequence generated by the last call to create(). | |
void | set_vertex (int vertex, const Vertexf &vert) |
Moves the nth point or vertex of the line segment sequence generated by the last call to create(). | |
void | set_vertex (int vertex, float x, float y, float z) |
Moves the nth point or vertex of the line segment sequence generated by the last call to create(). | |
Colorf | get_vertex_color (int vertex) const |
Returns the color of the nth point or vertex/. | |
void | set_vertex_color (int vertex, const Colorf &color) |
Changes the vertex color of the nth point or vertex. | |
void | set_vertex_color (int vertex, float r, float g, float b, float a=1.0f) |
Changes the vertex color of the nth point or vertex. | |
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 |
void | output (ostream &out) const |
Outputs the Namable. | |
Static Public Member Functions | |
TypeHandle | get_class_type () |
void | init_type () |
Private Types | |
typedef pvector< Point > | SegmentList |
typedef pvector< SegmentList > | LineList |
Private Attributes | |
LineList | _list |
Colorf | _color |
float | _thick |
PTA_Vertexf | _created_verts |
PTA_Colorf | _created_colors |
This class doesn't attempt to be the smartest it could possibly be; it's intended primarily as a visualization and editing tool.
Definition at line 52 of file lineSegs.h.
|
Definition at line 98 of file lineSegs.h. |
|
Definition at line 97 of file lineSegs.h. |
|
Constructs a LineSegs object, which can be used to create any number of disconnected lines or points of various thicknesses and colors through the visible scene. After creating the object, call move_to() and draw_to() repeatedly to describe the path, then call create() to create a GeomNode which will render the described path. Definition at line 45 of file lineSegs.cxx. |
|
Definition at line 58 of file lineSegs.cxx. References _color. |
|
Resets the Namable's name to empty.
Definition at line 82 of file namable.I. References Namable::_name, and INLINE. |
|
Appends to an existing GeomNode a new Geom that will render the series of line segments and points described via calls to move_to() and draw_to(). The lines and points are created with the color and thickness established by calls to set_color() and set_thick(). If frame_accurate is true, the line segments will be created as a frame-accurate index, so that later calls to set_vertex or set_vertex_color will be visually correct. Definition at line 200 of file lineSegs.cxx. |
|
Creates a new GeomNode that will render the series of line segments and points described via calls to move_to() and draw_to(). The lines and points are created with the color and thickness established by calls to set_color() and set_thick(). If frame_accurate is true, the line segments will be created as a frame-accurate index, so that later calls to set_vertex or set_vertex_color will be visually correct. Definition at line 193 of file lineSegs.I. References INLINE, set_vertex(), Vertexf, x, and y. Referenced by move_to(). |
|
Draws a line segment from the pen's last position (the last call to move_to or draw_to) to the indicated point. move_to() and draw_to() only update tables; the actual drawing is performed when create() is called. Definition at line 119 of file lineSegs.cxx. |
|
Draws a line segment from the pen's last position (the last call to move_to or draw_to) to the indicated point. move_to() and draw_to() only update tables; the actual drawing is performed when create() is called. Definition at line 162 of file lineSegs.I. References _created_verts, INLINE, nassertr, PointerToArray< Vertexf >::size(), and Vertexf. Referenced by ParametricCurveDrawer::set_frame_accurate(), set_thickness(), and ParametricCurveDrawer::set_tick_color(). |
|
|
Returns the pen's current position. The next call to draw_to() will draw a line segment from this point. Definition at line 162 of file lineSegs.cxx. References _list. |
|
|
Returns the total number of line segment and point vertices generated by the last call to create(). The positions of these vertices may be read and adjusted through get_vertex() and set_vertex(). Definition at line 213 of file lineSegs.I. References _created_colors. Referenced by NurbsCurveDrawer::get_show_hull(). |
|
Returns the nth point or vertex of the line segment sequence generated by the last call to create(). The first move_to() generates vertex 0; subsequent move_to() and draw_to() calls generate consecutively higher vertex numbers. Definition at line 234 of file lineSegs.I. References Colorf, INLINE, and set_vertex_color(). |
|
Returns the color of the nth point or vertex/.
Definition at line 292 of file lineSegs.I. |
|
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(). |
|
|
Returns true if move_to() or draw_to() have not been called since the last reset() or create(), false otherwise.
Definition at line 147 of file lineSegs.cxx. References _created_colors, _created_verts, _list, PointerToArray< Colorf >::clear(), and PointerToArray< Vertexf >::clear(). |
|
Moves the pen to the given point without drawing a line. When followed by draw_to(), this marks the first point of a line segment; when followed by move_to() or create(), this creates a single point. Definition at line 93 of file lineSegs.cxx. |
|
Moves the pen to the given point without drawing a line. When followed by draw_to(), this marks the first point of a line segment; when followed by move_to() or create(), this creates a single point. Definition at line 141 of file lineSegs.I. References create(), Namable::get_name(), and INLINE. Referenced by draw_to(), set_color(), ParametricCurveDrawer::set_frame_accurate(), and ParametricCurveDrawer::set_tick_color(). |
|
Outputs the Namable. This function simply writes the name to the output stream; most Namable derivatives will probably redefine this. Reimplemented in BuilderBucket, AnimBundle, AnimChannelBase, AnimChannelFixed< SwitchType >, AnimGroup, PartBundle, CollisionNode, ButtonNode, HermiteCurve, RopeNode, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, PandaNode, PlaneNode, MouseWatcher, and MouseWatcherRegion. |
|
Removes any lines in progress and resets to the initial empty state.
Definition at line 73 of file lineSegs.cxx. References _list. |
|
Establishes the color that will be assigned to all vertices created by future calls to move_to() and draw_to().
Definition at line 105 of file lineSegs.I. |
|
Establishes the color that will be assigned to all vertices created by future calls to move_to() and draw_to().
Definition at line 88 of file lineSegs.I. References _thick, and INLINE. Referenced by NurbsCurveDrawer::set_cv_color(), NurbsCurveDrawer::set_knot_color(), ParametricCurveDrawer::set_num_segs(), and NurbsCurveDrawer::~NurbsCurveDrawer(). |
|
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(). |
|
Establishes the line thickness or point size in pixels that will be assigned to all lines and points created by future calls to create().
Definition at line 122 of file lineSegs.I. |
|
Moves the nth point or vertex of the line segment sequence generated by the last call to create(). The first move_to() generates vertex 0; subsequent move_to() and draw_to() calls generate consecutively higher vertex numbers. Definition at line 279 of file lineSegs.I. |
|
Moves the nth point or vertex of the line segment sequence generated by the last call to create(). The first move_to() generates vertex 0; subsequent move_to() and draw_to() calls generate consecutively higher vertex numbers. Definition at line 257 of file lineSegs.I. Referenced by create(). |
|
Changes the vertex color of the nth point or vertex. See set_vertex(). Definition at line 325 of file lineSegs.I. |
|
Changes the vertex color of the nth point or vertex. See set_vertex(). Definition at line 309 of file lineSegs.I. Referenced by NurbsCurveDrawer::get_show_hull(), and get_vertex(). |
|
Definition at line 101 of file lineSegs.h. Referenced by LineSegs::Point::Point(), and ~LineSegs(). |
|
Definition at line 105 of file lineSegs.h. Referenced by get_num_vertices(), and is_empty(). |
|
Definition at line 104 of file lineSegs.h. Referenced by draw_to(), and is_empty(). |
|
Definition at line 100 of file lineSegs.h. Referenced by draw_to(), get_current_position(), is_empty(), and reset(). |
|
Definition at line 102 of file lineSegs.h. Referenced by set_color(). |