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


C++ Region函数代码示例

本文整理汇总了C++中Region函数的典型用法代码示例。如果您正苦于以下问题:C++ Region函数的具体用法?C++ Region怎么用?C++ Region使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: Region

	TextureRegion::TextureRegion(TextureAtlas *pTextureAtlas,float x1,float y1,float x2,float y2)
	{
		mTexture=pTextureAtlas;
		Region(x1,y1,x2,y2);
	
		if(!pTextureAtlas)
			Log::Warning("TxTextureRegion::TxTextureRegion: Texture Atlas - null");
	}
开发者ID:mhyhre,项目名称:Tuxis-Engine,代码行数:8,代码来源:TextureRegion.cpp

示例2: Region

Regions Content::LayoutForPointInRegion(Point p, const Region& rgn) const
{
	Region layoutRgn = Region(rgn.Origin() + p, frame.Dimensions());

	Regions rgns;
	rgns.push_back(layoutRgn);
	return rgns;
}
开发者ID:ChunHungLiu,项目名称:gemrb,代码行数:8,代码来源:TextContainer.cpp

示例3: layerRect

void TextureMapperLayer::computeOverlapRegions(Region& overlapRegion, Region& nonOverlapRegion, ResolveSelfOverlapMode mode)
{
    if (!m_state.visible || !m_state.contentsVisible)
        return;

    FloatRect boundingRect;
    if (m_backingStore || m_state.masksToBounds || m_state.maskLayer || hasFilters())
        boundingRect = layerRect();
    else if (m_contentsLayer || m_state.solidColor.alpha())
        boundingRect = m_state.contentsRect;

    if (m_currentFilters.hasOutsets()) {
        FilterOutsets outsets = m_currentFilters.outsets();
        IntRect unfilteredTargetRect(boundingRect);
        boundingRect.move(std::max(0, -outsets.left()), std::max(0, -outsets.top()));
        boundingRect.expand(outsets.left() + outsets.right(), outsets.top() + outsets.bottom());
        boundingRect.unite(unfilteredTargetRect);
    }

    TransformationMatrix replicaMatrix;
    if (m_state.replicaLayer) {
        replicaMatrix = replicaTransform();
        boundingRect.unite(replicaMatrix.mapRect(boundingRect));
    }

    boundingRect = m_currentTransform.combined().mapRect(boundingRect);

    // Count all masks and filters as overlap layers.
    if (hasFilters() || m_state.maskLayer || (m_state.replicaLayer && m_state.replicaLayer->m_state.maskLayer)) {
        Region newOverlapRegion(enclosingIntRect(boundingRect));
        nonOverlapRegion.subtract(newOverlapRegion);
        overlapRegion.unite(newOverlapRegion);
        return;
    }

    Region newOverlapRegion;
    Region newNonOverlapRegion(enclosingIntRect(boundingRect));

    if (!m_state.masksToBounds) {
        for (auto* child : m_children)
            child->computeOverlapRegions(newOverlapRegion, newNonOverlapRegion, ResolveSelfOverlapIfNeeded);
    }

    if (m_state.replicaLayer) {
        newOverlapRegion.unite(replicaMatrix.mapRect(newOverlapRegion.bounds()));
        Region replicaRegion(replicaMatrix.mapRect(newNonOverlapRegion.bounds()));
        resolveOverlaps(replicaRegion, newOverlapRegion, newNonOverlapRegion);
    }

    if ((mode != ResolveSelfOverlapAlways) && shouldBlend()) {
        newNonOverlapRegion.unite(newOverlapRegion);
        newOverlapRegion = Region();
    }

    overlapRegion.unite(newOverlapRegion);
    resolveOverlaps(newNonOverlapRegion, overlapRegion, nonOverlapRegion);
}
开发者ID:reaven15,项目名称:webkit,代码行数:57,代码来源:TextureMapperLayer.cpp

示例4: reduce

static Rect reduce(const Rect& win, const Region& exclude) {
    if (CC_LIKELY(exclude.isEmpty())) {
        return win;
    }
    if (exclude.isRect()) {
        return win.reduce(exclude.getBounds());
    }
    return Region(win).subtract(exclude).getBounds();
}
开发者ID:trebon-chocodot,项目名称:android_frameworks_native,代码行数:9,代码来源:Layer.cpp

示例5: Region

Group::Group(unsigned int genus) {
	//center = cen;
	halfRegionWidth = _DRAW_WIDTH/(2*genus);
	for (unsigned int i = 0; i < genus; i++) {
		trans.push_back(vec2((-1 + .1 + (halfRegionWidth) + i*(_DRAW_WIDTH/(genus))), 0.0));
	}
	Region n = Region(genus, trans);
	baseRegion = n;
}
开发者ID:jlee923,项目名称:research2011,代码行数:9,代码来源:group.cpp

