Display issue with CRhinoDisplayConduit v6

Hi;
I use CRhinoDisplayConduit Draw Shaded Brep, but it seam not good, how can I solve it ?

My file is here Display.3dm (233.1 KB)
Here is my code:

class DSP : public CRhinoDisplayConduit
{
public:
	DSP();
	~DSP() {};

	bool ExecConduit(
		CRhinoDisplayPipeline& dp, // pipeline executing this conduit
		UINT nChannel,             // current channel within the pipeline
		bool& bTerminate           // channel termination flag
	);
	ON_SimpleArray<ON_Brep*> rc_drabw;
};
DSP::DSP()
	: CRhinoDisplayConduit(CSupportChannels::SC_DRAWOVERLAY | CSupportChannels::SC_POSTDRAWOBJECTS)
{}
bool DSP::ExecConduit(
	CRhinoDisplayPipeline& dp,
	UINT nChannel,
	bool& bTerminate
)
{
    if(nChannel == CSupportChannels::SC_DRAWOVERLAY)
    {
    if (rc_drabw.Count() > 0)
    {
        for (int i = 0; i < rc_drabw.Count(); i++)
        {
            CDisplayPipelineMaterial mat;
            dp.SetupDisplayMaterial(mat, HsvToRgb(215, 122, 250));
            dp.DrawShadedBrep(rc_drabw[i], &mat, nullptr);
        }
    }
}

I have solve

class DSP : public CRhinoDisplayConduit
{
public:
	DSP();
	~DSP() {};

	bool ExecConduit(
		CRhinoDisplayPipeline& dp, // pipeline executing this conduit
		UINT nChannel,             // current channel within the pipeline
		bool& bTerminate           // channel termination flag
	);
	ON_SimpleArray<ON_Brep*> rc_drabw;
};
DSP::DSP()
	: CRhinoDisplayConduit(CSupportChannels::SC_CALCBOUNDINGBOX |CSupportChannels::SC_DRAWOVERLAY | CSupportChannels::SC_POSTDRAWOBJECTS)
{}
bool DSP::ExecConduit(
	CRhinoDisplayPipeline& dp,
	UINT nChannel,
	bool& bTerminate
)
{
if (nChannel == CSupportChannels::SC_CALCBOUNDINGBOX)
	{
		if (rc_drabw.Count() > 0)
		{
			ON_BoundingBox bbox;
			for (int i = 0; i < rc_drabw.Count(); i++)
			{
				if (nullptr != rc_drabw[i])
					rc_drabw[i]->GetTightBoundingBox(bbox, true);
				m_pChannelAttrs->m_BoundingBox.Union(bbox);
			}
		}
	}
   else  if(nChannel == CSupportChannels::SC_DRAWOVERLAY)
    {
    if (rc_drabw.Count() > 0)
    {
        for (int i = 0; i < rc_drabw.Count(); i++)
        {
            CDisplayPipelineMaterial mat;
            dp.SetupDisplayMaterial(mat, HsvToRgb(215, 122, 250));
            dp.DrawShadedBrep(rc_drabw[i], &mat, nullptr);
        }
    }
}
1 Like