本文整理汇总了C++中Viewport::commitDamage方法的典型用法代码示例。如果您正苦于以下问题:C++ Viewport::commitDamage方法的具体用法?C++ Viewport::commitDamage怎么用?C++ Viewport::commitDamage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Viewport
的用法示例。
在下文中一共展示了Viewport::commitDamage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void execute()
{
Allocation rect;
getAllocation( rect );
try
{
Allocation a = d_model->getAllocation();
Viewport* v = getHandler()->getViewport();
assert( v );
Viewport::pushCursor( Viewport::CurWait );
if( rect.getWidth() != 0 && rect.getHeight() != 0 )
{
v->captureDamage();
PpmRange rx, ry;
rx.first = d_model->toPpm( rect.getLeft(), a.getLeft(), DimX );
rx.second = d_model->toPpm( rect.getRight(), a.getLeft(), DimX );
ry.first = d_model->toPpm( rect.getTop(), a.getTop(), DimY );
ry.second = d_model->toPpm( rect.getBottom(), a.getTop(), DimY );
d_target->setRange( rx, ry );
v->commitDamage();
}else
{
d_target->centerPoint( d_model->toPpm( rect.getLeft(), a.getLeft(), DimX ),
d_model->toPpm( rect.getTop(), a.getTop(), DimY ) );
}
v->damageAll();
Viewport::popCursor();
}catch( ... )
{
qDebug( "Exception in _OverviewCmd" );
}
Command::execute();
}
示例2: execute
void execute()
{
Allocation rect;
getAllocation( rect );
if( rect.getWidth() != 0 && rect.getHeight() != 0 )
{
Allocation a = d_model->getAllocation();
Viewport* p = getController()->getViewport();
assert( p );
p->pushCursor( Viewport::CurWait );
p->captureDamage();
if( d_do[ DimY ] && d_model->inUse( DimY ) &&
d_do[ DimX ] && d_model->inUse( DimX ) )
{
PpmRange rx;
rx.first = d_model->toPpm( rect.getLeft(), a.getLeft(), DimX );
rx.second = d_model->toPpm( rect.getRight(), a.getLeft(), DimX );
PpmRange ry;
ry.first = d_model->toPpm( rect.getTop(), a.getTop(), DimY );
ry.second = d_model->toPpm( rect.getBottom(), a.getTop(), DimY );
d_model->setRange( rx, ry );
}else if( d_do[ DimX ] && d_model->inUse( DimX ) )
{
PpmRange rx;
rx.first = d_model->toPpm( rect.getLeft(), a.getLeft(), DimX );
rx.second = d_model->toPpm( rect.getRight(), a.getLeft(), DimX );
d_model->setRange( DimX, rx );
}else if( d_do[ DimY ] && d_model->inUse( DimY ) )
{
PpmRange ry;
ry.first = d_model->toPpm( rect.getTop(), a.getTop(), DimY );
ry.second = d_model->toPpm( rect.getBottom(), a.getTop(), DimY );
d_model->setRange( DimY, ry );
}
p->commitDamage();
p->popCursor();
d_model->redraw(p);
}
Command::execute();
}