[vtkusers] Problem in using vtkColorTransferControlPointsItem

qt.itk.vtk.help qt.itk.vtk.help at gmail.com
Wed Nov 13 07:49:25 EST 2013


I have integrated vtkContextView to a qt widget and
added vtkColorTransferControlPointsItem
with vtkCompositeTransferFunctionItem to the vtkChart. Widget's constructor
 code contain this is :

viewCTF = vtkSmartPointer<vtkContextView >::New();
        chartCTF= vtkSmartPointer<vtkChartXY>::New();

viewCTF->GetScene()->AddItem(chartCTF);

ctfitem = vtkSmartPointer<vtkCompositeTransferFunctionItem >::New();
ctfitem->SetMaskAboveCurve(true);
chartCTF->AddPlot(ctfitem);


cp =vtkSmartPointer<vtkColorTransferControlPointsItem>::New();

cp->SetColorTransferFunction(ctf);

chartCTF->AddPlot(cp);

        //further qt related settings..

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:

void vtkContextScene::SetDirty(bool isDirty)
{
  if (this->Storage->IsDirty == isDirty) // error here: storage is having
invalid pointer.
    {
    return;
    }
  this->Storage->IsDirty = isDirty;
  if(this->Storage->IsDirty)
    {
    this->BufferIdDirty=true;
    }
  this->Modified();
}

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.

Please help.

Thanks & Regards,
Tab
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20131113/a40041ed/attachment.htm>


More information about the vtkusers mailing list