77 rootNode_(_object.rootNode_),
112 std::cerr <<
"cleanup : separatorNode_ is already 0" << std::endl;
132 std::cerr <<
"Separator Node already exists. this should not happen!" << std::endl;
142 std::cerr <<
"Manipulator Node already exists. this should not happen!" << std::endl;
158 if ( OpenFlipper::Options::randomDefaultColor() ){
164 color.setRgb(rand()%255, rand()%255, rand()%255);
166 diff = (bckgrnd.red() - color.red()) *(bckgrnd.red() - color.red())
167 +(bckgrnd.green() - color.green())*(bckgrnd.green() - color.green())
168 +(bckgrnd.blue() - color.blue()) *(bckgrnd.blue() - color.blue());
169 }
while (diff < 70000);
172 color = OpenFlipper::Options::defaultColor();
176 colorV[0] = color.redF();
177 colorV[1] = color.greenF();
178 colorV[2] = color.blueF();
179 colorV[3] = color.alphaF();
237 QList< BaseNode* > list;
241 while (!list.empty()) {
242 currentNode = list.front();
344 QString searchname = _pluginName+
"#"+_nodeName+
"#"+index;
360 std::string nodename = std::string(
"SeparatorNode for object " + _name.toUtf8());
363 nodename = std::string(
"ManipulatorNode for object " + _name.toUtf8());
366 nodename = std::string(
"BoundingBoxNode for object " + _name.toUtf8());
369 nodename = std::string(_name.toUtf8() +
"'s Material" );
372 nodename = std::string(
"StencilRefNode for object " + _name.toUtf8());
DLLEXPORT OpenFlipperQSettings & OpenFlipperSettings()
QSettings object containing all program settings of OpenFlipper.
ACG::SceneGraph::SeparatorNode SeparatorNode
Seperator Node.
Namespace providing different geometric functions concerning angles.
void push_back(BaseNode *_node)
Insert _node at the end of the list of children.
std::string name() const
Returns: name of node (needs not be unique)
StencilRefNode * stencilRefNode_
Stencil reference node for the object.
PickTarget
What target to use for picking.
bool manipPlaced()
Check if the manipulator has been placed.
QtTranslationManipulatorNode * manipulatorNode()
ACG::SceneGraph::BoundingBoxNode BoundingBoxNode
Bounding box Node.
virtual ~BaseObjectData()
destructor
Hide this node and its children.
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
virtual bool pickingEnabled()
virtual void show()
Sets the whole Scenegraph subtree of this node to visible.
MaterialNode * materialNode()
get a pointer to the materialnode
void set_overlay_color(const Vec4f &_s)
set the overlay color
BaseObjectData()
constructor
ChildIter childrenBegin()
Returns: begin-iterator of children.
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.
SeparatorNode * separatorNode_
Separator at top of Scenegraph structure used for this Object.
VectorT< double, 3 > Vec3d
virtual void hide()
Sets the whole Scenegraph subtree of this node to invisible.
void delete_subtree()
Delete the whole subtree of this node.
void setIdentifier(int _id)
Set an identifier for that manipulator.
virtual bool hasNode(BaseNode *_node)
Check if the given node is owned by this object.
void set_base_color(const Vec4f &_c)
set the base color
bool hasAdditionalNode(QString _pluginName, QString _nodeName, int _id=0)
check if an object has the additional node
std::list< BaseNode * >::iterator ChildIter
allows to iterate over children
SeparatorNode * baseNode()
void set_status(StatusMode _s)
Set the status of this node.
const Vec3d & bbMax() const
Returns maximum point of the bounding box.
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
virtual BaseNode * primaryNode()
StencilRefNode * stencilRefNode()
get a pointer to the stencil reference node
virtual void enablePicking(bool _enable)
virtual ACG::SceneGraph::ShaderNode * shaderNode()
BoundingBoxNode * boundingBoxNode()
get a pointer to the bounding box node
virtual void update(UpdateType _type=UPDATE_ALL)
This function is called to update the object.
ACG::SceneGraph::StencilRefNode StencilRefNode
Stencil reference Node.
void getBoundingBox(ACG::Vec3d &bbmin, ACG::Vec3d &bbmax)
get the bounding box of the object
const Vec3d & bbMin() const
Returns minimum point of the bounding box.
std::vector< std::pair< BaseNode *, QString > > additionalNodes_
const Vec4f & specular_color() const
get the specular color
bool manipPlaced_
rootNode of global Scenegraph structure
void visibilityChanged(int _objectId)
ACG::SceneGraph::QtTranslationManipulatorNode QtTranslationManipulatorNode
ManipulatorNode.
QVariant value(const QString &key, const QVariant &defaultValue=QVariant()) const
QtTranslationManipulatorNode * manipulatorNode_
Manipulator used for this Object.
Hide this node, but draw children.
void initializeScenegraphNodes()
virtual bool visible()
return visiblity
MaterialNode * materialNode_
Scenegraph Material Node for the object.
BoundingBoxNode * boundingBoxNode_
Bounding box node for the object.
virtual void setName(QString _name)
path to the file from which the object is loaded ( defaults to "." )
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
void setObjectDrawMode(const ACG::SceneGraph::DrawModes::DrawMode &_mode, const bool &_force=false)
Set the draw mode for the object.
BaseObject * child(int row)
return a child
void traverse(BaseNode *_node, Action &_action)
SeparatorNode * rootNode_
rootNode of global Scenegraph structure
ChildIter childrenEnd()
Returns: end-iterator of children.
ChildIter find(BaseNode *_node)
virtual bool picked(uint _node_idx)
detect if the node has been picked