diff --git a/CMakeLists.txt b/CMakeLists.txt
index fb6a55d..e0bc47c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,6 +12,8 @@ endif()
set(PROJECT "ExamplePlugins")
PROJECT(${PROJECT})
+add_subdirectory(Common)
+
add_subdirectory(ExampleView)
add_subdirectory(ExampleViewJS)
add_subdirectory(ExampleViewOpenGL)
diff --git a/Common/CMakeLists.txt b/Common/CMakeLists.txt
new file mode 100644
index 0000000..36abc53
--- /dev/null
+++ b/Common/CMakeLists.txt
@@ -0,0 +1,17 @@
+set(DIR ${CMAKE_CURRENT_SOURCE_DIR})
+
+set(COMMON_HEADERS
+ ${DIR}/Common.h
+ PARENT_SCOPE
+)
+
+set(COMMON_SOURCES
+ ${DIR}/Common.cpp
+ PARENT_SCOPE
+)
+
+set(COMMON_FILES
+ ${COMMON_HEADERS}
+ ${COMMON_SOURCES}
+ PARENT_SCOPE
+)
diff --git a/Common/common.cpp b/Common/common.cpp
new file mode 100644
index 0000000..e1fa704
--- /dev/null
+++ b/Common/common.cpp
@@ -0,0 +1,16 @@
+#include "Common.h"
+
+QString getExampleNotificationMessage()
+{
+ return { "ManiVault Studio features a notification system that can be triggered from:
"
+ "
" };
+}
diff --git a/Common/common.h b/Common/common.h
new file mode 100644
index 0000000..db147c0
--- /dev/null
+++ b/Common/common.h
@@ -0,0 +1,5 @@
+#pragma once
+
+#include
+
+QString getExampleNotificationMessage();
diff --git a/ExampleAnalysis/CMakeLists.txt b/ExampleAnalysis/CMakeLists.txt
index 00da83e..8fb697b 100644
--- a/ExampleAnalysis/CMakeLists.txt
+++ b/ExampleAnalysis/CMakeLists.txt
@@ -28,6 +28,11 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED)
find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET)
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -40,19 +45,21 @@ set(PLUGIN_SOURCES
src/ExampleAnalysisPlugin.json
)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${COMMON_FILES})
# -----------------------------------------------------------------------------
# Target include directories
# -----------------------------------------------------------------------------
# Include ManiVault headers, including system data plugins
target_include_directories(${PROJECT_NAME} PRIVATE "${ManiVault_INCLUDE_DIR}")
+target_include_directories(${PROJECT_NAME} PRIVATE Common)
# -----------------------------------------------------------------------------
# Target properties
diff --git a/ExampleAnalysis/src/ExampleAnalysisPlugin.cpp b/ExampleAnalysis/src/ExampleAnalysisPlugin.cpp
index 46aa420..6180b5f 100644
--- a/ExampleAnalysis/src/ExampleAnalysisPlugin.cpp
+++ b/ExampleAnalysis/src/ExampleAnalysisPlugin.cpp
@@ -1,5 +1,7 @@
#include "ExampleAnalysisPlugin.h"
+#include "../Common/Common.h"
+
#include "PointData/PointData.h"
#include
@@ -161,18 +163,7 @@ void ExampleAnalysisPlugin::init()
_eventListener.registerDataEventByType(PointType, std::bind(&ExampleAnalysisPlugin::onDataEvent, this, std::placeholders::_1));
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
void ExampleAnalysisPlugin::onDataEvent(mv::DatasetEvent* dataEvent)
diff --git a/ExampleData/CMakeLists.txt b/ExampleData/CMakeLists.txt
index f03a81c..b3ca337 100644
--- a/ExampleData/CMakeLists.txt
+++ b/ExampleData/CMakeLists.txt
@@ -31,6 +31,11 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED)
find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET)
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -45,13 +50,14 @@ set(PLUGIN_HEADERS
src/ExampleDataPlugin.h
)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${COMMON_FILES})
target_sources(${PROJECT_NAME} PRIVATE
${PLUGIN_SOURCES}
diff --git a/ExampleData/src/ExampleDataPlugin.cpp b/ExampleData/src/ExampleDataPlugin.cpp
index 145d014..81c96ee 100644
--- a/ExampleData/src/ExampleDataPlugin.cpp
+++ b/ExampleData/src/ExampleDataPlugin.cpp
@@ -1,5 +1,7 @@
#include "ExampleDataPlugin.h"
+#include "../Common/Common.h"
+
#include "Application.h"
#include
@@ -17,18 +19,7 @@ ExampleDataPlugin::~ExampleDataPlugin(void)
void ExampleDataPlugin::init()
{
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
/**
diff --git a/ExampleDependencies/CMakeLists.txt b/ExampleDependencies/CMakeLists.txt
index 8d3807a..b2828e0 100644
--- a/ExampleDependencies/CMakeLists.txt
+++ b/ExampleDependencies/CMakeLists.txt
@@ -47,6 +47,11 @@ if(${MV_EXAMPLES_USE_VCPKG})
endif()
endif()
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -59,13 +64,14 @@ set(PLUGIN_SOURCES
src/ExampleDependenciesPlugin.json
)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${COMMON_FILES})
# -----------------------------------------------------------------------------
# Target include directories
diff --git a/ExampleDependencies/src/ExampleDependenciesPlugin.cpp b/ExampleDependencies/src/ExampleDependenciesPlugin.cpp
index 9f869fc..a2fec98 100644
--- a/ExampleDependencies/src/ExampleDependenciesPlugin.cpp
+++ b/ExampleDependencies/src/ExampleDependenciesPlugin.cpp
@@ -1,5 +1,7 @@
#include "ExampleDependenciesPlugin.h"
+#include "../Common/Common.h"
+
#include
#include
@@ -51,18 +53,7 @@ void ExampleDependenciesPlugin::init()
// Start the analysis when the user clicks the start analysis push button
connect(&_settingsAction.getStartAnalysisAction(), &mv::gui::TriggerAction::triggered, this, &ExampleDependenciesPlugin::compute);
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
void ExampleDependenciesPlugin::compute()
diff --git a/ExampleLoader/CMakeLists.txt b/ExampleLoader/CMakeLists.txt
index 0dd8b4c..569e0cd 100644
--- a/ExampleLoader/CMakeLists.txt
+++ b/ExampleLoader/CMakeLists.txt
@@ -28,6 +28,11 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED)
find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET)
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -38,13 +43,14 @@ set(PLUGIN_SOURCES
src/ExampleLoaderPlugin.json
)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${COMMON_FILES})
# -----------------------------------------------------------------------------
# Target include directories
diff --git a/ExampleLoader/src/ExampleLoaderPlugin.cpp b/ExampleLoader/src/ExampleLoaderPlugin.cpp
index 1370867..0ef67be 100644
--- a/ExampleLoader/src/ExampleLoaderPlugin.cpp
+++ b/ExampleLoader/src/ExampleLoaderPlugin.cpp
@@ -1,5 +1,7 @@
#include "ExampleLoaderPlugin.h"
+#include "../Common/Common.h"
+
#include "PointData/PointData.h"
#include "Set.h"
@@ -35,18 +37,7 @@ ExampleLoaderPlugin::~ExampleLoaderPlugin(void)
*/
void ExampleLoaderPlugin::init()
{
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
/**
diff --git a/ExampleTransformation/CMakeLists.txt b/ExampleTransformation/CMakeLists.txt
index 4332be7..3501bd0 100644
--- a/ExampleTransformation/CMakeLists.txt
+++ b/ExampleTransformation/CMakeLists.txt
@@ -28,6 +28,11 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED)
find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET)
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -38,13 +43,14 @@ set(PLUGIN_SOURCES
src/ExampleTransformationPlugin.json
)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${COMMON_FILES})
# -----------------------------------------------------------------------------
# Target include directories
diff --git a/ExampleTransformation/src/ExampleTransformationPlugin.cpp b/ExampleTransformation/src/ExampleTransformationPlugin.cpp
index db800b1..5c01d5c 100644
--- a/ExampleTransformation/src/ExampleTransformationPlugin.cpp
+++ b/ExampleTransformation/src/ExampleTransformationPlugin.cpp
@@ -1,5 +1,7 @@
#include "ExampleTransformationPlugin.h"
+#include "../Common/Common.h"
+
#include
#include
@@ -22,18 +24,7 @@ ExampleTransformationPlugin::ExampleTransformationPlugin(const PluginFactory* fa
TransformationPlugin(factory),
_type(Type::Abs)
{
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
void ExampleTransformationPlugin::transform()
diff --git a/ExampleView/CMakeLists.txt b/ExampleView/CMakeLists.txt
index dab7ce3..693e433 100644
--- a/ExampleView/CMakeLists.txt
+++ b/ExampleView/CMakeLists.txt
@@ -28,6 +28,11 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED)
find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET)
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -42,13 +47,14 @@ set(PLUGIN_MOC_HEADERS
src/ExampleViewPlugin.h
)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${COMMON_FILES})
# -----------------------------------------------------------------------------
# Target include directories
diff --git a/ExampleView/src/ExampleViewPlugin.cpp b/ExampleView/src/ExampleViewPlugin.cpp
index c7946a0..c6f3c63 100644
--- a/ExampleView/src/ExampleViewPlugin.cpp
+++ b/ExampleView/src/ExampleViewPlugin.cpp
@@ -1,5 +1,7 @@
#include "ExampleViewPlugin.h"
+#include "../Common/Common.h"
+
#include
#include
@@ -115,18 +117,7 @@ void ExampleViewPlugin::init()
_eventListener.addSupportedEventType(static_cast(EventType::DatasetDataSelectionChanged));
_eventListener.registerDataEventByType(PointType, std::bind(&ExampleViewPlugin::onDataEvent, this, std::placeholders::_1));
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
void ExampleViewPlugin::onDataEvent(mv::DatasetEvent* dataEvent)
diff --git a/ExampleViewJS/CMakeLists.txt b/ExampleViewJS/CMakeLists.txt
index 76bbb98..61f206d 100644
--- a/ExampleViewJS/CMakeLists.txt
+++ b/ExampleViewJS/CMakeLists.txt
@@ -28,6 +28,11 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED)
find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET)
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -55,15 +60,16 @@ set(AUX
qt6_add_resources(RESOURCE_FILES res/example_chart.qrc)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
-source_group( Web FILES ${WEB})
-source_group( Aux FILES ${AUX})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Web FILES ${WEB})
+source_group(Aux FILES ${AUX})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${AUX} ${WEB} ${RESOURCE_FILES})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${AUX} ${WEB} ${RESOURCE_FILES} ${COMMON_FILES})
# -----------------------------------------------------------------------------
# Target include directories
diff --git a/ExampleViewJS/src/ExampleViewJSPlugin.cpp b/ExampleViewJS/src/ExampleViewJSPlugin.cpp
index 7279ab6..115d87b 100644
--- a/ExampleViewJS/src/ExampleViewJSPlugin.cpp
+++ b/ExampleViewJS/src/ExampleViewJSPlugin.cpp
@@ -1,5 +1,7 @@
#include "ExampleViewJSPlugin.h"
+#include "../Common/Common.h"
+
#include "ChartWidget.h"
#include
@@ -101,18 +103,7 @@ void ExampleViewJSPlugin::init()
// Create data so that we do not need to load any in this example
createData();
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
void ExampleViewJSPlugin::loadData(const mv::Datasets& datasets)
diff --git a/ExampleViewOpenGL/CMakeLists.txt b/ExampleViewOpenGL/CMakeLists.txt
index 3aa20cf..e42f0d0 100644
--- a/ExampleViewOpenGL/CMakeLists.txt
+++ b/ExampleViewOpenGL/CMakeLists.txt
@@ -28,6 +28,11 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets OpenGL OpenGLWidgets REQUIR
find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET)
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -50,15 +55,16 @@ set(PLUGIN_ACTIONS
src/GlobalSettingsAction.cpp
)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
-source_group( Widget FILES ${PLUGIN_WIDGETS})
-source_group( Actions FILES ${PLUGIN_ACTIONS})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Widget FILES ${PLUGIN_WIDGETS})
+source_group(Actions FILES ${PLUGIN_ACTIONS})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${PLUGIN_WIDGETS} ${PLUGIN_ACTIONS})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${PLUGIN_WIDGETS} ${PLUGIN_ACTIONS} ${COMMON_FILES})
# -----------------------------------------------------------------------------
# Target include directories
diff --git a/ExampleViewOpenGL/src/ExampleViewGLPlugin.cpp b/ExampleViewOpenGL/src/ExampleViewGLPlugin.cpp
index 4b1b557..cfd8874 100644
--- a/ExampleViewOpenGL/src/ExampleViewGLPlugin.cpp
+++ b/ExampleViewOpenGL/src/ExampleViewGLPlugin.cpp
@@ -1,6 +1,8 @@
#include "ExampleViewGLPlugin.h"
#include "ExampleGLWidget.h"
+#include "../Common/Common.h"
+
#include "GlobalSettingsAction.h"
#include
@@ -132,18 +134,7 @@ void ExampleViewGLPlugin::init()
// Update the data when the scatter plot widget is initialized
connect(_exampleGLWidget, &ExampleGLWidget::initialized, this, []() { qDebug() << "ExampleGLWidget is initialized."; } );
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
void ExampleViewGLPlugin::updatePlot()
diff --git a/ExampleWriter/CMakeLists.txt b/ExampleWriter/CMakeLists.txt
index 197ab8f..dcbf1ae 100644
--- a/ExampleWriter/CMakeLists.txt
+++ b/ExampleWriter/CMakeLists.txt
@@ -28,6 +28,11 @@ find_package(Qt6 COMPONENTS Widgets WebEngineWidgets REQUIRED)
find_package(ManiVault COMPONENTS Core PointData CONFIG QUIET)
+# -----------------------------------------------------------------------------
+# Include Common directory
+# -----------------------------------------------------------------------------
+add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../Common ${CMAKE_CURRENT_BINARY_DIR}/Common)
+
# -----------------------------------------------------------------------------
# Source files
# -----------------------------------------------------------------------------
@@ -38,13 +43,14 @@ set(PLUGIN_SOURCES
src/ExampleWriterPlugin.json
)
-source_group( Plugin FILES ${PLUGIN_SOURCES})
+source_group(Plugin FILES ${PLUGIN_SOURCES})
+source_group(Common FILES ${COMMON_FILES})
# -----------------------------------------------------------------------------
# CMake Target
# -----------------------------------------------------------------------------
# Create dynamic library for the plugin
-add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES})
+add_library(${PROJECT_NAME} SHARED ${PLUGIN_SOURCES} ${COMMON_FILES})
# -----------------------------------------------------------------------------
# Target include directories
diff --git a/ExampleWriter/src/ExampleWriterPlugin.cpp b/ExampleWriter/src/ExampleWriterPlugin.cpp
index da18a6a..070fc70 100644
--- a/ExampleWriter/src/ExampleWriterPlugin.cpp
+++ b/ExampleWriter/src/ExampleWriterPlugin.cpp
@@ -1,5 +1,7 @@
#include "ExampleWriterPlugin.h"
+#include "../Common/Common.h"
+
#include "PointData/PointData.h"
#include
@@ -33,18 +35,7 @@ ExampleWriterPlugin::~ExampleWriterPlugin(void)
*/
void ExampleWriterPlugin::init()
{
- addNotification("ManiVault Studio features a notification system that can be triggered from:
"
- ""
- );
+ addNotification(getExampleNotificationMessage());
}
/**