ExecConduit

@dale
Source3.cpp (1.3 KB)

The attached cpp is based on the code you provided. May I ask you two questions:

  1. I think the following code is not used, why would you include it inside ExecConduit?

     	ON_4iRect rect;
     	if (!CRhinoDisplayPipeline::MeasureString(rect, m_strMessage, screen_point, false, text_height, L"System"))
     		return FALSE;
    
     	rect.InflateRect(3, -3, 3, 3);
    
  2. “dp.DrawSurface(*(m_prnBrep->m_S[0]), m_bFullPreview ? 1 : 2);” The code works for Rhino 6. How could we do it in Rhino 5? Could you show the Rhino 5 code for displaying a surface?

Hi @XNurbs,

1.) It looks like your code isn’t using rect, to it’s probably save to remove.

2.) In Rhino 5, use CRhinoViewport::DrawSurface:

bool CXNurbsPreviewConduit::ExecConduit(
  CRhinoDisplayPipeline& dp, 
  UINT nChannel, 
  bool& bTerminate
  )
{
  if (nChannel == CSupportChannels::SC_DRAWOVERLAY)
  {
    // Get the Rhino viewport attached to the display pipeline
    CRhinoViewport& vp = dp.GetRhinoVP();
    vp.DrawSurface(*(m_prnBrep->m_S[0]), m_bFullPreview ? 1 : 2);
    ...

– Dale