developer:sdksamples:ghostedshade


Ghosting Viewports

C++

Summary: Demonstrates how to set a viewport to ghosted display using the Rhino SDK.

Question

I would like to set the active viewport to ghosted display from a plug-in command. How is this accomplished?

Answer

The following example code demonstrates how to ghost a viewport using the Rhino SDK.

C++

 
CRhinoCommand::result CCommandTest::RunCommand( const CRhinoCommandContext& context )
{
  CRhinoView* view = RhinoApp().ActiveView();
  if( 0 == view )
    return CRhinoCommand::failure;
 
  CRhinoViewport& vp = view->ActiveViewport();
 
  const CDisplayPipelineAttributes* pStdAttrs = CRhinoDisplayAttrsMgr::StdGhostedAttrs();
  if( pStdAttrs )
  {
    vp.SetDisplayMode( pStdAttrs->Id() );
    view->Redraw();
  }
 
  return CRhinoCommand::success;
}
developer/sdksamples/ghostedshade.txt · Last modified: 2010/01/26 16:37 (external edit) Driven by DokuWiki Recent changes RSS feed

 © 1997-2012 

McNeel North America Europe Latin AmericaAsia