From a32b09680628cbac289ad93a483a05fb1de0a463 Mon Sep 17 00:00:00 2001 From: RubioJr9 Date: Fri, 14 Jul 2023 15:19:55 -0600 Subject: [PATCH 1/7] Added variable to use find OSPRay instead of building from scratch --- Superbuild/Superbuild.cmake | 8 +++- .../Modules/Render/Ospray/OSPRayRenderer.cpp | 2 +- .../Modules/Render/Ospray/OSPRayRenderer.h | 2 +- .../Modules/Render/OsprayViewerDialog.cc | 48 +++++++++---------- 4 files changed, 33 insertions(+), 27 deletions(-) diff --git a/Superbuild/Superbuild.cmake b/Superbuild/Superbuild.cmake index d4333e6765..a28b4a5436 100644 --- a/Superbuild/Superbuild.cmake +++ b/Superbuild/Superbuild.cmake @@ -75,6 +75,10 @@ OPTION(WITH_TETGEN "Build Tetgen." OFF) # Configure ospray OPTION(WITH_OSPRAY "Build Ospray." OFF) +########################################### +# Use local ospray +OPTION(WITH_OSPRAY_LOCAL "Use Local Ospray." OFF) + ########################################### # Configure data OPTION(BUILD_WITH_SCIRUN_DATA "Svn checkout data" OFF) @@ -182,7 +186,9 @@ IF(WITH_TETGEN) ADD_EXTERNAL( ${SUPERBUILD_DIR}/TetgenExternal.cmake Tetgen_external ) ENDIF() -IF(WITH_OSPRAY) +IF(WITH_OSPRAY_LOCAL) + find_package(ospray 2.10.0 REQUIRED) +ELSEIF(WITH_OSPRAY) ADD_EXTERNAL( ${SUPERBUILD_DIR}/OsprayExternal.cmake Ospray_external ) ENDIF() diff --git a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp index 4af6f85663..e8003cfca0 100644 --- a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp +++ b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp @@ -46,7 +46,7 @@ using namespace Render; using namespace Core::Datatypes; using namespace Core::Geometry; -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) //int OSPRayRenderer::osprayRendererInstances = 0; OSPRayDataManager OSPRayRenderer::dataManager; diff --git a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h index 2b1c03894d..1f8995e1b1 100644 --- a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h +++ b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h @@ -31,7 +31,7 @@ #include -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #include #include diff --git a/src/Interface/Modules/Render/OsprayViewerDialog.cc b/src/Interface/Modules/Render/OsprayViewerDialog.cc index fdd4f92430..c4b2886f61 100644 --- a/src/Interface/Modules/Render/OsprayViewerDialog.cc +++ b/src/Interface/Modules/Render/OsprayViewerDialog.cc @@ -30,7 +30,7 @@ #include #include -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #include #include @@ -48,7 +48,7 @@ using namespace SCIRun; using namespace SCIRun::Gui; using namespace SCIRun::Dataflow::Networks; using namespace SCIRun::Core::Algorithms; - #ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) using namespace SCIRun::Core::Algorithms::Render; #endif using namespace SCIRun::Core::Datatypes; @@ -61,7 +61,7 @@ OsprayViewerDialog::OsprayViewerDialog(const std::string& name, ModuleStateHandl QWidget* parent) : ModuleDialogGeneric(state, parent) { - #ifdef WITH_OSPRAY + #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) statusBar_ = new QStatusBar(this); renderer_ = new OSPRayRenderer(); @@ -133,7 +133,7 @@ OsprayViewerDialog::OsprayViewerDialog(const std::string& name, ModuleStateHandl OsprayViewerDialog::~OsprayViewerDialog() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) delete viewer_; delete renderer_; #endif @@ -141,7 +141,7 @@ OsprayViewerDialog::~OsprayViewerDialog() void OsprayViewerDialog::newGeometryValue() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) auto geomDataTransient = state_->getTransientValue(Parameters::GeomData); if (!geomDataTransient || geomDataTransient->empty()) return; @@ -200,14 +200,14 @@ void OsprayViewerDialog::addConfigurationButton() void OsprayViewerDialog::configButtonClicked() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) configDialog_->setVisible(!configDialog_->isVisible()); #endif } void OsprayViewerDialog::addConfigurationDialog() { - #ifdef WITH_OSPRAY + #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) auto name = windowTitle() + " Configuration"; configDialog_ = new ViewOspraySceneConfigDialog(name, this); #endif @@ -298,49 +298,49 @@ void OsprayViewerDialog::toggleLockColor(bool locked) void OsprayViewerDialog::autoRotateClicked() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #endif } void OsprayViewerDialog::autoViewClicked() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) renderer_->autoView(); #endif } void OsprayViewerDialog::screenshotClicked() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #endif } void OsprayViewerDialog::nextTimestepClicked() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #endif } void OsprayViewerDialog::playTimestepsClicked() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #endif } void OsprayViewerDialog::setViewportCamera() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #endif } float OsprayViewerDialog::getFloat(const Name& name) const { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) return static_cast(state_->getValue(name).toDouble()); #endif return 0; @@ -348,21 +348,21 @@ float OsprayViewerDialog::getFloat(const Name& name) const void OsprayViewerDialog::setCameraWidgets() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #endif } void OsprayViewerDialog::setLightColor() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #endif } void OsprayViewerDialog::setBGColor() { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #endif } @@ -370,7 +370,7 @@ void OsprayViewerDialog::setBGColor() void OsprayViewerDialog::pullSpecial() { - #ifdef WITH_OSPRAY + #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) auto ambient = colorFromState(Parameters::AmbientLightColor); configDialog_->ambientLightColorRDoubleSpinBox_->setValue(ambient.redF()); configDialog_->ambientLightColorGDoubleSpinBox_->setValue(ambient.greenF()); @@ -385,7 +385,7 @@ void OsprayViewerDialog::pullSpecial() void OsprayViewerDialog::mousePositionToScreenSpace(int xIn, int yIn, float& xOut, float& yOut) { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) int xWindow = xIn - viewer_->pos().x(); int yWindow = yIn - viewer_->pos().y(); @@ -396,7 +396,7 @@ void OsprayViewerDialog::mousePositionToScreenSpace(int xIn, int yIn, float& xOu MouseButton OsprayViewerDialog::getRenderButton(QMouseEvent* event) { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) auto btn = MouseButton::NONE; if (event->buttons() & Qt::LeftButton) btn = MouseButton::LEFT; else if (event->buttons() & Qt::RightButton) btn = MouseButton::RIGHT; @@ -408,7 +408,7 @@ MouseButton OsprayViewerDialog::getRenderButton(QMouseEvent* event) void OsprayViewerDialog::mousePressEvent(QMouseEvent* event) { - #ifdef WITH_OSPRAY + #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) float xSS, ySS; mousePositionToScreenSpace(event->x(), event->y(), xSS, ySS); @@ -418,7 +418,7 @@ void OsprayViewerDialog::mousePressEvent(QMouseEvent* event) void OsprayViewerDialog::mouseMoveEvent(QMouseEvent* event) { - #ifdef WITH_OSPRAY + #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) float xSS, ySS; mousePositionToScreenSpace(event->x(), event->y(), xSS, ySS); @@ -428,7 +428,7 @@ void OsprayViewerDialog::mouseMoveEvent(QMouseEvent* event) void OsprayViewerDialog::mouseReleaseEvent(QMouseEvent* event) { -#ifdef WITH_OSPRAY +#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) renderer_->mouseRelease(); #endif } @@ -438,7 +438,7 @@ void OsprayViewerDialog::mouseReleaseEvent(QMouseEvent* event) void OsprayViewerDialog::wheelEvent(QWheelEvent* event) { - #ifdef WITH_OSPRAY + #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) renderer_->mouseWheel(event->delta()); #endif } From 2eb1556dd0937921c6f372c75a098ee9209f1712 Mon Sep 17 00:00:00 2001 From: RubioJr9 Date: Fri, 14 Jul 2023 15:47:22 -0600 Subject: [PATCH 2/7] Added build instructions for local OSPRay install --- docs/start/build.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/start/build.md b/docs/start/build.md index 1a0a0390af..4a207fbe23 100644 --- a/docs/start/build.md +++ b/docs/start/build.md @@ -87,5 +87,9 @@ To use the InterfaceWithTetgen module, SCIRun needs to be built with Tetgen, whi cmake -DWITH_TETGEN=True ../Superbuild/ ``` +### Configuring SCIRun with Prebuilt OSPRay + +To use the OsprayViewer module with a prebuilt binary, you need to download from the [releases page](https://github.com/ospray/OSPRay/releases) and extract the zip. Only OSPRay 2.4 and 2.10 have been tested. Then add the directory to your shell's PATH variable. CMake will automatically find it when the flag `WITH_OSPRAY_LOCAL` is enabled. + ## Tagging Releases On an OSX system, run script `release.sh` in the `src` directory with the release name in format ***beta.XX*** as a parameter. From a470ba6e9ba3f898197eb6e920511bd7279ad945 Mon Sep 17 00:00:00 2001 From: Tark Patel Date: Wed, 25 Oct 2023 17:02:20 -0600 Subject: [PATCH 3/7] Changed flags for Ospray --- Superbuild/Superbuild.cmake | 9 ++-- docs/start/build.md | 2 +- .../Modules/Render/Ospray/OSPRayRenderer.cpp | 2 +- .../Modules/Render/OsprayViewerDialog.cc | 48 +++++++++---------- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/Superbuild/Superbuild.cmake b/Superbuild/Superbuild.cmake index 6fa3bdbdcd..9edb118932 100644 --- a/Superbuild/Superbuild.cmake +++ b/Superbuild/Superbuild.cmake @@ -73,11 +73,11 @@ OPTION(WITH_TETGEN "Build Tetgen." ON) ########################################### # Configure ospray -OPTION(WITH_OSPRAY "Build Ospray." OFF) +OPTION(BUILD_OSPRAY "Build Ospray." OFF) ########################################### # Use local ospray -OPTION(WITH_OSPRAY_LOCAL "Use Local Ospray." OFF) +OPTION(PREBUILT_OSPRAY "Use prebuilt copy of Ospray." OFF) ########################################### # Configure data @@ -195,11 +195,12 @@ IF(WITH_TETGEN) ADD_EXTERNAL( ${SUPERBUILD_DIR}/TetgenExternal.cmake Tetgen_external ) ENDIF() -IF(WITH_OSPRAY_LOCAL) +IF(PREBUILT_OSPRAY) find_package(ospray 2.10.0 REQUIRED) -ELSEIF(WITH_OSPRAY) +ELSEIF(BUILD_OSPRAY) ADD_EXTERNAL( ${SUPERBUILD_DIR}/OsprayExternal.cmake Ospray_external ) ENDIF() +SET(WITH_OSPRAY (BUILD_OSPRAY || PREBUILT_OSPRAY)) IF(NOT BUILD_HEADLESS) ADD_EXTERNAL( ${SUPERBUILD_DIR}/QwtExternal.cmake Qwt_external ) diff --git a/docs/start/build.md b/docs/start/build.md index a1c717e1cd..f6b21f4207 100644 --- a/docs/start/build.md +++ b/docs/start/build.md @@ -151,7 +151,7 @@ Append `-jN`, where N is the number of threads, to build multi-threaded. ### Configuring SCIRun with Prebuilt OSPRay -To use the OsprayViewer module with a prebuilt binary, you need to download from the [releases page](https://github.com/ospray/OSPRay/releases) and extract the zip. Only OSPRay 2.4 and 2.10 have been tested. Then add the directory to your shell's PATH variable. CMake will automatically find it when the flag `WITH_OSPRAY_LOCAL` is enabled. +To use the OsprayViewer module with a prebuilt binary, you need to download from the [releases page](https://github.com/ospray/OSPRay/releases) and extract the zip. Only OSPRay 2.4 and 2.10 have been tested. Then add the directory to your shell's PATH variable. CMake will automatically find it when the flag `PREBUILT_OSPRAY` is enabled. ## Tagging Releases On an OSX system, run script `release.sh` in the `src` directory with the release name in format ***beta.XX*** as a parameter. diff --git a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp index e8003cfca0..fa66fdbc36 100644 --- a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp +++ b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp @@ -46,7 +46,7 @@ using namespace Render; using namespace Core::Datatypes; using namespace Core::Geometry; -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) //int OSPRayRenderer::osprayRendererInstances = 0; OSPRayDataManager OSPRayRenderer::dataManager; diff --git a/src/Interface/Modules/Render/OsprayViewerDialog.cc b/src/Interface/Modules/Render/OsprayViewerDialog.cc index 6d5f202495..7bb5a12658 100644 --- a/src/Interface/Modules/Render/OsprayViewerDialog.cc +++ b/src/Interface/Modules/Render/OsprayViewerDialog.cc @@ -30,7 +30,7 @@ #include #include -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #include #include @@ -48,7 +48,7 @@ using namespace SCIRun; using namespace SCIRun::Gui; using namespace SCIRun::Dataflow::Networks; using namespace SCIRun::Core::Algorithms; -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) using namespace SCIRun::Core::Algorithms::Render; #endif using namespace SCIRun::Core::Datatypes; @@ -61,7 +61,7 @@ OsprayViewerDialog::OsprayViewerDialog(const std::string& name, ModuleStateHandl QWidget* parent) : ModuleDialogGeneric(state, parent) { - #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) + #if defined(WITH_OSPRAY) statusBar_ = new QStatusBar(this); renderer_ = new OSPRayRenderer(); @@ -133,7 +133,7 @@ OsprayViewerDialog::OsprayViewerDialog(const std::string& name, ModuleStateHandl OsprayViewerDialog::~OsprayViewerDialog() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) delete viewer_; delete renderer_; #endif @@ -141,7 +141,7 @@ OsprayViewerDialog::~OsprayViewerDialog() void OsprayViewerDialog::newGeometryValue() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) auto geomDataTransient = state_->getTransientValue(Parameters::GeomData); if (!geomDataTransient || geomDataTransient->empty()) return; @@ -200,14 +200,14 @@ void OsprayViewerDialog::addConfigurationButton() void OsprayViewerDialog::configButtonClicked() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) configDialog_->setVisible(!configDialog_->isVisible()); #endif } void OsprayViewerDialog::addConfigurationDialog() { - #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) + #if defined(WITH_OSPRAY) auto name = windowTitle() + " Configuration"; configDialog_ = new ViewOspraySceneConfigDialog(name, this); #endif @@ -298,49 +298,49 @@ void OsprayViewerDialog::toggleLockColor(bool locked) void OsprayViewerDialog::autoRotateClicked() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #endif } void OsprayViewerDialog::autoViewClicked() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) renderer_->autoView(); #endif } void OsprayViewerDialog::screenshotClicked() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #endif } void OsprayViewerDialog::nextTimestepClicked() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #endif } void OsprayViewerDialog::playTimestepsClicked() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #endif } void OsprayViewerDialog::setViewportCamera() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #endif } float OsprayViewerDialog::getFloat(const Name& name) const { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) return static_cast(state_->getValue(name).toDouble()); #endif return 0; @@ -348,21 +348,21 @@ float OsprayViewerDialog::getFloat(const Name& name) const void OsprayViewerDialog::setCameraWidgets() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #endif } void OsprayViewerDialog::setLightColor() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #endif } void OsprayViewerDialog::setBGColor() { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) #endif } @@ -370,7 +370,7 @@ void OsprayViewerDialog::setBGColor() void OsprayViewerDialog::pullSpecial() { - #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) + #if defined(WITH_OSPRAY) auto ambient = colorFromState(Parameters::AmbientLightColor); configDialog_->ambientLightColorRDoubleSpinBox_->setValue(ambient.redF()); configDialog_->ambientLightColorGDoubleSpinBox_->setValue(ambient.greenF()); @@ -385,7 +385,7 @@ void OsprayViewerDialog::pullSpecial() void OsprayViewerDialog::mousePositionToScreenSpace(int xIn, int yIn, float& xOut, float& yOut) { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) int xWindow = xIn - viewer_->pos().x(); int yWindow = yIn - viewer_->pos().y(); @@ -396,7 +396,7 @@ void OsprayViewerDialog::mousePositionToScreenSpace(int xIn, int yIn, float& xOu MouseButton OsprayViewerDialog::getRenderButton(QMouseEvent* event) { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) auto btn = MouseButton::NONE; if (event->buttons() & Qt::LeftButton) btn = MouseButton::LEFT; else if (event->buttons() & Qt::RightButton) btn = MouseButton::RIGHT; @@ -408,7 +408,7 @@ MouseButton OsprayViewerDialog::getRenderButton(QMouseEvent* event) void OsprayViewerDialog::mousePressEvent(QMouseEvent* event) { - #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) + #if defined(WITH_OSPRAY) float xSS, ySS; mousePositionToScreenSpace(event->x(), event->y(), xSS, ySS); @@ -418,7 +418,7 @@ void OsprayViewerDialog::mousePressEvent(QMouseEvent* event) void OsprayViewerDialog::mouseMoveEvent(QMouseEvent* event) { - #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) + #if defined(WITH_OSPRAY) float xSS, ySS; mousePositionToScreenSpace(event->x(), event->y(), xSS, ySS); @@ -428,14 +428,14 @@ void OsprayViewerDialog::mouseMoveEvent(QMouseEvent* event) void OsprayViewerDialog::mouseReleaseEvent(QMouseEvent* event) { -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#if defined(WITH_OSPRAY) renderer_->mouseRelease(); #endif } void OsprayViewerDialog::wheelEvent(QWheelEvent* event) { - #if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) + #if defined(WITH_OSPRAY) renderer_->mouseWheel(event->angleDelta().y()); #endif } From 584e04ec58cd15ef7bf305391238179b5009a2f2 Mon Sep 17 00:00:00 2001 From: Tark Patel Date: Wed, 25 Oct 2023 17:02:34 -0600 Subject: [PATCH 4/7] Added error message for building and prebuilt ospray together --- Superbuild/Superbuild.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Superbuild/Superbuild.cmake b/Superbuild/Superbuild.cmake index 9edb118932..623c49e5d3 100644 --- a/Superbuild/Superbuild.cmake +++ b/Superbuild/Superbuild.cmake @@ -79,6 +79,10 @@ OPTION(BUILD_OSPRAY "Build Ospray." OFF) # Use local ospray OPTION(PREBUILT_OSPRAY "Use prebuilt copy of Ospray." OFF) +IF (BUILD_OSPRAY AND PREBUILT_OSPRAY) + MESSAGE(SEND_ERROR "Cannot set both building and prebuilt Ospray.") +ENDIF() + ########################################### # Configure data OPTION(BUILD_WITH_SCIRUN_DATA "Svn checkout data" OFF) From f36c8169941726b3cf062e0f627f0552688724ab Mon Sep 17 00:00:00 2001 From: Tark Patel Date: Wed, 25 Oct 2023 17:06:32 -0600 Subject: [PATCH 5/7] Changed idef syntax back --- .../Modules/Render/Ospray/OSPRayRenderer.cpp | 2 +- .../Modules/Render/Ospray/OSPRayRenderer.h | 2 +- .../Modules/Render/OsprayViewerDialog.cc | 48 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp index fa66fdbc36..fa63529e83 100644 --- a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp +++ b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp @@ -46,7 +46,7 @@ using namespace Render; using namespace Core::Datatypes; using namespace Core::Geometry; -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) //int OSPRayRenderer::osprayRendererInstances = 0; OSPRayDataManager OSPRayRenderer::dataManager; diff --git a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h index 1f8995e1b1..99f3b1f142 100644 --- a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h +++ b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h @@ -31,7 +31,7 @@ #include -#if defined(WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#ifdef (WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) #include #include diff --git a/src/Interface/Modules/Render/OsprayViewerDialog.cc b/src/Interface/Modules/Render/OsprayViewerDialog.cc index 7bb5a12658..8e1097a611 100644 --- a/src/Interface/Modules/Render/OsprayViewerDialog.cc +++ b/src/Interface/Modules/Render/OsprayViewerDialog.cc @@ -30,7 +30,7 @@ #include #include -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #include #include @@ -48,7 +48,7 @@ using namespace SCIRun; using namespace SCIRun::Gui; using namespace SCIRun::Dataflow::Networks; using namespace SCIRun::Core::Algorithms; -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) using namespace SCIRun::Core::Algorithms::Render; #endif using namespace SCIRun::Core::Datatypes; @@ -61,7 +61,7 @@ OsprayViewerDialog::OsprayViewerDialog(const std::string& name, ModuleStateHandl QWidget* parent) : ModuleDialogGeneric(state, parent) { - #if defined(WITH_OSPRAY) + #ifdef (WITH_OSPRAY) statusBar_ = new QStatusBar(this); renderer_ = new OSPRayRenderer(); @@ -133,7 +133,7 @@ OsprayViewerDialog::OsprayViewerDialog(const std::string& name, ModuleStateHandl OsprayViewerDialog::~OsprayViewerDialog() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) delete viewer_; delete renderer_; #endif @@ -141,7 +141,7 @@ OsprayViewerDialog::~OsprayViewerDialog() void OsprayViewerDialog::newGeometryValue() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) auto geomDataTransient = state_->getTransientValue(Parameters::GeomData); if (!geomDataTransient || geomDataTransient->empty()) return; @@ -200,14 +200,14 @@ void OsprayViewerDialog::addConfigurationButton() void OsprayViewerDialog::configButtonClicked() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) configDialog_->setVisible(!configDialog_->isVisible()); #endif } void OsprayViewerDialog::addConfigurationDialog() { - #if defined(WITH_OSPRAY) + #ifdef (WITH_OSPRAY) auto name = windowTitle() + " Configuration"; configDialog_ = new ViewOspraySceneConfigDialog(name, this); #endif @@ -298,49 +298,49 @@ void OsprayViewerDialog::toggleLockColor(bool locked) void OsprayViewerDialog::autoRotateClicked() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #endif } void OsprayViewerDialog::autoViewClicked() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) renderer_->autoView(); #endif } void OsprayViewerDialog::screenshotClicked() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #endif } void OsprayViewerDialog::nextTimestepClicked() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #endif } void OsprayViewerDialog::playTimestepsClicked() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #endif } void OsprayViewerDialog::setViewportCamera() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #endif } float OsprayViewerDialog::getFloat(const Name& name) const { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) return static_cast(state_->getValue(name).toDouble()); #endif return 0; @@ -348,21 +348,21 @@ float OsprayViewerDialog::getFloat(const Name& name) const void OsprayViewerDialog::setCameraWidgets() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #endif } void OsprayViewerDialog::setLightColor() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #endif } void OsprayViewerDialog::setBGColor() { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) #endif } @@ -370,7 +370,7 @@ void OsprayViewerDialog::setBGColor() void OsprayViewerDialog::pullSpecial() { - #if defined(WITH_OSPRAY) + #ifdef (WITH_OSPRAY) auto ambient = colorFromState(Parameters::AmbientLightColor); configDialog_->ambientLightColorRDoubleSpinBox_->setValue(ambient.redF()); configDialog_->ambientLightColorGDoubleSpinBox_->setValue(ambient.greenF()); @@ -385,7 +385,7 @@ void OsprayViewerDialog::pullSpecial() void OsprayViewerDialog::mousePositionToScreenSpace(int xIn, int yIn, float& xOut, float& yOut) { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) int xWindow = xIn - viewer_->pos().x(); int yWindow = yIn - viewer_->pos().y(); @@ -396,7 +396,7 @@ void OsprayViewerDialog::mousePositionToScreenSpace(int xIn, int yIn, float& xOu MouseButton OsprayViewerDialog::getRenderButton(QMouseEvent* event) { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) auto btn = MouseButton::NONE; if (event->buttons() & Qt::LeftButton) btn = MouseButton::LEFT; else if (event->buttons() & Qt::RightButton) btn = MouseButton::RIGHT; @@ -408,7 +408,7 @@ MouseButton OsprayViewerDialog::getRenderButton(QMouseEvent* event) void OsprayViewerDialog::mousePressEvent(QMouseEvent* event) { - #if defined(WITH_OSPRAY) + #ifdef (WITH_OSPRAY) float xSS, ySS; mousePositionToScreenSpace(event->x(), event->y(), xSS, ySS); @@ -418,7 +418,7 @@ void OsprayViewerDialog::mousePressEvent(QMouseEvent* event) void OsprayViewerDialog::mouseMoveEvent(QMouseEvent* event) { - #if defined(WITH_OSPRAY) + #ifdef (WITH_OSPRAY) float xSS, ySS; mousePositionToScreenSpace(event->x(), event->y(), xSS, ySS); @@ -428,14 +428,14 @@ void OsprayViewerDialog::mouseMoveEvent(QMouseEvent* event) void OsprayViewerDialog::mouseReleaseEvent(QMouseEvent* event) { -#if defined(WITH_OSPRAY) +#ifdef (WITH_OSPRAY) renderer_->mouseRelease(); #endif } void OsprayViewerDialog::wheelEvent(QWheelEvent* event) { - #if defined(WITH_OSPRAY) + #ifdef (WITH_OSPRAY) renderer_->mouseWheel(event->angleDelta().y()); #endif } From 475e87733c3fbfa872f2b85d0af3f9ffc3045024 Mon Sep 17 00:00:00 2001 From: Tark Patel Date: Wed, 25 Oct 2023 17:08:48 -0600 Subject: [PATCH 6/7] Removed parantheses --- .../Modules/Render/Ospray/OSPRayRenderer.cpp | 2 +- .../Modules/Render/Ospray/OSPRayRenderer.h | 2 +- .../Modules/Render/OsprayViewerDialog.cc | 48 +++++++++---------- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp index fa63529e83..4af6f85663 100644 --- a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp +++ b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.cpp @@ -46,7 +46,7 @@ using namespace Render; using namespace Core::Datatypes; using namespace Core::Geometry; -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY //int OSPRayRenderer::osprayRendererInstances = 0; OSPRayDataManager OSPRayRenderer::dataManager; diff --git a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h index 99f3b1f142..2b1c03894d 100644 --- a/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h +++ b/src/Interface/Modules/Render/Ospray/OSPRayRenderer.h @@ -31,7 +31,7 @@ #include -#ifdef (WITH_OSPRAY) || defined(WITH_OSPRAY_LOCAL) +#ifdef WITH_OSPRAY #include #include diff --git a/src/Interface/Modules/Render/OsprayViewerDialog.cc b/src/Interface/Modules/Render/OsprayViewerDialog.cc index 8e1097a611..067b8c94f4 100644 --- a/src/Interface/Modules/Render/OsprayViewerDialog.cc +++ b/src/Interface/Modules/Render/OsprayViewerDialog.cc @@ -30,7 +30,7 @@ #include #include -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #include #include @@ -48,7 +48,7 @@ using namespace SCIRun; using namespace SCIRun::Gui; using namespace SCIRun::Dataflow::Networks; using namespace SCIRun::Core::Algorithms; -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY using namespace SCIRun::Core::Algorithms::Render; #endif using namespace SCIRun::Core::Datatypes; @@ -61,7 +61,7 @@ OsprayViewerDialog::OsprayViewerDialog(const std::string& name, ModuleStateHandl QWidget* parent) : ModuleDialogGeneric(state, parent) { - #ifdef (WITH_OSPRAY) + #ifdef WITH_OSPRAY statusBar_ = new QStatusBar(this); renderer_ = new OSPRayRenderer(); @@ -133,7 +133,7 @@ OsprayViewerDialog::OsprayViewerDialog(const std::string& name, ModuleStateHandl OsprayViewerDialog::~OsprayViewerDialog() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY delete viewer_; delete renderer_; #endif @@ -141,7 +141,7 @@ OsprayViewerDialog::~OsprayViewerDialog() void OsprayViewerDialog::newGeometryValue() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY auto geomDataTransient = state_->getTransientValue(Parameters::GeomData); if (!geomDataTransient || geomDataTransient->empty()) return; @@ -200,14 +200,14 @@ void OsprayViewerDialog::addConfigurationButton() void OsprayViewerDialog::configButtonClicked() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY configDialog_->setVisible(!configDialog_->isVisible()); #endif } void OsprayViewerDialog::addConfigurationDialog() { - #ifdef (WITH_OSPRAY) + #ifdef WITH_OSPRAY auto name = windowTitle() + " Configuration"; configDialog_ = new ViewOspraySceneConfigDialog(name, this); #endif @@ -298,49 +298,49 @@ void OsprayViewerDialog::toggleLockColor(bool locked) void OsprayViewerDialog::autoRotateClicked() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #endif } void OsprayViewerDialog::autoViewClicked() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY renderer_->autoView(); #endif } void OsprayViewerDialog::screenshotClicked() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #endif } void OsprayViewerDialog::nextTimestepClicked() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #endif } void OsprayViewerDialog::playTimestepsClicked() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #endif } void OsprayViewerDialog::setViewportCamera() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #endif } float OsprayViewerDialog::getFloat(const Name& name) const { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY return static_cast(state_->getValue(name).toDouble()); #endif return 0; @@ -348,21 +348,21 @@ float OsprayViewerDialog::getFloat(const Name& name) const void OsprayViewerDialog::setCameraWidgets() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #endif } void OsprayViewerDialog::setLightColor() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #endif } void OsprayViewerDialog::setBGColor() { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY #endif } @@ -370,7 +370,7 @@ void OsprayViewerDialog::setBGColor() void OsprayViewerDialog::pullSpecial() { - #ifdef (WITH_OSPRAY) + #ifdef WITH_OSPRAY auto ambient = colorFromState(Parameters::AmbientLightColor); configDialog_->ambientLightColorRDoubleSpinBox_->setValue(ambient.redF()); configDialog_->ambientLightColorGDoubleSpinBox_->setValue(ambient.greenF()); @@ -385,7 +385,7 @@ void OsprayViewerDialog::pullSpecial() void OsprayViewerDialog::mousePositionToScreenSpace(int xIn, int yIn, float& xOut, float& yOut) { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY int xWindow = xIn - viewer_->pos().x(); int yWindow = yIn - viewer_->pos().y(); @@ -396,7 +396,7 @@ void OsprayViewerDialog::mousePositionToScreenSpace(int xIn, int yIn, float& xOu MouseButton OsprayViewerDialog::getRenderButton(QMouseEvent* event) { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY auto btn = MouseButton::NONE; if (event->buttons() & Qt::LeftButton) btn = MouseButton::LEFT; else if (event->buttons() & Qt::RightButton) btn = MouseButton::RIGHT; @@ -408,7 +408,7 @@ MouseButton OsprayViewerDialog::getRenderButton(QMouseEvent* event) void OsprayViewerDialog::mousePressEvent(QMouseEvent* event) { - #ifdef (WITH_OSPRAY) + #ifdef WITH_OSPRAY float xSS, ySS; mousePositionToScreenSpace(event->x(), event->y(), xSS, ySS); @@ -418,7 +418,7 @@ void OsprayViewerDialog::mousePressEvent(QMouseEvent* event) void OsprayViewerDialog::mouseMoveEvent(QMouseEvent* event) { - #ifdef (WITH_OSPRAY) + #ifdef WITH_OSPRAY float xSS, ySS; mousePositionToScreenSpace(event->x(), event->y(), xSS, ySS); @@ -428,14 +428,14 @@ void OsprayViewerDialog::mouseMoveEvent(QMouseEvent* event) void OsprayViewerDialog::mouseReleaseEvent(QMouseEvent* event) { -#ifdef (WITH_OSPRAY) +#ifdef WITH_OSPRAY renderer_->mouseRelease(); #endif } void OsprayViewerDialog::wheelEvent(QWheelEvent* event) { - #ifdef (WITH_OSPRAY) + #ifdef WITH_OSPRAY renderer_->mouseWheel(event->angleDelta().y()); #endif } From 36d1801b4032c68cdcabd00fd6a3d08c05ad3c02 Mon Sep 17 00:00:00 2001 From: Tark Patel Date: Wed, 25 Oct 2023 17:09:27 -0600 Subject: [PATCH 7/7] Added back space --- src/Interface/Modules/Render/OsprayViewerDialog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Interface/Modules/Render/OsprayViewerDialog.cc b/src/Interface/Modules/Render/OsprayViewerDialog.cc index 067b8c94f4..cbee77b261 100644 --- a/src/Interface/Modules/Render/OsprayViewerDialog.cc +++ b/src/Interface/Modules/Render/OsprayViewerDialog.cc @@ -48,7 +48,7 @@ using namespace SCIRun; using namespace SCIRun::Gui; using namespace SCIRun::Dataflow::Networks; using namespace SCIRun::Core::Algorithms; -#ifdef WITH_OSPRAY + #ifdef WITH_OSPRAY using namespace SCIRun::Core::Algorithms::Render; #endif using namespace SCIRun::Core::Datatypes;