LCOV - code coverage report
Current view: top level - eq/server - compoundInitVisitor.cpp (source / functions) Hit Total Coverage
Test: lcov2.info Lines: 22 22 100.0 %
Date: 2014-06-18 Functions: 4 4 100.0 %

          Line data    Source code
       1             : 
       2             : /* Copyright (c) 2007-2013, Stefan Eilemann <eile@equalizergraphics.com>
       3             :  *                    2011, Daniel Nachbaur <danielnachbaur@gmail.com>
       4             :  *                    2010, Cedric Stalder <cedric.stalder@gmail.com>
       5             :  *
       6             :  * This library is free software; you can redistribute it and/or modify it under
       7             :  * the terms of the GNU Lesser General Public License version 2.1 as published
       8             :  * by the Free Software Foundation.
       9             :  *
      10             :  * This library is distributed in the hope that it will be useful, but WITHOUT
      11             :  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
      12             :  * FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
      13             :  * details.
      14             :  *
      15             :  * You should have received a copy of the GNU Lesser General Public License
      16             :  * along with this library; if not, write to the Free Software Foundation, Inc.,
      17             :  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
      18             :  */
      19             : 
      20             : #include "compoundInitVisitor.h"
      21             : 
      22             : #include "config.h"
      23             : #include "frame.h"
      24             : #include "log.h"
      25             : #include "segment.h"
      26             : #include "view.h"
      27             : #include "window.h"
      28             : #include <eq/client/log.h>
      29             : 
      30             : namespace eq
      31             : {
      32             : namespace server
      33             : {
      34          55 : CompoundInitVisitor::CompoundInitVisitor( )
      35          55 :         : _taskID( 0 )
      36          55 : {}
      37             : 
      38         381 : VisitorResult CompoundInitVisitor::visit( Compound* compound )
      39             : {
      40         381 :     Channel* channel = compound->getChannel();
      41             : 
      42         381 :     compound->setTaskID( ++_taskID );
      43         381 :     if( channel && channel->getView( ))
      44         243 :         channel->getView()->updateFrusta();
      45             :     else
      46         138 :         compound->updateFrustum( Vector3f::ZERO, 1.f );
      47             : 
      48         381 :     compound->updateInheritData( 0 ); // Compound::activate needs _inherit.eyes
      49             : 
      50         762 :     if( !channel || // non-channel root compounds
      51         381 :         ( compound->isDestination() && !channel->getSegment( )))
      52             :     {
      53             :         // Note: The second case are non-view destination compounds. One use
      54             :         // case is swap-syncing all output channels using task-less compounds.
      55             : 
      56          55 :         LBASSERT( !channel || !channel->getView( ));
      57          55 :         uint32_t eyes = compound->getEyes();
      58          55 :         if( eyes == fabric::EYE_UNDEFINED )
      59          55 :             eyes = fabric::EYES_ALL;
      60             : 
      61          55 :         compound->activate( eyes );
      62             :     }
      63             : 
      64         381 :     if( channel )
      65             :     {
      66         326 :         compound->updateInheritTasks();
      67         326 :         channel->addTasks( compound->getInheritTasks( ));
      68             :     }
      69         381 :     return TRAVERSE_CONTINUE;
      70             : }
      71             : 
      72             : }
      73          27 : }

Generated by: LCOV version 1.10