Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions .travis-functions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
#!/bin/bash

#
# .travis-functions.sh:
# - helper functions to be sourced from .travis.yml
# - designed to respect travis' environment but testing locally is possible
#

if [ ! -f "src/CMakeLists.txt" ]; then
echo ".travis-functions.sh must be sourced from source dir" >&2
return 1 || exit 1
fi

# some config settings
MAKE="make -j2"

function xconfigure
{
local CMAKEOPT

if test "$USE_QT" = "qt4"; then
CMAKEOPT+=" -DDI_FORCE_QT4=ON"
fi
cmake $CMAKEOPT ../src
}

function script_xvfb_run
{
# start xvfb X server and give it some time to start
export DISPLAY=:99.0
if [ "${TRAVIS_OS_NAME}" = "osx" ]; then
sudo Xvfb :99 -ac -screen 0 1024x768x24 &
else
Xvfb :99 -ac -screen 0 1024x768x24 &
fi
sleep 3

# just for info output
glewinfo

# Run the program.
#
# For now we just start it in background and see if it's still running. Once
# it's fixed for OSX and Ubuntu soft-GL we could use paraameters like
# --screenshot ../test/data/surfR_p_dist.ply ../test/data/distR.labels
# Note, OSX Xvfb has GL Version 4.1, so it should be possible somehow ...

./bin/DirectionalityIndicator &
sleep 10

# kill returns failure if there is no process running
kill $!
}

function script_generic
{
xconfigure || return
$MAKE || return
script_xvfb_run || return
}

function install_deps_linux
{
# install some packages from Ubuntu's default sources
sudo apt-get -qq update

# we should better install the glewinfo version from our bundled sources
sudo apt-get install -qq \
glew-utils \
|| return

if test "$USE_QT" = "qt4"; then
sudo apt-get install -qq \
libqt4-dev \
libqt4-opengl-dev \
|| return
else
sudo apt-get install -qq \
qt5-default \
libqt5opengl5-dev \
|| return
fi
}

function install_deps_osx
{
brew update >/dev/null
brew install \
glew \
qt5 \
|| return

QT_DIR=$(brew --prefix qt5)
PATH="$QT_DIR/bin:$PATH"
}

function travis_install_script
{
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
install_deps_osx || return
else
install_deps_linux || return
fi
}

function travis_script
{
local ret

# cd causes ugly traces on OSX, thats why we do it here
cd build || return

set -o xtrace

script_generic
ret=$?

set +o xtrace
return $ret
}
42 changes: 42 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
language: cpp

sudo: required
dist: trusty

os:
- linux

compiler:
- gcc
- clang

env:
- USE_QT="qt4"
- USE_QT="qt5"

matrix:
include:
- os: osx
osx_image: xcode8.3
compiler: clang
env: USE_QT="qt5"
- os: osx
osx_image: xcode7.3
compiler: clang
env: USE_QT="qt5"

install:
- env | grep -v "encrypted" | LC_ALL=C sort
- lscpu || sysctl hw
- source ./.travis-functions.sh
- travis_install_script

script:
- travis_script

branches:
only:
- master
- next
- /^travis.*/
- /^tmp.*/
13 changes: 4 additions & 9 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -282,42 +282,37 @@ IF( NOT REQUIRE_QT4 )
MESSAGE( "Using custom Qt path. Ensure you set the path to the directory containing the bin and lib directories." )
SET( CMAKE_PREFIX_PATH "$ENV{DI_QTDIR}/lib/cmake/Qt5Widgets" ${CMAKE_PREFIX_PATH} )
SET( CMAKE_PREFIX_PATH "$ENV{DI_QTDIR}/lib/cmake/Qt5OpenGL" ${CMAKE_PREFIX_PATH} )
SET( CMAKE_PREFIX_PATH "$ENV{DI_QTDIR}/lib/cmake/Qt5WebKitWidgets" ${CMAKE_PREFIX_PATH} )
SET( CMAKE_PREFIX_PATH $ENV{DI_QTDIR} ${CMAKE_PREFIX_PATH} )
endif()

# Package dependencies:
FIND_PACKAGE( Qt5Widgets )
FIND_PACKAGE( Qt5OpenGL )
FIND_PACKAGE( Qt5WebKitWidgets )

