Commit 870cdb35 authored by Jan Möbius's avatar Jan Möbius
Browse files

Lots of cppcheck fixes


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@18765 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 09c7e5fd
......@@ -159,7 +159,6 @@ void IRenderer::traverseRenderableNodes( ACG::GLState* _glState, ACG::SceneGraph
if (_node)
{
ACG::SceneGraph::BaseNode::StatusMode status(_node->status());
bool process_children(status != ACG::SceneGraph::BaseNode::HideChildren);
ACG::SceneGraph::DrawModes::DrawMode nodeDM = _node->drawMode();
......@@ -184,7 +183,8 @@ void IRenderer::traverseRenderableNodes( ACG::GLState* _glState, ACG::SceneGraph
if (_node->status() != ACG::SceneGraph::BaseNode::HideNode)
_node->getRenderObjects(this, *_glState, nodeDM, _mat);
if (process_children)
// Process children?
if (status != ACG::SceneGraph::BaseNode::HideChildren)
{
ACG::SceneGraph::BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
......
......@@ -778,7 +778,7 @@ const DrawMode& addDrawMode( const std::string & _name , bool _propertyBased)
//----------------------------------------------------------------------------
ACGDLLEXPORT
const DrawMode& addDrawMode( const std::string & _name, const DrawModeProperties _properties)
const DrawMode& addDrawMode( const std::string & _name, const DrawModeProperties& _properties)
{
const DrawMode& drawmode = addDrawMode( _name , true );
......
......@@ -637,7 +637,7 @@ namespace DrawModes {
* @return Id of the new draw mode
*/
ACGDLLEXPORT
const DrawMode& addDrawMode( const std::string & _name, const DrawModeProperties _properties);
const DrawMode& addDrawMode( const std::string & _name, const DrawModeProperties& _properties);
/** \brief Get a custom DrawMode.
*
......
......@@ -139,12 +139,14 @@ traverse( BaseNode* _node, Action& _action )
if (_node)
{
BaseNode::StatusMode status(_node->status());
bool process_children(status != BaseNode::HideChildren);
// If the subtree is hidden, ignore this node and its children while rendering
if (status != BaseNode::HideSubtree)
{
bool process_children(status != BaseNode::HideChildren);
// If the node itself is hidden, ignore it but continue with its children
if (_node->status() != BaseNode::HideNode)
{
......@@ -206,55 +208,57 @@ template <class Action>
void
traverse_multipass ( BaseNode* _node, Action& _action, const unsigned int& _pass )
{
// Process node if it exists
if (_node) {
BaseNode::StatusMode status(_node->status());
bool process_children(status != BaseNode::HideChildren);
// If the subtree is hidden, ignore this node and its children while rendering
if (status != BaseNode::HideSubtree) {
// Executes this nodes enter function (if available and active in multipass)
if ( _node->multipassStatusActive(_pass) ) {
if_has_enter(_action, _node);
}
// If the node itself is hidden, don't call the action on it.
// Additionally check if rendering order is node first. otherwise, we will call it after the children.
// And check if it should be called in this rendering pass.
if ( (_node->status() != BaseNode::HideNode ) && ( _node->traverseMode() & BaseNode::NodeFirst ) && _node->multipassNodeActive(_pass))
process_children &= _action(_node);
if (process_children) {
BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
// Process all children
for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
if (~(*cIt)->traverseMode() & BaseNode::SecondPass)
traverse_multipass(*cIt, _action, _pass);
// Process all children which are second pass
for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
if ((*cIt)->traverseMode() & BaseNode::SecondPass)
traverse_multipass(*cIt, _action, _pass);
}
// If we are in childrenfirst node, the children have been painted andwe now check, if we can draw this node.
// If its hidden, ignore it.
// If it should not be rendered in this pass, ignore it too.
if ( (_node->traverseMode() & BaseNode::ChildrenFirst ) && (_node->status() != BaseNode::HideNode) && _node->multipassNodeActive(_pass) )
_action(_node);
// Call the leave function of the node (if available and active in multipass).
if ( _node->multipassStatusActive(_pass) )
if_has_leave(_action, _node);
} // if (status != BaseNode::HideSubtree)
} // if(node_)
// Process node if it exists
if (_node) {
BaseNode::StatusMode status(_node->status());
// If the subtree is hidden, ignore this node and its children while rendering
if (status != BaseNode::HideSubtree) {
bool process_children(status != BaseNode::HideChildren);
// Executes this nodes enter function (if available and active in multipass)
if ( _node->multipassStatusActive(_pass) ) {
if_has_enter(_action, _node);
}
// If the node itself is hidden, don't call the action on it.
// Additionally check if rendering order is node first. otherwise, we will call it after the children.
// And check if it should be called in this rendering pass.
if ( (_node->status() != BaseNode::HideNode ) && ( _node->traverseMode() & BaseNode::NodeFirst ) && _node->multipassNodeActive(_pass))
process_children &= _action(_node);
if (process_children) {
BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
// Process all children
for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
if (~(*cIt)->traverseMode() & BaseNode::SecondPass)
traverse_multipass(*cIt, _action, _pass);
// Process all children which are second pass
for (cIt = _node->childrenBegin(); cIt != cEnd; ++cIt)
if ((*cIt)->traverseMode() & BaseNode::SecondPass)
traverse_multipass(*cIt, _action, _pass);
}
// If we are in childrenfirst node, the children have been painted andwe now check, if we can draw this node.
// If its hidden, ignore it.
// If it should not be rendered in this pass, ignore it too.
if ( (_node->traverseMode() & BaseNode::ChildrenFirst ) && (_node->status() != BaseNode::HideNode) && _node->multipassNodeActive(_pass) )
_action(_node);
// Call the leave function of the node (if available and active in multipass).
if ( _node->multipassStatusActive(_pass) )
if_has_leave(_action, _node);
} // if (status != BaseNode::HideSubtree)
} // if(node_)
}
......
......@@ -1021,7 +1021,7 @@ updatePerFaceBuffers() {
typename Mesh::VertexHandle cvh = mesh_.to_vertex_handle(fhe_it);
const Vec2f texcoord = mesh_.property(perFaceTextureCoordinateProperty,fhe_it);
if ( mesh_.vertex_handle( strips_[ i ].indexArray[ stripIndex - 2 ] ) == cvh ) {
if ( mesh_.vertex_handle( strips_[ i ].indexArray[ stripIndex - 2 ] ) == cvh ) {
perFaceTextureCoordArray_[ bufferIndex + 2 ] = texcoord;
continue;
} else if ( mesh_.vertex_handle( strips_[ i ].indexArray[ stripIndex - 1 ] ) == cvh ) {
......
......@@ -426,7 +426,7 @@ QPoint mapToLocal( const QPoint _point ) {
return examiner_widgets_[activeExaminer_]->glMapFromGlobal(_point);
}
void setDrawMode( const ACG::SceneGraph::DrawModes::DrawMode _mode , int _viewer) {
void setDrawMode( const ACG::SceneGraph::DrawModes::DrawMode _mode& , int _viewer) {
if ( _viewer == ACTIVE_VIEWER )
viewerProperties(activeExaminer()).drawMode(_mode);
......
......@@ -356,7 +356,7 @@ void perspectiveProjection( int _viewer = ALL_VIEWERS );
* @param _mode New drawmode of the given viewer
*/
DLLEXPORT
void setDrawMode( const ACG::SceneGraph::DrawModes::DrawMode _mode , int _viewer = ALL_VIEWERS);
void setDrawMode( const ACG::SceneGraph::DrawModes::DrawMode& _mode , int _viewer = ALL_VIEWERS);
/** \brief Get the current draw Mode of a Viewer
*
......
......@@ -331,7 +331,6 @@ void DepthPeelingPlugin::traverseLightNodes( BaseNode* _node)
if (_node)
{
BaseNode::StatusMode status(_node->status());
bool process_children(status != BaseNode::HideChildren);
// If the subtree is hidden, ignore this node and its children while rendering
if (status != BaseNode::HideSubtree)
......@@ -371,7 +370,8 @@ void DepthPeelingPlugin::traverseLightNodes( BaseNode* _node)
}
}
if (process_children)
// Process children?
if (status != BaseNode::HideChildren)
{
BaseNode::ChildIter cIt, cEnd(_node->childrenEnd());
......@@ -914,11 +914,12 @@ DepthPeelingPlugin::traverseDraw( BaseNode* _node, Action& _action, ACG::SceneGr
// Process node if it exists
if (_node) {
BaseNode::StatusMode status(_node->status());
bool process_children(status != BaseNode::HideChildren);
// If the subtree is hidden, ignore this node and its children while rendering
if (status != BaseNode::HideSubtree) {
bool process_children(status != BaseNode::HideChildren);
// Executes this nodes enter function (if available and active in multipass)
if ( _node->multipassStatusActive(_pass) ) {
if_has_enter(_action, _node);
......
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