Commit 6aebe1c8 authored by David Thompson's avatar David Thompson

Handle VTK-only build with cinema helper.

The Cinema helper needs to expose different functionality depending
on what VTK libraries are requested/available.

+ When the Cinema helper is expected to generate images, VTK's rendering
  libraries must be available (either through Catalyst or VTK).
+ Other functionality is specific to Catalyst (which provides Ice-T
  parallel, multipass rendering).
parent a7276c5c
......@@ -36,6 +36,10 @@ cmake_dependent_option(ENABLE_VTK_MPI
"Enable use of parallel vtk" OFF
"ENABLE_SENSEI" OFF)
cmake_dependent_option(ENABLE_VTK_RENDERING
"Enable use of VTK's rendering libraries" ON
"ENABLE_SENSEI" OFF)
cmake_dependent_option(ENABLE_VTK_ACCELERATORS
"Enable analysis methods that use VTK-m via VTK's Accelerators module" OFF
"ENABLE_SENSEI" OFF)
......@@ -71,6 +75,7 @@ message(STATUS "ENABLE_CONDUIT=${ENABLE_CONDUIT}")
message(STATUS "ENABLE_LIBSIM=${ENABLE_LIBSIM}")
message(STATUS "ENABLE_VTK_IO=${ENABLE_VTK_IO}")
message(STATUS "ENABLE_VTK_MPI=${ENABLE_VTK_MPI}")
message(STATUS "ENABLE_VTK_RENDERING=${ENABLE_VTK_RENDERING}")
message(STATUS "ENABLE_VTK_ACCELERATORS=${ENABLE_VTK_ACCELERATORS}")
message(STATUS "ENABLE_VTKM=${ENABLE_VTKM}")
message(STATUS "ENABLE_VTKM_RENDERING=${ENABLE_VTKM_RENDERING}")
......
......@@ -8,6 +8,15 @@ if (ENABLE_VTK_IO)
list(APPEND SENSEI_VTK_COMPONENTS vtkIOParallelXML)
endif()
endif()
if (ENABLE_VTK_RENDERING)
list(APPEND SENSEI_VTK_COMPONENTS vtkRenderingCore)
if (TARGET vtkRenderingOpenGL2)
list(APPEND SENSEI_VTK_COMPONENTS vtkRenderingOpenGL2)
endif()
if (TARGET vtkRenderingOpenGL)
list(APPEND SENSEI_VTK_COMPONENTS vtkRenderingOpenGL)
endif()
endif()
if (ENABLE_PYTHON)
list(APPEND SENSEI_VTK_COMPONENTS vtkPython vtkWrappingPythonCore)
endif()
......
This diff is collapsed.
#ifndef sensei_CinemaHelper_h
#define sensei_CinemaHelper_h
#include "senseiConfig.h"
class vtkSMViewProxy;
class vtkSMRenderViewProxy;
class vtkSMRepresentationProxy;
......@@ -9,8 +11,6 @@ class vtkCamera;
class vtkRenderer;
class vtkRenderWindow;
class vtkIceTCompositePass;
class vtkCameraPass;
class vtkLightingMapPass;
class vtkImageData;
#include <string>
......@@ -28,14 +28,25 @@ public:
void SetImageSize(int width, int height);
void SetWorkingDirectory(const std::string& path);
void SetExportType(const std::string& exportType);
void SetSampleSize(int ssz);
void AddTimeEntry();
void WriteMetadata();
// Camera handling
void SetCameraConfig(const std::string& config);
int GetNumberOfCameraPositions();
#ifdef ENABLE_CATALYST
void ApplyCameraPosition(vtkSMViewProxy* view, int cameraPositionIndex);
#endif
#if defined(ENABLE_CATALYST) || defined (ENABLE_VTK_RENDERING)
void ApplyCameraPosition(vtkCamera* camera, int cameraPositionIndex);
#endif
// Scalar selection
void SetScalarAssociation(const std::string& assoc); // "points" or "cells"
std::string GetScalarAssociation() const;
void SetScalarName(const std::string& name);
std::string GetScalarName() const;
// Contours handling
int GetNumberOfContours();
......@@ -44,22 +55,35 @@ public:
// Composite dataset handling
// => FIXME: Assume => intensity + constant coloring
#ifdef ENABLE_CATALYST
int RegisterLayer(const std::string& name, vtkSMRepresentationProxy* representation, double scalarValue);
#endif
#if defined(ENABLE_CATALYST) || defined (ENABLE_VTK_RENDERING)
int RegisterLayer(const std::string& name, vtkActor* actor, double scalarValue);
#endif
#ifdef ENABLE_CATALYST
void CaptureSortedCompositeData(vtkSMRenderViewProxy* view);
void CaptureSortedCompositeData(vtkRenderWindow* renderWindow, vtkRenderer* renderer, vtkIceTCompositePass* compositePass);
#endif
#if defined(ENABLE_CATALYST) || defined (ENABLE_VTK_RENDERING)
void Render(vtkRenderWindow* renderWindow);
vtkImageData* CaptureWindow(vtkRenderWindow* renderWindow);
#endif
#ifdef ENABLE_CATALYST
// Image handling
void CaptureImage(vtkSMViewProxy* view, const std::string fileName, const std::string writerName, double scale = 1, bool createDirectory = true);
// Generic Methods
void Capture(vtkSMViewProxy* view);
#endif
// Volume handling
void WriteVolume(vtkImageData* image);
// CDF handling
void WriteCDF(long long totalArraySize, const double* cdfValues);
private:
struct Internals;
Internals *Data;
......
......@@ -7,8 +7,10 @@
#include <vtkCellData.h>
#include <vtkFloatArray.h>
#include <vtkImageData.h>
#include <vtkMPICommunicator.h>
#include <vtkMPIController.h>
#ifdef ENABLE_VTK_MPI
# include <vtkMPICommunicator.h>
# include <vtkMPIController.h>
#endif
#include <vtkMultiBlockDataSet.h>
#include <vtkNew.h>
#include <vtkObjectFactory.h>
......@@ -215,10 +217,12 @@ void VTKmVolumeReductionAnalysis::Initialize(
this->Communicator = comm;
this->Reduction = reductionFactor;
#ifdef ENABLE_VTK_MPI
vtkNew<vtkMPIController> con;
con->Initialize(0, 0, 1); // initialized externally
vtkMultiProcessController::SetGlobalController(con.GetPointer());
con->Register(NULL); // Keep ref
#endif
this->Helper = new CinemaHelper();
this->Helper->SetWorkingDirectory(workingDirectory);
......
......@@ -15,6 +15,7 @@
#cmakedefine ENABLE_VTK_GENERIC_ARRAYS
#cmakedefine ENABLE_VTK_MPI
#cmakedefine ENABLE_VTK_IO
#cmakedefine ENABLE_VTK_RENDERING
#cmakedefine ENABLE_VTK_ACCELERATORS
#cmakedefine ENABLE_VTKM
......
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