Skip to content

Commit

Permalink
Add CPack support
Browse files Browse the repository at this point in the history
  • Loading branch information
rdimaio committed Apr 25, 2019
1 parent cf58877 commit b23ca1b
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ compile_commands.json
CTestTestfile.cmake

# CPack
_CPack_Packages
CPackConfig.cmake
CPackSourceConfig.cmake

Expand Down
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,17 @@ else()

target_link_libraries(${PROJECT_NAME} Qt5::Widgets ${VTK_LIBRARIES})

install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib/static)

# Use NSIS to generate installer for Windows, else format it to Zip
if(WIN32)
set(CPACK_GENERATOR "NSIS")
else()
set(CPACK_GENERATOR "ZIP")
endif()

include(CPack)

endif(TESTING)
Expand Down
48 changes: 46 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,43 @@
// H62PEP - Group 13
```

# Key features
- Open, visualize and save .mod and .stl files
- Fully fledged camera controls allow for
- Modify properties of the visualization, such as the model's opacity or colour
- Toggle the background to be a gradient instead of a uniform colour of your choice
- Switch between different visualization paradigms, such as wireframes and points
- Enable an external light, modifying its intensity and the specularity of the model
- Export volume, surface area, number of cells and vertices as text file data
- Filters, like shrink and clip filters, are available

# Requirements
- Windows/Linux (possibly MAC OSX, not tested)
- CMake 3.3 or greater (if installing from source)
- Qt 5
- VTK 8.2.0

# Installation
**Note: the preloaded .mod and .stl test files are not available
## From source
```bash
# Clone the repository
$ git clone https://github.com/rdimaio/ModelLoader

# Go into the ModelLoader folder
$ cd ModelLoader

# Build and make
$ cmake .
$ make

# Run the program
$ ./ModelLoader
```

## Via .zip (Linux)


## Library structure
The library's structure is a slightly modified version of [this answer](https://stackoverflow.com/a/1398594):

Expand All @@ -16,6 +53,7 @@ The library's structure is a slightly modified version of [this answer](https://
/include Public header files (.h) exposed to the library users
/lib Library build directory
/src Source files (.cpp) and private header files (.h)
/src/gui Graphical user interface files
/tests Test suites
```

Expand Down Expand Up @@ -133,8 +171,14 @@ in case the latest commit breaks the tests in any way.
- Code could be cleaned up, especially in mainwindow.cpp.
The different functions could be put in different files,
improving the ease of navigating the GUI source code.

## Useful links
- Many class member variables could be transformed into static/constant variables;
[This link](https://stackoverflow.com/questions/5620256/understanding-how-to-correctly-treat-c-class-constants)
provides a good understanding of the matter.
- A function to export a depth map could be added, using [this example](https://vtk.org/Wiki/VTK/Examples/Cxx/Utilities/ZBuffer)
as a starting point.
- Colorblind mode could be implemented.

# Useful links

- [An excellent and very brief git guide](http://rogerdudler.github.io/git-guide/)
- [A working example of Qt and VTK working together.](https://vtk.org/Wiki/VTK/Examples/Cxx/Qt/SideBySideRenderWindowsQt)
Expand Down
2 changes: 1 addition & 1 deletion src/gui/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ void MainWindow::handleActionOpen()
// Prompt user for a filename
inputFileName = QFileDialog::getOpenFileName(this, tr("Open File"),
QDir::currentPath(),
tr("Supported Models (*.mod, *.stl);;STL Model (*.stl);;Proprietary Model (*.mod)"));
tr("Supported Models (*.mod *.stl);;STL Model (*.stl);;Proprietary Model (*.mod)"));

if (!inputFileName.isEmpty() && !inputFileName.isNull())
{
Expand Down

0 comments on commit b23ca1b

Please sign in to comment.