56#ifndef ACG_POLYLINENODET_HH
57#define ACG_POLYLINENODET_HH
62#include <ACG/Scenegraph/BaseNode.hh>
63#include <ACG/Scenegraph/DrawModes.hh>
64#include <ACG/GL/VertexDeclaration.hh>
65#include <ACG/GL/IRenderer.hh>
66#include <ACG/GL/GLPrimitives.hh>
67#include <ACG/GL/globjects.hh>
88template <
class PolyLine>
94 typedef typename PolyLine::Point Point;
199 size_t fillVertexBuffer(
void* _buf,
size_t _bufSize,
bool _addLineStripEndVertex);
203 void pick_vertices (
GLState& _state );
204 void pick_spheres (
GLState& _state );
205 void pick_spheres_screen (
GLState& _state );
206 void pick_edges (
GLState& _state,
unsigned int _offset);
241 void writeVertex(
unsigned int _vertex,
void* _dst);
249 void writeVertexColor(
unsigned int _vertex,
bool _colorSourceVertex,
void* _dst)
const;
283#if defined(INCLUDE_TEMPLATES) && !defined(ACG_POLYLINENODET_C)
284#define ACG_POLYLINENODET_TEMPLATES
285#include "PolyLineNodeT_impl.hh"
ACG::VertexDeclaration vertexDecl_
Vertex layout without vertex colors.
void getRenderObjects(ACG::IRenderer *_renderer, ACG::GLState &_state, const ACG::SceneGraph::DrawModes::DrawMode &_drawMode, const ACG::SceneGraph::Material *_mat) override
Add the objects to the given renderer.
DrawModes::DrawMode POINTS_SPHERES
This defines a local point spheres draw mode for all polyLine nodes.
void update()
Trigger an update of the vbo.
ACG_CLASSNAME(PolyLineNodeT)
static name of this class
void updateVBO()
Trigger an update of the vbo.
void writeVertexColor(unsigned int _vertex, bool _colorSourceVertex, void *_dst) const
Write color for rendering to a buffer.
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax) override
update bounding box
ACG::VertexDeclaration vertexDeclECol_
Vertex layout with edge colors.
ACG::VertexDeclaration vertexDeclVCol_
Vertex layout with vertex colors.
void setCustomBuffer(int _id, const void *_buffer)
void setupVertexDeclaration(VertexDeclaration *_dst, int _colorSource) const
Create the vertex declaration.
~PolyLineNodeT()
Destructor.
int addCustomBuffer(const ACG::VertexElement &_desc, const void *_buffer)
void draw(GLState &, const DrawModes::DrawMode &_drawMode) override
draw lines and normals
std::vector< unsigned int > selectedEdgeIndexBuffer_
Index buffer for selected edges.
size_t fillVertexBuffer(void *_buf, size_t _bufSize, bool _addLineStripEndVertex)
Fill a buffer with vertex data.
std::vector< std::pair< ACG::VertexElement, const void * > > customBuffers_
Custom vertex data for shader based rendering.
void writeVertex(unsigned int _vertex, void *_dst)
Write vertex data for rendering to a buffer.
PolyLineNodeT(const PolyLineNodeT &_rhs)
Copy constructor (not used)
std::map< typename PolyLine::CustomPropertyHandle, int > polylinePropMap_
Map from custom properties in PolyLine to id in customBuffers_.
GLSphere * sphere_
Sphere for VertexSphere DrawMode.
DrawModes::DrawMode availableDrawModes() const override
return available draw modes
DrawModes::DrawMode POINTS_SPHERES_SCREEN
This defines a local point spheres draw mode for all polyLine nodes with constant screen size.
PolyLineNodeT & operator=(const PolyLineNodeT &_rhs)
Assignment operator (not used)
GeometryBuffer vbo_
VBO used to render the poly line.
bool updateVBO_
Flag to trigger update of vbo.
std::vector< unsigned int > selectedVertexIndexBuffer_
Index buffer for selected vertices.
PolyLine & polyline_
The associated poly line.
void pick(GLState &_state, PickTarget _target) override
picking
Class to define the vertex input layout.
PickTarget
What target to use for picking.
Namespace providing different geometric functions concerning angles.
Description of one vertex element.