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() ){
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());
virtual void show()
Sets the whole Scenegraph subtree of this node to visible.
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
Namespace providing different geometric functions concerning angles.
bool manipPlaced_
rootNode of global Scenegraph structure
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
virtual BaseNode * primaryNode()
void visibilityChanged(int _objectId)
void initializeScenegraphNodes()
virtual ~BaseObjectData()
destructor
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
ACG::SceneGraph::QtTranslationManipulatorNode QtTranslationManipulatorNode
ManipulatorNode.
ChildIter childrenEnd()
Returns: end-iterator of children.
MaterialNode * materialNode()
get a pointer to the materialnode
bool manipPlaced()
Check if the manipulator has been placed.
ACG::SceneGraph::BoundingBoxNode BoundingBoxNode
Bounding box Node.
std::string name() const
Returns: name of node (needs not be unique)
SeparatorNode * separatorNode_
Separator at top of Scenegraph structure used for this Object.
virtual bool hasNode(BaseNode *_node)
Check if the given node is owned by this object.
ChildIter childrenBegin()
Returns: begin-iterator of children.
Hide this node, but draw children.
BoundingBoxNode * boundingBoxNode_
Bounding box node for the object.
Hide this node and its children.
virtual bool pickingEnabled()
void set_status(StatusMode _s)
Set the status of this node.
StencilRefNode * stencilRefNode()
get a pointer to the stencil reference node
SeparatorNode * rootNode_
rootNode of global Scenegraph structure
StencilRefNode * stencilRefNode_
Stencil reference node for the object.
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
void setIdentifier(int _id)
Set an identifier for that manipulator.
VectorT< double, 3 > Vec3d
const Vec3d & bbMin() const
Returns minimum point of the bounding box.
void set_overlay_color(const Vec4f &_s)
set the overlay color
void getBoundingBox(ACG::Vec3d &bbmin, ACG::Vec3d &bbmax)
get the bounding box of the object
ChildIter find(BaseNode *_node)
BaseObjectData()
constructor
SeparatorNode * baseNode()
BoundingBoxNode * boundingBoxNode()
get a pointer to the bounding box node
virtual void enablePicking(bool _enable)
const Vec4f & specular_color() const
get the specular color
QtTranslationManipulatorNode * manipulatorNode_
Manipulator used for this Object.
PickTarget
What target to use for picking.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
void traverse(BaseNode *_node, Action &_action)
MaterialNode * materialNode_
Scenegraph Material Node for the object.
void push_back(BaseNode *_node)
Insert _node at the end of the list of children.
void setObjectDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, const bool &_force=false)
Set the draw mode for the object.
ACG::SceneGraph::StencilRefNode StencilRefNode
Stencil reference Node.
ACG::SceneGraph::SeparatorNode SeparatorNode
Seperator Node.
virtual bool picked(uint _node_idx)
detect if the node has been picked
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
void delete_subtree()
Delete the whole subtree of this node.
virtual bool visible()
return visiblity
void set_base_color(const Vec4f &_c)
set the base color ( Same as set_emission(const Vec4f& _c) )
BaseObject * child(int row)
return a child
std::vector< BaseNode * >::iterator ChildIter
allows to iterate over children
const Vec3d & bbMax() const
Returns maximum point of the bounding box.
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.
bool hasAdditionalNode(QString _pluginName, QString _nodeName, int _id=0)
check if an object has the additional node
QtTranslationManipulatorNode * manipulatorNode()
virtual ACG::SceneGraph::ShaderNode * shaderNode()
virtual void hide()
Sets the whole Scenegraph subtree of this node to invisible.
std::vector< std::pair< BaseNode *, QString > > additionalNodes_