Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/reorg renderlib #110

Merged
merged 2 commits into from
Jun 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "renderlib/libCZI"]
path = renderlib/libCZI
path = renderlib/io/libCZI
url = https://github.com/ZEISS/libczi.git
8 changes: 4 additions & 4 deletions agave_app/GLView3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

#include "renderlib/ImageXYZC.h"
#include "renderlib/Logging.h"
#include "renderlib/RenderGL.h"
#include "renderlib/RenderGLPT.h"
#include "renderlib/gl/Image3D.h"
#include "renderlib/gl/Util.h"
#include "renderlib/graphics/RenderGL.h"
#include "renderlib/graphics/RenderGLPT.h"
#include "renderlib/graphics/gl/Image3D.h"
#include "renderlib/graphics/gl/Util.h"

#include <glm.h>

Expand Down
2 changes: 1 addition & 1 deletion agave_app/TimelineDockWidget.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"

#include <QDockWidget>
#include <QGridLayout>
Expand Down
2 changes: 1 addition & 1 deletion agave_app/agaveGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "agaveGui.h"

#include "renderlib/AppScene.h"
#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"
#include "renderlib/ImageXYZC.h"
#include "renderlib/Logging.h"
#include "renderlib/Status.h"
Expand Down
2 changes: 1 addition & 1 deletion agave_app/loadDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "RangeWidget.h"
#include "Section.h"

#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"
#include "renderlib/Logging.h"

#include <QComboBox>
Expand Down
2 changes: 1 addition & 1 deletion agave_app/loadDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "Controls.h"
#include "Section.h"

#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"
#include "renderlib/VolumeDimensions.h"

#include <QComboBox>
Expand Down
2 changes: 1 addition & 1 deletion agave_app/main.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "agaveGui.h"

#include "mainwindow.h"
#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"
#include "renderlib/Logging.h"
#include "renderlib/renderlib.h"
#include "renderlib/version.h"
Expand Down
4 changes: 2 additions & 2 deletions agave_app/python/pyrenderer.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "pyrenderer.h"

#include "renderlib/CCamera.h"
#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"
#include "renderlib/Logging.h"
#include "renderlib/RenderGLPT.h"
#include "renderlib/graphics/RenderGLPT.h"
#include "renderlib/RenderSettings.h"
#include "renderlib/renderlib.h"

Expand Down
4 changes: 2 additions & 2 deletions agave_app/python/pyrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

#include "RenderInterface.h"
#include "command.h"
#include "renderlib/IRenderWindow.h"
#include "renderlib/gl/Util.h"
#include "renderlib/graphics/IRenderWindow.h"
#include "renderlib/graphics/gl/Util.h"
#include "renderlib/renderlib.h"

#include <QList>
Expand Down
2 changes: 1 addition & 1 deletion agave_app/renderDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "renderer.h"

#include "renderlib/AppScene.h"
#include "renderlib/IRenderWindow.h"
#include "renderlib/graphics/IRenderWindow.h"
#include "renderlib/Logging.h"
#include "renderlib/RenderSettings.h"
#include "renderlib/command.h"
Expand Down
2 changes: 1 addition & 1 deletion agave_app/renderDialog.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

#include "renderlib/CCamera.h"
#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"

#include <QDialog>
#include <QMutex>
Expand Down
6 changes: 3 additions & 3 deletions agave_app/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

#include "renderlib/AppScene.h"
#include "renderlib/CCamera.h"
#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"
#include "renderlib/Logging.h"
#include "renderlib/RenderGL.h"
#include "renderlib/RenderGLPT.h"
#include "renderlib/graphics/RenderGL.h"
#include "renderlib/graphics/RenderGLPT.h"
#include "renderlib/RenderSettings.h"

#include "command.h"
Expand Down
4 changes: 2 additions & 2 deletions agave_app/renderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@

#include "glad/glad.h"

#include "renderlib/FileReader.h"
#include "renderlib/io/FileReader.h"
#include "renderlib/command.h"
#include "renderlib/gl/Util.h"
#include "renderlib/graphics/gl/Util.h"
#include "renderlib/renderlib.h"
#include "renderrequest.h"

