View PDB (Protein Data Bank) and MOL files. This app is built with CMake both natively and to the web. The web build has an accompanying demo. For a brief explanation of how the protein diagrams are generated check out this blog post.
Haemoglobin (PDB)
Immunoglobulin Antibody (IgG) (PDB)
Caffeine (MOL)
Download the source and unzip or
git clone https://github.com/patricklbell/chemical_visualizer.git
The build system uses CMake and Emscripten to create a WebAssembly module, it is easiest to use inside the accompanying Docker container. For native building see instructions below.
The provided Dockerfile contains all you need to build and run this project (e.g. Emscripten SDK version 2.0+, gcc, CMake, Ninja).
Open the folder with VSCode using "Remote-Container: Open folder in container", Enable the CMake Tools extension for VSCode.
Create a running container from the Dockerfile, mount the root of the repository and navigate into the workspace, and run:
mkdir build && cd build && ln -s ../data data
emcmake cmake -GNinja -DCMAKE_BUILD_TYPE=Release ..
cmake --build .
You can replace Ninja with any project file generator you like, e.g. make/VisualStudio/XCode/Eclipse.
You need CMake and the Visual Studio build tool-chain for C++. Additionally, OpenGL must be above version 3.3 (Should already work, if not, update your graphics drivers).
Open the root of source with Visual Studio as a folder, right click CMakeList.txt and select 'Set as Startup Item.' Set the CWD to the root of the project, or copy /data to the build folder. Build
To compile GLFW you need the X11 development packages installed, on Debian and derivates like Ubuntu and Linux Mint the xorg-dev meta-package pulls in the development packages for all of X11. For more information see https://www.glfw.org/docs/3.3/compile.html. You will need CMake, and OpenGL must be above version 3.3 (Should already work, if not, update your graphics drivers).
Navigate to the root of source, create a build directory, link data, and build with CMake:
cd chemical_visualizer
mkdir build && cd build && ln -s ../data data
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build .