Commit 94835888 authored by Jan Möbius's avatar Jan Möbius
Browse files

Merge branch 'master' into Enable_autouic

parents 14b6bfc4 e76e3f37
......@@ -39,21 +39,11 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef VIEWINTERFACE_HH
#define VIEWINTERFACE_HH
#pragma once
#include <OpenFlipper/common/Types.hh>
#include <QtWidgets>
#include <OpenFlipper/common/Types.hh>
#include <QWidget>
#include <QMenuBar>
/**
This Interface should be used by plugins which will provide an additional view widget.
......@@ -90,4 +80,3 @@ class ViewInterface {
Q_DECLARE_INTERFACE(ViewInterface,"OpenFlipper.ViewInterface/1.0")
#endif // VIEWINTERFACE_HH
......@@ -39,21 +39,8 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef VIEWMODEINTERFACE_HH
#define VIEWMODEINTERFACE_HH
#include <QtWidgets>
#pragma once
#include <QMenuBar>
#include <QStringList>
......@@ -205,4 +192,3 @@ To use the ViewModeInterface:
Q_DECLARE_INTERFACE(ViewModeInterface,"OpenFlipper.ViewModeInterface/1.0")
#endif // VIEWMODEINTERFACE_HH
......@@ -39,13 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "WhatsThisGenerator.hh"
......
......@@ -39,16 +39,7 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef WHATSTHISGENERATOR_HH_
#define WHATSTHISGENERATOR_HH_
#pragma once
#include <QAction>
#include <QString>
......@@ -91,4 +82,3 @@ public:
};
#endif /* WHATSTHISGENERATOR_HH_ */
......@@ -90,6 +90,9 @@
#include <OpenFlipper/common/PluginStorage.hh>
#include <ACG/Scenegraph/MaterialNode.hh>
#include <ACG/Scenegraph/SeparatorNode.hh>
#define WIDGET_HEIGHT 800
#define WIDGET_WIDTH 800
......
......@@ -63,6 +63,8 @@
#include "OpenFunctionThread.hh"
#include <ACG/Scenegraph/SeparatorNode.hh>
void Core::resetScenegraph( bool _resetTrackBall ) {
if ( OpenFlipper::Options::gui() && !OpenFlipper::Options::sceneGraphUpdatesBlocked() ) {
......
......@@ -4,7 +4,10 @@
- <b>OpenFlipper 4.0 ( ?/?/? )</b>
- <b>Breaking changes</b>
- Picking functions use size_t instead of unsigned int now (Required to get rid of a lot of warnings during compilation)
- Enabled AUTOMOC in cmake for QT ( If you get redefinition errors, guard the corresponding headers with a #pragma once )
- Enabled AUTOMOC in cmake for QT ( If you get redefinition errors, guard the corresponding headers with a #pragma once ; If you get gl.h before glew.h errors, move your widgets not using OpenGL into a subdir and add that to the DIRS macro in your CMakeLists.txt)
- Removed a lot of Scenegraph includes in BaseObjectData to reduce gl qt collisions and replaced them with forward declarations. (You have to include the scenegraph headers yourself now!)
- Removed a lot of unnecessary large QT includes from the Interfaces (Mostly QtWidgets). You have to add your own include statements in your plugins now.
- Removed WhatsThisGenerator include from BaseInterface. You have to include it in the plugins now if you use it.
- <b>Core</b>
- Use QOpenGLDebuglogger
- Queued cross plugin interconnection feature
......
# - Try to find Teem
# Once done this will define
#
# TEEM_FOUND - system has Teem
# TEEM_INCLUDE_DIR - the Teem include directory
# TEEM_LIBRARY - Link these to use Teem
#
IF(TEEM_INCLUDE_DIR)
# Already in cache, be silent
SET(TEEM_FIND_QUIETLY TRUE)
ENDIF(TEEM_INCLUDE_DIR)
if(WIN32)
FIND_PATH(TEEM_INCLUDE_DIR unrrdu.h nrrdDefines.h
PATHS "c:/teem/include" "c:/teem/teem-build/include")
SET(TEEM_NAMES teem)
FIND_LIBRARY(TEEM_LIBRARY
NAMES ${TEEM_NAMES}
PATHS "c:/teem/bin" "c:/teem/teem-build/bin")
else(WIN32)
FIND_PATH(TEEM_INCLUDE_DIR unrrdu.h nrrdDefines.h
PATHS /usr/local/include /usr/include)
SET(TEEM_NAMES teem TEEM)
FIND_LIBRARY(TEEM_LIBRARY
NAMES ${TEEM_NAMES}
PATHS /usr/lib /usr/local/lib)
endif(WIN32)
GET_FILENAME_COMPONENT(TEEM_LIBRARY_DIR ${TEEM_LIBRARY} PATH)
IF(TEEM_INCLUDE_DIR AND TEEM_LIBRARY)
SET(TEEM_FOUND TRUE)
ELSE(TEEM_INCLUDE_DIR AND TEEM_LIBRARY)
SET(TEEM_FOUND FALSE)
SET(TEEM_LIBRARY_DIR)
ENDIF(TEEM_INCLUDE_DIR AND TEEM_LIBRARY)
......@@ -39,14 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "BackupData.hh"
//-----------------------------------------------------------------------------
......
......@@ -39,16 +39,7 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef BACKUPDATA_HH
#define BACKUPDATA_HH
#pragma once
#include <QString>
#include <OpenFlipper/common/perObjectData.hh>
......@@ -129,4 +120,3 @@ class DLLEXPORT BackupData : public PerObjectData
size_t maxBackups_;
};
#endif //BACKUPDATA_HH
......@@ -39,14 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "BaseBackup.hh"
#include <OpenFlipper/common/BackupData.hh>
......
......@@ -39,16 +39,7 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#ifndef BASEBACKUP_HH
#define BASEBACKUP_HH
#pragma once
#include <QString>
#include <OpenFlipper/common/BaseObjectData.hh>
......@@ -126,4 +117,3 @@ class DLLEXPORT BaseBackup
int id_;
};
#endif //BASEBACKUP_HH
......@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
......@@ -56,7 +46,6 @@
//
//=============================================================================
#define BASEOBJECT_C
//== INCLUDES =================================================================
......@@ -65,6 +54,9 @@
#include <OpenFlipper/BasePlugin/PluginFunctionsCore.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <QJsonDocument>
#include <QJsonObject>
//== TYPEDEFS =================================================================
......@@ -829,6 +821,68 @@ deleteData() {
}
QString& BaseObject::getCommentByKey(const QString &key) {
return commentsByKey_[key];
}
const QString BaseObject::getCommentByKey(const QString &key) const {
return commentsByKey_.value(key);
}
bool BaseObject::hasCommentForKey(const QString &key) const {
return commentsByKey_.contains(key);
}
bool BaseObject::hasComments() const {
return !commentsByKey_.empty();
}
void BaseObject::clearComment(const QString &key) {
commentsByKey_.remove(key);
}
void BaseObject::clearAllComments() {
commentsByKey_.clear();
}
const QMap<QString, QString>& BaseObject::getAllComments() const {
return commentsByKey_;
}
const QString BaseObject::getAllCommentsFlat() const {
QStringList result;
result.append(QString("BEGIN Comments for object \"%1\"").arg(name()));
/*
* Compose JSON parsable object.
*/
QJsonObject comment_obj;
for (QMap<QString, QString>::const_iterator it = commentsByKey_.begin(), it_end = commentsByKey_.end();
it != it_end; ++it) {
QJsonParseError json_error;
QString test_json_str = QString::fromUtf8("{\"test\": %1}").arg(it.value());
QByteArray test_json_ba = test_json_str.toUtf8();
QJsonDocument test_json = QJsonDocument::fromJson(test_json_ba, &json_error);
if (json_error.error != QJsonParseError::NoError) {
comment_obj[it.key()] = it.value();
} else {
comment_obj[it.key()] = test_json.object().value("test");
}
}
result.append(QString::fromUtf8(QJsonDocument(comment_obj).toJson(QJsonDocument::Indented)));
result.append(QString("END Comments for object \"%1\"\n").arg(name()));
return result.join("\n");
}
QMap<QString, PerObjectData*>& BaseObject::getPerObjectDataMap() {
return dataMap_;
}
......
......@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
......@@ -61,24 +51,24 @@
* This File contains the Basic object class for all Objects (Includes also non visual objects such as Groups).
*/
#ifndef BASEOBJECT_HH
#define BASEOBJECT_HH
#pragma once
//== INCLUDES =================================================================
#include <OpenFlipper/common/GlobalDefines.hh>
#include <OpenFlipper/common/DataTypes.hh>
#include <OpenFlipper/common/UpdateType.hh>
#include "perObjectData.hh"
#include <vector>
#include <QObject>
#include <QString>
#include <QList>
#include <QStringList>
#include <vector>
#include <QMap>
#include "perObjectData.hh"
#include <QJsonDocument>
#include <QJsonObject>
//== TYPEDEFS =================================================================
......@@ -551,71 +541,30 @@ class DLLEXPORT BaseObject : public QObject {
* If no comment with the specified exists, an empty
* one is created.
*/
QString &getCommentByKey(const QString &key) {
return commentsByKey_[key];
}
QString &getCommentByKey(const QString &key);
/** \brief Get comment for the specified key.
*
* If no comment with the specified exists, an empty comment
* is returned (but not inserted into the map).
*/
const QString getCommentByKey(const QString &key) const {
return commentsByKey_.value(key);
}
const QString getCommentByKey(const QString &key) const;
/** Returns true if a comment for the specified key exists, false otherwise. */
bool hasCommentForKey(const QString &key) const {
return commentsByKey_.contains(key);
}
bool hasCommentForKey(const QString &key) const;
/** Indicates whether any comment has been supplied for this object. */
bool hasComments() const {
return !commentsByKey_.empty();
}
bool hasComments() const;
void clearComment(const QString &key) {
commentsByKey_.remove(key);
}
void clearComment(const QString &key);
void clearAllComments() {
commentsByKey_.clear();
}
void clearAllComments();
/** Returns a reference to all comments. */
const QMap<QString, QString> &getAllComments() const {
return commentsByKey_;
}
const QMap<QString, QString> &getAllComments() const;
/** Returns a flat, human readable representation of all comments. */
const QString getAllCommentsFlat() const {
QStringList result;
result.append(QString("BEGIN Comments for object \"%1\"").arg(name()));
/*
* Compose JSON parsable object.
*/
QJsonObject comment_obj;
for (QMap<QString, QString>::const_iterator it = commentsByKey_.begin(), it_end = commentsByKey_.end();
it != it_end; ++it) {
QJsonParseError json_error;
QString test_json_str = QString::fromUtf8("{\"test\": %1}").arg(it.value());
QByteArray test_json_ba = test_json_str.toUtf8();
QJsonDocument test_json = QJsonDocument::fromJson(test_json_ba, &json_error);
if (json_error.error != QJsonParseError::NoError) {
comment_obj[it.key()] = it.value();
} else {
comment_obj[it.key()] = test_json.object().value("test");
}
}
result.append(QString::fromUtf8(QJsonDocument(comment_obj).toJson(QJsonDocument::Indented)));
result.append(QString("END Comments for object \"%1\"\n").arg(name()));
return result.join("\n");
}
const QString getAllCommentsFlat() const;
private:
QMap<QString, QString> commentsByKey_;
......@@ -624,7 +573,3 @@ class DLLEXPORT BaseObject : public QObject {
};
//=============================================================================
#endif // BASEOBJECT_HH defined
//=============================================================================
......@@ -39,15 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
#include "BaseObjectCore.hh"
#include <OpenFlipper/BasePlugin/PluginFunctionsCore.hh>
......
......@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
......
......@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
......@@ -65,7 +55,11 @@
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <ACG/Scenegraph/SeparatorNode.hh>
#include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh>
#include <ACG/Scenegraph/BoundingBoxNode.hh>
#include <ACG/Scenegraph/StencilRefNode.hh>
#include <ACG/Scenegraph/StatusNodesT.hh>
//== TYPEDEFS =================================================================
......
......@@ -39,16 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
......@@ -62,26 +52,33 @@
* the Scenegraph.
*/
#ifndef BASEOBJECTDATA_HH
#define BASEOBJECTDATA_HH
#pragma once
//== INCLUDES =================================================================
#include <OpenFlipper/common/GlobalDefines.hh>
#include <OpenFlipper/common/BaseObject.hh>
#include <QObject>
#include <vector>
#include <ACG/Scenegraph/MaterialNode.hh>
#include <ACG/Scenegraph/SeparatorNode.hh>
#include <ACG/Scenegraph/ShaderNode.hh>
#include <ACG/Scenegraph/BaseNode.hh>
#include <ACG/Scenegraph/BoundingBoxNode.hh>
#include <ACG/Scenegraph/StencilRefNode.hh>
#include <ACG/QtScenegraph/QtTranslationManipulatorNode.hh>
#include <ACG/Scenegraph/PickTarget.hh>
#include <ACG/Scenegraph/DrawModes.hh>
//== FORWARD Declarations to avoid gl qt collisions =================================================================
namespace ACG {
namespace SceneGraph {
class MaterialNode;
class QtTranslationManipulatorNode;
class SeparatorNode;
class BaseNode;
class BoundingBoxNode;
class StencilRefNode;
class ShaderNode;
}
}
//== TYPEDEFS =================================================================
//== TYPEDEFS FOR SCENEGRAPH ===============================================
/// Materialnode
......@@ -389,6 +386,3 @@ class DLLEXPORT BaseObjectData : public BaseObject
#include "BaseObjectDataT.cc"
#endif
//=============================================================================
#endif // BASEOBJECTDATA_HH defined
//=============================================================================
......@@ -39,15 +39,6 @@
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $LastChangedBy$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
......@@ -61,6 +52,8 @@
//== INCLUDES =================================================================
#include "Types.hh"
#include <stack>