Expand Down
62 changes: 3 additions & 59 deletions renderlib/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set(GLAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/glad/include")
set(GLAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}/graphics/glad/include")

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/version.h.in"
Expand All @@ -19,20 +19,8 @@ target_sources(renderlib PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/CCamera.h"
"${CMAKE_CURRENT_SOURCE_DIR}/command.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/command.h"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReader.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReader.h"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReaderCCP4.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReaderCCP4.h"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReaderCzi.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReaderCzi.h"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReaderTIFF.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReaderTIFF.h"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReaderZarr.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/FileReaderZarr.h"
"${CMAKE_CURRENT_SOURCE_DIR}/Flags.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Flags.h"
"${CMAKE_CURRENT_SOURCE_DIR}/Framebuffer.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Framebuffer.h"
"${CMAKE_CURRENT_SOURCE_DIR}/Fuse.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Fuse.h"
"${CMAKE_CURRENT_SOURCE_DIR}/GradientData.cpp"
Expand All @@ -42,16 +30,8 @@ target_sources(renderlib PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/IFileReader.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ImageXYZC.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ImageXYZC.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ImageXyzcGpu.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ImageXyzcGpu.h"
"${CMAKE_CURRENT_SOURCE_DIR}/IRenderWindow.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/IRenderWindow.h"
"${CMAKE_CURRENT_SOURCE_DIR}/Logging.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Logging.h"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderGL.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderGL.h"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderGLPT.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderGLPT.h"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderSettings.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderSettings.h"
"${CMAKE_CURRENT_SOURCE_DIR}/Status.cpp"
Expand All @@ -68,50 +48,14 @@ target_sources(renderlib PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/VolumeDimensions.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/VolumeDimensions.h"
)
add_subdirectory(gl)
add_subdirectory(glad/src)
add_subdirectory(glsl)
add_subdirectory(graphics)
add_subdirectory(io)
add_subdirectory(pugixml)

# libCZI dependency for renderlib
# add_compile_definitions(_LIBCZISTATICLIB)
set(LIBCZI_DO_NOT_SET_MSVC_RUNTIME_LIBRARY ON)
set(LIBCZI_BUILD_UNITTESTS OFF)
set(LIBCZI_BUILD_DYNLIB ON)
set(LIBCZI_BUILD_CZICMD OFF)
add_subdirectory(libCZI)

# end libczi dependency

# zstd dependency for tensorstore / riegeli
FetchContent_Declare(
zstd
URL "https://github.com/facebook/zstd/archive/v1.5.5.tar.gz"
URL_HASH SHA256=98e9c3d949d1b924e28e01eccb7deed865eefebf25c2f21c702e5cd5b63b85e1
)

# Additional FetchContent_Declare calls as needed...
FetchContent_MakeAvailable(zstd)

# tensorstore dependency for renderlib
set(TENSORSTORE_USE_SYSTEM_TIFF ON)
FetchContent_Declare(
tensorstore
URL "https://github.com/google/tensorstore/archive/refs/tags/v0.1.36.tar.gz"
URL_HASH SHA256=5857582B1B68E5A3F470D2EE8E9A7FA1AD6E6C7E0867C7C69E5A523AE00BC002
)

# Additional FetchContent_Declare calls as needed...
FetchContent_MakeAvailable(tensorstore)

# end tensorstore dependency
target_link_libraries(renderlib
Qt::Widgets Qt::Core Qt::Gui Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::WebSockets Qt::Xml
${CMAKE_DL_LIBS}
${TIFF_LIBRARIES}
libCZI

tensorstore::tensorstore tensorstore::all_drivers

${OPENGL_egl_LIBRARY}
spdlog::spdlog_header_only
Expand Down
2 changes: 1 addition & 1 deletion renderlib/command.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#include "FileReader.h"
#include "io/FileReader.h"

#include <string>
#include <vector>
Expand Down
21 changes: 21 additions & 0 deletions renderlib/graphics/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
target_include_directories(renderlib PUBLIC
"${CMAKE_CURRENT_SOURCE_DIR}"
)

add_subdirectory(glad/src)
add_subdirectory(gl)
add_subdirectory(glsl)

target_sources(renderlib PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/Framebuffer.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/Framebuffer.h"
"${CMAKE_CURRENT_SOURCE_DIR}/ImageXyzcGpu.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/ImageXyzcGpu.h"
"${CMAKE_CURRENT_SOURCE_DIR}/IRenderWindow.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/IRenderWindow.h"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderGL.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderGL.h"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderGLPT.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/RenderGLPT.h"
)

File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "IRenderWindow.h"
IRenderWindow::IRenderWindow() {}
IRenderWindow::~IRenderWindow() {}
#include "IRenderWindow.h"

IRenderWindow::IRenderWindow() {}

IRenderWindow::~IRenderWindow() {}
70 changes: 35 additions & 35 deletions renderlib/IRenderWindow.h → renderlib/graphics/IRenderWindow.h
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
#pragma once
#include <inttypes.h>
class CCamera;
class CStatus;
class GLFramebufferObject;
class RenderSettings;
class Scene;
#include <memory>
class IRenderWindow
{
public:
IRenderWindow();
virtual ~IRenderWindow();
virtual void initialize(uint32_t w, uint32_t h, float devicePixelRatio = 1.0f) = 0;
virtual void render(const CCamera& camera) = 0;
virtual void renderTo(const CCamera& camera, GLFramebufferObject* fbo) = 0;
virtual void resize(uint32_t w, uint32_t h, float devicePixelRatio = 1.0f) = 0;
virtual void cleanUpResources() {}
// An interface for reporting statistics and other data updates
// The IRenderWindow is the first to create this object but it can get shared with other widgets in the gui.
// Alternative impl could be to create at app layer and pass down into renderers
virtual std::shared_ptr<CStatus> getStatusInterface() { return nullptr; }
// I own these.
virtual RenderSettings& renderSettings() = 0;
virtual Scene* scene() = 0;
virtual void setScene(Scene* s) = 0;
};
#pragma once

#include <inttypes.h>

class CCamera;
class CStatus;
class GLFramebufferObject;
class RenderSettings;
class Scene;

#include <memory>

class IRenderWindow
{
public:
IRenderWindow();
virtual ~IRenderWindow();

virtual void initialize(uint32_t w, uint32_t h, float devicePixelRatio = 1.0f) = 0;
virtual void render(const CCamera& camera) = 0;
virtual void renderTo(const CCamera& camera, GLFramebufferObject* fbo) = 0;
virtual void resize(uint32_t w, uint32_t h, float devicePixelRatio = 1.0f) = 0;
virtual void cleanUpResources() {}

// An interface for reporting statistics and other data updates
// The IRenderWindow is the first to create this object but it can get shared with other widgets in the gui.
// Alternative impl could be to create at app layer and pass down into renderers
virtual std::shared_ptr<CStatus> getStatusInterface() { return nullptr; }

// I own these.
virtual RenderSettings& renderSettings() = 0;

virtual Scene* scene() = 0;
virtual void setScene(Scene* s) = 0;
};
File renamed without changes.
File renamed without changes.
Loading