That is the problem. Thanks very much!!!<br><br><br><div class="gmail_quote">On Thu, Feb 26, 2009 at 6:35 AM, 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;">
Yes it shouldn't be necessary to move your code in with the paraview code.<br>
<br>
I think each of your calls to ADD_PARAVIEW_PLUGIN is probably<br>
overriting the previous ones. Simply call the macro once like so:<br>
<div><br>
FIND_PACKAGE(ParaView REQUIRED)<br>
INCLUDE(${PARAVIEW_USE_FILE})<br>
<br>
ADD_PARAVIEW_PLUGIN(<br>
myReader "1.0"<br>
SERVER_MANAGER_SOURCES vtkMyReader.cxx<br>
</div><div> SERVER_MANAGER_XML reader.xml<br>
</div><div> GUI_RESOURCE_FILES pqReader.xml)<br>
<br>
</div><div><div></div><div>On Thu, Feb 26, 2009 at 1:53 AM, Biao She <<a href="mailto:shebiao@gmail.com" target="_blank">shebiao@gmail.com</a>> wrote:<br>
> I think I have found a way to solve the problem. Thanks for your help. It<br>
> gave me useful hints.<br>
> I first moved the source files (.cxx and .h files) for vtkMyReader into the<br>
> $paraview_sourcet/VTK/IO directory, and modified the CMakelist.txt in this<br>
> directory by adding vtkMyReader.cxx into the "kit_src" list. After that, I<br>
> wrote two XML files to expose this reader. Everything works fine.<br>
> Still, I have questions. According to the paraview user guide, the first<br>
> step shouldn't be neccessary. I should be able to write a plugin without the<br>
> need to change paraview source code. I am not very familar with CMake and<br>
> VTK, but I am sure that the problem must be in my CMakeList.txt file for the<br>
> plugin. The file looks like the following:<br>
><br>
> FIND_PACKAGE(ParaView REQUIRED)<br>
> INCLUDE(${PARAVIEW_USE_FILE})<br>
><br>
> ADD_PARAVIEW_PLUGIN(<br>
> 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<br>
> cmake file to make my plugin works without changing the paraview source<br>
> code?<br>
><br>
> Thanks<br>
><br>
><br>
> On Wed, Feb 25, 2009 at 8:55 PM, Biao She <<a href="mailto:shebiao@gmail.com" target="_blank">shebiao@gmail.com</a>> wrote:<br>
>><br>
>> Thanks for your reply.<br>
>> I have included vtkObjectFactory and have used<br>
>> vtkStandardNewMacro(vtkMyReader) in the .cxx file. The class filename and<br>
>> class name also match the class=attribute in the XML file. But the error<br>
>> message still appeares.<br>
>><br>
>> On Wed, Feb 25, 2009 at 8:03 PM, David E DeMarle<br>
>> <<a href="mailto:dave.demarle@kitware.com" target="_blank">dave.demarle@kitware.com</a>> wrote:<br>
>>><br>
>>> 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>
>>><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<br>
>>> >> the<br>
>>> >> following error when I try to use it:<br>
>>> >><br>
>>> >> ERROR: In<br>
>>> >><br>
>>> >> /usr/scratch/bshe/Paraview/ParaView-3.4.0/Servers/Common/vtkProcessModule.cxx,<br>
>>> >> line 1079<br>
>>> >> vtkProcessModule (0x8c24658): Cannot create object of type<br>
>>> >> "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>
>>> >><br>
>>> >> /usr/scratch/bshe/Paraview/ParaView-3.4.0/Servers/Common/vtkProcessModule.cxx,<br>
>>> >> line 1080<br>
>>> >> vtkProcessModule (0x8c24658): Aborting execution for debugging<br>
>>> >> purposes.<br>
>>> >><br>
>>> >> It seems to be a vtkMyReader construction problem. (Please correct me<br>
>>> >> if<br>
>>> >> not)<br>
>>> >> My vtkMyReader is derived from vtkImageReader2, and it has a public<br>
>>> >> static<br>
>>> >> method for construction in .h file - static vtkDICOMImageReaderCopy<br>
>>> >> *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>
>><br>
>><br>
>><br>
>> --<br>
>> She, Biao<br>
>> Department of Computing Science,<br>
>> University of Alberta, Edmonton, Canada<br>
><br>
><br>
><br>
> --<br>
> She, Biao<br>
> Department of Computing Science,<br>
> University of Alberta, Edmonton, Canada<br>
><br>
<br>
<br>
<br>
</div></div>--<br>
<div><div></div><div>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>-- <br>She, Biao<br>Department of Computing Science,<br>University of Alberta, Edmonton, Canada<br>