[Paraview] How can I fix the problem?

David E DeMarle dave.demarle at kitware.com
Thu Feb 26 08:35:08 EST 2009


Yes it shouldn't be necessary to move your code in with the paraview code.

I think each of your calls to ADD_PARAVIEW_PLUGIN is probably
overriting the previous ones. Simply call the macro once like so:

FIND_PACKAGE(ParaView REQUIRED)
INCLUDE(${PARAVIEW_USE_FILE})

ADD_PARAVIEW_PLUGIN(
   myReader "1.0"
  SERVER_MANAGER_SOURCES vtkMyReader.cxx
  SERVER_MANAGER_XML reader.xml
  GUI_RESOURCE_FILES pqReader.xml)

On Thu, Feb 26, 2009 at 1:53 AM, Biao She <shebiao at gmail.com> wrote:
> I think I have found a way to solve the problem. Thanks for your help. It
> gave me useful hints.
> 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.
> 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:
>
> FIND_PACKAGE(ParaView REQUIRED)
> INCLUDE(${PARAVIEW_USE_FILE})
>
> ADD_PARAVIEW_PLUGIN(
> myReader "1.0" SERVER_MANAGER_SOURCES
> vtkMyReader.cxx)
> ADD_PARAVIEW_PLUGIN(myReader "1.0" GUI_RESOURCE_FILES pqReader.xml)
> ADD_PARAVIEW_PLUGIN(myReader "1.0" SERVER_MANAGER_XML reader.xml)
>
> 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?
>
> Thanks
>
>
> On Wed, Feb 25, 2009 at 8:55 PM, Biao She <shebiao at gmail.com> wrote:
>>
>> Thanks for your reply.
>> 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.
>>
>> On Wed, Feb 25, 2009 at 8:03 PM, David E DeMarle
>> <dave.demarle at kitware.com> wrote:
>>>
>>> Sorry, I should have thought before I replied.  Of course you have XML
>>> or else paraview wouldn't know to ask the ProcessModule to try to
>>> create a vtkMyReader.
>>>
>>> Check for the inclusion of the vtkObjectFactory and the use of
>>> vtkStandardNewMacro in the .cxx file. Also check that the classes
>>> filename and class name match that in of the class= attribute in the
>>> XML file.
>>>
>>>
>>> On Wed, Feb 25, 2009 at 9:40 PM, David E DeMarle
>>> <dave.demarle at kitware.com> wrote:
>>> > Have you written the xml configuration file that tells ParaView how to
>>> > call the reader?
>>> >
>>> > On Wed, Feb 25, 2009 at 7:15 PM, Biao She <shebiao at gmail.com> wrote:
>>> >> Hi everyone.
>>> >> I am trying to write a new reader plugin for Paraview. However, I get
>>> >> the
>>> >> following error when I try to use it:
>>> >>
>>> >> ERROR: In
>>> >>
>>> >> /usr/scratch/bshe/Paraview/ParaView-3.4.0/Servers/Common/vtkProcessModule.cxx,
>>> >> line 1079
>>> >> vtkProcessModule (0x8c24658): Cannot create object of type
>>> >> "vtkMyReader".
>>> >> while processing
>>> >> Message 0 = New
>>> >>   Argument 0 = string_value {vtkMyReader}
>>> >>   Argument 1 = id_value {84}
>>> >>
>>> >>
>>> >>
>>> >> ERROR: In
>>> >>
>>> >> /usr/scratch/bshe/Paraview/ParaView-3.4.0/Servers/Common/vtkProcessModule.cxx,
>>> >> line 1080
>>> >> vtkProcessModule (0x8c24658): Aborting execution for debugging
>>> >> purposes.
>>> >>
>>> >> It seems to be a vtkMyReader construction problem. (Please correct me
>>> >> if
>>> >> not)
>>> >> My vtkMyReader is derived from vtkImageReader2, and it has a public
>>> >> static
>>> >> method for construction in .h file - static vtkDICOMImageReaderCopy
>>> >> *New().
>>> >> I am wondering if I have to write some code for this method in the
>>> >> vtkMyReader implementation (.cxx file) to fix the error?
>>> >>
>>> >> Thanks
>>> >>
>>> >> Biao
>>> >>
>>> >> _______________________________________________
>>> >> Powered by www.kitware.com
>>> >>
>>> >> Visit other Kitware open-source projects at
>>> >> http://www.kitware.com/opensource/opensource.html
>>> >>
>>> >> Please keep messages on-topic and check the ParaView Wiki at:
>>> >> http://paraview.org/Wiki/ParaView
>>> >>
>>> >> Follow this link to subscribe/unsubscribe:
>>> >> http://www.paraview.org/mailman/listinfo/paraview
>>> >>
>>> >>
>>> >
>>> >
>>> >
>>> > --
>>> > David E DeMarle
>>> > Kitware, Inc.
>>> > R&D Engineer
>>> > 28 Corporate Drive
>>> > Clifton Park, NY 12065-8662
>>> > Phone: 518-371-3971 x109
>>> >
>>>
>>>
>>>
>>> --
>>> David E DeMarle
>>> Kitware, Inc.
>>> R&D Engineer
>>> 28 Corporate Drive
>>> Clifton Park, NY 12065-8662
>>> Phone: 518-371-3971 x109
>>
>>
>>
>> --
>> She, Biao
>> Department of Computing Science,
>> University of Alberta, Edmonton, Canada
>
>
>
> --
> She, Biao
> Department of Computing Science,
> University of Alberta, Edmonton, Canada
>



-- 
David E DeMarle
Kitware, Inc.
R&D Engineer
28 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-371-3971 x109


More information about the ParaView mailing list