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();
static QString getShaderDir()
StatusMode status_
node status()
void multipassNodeSetActive(const unsigned int _i, bool _active)
Set Node status to traverse in a specific pass.
DrawModePrimitive
Primitive mode of a mesh.
std::map< DrawModes::DrawModePrimitive, ShaderSet > shaderSettings_
shader settings for primitive modes
void addTexture(const Texture &_t)
adds a texture to stage RenderObjects::numTextures()
void remove(ChildIter _pos)
Namespace providing different geometric functions concerning angles.
virtual void apply(RenderObject *_obj)=0
apply the modifier
virtual void enterPick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
virtual void enter(GLState &, const DrawModes::DrawMode &)
unsigned int id_
ID of node.
ShaderGenDesc shaderDesc
Drawmode and other shader params.
std::string tes_
tess-eval
std::vector< BaseNode * > children_
list of children
bool multipassNodeActive(const unsigned int _i) const
Get Node status to traverse in a specific pass.
MultipassBitMask multipassNode_
void addUniformPool(const GLSL::UniformPool &_pool)
add all uniforms from a pool
RenderObjectModifier * renderModifier_
render-object modifier
std::vector< BaseNode * >::iterator ChildIter
allows to iterate over children
bool multipassStatusActive(const unsigned int _i) const
Get multipass status to traverse in a specific pass.
static unsigned int last_id_used__
used to provide unique IDs to nodes
void push_back(BaseNode *_node)
Insert _node at the end of the list of children.
std::string tcs_
tess-control
ChildIter childrenBegin()
Returns: begin-iterator of children.
virtual ~BaseNode()
Destructor.
unsigned int traverseMode_
traverse mode
static unsigned int last_id_used__
used to provide unique IDs to nodes
bool dirty_
Flag indicating that the node has to be redrawn.
void set_parent(BaseNode *_parent)
Set the parent of this node.
std::vector< BaseNode * >::iterator ChildIter
allows to iterate over children
const GLSL::UniformPool * uniformPool_
user provided uniform pool for shader constants
BaseNode(BaseNode *_parent=0, std::string _name="<unknown>")
Default constructor.
std::string vs_
vertex shader
void multipassStatusSetActive(const unsigned int _i, bool _active)
Set multipass status to traverse in a specific pass.
void applyRenderObjectSettings(DrawModes::DrawModePrimitive _primitive, RenderObject *_obj) const
Set shaders, textures and uniforms as provided by user to a render-object.
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.
ChildIter find(BaseNode *_node)
std::map< int, RenderObject::Texture > textureSettings_
texture settings for shader based rendering
BaseNode(BaseNode *_parent=0, std::string _name="<unknown>")
Default constructor.
void delete_subtree()
Delete the whole subtree of this node.
BaseNode * parent_
pointer to parent node
bool relativePaths_
rel or abs path
Execute action on node first and then on its children.
virtual void leavePick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
void initializeDefaultDrawModes(void)
std::string name_
name of node
Interface class between scenegraph and renderer.
DrawModes::DrawMode drawMode_
private draw mode
MultipassBitMask multipassStatus_
ChildIter childrenEnd()
Returns: end-iterator of children.
void setRenderObjectTexture(int _samplerSlot, GLuint _texId, GLenum _texType=GL_TEXTURE_2D)
Set textures for shader based rendering.
virtual void leave(GLState &, const DrawModes::DrawMode &)