Commit 0f3f7e7e authored by Ben Boeckel's avatar Ben Boeckel

vtkPVServerManagerRendering: update to the new module system

parent e1c07bc1
......@@ -28,110 +28,87 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
#==========================================================================
set (Module_SRCS
vtkPVComparativeAnimationCue.cxx
vtkPVComparativeView.cxx
vtkPVRepresentedArrayListSettings.cxx
vtkSMBagChartSeriesListDomain.cxx
vtkSMBoxRepresentationProxy.cxx
vtkSMCameraLink.cxx
vtkSMCameraProxy.cxx
vtkSMChartRepresentationProxy.cxx
vtkSMChartSeriesListDomain.cxx
vtkSMChartSeriesSelectionDomain.cxx
vtkSMChartUseIndexForAxisDomain.cxx
vtkSMComparativeAnimationCueProxy.cxx
vtkSMComparativeAnimationCueUndoElement.cxx
vtkSMComparativeViewProxy.cxx
vtkSMContextViewProxy.cxx
vtkSMDataDeliveryManager.cxx
vtkSMFunctionalBagChartSeriesSelectionDomain.cxx
vtkSMImplicitPlaneRepresentationProxy.cxx
vtkSMLightProxy.cxx
vtkSMMaterialDomain.cxx
vtkSMMaterialLibraryProxy.cxx
vtkSMPVMoleculeRepresentationProxy.cxx
vtkSMMultiSliceViewProxy.cxx
vtkSMNewWidgetRepresentationProxy.cxx
vtkSMOrthographicSliceViewProxy.cxx
vtkSMPlotMatrixViewProxy.cxx
vtkSMPVRepresentationProxy.cxx
vtkSMRenderViewProxy.cxx
vtkSMRangedTransferFunctionDomain.cxx
vtkSMRepresentationProxy.cxx
vtkSMRepresentationTypeDomain.cxx
vtkSMRepresentedArrayListDomain.cxx
vtkSMSaveScreenshotProxy.cxx
vtkSMScalarBarWidgetRepresentationProxy.cxx
vtkSMSelectionHelper.cxx
vtkSMSelectionLink.cxx
vtkSMSpreadSheetRepresentationProxy.cxx
vtkSMSpreadSheetViewProxy.cxx
vtkSMTextWidgetRepresentationProxy.cxx
vtkSMTransferFunctionManager.cxx
vtkSMTransferFunctionPresets.cxx
vtkSMTransferFunctionProxy.cxx
vtkSMUtilities.cxx
vtkSMViewLayoutProxy.cxx
vtkSMViewProxy.cxx
vtkSMViewProxyInteractorHelper.cxx
vtkSMViewResolutionDomain.cxx
vtkSMWidgetRepresentationProxy.cxx
)
set(classes
vtkPVComparativeAnimationCue
vtkPVComparativeView
vtkPVRepresentedArrayListSettings
vtkSMBagChartSeriesListDomain
vtkSMBoxRepresentationProxy
vtkSMCameraLink
vtkSMCameraProxy
vtkSMChartRepresentationProxy
vtkSMChartSeriesListDomain
vtkSMChartSeriesSelectionDomain
vtkSMChartUseIndexForAxisDomain
vtkSMComparativeAnimationCueProxy
vtkSMComparativeAnimationCueUndoElement
vtkSMComparativeViewProxy
vtkSMContextViewProxy
vtkSMDataDeliveryManager
vtkSMFunctionalBagChartSeriesSelectionDomain
vtkSMImplicitPlaneRepresentationProxy
vtkSMLightProxy
vtkSMMaterialDomain
vtkSMMaterialLibraryProxy
vtkSMMultiSliceViewProxy
vtkSMNewWidgetRepresentationProxy
vtkSMOrthographicSliceViewProxy
vtkSMPVMoleculeRepresentationProxy
vtkSMPVRepresentationProxy
vtkSMParaViewPipelineControllerWithRendering
vtkSMPlotMatrixViewProxy
vtkSMRangedTransferFunctionDomain
vtkSMRenderViewProxy
vtkSMRepresentationProxy
vtkSMRepresentationTypeDomain
vtkSMRepresentedArrayListDomain
vtkSMSaveScreenshotProxy
vtkSMScalarBarWidgetRepresentationProxy
vtkSMSelectionHelper
vtkSMSelectionLink
vtkSMSpreadSheetRepresentationProxy
vtkSMSpreadSheetViewProxy
vtkSMTextWidgetRepresentationProxy
vtkSMTransferFunctionManager
vtkSMTransferFunctionPresets
vtkSMTransferFunctionProxy
vtkSMUtilities
vtkSMViewLayoutProxy
vtkSMViewProxy
vtkSMViewProxyInteractorHelper
vtkSMViewResolutionDomain
vtkSMWidgetRepresentationProxy)
if (PARAVIEW_ENABLE_PYTHON)
list(APPEND Module_SRCS vtkSMPythonViewProxy.cxx)
endif()
if (TARGET ParaView::ClientServerCorePython)
# TODO: Split these into a separate module so that there isn't a public
# optional dependency.
list(APPEND classes
vtkSMPythonViewProxy)
endif ()
#-----------------------------------------------------------------------------
# Stuff for ObjectFactory override for vtkSMParaViewPipelineControllerWithRendering.
list(APPEND Module_SRCS
vtkSMParaViewPipelineControllerWithRendering.cxx
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
# Override some rendering classes. Create object factory:
set(vtk_module_overrides "vtkSMParaViewPipelineController")
set(vtk_module_vtkSMParaViewPipelineController_override
"vtkSMParaViewPipelineControllerWithRendering")
# Now we iterate and create that class file...
foreach(_class ${vtk_module_overrides})
set(_override ${vtk_module_${_class}_override})
set(_vtk_override_includes "${_vtk_override_includes}
#include \"${_override}.h\"")
set(_vtk_override_creates "${_vtk_override_creates}
VTK_CREATE_CREATE_FUNCTION(${_override})")
set(_vtk_override_do "${_vtk_override_do}
this->RegisterOverride(\"${_class}\",
\"${_override}\",
\"Override for ${vtk-module} module\", 1,
vtkObjectFactoryCreate${_override});")
endforeach()
# Now lets create the object factory classes
string(TOUPPER ${vtk-module} VTK-MODULE)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.h.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.h)
configure_file(${VTK_CMAKE_DIR}/vtkObjectFactory.cxx.in
${CMAKE_CURRENT_BINARY_DIR}/${vtk-module}ObjectFactory.cxx)
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Compile ColorMaps.json
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vtkSMTransferFunctionPresetsBuiltin.h
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/ColorMaps.json
kwProcessXML
COMMAND kwProcessXML
${CMAKE_CURRENT_BINARY_DIR}/vtkSMTransferFunctionPresetsBuiltin.h
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/vtkSMTransferFunctionPresetsBuiltin.h"
DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/ColorMaps.json"
ParaView::ProcessXML
COMMAND ParaView::ProcessXML
"${CMAKE_CURRENT_BINARY_DIR}/vtkSMTransferFunctionPresetsBuiltin.h"
vtkSMTransferFunctionPresets JSON JSON
${CMAKE_CURRENT_SOURCE_DIR}/ColorMaps.json
"${CMAKE_CURRENT_SOURCE_DIR}/ColorMaps.json"
COMMENT "Processing builtin color maps")
set(${vtk-module}_HDRS
${CMAKE_CURRENT_BINARY_DIR}/vtkSMTransferFunctionPresetsBuiltin.h)
set_source_files_properties(
${CMAKE_CURRENT_BINARY_DIR}/vtkSMTransferFunctionPresetsBuiltin.h
HEADER_FILE_ONLY)
#-----------------------------------------------------------------------------
vtk_module_library(vtkPVServerManagerRendering ${Module_SRCS})
set(headers
"${CMAKE_CURRENT_BINARY_DIR}/vtkSMTransferFunctionPresetsBuiltin.h")
vtk_object_factory_declare(
BASE vtkSMParaViewPipelineController
OVERRIDE vtkSMParaViewPipelineControllerWithRendering)
vtk_object_factory_configure(
SOURCE_FILE vtk_object_factory_source
HEADER_FILE vtk_object_factory_header
EXPORT_MACRO "VTKPVSERVERMANAGERRENDERING_EXPORT")
vtk_module_add_module(ParaView::ServerManagerRendering
CLASSES ${classes}
SOURCES ${vtk_object_factory_source}
HEADERS ${headers}
PRIVATE_HEADERS ${vtk_object_factory_header})
add_subdirectory(Cxx)
if (PARAVIEW_ENABLE_PYTHON)
add_subdirectory(Python)
endif ()
paraview_add_test_cxx(${vtk-module}CxxTests tests
vtk_add_test_cxx(vtkPVServerManagerRenderingCxxTests tests
NO_DATA NO_OUTPUT NO_VALID
TestImageScaleFactors.cxx
TestParaViewPipelineControllerWithRendering.cxx
TestTransferFunctionManager.cxx
TestTransferFunctionPresets.cxx
)
vtk_test_cxx_executable(${vtk-module}CxxTests tests)
vtk_test_cxx_executable(vtkPVServerManagerRenderingCxxTests tests)
set (__dependencies)
if (PARAVIEW_USE_OSPRAY)
list (APPEND __dependencies vtkRenderingOSPRay)
endif ()
vtk_module(vtkPVServerManagerRendering
GROUPS
ParaViewRendering
IMPLEMENTS
vtkPVServerManagerCore
DEPENDS
vtkPVServerImplementationRendering
vtkPVServerManagerCore
vtkjsoncpp
${__dependencies}
PRIVATE_DEPENDS
vtkCommonColor
vtksys
COMPILE_DEPENDS
vtkUtilitiesProcessXML
TEST_DEPENDS
vtkPVServerManagerApplication
TEST_LABELS
PARAVIEW
KIT
vtkPVServerManager
)
NAME
ParaView::ServerManagerRendering
LIBRARY_NAME
vtkPVServerManagerRendering
GROUPS
ParaViewRendering
KIT
ParaView::ServerManager
IMPLEMENTS
ParaView::ServerManagerCore
DEPENDS
ParaView::ServerImplementationRendering
ParaView::ServerManagerCore
VTK::jsoncpp
PRIVATE_DEPENDS
VTK::CommonColor
VTK::vtksys
OPTIONAL_DEPENDS
VTK::RenderingOSPRay
# These affect the public API.
ParaView::ClientServerCorePython
TEST_DEPENDS
ParaView::ServerManagerApplication
VTK::TestingCore
TEST_LABELS
ParaView
......@@ -26,7 +26,7 @@
#include "vtkPVConfig.h"
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
#include "vtkOSPRayMaterialLibrary.h"
#endif
......@@ -42,7 +42,7 @@ public:
vtkSMMaterialObserver()
{
this->Owner = nullptr;
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
this->Watchee = nullptr;
#endif
}
......@@ -56,7 +56,7 @@ public:
void StartWatching()
{
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
vtkNew<vtkSMParaViewPipelineController> controller;
vtkSMMaterialLibraryProxy* mlp = vtkSMMaterialLibraryProxy::SafeDownCast(
controller->FindMaterialLibrary(this->Owner->GetSession()));
......@@ -74,7 +74,7 @@ public:
}
void StopWatching()
{
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
if (this->Watchee)
{
this->Watchee->RemoveObserver(this);
......@@ -82,7 +82,7 @@ public:
#endif
}
vtkWeakPointer<vtkSMMaterialDomain> Owner;
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
vtkWeakPointer<vtkOSPRayMaterialLibrary> Watchee;
#endif
};
......@@ -113,7 +113,7 @@ void vtkSMMaterialDomain::PrintSelf(ostream& os, vtkIndent indent)
//---------------------------------------------------------------------------
int vtkSMMaterialDomain::ReadXMLAttributes(vtkSMProperty* prop, vtkPVXMLElement* element)
{
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
int retVal = this->Superclass::ReadXMLAttributes(prop, element);
if (!retVal)
{
......@@ -142,7 +142,7 @@ void vtkSMMaterialDomain::CallMeSometime()
//---------------------------------------------------------------------------
void vtkSMMaterialDomain::Update(vtkSMProperty* vtkNotUsed(prop))
{
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
// find the material library we reflect contents of
vtkNew<vtkSMParaViewPipelineController> controller;
vtkSMMaterialLibraryProxy* mlp =
......
......@@ -25,7 +25,7 @@
#include "vtkSMSession.h"
#include "vtkSmartPointer.h"
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
#include "vtkOSPRayMaterialLibrary.h"
#endif
......@@ -43,7 +43,7 @@ vtkSMMaterialLibraryProxy::~vtkSMMaterialLibraryProxy()
//-----------------------------------------------------------------------------
void vtkSMMaterialLibraryProxy::LoadMaterials(const char* filename)
{
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke << VTKOBJECT(this) << "ReadFile" << filename
<< vtkClientServerStream::End;
......@@ -59,7 +59,7 @@ void vtkSMMaterialLibraryProxy::LoadMaterials(const char* filename)
//-----------------------------------------------------------------------------
void vtkSMMaterialLibraryProxy::LoadDefaultMaterials()
{
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
// todo: this should be relative to binary or in prefs/settings, see pq
vtkClientServerStream stream;
stream << vtkClientServerStream::Invoke << VTKOBJECT(this) << "ReadRelativeFile"
......@@ -73,7 +73,7 @@ void vtkSMMaterialLibraryProxy::LoadDefaultMaterials()
//-----------------------------------------------------------------------------
void vtkSMMaterialLibraryProxy::Synchronize()
{
#ifdef PARAVIEW_USE_OSPRAY
#if VTK_MODULE_ENABLE_VTK_RenderingOSPRay
bool builtinMode = false;
if (!this->GetSession() || (this->GetSession()->GetProcessRoles() & vtkPVSession::SERVERS) != 0)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment