本文整理汇总了C++中setCurrentTool函数的典型用法代码示例。如果您正苦于以下问题:C++ setCurrentTool函数的具体用法?C++ setCurrentTool怎么用?C++ setCurrentTool使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setCurrentTool函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setCurrentTool
BOOL LLToolCompGun::handleHover(S32 x, S32 y, MASK mask)
{
// *NOTE: This hack is here to make mouselook kick in again after
// item selected from context menu.
if ( mCur == mNull && !gPopupMenuView->getVisible() )
{
LLSelectMgr::getInstance()->deselectAll();
setCurrentTool( (LLTool*) mGrab );
}
// Note: if the tool changed, we can't delegate the current mouse event
// after the change because tools can modify the mouse during selection and deselection.
// Instead we let the current tool handle the event and then make the change.
// The new tool will take effect on the next frame.
mCur->handleHover( x, y, mask );
// If mouse button not down...
if( !gViewerWindow->getLeftMouseDown())
{
// let ALT switch from gun to grab
if ( mCur == mGun && (mask & MASK_ALT) )
{
setCurrentTool( (LLTool*) mGrab );
}
else if ( mCur == mGrab && !(mask & MASK_ALT) )
{
setCurrentTool( (LLTool*) mGun );
setMouseCapture(TRUE);
}
}
return TRUE;
}
示例2: QMainWindow
MainWindow2::MainWindow2( QWidget *parent ) :
QMainWindow( parent ),
ui( new Ui::MainWindow2 )
{
ui->setupUi( this );
m_object = new Object();
m_object->defaultInitialisation();
editor = new Editor( this );
m_pScribbleArea = editor->getScribbleArea();
m_pTimeLine = new TimeLine( this, editor );
makeTimeLineConnections();
arrangePalettes();
createMenus();
loadAllShortcuts();
// must run after 'arragePalettes'
editor->setObject( m_object );
editor->resetUI();
readSettings();
makeColorPaletteConnections();
makeColorWheelConnections();
connect(editor, SIGNAL(needSave()), this, SLOT(saveDocument()));
connect(m_pToolSet, SIGNAL(clearButtonClicked()), editor, SLOT(clearCurrentFrame()));
connect(editor, SIGNAL(changeTool(ToolType)), m_pToolSet, SLOT(setCurrentTool(ToolType)));
editor->setCurrentLayer( this->editor->m_pObject->getLayerCount() - 1 );
}
示例3: mBaseTool
LLToolMgr::LLToolMgr()
:
mBaseTool(NULL),
mSavedTool(NULL),
mTransientTool( NULL ),
mOverrideTool( NULL ),
mSelectedTool( NULL ),
mCurrentToolset( NULL )
{
// Not a panel, register these callbacks globally.
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this));
// LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this));
// [RLVa:KB] - Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d | Ansa: Changed because of FIRE-5552
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&RlvUIEnabler::isBuildEnabled));
// [/RLVa:KB]
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this, _2));
gToolNull = new LLTool(LLStringUtil::null); // Does nothing
setCurrentTool(gToolNull);
gBasicToolset = new LLToolset();
gCameraToolset = new LLToolset();
// gLandToolset = new LLToolset();
gMouselookToolset = new LLToolset();
gFaceEditToolset = new LLToolset();
gMouselookToolset->setShowFloaterTools(false);
gFaceEditToolset->setShowFloaterTools(false);
}
示例4: AbstractViewInspector
QDeclarativeViewInspector::QDeclarativeViewInspector(QDeclarativeView *view,
QObject *parent) :
AbstractViewInspector(parent),
data(new QDeclarativeViewInspectorPrivate(this))
{
data->view = view;
data->manipulatorLayer = new LiveLayerItem(view->scene());
data->selectionTool = new LiveSelectionTool(this);
data->zoomTool = new ZoomTool(this);
data->colorPickerTool = new ColorPickerTool(this);
data->boundingRectHighlighter = new BoundingRectHighlighter(this);
setCurrentTool(data->selectionTool);
// to capture ChildRemoved event when viewport changes
data->view->installEventFilter(this);
data->setViewport(data->view->viewport());
connect(data->view, SIGNAL(statusChanged(QDeclarativeView::Status)),
data.data(), SLOT(_q_onStatusChanged(QDeclarativeView::Status)));
connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
SIGNAL(selectedColorChanged(QColor)));
connect(data->colorPickerTool, SIGNAL(selectedColorChanged(QColor)),
this, SLOT(sendColorChanged(QColor)));
changeTool(InspectorProtocol::SelectTool);
}
示例5: setCurrentTool
void LLToolCompInspect::keyUp(KEY key, MASK mask)
{
if (KEY_ALT == key && mCur == LLToolCamera::getInstance())
{
setCurrentTool(mDefault);
mIsToolCameraActive = FALSE;
}
}
示例6: LLToolComposite
LLToolCompGun::LLToolCompGun()
: LLToolComposite(std::string("Mouselook"))
{
mGun = new LLToolGun(this);
mGrab = new LLToolGrab(this);
mNull = sNullTool;
setCurrentTool(mGun);
mDefault = mGun;
}
示例7: setCurrentTool
void LLToolCompGun::onMouseCaptureLost()
{
if (mComposite)
{
mComposite->onMouseCaptureLost();
return;
}
mCur->onMouseCaptureLost();
// JC - I don't know if this is necessary. Maybe we could lose capture
// if someone ALT-Tab's out when in mouselook.
setCurrentTool( (LLTool*) mGun );
}
示例8: LLToolComposite
LLToolCompGun::LLToolCompGun()
: LLToolComposite(std::string("Mouselook"))
, mMenuShown(false), mTimerFOV(), mOriginalFOV(), mStartFOV(), mTargetFOV()
{
mGun = new LLToolGun(this);
mGrab = new LLToolGrab(this);
mNull = sNullTool;
setCurrentTool(mGun);
mDefault = mGun;
mTimerFOV.stop();
}
示例9: viewport
void QgsComposerView::keyReleaseEvent( QKeyEvent * e )
{
if ( e->key() == Qt::Key_Space && !e->isAutoRepeat() && mPanning )
{
//end of panning with space key
mPanning = false;
//reset cursor
if ( mCurrentTool == Pan )
{
viewport()->setCursor( Qt::OpenHandCursor );
}
else
{
if ( composition() )
{
//allow cursor changes again
composition()->setPreventCursorChange( false );
}
viewport()->setCursor( Qt::ArrowCursor );
}
return;
}
else if ( e->key() == Qt::Key_Space && !e->isAutoRepeat() && mTemporaryZoomStatus != QgsComposerView::Inactive )
{
//temporary keyboard-based zoom tool is active and space key has been released
if ( mMarqueeZoom )
{
//currently in the middle of a marquee operation, so don't switch tool back immediately
//instead, wait until mouse button has been released before switching tool back
mTemporaryZoomStatus = QgsComposerView::ActiveUntilMouseRelease;
}
else
{
//switch tool back
mTemporaryZoomStatus = QgsComposerView::Inactive;
setCurrentTool( mPreviousTool );
}
}
else if ( mCurrentTool == QgsComposerView::Zoom )
{
//if zoom tool is active, respond to changes in the shift key status and update cursor accordingly
if ( ! e->isAutoRepeat() )
{
QPixmap myZoomQPixmap = QPixmap(( const char ** )( e->modifiers() & Qt::ShiftModifier ? zoom_out : zoom_in ) );
QCursor zoomCursor = QCursor( myZoomQPixmap, 7, 7 );
viewport()->setCursor( zoomCursor );
}
return;
}
}
示例10: mBaseTool
LLToolMgr::LLToolMgr()
:
mBaseTool(NULL),
mSavedTool(NULL),
mTransientTool( NULL ),
mOverrideTool( NULL ),
mSelectedTool( NULL ),
mCurrentToolset( NULL )
{
gToolNull = new LLTool(LLStringUtil::null); // Does nothing
setCurrentTool(gToolNull);
gBasicToolset = new LLToolset();
gCameraToolset = new LLToolset();
// gLandToolset = new LLToolset();
gMouselookToolset = new LLToolset();
gFaceEditToolset = new LLToolset();
}
示例11: setCurrentTool
void LLToolMgr::setCurrentToolset(LLToolset* current)
{
if (!current) return;
// switching toolsets?
if (current != mCurrentToolset)
{
// deselect current tool
if (mSelectedTool)
{
mSelectedTool->handleDeselect();
}
mCurrentToolset = current;
// select first tool of new toolset only if toolset changed
mCurrentToolset->selectFirstTool();
}
// update current tool based on new toolset
setCurrentTool( mCurrentToolset->getSelectedTool() );
}
示例12: mBaseTool
LLToolMgr::LLToolMgr()
:
mBaseTool(NULL),
mSavedTool(NULL),
mTransientTool( NULL ),
mOverrideTool( NULL ),
mSelectedTool( NULL ),
mCurrentToolset( NULL )
{
gToolNull = new LLTool(LLStringUtil::null); // Does nothing
setCurrentTool(gToolNull);
gBasicToolset = new LLToolset("Basic");
gCameraToolset = new LLToolset("Camera");
// gLandToolset = new LLToolset("Land");
gMouselookToolset = new LLToolset("MouseLook");
gFaceEditToolset = new LLToolset("FaceEdit");
gMouselookToolset->setShowFloaterTools(false);
gFaceEditToolset->setShowFloaterTools(false);
}
示例13: switch
void SGViewInspector::changeTool(InspectorProtocol::Tool tool)
{
switch (tool) {
case InspectorProtocol::ColorPickerTool:
// TODO
emit colorPickerActivated();
break;
case InspectorProtocol::SelectMarqueeTool:
// TODO
emit marqueeSelectToolActivated();
break;
case InspectorProtocol::SelectTool:
setCurrentTool(m_selectionTool);
emit selectToolActivated();
break;
case InspectorProtocol::ZoomTool:
// TODO
emit zoomToolActivated();
break;
}
}
示例14: viewportRect
void QgsComposerView::endMarqueeZoom( QMouseEvent* e )
{
mMarqueeZoom = false;
QRectF boundsRect;
if ( !mRubberBandItem || ( mRubberBandItem->rect().width() < 0.1 && mRubberBandItem->rect().height() < 0.1 ) )
{
//just a click, so zoom to clicked point and recenter
double scaleFactor = 0.5;
//get current visible part of scene
QRect viewportRect( 0, 0, viewport()->width(), viewport()->height() );
QgsRectangle visibleRect = QgsRectangle( mapToScene( viewportRect ).boundingRect() );
//transform the mouse pos to scene coordinates
QPointF scenePoint = mapToScene( e->pos() );
visibleRect.scale( scaleFactor, scenePoint.x(), scenePoint.y() );
boundsRect = visibleRect.toRectF();
}
else
{
//marquee zoom
//zoom bounds are size marquee object
boundsRect = QRectF( mRubberBandItem->transform().dx(), mRubberBandItem->transform().dy(),
mRubberBandItem->rect().width(), mRubberBandItem->rect().height() );
}
removeRubberBand();
//zoom view to fit desired bounds
fitInView( boundsRect, Qt::KeepAspectRatio );
if ( mTemporaryZoomStatus == QgsComposerView::ActiveUntilMouseRelease )
{
//user was using the temporary keyboard activated zoom tool
//and the control or space key was released before mouse button, so end temporary zoom
mTemporaryZoomStatus = QgsComposerView::Inactive;
setCurrentTool( mPreviousTool );
}
}
示例15: mBaseTool
LLToolMgr::LLToolMgr()
:
mBaseTool(NULL),
mSavedTool(NULL),
mTransientTool( NULL ),
mOverrideTool( NULL ),
mSelectedTool( NULL ),
mCurrentToolset( NULL )
{
// Not a panel, register these callbacks globally.
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this));
gToolNull = new LLTool(LLStringUtil::null); // Does nothing
setCurrentTool(gToolNull);
gBasicToolset = new LLToolset();
gCameraToolset = new LLToolset();
// gLandToolset = new LLToolset();
gMouselookToolset = new LLToolset();
gFaceEditToolset = new LLToolset();
}