/*! read server cababilities
 */
void SortLastWindow::clientInit( void )
{
    getNetwork()->getAspect()->addFieldFilter(Node::getClassType().getId(),
                                              Node::VolumeFieldMask);
    getNetwork()->getAspect()->addFieldFilter(Node::getClassType().getId(),
                                              Node::TravMaskFieldMask);

    // create default composer
    if(getComposer() == NULL)
    {
/*
        FieldContainerPtr fcPtr = 
            FieldContainerFactory::the()->createFieldContainer("BinarySwapComposer");
        setComposer(ImageComposerPtr::dcast(fcPtr));
*/
    }
    if(getComposer() != NULL)
    {
        SortLastWindow *clusterWindow(this);
        getComposer()->setup(true,
                             getMFServers()->size32(),
                             getClientWindow(),
                             clusterWindow);
        getComposer()->open();
        // build node groups
        buildGroups();
    }
}
/*! init client window
 *
 *  If manageClientViewports is set, then all viewports from the
 *  cluster window are duplcated to the client window.
 */
void MultiDisplayWindow::clientInit( void )
{
    bool             changed = false;
    ViewportPtr      vp,cvp;

    if(getManageClientViewports() == false ||
       getClientWindow() == NullFC)
        return;

    // check if something changed
    if(getMFPort()->size() == getClientWindow()->getMFPort()->size())
    {
        for(UInt32 v = 0 ; v < getMFPort()->size() && !changed ; v++)
        {
            vp  = getPort(v);
            cvp = getClientWindow()->getPort(v);
            if( vp->getRoot() != cvp->getRoot() ||
                vp->getLeft() != cvp->getLeft() ||
                vp->getRight() != cvp->getRight() ||
                vp->getBottom() != cvp->getBottom() ||
                vp->getTop() != cvp->getTop() ||
                vp->getBackground() != cvp->getBackground() ||
                vp->getMFForegrounds()->size() !=
                    cvp->getMFForegrounds()->size() )
                changed = true;
        }
    }
    else
    {
        changed = true;
    }

    if(changed)
    {
        beginEditCP(getClientWindow());
        // remove all viewports
        while(getClientWindow()->getMFPort()->size())
        {
            vp = getClientWindow()->getPort(0);
            getClientWindow()->subPort(0);
            subRefCP(vp);
        }
        // duplicate viewports
        for(UInt32 v=0 ; v<getMFPort()->size() ;v++)
        {
            getClientWindow()->addPort(ViewportPtr::dcast(getPort(v)->shallowCopy()));
        }
        endEditCP(getClientWindow());
    }
}
/*! client frame init
 */
