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