Commit b8906443 authored by Jan Möbius's avatar Jan Möbius
Browse files
parents cd161990 5875bf0c
......@@ -19,7 +19,6 @@ FIND_PATH(OPENVOLUMEMESH_INCLUDE_DIR OpenVolumeMesh/Mesh/PolyhedralMesh.hh
"${CMAKE_SOURCE_DIR}/Type-OpenVolumeMesh/libs/OpenVolumeMesh/src"
"${CMAKE_SOURCE_DIR}/OpenVolumeMesh/src"
"${CMAKE_SOURCE_DIR}/libs_required/OpenVolumeMesh/src"
"${CMAKE_SOURCE_DIR}/../OpenVolumeMesh/src"
/ACG/acgdev/gcc-4.0-x86_64/OVM/OpenVolumeMesh/installed/include
"C:\\Program Files\\OpenVolumeMesh\\include"
)
......
......@@ -25,16 +25,24 @@ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
if (QT5_FOUND)
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.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()
else()
......@@ -52,6 +60,7 @@ find_path(QWT6_INCLUDE_DIR qwt.h
/usr/include
/usr/include/qwt
"${VS_SEARCH_PATH}/qwt-6.1.0/include"
"${VS_SEARCH_PATH}/qwt-6.1.3-qt${Qt5Core_VERSION_STRING}/include"
c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.1.0
c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.0.2
c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.0.1
......@@ -79,6 +88,7 @@ if (QWT6_VERSION_FOUND)
find_library(QWT6_LIBRARY_RELEASE NAMES qwt
PATHS
"${VS_SEARCH_PATH}/qwt-6.1.0/lib"
"${VS_SEARCH_PATH}/qwt-6.1.3-qt${Qt5Core_VERSION_STRING}/lib"
"c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.0.2\\lib"
"c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.1.0\\lib"
"c:\\libs\\Qwt-6.1.0\\lib"
......@@ -88,6 +98,7 @@ if (QWT6_VERSION_FOUND)
find_library(QWT6_LIBRARY_DEBUG NAMES qwtd
PATHS
"${VS_SEARCH_PATH}/qwt-6.1.0/lib"
"${VS_SEARCH_PATH}/qwt-6.1.3-qt${Qt5Core_VERSION_STRING}/lib"
"c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.0.2\\lib"
"c:\\libs\\${SEARCHPATH}\\x32\\Qwt-6.1.0\\lib"
"c:\\libs\\Qwt-6.1.0\\lib"
......
......@@ -17,7 +17,7 @@ endif()
if ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 11.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2012/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 12.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2013/x64/")
......@@ -27,6 +27,10 @@ elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 14.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2015/x32/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*Win64" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x64/")
elseif ( CMAKE_GENERATOR MATCHES "^Visual Studio 15.*" )
SET(VS_SEARCH_PATH "${CMAKE_WINDOWS_LIBS_DIR}/vs2017/x32/")
endif()
......
......@@ -695,7 +695,7 @@ function (_build_openflipper_plugin plugin)
# Visual studio requires our plugins to link with GLUT
find_package (GLUT)
# generate dllinport defines
add_definitions (-DACGDLL -DUSEACG -DPLUGINLIBDLL -DUSEPLUGINLIBDLL)
add_definitions (-DACGDLL -DUSEACG -DPLUGINLIBDLL -DUSEPLUGINLIBDLL -DFREEGLUT_LIB_PRAGMAS=0)
target_link_libraries (Plugin-${plugin}
${OPENMESH_LIBRARIES}
ACG
......
......@@ -29,6 +29,7 @@ if (WIN32)
-DBUILDOBJECTTYPEDLL
-DACGDLL
-DUSEACG
-DFREEGLUT_LIB_PRAGMAS=0
)
endif ()
......
......@@ -77,10 +77,8 @@
#include <vector>
#include <QMap>
#include "perObjectData.hh"
#if QT_VERSION >= 0x050000
#include <QJsonDocument>
#include <QJsonObject>
#endif
//== TYPEDEFS =================================================================
......@@ -598,7 +596,6 @@ class DLLEXPORT BaseObject : public QObject {
/*
* Compose JSON parsable object.
*/
#if QT_VERSION >= 0x050000
QJsonObject comment_obj;
for (QMap<QString, QString>::const_iterator it = commentsByKey_.begin(), it_end = commentsByKey_.end();
it != it_end; ++it) {
......@@ -614,12 +611,6 @@ class DLLEXPORT BaseObject : public QObject {
}
}
result.append(QString::fromUtf8(QJsonDocument(comment_obj).toJson(QJsonDocument::Indented)));
#else
for (QMap<QString, QString>::const_iterator it = commentsByKey_.begin(), it_end = commentsByKey_.end();
it != it_end; ++it) {
result.append(QString("%1: %2").arg(it.key(), it.value()));
}
#endif
result.append(QString("END Comments for object \"%1\"\n").arg(name()));
......
......@@ -58,7 +58,7 @@
/**
* \file FileTypes.cc
* This File contains the management of file plugins.
* This File contains the file type management vectors
*/
......@@ -66,14 +66,12 @@
#include <OpenFlipper/common/FileTypes.hh>
// Stores information about file types supported by the file plugins.
static std::vector<fileTypes> supportedTypes_;
std::vector<fileTypes>& supportedTypes() {
return supportedTypes_;
}
//=============================================================================
//=============================================================================
......@@ -58,12 +58,11 @@
/**
* \file FileTypes.hh
* This File contains the management of file plugins.
* This File contains the file type management vectors
*/
#ifndef FILETYPES_HH
#define FILETYPES_HH
#pragma once
#include <QString>
#include <OpenFlipper/common/GlobalDefines.hh>
......@@ -84,10 +83,8 @@ struct fileTypes {
// Get vector of supported types
DLLEXPORT
std::vector<fileTypes>&
supportedTypes();
std::vector<fileTypes>& supportedTypes();
//=============================================================================
#endif // FILETYPES_HH defined
//=============================================================================
......@@ -138,9 +138,21 @@ static bool stereo_ = true;
/// Use opengl core profile mode?
static bool coreProfile_ = false;
static bool profileOverride_ = false;
/// Requested Opengl version
static QPair<int,int> version_ {4,6};
static bool versionOverride_ = false;
/// Requested OpenGL multisampling
static int samples_ = 4;
static bool samplesOverride_ = false;
/// Store the opengl stereo support
static bool glStereo_ = true;
static bool overrideGLStereo_ = false;
static bool requestedGLStereo = false;
static bool GLStereoSet = false;
/// Stereo mode
static StereoMode stereoMode_ = OpenGL;
......@@ -378,37 +390,98 @@ bool stereo( ) {
}
/// Store opengl core profile setting
void coreProfile( bool _enableCoreProfile ) {
coreProfile_ = _enableCoreProfile;
void coreProfile( bool _enableCoreProfile, bool _temporary ) {
if(_temporary)
{
profileOverride_ = true;
coreProfile_ = _enableCoreProfile;
}
else
OpenFlipperSettings().setValue("Core/OpenGL/CoreProfile",_enableCoreProfile);
}
/// get opengl core profile setting
bool coreProfile( ) {
return coreProfile_;
if(profileOverride_)
return coreProfile_;
else
return OpenFlipperSettings().value("Core/OpenGL/CoreProfile", false).toBool();
}
/// get opengl version setting
QPair<int,int> glVersion(){
if(versionOverride_)
return version_;
else
{
// unfortunately QVariant cant store QPair directly, we could try std::pair but its good for now
int major = OpenFlipperSettings().value("Core/OpenGL/VersionMajor", 1).value<int>();
int minor = OpenFlipperSettings().value("Core/OpenGL/VersionMinor", 0).value<int>();
return QPair<int, int>(major,minor);
}
}
/// Store opengl version setting
void glVersion(const QPair<int,int> & _version, bool _temporary)
{
//possible enhancement: check for validity
if(_temporary)
{
version_ = _version;
versionOverride_ = true;
}
else
{
OpenFlipperSettings().setValue("Core/OpenGL/VersionMajor",_version.first);
OpenFlipperSettings().setValue("Core/OpenGL/VersionMinor",_version.second);
}
}
/// Store opengl MSAA sample count
void samples(int _samples) {
OpenFlipperSettings().setValue("Core/OpenGL/Samples",_samples);
void samples(int _samples, bool _temporary) {
if(_temporary)
{
samples_ = _samples;
samplesOverride_ = true;
}
else
OpenFlipperSettings().setValue("Core/OpenGL/Samples",_samples);
}
/// Get opengl MSAA sample count
int samples() {
#if defined(ARCH_DARWIN) //Disable MSAA on OSX by default until workaround is found.
return OpenFlipperSettings().value("Core/OpenGL/Samples",0).toInt();
#else
return OpenFlipperSettings().value("Core/OpenGL/Samples",4).toInt();
#endif
if(samplesOverride_)
return samples_;
else
return OpenFlipperSettings().value("Core/OpenGL/Samples",4).toInt();
}
/// Store opengl stereo mode setting
void glStereo( bool _glStereo ) {
glStereo_ = _glStereo;
void glStereo( bool _glStereo, bool _temporary ) {
if(!GLStereoSet) // store the first set value because it is used to create the context
{ // so we can display it properly later on in options
requestedGLStereo = _glStereo;
GLStereoSet = true;
}
if(_temporary)
{
glStereo_ = _glStereo;
overrideGLStereo_ = true;
}
else
OpenFlipperSettings().setValue("Core/OpenGL/Stereo",_glStereo);
}
/// get current opengl stereo setting
bool glStereo( ) {
return glStereo_;
if(overrideGLStereo_)
return glStereo_;
else
return OpenFlipperSettings().value("Core/OpenGL/Stereo",false).toBool();
}
/// get the glStereo flag that was used to request the opengl context
bool glStereoRequested( ) {
return requestedGLStereo;
}
/// Store stereo mode setting
......
......@@ -417,15 +417,23 @@ QString helpDirStr();
/// Store opengl core profile setting
DLLEXPORT
void coreProfile(bool _enableCoreProfile);
void coreProfile(bool _enableCoreProfile, bool _temporary = false);
/// get opengl core profile setting
DLLEXPORT
bool coreProfile( );
/// get opengl version setting
DLLEXPORT
QPair<int,int> glVersion();
/// set opengl version setting
DLLEXPORT
void glVersion(const QPair<int, int>& _version, bool _teporary = false);
/// Store opengl MSAA sample count
DLLEXPORT
void samples(int _samples);
void samples(int _samples, bool _temporary = false);
/// Get opengl MSAA sample count
DLLEXPORT
......@@ -448,11 +456,15 @@ QString helpDirStr();
/// Store opengl stereo support setting
DLLEXPORT
void glStereo( bool _stereo );
void glStereo( bool _stereo, bool _temporary = false );
/// will be set in core is opengl stereo is supported
DLLEXPORT
bool glStereo( );
/// will be set in core is opengl stereo is supported
DLLEXPORT
bool glStereoRequested( );
/// Store stereo mode setting
DLLEXPORT
......
......@@ -52,7 +52,6 @@
#include <QtGlobal>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 4))
//only forward declaration
class QOpenGLWidget;
......@@ -61,12 +60,3 @@ class QSurfaceFormat;
typedef QOpenGLWidget OFGLWidget;
typedef QSurfaceFormat OFGLFormat;
#else
#include <QGLWidget>
#include <QGLFormat>
typedef QGLWidget OFGLWidget;
typedef QGLFormat OFGLFormat;
#endif
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Types
//
//=============================================================================
/**
* \file PluginStorage.cc
* This File contains the management of plugins.
*/
//== INCLUDES =================================================================
#include <OpenFlipper/common/PluginStorage.hh>
namespace PluginStorage {
/// reference to Core plugin list
static std::vector<PluginInfo> plugins_;
/// reference to failed plugin list
static std::vector<PluginInfo> pluginsFailed_;
std::vector<PluginInfo>& plugins() {
return plugins_;
}
std::vector<PluginInfo>& pluginsFailed() {
return pluginsFailed_;
}
}
//=============================================================================
//=============================================================================
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (c) 2001-2015, RWTH-Aachen University *
* Department of Computer Graphics and Multimedia *
* All rights reserved. *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
*---------------------------------------------------------------------------*
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions *
* are met: *
* *
* 1. Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* *
* 2. Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* 3. Neither the name of the copyright holder nor the names of its *
* contributors may be used to endorse or promote products derived from *
* this software without specific prior written permission. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS *
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED *
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A *
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER *
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// Types
//
//=============================================================================
/**
* \file PluginStorage.hh
* This File contains the management vector for the plugins.
*/
#pragma once
#include <OpenFlipper/common/GlobalDefines.hh>
#include <OpenFlipper/Core/PluginInfo.hh>
//== INCLUDES =================================================================
namespace PluginStorage {
/// Get the vector of all PluginInfos
DLLEXPORT
std::vector<PluginInfo>& plugins();
/// Get the vector of all PluginInfos for plugins that failed to load at startup
DLLEXPORT
std::vector<PluginInfo>& pluginsFailed();
}
//=============================================================================
//=============================================================================
......@@ -48,11 +48,14 @@
\*===========================================================================*/
#include "glew_wrappers.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#include <GL/glew.h>
#include <stdio.h>
DLLEXPORT void initGlew() {
if (OpenFlipper::Options::glVersion().first >= 3 && OpenFlipper::Options::glVersion().second >= 2 && OpenFlipper::Options::coreProfile())
glewExperimental = GL_TRUE;
GLenum err = glewInit();
if (GLEW_OK != err)
{
......
......@@ -73,7 +73,6 @@ include_directories (
link_directories (
${GLEW_LIBRARY_DIR}
${GLUT_LIBRARY_DIR}
)
#===================================================================
......@@ -101,7 +100,7 @@ set (directories
# generate dllexport macros on windows
if (WIN32)
add_definitions(-DACGDLL)
add_definitions(-DACGDLL -DFREEGLUT_LIB_PRAGMAS=0)
remove_definitions(-DUSEACG)
endif ()
......
......@@ -242,7 +242,8 @@ bool ColorStack::Node::setIndex (size_t _idx) const
{
if (colorStartIdx_ && colorStartIdx_ + _idx < colorEndIdx_)
{
//glColor(translator_->index2color(colorStartIdx_ + _idx));
if(ACG::compatibilityProfile()) //only change glColor in compat mode as shader pipeline
glColor(translator_->index2color(colorStartIdx_ + _idx)); //renderer on core profiles does not rely on glColor
return true;
}
return false;
......
......@@ -68,17 +68,17 @@ DrawMeshBase::DrawMeshBase() :
}
DrawMeshBase::~DrawMeshBase() {
if (vbo_) glDeleteBuffersARB(1, &vbo_);
if (ibo_) glDeleteBuffersARB(1, &ibo_);
if (lineIBO_) glDeleteBuffersARB(1, &lineIBO_);
if (heVBO_) glDeleteBuffersARB(1, &heVBO_);
if (vbo_) glDeleteBuffers(1, &vbo_);
if (ibo_) glDeleteBuffers(1, &ibo_);
if (lineIBO_) glDeleteBuffers(1, &lineIBO_);
if (heVBO_) glDeleteBuffers(1, &heVBO_);
delete vertexDecl_;
delete vertexDeclEdgeCol_;
delete vertexDeclHalfedgeCol_;
delete vertexDeclHalfedgePos_;
if (pickVertexIBO_) glDeleteBuffersARB(1, &pickVertexIBO_);
if (pickVertexIBO_) glDeleteBuffers(1, &pickVertexIBO_);
}