<div dir="ltr"><div class="gmail_quote"><br><div dir="ltr">I have integrated vtkContextView to a qt widget and added vtkColorTransferControlPointsItem with vtkCompositeTransferFunctionItem to the vtkChart. Widget's constructor code contain this is :<div>
<br><div>
<div><span style="white-space:pre-wrap"> </span>viewCTF = vtkSmartPointer<vtkContextView >::New();</div><div> chartCTF= vtkSmartPointer<vtkChartXY>::New();<br></div><div><br></div><div><span style="white-space:pre-wrap"> </span>viewCTF->GetScene()->AddItem(chartCTF);</div>
<div><br></div><div><span style="white-space:pre-wrap"> </span>ctfitem = vtkSmartPointer<vtkCompositeTransferFunctionItem >::New();</div><div><span style="white-space:pre-wrap"> </span>ctfitem->SetMaskAboveCurve(true);</div>
<div><span style="white-space:pre-wrap"> </span>chartCTF->AddPlot(ctfitem);</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap"> </span>cp =vtkSmartPointer<vtkColorTransferControlPointsItem>::New();</div>
<div><br></div><div><div><span style="white-space:pre-wrap"> </span>cp->SetColorTransferFunction(ctf);</div></div><div><br></div><div><span style="white-space:pre-wrap"> </span>chartCTF->AddPlot(cp);</div></div>
</div><div><br></div><div> //further qt related settings..</div><div><br></div><div>I am initializing it when user want to edit transfer function when he close it object will be deleted. On first initialization it is working fine. But when widget deleted and initialized again it is appearing and if any control point is edited it is showing error in following function of vtkContextScene:</div>
<div><br></div><div><div>void vtkContextScene::SetDirty(bool isDirty)</div><div>{</div><div> if (this->Storage->IsDirty == isDirty) // error here: storage is having invalid pointer.</div><div> {</div><div> return;</div>
<div> }</div><div> this->Storage->IsDirty = isDirty;</div><div> if(this->Storage->IsDirty)</div><div> {</div><div> this->BufferIdDirty=true;</div><div> }</div><div> this->Modified();</div>
<div>}</div></div><div><br></div><div>Strange to get what is problem. All is well if control points item not added. Even when added first widget behave properly only after closing it and opening again(initializing again) causing error while interacting with control point.</div>
<div><br></div><div>Please help.</div><div><br></div><div>Thanks & Regards,</div><div>Tab</div></div>
</div><br></div>