61 #include "PointNode.hh" 62 #include <ACG/GL/IRenderer.hh> 77 ConstPointIter p_it=points_.begin(), p_end=points_.end();
78 for (; p_it!=p_end; ++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
DrawMode POINTS_COLORED
draw colored, but not lighted points (requires point colors)
static void colorPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glColorPointer, supports locking
static void enableClientState(GLenum _cap)
replaces glEnableClientState, supports locking
void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
draw points and normals via renderer plugin
DrawModeProperties stores a set of properties that defines, how to render an object.
void setupShaderGenFromDrawmode(const SceneGraph::DrawModes::DrawModeProperties *_props)
Fills out ShaderGenDesc parameters based on Drawmode properties.
void setVertexStride(unsigned int _stride)
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw points and normals
int priority
Priority to allow sorting of objects.
static void vertexPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glVertexPointer, supports locking
const VertexDeclaration * vertexDecl
Defines the vertex buffer layout, ignored if VAO is provided.
int viewport_width() const
get viewport width
DrawMode POINTS
draw unlighted points using the default base color
static QString getShaderDir()
size_t getNumLayers() const
returns the layer count
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
static void enable(GLenum _cap)
replaces glEnable, but supports locking
DrawModes::DrawMode availableDrawModes() const
return available draw modes
virtual void addRenderObject(RenderObject *_renderObject)
Callback for the scenegraph nodes, which send new render objects via this function.
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
update bounding box
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
static void disable(GLenum _cap)
replaces glDisable, but supports locking
DrawMode POINTS_SHADED
draw shaded points (requires point normals)
Namespace providing different geometric functions concerning angles.
static void disableClientState(GLenum _cap)
replaces glDisableClientState, supports locking
void addElement(const VertexElement *_pElement)
GLenum depthFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
static void normalPointer(GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glNormalPointer, supports locking
void initFromState(GLState *_glState)
Initializes a RenderObject instance.
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
int viewport_height() const
get viewport height
Interface class between scenegraph and renderer.
void pointSize(float _sz)
set point size (default: 1.0)
ShaderGenDesc shaderDesc
Drawmode and other shader params.