示例6: ASSERT

void CCOcclusionTrackerBase<LayerType, RenderSurfaceType>::finishedTargetRenderSurface(const LayerType* owningLayer, const RenderSurfaceType* finishedTarget)
{
    // FIXME: Remove the owningLayer parameter when we can get all the info from the surface.
    ASSERT(owningLayer->renderSurface() == finishedTarget);

    // Make sure we know about the target surface.
    enterTargetRenderSurface(finishedTarget);

    // If the occlusion within the surface can not be applied to things outside of the surface's subtree, then clear the occlusion here so it won't be used.
    if (owningLayer->maskLayer() || !surfaceOpacityKnown(finishedTarget) || finishedTarget->drawOpacity() < 1 || finishedTarget->filters().hasFilterThatAffectsOpacity()) {
        m_stack.last().occlusionInScreen = Region();
        m_stack.last().occlusionInTarget = Region();
    } else {
        if (!surfaceTransformsToTargetKnown(finishedTarget))
            m_stack.last().occlusionInTarget = Region();
        if (!surfaceTransformsToScreenKnown(finishedTarget))
            m_stack.last().occlusionInScreen = Region();
    }
}
开发者ID:xiaolu31,项目名称:webkit-node,代码行数:19,代码来源:CCOcclusionTracker.cpp

示例7: ENABLE

Region ScrollingCoordinator::computeNonFastScrollableRegion(const Frame* frame, const IntPoint& frameLocation) const
{
#if ENABLE(IOS_TOUCH_EVENTS)
    // On iOS, we use nonFastScrollableRegion to represent the region covered by elements with touch event handlers.
    ASSERT(frame->isMainFrame());
    UNUSED_PARAM(frameLocation);

    Document* document = frame->document();
    if (!document)
        return Region();

    Vector<IntRect> touchRects;
    document->getTouchRects(touchRects);
    
    Region touchRegion;
    for (const auto& rect : touchRects)
        touchRegion.unite(rect);

    return touchRegion;
#else
    Region nonFastScrollableRegion;
    FrameView* frameView = frame->view();
    if (!frameView)
        return nonFastScrollableRegion;

    IntPoint offset = frameLocation;
    offset.moveBy(frameView->frameRect().location());
    offset.move(0, frameView->topContentInset());

    if (const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas()) {
        for (FrameView::ScrollableAreaSet::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) {
            ScrollableArea* scrollableArea = *it;
            // Composited scrollable areas can be scrolled off the main thread.
            if (scrollableArea->usesCompositedScrolling())
                continue;
            IntRect box = scrollableArea->scrollableAreaBoundingBox();
            box.moveBy(offset);
            nonFastScrollableRegion.unite(box);
        }
    }

    for (const auto& child : frameView->children()) {
        if (!child->isPluginViewBase())
            continue;
        PluginViewBase* pluginViewBase = toPluginViewBase(child.get());
        if (pluginViewBase->wantsWheelEvents())
            nonFastScrollableRegion.unite(pluginViewBase->frameRect());
    }

    for (Frame* subframe = frame->tree().firstChild(); subframe; subframe = subframe->tree().nextSibling())
        nonFastScrollableRegion.unite(computeNonFastScrollableRegion(subframe, offset));

    return nonFastScrollableRegion;
#endif
}
开发者ID:highweb-project,项目名称:highweb-parallelwebkit,代码行数:55,代码来源:ScrollingCoordinator.cpp

示例8:

List<Region> Map2d<Object>::collectregions() {
  int numrs=largest();
  List<Region> rs=List<Region>(numrs);
  for (int i=1;i<=numrs;i++)
    rs.add(Region(width,height));
  for (int i=0;i<width;i++)
  for (int j=0;j<height;j++)
    if (getpos(i,j)>0)
      rs.p2num(getpos(i,j))->list->add(Pixel(i,j));
  return rs;
}
开发者ID:10crimes,项目名称:code,代码行数:11,代码来源:map2d2.c

示例9: BEGIN_TEST

END_TEST

BEGIN_TEST(viewInsideRegion1) 
{
Region r1 = Region(1,2,3,4);
r1.
v.addRegion(r1);
WIN_ASSERT_TRUE(v.clickableRegions.get(r1).isInsideRegion(2,3));


}
开发者ID:vitalema,项目名称:BEER,代码行数:11,代码来源:ViewTest.cpp

示例10: Region

int EQS_D2D::Coefs( ELEM*    elem,
                    PROJECT* project,
                    double** estifm,
                    double*  force )
{
  if( isFS(elem->flag, ELEM::kDry)  ||  isFS(elem->flag, ELEM::kBound) )  return 0;

  Region( elem, project, estifm, force );

  return 1;
}
开发者ID:markuszi,项目名称:Rismo2D,代码行数:11,代码来源:CoefsD2D.cpp

