58#include <ACG/Scenegraph/SeparatorNode.hh>
59#include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh>
60#include <ACG/Scenegraph/BoundingBoxNode.hh>
61#include <ACG/Scenegraph/StencilRefNode.hh>
62#include <ACG/Scenegraph/StatusNodesT.hh>
71 rootNode_(_object.rootNode_),
106 std::cerr <<
"cleanup : separatorNode_ is already 0" << std::endl;
126 std::cerr <<
"Separator Node already exists. this should not happen!" << std::endl;
136 std::cerr <<
"Manipulator Node already exists. this should not happen!" << std::endl;
152 if ( OpenFlipper::Options::randomDefaultColor() ){
154 QColor bckgrnd = OpenFlipperSettings().
value(
"Core/Gui/glViewer/defaultBackgroundColor").value<QColor>();
158 color.setRgb(rand()%255, rand()%255, rand()%255);
160 diff = (bckgrnd.red() - color.red()) *(bckgrnd.red() - color.red())
161 +(bckgrnd.green() - color.green())*(bckgrnd.green() - color.green())
162 +(bckgrnd.blue() - color.blue()) *(bckgrnd.blue() - color.blue());
163 }
while (diff < 70000);
166 color = OpenFlipper::Options::defaultColor();
170 colorV[0] = color.redF();
171 colorV[1] = color.greenF();
172 colorV[2] = color.blueF();
173 colorV[3] = color.alphaF();
231 QList< BaseNode* > list;
235 while (!list.empty()) {
236 currentNode = list.front();
342 QString searchname = _pluginName+
"#"+_nodeName+
"#"+index;
358 std::string nodename = std::string(
"SeparatorNode for object " + _name.toUtf8());
361 nodename = std::string(
"ManipulatorNode for object " + _name.toUtf8());
364 nodename = std::string(
"BoundingBoxNode for object " + _name.toUtf8());
367 nodename = std::string(_name.toUtf8() +
"'s Material" );
370 nodename = std::string(
"StencilRefNode for object " + _name.toUtf8());
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
ACG::SceneGraph::BoundingBoxNode BoundingBoxNode
Bounding box Node.
ACG::SceneGraph::SeparatorNode SeparatorNode
Seperator Node.
ACG::SceneGraph::StencilRefNode StencilRefNode
Stencil reference Node.
ACG::SceneGraph::QtTranslationManipulatorNode QtTranslationManipulatorNode
ManipulatorNode.
ChildIter childrenBegin()
Returns: begin-iterator of children.
void delete_subtree()
Delete the whole subtree of this node.
ChildIter childrenEnd()
Returns: end-iterator of children.
@ HideNode
Hide this node, but draw children.
@ HideSubtree
Hide this node and its children.
@ Active
Draw node & children.
std::vector< BaseNode * >::iterator ChildIter
allows to iterate over children
void set_status(StatusMode _s)
Set the status of this node.
std::string name() const
Returns: name of node (needs not be unique)
void push_back(BaseNode *_node)
Insert _node at the end of the list of children.
ChildIter find(BaseNode *_node)
const Vec3d & bbMin() const
Returns minimum point of the bounding box.
const Vec3d & bbMax() const
Returns maximum point of the bounding box.
void set_overlay_color(const Vec4f &_s)
set the overlay color
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
void set_base_color(const Vec4f &_c)
set the base color ( Same as set_emission(const Vec4f& _c) )
const Vec4f & specular_color() const
get the specular color
void setIdentifier(int _id)
Set an identifier for that manipulator.
bool manipPlaced_
rootNode of global Scenegraph structure
virtual void enablePicking(bool _enable)
void initializeScenegraphNodes()
SeparatorNode * rootNode_
rootNode of global Scenegraph structure
virtual bool pickingEnabled()
BaseObjectData()
constructor
SeparatorNode * baseNode()
MaterialNode * materialNode_
Scenegraph Material Node for the object.
virtual void show()
Sets the whole Scenegraph subtree of this node to visible.
virtual void hide()
Sets the whole Scenegraph subtree of this node to invisible.
void getBoundingBox(ACG::Vec3d &bbmin, ACG::Vec3d &bbmax) const
get the bounding box of the object
virtual ACG::Vec3d refinePick(ACG::SceneGraph::PickTarget _pickTarget, const ACG::Vec3d _hitPoint, const ACG::Vec3d _start, const ACG::Vec3d _dir, const unsigned int _targetIdx)
Refine picking.
QtTranslationManipulatorNode * manipulatorNode_
Manipulator used for this Object.
BoundingBoxNode * boundingBoxNode()
get a pointer to the bounding box node
bool hasAdditionalNode(const QString &_pluginName, const QString &_nodeName, int _id=0)
check if an object has the additional node
virtual void setName(QString _name) override
path to the file from which the object is loaded ( defaults to "." )
MaterialNode * materialNode()
get a pointer to the materialnode
void setObjectDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, const bool &_force=false)
Set the draw mode for the object.
virtual void update(UpdateType _type=UPDATE_ALL) override
This function is called to update the object.
StencilRefNode * stencilRefNode_
Stencil reference node for the object.
virtual ~BaseObjectData()
destructor
virtual void cleanup() override
virtual ACG::SceneGraph::ShaderNode * shaderNode()
SeparatorNode * separatorNode_
Separator at top of Scenegraph structure used for this Object.
virtual BaseNode * primaryNode()
StencilRefNode * stencilRefNode()
get a pointer to the stencil reference node
virtual bool hasNode(BaseNode *_node)
Check if the given node is owned by this object.
QtTranslationManipulatorNode * manipulatorNode()
BoundingBoxNode * boundingBoxNode_
Bounding box node for the object.
virtual bool visible() override
return visiblity
bool manipPlaced()
Check if the manipulator has been placed.
std::vector< std::pair< BaseNode *, QString > > additionalNodes_
virtual bool picked(uint _node_idx)
detect if the node has been picked
void visibilityChanged(int _objectId)
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
BaseObject * child(int row)
return a child
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void traverse(BaseNode *_node, Action &_action)
PickTarget
What target to use for picking.
Namespace providing different geometric functions concerning angles.
VectorT< double, 3 > Vec3d