Skip to content

Commit

Permalink
Merge commit '42581392f0e29d5c91e0de20264093a34cc4167f' into feature/…
Browse files Browse the repository at this point in the history
…color-lut
  • Loading branch information
toloudis committed Dec 13, 2023
2 parents ff9ac1e + 4258139 commit deee475
Show file tree
Hide file tree
Showing 9 changed files with 252 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ jobs:
- name: windows get nasm
if: matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1
- name: Remove bad Strawberry Perl patch binary in search path
# https://github.com/actions/runner-images/issues/5459#issuecomment-1532856844
if: matrix.os == 'windows-latest'
run: del C:\Strawberry\c\bin\patch.EXE
- name: windows build and test
if: matrix.os == 'windows-latest'
env:
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/tagged_master_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ jobs:
- name: windows get nasm
if: matrix.os == 'windows-latest'
uses: ilammy/setup-nasm@v1
- name: Remove bad Strawberry Perl patch binary in search path
# https://github.com/actions/runner-images/issues/5459#issuecomment-1532856844
if: matrix.os == 'windows-latest'
run: del C:\Strawberry\c\bin\patch.EXE
- name: windows build and test
if: matrix.os == 'windows-latest'
env:
Expand Down
4 changes: 4 additions & 0 deletions agave_app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ target_include_directories(agaveapp PUBLIC
${GLM_INCLUDE_DIRS}
)
target_sources(agaveapp PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/aboutDialog.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/aboutDialog.h"
"${CMAKE_CURRENT_SOURCE_DIR}/agaveGui.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/agaveGui.h"
"${CMAKE_CURRENT_SOURCE_DIR}/agaveGui.qrc"
Expand All @@ -25,6 +27,8 @@ target_sources(agaveapp PRIVATE
"${CMAKE_CURRENT_SOURCE_DIR}/CameraDockWidget.h"
"${CMAKE_CURRENT_SOURCE_DIR}/CameraWidget.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/CameraWidget.h"
"${CMAKE_CURRENT_SOURCE_DIR}/citationDialog.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/citationDialog.h"
"${CMAKE_CURRENT_SOURCE_DIR}/cgiparser.cpp"
"${CMAKE_CURRENT_SOURCE_DIR}/cgiparser.h"
"${CMAKE_CURRENT_SOURCE_DIR}/commandBuffer.cpp"
Expand Down
58 changes: 58 additions & 0 deletions agave_app/aboutDialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#include "aboutDialog.h"

#include <QApplication>
#include <QDialogButtonBox>
#include <QLabel>
#include <QTextBrowser>
#include <QVBoxLayout>

AboutDialog::AboutDialog()
: QDialog()
{
setWindowTitle("About AGAVE");
auto layout = new QVBoxLayout(this);
auto label = new QLabel(this);

label->setText("<h1 style=\"line-height:70%\"><b>AGAVE</b></h1>"
"<i style=\"line-height:70%\">Advanced GPU Accelerated Volume Explorer</i>"
"<h4><b>Version " +
qApp->applicationVersion() + "</b></h4>");
label->setAlignment(Qt::AlignCenter);
layout->addWidget(label);

QString agaveUrl = "https://github.com/allen-cell-animated/agave";

auto text = new QLabel(this);
text->setText(
"AGAVE is a desktop volume viewer that uses path trace rendering and cinematic lighting techniques to generate "
"images with a high degree of resolution and clarity. It is designed and optimized for multi-channel OME-TIFF or "
"OME-Zarr files.<br><br>"
"<a href=\"https://www.allencell.org/pathtrace-rendering.html\">Visit our website</a> to learn more and download "
"the latest version.");
text->setFrameShape(QFrame::Panel);
text->setFrameShadow(QFrame::Sunken);
text->setTextInteractionFlags(Qt::TextBrowserInteraction);
text->setOpenExternalLinks(true);
text->setWordWrap(true);
layout->addWidget(text);

label = new QLabel(this);
label->setText(
"AGAVE is made possible through the hard work and dedication of engineers, designers, and scientists at the Allen "
"Institute for Cell Science and through the continued philanthropy of the Paul Allen estate."
"<br>"
"<br>"
"<b>Copyright 2023 The Allen Institute. All rights reserved.</b><br>"
"");
label->setWordWrap(true);
layout->addWidget(label);

auto button = new QDialogButtonBox(QDialogButtonBox::Ok, this);
button->setCenterButtons(true);
layout->addWidget(button);
connect(button, &QDialogButtonBox::accepted, this, &QDialog::accept);

setLayout(layout);
}

AboutDialog::~AboutDialog() {}
12 changes: 12 additions & 0 deletions agave_app/aboutDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include <QDialog>

class AboutDialog : public QDialog
{
public:
AboutDialog();
virtual ~AboutDialog();

QSize sizeHint() const override { return QSize(500, 100); }
};
77 changes: 77 additions & 0 deletions agave_app/agaveGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
#include "StatisticsDockWidget.h"
#include "TimelineDockWidget.h"
#include "ViewerState.h"
#include "aboutDialog.h"
#include "citationDialog.h"
#include "loadDialog.h"
#include "renderDialog.h"

Expand Down Expand Up @@ -142,6 +144,30 @@ agaveGui::createActions()
m_renderAction = new QAction(tr("&Render..."), this);
m_renderAction->setStatusTip(tr("Open the render dialog"));
connect(m_renderAction, SIGNAL(triggered()), this, SLOT(onRenderAction()));

m_aboutDialogAction = new QAction(tr("&About"), this);
m_aboutDialogAction->setStatusTip(tr("Open the about dialog"));
connect(m_aboutDialogAction, SIGNAL(triggered()), this, SLOT(onAboutDialogAction()));

m_supportForumAction = new QAction(tr("&Support Forum"), this);
m_supportForumAction->setStatusTip(tr("Open the support forum in your browser"));
connect(m_supportForumAction, SIGNAL(triggered()), this, SLOT(onSupportForumAction()));

m_documentationAction = new QAction(tr("&Documentation"), this);
m_documentationAction->setStatusTip(tr("Open the documentation in your browser"));
connect(m_documentationAction, SIGNAL(triggered()), this, SLOT(onDocumentationAction()));

m_reportBugAction = new QAction(tr("&Report a bug"), this);
m_reportBugAction->setStatusTip(tr("Open the bug reporting page in your browser"));
connect(m_reportBugAction, SIGNAL(triggered()), this, SLOT(onReportBugAction()));

m_sourceCodeAction = new QAction(tr("&Source code"), this);
m_sourceCodeAction->setStatusTip(tr("Open the source code in your browser"));
connect(m_sourceCodeAction, SIGNAL(triggered()), this, SLOT(onSourceCodeAction()));

m_citationAction = new QAction(tr("&Cite AGAVE"), this);
m_citationAction->setStatusTip(tr("Cite AGAVE in your research"));
connect(m_citationAction, SIGNAL(triggered()), this, SLOT(onCitationAction()));
}

void
Expand Down Expand Up @@ -174,6 +200,14 @@ agaveGui::createMenus()
m_viewMenu = menuBar()->addMenu(tr("&View"));

m_fileMenu->addSeparator();

m_helpMenu = menuBar()->addMenu(tr("&Help"));
m_helpMenu->addAction(m_aboutDialogAction);
m_helpMenu->addAction(m_supportForumAction);
m_helpMenu->addAction(m_documentationAction);
m_helpMenu->addAction(m_reportBugAction);
m_helpMenu->addAction(m_sourceCodeAction);
m_helpMenu->addAction(m_citationAction);
}

