60 #ifndef ACG_LINENODE_HH
61 #define ACG_LINENODE_HH
66 #include <ACG/Scenegraph/MaterialNode.hh>
67 #include "DrawModes.hh"
68 #include <ACG/GL/VertexDeclaration.hh>
75 namespace SceneGraph {
97 typedef std::vector<Vec3d> PointVector;
98 typedef PointVector::iterator PointIter;
99 typedef PointVector::const_iterator ConstPointIter;
100 typedef std::vector<ACG::Vec3uc> ColorVector;
101 typedef ColorVector::iterator ColorIter;
102 typedef ColorVector::const_iterator ConstColorIter;
103 typedef std::vector<Color4f> Color4fVector;
104 typedef Color4fVector::iterator Color4fIter;
105 typedef Color4fVector::const_iterator ConstColor4fIter;
115 std::string _name=
"<LineNode>" );
121 void set_line_mode(LineMode _mode);
131 void boundingBox(
Vec3d& _bbMin,
Vec3d& _bbMax);
162 void set_color(
const Vec4f& _c);
165 void add_point(
const Vec3d& _v);
168 void add_line(
const Vec3d& _v0,
const Vec3d& _v1);
174 void add_color(
const Color4f _c);
181 return (picking_line_width_ != std::numeric_limits<float>::infinity()) ? picking_line_width_ : line_width();
192 const PointVector&
points()
const {
return points_; }
199 ColorVector&
colors() {
return colors_; }
202 bool&
alwaysOnTop() { updateVBO_ =
true;
return draw_always_on_top; }
204 void updateVBO() { updateVBO_ =
true; };
208 typedef Vec3d value_type;
209 typedef Vec3d& reference;
210 typedef const Vec3d& const_reference;
223 void pick_vertices(
GLState& _state);
224 void pick_edges (
GLState& _state,
unsigned int _offset);
235 Color4fVector colors4f_;
239 bool draw_always_on_top;
250 std::string lineNodeName_;
259 #endif // ACG_LINENODE_HH defined
Add colors to mesh item (vertices/faces/edges)
void reserve_lines(unsigned int _n)
reserve mem for _n lines
Namespace providing different geometric functions concerning angles.
PickTarget
What target to use for picking.
const PointVector & points() const
return reference to point vector
void push_back(const Vec3d &_v)
STL conformance.
size_t n_points() const
number of points
void reserve_points(unsigned int _n)
reserve mem for _n points
Class to define the vertex input layout.
float picking_line_width_
float picking_line_width() const
get line width used by the picking renderer. Defaults to line_width().
bool & alwaysOnTop()
get and set always on top
void set_picking_line_width(float _width)
set line width used by the picking renderer
ColorVector & colors()
get and set color container
LineMode
Line mode: draw line segments (every 2 points) or ONE polyline.