Skip to content

Commit

Permalink
Merge branch 'feature/formlayouts' into feature/color-lut
Browse files Browse the repository at this point in the history
  • Loading branch information
toloudis committed Feb 26, 2024
2 parents 92b1b37 + 4645cf1 commit 685540e
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.1
version: 6.5.3
modules: qtwebsockets qtimageformats
- name: macos install deps
if: matrix.os == 'macos-latest'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tagged_master_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: 6.5.1
version: 6.5.3
modules: qtwebsockets qtimageformats
- name: macos install deps
if: matrix.os == 'macos-latest'
Expand Down
14 changes: 7 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ if(DEFINED ENV{Qt6_DIR})
list(INSERT CMAKE_PREFIX_PATH 0 $ENV{Qt6_DIR})
endif()

set(AGAVE_QT_VERSION 6.5.1)
set(AGAVE_QT_VERSION 6.5.3)

if(WIN32)
set(GUESS_Qt6_DIR C:/Qt/${AGAVE_QT_VERSION}/msvc2019_64 CACHE STRING "Qt6 directory")
Expand Down Expand Up @@ -137,12 +137,12 @@ CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/CMake/conf.py.cmake ${CMAKE_SOURCE_DIR}/docs/
# #####################
# CPack
# #####################
find_package(Qt6QTiffPlugin 6.5.1 REQUIRED PATHS ${Qt6Gui_DIR})
find_package(Qt6QTiffPlugin 6.5.3 REQUIRED PATHS ${Qt6Gui_DIR})

# copy all dlls into place.
if(WIN32)
# find_package(Qt6QWindowsIntegrationPlugin 6.5.1 REQUIRED PATHS ${Qt6Gui_DIR})
# find_package(Qt6QWindowsVistaStylePlugin 6.5.1 REQUIRED PATHS ${Qt6Gui_DIR})
# find_package(Qt6QWindowsIntegrationPlugin 6.5.3 REQUIRED PATHS ${Qt6Gui_DIR})
# find_package(Qt6QWindowsVistaStylePlugin 6.5.3 REQUIRED PATHS ${Qt6Gui_DIR})

