ArVizComponentPlugin.cpp
Go to the documentation of this file.
1 #include "ArVizComponentPlugin.h"
2 
4 
5 namespace armarx::plugins
6 {
7  static const std::string ARVIZ_TOPIC_PROPERTY_NAME = "ArVizTopicName";
8  static const std::string ARVIZ_TOPIC_PROPERTY_DEFAULT = "ArVizTopic";
9 
10  static const std::string ARVIZ_STORAGE_PROPERTY_NAME = "ArVizStorageName";
11  static const std::string ARVIZ_STORAGE_PROPERTY_DEFAULT = "ArVizStorage";
12 
13  std::string
15  {
16  return parentDerives<Component>() ? parent<Component>().getProperty<std::string>(
17  makePropertyName(ARVIZ_TOPIC_PROPERTY_NAME))
18  : ARVIZ_TOPIC_PROPERTY_DEFAULT;
19  }
20 
21  std::string
23  {
24  return parentDerives<Component>() ? parent<Component>().getProperty<std::string>(
25  makePropertyName(ARVIZ_STORAGE_PROPERTY_NAME))
26  : ARVIZ_STORAGE_PROPERTY_DEFAULT;
27  }
28 
29  void
31  {
34  }
35 
36  void
38  {
39  if (parentDerives<ArVizComponentPluginUser>())
40  {
41  parent<ArVizComponentPluginUser>().arviz = createClient();
42  }
43  }
44 
45  void
47  {
48  if (!properties->hasDefinition(makePropertyName(ARVIZ_TOPIC_PROPERTY_NAME)))
49  {
50  properties->defineOptionalProperty<std::string>(
51  makePropertyName(ARVIZ_TOPIC_PROPERTY_NAME),
52  ARVIZ_TOPIC_PROPERTY_DEFAULT,
53  "Name of the ArViz topic");
54  }
55  if (!properties->hasDefinition(makePropertyName(ARVIZ_STORAGE_PROPERTY_NAME)))
56  {
57  properties->defineOptionalProperty<std::string>(
58  makePropertyName(ARVIZ_STORAGE_PROPERTY_NAME),
59  ARVIZ_STORAGE_PROPERTY_DEFAULT,
60  "Name of the ArViz storage");
61  }
62  }
63 
66  {
68  }
69 } // namespace armarx::plugins
70 
71 namespace armarx
72 {
74  {
75  addPlugin(plugin);
76  }
77 
80  {
81  return plugin->createClient();
82  }
83 } // namespace armarx
armarx::plugins::ArVizComponentPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: ArVizComponentPlugin.cpp:46
ArVizComponentPlugin.h
armarx::plugins::ArVizComponentPlugin::preOnInitComponent
void preOnInitComponent() override
Definition: ArVizComponentPlugin.cpp:30
armarx::ManagedIceObjectPlugin::parent
ManagedIceObject & parent()
Definition: ManagedIceObjectPlugin.cpp:69
armarx::ManagedIceObject::addPlugin
PluginT * addPlugin(const std::string prefix="", ParamsT &&...params)
Definition: ManagedIceObject.h:182
armarx::ArVizComponentPluginUser::ArVizComponentPluginUser
ArVizComponentPluginUser()
Definition: ArVizComponentPlugin.cpp:73
armarx::plugins::ArVizComponentPlugin::getTopicName
std::string getTopicName()
Definition: ArVizComponentPlugin.cpp:14
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:28
armarx::plugins::ArVizComponentPlugin::getStorageName
std::string getStorageName()
Definition: ArVizComponentPlugin.cpp:22
armarx::plugins::ArVizComponentPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition: ArVizComponentPlugin.cpp:37
Component.h
armarx::plugins::ArVizComponentPlugin::createClient
armarx::viz::Client createClient()
Definition: ArVizComponentPlugin.cpp:65
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition: ManagedIceObject.cpp:290
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::ManagedIceObjectPlugin::makePropertyName
std::string makePropertyName(const std::string &name)
Definition: ManagedIceObjectPlugin.cpp:53
armarx::viz::Client
Definition: Client.h:109
armarx::ArVizComponentPluginUser::createArVizClient
armarx::viz::Client createArVizClient()
Definition: ArVizComponentPlugin.cpp:79
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28