62 #include "BaseNode.hh"
68 namespace SceneGraph {
82 : multipassStatus_(ALLPASSES),
83 multipassNode_(PASS_1),
87 drawMode_(DrawModes::DEFAULT),
88 pickingEnabled_(true),
106 : multipassStatus_(ALLPASSES),
107 multipassNode_(PASS_1),
111 drawMode_(DrawModes::DEFAULT),
112 pickingEnabled_(true),
116 assert(_parent != 0 && _child != 0);
188 enter (_state, _drawMode);
196 leave (_state, _drawMode);
203 if ( _i == NOPASS ) {
205 }
else if ( _i == ALLPASSES ) {
236 if ( _i == NOPASS ) {
238 }
else if ( _i == ALLPASSES ) {
270 s.
vs_ = _vertexShaderFile;
271 s.
gs_ = _geometryShaderFile;
272 s.
fs_ = _fragmentShaderFile;
283 s.
vs_ = _vertexShaderFile;
284 s.
gs_ = _geometryShaderFile;
285 s.
fs_ = _fragmentShaderFile;
286 s.
tcs_ = _tessControlShaderFile;
287 s.
tes_ = _tessEvalShaderFile;
311 _obj->
addTexture(it->second,
size_t(it->first),
false);
318 std::map<DrawModes::DrawModePrimitive, ShaderSet>::const_iterator shaderSet =
shaderSettings_.find(_primitive);
322 if (!defaultShaders) {
325 if (shaderSet->second.relativePaths_) {
333 _obj->
shaderDesc.vertexTemplateFile += shaderSet->second.vs_.c_str();
334 _obj->
shaderDesc.tessControlTemplateFile += shaderSet->second.tcs_.c_str();
335 _obj->
shaderDesc.tessEvaluationTemplateFile += shaderSet->second.tes_.c_str();
336 _obj->
shaderDesc.geometryTemplateFile += shaderSet->second.gs_.c_str();
337 _obj->
shaderDesc.fragmentTemplateFile += shaderSet->second.fs_.c_str();
DrawModePrimitive
Primitive mode of a mesh.
ShaderGenDesc shaderDesc
Drawmode and other shader params.
Namespace providing different geometric functions concerning angles.
virtual void enter(GLState &, const DrawModes::DrawMode &)
virtual void leave(GLState &, const DrawModes::DrawMode &)
BaseNode(BaseNode *_parent=0, std::string _name="<unknown>")
Default constructor.
RenderObjectModifier * renderModifier_
render-object modifier
void multipassNodeSetActive(const unsigned int _i, bool _active)
Set Node status to traverse in a specific pass.
std::map< DrawModes::DrawModePrimitive, ShaderSet > shaderSettings_
shader settings for primitive modes
ChildIter childrenEnd()
Returns: end-iterator of children.
void setRenderObjectTexture(int _samplerSlot, GLuint _texId, GLenum _texType=GL_TEXTURE_2D)
Set textures for shader based rendering.
ChildIter find(BaseNode *_node)
std::list< BaseNode * > children_
list of children
MultipassBitMask multipassNode_
void push_back(BaseNode *_node)
Insert _node at the end of the list of children.
ACGDLLEXPORT void initializeDefaultDrawModes(void)
void delete_subtree()
Delete the whole subtree of this node.
virtual void enterPick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
const GLSL::UniformPool * uniformPool_
user provided uniform pool for shader constants
std::list< BaseNode * >::iterator ChildIter
allows to iterate over children
bool relativePaths_
rel or abs path
static unsigned int last_id_used__
used to provide unique IDs to nodes
void multipassStatusSetActive(const unsigned int _i, bool _active)
Set multipass status to traverse in a specific pass.
std::string tes_
tess-eval
void set_parent(BaseNode *_parent)
Set the parent of this 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.
static unsigned int last_id_used__
used to provide unique IDs to nodes
std::string tcs_
tess-control
std::list< BaseNode * >::iterator ChildIter
allows to iterate over children
virtual void leavePick(GLState &_state, PickTarget _target, const DrawModes::DrawMode &_drawMode)
Interface class between scenegraph and renderer.
void applyRenderObjectSettings(DrawModes::DrawModePrimitive _primitive, RenderObject *_obj) const
Set shaders, textures and uniforms as provided by user to a render-object.
void addUniformPool(const GLSL::UniformPool &_pool)
add all uniforms from a pool
ChildIter childrenBegin()
Returns: begin-iterator of children.
virtual void apply(RenderObject *_obj)=0
apply the modifier
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 remove(ChildIter _pos)
void addTexture(const Texture &_t)
adds a texture to stage RenderObjects::numTextures()
bool multipassStatusActive(const unsigned int _i) const
Get multipass status to traverse in a specific pass.
unsigned int id_
ID of node.
MultipassBitMask multipassStatus_
BaseNode * parent_
pointer to parent node
BaseNode(BaseNode *_parent=0, std::string _name="<unknown>")
Default constructor.
std::string vs_
vertex shader
static QString getShaderDir()
virtual ~BaseNode()
Destructor.