Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
8ddb7c4
refactor, use new CameraDataObject for ui
toloudis Feb 25, 2025
782072a
move controls into subdir
toloudis Feb 25, 2025
fe35bc9
add properties for appearance settings
toloudis May 20, 2025
a900ea0
compile new widget
toloudis May 28, 2025
f7c3d30
adding the dockwidget
toloudis Jun 1, 2025
589f924
update tensorstore
toloudis Jun 2, 2025
bc37293
fix python lint
toloudis Jun 3, 2025
ec19629
appearancedataobject has to affect the Scene also
toloudis Jun 3, 2025
bb3ca1c
compile fix
toloudis Jun 5, 2025
ac22497
install the scene earlier
toloudis Jun 6, 2025
0ac2355
try to hook up changes that need to happen on the ViewerWindow
toloudis Jun 9, 2025
6e52ce9
don't capture by ref for local variables
toloudis Jun 11, 2025
39909be
store renderer type inside of RenderSettings
toloudis Jun 12, 2025
885c175
remove controls that are in the object model
toloudis Jun 12, 2025
809bb11
loading from json is broken: the ui does not update to the correct va…
toloudis Jun 12, 2025
177ff94
fleshing out the property system
toloudis Jun 18, 2025
f73205f
still missing prtyVec3
toloudis Jun 18, 2025
d286818
renderlib compiles
toloudis Jun 19, 2025
f97f2ed
test working
toloudis Jun 19, 2025
12e5a70
fixing compile errors
toloudis Jun 19, 2025
2612908
bring back agProperty
toloudis Jun 21, 2025
4ecac31
WIP commit
toloudis Jun 21, 2025
23bb928
WIP
toloudis Jun 22, 2025
58bbfcf
fix scene ref
toloudis Jun 22, 2025
f5526f9
fix test, add callbacks
toloudis Jun 22, 2025
5064ebe
wip
toloudis Jun 23, 2025
7eec5dd
add status tip and tooltip
toloudis Jun 25, 2025
bd5b1a6
add simple getters for now (todo: iterate more generically factory-st…
toloudis Jun 25, 2025
b01e703
camera and appearance compiles but completely detached from the renderer
toloudis Jun 25, 2025
a9b1940
make control creation more generic
toloudis Jun 25, 2025
221c099
add ui info details
toloudis Jun 29, 2025
2f31703
tiny cleanup
toloudis Jun 29, 2025
7eb9ad9
wip on camera creation / lifetime
toloudis Jul 3, 2025
08be5ef
try to disconnect properties on control deletion
toloudis Jul 3, 2025
67ad37f
clean up gui
toloudis Jul 4, 2025
9ed5580
more object lifetime work with camera
toloudis Jul 4, 2025
d1a78be
rename
toloudis Jul 4, 2025
f0fc52a
renaming
toloudis Jul 4, 2025
62881f8
wip
toloudis Jul 4, 2025
cb9310c
fix compile
toloudis Jul 4, 2025
f9673e8
add a callback for updating ui via property updates
toloudis Jul 4, 2025
2ec822c
remove dead code
toloudis Jul 1, 2025
06ec6fd
wip
toloudis Jul 5, 2025
cb243da
hook up render settings
toloudis Jul 5, 2025
acb1f32
renderertype switch
toloudis Jul 5, 2025
ce75802
read and write appearance settings via properties
toloudis Jul 7, 2025
efd5196
update viewerstatetoapp and apptoviewerstate
toloudis Jul 7, 2025
0e1fcb4
start adding complete camera properties
toloudis Jul 10, 2025
e262fd2
fix warning
toloudis Jul 28, 2025
051adf3
use prtyEnum correctly
toloudis Jul 31, 2025
34529b9
fix weird character
toloudis Jul 31, 2025
818fc7e
update camera via properties
toloudis Aug 2, 2025
5e6dc57
add target, pos and roll properties to camera
toloudis Aug 5, 2025
9fd837c
clean up comments and include guards in favor of pragma once
toloudis Aug 14, 2025
73a8a96
cleanup
toloudis Aug 15, 2025
fd552fd
fix cmake problem
toloudis Sep 4, 2025
5a8df9f
reinstate tensorstore version
toloudis Sep 4, 2025
f355dfe
fix include
toloudis Sep 4, 2025
2e41056
fix cmake
toloudis Sep 4, 2025
514fc1c
Bump js-yaml from 4.1.0 to 4.1.1 in /webclient
dependabot[bot] Nov 15, 2025
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
10 changes: 8 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: "x64"
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
Expand Down Expand Up @@ -228,10 +233,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
architecture: "x64"
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/tagged_master_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
architecture: "x64"
- name: Install Qt
uses: jurplel/install-qt-action@v4
with:
Expand Down Expand Up @@ -162,7 +167,7 @@ jobs:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
architecture: "x64"
- name: Install Dependencies
run: |
Expand Down
19 changes: 19 additions & 0 deletions agave_app/AppearanceDockWidget2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#include "AppearanceDockWidget2.h"

QAppearanceDockWidget2::QAppearanceDockWidget2(QWidget* pParent,
RenderSettings* rs,
ViewerWindow* vw,
AppearanceObject* ado)
: QDockWidget(pParent)
, m_AppearanceWidget(nullptr, rs, vw, ado)
{
setWindowTitle("Appearance");

setWidget(&m_AppearanceWidget);

QSizePolicy SizePolicy;

SizePolicy.setVerticalPolicy(QSizePolicy::Maximum);

setSizePolicy(SizePolicy);
}
19 changes: 19 additions & 0 deletions agave_app/AppearanceDockWidget2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#pragma once

#include <QDockWidget>

#include "AppearanceWidget.h"

class QAppearanceDockWidget2 : public QDockWidget
{
Q_OBJECT

public:
QAppearanceDockWidget2(QWidget* pParent = NULL,
RenderSettings* rs = NULL,
ViewerWindow* vw = NULL,
AppearanceObject* cdo = NULL);

private:
QAppearanceWidget2 m_AppearanceWidget;
};
153 changes: 0 additions & 153 deletions agave_app/AppearanceSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,118 +99,12 @@ QAppearanceSettingsWidget::QAppearanceSettingsWidget(QWidget* pParent,
QAction* pToggleTranslateAction)
: QGroupBox(pParent)
, m_MainLayout()
, m_DensityScaleSlider()
, m_RendererType()
, m_ShadingType()
, m_GradientFactorSlider()
, m_StepSizePrimaryRaySlider()
, m_StepSizeSecondaryRaySlider()
, m_qrendersettings(qrs)
, m_scene(nullptr)
{
Controls::initFormLayout(m_MainLayout);
setLayout(&m_MainLayout);

m_RendererType.setStatusTip(tr("Select volume rendering type"));
m_RendererType.setToolTip(tr("Select volume rendering type"));

m_RendererType.addItem("Ray march blending", 0);
m_RendererType.addItem("Path Traced", 1);

m_RendererType.setCurrentIndex(1);
m_MainLayout.addRow("Renderer", &m_RendererType);

m_DensityScaleSlider.setStatusTip(tr("Set scattering density for volume"));
m_DensityScaleSlider.setToolTip(tr("Set scattering density for volume"));
m_DensityScaleSlider.setRange(0.001, 100.0);
m_DensityScaleSlider.setDecimals(3);
m_DensityScaleSlider.setValue(rs->m_RenderSettings.m_DensityScale);
m_MainLayout.addRow("Scattering Density", &m_DensityScaleSlider);

m_ShadingType.setStatusTip(tr("Select volume shading style"));
m_ShadingType.setToolTip(tr("Select volume shading style"));
m_ShadingType.addItem("BRDF Only", 0);
m_ShadingType.addItem("Phase Function Only", 1);
m_ShadingType.addItem("Mixed", 2);
m_ShadingType.setCurrentIndex(rs->m_RenderSettings.m_ShadingType);
m_MainLayout.addRow("Shading Type", &m_ShadingType);

m_GradientFactorSlider.setStatusTip(tr("Mix between BRDF and Phase shading"));
m_GradientFactorSlider.setToolTip(tr("Mix between BRDF and Phase shading"));
m_GradientFactorSlider.setRange(0.0, 1.0);
m_GradientFactorSlider.setDecimals(3);
m_GradientFactorSlider.setValue(rs->m_RenderSettings.m_GradientFactor);
m_MainLayout.addRow("Shading Type Mixture", &m_GradientFactorSlider);

QObject::connect(&m_DensityScaleSlider, SIGNAL(valueChanged(double)), this, SLOT(OnSetDensityScale(double)));
QObject::connect(&m_GradientFactorSlider, SIGNAL(valueChanged(double)), this, SLOT(OnSetGradientFactor(double)));

m_StepSizePrimaryRaySlider.setStatusTip(tr("Set volume ray march step size for camera rays"));
m_StepSizePrimaryRaySlider.setToolTip(tr("Set volume ray march step size for camera rays"));
// step size is in voxels and step sizes of less than 1 voxel are not very useful, while slowing down performance
m_StepSizePrimaryRaySlider.setRange(1.0, 100.0);
m_StepSizePrimaryRaySlider.setValue(rs->m_RenderSettings.m_StepSizeFactor);
m_StepSizePrimaryRaySlider.setDecimals(3);
m_MainLayout.addRow("Primary Ray Step Size", &m_StepSizePrimaryRaySlider);

QObject::connect(
&m_StepSizePrimaryRaySlider, SIGNAL(valueChanged(double)), this, SLOT(OnSetStepSizePrimaryRay(double)));

m_StepSizeSecondaryRaySlider.setStatusTip(tr("Set volume ray march step size for scattered rays"));
m_StepSizeSecondaryRaySlider.setToolTip(tr("Set volume ray march step size for scattered rays"));
m_StepSizeSecondaryRaySlider.setRange(1.0, 100.0);
m_StepSizeSecondaryRaySlider.setValue(rs->m_RenderSettings.m_StepSizeFactorShadow);
m_StepSizeSecondaryRaySlider.setDecimals(3);
m_MainLayout.addRow("Secondary Ray Step Size", &m_StepSizeSecondaryRaySlider);

QObject::connect(
&m_StepSizeSecondaryRaySlider, SIGNAL(valueChanged(double)), this, SLOT(OnSetStepSizeSecondaryRay(double)));

m_interpolateCheckBox.setChecked(true);
m_interpolateCheckBox.setStatusTip(tr("Interpolated volume sampling"));
m_interpolateCheckBox.setToolTip(tr("Interpolated volume sampling"));
m_MainLayout.addRow("Interpolate", &m_interpolateCheckBox);
QObject::connect(&m_interpolateCheckBox, &QCheckBox::clicked, [this](const bool is_checked) {
this->OnInterpolateChecked(is_checked);
});

m_backgroundColorButton.setStatusTip(tr("Set background color"));
m_backgroundColorButton.setToolTip(tr("Set background color"));
m_backgroundColorButton.SetColor(QColor(0, 0, 0), true);
m_MainLayout.addRow("Background Color", &m_backgroundColorButton);

QObject::connect(&m_backgroundColorButton, &QColorPushButton::currentColorChanged, [this](const QColor& c) {
this->OnBackgroundColorChanged(c);
});

auto* bboxLayout = new QHBoxLayout();
m_showBoundingBoxCheckBox.setChecked(false);
m_showBoundingBoxCheckBox.setStatusTip(tr("Show/hide bounding box"));
m_showBoundingBoxCheckBox.setToolTip(tr("Show/hide bounding box"));
bboxLayout->addWidget(&m_showBoundingBoxCheckBox, 0);

m_boundingBoxColorButton.setStatusTip(tr("Set bounding box color"));
m_boundingBoxColorButton.setToolTip(tr("Set bounding box color"));
m_boundingBoxColorButton.SetColor(QColor(255, 255, 255), true);
bboxLayout->addWidget(&m_boundingBoxColorButton, 1);

m_MainLayout.addRow("Bounding Box", bboxLayout);

QObject::connect(&m_showBoundingBoxCheckBox, &QCheckBox::clicked, [this](const bool is_checked) {
this->OnShowBoundsChecked(is_checked);
});
QObject::connect(&m_boundingBoxColorButton, &QColorPushButton::currentColorChanged, [this](const QColor& c) {
this->OnBoundingBoxColorChanged(c);
});

m_showScaleBarCheckBox.setChecked(false);
m_showScaleBarCheckBox.setStatusTip(tr("Show/hide scale bar"));
m_showScaleBarCheckBox.setToolTip(tr("Show/hide scale bar"));
m_MainLayout.addRow("Scale Bar", &m_showScaleBarCheckBox);
QObject::connect(&m_showScaleBarCheckBox, &QCheckBox::clicked, [this](const bool is_checked) {
this->OnShowScaleBarChecked(is_checked);
});

m_scaleSection = new Section("Volume Scale", 0);
auto* scaleSectionLayout = new QGridLayout();
scaleSectionLayout->addWidget(new QLabel("X"), 0, 0);
Expand Down Expand Up @@ -321,12 +215,6 @@ QAppearanceSettingsWidget::QAppearanceSettingsWidget(QWidget* pParent,
lineA->setFrameShape(QFrame::HLine);
lineA->setFrameShadow(QFrame::Sunken);
m_MainLayout.addRow(lineA);

QObject::connect(&m_RendererType, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSetRendererType(int)));
QObject::connect(&m_ShadingType, SIGNAL(currentIndexChanged(int)), this, SLOT(OnSetShadingType(int)));
// QObject::connect(&gStatus, SIGNAL(RenderBegin()), this, SLOT(OnRenderBegin()));

QObject::connect(m_qrendersettings, SIGNAL(Changed()), this, SLOT(OnTransferFunctionChanged()));
}

void
Expand Down Expand Up @@ -782,32 +670,12 @@ QAppearanceSettingsWidget::OnSetSkyLightBotColor(double intensity, const QColor&
m_qrendersettings->renderSettings()->m_DirtyFlags.SetFlag(LightsDirty);
}

void
QAppearanceSettingsWidget::OnRenderBegin(void)
{
m_DensityScaleSlider.setValue(m_qrendersettings->GetDensityScale());
m_ShadingType.setCurrentIndex(m_qrendersettings->GetShadingType());
m_GradientFactorSlider.setValue(m_qrendersettings->renderSettings()->m_RenderSettings.m_GradientFactor);

m_StepSizePrimaryRaySlider.setValue(m_qrendersettings->renderSettings()->m_RenderSettings.m_StepSizeFactor, true);
m_StepSizeSecondaryRaySlider.setValue(m_qrendersettings->renderSettings()->m_RenderSettings.m_StepSizeFactorShadow,
true);
m_interpolateCheckBox.setChecked(m_qrendersettings->renderSettings()->m_RenderSettings.m_InterpolatedVolumeSampling);
}

void
QAppearanceSettingsWidget::OnSetDensityScale(double DensityScale)
{
m_qrendersettings->SetDensityScale(DensityScale);
}

void
QAppearanceSettingsWidget::OnSetShadingType(int Index)
{
m_qrendersettings->SetShadingType(Index);
m_GradientFactorSlider.setEnabled(Index == 2);
}

void
QAppearanceSettingsWidget::OnSetRendererType(int Index)
{
Expand All @@ -834,14 +702,6 @@ QAppearanceSettingsWidget::OnSetStepSizeSecondaryRay(const double& StepSizeSecon
m_qrendersettings->renderSettings()->m_DirtyFlags.SetFlag(RenderParamsDirty);
}

void
QAppearanceSettingsWidget::OnTransferFunctionChanged(void)
{
m_DensityScaleSlider.setValue(m_qrendersettings->GetDensityScale(), true);
m_ShadingType.setCurrentIndex(m_qrendersettings->GetShadingType());
m_GradientFactorSlider.setValue(m_qrendersettings->GetGradientFactor(), true);
}

void
QAppearanceSettingsWidget::OnBackgroundColorChanged(const QColor& color)
{
Expand Down Expand Up @@ -1072,19 +932,6 @@ QAppearanceSettingsWidget::onNewImage(Scene* scene)
return;
}

m_DensityScaleSlider.setValue(m_qrendersettings->renderSettings()->m_RenderSettings.m_DensityScale);
m_ShadingType.setCurrentIndex(m_qrendersettings->renderSettings()->m_RenderSettings.m_ShadingType);
m_GradientFactorSlider.setValue(m_qrendersettings->renderSettings()->m_RenderSettings.m_GradientFactor);

m_StepSizePrimaryRaySlider.setValue(m_qrendersettings->renderSettings()->m_RenderSettings.m_StepSizeFactor);
m_StepSizeSecondaryRaySlider.setValue(m_qrendersettings->renderSettings()->m_RenderSettings.m_StepSizeFactorShadow);
m_interpolateCheckBox.setChecked(m_qrendersettings->renderSettings()->m_RenderSettings.m_InterpolatedVolumeSampling);

QColor cbg = QColor::fromRgbF(m_scene->m_material.m_backgroundColor[0],
m_scene->m_material.m_backgroundColor[1],
m_scene->m_material.m_backgroundColor[2]);
m_backgroundColorButton.SetColor(cbg);

size_t xmax = m_scene->m_volume->sizeX() - 1;
size_t ymax = m_scene->m_volume->sizeY() - 1;
size_t zmax = m_scene->m_volume->sizeZ() - 1;
Expand Down
11 changes: 0 additions & 11 deletions agave_app/AppearanceSettingsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,8 @@ class QAppearanceSettingsWidget : public QGroupBox
void onNewImage(Scene* scene);

public slots:
void OnRenderBegin(void);
void OnSetDensityScale(double DensityScale);
void OnTransferFunctionChanged(void);
void OnSetRendererType(int Index);
void OnSetShadingType(int Index);
void OnSetGradientFactor(double GradientFactor);
void OnSetStepSizePrimaryRay(const double& StepSizePrimaryRay);
void OnSetStepSizeSecondaryRay(const double& StepSizeSecondaryRay);
Expand Down Expand Up @@ -90,14 +87,6 @@ public slots:
Scene* m_scene;

QFormLayout m_MainLayout;
QNumericSlider m_DensityScaleSlider;
QComboBox m_RendererType;
QComboBox m_ShadingType;
QNumericSlider m_GradientFactorSlider;
QNumericSlider m_StepSizePrimaryRaySlider;
QNumericSlider m_StepSizeSecondaryRaySlider;
QCheckBox m_interpolateCheckBox;
QColorPushButton m_backgroundColorButton;

QRenderSettings* m_qrendersettings;

Expand Down
75 changes: 75 additions & 0 deletions agave_app/AppearanceWidget.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#include "AppearanceWidget.h"
#include "RenderSettings.h"

#include "qtControls/controlFactory.h"

#include "renderlib/uiInfo.hpp"
#include "renderlib/AppearanceObject.hpp"
#include "renderlib/ViewerWindow.h"

#include <QLabel>

QAppearanceWidget2::QAppearanceWidget2(QWidget* pParent, RenderSettings* rs, ViewerWindow* vw, AppearanceObject* cdo)
: QWidget(pParent)
, m_MainLayout()
, m_renderSettings(rs)
, m_appearanceObject(cdo)
{
Controls::initFormLayout(m_MainLayout);
setLayout(&m_MainLayout);
if (m_appearanceObject) {
createFlatList(&m_MainLayout, m_appearanceObject);
}
// // loop over all properties in cameraobject. for each property, add a callback that updates the rendersetttings
// // cameradirty flags
// for (const auto& prop : m_cameraObject->GetList()) {
// if (prop) {
// prop->GetProperty(0)->AddCallback(new prtyCallbackLambda([this](prtyProperty* i_Property, bool i_bDirty) {
// if (i_bDirty) {
// m_renderSettings->m_DirtyFlags.SetFlag(CameraDirty);
// }
// }));
// }
// }

// QComboBox* rendererType = addRow(*m_appearanceDataObject->getRendererTypeUiInfo());
// m_MainLayout.addRow("Renderer", rendererType);
// QComboBox* shadingType = addRow(*m_appearanceDataObject->getShadingTypeUiInfo());
// m_MainLayout.addRow("Shading Type", shadingType);
// QNumericSlider* densityScale = addRow(*m_appearanceDataObject->getDensityScaleUiInfo());
// m_MainLayout.addRow("Scattering Density", densityScale);
// QNumericSlider* gradientFactor = addRow(*m_appearanceDataObject->getGradientFactorUiInfo());
// m_MainLayout.addRow("Shading Type Mixture", gradientFactor);
// QNumericSlider* stepSizePrimaryRay = addRow(*m_appearanceDataObject->getStepSizePrimaryRayUiInfo());
// m_MainLayout.addRow("Step Size Primary Ray", stepSizePrimaryRay);
// QNumericSlider* stepSizeSecondaryRay = addRow(*m_appearanceDataObject->getStepSizeSecondaryRayUiInfo());
// m_MainLayout.addRow("Step Size Secondary Ray", stepSizeSecondaryRay);
// QCheckBox* interpolateCheckBox = addRow(*m_appearanceDataObject->getInterpolateUiInfo());
// m_MainLayout.addRow("Interpolate", interpolateCheckBox);
// QColorPushButton* backgroundColorButton = addRow(*m_appearanceDataObject->getBackgroundColorUiInfo());
// m_MainLayout.addRow("Background Color", backgroundColorButton);
// QCheckBox* showBoundingBoxCheckBox = addRow(*m_appearanceDataObject->getShowBoundingBoxUiInfo());
// m_MainLayout.addRow("Show Bounding Box", showBoundingBoxCheckBox);
// QColorPushButton* boundingBoxColorButton = addRow(*m_appearanceDataObject->getBoundingBoxColorUiInfo());
// m_MainLayout.addRow("Bounding Box Color", boundingBoxColorButton);
// QCheckBox* showScaleBarCheckBox = addRow(*m_appearanceDataObject->getShowScaleBarUiInfo());
// m_MainLayout.addRow("Show Scale Bar", showScaleBarCheckBox);

// QObject::connect(rendererType, &QComboBox::currentIndexChanged, [this, vw](int index) { vw->setRenderer(index); });
// QObject::connect(shadingType, &QComboBox::currentIndexChanged, [this, gradientFactor](int index) {
// gradientFactor->setEnabled(index == 2);
// });
m_appearanceObject->getRendererTypeUiInfo()->GetProperty(0)->AddCallback(
new prtyCallbackLambda([this, vw](prtyProperty* i_Property, bool i_bDirty) {
if (i_bDirty) {
const int newvalue = (static_cast<prtyInt8*>(i_Property))->GetValue();
vw->setRenderer(newvalue);
}
}));
}

QSize
QAppearanceWidget2::sizeHint() const
{
return QSize(20, 20);
}
Loading
Loading