Commit aea267da authored by Jan Möbius's avatar Jan Möbius

Dennis: Added-stencil-reference-node-to-base-object

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@6626 383ad7c9-94d9-4d36-a494-682f7c89f535
parent b11f7c26
......@@ -56,7 +56,8 @@ BaseObjectData::BaseObjectData(const BaseObjectData& _object)
separatorNode_(0),
manipulatorNode_(0),
materialNode_(0),
boundingBoxNode_(0)
boundingBoxNode_(0),
stencilRefNode_(0)
{
// We have to create our own visualization nodes as we are a new object
init();
......@@ -70,7 +71,8 @@ BaseObjectData::BaseObjectData( SeparatorNode* _rootNode ) :
separatorNode_(0),
manipulatorNode_(0),
materialNode_(0),
boundingBoxNode_(0)
boundingBoxNode_(0),
stencilRefNode_(0)
{
init();
}
......@@ -125,6 +127,11 @@ void BaseObjectData::init() {
}
if ( materialNode_ == 0 )
materialNode_ = new MaterialNode(boundingBoxNode(), "New Material");
if ( stencilRefNode_ == 0 )
{
stencilRefNode_ = new StencilRefNode(materialNode(), "New Material");
stencilRefNode_->set_status( ACG::SceneGraph::BaseNode::HideNode );
}
}
......@@ -152,6 +159,9 @@ void BaseObjectData::setName( QString _name ) {
nodename = std::string(_name.toUtf8() + "'s Material" );
materialNode_->name( nodename );
nodename = std::string("StencilRefNode for object " + _name.toUtf8());
stencilRefNode_->name( nodename );
}
......@@ -211,6 +221,10 @@ BoundingBoxNode* BaseObjectData::boundingBoxNode() {
return boundingBoxNode_;
}
StencilRefNode* BaseObjectData::stencilRefNode() {
return stencilRefNode_;
}
void BaseObjectData::setBaseColor(ACG::Vec4f _color) {
materialNode_->set_base_color(_color);
......
......@@ -59,6 +59,7 @@
#include <ACG/Scenegraph/ShaderNode.hh>
#include <ACG/Scenegraph/BaseNode.hh>
#include <ACG/Scenegraph/BoundingBoxNode.hh>
#include <ACG/Scenegraph/StencilRefNode.hh>
#include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh>
//== TYPEDEFS =================================================================
......@@ -74,6 +75,8 @@ typedef ACG::SceneGraph::SeparatorNode SeparatorNode;
typedef ACG::SceneGraph::BaseNode BaseNode;
/// Bounding box Node
typedef ACG::SceneGraph::BoundingBoxNode BoundingBoxNode;
/// Stencil reference Node
typedef ACG::SceneGraph::StencilRefNode StencilRefNode;
//== CLASS DEFINITION =========================================================
......@@ -189,6 +192,9 @@ class DLLEXPORT BaseObjectData : public BaseObject
/// get a pointer to the bounding box node
BoundingBoxNode* boundingBoxNode();
/// get a pointer to the stencil reference node
StencilRefNode* stencilRefNode();
/// Set the color of the object
void setBaseColor(ACG::Vec4f _color);
......@@ -221,6 +227,9 @@ class DLLEXPORT BaseObjectData : public BaseObject
/// Bounding box node for the object
BoundingBoxNode * boundingBoxNode_;
/// Stencil reference node for the object
StencilRefNode* stencilRefNode_;
/** @} */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment