Skip to content

Commit

Permalink
Simple slice renderer (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
FreddyFunk authored Jan 9, 2022
1 parent 849581c commit 9513fb8
Show file tree
Hide file tree
Showing 17 changed files with 1,237 additions and 49 deletions.
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ add_executable(VDS
widgets/expandable_section_widget.cpp
widgets/histogram_view_GL.h
widgets/histogram_view_GL.cpp
widgets/slice_view_GL.h
widgets/slice_view_GL.cpp
widgets/volume_view_GL.h
widgets/volume_view_GL.cpp
)
Expand Down
2 changes: 1 addition & 1 deletion src/fileio/import_item.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <QString>
#include <QVector3D>

#include <VDTK//common/CommonDataTypes.h>
#include <VDTK/common/CommonDataTypes.h>

namespace VDS {
// Interface class for processing different kind of import item for the "last opened" section in
Expand Down
340 changes: 329 additions & 11 deletions src/main_window.cpp

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions src/main_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,25 @@ public slots:
void errorRawImport();
void errorBinarySlicesImport();

void toggleSliceViewEnabled();
void toggleControllViewEnabled();

void enableSliceRendererXMetaInfo();
void enableSliceRendererYMetaInfo();
void enableSliceRendererZMetaInfo();
void disableSliceRendererXMetaInfo();
void disableSliceRendererYMetaInfo();
void disableSliceRendererZMetaInfo();

void updateSliceRendererXPosition(int position);
void updateSliceRendererYPosition(int position);
void updateSliceRendererZPosition(int position);

void updateSliceRenderSliderValueRanges();
void updateSliceRendererSizeParameters();
void updateSliceRendererSpacingParameters();
void updateSliceRendererTexture();

signals:
void updateHistogram(const std::vector<uint16_t>& histogram, bool ignoreBorders);
// -1 = allow it, 0 = unchanged, 1 = do not allow it
Expand All @@ -81,6 +100,7 @@ public slots:
void setupFileMenu();
void setupViewMenu();
void setupToolsMenu();
void setupRendererView();
void setupShaderEditor();

bool checkIsBigEndian();
Expand All @@ -99,11 +119,24 @@ public slots:
// View Menu
QMenu* m_menuView;
QAction* m_actionResetView;
QAction* m_actionToggleControlView;
QAction* m_actionToggleSliceView;

// Tools Menu
QMenu* m_menuTools;
QAction* m_actionResizeVolumeData;

// Renderer View
QLabel* m_labelSliceRendererX;
QLabel* m_labelSliceRendererY;
QLabel* m_labelSliceRendererZ;
QSlider* m_sliderSliceRendererX;
QSlider* m_sliderSliceRendererY;
QSlider* m_sliderSliceRendererZ;
QHBoxLayout* m_sliderSliceRendererXLayout;
QHBoxLayout* m_sliderSliceRendererYLayout;
QHBoxLayout* m_sliderSliceRendererZLayout;

// Debug Shader Editor
QLabel* m_shaderEditorInfo;
QTextEdit* m_vertexShaderEdit;
Expand Down
147 changes: 134 additions & 13 deletions src/main_window.ui
Original file line number Diff line number Diff line change
Expand Up @@ -34,25 +34,139 @@
<number>0</number>
</property>
<item>
<widget class="VolumeViewGL" name="volumeViewWidget"/>
</item>
<item>
<widget class="QGroupBox" name="groupBoxSliceView">
<widget class="QGroupBox" name="groupBoxRenderer">
<property name="enabled">
<bool>true</bool>
</property>
<property name="title">
<string>Slice View</string>
<string/>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QOpenGLWidget" name="openGLWidget_4"/>
<property name="flat">
<bool>false</bool>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QGroupBox" name="groupBoxVolumeView">
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="VolumeViewGL" name="volumeViewWidget"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QOpenGLWidget" name="openGLWidget_2"/>
<item row="1" column="1">
<widget class="QGroupBox" name="groupBoxSliceRenderZ">
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="SliceViewGL" name="openGLWidgetSliceRenderZ"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QOpenGLWidget" name="openGLWidget_3"/>
<item row="1" column="0">
<widget class="QGroupBox" name="groupBoxSliceRenderY">
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="SliceViewGL" name="openGLWidgetSliceRenderY"/>
</item>
</layout>
</widget>
</item>
<item row="0" column="0">
<widget class="QGroupBox" name="groupBoxSliceRenderX">
<property name="title">
<string/>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="SliceViewGL" name="openGLWidgetSliceRenderX"/>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
Expand Down Expand Up @@ -612,7 +726,14 @@
<extends>QOpenGLWidget</extends>
<header>widgets/histogram_view_GL.h</header>
</customwidget>
<customwidget>
<class>SliceViewGL</class>
<extends>QOpenGLWidget</extends>
<header>widgets/slice_view_GL.h</header>
</customwidget>
</customwidgets>
<resources/>
<resources>
<include location="qt_resources/resources.qrc"/>
</resources>
<connections/>
</ui>
Loading

0 comments on commit 9513fb8

Please sign in to comment.