33class EXPCL_PANDA_GRUTIL
LineSegs :
public Namable {
35 explicit LineSegs(
const std::string &name =
"lines");
39 INLINE
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0f);
40 INLINE
void set_color(
const LColor &color);
43 INLINE
void move_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
44 void move_to(
const LVecBase3 &v);
46 INLINE
void draw_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
47 void draw_to(
const LVecBase3 &v);
60 INLINE
void set_vertex(
int vertex, PN_stdfloat x, PN_stdfloat y, PN_stdfloat z);
65 INLINE
void set_vertex_color(
int vertex, PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a = 1.0f);
71 INLINE Point(
const LVecBase3 &point,
const LColor &color);
72 INLINE Point(
const Point ©);
73 INLINE
void operator = (
const Point ©);
76 UnalignedLVecBase4 _color;
79 typedef pvector<Point> SegmentList;
80 typedef pvector<SegmentList> LineList;
A node that holds Geom objects, renderable pieces of geometry.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
LineSegs(const std::string &name="lines")
Constructs a LineSegs object, which can be used to create any number of disconnected lines or points ...
void set_thickness(PN_stdfloat thick)
Establishes the line thickness or point size in pixels that will be assigned to all lines and points ...
void draw_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Draws a line segment from the pen's last position (the last call to move_to or draw_to) to the indica...
get_vertex_color
Returns the color of the nth point or vertex.
void reset()
Removes any lines in progress and resets to the initial empty state.
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b, PN_stdfloat a=1.0f)
Establishes the color that will be assigned to all vertices created by future calls to move_to() and ...
get_num_vertices
Returns the total number of line segment and point vertices generated by the last call to create().
GeomNode * create(bool dynamic=false)
Creates a new GeomNode that will render the series of line segments and points described via calls to...
void set_vertex(int n, const LVertex &vert)
Moves the nth point or vertex of the line segment sequence generated by the last call to create().
bool is_empty()
Returns true if move_to() or draw_to() have not been called since the last reset() or create(),...
void set_vertex_color(int vertex, const LColor &c)
Changes the vertex color of the nth point or vertex.
get_vertex
Returns the nth point or vertex of the line segment sequence generated by the last call to create().
void move_to(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z)
Moves the pen to the given point without drawing a line.
const LVertex & get_current_position()
Returns the pen's current position.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.