DebugDrawerHelperComponentPlugin.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  * @package RobotAPI::ArmarXObjects::RobotAPIComponentPlugins
17  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18  * @date 2019
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
26 
28 
30 
31 namespace armarx::plugins
32 {
33  /**
34  * @class DebugDrawerHelperComponentPlugin
35  * @ingroup Library-RobotAPIComponentPlugins
36  * @brief Brief description of class RobotAPIComponentPlugins.
37  *
38  * Detailed description of class RobotAPIComponentPlugins.
39  */
41  {
42  public:
44  using ComponentPlugin::ComponentPlugin;
45 
46  //helper
47  public:
50 
52 
53  //other
54  public:
55  std::unique_lock<std::recursive_mutex> getDebugDrawerHelperLock() const;
56  std::string getDebugDrawerLayerName() const;
57 
59 
61  bool synchronizeDebugDrawerHelperRobot(Ice::Long timestamp) const;
62  bool synchronizeDebugDrawerHelperRobot(const RobotStateConfig& state) const;
63 
64  void setClearLayersOnDisconnect(bool b);
65  //hooks
66  protected:
67  void preOnInitComponent() override;
68  void preOnConnectComponent() override;
69  void postOnDisconnectComponent() override;
70  void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
71 
72  //data
73  private:
75  static constexpr auto _propertyName = "DebugDrawerTopicName";
76  std::string _pre;
77  mutable std::recursive_mutex _debugDrawerHelperMutex;
78  std::unique_ptr<DebugDrawerHelper> _debugDrawerHelper;
79  DebugDrawerInterfacePrx _debugDrawerTopic;
80  RobotStateComponentPlugin* _robotStateComponentPlugin{nullptr};
81  bool _doNotClearLayersOnDisconnect = false;
82  };
83 }
84 
85 
87 
88 namespace armarx
89 {
91  {
92  public:
94  private:
95  DebugDrawerHelperComponentPlugin* _debugDrawerHelperComponentPlugin{nullptr};
96  public:
98 
101 
104 
106 
107  //other
108  public:
109  std::unique_lock<std::recursive_mutex> getDebugDrawerHelperLock() const;
110  std::string getDebugDrawerLayerName() const;
111 
113 
115  bool synchronizeDebugDrawerHelperRobot(Ice::Long timestamp) const;
116  bool synchronizeDebugDrawerHelperRobot(const RobotStateConfig& state) const;
117  };
118 }
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerHelperLock
std::unique_lock< std::recursive_mutex > getDebugDrawerHelperLock() const
Definition: DebugDrawerHelperComponentPlugin.cpp:214
RobotStateComponentPlugin.h
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerLayerName
std::string getDebugDrawerLayerName() const
Definition: DebugDrawerHelperComponentPlugin.cpp:66
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerTopic
const DebugDrawerInterfacePrx & getDebugDrawerTopic() const
Definition: DebugDrawerHelperComponentPlugin.cpp:54
armarx::plugins::DebugDrawerHelperComponentPlugin::setClearLayersOnDisconnect
void setClearLayersOnDisconnect(bool b)
Definition: DebugDrawerHelperComponentPlugin.cpp:169
armarx::plugins::DebugDrawerHelperComponentPlugin::DebugDrawerHelperComponentPlugin
DebugDrawerHelperComponentPlugin(ManagedIceObject &parent, std::string pre)
Definition: DebugDrawerHelperComponentPlugin.cpp:31
armarx::ManagedIceObjectPlugin::parent
ManagedIceObject & parent()
Definition: ManagedIceObjectPlugin.cpp:69
armarx::plugins::DebugDrawerHelperComponentPlugin::preOnInitComponent
void preOnInitComponent() override
Definition: DebugDrawerHelperComponentPlugin.cpp:76
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerLayerName
std::string getDebugDrawerLayerName() const
Definition: DebugDrawerHelperComponentPlugin.cpp:219
armarx::plugins::DebugDrawerHelperComponentPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition: DebugDrawerHelperComponentPlugin.cpp:85
armarx::DebugDrawerHelperComponentPluginUser::synchronizeDebugDrawerHelperRobot
bool synchronizeDebugDrawerHelperRobot() const
Definition: DebugDrawerHelperComponentPlugin.cpp:231
armarx::DebugDrawerHelperComponentPluginUser::DebugDrawerHelperComponentPluginUser
DebugDrawerHelperComponentPluginUser()
Definition: DebugDrawerHelperComponentPlugin.cpp:178
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerHelperRobot
VirtualRobot::RobotPtr getDebugDrawerHelperRobot() const
Definition: DebugDrawerHelperComponentPlugin.cpp:139
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerHelper
const DebugDrawerHelper & getDebugDrawerHelper() const
Definition: DebugDrawerHelperComponentPlugin.cpp:196
ManagedIceObject.h
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:28
armarx::ComponentPlugin
Definition: ComponentPlugin.h:38
armarx::plugins::DebugDrawerHelperComponentPlugin::synchronizeDebugDrawerHelperRobot
bool synchronizeDebugDrawerHelperRobot() const
Definition: DebugDrawerHelperComponentPlugin.cpp:145
armarx::plugins::DebugDrawerHelperComponentPlugin::postOnDisconnectComponent
void postOnDisconnectComponent() override
Definition: DebugDrawerHelperComponentPlugin.cpp:111
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:917
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerHelperPlugin
const DebugDrawerHelperComponentPlugin & getDebugDrawerHelperPlugin() const
Definition: DebugDrawerHelperComponentPlugin.cpp:184
armarx::DebugDrawerHelperComponentPluginUser::DebugDrawerHelperComponentPlugin
armarx::plugins::DebugDrawerHelperComponentPlugin DebugDrawerHelperComponentPlugin
Definition: DebugDrawerHelperComponentPlugin.h:93
armarx::DebugDrawerHelper
The DebugDrawerHelper class provides draw functions in a given frame (static matrix or robot node) an...
Definition: DebugDrawerHelper.h:124
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerHelper
const DebugDrawerHelper & getDebugDrawerHelper() const
Definition: DebugDrawerHelperComponentPlugin.cpp:40
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:163
armarx::plugins::DebugDrawerHelperComponentPlugin
Brief description of class RobotAPIComponentPlugins.
Definition: DebugDrawerHelperComponentPlugin.h:40
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::plugins::RobotStateComponentPlugin
Brief description of class RobotAPIComponentPlugins.
Definition: RobotStateComponentPlugin.h:52
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerTopic
const DebugDrawerInterfacePrx & getDebugDrawerTopic() const
Definition: DebugDrawerHelperComponentPlugin.cpp:208
ComponentPlugin.h
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerHelperLock
std::unique_lock< std::recursive_mutex > getDebugDrawerHelperLock() const
Definition: DebugDrawerHelperComponentPlugin.cpp:60
DebugDrawerHelper.h
armarx::DebugDrawerHelperComponentPluginUser
Definition: DebugDrawerHelperComponentPlugin.h:90
armarx::plugins::DebugDrawerHelperComponentPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: DebugDrawerHelperComponentPlugin.cpp:127
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerHelperRobot
VirtualRobot::RobotPtr getDebugDrawerHelperRobot() const
Definition: DebugDrawerHelperComponentPlugin.cpp:225
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18