I think I have found a way to solve the problem. Thanks for your help. It gave me useful hints. <br>I first moved the source files (.cxx and .h files) for vtkMyReader into the $paraview_sourcet/VTK/IO directory, and modified the CMakelist.txt in this directory by adding vtkMyReader.cxx into the "kit_src" list. After that, I wrote two XML files to expose this reader. Everything works fine.<br>
Still, I have questions. According to the paraview user guide, the first step shouldn't be neccessary. I should be able to write a plugin without the need to change paraview source code. I am not very familar with CMake and VTK, but I am sure that the problem must be in my CMakeList.txt file for the plugin. The file looks like the following:<br>
<br>FIND_PACKAGE(<span class="nfakPe">ParaView</span> REQUIRED)<br>INCLUDE(${PARAVIEW_USE_FILE})<br><br>ADD_PARAVIEW_PLUGIN(<div id=":xh" class="ArwC7c ckChnd">myReader "1.0" SERVER_MANAGER_SOURCES<br>vtkMyReader.cxx)<br>
ADD_PARAVIEW_PLUGIN(myReader "1.0" GUI_RESOURCE_FILES pqReader.xml)<br>
ADD_PARAVIEW_PLUGIN(myReader "1.0" SERVER_MANAGER_XML reader.xml)<br><br>I am using the Cmake cdt 4 generator. Could anyone tell me how to change the cmake file to make my plugin works without changing the paraview source code?<br>
<br>Thanks<br></div><br>
<br><div class="gmail_quote">On Wed, Feb 25, 2009 at 8:55 PM, Biao She <span dir="ltr"><<a href="mailto:shebiao@gmail.com" target="_blank">shebiao@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks for your reply.<br>I have included vtkObjectFactory and have used vtkStandardNewMacro(vtkMyReader) in the .cxx file. The class filename and class name also match the class=attribute in the XML file. But the error message still appeares. <br>
<div><div></div><div>
<br><div class="gmail_quote">
On Wed, Feb 25, 2009 at 8:03 PM, David E DeMarle <span dir="ltr"><<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Sorry, I should have thought before I replied. Of course you have XML<br>
or else paraview wouldn't know to ask the ProcessModule to try to<br>
create a vtkMyReader.<br>
<br>
Check for the inclusion of the vtkObjectFactory and the use of<br>
vtkStandardNewMacro in the .cxx file. Also check that the classes<br>
filename and class name match that in of the class= attribute in the<br>
XML file.<br>
<div><div></div><div><br>
<br>
On Wed, Feb 25, 2009 at 9:40 PM, David E DeMarle<br>
<<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>> wrote:<br>
> Have you written the xml configuration file that tells ParaView how to<br>
> call the reader?<br>
><br>
> On Wed, Feb 25, 2009 at 7:15 PM, Biao She <<a href="mailto:shebiao@gmail.com" target="_blank">shebiao@gmail.com</a>> wrote:<br>
>> Hi everyone.<br>
>> I am trying to write a new reader plugin for Paraview. However, I get the<br>
>> following error when I try to use it:<br>
>><br>
>> ERROR: In<br>
>> /usr/scratch/bshe/Paraview/ParaView-3.4.0/Servers/Common/vtkProcessModule.cxx,<br>
>> line 1079<br>
>> vtkProcessModule (0x8c24658): Cannot create object of type "vtkMyReader".<br>
>> while processing<br>
>> Message 0 = New<br>
>> Argument 0 = string_value {vtkMyReader}<br>
>> Argument 1 = id_value {84}<br>
>><br>
>><br>
>><br>
>> ERROR: In<br>
>> /usr/scratch/bshe/Paraview/ParaView-3.4.0/Servers/Common/vtkProcessModule.cxx,<br>
>> line 1080<br>
>> vtkProcessModule (0x8c24658): Aborting execution for debugging purposes.<br>
>><br>
>> It seems to be a vtkMyReader construction problem. (Please correct me if<br>
>> not)<br>
>> My vtkMyReader is derived from vtkImageReader2, and it has a public static<br>
>> method for construction in .h file - static vtkDICOMImageReaderCopy *New().<br>
>> I am wondering if I have to write some code for this method in the<br>
>> vtkMyReader implementation (.cxx file) to fix the error?<br>
>><br>
>> Thanks<br>
>><br>
>> Biao<br>
>><br>
>> _______________________________________________<br>
>> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
>><br>
>> Visit other Kitware open-source projects at<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Please keep messages on-topic and check the ParaView Wiki at:<br>
>> <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
>><br>
>><br>
><br>
><br>
><br>
> --<br>
> David E DeMarle<br>
> Kitware, Inc.<br>
> R&D Engineer<br>
> 28 Corporate Drive<br>
> Clifton Park, NY 12065-8662<br>
> Phone: 518-371-3971 x109<br>
><br>
<br>
<br>
<br>
--<br>
David E DeMarle<br>
Kitware, Inc.<br>
R&D Engineer<br>
28 Corporate Drive<br>
Clifton Park, NY 12065-8662<br>
Phone: 518-371-3971 x109<br>
</div></div></blockquote></div><br><br clear="all"><br></div></div><font color="#888888">-- <br>She, Biao<br>Department of Computing Science,<br>University of Alberta, Edmonton, Canada<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>She, Biao<br>Department of Computing Science,<br>University of Alberta, Edmonton, Canada<br>