当前位置: 首页>>代码示例>>C++>>正文


C++ CAView::getAtlasIndex方法代码示例

本文整理汇总了C++中CAView::getAtlasIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ CAView::getAtlasIndex方法的具体用法?C++ CAView::getAtlasIndex怎么用?C++ CAView::getAtlasIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CAView的用法示例。


在下文中一共展示了CAView::getAtlasIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: atlasIndexForSubview

unsigned int CABatchView::atlasIndexForSubview(CAView *view, int nZ)
{
    const CAVector<CAView*>& pBrothers = view->getSuperview()->getSubviews();
    
    unsigned int uSubviewIndex = (unsigned int)pBrothers.getIndex(view);

    bool bIgnoreParent = (CABatchView*)(view->getSuperview()) == this;
    CAView *pPrevious = NULL;
    if (uSubviewIndex > 0 && uSubviewIndex < UINT_MAX)
    {
        pPrevious = (CAView*)(pBrothers.at(uSubviewIndex - 1));
    }

    if (bIgnoreParent)
    {
        if (uSubviewIndex == 0)
        {
            return 0;
        }

        return highestAtlasIndexInSubview(pPrevious) + 1;
    }

    if (uSubviewIndex == 0)
    {
        CAView *p = (CAView*)(view->getSuperview());

        if (nZ < 0)
        {
            return p->getAtlasIndex();
        }
        else
        {
            return p->getAtlasIndex() + 1;
        }
    }
    else
    {
        if ((pPrevious->getZOrder() < 0 && nZ < 0) || (pPrevious->getZOrder() >= 0 && nZ >= 0))
        {
            return highestAtlasIndexInSubview(pPrevious) + 1;
        }

        CAView *p = (CAView*)(view->getSuperview());
        return p->getAtlasIndex() + 1;
    }

    CCAssert(0, "should not run here");
    return 0;
}
开发者ID:Brian1900,项目名称:CrossApp,代码行数:50,代码来源:CABatchView.cpp

示例2: removeViewFromAtlas

void CABatchView::removeViewFromAtlas(CAView *view)
{
    m_pobImageAtlas->removeQuadAtIndex(view->getAtlasIndex());

    view->setBatch(NULL);

    
    
    unsigned int uIndex = (unsigned int)m_obDescendants.getIndex(view);
    if (uIndex != UINT_MAX)
    {
        m_obDescendants.erase(uIndex);
        unsigned int count = (unsigned int)m_obDescendants.size();
        
        for(; uIndex < count; ++uIndex)
        {
            CAView* s = m_obDescendants.at(uIndex);
            s->setAtlasIndex(s->getAtlasIndex() - 1);
        }
    }

    CAVector<CAView*>::const_iterator itr;
    for (itr=view->getSubviews().begin(); itr!=view->getSubviews().end(); itr++)
    {
        removeViewFromAtlas(*itr);
    }
}
开发者ID:Brian1900,项目名称:CrossApp,代码行数:27,代码来源:CABatchView.cpp


注:本文中的CAView::getAtlasIndex方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。