How to draw ON_Curve in CRhinoDisplayConduit ?(C++)

I would like to draw lots of ON_Curves in ExecConduit.
Who know how to do it ? :sob:

    bool CGitConduit::ExecConduit(
    	CRhinoDisplayPipeline& dp, // pipeline executing this conduit
    	UINT nChannelID,           // current channel within the pipeline
    	bool& bTerminationFlag     // channel termination flag
    	)
{
    if( nChannelID & CSupportChannels::SC_POSTDRAWOBJECTS ) //
    	{
    		//draw ON_mesh
    		for( int i=0; i < m_DrawMesh.Count(); i++ )
    			dp.DrawShadedMesh( *(m_DrawMesh[i]), m_DrawMatMesh[i] );
    		//draw ON_Curve
    		for( int i=0; i < m_DrawCrv.Count(); i++ )
    			;// How to draw ON_Curve ???
    	}
...
}

C++ isn’t my language, but are you sure there’s no dp.DrawCurve(); ?

There isn’t indeed DrawCurve().
I am green with envy for C#.

Well, this code is in the CRhinoDisplayPipeline class. However it’s not prefixed by ‘public’ and I’m not sure that’s the C++ default access. But since none of the methods are prefixed by ‘public’ I imagine it is.

This is a C++'s result. :sob:

To draw curve:
CRhinoViewport& vp;
vp.DrawNurbsCurve(…);

I know it, but it seem no depth test.
Right ?

That probably depends on when you draw this curve. What channel are you drawing your geometry in?

I work it in a channel PostDrawObjects.
I think vp.drawXXXX(…) is to be drawn on top of everything in the scene.
Do I get it wrong ?

I think you may be looking at V6 code @DavidRutten. I moved all the Drawing routines to the display pipeline class since there were ones scattered about on CRhinoViewport and other static routines.

PostDrawObjects should still be depth buffered. The CRhinoViewport draw curve function should not be making any adjustments to the depth testing/writing of the engine.

Would you offer codes about drawing curves in CRhinoDisplayPipeline ?
I don’t know how to get CRhinoViewport in CRhinoDisplayPipeline and how to set color of curve.
Besides, why not using DrawCurve() ?

Something like this should do it:

CRhinoViewport& vp = dp.GetRhinoVP();
ON_Color old_color = vp.SetDrawColor(RGB(0,0,255));
vp.DrawCurve(curve);
vp.SetDrawColor(old_color);

Let me know if this helps…

Thank you for help.
It is help for me. :smile: