Hey guys,
I’m currently trying to create a reader for the JSON based CityJSON format (mix of CityGML and GeoJSON (www.cityjson.org)).
As far as I understand I will need to create a new VTK reader to accompany the ParaView plugin, so I’m using the ElevationFilter as an example. Running into a few issues however, so was hoping someone could help:
When I try to compile I run into the following error:
In file included from /mnt/hdd/Repositories/Paraview-CityJSONReader/Plugin/CityJSONReaders/vtkMyCityJSONReader.cxx:1:
/mnt/hdd/Repositories/Paraview-CityJSONReader/Plugin/CityJSONReaders/vtkMyCityJSONReader.h:6:49: error: expected initializer before ‘:’ token
6 | class CITYJSONREADER_EXPORT vtkMyCityJSONReader : public vtkPolyData
|
The code I have so far is:
vtkMyCityJSONReader.cxx
#include "vtkMyCityJSONReader.h"
#include "vtkObjectFactory.h"
vtkStandardNewMacro(vtkMyCityJSONReader);
//----------------------------------------------------------------------------
vtkMyCityJSONReader::vtkMyCityJSONReader()
{
}
//----------------------------------------------------------------------------
vtkMyCityJSONReader::~vtkMyCityJSONReader()
{
}
//----------------------------------------------------------------------------
void vtkMyCityJSONReader::PrintSelf(ostream& os, vtkIndent indent)
{
this->Superclass::PrintSelf(os, indent);
}
vtkMyCityJSONReader.h
#ifndef vtkMyCityJSONReader_h
#define vtkMyCityJSONReader_h
#include "vtkPolyData.h"
class CITYJSONREADER_EXPORT vtkMyCityJSONReader : public vtkPolyData
{
public:
static vtkMyCityJSONReader* New();
vtkTypeMacro(vtkMyCityJSONReader, vtkPolyData);
void PrintSelf(ostream& os, vtkIndent indent) override;
protected:
vtkMyCityJSONReader();
~vtkMyCityJSONReader();
private:
vtkMyCityJSONReader(const vtkMyCityJSONReader&) = delete;
void operator=(const vtkMyCityJSONReader&) = delete;
};
#endif
CMakeLists.txt
cmake_minimum_required(VERSION 3.8)
project(CityJSONReader)
find_package(ParaView REQUIRED)
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
enable_testing()
# Required for python testing
set(_vtk_build_TEST_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/Testing/Temporary)
include(GNUInstallDirs)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
set("_paraview_plugin_default_${CMAKE_PROJECT_NAME}" ON)
paraview_plugin_scan(
PLUGIN_FILES "${CMAKE_CURRENT_SOURCE_DIR}/Plugin/paraview.plugin"
PROVIDES_PLUGINS plugins
REQUIRES_MODULES required_modules)
foreach (module IN LISTS required_modules)
if (NOT TARGET "${module}")
message(#FATAL_ERROR
"Skipping example ${CMAKE_PROJECT_NAME}: Missing required module: "
"${module}")
return ()
endif ()
endforeach ()
paraview_plugin_build(
RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}"
LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}"
PLUGINS ${plugins})