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


C++ setCurrentTool函数代码示例

本文整理汇总了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; 
}
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:34,代码来源:lltoolcomp.cpp

示例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 );
}
开发者ID:Verlet,项目名称:pencil,代码行数:33,代码来源:mainwindow2.cpp

示例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);
}
开发者ID:gabeharms,项目名称:firestorm,代码行数:28,代码来源:lltoolmgr.cpp

示例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);
}
开发者ID:wpbest,项目名称:copperspice,代码行数:28,代码来源:qdeclarativeviewinspector.cpp

示例5: setCurrentTool

void LLToolCompInspect::keyUp(KEY key, MASK mask)
{
	if (KEY_ALT == key && mCur == LLToolCamera::getInstance())
	{
		setCurrentTool(mDefault);
		mIsToolCameraActive = FALSE;
	}
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:8,代码来源:lltoolcomp.cpp

示例6: LLToolComposite

LLToolCompGun::LLToolCompGun()
	: LLToolComposite(std::string("Mouselook"))
{
	mGun = new LLToolGun(this);
	mGrab = new LLToolGrab(this);
	mNull = sNullTool;

	setCurrentTool(mGun);
	mDefault = mGun;
}
开发者ID:Barosonix,项目名称:AstraViewer,代码行数:10,代码来源:lltoolcomp.cpp

示例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 );
}
开发者ID:Boy,项目名称:rainbow,代码行数:13,代码来源:lltoolcomp.cpp

示例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();
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:13,代码来源:lltoolcomp.cpp

示例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;
  }
}
开发者ID:kiith-sa,项目名称:QGIS,代码行数:51,代码来源:qgscomposerview.cpp

示例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();
}
开发者ID:meta7,项目名称:Meta7-Viewer,代码行数:18,代码来源:lltoolmgr.cpp

示例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() );
}
开发者ID:meta7,项目名称:Meta7-Viewer,代码行数:19,代码来源:lltoolmgr.cpp

示例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);
}
开发者ID:CmdrCupcake,项目名称:SingularityViewer,代码行数:20,代码来源:lltoolmgr.cpp

示例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;
    }
}
开发者ID:yinyunqiao,项目名称:qtdeclarative,代码行数:21,代码来源:sgviewinspector.cpp

示例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 );
  }
}
开发者ID:kiith-sa,项目名称:QGIS,代码行数:40,代码来源:qgscomposerview.cpp

示例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();
}
开发者ID:HyangZhao,项目名称:NaCl-main,代码行数:23,代码来源:lltoolmgr.cpp


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