56 #include "BaseNode.hh" 76 : multipassStatus_(ALLPASSES),
77 multipassNode_(PASS_1),
81 drawMode_(DrawModes::DEFAULT),
82 pickingEnabled_(true),
110 assert(_parent != 0 && _child != 0);
182 enter (_state, _drawMode);
190 leave (_state, _drawMode);
197 if ( _i == NOPASS ) {
199 }
else if ( _i == ALLPASSES ) {
230 if ( _i == NOPASS ) {
232 }
else if ( _i == ALLPASSES ) {
264 s.
vs_ = _vertexShaderFile;
265 s.
gs_ = _geometryShaderFile;
266 s.
fs_ = _fragmentShaderFile;
277 s.
vs_ = _vertexShaderFile;
278 s.
gs_ = _geometryShaderFile;
279 s.
fs_ = _fragmentShaderFile;
280 s.
tcs_ = _tessControlShaderFile;
281 s.
tes_ = _tessEvalShaderFile;
305 _obj->
addTexture(it->second,
size_t(it->first),
false);
312 std::map<DrawModes::DrawModePrimitive, ShaderSet>::const_iterator shaderSet =
shaderSettings_.find(_primitive);
316 if (!defaultShaders) {
319 if (shaderSet->second.relativePaths_) {
327 _obj->
shaderDesc.vertexTemplateFile += shaderSet->second.vs_.c_str();
328 _obj->
shaderDesc.tessControlTemplateFile += shaderSet->second.tcs_.c_str();
329 _obj->
shaderDesc.tessEvaluationTemplateFile += shaderSet->second.tes_.c_str();
330 _obj->
shaderDesc.geometryTemplateFile += shaderSet->second.gs_.c_str();
331 _obj->
shaderDesc.fragmentTemplateFile += shaderSet->second.fs_.c_str();
std::string tcs_
tess-control
Namespace providing different geometric functions concerning angles.
ChildIter find(BaseNode *_node)
void addTexture(const Texture &_t)
adds a texture to stage RenderObjects::numTextures()
std::map< DrawModes::DrawModePrimitive, ShaderSet > shaderSettings_
shader settings for primitive modes
MultipassBitMask multipassStatus_
bool multipassStatusActive(const unsigned int _i) const
Get multipass status to traverse in a specific pass.
void push_back(BaseNode *_node)
Insert _node at the end of the list of children.
virtual void leave(GLState &, const DrawModes::DrawMode &)
unsigned int id_
ID of node.
std::vector< BaseNode * > children_
list of children
DrawModePrimitive
Primitive mode of a mesh.
void multipassStatusSetActive(const unsigned int _i, bool _active)
Set multipass status to traverse in a specific pass.
Interface class between scenegraph and renderer.
std::string vs_
vertex shader
MultipassBitMask multipassNode_
bool relativePaths_
rel or abs path
void addUniformPool(const GLSL::UniformPool &_pool)
add all uniforms from a pool
bool dirty_
Flag indicating that the node has to be redrawn.
void setRenderObjectTexture(int _samplerSlot, GLuint _texId, GLenum _texType=GL_TEXTURE_2D)
Set textures for shader based rendering.
BaseNode * parent_
pointer to parent node
std::map< int, RenderObject::Texture > textureSettings_
texture settings for shader based rendering
bool multipassNodeActive(const unsigned int _i) const
Get Node status to traverse in a specific pass.
BaseNode(BaseNode *_parent=0, std::string _name="<unknown>")
Default constructor.
virtual void leavePick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
virtual void enterPick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
std::vector< BaseNode * >::iterator ChildIter
allows to iterate over children
unsigned int traverseMode_
traverse mode
virtual void apply(RenderObject *_obj)=0
apply the modifier
static unsigned int last_id_used__
used to provide unique IDs to nodes
RenderObjectModifier * renderModifier_
render-object modifier
StatusMode status_
node status()
std::string tes_
tess-eval
virtual ~BaseNode()
Destructor.
static unsigned int last_id_used__
used to provide unique IDs to nodes
void applyRenderObjectSettings(DrawModes::DrawModePrimitive _primitive, RenderObject *_obj) const
Set shaders, textures and uniforms as provided by user to a render-object.
static QString getShaderDir()
void remove(ChildIter _pos)
virtual void enter(GLState &, const DrawModes::DrawMode &)
ChildIter childrenBegin()
Returns: begin-iterator of children.
ShaderGenDesc shaderDesc
Drawmode and other shader params.
BaseNode(BaseNode *_parent=0, std::string _name="<unknown>")
Default constructor.
void setRenderObjectShaders(const std::string &_vertexShaderFile, const std::string &_geometryShaderFile, const std::string &_fragmentShaderFile, bool _relativePaths=true, DrawModes::DrawModePrimitive _primitiveType=DrawModes::PRIMITIVE_POLYGON)
Set custom shaders.
void multipassNodeSetActive(const unsigned int _i, bool _active)
Set Node status to traverse in a specific pass.
void delete_subtree()
Delete the whole subtree of this node.
ChildIter childrenEnd()
Returns: end-iterator of children.
DrawModes::DrawMode drawMode_
private draw mode
Execute action on node first and then on its children.
std::vector< BaseNode * >::iterator ChildIter
allows to iterate over children
void initializeDefaultDrawModes(void)
const GLSL::UniformPool * uniformPool_
user provided uniform pool for shader constants
std::string name_
name of node
void set_parent(BaseNode *_parent)
Set the parent of this node.