LineSegs
from panda3d.core import LineSegs
- class LineSegs
Bases:
Namable
Encapsulates creation of a series of connected or disconnected line segments or points, for drawing paths or rays. This class doesn’t attempt to be the smartest it could possibly be; it’s intended primarily as a visualization and editing tool.
Inheritance diagram
- __init__(*args, **kwargs)
- create()
C++ Interface: create(const LineSegs self) create(const LineSegs self, GeomNode previous, bool dynamic) create(const LineSegs self, bool dynamic)
- /**
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_thickness().
If dynamic is true, the line segments will be created with the dynamic Geom
setting, optimizing them for runtime vertex animation.
*/
- /**
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_thickness().
If dynamic is true, the line segments will be created with the dynamic Geom
setting, optimizing them for runtime vertex animation.
*/
- drawTo()
C++ Interface: draw_to(const LineSegs self, const LVecBase3f v) draw_to(const LineSegs self, 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. move_to() and draw_to() only update
tables; the actual drawing is performed when create() is called.
*/
- /**
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.
*/
- draw_to()
C++ Interface: draw_to(const LineSegs self, const LVecBase3f v) draw_to(const LineSegs self, 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. move_to() and draw_to() only update
tables; the actual drawing is performed when create() is called.
*/
- /**
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.
*/
- getCurrentPosition()
C++ Interface: get_current_position(const LineSegs self)
- /**
Returns the pen’s current position. The next call to draw_to() will draw a
line segment from this point.
*/
- getNumVertices()
C++ Interface: get_num_vertices(LineSegs self)
// Functions to move the line vertices after they have been created.
// Functions to move the line vertices after they have been created.
// Functions to move the line vertices after they have been created.
- /**
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().
*/
- getVertex()
C++ Interface: get_vertex(LineSegs self, int n)
- /**
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.
*/
- getVertexColor()
C++ Interface: get_vertex_color(LineSegs self, int vertex)
- /**
Returns the color of the nth point or vertex.
*/
- getVertexColors()
- getVertices()
- get_current_position()
C++ Interface: get_current_position(const LineSegs self)
- /**
Returns the pen’s current position. The next call to draw_to() will draw a
line segment from this point.
*/
- get_num_vertices()
C++ Interface: get_num_vertices(LineSegs self)
// Functions to move the line vertices after they have been created.
// Functions to move the line vertices after they have been created.
// Functions to move the line vertices after they have been created.
- /**
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().
*/
- get_vertex()
C++ Interface: get_vertex(LineSegs self, int n)
- /**
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.
*/
- get_vertex_color()
C++ Interface: get_vertex_color(LineSegs self, int vertex)
- /**
Returns the color of the nth point or vertex.
*/
- get_vertex_colors()
- get_vertices()
- isEmpty()
C++ Interface: is_empty(const LineSegs self)
- /**
Returns true if move_to() or draw_to() have not been called since the last
reset() or create(), false otherwise.
*/
- is_empty()
C++ Interface: is_empty(const LineSegs self)
- /**
Returns true if move_to() or draw_to() have not been called since the last
reset() or create(), false otherwise.
*/
- moveTo()
C++ Interface: move_to(const LineSegs self, const LVecBase3f v) move_to(const LineSegs self, float x, float y, float z)
- /**
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.
*/
- /**
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.
*/
- move_to()
C++ Interface: move_to(const LineSegs self, const LVecBase3f v) move_to(const LineSegs self, float x, float y, float z)
- /**
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.
*/
- /**
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.
*/
- reset()
C++ Interface: reset(const LineSegs self)
- /**
Removes any lines in progress and resets to the initial empty state.
*/
- setColor()
C++ Interface: set_color(const LineSegs self, const LVecBase4f color) set_color(const LineSegs self, float r, float g, float b, float a)
- setThickness()
C++ Interface: set_thickness(const LineSegs self, 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().
*/
- setVertex()
C++ Interface: set_vertex(const LineSegs self, int n, const LPoint3f vert) set_vertex(const LineSegs self, 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(). The first move_to() generates vertex 0; subsequent
move_to() and draw_to() calls generate consecutively higher vertex numbers.
*/
- /**
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.
*/
- setVertexColor()
C++ Interface: set_vertex_color(const LineSegs self, int vertex, const LVecBase4f c) set_vertex_color(const LineSegs self, int vertex, float r, float g, float b, float a)
- set_color()
C++ Interface: set_color(const LineSegs self, const LVecBase4f color) set_color(const LineSegs self, float r, float g, float b, float a)
- set_thickness()
C++ Interface: set_thickness(const LineSegs self, 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().
*/
- set_vertex()
C++ Interface: set_vertex(const LineSegs self, int n, const LPoint3f vert) set_vertex(const LineSegs self, 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(). The first move_to() generates vertex 0; subsequent
move_to() and draw_to() calls generate consecutively higher vertex numbers.
*/
- /**
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.
*/
- set_vertex_color()
C++ Interface: set_vertex_color(const LineSegs self, int vertex, const LVecBase4f c) set_vertex_color(const LineSegs self, int vertex, float r, float g, float b, float a)