# Qt5 specific setup
IF( Qt5Widgets_FOUND AND Qt5OpenGL_FOUND AND Qt5WebKitWidgets_FOUND )
IF( Qt5Widgets_FOUND AND Qt5OpenGL_FOUND )
# Includes:
INCLUDE_DIRECTORIES( SYSTEM ${QT_INCLUDE_DIR} )
INCLUDE_DIRECTORIES( SYSTEM ${Qt5Widgets_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( SYSTEM ${Qt5OpenGL_INCLUDE_DIRS} )
INCLUDE_DIRECTORIES( SYSTEM ${Qt5WebKitWidgets_INCLUDE_DIRS} )

# Compiling with Qt5 requires some special definitions and flags to be set.

# Collect and set definitions
SET( _QT5_DEFINITIONS "" )
LIST( APPEND _QT5_DEFINITIONS ${Qt5Widgets_DEFINITIONS} )
LIST( APPEND _QT5_DEFINITIONS ${Qt5OpenGL_DEFINITIONS} )
LIST( APPEND _QT5_DEFINITIONS ${Qt5WebKitWidgets_DEFINITIONS} )
LIST( REMOVE_DUPLICATES _QT5_DEFINITIONS )
ADD_DEFINITIONS( ${_QT5_DEFINITIONS} )

# Collect and set compiler flags
SET( _QT5_EXECUTABLE_COMPILE_FLAGS "" )
LIST( APPEND _QT5_EXECUTABLE_COMPILE_FLAGS ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS} )
LIST( APPEND _QT5_EXECUTABLE_COMPILE_FLAGS ${Qt5OpenGL_EXECUTABLE_COMPILE_FLAGS} )
LIST( APPEND _QT5_EXECUTABLE_COMPILE_FLAGS ${Qt5WebKitWidgets_EXECUTABLE_COMPILE_FLAGS} )
LIST( REMOVE_DUPLICATES _QT5_EXECUTABLE_COMPILE_FLAGS )
SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${_QT5_EXECUTABLE_COMPILE_FLAGS}" )

SET( QT_Link_Libs Qt5::Widgets Qt5::OpenGL Qt5::WebKitWidgets )
SET( QT_Link_Libs Qt5::Widgets Qt5::OpenGL )
ELSE()
# Not Found ... we need at least Qt4:
SET( REQUIRE_QT4 TRUE )
Expand All @@ -326,14 +321,14 @@ ENDIF()

IF( REQUIRE_QT4 )
# Searching Qt4
FIND_PACKAGE( Qt4 4.8.0 REQUIRED QtCore QtGui QtOpenGL QtWebKit )
FIND_PACKAGE( Qt4 4.8.0 REQUIRED QtCore QtGui QtOpenGL)

IF( NOT QT4_FOUND )
MESSAGE( FATAL_ERROR "Neither Qt5 nor Qt4 were found. Abort. Try using DI_QTDIR or QTDIR environment variables to point to your Qt installation." )
ENDIF()

INCLUDE_DIRECTORIES( SYSTEM ${QT_INCLUDES} )
SET( QT_Link_Libs Qt4::QtCore Qt4::QtGui Qt4::QtOpenGL Qt4::QtWebKit )
SET( QT_Link_Libs Qt4::QtCore Qt4::QtGui Qt4::QtOpenGL )
endif()

# This is needed since the mocs will be generated there
Expand Down
2 changes: 1 addition & 1 deletion src/app/App.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ namespace di
*
* \return true if everything is ok
*/
virtual bool handleCommandLine( const std::vector< std::string >& arguments, int argc, char** argv );
virtual bool handleCommandLine( const std::vector< std::string >& arguments, int argc, char** argv ) override;

private:
/**
Expand Down
12 changes: 6 additions & 6 deletions src/lib/di/algorithms/RenderIllustrativeLines.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ namespace di
/**
* Process the data in the inputs and update output data. Keep in mind that this might be called in its own thread thread.
*/
virtual void process();
virtual void process() override;

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Visualization Specific Methods
Expand All @@ -79,15 +79,15 @@ namespace di
*
* \note this runs in the OpenGL thread and the context is bound.
*/
virtual void prepare();
virtual void prepare() override;

/**
* Finalize your OpenGL resources here. Free buffers and shaders.
* If an error occurs, throw an exception accordingly.
*
* \note this runs in the OpenGL thread and the context is bound.
*/
virtual void finalize();
virtual void finalize() override;

/**
* Do actual rendering.
Expand All @@ -97,7 +97,7 @@ namespace di
*
* \param view the view to render to. This contains probably useful information.
*/
virtual void render( const core::View& view );
virtual void render( const core::View& view ) override;

/**
* This method is called between the frames. Use this to update resources. Immediately return if nothing needs to update. If you do not
Expand All @@ -109,15 +109,15 @@ namespace di
* \param view the view to render to. This contains probably useful information.
* \param reload to force a reload of all resources.
*/
virtual void update( const core::View& view, bool reload = false );
virtual void update( const core::View& view, bool reload = false ) override;

/**
* Each visualization needs to know the rendering area it will use. In most cases, this is the bounding box of the rendered geometry.
* Avoid long running functions, since they block the OpenGL thread.
*
* \return bounding box of this visualization
*/
virtual core::BoundingBox getBoundingBox() const;
virtual core::BoundingBox getBoundingBox() const override;

protected:
/**
Expand Down
Loading