Hi All,
Do you have any suggestions? Thanks a lot.
Best,
xunlei

-----Original Message-----
From: Xunlei Wu 
Sent: Saturday, January 15, 2011 5:44 PM
To: 'David Doria'
Cc: '[email protected]'
Subject: Write a reader plugin

Hi David and all,
I am writing a reader plugin for ParaView. A test program without the VTK 
wrapping approves that I can get all the header (metadata) and grid data 
correctly. However, when I following the examples posted in 
http://www.vtk.org/Wiki/ParaView/Examples/Plugins/Reader
http://www.kitware.com/products/html/WritingAParaViewReaderPlug-in.html
and vtkStructuredGridReader.h/.cxx

I got confused. Shall I subclass vtkStructuredGridAlgorithm or 
vtkStructuredGridReader? What are the differences? With minor differences in 
the code, i.e. defining char* FileName, I have both scenarios built fine. 

Let's say, we are subclassing vtkStructuredGridAlgorithm for now on. After I 
populate values as the following

int vtkGRIB2Reader::RequestInformation(vtkInformation* vtkNotUsed(request),     
                                                        vtkInformationVector** 
vtkNotUsed(inputVector),                                                 
vtkInformationVector *outputVector)
{
        ...
        vtkInformation* outInfo = outputVector->GetInformationObject(0);
        
        outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),  ext, 6);
        outInfo->Set(vtkDataObject::SPACING(),  this->Spacing, 3);
        outInfo->Set(vtkDataObject::ORIGIN(),   this->Origin, 3);       

        return 1;
}

In ParaView Object Inspector / Information widget, I did not see any update in 
all the fields except Statistics / Type: Structured (Curvilinear) Grid. Would 
you please help me? Did I populate outInof in the wrong place? Thanks a lot.

Best,
xunlei

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to