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