void SortLastWindow::clientPreSync( void )
{
    if(getClientWindow() != NULL)
    {
        UInt32 width =getClientWindow()->getWidth();
        UInt32 height=getClientWindow()->getHeight();
        if(width == 0)
            width = 2;
        if(height == 0)
            height = 2;
        if(width  != getWidth() ||
           height != getHeight())
        {
           setSize(width,height);
        }
    }
    
    Inherited::clientPreSync();

    // rebuild node groups
    buildGroups();
}
void MultiDisplayWindow::clientInit(void)
{
    bool      changed = false;
    Viewport *vp, *cvp;

    if(getManageClientViewports() == false ||
            getClientWindow         () == NULL)
    {
        return;
    }

    // check if something changed
    if(getMFPort()->size() == getClientWindow()->getMFPort()->size())
    {
        for(UInt32 v = 0 ; v < getMFPort()->size() && !changed ; v++)
        {
            vp  = getPort(v);

            cvp = getClientWindow()->getPort(v);

            if( vp->getRoot() != cvp->getRoot() ||
                    vp->getLeft() != cvp->getLeft() ||
                    vp->getRight() != cvp->getRight() ||
                    vp->getBottom() != cvp->getBottom() ||
                    vp->getTop() != cvp->getTop() ||
                    vp->getBackground() != cvp->getBackground() ||
                    vp->getMFForegrounds()->size() !=
                    cvp->getMFForegrounds()->size() )
            {
                changed = true;
            }
        }
    }
    else
    {
        changed = true;
    }

    if(changed)
    {
        // remove all viewports
#if 0
        while(getClientWindow()->getMFPort()-size())
        {
            vp = getClientWindow()->getPort(0);

            getClientWindow()->subPort(0U);
        }
#endif

        getClientWindow()->clearPorts();

        // duplicate viewports
        for(UInt32 v=0 ; v<getMFPort()->size() ; v++)
        {
            ViewportUnrecPtr pTmpPort =
                dynamic_pointer_cast<Viewport>(getPort(v)->shallowCopy());

            getClientWindow()->addPort(pTmpPort);
        }
    }
}
void SortLastWindow::clientRender(RenderActionBase *action)
{
    UInt32          p;
    UInt32          groupId = getMFServers()->size32();

    if(getMFServers()->size())
    {
        if(getClientWindow() != NULL)
        {
            setupNodes(groupId);
/*
            getClientWindow()->activate();
            getClientWindow()->frameInit();
*/
            action->setWindow(getClientWindow());

            if(getComposer() != NULL)
                getComposer()->startFrame();

            DrawEnv oEnv;
            
            oEnv.setWindow(action->getWindow());

            // render all viewports
            for(p = 0; p < getMFPort()->size() ; ++p)
            {
                Viewport *vp=getPort(p);

                oEnv.setViewportDimension(vp->calcPixelLeft   (),
                                          vp->calcPixelBottom (),
                                          vp->calcPixelRight  (),
                                          vp->calcPixelTop    (),
                                          vp->calcIsFullWindow());
                if(getComposer() != NULL)
                {
                    getComposer()->startViewport(vp);

                    action->setCamera    (vp->getCamera    ());
                    action->setBackground(vp->getBackground());
                    action->setViewarea  (vp                 );
                    action->setTravMask  (vp->getTravMask  ());

                    action->apply(vp->getRoot());

                    for(UInt16 i=0; i < vp->getMFForegrounds()->size(); i++)
                    {
                        if(dynamic_cast<StatisticsForeground *>(
                               vp->getForegrounds(i)) == NULL)
                        {
                            vp->getForegrounds(i)->draw(&oEnv);
                        }
                    }

                    getComposer()->composeViewport(vp);

                    for(UInt16 i=0; i < vp->getMFForegrounds()->size(); i++)
                    {
                        if(dynamic_cast<StatisticsForeground *>(
                               vp->getForegrounds(i)) != NULL)
                        {
                            vp->getForegrounds(i)->draw(&oEnv);
                        }
                    }

                }
                else
                {
                    vp->render(action);
                }
            }

            // compose whole window
            if(getComposer() != NULL)
                getComposer()->composeWindow();
        }
    }
}
/*! client rendering
 */
void SortLastWindow::clientRender(DrawActionBase *action)
{
    UInt32          p;
    UInt32          groupId = getServers().size();
    UInt32          l,b,r,t;
    UInt32          front,back;
    SortLastWindow *clusterWindow(this);

    if(getServers().size())
    {
        Connection *srcConnection=
            getNetwork()->getConnection(groupId);
        
        if(getClientWindow() != NULL)
        {
            setupNodes(groupId);
/*
            getClientWindow()->activate();
            getClientWindow()->frameInit();
*/
            action->setWindow(getClientWindow());

            if(getComposer() != NULL)
                getComposer()->startFrame();

            DrawEnv oEnv;
            
            oEnv.setWindow(action->getWindow());

            // render all viewports
            for(p = 0; p < getPort().size() ; ++p)
            {
                Viewport *vp=getPort()[p];
                if(getComposer() != NULL)
                {
                    getComposer()->startViewport(vp);

                    action->setCamera    (vp->getCamera    ());
                    action->setBackground(vp->getBackground());
                    action->setViewport  (vp                 );
                    action->setTravMask  (vp->getTravMask  ());

                    action->apply(vp->getRoot());

                    for(UInt16 i=0; i < vp->getForegrounds().size(); i++)
                    {
                        if(dynamic_cast<StatisticsForeground *>(
                               vp->getForegrounds(i)) == NULL)
                        {
                            vp->getForegrounds(i)->draw(&oEnv, vp);
                        }
                    }

                    getComposer()->composeViewport(vp);

                    for(UInt16 i=0; i < vp->getForegrounds().size(); i++)
                    {
                        if(dynamic_cast<StatisticsForeground *>(
                               vp->getForegrounds(i)) != NULL)
                        {
                            vp->getForegrounds(i)->draw(&oEnv, vp);
                        }
                    }

                }
                else
                {
                    vp->render(action);
                }
            }

            // compose whole window
            if(getComposer() != NULL)
                getComposer()->composeWindow();
        }
    }
}
Beispiel #7
0
	uint32_t
	DocWindowFrame::calcHeightFromClient()
	{
		return getClientWindow().getHeight() + kWindowHeightDelta;
	}
Beispiel #8
0
	uint32_t
	DocWindowFrame::calcWidthFromClient()
	{
		return getClientWindow().getWidth() + kWindowWidthDelta;
	}