[Paraview] Paraview3 External plugin - call sequence

Philippose Rajan sarith at rocketmail.com
Mon Aug 20 13:02:13 EDT 2007


Hello again,

Thanks a lot for the suggestions :-) And a good day!

I tracked down the problem on Sunday night :-)! It was one of those compatibility 
issues between ParaView 2.4.x, and ParaView 3.x.x. I was basically trying to port 
a plugin from ParaView 2.4.4 to ParaView 3.x.x.

In the original code, the following line of code was sufficient, in the reader's constructor:

this->SetNumberOfOutputPorts(0);

But in ParaView 3.x.x, it looks like that does not work... I had to modify that line to:

this->SetNumberOfOutputPorts(1);

And in addition, I had to explicitly define a "FillOutputPortInformation" function, and 
declare exactly what data was going to be sent out via this port. 

Once these changes were made, things worked out fine!

Have a nice day!

Philippose


----- Original Message ----
From: Sean Ziegeler (Contractor) <sean.ziegeler at nrlssc.navy.mil>
To: Philippose Rajan <sarith at rocketmail.com>
Cc: paraview at paraview.org
Sent: Monday, August 20, 2007 6:49:59 PM
Subject: Re: [Paraview] Paraview3 External plugin - call sequence

I recommend using a debugger as well.  Make sure you compile all of 
ParaView and your plugin with -g.  It should catch the Seg Fault and 
show you precisely where it happens.  And you can do a backtrace 
yourself to really want to, but it may not be necessary.

The only thing I don't like about the debugger, at least with gdb on 
Linux, is that break points in the plugin code itself don't get 
triggered if you load the plugin at run time.  I guess its hard for the 
debugger to track address space from a dlopen().  Anyway, won't need to 
set a break point to make the debugger stop at the seg fault, but you 
may need it to step through code _before_ the seg fault.  One work 
around is to set the break point in the ParaView code (e.g., one of the 
methods in the previous post).  If you really need to set a break point 
in the plugin code, another work around is to compile the code into 
ParaView either statically or dynamically.

One other work-around that works for a run-time loaded plugin, is to 
send a signal to itself.  The following works for me in Linux:
#if 1
#include <signal.h>
#include <unistd.h>
signal(1, SIG_IGN);  kill(getpid(), 1);
#endif

The #if is so you can change the 1 to 0 to temporarily disable it. 
Anyway, it will force the debugger to stop at that line of code but 
without killing the process or interrupting it if the debugger is not 
running.

Hope that helps,
Sean

clinton at elemtech.com wrote:
> If you're ok with debugging...
> 
> Try setting a breakpoint in
> pqReaderFactory::loadFileTypes
> which should be called at start up, and again when your plugin loads.
> You can follow that to make sure it reads the xml file included in your plugin 
> which defines the reader's file extention(s) among other stuff.
> 
> pqReaderFactory::createReader should be called when trying to make your 
> reader.
> 
> Clint
> 
> On Sunday 19 August 2007 9:51:28 am Philippose Rajan wrote:
>> Hello,
>>
>> Could someone give me a brief overview of the sequence of events (functions
>> called for example), when I load an external "Reader" plugin, a "GUI"
>> plugin (which allows me to load specific file types), and then open a file
>> which is meant to be handled by this custom reader?
>>
>> A plugin which worked in Paraview 3.1.0 (July snapshot) does not work
>> anymore after I compiled Paraview 3.1.1 (from CVS), and I would like to
>> trace the possible reason for the error which says:
>>
>> Invalid output port : 0 . Available number of output ports : 0
>> Segmentation Fault
>>
>> Regards,
>>
>> Philippose
>>
>>
>>
>>
>>
>>      
>> ___________________________________________________________________________
>> _________ Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s
>> user panel and lay it on us.
>> http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7
> 
> 
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview
> 








       
____________________________________________________________________________________
Need a vacation? Get great deals
to amazing places on Yahoo! Travel.
http://travel.yahoo.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/paraview/attachments/20070820/427514ed/attachment.html


More information about the ParaView mailing list