Skip to content

ric-bianchi/Coin3D-SoQt-Examples

Repository files navigation

Coin3D-SoQt-Examples

Installation

Install the Qt framework and set it working

First of all, you should install the Qt software framework on your system and set it working for your terminal (on some systems, you probably have to adjust the PATH environment variable).

Please, refer to the official documentation for that. (Please notice: there is an Open Source version on the Installation page of Qt, you probably want to install that one)

Install all the other needed external dependencies

We are going to install all the external dependencies locally, i.e. you do not need any administrator right to install and run this.

Install Simage

Simage is the image manipulation library within the Coin3D suite.

  1. Get Simage code:
hg clone https://bitbucket.org/Coin3D/simage
  1. Configure and compile the code:
mkdir build_simage
cd build_simage
cmake -DCMAKE_INSTALL_PREFIX=../install ../simage
make
make install
cd ..

Notes:

  • If you get a warning message from CMake about a variable containing RPATH, please add the line below to the CMakeLists.txt file, which is needed for modern versions of CMake (I will push the edit to the official Simage repo, later). Apparently, it is not really needed for us, but you might want to set this to stop the warnings from CMake
set(CMAKE_MACOSX_RPATH 1)
  • You might need to set this before compiling the package, on certain operating systems:
export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH

Install Coin, the 3D graphics engine

  1. Get the Coin source code, from the CMake branch:
hg clone https://bitbucket.org/Coin3D/coin -r CMake
  1. Get a couple of extra subrepositories, needed to build Coin:
hg clone https://bitbucket.org/Coin3D/boost-header-libs-full
hg clone https://bitbucket.org/Coin3D/generalmsvcgeneration
  1. Create a build directory:
mkdir build_coin
cd build_coin
  1. Configure, compile and install:
cmake -DCMAKE_INSTALL_PREFIX=../install ../coin
make
make install
cd ..

Install SoQt, the windowing glue package

SoQt links Coin with the Qt user interface. It allows to have OpenGL-based 3D content created with Coin displayed in a Qt widget.

  1. Get the SoQt code
  • If you are on Linux, get the code from the official repository:
hg clone https://bitbucket.org/Coin3D/soqt
  • If you are on macOS, please get the code from the fork of , who fixed the problem with the Mac Retina display (there is a pull request pending, so in the future this fix will be integrated into the official SoQt repository):
hg clone https://bitbucket.org/roboticslibrary/soqt -r patch-hidpi
  1. Configure and compile the code:
mkdir build_soqt
cd build_soqt
cmake -DCMAKE_INSTALL_PREFIX=../install ../soqt
make
make install
cd ..

Notes:

  • Like with Simage above, if you get a warning message from CMake about a variable containing RPATH, please add the line below to the CMakeLists.txt file, which is needed for modern versions of CMake (I will push the edit to the official Simage repo, later). Apparently, it is not really needed for us, but you might want to set this to stop the warnings from CMake
set(CMAKE_MACOSX_RPATH 1)

Compiling the examples

Now, you can compile the examples. In general, you will be able to compile them by using the same install folder we used to install the external dependencies.

For example, taking the 'anti-aliasing' code as an example:

mkdir build_ex1_aa
cd build_ex1_aa
cmake -DCMAKE_INSTALL_PREFIX=../install ../Coin3D-SoQt-Examples/boilerplate_plus_antialiasing/
make

After the compilation, you will find an executable file inside the build folder, you can run it with:

./customExaminerViewer

Extra stuff

Testing with GCC7 on LXPLUS

If you work on CERN projects, you have access to the CERN computing network, and you want to test your code or the externals' code with Gcc7 on an Lxplus machine, here below you can find the relevant instructions. For convenience, we use the software framework of the ATLAS experiment to set Gcc7.

mkdir build_gcc7
cd build_gcc7
setupATLAS
asetup none,gcc7 --cmakesetup
cmake -DCMAKE_INSTALL_PREFIX=../install_gcc7 ../coin
make
make install

About

Basic examples on basic Coin3D/SoQt features

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published