Commit 8b46a1b0 authored by Jan Möbius's avatar Jan Möbius
Browse files

Fixed accidental removal of docu by mike

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@7609 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 14de28e7
......@@ -82,8 +82,10 @@ namespace SceneGraph {
/// What target to use for picking
enum PickTarget
enum PickTarget
{
/// picks faces (may not be implemented for all nodes)
PICK_CELL,
/// picks faces (should be implemented for all nodes)
PICK_FACE,
/// picks edges (may not be implemented for all nodes)
......@@ -110,10 +112,10 @@ enum PickTarget
/** \class BaseNode BaseNode.hh <ACG/Scenegraph/BaseNode.hh>
This is the base for all scenegraph nodes. All virtual functions
should be reimplemented when inheriting from this class.
should be reimplemented when inheriting from this class.
**/
class ACGDLLEXPORT BaseNode
class ACGDLLEXPORT BaseNode
{
public:
......@@ -123,16 +125,21 @@ public:
/// Put this node between _parent and _child
BaseNode(BaseNode* _parent, BaseNode* _child, std::string _name="<unknown>");
/// Destructor.
virtual ~BaseNode();
/** Remove the while subtree below this node (including this node).
All node will be destucted, **/
/** \brief Delete the whole subtree of this node
*
* This function will remove the whole subtree below this node.
* All children in this nodes bubtree will be automatically removed from the tree
* and their destructor is called.
* The node itself will be removed from the list of its parents children.
* Afterwards it will also call its own destructor.
**/
void delete_subtree();
// --- basic interface ---
/// Return class name (implemented by the ACG_CLASSNAME macro)
......@@ -144,7 +151,7 @@ public:
/** Compute the bounding box of this node and update the values
_bbMin and _bbMax accordingly. Do not initialize _bbMin and
_bbMax since they may already store values of previous nodes'
_bbMax since they may already store values of previous nodes'
bounding box computation.
*/
virtual void boundingBox(Vec3f& /* _bbMin */, Vec3f& /*_bbMax*/ ) {}
......@@ -152,8 +159,8 @@ public:
/** This function is called when traversing the scene graph and
arriving at this node. It can be used to store GL states that
will be changed in order to restore then in the leave()
function.
\see MaterialNode
function.
\see MaterialNode
*/
virtual void enter(GLState& /*_state */, unsigned int /*_drawMode*/ ) {}
......@@ -161,7 +168,7 @@ public:
virtual void draw(GLState& /* _state */, unsigned int /* _drawMode */) {}
/** The leave function is used to restore GL states the have been changed.
This function must restore the status before enter() !
This function must restore the status before enter() !
*/
virtual void leave(GLState& /* _state */, unsigned int /* _drawMode */) {}
......@@ -172,7 +179,7 @@ public:
*/
virtual void enterPick(GLState& _state , PickTarget _target,
unsigned int _drawMode );
/** Draw the node using the GL picking name stack. The node's ID
will already be on the name stack, so only names identifing e.g. faces
should be used ( by glLoadName() ).
......@@ -185,16 +192,16 @@ public:
*/
virtual void leavePick(GLState& _state, PickTarget _target,
unsigned int _drawMode );
/** Enable or Disable picking for this node
* ( default: enabled )
*/
void enablePicking(bool _enable) { pickingEnabled_ = _enable; };
/** Check if picking is enabled for this node
/** Check if picking is enabled for this node
*/
bool pickingEnabled() { return pickingEnabled_; };
/// Handle mouse event (some interaction, e.g. modeling)
virtual void mouseEvent(GLState& /* _state */, QMouseEvent* /* _event */ ) {}
......@@ -232,7 +239,7 @@ public:
ChildIter childrenEnd() { return children_.end(); }
/// Same but \c const
ConstChildIter childrenEnd() const { return children_.end(); }
/// Returns: reverse begin-iterator of children
ChildRIter childrenRBegin() { return children_.rbegin(); }
/// Same but const
......@@ -245,11 +252,11 @@ public:
// --- insert / remove ---
/// Insert _node at the end of the list of children.
void push_back(BaseNode* _node)
void push_back(BaseNode* _node)
{
if (_node)
{
......@@ -261,11 +268,11 @@ public:
/** Remove child node at position _pos.
This _pos \a must \a be \a reachable from childrenBegin().<br>
This method has no effect if called with childrenEnd() as parameter. */
void remove(ChildIter _pos)
void remove(ChildIter _pos)
{
if (_pos == childrenEnd()) return;
//(*_pos)->parent_=0;
children_.erase(_pos);
children_.erase(_pos);
}
/// number of children
......@@ -277,15 +284,15 @@ public:
position.<br>
Returns childrenEnd() if no appropriate node is found.
*/
ChildIter find(BaseNode* _node)
ChildIter find(BaseNode* _node)
{
ChildIter i=std::find(children_.begin(),children_.end(),_node);
return i;
}
}
/** Find a node of a given name */
BaseNode * find( const std::string & _name )
{
if ( name() == _name )
......@@ -299,16 +306,23 @@ public:
}
return 0;
}
}
/// Get the nodes parent node
BaseNode* parent() { return parent_; }
/** \brief Set the parent of this node.
*
* This function will remove this node from its original parents children, if the parent exists.
* And will add it to the new parents children.
*/
void set_parent(BaseNode* _parent);
// --- status info ---
/// Status modi
enum StatusMode
{
......@@ -337,22 +351,22 @@ public:
/// Returns: name of node (needs not be unique)
std::string name() const { return name_; }
/// rename a node
/// rename a node
void name(const std::string& _name) { name_ = _name; }
/** Get unique ID of node. IDs are always positive and may be used
e.g. for picking.
*/
unsigned int id() const { return id_; }
//--- draw mode ---
/// Return the own draw modes of this node
unsigned int drawMode() const { return drawMode_; }
/** Set this node's own draw mode. It will be used for drawing instead of
/** Set this node's own draw mode. It will be used for drawing instead of
the the global draw mode. */
void drawMode(unsigned int _drawMode) { drawMode_ = _drawMode; }
......@@ -427,7 +441,7 @@ private:
/// Assigment operator. Disabled.
void operator=(const BaseNode&);
/// pointer to parent node
BaseNode* parent_;
......@@ -436,9 +450,9 @@ private:
/// node status()
StatusMode status_;
/// list of children
std::list<BaseNode*> children_;
std::list<BaseNode*> children_;
/// used to provide unique IDs to nodes
static unsigned int last_id_used__;
......@@ -451,7 +465,7 @@ private:
/// depth func
GLenum depth_func_;
/** Flag indicating if picking should be done for this object
* This flag has to be checked by your node if you implement picking
*/
......
Supports Markdown
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