[Paraview-developers] Custom Contour filter not working

Pandu tech pandu4tech at gmail.com
Mon Jun 4 08:11:13 EDT 2012


Hi,

I am implementing MyContour filter, similar to a Contour filter. The UI of
pqMyContourPanel.cxx is similar to pqThresholdPanel.cxx file and even
vtkMyContour.xml also has StringVectorProperty "SelectInputScalars" and
DoubleVectorProperty "ContourRange". I ensured that the i/p values are
properly read and any change in ContourBy option the ContourRange is
updated. This logic is implemented from pqThresholdPanel.cxx

The requestData method of vtkMyContour.cxx is simple, with just reading
input and applying values:

    VTK_CREATE(vtkContourFilter, myContour);
    myContour->SetInput(input_ref);
    myContour->SetNumberOfContours(this->NumberOfContours);

    if(this->NumberOfContours == 1)
    {
        rrContour->SetValue(0, (this->ContourRange[0] +
this->ContourRange[1])/2.0 );
    }
    else// this part is also implemented can be ignored now
    myContour->Update();
    output->ShallowCopy(myContour->GetOutput());
    return 1;

When ContourBy comboBox (or selectInputScalars) is changed from one scalar
array to another, I can see ContourRange is updated, but after pressing
Apply button I cannot see anything in the output except the X,Y,Z axes.

Do I need to modify requestData() with SelectInputScalars logic. Please
suggest me any ideas regarding this.

Highly appreciate your help regarding this.

Thanks,
Pandu.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20120604/0265142f/attachment.htm>


More information about the Paraview-developers mailing list