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


C++ RenderObject::getVisible方法代码示例

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


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

示例1: handleMouseMove

void RenderContainer::handleMouseMove(int button, int x, int y)
{
    bool isabovesomething = false;
    std::list<RenderObject *>::const_iterator itr = _objlist.begin();
    for (;itr != _objlist.end() ; ++itr) {
        RenderObject * current = *itr;

        if (!current->getVisible()) continue;

        if (!current->hitTest(x, y)) {
            continue;
        }
        if (_lasthoverobj!=current) {
            if (_lasthoverobj) _lasthoverobj->handleMouseLeave(button);
            current->handleMouseEnter(button);
            _lasthoverobj = current;
        }


        isabovesomething = true;
        if (current->handleMouseMove(button, x, y)) break;   
    }
    if (!isabovesomething) {
        if (_lasthoverobj) _lasthoverobj->handleMouseLeave(button);
        _lasthoverobj = NULL;
    }
}
开发者ID:CJ456,项目名称:laserkbd,代码行数:27,代码来源:cvui_container.cpp

示例2: handleMouseRelease

void RenderContainer::handleMouseRelease(int button, int x, int y)
{
    std::list<RenderObject *>::const_iterator itr = _objlist.begin();
   for (;itr != _objlist.end() ; ++itr) {
        RenderObject * current = *itr;

        if (!current->getVisible()) continue;

        if (!current->hitTest(x, y)) continue;

        if (current->handleMouseRelease(button, x, y)) break;
    }

}
开发者ID:CJ456,项目名称:laserkbd,代码行数:14,代码来源:cvui_container.cpp

示例3: renderObjects

void RenderContainer::renderObjects(IplImage* frame)
{
    CvRect dirtyRT;
    dirtyRT.x = -1;
    dirtyRT.y = -1;

    std::list<RenderObject *>::const_iterator itr = _objlist.begin();

    for (;itr != _objlist.end() ; ++itr) {
        RenderObject * current = *itr;

        if (!current->getVisible()) continue;

        CvRect ObjRect;
        ObjRect.x = current->getX();
        ObjRect.y = current->getY();
        ObjRect.width = current->getWidth();
        ObjRect.height = current->getHeight();

        if (!current->getDirtyFlag()) {
            CvRect intersect = cvRectIntersection(dirtyRT, ObjRect);

            if (intersect.width<=0 || intersect.height<=0) {
                continue;
            }
        }

        current->renderSelf(frame);


        dirtyRT.x = std::min(dirtyRT.x, ObjRect.x);
        dirtyRT.y = std::min(dirtyRT.y, ObjRect.y);
        
        int mergedRight = std::max(dirtyRT.x + dirtyRT.width, ObjRect.x + ObjRect.width);
        int mergedBottom = std::max(dirtyRT.y + dirtyRT.height, ObjRect.y + ObjRect.height);
        
        dirtyRT.width = mergedRight - dirtyRT.x;
        dirtyRT.height = mergedBottom - dirtyRT.y;

    }
}
开发者ID:CJ456,项目名称:laserkbd,代码行数:41,代码来源:cvui_container.cpp


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