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


C++ Bounds::getMin方法代码示例

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


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

示例1: launchEditDialog

void StickyNoteActor::launchEditDialog(bool selectExistingText)
{
	_selectExistingText = selectExistingText;

	// NOTE: for the future, we may want QuickLook-like behaviour where
	// we follow the sticky notes as the user clicks around on the screen.
	// If so, then we should keep a reference to the existing dialog some
	// where and pass it into this launch process?
	
	// if one does not exist, create a new sticky not dialog
	// and center it
	if (!_editDialog)
		_editDialog = new StickyNoteEditDialog();
	else
	{
		// close the dialog and disconnect all signals
		_editDialog->accept();
		_editDialog->disconnect();
	}
	
	// setup all the connections
	connect(_editDialog, SIGNAL(finished(int)), this, SLOT(finishedEditing()));
	connect(_editDialog, SIGNAL(accepted()), this, SLOT(finishedEditing()));
	connect(_editDialog, SIGNAL(rejected()), this, SLOT(finishedEditing()));

	// move it to the appropriate place
	const int marginLeftRight = 20;
	const int marginTopBottom = -20;
	Bounds b = this->getScreenBoundingBox();
	POINT windowPos = {0, 0};
	ClientToScreen(winOS->GetWindowsHandle(), &windowPos);
	Vec3 screenMin = b.getMin() + Vec3(windowPos.x, windowPos.y, 0);
	Vec3 screenMax = b.getMax() + Vec3(windowPos.x, windowPos.y, 0);
	Vec3 screenDims = Vec3(winOS->GetWindowWidth(), winOS->GetWindowHeight(), 0);
	Vec3 tr(NxMath::max(screenMin.x, screenMax.x), NxMath::min(screenMin.y, screenMax.y), 0);
	Vec3 tl(NxMath::min(screenMin.x, screenMax.x), NxMath::min(screenMin.y, screenMax.y), 0);
	int yBound = NxMath::min(NxMath::max((int) tr.y + marginTopBottom, windowPos.y + abs(marginTopBottom)), windowPos.y + (int) screenDims.y - abs(marginTopBottom) - _editDialog->height());
	if ((tr.x + marginLeftRight + _editDialog->width()) <= (windowPos.x + screenDims.x - marginLeftRight))
	{
		// put this note to the right of this actor
		_editDialog->move(tr.x + marginLeftRight, yBound);
	}
	else if ((tl.x - marginLeftRight - _editDialog->width()) >= marginLeftRight)
	{
		// put this note to the left of this actor
		_editDialog->move((tl.x - marginLeftRight - _editDialog->width()), yBound);
	}

	Mat34 finalPose;
	Vec3 finalDims;
	calculateDialogPoseDims(finalPose, finalDims);
	const int StickyNoteActorNumTempActorSteps = 13;
	const int StickyNoteActorNumStickySteps = 8;
	
	// create a new proxy actor
	assert(!_tmpAnimationActor);
	_tmpAnimationActor = new Actor();
	_tmpAnimationActor->pushActorType(Temporary);
	_tmpAnimationActor->setObjectToMimic(this);
	_tmpAnimationActor->setFrozen(false);
	_tmpAnimationActor->setGravity(false);
	_tmpAnimationActor->setCollisions(false);
	_tmpAnimationActor->setAlphaAnim(0.0f, 1.0f, StickyNoteActorNumTempActorSteps);
	_tmpAnimationActor->setSizeAnim(lerpRange(getDims(), finalDims, StickyNoteActorNumTempActorSteps, SoftEase));
	_tmpAnimationActor->setPoseAnim(slerpPose(getGlobalPose(), finalPose, StickyNoteActorNumTempActorSteps, SoftEase), (FinishedCallBack) EditStickyNoteAfterAnim, NULL);
	setAlphaAnim(getAlpha(), 0.4f, StickyNoteActorNumStickySteps);
}
开发者ID:DX94,项目名称:BumpTop,代码行数:67,代码来源:BT_StickyNoteActor.cpp


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