[Paraview] Reader Plugin Dev: "NA" extents & how to print debug messages?
Peter Schmitt
pschmittml at gmail.com
Wed Nov 10 12:27:34 EST 2010
Thanks Burlen! `this->DebugOn()` helped me find the problems with my plugin
reader.
Cheers,
Pete
On Tue, Nov 9, 2010 at 4:32 PM, burlen <burlen.loring at gmail.com> wrote:
> Hi Peter,
>
> To use the vtkDebugMacro, do a "this->DebugOn()" in your constructor.
>
> You could just use cerr if you are Linux/mac and launch paraview/pvserver
> from a terminal. Doing a "output->Print(cerr);" at the end of request data
> would prove that you did what you think.
>
> You could use vtkErrorMacro to get stuff into PV 's window.
>
> Burlen
>
>
> Peter Schmitt wrote:
>
>> Hi ParaViewers,
>>
>> (Sorry if this double-posts!)
>>
>> I am writing a ParaView Reader Plugin to get my data into ParaView via a
>> vtkStructuredGrid object. I can load my plugin into ParaView via "Manage
>> Plugins". My file type shows up in the "File-> Open" dialog. When
>> PV_PLUGIN_DEBUG is set, the "Output Messages" window shows that the library
>> was loaded successfully.
>>
>> When I select a file and click "Apply" in the object inspector, Paraview
>> thinks for a split second before returning to an interactive state.
>> However, no data appears & the "Information" tab of the object inspector
>> sets nCells = 0; nPoints = 0; Memory = 0 MB and the X,Y,Z extents are "NA".
>>
>> My plugin reader derives from "vtkStructuredGridReader" and implements:
>>
>> * SetFileName
>> * GetFileName
>> * CanReadFile * RequestInformation, where I set the extents via:
>> outInfo->Set(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT(),extent,6);
>> * RequestData, where I obtain a vtkStructuredGrid via:
>> vtkStructuredGrid *output =
>>
>> vtkStructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
>>
>> I am not sure why the "Information" tab is showing an empty structured
>> grid. My questions are:
>>
>> 1. How can I print debugging messages to stdout or Paraview's own "Output
>> Messages" window? Specifically, I'd like to make sure that my X,Y,Z extents
>> are being read properly from file. I tried vtkDebugMacro, but the data
>> isn't being printed.
>>
>> 2. Have I implemented the appropriate functions that derive from
>> vtkStructuredGridReader?
>> 3. Should I derive instead from another class? When I derive from
>> vtkStructuredGridAlgorithm, I get three error messages from
>> vtkCompositeDataPipeline: "Input port 0 of algorithm
>> vtkLFMReader(0x11f98a720) has 0 connections but is not optional".
>>
>> Can you offer any hints of how I can proceed to debug my reader?
>>
>> Thanks!
>> Pete
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> 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
>>
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20101110/74fcc779/attachment.htm>
More information about the ParaView
mailing list