[Paraview] Error in paraview-generated code compiling paraview
reader
Randy Hudson
hudson at mcs.anl.gov
Sun Feb 6 16:07:08 EST 2005
I'm trying to compile a reader I've written for ParaView 1.8.2, and am getting an error in a source file created by ParaView's vtkWrapClientServer.
I modeled CMakeLists.txt on that of <paraview_source>/Examples/PVLocal. I derive my reader from vtkSource. I based the XML files on what I read in the ParaView manual and on the .in files in <paraview_source>/Examples/PVLocal.
Below, I've included the compiler error message, the piece of the paraview-generated source that's causing the error, CMakeLists.txt, the beginning lines from the header file of my reader, and the interface and server manager XML.in files.
Can someone suggest a solution?
Thanks.
Randy Hudson.
Here's the error message:
-------------------------
ParaViewTest/MY_PVLocalBuild/vtkFlashHDF5ReaderClientServer.cxx: In
function `int vtkFlashHDF5ReaderCommand(vtkClientServerInterpreter*,
vtkObjectBase*, const char*, const vtkClientServerStream&,
vtkClientServerStream&)':
ParaViewTest/MY_PVLocalBuild/vtkFlashHDF5ReaderClientServer.cxx:19: invalid
conversion from `vtkUnstructuredGridSource*' to `vtkFlashHDF5Reader*'
make[1]: *** [vtkFlashHDF5ReaderClientServer.o] Error 1
make[1]: Leaving directory `ParaViewTest/MY_PVLocalBuild'
make: *** [default_target] Error 2
Here are a few lines of the paraview-generated source (the last line is the one in error):
------------------------------------------------------------------------------------------
int VTK_EXPORT vtkFlashHDF5ReaderCommand(vtkClientServerInterpreter *arlu,
vtkObjectBase *ob, const char *method,
const vtkClientServerStream& msg, vtkClientServerStream& resultStream) {
vtkFlashHDF5Reader *op = vtkFlashHDF5Reader::SafeDownCast(ob);
Here's CMakeLists.txt:
----------------------
PROJECT(PVLocal)
SET(PVLocal_SRCS
vtkFlashHDF5Reader.C
)
SET(PVLocal_LIBS
vtkFiltering vtkCommon vtkParallel
)
# Need to include class headers and the configuration header.
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR})
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR})
# Import ParaView build settings.
FIND_PACKAGE(ParaView)
IF(NOT ParaView_FOUND)
MESSAGE(FATAL_ERROR "ParaView is required. Set ParaView_DIR.")
ENDIF(NOT ParaView_FOUND)
IF(NOT PARAVIEW_BUILD_SHARED_LIBS)
MESSAGE(FATAL_ERROR "ParaView must be built with BUILD_SHARED_LIBS ON.")
ENDIF(NOT PARAVIEW_BUILD_SHARED_LIBS)
INCLUDE(${PARAVIEW_USE_FILE})
# Configure output directories.
SET (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR} CACHE INTERNAL
"Single output directory for building all libraries.")
SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR} CACHE INTERNAL
"Single output directory for building all executables.")
# Create the configuration header.
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/vtkPVLocalConfigure.h.in
${PROJECT_BINARY_DIR}/vtk${PROJECT_NAME}Configure.h
@ONLY IMMEDIATE)
# Create vtk client/server wrappers for the classes.
VTK_WRAP_ClientServer(${PROJECT_NAME} PVLocalCS_SRCS "${PVLocal_SRCS}")
# Build the package as a plugin for ParaView.
ADD_LIBRARY(${PROJECT_NAME} MODULE ${PVLocal_SRCS} ${PVLocalCS_SRCS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} vtkClientServer)
FOREACH(c ${PVLocal_LIBS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${c}CS)
ENDFOREACH(c)
# Place the package configuration file into the build tree.
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PVLocal.xml.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}.xml @ONLY IMMEDIATE)
# Place the package configuration file into the build tree.
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/PVLocal.pvsm.in
${PROJECT_BINARY_DIR}/${PROJECT_NAME}.pvsm @ONLY IMMEDIATE)
tg-viz-login2:/home/hudson/ParaViewTest/MY_PVLocalBuild>
Here's PVLocal.pvsm.in:
-----------------------
<ServerManagerConfiguration>
<ProxyGroup name="sources">
<SourceProxy name="FlashHDF5Reader" class="vtkFlashHDF5Reader">
<StringVectorProperty name="FileName" command="SetFileName" number_of_elements="1">
<StringListDomain name="files"/>
</StringVectorProperty>
</SourceProxy>
</ProxyGroup>
</ServerManagerConfiguration>
Here's PVLocal.xml.in:
----------------------
<ModuleInterfaces>
<Library name="@PROJECT_NAME@" directory="@LIBRARY_OUTPUT_PATH@"/>
<ServerManagerFile name="@PROJECT_NAME at .pvsm"/>
<Module name="FlashHDF5Reader"
root_name="FlashHDF5Reader"
output="vtkUnstructuredGrid"
class="vtkPVReaderModule"
module_type="Reader"
extension="*"
file_description="HDF5 Flash PARAMESH files">
<Source class="vtkFlashHDF5Reader"/>
</Module>
</ModuleInterfaces>
Here's the beginning of my header file:
---------------------------------------
#include "vtkSource.h"
#include "vtkExtractUnstructuredGridPiece.h"
#include "vtkUnstructuredGrid.h"
#include "flashVtkComponents.h"
#include "vtkPVLocalConfigure.h"
class VTK_PVLocal_EXPORT vtkFlashHDF5Reader : public vtkSource {
More information about the ParaView
mailing list