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