Skip to content

Commit

Permalink
Use PNG for icons
Browse files Browse the repository at this point in the history
  • Loading branch information
davidborland committed Jan 24, 2020
1 parent 916b900 commit 3c5a476
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 24 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ if(${VTK_VERSION} VERSION_GREATER "6" AND VTK_QT_VERSION VERSION_GREATER "4")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
find_package(Qt5Widgets REQUIRED QUIET)
find_package(Qt5Svg REQUIRED)
else()
find_package(Qt4 REQUIRED)
include(${QT_USE_FILE})
Expand Down Expand Up @@ -60,7 +59,7 @@ if(${VTK_VERSION} VERSION_GREATER "6" AND VTK_QT_VERSION VERSION_GREATER "4")
qt5_wrap_ui(UISrcs ${UI_FILES} )
# CMAKE_AUTOMOC in ON so the MOC headers will be automatically wrapped.
add_executable(Segmentor MACOSX_BUNDLE ${CXX_FILES} ${UISrcs} ${QT_WRAP} ${UI_RESOURCES})
qt5_use_modules(Segmentor Core Gui Svg)
qt5_use_modules(Segmentor Core Gui)
target_link_libraries(Segmentor ${VTK_LIBRARIES})
else()
QT4_WRAP_UI(UISrcs ${UI_FILES})
Expand Down
22 changes: 11 additions & 11 deletions Segmentor.qrc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file>icons/icon_overlay.svg</file>
<file>icons/icon_voxels.svg</file>
<file>icons/icon_outline.svg</file>
<file>icons/icon_smooth_surface.svg</file>
<file>icons/icon_smooth_normals.svg</file>
<file>icons/icon_plane.svg</file>
<file>icons/icon_filter_plane.svg</file>
<file>icons/icon_filter_neighbors.svg</file>
<file>icons/icon_filter_region.svg</file>
<file>icons/icon_dilate.svg</file>
<file>icons/icon_erode.svg</file>
<file>icons/icon_overlay.png</file>
<file>icons/icon_voxels.png</file>
<file>icons/icon_outline.png</file>
<file>icons/icon_smooth_surface.png</file>
<file>icons/icon_smooth_normals.png</file>
<file>icons/icon_plane.png</file>
<file>icons/icon_filter_plane.png</file>
<file>icons/icon_filter_neighbors.png</file>
<file>icons/icon_filter_region.png</file>
<file>icons/icon_dilate.png</file>
<file>icons/icon_erode.png</file>
</qresource>
</RCC>
Binary file added icons/icon_dilate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_erode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_filter_neighbors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_filter_plane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_filter_region.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_overlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_plane.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_smooth_normals.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_smooth_surface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/icon_voxels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 11 additions & 11 deletions qt/MainWindow.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -435,17 +435,17 @@ void MainWindow::CreateToolBar() {
//QActionGroup* filterModeGroup = new QActionGroup(this);
//interactionModeGroup->setExclusive(false);

QAction* actionFilterPlane = new QAction(QIcon(":/icons/icon_filter_plane.svg"), "Filter to plane", this);
QAction* actionFilterPlane = new QAction(QIcon(":/icons/icon_filter_plane.png"), "Filter to plane", this);
actionFilterPlane->setShortcut(QKeySequence("p"));
actionFilterPlane->setCheckable(true);
actionFilterPlane->setChecked(visualizationContainer->GetFilterMode() == FilterPlane);

QAction* actionFilterNeighbors = new QAction(QIcon(":/icons/icon_filter_neighbors.svg"), "Filter neighbors", this);
QAction* actionFilterNeighbors = new QAction(QIcon(":/icons/icon_filter_neighbors.png"), "Filter neighbors", this);
actionFilterNeighbors->setShortcut(QKeySequence("k"));
actionFilterNeighbors->setCheckable(true);
actionFilterNeighbors->setChecked(visualizationContainer->GetFilterMode() == FilterNeighbors);

QAction* actionFilterRegion = new QAction(QIcon(":/icons/icon_filter_region.svg"), "Filter region", this);
QAction* actionFilterRegion = new QAction(QIcon(":/icons/icon_filter_region.png"), "Filter region", this);
actionFilterRegion->setShortcut(QKeySequence("l"));
actionFilterRegion->setCheckable(true);
actionFilterRegion->setChecked(visualizationContainer->GetFilterMode() == FilterRegion);
Expand All @@ -456,23 +456,23 @@ void MainWindow::CreateToolBar() {
toolBar->addAction(actionEdit);
toolBar->addSeparator();
toolBar->addWidget(CreateLabel("2D"));
toolBar->addAction(CreateActionIcon(":/icons/icon_overlay.svg", "Show overlay", "q", visualizationContainer->GetSliceView()->GetShowLabelSlice(), &MainWindow::on_actionOverlay));
toolBar->addAction(CreateActionIcon(":/icons/icon_voxels.svg", "Show voxels", "w", visualizationContainer->GetSliceView()->GetShowVoxelOutlines(), &MainWindow::on_actionVoxels));
toolBar->addAction(CreateActionIcon(":/icons/icon_outline.svg", "Show outlines", "e", visualizationContainer->GetSliceView()->GetShowRegionOutlines(), &MainWindow::on_actionOutline));
toolBar->addAction(CreateActionIcon(":/icons/icon_overlay.png", "Show overlay", "q", visualizationContainer->GetSliceView()->GetShowLabelSlice(), &MainWindow::on_actionOverlay));
toolBar->addAction(CreateActionIcon(":/icons/icon_voxels.png", "Show voxels", "w", visualizationContainer->GetSliceView()->GetShowVoxelOutlines(), &MainWindow::on_actionVoxels));
toolBar->addAction(CreateActionIcon(":/icons/icon_outline.png", "Show outlines", "e", visualizationContainer->GetSliceView()->GetShowRegionOutlines(), &MainWindow::on_actionOutline));
toolBar->addSeparator();
toolBar->addWidget(CreateLabel("3D"));
toolBar->addAction(CreateActionIcon(":/icons/icon_smooth_normals.svg", "Smooth normals", "n", visualizationContainer->GetVolumeView()->GetSmoothShading(), &MainWindow::on_actionSmoothNormals));
toolBar->addAction(CreateActionIcon(":/icons/icon_smooth_surface.svg", "Smooth surfaces", "s", visualizationContainer->GetVolumeView()->GetSmoothSurfaces(), &MainWindow::on_actionSmoothSurfaces));
toolBar->addAction(CreateActionIcon(":/icons/icon_plane.svg", "Show plane", "o", visualizationContainer->GetVolumeView()->GetShowPlane(), &MainWindow::on_actionShowPlane));
toolBar->addAction(CreateActionIcon(":/icons/icon_smooth_normals.png", "Smooth normals", "n", visualizationContainer->GetVolumeView()->GetSmoothShading(), &MainWindow::on_actionSmoothNormals));
toolBar->addAction(CreateActionIcon(":/icons/icon_smooth_surface.png", "Smooth surfaces", "s", visualizationContainer->GetVolumeView()->GetSmoothSurfaces(), &MainWindow::on_actionSmoothSurfaces));
toolBar->addAction(CreateActionIcon(":/icons/icon_plane.png", "Show plane", "o", visualizationContainer->GetVolumeView()->GetShowPlane(), &MainWindow::on_actionShowPlane));
toolBar->addSeparator();
toolBar->addWidget(CreateLabel("Filter"));
toolBar->addAction(actionFilterPlane);
toolBar->addAction(actionFilterNeighbors);
toolBar->addAction(actionFilterRegion);
toolBar->addSeparator();
toolBar->addWidget(CreateLabel("Edit"));
toolBar->addAction(CreateActionIcon(":/icons/icon_dilate.svg", "Dilate region", "c", &MainWindow::on_actionDilateRegion));
toolBar->addAction(CreateActionIcon(":/icons/icon_erode.svg", "Erode region", "v",&MainWindow::on_actionErodeRegion));
toolBar->addAction(CreateActionIcon(":/icons/icon_dilate.png", "Dilate region", "c", &MainWindow::on_actionDilateRegion));
toolBar->addAction(CreateActionIcon(":/icons/icon_erode.png", "Erode region", "v",&MainWindow::on_actionErodeRegion));

// Need extra logic for interaction mode
QObject::connect(actionNavigation, &QAction::triggered, this, &MainWindow::on_actionNavigation);
Expand Down

0 comments on commit 3c5a476

Please sign in to comment.