[Paraview] Write a reader plugin
Xunlei Wu
xunlei at renci.org
Sat Feb 5 17:46:25 EST 2011
Hi David and All,
I still have trouble seeing any updates in ParaView (ParaView Git built from source with VS2008 and Qt 4.6.3 on Windows 7 64bit) after loading a GRIB2 file. For simiplicity, I have created a skeleton version of my GRIB2 reader. I have only implemented RequestInformation() with some fabricated WHOLE_EXTENT() data. I have successfully built such reader as a plugin .dll (Windows) and loaded it into ParaView through Tool -> Manage Plugins. After you load a grib2 file also attached, RequestInformation() is called and WHOLE_EXTENT() has been updated. However, I do not see such change in "Object Inspector" -> "Information" panel.
I am not sure what I did wrong. And is there anything special I need to do when build ParaView from source? FYI, "BUILD_SHARED_LIB" is on.
Would you please help me? Thank you very much.
Best,
x
-----Original Message-----
From: Xunlei Wu
Sent: Friday, January 21, 2011 12:10 PM
To: David Doria
Cc: paraview at paraview.org
Subject: RE: Write a reader plugin
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: 'paraview at paraview.org'
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grib2reader_plugin_skeleton.zip
Type: application/x-zip-compressed
Size: 24312 bytes
Desc: grib2reader_plugin_skeleton.zip
URL: <http://www.paraview.org/pipermail/paraview/attachments/20110205/f7d83024/attachment-0001.bin>
More information about the ParaView
mailing list