示例11: hw

void LayerBase::drawForSreenShot()
{
    //Dont draw External-only layers
    if (isLayerExternalOnly(getLayer())) {
        return;
    }
    const DisplayHardware& hw(graphicPlane(0).displayHardware());
    setFiltering(true);
    onDraw( Region(hw.bounds()) );
    setFiltering(false);
}
开发者ID:frankinstine,项目名称:frameworks_native,代码行数:11,代码来源:LayerBase.cpp

示例12: computeOverlapRegions

void TextureMapperLayer::paintUsingOverlapRegions(const TextureMapperPaintOptions& options)
{
    Region overlapRegion;
    Region nonOverlapRegion;
    computeOverlapRegions(overlapRegion, nonOverlapRegion, ResolveSelfOverlapAlways);
    if (overlapRegion.isEmpty()) {
        paintSelfAndChildrenWithReplica(options);
        return;
    }

    // Having both overlap and non-overlap regions carries some overhead. Avoid it if the overlap area
    // is big anyway.
    if (overlapRegion.bounds().size().area() > nonOverlapRegion.bounds().size().area()) {
        overlapRegion.unite(nonOverlapRegion);
        nonOverlapRegion = Region();
    }

    nonOverlapRegion.translate(options.offset);
    Vector<IntRect> rects = nonOverlapRegion.rects();

    for (size_t i = 0; i < rects.size(); ++i) {
        IntRect rect = rects[i];
        if (!rect.intersects(options.textureMapper->clipBounds()))
            continue;

        options.textureMapper->beginClip(TransformationMatrix(), rects[i]);
        paintSelfAndChildrenWithReplica(options);
        options.textureMapper->endClip();
    }

    rects = overlapRegion.rects();
    static const size_t OverlapRegionConsolidationThreshold = 4;
    if (nonOverlapRegion.isEmpty() && rects.size() > OverlapRegionConsolidationThreshold) {
        rects.clear();
        rects.append(overlapRegion.bounds());
    }

    IntSize maxTextureSize = options.textureMapper->maxTextureSize();
    IntRect adjustedClipBounds(options.textureMapper->clipBounds());
    adjustedClipBounds.move(-options.offset);
    for (size_t i = 0; i < rects.size(); ++i) {
        IntRect rect = rects[i];
        for (int x = rect.x(); x < rect.maxX(); x += maxTextureSize.width()) {
            for (int y = rect.y(); y < rect.maxY(); y += maxTextureSize.height()) {
                IntRect tileRect(IntPoint(x, y), maxTextureSize);
                tileRect.intersect(rect);
                if (!tileRect.intersects(adjustedClipBounds))
                    continue;

                paintWithIntermediateSurface(options, tileRect);
            }
        }
    }
}
开发者ID:boska,项目名称:webkit,代码行数:54,代码来源:TextureMapperLayer.cpp

示例13: Region

BOOL Manipulator::IsInClient(CPoint pt)
{
	CRect rc = Region(pt);
	if(rc.top>0&&rc.left>0)
	{
		return TRUE;
	}
	else
	{
		return FALSE;
	}
}
开发者ID:uesoft,项目名称:AutoPFA,代码行数:12,代码来源:Manipulator.cpp

示例14:

std::vector<Region> Region::subdivide()
{
	std::vector<Region> out;
	out.reserve(4);

	for (int i = 0; i < 2; i++) {
		for (int z = 0; z < 2; z++) {
			out.push_back(Region(image, threshold, start_x + (i * (size_x / 2)), start_y + (z * (size_y / 2)), (size_x / 2), (size_y / 2)) );
		}
	}
	return out;
}
开发者ID:hanneskiene,项目名称:Image_Processor,代码行数:12,代码来源:Region.cpp

示例15: Region

/** Draws the Control on the Output Display */
void TextEdit::DrawInternal(Region& rgn)
{
	ieWord yOff = FontPosY;
	if (Back) {
		core->GetVideoDriver()->BlitSprite( Back, rgn.x, rgn.y, true );
		if (yOff) yOff += Back->Height;
	}
	if (!font)
		return;

	// FIXME: we should clip text to the background right?
	//The aligning of textedit fields is done by absolute positioning (FontPosX, FontPosY)
	if (hasFocus) {
		font->Print( Region( rgn.x + FontPosX, rgn.y - yOff, rgn.w, rgn.h ), Buffer,
				palette, Alignment,
				true, NULL, Cursor, CurPos );
	} else {
		font->Print( Region( rgn.x + FontPosX, rgn.y - yOff, rgn.w, rgn.h ), Buffer,
				palette, Alignment, true );
	}
}
开发者ID:BehoIder,项目名称:gemrb,代码行数:22,代码来源:TextEdit.cpp


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