本文整理汇总了C++中TRegion::Count方法的典型用法代码示例。如果您正苦于以下问题:C++ TRegion::Count方法的具体用法?C++ TRegion::Count怎么用?C++ TRegion::Count使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRegion
的用法示例。
在下文中一共展示了TRegion::Count方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IsClipped
CHuiCanvasGc::TClipRectVisibility CHuiCanvasGc::IsClipped(const TRect& aRect, const TRegion& aClippingRegion) const
{
TClipRectVisibility isClipped = EFullyOutside;
if (!aClippingRegion.Count())
{
return EFullyInside;
}
if (!aRect.IsEmpty() && aClippingRegion.Count())
{
#if 0
TBool test = EFalse;
if (test)
{
for (TInt i=0; i<aClippingRegion.Count(); i++)
{
#ifdef _DEBUG
RDebug::Print(_L("aClippingRegion Rect: %d %d %d %d"),
aClippingRegion[i].iTl.iX,
aClippingRegion[i].iTl.iY,
aClippingRegion[i].iBr.iX,
aClippingRegion[i].iBr.iY);
#endif
}
}
#endif
if (aClippingRegion.Intersects(aRect))
{
iTempRegion.Clear();
iTempRegion2.Clear();
iTempRegion.AddRect(aRect);
iTempRegion2.Intersection(aClippingRegion, iTempRegion);
iTempRegion2.Tidy();
// Assume it is only partially inside region -> Clipped
isClipped = EPartialOverlap;
if (iTempRegion2.Count() == 1)
{
if (iTempRegion2[0] == aRect)
{
// Fully inside region -> Not clipped
isClipped = EFullyInside;
}
}
}
else
{
// No overlap -> aRect is completely outside region -> Clipped
isClipped = EFullyOutside;
}
}
return isClipped;
}
示例2: CheckRectRegion
void TestRRegion::CheckRectRegion(const TRegion& region,const TRect& rect)
// Check the region matches the rectangle
{
const TRect* rlist;
if (rect.IsEmpty())
test(region.Count()==0);
else
{
test(region.Count()==1);
rlist=region.RectangleList();
test(rlist[0]==rect);
test(region[0]==rect);
}
}
示例3: Update
void RWindows::Update(const TRegion& aRgn,const TSize& aSize)
{
if(aRgn.CheckError())
UpdateRect(TRect(aSize),aSize);
else
for(TInt count=0;count<aRgn.Count();count++)
UpdateRect(aRgn[count],aSize);
}
示例4: LogRegion
void CDataWrapperBase::LogRegion(const TDesC& aMessage, const TRegion& aRegion)
{
INFO_PRINTF2(KLogRegion, &aMessage);
TInt indCount = aRegion.Count();
if ( indCount==0 )
{
INFO_PRINTF1(KLogEmpty);
}
else
{
const TRect* rect=aRegion.RectangleList();
for ( TInt index=0; index<indCount; ++index )
{
INFO_PRINTF6(KLogRegionsRect, index, rect[index].iTl.iX, rect[index].iTl.iY, rect[index].iBr.iX, rect[index].iBr.iY);
}
}
}
示例5: GetRegionFromConfig
TBool CDataWrapperBase::GetRegionFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRegion& aResult)
{
TBuf<KMaxTestExecuteCommandLength> tempStore;
TRect rect;
aResult.Clear();
TBool moreData=ETrue;
for ( TInt index=0; moreData; )
{
tempStore.Format(KFormatFieldNumber, &aKeyName, ++index);
moreData=GetRectFromConfig(aSectName, tempStore, rect);
if ( moreData )
{
aResult.AddRect(rect);
}
}
return aResult.Count()>0;
}
示例6: ClipRegion
EXPORT_C void CHuiCanvasGc::ClipRegion(const TRegion& aClipRegion)
{
if (!iGc)
{
return;
}
switch (iClipMode)
{
case EHuiCanvasClipModeNormal:
{
// If previous clipping region set, cancel it first.
if (iClippingRegion.Count())
{
CancelClipping();
}
// Set new region, ignore empty rects if any
for (TInt i=0; i < aClipRegion.Count(); i++)
{
if (!aClipRegion[i].IsEmpty())
{
iClippingRegion.AddRect(aClipRegion[i]);
}
}
iClippingRegion.Tidy();
if (iClippingRegion.Count() == 1)
{
// If only one rect, then do simple clipping...
iGc->Enable(CHuiGc::EFeatureClipping);
iGc->PushClip();
iGc->Clip(iClippingRegion[0]);
}
else if (iClippingRegion.Count() > 1)
{
// ...otherewise must do region clipping.
iGc->Enable(CHuiGc::EFeatureClipping);
iGc->PushClip();
if (MaxNumberOfClipRects() > 1)
{
iGc->Clip(iClippingRegion);
}
else
{
// region clipping is not available, try boundingrect
iGc->Clip(iClippingRegion.BoundingRect());
}
}
else
{
// No clip rects set, do nothing here.
}
break;
}
case EHuiCanvasClipModeDelayed:
{
// If previous clipping region set, cancel it first.
if (iClippingRegion.Count())
{
CancelClipping();
}
// Set new region, ignore empty rects if any
for (TInt i=0; i < aClipRegion.Count(); i++)
{
if (!aClipRegion[i].IsEmpty())
{
iClippingRegion.AddRect(aClipRegion[i]);
}
}
iClippingRegion.Tidy();
break;
}
case EHuiCanvasClipModeNone:
default:
{
// Do nothing
break;
}
}
}
示例7: CachedDraw
//.........这里部分代码省略.........
if (IsCachedRenderTargetSupported() && IsCachedRenderTargetPreferred())
{
// Background needs to be captured from surface if effect uses background AND
// Visual is transparent or margin is enabled AND
// Background has not been disabled with a effect specific flag
TBool enableBackground = IsAppliedToBackground() && (!aOpaque || iRoot->IsMarginEnabled()) && !(EffectFlags() & KHuiFxDisableBackground);
if (EffectFlags() & KHuiFxEnableBackgroundInAllLayers)
{
enableBackground = ETrue;
}
TBool useFrozenBackground = (EffectFlags() & KHuiFxFrozenBackground);
// Check if cache is up-to date or does it need to be refreshed
TBool cachedRenderTargetNeedsRefresh = (iRoot->Changed() || aRefreshCachedRenderTarget || (enableBackground && !useFrozenBackground));
if (!iCachedRenderTarget || (iCachedRenderTarget && iCachedRenderTarget->Size() != iRoot->VisualRect().Size()))
{
cachedRenderTargetNeedsRefresh = ETrue;
}
// Try to apply also margins, we cannot just use aDisplayRect directly
TRect targetRect = iRoot->VisualRect();
// Size is always same as target rect. It contains margins if those are enabled.
TSize cachedRenderTargetSize = targetRect.Size();
// Prepare cached offscreen render target
PrepareCachedRenderTarget(targetRect.iTl, cachedRenderTargetSize, cachedRenderTargetNeedsRefresh, enableBackground);
// If it is available, then lets do it
if (iCachedRenderTarget)
{
// Disable clipping, otherwise strange things happen.
aGc.Disable(CHuiGc::EFeatureClipping);
if (cachedRenderTargetNeedsRefresh)
{
// Render to cached render target
iRoot->Draw(*iEngine, aGc, *iCachedRenderTarget, *iCachedRenderTarget, aHasSurface);
#ifdef HUIFX_TRACE
RDebug::Print(_L("CHuiFxEffect::CachedDraw - refreshed cached render buffer 0x%x"), this);
#endif
}
if (aClipRegion.Count())
{
aGc.Enable(CHuiGc::EFeatureClipping);
aGc.PushClip();
aGc.Clip(aClipRegion);
}
// Write cached buffer to the display
iEngine->Composite(aGc, *iCachedRenderTarget, targetRect.iTl, aOpaque && !(EffectFlags() & KHuiFxAlwaysBlend), aAlpha);
if (aClipRegion.Count())
{
aGc.PopClip();
}
aGc.Enable(CHuiGc::EFeatureClipping);
#ifdef HUIFX_TRACE
RDebug::Print(_L("CHuiFxEffect::CachedDraw - Cached render buffer drawn 0x%x"), this);
RDebug::Print(_L("CHuiFxEffect::CachedDraw - displayrect: %i,%i, %i,%i "),
aDisplayRect.iTl.iX,
aDisplayRect.iTl.iY,
aDisplayRect.iBr.iX,
aDisplayRect.iBr.iY);
#endif
}
else
{
// It might not be available e.g. in low memory situations, just indiacte that we could not draw.
return EFalse;
}
}
else
{
// Release cached render target just in case it is reserved for some reason
ReleaseCachedRenderTarget();
// Use default onscreen render target
if (!target)
{
target = iEngine->DefaultRenderbuffer();
}
if (!target)
{
return EFalse;
}
// Normal drawing
iRoot->Draw(*iEngine, aGc, *target, *target, aHasSurface);
}
return ETrue;
}