void
Expand All @@ -191,6 +225,13 @@ agaveGui::createToolbars()
m_ui.mainToolBar->addSeparator();
m_ui.mainToolBar->addAction(m_viewResetAction);
m_ui.mainToolBar->addAction(m_toggleCameraProjectionAction);
m_ui.mainToolBar->addSeparator();

QToolButton* helpButton = new QToolButton(this);
helpButton->setText("Help");
helpButton->setPopupMode(QToolButton::InstantPopup);
helpButton->setMenu(m_helpMenu);
m_ui.mainToolBar->addWidget(helpButton);
}

void
Expand Down Expand Up @@ -379,6 +420,42 @@ agaveGui::saveImage()
}
}

void
agaveGui::onAboutDialogAction()
{
AboutDialog* dlg = new AboutDialog();
dlg->setModal(true);
dlg->exec();
}

void
agaveGui::onSupportForumAction()
{
QDesktopServices::openUrl(QUrl("https://forum.image.sc/tag/agave"));
}
void
agaveGui::onDocumentationAction()
{
QDesktopServices::openUrl(QUrl("https://allen-cell-animated.github.io/agave"));
}
void
agaveGui::onReportBugAction()
{
QDesktopServices::openUrl(QUrl("https://github.com/allen-cell-animated/agave/issues"));
}
void
agaveGui::onSourceCodeAction()
{
QDesktopServices::openUrl(QUrl("https://github.com/allen-cell-animated/agave"));
}
void
agaveGui::onCitationAction()
{
CitationDialog* dlg = new CitationDialog();
dlg->setModal(true);
dlg->exec();
}

