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 } // namespace armarx::plugins
84 
86 
87 namespace armarx
88 {
90  {
91  public:
93 
94  private:
95  DebugDrawerHelperComponentPlugin* _debugDrawerHelperComponentPlugin{nullptr};
96 
97  public:
99 
102 
105 
107 
108  //other
109  public:
110  std::unique_lock<std::recursive_mutex> getDebugDrawerHelperLock() const;
111  std::string getDebugDrawerLayerName() const;
112 
114 
116  bool synchronizeDebugDrawerHelperRobot(Ice::Long timestamp) const;
117  bool synchronizeDebugDrawerHelperRobot(const RobotStateConfig& state) const;
118  };
119 } // namespace armarx
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerHelperLock
std::unique_lock< std::recursive_mutex > getDebugDrawerHelperLock() const
Definition: DebugDrawerHelperComponentPlugin.cpp:234
RobotStateComponentPlugin.h
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerLayerName
std::string getDebugDrawerLayerName() const
Definition: DebugDrawerHelperComponentPlugin.cpp:70
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerTopic
const DebugDrawerInterfacePrx & getDebugDrawerTopic() const
Definition: DebugDrawerHelperComponentPlugin.cpp:56
armarx::plugins::DebugDrawerHelperComponentPlugin::setClearLayersOnDisconnect
void setClearLayersOnDisconnect(bool b)
Definition: DebugDrawerHelperComponentPlugin.cpp:183
armarx::plugins::DebugDrawerHelperComponentPlugin::DebugDrawerHelperComponentPlugin
DebugDrawerHelperComponentPlugin(ManagedIceObject &parent, std::string pre)
Definition: DebugDrawerHelperComponentPlugin.cpp:30
armarx::ManagedIceObjectPlugin::parent
ManagedIceObject & parent()
Definition: ManagedIceObjectPlugin.cpp:72
armarx::plugins::DebugDrawerHelperComponentPlugin::preOnInitComponent
void preOnInitComponent() override
Definition: DebugDrawerHelperComponentPlugin.cpp:81
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerLayerName
std::string getDebugDrawerLayerName() const
Definition: DebugDrawerHelperComponentPlugin.cpp:241
armarx::plugins::DebugDrawerHelperComponentPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition: DebugDrawerHelperComponentPlugin.cpp:91
armarx::DebugDrawerHelperComponentPluginUser::synchronizeDebugDrawerHelperRobot
bool synchronizeDebugDrawerHelperRobot() const
Definition: DebugDrawerHelperComponentPlugin.cpp:255
armarx::DebugDrawerHelperComponentPluginUser::DebugDrawerHelperComponentPluginUser
DebugDrawerHelperComponentPluginUser()
Definition: DebugDrawerHelperComponentPlugin.cpp:192
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerHelperRobot
VirtualRobot::RobotPtr getDebugDrawerHelperRobot() const
Definition: DebugDrawerHelperComponentPlugin.cpp:146
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerHelper
const DebugDrawerHelper & getDebugDrawerHelper() const
Definition: DebugDrawerHelperComponentPlugin.cpp:213
ManagedIceObject.h
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:27
armarx::ComponentPlugin
Definition: ComponentPlugin.h:37
armarx::plugins::DebugDrawerHelperComponentPlugin::synchronizeDebugDrawerHelperRobot
bool synchronizeDebugDrawerHelperRobot() const
Definition: DebugDrawerHelperComponentPlugin.cpp:153
armarx::plugins::DebugDrawerHelperComponentPlugin::postOnDisconnectComponent
void postOnDisconnectComponent() override
Definition: DebugDrawerHelperComponentPlugin.cpp:115
armarx::VariantType::Long
const VariantTypeId Long
Definition: Variant.h:918
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerHelperPlugin
const DebugDrawerHelperComponentPlugin & getDebugDrawerHelperPlugin() const
Definition: DebugDrawerHelperComponentPlugin.cpp:199
armarx::DebugDrawerHelperComponentPluginUser::DebugDrawerHelperComponentPlugin
armarx::plugins::DebugDrawerHelperComponentPlugin DebugDrawerHelperComponentPlugin
Definition: DebugDrawerHelperComponentPlugin.h:92
armarx::DebugDrawerHelper
The DebugDrawerHelper class provides draw functions in a given frame (static matrix or robot node) an...
Definition: DebugDrawerHelper.h:180
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:162
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:51
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerTopic
const DebugDrawerInterfacePrx & getDebugDrawerTopic() const
Definition: DebugDrawerHelperComponentPlugin.cpp:227
ComponentPlugin.h
armarx::plugins::DebugDrawerHelperComponentPlugin::getDebugDrawerHelperLock
std::unique_lock< std::recursive_mutex > getDebugDrawerHelperLock() const
Definition: DebugDrawerHelperComponentPlugin.cpp:63
DebugDrawerHelper.h
armarx::DebugDrawerHelperComponentPluginUser
Definition: DebugDrawerHelperComponentPlugin.h:89
armarx::plugins::DebugDrawerHelperComponentPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: DebugDrawerHelperComponentPlugin.cpp:134
armarx::DebugDrawerHelperComponentPluginUser::getDebugDrawerHelperRobot
VirtualRobot::RobotPtr getDebugDrawerHelperRobot() const
Definition: DebugDrawerHelperComponentPlugin.cpp:248
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19