Ejemplo n.º 1
0
    void frameDraw( const eq::uint128_t& )
    {
        livre::Node* node = static_cast< livre::Node* >( _channel->getNode( ));
        const DashRenderStatus& renderStatus = node->getDashTree()->getRenderStatus();
        const uint32_t frame = renderStatus.getFrameID();
        if( frame >= INVALID_FRAME )
            return;

        applyCamera();
        initializeLivreFrustum();
        const DashRenderNodes& visibles = requestData();

        const eq::fabric::Viewport& vp = _channel->getViewport( );
        const Viewport viewport( vp.x, vp.y, vp.w, vp.h );
        _renderViewPtr->setViewport( viewport );

        livre::Window* window = static_cast< livre::Window* >( _channel->getWindow( ));
        const livre::Pipe* pipe = static_cast< const livre::Pipe* >( _channel->getPipe( ));

        const bool isSynchronous = pipe->getFrameData()->getVRParameters()->getSynchronousMode();

        // #75: only wait for data in synchronous mode
        const bool dashTreeUpdated = window->apply( isSynchronous );

        if( dashTreeUpdated )
        {
            const Frustum& receivedFrustum = renderStatus.getFrustum();

            // If there are multiple channels, this may cause the ping-pong
            // because every channel will try to update the same DashTree in
            // node with their own frustum.
            if( !isSynchronous && receivedFrustum != _currentFrustum )
                _channel->getConfig()->sendEvent( REDRAW );
        }

        const AvailableSetGenerator generateSet( node->getDashTree(),
                                                 window->getTextureCache( ));

        _frameInfo.clear();
        for( const auto& visible : visibles )
            _frameInfo.allNodes.push_back(visible.getLODNode().getNodeId());
        generateSet.generateRenderingSet( _frameInfo );

        EqRenderViewPtr renderViewPtr =
                boost::static_pointer_cast< EqRenderView >( _renderViewPtr );
        RayCastRendererPtr renderer =
                boost::static_pointer_cast< RayCastRenderer >(
                    renderViewPtr->getRenderer( ));

        renderer->update( *pipe->getFrameData( ));

        RenderBricks renderBricks;
        generateRenderBricks( _frameInfo.renderNodes, renderBricks );
        renderViewPtr->render( _frameInfo, renderBricks, *_glWidgetPtr );
        updateRegions( renderBricks );
    }
Ejemplo n.º 2
0
void PolylineAnnotation::paint( GeoPainter *painter, const ViewportParams *viewport )
{
    m_viewport = viewport;
    Q_ASSERT( placemark()->geometry()->nodeType() == GeoDataTypes::GeoDataLineStringType );

    painter->save();
    if ( state() == SceneGraphicsItem::DrawingPolyline || !m_regionsInitialized ) {
        setupRegionsLists( painter );
        m_regionsInitialized = true;
    } else {
        updateRegions( painter );
    }

    if ( hasFocus() ) {
        drawNodes( painter );
    }
    painter->restore();
}
Ejemplo n.º 3
0
void CEngine::exec()
{

    print_debug(DEBUG_ANALYZER, "in main cycle");
    QTime t;
    t.start();


    if (eventPipe.isEmpty())
        return;


    print_debug(DEBUG_ANALYZER, "trying to dequeue the pipe ...");
    event = eventPipe.getEvent();
    print_debug(DEBUG_ANALYZER, "preparing to call the event parser...");
    parseEvent();

    print_debug(DEBUG_ANALYZER, "updating regions");
    updateRegions();


    print_debug(DEBUG_ANALYZER, "done. Time elapsed %d ms", t.elapsed());
    return;
}