void
agaveGui::onRenderAction()
{
Expand Down
13 changes: 13 additions & 0 deletions agave_app/agaveGui.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ private slots:
void savePython();
void onRenderAction();
void OnUpdateRenderer();
void onAboutDialogAction();
void onSupportForumAction();
void onDocumentationAction();
void onReportBugAction();
void onSourceCodeAction();
void onCitationAction();

private:
enum
Expand All @@ -85,6 +91,7 @@ private slots:

QMenu* m_fileMenu;
QMenu* m_viewMenu;
QMenu* m_helpMenu;

QToolBar* m_Cam2DTools;

Expand All @@ -100,6 +107,12 @@ private slots:
QAction* m_toggleCameraProjectionAction = nullptr;
QAction* m_saveImageAction = nullptr;
QAction* m_renderAction = nullptr;
QAction* m_aboutDialogAction = nullptr;
QAction* m_supportForumAction = nullptr;
QAction* m_documentationAction = nullptr;
QAction* m_reportBugAction = nullptr;
QAction* m_sourceCodeAction = nullptr;
QAction* m_citationAction = nullptr;

QSlider* createAngleSlider();
QSlider* createRangeSlider();
Expand Down
68 changes: 68 additions & 0 deletions agave_app/citationDialog.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#include "citationDialog.h"

#include <QApplication>
#include <QDialogButtonBox>
#include <QLabel>
#include <QTextBrowser>
#include <QVBoxLayout>

CitationDialog::CitationDialog()
: QDialog()
{
setWindowTitle("Cite AGAVE");
auto layout = new QVBoxLayout(this);

auto label = new QLabel(this);
label->setText("If you use AGAVE in your research, please cite the following:");
layout->addWidget(label);

QString agaveUrl = "https://github.com/allen-cell-animated/agave";

auto citationtext = new QLabel(this);
citationtext->setText(
"Daniel Toloudis, AGAVE Contributors (2023). AGAVE: Advanced GPU Accelerated Volume Explorer (Version " +
qApp->applicationVersion() +
") [Computer software]. Allen Institute for Cell Science. <a "
"href=\"" +
agaveUrl + "\"></a>");
citationtext->setFrameShape(QFrame::Panel);
citationtext->setFrameShadow(QFrame::Sunken);
citationtext->setTextInteractionFlags(Qt::TextBrowserInteraction);
citationtext->setOpenExternalLinks(true);
citationtext->setWordWrap(true);
layout->addWidget(citationtext);

auto label2 = new QLabel(this);
label2->setText("bibtex:");
layout->addWidget(label2);

auto citationtext2 = new QLabel(this);
citationtext2->setText("<tt>@software{agave,<br/>"
"&nbsp;&nbsp;author = {Toloudis, Daniel and AGAVE Contributors},<br/>"
"&nbsp;&nbsp;title = {AGAVE: Advanced GPU Accelerated Volume Explorer},<br/>"
"&nbsp;&nbsp;year = {2023},<br/>"
"&nbsp;&nbsp;version = {" +
qApp->applicationVersion() +
"},<br/>"
"&nbsp;&nbsp;url = {" +
agaveUrl +
"}<br/>"
"&nbsp;&nbsp;organization = {Allen Institute for Cell Science}<br/>"
"&nbsp;&nbsp;note = {Computer Software}<br/>"
"}</tt><br/>");
citationtext2->setFrameShape(QFrame::Panel);
citationtext2->setFrameShadow(QFrame::Sunken);
citationtext2->setTextInteractionFlags(Qt::TextBrowserInteraction);
citationtext2->setOpenExternalLinks(true);
citationtext2->setWordWrap(true);
layout->addWidget(citationtext2);

auto button = new QDialogButtonBox(QDialogButtonBox::Ok, this);
button->setCenterButtons(true);
layout->addWidget(button);
connect(button, &QDialogButtonBox::accepted, this, &QDialog::accept);

setLayout(layout);
}

CitationDialog::~CitationDialog() {}
12 changes: 12 additions & 0 deletions agave_app/citationDialog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#pragma once

#include <QDialog>

class CitationDialog : public QDialog
{
public:
CitationDialog();
virtual ~CitationDialog();

QSize sizeHint() const override { return QSize(500, 100); }
};

0 comments on commit deee475

Please sign in to comment.