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


C++ MEvent::isModifierControl方法代码示例

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


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

示例1: selection

MStatus SelectRingContext2::doPress( MEvent &event )
{
	listAdjust = MGlobal::kReplaceList;
	
	// Determine which modifier keys were pressed
	if( event.isModifierShift() || event.isModifierControl() ) 
	{
		if( event.isModifierShift() ) 
		{
			if( event.isModifierControl() ) 
				listAdjust = MGlobal::kAddToList; // Shift+Ctrl: Merge selection
			else
				listAdjust = MGlobal::kXORWithList; // Shift: Toggle selection (XOR)
		} 
		else
		{
			if( event.isModifierControl() )
				listAdjust = MGlobal::kRemoveFromList; // Ctrl: Remove selection
		}
	}
	
	// Get the position of the mouse click
	event.getPosition( pressX, pressY );

	return MS::kSuccess;		
}
开发者ID:animformed,项目名称:complete-maya-programming-book-files,代码行数:26,代码来源:SelectRingContext2.cpp

示例2: doPressCommon

void marqueeContext::doPressCommon( MEvent & event )
{
	// Figure out which modifier keys were pressed, and set up the
	// listAdjustment parameter to reflect what to do with the selected points.
	if (event.isModifierShift() || event.isModifierControl() ) {
		if ( event.isModifierShift() ) {
			if ( event.isModifierControl() ) {
				// both shift and control pressed, merge new selections
				listAdjustment = MGlobal::kAddToList;
			} else {
				// shift only, xor new selections with previous ones
				listAdjustment = MGlobal::kXORWithList;
			}
		} else if ( event.isModifierControl() ) {
			// control only, remove new selections from the previous list
			listAdjustment = MGlobal::kRemoveFromList; 
		}
	} else {
		listAdjustment = MGlobal::kReplaceList;
	}

	// Extract the event information
	//
	event.getPosition( start_x, start_y );
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:25,代码来源:marqueeTool.cpp

示例3: doPress

MStatus marqueeContext::doPress( MEvent & event )
//
// Begin marquee drawing (using OpenGL)
// Get the start position of the marquee 
//
{

		// Figure out which modifier keys were pressed, and set up the
	// listAdjustment parameter to reflect what to do with the selected points.
	if (event.isModifierShift() || event.isModifierControl() ) {
		if ( event.isModifierShift() ) {
			if ( event.isModifierControl() ) {
				// both shift and control pressed, merge new selections
				listAdjustment = MGlobal::kAddToList;
			} else {
				// shift only, xor new selections with previous ones
				listAdjustment = MGlobal::kXORWithList;
			}
		} else if ( event.isModifierControl() ) {
			// control only, remove new selections from the previous list
			listAdjustment = MGlobal::kRemoveFromList; 
		}
	} else {
		listAdjustment = MGlobal::kReplaceList;
	}

	// Extract the event information
	//
	event.getPosition( start_x, start_y );

	// Enable OpenGL drawing on viewport
	view = M3dView::active3dView();
	view.beginGL();

#ifdef USE_SOFTWARE_OVERLAYS
	p_last_x = start_x;
	p_last_y = start_y;

	fsDrawn = false;
#else
	// If HW overlays supported then initialize the overlay plane for drawing.
	view.beginOverlayDrawing();
#endif

	return MS::kSuccess;		
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:46,代码来源:marqueeTool.cpp

示例4: doPress

MStatus lassoTool::doPress( MEvent & event )
// Set up for overlay drawing, and remember our starting point
{
	// Figure out which modifier keys were pressed, and set up the
	// listAdjustment parameter to reflect what to do with the selected points.
	if (event.isModifierShift() || event.isModifierControl() ) {
		if ( event.isModifierShift() ) {
			if ( event.isModifierControl() ) {
				// both shift and control pressed, merge new selections
				listAdjustment = MGlobal::kAddToList;
			} else {
				// shift only, xor new selections with previous ones
				listAdjustment = MGlobal::kXORWithList;
			}
		} else if ( event.isModifierControl() ) {
			// control only, remove new selections from the previous list
			listAdjustment = MGlobal::kRemoveFromList; 
		}
	} else {
		listAdjustment = MGlobal::kReplaceList;
	}

	// Get the active 3D view.
	//
	view = M3dView::active3dView();

	// Create an array to hold the lasso points. Assume no mem failures
	maxSize = initialSize;
	lasso = (coord*) malloc (sizeof(coord) * maxSize);

	coord start;
	event.getPosition( start.h, start.v );
	num_points = 1;
	lasso[0] = min = max = start;

	firstDraw = true;

	return MS::kSuccess;
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:39,代码来源:lassoTool.cpp


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