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());
vector_type & maximize(const vector_type &_rhs)
maximize values: same as *this = max(*this, _rhs), but faster
Namespace providing different geometric functions concerning angles.
void setupShaderGenFromDrawmode(const SceneGraph::DrawModes::DrawModeProperties *_props)
Fills out ShaderGenDesc parameters based on Drawmode properties.
static void normalPointer(GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glNormalPointer, supports locking
DrawMode POINTS_SHADED
draw shaded points (requires point normals)
static void colorPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glColorPointer, supports locking
DrawMode POINTS_COLORED
draw colored, but not lighted points (requires point colors)
static void enable(GLenum _cap, bool _warnRemoved=true)
replaces glEnable, but supports locking
void pointSize(float _sz)
set point size (default: 1.0)
void boundingBox(Vec3d &_bbMin, Vec3d &_bbMax)
update bounding box
void initFromState(GLState *_glState)
Initializes a RenderObject instance.
int viewport_width() const
get viewport width
static void disable(GLenum _cap, bool _warnRemoved=true)
replaces glDisable, but supports locking
Interface class between scenegraph and renderer.
size_t getNumLayers() const
returns the layer count
GLenum depthFunc
GL_LESS, GL_LEQUAL, GL_GREATER ..
VectorT< float, 2 > Vec2f
static void vertexPointer(GLint _size, GLenum _type, GLsizei _stride, const GLvoid *_pointer)
replaces glVertexPointer, supports locking
static void disableClientState(GLenum _cap)
replaces glDisableClientState, supports locking
void setVertexStride(unsigned int _stride)
void addElement(const VertexElement *_pElement)
int viewport_height() const
get viewport height
void setUniform(const char *_name, GLint _value)
set values for int uniforms
static void enableClientState(GLenum _cap)
replaces glEnableClientState, 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.
static QString getShaderDir()
void draw(GLState &_state, const DrawModes::DrawMode &_drawMode)
draw points and normals
ShaderGenDesc shaderDesc
Drawmode and other shader params.
vector_type & minimize(const vector_type &_rhs)
minimize values: same as *this = min(*this, _rhs), but faster
const DrawModeProperties * getLayer(unsigned int _i) const
returns the property set at layer i
void getRenderObjects(IRenderer *_renderer, GLState &_state, const DrawModes::DrawMode &_drawMode, const Material *_mat)
draw points and normals via renderer plugin
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.
int priority
Priority to allow sorting of objects.