[Paraview] Write Paraview Plugin, File .cxx and .h

Tuan Ha Tran tuan-ha.tran at insa-lyon.fr
Thu May 31 05:34:30 EDT 2012


Hi everyone, 
   I'm searching a way to convert a class (developed by our laboratory) to ParaView plugin.
   So, they have the  vtkOtsuSphereSource.cxx and vtkOtsuSphereSource.h file as in the attachments.
   With this class, they will be able to calculate the optimal threshold of an vtkImageData. The return value is this optimal threshold.
   
   I have some questions to ask you about how to convert this class so it can be used as ParaView plugin.
   - What does it means "vtkStandardNewMacro(vtkOtsuSphereSource)" and does it mandatory?
   - Error when compiling vtkOtsuSphereSourceClientServer.cxx:13:10: error: ‘New’ is not a member of ‘vtkOtsuSphereSource’, so, it's because I don't have static vtkOtsuSphereSource* New(); in the .h file. So I want to ask : what is this?
   - When I added this static vtkOtsuSphereSource* New(); in the .h file. another compiling error : /vtkOtsuSphereSource/bin/vtkOtsuSphereSourceClientServer.cxx:13:35: error: cannot convert ‘vtkOtsuSphereSource*’ to ‘vtkObjectBase*’ in return so my class is not a vtkObjectBase, but how can we go through this error?
  
The following lines indicate the compiling error with static vtkOtsuSphereSource* New(); in .h file
  /home/thtran/ParaViewPlugins/vtkOtsuSphereSource/bin/vtkOtsuSphereSourceClientServer.cxx: In function ‘int vtkOtsuSphereSourceCommand(vtkClientServerInterpreter*, vtkObjectBase*, const char*, const vtkClientServerStream&, vtkClientServerStream&)’:
/home/thtran/ParaViewPlugins/vtkOtsuSphereSource/bin/vtkOtsuSphereSourceClientServer.cxx:19:29: error: ‘SafeDownCast’ is not a member of ‘vtkOtsuSphereSource’
make[2]: *** [CMakeFiles/MyOtsuSphereSource.dir/vtkOtsuSphereSourceClientServer.o] Error 1
make[1]: *** [CMakeFiles/MyOtsuSphereSource.dir/all] Error 2
  
  Thank you very much in advance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120531/fa808d19/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkOtsuSphereSource.h
Type: text/x-chdr
Size: 514 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120531/fa808d19/attachment-0001.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkOtsuSphereSource.cxx
Type: text/x-c++src
Size: 3890 bytes
Desc: not available
URL: <http://www.paraview.org/pipermail/paraview/attachments/20120531/fa808d19/attachment-0001.cxx>


More information about the ParaView mailing list