# assuming vcpkg has done some work already to get dlls in here
install(
Expand Down Expand Up @@ -212,8 +212,8 @@ if(WIN32)

# ###############
elseif(APPLE)
find_package(Qt6QCocoaIntegrationPlugin 6.5.1 REQUIRED PATHS ${Qt6Gui_DIR})
find_package(Qt6QMacStylePlugin 6.5.1 REQUIRED PATHS ${Qt6Widgets_DIR})
find_package(Qt6QCocoaIntegrationPlugin 6.5.3 REQUIRED PATHS ${Qt6Gui_DIR})
find_package(Qt6QMacStylePlugin 6.5.3 REQUIRED PATHS ${Qt6Widgets_DIR})

# ###############
set(PACKAGE_OSX_TARGET ${CMAKE_OSX_DEPLOYMENT_TARGET})
Expand Down Expand Up @@ -305,7 +305,7 @@ elseif(APPLE)
include(CPack)

else() # Linux
find_package(Qt6QXcbIntegrationPlugin 6.5.1 REQUIRED PATHS ${Qt6Gui_DIR})
find_package(Qt6QXcbIntegrationPlugin 6.5.3 REQUIRED PATHS ${Qt6Gui_DIR})

install(FILES
${PROJECT_SOURCE_DIR}/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ RUN apt-get install -y python3-pip
RUN pip3 install --upgrade pip

# get Qt installed
ENV QT_VERSION=6.5.1
ENV QT_VERSION=6.5.3
RUN pip3 install aqtinstall
RUN aqt install-qt --outputdir /qt linux desktop ${QT_VERSION} -m qtwebsockets qtimageformats
# required for qt offscreen platform plugin
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,54 +17,60 @@ git submodule update --init
```

### For WINDOWS:

Make sure you are in an environment where vsvarsall has been run, e.g. a "VS2022 x64 Native Tools Command Prompt"

**tensorstore** requires:

- Python 3.7 or later
- CMake 3.24 or later
- Perl, for building libaom from source (default). Must be in PATH. Not required if -DTENSORSTORE_USE_SYSTEM_LIBAOM=ON is specified.
- NASM, for building libjpeg-turbo, libaom, and dav1d from source (default). Must be in PATH.Not required if -DTENSORSTORE*USE_SYSTEM*{JPEG,LIBAOM,DAV1D}=ON is specified.
- GNU Patch or equivalent. Must be in PATH.

A convenient way to install Perl, NASM, and GNU Patch is with chocolatey.

```
choco install strawberryperl nasm patch
```

**Install Qt LTS 6.5.1.**
**Install Qt LTS 6.5.3.**
In your favorite Python virtual environment:

```
pip install aqtinstall
aqt install-qt --outputdir C:\Qt windows desktop 6.5.1 win64_msvc2019_64 -m qtwebsockets qtimageformats
aqt install-qt --outputdir C:\Qt windows desktop 6.5.3 win64_msvc2019_64 -m qtwebsockets qtimageformats
```

Use vcpkg (must use target triplet x64-windows) to install the following:

```
vcpkg install spdlog glm zlib libjpeg-turbo liblzma tiff zstd --triplet x64-windows
```

**Build AGAVE**

```
mkdir build
cd build
# (vs 2022)
cmake -DCMAKE_TOOLCHAIN_FILE=D:\vcpkg\scripts\buildsystems\vcpkg.cmake -G "Visual Studio 17 2022" -A x64 -DVCPKG_TARGET_TRIPLET=x64-windows ..
cmake --build .
```

You may need to adjust the vcpkg path depending on your configuration.

If you encounter issues during your build, check that all of your dependencies are installed and try again. You can also build to the INSTALL target with Visual Studio by opening the project solution (`agave.sln`).


### For MAC OS: (using homebrew)

In your favorite Python virtual environment:

```
pip install aqtinstall
aqt install-qt --outputdir ~/Qt mac desktop 6.5.1 -m qtwebsockets qtimageformats
export Qt6_DIR=~/Qt/6.5.1/macos
aqt install-qt --outputdir ~/Qt mac desktop 6.5.3 -m qtwebsockets qtimageformats
export Qt6_DIR=~/Qt/6.5.3/macos
# and then:
brew install spdlog glm libtiff
Expand All @@ -79,15 +85,15 @@ sudo make install

### For LINUX:

Install Qt 6.5.1 in your directory of choice and tell the build where to find it.
Install Qt 6.5.3 in your directory of choice and tell the build where to find it.
In your favorite Python virtual environment:

```
pip install aqtinstall
aqt install-qt --outputdir ~/Qt linux desktop 6.5.1 -m qtwebsockets qtimageformats
aqt install-qt --outputdir ~/Qt linux desktop 6.5.3 -m qtwebsockets qtimageformats
# the next line is needed for CMake
export Qt6_DIR=~/Qt/6.5.1/gcc_64
export Qt6_DIR=~/Qt/6.5.3/gcc_64
```

- sudo apt install libtiff-dev
Expand Down
54 changes: 31 additions & 23 deletions agave_app/AppearanceSettingsWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,10 @@ QAppearanceSettingsWidget::QAppearanceSettingsWidget(QWidget* pParent,
m_clipRoiSection->setContentLayout(*roiSectionLayout);
m_MainLayout.addRow(m_clipRoiSection);

Section* section = createLightingControls(pLightRotationAction);
Section* section = createAreaLightingControls(pLightRotationAction);
m_MainLayout.addRow(section);
Section* section2 = createSkyLightingControls();
m_MainLayout.addRow(section2);

QFrame* lineA = new QFrame();
lineA->setFrameShape(QFrame::HLine);
Expand All @@ -637,16 +639,16 @@ QAppearanceSettingsWidget::QAppearanceSettingsWidget(QWidget* pParent,
}

Section*
QAppearanceSettingsWidget::createLightingControls(QAction* pLightRotationAction)
QAppearanceSettingsWidget::createAreaLightingControls(QAction* pLightRotationAction)
{
Section* section = new Section("Lighting", 0);
auto* sectionLayout = Controls::createFormLayout();
Section* section = new Section("Area Light", 0);
auto* sectionLayout = Controls::createMyFormLayout();

m_lt0gui.m_enableControlsCheckBox = new QCheckBox();
m_lt0gui.m_enableControlsCheckBox->setStatusTip(
tr("Show interactive controls in viewport for area light rotation angle"));
tr("Show interactive controls in viewport for area light rotation angle (or press R to toggle)"));
m_lt0gui.m_enableControlsCheckBox->setToolTip(
tr("Show interactive controls in viewport for area light rotation angle"));
tr("Show interactive controls in viewport for area light rotation angle (or press R to toggle)"));
sectionLayout->addRow("Viewport Controls", m_lt0gui.m_enableControlsCheckBox);
QObject::connect(m_lt0gui.m_enableControlsCheckBox, &QCheckBox::clicked, pLightRotationAction, &QAction::trigger);
QObject::connect(pLightRotationAction, &QAction::triggered, [this](bool toggled) {
Expand All @@ -659,7 +661,7 @@ QAppearanceSettingsWidget::createLightingControls(QAction* pLightRotationAction)
m_lt0gui.m_thetaSlider->setRange(0.0, TWO_PI_F);
m_lt0gui.m_thetaSlider->setSingleStep(TWO_PI_F / 100.0);
m_lt0gui.m_thetaSlider->setValue(0.0);
sectionLayout->addRow("AreaLight Theta", m_lt0gui.m_thetaSlider);
sectionLayout->addRow("Theta", m_lt0gui.m_thetaSlider);
QObject::connect(
m_lt0gui.m_thetaSlider, &QNumericSlider::valueChanged, this, &QAppearanceSettingsWidget::OnSetAreaLightTheta);

Expand All @@ -669,7 +671,7 @@ QAppearanceSettingsWidget::createLightingControls(QAction* pLightRotationAction)
m_lt0gui.m_phiSlider->setRange(0.0, PI_F);
m_lt0gui.m_phiSlider->setSingleStep(PI_F / 100.0);
m_lt0gui.m_phiSlider->setValue(HALF_PI_F);
sectionLayout->addRow("AreaLight Phi", m_lt0gui.m_phiSlider);
sectionLayout->addRow("Phi", m_lt0gui.m_phiSlider);
QObject::connect(
m_lt0gui.m_phiSlider, &QNumericSlider::valueChanged, this, &QAppearanceSettingsWidget::OnSetAreaLightPhi);

Expand All @@ -679,17 +681,17 @@ QAppearanceSettingsWidget::createLightingControls(QAction* pLightRotationAction)
m_lt0gui.m_sizeSlider->setRange(0.1, 5.0);
m_lt0gui.m_sizeSlider->setSingleStep(5.0 / 100.0);
m_lt0gui.m_sizeSlider->setValue(1.0);
sectionLayout->addRow("AreaLight Size", m_lt0gui.m_sizeSlider);
sectionLayout->addRow("Size", m_lt0gui.m_sizeSlider);
QObject::connect(
m_lt0gui.m_sizeSlider, &QNumericSlider::valueChanged, this, &QAppearanceSettingsWidget::OnSetAreaLightSize);

m_lt0gui.m_distSlider = new QNumericSlider();
m_lt0gui.m_distSlider->setStatusTip(tr("Set distance for area light"));
m_lt0gui.m_distSlider->setToolTip(tr("Set distance for area light"));
m_lt0gui.m_distSlider->setRange(0.1, 100.0);
m_lt0gui.m_distSlider->setRange(0.1, 10.0);
m_lt0gui.m_distSlider->setSingleStep(1.0);
m_lt0gui.m_distSlider->setValue(10.0);
sectionLayout->addRow("AreaLight Distance", m_lt0gui.m_distSlider);
sectionLayout->addRow("Distance", m_lt0gui.m_distSlider);
QObject::connect(
m_lt0gui.m_distSlider, &QNumericSlider::valueChanged, this, &QAppearanceSettingsWidget::OnSetAreaLightDistance);

Expand All @@ -698,26 +700,32 @@ QAppearanceSettingsWidget::createLightingControls(QAction* pLightRotationAction)
m_lt0gui.m_intensitySlider->setStatusTip(tr("Set intensity for area light"));
m_lt0gui.m_intensitySlider->setToolTip(tr("Set intensity for area light"));
m_lt0gui.m_intensitySlider->setRange(0.0, 1000.0);
m_lt0gui.m_intensitySlider->setSingleStep(1.0);
m_lt0gui.m_intensitySlider->setSingleStep(10.0);
m_lt0gui.m_intensitySlider->setValue(100.0);
m_lt0gui.m_intensitySlider->setDecimals(1);
arealightLayout->addWidget(m_lt0gui.m_intensitySlider, 1);
m_lt0gui.m_areaLightColorButton = new QColorPushButton();
m_lt0gui.m_areaLightColorButton->setStatusTip(tr("Set color for area light"));
m_lt0gui.m_areaLightColorButton->setToolTip(tr("Set color for area light"));
arealightLayout->addWidget(m_lt0gui.m_areaLightColorButton);
sectionLayout->addRow("AreaLight Intensity", arealightLayout);
arealightLayout->addWidget(m_lt0gui.m_areaLightColorButton, 0);
arealightLayout->setContentsMargins(0, 0, 0, 0);
sectionLayout->addRow("Intensity", arealightLayout);
QObject::connect(m_lt0gui.m_areaLightColorButton, &QColorPushButton::currentColorChanged, [this](const QColor& c) {
this->OnSetAreaLightColor(this->m_lt0gui.m_intensitySlider->value(), c);
});
QObject::connect(m_lt0gui.m_intensitySlider, &QNumericSlider::valueChanged, [this](double v) {
this->OnSetAreaLightColor(v, this->m_lt0gui.m_areaLightColorButton->GetColor());
});

// separator
QFrame* line = new QFrame();
line->setFrameShape(QFrame::HLine);
line->setFrameShadow(QFrame::Sunken);
sectionLayout->addRow(line);
section->setContentLayout(*sectionLayout);
return section;
}

Section*
QAppearanceSettingsWidget::createSkyLightingControls()
{
Section* section = new Section("Sky Light", 0);
auto* sectionLayout = Controls::createMyFormLayout();

auto* skylightTopLayout = new QHBoxLayout();
m_lt1gui.m_stintensitySlider = new QNumericSlider();
Expand All @@ -730,7 +738,7 @@ QAppearanceSettingsWidget::createLightingControls(QAction* pLightRotationAction)
m_lt1gui.m_stColorButton->setStatusTip(tr("Set color for top of skylight sphere"));
m_lt1gui.m_stColorButton->setToolTip(tr("Set color for top of skylight sphere"));
skylightTopLayout->addWidget(m_lt1gui.m_stColorButton);
sectionLayout->addRow("SkyLight Top", skylightTopLayout);
sectionLayout->addRow("Top", skylightTopLayout);
QObject::connect(m_lt1gui.m_stColorButton, &QColorPushButton::currentColorChanged, [this](const QColor& c) {
this->OnSetSkyLightTopColor(this->m_lt1gui.m_stintensitySlider->value(), c);
});
Expand All @@ -749,7 +757,7 @@ QAppearanceSettingsWidget::createLightingControls(QAction* pLightRotationAction)
m_lt1gui.m_smColorButton->setStatusTip(tr("Set color for middle of skylight sphere"));
m_lt1gui.m_smColorButton->setToolTip(tr("Set color for middle of skylight sphere"));
skylightMidLayout->addWidget(m_lt1gui.m_smColorButton);
sectionLayout->addRow("SkyLight Mid", skylightMidLayout);
sectionLayout->addRow("Mid", skylightMidLayout);
QObject::connect(m_lt1gui.m_smColorButton, &QColorPushButton::currentColorChanged, [this](const QColor& c) {
this->OnSetSkyLightMidColor(this->m_lt1gui.m_smintensitySlider->value(), c);
});
Expand All @@ -768,7 +776,7 @@ QAppearanceSettingsWidget::createLightingControls(QAction* pLightRotationAction)
m_lt1gui.m_sbColorButton->setStatusTip(tr("Set color for bottom of skylight sphere"));
m_lt1gui.m_sbColorButton->setToolTip(tr("Set color for bottom of skylight sphere"));
skylightBotLayout->addWidget(m_lt1gui.m_sbColorButton);
sectionLayout->addRow("SkyLight Bot", skylightBotLayout);
sectionLayout->addRow("Bot", skylightBotLayout);
QObject::connect(m_lt1gui.m_sbColorButton, &QColorPushButton::currentColorChanged, [this](const QColor& c) {
this->OnSetSkyLightBotColor(this->m_lt1gui.m_sbintensitySlider->value(), c);
});
Expand Down Expand Up @@ -1298,7 +1306,7 @@ QAppearanceSettingsWidget::onNewImage(Scene* scene)

auto* fullLayout = new QVBoxLayout();

auto* sectionLayout = Controls::createFormLayout();
auto* sectionLayout = Controls::createMyFormLayout();

GradientWidget* editor =
new GradientWidget(scene->m_volume->channel(i)->m_histogram, &scene->m_material.m_gradientData[i]);
Expand Down
3 changes: 2 additions & 1 deletion agave_app/AppearanceSettingsWidget.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ public slots:
QColorPushButton* m_sbColorButton;
} m_lt1gui;

Section* createLightingControls(QAction* pLightRotationAction);
Section* createSkyLightingControls();
Section* createAreaLightingControls(QAction* pLightRotationAction);
void initLightingControls(Scene* scene);
};
Loading

0 comments on commit 685540e

Please sign in to comment.