Commit ef5bad79 authored by Jan Möbius's avatar Jan Möbius

Merge branch 'master' into 'cmake_qtquick'

# Conflicts:
#   cmake/ACGQt.cmake
parents baef96be 49daf67b
......@@ -101,6 +101,16 @@ class BaseInterface {
*/
virtual void pluginsInitialized() {};
/** \brief Initialize Plugin step 2 alternative
*
* This slot is similar to the vanilla version without parameters but additionally passes plugin command line options
* as key-value pairs. For passing command line options, use e.g.:
* OpenFlipper -o key1=value1 -p key2=value2
* or
* OpenFlipper --pluginoptions key1=value1;key2=value2
*/
virtual void pluginsInitialized(QVector<QPair<QString, QString>> const& _pluginOptions) {};
/** @} */
......
......@@ -161,6 +161,13 @@ void disableExaminerLightHandling() {
bool examinerLightHandling() {
return internalLightHandling_;
}
/** \brief DONT USE DIRECTLY!!
*
* Plugin command line options
* The container is set by the command line parser once
* and it is passed to the respective pluginsInitialized(...) method
*/
static QVector<QPair<QString, QString>> pluginCommandLineOptions_;
int viewerId() {
return viewerId_;
......@@ -1262,4 +1269,14 @@ ObjectReferenceRange objectReferences(IteratorRestriction _restriction, DataType
return ObjectReferenceRange(_restriction, _dataType);
}
const QVector<QPair<QString, QString> > &pluginCommandLineOptions()
{
return pluginCommandLineOptions_;
}
void setPluginCommandLineOptions(const QVector<QPair<QString, QString> > &_pluginCommandLineOptions)
{
pluginCommandLineOptions_ = _pluginCommandLineOptions;
}
} // End namespace PluginFunctions
......@@ -158,6 +158,21 @@ void removeObjectFromMap(int _objectId);
/** @} */
//=======================================
// Object container functions
/** @name Internal container for plugin options set via command line arguments
* @{ */
//=======================================
/// Get command line plugin settings as key-value pairs
DLLEXPORT
QVector<QPair<QString, QString>> const& pluginCommandLineOptions();
/// Set the command line plugin settings ( DO NOT USE!! )
/// This method is usually only called by the command line parser
DLLEXPORT
void setPluginCommandLineOptions(QVector<QPair<QString, QString>> const& _pluginCommandLineOptions);
//=======================================
// SceneGraph Generator Map
/** @name Internal container for scenegraph widget generators
......
......@@ -254,7 +254,7 @@ Core::init() {
connect(coreWidget_, SIGNAL(applyOptions()) , this, SLOT(applyOptions()));
connect(coreWidget_, SIGNAL(saveOptions()) , this, SLOT(saveOptions()));
connect(coreWidget_, SIGNAL(recentOpen(QAction*)) , this, SLOT(slotRecentOpen(QAction*)));
connect(coreWidget_, SIGNAL(exit()) , this, SLOT(slotExit()));
connect(coreWidget_, SIGNAL(exit()) , this, SLOT(slotExit()), Qt::QueuedConnection); // queue to avoid destroying the core widget during event handling
connect( coreWidget_, SIGNAL( resizeViewers(int,int) ), this, SLOT( resizeViewers(int,int) ) );
......
......@@ -404,6 +404,9 @@ signals:
/// Called after all plugins are loaded
void pluginsInitialized();
/// Called after all plugins are loaded and additionally passes command line plugin options
void pluginsInitialized(QVector<QPair<QString, QString>> const&);
/// Tell plugins that the visibility of an object has changed
void visibilityChanged(int _id);
......
......@@ -81,6 +81,7 @@
#include "OpenFlipper/BasePlugin/SecurityInterface.hh"
#include "OpenFlipper/BasePlugin/PluginConnectionInterface.hh"
#include "OpenFlipper/BasePlugin/MetadataInterface.hh"
#include "OpenFlipper/BasePlugin/PluginFunctionsCore.hh"
#include <ACG/QtWidgets/QtFileDialog.hh>
......@@ -559,6 +560,8 @@ void Core::loadPlugins()
emit pluginsInitialized();
emit pluginsInitialized(PluginFunctions::pluginCommandLineOptions());
emit log(LOGOUT,tr("Loaded %n Plugin(s)","",int(plugins().size())) );
}
......@@ -1046,6 +1049,9 @@ void Core::loadPlugin(const QString& _filename,const bool _silent, QString& _lic
if ( checkSlot( plugin , "pluginsInitialized()" ) )
connect(this,SIGNAL(pluginsInitialized()),plugin,SLOT(pluginsInitialized()), Qt::DirectConnection);
if ( checkSlot( plugin , "pluginsInitialized(QVector<QPair<QString,QString>>const&)" ) )
connect(this,SIGNAL(pluginsInitialized(QVector<QPair<QString,QString>>const&)),plugin,SLOT(pluginsInitialized(QVector<QPair<QString,QString>>const&)), Qt::DirectConnection);
if ( checkSignal(plugin,"setSlotDescription(QString,QString,QStringList,QStringList)") )
connect(plugin, SIGNAL(setSlotDescription(QString,QString,QStringList,QStringList)),
this, SLOT(slotSetSlotDescription(QString,QString,QStringList,QStringList)) );
......
......@@ -53,6 +53,7 @@
#include "OpenFlipper/Core/Core.hh"
#include "common/glew_wrappers.hh"
#include "OpenFlipper/BasePlugin/PluginFunctionsCore.hh"
// Qt
#include <qgl.h>
......@@ -365,6 +366,10 @@ CommandLineParseResult parseCommandLine(QCommandLineParser &parser, QString *err
QCommandLineOption profileOption("profile",QCoreApplication::translate("main","Request OpenGL context profile <profile> with profile set as compat or core"),QCoreApplication::translate("main","< compat | core >"));
parser.addOption(profileOption);
QCommandLineOption pluginOptionsOption(QStringList() << "o" << "pluginoptions",QCoreApplication::translate("main", "Pass options to plugins"), "key1=value1;key2=value2;...");
parser.addOption(pluginOptionsOption);
const QCommandLineOption helpOption = parser.addHelpOption();
const QCommandLineOption versionOption = parser.addVersionOption();
......@@ -454,6 +459,19 @@ CommandLineParseResult parseCommandLine(QCommandLineParser &parser, QString *err
if(parser.isSet(coreProfileOption)) {
OpenFlipper::Options::coreProfile(true, true);
}
if(parser.isSet(pluginOptionsOption))
{
QStringList poptions = parser.value(pluginOptionsOption).split(";");
QVector<QPair<QString, QString>> pcloptions;
for(auto s : poptions)
{
auto kvp = s.split("=");
auto key = kvp[0];
auto value = kvp[1];
pcloptions.push_back({key, value});
}
PluginFunctions::setPluginCommandLineOptions(pcloptions);
}
return CommandLineOk;
}
......
......@@ -100,6 +100,55 @@ macro (acg_qt5)
endif()
endforeach(QT_PACKAGE)
if (Qt5Core_FOUND AND Qt5Widgets_FOUND
AND Qt5Gui_FOUND AND Qt5OpenGL_FOUND AND Qt5Network_FOUND
AND Qt5Script_FOUND AND Qt5ScriptTools_FOUND AND Qt5Sql_FOUND
AND Qt5Xml_FOUND AND Qt5XmlPatterns_FOUND AND Qt5Help_FOUND
AND Qt5UiTools_FOUND AND Qt5Concurrent_FOUND
AND Qt5PrintSupport_FOUND)
set (QT5_FOUND TRUE)
else()
if (NOT Qt5Core_FOUND)
message(FATAL_ERROR "Qt5Core not found!")
endif()
if (NOT Qt5Widgets_FOUND)
message(FATAL_ERROR "Qt5Widgets not found!")
endif()
if (NOT Qt5Gui_FOUND)
message(FATAL_ERROR "Qt5Gui not found!")
endif()
if (NOT Qt5OpenGL_FOUND)
message(FATAL_ERROR "Qt5OpenGL not found!")
endif()
if (NOT Qt5Network_FOUND)
message(FATAL_ERROR "Qt5Network not found!")
endif()
if (NOT Qt5Script_FOUND)
message(FATAL_ERROR "Qt5Script not found!")
endif()
if (NOT Qt5ScriptTools_FOUND)
message(FATAL_ERROR "Qt5ScriptTools not found!")
endif()
if (NOT Qt5Sql_FOUND)
message(FATAL_ERROR "Qt5Sql not found!")
endif()
if (NOT Qt5Xml_FOUND)
message(FATAL_ERROR "Qt5Xml not found!")
endif()
if (NOT Qt5XmlPatterns_FOUND)
message(FATAL_ERROR "Qt5XmlPatterns not found!")
endif()
if (NOT Qt5Help)
message(FATAL_ERROR "Qt5Help not found!")
endif()
if (NOT Qt5Concurrent_FOUND)
message(FATAL_ERROR "Qt5Concurrent not found!")
endif()
if (NOT Qt5PrintSupport_FOUND)
message(FATAL_ERROR "Qt5PrintSupport not found!")
endif()
endif()
endif(Qt5Core_FOUND)
if (QT5_FOUND)
......
......@@ -20,9 +20,9 @@ set( CMAKE_CXX_STANDARD 11 )
# ACG Environment default settings
# This is ugly but currently we need to work around the default installed 5.3 on debian
if ( EXISTS /ACG/acgdev/gcc-x86_64/qt-5.10.1/5.10.1/gcc_64/ )
if ( EXISTS /ACG/acgdev/gcc-x86_64/qt-5.11.2/5.11.2/gcc_64 )
# Default to this install path for QT%_INSTALL_DIR
set (QT5_INSTALL_PATH /ACG/acgdev/gcc-x86_64/qt-5.10.1/5.10.1/gcc_64/ CACHE PATH "Qt5 install path set for ACG environment" )
set (QT5_INSTALL_PATH /ACG/acgdev/gcc-x86_64/qt-5.11.2/5.11.2/gcc_64/ CACHE PATH "Qt5 install path set for ACG environment using QT 5.11.2" )
endif()
if ( WIN32 )
......@@ -37,9 +37,11 @@ endif()
IF ( APPLE )
IF(CMAKE_BUILD_TYPE MATCHES Debug)
message(WARNING "WARNING: Mac Debug mode might mix debug and release libraries (Webkit, ...), which causes strange errors. If you use ports to provide qt, you might want to disable Qt debug libraries to make sure only release qt libraries are linked to OpenFlippers debug build.")
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
set(CMAKE_MACOSX_RPATH 0)
IF(CMAKE_BUILD_TYPE MATCHES Debug)
message(WARNING "WARNING: Mac Debug mode might mix debug and release libraries (Webkit, ...), which causes strange errors. If you use ports to provide qt, you might want to disable Qt debug libraries to make sure only release qt libraries are linked to OpenFlippers debug build.")
ENDIF(CMAKE_BUILD_TYPE MATCHES Debug)
endif()
......
......@@ -32,16 +32,20 @@ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
endif()
if (QT5_FOUND)
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.10.1" )
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.10.1")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.9.0" )
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.9.0")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.8.0" OR ${Qt5Core_VERSION_STRING} VERSION_GREATER "5.5.1")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.8.0")
else()
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-4.9-x86_64/qwt-6.1-qt5")
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.11.2")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.11.2")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.10.1" )
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.10.1")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.9.0" )
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.9.0")
else()
if (${Qt5Core_VERSION_STRING} VERSION_EQUAL "5.8.0" OR ${Qt5Core_VERSION_STRING} VERSION_GREATER "5.5.1")
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-x86_64/qwt-6.1.3-qt5.8.0")
else()
SET(ACG_SEARCH_PATH "/ACG/acgdev/gcc-4.9-x86_64/qwt-6.1-qt5")
endif()
endif()
endif()
endif()
......
# - Try to find SUITESPARSE
# Once done this will define
#
#
# SUITESPARSE_FOUND - system has SUITESPARSE
# SUITESPARSE_INCLUDE_DIRS - the SUITESPARSE include directory
# SUITESPARSE_LIBRARIES - Link these to use SUITESPARSE
......@@ -37,7 +37,7 @@ if( WIN32 )
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
endif()
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS "C:\\libs\\win32\\SuiteSparse\\Include"
......@@ -53,21 +53,21 @@ if( WIN32 )
# find path suitesparse library
FIND_PATH( SUITESPARSE_LIBRARY_DIRS
FIND_PATH( SUITESPARSE_LIBRARY_DIRS
NAMES amd.lib libamd.lib
PATHS "C:\\libs\\win32\\SuiteSparse\\libs"
PATHS "C:\\libs\\win32\\SuiteSparse\\libs"
"${VS_SEARCH_PATH}"
PATH_SUFFIXES suitesparse-4.2.1/lib64
suitesparse-metis-for-windows-1.2.2-install/lib64 )
# if we found the library, add it to the defined libraries
IF ( SUITESPARSE_LIBRARY_DIRS )
if ( EXISTS "${SUITESPARSE_LIBRARY_DIRS}/libamd.lib" )
list ( APPEND SUITESPARSE_LIBRARIES optimized;libamd;optimized;libcamd;optimized;libccolamd;optimized;libcholmod;optimized;libcolamd;optimized;metis;optimized;libspqr;optimized;libumfpack;debug;libamdd;debug;libcamdd;debug;libccolamdd;debug;libcholmodd;debug;libspqrd;debug;libumfpackd;debug;libcolamdd;debug;metisd;optimized;liblapack;debug;liblapackd;optimized;suitesparseconfig;debug;suitesparseconfigd )
else()
else()
list ( APPEND SUITESPARSE_LIBRARIES optimized;amd;optimized;camd;optimized;ccolamd;optimized;cholmod;optimized;colamd;optimized;metis;optimized;spqr;optimized;umfpack;debug;amdd;debug;camdd;debug;ccolamdd;debug;cholmodd;debug;spqrd;debug;umfpackd;debug;colamdd;debug;metisd;optimized;blas;optimized;libf2c;optimized;lapack;debug;blasd;debug;libf2cd;debug;lapackd )
endif()
endif()
if(EXISTS "${CHOLMOD_INCLUDE_DIR}/SuiteSparseQR.hpp")
SET(SUITESPARSE_SPQR_VALID TRUE CACHE BOOL "SuiteSparseSPQR valid")
else()
......@@ -78,45 +78,34 @@ if( WIN32 )
FIND_LIBRARY( SUITESPARSE_SPQR_LIBRARY
NAMES libspqr
PATHS ${SUITESPARSE_LIBRARY_DIRS} )
IF (SUITESPARSE_SPQR_LIBRARY)
IF (SUITESPARSE_SPQR_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES optimized;libspqr;debug;libspqrd)
ENDIF (SUITESPARSE_SPQR_LIBRARY)
endif()
ENDIF( SUITESPARSE_LIBRARY_DIRS )
else( WIN32 )
IF( APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /opt/local/include/ufsparse )
FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libSuiteSparse.dylib
PATHS /opt/local/lib )
list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_LIBRARY_DIR} )
list ( APPEND SUITESPARSE_LIBRARIES SuiteSparse)
ENDIF( SUITESPARSE_LIBRARY_DIRS )
ELSE(APPLE)
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /usr/local/include
/usr/include
/usr/include/suitesparse/
else( WIN32 )
FIND_PATH( CHOLMOD_INCLUDE_DIR cholmod.h
PATHS /usr/local/include
/usr/include
/usr/include/suitesparse/
/opt/local/include/
${CMAKE_SOURCE_DIR}/MacOS/Libs/cholmod
PATH_SUFFIXES cholmod/ CHOLMOD/ )
FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libcholmod.so
PATHS /usr/lib
/usr/lib64
FIND_PATH( SUITESPARSE_LIBRARY_DIR
NAMES libcholmod.so libcholmod.dylib
PATHS /usr/lib
/usr/lib64
/usr/local/lib
/opt/local/lib
/usr/lib/x86_64-linux-gnu )
list ( APPEND SUITESPARSE_LIBRARY_DIRS ${SUITESPARSE_LIBRARY_DIR} )
ENDIF(APPLE)
# Add cholmod include directory to collection include directories
IF ( CHOLMOD_INCLUDE_DIR )
......@@ -141,12 +130,12 @@ else( WIN32 )
# list ( APPEND SUITESPARSE_LIBRARIES spqr)
list ( APPEND SUITESPARSE_LIBRARIES umfpack)
# endif()
# Metis and spqr are optional
FIND_LIBRARY( SUITESPARSE_METIS_LIBRARY
NAMES metis
PATHS ${SUITESPARSE_LIBRARY_DIR} )
IF (SUITESPARSE_METIS_LIBRARY)
IF (SUITESPARSE_METIS_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES ${SUITESPARSE_METIS_LIBRARY})
ENDIF(SUITESPARSE_METIS_LIBRARY)
......@@ -160,13 +149,13 @@ else( WIN32 )
FIND_LIBRARY( SUITESPARSE_SPQR_LIBRARY
NAMES spqr
PATHS ${SUITESPARSE_LIBRARY_DIR} )
IF (SUITESPARSE_SPQR_LIBRARY)
IF (SUITESPARSE_SPQR_LIBRARY)
list ( APPEND SUITESPARSE_LIBRARIES spqr)
ENDIF (SUITESPARSE_SPQR_LIBRARY)
endif()
ENDIF( SUITESPARSE_LIBRARY_DIR )
ENDIF( SUITESPARSE_LIBRARY_DIR )
endif( WIN32 )
IF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
......@@ -177,4 +166,3 @@ IF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
ELSE (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
SET( SUITESPARSE_FOUND FALSE )
ENDIF (SUITESPARSE_INCLUDE_DIRS AND SUITESPARSE_LIBRARIES)
......@@ -502,26 +502,27 @@ void TextureNode::enter(GLState& _state , const DrawModes::DrawMode& _drawmode)
open_volume_mesh_texture_draw_modes_ ))
{
if(_state.compatibilityProfile())
ACG::GLState::enable( GL_TEXTURE_2D );
ACG::GLState::enable( GL_TEXTURE_2D );
mipmapping_globally_active_ = _state.mipmapping_allowed();
// Check if mipmapping status has changed
if(_state.mipmapping_allowed() != last_mipmapping_status_) {
// Update mipmaps
updateMipmaps(mipmapping_globally_active_ && mipmapping_);
// Keep track of changes
last_mipmapping_status_ = _state.mipmapping_allowed();
}
if ( !textures_.empty() ) {
textures_[activeTexture_].tex->bind();
}
if(_state.compatibilityProfile())
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, tex_mode_ );
mipmapping_globally_active_ = _state.mipmapping_allowed();
// Check if mipmapping status has changed
if(_state.mipmapping_allowed() != last_mipmapping_status_) {
// Update mipmaps
updateMipmaps(mipmapping_globally_active_ && mipmapping_);
// Keep track of changes
last_mipmapping_status_ = _state.mipmapping_allowed();
}
if ( !textures_.empty() ) {
textures_[activeTexture_].tex->bind();
}
if(_state.compatibilityProfile())
glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, tex_mode_ );
// if (_drawmode & DrawModes::SOLID_FACES_COLORED_2DTEXTURED_FACE_SMOOTH_SHADED)
// glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL);
......
Subproject commit 054e9985276cc8badd6a74f3621cc21de8936198
Subproject commit 14052c8532582ed27b3db83ff7f878ab267fad2b
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment