ObjectPoseClientWidget.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Rainer Kartmann ( rainer dot kartmann at kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <memory>
25 #include <optional>
26 #include <string>
27 #include <vector>
28 
29 #include <QWidget>
30 #include <qobjectdefs.h>
31 #include <qwidget.h>
32 
33 #include <Eigen/Core>
34 
37 
38 
39 class QLabel;
40 class QPushButton;
41 
42 namespace IceInternal
43 {
44  template <typename T>
45  class ProxyHandle;
46 }
47 
49 {
50  class ObjectPoseStorageInterface;
51 }
52 
53 namespace armarx
54 {
55  class ManagedIceObject;
58 } // namespace armarx
59 
61 {
62 
63  class Connection
64  {
65  public:
66  Connection(ObjectPoseStorageInterfacePrx objectPoseStorageComponent);
67  ~Connection();
68 
70  std::string getConnectedName() const;
71 
73 
75  std::vector<ObjectInfo> getObjectInfo();
76 
77  private:
78  std::unique_ptr<ObjectPoseStorageInterfacePrx> _objectPoseStorageComponent;
79  std::unique_ptr<objpose::ObjectPoseClient> _objectPoseClient;
80  };
81 
82 } // namespace armarx::navigation::qt_plugins::location_graph_editor::objectposes
83 
85 
86 {
87 
88  class ObjectPoseClientWidget : public QWidget
89  {
90  Q_OBJECT
92 
93  public:
94  ObjectPoseClientWidget(ManagedIceObject& component, QWidget* parent = nullptr);
95 
96 
97  bool isConnected() const;
99 
100 
101  signals:
102 
103  void connected();
104 
105 
106  public slots:
107 
109 
110 
111  private:
112  ManagedIceObject& _component;
113  std::optional<objectposes::Connection> _connection;
114 
115  QLabel* _statusLabel = nullptr;
116  QPushButton* _connectButton = nullptr;
117  };
118 
119 } // namespace armarx::navigation::qt_plugins::location_graph_editor
IceProxy::armarx::objpose
Definition: ObjectPoseClientWidget.h:48
armarx::navigation::qt_plugins::location_graph_editor::objectposes::Connection
Definition: ObjectPoseClientWidget.h:63
armarx::ObjectPoseStorageInterfacePrx
::IceInternal::ProxyHandle<::IceProxy::armarx::objpose::ObjectPoseStorageInterface > ObjectPoseStorageInterfacePrx
Definition: ObjectPoseClientWidget.h:57
armarx::navigation::qt_plugins::location_graph_editor::objectposes::Connection::getObjectPoseMap
objpose::ObjectPoseMap getObjectPoseMap()
Definition: ObjectPoseClientWidget.cpp:81
armarx::ProxyType::component
@ component
armarx::navigation::qt_plugins::location_graph_editor::objectposes::Connection::getObjectInfo
std::vector< ObjectInfo > getObjectInfo()
Definition: ObjectPoseClientWidget.cpp:87
armarx::navigation::qt_plugins::location_graph_editor::objectposes::Connection::getObjectClient
objpose::ObjectPoseClient & getObjectClient()
Definition: ObjectPoseClientWidget.cpp:75
armarx::navigation::qt_plugins::location_graph_editor::ObjectPoseClientWidget::connection
objectposes::Connection & connection()
Definition: ObjectPoseClientWidget.cpp:125
armarx::objpose::ObjectPoseClient
Provides access to the armarx::objpose::ObjectPoseStorageInterface (aka the object memory).
Definition: ObjectPoseClient.h:17
armarx::navigation::qt_plugins::location_graph_editor::objectposes::Connection::getConnectedName
std::string getConnectedName() const
Definition: ObjectPoseClientWidget.cpp:69
armarx::navigation::qt_plugins::location_graph_editor::ObjectPoseClientWidget::ObjectPoseClientWidget
ObjectPoseClientWidget(ManagedIceObject &component, QWidget *parent=nullptr)
Definition: ObjectPoseClientWidget.cpp:93
armarx::navigation::qt_plugins::location_graph_editor::objectposes::Connection::~Connection
~Connection()
armarx::navigation::qt_plugins::location_graph_editor::ObjectPoseClientWidget::connectToObjectPoseComponent
void connectToObjectPoseComponent()
Definition: ObjectPoseClientWidget.cpp:131
armarx::navigation::qt_plugins::location_graph_editor
Definition: GuiGraph.cpp:34
ObjectInfo.h
IceInternal
This file is part of ArmarX.
Definition: InstrumentationI.h:16
armarx::navigation::qt_plugins::location_graph_editor::ObjectPoseClientWidget
Definition: ObjectPoseClientWidget.h:88
forward_declarations.h
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:162
IceInternal::ProxyHandle
Definition: ObjectPoseClientWidget.h:45
armarx::navigation::qt_plugins::location_graph_editor::objectposes::Connection::getObjectPoseStorageComponent
ObjectPoseStorageInterfacePrx getObjectPoseStorageComponent() const
Definition: ObjectPoseClientWidget.cpp:61
armarx::navigation::qt_plugins::location_graph_editor::ObjectPoseClientWidget::isConnected
bool isConnected() const
Definition: ObjectPoseClientWidget.cpp:119
armarx::navigation::qt_plugins::location_graph_editor::objectposes::Connection::Connection
Connection(ObjectPoseStorageInterfacePrx objectPoseStorageComponent)
Definition: ObjectPoseClientWidget.cpp:48
armarx::navigation::qt_plugins::location_graph_editor::ObjectPoseClientWidget::connected
void connected()
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::objpose::ObjectPoseMap
std::map< ObjectID, ObjectPose > ObjectPoseMap
Definition: forward_declarations.h:21
armarx::navigation::qt_plugins::location_graph_editor::objectposes
Definition: ObjectPoseClientWidget.h:60