61 #include "PointNode.hh"
62 #include <ACG/GL/IRenderer.hh>
67 namespace SceneGraph {
77 ConstPointIter p_it=points_.begin(), p_end=points_.end();
78 for (; p_it!=p_end; ++p_it) {
79 _bbMin.minimize(*p_it);
80 _bbMax.maximize(*p_it);
114 glDrawArrays(GL_POINTS, 0,
int(points_.size()));
121 if (points_.size() == normals_.size())
128 glDrawArrays(GL_POINTS, 0,
int(points_.size()));
136 if (points_.size() == colors_.size())
143 glDrawArrays(GL_POINTS, 0,
int(points_.size()));
145 std::cerr <<
"Mismatch size!" << std::endl;
164 ro.debugName =
"PointNode";
172 if (!normals_.empty())
174 if (!colors_.empty())
181 for (
unsigned int i = 0; i < _drawMode.
getNumLayers(); ++i)
185 if (props->primitive() == DrawModes::PRIMITIVE_POINT)
189 ro.setMaterial(_mat);
194 ro.depthWrite =
true;
199 geomTemplate +=
"PointSize/geometry.tpl";
202 fragTemplate +=
"PointSize/fragment.tpl";
204 ro.
shaderDesc.geometryTemplateFile = geomTemplate;
205 ro.
shaderDesc.fragmentTemplateFile = fragTemplate;
211 ro.glDrawArrays(GL_POINTS, 0, (GLsizei)points_.size());
VectorT< float, 2 > Vec2f
ShaderGenDesc shaderDesc
Drawmode and other shader params.
Namespace providing different geometric functions concerning angles.
static void enable(GLenum _cap)
replaces glEnable, but supports locking
static void disableClientState(GLenum _cap)
replaces glDisableClientState, supports locking
DrawModes::DrawMode availableDrawModes() const
return available draw modes
static void colorPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glColorPointer, supports locking
static void disable(GLenum _cap)
replaces glDisable, but supports locking
Interface class between scenegraph and renderer.
void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
draw points and normals via renderer plugin
void setUniform(const char *_name, GLint _value)
set values for int uniforms
const DrawModeProperties * getLayer(unsigned int _i) const
returns the property set at layer i
GLenum depthFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
void initFromState(GLState *_glState)
Initializes a RenderObject instance.
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw points and normals
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
update bounding box
const VertexDeclaration * vertexDecl
Defines the vertex buffer layout, ignored if VAO is provided.
size_t getNumLayers() const
returns the layer count
int viewport_width() const
get viewport width
DrawMode POINTS_COLORED
draw colored, but not lighted points (requires point colors)
DrawModeProperties stores a set of properties that defines, how to render an object.
DrawMode POINTS
draw unlighted points using the default base color
virtual void addRenderObject(RenderObject *_renderObject)
Callback for the scenegraph nodes, which send new render objects via this function.
DrawMode POINTS_SHADED
draw shaded points (requires point normals)
static void normalPointer(GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glNormalPointer, supports locking
static void vertexPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glVertexPointer, supports locking
static void enableClientState(GLenum _cap)
replaces glEnableClientState, supports locking
void setupShaderGenFromDrawmode(const SceneGraph::DrawModes::DrawModeProperties *_props)
Fills out ShaderGenDesc parameters based on Drawmode properties.
int priority
Priority to allow sorting of objects.
static QString getShaderDir()
int viewport_height() const
get viewport height
void pointSize(float _sz)
set point size (default: 1.0)
void addElement(const VertexElement *_pElement)
void setVertexStride(unsigned int _stride)