diff --git a/source/RobotAPI/gui-plugins/CMakeLists.txt b/source/RobotAPI/gui-plugins/CMakeLists.txt index 95c3e16c4995fd97aaaf7fb43b1aea114fc3d3f8..efa75d05dcf3051fcdb7ae16d29b151bcf4ebee4 100644 --- a/source/RobotAPI/gui-plugins/CMakeLists.txt +++ b/source/RobotAPI/gui-plugins/CMakeLists.txt @@ -15,3 +15,4 @@ add_subdirectory(CartesianWaypointControlGui) add_subdirectory(DebugDrawerGuiPlugin) add_subdirectory(ArViz) add_subdirectory(CartesianNaturalPositionController) +add_subdirectory(ObjectPoseGui) diff --git a/source/RobotAPI/gui-plugins/ObjectPoseGui/CMakeLists.txt b/source/RobotAPI/gui-plugins/ObjectPoseGui/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..faf1e6180e072b4e4299fc0e2441969e93257ecf --- /dev/null +++ b/source/RobotAPI/gui-plugins/ObjectPoseGui/CMakeLists.txt @@ -0,0 +1,38 @@ +armarx_set_target("ObjectPoseGuiPlugin") + +# most qt components will be linked against in the call armarx_gui_library +#armarx_find_qt(QtCore QtGui QtDesigner) + +# ArmarXGui gets included through depends_on_armarx_package(ArmarXGui "OPTIONAL") +# in the toplevel CMakeLists.txt +armarx_build_if(ArmarXGui_FOUND "ArmarXGui not available") + +set(SOURCES + ObjectPoseGuiPlugin.cpp ObjectPoseGuiWidgetController.cpp +) + +# do not rename this variable, it is used in armarx_gui_library()... +set(HEADERS + ObjectPoseGuiPlugin.h ObjectPoseGuiWidgetController.h +) + +set(GUI_MOC_HDRS ${HEADERS}) + +set(GUI_UIS + ObjectPoseGuiWidget.ui +) + +# Add more libraries you depend on here, e.g. ${QT_LIBRARIES}. +set(COMPONENT_LIBS ) + +if(ArmarXGui_FOUND) + armarx_gui_library(ObjectPoseGuiPlugin "${SOURCES}" "${GUI_MOC_HDRS}" "${GUI_UIS}" "" "${COMPONENT_LIBS}") + + #find_package(MyLib QUIET) + #armarx_build_if(MyLib_FOUND "MyLib not available") + # all target_include_directories must be guarded by if(Xyz_FOUND) + # for multiple libraries write: if(X_FOUND AND Y_FOUND).... + #if(MyLib_FOUND) + # target_include_directories(ObjectPoseGuiPlugi PUBLIC ${MyLib_INCLUDE_DIRS}) + #endif() +endif() diff --git a/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiPlugin.cpp b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiPlugin.cpp new file mode 100644 index 0000000000000000000000000000000000000000..01cff7dcbe628fc900c62a5ad74c75b3aa6fab4d --- /dev/null +++ b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiPlugin.cpp @@ -0,0 +1,33 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * \package RobotAPI::gui-plugins::ObjectPoseGuiPlugin + * \author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * \date 2020 + * \copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "ObjectPoseGuiPlugin.h" + +#include "ObjectPoseGuiWidgetController.h" + +namespace armarx +{ + ObjectPoseGuiPlugin::ObjectPoseGuiPlugin() + { + addWidget < ObjectPoseGuiWidgetController > (); + } +} diff --git a/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiPlugin.h b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiPlugin.h new file mode 100644 index 0000000000000000000000000000000000000000..69625e6dc30760ebca74ba87db6b9338316185ac --- /dev/null +++ b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiPlugin.h @@ -0,0 +1,50 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * \package RobotAPI::gui-plugins::ObjectPoseGui + * \author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * \date 2020 + * \copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ +#pragma once + +#include <ArmarXCore/core/system/ImportExportComponent.h> +#include <ArmarXGui/libraries/ArmarXGuiBase/ArmarXGuiPlugin.h> +#include <ArmarXGui/libraries/ArmarXGuiBase/ArmarXComponentWidgetController.h> + +namespace armarx +{ + /** + * \class ObjectPoseGuiPlugin + * \ingroup ArmarXGuiPlugins + * \brief ObjectPoseGuiPlugin brief description + * + * Detailed description + */ + class ARMARXCOMPONENT_IMPORT_EXPORT ObjectPoseGuiPlugin: + public armarx::ArmarXGuiPlugin + { + Q_OBJECT + Q_INTERFACES(ArmarXGuiInterface) + Q_PLUGIN_METADATA(IID "ArmarXGuiInterface/1.00") + public: + /** + * All widgets exposed by this plugin are added in the constructor + * via calls to addWidget() + */ + ObjectPoseGuiPlugin(); + }; +} diff --git a/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidget.ui b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidget.ui new file mode 100644 index 0000000000000000000000000000000000000000..39b421458e3d9bfd2633be4a4a89af8c329ec480 --- /dev/null +++ b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidget.ui @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ui version="4.0"> + <class>ObjectPoseGuiWidget</class> + <widget class="QWidget" name="ObjectPoseGuiWidget"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>400</width> + <height>300</height> + </rect> + </property> + <property name="windowTitle"> + <string>ObjectPoseGuiWidget</string> + </property> + </widget> + <resources/> + <connections/> +</ui> diff --git a/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidgetController.cpp b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidgetController.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bafffb7caa8dd3be506936e39d5aa5ec5183aee8 --- /dev/null +++ b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidgetController.cpp @@ -0,0 +1,66 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * \package RobotAPI::gui-plugins::ObjectPoseGuiWidgetController + * \author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * \date 2020 + * \copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ + +#include "ObjectPoseGuiWidgetController.h" + +#include <string> + + +namespace armarx +{ + + ObjectPoseGuiWidgetController::ObjectPoseGuiWidgetController() + { + widget.setupUi(getWidget()); + } + + + ObjectPoseGuiWidgetController::~ObjectPoseGuiWidgetController() + { + + } + + + void ObjectPoseGuiWidgetController::loadSettings(QSettings* settings) + { + } + + void ObjectPoseGuiWidgetController::saveSettings(QSettings* settings) + { + } + + QString ObjectPoseGuiWidgetController::GetWidgetName() + { + return "ObjectPoseGui"; + } + + + void ObjectPoseGuiWidgetController::onInitComponent() + { + + } + + void ObjectPoseGuiWidgetController::onConnectComponent() + { + + } +} diff --git a/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidgetController.h b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidgetController.h new file mode 100644 index 0000000000000000000000000000000000000000..4c71bdab143101fb4b8339025c7e30ed003dfcde --- /dev/null +++ b/source/RobotAPI/gui-plugins/ObjectPoseGui/ObjectPoseGuiWidgetController.h @@ -0,0 +1,96 @@ +/* + * This file is part of ArmarX. + * + * ArmarX is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * ArmarX is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * @package RobotAPI::gui-plugins::ObjectPoseGuiWidgetController + * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu ) + * @date 2020 + * @copyright http://www.gnu.org/licenses/gpl-2.0.txt + * GNU General Public License + */ +#pragma once + +#include <RobotAPI/gui-plugins/ObjectPoseGui/ui_ObjectPoseGuiWidget.h> + +#include <ArmarXGui/libraries/ArmarXGuiBase/ArmarXGuiPlugin.h> +#include <ArmarXGui/libraries/ArmarXGuiBase/ArmarXComponentWidgetController.h> + +#include <ArmarXCore/core/system/ImportExportComponent.h> + +namespace armarx +{ + /** + @page RobotAPI-GuiPlugins-ObjectPoseGui ObjectPoseGui + @brief The ObjectPoseGui allows visualizing ... + + @image html ObjectPoseGui.png + The user can + + API Documentation @ref ObjectPoseGuiWidgetController + + @see ObjectPoseGuiGuiPlugin + */ + + /** + * @class ObjectPoseGuiWidgetController + * @brief ObjectPoseGuiWidgetController brief one line description + * + * Detailed description + */ + class ARMARXCOMPONENT_IMPORT_EXPORT + ObjectPoseGuiWidgetController: + public armarx::ArmarXComponentWidgetControllerTemplate < ObjectPoseGuiWidgetController > + { + Q_OBJECT + + public: + /// Controller Constructor + explicit ObjectPoseGuiWidgetController(); + + /// Controller destructor + virtual ~ObjectPoseGuiWidgetController(); + + + /// @see ArmarXWidgetController::loadSettings() + void loadSettings(QSettings* settings) override; + /// @see ArmarXWidgetController::saveSettings() + void saveSettings(QSettings* settings) override; + + /// Returns the Widget name displayed in the ArmarXGui to create an instance of this class. + static QString GetWidgetName(); + + + /// @see armarx::Component::onInitComponent() + void onInitComponent() override; + + /// @see armarx::Component::onConnectComponent() + void onConnectComponent() override; + + + public slots: + /* QT slot declarations */ + + signals: + /* QT signal declarations */ + + private: + + /// Widget Form + Ui::ObjectPoseGuiWidget widget; + + + }; +} + +