本文整理汇总了C++中MDrawRequest::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ MDrawRequest::setColor方法的具体用法?C++ MDrawRequest::setColor怎么用?C++ MDrawRequest::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MDrawRequest
的用法示例。
在下文中一共展示了MDrawRequest::setColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setWireFrameColors
void ProceduralHolderUI::setWireFrameColors( MDrawRequest &request, M3dView::DisplayStatus status )
{
// yes, this does use magic numbers for the color indices, and
// no, i don't know how to get them properly. the quadricShape api
// example is just doing this too.
switch( status )
{
case M3dView::kLead :
request.setColor( 18, M3dView::kActiveColors );
break;
case M3dView::kActive :
request.setColor( 15, M3dView::kActiveColors );
break;
case M3dView::kActiveAffected :
request.setColor( 8, M3dView::kActiveColors );
break;
case M3dView::kHilite :
request.setColor( 17, M3dView::kActiveColors );
break;
case M3dView::kTemplate :
request.setColor( 2, M3dView::kDormantColors );
break;
case M3dView::kActiveTemplate :
request.setColor( 19, M3dView::kActiveColors );
break;
default :
// dormant
request.setColor( 4, M3dView::kDormantColors );
break;
}
}
示例2: getDrawRequests
void DrawableHolderUI::getDrawRequests( const MDrawInfo &info, bool objectAndActiveOnly, MDrawRequestQueue &requests )
{
// it's easy if noone want to look at us
if( !info.objectDisplayStatus( M3dView::kDisplayLocators ) )
{
return;
}
// the node we're meant to be drawing
DrawableHolder *drawableHolder = dynamic_cast<DrawableHolder *>( surfaceShape() );
if( !drawableHolder )
{
return;
}
// do we actually want to draw it?
MPlug pDraw( drawableHolder->thisMObject(), DrawableHolder::aDraw );
bool draw = true;
pDraw.getValue( draw );
if( !draw )
{
return;
}
// draw data encapsulating that node
MDrawData drawData;
getDrawData( drawableHolder, drawData );
MDrawRequest request = info.getPrototype( *this );
request.setDrawData( drawData );
// set correct drawing colour:
switch( info.displayStatus() )
{
case M3dView::kLead :
request.setColor( 18, M3dView::kActiveColors );
break;
case M3dView::kActive :
request.setColor( 15, M3dView::kActiveColors );
break;
case M3dView::kActiveAffected :
request.setColor( 8, M3dView::kActiveColors );
break;
case M3dView::kHilite :
request.setColor( 17, M3dView::kActiveColors );
break;
case M3dView::kTemplate :
request.setColor( 2, M3dView::kDormantColors );
break;
case M3dView::kActiveTemplate :
request.setColor( 19, M3dView::kActiveColors );
break;
default :
// dormant
request.setColor( 4, M3dView::kDormantColors );
break;
}
requests.add( request );
}
示例3: getDrawRequests
/* override */
void apiSimpleShapeUI::getDrawRequests( const MDrawInfo & info,
bool objectAndActiveOnly,
MDrawRequestQueue & queue )
//
// Description:
//
// Add draw requests to the draw queue
//
// Arguments:
//
// info - current drawing state
// objectsAndActiveOnly - no components if true
// queue - queue of draw requests to add to
//
{
// Get the data necessary to draw the shape
//
MDrawData data;
apiSimpleShape* shape = (apiSimpleShape*) surfaceShape();
MVectorArray* geomPtr = shape->getControlPoints();
// This call creates a prototype draw request that we can fill
// in and then add to the draw queue.
//
MDrawRequest request = info.getPrototype( *this );
// Stuff our data into the draw request, it'll be used when the drawing
// actually happens
getDrawData( geomPtr, data );
request.setDrawData( data );
// Decode the draw info and determine what needs to be drawn
//
M3dView::DisplayStyle appearance = info.displayStyle();
M3dView::DisplayStatus displayStatus = info.displayStatus();
switch ( appearance )
{
case M3dView::kWireFrame :
{
request.setToken( kDrawWireframe );
M3dView::ColorTable activeColorTable = M3dView::kActiveColors;
M3dView::ColorTable dormantColorTable = M3dView::kDormantColors;
switch ( displayStatus )
{
case M3dView::kLead :
request.setColor( LEAD_COLOR, activeColorTable );
break;
case M3dView::kActive :
request.setColor( ACTIVE_COLOR, activeColorTable );
break;
case M3dView::kActiveAffected :
request.setColor( ACTIVE_AFFECTED_COLOR, activeColorTable );
break;
case M3dView::kDormant :
request.setColor( DORMANT_COLOR, dormantColorTable );
break;
case M3dView::kHilite :
request.setColor( HILITE_COLOR, activeColorTable );
break;
default:
break;
}
queue.add( request );
break;
}
case M3dView::kGouraudShaded :
{
// Create the smooth shaded draw request
//
request.setToken( kDrawSmoothShaded );
// Need to get the material info
//
MDagPath path = info.multiPath(); // path to your dag object
M3dView view = info.view();; // view to draw to
MMaterial material = MPxSurfaceShapeUI::material( path );
// Evaluate the material and if necessary, the texture.
//
if ( ! material.evaluateMaterial( view, path ) ) {
cerr << "Couldnt evaluate\n";
}
bool drawTexture = true;
if ( drawTexture && material.materialIsTextured() ) {
material.evaluateTexture( data );
}
request.setMaterial( material );
//.........这里部分代码省略.........