Go to the documentation of this file.
39 #include <boost/functional/factory.hpp>
41 #include <moveit/task_constructor/properties.h>
47 namespace mtc = ::moveit::task_constructor;
55 if (!mtc_prop.
value().empty())
56 value = boost::any_cast<std::string>(mtc_prop.
value());
67 T
value = !mtc_prop.
value().empty() ? boost::any_cast<T>(mtc_prop.
value()) : T();
77 registerType<float>(&floatFactory<float>);
78 registerType<double>(&floatFactory<double>);
88 if (type_name.empty())
103 return it->second(QString::fromStdString(prop_name), prop, scene, display_context);
112 return it->second(stage.
properties(), scene, display_context);
124 for (
int i = 0, end =
root->numChildren(); i != end; ++i) {
125 if (
root->childAt(i)->getName() == name)
134 for (
auto& prop : properties) {
135 const QString&
name = QString::fromStdString(prop.first);
142 root->addChild(rviz_prop);
146 if (
root->numChildren() == 0)
152 const std::string& description,
const std::string& value,
157 old->
setValue(QString::fromStdString(value));
161 QString::fromStdString(description));
rviz::Property * create(const std::string &prop_name, moveit::task_constructor::Property &prop, const planning_scene::PlanningScene *scene, rviz::DisplayContext *display_context) const
create rviz::Property for given MTC Property
std::map< std::type_index, TreeFactoryFunction > stage_registry_
void addRemainingProperties(rviz::Property *root, moveit::task_constructor::PropertyMap &properties, const planning_scene::PlanningScene *scene, rviz::DisplayContext *display_context)
add all properties from map that are not yet in root
static PropertyFactory & instance()
std::string getNameStd() const
static rviz::StringProperty * stringFactory(const QString &name, mtc::Property &mtc_prop, const planning_scene::PlanningScene *, rviz::DisplayContext *)
PropertyMap & properties()
std::string serialize() const
PropertyFactory()
class is singleton
std::function< rviz::PropertyTreeModel *(moveit::task_constructor::PropertyMap &, const planning_scene::PlanningScene *, rviz::DisplayContext *)> TreeFactoryFunction
rviz::PropertyTreeModel * createPropertyTreeModel(moveit::task_constructor::Stage &stage, const planning_scene::PlanningScene *scene, rviz::DisplayContext *display_context)
create PropertyTreeModel for given Stage
rviz::PropertyTreeModel * defaultPropertyTreeModel(moveit::task_constructor::PropertyMap &properties, const planning_scene::PlanningScene *scene, rviz::DisplayContext *display_context)
turn a PropertyMap into an rviz::PropertyTreeModel
virtual float getFloat() const
virtual bool setValue(const QVariant &new_value)
std::string getStdString()
static bool hasChild(rviz::Property *root, const QString &name)
void setValue(const boost::any &value)
std::map< std::string, PropertyFactoryFunction > property_registry_
virtual void setDescription(const QString &description)
static rviz::FloatProperty * floatFactory(const QString &name, mtc::Property &mtc_prop, const planning_scene::PlanningScene *, rviz::DisplayContext *)
virtual void setReadOnly(bool read_only)
std::string typeName() const
void registerType(const PropertyFactoryFunction &f)
register a factory function for type T
const std::string & description() const
void registerStage(const TreeFactoryFunction &f)
register a factory function for stage T
static rviz::Property * createDefault(const std::string &name, const std::string &type, const std::string &description, const std::string &value, rviz::Property *old=nullptr)
create rviz::Property for property of given name, type, description, and value
visualization
Author(s): Robert Haschke
autogenerated on Sat May 3 2025 02:40:38